ark/hosts/default.nix

63 lines
1.5 KiB
Nix
Raw Normal View History

{ home, nixpkgs, unstable, unstablePkgs, self, pkgs, system, utils, ... }:
let
inherit (nixpkgs) lib;
inherit (utils) recImport;
2020-01-04 08:06:31 +03:00
inherit (builtins) attrValues removeAttrs;
config = hostName:
lib.nixosSystem {
inherit system;
2020-07-31 07:17:28 +03:00
modules =
let
inherit (home.nixosModules) home-manager;
core = self.nixosModules.profiles.core;
global = {
networking.hostName = hostName;
nix.nixPath = [
"nixpkgs=${nixpkgs}"
"nixos-config=/etc/nixos/configuration.nix"
"nixpkgs-overlays=/etc/nixos/overlays"
];
nixpkgs = { inherit pkgs; };
nix.registry = {
nixpkgs.flake = nixpkgs;
nixflk.flake = self;
master.flake = unstable;
};
};
2020-07-31 07:17:28 +03:00
unstables = {
systemd.package = unstablePkgs.systemd;
nixpkgs.overlays = [
(final: prev:
with unstablePkgs; {
inherit starship element-desktop discord signal-desktop mpv
2020-07-31 07:49:41 +03:00
protonvpn-cli-ng dhall nixpkgs-fmt;
2020-07-31 07:17:28 +03:00
}
)
];
};
2020-07-31 07:17:28 +03:00
local = import "${toString ./.}/${hostName}.nix";
2020-07-31 07:17:28 +03:00
# Everything in `./modules/list.nix`.
flakeModules =
attrValues (removeAttrs self.nixosModules [ "profiles" ]);
2020-07-31 07:17:28 +03:00
in
flakeModules ++ [ core global local home-manager unstables ];
};
2020-01-04 08:06:31 +03:00
hosts = recImport {
dir = ./.;
_import = config;
};
2020-07-31 07:17:28 +03:00
in
hosts