2017-11-24 21:58:16 +01:00
|
|
|
{ pkgs
|
2020-01-16 23:41:14 +01:00
|
|
|
|
|
|
|
# Note, this should be "the standard library" + HM extensions.
|
2017-11-24 21:58:16 +01:00
|
|
|
, lib
|
|
|
|
|
|
|
|
# Whether to enable module type checking.
|
|
|
|
, check ? true
|
2020-03-01 17:06:20 +01:00
|
|
|
|
|
|
|
# If disabled, the pkgs attribute passed to this function is used instead.
|
|
|
|
, useNixpkgsModule ? true
|
2017-11-24 21:58:16 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2018-12-16 12:23:01 +01:00
|
|
|
hostPlatform = pkgs.stdenv.hostPlatform;
|
|
|
|
|
|
|
|
loadModule = file: { condition ? true }: {
|
|
|
|
inherit file condition;
|
|
|
|
};
|
|
|
|
|
|
|
|
allModules = [
|
|
|
|
(loadModule ./accounts/email.nix { })
|
|
|
|
(loadModule ./files.nix { })
|
|
|
|
(loadModule ./home-environment.nix { })
|
|
|
|
(loadModule ./manual.nix { })
|
2018-11-04 19:51:40 +01:00
|
|
|
(loadModule ./misc/dconf.nix { })
|
2020-02-21 19:11:58 +01:00
|
|
|
(loadModule ./misc/debug.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./misc/fontconfig.nix { })
|
|
|
|
(loadModule ./misc/gtk.nix { })
|
|
|
|
(loadModule ./misc/lib.nix { })
|
|
|
|
(loadModule ./misc/news.nix { })
|
2020-03-01 17:06:20 +01:00
|
|
|
(loadModule ./misc/nixpkgs.nix { condition = useNixpkgsModule; })
|
2019-07-29 03:41:02 +02:00
|
|
|
(loadModule ./misc/numlock.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./misc/pam.nix { })
|
|
|
|
(loadModule ./misc/qt.nix { })
|
2019-02-09 15:08:16 +01:00
|
|
|
(loadModule ./misc/submodule-support.nix { })
|
2020-04-30 15:54:54 +02:00
|
|
|
(loadModule ./misc/tmpfiles.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./misc/version.nix { })
|
2020-06-14 12:20:12 +02:00
|
|
|
(loadModule ./misc/vte.nix { })
|
2019-11-10 21:36:16 +01:00
|
|
|
(loadModule ./misc/xdg-mime.nix { condition = hostPlatform.isLinux; })
|
2019-09-05 11:25:31 +02:00
|
|
|
(loadModule ./misc/xdg-mime-apps.nix { condition = hostPlatform.isLinux; })
|
2019-09-05 11:18:43 +02:00
|
|
|
(loadModule ./misc/xdg-user-dirs.nix { condition = hostPlatform.isLinux; })
|
2019-09-05 11:25:31 +02:00
|
|
|
(loadModule ./misc/xdg.nix { })
|
2020-02-29 23:13:12 +01:00
|
|
|
(loadModule ./programs/abook.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/afew.nix { })
|
2019-03-11 00:45:49 +01:00
|
|
|
(loadModule ./programs/alacritty.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/alot.nix { })
|
2020-04-28 20:38:41 +02:00
|
|
|
(loadModule ./programs/aria2.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/astroid.nix { })
|
|
|
|
(loadModule ./programs/autorandr.nix { })
|
|
|
|
(loadModule ./programs/bash.nix { })
|
2019-02-11 06:57:10 +01:00
|
|
|
(loadModule ./programs/bat.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/beets.nix { })
|
2019-03-27 12:36:37 +01:00
|
|
|
(loadModule ./programs/broot.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/browserpass.nix { })
|
|
|
|
(loadModule ./programs/chromium.nix { condition = hostPlatform.isLinux; })
|
|
|
|
(loadModule ./programs/command-not-found/command-not-found.nix { })
|
2020-05-06 18:23:40 +02:00
|
|
|
(loadModule ./programs/dircolors.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/direnv.nix { })
|
|
|
|
(loadModule ./programs/eclipse.nix { })
|
|
|
|
(loadModule ./programs/emacs.nix { })
|
|
|
|
(loadModule ./programs/feh.nix { })
|
|
|
|
(loadModule ./programs/firefox.nix { })
|
|
|
|
(loadModule ./programs/fish.nix { })
|
|
|
|
(loadModule ./programs/fzf.nix { })
|
2019-06-27 20:04:18 +02:00
|
|
|
(loadModule ./programs/getmail.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/git.nix { })
|
|
|
|
(loadModule ./programs/gnome-terminal.nix { })
|
|
|
|
(loadModule ./programs/go.nix { })
|
2019-05-24 09:01:10 +02:00
|
|
|
(loadModule ./programs/gpg.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/home-manager.nix { })
|
|
|
|
(loadModule ./programs/htop.nix { })
|
2020-05-01 05:49:20 +02:00
|
|
|
(loadModule ./programs/i3status.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/info.nix { })
|
2019-01-24 13:00:11 +01:00
|
|
|
(loadModule ./programs/irssi.nix { })
|
2020-02-21 08:19:30 +01:00
|
|
|
(loadModule ./programs/lieer.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/jq.nix { })
|
2019-03-21 19:38:55 +01:00
|
|
|
(loadModule ./programs/kakoune.nix { })
|
2019-02-08 05:21:54 +01:00
|
|
|
(loadModule ./programs/keychain.nix { })
|
2020-01-14 02:23:20 +01:00
|
|
|
(loadModule ./programs/kitty.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/lesspipe.nix { })
|
2020-04-18 20:22:09 +02:00
|
|
|
(loadModule ./programs/lf.nix { })
|
2019-03-17 22:37:21 +01:00
|
|
|
(loadModule ./programs/lsd.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/man.nix { })
|
2019-01-11 15:53:50 +01:00
|
|
|
(loadModule ./programs/matplotlib.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/mbsync.nix { })
|
2020-08-22 11:20:00 +02:00
|
|
|
(loadModule ./programs/mcfly.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/mercurial.nix { })
|
2019-04-30 03:25:53 +02:00
|
|
|
(loadModule ./programs/mpv.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/msmtp.nix { })
|
2020-08-26 21:20:54 +02:00
|
|
|
(loadModule ./programs/ncmpcpp.nix { })
|
2020-06-16 03:47:58 +02:00
|
|
|
(loadModule ./programs/ne.nix { })
|
2020-01-22 00:52:01 +01:00
|
|
|
(loadModule ./programs/neomutt.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/neovim.nix { })
|
|
|
|
(loadModule ./programs/newsboat.nix { })
|
|
|
|
(loadModule ./programs/noti.nix { })
|
|
|
|
(loadModule ./programs/notmuch.nix { })
|
2020-07-24 17:15:55 +02:00
|
|
|
(loadModule ./programs/nushell.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/obs-studio.nix { })
|
|
|
|
(loadModule ./programs/offlineimap.nix { })
|
2018-12-28 13:00:00 +01:00
|
|
|
(loadModule ./programs/opam.nix { })
|
2019-07-14 21:09:53 +02:00
|
|
|
(loadModule ./programs/password-store.nix { })
|
2019-11-03 22:20:00 +01:00
|
|
|
(loadModule ./programs/pazi.nix { })
|
2020-02-23 21:49:50 +01:00
|
|
|
(loadModule ./programs/pet.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/pidgin.nix { })
|
2020-05-29 17:54:38 +02:00
|
|
|
(loadModule ./programs/powerline-go.nix { })
|
2020-04-07 09:10:07 +02:00
|
|
|
(loadModule ./programs/qutebrowser.nix { })
|
2019-12-01 16:21:58 +01:00
|
|
|
(loadModule ./programs/readline.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/rofi.nix { })
|
2019-05-13 08:00:00 +02:00
|
|
|
(loadModule ./programs/rtorrent.nix { })
|
2019-04-14 12:49:55 +02:00
|
|
|
(loadModule ./programs/skim.nix { })
|
2019-09-08 11:20:00 +02:00
|
|
|
(loadModule ./programs/starship.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/ssh.nix { })
|
|
|
|
(loadModule ./programs/taskwarrior.nix { })
|
|
|
|
(loadModule ./programs/termite.nix { })
|
|
|
|
(loadModule ./programs/texlive.nix { })
|
|
|
|
(loadModule ./programs/tmux.nix { })
|
|
|
|
(loadModule ./programs/urxvt.nix { })
|
|
|
|
(loadModule ./programs/vim.nix { })
|
|
|
|
(loadModule ./programs/vscode.nix { })
|
2019-03-17 14:26:02 +01:00
|
|
|
(loadModule ./programs/vscode/haskell.nix { })
|
2020-07-29 22:29:51 +02:00
|
|
|
(loadModule ./programs/waybar.nix { condition = hostPlatform.isLinux; })
|
2019-01-20 19:02:55 +01:00
|
|
|
(loadModule ./programs/z-lua.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/zathura.nix { })
|
2020-05-25 11:20:00 +02:00
|
|
|
(loadModule ./programs/zoxide.nix { })
|
2020-03-20 11:02:58 +01:00
|
|
|
(loadModule ./programs/zplug.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./programs/zsh.nix { })
|
|
|
|
(loadModule ./services/blueman-applet.nix { })
|
2019-12-29 11:26:24 +01:00
|
|
|
(loadModule ./services/cbatticon.nix { condition = hostPlatform.isLinux; })
|
2020-06-07 19:59:50 +02:00
|
|
|
(loadModule ./services/clipmenu.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/compton.nix { })
|
2020-07-09 00:17:51 +02:00
|
|
|
(loadModule ./services/dropbox.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/dunst.nix { })
|
2019-08-10 16:57:19 +02:00
|
|
|
(loadModule ./services/dwm-status.nix { condition = hostPlatform.isLinux; })
|
2018-12-29 20:11:48 +01:00
|
|
|
(loadModule ./services/emacs.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/flameshot.nix { })
|
2020-06-13 13:34:16 +02:00
|
|
|
(loadModule ./services/fluidsynth.nix { condition = hostPlatform.isLinux; })
|
2019-08-08 13:53:22 +02:00
|
|
|
(loadModule ./services/getmail.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/gnome-keyring.nix { })
|
|
|
|
(loadModule ./services/gpg-agent.nix { })
|
2019-12-27 10:30:06 +01:00
|
|
|
(loadModule ./services/grobi.nix { condition = hostPlatform.isLinux; })
|
2019-08-02 10:45:28 +02:00
|
|
|
(loadModule ./services/hound.nix { condition = hostPlatform.isLinux; })
|
2019-04-09 19:34:44 +02:00
|
|
|
(loadModule ./services/imapnotify.nix { condition = hostPlatform.isLinux; })
|
2020-04-12 15:42:43 +02:00
|
|
|
(loadModule ./services/kanshi.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/kbfs.nix { })
|
|
|
|
(loadModule ./services/kdeconnect.nix { })
|
|
|
|
(loadModule ./services/keepassx.nix { })
|
|
|
|
(loadModule ./services/keybase.nix { })
|
2020-03-10 23:28:48 +01:00
|
|
|
(loadModule ./services/keynav.nix { condition = hostPlatform.isLinux; })
|
2020-02-21 08:30:59 +01:00
|
|
|
(loadModule ./services/lieer.nix { condition = hostPlatform.isLinux; })
|
2019-11-16 22:05:08 +01:00
|
|
|
(loadModule ./services/lorri.nix { condition = hostPlatform.isLinux; })
|
2020-03-23 10:52:02 +01:00
|
|
|
(loadModule ./services/mako.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/mbsync.nix { })
|
|
|
|
(loadModule ./services/mpd.nix { })
|
2019-02-20 16:38:40 +01:00
|
|
|
(loadModule ./services/mpdris2.nix { condition = hostPlatform.isLinux; })
|
2019-07-23 00:15:45 +02:00
|
|
|
(loadModule ./services/muchsync.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/network-manager-applet.nix { })
|
|
|
|
(loadModule ./services/nextcloud-client.nix { })
|
|
|
|
(loadModule ./services/owncloud-client.nix { })
|
|
|
|
(loadModule ./services/parcellite.nix { })
|
2019-07-14 21:09:53 +02:00
|
|
|
(loadModule ./services/password-store-sync.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/pasystray.nix { })
|
2020-03-23 00:56:34 +01:00
|
|
|
(loadModule ./services/picom.nix { })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/polybar.nix { })
|
2020-04-21 22:12:45 +02:00
|
|
|
(loadModule ./services/pulseeffects.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/random-background.nix { })
|
|
|
|
(loadModule ./services/redshift.nix { })
|
2019-04-29 19:22:37 +02:00
|
|
|
(loadModule ./services/rsibreak.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/screen-locker.nix { })
|
|
|
|
(loadModule ./services/stalonetray.nix { })
|
|
|
|
(loadModule ./services/status-notifier-watcher.nix { })
|
2019-10-18 21:04:08 +02:00
|
|
|
(loadModule ./services/spotifyd.nix { condition = hostPlatform.isLinux; })
|
2019-09-15 23:12:08 +02:00
|
|
|
(loadModule ./services/sxhkd.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/syncthing.nix { })
|
|
|
|
(loadModule ./services/taffybar.nix { })
|
|
|
|
(loadModule ./services/tahoe-lafs.nix { })
|
2019-07-14 18:08:33 +02:00
|
|
|
(loadModule ./services/taskwarrior-sync.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/udiskie.nix { })
|
|
|
|
(loadModule ./services/unclutter.nix { })
|
2019-07-15 01:33:13 +02:00
|
|
|
(loadModule ./services/unison.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/window-managers/awesome.nix { })
|
2018-08-28 15:46:24 +02:00
|
|
|
(loadModule ./services/window-managers/bspwm/default.nix { condition = hostPlatform.isLinux; })
|
2019-09-04 04:30:44 +02:00
|
|
|
(loadModule ./services/window-managers/i3-sway/i3.nix { })
|
|
|
|
(loadModule ./services/window-managers/i3-sway/sway.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/window-managers/xmonad.nix { })
|
2019-04-09 17:12:36 +02:00
|
|
|
(loadModule ./services/xcape.nix { condition = hostPlatform.isLinux; })
|
2019-01-26 14:18:07 +01:00
|
|
|
(loadModule ./services/xembed-sni-proxy.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./services/xscreensaver.nix { })
|
2019-05-30 23:25:30 +02:00
|
|
|
(loadModule ./services/xsuspender.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./systemd.nix { })
|
2020-08-28 15:42:05 +02:00
|
|
|
(loadModule ./targets/darwin.nix { condition = hostPlatform.isDarwin; })
|
2020-04-05 16:46:55 +02:00
|
|
|
(loadModule ./targets/generic-linux.nix { condition = hostPlatform.isLinux; })
|
2018-12-16 12:23:01 +01:00
|
|
|
(loadModule ./xcursor.nix { })
|
|
|
|
(loadModule ./xresources.nix { })
|
|
|
|
(loadModule ./xsession.nix { })
|
2020-01-15 20:07:26 +01:00
|
|
|
(loadModule (pkgs.path + "/nixos/modules/misc/assertions.nix") { })
|
|
|
|
(loadModule (pkgs.path + "/nixos/modules/misc/meta.nix") { })
|
2018-12-16 12:23:01 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
modules = map (getAttr "file") (filter (getAttr "condition") allModules);
|
2017-11-24 21:58:16 +01:00
|
|
|
|
2020-07-31 00:33:12 +02:00
|
|
|
pkgsModule = { config, ... }: {
|
2020-03-01 17:06:20 +01:00
|
|
|
config = {
|
|
|
|
_module.args.baseModules = modules;
|
2020-07-31 00:33:12 +02:00
|
|
|
_module.args.pkgsPath = lib.mkDefault (
|
|
|
|
if versionAtLeast config.home.stateVersion "20.09" then
|
|
|
|
pkgs.path
|
|
|
|
else
|
|
|
|
<nixpkgs>);
|
2020-03-01 17:06:20 +01:00
|
|
|
_module.args.pkgs = lib.mkDefault pkgs;
|
|
|
|
_module.check = check;
|
|
|
|
lib = lib.hm;
|
|
|
|
} // optionalAttrs useNixpkgsModule {
|
|
|
|
nixpkgs.system = mkDefault pkgs.system;
|
|
|
|
};
|
2017-11-24 21:58:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2017-12-11 13:48:46 +01:00
|
|
|
modules ++ [ pkgsModule ]
|