diff --git a/README.md b/README.md index f488a4fe..8cbda003 100644 --- a/README.md +++ b/README.md @@ -82,14 +82,14 @@ I generate `.sops.yaml` from `.sops.nix`: ```nix let wim = "somekey"; - oksys = "somekey2"; + binto = "somekey2"; in { creation_rules = [ { path_regex = "secrets/[^/]+\\.(yaml|json|env|ini)$"; key_groups = [ { - age = [wim oksys]; + age = [wim binto]; } ]; } diff --git a/devices/README.md b/devices/README.md index 2c4ce6ba..b7986c82 100644 --- a/devices/README.md +++ b/devices/README.md @@ -11,7 +11,6 @@ This directory encompasses every device's main configuration file. | `binto` | My desktop PC with a multi-monitor setup and an NVIDIA (cringe) 3070 | | `cluster` | Two Lenovo mini PCs that make use of [NixOS-pcsd](https://github.com/matt1432/nixos-pcsd) to form a cluster | | `nos` | My custom built NAS | -| `oksys` | A very old Acer laptop that went from sailing the seas for years to becoming my web server and VPN host. It is now retired indefinitely. | | `servivi` | A gaming PC in a previous life, it is now used as a build farm and hosts game servers | | `wim` | My 2-1 Lenovo Laptop that I use for uni | diff --git a/devices/bbsteamie/default.nix b/devices/bbsteamie/default.nix index 6a22b4e9..90a027dd 100644 --- a/devices/bbsteamie/default.nix +++ b/devices/bbsteamie/default.nix @@ -1,34 +1,37 @@ { config, - jovian, self, ... }: let inherit (config.vars) mainUser hostName; in { + # ------------------------------------------------ + # Imports + # ------------------------------------------------ imports = [ - jovian.nixosModules.default + ./hardware-configuration.nix + ../../modules/kmscon.nix ../../modules/sshd.nix - ./hardware-configuration.nix - ./modules/desktop.nix self.nixosModules.plymouth ]; + # State Version: DO NOT CHANGE + system.stateVersion = "24.11"; + home-manager.users.${mainUser}.home.stateVersion = "24.11"; + + # ------------------------------------------------ + # User Settings + # ------------------------------------------------ vars = { mainUser = "mariah"; hostName = "bbsteamie"; promptMainColor = "pink"; }; - boot.plymouth = { - enable = true; - theme = "steamos"; - }; - users.users.${mainUser} = { isNormalUser = true; extraGroups = [ @@ -42,16 +45,13 @@ in { networkmanager.enable = true; }; - home-manager.users.${mainUser} = { - imports = []; - - # No touchy - home.stateVersion = "24.11"; - }; - - # Set your time zone. time.timeZone = "America/Montreal"; - # No touchy - system.stateVersion = "24.11"; + # ------------------------------------------------ + # `Self` Modules configuration + # ------------------------------------------------ + boot.plymouth = { + enable = true; + theme = "steamos"; + }; } diff --git a/devices/bbsteamie/hardware-configuration.nix b/devices/bbsteamie/hardware-configuration.nix index 57c40dcb..2c76ecfb 100644 --- a/devices/bbsteamie/hardware-configuration.nix +++ b/devices/bbsteamie/hardware-configuration.nix @@ -1,11 +1,15 @@ { config, + jovian, lib, modulesPath, ... }: { nixpkgs.hostPlatform = "x86_64-linux"; - imports = [(modulesPath + "/installer/scan/not-detected.nix")]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + jovian.nixosModules.default + ]; jovian = { steamos.useSteamOSConfig = true; diff --git a/devices/binto/default.nix b/devices/binto/default.nix index 31085b59..9f09a48e 100644 --- a/devices/binto/default.nix +++ b/devices/binto/default.nix @@ -5,6 +5,9 @@ }: let inherit (config.vars) mainUser hostName; in { + # ------------------------------------------------ + # Imports + # ------------------------------------------------ imports = [ ./hardware-configuration.nix @@ -23,26 +26,26 @@ in { self.nixosModules.desktop ]; + home-manager.users.${mainUser} = { + imports = [ + ../../home/firefox + ]; + + # State Version: DO NOT CHANGE + home.stateVersion = "23.11"; + }; + # State Version: DO NOT CHANGE + system.stateVersion = "23.11"; + + # ------------------------------------------------ + # User Settings + # ------------------------------------------------ vars = { mainUser = "matt"; hostName = "binto"; promptMainColor = "purple"; }; - roles.desktop = { - user = config.vars.mainUser; - - mainMonitor = "desc:GIGA-BYTE TECHNOLOGY CO. LTD. G27QC 0x00000B1D"; - displayManager.duplicateScreen = false; - - fontSize = 12.5; - }; - - programs.adb = { - enable = true; - user = mainUser; - }; - users.users.${mainUser} = { isNormalUser = true; extraGroups = [ @@ -54,14 +57,6 @@ in { "libvirtd" ]; }; - home-manager.users.${mainUser} = { - imports = [ - ../../home/firefox - ]; - - # No touchy - home.stateVersion = "23.11"; - }; networking = { inherit hostName; @@ -69,9 +64,22 @@ in { firewall.enable = false; }; - # Set your time zone. time.timeZone = "America/Montreal"; - # No touchy - system.stateVersion = "23.11"; + # ------------------------------------------------ + # `Self` Modules configuration + # ------------------------------------------------ + roles.desktop = { + user = mainUser; + + mainMonitor = "desc:GIGA-BYTE TECHNOLOGY CO. LTD. G27QC 0x00000B1D"; + displayManager.duplicateScreen = false; + + fontSize = 12.5; + }; + + programs.adb = { + enable = true; + user = mainUser; + }; } diff --git a/devices/cluster/default.nix b/devices/cluster/default.nix index d947f327..ef2c5fec 100644 --- a/devices/cluster/default.nix +++ b/devices/cluster/default.nix @@ -3,6 +3,9 @@ deviceName: {config, ...}: let clusterIP = config.services.pcsd.virtualIps.caddy-vip.ip; in { + # ------------------------------------------------ + # Imports + # ------------------------------------------------ imports = [ ./hardware-configuration.nix @@ -13,6 +16,13 @@ in { ./modules/pcsd.nix ]; + # State Version: DO NOT CHANGE + system.stateVersion = "24.05"; + home-manager.users.${mainUser}.home.stateVersion = "24.05"; + + # ------------------------------------------------ + # User Settings + # ------------------------------------------------ vars = { mainUser = "matt"; hostName = deviceName; @@ -32,13 +42,6 @@ in { ]; }; - home-manager.users.${mainUser} = { - imports = []; - - # No touchy - home.stateVersion = "24.05"; - }; - networking = { inherit hostName; resolvconf.enable = true; @@ -53,9 +56,5 @@ in { firewall.enable = false; }; - # Set your time zone. time.timeZone = "America/Montreal"; - - # No touchy - system.stateVersion = "24.05"; } diff --git a/devices/nos/default.nix b/devices/nos/default.nix index 0280e145..1e67e033 100644 --- a/devices/nos/default.nix +++ b/devices/nos/default.nix @@ -1,6 +1,9 @@ {config, ...}: let inherit (config.vars) mainUser hostName; in { + # ------------------------------------------------ + # Imports + # ------------------------------------------------ imports = [ ./hardware-configuration.nix @@ -16,6 +19,13 @@ in { ./modules/subtitles ]; + # State Version: DO NOT CHANGE + system.stateVersion = "24.05"; + home-manager.users.${mainUser}.home.stateVersion = "24.05"; + + # ------------------------------------------------ + # User Settings + # ------------------------------------------------ vars = { mainUser = "matt"; hostName = "nos"; @@ -31,22 +41,11 @@ in { ]; }; - home-manager.users.${mainUser} = { - imports = []; - - # No touchy - home.stateVersion = "24.05"; - }; - networking = { inherit hostName; resolvconf.enable = true; firewall.enable = false; }; - # Set your time zone. time.timeZone = "America/Montreal"; - - # No touchy - system.stateVersion = "24.05"; } diff --git a/devices/oksys/default.nix b/devices/oksys/default.nix deleted file mode 100644 index d446520c..00000000 --- a/devices/oksys/default.nix +++ /dev/null @@ -1,45 +0,0 @@ -# Not currently operational -{config, ...}: let - inherit (config.vars) mainUser hostName; -in { - imports = [ - ./hardware-configuration.nix - - ../../modules/sshd.nix - ../../modules/tailscale.nix - - ./modules/remote-builder.nix - ]; - - vars = { - mainUser = "matt"; - hostName = "oksys"; - neovimIde = false; - }; - - users.users.${mainUser} = { - isNormalUser = true; - extraGroups = [ - "wheel" - "adm" - ]; - }; - home-manager.users.${mainUser} = { - imports = []; - - # No touchy - home.stateVersion = "24.05"; - }; - - networking = { - inherit hostName; - resolvconf.enable = true; - firewall.enable = false; - }; - - # Set your time zone. - time.timeZone = "America/Montreal"; - - # No touchy - system.stateVersion = "24.05"; -} diff --git a/devices/oksys/hardware-configuration.nix b/devices/oksys/hardware-configuration.nix deleted file mode 100644 index 92d45683..00000000 --- a/devices/oksys/hardware-configuration.nix +++ /dev/null @@ -1,55 +0,0 @@ -{ - config, - modulesPath, - ... -}: { - nixpkgs.hostPlatform = "x86_64-linux"; - imports = [(modulesPath + "/installer/scan/not-detected.nix")]; - - services.logind = { - lidSwitchDocked = "ignore"; - lidSwitchExternalPower = "ignore"; - }; - - boot = { - loader = { - timeout = 2; - - grub = { - enable = true; - device = "/dev/sda"; - }; - }; - initrd.availableKernelModules = [ - "uhci_hcd" - "ehci_pci" - "ahci" - "usbhid" - "usb_storage" - "sd_mod" - ]; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-label/NIXROOT"; - fsType = "ext4"; - }; - - "/boot" = { - device = "/dev/disk/by-label/NIXBOOT"; - fsType = "vfat"; - }; - }; - - swapDevices = [ - { - device = "/var/lib/swapfile"; - size = 16 * 1024; - } - ]; - - zramSwap.enable = true; - - hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware; -} diff --git a/devices/oksys/modules/remote-builder.nix b/devices/oksys/modules/remote-builder.nix deleted file mode 100644 index 776e61f7..00000000 --- a/devices/oksys/modules/remote-builder.nix +++ /dev/null @@ -1,42 +0,0 @@ -{config, ...}: let - servivi = "100.64.0.7"; -in { - # https://nixos.wiki/wiki/Distributed_build - home-manager.users.root = { - home.file.".ssh/config".text = - # ssh_config - '' - Host ${servivi} - # Prevent using ssh-agent or another keyfile, useful for testing - IdentitiesOnly yes - IdentityFile ${config.sops.secrets.nixremote.path} - - # The weakly privileged user on the remote builder – if not set, - # 'root' is used – which will hopefully fail - User nixremote - ''; - }; - - programs.ssh.knownHosts = { - ${servivi}.publicKey = "servivi ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMkNW0H4Fl6NFgahlgGbSvglg1DrX4yl1ht9Lp+vHE2A"; - }; - - nix = { - buildMachines = [ - { - hostName = servivi; - system = "x86_64-linux"; - protocol = "ssh-ng"; - maxJobs = 1; - speedFactor = 2; - supportedFeatures = ["nixos-test" "benchmark" "big-parallel" "kvm"]; - mandatoryFeatures = []; - } - ]; - distributedBuilds = true; - # optional, useful when the builder has a faster internet connection than yours - extraOptions = '' - builders-use-substitutes = true - ''; - }; -} diff --git a/devices/servivi/default.nix b/devices/servivi/default.nix index f0bce05c..5ba81e80 100644 --- a/devices/servivi/default.nix +++ b/devices/servivi/default.nix @@ -1,10 +1,12 @@ {config, ...}: let inherit (config.vars) mainUser hostName; in { + # ------------------------------------------------ + # Imports + # ------------------------------------------------ imports = [ ./hardware-configuration.nix - ../../modules/arion ../../modules/kmscon.nix ../../modules/sshd.nix ../../modules/tailscale.nix @@ -15,6 +17,13 @@ in { ./modules/nfs.nix ]; + # State Version: DO NOT CHANGE + system.stateVersion = "24.05"; + home-manager.users.${mainUser}.home.stateVersion = "24.05"; + + # ------------------------------------------------ + # User Settings + # ------------------------------------------------ vars = { mainUser = "matt"; hostName = "servivi"; @@ -43,24 +52,16 @@ in { }; }; - home-manager.users.${mainUser} = { - imports = []; - - # No touchy - home.stateVersion = "24.05"; - }; - - arion.enable = true; - networking = { inherit hostName; resolvconf.enable = true; firewall.enable = false; }; - # Set your time zone. time.timeZone = "America/Montreal"; - # No touchy - system.stateVersion = "24.05"; + # ------------------------------------------------ + # `Self` Modules configuration + # ------------------------------------------------ + arion.enable = true; } diff --git a/devices/wim/default.nix b/devices/wim/default.nix index b765d24c..4d964d9d 100644 --- a/devices/wim/default.nix +++ b/devices/wim/default.nix @@ -5,6 +5,9 @@ }: let inherit (config.vars) mainUser hostName; in { + # ------------------------------------------------ + # Imports + # ------------------------------------------------ imports = [ ./hardware-configuration.nix @@ -21,14 +24,54 @@ in { self.nixosModules.plymouth ]; + home-manager.users.${mainUser} = { + imports = [ + ../../home/firefox + ]; + + # State Version: DO NOT CHANGE + home.stateVersion = "23.05"; + }; + # State Version: DO NOT CHANGE + system.stateVersion = "23.05"; + + # ------------------------------------------------ + # User Settings + # ------------------------------------------------ vars = { mainUser = "matt"; hostName = "wim"; promptMainColor = "purple"; }; + users.users.${mainUser} = { + isNormalUser = true; + extraGroups = [ + "wheel" + "input" + "uinput" + "adm" + "video" + "libvirtd" + ]; + }; + + networking = { + inherit hostName; + networkmanager = { + enable = true; + wifi.backend = "wpa_supplicant"; + }; + firewall.enable = false; + }; + + time.timeZone = "America/Montreal"; + + # ------------------------------------------------ + # `Self` Modules configuration + # ------------------------------------------------ roles.desktop = { - user = config.vars.mainUser; + user = mainUser; mainMonitor = "eDP-1"; isLaptop = true; @@ -46,39 +89,4 @@ in { enable = true; theme = "dracula"; }; - - users.users.${mainUser} = { - isNormalUser = true; - extraGroups = [ - "wheel" - "input" - "uinput" - "adm" - "video" - "libvirtd" - ]; - }; - home-manager.users.${mainUser} = { - imports = [ - ../../home/firefox - ]; - - # No touchy - home.stateVersion = "23.05"; - }; - - networking = { - inherit hostName; - networkmanager = { - enable = true; - wifi.backend = "wpa_supplicant"; - }; - firewall.enable = false; - }; - - # Set your time zone. - time.timeZone = "America/Montreal"; - - # No touchy - system.stateVersion = "23.05"; } diff --git a/flake.in.nix b/flake.in.nix index 1cb2844b..3af67537 100644 --- a/flake.in.nix +++ b/flake.in.nix @@ -42,9 +42,9 @@ mainInputs // otherInputs; outputs = inputs @ { - self, nixpkgs, secrets, + self, ... }: let inherit (import ./lib.nix inputs) mkVersion mkNixOS mkNixOnDroid mkPkgs;