aboutsummaryrefslogtreecommitdiff
path: root/home-manager/modules/misc
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2020-02-03 10:05:30 +0100
committerKatharina Fey <kookie@spacekookie.de>2020-02-03 10:05:30 +0100
commitc488527c95c874d3b8743c915173ad7bfb05d5af (patch)
tree2b874dc5606a9dff44096a5e8557f00dc52ac2b6 /home-manager/modules/misc
parent899a451e08f7d6d2c8214d119c2a0316849a0ed4 (diff)
parent6cc4fd6ede4909226cb81d3475834251ed1b7210 (diff)
Merge commit '6cc4fd6ede4909226cb81d3475834251ed1b7210'
Diffstat (limited to 'home-manager/modules/misc')
-rw-r--r--home-manager/modules/misc/dconf.nix3
-rw-r--r--home-manager/modules/misc/fontconfig.nix12
-rw-r--r--home-manager/modules/misc/lib.nix2
-rw-r--r--home-manager/modules/misc/news.nix111
-rw-r--r--home-manager/modules/misc/nixpkgs.nix2
-rw-r--r--home-manager/modules/misc/numlock.nix12
-rw-r--r--home-manager/modules/misc/pam.nix14
-rw-r--r--home-manager/modules/misc/qt.nix29
-rw-r--r--home-manager/modules/misc/version.nix2
-rw-r--r--home-manager/modules/misc/xdg-mime-apps.nix18
-rw-r--r--home-manager/modules/misc/xdg-mime.nix47
-rw-r--r--home-manager/modules/misc/xdg-user-dirs.nix37
12 files changed, 213 insertions, 76 deletions
diff --git a/home-manager/modules/misc/dconf.nix b/home-manager/modules/misc/dconf.nix
index ef87f8972ff..f5c9bf71456 100644
--- a/home-manager/modules/misc/dconf.nix
+++ b/home-manager/modules/misc/dconf.nix
@@ -5,7 +5,6 @@ with lib;
let
cfg = config.dconf;
- dag = config.lib.dag;
toDconfIni = generators.toINI { mkKeyValue = mkIniKeyValue; };
@@ -65,7 +64,7 @@ in
};
config = mkIf (cfg.enable && cfg.settings != {}) {
- home.activation.dconfSettings = dag.entryAfter ["installPackages"] (
+ home.activation.dconfSettings = hm.dag.entryAfter ["installPackages"] (
let
iniFile = pkgs.writeText "hm-dconf.ini" (toDconfIni cfg.settings);
in
diff --git a/home-manager/modules/misc/fontconfig.nix b/home-manager/modules/misc/fontconfig.nix
index 8dbcce53c22..795ab3a74f6 100644
--- a/home-manager/modules/misc/fontconfig.nix
+++ b/home-manager/modules/misc/fontconfig.nix
@@ -8,15 +8,15 @@ let
profileDirectory = config.home.profileDirectory;
-in
-
-{
+in {
meta.maintainers = [ maintainers.rycee ];
imports = [
- (mkRenamedOptionModule
- [ "fonts" "fontconfig" "enableProfileFonts" ]
- [ "fonts" "fontconfig" "enable" ])
+ (mkRenamedOptionModule [ "fonts" "fontconfig" "enableProfileFonts" ] [
+ "fonts"
+ "fontconfig"
+ "enable"
+ ])
];
options = {
diff --git a/home-manager/modules/misc/lib.nix b/home-manager/modules/misc/lib.nix
index a0907545314..13c00dc59a6 100644
--- a/home-manager/modules/misc/lib.nix
+++ b/home-manager/modules/misc/lib.nix
@@ -4,7 +4,7 @@
options = {
lib = lib.mkOption {
type = lib.types.attrsOf lib.types.attrs;
- default = {};
+ 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
index 4949b757fff..6b01617fc55 100644
--- a/home-manager/modules/misc/news.nix
+++ b/home-manager/modules/misc/news.nix
@@ -1207,6 +1207,117 @@ in
A new module is available: 'programs.rtorrent'.
'';
}
+
+ {
+ time = "2019-11-04T20:56:29+00:00";
+ message = ''
+ A new module is available: 'programs.pazi'.
+ '';
+ }
+
+ {
+ time = "2019-11-05T21:54:04+00:00";
+ condition = config.programs.zsh.enable;
+ message = ''
+ The 'programs.zsh.history.path' option behavior and the
+ default value has changed for state version 20.03 and above.
+
+ Specifically, '$HOME' will no longer be prepended to the
+ option value, which allows specifying absolute paths (e.g.
+ using the xdg module). Also, the default value is fixed to
+ '$HOME/.zsh_history' and 'dotDir' path is not prepended to
+ it anymore.
+ '';
+ }
+
+ {
+ time = "2019-11-17T18:47:40+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.lorri'.
+ '';
+ }
+
+ {
+ time = "2019-11-24T17:46:57+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.spotifyd'.
+ '';
+ }
+
+ {
+ time = "2019-11-29T21:18:48+00:00";
+ message = ''
+ A new module is available: 'programs.password-store'.
+ '';
+ }
+
+ {
+ time = "2019-11-29T21:18:48+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.password-store-sync'.
+ '';
+ }
+
+ {
+ time = "2019-11-29T22:46:49+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.unison'.
+ '';
+ }
+
+ {
+ time = "2019-12-01T22:10:23+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'xdg.mime'.
+
+ If enabled, which it is by default, this module will create
+ the XDG mime database and desktop file database caches from
+ programs installed via Home Manager.
+ '';
+ }
+
+ {
+ time = "2019-12-08T19:48:26+00:00";
+ message = ''
+ A new module is available: 'programs.readline'.
+ '';
+ }
+
+ {
+ time = "2020-01-11T11:49:51+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.cbatticon'.
+ '';
+ }
+
+ {
+ time = "2020-01-26T12:42:33+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'xsession.windowManager.bspwm'.
+ '';
+ }
+
+ {
+ time = "2020-01-26T12:49:40+00:00";
+ condition = hostPlatform.isLinux;
+ message = ''
+ A new module is available: 'services.grobi'.
+ '';
+ }
+
+ {
+ time = "2020-01-26T19:37:57+00:00";
+ message = ''
+ A new module is available: 'programs.neomutt'.
+ '';
+ }
];
};
}
diff --git a/home-manager/modules/misc/nixpkgs.nix b/home-manager/modules/misc/nixpkgs.nix
index e7c0d8f25ea..7b0904a5f20 100644
--- a/home-manager/modules/misc/nixpkgs.nix
+++ b/home-manager/modules/misc/nixpkgs.nix
@@ -142,7 +142,7 @@ in
config = {
_module.args = {
- pkgs = _pkgs;
+ pkgs = mkOverride modules.defaultPriority _pkgs;
pkgs_i686 =
if _pkgs.stdenv.isLinux && _pkgs.stdenv.hostPlatform.isx86
then _pkgs.pkgsi686Linux
diff --git a/home-manager/modules/misc/numlock.nix b/home-manager/modules/misc/numlock.nix
index 77149d123ec..199dd317daa 100644
--- a/home-manager/modules/misc/numlock.nix
+++ b/home-manager/modules/misc/numlock.nix
@@ -6,12 +6,8 @@ let
cfg = config.xsession.numlock;
-in
-
-{
- options = {
- xsession.numlock.enable = mkEnableOption "Num Lock";
- };
+in {
+ options = { xsession.numlock.enable = mkEnableOption "Num Lock"; };
config = mkIf cfg.enable {
systemd.user.services.numlockx = {
@@ -27,9 +23,7 @@ in
ExecStart = "${pkgs.numlockx}/bin/numlockx";
};
- Install = {
- WantedBy = [ "graphical-session.target" ];
- };
+ Install = { WantedBy = [ "graphical-session.target" ]; };
};
};
}
diff --git a/home-manager/modules/misc/pam.nix b/home-manager/modules/misc/pam.nix
index 6ace2bfdaac..f54f4b95089 100644
--- a/home-manager/modules/misc/pam.nix
+++ b/home-manager/modules/misc/pam.nix
@@ -6,14 +6,12 @@ let
vars = config.pam.sessionVariables;
-in
-
-{
+in {
meta.maintainers = [ maintainers.rycee ];
options = {
pam.sessionVariables = mkOption {
- default = {};
+ default = { };
type = types.attrs;
example = { EDITOR = "vim"; };
description = ''
@@ -27,10 +25,8 @@ in
};
};
- config = mkIf (vars != {}) {
- home.file.".pam_environment".text =
- concatStringsSep "\n" (
- mapAttrsToList (n: v: "${n} OVERRIDE=\"${toString v}\"") vars
- ) + "\n";
+ 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
index 60de8774231..ff38f842c81 100644
--- a/home-manager/modules/misc/qt.nix
+++ b/home-manager/modules/misc/qt.nix
@@ -5,21 +5,14 @@ with lib;
let
cfg = config.qt;
- dag = config.lib.dag;
-in
-
-{
+in {
meta.maintainers = [ maintainers.rycee ];
imports = [
- (mkChangedOptionModule
- [ "qt" "useGtkTheme" ]
- [ "qt" "platformTheme" ]
+ (mkChangedOptionModule [ "qt" "useGtkTheme" ] [ "qt" "platformTheme" ]
(config:
- if getAttrFromPath [ "qt" "useGtkTheme" ] config
- then "gtk"
- else null))
+ if getAttrFromPath [ "qt" "useGtkTheme" ] config then "gtk" else null))
];
options = {
@@ -30,10 +23,8 @@ in
type = types.nullOr (types.enum [ "gtk" "gnome" ]);
default = null;
example = "gnome";
- relatedPackages = [
- "qgnomeplatform"
- ["libsForQt5" "qtstyleplugins"]
- ];
+ relatedPackages =
+ [ "qgnomeplatform" [ "libsForQt5" "qtstyleplugins" ] ];
description = ''
Selects the platform theme to use for Qt applications.</para>
<para>The options are
@@ -60,16 +51,16 @@ in
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 ];
+ 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"] ''
+ home.activation.useGtkThemeInQt4 = hm.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/version.nix b/home-manager/modules/misc/version.nix
index 18bb28f7603..1352aadc614 100644
--- a/home-manager/modules/misc/version.nix
+++ b/home-manager/modules/misc/version.nix
@@ -5,7 +5,7 @@ with lib;
{
options = {
home.stateVersion = mkOption {
- type = types.enum [ "18.09" "19.03" "19.09" ];
+ type = types.enum [ "18.09" "19.03" "19.09" "20.03" ];
default = "18.09";
description = ''
It is occasionally necessary for Home Manager to change
diff --git a/home-manager/modules/misc/xdg-mime-apps.nix b/home-manager/modules/misc/xdg-mime-apps.nix
index 979c7ea48be..7ba4083b3c0 100644
--- a/home-manager/modules/misc/xdg-mime-apps.nix
+++ b/home-manager/modules/misc/xdg-mime-apps.nix
@@ -9,9 +9,7 @@ let
strListOrSingleton = with types;
coercedTo (either (listOf str) str) toList (listOf str);
-in
-
-{
+in {
meta.maintainers = with maintainers; [ pacien ];
options.xdg.mimeApps = {
@@ -80,13 +78,11 @@ in
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;
- };
+ 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-mime.nix b/home-manager/modules/misc/xdg-mime.nix
new file mode 100644
index 00000000000..32006e025ff
--- /dev/null
+++ b/home-manager/modules/misc/xdg-mime.nix
@@ -0,0 +1,47 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+ cfg = config.xdg.mime;
+
+in {
+ options = {
+ xdg.mime.enable = mkOption {
+ type = types.bool;
+ default = true;
+ description = ''
+ Whether to install programs and files to support the
+ XDG Shared MIME-info specification and XDG MIME Applications
+ specification at
+ <link xlink:href="https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-latest.html"/>
+ and
+ <link xlink:href="https://specifications.freedesktop.org/mime-apps-spec/mime-apps-spec-latest.html"/>,
+ respectively.
+ '';
+ };
+ };
+
+ config = mkIf config.xdg.mime.enable {
+ home.packages = [
+ # Explicitly install package to provide basic mime types.
+ pkgs.shared-mime-info
+ ];
+
+ home.extraProfileCommands = ''
+ if [[ -w $out/share/mime && -d $out/share/mime/packages ]]; then
+ XDG_DATA_DIRS=$out/share \
+ PKGSYSTEM_ENABLE_FSYNC=0 \
+ ${pkgs.buildPackages.shared-mime-info}/bin/update-mime-database \
+ -V $out/share/mime > /dev/null
+ fi
+
+ if [[ -w $out/share/applications ]]; then
+ ${pkgs.buildPackages.desktop-file-utils}/bin/update-desktop-database \
+ $out/share/applications
+ fi
+ '';
+ };
+
+}
diff --git a/home-manager/modules/misc/xdg-user-dirs.nix b/home-manager/modules/misc/xdg-user-dirs.nix
index 4d034d7fe43..da9d3c43ad9 100644
--- a/home-manager/modules/misc/xdg-user-dirs.nix
+++ b/home-manager/modules/misc/xdg-user-dirs.nix
@@ -6,11 +6,17 @@ let
cfg = config.xdg.userDirs;
-in
-
-{
+in {
meta.maintainers = with maintainers; [ pacien ];
+ imports = [
+ (mkRenamedOptionModule [ "xdg" "userDirs" "publishShare" ] [
+ "xdg"
+ "userDirs"
+ "publicShare"
+ ])
+ ];
+
options.xdg.userDirs = {
enable = mkOption {
type = types.bool;
@@ -56,7 +62,7 @@ in
description = "The Pictures directory.";
};
- publishShare = mkOption {
+ publicShare = mkOption {
type = types.str;
default = "$HOME/Public";
description = "The Public share directory.";
@@ -83,18 +89,15 @@ in
};
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
- );
+ 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.publicShare;
+ XDG_TEMPLATES_DIR = cfg.templates;
+ XDG_VIDEOS_DIR = cfg.videos;
+ } // cfg.extraConfig);
};
}