Replace machineConfig variable

This commit is contained in:
Manuel Thalmann 2024-05-11 20:02:43 +02:00
parent 0e092d427b
commit b227f1865f
3 changed files with 10 additions and 15 deletions

View file

@ -92,10 +92,6 @@
name = hostname; name = hostname;
config = (pkgs.callPackage config { }); config = (pkgs.callPackage config { });
}; };
machineConfig = (pkgs.callPackage config { }) // {
inherit hostname;
};
}; };
}) })
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
@ -136,7 +132,6 @@
}; };
inherit inherit
machineConfig
username username
; ;

View file

@ -1,4 +1,4 @@
{ lib, machineConfig, machineInfo, ... }: { { lib, machineInfo, ... }: {
imports = [ imports = [
./modules/custom-build-vm.nix ./modules/custom-build-vm.nix
./modules/custom-sops-nix.nix ./modules/custom-sops-nix.nix
@ -28,7 +28,7 @@
vmVariantWithBootLoader = vmConfig; vmVariantWithBootLoader = vmConfig;
}; };
users.myUsers = machineConfig.users; users.myUsers = machineInfo.config.users;
home-manager = { home-manager = {
useUserPackages = true; useUserPackages = true;
@ -50,19 +50,19 @@
} // args); } // args);
} }
else {}) else {})
machineConfig.users; machineInfo.config.users;
}; };
# Networking # Networking
networking.hostName = machineInfo.name; networking.hostName = machineInfo.name;
# Set time zone # Set time zone
time.timeZone = machineConfig.timeZone; time.timeZone = machineInfo.config.timeZone;
# Configure keyboard layout # Configure keyboard layout
console.keyMap = machineConfig.keyMap; console.keyMap = machineInfo.config.keyMap;
services.xserver.xkb.layout = machineConfig.keyboardLayout; services.xserver.xkb.layout = machineInfo.config.keyboardLayout;
i18n.extraLocaleSettings = machineConfig.localeSettings; i18n.extraLocaleSettings = machineInfo.config.localeSettings;
}; };
} }

View file

@ -1,11 +1,11 @@
{ lib, machineConfig, ... }: { { lib, machineInfo, ... }: {
config = { config = {
nixpkgs = { nixpkgs = {
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) ( config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) (
let let
names = names =
(lib.optional machineConfig.xone "xow_dongle-firmware") ++ (lib.optional machineInfo.config.xone "xow_dongle-firmware") ++
(lib.optionals machineConfig.nvidia [ (lib.optionals machineInfo.config.nvidia [
"cuda_cccl" "cuda_cccl"
"cuda_cudart" "cuda_cudart"
"cuda_cuobjdump" "cuda_cuobjdump"