From e99de88c5c536346e809269d3b5b48823db123d9 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 24 Nov 2017 21:58:16 +0100 Subject: [PATCH] modules core: move modules list to own file This is to simplify use of Home Manager as a NixOS module. --- modules/default.nix | 69 ++------------------------------------- modules/modules.nix | 79 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 66 deletions(-) create mode 100644 modules/modules.nix diff --git a/modules/default.nix b/modules/default.nix index 7c67887c..4d0e9cc7 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -10,64 +10,6 @@ with lib; let - modules = [ - ./files.nix - ./home-environment.nix - ./manual.nix - ./misc/fontconfig.nix - ./misc/gtk.nix - ./misc/news.nix - ./misc/nixpkgs.nix - ./misc/pam.nix - ./misc/xdg.nix - ./programs/bash.nix - ./programs/beets.nix - ./programs/browserpass.nix - ./programs/command-not-found/command-not-found.nix - ./programs/eclipse.nix - ./programs/emacs.nix - ./programs/feh.nix - ./programs/firefox.nix - ./programs/git.nix - ./programs/gnome-terminal.nix - ./programs/home-manager.nix - ./programs/htop.nix - ./programs/info.nix - ./programs/lesspipe.nix - ./programs/man.nix - ./programs/neovim.nix - ./programs/rofi.nix - ./programs/ssh.nix - ./programs/termite.nix - ./programs/texlive.nix - ./programs/vim.nix - ./programs/zsh.nix - ./services/blueman-applet.nix - ./services/compton.nix - ./services/dunst.nix - ./services/gnome-keyring.nix - ./services/gpg-agent.nix - ./services/keepassx.nix - ./services/network-manager-applet.nix - ./services/owncloud-client.nix - ./services/polybar.nix - ./services/random-background.nix - ./services/redshift.nix - ./services/screen-locker.nix - ./services/syncthing.nix - ./services/taffybar.nix - ./services/tahoe-lafs.nix - ./services/udiskie.nix - ./services/window-managers/i3.nix - ./services/window-managers/xmonad.nix - ./services/xscreensaver.nix - ./systemd.nix - ./xresources.nix - ./xsession.nix - - - ]; - collectFailed = cfg: map (x: x.message) (filter (x: !x.assertion) cfg.assertions); @@ -77,15 +19,10 @@ let in fold f res res.config.warnings; - pkgsModule = { - config._module.args.baseModules = modules; - config._module.args.pkgs = lib.mkDefault pkgs; - config._module.check = check; - config.nixpkgs.system = mkDefault pkgs.system; - }; - rawModule = lib.evalModules { - modules = [ configuration ] ++ modules ++ [ pkgsModule ]; + modules = + [ configuration ] + ++ (import ./modules.nix { inherit check lib pkgs; }); }; module = showWarnings ( diff --git a/modules/modules.nix b/modules/modules.nix new file mode 100644 index 00000000..4c1e1a1a --- /dev/null +++ b/modules/modules.nix @@ -0,0 +1,79 @@ +{ pkgs +, lib + + # Whether to enable module type checking. +, check ? true +}: + +with lib; + +let + + modules = [ + ./files.nix + ./home-environment.nix + ./manual.nix + ./misc/fontconfig.nix + ./misc/gtk.nix + ./misc/news.nix + ./misc/nixpkgs.nix + ./misc/pam.nix + ./misc/xdg.nix + ./programs/bash.nix + ./programs/beets.nix + ./programs/browserpass.nix + ./programs/command-not-found/command-not-found.nix + ./programs/eclipse.nix + ./programs/emacs.nix + ./programs/feh.nix + ./programs/firefox.nix + ./programs/git.nix + ./programs/gnome-terminal.nix + ./programs/home-manager.nix + ./programs/htop.nix + ./programs/info.nix + ./programs/lesspipe.nix + ./programs/man.nix + ./programs/neovim.nix + ./programs/rofi.nix + ./programs/ssh.nix + ./programs/termite.nix + ./programs/texlive.nix + ./programs/vim.nix + ./programs/zsh.nix + ./services/blueman-applet.nix + ./services/compton.nix + ./services/dunst.nix + ./services/gnome-keyring.nix + ./services/gpg-agent.nix + ./services/keepassx.nix + ./services/network-manager-applet.nix + ./services/owncloud-client.nix + ./services/polybar.nix + ./services/random-background.nix + ./services/redshift.nix + ./services/screen-locker.nix + ./services/syncthing.nix + ./services/taffybar.nix + ./services/tahoe-lafs.nix + ./services/udiskie.nix + ./services/window-managers/i3.nix + ./services/window-managers/xmonad.nix + ./services/xscreensaver.nix + ./systemd.nix + ./xresources.nix + ./xsession.nix + + + ]; + + pkgsModule = { + config._module.args.baseModules = modules; + config._module.args.pkgs = lib.mkDefault pkgs; + config._module.check = check; + config.nixpkgs.system = mkDefault pkgs.system; + }; + +in + + map import modules ++ [ pkgsModule ]