From b227f1865f0e5a32950643f7c37dc47dac24ebfa Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 11 May 2024 20:02:43 +0200 Subject: [PATCH] Replace `machineConfig` variable --- flake.nix | 5 ----- lib/configuration.nix | 14 +++++++------- lib/modules/unfree.nix | 6 +++--- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index 207195c..0efa939 100644 --- a/flake.nix +++ b/flake.nix @@ -92,10 +92,6 @@ name = hostname; config = (pkgs.callPackage config { }); }; - - machineConfig = (pkgs.callPackage config { }) // { - inherit hostname; - }; }; }) home-manager.nixosModules.home-manager @@ -136,7 +132,6 @@ }; inherit - machineConfig username ; diff --git a/lib/configuration.nix b/lib/configuration.nix index 2fa3690..601245a 100644 --- a/lib/configuration.nix +++ b/lib/configuration.nix @@ -1,4 +1,4 @@ -{ lib, machineConfig, machineInfo, ... }: { +{ lib, machineInfo, ... }: { imports = [ ./modules/custom-build-vm.nix ./modules/custom-sops-nix.nix @@ -28,7 +28,7 @@ vmVariantWithBootLoader = vmConfig; }; - users.myUsers = machineConfig.users; + users.myUsers = machineInfo.config.users; home-manager = { useUserPackages = true; @@ -50,19 +50,19 @@ } // args); } else {}) - machineConfig.users; + machineInfo.config.users; }; # Networking networking.hostName = machineInfo.name; # Set time zone - time.timeZone = machineConfig.timeZone; + time.timeZone = machineInfo.config.timeZone; # Configure keyboard layout - console.keyMap = machineConfig.keyMap; - services.xserver.xkb.layout = machineConfig.keyboardLayout; + console.keyMap = machineInfo.config.keyMap; + services.xserver.xkb.layout = machineInfo.config.keyboardLayout; - i18n.extraLocaleSettings = machineConfig.localeSettings; + i18n.extraLocaleSettings = machineInfo.config.localeSettings; }; } diff --git a/lib/modules/unfree.nix b/lib/modules/unfree.nix index c65ba7c..166740e 100644 --- a/lib/modules/unfree.nix +++ b/lib/modules/unfree.nix @@ -1,11 +1,11 @@ -{ lib, machineConfig, ... }: { +{ lib, machineInfo, ... }: { config = { nixpkgs = { config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) ( let names = - (lib.optional machineConfig.xone "xow_dongle-firmware") ++ - (lib.optionals machineConfig.nvidia [ + (lib.optional machineInfo.config.xone "xow_dongle-firmware") ++ + (lib.optionals machineInfo.config.nvidia [ "cuda_cccl" "cuda_cudart" "cuda_cuobjdump"