1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-15 17:50:53 +00:00
home-manager/modules/default.nix

84 lines
1.8 KiB
Nix
Raw Normal View History

2017-01-07 18:16:26 +00:00
{ configuration
, pkgs
, lib ? pkgs.stdenv.lib
}:
with lib;
2017-01-07 18:16:26 +00:00
let
modules = [
./home-environment.nix
./manual.nix
./misc/gtk.nix
./misc/pam.nix
2017-01-07 18:16:26 +00:00
./programs/bash.nix
./programs/beets.nix
./programs/browserpass.nix
2017-01-07 18:16:26 +00:00
./programs/eclipse.nix
./programs/emacs.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
./programs/home-manager.nix
./programs/info.nix
2017-01-07 18:16:26 +00:00
./programs/lesspipe.nix
./programs/ssh.nix
2017-01-07 18:16:26 +00:00
./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
./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
./xresources.nix
2017-01-07 18:16:26 +00:00
./xsession.nix
<nixpkgs/nixos/modules/misc/assertions.nix>
<nixpkgs/nixos/modules/misc/meta.nix>
2017-01-07 18:16:26 +00:00
];
collectFailed = cfg:
map (x: x.message) (filter (x: !x.assertion) cfg.assertions);
showWarnings = res:
let
f = w: x: builtins.trace "warning: ${w}" x;
in
fold f res res.config.warnings;
2017-01-07 18:16:26 +00:00
pkgsModule = {
config._module.args.pkgs = lib.mkForce pkgs;
config._module.args.baseModules = modules;
2017-01-07 18:16:26 +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;
activation-script = module.config.home.activationPackage;
home-path = module.config.home.path;
}