mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 20:39:18 -08:00
Moving to modules. Structural changes.
This commit is contained in:
parent
3903bc1766
commit
060d4c6d1e
258 changed files with 621 additions and 407 deletions
66
default.nix
66
default.nix
|
|
@ -1,36 +1,54 @@
|
|||
rec {
|
||||
let
|
||||
sources = import ./nix/sources.nix;
|
||||
pkgs = import ./pkgs { inherit sources; };
|
||||
modList = import ./lib/modules.nix;
|
||||
|
||||
profiles = modList {
|
||||
modulesDir = ./profiles;
|
||||
};
|
||||
|
||||
users = modList { modulesDir = ./users; };
|
||||
|
||||
inherit (import ./lib/hosts.nix {
|
||||
inherit pkgs sources profiles users;
|
||||
inherit (deploy) target;
|
||||
}) hosts targets;
|
||||
|
||||
inherit (pkgs) lib;
|
||||
|
||||
runners = import ./runners.nix { inherit lib; inherit (deploy) target; };
|
||||
profiles = lib.modList {
|
||||
modulesDir = ./config/profiles;
|
||||
};
|
||||
|
||||
users = lib.modList {
|
||||
modulesDir = ./config/users;
|
||||
};
|
||||
|
||||
metaConfig = { ... }: {
|
||||
config = {
|
||||
runners = {
|
||||
lazy = {
|
||||
file = ./.;
|
||||
args = [ "--show-trace" ];
|
||||
};
|
||||
};
|
||||
_module.args = {
|
||||
pkgs = lib.mkDefault pkgs;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
eval = lib.evalModules {
|
||||
modules = [
|
||||
metaConfig
|
||||
./config/targets
|
||||
./config/modules/meta/default.nix
|
||||
./config/hosts/athame/meta.nix
|
||||
./config/hosts/samhain/meta.nix
|
||||
./config/hosts/yule/meta.nix
|
||||
];
|
||||
specialArgs = {
|
||||
inherit sources profiles users;
|
||||
};
|
||||
};
|
||||
inherit (eval) config;
|
||||
|
||||
|
||||
sourceCache = with lib; let
|
||||
getSources = sources: removeAttrs sources [ "__functor" "dorkfiles" ];
|
||||
getSources = sources: removeAttrs sources [ "__functor" ]; #"dorkfiles" ];
|
||||
source2drv = value: if isDerivation value.outPath then value.outPath else value;
|
||||
sources2drvs = sources: mapAttrs (_: source2drv) (getSources sources);
|
||||
in recurseIntoAttrs rec {
|
||||
local = sources2drvs sources;
|
||||
hexchen = sources2drvs (import sources.hexchen {}).sources;
|
||||
all = attrValues local ++ attrValues hexchen;
|
||||
#hexchen = sources2drvs (import sources.hexchen {}).sources;
|
||||
all = attrValues local; #++ attrValues hexchen;
|
||||
allStr = toString all;
|
||||
};
|
||||
|
||||
deploy = import ./lib/deploy.nix {
|
||||
inherit pkgs sources;
|
||||
inherit hosts targets;
|
||||
};
|
||||
}
|
||||
in config // { inherit pkgs sourceCache sources; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue