2017-01-07 18:16:26 +00:00
|
|
|
|
{ configuration
|
|
|
|
|
, pkgs
|
|
|
|
|
, lib ? pkgs.stdenv.lib
|
2017-08-26 20:24:40 +00:00
|
|
|
|
|
|
|
|
|
# Whether to check that each option has a matching declaration.
|
|
|
|
|
, check ? true
|
2017-01-07 18:16:26 +00:00
|
|
|
|
}:
|
|
|
|
|
|
2017-02-21 20:39:53 +00:00
|
|
|
|
with lib;
|
|
|
|
|
|
2017-01-07 18:16:26 +00:00
|
|
|
|
let
|
|
|
|
|
|
|
|
|
|
modules = [
|
|
|
|
|
./home-environment.nix
|
2017-01-15 19:56:18 +00:00
|
|
|
|
./manual.nix
|
2017-01-16 23:47:03 +00:00
|
|
|
|
./misc/gtk.nix
|
2017-07-11 22:35:59 +00:00
|
|
|
|
./misc/news.nix
|
2017-01-16 22:54:45 +00:00
|
|
|
|
./misc/pam.nix
|
2017-01-07 18:16:26 +00:00
|
|
|
|
./programs/bash.nix
|
|
|
|
|
./programs/beets.nix
|
2017-06-30 20:45:09 +00:00
|
|
|
|
./programs/browserpass.nix
|
2017-01-07 18:16:26 +00:00
|
|
|
|
./programs/eclipse.nix
|
|
|
|
|
./programs/emacs.nix
|
2017-09-04 14:35:23 +00:00
|
|
|
|
./programs/feh.nix
|
2017-01-10 23:36:43 +00:00
|
|
|
|
./programs/firefox.nix
|
2017-01-07 18:16:26 +00:00
|
|
|
|
./programs/git.nix
|
|
|
|
|
./programs/gnome-terminal.nix
|
2017-07-11 17:55:30 +00:00
|
|
|
|
./programs/home-manager.nix
|
2017-07-24 05:47:59 +00:00
|
|
|
|
./programs/htop.nix
|
2017-05-24 20:55:12 +00:00
|
|
|
|
./programs/info.nix
|
2017-01-07 18:16:26 +00:00
|
|
|
|
./programs/lesspipe.nix
|
2017-08-16 12:15:53 +00:00
|
|
|
|
./programs/oh-my-zsh.nix
|
2017-05-09 03:30:37 +00:00
|
|
|
|
./programs/ssh.nix
|
2017-08-23 14:10:41 +00:00
|
|
|
|
./programs/termite.nix
|
2017-01-07 18:16:26 +00:00
|
|
|
|
./programs/texlive.nix
|
2017-08-28 14:33:22 +00:00
|
|
|
|
./programs/vim.nix
|
2017-08-15 11:54:33 +00:00
|
|
|
|
./programs/zsh.nix
|
2017-01-07 18:16:26 +00:00
|
|
|
|
./services/dunst.nix
|
|
|
|
|
./services/gnome-keyring.nix
|
|
|
|
|
./services/gpg-agent.nix
|
|
|
|
|
./services/keepassx.nix
|
|
|
|
|
./services/network-manager-applet.nix
|
2017-08-26 14:00:55 +00:00
|
|
|
|
./services/owncloud-client.nix
|
2017-01-07 18:16:26 +00:00
|
|
|
|
./services/random-background.nix
|
2017-01-20 18:26:52 +00:00
|
|
|
|
./services/redshift.nix
|
2017-07-17 08:10:15 +00:00
|
|
|
|
./services/syncthing.nix
|
2017-01-07 18:16:26 +00:00
|
|
|
|
./services/taffybar.nix
|
|
|
|
|
./services/tahoe-lafs.nix
|
|
|
|
|
./services/udiskie.nix
|
|
|
|
|
./services/xscreensaver.nix
|
|
|
|
|
./systemd.nix
|
2017-01-12 00:01:15 +00:00
|
|
|
|
./xresources.nix
|
2017-01-07 18:16:26 +00:00
|
|
|
|
./xsession.nix
|
2017-02-21 20:39:53 +00:00
|
|
|
|
<nixpkgs/nixos/modules/misc/assertions.nix>
|
2017-01-15 19:56:18 +00:00
|
|
|
|
<nixpkgs/nixos/modules/misc/meta.nix>
|
2017-01-07 18:16:26 +00:00
|
|
|
|
];
|
|
|
|
|
|
2017-02-21 20:39:53 +00: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 18:16:26 +00:00
|
|
|
|
pkgsModule = {
|
|
|
|
|
config._module.args.pkgs = lib.mkForce pkgs;
|
2017-01-15 19:56:18 +00:00
|
|
|
|
config._module.args.baseModules = modules;
|
2017-08-26 20:24:40 +00:00
|
|
|
|
config._module.check = check;
|
2017-01-07 18:16:26 +00:00
|
|
|
|
};
|
|
|
|
|
|
2017-02-21 20:39:53 +00: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 18:16:26 +00:00
|
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
inherit (module) options config;
|
|
|
|
|
|
2017-08-27 11:04:39 +00:00
|
|
|
|
activationPackage = module.config.home.activationPackage;
|
2017-08-27 15:44:00 +00:00
|
|
|
|
|
|
|
|
|
# For backwards compatibility. Please use activationPackage instead.
|
2017-08-27 15:13:06 +00:00
|
|
|
|
activation-script = module.config.home.activationPackage;
|
2017-08-26 20:24:40 +00:00
|
|
|
|
|
|
|
|
|
newsDisplay = module.config.news.display;
|
|
|
|
|
newsEntries =
|
|
|
|
|
sort (a: b: a.time > b.time) (
|
|
|
|
|
filter (a: a.condition) module.config.news.entries
|
|
|
|
|
);
|
2017-01-07 18:16:26 +00:00
|
|
|
|
}
|