diff options
author | Robert Helgesson <robert@rycee.net> | 2017-08-26 22:24:40 +0200 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2017-09-05 11:37:07 +0200 |
commit | 9c1b3735b402346533449efc741f191d6ef578dd (patch) | |
tree | 29de685e46c1e93843b99a0b999ec9735a9b8c7a /modules/default.nix | |
parent | ab0338f6ae372ff6891a6df143fd753bcbb24f71 (diff) |
home-manager: add news sub-command
This command allows the user to examine the news items generated by
the news module. See #52.
Many thanks to @nonsequitur and @uvNikita for suggestions and
improvements.
Diffstat (limited to '')
-rw-r--r-- | modules/default.nix | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/default.nix b/modules/default.nix index 7add9dc3b5a3..9137fa384e15 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,6 +1,9 @@ { configuration , pkgs , lib ? pkgs.stdenv.lib + + # Whether to check that each option has a matching declaration. +, check ? true }: with lib; @@ -64,6 +67,7 @@ let pkgsModule = { config._module.args.pkgs = lib.mkForce pkgs; config._module.args.baseModules = modules; + config._module.check = check; }; module = showWarnings ( @@ -90,4 +94,10 @@ in # For backwards compatibility. Please use activationPackage instead. activation-script = module.config.home.activationPackage; + + newsDisplay = module.config.news.display; + newsEntries = + sort (a: b: a.time > b.time) ( + filter (a: a.condition) module.config.news.entries + ); } |