aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/default.nix
diff options
context:
space:
mode:
authorSoispha Peetz <soispha@b-peetz.de>2026-10-29 23:32:22 +0100
committerSoispha Peetz <soispha@b-peetz.de>2026-11-27 00:27:17 +0100
commit021564ffd40d54a59dd461b7d0d5e00a3c86ed0e (patch)
tree86e5d3612603fdf50b84c4c3fb62b0537da28249 /hosts/default.nix
parenttests/stalwart-*: Hard disable them (diff)
downloadnixos-server-021564ffd40d54a59dd461b7d0d5e00a3c86ed0e.zip
treewide: Rework entry points and attribute names
That just makes a lot of stuff easier and more streamlined. Also, all choices between stable or unstable nixpkgs should now be explicit.
Diffstat (limited to '')
-rw-r--r--hosts/default.nix44
1 files changed, 29 insertions, 15 deletions
diff --git a/hosts/default.nix b/hosts/default.nix
index 613db37..4a3d52f 100644
--- a/hosts/default.nix
+++ b/hosts/default.nix
@@ -1,34 +1,48 @@
{
- pkgs,
- nixLib,
- nixpkgs,
- specialArgs,
- extraModules,
- deploy-rs,
self,
+ extra_lib,
+ module_args,
+ extra_modules,
+ special_args,
+ nixpkgs-stable,
+ nixpkgs-unstable,
+ deploy-rs,
+ system,
}: let
- hosts = nixLib.mkByName {
+ hosts = extra_lib.mkByName {
useShards = false;
baseDirectory = ./by-name;
fileName = "configuration.nix";
};
- mkNixosConfiguration = _: value:
+ mkNixosConfiguration = name: path: let
+ host_file = builtins.fromTOML (builtins.readFile (path + "/../host.toml"));
+ nixpkgs =
+ if host_file.nixpkgs == "stable"
+ then nixpkgs-stable
+ else nixpkgs-unstable;
+ in
nixpkgs.lib.nixosSystem {
- system = "x86_64-linux";
- inherit specialArgs;
+ specialArgs = special_args;
modules =
- extraModules
+ extra_modules
++ [
+ {
+ _module.args = module_args;
+ }
+ path
+
../modules
- value
+ # ../modules/common
];
};
- mkDeployHost = name: value: {
- hostname = "${name}.vhack.eu";
+ mkDeployHost = name: path: let
+ host_file = builtins.fromTOML (builtins.readFile path + "/host.toml");
+ in {
+ inherit (host_file) hostname;
profiles.system = {
user = "root";
- path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations."${name}";
+ path = deploy-rs.lib."${system}".activate.nixos self.nixosConfigurations."${name}";
};
};