2020-08-02 07:08:41 +03:00
|
|
|
{ home
|
|
|
|
, lib
|
|
|
|
, nixos
|
|
|
|
, master
|
|
|
|
, pkgset
|
|
|
|
, self
|
|
|
|
, system
|
|
|
|
, utils
|
|
|
|
, ...
|
|
|
|
}:
|
2019-12-05 08:36:36 +03:00
|
|
|
let
|
2020-01-06 01:39:59 +03:00
|
|
|
inherit (utils) recImport;
|
2020-01-04 08:06:31 +03:00
|
|
|
inherit (builtins) attrValues removeAttrs;
|
2020-08-02 07:08:41 +03:00
|
|
|
inherit (pkgset) osPkgs pkgs;
|
2019-12-05 08:36:36 +03:00
|
|
|
|
2020-01-11 09:49:18 +03:00
|
|
|
config = hostName:
|
2020-02-02 07:10:09 +03:00
|
|
|
lib.nixosSystem {
|
2020-01-29 18:50:07 +03:00
|
|
|
inherit system;
|
2019-12-05 08:36:36 +03:00
|
|
|
|
2020-07-31 07:17:28 +03:00
|
|
|
modules =
|
|
|
|
let
|
|
|
|
inherit (home.nixosModules) home-manager;
|
|
|
|
|
|
|
|
core = self.nixosModules.profiles.core;
|
|
|
|
|
|
|
|
global = {
|
|
|
|
networking.hostName = hostName;
|
2020-08-02 07:08:41 +03:00
|
|
|
nix.nixPath = let path = toString ../.; in
|
|
|
|
[
|
|
|
|
"nixpkgs=${master}"
|
|
|
|
"nixos=${nixos}"
|
|
|
|
"nixos-config=${path}/configuration.nix"
|
|
|
|
"nixpkgs-overlays=${path}/overlays"
|
|
|
|
];
|
2020-07-31 07:17:28 +03:00
|
|
|
|
2020-08-02 07:08:41 +03:00
|
|
|
nixpkgs = { pkgs = osPkgs; };
|
2020-07-31 07:17:28 +03:00
|
|
|
|
|
|
|
nix.registry = {
|
2020-08-02 07:08:41 +03:00
|
|
|
nixos.flake = nixos;
|
2020-07-31 07:17:28 +03:00
|
|
|
nixflk.flake = self;
|
2020-08-02 07:08:41 +03:00
|
|
|
nixpkgs.flake = master;
|
2020-07-31 07:17:28 +03:00
|
|
|
};
|
2020-08-04 09:11:08 +03:00
|
|
|
|
|
|
|
system.configurationRevision = lib.mkIf (self ? rev) self.rev;
|
2020-07-27 07:18:59 +03:00
|
|
|
};
|
|
|
|
|
2020-08-02 07:08:41 +03:00
|
|
|
overrides = {
|
|
|
|
nixpkgs.overlays =
|
|
|
|
let
|
|
|
|
override = import ../pkgs/override.nix pkgs;
|
|
|
|
|
|
|
|
overlay = pkg: final: prev: {
|
2020-08-02 23:46:16 +03:00
|
|
|
"${pkg.pname}" = pkg;
|
2020-08-02 07:08:41 +03:00
|
|
|
};
|
|
|
|
in
|
|
|
|
map overlay override;
|
2020-07-31 07:17:28 +03:00
|
|
|
};
|
2019-12-05 08:36:36 +03:00
|
|
|
|
2020-07-31 07:17:28 +03:00
|
|
|
local = import "${toString ./.}/${hostName}.nix";
|
2020-01-02 05:12:59 +03:00
|
|
|
|
2020-07-31 07:17:28 +03:00
|
|
|
# Everything in `./modules/list.nix`.
|
|
|
|
flakeModules =
|
|
|
|
attrValues (removeAttrs self.nixosModules [ "profiles" ]);
|
2020-01-04 06:01:22 +03:00
|
|
|
|
2020-07-31 07:17:28 +03:00
|
|
|
in
|
2020-08-02 07:08:41 +03:00
|
|
|
flakeModules ++ [ core global local home-manager overrides ];
|
2019-12-05 08:36:36 +03:00
|
|
|
|
2020-11-18 21:35:08 +03:00
|
|
|
extraArgs = {
|
|
|
|
inherit system;
|
|
|
|
};
|
2019-12-14 07:30:43 +03:00
|
|
|
};
|
2019-12-18 02:03:44 +03:00
|
|
|
|
2020-01-04 08:06:31 +03:00
|
|
|
hosts = recImport {
|
|
|
|
dir = ./.;
|
|
|
|
_import = config;
|
|
|
|
};
|
2020-07-31 07:17:28 +03:00
|
|
|
in
|
|
|
|
hosts
|