From 0a989caa181232ac2fa794189d822a0316791fa8 Mon Sep 17 00:00:00 2001 From: Andreas Zweili Date: Mon, 3 Jan 2022 20:29:08 +0100 Subject: [PATCH] use the mkComputer function everywhere --- flake.nix | 27 +++++++++++---------- systems/gwyn/configuration.nix | 2 -- systems/gwyn/hardware-configuration.nix | 31 +++++++++---------------- 3 files changed, 24 insertions(+), 36 deletions(-) diff --git a/flake.nix b/flake.nix index ce88eb9..47f52b5 100644 --- a/flake.nix +++ b/flake.nix @@ -15,7 +15,7 @@ }; outputs = - inputs @ { self + inputs@{ self , nixpkgs , nixpkgs-unstable , nixos-hardware @@ -55,12 +55,14 @@ in { nixosConfigurations = { - gwyn = nixpkgs.lib.nixosSystem { - inherit system pkgs; - modules = [ - ./systems/gwyn/configuration.nix + gwyn = mkComputer + ./systems/gwyn/configuration.nix + [ nixos-hardware.nixosModules.dell-precision-5530 nixos-hardware.nixosModules.common-gpu-nvidia + ./hardware/bluetooth + ./hardware/nvidia + ./modules/desktop.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; @@ -71,14 +73,13 @@ }; } ]; - }; staubfinger = mkComputer ./systems/staubfinger/configuration.nix [ - ./modules/desktop.nix - ./hardware/bluetooth nixos-hardware.nixosModules.common-pc-laptop nixos-hardware.nixosModules.common-pc-laptop-ssd + ./hardware/bluetooth + ./modules/desktop.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; @@ -89,10 +90,9 @@ }; } ]; - nixos-vm = nixpkgs.lib.nixosSystem { - inherit system pkgs; - modules = [ - ./systems/vm/configuration.nix + nixos-vm = mkComputer + ./systems/vm/configuration.nix + [ home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; @@ -103,12 +103,11 @@ }; } ]; - }; nixos-test-vm = mkComputer ./systems/proxmox-vm/configuration.nix [ - ./modules/docker.nix ./modules/code-server + ./modules/docker.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; diff --git a/systems/gwyn/configuration.nix b/systems/gwyn/configuration.nix index 6f457e8..92a210a 100644 --- a/systems/gwyn/configuration.nix +++ b/systems/gwyn/configuration.nix @@ -2,8 +2,6 @@ { imports = [ - ../../modules/desktop.nix - ../../hardware/bluetooth ./hardware-configuration.nix ]; diff --git a/systems/gwyn/hardware-configuration.nix b/systems/gwyn/hardware-configuration.nix index 71dc0f7..111a6cf 100644 --- a/systems/gwyn/hardware-configuration.nix +++ b/systems/gwyn/hardware-configuration.nix @@ -1,10 +1,5 @@ { lib, ... }: - { - imports = [ - ../../hardware/nvidia - ]; - boot.initrd.availableKernelModules = [ "aesni_intel" "ahci" @@ -22,22 +17,18 @@ boot.extraModulePackages = [ ]; boot.kernelParams = [ ]; powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; - boot.initrd.luks.devices."cryptlvm".device = "/dev/nvme0n1p2"; - fileSystems."/" = - { - device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - }; - - fileSystems."/boot" = - { - device = "/dev/disk/by-label/BOOT"; - fsType = "vfat"; - }; - - swapDevices = - [{ device = "/dev/disk/by-label/swap"; }]; + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; + fileSystems."/boot" = { + device = "/dev/disk/by-label/BOOT"; + fsType = "vfat"; + }; + swapDevices = [ + { device = "/dev/disk/by-label/swap"; } + ]; }