Compare commits
No commits in common. "35bfc55356b19a4555597e583035f70ac19a9265" and "7d64b2b4a3debcd1472c7313885b70f5c03ee0db" have entirely different histories.
35bfc55356
...
7d64b2b4a3
6 changed files with 35 additions and 56 deletions
|
@ -1,2 +1 @@
|
|||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILZKBTf7HdsZDJDwblnROAaGZDIWi/jWNwGjrih8UPuY kalle@kalle-laptop
|
||||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPxzPYIYw3Ysv5LwzC2zSjE8kcycgZ/vm+r0iOt6+XI2 kalle@kalle-pc
|
||||
|
|
|
@ -18,17 +18,14 @@
|
|||
|
||||
homelabConfig = import ./config.nix;
|
||||
roles = import ./roles { inherit utils; };
|
||||
hosts = import ./hosts.nix {
|
||||
inherit homelabConfig roles;
|
||||
lib = nixpkgs.lib;
|
||||
};
|
||||
hosts = import ./hosts.nix { inherit homelabConfig roles; };
|
||||
in
|
||||
{
|
||||
nixosConfigurations = nixpkgs.lib.mapAttrs (
|
||||
_: value:
|
||||
hostname: value:
|
||||
(utils.mkSystem {
|
||||
inherit hosts;
|
||||
hostConfig = value;
|
||||
hostConfig = (value // { inherit hostname; });
|
||||
})
|
||||
) hosts;
|
||||
};
|
||||
|
|
43
hosts.nix
43
hosts.nix
|
@ -1,20 +1,37 @@
|
|||
{
|
||||
roles,
|
||||
homelabConfig,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
lib.attrsets.mapAttrs' (
|
||||
name: _:
|
||||
let
|
||||
cfg = import (./hosts + "/${name}") {
|
||||
inherit roles;
|
||||
let
|
||||
hlConfig = homelabConfig;
|
||||
in
|
||||
{
|
||||
base = {
|
||||
roles = [ ];
|
||||
config = { };
|
||||
stateVersion = "24.05";
|
||||
};
|
||||
hostname = cfg.hostname;
|
||||
in
|
||||
{
|
||||
name = hostname;
|
||||
value = cfg;
|
||||
}
|
||||
) (builtins.readDir ./hosts)
|
||||
|
||||
nix-test = {
|
||||
roles = with roles; [
|
||||
traefik
|
||||
sonarr
|
||||
];
|
||||
config = {
|
||||
sonarr.domain = "sonarr2.${hlConfig.domain}";
|
||||
traefik.wildcardDomains = [ hlConfig.domain ];
|
||||
};
|
||||
stateVersion = "24.05";
|
||||
};
|
||||
|
||||
nix-test2 = {
|
||||
roles = with roles; [
|
||||
sonarr
|
||||
];
|
||||
config = {
|
||||
sonarr.domain = "sonarr.${hlConfig.domain}";
|
||||
};
|
||||
stateVersion = "24.05";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
{
|
||||
roles,
|
||||
hlConfig,
|
||||
}:
|
||||
{
|
||||
hostname = "base";
|
||||
managed = true;
|
||||
ip = "192.168.10.98";
|
||||
|
||||
roles = with roles; [
|
||||
];
|
||||
config = {
|
||||
};
|
||||
stateVersion = "24.05";
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
roles,
|
||||
hlConfig,
|
||||
}:
|
||||
{
|
||||
hostname = "nix-test";
|
||||
managed = true;
|
||||
ip = "192.168.10.99";
|
||||
|
||||
roles = with roles; [
|
||||
traefik
|
||||
sonarr
|
||||
];
|
||||
config = {
|
||||
sonarr.domain = "sonarr2.${hlConfig.domain}";
|
||||
traefik.wildcardDomains = [ hlConfig.domain ];
|
||||
};
|
||||
stateVersion = "24.05";
|
||||
}
|
|
@ -14,7 +14,7 @@
|
|||
{
|
||||
name = "${hostname}-sonarr";
|
||||
rule = "Host(`${config.sonarr.domain}`)";
|
||||
target = "http://${config.ip}:8989";
|
||||
target = "http://${hostname}.lan:8989";
|
||||
}
|
||||
];
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue