From 8df61f216eae02b4b3e26838b543b1ac9840195b Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 9 Sep 2023 15:21:27 +0200 Subject: [PATCH] split hardware back out again, dir rename --- hardware/vinzenz-lpt.nix | 44 +++++++++++++++++++++ hardware/vinzenz-pc3.nix | 67 ++++++++++++++++++++++++++++++++ {my => modules}/default.nix | 2 +- {my => modules}/gnome.nix | 0 {my => modules}/home/default.nix | 0 {my => modules}/home/ronja.nix | 0 {my => modules}/home/vinzenz.nix | 0 {my => modules}/kde.nix | 8 ++-- vinzenz-lpt.nix | 42 ++------------------ vinzenz-pc3.nix | 64 ++---------------------------- 10 files changed, 124 insertions(+), 103 deletions(-) create mode 100644 hardware/vinzenz-lpt.nix create mode 100644 hardware/vinzenz-pc3.nix rename {my => modules}/default.nix (99%) rename {my => modules}/gnome.nix (100%) rename {my => modules}/home/default.nix (100%) rename {my => modules}/home/ronja.nix (100%) rename {my => modules}/home/vinzenz.nix (100%) rename {my => modules}/kde.nix (94%) diff --git a/hardware/vinzenz-lpt.nix b/hardware/vinzenz-lpt.nix new file mode 100644 index 0000000..bcb7160 --- /dev/null +++ b/hardware/vinzenz-lpt.nix @@ -0,0 +1,44 @@ +{ + config, + lib, + ... +}: { + config = { + boot = { + initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; + initrd.kernelModules = []; + kernelModules = ["kvm-intel"]; + extraModulePackages = []; + loader.efi.efiSysMountPoint = "/boot/efi"; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/boot/efi" = { + device = "/dev/disk/by-uuid/2381-1CD2"; + fsType = "vfat"; + }; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} + ]; + + # 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.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.enableRedistributableFirmware = true; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +} diff --git a/hardware/vinzenz-pc3.nix b/hardware/vinzenz-pc3.nix new file mode 100644 index 0000000..6c25f47 --- /dev/null +++ b/hardware/vinzenz-pc3.nix @@ -0,0 +1,67 @@ +{ + config, + lib, + pkgs, + ... +}: { + config = { + boot = { + initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" + initrd.kernelModules = []; + kernelModules = ["kvm-amd"]; + extraModulePackages = []; + loader.efi.efiSysMountPoint = "/boot"; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/home" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@home"]; + }; + + "/games" = { + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvol=@games"]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/AF67-8F16"; + fsType = "vfat"; + }; + + "/mnt/nixos_btrfs_root" = { + # subvolume with id 5 is always the root volume + # this is convenient for managing the flat subvolume hierarchy + device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; + fsType = "btrfs"; + options = ["subvolid=5"]; + }; + + "/mnt/ssd2" = { + device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; + 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.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + }; +} diff --git a/my/default.nix b/modules/default.nix similarity index 99% rename from my/default.nix rename to modules/default.nix index 952b919..16df219 100644 --- a/my/default.nix +++ b/modules/default.nix @@ -9,7 +9,7 @@ with lib; let cfg = config.my; in { imports = [ - ./home/default.nix + ./home ./gnome.nix ./kde.nix (modulesPath + "/installer/scan/not-detected.nix") diff --git a/my/gnome.nix b/modules/gnome.nix similarity index 100% rename from my/gnome.nix rename to modules/gnome.nix diff --git a/my/home/default.nix b/modules/home/default.nix similarity index 100% rename from my/home/default.nix rename to modules/home/default.nix diff --git a/my/home/ronja.nix b/modules/home/ronja.nix similarity index 100% rename from my/home/ronja.nix rename to modules/home/ronja.nix diff --git a/my/home/vinzenz.nix b/modules/home/vinzenz.nix similarity index 100% rename from my/home/vinzenz.nix rename to modules/home/vinzenz.nix diff --git a/my/kde.nix b/modules/kde.nix similarity index 94% rename from my/kde.nix rename to modules/kde.nix index 87b0835..0faecec 100644 --- a/my/kde.nix +++ b/modules/kde.nix @@ -7,10 +7,10 @@ cfg = config.my.kde; applyKdeUserSettings = { - home = { - packages = with pkgs; [ - ]; - }; + #home = { + # packages = with pkgs; [ + # ]; + #}; services.kdeconnect = { enable = true; diff --git a/vinzenz-lpt.nix b/vinzenz-lpt.nix index 39c3068..edb2e14 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -4,7 +4,10 @@ pkgs, ... }: { - imports = [./my/default.nix]; + imports = [ + ./modules + ./hardware/vinzenz-lpt.nix + ]; config = { networking.hostName = "vinzenz-lpt"; @@ -13,42 +16,5 @@ my.home.vinzenz.enable = true; services.flatpak.enable = true; - - boot = { - initrd.availableKernelModules = ["xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci"]; - initrd.kernelModules = []; - kernelModules = ["kvm-intel"]; - extraModulePackages = []; - loader.efi.efiSysMountPoint = "/boot/efi"; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/34cb86c4-8823-4785-9672-92ef0bcd5eaf"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/boot/efi" = { - device = "/dev/disk/by-uuid/2381-1CD2"; - fsType = "vfat"; - }; - }; - - swapDevices = [ - {device = "/dev/disk/by-uuid/f5932f70-60e4-4abe-b23d-2cab3c095c7d";} - ]; - - # 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.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.enableRedistributableFirmware = true; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }; } diff --git a/vinzenz-pc3.nix b/vinzenz-pc3.nix index d2a35d2..817a647 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -4,7 +4,10 @@ pkgs, ... }: { - imports = [./my/default.nix]; + imports = [ + ./modules + ./hardware/vinzenz-pc3.nix + ]; config = { networking.hostName = "vinzenz-pc3"; @@ -22,64 +25,5 @@ users.users.vinzenz.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINrY6tcgnoC/xbgL7vxSjddEY9MBxRXe9n2cAHt88/TT home roaming" ]; - - boot = { - initrd.availableKernelModules = ["nvme" "xhci_pci" "ahci" "usbhid" "sd_mod"]; # "usb_storage" - initrd.kernelModules = []; - kernelModules = ["kvm-amd"]; - extraModulePackages = []; - loader.efi.efiSysMountPoint = "/boot"; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/home" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@home"]; - }; - - "/games" = { - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvol=@games"]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/AF67-8F16"; - fsType = "vfat"; - }; - - "/mnt/nixos_btrfs_root" = { - # subvolume with id 5 is always the root volume - # this is convenient for managing the flat subvolume hierarchy - device = "/dev/disk/by-uuid/0e9c983a-e733-447e-8181-f41d6670c4b8"; - fsType = "btrfs"; - options = ["subvolid=5"]; - }; - - "/mnt/ssd2" = { - device = "/dev/disk/by-uuid/6b2a647d-c68e-4c07-85bf-c9bfc5db7e8a"; - 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.eno1.useDHCP = lib.mkDefault true; - # networking.interfaces.wlp5s0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; }; }