Making the host import system take profiles as an argument

This commit is contained in:
kat witch 2021-08-08 02:14:20 +01:00
parent 8446e95a5f
commit 526d03d18e
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
7 changed files with 57 additions and 21 deletions

View file

@ -1,4 +1,4 @@
{ lib, config, ... }: with lib; {
{ lib, config, profiles, ... }: with lib; {
config = {
deploy.targets.infra = {
tf = {
@ -22,7 +22,10 @@ config = {
};
};
network.nodes.athame = {
imports = lib.hostImport "athame";
imports = lib.hostImport {
hostName = "athame";
inherit profiles;
};
networking = {
hostName = "athame";
};

View file

@ -1,4 +1,4 @@
{ lib, config, ... }: with lib; {
{ lib, config, profiles, ... }: with lib; {
config = {
deploy.targets.beltane = {
tf = {
@ -13,7 +13,10 @@
};
};
network.nodes.beltane = {
imports = lib.hostImport "beltane";
imports = lib.hostImport {
hostName = "beltane";
inherit profiles;
};
networking = {
hostName = "beltane";
};

View file

@ -1,7 +1,10 @@
{ lib, config, ... }: with lib; {
{ lib, config, profiles, ... }: with lib; {
deploy.targets.dummy.enable = false;
network.nodes.dummy = {
imports = lib.hostImport "dummy";
imports = lib.hostImport {
hostName = "dummy";
inherit profiles;
};
networking = {
hostName = "dummy";
};

View file

@ -0,0 +1,25 @@
{ lib, config, profiles, ... }: with lib; {
config = {
deploy.targets.ostara = {
tf = {
resources.ostara = {
provider = "null";
type = "resource";
connection = {
port = 62954;
host = "192.168.1.245";
};
};
};
};
network.nodes.ostara = {
imports = lib.hostImport {
hostName = "ostara";
inherit profiles;
};
networking = {
hostName = "ostara";
};
};
};
}

View file

@ -1,4 +1,4 @@
{ lib, config, ... }: with lib; {
{ lib, config, profiles, ... }: with lib; {
config = {
deploy.targets.personal = {
tf = {
@ -13,7 +13,10 @@
};
};
network.nodes.samhain = {
imports = lib.hostImport "samhain";
imports = lib.hostImport {
hostName = "samhain";
inherit profiles;
};
networking = {
hostName = "samhain";
};

View file

@ -1,4 +1,4 @@
{ lib, config, ... }: with lib; {
{ lib, config, profiles, ... }: with lib; {
config = {
deploy.targets.personal = {
tf = {
@ -13,7 +13,10 @@
};
};
network.nodes.yule = {
imports = lib.hostImport "yule";
imports = lib.hostImport {
hostName = "yule";
inherit profiles;
};
networking = {
hostName = "yule";
};

View file

@ -1,15 +1,11 @@
{ lib }: hostName: with lib; filter builtins.pathExists [
{ lib }: { hostName, profiles }: with lib; filter builtins.pathExists [
(../../config/hosts + "/${hostName}/nixos.nix")
(../../config/trusted/hosts + "/${hostName}/nixos.nix")
../../config/trusted/profile
../../config/profiles/base
] ++ singleton {
options.home-manager.users = mkOption {
type = types.attrsOf (types.submoduleWith {
modules = filter builtins.pathExists [
(../../config/hosts + "/${hostName}/home.nix")
(../../config/trusted/hosts + "/${hostName}/home.nix")
];
});
] ++ profiles.base.imports ++ singleton {
home-manager.users.kat = {
imports = filter builtins.pathExists [
(../../config/hosts + "/${hostName}/home.nix")
(../../config/trusted/hosts + "/${hostName}/home.nix")
];
};
}