aboutsummaryrefslogtreecommitdiff
path: root/home-manager/modules/misc
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2019-10-05 12:06:29 +0000
committerKatharina Fey <kookie@spacekookie.de>2019-10-05 12:42:50 +0000
commit1148b1d122bc03e9a3665856c9b7bb96bd4e3994 (patch)
tree1a9586de593790e236349d5caa0abdff7f3f6856 /home-manager/modules/misc
parent919d4e75699aa4ba456fd2d3d416a0522c9c7294 (diff)
parent8bddc1adab0f7a51476f819fa2197353e8e1d136 (diff)
Add 'home-manager/' from commit '8bddc1adab0f7a51476f819fa2197353e8e1d136'
git-subtree-dir: home-manager git-subtree-mainline: 919d4e75699aa4ba456fd2d3d416a0522c9c7294 git-subtree-split: 8bddc1adab0f7a51476f819fa2197353e8e1d136
Diffstat (limited to 'home-manager/modules/misc')
-rw-r--r--home-manager/modules/misc/dconf.nix89
-rw-r--r--home-manager/modules/misc/fontconfig.nix105
-rw-r--r--home-manager/modules/misc/gtk.nix188
-rw-r--r--home-manager/modules/misc/lib.nix14
-rw-r--r--home-manager/modules/misc/news.nix1212
-rw-r--r--home-manager/modules/misc/nixpkgs.nix152
-rw-r--r--home-manager/modules/misc/numlock.nix35
-rw-r--r--home-manager/modules/misc/pam.nix36
-rw-r--r--home-manager/modules/misc/qt.nix77
-rw-r--r--home-manager/modules/misc/submodule-support.nix32
-rw-r--r--home-manager/modules/misc/version.nix24
-rw-r--r--home-manager/modules/misc/xdg-mime-apps.nix92
-rw-r--r--home-manager/modules/misc/xdg-user-dirs.nix100
-rw-r--r--home-manager/modules/misc/xdg.nix104
14 files changed, 2260 insertions, 0 deletions
diff --git a/home-manager/modules/misc/dconf.nix b/home-manager/modules/misc/dconf.nix
new file mode 100644
index 00000000000..ef87f8972ff
--- /dev/null
+++ b/home-manager/modules/misc/dconf.nix
@@ -0,0 +1,89 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.dconf;
+ dag = config.lib.dag;
+
+ toDconfIni = generators.toINI { mkKeyValue = mkIniKeyValue; };
+
+ mkIniKeyValue = key: value:
+ let
+ tweakVal = v:
+ if isString v then "'${v}'"
+ else if isList v then tweakList v
+ else if isBool v then (if v then "true" else "false")
+ else toString v;
+
+ # Assume empty list is a list of strings, see #769
+ tweakList = v:
+ if v == [] then "@as []"
+ else "[" + concatMapStringsSep "," tweakVal v + "]";
+
+ in
+ "${key}=${tweakVal value}";
+
+ primitive = with types; either bool (either int (either float str));
+
+in
+
+{
+ meta.maintainers = [ maintainers.gnidorah maintainers.rycee ];
+
+ options = {
+ dconf = {
+ enable = mkOption {
+ type = types.bool;
+ default = true;
+ visible = false;
+ description = ''
+ Whether to enable dconf settings.
+ '';
+ };
+
+ settings = mkOption {
+ type = with types;
+ attrsOf (attrsOf (either primitive (listOf primitive)));
+ default = {};
+ example = literalExample ''
+ {
+ "org/gnome/calculator" = {
+ button-mode = "programming";
+ show-thousands = true;
+ base = 10;
+ word-size = 64;
+ };
+ }
+ '';
+ description = ''
+ Settings to write to the dconf configuration system.
+ '';
+ };
+ };
+ };
+
+ config = mkIf (cfg.enable && cfg.settings != {}) {
+ home.activation.dconfSettings = dag.entryAfter ["installPackages"] (
+ let
+ iniFile = pkgs.writeText "hm-dconf.ini" (toDconfIni cfg.settings);
+ in
+ ''
+ if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then
+ DCONF_DBUS_RUN_SESSION=""
+ else
+ DCONF_DBUS_RUN_SESSION="${pkgs.dbus}/bin/dbus-run-session"
+ fi
+
+ if [[ -v DRY_RUN ]]; then
+ echo $DCONF_DBUS_RUN_SESSION ${pkgs.gnome3.dconf}/bin/dconf load / "<" ${iniFile}
+ else
+ $DCONF_DBUS_RUN_SESSION ${pkgs.gnome3.dconf}/bin/dconf load / < ${iniFile}
+ fi
+
+ unset DCONF_DBUS_RUN_SESSION
+ ''
+ );
+ };
+}
diff --git a/home-manager/modules/misc/fontconfig.nix b/home-manager/modules/misc/fontconfig.nix
new file mode 100644
index 00000000000..8dbcce53c22
--- /dev/null
+++ b/home-manager/modules/misc/fontconfig.nix
@@ -0,0 +1,105 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.fonts.fontconfig;
+
+ profileDirectory = config.home.profileDirectory;
+
+in
+
+{
+ meta.maintainers = [ maintainers.rycee ];
+
+ imports = [
+ (mkRenamedOptionModule
+ [ "fonts" "fontconfig" "enableProfileFonts" ]
+ [ "fonts" "fontconfig" "enable" ])
+ ];
+
+ options = {
+ fonts.fontconfig = {
+ enable = mkOption {
+ type = types.bool;
+ default = false;
+ description = ''
+ Whether to enable fontconfig configuration. This will, for
+ example, allow fontconfig to discover fonts and
+ configurations installed through
+ <varname>home.packages</varname> and
+ <command>nix-env</command>.
+ '';
+ };
+ };
+ };
+
+ config = mkIf cfg.enable {
+ # Create two dummy files in /lib/fontconfig to make sure that
+ # buildEnv creates a real directory path. These files are removed
+ # in home.extraProfileCommands below so the packages will not
+ # become "runtime" dependencies.
+ home.packages = [
+ (pkgs.writeTextFile {
+ name = "hm-dummy1";
+ destination = "/lib/fontconfig/hm-dummy1";
+ text = "dummy";
+ })
+
+ (pkgs.writeTextFile {
+ name = "hm-dummy2";
+ destination = "/lib/fontconfig/hm-dummy2";
+ text = "dummy";
+ })
+ ];
+
+ home.extraProfileCommands = ''
+ if [[ -d $out/lib/X11/fonts || -d $out/share/fonts ]]; then
+ export FONTCONFIG_FILE="$(pwd)/fonts.conf"
+
+ cat > $FONTCONFIG_FILE << EOF
+ <?xml version='1.0'?>
+ <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
+ <fontconfig>
+ <dir>$out/lib/X11/fonts</dir>
+ <dir>$out/share/fonts</dir>
+ <cachedir>$out/lib/fontconfig/cache</cachedir>
+ </fontconfig>
+ EOF
+
+ ${getBin pkgs.fontconfig}/bin/fc-cache -f
+ rm -f $out/lib/fontconfig/cache/CACHEDIR.TAG
+ rmdir --ignore-fail-on-non-empty -p $out/lib/fontconfig/cache
+
+ rm "$FONTCONFIG_FILE"
+ unset FONTCONFIG_FILE
+ fi
+
+ # Remove hacky dummy files.
+ rm $out/lib/fontconfig/hm-dummy?
+ rmdir --ignore-fail-on-non-empty -p $out/lib/fontconfig
+ '';
+
+ xdg.configFile = {
+ "fontconfig/conf.d/10-hm-fonts.conf".text = ''
+ <?xml version='1.0'?>
+
+ <!-- Generated by Home Manager. -->
+
+ <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
+ <fontconfig>
+ <include ignore_missing="yes">${config.home.path}/etc/fonts/conf.d</include>
+ <include ignore_missing="yes">${config.home.path}/etc/fonts/fonts.conf</include>
+
+ <dir>${config.home.path}/lib/X11/fonts</dir>
+ <dir>${config.home.path}/share/fonts</dir>
+ <dir>${profileDirectory}/lib/X11/fonts</dir>
+ <dir>${profileDirectory}/share/fonts</dir>
+
+ <cachedir>${config.home.path}/lib/fontconfig/cache</cachedir>
+ </fontconfig>
+ '';
+ };
+ };
+}
diff --git a/home-manager/modules/misc/gtk.nix b/home-manager/modules/misc/gtk.nix
new file mode 100644
index 00000000000..1222db4ecab
--- /dev/null
+++ b/home-manager/modules/misc/gtk.nix
@@ -0,0 +1,188 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.gtk;
+ cfg2 = config.gtk.gtk2;
+ cfg3 = config.gtk.gtk3;
+
+ toGtk3Ini = generators.toINI {
+ mkKeyValue = key: value:
+ let
+ value' =
+ if isBool value then (if value then "true" else "false")
+ else toString value;
+ in
+ "${key}=${value'}";
+ };
+
+ formatGtk2Option = n: v:
+ let
+ v' =
+ if isBool v then (if v then "true" else "false")
+ else if isString v then "\"${v}\""
+ else toString v;
+ in
+ "${n} = ${v'}";
+
+ fontType = types.submodule {
+ options = {
+ package = mkOption {
+ type = types.nullOr types.package;
+ default = null;
+ example = literalExample "pkgs.dejavu_fonts";
+ description = ''
+ Package providing the font. This package will be installed
+ to your profile. If <literal>null</literal> then the font
+ is assumed to already be available in your profile.
+ '';
+ };
+
+ name = mkOption {
+ type = types.str;
+ example = "DejaVu Sans 8";
+ description = ''
+ The family name and size of the font within the package.
+ '';
+ };
+ };
+ };
+
+ themeType = types.submodule {
+ options = {
+ package = mkOption {
+ type = types.nullOr types.package;
+ default = null;
+ example = literalExample "pkgs.gnome3.gnome_themes_standard";
+ description = ''
+ Package providing the theme. This package will be installed
+ to your profile. If <literal>null</literal> then the theme
+ is assumed to already be available in your profile.
+ '';
+ };
+
+ name = mkOption {
+ type = types.str;
+ example = "Adwaita";
+ description = "The name of the theme within the package.";
+ };
+ };
+ };
+
+in
+
+{
+ meta.maintainers = [ maintainers.rycee ];
+
+ imports = [
+ (mkRemovedOptionModule ["gtk" "gtk3" "waylandSupport"] ''
+ This options is not longer needed and can be removed.
+ '')
+ ];
+
+ options = {
+ gtk = {
+ enable = mkEnableOption "GTK 2/3 configuration";
+
+ font = mkOption {
+ type = types.nullOr fontType;
+ default = null;
+ description = ''
+ The font to use in GTK+ 2/3 applications.
+ '';
+ };
+
+ iconTheme = mkOption {
+ type = types.nullOr themeType;
+ default = null;
+ description = "The icon theme to use.";
+ };
+
+ theme = mkOption {
+ type = types.nullOr themeType;
+ default = null;
+ description = "The GTK+2/3 theme to use.";
+ };
+
+ gtk2 = {
+ extraConfig = mkOption {
+ type = types.lines;
+ default = "";
+ example = "gtk-can-change-accels = 1";
+ description = ''
+ Extra configuration lines to add verbatim to
+ <filename>~/.gtkrc-2.0</filename>.
+ '';
+ };
+ };
+
+ gtk3 = {
+ extraConfig = mkOption {
+ type = with types; attrsOf (either bool (either int str));
+ default = {};
+ example = { gtk-cursor-blink = false; gtk-recent-files-limit = 20; };
+ description = ''
+ Extra configuration options to add to
+ <filename>~/.config/gtk-3.0/settings.ini</filename>.
+ '';
+ };
+
+ extraCss = mkOption {
+ type = types.lines;
+ default = "";
+ description = ''
+ Extra configuration lines to add verbatim to
+ <filename>~/.config/gtk-3.0/gtk.css</filename>.
+ '';
+ };
+ };
+ };
+ };
+
+ config = mkIf cfg.enable (
+ let
+ ini =
+ optionalAttrs (cfg.font != null)
+ { gtk-font-name = cfg.font.name; }
+ //
+ optionalAttrs (cfg.theme != null)
+ { gtk-theme-name = cfg.theme.name; }
+ //
+ optionalAttrs (cfg.iconTheme != null)
+ { gtk-icon-theme-name = cfg.iconTheme.name; };
+
+ dconfIni =
+ optionalAttrs (cfg.font != null)
+ { font-name = cfg.font.name; }
+ //
+ optionalAttrs (cfg.theme != null)
+ { gtk-theme = cfg.theme.name; }
+ //
+ optionalAttrs (cfg.iconTheme != null)
+ { icon-theme = cfg.iconTheme.name; };
+
+ optionalPackage = opt:
+ optional (opt != null && opt.package != null) opt.package;
+ in
+ {
+ home.packages =
+ optionalPackage cfg.font
+ ++ optionalPackage cfg.theme
+ ++ optionalPackage cfg.iconTheme;
+
+ home.file.".gtkrc-2.0".text =
+ concatStringsSep "\n" (
+ mapAttrsToList formatGtk2Option ini
+ ) + "\n" + cfg2.extraConfig;
+
+ xdg.configFile."gtk-3.0/settings.ini".text =
+ toGtk3Ini { Settings = ini // cfg3.extraConfig; };
+
+ xdg.configFile."gtk-3.0/gtk.css".text = cfg3.extraCss;
+
+ dconf.settings."org/gnome/desktop/interface" = dconfIni;
+ }
+ );
+}
diff --git a/home-manager/modules/misc/lib.nix b/home-manager/modules/misc/lib.nix
new file mode 100644
index 00000000000..a0907545314
--- /dev/null
+++ b/home-manager/modules/misc/lib.nix
@@ -0,0 +1,14 @@
+{ lib, ... }:
+
+{
+ options = {
+ lib = lib.mkOption {
+ type = lib.types.attrsOf lib.types.attrs;
+ default = {};
+ description = ''
+ This option allows modules to define helper functions,
+ constants, etc.
+ '';
+ };
+ };
+}
diff --git a/home-manager/modules/misc/news.nix b/home-manager/modules/misc/news.nix
new file mode 100644
index 00000000000..4949b757fff
--- /dev/null
+++ b/home-manager/modules/misc/news.nix
@@ -0,0 +1,1212 @@
+{ config, lib, options, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.news;
+
+ hostPlatform = pkgs.stdenv.hostPlatform;
+
+ entryModule = types.submodule ({ config, ... }: {
+ options = {
+ id = mkOption {
+ internal = true;
+ type = types.str;
+ description = ''
+ A unique entry identifier. By default it is a base16
+ formatted hash of the entry message.
+ '';
+ };
+
+ time = mkOption {
+ internal = true;
+ type = types.str;
+ example = "2017-07-10T21:55:04+00:00";
+ description = ''
+ News entry time stamp in ISO-8601 format. Must be in UTC
+ (ending in '+00:00').
+ '';
+ };
+
+ condition = mkOption {
+ internal = true;
+ default = true;
+ description = "Whether the news entry should be active.";
+ };
+
+ message = mkOption {
+ internal = true;
+ type = types.str;
+ description = "The news entry content.";
+ };
+ };
+
+ config = {
+ id = mkDefault (builtins.hashString "sha256" config.message);
+ };
+ });
+
+in
+
+{
+ meta.maintainers = [ maintainers.rycee ];
+
+ options = {
+ news = {
+ display = mkOption {
+ type = types.enum [ "silent" "notify" "show" ];
+ default = "notify";
+ description = ''
+ How unread and relevant news should be presented when
+ running <command>home-manager build</command> and
+ <command>home-manager switch</command>.
+
+ </para><para>
+
+ The options are
+
+ <variablelist>
+ <varlistentry>
+ <term><literal>silent</literal></term>
+ <listitem>
+ <para>
+ Do not print anything during build or switch. The
+ <command>home-manager news</command> command still
+ works for viewing the entries.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>notify</literal></term>
+ <listitem>
+ <para>
+ The number of unread and relevant news entries will be
+ printed to standard output. The <command>home-manager
+ news</command> command can later be used to view the
+ entries.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>show</literal></term>
+ <listitem>
+ <para>
+ A pager showing unread news entries is opened.
+ </para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ '';
+ };
+
+ entries = mkOption {
+ internal = true;
+ type = types.listOf entryModule;
+ default = [];
+ description = "News entries.";
+ };
+ };
+ };
+
+ config = {
+ # Add news entries in chronological order (i.e., latest time
+ # should be at the bottom of the list). The time should be
+ # formatted as given in the output of
+ #
+ # date --iso-8601=second --universal
+ #
+ news.entries = [
+ {
+ time = "2017-09-01T10:56:28+00:00";
+ message = ''
+ Hello! This is a news entry and it represents an
+ experimental new feature of Home Manager. The idea is to
+ inform you when something of importance happens in Home
+ Manager or its modules.
+
+ We will try to not disturb you about the same news more than
+ once so the next time you run
+
+ home-manager switch
+
+ or
+
+ home-manager build
+
+ it should not notify you about this text again.
+
+ News items may be conditional and will then only show if the
+ condition holds, for example if they are relevant to your
+ configuration.
+
+ If you want to see all relevant news then please use the
+
+ home-manager news
+
+ command.
+
+ Since this is an experimental feature any positive or
+ negative feedback would be greatly appreciated. For example,
+ by commenting in https://git.io/v5BJL.
+ '';
+ }
+
+ {
+ time = "2017-09-10T22:15:19+00:00";
+ condition = config.programs.zsh.enable;
+ message = ''
+ Home Manager now offers its own minimal zsh plugin manager
+ under the 'programs.zsh.plugins' option path. By statically
+ sourcing your plugins it achieves no startup overhead.
+ '';
+ }
+
+ {
+ time = "2017-09-12T13:11:48+00:00";
+ condition = (
+ config.programs.zsh.enable &&
+ config.programs.zsh.shellAliases != {}
+ );
+ message = ''
+ Aliases defined in 'programs.zsh.shellAliases'
+ are now have the highest priority. Such aliases will
+ not be redefined by the code in 'programs.zsh.initExtra'
+ or any external plugins.
+ '';
+ }
+
+ {
+ time = "2017-09-12T14:22:18+00:00";
+ message = ''
+ A new service is available: 'services.blueman-applet'.
+ '';
+ }
+
+ {
+ time = "2017-09-13T11:30:22+00:00";
+ message = ''
+ A new service is available: 'services.compton'.
+ '';
+ }
+
+ {
+ time = "2017-09-20T14:47:14+00:00";
+ message = ''
+ A new service is available: 'services.screen-locker'.
+ '';
+ }
+
+ {
+ time = "2017-09-22T12:09:01+00:00";
+ condition = isString config.programs.git.extraConfig;
+ message = ''
+ The 'programs.git.extraConfig' parameter now accepts
+ attributes instead of strings which allows more flexible
+ configuration.
+
+ The string parameter type will be deprecated in the future,
+ please change your configuration file accordingly.
+
+ For example, if your configuration includes
+
+ programs.git.extraConfig = '''
+ [core]
+ editor = vim
+ ''';
+
+ then you can now change it to
+
+ programs.git.extraConfig = {
+ core = {
+ editor = "vim";
+ };
+ };
+ '';
+ }
+
+ {
+ time = "2017-09-27T07:28:54+00:00";
+ message = ''
+ A new program module is available: 'programs.command-not-found'.
+
+ Note, this differs from the NixOS system command-not-found
+ tool in that NIX_AUTO_INSTALL is not supported.
+ '';
+ }
+
+ {
+ time = "2017-09-28T12:39:36+00:00";
+ message = ''
+ A new program module is available: 'programs.rofi';
+ '';
+ }
+
+ {
+ time = "2017-10-02T11:15:03+00:00";
+ condition = config.services.udiskie.enable;
+ message = ''
+ The udiskie service now defaults to automatically mounting
+ new devices. Previous behavior was to not automatically
+ mount. To restore this previous behavior add
+
+ services.udiskie.automount = false;
+
+ to your Home Manager configuration.
+ '';
+ }
+
+ {
+ time = "2017-10-04T18:36:07+00:00";
+ message = ''
+ A new module is available: 'xsession.windowManager.xmonad'.
+ '';
+ }
+
+ {
+ time = "2017-10-06T08:21:43+00:00";
+ message = ''
+ A new service is available: 'services.polybar'.
+ '';
+ }
+
+ {
+ time = "2017-10-09T16:38:34+00:00";
+ message = ''
+ A new module is available: 'fonts.fontconfig'.
+
+ In particular, the Boolean option
+
+ fonts.fontconfig.enableProfileFonts
+
+ was added for those who do not use NixOS and want to install
+ font packages using 'nix-env' or 'home.packages'. If you are
+ using NixOS then you do not need to enable this option.
+ '';
+ }
+
+ {
+ time = "2017-10-12T11:21:45+00:00";
+ condition = config.programs.zsh.enable;
+ message = ''
+ A new option in zsh module is available: 'programs.zsh.sessionVariables'.
+
+ This option can be used to set zsh specific session variables which
+ will be set only on zsh launch.
+ '';
+ }
+
+ {
+ time = "2017-10-15T13:59:47+00:00";
+ message = ''
+ A new module is available: 'programs.man'.
+
+ This module is enabled by default and makes sure that manual
+ pages are installed for packages in 'home.packages'.
+ '';
+ }
+
+ {
+ time = "2017-10-20T12:15:27+00:00";
+ condition = with config.systemd.user;
+ services != {} || sockets != {} || targets != {} || timers != {};
+ message = ''
+ Home Manager's interaction with systemd is now done using
+ 'systemctl' from Nixpkgs, not the 'systemctl' in '$PATH'.
+
+ If you are using a distribution whose systemd is
+ incompatible with the version in Nixpkgs then you can
+ override this behavior by adding
+
+ systemd.user.systemctlPath = "/usr/bin/systemctl"
+
+ to your configuration. Home Manager will then use your
+ chosen version.
+ '';
+ }
+
+ {
+ time = "2017-10-23T23:10:29+00:00";
+ condition = !config.programs.home-manager.enable;
+ message = ''
+ Unfortunately, due to some internal restructuring it is no
+ longer possible to install the home-manager command when
+ having
+
+ home-manager = import ./home-manager { inherit pkgs; };
+
+ in the '~/.config/nixpkgs/config.nix' package override
+ section. Attempting to use the above override will now
+ result in the error "cannot coerce a set to a string".
+
+ To resolve this please delete the override from the
+ 'config.nix' file and either link the Home Manager overlay
+
+ $ ln -s ~/.config/nixpkgs/home-manager/overlay.nix \
+ ~/.config/nixpkgs/overlays/home-manager.nix
+
+ or add
+
+ programs.home-manager.enable = true;
+
+ to your Home Manager configuration. The latter is
+ recommended as the home-manager tool then is updated
+ automatically whenever you do a switch.
+ '';
+ }
+
+ {
+ time = "2017-10-23T23:26:17+00:00";
+ message = ''
+ A new module is available: 'nixpkgs'.
+
+ Like the identically named NixOS module, this allows you to
+ set Nixpkgs options and define Nixpkgs overlays. Note, the
+ changes you make here will not automatically apply to Nix
+ commands run outside Home Manager.
+ '';
+ }
+
+ {
+ time = "2017-10-28T23:39:55+00:00";
+ message = ''
+ A new module is available: 'xdg'.
+
+ If enabled, this module allows configuration of the XDG base
+ directory paths.
+
+ Whether the module is enabled or not, it also offers the
+ option 'xdg.configFile', which acts much like 'home.file'
+ except the target path is relative to the XDG configuration
+ directory. That is, unless `XDG_CONFIG_HOME` is configured
+ otherwise, the assignment
+
+ xdg.configFile.hello.text = "hello world";
+
+ will result in a file '$HOME/.config/hello'.
+
+ Most modules in Home Manager that previously were hard coded
+ to write configuration to '$HOME/.config' now use this
+ option and will therefore honor the XDG configuration
+ directory.
+ '';
+ }
+
+ {
+ time = "2017-10-31T11:46:07+00:00";
+ message = ''
+ A new window manager module is available: 'xsession.windowManager.i3'.
+ '';
+ }
+
+ {
+ time = "2017-11-12T00:18:59+00:00";
+ message = ''
+ A new program module is available: 'programs.neovim'.
+ '';
+ }
+
+ {
+ time = "2017-11-14T19:56:49+00:00";
+ condition = with config.xsession.windowManager; (
+ i3.enable && i3.config != null && i3.config.startup != []
+ );
+ message = ''
+ A new 'notification' option was added to
+ xsession.windowManager.i3.startup submodule.
+
+ Startup commands are now executed with the startup-notification
+ support enabled by default. Please, set 'notification' to false
+ where --no-startup-id option is necessary.
+ '';
+ }
+
+ {
+ time = "2017-11-17T10:36:10+00:00";
+ condition = config.xsession.windowManager.i3.enable;
+ message = ''
+ The i3 window manager module has been extended with the following options:
+
+ i3.config.keycodebindings
+ i3.config.window.commands
+ i3.config.window.hideEdgeBorders
+ i3.config.focus.mouseWarping
+ '';
+ }
+
+ {
+ time = "2017-11-26T21:57:23+00:00";
+ message = ''
+ Two new modules are available:
+
+ 'services.kbfs' and 'services.keybase'
+ '';
+ }
+
+ {
+ time = "2017-12-07T22:23:11+00:00";
+ message = ''
+ A new module is available: 'services.parcellite'
+ '';
+ }
+
+ {
+ time = "2017-12-11T17:23:12+00:00";
+ condition = config.home.activation ? reloadSystemD;
+ message = ''
+ The Boolean option 'systemd.user.startServices' is now
+ available. When enabled the current naive systemd unit
+ reload logic is replaced by a more sophisticated one that
+ attempts to automatically start, stop, and restart units as
+ necessary.
+ '';
+ }
+
+ {
+ time = "2018-02-02T11:15:00+00:00";
+ message = ''
+ A new program configuration is available: 'programs.mercurial'
+ '';
+ }
+
+ {
+ time = "2018-02-03T10:00:00+00:00";
+ message = ''
+ A new module is available: 'services.stalonetray'
+ '';
+ }
+
+ {
+ time = "2018-02-04T22:58:49+00:00";
+ condition = config.xsession.enable;
+ message = ''
+ A new option 'xsession.pointerCursor' is now available. It
+ allows specifying the pointer cursor theme and size. The
+ settings will be applied in the xsession, Xresources, and
+ GTK configurations.
+ '';
+ }
+
+ {
+ time = "2018-02-06T20:23:34+00:00";
+ message = ''
+ It is now possible to use Home Manager as a NixOS module.
+ This allows you to prepare user environments from the system
+ configuration file, which often is more convenient than
+ using the 'home-manager' tool. It also opens up additional
+ possibilities, for example, to automatically configure user
+ environments in NixOS declarative containers or on systems
+ deployed through NixOps.
+
+ This feature should be considered experimental for now and
+ some critial limitations apply. For example, it is currently
+ not possible to use 'nixos-rebuild build-vm' when using the
+ Home Manager NixOS module. That said, it should be
+ reasonably robust and stable for simpler use cases.
+
+ To make Home Manager available in your NixOS system
+ configuration you can add
+
+ imports = [
+ "''${builtins.fetchTarball https://github.com/rycee/home-manager/archive/master.tar.gz}/nixos"
+ ];
+
+ to your 'configuration.nix' file. This will introduce a new
+ NixOS option called 'home-manager.users' whose type is an
+ attribute set mapping user names to Home Manager
+ configurations.
+
+ For example, a NixOS configuration may include the lines
+
+ users.users.eve.isNormalUser = true;
+ home-manager.users.eve = {
+ home.packages = [ pkgs.atool pkgs.httpie ];
+ programs.bash.enable = true;
+ };
+
+ and after a 'nixos-rebuild switch' the user eve's
+ environment should include a basic Bash configuration and
+ the packages atool and httpie.
+
+ More detailed documentation on the intricacies of this new
+ feature is slowly forthcoming.
+ '';
+ }
+
+ {
+ time = "2018-02-09T21:14:42+00:00";
+ condition = with config.programs.rofi; enable && colors != null;
+ message = ''
+ The new and preferred way to configure the rofi theme is
+ using rasi themes through the 'programs.rofi.theme' option.
+ This option can take as value either the name of a
+ pre-installed theme or the path to a theme file.
+
+ A rasi theme can be generated from an Xresources config
+ using 'rofi -dump-theme'.
+
+ The option 'programs.rofi.colors' is still supported but may
+ become deprecated and removed in the future.
+ '';
+ }
+
+ {
+ time = "2018-02-19T21:45:26+00:00";
+ message = ''
+ A new module is available: 'programs.pidgin'
+ '';
+ }
+
+ {
+ time = "2018-03-04T06:54:26+00:00";
+ message = ''
+ A new module is available: 'services.unclutter'
+ '';
+ }
+
+ {
+ time = "2018-03-07T21:38:27+00:00";
+ message = ''
+ A new module is available: 'programs.fzf'.
+ '';
+ }
+
+ {
+ time = "2018-03-25T06:49:57+00:00";
+ condition = with config.programs.ssh; enable && matchBlocks != {};
+ message = ''
+ Options set through the 'programs.ssh' module are now placed
+ at the end of the SSH configuration file. This was done to
+ make it possible to override global options such as
+ 'ForwardAgent' or 'Compression' inside a host match block.
+
+ If you truly need to override an SSH option across all match
+ blocks then the new option
+
+ programs.ssh.extraOptionOverrides
+
+ can be used.
+ '';
+ }
+
+ {
+ time = "2018-04-19T07:42:01+00:00";
+ message = ''
+ A new module is available: 'programs.autorandr'.
+ '';
+ }
+
+ {
+ time = "2018-04-19T15:44:55+00:00";
+ condition = config.programs.git.enable;
+ message = ''
+ A new option 'programs.git.includes' is available. Additional
+ Git configuration files may be included via
+
+ programs.git.includes = [
+ { path = "~/path/to/config.inc"; }
+ ];
+
+ or conditionally via
+
+ programs.git.includes = [
+ { path = "~/path/to/config.inc"; condition = "gitdir:~/src/"; }
+ ];
+
+ and the corresponding '[include]' or '[includeIf]' sections will be
+ appended to the main Git configuration file.
+ '';
+ }
+
+ {
+ time = "2018-05-01T20:49:31+00:00";
+ message = ''
+ A new module is available: 'services.mbsync'.
+ '';
+ }
+ {
+ time = "2018-05-03T12:34:47+00:00";
+ message = ''
+ A new module is available: 'services.flameshot'.
+ '';
+ }
+
+ {
+ time = "2018-05-18T18:34:15+00:00";
+ message = ''
+ A new module is available: 'qt'
+
+ At the moment this module allows you to set up Qt to use the
+ GTK+ theme, and not much else.
+ '';
+ }
+
+ {
+ time = "2018-06-05T01:36:45+00:00";
+ message = ''
+ A new module is available: 'services.kdeconnect'.
+ '';
+ }
+
+ {
+ time = "2018-06-09T09:11:59+00:00";
+ message = ''
+ A new module is available: `programs.newsboat`.
+ '';
+ }
+
+ {
+ time = "2018-07-01T14:33:15+00:00";
+ message = ''
+ A new module is available: 'accounts.email'.
+
+ As the name suggests, this new module offers a number of
+ options for configuring email accounts. This, for example,
+ includes the email address and owner's real name but also
+ server settings for IMAP and SMTP.
+
+ The intent is to have a central location for account
+ specific configuration that other modules can use.
+
+ Note, this module is still somewhat experimental and its
+ structure should not be seen as final. Feedback is greatly
+ appreciated, both positive and negative.
+ '';
+ }
+
+ {
+ time = "2018-07-01T16:07:04+00:00";
+ message = ''
+ A new module is available: 'programs.mbsync'.
+ '';
+ }
+
+ {
+ time = "2018-07-01T16:12:20+00:00";
+ message = ''
+ A new module is available: 'programs.notmuch'.
+ '';
+ }
+
+ {
+ time = "2018-07-07T15:48:56+00:00";
+ message = ''
+ A new module is available: 'xsession.windowManager.awesome'.
+ '';
+ }
+
+ {
+ time = "2018-07-18T20:14:11+00:00";
+ message = ''
+ A new module is available: 'services.mpd'.
+ '';
+ }
+
+ {
+ time = "2018-07-31T13:33:39+00:00";
+ message = ''
+ A new module is available: 'services.status-notifier-watcher'.
+ '';
+ }
+
+ {
+ time = "2018-07-31T13:47:06+00:00";
+ message = ''
+ A new module is available: 'programs.direnv'.
+ '';
+ }
+
+ {
+ time = "2018-08-17T20:30:14+00:00";
+ message = ''
+ A new module is available: 'programs.fish'.
+ '';
+ }
+
+ {
+ time = "2018-08-18T19:03:42+00:00";
+ condition = config.services.gpg-agent.enable;
+ message = ''
+ A new option is available: 'services.gpg-agent.extraConfig'.
+
+ Extra lines may be appended to $HOME/.gnupg/gpg-agent.conf
+ using this option.
+ '';
+ }
+
+ {
+ time = "2018-08-19T20:46:09+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new modules is available: 'programs.chromium'.
+ '';
+ }
+
+ {
+ time = "2018-08-20T20:27:26+00:00";
+ message = ''
+ A new module is available: 'programs.msmtp'.
+ '';
+ }
+
+ {
+ time = "2018-08-21T20:13:50+00:00";
+ message = ''
+ A new module is available: 'services.pasystray'.
+ '';
+ }
+
+ {
+ time = "2018-08-29T20:27:04+00:00";
+ message = ''
+ A new module is available: 'programs.offlineimap'.
+ '';
+ }
+
+ {
+ time = "2018-09-18T21:25:14+00:00";
+ message = ''
+ A new module is available: 'programs.taskwarrior'.
+ '';
+ }
+
+ {
+ time = "2018-09-18T21:43:54+00:00";
+ message = ''
+ A new module is available: 'programs.zathura'.
+ '';
+ }
+
+ {
+ time = "2018-09-20T19:26:40+00:00";
+ message = ''
+ A new module is available: 'programs.noti'.
+ '';
+ }
+
+ {
+ time = "2018-09-20T22:10:45+00:00";
+ message = ''
+ A new module is available: 'programs.go'.
+ '';
+ }
+
+ {
+ time = "2018-09-27T17:48:08+00:00";
+ message = ''
+ A new module is available: 'programs.obs-studio'.
+ '';
+ }
+
+ {
+ time = "2018-09-28T21:38:48+00:00";
+ message = ''
+ A new module is available: 'programs.alot'.
+ '';
+ }
+
+ {
+ time = "2018-10-20T09:30:57+00:00";
+ message = ''
+ A new module is available: 'programs.urxvt'.
+ '';
+ }
+
+ {
+ time = "2018-11-13T23:08:03+00:00";
+ message = ''
+ A new module is available: 'programs.tmux'.
+ '';
+ }
+
+ {
+ time = "2018-11-18T18:55:15+00:00";
+ message = ''
+ A new module is available: 'programs.astroid'.
+ '';
+ }
+
+ {
+ time = "2018-11-18T21:41:51+00:00";
+ message = ''
+ A new module is available: 'programs.afew'.
+ '';
+ }
+
+ {
+ time = "2018-11-19T00:40:34+00:00";
+ message = ''
+ A new nix-darwin module is available. Use it the same way the NixOS
+ module is used. A major limitation is that Home Manager services don't
+ work, as they depend explicitly on Linux and systemd user services.
+ However, 'home.file' and 'home.packages' do work. Everything else is
+ untested at this time.
+ '';
+ }
+
+ {
+ time = "2018-11-24T16:22:19+00:00";
+ message = ''
+ A new option 'home.stateVersion' is available. Its function
+ is much like the 'system.stateVersion' option in NixOS.
+
+ Briefly, the state version indicates a stable set of option
+ defaults. In the future, whenever Home Manager changes an
+ option default in a way that may cause program breakage it
+ will do so only for the unstable state version, currently
+ 19.03. Once 19.03 becomes the stable version only backwards
+ compatible changes will be made and 19.09 becomes the
+ unstable state version.
+
+ The default value for this option is 18.09 but it may still
+ be a good idea to explicitly add
+
+ home.stateVersion = "18.09";
+
+ to your Home Manager configuration.
+ '';
+ }
+
+ {
+ time = "2018-11-25T22:10:15+00:00";
+ message = ''
+ A new module is available: 'services.nextcloud-client'.
+ '';
+ }
+
+ {
+ time = "2018-11-25T22:55:12+00:00";
+ message = ''
+ A new module is available: 'programs.vscode'.
+ '';
+ }
+
+ {
+ time = "2018-12-04T21:54:38+00:00";
+ condition = config.programs.beets.settings != {};
+ message = ''
+ A new option 'programs.beets.enable' has been added.
+ Starting with state version 19.03 this option defaults to
+ false. For earlier versions it defaults to true if
+ 'programs.beets.settings' is non-empty.
+
+ It is recommended to explicitly add
+
+ programs.beets.enable = true;
+
+ to your configuration.
+ '';
+ }
+
+ {
+ time = "2018-12-12T21:02:05+00:00";
+ message = ''
+ A new module is available: 'programs.jq'.
+ '';
+ }
+
+ {
+ time = "2018-12-24T16:26:16+00:00";
+ message = ''
+ A new module is available: 'dconf'.
+
+ Note, on NixOS you may need to add
+
+ services.dbus.packages = with pkgs; [ gnome3.dconf ];
+
+ to the system configuration for this module to work as
+ expected. In particular if you get the error message
+
+ The name ca.desrt.dconf was not provided by any .service files
+
+ when activating your Home Manager configuration.
+ '';
+ }
+
+ {
+ time = "2018-12-28T12:32:30+00:00";
+ message = ''
+ A new module is available: 'programs.opam'.
+ '';
+ }
+
+ {
+ time = "2019-01-18T00:21:56+00:00";
+ message = ''
+ A new module is available: 'programs.matplotlib'.
+ '';
+ }
+
+ {
+ time = "2019-01-26T13:20:37+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.xembed-sni-proxy'.
+ '';
+ }
+
+ {
+ time = "2019-01-28T23:36:10+00:00";
+ message = ''
+ A new module is available: 'programs.irssi'.
+ '';
+ }
+
+ {
+ time = "2019-02-09T14:09:58+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.emacs'.
+
+ This module provides a user service that runs the Emacs
+ configured in
+
+ programs.emacs
+
+ as an Emacs daemon.
+ '';
+ }
+
+ {
+ time = "2019-02-16T20:33:56+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ When using Home Manager as a NixOS submodule it is now
+ possible to install packages using the NixOS
+
+ users.users.<name?>.packages
+
+ option. This is enabled by adding
+
+ home-manager.useUserPackages = true;
+
+ to your NixOS system configuration. This mode of operation
+ is necessary if you want to use 'nixos-rebuild build-vm'.
+ '';
+ }
+
+ {
+ time = "2019-02-17T21:11:24+00:00";
+ message = ''
+ A new module is available: 'programs.keychain'.
+ '';
+ }
+
+ {
+ time = "2019-02-24T00:32:23+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new service is available: 'services.mpdris2'.
+ '';
+ }
+
+ {
+ time = "2019-03-19T22:56:20+00:00";
+ message = ''
+ A new module is available: 'programs.bat'.
+ '';
+ }
+
+ {
+ time = "2019-03-19T23:07:34+00:00";
+ message = ''
+ A new module is available: 'programs.lsd'.
+ '';
+ }
+
+ {
+ time = "2019-04-09T20:10:22+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.xcape'.
+ '';
+ }
+
+ {
+ time = "2019-04-11T22:50:10+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ The type used for the systemd unit options under
+
+ systemd.user.services, systemd.user.sockets, etc.
+
+ has been changed to offer more robust merging of configurations.
+
+ If you don't override values within systemd units then you are not
+ affected by this change. Unfortunately, if you do override unit values
+ you may encounter errors due to this change.
+
+ In particular, if you get an error saying that a "unique option" is
+ "defined multiple times" then you need to use 'lib.mkForce'. For
+ example,
+
+ systemd.user.services.foo.Service.ExecStart = "/foo/bar";
+
+ becomes
+
+ systemd.user.services.foo.Service.ExecStart = lib.mkForce "/foo/bar";
+
+ We had to make this change because the old merging was causing too
+ many confusing situations for people. Apologies for potentially
+ breaking your configuration!
+ '';
+ }
+
+ {
+ time = "2019-04-14T15:35:16+00:00";
+ message = ''
+ A new module is available: 'programs.skim'.
+ '';
+ }
+
+ {
+ time = "2019-04-22T12:43:20+00:00";
+ message = ''
+ A new module is available: 'programs.alacritty'.
+ '';
+ }
+
+ {
+ time = "2019-04-26T22:53:48+00:00";
+ condition = config.programs.vscode.enable;
+ message = ''
+ A new module is available: 'programs.vscode.haskell'.
+
+ Enable to add Haskell IDE Engine and syntax highlighting
+ support to your VSCode.
+ '';
+ }
+
+ {
+ time = "2019-05-04T23:56:39+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.rsibreak'.
+ '';
+ }
+
+ {
+ time = "2019-05-07T20:49:29+00:00";
+ message = ''
+ A new module is available: 'programs.mpv'.
+ '';
+ }
+
+ {
+ time = "2019-05-30T17:49:29+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.xsuspender'.
+ '';
+ }
+
+ {
+ time = "2019-06-03T21:47:10+00:00";
+ message = ''
+ A new module is available: 'programs.gpg'.
+ '';
+ }
+
+ {
+ time = "2019-06-09T12:19:18+00:00";
+ message = ''
+ Collisions between unmanaged and managed files can now be
+ automatically resolved by moving the target file to a new
+ path instead of failing the switch operation. To enable
+ this, use the new '-b' command line argument. For example,
+
+ home-manager -b bck switch
+
+ where 'bck' is the suffix to give the moved file. In this
+ case a colliding file 'foo.conf' will be moved to
+ 'foo.conf.bck'.
+ '';
+ }
+
+ {
+ time = "2019-06-19T17:49:29+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: `services.getmail`.
+ '';
+ }
+
+ {
+ time = "2019-07-02T09:27:56+00:00";
+ message = ''
+ A new module is available: 'programs.broot'.
+ '';
+ }
+
+ {
+ time = "2019-07-17T19:30:29+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.taskwarrior-sync'.
+ '';
+ }
+
+ {
+ time = "2019-07-17T20:05:29+00:00";
+ message = ''
+ A new module is available: 'programs.kakoune'.
+ '';
+ }
+
+ {
+ time = "2019-08-08T11:49:35+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.hound'.
+ '';
+ }
+
+ {
+ time = "2019-08-17T12:24:58+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.muchsync'.
+ '';
+ }
+
+ {
+ time = "2019-08-18T14:22:41+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.dwm-status'.
+ '';
+ }
+
+ {
+ time = "2019-08-28T10:18:07+00:00";
+ condition = config.programs.vim.enable;
+ message = ''
+ The 'programs.vim.plugins' option now accepts packages.
+ Specifying them as strings is deprecated.
+ '';
+ }
+
+ {
+ time = "2019-09-17T19:33:49+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.sxhkd'.
+ '';
+ }
+
+ {
+ time = "2019-09-26T21:05:24+00:00";
+ message = ''
+ A new module is available: 'programs.starship'.
+ '';
+ }
+
+ {
+ time = "2019-09-26T21:47:13+00:00";
+ message = ''
+ A new module is available: 'programs.rtorrent'.
+ '';
+ }
+ ];
+ };
+}
diff --git a/home-manager/modules/misc/nixpkgs.nix b/home-manager/modules/misc/nixpkgs.nix
new file mode 100644
index 00000000000..e7c0d8f25ea
--- /dev/null
+++ b/home-manager/modules/misc/nixpkgs.nix
@@ -0,0 +1,152 @@
+# Adapted from Nixpkgs.
+
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ isConfig = x:
+ builtins.isAttrs x || builtins.isFunction x;
+
+ optCall = f: x:
+ if builtins.isFunction f
+ then f x
+ else f;
+
+ mergeConfig = lhs_: rhs_:
+ let
+ lhs = optCall lhs_ { inherit pkgs; };
+ rhs = optCall rhs_ { inherit pkgs; };
+ in
+ lhs // rhs //
+ optionalAttrs (lhs ? packageOverrides) {
+ packageOverrides = pkgs:
+ optCall lhs.packageOverrides pkgs //
+ optCall (attrByPath ["packageOverrides"] ({}) rhs) pkgs;
+ } //
+ optionalAttrs (lhs ? perlPackageOverrides) {
+ perlPackageOverrides = pkgs:
+ optCall lhs.perlPackageOverrides pkgs //
+ optCall (attrByPath ["perlPackageOverrides"] ({}) rhs) pkgs;
+ };
+
+ configType = mkOptionType {
+ name = "nixpkgs-config";
+ description = "nixpkgs config";
+ check = x:
+ let traceXIfNot = c:
+ if c x then true
+ else lib.traceSeqN 1 x false;
+ in traceXIfNot isConfig;
+ merge = args: fold (def: mergeConfig def.value) {};
+ };
+
+ overlayType = mkOptionType {
+ name = "nixpkgs-overlay";
+ description = "nixpkgs overlay";
+ check = builtins.isFunction;
+ merge = lib.mergeOneOption;
+ };
+
+ _pkgs = import <nixpkgs> (
+ filterAttrs (n: v: v != null) config.nixpkgs
+ );
+
+in
+
+{
+ options.nixpkgs = {
+ config = mkOption {
+ default = null;
+ example = { allowBroken = true; };
+ type = types.nullOr configType;
+ description = ''
+ The configuration of the Nix Packages collection. (For
+ details, see the Nixpkgs documentation.) It allows you to set
+ package configuration options.
+
+ </para><para>
+
+ If <literal>null</literal>, then configuration is taken from
+ the fallback location, for example,
+ <filename>~/.config/nixpkgs/config.nix</filename>.
+
+ </para><para>
+
+ Note, this option will not apply outside your Home Manager
+ configuration like when installing manually through
+ <command>nix-env</command>. If you want to apply it both
+ inside and outside Home Manager you can put it in a separate
+ file and include something like
+
+ <programlisting language="nix">
+ nixpkgs.config = import ./nixpkgs-config.nix;
+ xdg.configFile."nixpkgs/config.nix".source = ./nixpkgs-config.nix;
+ </programlisting>
+
+ in your Home Manager configuration.
+ '';
+ };
+
+ overlays = mkOption {
+ default = null;
+ example = literalExample
+ ''
+ [ (self: super: {
+ openssh = super.openssh.override {
+ hpnSupport = true;
+ withKerberos = true;
+ kerberos = self.libkrb5;
+ };
+ };
+ ) ]
+ '';
+ type = types.nullOr (types.listOf overlayType);
+ description = ''
+ List of overlays to use with the Nix Packages collection. (For
+ details, see the Nixpkgs documentation.) It allows you to
+ override packages globally. This is a function that takes as
+ an argument the <emphasis>original</emphasis> Nixpkgs. The
+ first argument should be used for finding dependencies, and
+ the second should be used for overriding recipes.
+
+ </para><para>
+
+ If <literal>null</literal>, then the overlays are taken from
+ the fallback location, for example,
+ <filename>~/.config/nixpkgs/overlays</filename>.
+
+ </para><para>
+
+ Like <varname>nixpkgs.config</varname> this option only
+ applies within the Home Manager configuration. See
+ <varname>nixpkgs.config</varname> for a suggested setup that
+ works both internally and externally.
+ '';
+ };
+
+ system = mkOption {
+ type = types.str;
+ example = "i686-linux";
+ internal = true;
+ description = ''
+ Specifies the Nix platform type for which the user environment
+ should be built. If unset, it defaults to the platform type of
+ your host system. Specifying this option is useful when doing
+ distributed multi-platform deployment, or when building
+ virtual machines.
+ '';
+ };
+ };
+
+ config = {
+ _module.args = {
+ pkgs = _pkgs;
+ pkgs_i686 =
+ if _pkgs.stdenv.isLinux && _pkgs.stdenv.hostPlatform.isx86
+ then _pkgs.pkgsi686Linux
+ else { };
+ };
+ };
+}
diff --git a/home-manager/modules/misc/numlock.nix b/home-manager/modules/misc/numlock.nix
new file mode 100644
index 00000000000..77149d123ec
--- /dev/null
+++ b/home-manager/modules/misc/numlock.nix
@@ -0,0 +1,35 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.xsession.numlock;
+
+in
+
+{
+ options = {
+ xsession.numlock.enable = mkEnableOption "Num Lock";
+ };
+
+ config = mkIf cfg.enable {
+ systemd.user.services.numlockx = {
+ Unit = {
+ Description = "NumLockX";
+ After = [ "graphical-session-pre.target" ];
+ PartOf = [ "graphical-session.target" ];
+ };
+
+ Service = {
+ Type = "oneshot";
+ RemainAfterExit = true;
+ ExecStart = "${pkgs.numlockx}/bin/numlockx";
+ };
+
+ Install = {
+ WantedBy = [ "graphical-session.target" ];
+ };
+ };
+ };
+}
diff --git a/home-manager/modules/misc/pam.nix b/home-manager/modules/misc/pam.nix
new file mode 100644
index 00000000000..6ace2bfdaac
--- /dev/null
+++ b/home-manager/modules/misc/pam.nix
@@ -0,0 +1,36 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ vars = config.pam.sessionVariables;
+
+in
+
+{
+ meta.maintainers = [ maintainers.rycee ];
+
+ options = {
+ pam.sessionVariables = mkOption {
+ default = {};
+ type = types.attrs;
+ example = { EDITOR = "vim"; };
+ description = ''
+ Environment variables that will be set for the PAM session.
+ The variable values must be as described in
+ <citerefentry>
+ <refentrytitle>pam_env.conf</refentrytitle>
+ <manvolnum>5</manvolnum>
+ </citerefentry>.
+ '';
+ };
+ };
+
+ config = mkIf (vars != {}) {
+ home.file.".pam_environment".text =
+ concatStringsSep "\n" (
+ mapAttrsToList (n: v: "${n} OVERRIDE=\"${toString v}\"") vars
+ ) + "\n";
+ };
+}
diff --git a/home-manager/modules/misc/qt.nix b/home-manager/modules/misc/qt.nix
new file mode 100644
index 00000000000..60de8774231
--- /dev/null
+++ b/home-manager/modules/misc/qt.nix
@@ -0,0 +1,77 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.qt;
+ dag = config.lib.dag;
+
+in
+
+{
+ meta.maintainers = [ maintainers.rycee ];
+
+ imports = [
+ (mkChangedOptionModule
+ [ "qt" "useGtkTheme" ]
+ [ "qt" "platformTheme" ]
+ (config:
+ if getAttrFromPath [ "qt" "useGtkTheme" ] config
+ then "gtk"
+ else null))
+ ];
+
+ options = {
+ qt = {
+ enable = mkEnableOption "Qt 4 and 5 configuration";
+
+ platformTheme = mkOption {
+ type = types.nullOr (types.enum [ "gtk" "gnome" ]);
+ default = null;
+ example = "gnome";
+ relatedPackages = [
+ "qgnomeplatform"
+ ["libsForQt5" "qtstyleplugins"]
+ ];
+ description = ''
+ Selects the platform theme to use for Qt applications.</para>
+ <para>The options are
+ <variablelist>
+ <varlistentry>
+ <term><literal>gtk</literal></term>
+ <listitem><para>Use GTK theme with
+ <link xlink:href="https://github.com/qt/qtstyleplugins">qtstyleplugins</link>
+ </para></listitem>
+ </varlistentry>
+ <varlistentry>
+ <term><literal>gnome</literal></term>
+ <listitem><para>Use GNOME theme with
+ <link xlink:href="https://github.com/FedoraQt/QGnomePlatform">qgnomeplatform</link>
+ </para></listitem>
+ </varlistentry>
+ </variablelist>
+ '';
+ };
+ };
+ };
+
+ config = mkIf (cfg.enable && cfg.platformTheme != null) {
+ home.sessionVariables.QT_QPA_PLATFORMTHEME =
+ if cfg.platformTheme == "gnome" then "gnome" else "gtk2";
+
+ home.packages =
+ if cfg.platformTheme == "gnome"
+ then [ pkgs.qgnomeplatform ]
+ else [ pkgs.libsForQt5.qtstyleplugins ];
+
+ xsession.importedVariables = [ "QT_QPA_PLATFORMTHEME" ];
+
+ # Enable GTK+ style for Qt4 in either case.
+ # It doesn’t support the platform theme packages.
+ home.activation.useGtkThemeInQt4 = dag.entryAfter ["writeBoundary"] ''
+ $DRY_RUN_CMD ${pkgs.crudini}/bin/crudini $VERBOSE_ARG \
+ --set "${config.xdg.configHome}/Trolltech.conf" Qt style GTK+
+ '';
+ };
+}
diff --git a/home-manager/modules/misc/submodule-support.nix b/home-manager/modules/misc/submodule-support.nix
new file mode 100644
index 00000000000..ff80291cadf
--- /dev/null
+++ b/home-manager/modules/misc/submodule-support.nix
@@ -0,0 +1,32 @@
+{ lib, ... }:
+
+with lib;
+
+{
+ meta.maintainers = [ maintainers.rycee ];
+
+ options.submoduleSupport = {
+ enable = mkOption {
+ type = types.bool;
+ default = false;
+ internal = true;
+ description = ''
+ Whether the Home Manager module system is used as a submodule
+ in, for example, NixOS or nix-darwin.
+ '';
+ };
+
+ externalPackageInstall = mkOption {
+ type = types.bool;
+ default = false;
+ internal = true;
+ description = ''
+ Whether the packages of <option>home.packages</option> are
+ installed separately from the Home Manager activation script.
+ In NixOS, for example, this may be accomplished by installing
+ the packages through
+ <option>users.users.‹name?›.packages</option>.
+ '';
+ };
+ };
+}
diff --git a/home-manager/modules/misc/version.nix b/home-manager/modules/misc/version.nix
new file mode 100644
index 00000000000..18bb28f7603
--- /dev/null
+++ b/home-manager/modules/misc/version.nix
@@ -0,0 +1,24 @@
+{ config, lib, ... }:
+
+with lib;
+
+{
+ options = {
+ home.stateVersion = mkOption {
+ type = types.enum [ "18.09" "19.03" "19.09" ];
+ default = "18.09";
+ description = ''
+ It is occasionally necessary for Home Manager to change
+ configuration defaults in a way that is incompatible with
+ stateful data. This could, for example, include switching the
+ default data format or location of a file.
+ </para><para>
+ The <emphasis>state version</emphasis> indicates which default
+ settings are in effect and will therefore help avoid breaking
+ program configurations. Switching to a higher state version
+ typically requires performing some manual steps, such as data
+ conversion or moving files.
+ '';
+ };
+ };
+}
diff --git a/home-manager/modules/misc/xdg-mime-apps.nix b/home-manager/modules/misc/xdg-mime-apps.nix
new file mode 100644
index 00000000000..979c7ea48be
--- /dev/null
+++ b/home-manager/modules/misc/xdg-mime-apps.nix
@@ -0,0 +1,92 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.xdg.mimeApps;
+
+ strListOrSingleton = with types;
+ coercedTo (either (listOf str) str) toList (listOf str);
+
+in
+
+{
+ meta.maintainers = with maintainers; [ pacien ];
+
+ options.xdg.mimeApps = {
+ enable = mkOption {
+ type = types.bool;
+ default = false;
+ description = ''
+ Whether to manage <filename>$XDG_CONFIG_HOME/mimeapps.list</filename>.
+ </para>
+ <para>
+ The generated file is read-only.
+ '';
+ };
+
+ # descriptions from
+ # https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-1.0.1.html
+
+ associations.added = mkOption {
+ type = types.attrsOf strListOrSingleton;
+ default = { };
+ example = literalExample ''
+ {
+ "mimetype1" = [ "foo1.desktop" "foo2.desktop" "foo3.desktop" ];
+ "mimetype2" = "foo4.desktop";
+ }
+ '';
+ description = ''
+ Defines additional associations of applications with
+ mimetypes, as if the .desktop file was listing this mimetype
+ in the first place.
+ '';
+ };
+
+ associations.removed = mkOption {
+ type = types.attrsOf strListOrSingleton;
+ default = { };
+ example = { "mimetype1" = "foo5.desktop"; };
+ description = ''
+ Removes associations of applications with mimetypes, as if the
+ .desktop file was <emphasis>not</emphasis> listing this
+ mimetype in the first place.
+ '';
+ };
+
+ defaultApplications = mkOption {
+ type = types.attrsOf strListOrSingleton;
+ default = { };
+ example = literalExample ''
+ {
+ "mimetype1" = [ "default1.desktop" "default2.desktop" ];
+ }
+ '';
+ description = ''
+ The default application to be used for a given mimetype. This
+ is, for instance, the one that will be started when
+ double-clicking on a file in a file manager. If the
+ application is no longer installed, the next application in
+ the list is attempted, and so on.
+ '';
+ };
+ };
+
+ config = mkIf cfg.enable {
+ # Deprecated but still used by some applications.
+ home.file.".local/share/applications/mimeapps.list".source =
+ config.xdg.configFile."mimeapps.list".source;
+
+ xdg.configFile."mimeapps.list".text =
+ let
+ joinValues = mapAttrs (n: concatStringsSep ";");
+ in
+ generators.toINI {} {
+ "Added Associations" = joinValues cfg.associations.added;
+ "Removed Associations" = joinValues cfg.associations.removed;
+ "Default Applications" = joinValues cfg.defaultApplications;
+ };
+ };
+}
diff --git a/home-manager/modules/misc/xdg-user-dirs.nix b/home-manager/modules/misc/xdg-user-dirs.nix
new file mode 100644
index 00000000000..4d034d7fe43
--- /dev/null
+++ b/home-manager/modules/misc/xdg-user-dirs.nix
@@ -0,0 +1,100 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.xdg.userDirs;
+
+in
+
+{
+ meta.maintainers = with maintainers; [ pacien ];
+
+ options.xdg.userDirs = {
+ enable = mkOption {
+ type = types.bool;
+ default = false;
+ description = ''
+ Whether to manage <filename>$XDG_CONFIG_HOME/user-dirs.dirs</filename>.
+ </para>
+ <para>
+ The generated file is read-only.
+ '';
+ };
+
+ # Well-known directory list from
+ # https://gitlab.freedesktop.org/xdg/xdg-user-dirs/blob/master/man/user-dirs.dirs.xml
+
+ desktop = mkOption {
+ type = types.str;
+ default = "$HOME/Desktop";
+ description = "The Desktop directory.";
+ };
+
+ documents = mkOption {
+ type = types.str;
+ default = "$HOME/Documents";
+ description = "The Documents directory.";
+ };
+
+ download = mkOption {
+ type = types.str;
+ default = "$HOME/Downloads";
+ description = "The Downloads directory.";
+ };
+
+ music = mkOption {
+ type = types.str;
+ default = "$HOME/Music";
+ description = "The Music directory.";
+ };
+
+ pictures = mkOption {
+ type = types.str;
+ default = "$HOME/Pictures";
+ description = "The Pictures directory.";
+ };
+
+ publishShare = mkOption {
+ type = types.str;
+ default = "$HOME/Public";
+ description = "The Public share directory.";
+ };
+
+ templates = mkOption {
+ type = types.str;
+ default = "$HOME/Templates";
+ description = "The Templates directory.";
+ };
+
+ videos = mkOption {
+ type = types.str;
+ default = "$HOME/Videos";
+ description = "The Videos directory.";
+ };
+
+ extraConfig = mkOption {
+ type = with types; attrsOf str;
+ default = { };
+ example = { XDG_MISC_DIR = "$HOME/Misc"; };
+ description = "Other user directories.";
+ };
+ };
+
+ config = mkIf cfg.enable {
+ xdg.configFile."user-dirs.dirs".text = generators.toKeyValue {} (
+ {
+ XDG_DESKTOP_DIR = cfg.desktop;
+ XDG_DOCUMENTS_DIR = cfg.documents;
+ XDG_DOWNLOAD_DIR = cfg.download;
+ XDG_MUSIC_DIR = cfg.music;
+ XDG_PICTURES_DIR = cfg.pictures;
+ XDG_PUBLICSHARE_DIR = cfg.publishShare;
+ XDG_TEMPLATES_DIR = cfg.templates;
+ XDG_VIDEOS_DIR = cfg.videos;
+ }
+ // cfg.extraConfig
+ );
+ };
+}
diff --git a/home-manager/modules/misc/xdg.nix b/home-manager/modules/misc/xdg.nix
new file mode 100644
index 00000000000..84ab4ada59a
--- /dev/null
+++ b/home-manager/modules/misc/xdg.nix
@@ -0,0 +1,104 @@
+{ options, config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.xdg;
+
+ dag = config.lib.dag;
+
+ fileType = (import ../lib/file-type.nix {
+ inherit (config.home) homeDirectory;
+ inherit lib pkgs;
+ }).fileType;
+
+ defaultCacheHome = "${config.home.homeDirectory}/.cache";
+ defaultConfigHome = "${config.home.homeDirectory}/.config";
+ defaultDataHome = "${config.home.homeDirectory}/.local/share";
+
+ getXdgDir = name: fallback:
+ let
+ value = builtins.getEnv name;
+ in
+ if value != "" then value else fallback;
+
+in
+
+{
+ options.xdg = {
+ enable = mkEnableOption "management of XDG base directories";
+
+ cacheHome = mkOption {
+ type = types.path;
+ defaultText = "~/.cache";
+ description = ''
+ Absolute path to directory holding application caches.
+ '';
+ };
+
+ configFile = mkOption {
+ type = fileType "<varname>xdg.configHome</varname>" cfg.configHome;
+ default = {};
+ description = ''
+ Attribute set of files to link into the user's XDG
+ configuration home.
+ '';
+ };
+
+ configHome = mkOption {
+ type = types.path;
+ defaultText = "~/.config";
+ description = ''
+ Absolute path to directory holding application configurations.
+ '';
+ };
+
+ dataFile = mkOption {
+ type = fileType "<varname>xdg.dataHome</varname>" cfg.dataHome;
+ default = {};
+ description = ''
+ Attribute set of files to link into the user's XDG
+ data home.
+ '';
+ };
+
+ dataHome = mkOption {
+ type = types.path;
+ defaultText = "~/.local/share";
+ description = ''
+ Absolute path to directory holding application data.
+ '';
+ };
+ };
+
+ config = mkMerge [
+ (mkIf cfg.enable {
+ xdg.cacheHome = mkDefault defaultCacheHome;
+ xdg.configHome = mkDefault defaultConfigHome;
+ xdg.dataHome = mkDefault defaultDataHome;
+
+ home.sessionVariables = {
+ XDG_CACHE_HOME = cfg.cacheHome;
+ XDG_CONFIG_HOME = cfg.configHome;
+ XDG_DATA_HOME = cfg.dataHome;
+ };
+ })
+
+ (mkIf (!cfg.enable) {
+ xdg.cacheHome = getXdgDir "XDG_CACHE_HOME" defaultCacheHome;
+ xdg.configHome = getXdgDir "XDG_CONFIG_HOME" defaultConfigHome;
+ xdg.dataHome = getXdgDir "XDG_DATA_HOME" defaultDataHome;
+ })
+
+ {
+ home.file = mkMerge [
+ cfg.configFile
+ cfg.dataFile
+ {
+ "${config.xdg.cacheHome}/.keep".text = "";
+ }
+ ];
+ }
+ ];
+}