Compare commits

..

No commits in common. "bcec9a18c3243a920777683ddfd1eea768c3b510" and "102d6b3cbf7acd6cc906ed0cb2cca115fc87ff2f" have entirely different histories.

7 changed files with 11 additions and 107 deletions

View file

@ -1,4 +0,0 @@
{
domain = "staging.kallestruik.nl";
shortDomain = "khs.li";
}

View file

@ -11,14 +11,11 @@
let
outputs = self.outputs;
utils = import ./utils.nix { inherit nixpkgs inputs outputs; };
homelabConfig = import ./config.nix;
roles = import ./roles { inherit utils; };
hosts = import ./hosts.nix { inherit homelabConfig roles; };
in
{
nixosConfigurations = nixpkgs.lib.mapAttrs (
hostname: value: (utils.mkSystem value // { inherit hostname; })
) hosts;
nixosConfigurations = {
"base" = utils.mkSystem [ ];
"nix-test" = utils.mkSystem [ ./systems/nix-test.nix ];
};
};
}

View file

@ -1,25 +0,0 @@
{
roles,
homelabConfig,
...
}:
let
hlConfig = homelabConfig;
in
{
base = {
roles = [ ];
config = { };
stateVersion = "24.05";
};
nix-test = {
roles = with roles; [
sonarr
];
config = {
sonarr.domain = "sonarr.${hlConfig.domain}";
};
stateVersion = "24.05";
};
}

View file

@ -1,6 +0,0 @@
{
utils,
}:
{
sonarr = utils.mkRole (import ./sonarr.nix);
}

View file

@ -1,43 +0,0 @@
{
name = "Sonarr";
description = ''
Sonarr PVR
'';
traefikRoutes =
{
hostname,
config,
...
}:
[
{
name = "${hostname}-sonarr";
rule = "Host(`${config.sonarr.domain}`)";
target = "http://${hostname}.lan:8989";
}
];
nixosModules =
{ lib, ... }:
{
options.sonarr = {
domain = lib.mkOption {
type = lib.types.listOf lib.types.str;
};
};
config = {
# Enable the sonarr service
services.sonarr = {
enable = true;
openFirewall = true;
group = "media";
};
# Ensure that the media group exists
users.groups.media = { };
};
};
}

View file

@ -41,7 +41,7 @@
openssh.authorizedKeys.keyFiles = [ ../../authorized_keys ];
};
users.groups."maintenance" = { };
users.groups."maintenance" = {};
# Enable mDNS for `hostname.local` addresses
services.avahi.enable = true;
@ -94,7 +94,7 @@
enable = true;
global = {
fsid = "b9b22d11-3492-49a6-92b7-b36cdf0161fe";
monHost = "v2:192.168.10.3:3300/0,v1:192.168.10.3:6789/0";
monHost = "v2:192.168.1.239:3300/0,v1:192.168.1.239:6789/0";
};
};

View file

@ -6,30 +6,15 @@
}:
{
mkSystem =
hostConfig:
configs:
nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = {
inherit inputs outputs hostConfig;
inherit inputs outputs;
};
modules = [
modules = [
inputs.impermanence.nixosModules.impermanence
# inputs.sops-nix.nixosModules.sops
./systems/base/configuration.nix
(
{ ... }:
{
networking.hostName = hostConfig.hostname;
system.stateVersion = hostConfig.stateVersion;
}
)
({ ... }: hostConfig.config)
] ++ builtins.map (role: role.nixosModule) hostConfig.roles;
./systems/base/configuration.nix
] ++ configs;
};
mkRole = cfg: {
inherit (cfg) name description nixosModule;
traefikRoutes = cfg.traefikRoutes or ({ ... }: [ ]);
};
}