Compare commits

..

No commits in common. "35bfc55356b19a4555597e583035f70ac19a9265" and "7d64b2b4a3debcd1472c7313885b70f5c03ee0db" have entirely different histories.

6 changed files with 35 additions and 56 deletions

View file

@ -1,2 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILZKBTf7HdsZDJDwblnROAaGZDIWi/jWNwGjrih8UPuY kalle@kalle-laptop ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILZKBTf7HdsZDJDwblnROAaGZDIWi/jWNwGjrih8UPuY kalle@kalle-laptop
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPxzPYIYw3Ysv5LwzC2zSjE8kcycgZ/vm+r0iOt6+XI2 kalle@kalle-pc

View file

@ -18,17 +18,14 @@
homelabConfig = import ./config.nix; homelabConfig = import ./config.nix;
roles = import ./roles { inherit utils; }; roles = import ./roles { inherit utils; };
hosts = import ./hosts.nix { hosts = import ./hosts.nix { inherit homelabConfig roles; };
inherit homelabConfig roles;
lib = nixpkgs.lib;
};
in in
{ {
nixosConfigurations = nixpkgs.lib.mapAttrs ( nixosConfigurations = nixpkgs.lib.mapAttrs (
_: value: hostname: value:
(utils.mkSystem { (utils.mkSystem {
inherit hosts; inherit hosts;
hostConfig = value; hostConfig = (value // { inherit hostname; });
}) })
) hosts; ) hosts;
}; };

View file

@ -1,20 +1,37 @@
{ {
roles, roles,
homelabConfig, homelabConfig,
lib,
... ...
}: }:
lib.attrsets.mapAttrs' ( let
name: _: hlConfig = homelabConfig;
let in
cfg = import (./hosts + "/${name}") { {
inherit roles; base = {
hlConfig = homelabConfig; roles = [ ];
config = { };
stateVersion = "24.05";
};
nix-test = {
roles = with roles; [
traefik
sonarr
];
config = {
sonarr.domain = "sonarr2.${hlConfig.domain}";
traefik.wildcardDomains = [ hlConfig.domain ];
}; };
hostname = cfg.hostname; stateVersion = "24.05";
in };
{
name = hostname; nix-test2 = {
value = cfg; roles = with roles; [
} sonarr
) (builtins.readDir ./hosts) ];
config = {
sonarr.domain = "sonarr.${hlConfig.domain}";
};
stateVersion = "24.05";
};
}

View file

@ -1,15 +0,0 @@
{
roles,
hlConfig,
}:
{
hostname = "base";
managed = true;
ip = "192.168.10.98";
roles = with roles; [
];
config = {
};
stateVersion = "24.05";
}

View file

@ -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";
}

View file

@ -14,7 +14,7 @@
{ {
name = "${hostname}-sonarr"; name = "${hostname}-sonarr";
rule = "Host(`${config.sonarr.domain}`)"; rule = "Host(`${config.sonarr.domain}`)";
target = "http://${config.ip}:8989"; target = "http://${hostname}.lan:8989";
} }
]; ];