diff --git a/flake.lock b/flake.lock index 0648522..e5a7558 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1689282004, - "narHash": "sha256-VNhuyb10c9SV+3hZOlxwJwzEGytZ31gN9w4nPCnNvdI=", + "lastModified": 1689373857, + "narHash": "sha256-mtBksyvhhT98Zsm9tYHuMKuLwUKDwv+BGTl6K5nOGhY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e74e68449c385db82de3170288a28cd0f608544f", + "rev": "dfdbcc428f365071f0ca3888f6ec8c25c3792885", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 8480f96..928ebc4 100644 --- a/flake.nix +++ b/flake.nix @@ -3,49 +3,41 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; }; - outputs = { nixpkgs, ... }: { + outputs = { self, nixpkgs, ... }: { + hosts = { + nitter = { + site = "vs"; + }; + nixos-coturn = { + site = "vs"; + }; + tor-relay = { + site = "vs"; + }; + jackett = { + site = "vs"; + }; + }; + + generateColmenaHost = name: host : { + deployment = { + targetHost = "${name}.${host.site}.grzb.de"; + targetUser = "colmena-deploy"; + }; + + imports = [ + ./configuration/common + ./configuration/proxmox-vm + ./hosts/${name} + ]; + }; + colmena = { meta = { nixpkgs = import nixpkgs { system = "x86_64-linux"; }; }; - - nitter = { name, nodes, pkgs, ... }: { - deployment = { - targetHost = "nitter.vs.grzb.de"; - targetUser = "colmena-deploy"; - }; - imports = [ - ./configuration/common - ./configuration/proxmox-vm - ./hosts/nitter - ]; - }; - - coturn = { name, nodes, pkgs, ... }: { - deployment = { - targetHost = "nixos-coturn.vs.grzb.de"; - targetUser = "colmena-deploy"; - }; - imports = [ - ./configuration/common - ./configuration/proxmox-vm - ./hosts/coturn - ]; - }; - - tor-relay = { name, nodes, pkgs, ...}: { - deployment = { - targetHost = "tor-relay.vs.grzb.de"; - targetUser = "colmena-deploy"; - }; - imports = [ - ./configuration/common - ./configuration/proxmox-vm - ./hosts/tor-relay - ]; - }; - }; + } // builtins.mapAttrs (self.generateColmenaHost) self.hosts; }; } diff --git a/hosts/jackett/configuration.nix b/hosts/jackett/configuration.nix index 72e9795..bd9bde9 100644 --- a/hosts/jackett/configuration.nix +++ b/hosts/jackett/configuration.nix @@ -1,10 +1,9 @@ -{ config, pkgs, ... }: - +{ ... }: { - imports = [ - ./hardware-configuration.nix - ./jackett.nix - ]; + boot.loader.grub = { + enable = true; + device = "/dev/vda"; + }; networking = { hostName = "jackett"; diff --git a/hosts/jackett/default.nix b/hosts/jackett/default.nix new file mode 100644 index 0000000..98e612a --- /dev/null +++ b/hosts/jackett/default.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + imports = [ + ./configuration.nix + ./jackett.nix + ]; +} diff --git a/hosts/nitter/configuration.nix b/hosts/nitter/configuration.nix index 3ca72b4..a7002d0 100644 --- a/hosts/nitter/configuration.nix +++ b/hosts/nitter/configuration.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ ... }: { boot.loader.grub = { enable = true; diff --git a/hosts/coturn/configuration.nix b/hosts/nixos-coturn/configuration.nix similarity index 100% rename from hosts/coturn/configuration.nix rename to hosts/nixos-coturn/configuration.nix diff --git a/hosts/coturn/coturn.nix b/hosts/nixos-coturn/coturn.nix similarity index 100% rename from hosts/coturn/coturn.nix rename to hosts/nixos-coturn/coturn.nix diff --git a/hosts/coturn/default.nix b/hosts/nixos-coturn/default.nix similarity index 100% rename from hosts/coturn/default.nix rename to hosts/nixos-coturn/default.nix diff --git a/hosts/coturn/secrets.nix b/hosts/nixos-coturn/secrets.nix similarity index 100% rename from hosts/coturn/secrets.nix rename to hosts/nixos-coturn/secrets.nix