ark/hosts/default.nix

48 lines
1.1 KiB
Nix
Raw Normal View History

2020-11-21 23:54:07 +03:00
inputs@{ home, impermanence, mynex, nixpkgs, self, pkgs, system, ... }:
let
utils = import ../lib/utils.nix { inherit lib pkgs; };
inherit (nixpkgs) lib;
inherit (utils) recImport;
config = hostName:
lib.nixosSystem {
inherit system;
specialArgs = {
usr = { inherit utils; };
util = utils;
nixosPersistence = "${impermanence}/nixos.nix";
};
2020-12-23 19:54:51 +03:00
modules =
let
inherit (home.nixosModules) home-manager;
inherit (mynex.nixosModules) security networking;
core = ../profiles/core.nix;
global = {
networking.hostName = hostName;
nix.nixPath = [
"nixpkgs=${nixpkgs}"
"nixos-config=/etc/nixos/configuration.nix"
"nixpkgs-overlays=/etc/nixos/overlays"
];
nixpkgs = { inherit pkgs; };
nixpkgs.overlays = [ mynex.overlay ];
};
local = import "${toString ./.}/${hostName}.nix";
in
[ core global local home-manager security networking ];
2020-11-21 23:54:07 +03:00
};
hosts = recImport {
dir = ./.;
_import = config;
};
2020-12-23 19:54:51 +03:00
in
hosts