refactor: extract host config into 'host.nix' files
This commit is contained in:
@@ -12,12 +12,13 @@ in
|
||||
{
|
||||
imports = [
|
||||
inputs.disko.nixosModules.disko
|
||||
../../modules/common
|
||||
./hard.nix
|
||||
./host.nix
|
||||
inputs.nixos-hardware.nixosModules.common-cpu-intel
|
||||
inputs.nixos-hardware.nixosModules.common-pc
|
||||
inputs.nixos-hardware.nixosModules.common-pc-ssd
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
../../modules/common
|
||||
../../modules/boot/bootloader.nix
|
||||
(import ../../modules/disko/zfs-encrypted-root.nix {
|
||||
inherit lib config;
|
||||
@@ -43,11 +44,6 @@ in
|
||||
../../modules/yubikey
|
||||
];
|
||||
|
||||
host = {
|
||||
username = "h";
|
||||
name = "andromache";
|
||||
};
|
||||
|
||||
home-manager.users.${config.host.username} = import ../../home/hosts/andromache {
|
||||
inherit
|
||||
inputs
|
||||
|
||||
6
hosts/andromache/host.nix
Normal file
6
hosts/andromache/host.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
host = {
|
||||
username = "h";
|
||||
name = "andromache";
|
||||
};
|
||||
}
|
||||
@@ -11,12 +11,13 @@ in
|
||||
{
|
||||
imports = [
|
||||
inputs.disko.nixosModules.disko
|
||||
../../modules/common
|
||||
./hard.nix
|
||||
./host.nix
|
||||
inputs.nixos-hardware.nixosModules.common-pc
|
||||
inputs.nixos-hardware.nixosModules.common-pc-ssd
|
||||
# inputs.nixos-hardware.nixosModules.lenovo-thinkpad-e14-intel-gen7 (not available yet?)
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
../../modules/common
|
||||
../../modules/boot/bootloader.nix
|
||||
(import ../../modules/disko/zfs-encrypted-root.nix {
|
||||
inherit lib config;
|
||||
@@ -40,11 +41,6 @@ in
|
||||
../../modules/nfc
|
||||
];
|
||||
|
||||
host = {
|
||||
username = "h";
|
||||
name = "astyanax";
|
||||
};
|
||||
|
||||
home-manager.users.${config.host.username} = import ../../home/hosts/astyanax {
|
||||
inherit
|
||||
inputs
|
||||
|
||||
6
hosts/astyanax/host.nix
Normal file
6
hosts/astyanax/host.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
host = {
|
||||
username = "h";
|
||||
name = "astyanax";
|
||||
};
|
||||
}
|
||||
@@ -6,15 +6,11 @@
|
||||
{
|
||||
imports = [
|
||||
./hard.nix
|
||||
../../modules/ssh
|
||||
./host.nix
|
||||
../../modules/common
|
||||
../../modules/ssh
|
||||
];
|
||||
|
||||
host = {
|
||||
username = "h";
|
||||
name = "eetion-02";
|
||||
};
|
||||
|
||||
ssh = {
|
||||
inherit (config.host) username;
|
||||
publicHostname = config.host.name;
|
||||
|
||||
6
hosts/eetion-02/host.nix
Normal file
6
hosts/eetion-02/host.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
host = {
|
||||
username = "h";
|
||||
name = "eetion-02";
|
||||
};
|
||||
}
|
||||
@@ -6,16 +6,12 @@
|
||||
{
|
||||
imports = [
|
||||
./hard.nix
|
||||
../../modules/ssh
|
||||
./host.nix
|
||||
../../modules/common
|
||||
../../modules/ssh
|
||||
# ../../modules/uptime-kuma
|
||||
];
|
||||
|
||||
host = {
|
||||
username = "h";
|
||||
name = "eetion";
|
||||
};
|
||||
|
||||
ssh = {
|
||||
inherit (config.host) username;
|
||||
publicHostname = config.host.name;
|
||||
|
||||
6
hosts/eetion/host.nix
Normal file
6
hosts/eetion/host.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
host = {
|
||||
username = "h";
|
||||
name = "eetion";
|
||||
};
|
||||
}
|
||||
@@ -10,17 +10,13 @@
|
||||
{
|
||||
imports = [
|
||||
inputs.disko.nixosModules.disko
|
||||
../../modules/common
|
||||
./hard.nix
|
||||
./host.nix
|
||||
../../modules/common
|
||||
../../modules/ssh
|
||||
../../modules/docker
|
||||
];
|
||||
|
||||
host = {
|
||||
username = "username";
|
||||
name = "hecuba";
|
||||
};
|
||||
|
||||
networking.hostName = config.host.name;
|
||||
ssh = {
|
||||
inherit (config.host) username;
|
||||
|
||||
6
hosts/hecuba/host.nix
Normal file
6
hosts/hecuba/host.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
host = {
|
||||
username = "username";
|
||||
name = "hecuba";
|
||||
};
|
||||
}
|
||||
@@ -8,10 +8,11 @@
|
||||
{
|
||||
imports = [
|
||||
inputs.disko.nixosModules.disko
|
||||
../../modules/common
|
||||
./hard.nix
|
||||
./host.nix
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
./disk.nix
|
||||
../../modules/common
|
||||
../../modules/boot/bootloader.nix
|
||||
../../modules/keyboard
|
||||
(import ../../modules/networking { hostName = config.host.name; })
|
||||
@@ -22,16 +23,12 @@
|
||||
../../modules/fonts
|
||||
../../modules/ssh
|
||||
../../modules/storage
|
||||
../../modules/stylix
|
||||
(import ../../modules/secrets {
|
||||
inherit lib inputs config;
|
||||
})
|
||||
];
|
||||
|
||||
host = {
|
||||
username = "h";
|
||||
name = "vm";
|
||||
};
|
||||
|
||||
home-manager.users.${config.host.username} = import ../../home/hosts/vm {
|
||||
inherit inputs config pkgs;
|
||||
};
|
||||
|
||||
6
hosts/vm/host.nix
Normal file
6
hosts/vm/host.nix
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
host = {
|
||||
username = "h";
|
||||
name = "vm";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user