From 9f2cacd5b144e052b976107fc3baa7786349aa9f Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Fri, 13 Sep 2024 10:58:25 -0400 Subject: [PATCH 01/36] Test this base config --- flake.nix | 24 ++++++++++++++++++++++++ hosts/remote/default.nix | 11 +++++++++++ 2 files changed, 35 insertions(+) create mode 100644 flake.nix create mode 100644 hosts/remote/default.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..edcd038 --- /dev/null +++ b/flake.nix @@ -0,0 +1,24 @@ +{ + description = "Entry point for NixOS"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + home-manager.url = "github:nix-community/home-manager"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = inputs: let + system = "x86_64-linux"; + inherit (inputs.nixpkgs) lib; + + pkgs = import inputs.nixpkgs { + inherit system; + config.allowUnfree = true; + }; + + ns = host: (lib.nixosSystem { + specialArgs = {inherit pkgs inputs;}; + modules = [(./hosts + "/${host}")]; + }); + in {nixosConfigurations = lib.attrsets.genAttrs ["remote"] ns;}; +} diff --git a/hosts/remote/default.nix b/hosts/remote/default.nix new file mode 100644 index 0000000..fe0dd8b --- /dev/null +++ b/hosts/remote/default.nix @@ -0,0 +1,11 @@ +{ + imports = [ + ./hardware-configuration.nix + ]; + networking.hostName = "nixos-remote"; + environment.systemPackages = [ + pkgs.git + pkgs.vim + pkgs.wget + ]; +} From 8762b45865f0f93de35ffbb966cc1bf81996520a Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Fri, 13 Sep 2024 11:01:41 -0400 Subject: [PATCH 02/36] Add shell.nix with some useful tools --- shell.nix | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..c961361 --- /dev/null +++ b/shell.nix @@ -0,0 +1,3 @@ +{ pkgs ? import {} }: pkgs.mkShell { + nativeBuildInputs = with pkgs.buildPackages; [ git vim ]; +} From 087e35f0f686c17085eb4c097631e68f48edb299 Mon Sep 17 00:00:00 2001 From: System administrator Date: Fri, 13 Sep 2024 15:37:26 +0000 Subject: [PATCH 03/36] Need to figure out boot.loader stuff --- flake.lock | 48 +++++++++++++++++++++++++ hosts/remote/default.nix | 15 +++++++- hosts/remote/hardware-configuration.nix | 29 +++++++++++++++ modules/default.nix | 5 +++ shell.nix | 7 ++-- 5 files changed, 101 insertions(+), 3 deletions(-) create mode 100644 flake.lock create mode 100644 hosts/remote/hardware-configuration.nix create mode 100644 modules/default.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..5762d62 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1726222338, + "narHash": "sha256-KuA8ciNR8qCF3dQaCaeh0JWyQUgEwkwDHr/f49Q5/e8=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "503af483e1b328691ea3a434d331995595fb2e3d", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1726062873, + "narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "home-manager": "home-manager", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/hosts/remote/default.nix b/hosts/remote/default.nix index fe0dd8b..8634862 100644 --- a/hosts/remote/default.nix +++ b/hosts/remote/default.nix @@ -1,6 +1,9 @@ -{ +{ pkgs, + ... +}:{ imports = [ ./hardware-configuration.nix + ../../modules ]; networking.hostName = "nixos-remote"; environment.systemPackages = [ @@ -8,4 +11,14 @@ pkgs.vim pkgs.wget ]; + + boot.loader.grub.device = "/dev/xvda"; + boot.loader.grub.efiSupport = true; + boot.loader.grub.efiInstallAsRemovable = true; + boot.loader.timeout = 1; + boot.loader.grub.extraConfig = '' + serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 + terminal_output console serial + terminal_input console serial + ''; } diff --git a/hosts/remote/hardware-configuration.nix b/hosts/remote/hardware-configuration.nix new file mode 100644 index 0000000..fcb587c --- /dev/null +++ b/hosts/remote/hardware-configuration.nix @@ -0,0 +1,29 @@ +# 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 = [ ]; + + boot.initrd.availableKernelModules = [ "nvme" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/f222513b-ded1-49fa-b591-20ce86a2fe7f"; + fsType = "ext4"; + }; + + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens5.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/modules/default.nix b/modules/default.nix new file mode 100644 index 0000000..92bac17 --- /dev/null +++ b/modules/default.nix @@ -0,0 +1,5 @@ +{ +imports = [ +./boot.nix +]; +} diff --git a/shell.nix b/shell.nix index c961361..9f27b92 100644 --- a/shell.nix +++ b/shell.nix @@ -1,3 +1,6 @@ -{ pkgs ? import {} }: pkgs.mkShell { - nativeBuildInputs = with pkgs.buildPackages; [ git vim ]; +{pkgs ? import {}, ...}: { + default = pkgs.mkShell { + NIX_CONFIG = "extra-experimental-features = nix-command flakes"; + nativeBuildInputs = with pkgs; [git neovim nix]; + }; } From 3af7fc9477ef479886c77abdd5ec74df7d6337d8 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Fri, 13 Sep 2024 17:07:00 -0400 Subject: [PATCH 04/36] Add vmware host --- hosts/vmware/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 hosts/vmware/default.nix diff --git a/hosts/vmware/default.nix b/hosts/vmware/default.nix new file mode 100644 index 0000000..3111356 --- /dev/null +++ b/hosts/vmware/default.nix @@ -0,0 +1,14 @@ +{ pkgs, + ... +}:{ + imports = [ + ./hardware-configuration.nix + ../../modules + ]; + networking.hostName = "nixos-vmware"; + environment.systemPackages = [ + pkgs.git + pkgs.vim + pkgs.wget + ]; +} From 17c2f4e7883fa5e9d5b591107123f1e086eddc9b Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Fri, 13 Sep 2024 17:08:01 -0400 Subject: [PATCH 05/36] Standardize hostname --- hosts/vmware/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/vmware/default.nix b/hosts/vmware/default.nix index 3111356..4a7991d 100644 --- a/hosts/vmware/default.nix +++ b/hosts/vmware/default.nix @@ -5,7 +5,7 @@ ./hardware-configuration.nix ../../modules ]; - networking.hostName = "nixos-vmware"; + networking.hostName = "vmware"; environment.systemPackages = [ pkgs.git pkgs.vim From d70d4dc701d07a00161e4a6612af25f3a167bd7d Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sat, 14 Sep 2024 11:43:46 +0000 Subject: [PATCH 06/36] Patch in boot for vmware host --- hosts/vmware/boot.nix | 7 +++++++ hosts/vmware/default.nix | 1 + modules/default.nix | 1 - 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 hosts/vmware/boot.nix diff --git a/hosts/vmware/boot.nix b/hosts/vmware/boot.nix new file mode 100644 index 0000000..78367ce --- /dev/null +++ b/hosts/vmware/boot.nix @@ -0,0 +1,7 @@ +{ + boot.loader.grub = { + enable = true; + device = "/dev/sda1"; + usOSProber = true; + } +} diff --git a/hosts/vmware/default.nix b/hosts/vmware/default.nix index 4a7991d..6112450 100644 --- a/hosts/vmware/default.nix +++ b/hosts/vmware/default.nix @@ -3,6 +3,7 @@ }:{ imports = [ ./hardware-configuration.nix + ./boot.nix ../../modules ]; networking.hostName = "vmware"; diff --git a/modules/default.nix b/modules/default.nix index 92bac17..b9b0839 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,5 +1,4 @@ { imports = [ -./boot.nix ]; } From ec1fbed4f45915769eeacaa1aa97240dc3a66dd9 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sat, 14 Sep 2024 11:49:48 +0000 Subject: [PATCH 07/36] Add vmware to config generation in flake --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index edcd038..a1e8127 100644 --- a/flake.nix +++ b/flake.nix @@ -20,5 +20,5 @@ specialArgs = {inherit pkgs inputs;}; modules = [(./hosts + "/${host}")]; }); - in {nixosConfigurations = lib.attrsets.genAttrs ["remote"] ns;}; + in {nixosConfigurations = lib.attrsets.genAttrs ["remote" "vmware"] ns;}; } From 8d69273bcd276e18c242974a0c4d0de74c851e1c Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sat, 14 Sep 2024 11:50:53 +0000 Subject: [PATCH 08/36] Add hardware configuration --- hosts/vmware/hardware-configuration.nix | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 hosts/vmware/hardware-configuration.nix diff --git a/hosts/vmware/hardware-configuration.nix b/hosts/vmware/hardware-configuration.nix new file mode 100644 index 0000000..f5f5f48 --- /dev/null +++ b/hosts/vmware/hardware-configuration.nix @@ -0,0 +1,61 @@ +# 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 = [ ]; + + boot.initrd.availableKernelModules = [ "ata_piix" "mptspi" "uhci_hcd" "ehci_pci" "ahci" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "tmpfs"; + fsType = "tmpfs"; + }; + + fileSystems."/iso" = + { device = "/dev/disk/by-uuid/1980-01-01-00-00-00-00"; + fsType = "iso9660"; + }; + + fileSystems."/nix/.ro-store" = + { device = "/iso/nix-store.squashfs"; + fsType = "squashfs"; + options = [ "loop" ]; + }; + + fileSystems."/nix/.rw-store" = + { device = "tmpfs"; + fsType = "tmpfs"; + }; + + fileSystems."/nix/store" = + { device = "overlay"; + fsType = "overlay"; + }; + + fileSystems."/mnt" = + { device = "/dev/disk/by-uuid/cc7fc1f5-77b0-4fd6-89c2-dde99d6247ca"; + fsType = "ext4"; + }; + + fileSystems."/mnt/boot" = + { device = "/dev/disk/by-uuid/73DE-6834"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens33.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} From b7f75cf885f145c57f3b324a7c967bb33f7b2294 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sat, 14 Sep 2024 11:51:29 +0000 Subject: [PATCH 09/36] Add hardware configuration --- hosts/vmware/boot.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/vmware/boot.nix b/hosts/vmware/boot.nix index 78367ce..848ae06 100644 --- a/hosts/vmware/boot.nix +++ b/hosts/vmware/boot.nix @@ -3,5 +3,5 @@ enable = true; device = "/dev/sda1"; usOSProber = true; - } + }; } From b0368c3841f1f427a7d58c2d41424c3a47253707 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sat, 14 Sep 2024 11:52:09 +0000 Subject: [PATCH 10/36] Add hardware configuration --- hosts/vmware/boot.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/vmware/boot.nix b/hosts/vmware/boot.nix index 848ae06..c16755b 100644 --- a/hosts/vmware/boot.nix +++ b/hosts/vmware/boot.nix @@ -2,6 +2,6 @@ boot.loader.grub = { enable = true; device = "/dev/sda1"; - usOSProber = true; + useOSProber = true; }; } From fa26f537d850ff112262bcfa85398779a5085c3e Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sat, 14 Sep 2024 11:56:40 +0000 Subject: [PATCH 11/36] Change target to device not partition --- hosts/vmware/boot.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/vmware/boot.nix b/hosts/vmware/boot.nix index c16755b..4aee74b 100644 --- a/hosts/vmware/boot.nix +++ b/hosts/vmware/boot.nix @@ -1,7 +1,7 @@ { boot.loader.grub = { enable = true; - device = "/dev/sda1"; + device = "/dev/sda"; useOSProber = true; }; } From fa595486ff486b1102459943ab7181746e8838dc Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 01:00:23 +0000 Subject: [PATCH 12/36] Switch to systemd boot --- hosts/vmware/boot.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hosts/vmware/boot.nix b/hosts/vmware/boot.nix index 4aee74b..2f11e08 100644 --- a/hosts/vmware/boot.nix +++ b/hosts/vmware/boot.nix @@ -1,7 +1,9 @@ { - boot.loader.grub = { - enable = true; - device = "/dev/sda"; - useOSProber = true; + boot.loader = { + systemd-boot.enable = true; + efi = { + canTouchEfiVariables = true; + efiSysMountPoint = "/boot/efi"; + }; }; } From f847039621889a2890db43aac8d8b050ac7c563a Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 01:11:41 +0000 Subject: [PATCH 13/36] Update hardware configuration and change boot.nix params --- hosts/vmware/boot.nix | 2 +- hosts/vmware/hardware-configuration.nix | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/hosts/vmware/boot.nix b/hosts/vmware/boot.nix index 2f11e08..380fe7a 100644 --- a/hosts/vmware/boot.nix +++ b/hosts/vmware/boot.nix @@ -3,7 +3,7 @@ systemd-boot.enable = true; efi = { canTouchEfiVariables = true; - efiSysMountPoint = "/boot/efi"; + efiSysMountPoint = "/boot"; }; }; } diff --git a/hosts/vmware/hardware-configuration.nix b/hosts/vmware/hardware-configuration.nix index f5f5f48..e7e6c1e 100644 --- a/hosts/vmware/hardware-configuration.nix +++ b/hosts/vmware/hardware-configuration.nix @@ -42,12 +42,6 @@ fsType = "ext4"; }; - fileSystems."/mnt/boot" = - { device = "/dev/disk/by-uuid/73DE-6834"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking From c8469703a2805e2a49616a298d9d67b304ef8a4d Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 01:17:20 +0000 Subject: [PATCH 14/36] Update hardware configuration --- hosts/vmware/hardware-configuration.nix | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/hosts/vmware/hardware-configuration.nix b/hosts/vmware/hardware-configuration.nix index e7e6c1e..ac65933 100644 --- a/hosts/vmware/hardware-configuration.nix +++ b/hosts/vmware/hardware-configuration.nix @@ -21,12 +21,6 @@ fsType = "iso9660"; }; - fileSystems."/nix/.ro-store" = - { device = "/iso/nix-store.squashfs"; - fsType = "squashfs"; - options = [ "loop" ]; - }; - fileSystems."/nix/.rw-store" = { device = "tmpfs"; fsType = "tmpfs"; @@ -37,11 +31,29 @@ fsType = "overlay"; }; + fileSystems."/nix/store" = + { device = "/nix/store"; + fsType = "none"; + options = [ "bind" ]; + }; + fileSystems."/mnt" = { device = "/dev/disk/by-uuid/cc7fc1f5-77b0-4fd6-89c2-dde99d6247ca"; fsType = "ext4"; }; + fileSystems."/mnt/boot" = + { device = "/dev/disk/by-uuid/73DE-6834"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + fileSystems."/nix/.ro-store" = + { device = "/iso/nix-store.squashfs"; + fsType = "squashfs"; + options = [ "loop" ]; + }; + swapDevices = [ ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking From 92db98ae6876edaff5ffaafb3ec42846fdcd3d45 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 01:26:40 +0000 Subject: [PATCH 15/36] Change hardware config to point to labels instead of UUID --- hosts/vmware/hardware-configuration.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts/vmware/hardware-configuration.nix b/hosts/vmware/hardware-configuration.nix index ac65933..ac5e2fd 100644 --- a/hosts/vmware/hardware-configuration.nix +++ b/hosts/vmware/hardware-configuration.nix @@ -38,12 +38,12 @@ }; fileSystems."/mnt" = - { device = "/dev/disk/by-uuid/cc7fc1f5-77b0-4fd6-89c2-dde99d6247ca"; + { device = "/dev/disk/by-label/nixos"; fsType = "ext4"; }; fileSystems."/mnt/boot" = - { device = "/dev/disk/by-uuid/73DE-6834"; + { device = "/dev/disk/by-label/boot"; fsType = "vfat"; options = [ "fmask=0022" "dmask=0022" ]; }; From b28b94ae17c2370a89f07018eac9e2bf3edba6a5 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 11:23:39 -0400 Subject: [PATCH 16/36] Some updates to flakes --- hosts/Parzival-Mobile/default.nix | 14 ++++++++++++ hosts/remote/default.nix | 24 -------------------- hosts/remote/hardware-configuration.nix | 29 ------------------------- {hosts/vmware => modules}/boot.nix | 0 modules/default.nix | 1 + 5 files changed, 15 insertions(+), 53 deletions(-) create mode 100644 hosts/Parzival-Mobile/default.nix delete mode 100644 hosts/remote/default.nix delete mode 100644 hosts/remote/hardware-configuration.nix rename {hosts/vmware => modules}/boot.nix (100%) diff --git a/hosts/Parzival-Mobile/default.nix b/hosts/Parzival-Mobile/default.nix new file mode 100644 index 0000000..62a27d8 --- /dev/null +++ b/hosts/Parzival-Mobile/default.nix @@ -0,0 +1,14 @@ +{ pkgs, + ... +}:{ + imports = [ + ./hardware-configuration.nix + ../../modules + ]; + networking.hostName = "Parzival-Mobile"; + environment.systemPackages = [ + pkgs.git + pkgs.vim + pkgs.wget + ]; +} diff --git a/hosts/remote/default.nix b/hosts/remote/default.nix deleted file mode 100644 index 8634862..0000000 --- a/hosts/remote/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, - ... -}:{ - imports = [ - ./hardware-configuration.nix - ../../modules - ]; - networking.hostName = "nixos-remote"; - environment.systemPackages = [ - pkgs.git - pkgs.vim - pkgs.wget - ]; - - boot.loader.grub.device = "/dev/xvda"; - boot.loader.grub.efiSupport = true; - boot.loader.grub.efiInstallAsRemovable = true; - boot.loader.timeout = 1; - boot.loader.grub.extraConfig = '' - serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1 - terminal_output console serial - terminal_input console serial - ''; -} diff --git a/hosts/remote/hardware-configuration.nix b/hosts/remote/hardware-configuration.nix deleted file mode 100644 index fcb587c..0000000 --- a/hosts/remote/hardware-configuration.nix +++ /dev/null @@ -1,29 +0,0 @@ -# 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 = [ ]; - - boot.initrd.availableKernelModules = [ "nvme" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/f222513b-ded1-49fa-b591-20ce86a2fe7f"; - fsType = "ext4"; - }; - - 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..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.ens5.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} diff --git a/hosts/vmware/boot.nix b/modules/boot.nix similarity index 100% rename from hosts/vmware/boot.nix rename to modules/boot.nix diff --git a/modules/default.nix b/modules/default.nix index b9b0839..412e6c1 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,4 +1,5 @@ { imports = [ + ./boot.nix ]; } From cf59f8482de23199c524ded33a2eda9407abfc04 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 14:36:15 -0400 Subject: [PATCH 17/36] Prepare for flake installation --- .../hardware-configuration.nix | 41 +++++++++++++++++++ modules/boot.nix | 1 - 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 hosts/Parzival-Mobile/hardware-configuration.nix diff --git a/hosts/Parzival-Mobile/hardware-configuration.nix b/hosts/Parzival-Mobile/hardware-configuration.nix new file mode 100644 index 0000000..31b3a13 --- /dev/null +++ b/hosts/Parzival-Mobile/hardware-configuration.nix @@ -0,0 +1,41 @@ +# 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" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/0e8c3f30-2abb-4687-b541-3f6dfdb2fa72"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/E6CB-9DA5"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/928718de-b495-4a7c-b9d4-eb491b6c8253"; } + ]; + + # 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/boot.nix b/modules/boot.nix index 380fe7a..6c8f23e 100644 --- a/modules/boot.nix +++ b/modules/boot.nix @@ -3,7 +3,6 @@ systemd-boot.enable = true; efi = { canTouchEfiVariables = true; - efiSysMountPoint = "/boot"; }; }; } From 255103fb9dfdfb750609efae351b8496bd6b398f Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 14:43:13 -0400 Subject: [PATCH 18/36] Prepare for flakes --- core.nix | 18 ++++++++++++++++++ modules/default.nix | 2 ++ modules/networking.nix | 2 ++ 3 files changed, 22 insertions(+) create mode 100644 core.nix create mode 100644 modules/networking.nix diff --git a/core.nix b/core.nix new file mode 100644 index 0000000..c9e18be --- /dev/null +++ b/core.nix @@ -0,0 +1,18 @@ +{ + system.stateVersion = "24.05"; + time.timeZone = "America/New_York"; + + environment.systemPackages = with pkgs; [ + neovim + wget + git + screen + curl + firefox + ]; + + users.users.crow = { + isNormalUser = true; + extraGroups = [ "wheel" "networking" ]; + }; +} diff --git a/modules/default.nix b/modules/default.nix index 412e6c1..6268f42 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,5 +1,7 @@ { imports = [ + ./core.nix ./boot.nix + ./networking.nix ]; } diff --git a/modules/networking.nix b/modules/networking.nix new file mode 100644 index 0000000..f7dc8e9 --- /dev/null +++ b/modules/networking.nix @@ -0,0 +1,2 @@ +networking.networkmanager.enable = true; +networking.firewall.enable = false; From f3ad2e7d25f072d8bd0602a0e2cb6d17add6b84b Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 15:06:18 -0400 Subject: [PATCH 19/36] Add mobile to flake --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index a1e8127..0a0a25d 100644 --- a/flake.nix +++ b/flake.nix @@ -20,5 +20,5 @@ specialArgs = {inherit pkgs inputs;}; modules = [(./hosts + "/${host}")]; }); - in {nixosConfigurations = lib.attrsets.genAttrs ["remote" "vmware"] ns;}; + in {nixosConfigurations = lib.attrsets.genAttrs [ "Parzival-Mobile" ] ns;}; } From 7cf8e51d95f6f9886cebdcc632505a1ecd5f1764 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 15:09:45 -0400 Subject: [PATCH 20/36] Whoops we put core in the wrong place --- core.nix => modules/core.nix | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename core.nix => modules/core.nix (100%) diff --git a/core.nix b/modules/core.nix similarity index 100% rename from core.nix rename to modules/core.nix From 96c691f37abeee17e151ab10d0f75c77c49aed21 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 15:21:02 -0400 Subject: [PATCH 21/36] Import pkgs into core --- modules/core.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/core.nix b/modules/core.nix index c9e18be..a627b07 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -1,4 +1,9 @@ { + config, + lib, + pkgs, + ... +}: { system.stateVersion = "24.05"; time.timeZone = "America/New_York"; From 00ff6ff0678b1e4f5baa166c475bbc826e0ab6c3 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 15:22:47 -0400 Subject: [PATCH 22/36] Whoops again --- modules/networking.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/networking.nix b/modules/networking.nix index f7dc8e9..571520e 100644 --- a/modules/networking.nix +++ b/modules/networking.nix @@ -1,2 +1,4 @@ -networking.networkmanager.enable = true; -networking.firewall.enable = false; +{ + networking.networkmanager.enable = true; + networking.firewall.enable = false; +} From 1eb1749943ed276162b208565510afed04265a78 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 15:50:17 -0400 Subject: [PATCH 23/36] Sway enabled --- modules/core.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/core.nix b/modules/core.nix index a627b07..47117ce 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -14,10 +14,16 @@ screen curl firefox + fish ]; users.users.crow = { isNormalUser = true; extraGroups = [ "wheel" "networking" ]; }; + + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + }; } From 9eb20764d5ca846bd47058dff988e89d6c572dda Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sun, 15 Sep 2024 21:27:05 -0400 Subject: [PATCH 24/36] Remove vmware host --- hosts/vmware/default.nix | 15 ------ hosts/vmware/hardware-configuration.nix | 67 ------------------------- 2 files changed, 82 deletions(-) delete mode 100644 hosts/vmware/default.nix delete mode 100644 hosts/vmware/hardware-configuration.nix diff --git a/hosts/vmware/default.nix b/hosts/vmware/default.nix deleted file mode 100644 index 6112450..0000000 --- a/hosts/vmware/default.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ pkgs, - ... -}:{ - imports = [ - ./hardware-configuration.nix - ./boot.nix - ../../modules - ]; - networking.hostName = "vmware"; - environment.systemPackages = [ - pkgs.git - pkgs.vim - pkgs.wget - ]; -} diff --git a/hosts/vmware/hardware-configuration.nix b/hosts/vmware/hardware-configuration.nix deleted file mode 100644 index ac5e2fd..0000000 --- a/hosts/vmware/hardware-configuration.nix +++ /dev/null @@ -1,67 +0,0 @@ -# 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 = [ ]; - - boot.initrd.availableKernelModules = [ "ata_piix" "mptspi" "uhci_hcd" "ehci_pci" "ahci" "sd_mod" "sr_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = - { device = "tmpfs"; - fsType = "tmpfs"; - }; - - fileSystems."/iso" = - { device = "/dev/disk/by-uuid/1980-01-01-00-00-00-00"; - fsType = "iso9660"; - }; - - fileSystems."/nix/.rw-store" = - { device = "tmpfs"; - fsType = "tmpfs"; - }; - - fileSystems."/nix/store" = - { device = "overlay"; - fsType = "overlay"; - }; - - fileSystems."/nix/store" = - { device = "/nix/store"; - fsType = "none"; - options = [ "bind" ]; - }; - - fileSystems."/mnt" = - { device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - }; - - fileSystems."/mnt/boot" = - { device = "/dev/disk/by-label/boot"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - fileSystems."/nix/.ro-store" = - { device = "/iso/nix-store.squashfs"; - fsType = "squashfs"; - options = [ "loop" ]; - }; - - 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..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.ens33.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; -} From dd7683a7563137b09085ee31cdfb4f9a9fefb886 Mon Sep 17 00:00:00 2001 From: Patrick Menking Date: Mon, 16 Sep 2024 08:45:50 -0400 Subject: [PATCH 25/36] Split config down further --- modules/core.nix | 15 --------------- modules/default.nix | 1 + modules/programs.nix | 16 ++++++++++++++++ 3 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 modules/programs.nix diff --git a/modules/core.nix b/modules/core.nix index 47117ce..cbc1966 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -7,23 +7,8 @@ system.stateVersion = "24.05"; time.timeZone = "America/New_York"; - environment.systemPackages = with pkgs; [ - neovim - wget - git - screen - curl - firefox - fish - ]; - users.users.crow = { isNormalUser = true; extraGroups = [ "wheel" "networking" ]; }; - - programs.sway = { - enable = true; - wrapperFeatures.gtk = true; - }; } diff --git a/modules/default.nix b/modules/default.nix index 6268f42..3c5a6cb 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -3,5 +3,6 @@ imports = [ ./core.nix ./boot.nix ./networking.nix + ./programs.nix ]; } diff --git a/modules/programs.nix b/modules/programs.nix new file mode 100644 index 0000000..3bcf384 --- /dev/null +++ b/modules/programs.nix @@ -0,0 +1,16 @@ +{ + environment.systemPackages = with pkgs; [ + neovim + wget + git + screen + curl + firefox + fish + ]; + + programs.sway = { + enable = true; + wrapperFeatures.gtk = true; + }; +} From b1a0574ed1ad79a09d2fe13f9a95f4c4b7907313 Mon Sep 17 00:00:00 2001 From: Patrick Menking Date: Mon, 16 Sep 2024 09:45:29 -0400 Subject: [PATCH 26/36] Make package options and split users into different file --- flake.nix | 8 +++++++- modules/core.nix | 5 ----- modules/default.nix | 35 ++++++++++++++++++++++++++++------- modules/users/crow.nix | 15 +++++++++++++++ modules/users/default.nix | 5 +++++ 5 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 modules/users/crow.nix create mode 100644 modules/users/default.nix diff --git a/flake.nix b/flake.nix index 0a0a25d..5b6fce0 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,13 @@ ns = host: (lib.nixosSystem { specialArgs = {inherit pkgs inputs;}; - modules = [(./hosts + "/${host}")]; + modules = [ + (./hosts + "/${host}") + home-manager.nixosModules.home-manager { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + } + ]; }); in {nixosConfigurations = lib.attrsets.genAttrs [ "Parzival-Mobile" ] ns;}; } diff --git a/modules/core.nix b/modules/core.nix index cbc1966..90876a5 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -6,9 +6,4 @@ }: { system.stateVersion = "24.05"; time.timeZone = "America/New_York"; - - users.users.crow = { - isNormalUser = true; - extraGroups = [ "wheel" "networking" ]; - }; } diff --git a/modules/default.nix b/modules/default.nix index 3c5a6cb..1c47ee4 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,8 +1,29 @@ -{ -imports = [ - ./core.nix - ./boot.nix - ./networking.nix - ./programs.nix -]; +{ lib, config, ...}: { + imports = [ + ./core.nix + ./boot.nix + ./networking.nix + ./programs.nix + ./users + ]; + + config = { + base = { + enable = lib.mkDefault true; + services.enable = lib.mkDefault true; + programs.enable = lib.mkDefault true; + }; + + home.enable = lib.mkDefault true; + hypr.enable = lib.mkDefault true; + i3.enable = lib.mkDefault true; + + packages = { + enable = lib.mkDefault true; + programming.enable = lib.mkDefault true; + mudding.enable = lib.mkDefault true; + gaming.enable = lib.mkDefault true; + gui.enable = lib.mkDefault true; + }; + }; } diff --git a/modules/users/crow.nix b/modules/users/crow.nix new file mode 100644 index 0000000..37e9778 --- /dev/null +++ b/modules/users/crow.nix @@ -0,0 +1,15 @@ +{ lib, config, pkgs, ...}: { + users.users.crow = { + isNormalUser = true; + extraGroups = [ "wheel" "networkmanager" ]; + }; + + home-manager.users.crow = { + home.username = "crow"; + home.homeDirectory = "/home/crow"; + + home.stateVersion = "24.05"; + + programs.home-manager.enable = true; + }; +} diff --git a/modules/users/default.nix b/modules/users/default.nix new file mode 100644 index 0000000..31b65c3 --- /dev/null +++ b/modules/users/default.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./crow.nix + ]; +} From d430ad5cd8e640fb1f879c73c61d6e750e80187c Mon Sep 17 00:00:00 2001 From: Patrick Menking Date: Mon, 16 Sep 2024 10:57:06 -0400 Subject: [PATCH 27/36] Add packages with enablers --- modules/default.nix | 18 ++----- modules/programs.nix | 111 +++++++++++++++++++++++++++++++++++------ modules/users/crow.nix | 10 +--- 3 files changed, 102 insertions(+), 37 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index 1c47ee4..2ca12ec 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -8,22 +8,14 @@ ]; config = { - base = { - enable = lib.mkDefault true; - services.enable = lib.mkDefault true; - programs.enable = lib.mkDefault true; - }; - - home.enable = lib.mkDefault true; - hypr.enable = lib.mkDefault true; - i3.enable = lib.mkDefault true; - packages = { enable = lib.mkDefault true; - programming.enable = lib.mkDefault true; - mudding.enable = lib.mkDefault true; - gaming.enable = lib.mkDefault true; + core.enable = lib.mkDefault true; gui.enable = lib.mkDefault true; + programming.enable = lib.mkDefault true; + hacking.enable = lib.mkDefault false; + mudding.enable = lib.mkDefault false; + gaming.enable = lib.mkDefault false; }; }; } diff --git a/modules/programs.nix b/modules/programs.nix index 3bcf384..e5ac218 100644 --- a/modules/programs.nix +++ b/modules/programs.nix @@ -1,16 +1,97 @@ -{ - environment.systemPackages = with pkgs; [ - neovim - wget - git - screen - curl - firefox - fish - ]; - - programs.sway = { - enable = true; - wrapperFeatures.gtk = true; - }; +{ inputs, pkgs, lib, config, ...}: { + + environment.systemPackages = with pkgs; + ( + # Core packages + if config.packages.core.enable + then [ + vim + wget + git + screen + curl + foot + tmux + ] else [] + ) + ++ ( + if config.packages.gui.enable + then [ + # Note taking + logseq + + # Communication + mattermost-desktop + slack + zoom-us + vesktop + signal-desktop + teamspeak_client + + # Browsing + firefox + tor-browser + + # Music + spotify + strawberry-qt6 + + # Utilities + grim + hyfetch + wofi + waybar + swaynotificationcenter + udiskie + swayidle + hyprlock + pulseaudio + gimp + ] else [] + ) + ++ ( + if config.packages.programming.enable + then [ + neovim + lua + libgcc + php + python3 + serverless + jwt-cli + jq + ddev + cloc + ansible + ] else [] + ) + ++ ( + if config.packages.hacking.enable + then [ + metasploit + exploitdb + ghidra + wireshark + nmap + hashcat + dirstalk + ] else [] + + ++ ( + if config.packages.mudding.enable + then [ + mudlet + ] else [] + ) + ++ ( + if config.packages.gaming.enable + then [ + steam + protonup-qt + prismlauncher + mudlet + widelands + wesnoth + ] else [] + ); } diff --git a/modules/users/crow.nix b/modules/users/crow.nix index 37e9778..655681e 100644 --- a/modules/users/crow.nix +++ b/modules/users/crow.nix @@ -1,15 +1,7 @@ { lib, config, pkgs, ...}: { users.users.crow = { isNormalUser = true; + initialPassword = "changeme"; extraGroups = [ "wheel" "networkmanager" ]; }; - - home-manager.users.crow = { - home.username = "crow"; - home.homeDirectory = "/home/crow"; - - home.stateVersion = "24.05"; - - programs.home-manager.enable = true; - }; } From 42f4710c7951b2bb5286c450da6894b31feda1a5 Mon Sep 17 00:00:00 2001 From: Patrick Menking Date: Mon, 16 Sep 2024 12:01:35 -0400 Subject: [PATCH 28/36] Remove home-manager module --- flake.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/flake.nix b/flake.nix index 5b6fce0..1323bd9 100644 --- a/flake.nix +++ b/flake.nix @@ -20,10 +20,6 @@ specialArgs = {inherit pkgs inputs;}; modules = [ (./hosts + "/${host}") - home-manager.nixosModules.home-manager { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - } ]; }); in {nixosConfigurations = lib.attrsets.genAttrs [ "Parzival-Mobile" ] ns;}; From 5159cd66dd69f10fd7fe0f3284dfde5800a03f17 Mon Sep 17 00:00:00 2001 From: Patrick Menking Date: Mon, 16 Sep 2024 12:03:12 -0400 Subject: [PATCH 29/36] Fix errounous ; --- modules/programs.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/programs.nix b/modules/programs.nix index e5ac218..3f672e0 100644 --- a/modules/programs.nix +++ b/modules/programs.nix @@ -1,5 +1,4 @@ { inputs, pkgs, lib, config, ...}: { - environment.systemPackages = with pkgs; ( # Core packages @@ -93,5 +92,5 @@ widelands wesnoth ] else [] - ); + ) } From a5051420e6c8ba711caeec86b0f86f68e8c28710 Mon Sep 17 00:00:00 2001 From: Patrick Menking Date: Mon, 16 Sep 2024 12:36:01 -0400 Subject: [PATCH 30/36] Whoops --- modules/programs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs.nix b/modules/programs.nix index 3f672e0..0daeae4 100644 --- a/modules/programs.nix +++ b/modules/programs.nix @@ -75,7 +75,7 @@ hashcat dirstalk ] else [] - + ) ++ ( if config.packages.mudding.enable then [ From 0ca187f2cd03d401c5a5808195f2220f8e63e32c Mon Sep 17 00:00:00 2001 From: Patrick Menking Date: Mon, 16 Sep 2024 12:36:33 -0400 Subject: [PATCH 31/36] I knew there was supposed to be a ; in there --- modules/programs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs.nix b/modules/programs.nix index 0daeae4..713c266 100644 --- a/modules/programs.nix +++ b/modules/programs.nix @@ -92,5 +92,5 @@ widelands wesnoth ] else [] - ) + ); } From ba4049f95ae7b2126b7ffec29c038f1365c36f65 Mon Sep 17 00:00:00 2001 From: Patrick Menking Date: Mon, 16 Sep 2024 12:42:05 -0400 Subject: [PATCH 32/36] Maybe I need to set this to options scope --- modules/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default.nix b/modules/default.nix index 2ca12ec..8f91223 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -7,7 +7,7 @@ ./users ]; - config = { + options = { packages = { enable = lib.mkDefault true; core.enable = lib.mkDefault true; From bcb1832a46af61b62b4dd60350abce08836ec461 Mon Sep 17 00:00:00 2001 From: Patrick Menking Date: Mon, 16 Sep 2024 14:08:31 -0400 Subject: [PATCH 33/36] Properly add module --- modules/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/default.nix b/modules/default.nix index 8f91223..924222c 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -7,7 +7,9 @@ ./users ]; - options = { + options.omni.enable = lib.mkOption {default = true;}; + + config = { packages = { enable = lib.mkDefault true; core.enable = lib.mkDefault true; From 892e70ba3ce03a4cba58865c2aee41aa6febdae3 Mon Sep 17 00:00:00 2001 From: Patrick Menking Date: Mon, 16 Sep 2024 14:09:53 -0400 Subject: [PATCH 34/36] Properly add module --- modules/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default.nix b/modules/default.nix index 924222c..987d80f 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -9,7 +9,7 @@ options.omni.enable = lib.mkOption {default = true;}; - config = { + config = lib.mkIf config.omni.enable { packages = { enable = lib.mkDefault true; core.enable = lib.mkDefault true; From 91f23ff5ebede827cef9ef687c0cc90a81fd9891 Mon Sep 17 00:00:00 2001 From: Patrick Menking Date: Mon, 16 Sep 2024 14:13:59 -0400 Subject: [PATCH 35/36] I understand modules a bit better now --- modules/core.nix | 23 +++++++++++++++++++++++ modules/default.nix | 14 -------------- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/modules/core.nix b/modules/core.nix index 90876a5..c4b5d2e 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -6,4 +6,27 @@ }: { system.stateVersion = "24.05"; time.timeZone = "America/New_York"; + + options.packages = { + enable = lib.mkEnableOption "enables packages"; + core.enable = lib.mkEnableOption "enables required packages"; + gui.enable = lib.mkEnableOption "enables gui+DE packages"; + programming.enable = lib.mkEnableOption "enables programming packages"; + hacking.enable = lib.mkEnableOption "enables hacking packages"; + mudding.enable = lib.mkEnableOption "enables mudding packages"; + gaming.enable = lib.mkEnableOption "enables gaming packages"; + }; + + config = { + packages = { + enable = lib.mkDefault true; + core.enable = lib.mkDefault true; + gui.enable = lib.mkDefault true; + programming.enable = lib.mkDefault true; + hacking.enable = lib.mkDefault false; + mudding.enable = lib.mkDefault false; + gaming.enable = lib.mkDefault false; + }; + }; + } diff --git a/modules/default.nix b/modules/default.nix index 987d80f..f8e696c 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -6,18 +6,4 @@ ./programs.nix ./users ]; - - options.omni.enable = lib.mkOption {default = true;}; - - config = lib.mkIf config.omni.enable { - packages = { - enable = lib.mkDefault true; - core.enable = lib.mkDefault true; - gui.enable = lib.mkDefault true; - programming.enable = lib.mkDefault true; - hacking.enable = lib.mkDefault false; - mudding.enable = lib.mkDefault false; - gaming.enable = lib.mkDefault false; - }; - }; } From 9a1113a920489976f0facc390f97ec1bcbb49bf0 Mon Sep 17 00:00:00 2001 From: Patrick Menking Date: Mon, 16 Sep 2024 14:15:33 -0400 Subject: [PATCH 36/36] Fix top level config issues in core --- modules/core.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/core.nix b/modules/core.nix index c4b5d2e..df52bb6 100644 --- a/modules/core.nix +++ b/modules/core.nix @@ -4,9 +4,6 @@ pkgs, ... }: { - system.stateVersion = "24.05"; - time.timeZone = "America/New_York"; - options.packages = { enable = lib.mkEnableOption "enables packages"; core.enable = lib.mkEnableOption "enables required packages"; @@ -18,6 +15,8 @@ }; config = { + system.stateVersion = "24.05"; + time.timeZone = "America/New_York"; packages = { enable = lib.mkDefault true; core.enable = lib.mkDefault true;