2017-01-07 19:16:26 +01:00
|
|
|
|
{ configuration
|
|
|
|
|
, pkgs
|
|
|
|
|
, lib ? pkgs.stdenv.lib
|
|
|
|
|
}:
|
|
|
|
|
|
2017-02-21 21:39:53 +01:00
|
|
|
|
with lib;
|
|
|
|
|
|
2017-01-07 19:16:26 +01:00
|
|
|
|
let
|
|
|
|
|
|
|
|
|
|
modules = [
|
|
|
|
|
./home-environment.nix
|
2017-01-15 20:56:18 +01:00
|
|
|
|
./manual.nix
|
2017-01-17 00:47:03 +01:00
|
|
|
|
./misc/gtk.nix
|
2017-01-16 23:54:45 +01:00
|
|
|
|
./misc/pam.nix
|
2017-01-07 19:16:26 +01:00
|
|
|
|
./programs/bash.nix
|
|
|
|
|
./programs/beets.nix
|
|
|
|
|
./programs/eclipse.nix
|
|
|
|
|
./programs/emacs.nix
|
2017-01-11 00:36:43 +01:00
|
|
|
|
./programs/firefox.nix
|
2017-01-07 19:16:26 +01:00
|
|
|
|
./programs/git.nix
|
|
|
|
|
./programs/gnome-terminal.nix
|
|
|
|
|
./programs/lesspipe.nix
|
|
|
|
|
./programs/texlive.nix
|
|
|
|
|
./services/dunst.nix
|
|
|
|
|
./services/gnome-keyring.nix
|
|
|
|
|
./services/gpg-agent.nix
|
|
|
|
|
./services/keepassx.nix
|
|
|
|
|
./services/network-manager-applet.nix
|
|
|
|
|
./services/random-background.nix
|
2017-01-20 19:26:52 +01:00
|
|
|
|
./services/redshift.nix
|
2017-01-07 19:16:26 +01:00
|
|
|
|
./services/taffybar.nix
|
|
|
|
|
./services/tahoe-lafs.nix
|
|
|
|
|
./services/udiskie.nix
|
|
|
|
|
./services/xscreensaver.nix
|
|
|
|
|
./systemd.nix
|
2017-01-12 01:01:15 +01:00
|
|
|
|
./xresources.nix
|
2017-01-07 19:16:26 +01:00
|
|
|
|
./xsession.nix
|
2017-02-21 21:39:53 +01:00
|
|
|
|
<nixpkgs/nixos/modules/misc/assertions.nix>
|
2017-01-15 20:56:18 +01:00
|
|
|
|
<nixpkgs/nixos/modules/misc/meta.nix>
|
2017-01-07 19:16:26 +01:00
|
|
|
|
];
|
|
|
|
|
|
2017-02-21 21:39:53 +01:00
|
|
|
|
collectFailed = cfg:
|
|
|
|
|
map (x: x.message) (filter (x: !x.assertion) cfg.assertions);
|
|
|
|
|
|
|
|
|
|
showWarnings = res:
|
|
|
|
|
let
|
|
|
|
|
f = w: x: builtins.trace "[1;31mwarning: ${w}[0m" x;
|
|
|
|
|
in
|
|
|
|
|
fold f res res.config.warnings;
|
|
|
|
|
|
2017-01-07 19:16:26 +01:00
|
|
|
|
pkgsModule = {
|
|
|
|
|
config._module.args.pkgs = lib.mkForce pkgs;
|
2017-01-15 20:56:18 +01:00
|
|
|
|
config._module.args.baseModules = modules;
|
2017-01-07 19:16:26 +01:00
|
|
|
|
};
|
|
|
|
|
|
2017-02-21 21:39:53 +01:00
|
|
|
|
module = showWarnings (
|
|
|
|
|
let
|
|
|
|
|
mod = lib.evalModules {
|
|
|
|
|
modules = [ configuration ] ++ modules ++ [ pkgsModule ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
failed = collectFailed mod.config;
|
|
|
|
|
|
|
|
|
|
failedStr = concatStringsSep "\n" (map (x: "- ${x}") failed);
|
|
|
|
|
in
|
|
|
|
|
if failed == []
|
|
|
|
|
then mod
|
|
|
|
|
else throw "\nFailed assertions:\n${failedStr}"
|
|
|
|
|
);
|
2017-01-07 19:16:26 +01:00
|
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
inherit (module) options config;
|
|
|
|
|
|
|
|
|
|
activation-script = module.config.home.activationPackage;
|
|
|
|
|
home-path = module.config.home.path;
|
|
|
|
|
}
|