de-lacadie #3

Merged
vorboyvo merged 4 commits from de-lacadie into main 2024-07-11 12:18:35 -04:00
5 changed files with 492 additions and 2 deletions

View file

@ -23,7 +23,7 @@
outputs = { self, nixpkgs, home-manager }:
let
system = "x86_64-linux";
hostname = "randolph";
hostname = "de-lacadie";
in {
nixosConfigurations = {
${hostname} = nixpkgs.lib.nixosSystem {

View file

@ -0,0 +1,190 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
# This is the minimum config file with which I am installing NixOS before switching to
{ config, lib, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nixpkgs.config.allowUnfree = true;
################################################
# SECTION 1: BASIC SYSTEM SOFTWARE CONFIGURATION
################################################
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# Enable flakes.
nix = { settings.experimental-features = [ "nix-command" "flakes" ]; };
networking.hostName = "de-lacadie"; # Define your hostname.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
# Set your time zone.
time.timeZone = "America/Montreal";
# Select internationalization properties.
i18n.defaultLocale = "fr_CA.UTF-8";
console = {
font = "Lat2-Terminus16";
keyMap = "us";
# useXkbConfig = true; # use xkb.options in tty.
};
# Home manager: make user home-manager configs use system nixpkgs
home-manager.useGlobalPkgs = true;
###################################
# SECTION 2: HARDWARE CONFIGURATION
###################################
# Set login and power management options
services.logind.powerKey = "ignore"; # handle this WM side
services.logind.powerKeyLongPress = "poweroff";
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable udisks (handles storage devices, e.g. usb flash drives)
services.udisks2.enable = true;
# Enable sound.
security.rtkit.enable = true; # needed for pipewire
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Enable Bluetooth.
hardware.bluetooth.enable = true;
# Enable nvidia drivers and graphics.
hardware.opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Disable (experimental) power management; enable if graphical corruption on wake
powerManagement.enable = false;
powerManagement.finegrained = false;
# Disable open kernel module (alpha-quality)
open = false;
# Enable nvidia-settings
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.stable;
};
###################################################
# SECTION 3: USERSPACE CONFIG AND OPTIONAL SOFTWARE
###################################################
# Define a user account. Don't forget to set a password with passwd.
users.users.alice = {
isNormalUser = true;
home = "/home/alice";
extraGroups = [ "wheel" "networkmanager" ]; # Enable sudo for the user.
initialPassword = "manysuchcases";
shell = pkgs.zsh;
};
home-manager.users.alice = import ./home.nix;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
ntfs3g
kakoune
git
gay # very important, do not remove
];
# TODO Steam goes here
# Enable x server
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
# Enable dconf; necessary for some programs
programs.dconf.enable = true;
# Enable gvfs; handles trash
services.gvfs.enable = true;
# Enable tailscale
services.tailscale.enable = true;
# Enable adb
programs.adb.enable = true;
# Enable zsh; necessary to switch
programs.zsh.enable = true;
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
# Copy the NixOS configuration file and link it from the resulting system
# (/run/current-system/configuration.nix). This is useful in case you
# accidentally delete configuration.nix.
# system.copySystemConfiguration = true;
# This option defines the first version of NixOS you have installed on this particular machine,
# and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions.
#
# Most users should NEVER change this value after the initial install, for any reason,
# even if you've upgraded your system to a new NixOS release.
#
# This value does NOT affect the Nixpkgs version your packages and OS are pulled from,
# so changing it will NOT upgrade your system - see https://nixos.org/manual/nixos/stable/#sec-upgrading for how
# to actually do that.
#
# This value being lower than the current NixOS release does NOT mean your system is
# out of date, out of support, or vulnerable.
#
# Do NOT change this value unless you have manually inspected all the changes it would make to your configuration,
# and migrated your data accordingly.
#
# For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion .
system.stateVersion = "24.05"; # Did you read the comment?
}

View file

@ -0,0 +1,39 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/4cf4f9ec-b943-4329-ab3d-71f6f568bc8f";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/41A9-890A";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

261
hosts/de-lacadie/home.nix Normal file
View file

@ -0,0 +1,261 @@
{ config, lib, pkgs, ... }:
let
scripts = ../../scripts;
extra = ../../extra;
terminal = pkgs.alacritty;
in {
imports = [
../../programs/kdeconnect.nix
../../programs/ssh.nix
../../programs/zsh.nix
];
home.username = "alice";
home.homeDirectory = "/home/alice";
home.stateVersion = "24.05";
# Configure cursor
home.pointerCursor = {
package = pkgs.vanilla-dmz;
name = "Vanilla-DMZ";
size = 128;
};
# Configure icon theme
gtk = {
enable = true;
iconTheme = {
name = "Papirus";
package = pkgs.papirus-icon-theme;
};
};
# Configure internationalization
# i18n.inputMethod.enabled = "fcitx5";
# Configure xdg-desktop-portal (for file picker, etc.)
# xdg.portal = {
# enable = true;
# };
# # Configure gammastep (night shift)
# services.gammastep = {
# enable = true;
# temperature.day = 6500;
# temperature.night = 4000;
# # boul robert-bourassa/boul rené-lévesque : 45.498743909804354, -73.5703457606738
# latitude = 45.4987;
# longitude = -73.5703;
# # tray = true;
# };
# Install packages
home.packages = with pkgs;
let
xdg-terminal-exec =
callPackage ../../pkgs/xdg-terminal-exec/xdg-terminal-exec.nix { };
mons = callPackage ../../pkgs/mons/mons.nix { };
archivo = callPackage ../../pkgs/archivo/archivo.nix { };
highway-gothic = callPackage ../../pkgs/highway-gothic/highway-gothic.nix { };
in [ gcc tree-sitter ] ++ # Basic dev tools
[ marksman nil ] ++ # Language servers except those installed through package sections
[ texliveFull texlab ] ++ # LaTeX
(with ocamlPackages; [
ocaml
opam
dune_3
dune-release
merlin
ocaml-lsp
odoc
ocamlformat
utop
]) ++ # OCaml
[ rustup ] ++ # Rust
[ go gopls ] ++ # Golang
(with elmPackages; [ elm elm-language-server elm-format elm-test ]) ++
[ python3 ] ++ # I guess.....
[
kak-lsp
brightnessctl
grim
slurp
jq
xdg-terminal-exec
blueman
upower
] ++ # Basic utilities
[ bitwarden-cli htop snore hledger hledger-ui ]
++ # Personalized selection of command-line (CLI/TUI) apps
[ terminal ] ++ # Terminal emulator
[
imv
vlc
pavucontrol
] ++ # Basic graphical apps
[
libreoffice
signal-desktop
element-desktop
prismlauncher
mumble
gimp
inkscape
deluge-gtk
shotwell
lorien
keepassxc
zulip
filezilla
bitwarden
] ++ # Personalized selection of graphical apps
[ mons shticker-book-unwritten ] ++ # Games
[ bemenu j4-dmenu-desktop xclip xdotool ] ++ # i3 and x11 related packages
[
noto-fonts
redhat-official-fonts
overpass
ibm-plex
rubik
archivo
highway-gothic
font-awesome
] ++ # Fonts
# [ papirus-icon-theme ] ++ # Icons
# [ vanilla-dmz ] ++ # Cursor
[ ] ++ # Temp
[ ];
programs.home-manager.enable = true;
programs.git = {
enable = true;
userName = "vorboyvo";
userEmail = "mrsirofvibe@outlook.com";
extraConfig = {
init.defaultBranch = "main";
core.editor = "kak";
};
};
# wayland.windowManager.sway = import ../../programs/sway.nix {
# inherit scripts extra config lib pkgs terminal;
#};
#programs.waybar =
# import ../../programs/waybar.nix { inherit scripts config lib pkgs terminal; };
#programs.swaylock = {
# enable = true;
# settings = { font-size = 14; };
#};
#services.swayidle = {
# enable = true;
# events = [{
# event = "before-sleep";
# command = "${pkgs.lib.getExe pkgs.swaylock} -f";
# }];
#};
#
# xsession = let
# term = terminal;
# dmenuCommand = builtins.readFile "${scripts}/dmenu.sh";
# in {
# enable = true;
# windowManager.i3 = {
# enable = true;
# config = rec {
# terminal = "${pkgs.lib.getExe term}";
# modifier = "Mod4";
# fonts = {
# names = [ "Red Hat Display" ];
# style = "Regular";
# size = 12.0;
# };
# # input = {
# # "type:keyboard" = {
# # xkb_layout = "ca,ca";
# # xkb_variant = ",eng";
# # };
# # };
# # leaving bars out for now
# # bars = ...
# window = {
# border = 2;
# titlebar = true;
# };
# menu = "j4-dmenu-desktop --no-generic --term=${pkgs.lib.getExe term} --dmenu='${dmenuCommand}'";
# focus.followMouse = false;
# # keybindings and extraConfig go here
# };
# };
# };
# Fixes electron apps
# home.sessionVariables = { NIXOS_OZONE_WL = "1"; };
# configure fonts correctly
# fonts.fontconfig.enable = true;
# xdg.configFile."fontconfig/conf.d/5-default.fonts.conf".source =
# "${extra}/20-default-fonts.conf";
# terminal emulator
programs.alacritty.enable = true;
# programs.neovim = import ./programs/neovim.nix;
programs.kakoune = import ../../programs/kakoune.nix pkgs;
xdg.configFile."kak-lsp/kak-lsp.toml".source =
../../programs/kakoune/kak-lsp.toml;
xdg.desktopEntries.kakoune = {
name = "Kakoune";
genericName = "Text Editor";
comment = "Edit text files";
icon = "kak";
exec = "kak %F";
terminal = true;
mimeType = [
"text/english"
"text/plain"
"text/x-makefile"
"text/x-c++hdr"
"text/x-c++src"
"text/x-chdr"
"text/x-csrc"
"text/x-java"
"text/x-moc"
"text/x-pascal"
"text/x-tcl"
"text/x-tex"
"application/x-shellscript"
"text/x-c"
"text/x-c++"
];
categories = [ "Utility" "TextEditor" ];
};
# programs.zathura = {
# enable = true;
# };
programs.pandoc = { enable = true; };
# Configure notifications
# services.dunst = {
# enable = true;
# settings = {
# global = {
# font = "Red Hat Display 12";
# mouse_left_click = "do_action, close_current";
# mouse_middle_click = "close_all";
# mouse_right_click = "close_current";
# };
# };
# };
programs.firefox = import ../../programs/firefox.nix { inherit pkgs; };
programs.thunderbird = import ../../programs/thunderbird.nix;
}

View file

@ -10,7 +10,7 @@
profileExtra = ''
export QT_SCALE_FACTOR_ROUNDING_POLICY=RoundPreferFloor
# If running from tty1 start sway
[ "$(tty)" = "/dev/tty1" ] && exec sway
# [ "$(tty)" = "/dev/tty1" ] && exec sway
'';
defaultKeymap = "emacs";
};