From 539465abf4eea10d3bbb0b005c007cc9f517dfbf Mon Sep 17 00:00:00 2001 From: lucy Date: Fri, 2 Oct 2026 23:59:05 +0200 Subject: [PATCH 1/2] restructure hosts --- flake.nix | 29 ++++++++++++---- .../desktop/hardware-configuration.nix | 0 hosts/laptop/hardware-configuration.nix | 33 +++++++++++++++++++ 3 files changed, 56 insertions(+), 6 deletions(-) rename hardware-configuration.nix => hosts/desktop/hardware-configuration.nix (100%) create mode 100644 hosts/laptop/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 4e061cd..8230f55 100755 --- a/flake.nix +++ b/flake.nix @@ -24,17 +24,34 @@ nix-maid, mangowm, }: + let + mods = [ + nixcord.nixosModules.nixcord + mangowm.nixosModules.mango + ./configuration.nix + ./maid.nix + ]; + in { nixosConfigurations.nerv = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; system = "x86_64-linux"; modules = [ - nixcord.nixosModules.nixcord - nix-maid.nixosModules.default - mangowm.nixosModules.mango - ./configuration.nix - ./maid.nix - ]; + ./hosts/desktop/hardware-configuration.nix + ] ++ mods; + ({ config, ...}: { + networking.hostname = "nerv"; + }); }; }; + nixosConfigurations.seele = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + system = "x86_64-linux"; + modules = [ + ./hosts/laptop/hardware-configuration.nix + ] ++ mods; + ({ config, ...}: { + networking.hostname = "seele"; + }); + } } diff --git a/hardware-configuration.nix b/hosts/desktop/hardware-configuration.nix similarity index 100% rename from hardware-configuration.nix rename to hosts/desktop/hardware-configuration.nix diff --git a/hosts/laptop/hardware-configuration.nix b/hosts/laptop/hardware-configuration.nix new file mode 100644 index 0000000..3b021ca --- /dev/null +++ b/hosts/laptop/hardware-configuration.nix @@ -0,0 +1,33 @@ +# 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" "nvme" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/629196f0-60e9-476e-b294-0d22fd7279c4"; + fsType = "xfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/2474-C1E6"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/166d1fb4-527f-4fda-a6bf-85aad4a4f917"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} From 07b5e8d344bf6ec9af6cfbcaf0b57ba77d8c9698 Mon Sep 17 00:00:00 2001 From: lucy Date: Sat, 3 Oct 2026 01:02:00 +0200 Subject: [PATCH 2/2] structure hosts --- configuration.nix | 13 +++++------- flake.nix | 50 +++++++++++++++++++++++++---------------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/configuration.nix b/configuration.nix index 234996a..bda013a 100755 --- a/configuration.nix +++ b/configuration.nix @@ -1,12 +1,9 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: { - imports = [ - ./hardware-configuration.nix - ]; hardware.graphics.enable = true; - services.xserver.videoDrivers = [ "nvidia" ]; - hardware.nvidia = { + services.xserver.videoDrivers = lib.mkIf (config.networking.hostName == "nerv") [ "nvidia" ]; + hardware.nvidia = lib.mkIf (config.networking.hostName == "nerv") { modesetting.enable = true; open = true; package = config.boot.kernelPackages.nvidiaPackages.new_feature; @@ -16,7 +13,7 @@ boot.loader.efi.canTouchEfiVariables = true; boot.loader.limine = { enable = true; - extraEntries = '' + extraEntries = lib.mkIf (config.networking.hostName == "nerv") '' /Windows 11 protocol: efi path: uuid(6E25-7E8D):/EFI/Microsoft/Boot/bootmgfw.efi @@ -24,7 +21,7 @@ }; boot.kernelPackages = pkgs.linuxPackages_latest; - networking.hostName = "nerv"; + networking.networkmanager.enable = true; time.timeZone = "Europe/Berlin"; i18n.defaultLocale = "en_US.UTF-8"; diff --git a/flake.nix b/flake.nix index 8230f55..e81f003 100755 --- a/flake.nix +++ b/flake.nix @@ -24,34 +24,38 @@ nix-maid, mangowm, }: - let - mods = [ - nixcord.nixosModules.nixcord - mangowm.nixosModules.mango - ./configuration.nix - ./maid.nix - ]; - in + let + mods = [ + nix-maid.nixosModules.default + nixcord.nixosModules.nixcord + mangowm.nixosModules.mango + ./configuration.nix + ./maid.nix + ]; + in { nixosConfigurations.nerv = nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs; }; system = "x86_64-linux"; modules = [ - ./hosts/desktop/hardware-configuration.nix - ] ++ mods; - ({ config, ...}: { - networking.hostname = "nerv"; - }); + ({ config, ... }: { + imports = [ ./hosts/desktop/hardware-configuration.nix ]; + networking.hostName = "nerv"; + }) + ] + ++ mods; + }; + + nixosConfigurations.seele = nixpkgs.lib.nixosSystem { + specialArgs = { inherit inputs; }; + system = "x86_64-linux"; + modules = [ + ({ config, ... }: { + imports = [ ./hosts/laptop/hardware-configuration.nix ]; + networking.hostName = "seele"; + }) + ] + ++ mods; }; }; - nixosConfigurations.seele = nixpkgs.lib.nixosSystem { - specialArgs = { inherit inputs; }; - system = "x86_64-linux"; - modules = [ - ./hosts/laptop/hardware-configuration.nix - ] ++ mods; - ({ config, ...}: { - networking.hostname = "seele"; - }); - } }