Rename variable holding machine infos

This commit is contained in:
Manuel Thalmann 2024-05-11 20:04:14 +02:00
parent b227f1865f
commit 58b2763c92
3 changed files with 14 additions and 14 deletions

View file

@ -88,7 +88,7 @@
(
{ pkgs, ... }: {
config._module.args = {
machineInfo = machine // {
machine = machine // {
name = hostname;
config = (pkgs.callPackage config { });
};
@ -126,7 +126,7 @@
(
{ pkgs, ... }: {
config._module.args = {
machineInfo = machine // {
machine = machine // {
name = hostname;
config = machineConfig;
};

View file

@ -1,4 +1,4 @@
{ lib, machineInfo, ... }: {
{ lib, machine, ... }: {
imports = [
./modules/custom-build-vm.nix
./modules/custom-sops-nix.nix
@ -28,7 +28,7 @@
vmVariantWithBootLoader = vmConfig;
};
users.myUsers = machineInfo.config.users;
users.myUsers = machine.config.users;
home-manager = {
useUserPackages = true;
@ -37,7 +37,7 @@
users =
lib.attrsets.concatMapAttrs (username: user:
let
hostname = machineInfo.name;
hostname = machine.name;
getUserConfig = import ./utils/user-config.nix { inherit lib; };
configPath = getUserConfig { inherit hostname username; };
in
@ -50,19 +50,19 @@
} // args);
}
else {})
machineInfo.config.users;
machine.config.users;
};
# Networking
networking.hostName = machineInfo.name;
networking.hostName = machine.name;
# Set time zone
time.timeZone = machineInfo.config.timeZone;
time.timeZone = machine.config.timeZone;
# Configure keyboard layout
console.keyMap = machineInfo.config.keyMap;
services.xserver.xkb.layout = machineInfo.config.keyboardLayout;
console.keyMap = machine.config.keyMap;
services.xserver.xkb.layout = machine.config.keyboardLayout;
i18n.extraLocaleSettings = machineInfo.config.localeSettings;
i18n.extraLocaleSettings = machine.config.localeSettings;
};
}

View file

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