aboutsummaryrefslogtreecommitdiffstats
path: root/hosts/default.nix
diff options
context:
space:
mode:
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}";
};
};