refactor: add config.host option for host variables

This commit is contained in:
2026-03-11 21:53:47 +01:00
parent 4c9db2b822
commit 43dff3e8e5
10 changed files with 89 additions and 72 deletions

View File

@@ -5,10 +5,6 @@
pkgs,
...
}:
let
username = "h";
hostName = "vm";
in
{
imports = [
inputs.disko.nixosModules.disko
@@ -18,7 +14,7 @@ in
./disk.nix
../../modules/boot/bootloader.nix
../../modules/keyboard
(import ../../modules/networking { inherit hostName; })
(import ../../modules/networking { hostName = config.host.name; })
../../modules/users
../../modules/audio
../../modules/localization
@@ -31,14 +27,19 @@ in
})
];
home-manager.users.${username} = import ../../home/hosts/vm {
host = {
username = "h";
name = "vm";
};
home-manager.users.${config.host.username} = import ../../home/hosts/vm {
inherit inputs config pkgs;
};
networking.hostName = hostName;
ssh.username = username;
networking.hostName = config.host.name;
ssh.username = config.host.username;
secrets.username = username;
secrets.username = config.host.username;
disko = {
devices.disk.main = {