mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-10 04:49:19 -08:00
Making the host import system take profiles as an argument
This commit is contained in:
parent
8446e95a5f
commit
526d03d18e
7 changed files with 57 additions and 21 deletions
|
|
@ -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";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
};
|
||||
|
|
|
|||
25
config/hosts/ostara/meta.nix
Normal file
25
config/hosts/ostara/meta.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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")
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue