From f1b46e56bfc967756f28d2e9a66b22f6f82ab0e1 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sat, 2 Sep 2023 14:53:25 +0200 Subject: [PATCH] merge hw config and machine config --- common.nix | 32 ++----------- home.nix => home-vinzenz.nix | 0 vinzenz-lpt-hardware-configuration.nix | 46 ------------------- vinzenz-lpt.nix | 45 ++++++++++++++++++- vinzenz-pc3-hardware-configuration.nix | 62 -------------------------- vinzenz-pc3.nix | 60 ++++++++++++++++++++++++- 6 files changed, 105 insertions(+), 140 deletions(-) rename home.nix => home-vinzenz.nix (100%) delete mode 100644 vinzenz-lpt-hardware-configuration.nix delete mode 100644 vinzenz-pc3-hardware-configuration.nix diff --git a/common.nix b/common.nix index 73e101e..344e4aa 100644 --- a/common.nix +++ b/common.nix @@ -6,7 +6,7 @@ imports = [ # enable home manager - ./home.nix + (modulesPath + "/installer/scan/not-detected.nix") ]; nixpkgs.config = { @@ -25,10 +25,6 @@ # wireless.enable = true; # Enables wireless support via wpa_supplicant. # wireless.userControlled.enable = true; - # Configure network proxy if necessary - # proxy.default = "http://user:password@proxy:port/"; - # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # Enable networking networkmanager.enable = true; @@ -103,33 +99,11 @@ alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - - # use the example session manager (no others are packaged yet so this is enabled by default, - # no need to redefine it in your config for now) - #media-session.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; - # }; - system = { - # This value determines the NixOS release from which the default - # settings for stateful data, like file locations and database versions - # on your system were taken. It‘s perfectly fine and recommended to leave - # this value at the release version of the first install of this system. - # Before changing this value read the documentation for this option - # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). - stateVersion = "22.11"; # Did you read the comment? - - # enable auto updates - autoUpgrade.enable = true; + stateVersion = "22.11"; + autoUpgrade.enable = true; # enable auto updates }; nix.gc = { diff --git a/home.nix b/home-vinzenz.nix similarity index 100% rename from home.nix rename to home-vinzenz.nix diff --git a/vinzenz-lpt-hardware-configuration.nix b/vinzenz-lpt-hardware-configuration.nix deleted file mode 100644 index 096c2f2..0000000 --- a/vinzenz-lpt-hardware-configuration.nix +++ /dev/null @@ -1,46 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - 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=@"]; - }; - - fileSystems."/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-lpt.nix b/vinzenz-lpt.nix index fa1218c..dc2fa6a 100644 --- a/vinzenz-lpt.nix +++ b/vinzenz-lpt.nix @@ -1,9 +1,50 @@ -{...}: { +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { networking.hostName = "vinzenz-lpt"; imports = [ - ./vinzenz-lpt-hardware-configuration.nix ./common.nix ./gnome.nix + ./home-vinzenz.nix ]; + + 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=@"]; + }; + + fileSystems."/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-hardware-configuration.nix b/vinzenz-pc3-hardware-configuration.nix deleted file mode 100644 index a3f26fd..0000000 --- a/vinzenz-pc3-hardware-configuration.nix +++ /dev/null @@ -1,62 +0,0 @@ -{ - config, - lib, - pkgs, - modulesPath, - ... -}: { - imports = [ - (modulesPath + "/installer/scan/not-detected.nix") - ]; - - 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=@"]; - }; - - "/boot" = { - device = "/dev/disk/by-uuid/AF67-8F16"; - fsType = "vfat"; - }; - - "/mnt/manjaro" = { - device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; - fsType = "btrfs"; - options = ["subvol=@"]; - }; - - "/mnt/manjaro/home" = { - device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; - fsType = "btrfs"; - options = ["subvol=@home"]; - }; - - "/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/vinzenz-pc3.nix b/vinzenz-pc3.nix index f1e995e..efc90c6 100644 --- a/vinzenz-pc3.nix +++ b/vinzenz-pc3.nix @@ -1,13 +1,71 @@ -{...}: { +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { networking.hostName = "vinzenz-pc3"; imports = [ ./vinzenz-pc3-hardware-configuration.nix ./common.nix ./kde.nix + ./home-vinzenz.nix ]; 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=@"]; + }; + + "/boot" = { + device = "/dev/disk/by-uuid/AF67-8F16"; + fsType = "vfat"; + }; + + "/mnt/manjaro" = { + device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; + fsType = "btrfs"; + options = ["subvol=@"]; + }; + + "/mnt/manjaro/home" = { + device = "/dev/disk/by-uuid/b6b4c0b8-4b16-4a72-a18d-d7923a2bb532"; + fsType = "btrfs"; + options = ["subvol=@home"]; + }; + + "/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; }