Replace hostname variable with machineInfo

This commit is contained in:
Manuel Thalmann 2024-05-11 19:53:58 +02:00
parent 54807aa9e2
commit 0e092d427b
2 changed files with 3 additions and 5 deletions

View file

@ -88,8 +88,6 @@
( (
{ pkgs, ... }: { { pkgs, ... }: {
config._module.args = { config._module.args = {
inherit hostname;
machineInfo = machine // { machineInfo = machine // {
name = hostname; name = hostname;
config = (pkgs.callPackage config { }); config = (pkgs.callPackage config { });
@ -139,7 +137,6 @@
inherit inherit
machineConfig machineConfig
hostname
username username
; ;

View file

@ -1,4 +1,4 @@
{ hostname, lib, machineConfig, ... }: { { lib, machineConfig, machineInfo, ... }: {
imports = [ imports = [
./modules/custom-build-vm.nix ./modules/custom-build-vm.nix
./modules/custom-sops-nix.nix ./modules/custom-sops-nix.nix
@ -37,6 +37,7 @@
users = users =
lib.attrsets.concatMapAttrs (username: user: lib.attrsets.concatMapAttrs (username: user:
let let
hostname = machineInfo.name;
getUserConfig = import ./utils/user-config.nix { inherit lib; }; getUserConfig = import ./utils/user-config.nix { inherit lib; };
configPath = getUserConfig { inherit hostname username; }; configPath = getUserConfig { inherit hostname username; };
in in
@ -53,7 +54,7 @@
}; };
# Networking # Networking
networking.hostName = hostname; networking.hostName = machineInfo.name;
# Set time zone # Set time zone
time.timeZone = machineConfig.timeZone; time.timeZone = machineConfig.timeZone;