From ce4b88c465d928f4f8b75d0920f1788d5b65ca94 Mon Sep 17 00:00:00 2001 From: NovaViper Date: Thu, 18 Jan 2024 14:45:32 -0500 Subject: [PATCH 001/636] mcfly: add mcfly-fzf integration --- modules/programs/mcfly.nix | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/modules/programs/mcfly.nix b/modules/programs/mcfly.nix index 75f6f2b3161e..0a7a64800ad0 100644 --- a/modules/programs/mcfly.nix +++ b/modules/programs/mcfly.nix @@ -5,6 +5,24 @@ let cfg = config.programs.mcfly; + bashIntegration = '' + eval "$(${getExe pkgs.mcfly} init bash)" + '' + optionalString cfg.fzf.enable '' + eval "$(${getExe pkgs.mcfly-fzf} init bash)" + ''; + + fishIntegration = '' + ${getExe pkgs.mcfly} init fish | source + '' + optionalString cfg.fzf.enable '' + ${getExe pkgs.mcfly-fzf} init fish | source + ''; + + zshIntegration = '' + eval "$(${getExe pkgs.mcfly} init zsh)" + '' + optionalString cfg.fzf.enable '' + eval "$(${getExe pkgs.mcfly-fzf} init zsh)" + ''; + in { meta.maintainers = [ ]; @@ -30,6 +48,8 @@ in { ''; }; + fzf.enable = mkEnableOption "McFly fzf integration"; + enableLightTheme = mkOption { default = false; type = types.bool; @@ -75,19 +95,13 @@ in { config = mkIf cfg.enable (mkMerge [ { - home.packages = [ pkgs.mcfly ]; + home.packages = [ pkgs.mcfly ] ++ optional cfg.fzf.enable pkgs.mcfly-fzf; - programs.bash.initExtra = mkIf cfg.enableBashIntegration '' - eval "$(${pkgs.mcfly}/bin/mcfly init bash)" - ''; + programs.bash.initExtra = mkIf cfg.enableBashIntegration bashIntegration; - programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' - eval "$(${pkgs.mcfly}/bin/mcfly init zsh)" - ''; + programs.zsh.initExtra = mkIf cfg.enableZshIntegration zshIntegration; - programs.fish.shellInit = mkIf cfg.enableFishIntegration '' - ${pkgs.mcfly}/bin/mcfly init fish | source - ''; + programs.fish.shellInit = mkIf cfg.enableFishIntegration fishIntegration; home.sessionVariables.MCFLY_KEY_SCHEME = cfg.keyScheme; } From 9b378afae72cb07471e19aefc30e8e05ef2d7a61 Mon Sep 17 00:00:00 2001 From: Samuele Facenda Date: Sun, 21 Jan 2024 00:40:55 +0100 Subject: [PATCH 002/636] hyprland: change plugins settings generation The previous syntax (`plugin:name { ...settings}`) is not working with more than one plugin. There is no documentation for this, just the source code [1]. With this update the plugins paths aren't generated together with the full config (so the "plugin" field is not "important" anymore) and the plugins settings are generated like the other fields. [1] https://github.com/hyprwm/Hyprland/blob/4d403dac3244aab217fb9bf17a68e9a009fcadd8/src/config/ConfigManager.cpp#L1574 --- modules/services/window-managers/hyprland.nix | 31 ++++++++++--------- .../hyprland/simple-config.conf | 14 +++++---- 2 files changed, 24 insertions(+), 21 deletions(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index d677eda75481..65cf0c316e2b 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -199,19 +199,8 @@ in { home.packages = lib.optional (cfg.package != null) cfg.finalPackage; xdg.configFile."hypr/hyprland.conf" = let - combinedSettings = cfg.settings // { - plugin = let - mkEntry = entry: - if lib.types.package.check entry then - "${entry}/lib/lib${entry.pname}.so" - else - entry; - in map mkEntry cfg.plugins; - } // lib.mapAttrs' (n: v: lib.nameValuePair "plugin:${n}" v) - (lib.attrByPath [ "plugin" ] { } cfg.settings); - shouldGenerate = cfg.systemd.enable || cfg.extraConfig != "" - || combinedSettings != { }; + || cfg.settings != { } || cfg.plugins != [ ]; toHyprconf = with lib; attrs: indentLevel: @@ -230,17 +219,29 @@ in { }; allFields = filterAttrs (n: v: !(isAttrs v)) attrs; importantFields = filterAttrs (n: _: - (hasPrefix "$" n) || (hasPrefix "bezier" n) || (n == "plugin") + (hasPrefix "$" n) || (hasPrefix "bezier" n) || (cfg.sourceFirst && (hasPrefix "source" n))) allFields; fields = builtins.removeAttrs allFields (mapAttrsToList (n: _: n) importantFields); in mkFields importantFields + concatStringsSep "\n" (mapAttrsToList mkSection sections) + mkFields fields; + + pluginsToHyprconf = plugins: + toHyprconf { + plugin = let + mkEntry = entry: + if lib.types.package.check entry then + "${entry}/lib/lib${entry.pname}.so" + else + entry; + in map mkEntry cfg.plugins; + } 0; in lib.mkIf shouldGenerate { text = lib.optionalString cfg.systemd.enable systemdActivation - + lib.optionalString (combinedSettings != { }) - (toHyprconf combinedSettings 0) + + lib.optionalString (cfg.plugins != [ ]) + (pluginsToHyprconf cfg.plugins) + + lib.optionalString (cfg.settings != { }) (toHyprconf cfg.settings 0) + lib.optionalString (cfg.extraConfig != "") cfg.extraConfig; onChange = lib.mkIf (cfg.package != null) '' diff --git a/tests/modules/services/window-managers/hyprland/simple-config.conf b/tests/modules/services/window-managers/hyprland/simple-config.conf index 4df74413565f..0db599a312c7 100644 --- a/tests/modules/services/window-managers/hyprland/simple-config.conf +++ b/tests/modules/services/window-managers/hyprland/simple-config.conf @@ -1,10 +1,10 @@ exec-once = /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY HYPRLAND_INSTANCE_SIGNATURE WAYLAND_DISPLAY XDG_CURRENT_DESKTOP && systemctl --user stop hyprland-session.target && systemctl --user start hyprland-session.target +plugin=/path/to/plugin1 +plugin=/nix/store/00000000000000000000000000000000-foo/lib/libfoo.so $mod=SUPER bezier=smoothOut, 0.36, 0, 0.66, -0.56 bezier=smoothIn, 0.25, 1, 0.5, 1 bezier=overshot, 0.4,0.8,0.2,1.2 -plugin=/path/to/plugin1 -plugin=/nix/store/00000000000000000000000000000000-foo/lib/libfoo.so source=sourced.conf animations { animation=border, 1, 2, smoothIn @@ -27,11 +27,13 @@ input { kb_layout=ro } -plugin:plugin1 { - section { - other=dummy setting +plugin { + plugin1 { + section { + other=dummy setting + } + dummy=plugin setting } - dummy=plugin setting } bindm=$mod, mouse:272, movewindow bindm=$mod, mouse:273, resizewindow From 928f2528f9ee952ba0a47bbb1ece8d93ed66e784 Mon Sep 17 00:00:00 2001 From: Nikita Pedorich Date: Sun, 21 Jan 2024 08:51:14 +0100 Subject: [PATCH 003/636] mise: add module This adds the support for the mise program, the successor of rtx. This commit therefore also removes the rtx module. --- modules/misc/news.nix | 9 ++ modules/modules.nix | 2 +- modules/programs/mise.nix | 111 ++++++++++++++++++ modules/programs/rtx.nix | 79 ------------- tests/default.nix | 2 +- .../programs/mise/bash-integration.nix | 16 +++ .../modules/programs/mise/custom-settings.nix | 45 +++++++ .../programs/mise/default-settings.nix | 13 ++ tests/modules/programs/mise/default.nix | 7 ++ .../{rtx => mise}/fish-integration.nix | 6 +- .../modules/programs/mise/zsh-integration.nix | 16 +++ .../modules/programs/rtx/bash-integration.nix | 16 --- .../modules/programs/rtx/custom-settings.nix | 35 ------ .../modules/programs/rtx/default-settings.nix | 12 -- tests/modules/programs/rtx/default.nix | 7 -- .../modules/programs/rtx/zsh-integration.nix | 16 --- 16 files changed, 222 insertions(+), 170 deletions(-) create mode 100644 modules/programs/mise.nix delete mode 100644 modules/programs/rtx.nix create mode 100644 tests/modules/programs/mise/bash-integration.nix create mode 100644 tests/modules/programs/mise/custom-settings.nix create mode 100644 tests/modules/programs/mise/default-settings.nix create mode 100644 tests/modules/programs/mise/default.nix rename tests/modules/programs/{rtx => mise}/fish-integration.nix (63%) create mode 100644 tests/modules/programs/mise/zsh-integration.nix delete mode 100644 tests/modules/programs/rtx/bash-integration.nix delete mode 100644 tests/modules/programs/rtx/custom-settings.nix delete mode 100644 tests/modules/programs/rtx/default-settings.nix delete mode 100644 tests/modules/programs/rtx/default.nix delete mode 100644 tests/modules/programs/rtx/zsh-integration.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index ed6d1546bb13..e24ed47287e7 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1383,6 +1383,15 @@ in { A new module is available: 'xdg.portal'. ''; } + + { + time = "2024-01-20T23:45:07+00:00"; + message = '' + A new module is available: 'programs.mise'. + + This module replaces 'programs.rtx', which has been removed. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 314dfdb8d824..d557dc1b3ce2 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -147,6 +147,7 @@ let ./programs/mcfly.nix ./programs/mercurial.nix ./programs/micro.nix + ./programs/mise.nix ./programs/mpv.nix ./programs/mr.nix ./programs/msmtp.nix @@ -194,7 +195,6 @@ let ./programs/rofi-pass.nix ./programs/rofi.nix ./programs/rtorrent.nix - ./programs/rtx.nix ./programs/ruff.nix ./programs/sagemath.nix ./programs/sapling.nix diff --git a/modules/programs/mise.nix b/modules/programs/mise.nix new file mode 100644 index 000000000000..404f1bf9ca4b --- /dev/null +++ b/modules/programs/mise.nix @@ -0,0 +1,111 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.programs.mise; + tomlFormat = pkgs.formats.toml { }; +in { + meta.maintainers = [ hm.maintainers.pedorich-n ]; + + imports = let + mkRemovedWarning = opt: + (mkRemovedOptionModule [ "programs" "rtx" opt ] '' + The `rtx` package has been replaced by `mise`, please switch over to + using the options under `programs.mise.*` instead. + ''); + + in map mkRemovedWarning [ + "enable" + "package" + "enableBashIntegration" + "enableZshIntegration" + "enableFishIntegration" + "settings" + ]; + + options = { + programs.mise = { + enable = mkEnableOption "mise"; + + package = mkPackageOption pkgs "mise" { }; + + enableBashIntegration = mkEnableOption "Bash Integration" // { + default = true; + }; + + enableZshIntegration = mkEnableOption "Zsh Integration" // { + default = true; + }; + + enableFishIntegration = mkEnableOption "Fish Integration" // { + default = true; + }; + + globalConfig = mkOption { + type = tomlFormat.type; + default = { }; + example = literalExpression '' + tools = { + node = "lts"; + python = ["3.10" "3.11"]; + }; + + aliases = { + my_custom_node = "20"; + }; + ''; + description = '' + Config written to {file}`$XDG_CONFIG_HOME/mise/config.toml`. + + See + for details on supported values. + ''; + }; + + settings = mkOption { + type = tomlFormat.type; + default = { }; + example = literalExpression '' + verbose = false; + experimental = false; + disable_tools = ["node"]; + ''; + description = '' + Settings written to {file}`$XDG_CONFIG_HOME/mise/settings.toml`. + + See + for details on supported values. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + + xdg.configFile = { + "mise/config.toml" = mkIf (cfg.globalConfig != { }) { + source = tomlFormat.generate "mise-config" cfg.globalConfig; + }; + + "mise/settings.toml" = mkIf (cfg.settings != { }) { + source = tomlFormat.generate "mise-settings" cfg.settings; + }; + }; + + programs = { + bash.initExtra = mkIf cfg.enableBashIntegration '' + eval "$(${getExe cfg.package} activate bash)" + ''; + + zsh.initExtra = mkIf cfg.enableZshIntegration '' + eval "$(${getExe cfg.package} activate zsh)" + ''; + + fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' + ${getExe cfg.package} activate fish | source + ''; + }; + }; +} diff --git a/modules/programs/rtx.nix b/modules/programs/rtx.nix deleted file mode 100644 index 5fa9b5631b90..000000000000 --- a/modules/programs/rtx.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -let - cfg = config.programs.rtx; - tomlFormat = pkgs.formats.toml { }; -in { - meta.maintainers = [ hm.maintainers.pedorich-n ]; - - options = { - programs.rtx = { - enable = mkEnableOption "RTX. Runtime Executor (asdf Rust clone)"; - - package = mkPackageOption pkgs "rtx" { }; - - enableBashIntegration = mkEnableOption "Bash Integration" // { - default = true; - }; - - enableZshIntegration = mkEnableOption "Zsh Integration" // { - default = true; - }; - - enableFishIntegration = mkEnableOption "Fish Integration" // { - default = true; - }; - - settings = mkOption { - type = tomlFormat.type; - default = { }; - example = literalExpression '' - tools = { - node = "lts"; - python = ["3.10" "3.11"]; - }; - - settings = { - verbose = false; - experimental = false; - }; - ''; - description = '' - Settings written to {file}`$XDG_CONFIG_HOME/rtx/config.toml`. - - See - for details on supported values. - - ::: {.warning} - Modifying the `tools` section doesn't make RTX install them. - You have to manually run `rtx install` to install the tools. - ::: - ''; - }; - }; - }; - - config = mkIf cfg.enable { - home.packages = [ cfg.package ]; - - xdg.configFile."rtx/config.toml" = mkIf (cfg.settings != { }) { - source = tomlFormat.generate "rtx-settings" cfg.settings; - }; - - programs = { - bash.initExtra = mkIf cfg.enableBashIntegration '' - eval "$(${getExe cfg.package} activate bash)" - ''; - - zsh.initExtra = mkIf cfg.enableZshIntegration '' - eval "$(${getExe cfg.package} activate zsh)" - ''; - - fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' - ${getExe cfg.package} activate fish | source - ''; - }; - }; -} diff --git a/tests/default.nix b/tests/default.nix index b9874d8b5f95..17e78d9147b2 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -101,6 +101,7 @@ in import nmtSrc { ./modules/programs/man ./modules/programs/mbsync ./modules/programs/micro + ./modules/programs/mise ./modules/programs/mpv ./modules/programs/mu ./modules/programs/mujmap @@ -128,7 +129,6 @@ in import nmtSrc { ./modules/programs/readline ./modules/programs/rio ./modules/programs/ripgrep - ./modules/programs/rtx ./modules/programs/ruff ./modules/programs/sagemath ./modules/programs/sapling diff --git a/tests/modules/programs/mise/bash-integration.nix b/tests/modules/programs/mise/bash-integration.nix new file mode 100644 index 000000000000..552db2ffad1d --- /dev/null +++ b/tests/modules/programs/mise/bash-integration.nix @@ -0,0 +1,16 @@ +{ config, ... }: { + programs = { + mise = { + package = config.lib.test.mkStubPackage { name = "mise"; }; + enable = true; + enableBashIntegration = true; + }; + + bash.enable = true; + }; + + nmt.script = '' + assertFileRegex home-files/.bashrc 'eval "$(/nix/store/.*mise.*/bin/mise activate bash)"' + ''; +} + diff --git a/tests/modules/programs/mise/custom-settings.nix b/tests/modules/programs/mise/custom-settings.nix new file mode 100644 index 000000000000..8f99e790a959 --- /dev/null +++ b/tests/modules/programs/mise/custom-settings.nix @@ -0,0 +1,45 @@ +{ config, pkgs, ... }: { + programs = { + mise = { + package = config.lib.test.mkStubPackage { name = "mise"; }; + enable = true; + globalConfig = { + tools = { + node = "lts"; + python = [ "3.10" "3.11" ]; + }; + + aliases = { my_custom_node = "20"; }; + }; + settings = { + verbose = false; + experimental = true; + disable_tools = [ "node" ]; + }; + }; + }; + + nmt.script = '' + assertFileExists home-files/.config/mise/config.toml + assertPathExists home-files/.config/mise/settings.toml + + assertFileContent home-files/.config/mise/config.toml ${ + pkgs.writeText "mise.config.expected" '' + [aliases] + my_custom_node = "20" + + [tools] + node = "lts" + python = ["3.10", "3.11"] + '' + } + + assertFileContent home-files/.config/mise/settings.toml ${ + pkgs.writeText "mise.settings.expected" '' + disable_tools = ["node"] + experimental = true + verbose = false + '' + } + ''; +} diff --git a/tests/modules/programs/mise/default-settings.nix b/tests/modules/programs/mise/default-settings.nix new file mode 100644 index 000000000000..de59e6297b38 --- /dev/null +++ b/tests/modules/programs/mise/default-settings.nix @@ -0,0 +1,13 @@ +{ config, ... }: { + config = { + programs.mise = { + package = config.lib.test.mkStubPackage { name = "mise"; }; + enable = true; + }; + + nmt.script = '' + assertPathNotExists home-files/.config/mise/config.toml + assertPathNotExists home-files/.config/mise/settings.toml + ''; + }; +} diff --git a/tests/modules/programs/mise/default.nix b/tests/modules/programs/mise/default.nix new file mode 100644 index 000000000000..511082a12830 --- /dev/null +++ b/tests/modules/programs/mise/default.nix @@ -0,0 +1,7 @@ +{ + mise-default-settings = ./default-settings.nix; + mise-custom-settings = ./custom-settings.nix; + mise-bash-integration = ./bash-integration.nix; + mise-zsh-integration = ./zsh-integration.nix; + mise-fish-integration = ./fish-integration.nix; +} diff --git a/tests/modules/programs/rtx/fish-integration.nix b/tests/modules/programs/mise/fish-integration.nix similarity index 63% rename from tests/modules/programs/rtx/fish-integration.nix rename to tests/modules/programs/mise/fish-integration.nix index edc752bd25ca..cb589193116a 100644 --- a/tests/modules/programs/rtx/fish-integration.nix +++ b/tests/modules/programs/mise/fish-integration.nix @@ -1,7 +1,7 @@ { config, ... }: { programs = { - rtx = { - package = config.lib.test.mkStubPackage { name = "rtx"; }; + mise = { + package = config.lib.test.mkStubPackage { name = "mise"; }; enable = true; enableFishIntegration = true; }; @@ -10,7 +10,7 @@ }; nmt.script = '' - assertFileRegex home-files/.config/fish/config.fish '/nix/store/.*rtx.*/bin/rtx activate fish | source' + assertFileRegex home-files/.config/fish/config.fish '/nix/store/.*mise.*/bin/mise activate fish | source' ''; } diff --git a/tests/modules/programs/mise/zsh-integration.nix b/tests/modules/programs/mise/zsh-integration.nix new file mode 100644 index 000000000000..d9b2cdd90305 --- /dev/null +++ b/tests/modules/programs/mise/zsh-integration.nix @@ -0,0 +1,16 @@ +{ config, ... }: { + programs = { + mise = { + package = config.lib.test.mkStubPackage { name = "mise"; }; + enable = true; + enableZshIntegration = true; + }; + + zsh.enable = true; + }; + + nmt.script = '' + assertFileRegex home-files/.zshrc 'eval "$(/nix/store/.*mise.*/bin/mise activate zsh)"' + ''; +} + diff --git a/tests/modules/programs/rtx/bash-integration.nix b/tests/modules/programs/rtx/bash-integration.nix deleted file mode 100644 index 3c05c25cb50a..000000000000 --- a/tests/modules/programs/rtx/bash-integration.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, ... }: { - programs = { - rtx = { - package = config.lib.test.mkStubPackage { name = "rtx"; }; - enable = true; - enableBashIntegration = true; - }; - - bash.enable = true; - }; - - nmt.script = '' - assertFileRegex home-files/.bashrc 'eval "$(/nix/store/.*rtx.*/bin/rtx activate bash)"' - ''; -} - diff --git a/tests/modules/programs/rtx/custom-settings.nix b/tests/modules/programs/rtx/custom-settings.nix deleted file mode 100644 index 74c52f94390c..000000000000 --- a/tests/modules/programs/rtx/custom-settings.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ config, pkgs, ... }: { - programs = { - rtx = { - package = config.lib.test.mkStubPackage { name = "rtx"; }; - enable = true; - settings = { - tools = { - node = "lts"; - python = [ "3.10" "3.11" ]; - }; - - settings = { - verbose = false; - experimental = false; - }; - }; - }; - }; - - nmt.script = '' - assertFileExists home-files/.config/rtx/config.toml - - assertFileContent home-files/.config/rtx/config.toml ${ - pkgs.writeText "rtx.expected" '' - [settings] - experimental = false - verbose = false - - [tools] - node = "lts" - python = ["3.10", "3.11"] - '' - } - ''; -} diff --git a/tests/modules/programs/rtx/default-settings.nix b/tests/modules/programs/rtx/default-settings.nix deleted file mode 100644 index c1a0e7ae5e68..000000000000 --- a/tests/modules/programs/rtx/default-settings.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ config, ... }: { - config = { - programs.rtx = { - package = config.lib.test.mkStubPackage { name = "rtx"; }; - enable = true; - }; - - nmt.script = '' - assertPathNotExists home-files/.config/rtx/config.toml - ''; - }; -} diff --git a/tests/modules/programs/rtx/default.nix b/tests/modules/programs/rtx/default.nix deleted file mode 100644 index 250b5ec6fdf4..000000000000 --- a/tests/modules/programs/rtx/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - rtx-default-settings = ./default-settings.nix; - rtx-custom-settings = ./custom-settings.nix; - rtx-bash-integration = ./bash-integration.nix; - rtx-zsh-integration = ./zsh-integration.nix; - rtx-fish-integration = ./fish-integration.nix; -} diff --git a/tests/modules/programs/rtx/zsh-integration.nix b/tests/modules/programs/rtx/zsh-integration.nix deleted file mode 100644 index fcff308d0555..000000000000 --- a/tests/modules/programs/rtx/zsh-integration.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ config, ... }: { - programs = { - rtx = { - package = config.lib.test.mkStubPackage { name = "rtx"; }; - enable = true; - enableZshIntegration = true; - }; - - zsh.enable = true; - }; - - nmt.script = '' - assertFileRegex home-files/.zshrc 'eval "$(/nix/store/.*rtx.*/bin/rtx activate zsh)"' - ''; -} - From 0021558dba313b6f494cd16362dcd4071f407535 Mon Sep 17 00:00:00 2001 From: Nikita Pedorich Date: Sun, 21 Jan 2024 23:26:31 +0100 Subject: [PATCH 004/636] mise: fix test assertPathExists -> assertFileExists --- tests/modules/programs/mise/custom-settings.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/programs/mise/custom-settings.nix b/tests/modules/programs/mise/custom-settings.nix index 8f99e790a959..ddc45353cc17 100644 --- a/tests/modules/programs/mise/custom-settings.nix +++ b/tests/modules/programs/mise/custom-settings.nix @@ -21,7 +21,7 @@ nmt.script = '' assertFileExists home-files/.config/mise/config.toml - assertPathExists home-files/.config/mise/settings.toml + assertFileExists home-files/.config/mise/settings.toml assertFileContent home-files/.config/mise/config.toml ${ pkgs.writeText "mise.config.expected" '' From 020399c287afa853136b8089c315e238bf4b161d Mon Sep 17 00:00:00 2001 From: Lucas Wagler Date: Sun, 21 Jan 2024 23:17:27 +0000 Subject: [PATCH 005/636] k9s: v0.29/v0.30 compatibility - Add `skins` option for definition of multiple skin files - Change file extension to ".yaml" - Deprecate `skin` option (points to `skins.skin`) --- modules/lib/maintainers.nix | 6 ++ modules/programs/k9s.nix | 88 ++++++++++++------- tests/modules/programs/k9s/default.nix | 2 + .../programs/k9s/deprecated-options.nix | 31 +++++++ ...cted.yml => example-aliases-expected.yaml} | 0 ...ected.yml => example-config-expected.yaml} | 2 + ...ected.yml => example-hotkey-expected.yaml} | 0 ...ected.yml => example-plugin-expected.yaml} | 0 .../modules/programs/k9s/example-settings.nix | 74 ++++++++++------ .../k9s/example-skin-expected-alt.yaml | 8 ++ ...xpected.yml => example-skin-expected.yaml} | 0 ...pected.yml => example-views-expected.yaml} | 0 .../k9s/partial-skin-settings-expected.yaml | 7 ++ .../programs/k9s/partial-skin-settings.nix | 53 +++++++++++ 14 files changed, 212 insertions(+), 59 deletions(-) create mode 100644 tests/modules/programs/k9s/deprecated-options.nix rename tests/modules/programs/k9s/{example-aliases-expected.yml => example-aliases-expected.yaml} (100%) rename tests/modules/programs/k9s/{example-config-expected.yml => example-config-expected.yaml} (76%) rename tests/modules/programs/k9s/{example-hotkey-expected.yml => example-hotkey-expected.yaml} (100%) rename tests/modules/programs/k9s/{example-plugin-expected.yml => example-plugin-expected.yaml} (100%) create mode 100644 tests/modules/programs/k9s/example-skin-expected-alt.yaml rename tests/modules/programs/k9s/{example-skin-expected.yml => example-skin-expected.yaml} (100%) rename tests/modules/programs/k9s/{example-views-expected.yml => example-views-expected.yaml} (100%) create mode 100644 tests/modules/programs/k9s/partial-skin-settings-expected.yaml create mode 100644 tests/modules/programs/k9s/partial-skin-settings.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 9fe03dcf2c77..f45068430b9b 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -159,6 +159,12 @@ github = "loicreynier"; githubId = 88983487; }; + LucasWagler = { + name = "Lucas Wagler"; + email = "lucas@wagler.dev"; + github = "LucasWagler"; + githubId = 32136449; + }; matrss = { name = "Matthias Riße"; email = "matrss@users.noreply.github.com"; diff --git a/modules/programs/k9s.nix b/modules/programs/k9s.nix index 43de8f79c802..900e129e1034 100644 --- a/modules/programs/k9s.nix +++ b/modules/programs/k9s.nix @@ -8,7 +8,20 @@ let yamlFormat = pkgs.formats.yaml { }; in { - meta.maintainers = with maintainers; [ katexochen liyangau ]; + meta.maintainers = with maintainers; [ + katexochen + liyangau + hm.maintainers.LucasWagler + ]; + + imports = [ + (mkRenamedOptionModule [ "programs" "k9s" "skin" ] [ + "programs" + "k9s" + "skins" + "skin" + ]) + ]; options.programs.k9s = { enable = @@ -20,7 +33,7 @@ in { type = yamlFormat.type; default = { }; description = '' - Configuration written to {file}`$XDG_CONFIG_HOME/k9s/config.yml`. See + Configuration written to {file}`$XDG_CONFIG_HOME/k9s/config.yaml`. See for supported values. ''; example = literalExpression '' @@ -30,17 +43,19 @@ in { ''; }; - skin = mkOption { - type = yamlFormat.type; + skins = mkOption { + type = types.attrsOf yamlFormat.type; default = { }; description = '' - Skin written to {file}`$XDG_CONFIG_HOME/k9s/skin.yml`. See + Skin files written to {file}`$XDG_CONFIG_HOME/k9s/skins/`. See for supported values. ''; example = literalExpression '' - k9s = { - body = { - fgColor = "dodgerblue"; + my_blue_skin = { + k9s = { + body = { + fgColor = "dodgerblue"; + }; }; }; ''; @@ -50,7 +65,7 @@ in { type = yamlFormat.type; default = { }; description = '' - Aliases written to {file}`$XDG_CONFIG_HOME/k9s/aliases.yml`. See + Aliases written to {file}`$XDG_CONFIG_HOME/k9s/aliases.yaml`. See for supported values. ''; example = literalExpression '' @@ -65,7 +80,7 @@ in { type = yamlFormat.type; default = { }; description = '' - Hotkeys written to {file}`$XDG_CONFIG_HOME/k9s/hotkey.yml`. See + Hotkeys written to {file}`$XDG_CONFIG_HOME/k9s/hotkey.yaml`. See for supported values. ''; example = literalExpression '' @@ -86,7 +101,7 @@ in { type = yamlFormat.type; default = { }; description = '' - Plugins written to {file}`$XDG_CONFIG_HOME/k9s/plugin.yml`. See + Plugins written to {file}`$XDG_CONFIG_HOME/k9s/plugin.yaml`. See for supported values. ''; example = literalExpression '' @@ -117,7 +132,7 @@ in { type = yamlFormat.type; default = { }; description = '' - Resource column views written to {file}`$XDG_CONFIG_HOME/k9s/views.yml`. + Resource column views written to {file}`$XDG_CONFIG_HOME/k9s/views.yaml`. See for supported values. ''; example = literalExpression '' @@ -140,31 +155,40 @@ in { }; }; - config = mkIf cfg.enable { + config = let + skinSetting = if (!(cfg.settings ? k9s.ui.skin) && cfg.skins != { }) then { + k9s.ui.skin = "${builtins.elemAt (builtins.attrNames cfg.skins) 0}"; + } else + { }; + + skinFiles = mapAttrs' (name: value: + nameValuePair "k9s/skins/${name}.yaml" { + source = yamlFormat.generate "k9s-skin-${name}.yaml" value; + }) cfg.skins; + in mkIf cfg.enable { home.packages = [ cfg.package ]; - xdg.configFile."k9s/config.yml" = mkIf (cfg.settings != { }) { - source = yamlFormat.generate "k9s-config" cfg.settings; - }; - - xdg.configFile."k9s/skin.yml" = mkIf (cfg.skin != { }) { - source = yamlFormat.generate "k9s-skin" cfg.skin; - }; + xdg.configFile = { + "k9s/config.yaml" = mkIf (cfg.settings != { }) { + source = yamlFormat.generate "k9s-config" + (lib.recursiveUpdate skinSetting cfg.settings); + }; - xdg.configFile."k9s/aliases.yml" = mkIf (cfg.aliases != { }) { - source = yamlFormat.generate "k9s-aliases" cfg.aliases; - }; + "k9s/aliases.yaml" = mkIf (cfg.aliases != { }) { + source = yamlFormat.generate "k9s-aliases" cfg.aliases; + }; - xdg.configFile."k9s/hotkey.yml" = mkIf (cfg.hotkey != { }) { - source = yamlFormat.generate "k9s-hotkey" cfg.hotkey; - }; + "k9s/hotkey.yaml" = mkIf (cfg.hotkey != { }) { + source = yamlFormat.generate "k9s-hotkey" cfg.hotkey; + }; - xdg.configFile."k9s/plugin.yml" = mkIf (cfg.plugin != { }) { - source = yamlFormat.generate "k9s-plugin" cfg.plugin; - }; + "k9s/plugin.yaml" = mkIf (cfg.plugin != { }) { + source = yamlFormat.generate "k9s-plugin" cfg.plugin; + }; - xdg.configFile."k9s/views.yml" = mkIf (cfg.views != { }) { - source = yamlFormat.generate "k9s-views" cfg.views; - }; + "k9s/views.yaml" = mkIf (cfg.views != { }) { + source = yamlFormat.generate "k9s-views" cfg.views; + }; + } // skinFiles; }; } diff --git a/tests/modules/programs/k9s/default.nix b/tests/modules/programs/k9s/default.nix index 58d9f32f3e6d..6f5b1ba2a143 100644 --- a/tests/modules/programs/k9s/default.nix +++ b/tests/modules/programs/k9s/default.nix @@ -1,4 +1,6 @@ { k9s-example-settings = ./example-settings.nix; k9s-empty-settings = ./empty-settings.nix; + k9s-deprecated-options = ./deprecated-options.nix; + k9s-partial-skin-settings = ./partial-skin-settings.nix; } diff --git a/tests/modules/programs/k9s/deprecated-options.nix b/tests/modules/programs/k9s/deprecated-options.nix new file mode 100644 index 000000000000..57527252245e --- /dev/null +++ b/tests/modules/programs/k9s/deprecated-options.nix @@ -0,0 +1,31 @@ +{ config, lib, options, ... }: { + programs.k9s = { + enable = true; + skin = { + k9s = { + body = { + fgColor = "dodgerblue"; + bgColor = "#ffffff"; + logoColor = "#0000ff"; + }; + info = { + fgColor = "lightskyblue"; + sectionColor = "steelblue"; + }; + }; + }; + }; + + test.asserts.warnings.enable = true; + test.asserts.warnings.expected = [ + "The option `programs.k9s.skin' defined in ${ + lib.showFiles options.programs.k9s.skin.files + } has been renamed to `programs.k9s.skins.skin'." + ]; + nmt.script = '' + assertFileExists home-files/.config/k9s/skins/skin.yaml + assertFileContent \ + home-files/.config/k9s/skins/skin.yaml \ + ${./example-skin-expected.yaml} + ''; +} diff --git a/tests/modules/programs/k9s/example-aliases-expected.yml b/tests/modules/programs/k9s/example-aliases-expected.yaml similarity index 100% rename from tests/modules/programs/k9s/example-aliases-expected.yml rename to tests/modules/programs/k9s/example-aliases-expected.yaml diff --git a/tests/modules/programs/k9s/example-config-expected.yml b/tests/modules/programs/k9s/example-config-expected.yaml similarity index 76% rename from tests/modules/programs/k9s/example-config-expected.yml rename to tests/modules/programs/k9s/example-config-expected.yaml index 019ee7a727db..5f4c43ffae11 100644 --- a/tests/modules/programs/k9s/example-config-expected.yml +++ b/tests/modules/programs/k9s/example-config-expected.yaml @@ -3,3 +3,5 @@ k9s: headless: false maxConnRetry: 5 refreshRate: 2 + ui: + skin: default diff --git a/tests/modules/programs/k9s/example-hotkey-expected.yml b/tests/modules/programs/k9s/example-hotkey-expected.yaml similarity index 100% rename from tests/modules/programs/k9s/example-hotkey-expected.yml rename to tests/modules/programs/k9s/example-hotkey-expected.yaml diff --git a/tests/modules/programs/k9s/example-plugin-expected.yml b/tests/modules/programs/k9s/example-plugin-expected.yaml similarity index 100% rename from tests/modules/programs/k9s/example-plugin-expected.yml rename to tests/modules/programs/k9s/example-plugin-expected.yaml diff --git a/tests/modules/programs/k9s/example-settings.nix b/tests/modules/programs/k9s/example-settings.nix index 3c935aa6fc74..7816a050fd2a 100644 --- a/tests/modules/programs/k9s/example-settings.nix +++ b/tests/modules/programs/k9s/example-settings.nix @@ -11,6 +11,7 @@ maxConnRetry = 5; enableMouse = true; headless = false; + ui.skin = "default"; }; }; hotkey = { @@ -22,16 +23,31 @@ }; }; }; - skin = { - k9s = { - body = { - fgColor = "dodgerblue"; - bgColor = "#ffffff"; - logoColor = "#0000ff"; + skins = { + "default" = { + k9s = { + body = { + fgColor = "dodgerblue"; + bgColor = "#ffffff"; + logoColor = "#0000ff"; + }; + info = { + fgColor = "lightskyblue"; + sectionColor = "steelblue"; + }; }; - info = { - fgColor = "lightskyblue"; - sectionColor = "steelblue"; + }; + "alt-skin" = { + k9s = { + body = { + fgColor = "orangered"; + bgColor = "#ffffff"; + logoColor = "#0000ff"; + }; + info = { + fgColor = "red"; + sectionColor = "mediumvioletred"; + }; }; }; }; @@ -61,29 +77,33 @@ }; nmt.script = '' - assertFileExists home-files/.config/k9s/config.yml + assertFileExists home-files/.config/k9s/config.yaml + assertFileContent \ + home-files/.config/k9s/config.yaml \ + ${./example-config-expected.yaml} + assertFileExists home-files/.config/k9s/skins/default.yaml assertFileContent \ - home-files/.config/k9s/config.yml \ - ${./example-config-expected.yml} - assertFileExists home-files/.config/k9s/skin.yml + home-files/.config/k9s/skins/default.yaml \ + ${./example-skin-expected.yaml} + assertFileExists home-files/.config/k9s/skins/alt-skin.yaml assertFileContent \ - home-files/.config/k9s/skin.yml \ - ${./example-skin-expected.yml} - assertFileExists home-files/.config/k9s/hotkey.yml + home-files/.config/k9s/skins/alt-skin.yaml \ + ${./example-skin-expected-alt.yaml} + assertFileExists home-files/.config/k9s/hotkey.yaml assertFileContent \ - home-files/.config/k9s/hotkey.yml \ - ${./example-hotkey-expected.yml} - assertFileExists home-files/.config/k9s/aliases.yml + home-files/.config/k9s/hotkey.yaml \ + ${./example-hotkey-expected.yaml} + assertFileExists home-files/.config/k9s/aliases.yaml assertFileContent \ - home-files/.config/k9s/aliases.yml \ - ${./example-aliases-expected.yml} - assertFileExists home-files/.config/k9s/plugin.yml + home-files/.config/k9s/aliases.yaml \ + ${./example-aliases-expected.yaml} + assertFileExists home-files/.config/k9s/plugin.yaml assertFileContent \ - home-files/.config/k9s/plugin.yml \ - ${./example-plugin-expected.yml} - assertFileExists home-files/.config/k9s/views.yml + home-files/.config/k9s/plugin.yaml \ + ${./example-plugin-expected.yaml} + assertFileExists home-files/.config/k9s/views.yaml assertFileContent \ - home-files/.config/k9s/views.yml \ - ${./example-views-expected.yml} + home-files/.config/k9s/views.yaml \ + ${./example-views-expected.yaml} ''; } diff --git a/tests/modules/programs/k9s/example-skin-expected-alt.yaml b/tests/modules/programs/k9s/example-skin-expected-alt.yaml new file mode 100644 index 000000000000..e78242ab05da --- /dev/null +++ b/tests/modules/programs/k9s/example-skin-expected-alt.yaml @@ -0,0 +1,8 @@ +k9s: + body: + bgColor: '#ffffff' + fgColor: orangered + logoColor: '#0000ff' + info: + fgColor: red + sectionColor: mediumvioletred diff --git a/tests/modules/programs/k9s/example-skin-expected.yml b/tests/modules/programs/k9s/example-skin-expected.yaml similarity index 100% rename from tests/modules/programs/k9s/example-skin-expected.yml rename to tests/modules/programs/k9s/example-skin-expected.yaml diff --git a/tests/modules/programs/k9s/example-views-expected.yml b/tests/modules/programs/k9s/example-views-expected.yaml similarity index 100% rename from tests/modules/programs/k9s/example-views-expected.yml rename to tests/modules/programs/k9s/example-views-expected.yaml diff --git a/tests/modules/programs/k9s/partial-skin-settings-expected.yaml b/tests/modules/programs/k9s/partial-skin-settings-expected.yaml new file mode 100644 index 000000000000..8d8b0ef7dbd8 --- /dev/null +++ b/tests/modules/programs/k9s/partial-skin-settings-expected.yaml @@ -0,0 +1,7 @@ +k9s: + enableMouse: true + headless: false + maxConnRetry: 5 + refreshRate: 2 + ui: + skin: alt-skin diff --git a/tests/modules/programs/k9s/partial-skin-settings.nix b/tests/modules/programs/k9s/partial-skin-settings.nix new file mode 100644 index 000000000000..ff296461ced9 --- /dev/null +++ b/tests/modules/programs/k9s/partial-skin-settings.nix @@ -0,0 +1,53 @@ +{ config, ... }: + +# When not specified in `programs.k9s.settings.ui.skin`, +# test that the first skin name (alphabetically) is used in the config file + +{ + programs.k9s = { + enable = true; + settings = { + k9s = { + refreshRate = 2; + maxConnRetry = 5; + enableMouse = true; + headless = false; + }; + }; + skins = { + "default" = { + k9s = { + body = { + fgColor = "dodgerblue"; + bgColor = "#ffffff"; + logoColor = "#0000ff"; + }; + info = { + fgColor = "lightskyblue"; + sectionColor = "steelblue"; + }; + }; + }; + "alt-skin" = { + k9s = { + body = { + fgColor = "orangered"; + bgColor = "#ffffff"; + logoColor = "#0000ff"; + }; + info = { + fgColor = "red"; + sectionColor = "mediumvioletred"; + }; + }; + }; + }; + }; + + nmt.script = '' + assertFileExists home-files/.config/k9s/config.yaml + assertFileContent \ + home-files/.config/k9s/config.yaml \ + ${./partial-skin-settings-expected.yaml} + ''; +} From 4af6720fff6cdc6188ccd4533365a202f6adeccc Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 22 Jan 2024 00:16:25 +0100 Subject: [PATCH 006/636] k9s: fix unnecessary test dependency --- tests/modules/programs/k9s/deprecated-options.nix | 2 ++ tests/modules/programs/k9s/partial-skin-settings.nix | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/modules/programs/k9s/deprecated-options.nix b/tests/modules/programs/k9s/deprecated-options.nix index 57527252245e..a2bf4685aa3a 100644 --- a/tests/modules/programs/k9s/deprecated-options.nix +++ b/tests/modules/programs/k9s/deprecated-options.nix @@ -16,6 +16,8 @@ }; }; + test.stubs.k9s = { }; + test.asserts.warnings.enable = true; test.asserts.warnings.expected = [ "The option `programs.k9s.skin' defined in ${ diff --git a/tests/modules/programs/k9s/partial-skin-settings.nix b/tests/modules/programs/k9s/partial-skin-settings.nix index ff296461ced9..ba2a61ce526a 100644 --- a/tests/modules/programs/k9s/partial-skin-settings.nix +++ b/tests/modules/programs/k9s/partial-skin-settings.nix @@ -44,6 +44,8 @@ }; }; + test.stubs.k9s = { }; + nmt.script = '' assertFileExists home-files/.config/k9s/config.yaml assertFileContent \ From 2d47379ad591bcb14ca95a90b6964b8305f6c913 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Mon, 22 Jan 2024 00:24:39 +0100 Subject: [PATCH 007/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/c3e128f3c0ecc1fb04aef9f72b3dcc2f6cecf370' (2024-01-15) → 'github:NixOS/nixpkgs/bbe7d8f876fbbe7c959c90ba2ae2852220573261' (2024-01-19) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 115cd7d7de2c..c4ba38570c5c 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1705316053, - "narHash": "sha256-J2Ey5mPFT8gdfL2XC0JTZvKaBw/b2pnyudEXFvl+dQM=", + "lastModified": 1705677747, + "narHash": "sha256-eyM3okYtMgYDgmYukoUzrmuoY4xl4FUujnsv/P6I/zI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c3e128f3c0ecc1fb04aef9f72b3dcc2f6cecf370", + "rev": "bbe7d8f876fbbe7c959c90ba2ae2852220573261", "type": "github" }, "original": { From 3d0dc78e80031731240c979d87eed8e090d35439 Mon Sep 17 00:00:00 2001 From: Anton Tetov Date: Tue, 23 Jan 2024 08:21:17 +0100 Subject: [PATCH 008/636] bemenu: allow floats in settings For example, the CLI option --width-factor controls the width of the launcher and is set to a value between 0-1. --- modules/programs/bemenu.nix | 3 ++- tests/modules/programs/bemenu/basic-configuration.nix | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/programs/bemenu.nix b/modules/programs/bemenu.nix index 3cfd000265bc..58d24dcc2cab 100644 --- a/modules/programs/bemenu.nix +++ b/modules/programs/bemenu.nix @@ -15,7 +15,7 @@ in { package = mkPackageOption pkgs "bemenu" { }; settings = mkOption { - type = with types; attrsOf (oneOf [ str int bool ]); + type = with types; attrsOf (oneOf [ str number bool ]); default = { }; example = literalExpression '' { @@ -32,6 +32,7 @@ in { hf = "#f9e2af"; af = "#cdd6f4"; ab = "#1e1e2e"; + width-factor = 0.3; } ''; description = diff --git a/tests/modules/programs/bemenu/basic-configuration.nix b/tests/modules/programs/bemenu/basic-configuration.nix index 3284975ca94f..0615ae3ca765 100644 --- a/tests/modules/programs/bemenu/basic-configuration.nix +++ b/tests/modules/programs/bemenu/basic-configuration.nix @@ -15,12 +15,13 @@ hf = "#f9e2af"; af = "#cdd6f4"; ab = "#1e1e2e"; + width-factor = 0.3; }; }; nmt.script = '' assertFileExists home-path/etc/profile.d/hm-session-vars.sh assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ - "export BEMENU_OPTS=\"'--ab' '#1e1e2e' '--af' '#cdd6f4' '--fb' '#1e1e2e' '--ff' '#cdd6f4' '--hb' '#1e1e2e' '--hf' '#f9e2af' '--ignorecase' '--line-height' '28' '--nb' '#1e1e2e' '--nf' '#cdd6f4' '--prompt' 'open' '--tb' '#1e1e2e' '--tf' '#f38ba8'\"" + "export BEMENU_OPTS=\"'--ab' '#1e1e2e' '--af' '#cdd6f4' '--fb' '#1e1e2e' '--ff' '#cdd6f4' '--hb' '#1e1e2e' '--hf' '#f9e2af' '--ignorecase' '--line-height' '28' '--nb' '#1e1e2e' '--nf' '#cdd6f4' '--prompt' 'open' '--tb' '#1e1e2e' '--tf' '#f38ba8' '--width-factor' '0.300000'\"" ''; } From 3df2a80f3f85f91ea06e5e91071fa74ba92e5084 Mon Sep 17 00:00:00 2001 From: Jan Tebernum Date: Tue, 23 Jan 2024 10:10:11 +0100 Subject: [PATCH 009/636] zoxide: fix nushell 0.89 deprecation Since nushell 0.89, automatically spreading lists is deprecated. This commit introduces a string replace for the zoxide init script to replace the deprecated code. See: https://github.com/ajeetdsouza/zoxide/issues/662 Fixes: #4916 --- modules/programs/zoxide.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/programs/zoxide.nix b/modules/programs/zoxide.nix index fe82ffc25eec..89b634220e92 100644 --- a/modules/programs/zoxide.nix +++ b/modules/programs/zoxide.nix @@ -88,6 +88,7 @@ in { } ${cfg.package}/bin/zoxide init nushell ${cfgOptions} | str replace "def-env" "def --env" --all | # https://github.com/ajeetdsouza/zoxide/pull/632 + str replace --all "-- $rest" "-- ...$rest" | save --force ${config.xdg.cacheHome}/zoxide/init.nu ''; extraConfig = '' From 6b28ab2d798c1c84e24053d95f4ee1dd9d81e2fb Mon Sep 17 00:00:00 2001 From: Nikita Pedorich Date: Wed, 24 Jan 2024 08:21:24 +0100 Subject: [PATCH 010/636] tealdeer: add cache update activation script Calls 'tldr --update' on home-manager switch --- modules/programs/tealdeer.nix | 5 +++++ tests/default.nix | 1 + tests/modules/programs/tealdeer/default-settings.nix | 12 ++++++++++++ tests/modules/programs/tealdeer/default.nix | 1 + 4 files changed, 19 insertions(+) create mode 100644 tests/modules/programs/tealdeer/default-settings.nix create mode 100644 tests/modules/programs/tealdeer/default.nix diff --git a/modules/programs/tealdeer.nix b/modules/programs/tealdeer.nix index f0e610c2d4fa..08ba9d3f33ce 100644 --- a/modules/programs/tealdeer.nix +++ b/modules/programs/tealdeer.nix @@ -49,5 +49,10 @@ in { home.file."${configDir}/tealdeer/config.toml" = mkIf (cfg.settings != { }) { source = tomlFormat.generate "tealdeer-config" cfg.settings; }; + + home.activation.tealdeerCache = hm.dag.entryAfter [ "linkGeneration" ] '' + $VERBOSE_ECHO "Rebuilding tealdeer cache" + $DRY_RUN_CMD ${getExe pkgs.tealdeer} --update + ''; }; } diff --git a/tests/default.nix b/tests/default.nix index 17e78d9147b2..b3e963bbd37e 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -140,6 +140,7 @@ in import nmtSrc { ./modules/programs/ssh ./modules/programs/starship ./modules/programs/taskwarrior + ./modules/programs/tealdeer ./modules/programs/texlive ./modules/programs/thefuck ./modules/programs/tmate diff --git a/tests/modules/programs/tealdeer/default-settings.nix b/tests/modules/programs/tealdeer/default-settings.nix new file mode 100644 index 000000000000..0044ca8f31c0 --- /dev/null +++ b/tests/modules/programs/tealdeer/default-settings.nix @@ -0,0 +1,12 @@ +{ config, ... }: { + config = { + programs.tealdeer = { + package = config.lib.test.mkStubPackage { name = "tldr"; }; + enable = true; + }; + + nmt.script = '' + assertFileRegex activate '/nix/store/.*tealdeer.*/bin/tldr --update' + ''; + }; +} diff --git a/tests/modules/programs/tealdeer/default.nix b/tests/modules/programs/tealdeer/default.nix new file mode 100644 index 000000000000..e9deed9393d4 --- /dev/null +++ b/tests/modules/programs/tealdeer/default.nix @@ -0,0 +1 @@ +{ tealdeer-default-settings = ./default-settings.nix; } From 425672900691a16a897fc47b4d5c3013d2a822a0 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 13 Jan 2024 23:15:00 +0100 Subject: [PATCH 011/636] treewide: deprecate `DRY_RUN_CMD` and `DRY_RUN_NULL` As a replacement, this adds the `run` helper function. --- docs/release-notes/rl-2405.md | 29 +++++++++++++++++++ home-manager/home-manager | 13 ++------- lib/bash/home-manager.sh | 24 +++++++++++++++ modules/files.nix | 20 +++++++------ modules/home-environment.nix | 24 ++++++++++----- modules/launchd/default.nix | 10 +++---- modules/lib-bash/activation-init.sh | 5 +++- modules/misc/dconf.nix | 4 +-- modules/misc/uninstall.nix | 8 ++--- modules/misc/xdg-user-dirs.nix | 2 +- modules/misc/xfconf.nix | 4 +-- modules/programs/bat.nix | 2 +- modules/programs/gh.nix | 2 +- modules/programs/gpg.nix | 7 ++--- modules/programs/mbsync.nix | 2 +- modules/programs/mu.nix | 2 +- modules/programs/taskwarrior.nix | 4 +-- modules/programs/vscode.nix | 4 +-- modules/services/dropbox.nix | 6 ++-- modules/systemd-activate.sh | 2 +- modules/targets/darwin/fonts.nix | 2 +- modules/targets/darwin/keybindings.nix | 2 +- .../targets/darwin/user-defaults/default.nix | 6 ++-- .../modules/programs/gpg/mutable-keyfiles.nix | 6 ++-- .../programs/mu/basic-configuration.nix | 2 +- 25 files changed, 125 insertions(+), 67 deletions(-) diff --git a/docs/release-notes/rl-2405.md b/docs/release-notes/rl-2405.md index d653e6040a68..1c35fd02bbf5 100644 --- a/docs/release-notes/rl-2405.md +++ b/docs/release-notes/rl-2405.md @@ -31,6 +31,35 @@ This release has the following notable changes: _all_ Home Manager state from your user environment. This includes removing all your historic Home Manager generations! +- The use of `$DRY_RUN_CMD` and `$DRY_RUN_NULL` in activation script + blocks is now deprecated. Instead use the new shell function + {command}`run`. In most cases it is sufficient to replace + `$DRY_RUN_CMD` by {command}`run`. For example, if your configuration + currently contains + + ```nix + home.activation.reportChanges = config.lib.dag.entryAnywhere '' + if [[ -v oldGenPath ]]; then + $DRY_RUN_CMD nix store diff-closures $oldGenPath $newGenPath + fi + ''; + ``` + + then you are now encouraged to change to + + ```nix + home.activation.reportChanges = config.lib.dag.entryAnywhere '' + if [[ -v oldGenPath ]]; then + run nix store diff-closures $oldGenPath $newGenPath + fi + ''; + ``` + + See the description of [home.activation](#opt-home.activation) for + more. The deprecated variables will continue to work for now but + their use may in the future trigger a warning message and eventually + they may be removed entirely. + ## State Version Changes {#sec-release-24.05-state-version-changes} The state version in this release includes the changes below. These diff --git a/home-manager/home-manager b/home-manager/home-manager index 34407ed27ede..eb69530a8627 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -21,18 +21,12 @@ function setNixProfileCommands() { fi } -function setVerboseAndDryRun() { +function setVerboseArg() { if [[ -v VERBOSE ]]; then export VERBOSE_ARG="--verbose" else export VERBOSE_ARG="" fi - - if [[ -v DRY_RUN ]] ; then - export DRY_RUN_CMD=echo - else - export DRY_RUN_CMD="" - fi } function setWorkDir() { @@ -661,7 +655,7 @@ function doListGens() { # generations to remove. function doRmGenerations() { setHomeManagerPathVariables - setVerboseAndDryRun + setVerboseArg pushd "$HM_PROFILE_DIR" > /dev/null @@ -674,7 +668,7 @@ function doRmGenerations() { _i 'Cannot remove the current generation %s' "$generationId" >&2 else _i 'Removing generation %s' "$generationId" - $DRY_RUN_CMD rm $VERBOSE_ARG $linkName + run rm $VERBOSE_ARG $linkName fi done @@ -809,7 +803,6 @@ function doShowNews() { function doUninstall() { setHomeManagerPathVariables - setVerboseAndDryRun setNixProfileCommands _i 'This will remove Home Manager from your system.' diff --git a/lib/bash/home-manager.sh b/lib/bash/home-manager.sh index b7f3f42b2817..18d477075077 100644 --- a/lib/bash/home-manager.sh +++ b/lib/bash/home-manager.sh @@ -83,3 +83,27 @@ function _iNote() { _i "$@" echo -n "${normalColor}" } + +# Runs the given command on live run, otherwise prints the command to standard +# output. +# +# If given the command line option `--silence`, then the command's standard and +# error output is sent to `/dev/null` on a live run. +# +# Note, the run function is exported. I.e., it is available also to called Bash +# script. +function run() { + if [[ $1 == '--silence' ]]; then + local silence=1 + shift + fi + + if [[ -v DRY_RUN ]] ; then + echo "$@" + elif [[ -v silence ]] ; then + "$@" > /dev/null 2>&1 + else + "$@" + fi +} +export -f run diff --git a/modules/files.nix b/modules/files.nix index c869df1d8617..9bbdb5b7175f 100644 --- a/modules/files.nix +++ b/modules/files.nix @@ -169,6 +169,8 @@ in home.activation.linkGeneration = hm.dag.entryAfter ["writeBoundary"] ( let link = pkgs.writeShellScript "link" '' + ${config.lib.bash.initHomeManagerLib} + newGenFiles="$1" shift for sourcePath in "$@" ; do @@ -177,7 +179,7 @@ in if [[ -e "$targetPath" && ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then # The target exists, back it up backup="$targetPath.$HOME_MANAGER_BACKUP_EXT" - $DRY_RUN_CMD mv $VERBOSE_ARG "$targetPath" "$backup" || errorEcho "Moving '$targetPath' failed!" + run mv $VERBOSE_ARG "$targetPath" "$backup" || errorEcho "Moving '$targetPath' failed!" fi if [[ -e "$targetPath" && ! -L "$targetPath" ]] && cmp -s "$sourcePath" "$targetPath" ; then @@ -186,8 +188,8 @@ in else # Place that symlink, --force # This can still fail if the target is a directory, in which case we bail out. - $DRY_RUN_CMD mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")" - $DRY_RUN_CMD ln -Tsf $VERBOSE_ARG "$sourcePath" "$targetPath" || exit 1 + run mkdir -p $VERBOSE_ARG "$(dirname "$targetPath")" + run ln -Tsf $VERBOSE_ARG "$sourcePath" "$targetPath" || exit 1 fi done ''; @@ -209,7 +211,7 @@ in warnEcho "Path '$targetPath' does not link into a Home Manager generation. Skipping delete." else $VERBOSE_ECHO "Checking $targetPath: gone (deleting)" - $DRY_RUN_CMD rm $VERBOSE_ARG "$targetPath" + run rm $VERBOSE_ARG "$targetPath" # Recursively delete empty parent directories. targetDir="$(dirname "$relativePath")" @@ -219,7 +221,7 @@ in # Call rmdir with a relative path excluding $HOME. # Otherwise, it might try to delete $HOME and exit # with a permission error. - $DRY_RUN_CMD rmdir $VERBOSE_ARG \ + run rmdir $VERBOSE_ARG \ -p --ignore-fail-on-non-empty \ "$targetDir" @@ -267,14 +269,14 @@ in nix profile list --profile "$genProfilePath" \ | cut -d ' ' -f 4 \ | xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG --profile "$genProfilePath" - $DRY_RUN_CMD nix profile install $VERBOSE_ARG --profile "$genProfilePath" "$newGenPath" + run nix profile install $VERBOSE_ARG --profile "$genProfilePath" "$newGenPath" else - $DRY_RUN_CMD nix-env $VERBOSE_ARG --profile "$genProfilePath" --set "$newGenPath" + run nix-env $VERBOSE_ARG --profile "$genProfilePath" --set "$newGenPath" fi - $DRY_RUN_CMD nix-store --realise "$newGenPath" --add-root "$newGenGcPath" > "$DRY_RUN_NULL" + run --silence nix-store --realise "$newGenPath" --add-root "$newGenGcPath" if [[ -e "$legacyGenGcPath" ]]; then - $DRY_RUN_CMD rm $VERBOSE_ARG "$legacyGenGcPath" + run rm $VERBOSE_ARG "$legacyGenGcPath" fi else _i "No change so reusing latest profile generation %s" "$oldGenNum" diff --git a/modules/home-environment.nix b/modules/home-environment.nix index d0d44472a32e..0a9936516d0d 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -374,7 +374,7 @@ in example = literalExpression '' { myActivationAction = lib.hm.dag.entryAfter ["writeBoundary"] ''' - $DRY_RUN_CMD ln -s $VERBOSE_ARG \ + run ln -s $VERBOSE_ARG \ ''${builtins.toPath ./link-me-directly} $HOME '''; } @@ -396,11 +396,19 @@ in collisions between non-managed files and files defined in [](#opt-home.file). - A script block should respect the {var}`DRY_RUN` - variable, if it is set then the actions taken by the script - should be logged to standard out and not actually performed. - The variable {var}`DRY_RUN_CMD` is set to - {command}`echo` if dry run is enabled. + A script block should respect the {var}`DRY_RUN` variable. If it is set + then the actions taken by the script should be logged to standard out + and not actually performed. A convenient shell function {command}`run` + is provided for activation script blocks. It is used as follows: + + {command}`run {command}` + : Runs the given command on live run, otherwise prints the command to + standard output. + + {command}`run --silence {command}` + : Runs the given command on live run and sends its standard and error + output to {file}`/dev/null`, otherwise prints the command to standard + output. A script block should also respect the {var}`VERBOSE` variable, and if set print @@ -594,7 +602,7 @@ in nixProfileRemove 'home-manager-path' - $DRY_RUN_CMD $oldNix profile install $1 + run $oldNix profile install $1 } if [[ -e ${cfg.profileDirectory}/manifest.json ]] ; then @@ -604,7 +612,7 @@ in REMOVE_CMD_SYNTAX='nix profile remove {number | store path}' else INSTALL_CMD="nix-env -i" - INSTALL_CMD_ACTUAL="$DRY_RUN_CMD nix-env -i" + INSTALL_CMD_ACTUAL="run nix-env -i" LIST_CMD="nix-env -q" REMOVE_CMD_SYNTAX='nix-env -e {package name}' fi diff --git a/modules/launchd/default.nix b/modules/launchd/default.nix index 90e5360de121..6a9c44efd710 100644 --- a/modules/launchd/default.nix +++ b/modules/launchd/default.nix @@ -162,7 +162,7 @@ in { fi if [[ -f "$dstPath" ]]; then for (( i = 0; i < bootout_retries; i++ )); do - $DRY_RUN_CMD /bin/launchctl bootout "$domain/$agentName" || err=$? + run /bin/launchctl bootout "$domain/$agentName" || err=$? if [[ -v DRY_RUN ]]; then break fi @@ -177,8 +177,8 @@ in { return 1 fi fi - $DRY_RUN_CMD install -Dm444 -T "$srcPath" "$dstPath" - $DRY_RUN_CMD /bin/launchctl bootstrap "$domain" "$dstPath" + run install -Dm444 -T "$srcPath" "$dstPath" + run /bin/launchctl bootstrap "$domain" "$dstPath" done if [[ ! -e "$oldDir" ]]; then @@ -194,7 +194,7 @@ in { continue fi - $DRY_RUN_CMD /bin/launchctl bootout "$domain/$agentName" || : + run /bin/launchctl bootout "$domain/$agentName" || : if [[ ! -e "$dstPath" ]]; then continue fi @@ -202,7 +202,7 @@ in { warnEcho "Skipping deletion of '$dstPath', since its contents have diverged" continue fi - $DRY_RUN_CMD rm -f $VERBOSE_ARG "$dstPath" + run rm -f $VERBOSE_ARG "$dstPath" done } diff --git a/modules/lib-bash/activation-init.sh b/modules/lib-bash/activation-init.sh index 0924c637ec06..aff833cb9609 100755 --- a/modules/lib-bash/activation-init.sh +++ b/modules/lib-bash/activation-init.sh @@ -115,7 +115,7 @@ function nixProfileRemove() { nixProfileList "$1" | xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG else if nix-env -q | grep -q "^$1$"; then - $DRY_RUN_CMD nix-env -e "$1" > $DRY_RUN_NULL 2>&1 + run --silence nix-env -e "$1" fi fi } @@ -161,6 +161,9 @@ nix-env -q > /dev/null 2>&1 || true migrateProfile setupVars +# Note, the DRY_RUN_CMD and DRY_RUN_NULL variables are deprecated and should not +# be used inside the Home Manager project. They are provided here for backwards +# compatibility. if [[ -v DRY_RUN ]] ; then _i "This is a dry run" export DRY_RUN_CMD=echo diff --git a/modules/misc/dconf.nix b/modules/misc/dconf.nix index 24e02a129903..291dabf2db0f 100644 --- a/modules/misc/dconf.nix +++ b/modules/misc/dconf.nix @@ -112,7 +112,7 @@ in { '($old[] - $new[])[]' \ | while read -r key; do $VERBOSE_ECHO "Resetting dconf key \"$key\"" - $DRY_RUN_CMD $DCONF_DBUS_RUN_SESSION dconf reset "$key" + run $DCONF_DBUS_RUN_SESSION dconf reset "$key" done ''; in '' @@ -128,7 +128,7 @@ in { "$newGenPath/${statePath}" fi - $DRY_RUN_CMD $DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / < ${iniFile} + run $DCONF_DBUS_RUN_SESSION ${pkgs.dconf}/bin/dconf load / < ${iniFile} unset DCONF_DBUS_RUN_SESSION ''); diff --git a/modules/misc/uninstall.nix b/modules/misc/uninstall.nix index eeb0fa4f000a..d12bde43ac4f 100644 --- a/modules/misc/uninstall.nix +++ b/modules/misc/uninstall.nix @@ -31,19 +31,19 @@ in { nixProfileRemove home-manager-path if [[ -e $hmDataPath ]]; then - $DRY_RUN_CMD rm $VERBOSE_ARG -r "$hmDataPath" + run rm $VERBOSE_ARG -r "$hmDataPath" fi if [[ -e $hmStatePath ]]; then - $DRY_RUN_CMD rm $VERBOSE_ARG -r "$hmStatePath" + run rm $VERBOSE_ARG -r "$hmStatePath" fi if [[ -e $genProfilePath ]]; then - $DRY_RUN_CMD rm $VERBOSE_ARG "$genProfilePath"* + run rm $VERBOSE_ARG "$genProfilePath"* fi if [[ -e $legacyGenGcPath ]]; then - $DRY_RUN_CMD rm $VERBOSE_ARG "$legacyGenGcPath" + run rm $VERBOSE_ARG "$legacyGenGcPath" fi ''; }; diff --git a/modules/misc/xdg-user-dirs.nix b/modules/misc/xdg-user-dirs.nix index fcc0742cd173..c9912812feb2 100644 --- a/modules/misc/xdg-user-dirs.nix +++ b/modules/misc/xdg-user-dirs.nix @@ -137,7 +137,7 @@ in { home.activation.createXdgUserDirectories = mkIf cfg.createDirectories (let directoriesList = attrValues directories; - mkdir = (dir: ''$DRY_RUN_CMD mkdir -p $VERBOSE_ARG "${dir}"''); + mkdir = (dir: ''run mkdir -p $VERBOSE_ARG "${dir}"''); in lib.hm.dag.entryAfter [ "linkGeneration" ] (strings.concatMapStringsSep "\n" mkdir directoriesList)); }; diff --git a/modules/misc/xfconf.nix b/modules/misc/xfconf.nix index ec0cd82d0319..f343020e3c9b 100644 --- a/modules/misc/xfconf.nix +++ b/modules/misc/xfconf.nix @@ -106,7 +106,7 @@ in { home.activation.xfconfSettings = hm.dag.entryAfter [ "installPackages" ] (let mkCommand = channel: property: value: '' - $DRY_RUN_CMD ${pkgs.xfce.xfconf}/bin/xfconf-query \ + run ${pkgs.xfce.xfconf}/bin/xfconf-query \ ${ escapeShellArgs ([ "-c" channel "-p" "/${property}" ] ++ (if value == null then @@ -129,7 +129,7 @@ in { export DBUS_RUN_SESSION_CMD="${pkgs.dbus}/bin/dbus-run-session --dbus-daemon=${pkgs.dbus}/bin/dbus-daemon" fi - $DRY_RUN_CMD $DBUS_RUN_SESSION_CMD ${load} + run $DBUS_RUN_SESSION_CMD ${load} unset DBUS_RUN_SESSION_CMD ''); diff --git a/modules/programs/bat.nix b/modules/programs/bat.nix index b3951c33bb4b..eb592becd657 100644 --- a/modules/programs/bat.nix +++ b/modules/programs/bat.nix @@ -163,7 +163,7 @@ in { ( export XDG_CACHE_HOME=${escapeShellArg config.xdg.cacheHome} $VERBOSE_ECHO "Rebuilding bat theme cache" - $DRY_RUN_CMD ${lib.getExe package} cache --build + run ${lib.getExe package} cache --build ) ''; } diff --git a/modules/programs/gh.nix b/modules/programs/gh.nix index 7e6885497775..03e8feab5304 100644 --- a/modules/programs/gh.nix +++ b/modules/programs/gh.nix @@ -143,7 +143,7 @@ in { trap "rm --force --recursive $TMP_DIR" EXIT cp "${ghHosts}" $TMP_DIR/ export GH_CONFIG_DIR=$TMP_DIR - $DRY_RUN_CMD ${getExe cfg.package} help 2>&1 > $DRY_RUN_NULL + run --silence ${getExe cfg.package} help cp $TMP_DIR/hosts.yml "${ghHosts}" ) fi diff --git a/modules/programs/gpg.nix b/modules/programs/gpg.nix index bc4cf4497946..1453892123fb 100644 --- a/modules/programs/gpg.nix +++ b/modules/programs/gpg.nix @@ -282,7 +282,7 @@ in { home.activation = { createGpgHomedir = hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] '' - $DRY_RUN_CMD mkdir -m700 -p $VERBOSE_ARG ${escapeShellArg cfg.homedir} + run mkdir -m700 -p $VERBOSE_ARG ${escapeShellArg cfg.homedir} ''; importGpgKeys = let @@ -290,12 +290,11 @@ in { importKey = { source, trust, ... }: # Import mutable keys - optional cfg.mutableKeys - "$DRY_RUN_CMD ${gpg} $QUIET_ARG --import ${source}" + optional cfg.mutableKeys "run ${gpg} $QUIET_ARG --import ${source}" # Import mutable trust ++ optional (trust != null && cfg.mutableTrust) - ''$DRY_RUN_CMD importTrust "${source}" ${toString trust}''; + ''run importTrust "${source}" ${toString trust}''; anyTrust = any (k: k.trust != null) cfg.publicKeys; diff --git a/modules/programs/mbsync.nix b/modules/programs/mbsync.nix index d43f645555c5..3437602e955d 100644 --- a/modules/programs/mbsync.nix +++ b/modules/programs/mbsync.nix @@ -287,7 +287,7 @@ in { home.activation = mkIf (mbsyncAccounts != [ ]) { createMaildir = hm.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] '' - $DRY_RUN_CMD mkdir -m700 -p $VERBOSE_ARG ${ + run mkdir -m700 -p $VERBOSE_ARG ${ concatMapStringsSep " " (a: a.maildir.absPath) mbsyncAccounts } ''; diff --git a/modules/programs/mu.nix b/modules/programs/mu.nix index 04b0558e39a6..4d051d4daef0 100644 --- a/modules/programs/mu.nix +++ b/modules/programs/mu.nix @@ -54,7 +54,7 @@ in { # In theory, mu is the only thing that creates that directory, and it is # only created during the initial index. if [[ ! -d "${dbLocation}" ]]; then - $DRY_RUN_CMD ${ + run ${ getExe cfg.package } init ${maildirOption} ${myAddresses} $VERBOSE_ARG; fi diff --git a/modules/programs/taskwarrior.nix b/modules/programs/taskwarrior.nix index 5c4f0bf8aef4..8de855b39cd6 100644 --- a/modules/programs/taskwarrior.nix +++ b/modules/programs/taskwarrior.nix @@ -110,13 +110,13 @@ in { if [[ ! -s "${userConf}" ]]; then # Ensure file's existence if [[ -v DRY_RUN ]]; then - $DRY_RUN_CMD echo "include ${homeConf}" ">" "${userConf}" + run echo "include ${homeConf}" ">" "${userConf}" else echo "include ${homeConf}" > "${userConf}" fi elif ! grep -qF "include ${homeConf}" ${escapeShellArg userConf}; then # Add include statement for Home Manager generated config. - $DRY_RUN_CMD sed -i '1i include ${homeConf}' ${escapeShellArg userConf} + run sed -i '1i include ${homeConf}' ${escapeShellArg userConf} fi ''; }; diff --git a/modules/programs/vscode.nix b/modules/programs/vscode.nix index 5ea6be8b497d..1b5cfe10cd6c 100644 --- a/modules/programs/vscode.nix +++ b/modules/programs/vscode.nix @@ -257,9 +257,9 @@ in { "${extensionPath}/.extensions-immutable.json" = { text = extensionJson; onChange = '' - $DRY_RUN_CMD rm $VERBOSE_ARG -f ${extensionPath}/{extensions.json,.init-default-profile-extensions} + run rm $VERBOSE_ARG -f ${extensionPath}/{extensions.json,.init-default-profile-extensions} $VERBOSE_ECHO "Regenerating VSCode extensions.json" - $DRY_RUN_CMD ${getExe cfg.package} --list-extensions > /dev/null + run ${getExe cfg.package} --list-extensions > /dev/null ''; }; }) diff --git a/modules/services/dropbox.nix b/modules/services/dropbox.nix index 941f4d82e978..b4e7359c0963 100644 --- a/modules/services/dropbox.nix +++ b/modules/services/dropbox.nix @@ -55,17 +55,17 @@ in { ExecStop = "${dropboxCmd} stop"; ExecStart = toString (pkgs.writeShellScript "dropbox-start" '' # ensure we have the dirs we need - $DRY_RUN_CMD ${pkgs.coreutils}/bin/mkdir $VERBOSE_ARG -p \ + run ${pkgs.coreutils}/bin/mkdir $VERBOSE_ARG -p \ ${homeBaseDir}/{.dropbox,.dropbox-dist,Dropbox} # symlink them as needed if [[ ! -d ${config.home.homeDirectory}/.dropbox ]]; then - $DRY_RUN_CMD ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \ + run ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \ ${homeBaseDir}/.dropbox ${config.home.homeDirectory}/.dropbox fi if [[ ! -d ${escapeShellArg cfg.path} ]]; then - $DRY_RUN_CMD ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \ + run ${pkgs.coreutils}/bin/ln $VERBOSE_ARG -s \ ${homeBaseDir}/Dropbox ${escapeShellArg cfg.path} fi diff --git a/modules/systemd-activate.sh b/modules/systemd-activate.sh index 1c464693cfc3..0eb459960d37 100644 --- a/modules/systemd-activate.sh +++ b/modules/systemd-activate.sh @@ -110,5 +110,5 @@ function systemdPostReload() { oldGenPath="$1" newGenPath="$2" -$DRY_RUN_CMD systemctl --user daemon-reload +run systemctl --user daemon-reload systemdPostReload diff --git a/modules/targets/darwin/fonts.nix b/modules/targets/darwin/fonts.nix index 2c558227879a..78723c43da4c 100644 --- a/modules/targets/darwin/fonts.nix +++ b/modules/targets/darwin/fonts.nix @@ -19,7 +19,7 @@ in { local f find -L "${fonts}" -type f -printf '%P\0' | while IFS= read -rd "" f; do - $DRY_RUN_CMD install $VERBOSE_ARG -Dm644 -T \ + run install $VERBOSE_ARG -Dm644 -T \ "${fonts}/$f" "${homeDir}/Library/Fonts/HomeManager/$f" done } diff --git a/modules/targets/darwin/keybindings.nix b/modules/targets/darwin/keybindings.nix index c4348333fe44..22e4a76d2ee5 100644 --- a/modules/targets/darwin/keybindings.nix +++ b/modules/targets/darwin/keybindings.nix @@ -38,7 +38,7 @@ in { home.activation.setCocoaKeybindings = hm.dag.entryAfter [ "writeBoundary" ] '' $VERBOSE_ECHO "Configuring keybindings for the Cocoa Text System" - $DRY_RUN_CMD install -Dm644 $VERBOSE_ARG \ + run install -Dm644 $VERBOSE_ARG \ "${confFile}" "${homeDir}/Library/KeyBindings/DefaultKeyBinding.dict" ''; }; diff --git a/modules/targets/darwin/user-defaults/default.nix b/modules/targets/darwin/user-defaults/default.nix index 8d4e17a20882..2bf0b36f0657 100644 --- a/modules/targets/darwin/user-defaults/default.nix +++ b/modules/targets/darwin/user-defaults/default.nix @@ -13,9 +13,9 @@ let cliFlags = lib.optionalString isLocal "-currentHost"; toActivationCmd = domain: attrs: - "$DRY_RUN_CMD /usr/bin/defaults ${cliFlags} import ${ - escapeShellArg domain - } ${toDefaultsFile domain attrs}"; + "run /usr/bin/defaults ${cliFlags} import ${escapeShellArg domain} ${ + toDefaultsFile domain attrs + }"; nonNullDefaults = mapAttrs (domain: attrs: (filterAttrs (n: v: v != null) attrs)) diff --git a/tests/modules/programs/gpg/mutable-keyfiles.nix b/tests/modules/programs/gpg/mutable-keyfiles.nix index d2028e4b4d30..ea87a3e0a886 100644 --- a/tests/modules/programs/gpg/mutable-keyfiles.nix +++ b/tests/modules/programs/gpg/mutable-keyfiles.nix @@ -22,10 +22,10 @@ assertFileContains activate "unset GNUPGHOME QUIET_ARG keyId importTrust" assertFileRegex activate \ - '^\$DRY_RUN_CMD @gnupg@/bin/gpg \$QUIET_ARG --import /nix/store/[0-9a-z]*-key1$' + '^run @gnupg@/bin/gpg \$QUIET_ARG --import /nix/store/[0-9a-z]*-key1$' assertFileRegex activate \ - '^\$DRY_RUN_CMD importTrust "/nix/store/[0-9a-z]*-key1" 1$' + '^run importTrust "/nix/store/[0-9a-z]*-key1" 1$' assertFileRegex activate \ - '^\$DRY_RUN_CMD @gnupg@/bin/gpg \$QUIET_ARG --import /nix/store/[0-9a-z]*-key2$' + '^run @gnupg@/bin/gpg \$QUIET_ARG --import /nix/store/[0-9a-z]*-key2$' ''; } diff --git a/tests/modules/programs/mu/basic-configuration.nix b/tests/modules/programs/mu/basic-configuration.nix index 70b66fb9ae86..93e870da63c1 100644 --- a/tests/modules/programs/mu/basic-configuration.nix +++ b/tests/modules/programs/mu/basic-configuration.nix @@ -19,6 +19,6 @@ 'if [[ ! -d "/home/hm-user/.cache/mu" ]]; then' assertFileContains activate \ - '$DRY_RUN_CMD @mu@/bin/mu init --maildir=/home/hm-user/Mail --my-address=hm@example.com --my-address=foo@example.com $VERBOSE_ARG;' + 'run @mu@/bin/mu init --maildir=/home/hm-user/Mail --my-address=hm@example.com --my-address=foo@example.com $VERBOSE_ARG;' ''; } From 190c6f46090a62ad025828bd8e16799d8fcdab1e Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 22 Jan 2024 22:40:55 +0100 Subject: [PATCH 012/636] home-manager: avoid running empty `nix profile remove` We only want to run `nix profile remove` if there is actually anything to remove. --- modules/files.nix | 2 +- modules/lib-bash/activation-init.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/files.nix b/modules/files.nix index 9bbdb5b7175f..c0d563c2612a 100644 --- a/modules/files.nix +++ b/modules/files.nix @@ -268,7 +268,7 @@ in # `nix profile remove '.*' --profile "$genProfilePath"` was not working, so here is a workaround: nix profile list --profile "$genProfilePath" \ | cut -d ' ' -f 4 \ - | xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG --profile "$genProfilePath" + | xargs -rt $DRY_RUN_CMD nix profile remove $VERBOSE_ARG --profile "$genProfilePath" run nix profile install $VERBOSE_ARG --profile "$genProfilePath" "$newGenPath" else run nix-env $VERBOSE_ARG --profile "$genProfilePath" --set "$newGenPath" diff --git a/modules/lib-bash/activation-init.sh b/modules/lib-bash/activation-init.sh index aff833cb9609..773abcd34a2c 100755 --- a/modules/lib-bash/activation-init.sh +++ b/modules/lib-bash/activation-init.sh @@ -112,7 +112,7 @@ function nixProfileRemove() { # nix-darwin and won't require uninstalling `home-manager-path`. if [[ -e $HOME/.nix-profile/manifest.json \ || -e ${XDG_STATE_HOME:-$HOME/.local/state}/nix/profile/manifest.json ]] ; then - nixProfileList "$1" | xargs -t $DRY_RUN_CMD nix profile remove $VERBOSE_ARG + nixProfileList "$1" | xargs -rt $DRY_RUN_CMD nix profile remove $VERBOSE_ARG else if nix-env -q | grep -q "^$1$"; then run --silence nix-env -e "$1" From e84811035d7c8ec79ed6c687a97e19e2a22123c1 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Tue, 23 Jan 2024 22:59:26 +0100 Subject: [PATCH 013/636] treewide: deprecate `VERBOSE_ECHO` The shell function `verboseEcho` can be used in its stead. --- docs/release-notes/rl-2405.md | 23 +++++++++++++++ lib/bash/home-manager.sh | 12 ++++++++ modules/files.nix | 8 +++--- modules/home-environment.nix | 12 ++++---- modules/lib-bash/activation-init.sh | 28 ++++++++++--------- modules/misc/dconf.nix | 2 +- modules/programs/bat.nix | 2 +- modules/programs/taskwarrior.nix | 2 +- modules/programs/vscode.nix | 2 +- modules/targets/darwin/keybindings.nix | 2 +- .../targets/darwin/user-defaults/default.nix | 2 +- xgettext | 2 ++ 12 files changed, 68 insertions(+), 29 deletions(-) diff --git a/docs/release-notes/rl-2405.md b/docs/release-notes/rl-2405.md index 1c35fd02bbf5..b69b34fe32ad 100644 --- a/docs/release-notes/rl-2405.md +++ b/docs/release-notes/rl-2405.md @@ -60,6 +60,29 @@ This release has the following notable changes: their use may in the future trigger a warning message and eventually they may be removed entirely. +- Similarly, the use of `$VERBOSE_ECHO` in activation script blocks is + deprecated. Instead use the new shell function + {command}`verboseEcho`. That is, + + ```nix + home.activation.doThing = config.lib.dag.entryAnywhere '' + $VERBOSE_ECHO "Doing the thing" + '' + ``` + + should now be expressed + + ```nix + home.activation.doThing = config.lib.dag.entryAnywhere '' + verboseEcho "Doing the thing" + '' + ``` + + See the description of [home.activation](#opt-home.activation) for + more. The deprecated variable will continue to work for now but its + use may in the future trigger a warning message and eventually it + may be removed entirely. + ## State Version Changes {#sec-release-24.05-state-version-changes} The state version in this release includes the changes below. These diff --git a/lib/bash/home-manager.sh b/lib/bash/home-manager.sh index 18d477075077..050ffca8e766 100644 --- a/lib/bash/home-manager.sh +++ b/lib/bash/home-manager.sh @@ -48,6 +48,12 @@ function noteEcho() { echo "${noteColor}$*${normalColor}" } +function verboseEcho() { + if [[ -v VERBOSE ]]; then + echo "$*" + fi +} + function _i() { local msgid="$1" shift @@ -84,6 +90,12 @@ function _iNote() { echo -n "${normalColor}" } +function _iVerbose() { + if [[ -v VERBOSE ]]; then + _i "$@" + fi +} + # Runs the given command on live run, otherwise prints the command to standard # output. # diff --git a/modules/files.nix b/modules/files.nix index c0d563c2612a..327cf1bbd1d6 100644 --- a/modules/files.nix +++ b/modules/files.nix @@ -103,7 +103,7 @@ in done if [[ -n $forced ]]; then - $VERBOSE_ECHO "Skipping collision check for $targetPath" + verboseEcho "Skipping collision check for $targetPath" elif [[ -e "$targetPath" \ && ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then # The target file already exists and it isn't a symlink owned by Home Manager. @@ -184,7 +184,7 @@ in if [[ -e "$targetPath" && ! -L "$targetPath" ]] && cmp -s "$sourcePath" "$targetPath" ; then # The target exists but is identical – don't do anything. - $VERBOSE_ECHO "Skipping '$targetPath' as it is identical to '$sourcePath'" + verboseEcho "Skipping '$targetPath' as it is identical to '$sourcePath'" else # Place that symlink, --force # This can still fail if the target is a directory, in which case we bail out. @@ -206,11 +206,11 @@ in for relativePath in "$@" ; do targetPath="$HOME/$relativePath" if [[ -e "$newGenFiles/$relativePath" ]] ; then - $VERBOSE_ECHO "Checking $targetPath: exists" + verboseEcho "Checking $targetPath: exists" elif [[ ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then warnEcho "Path '$targetPath' does not link into a Home Manager generation. Skipping delete." else - $VERBOSE_ECHO "Checking $targetPath: gone (deleting)" + verboseEcho "Checking $targetPath: gone (deleting)" run rm $VERBOSE_ARG "$targetPath" # Recursively delete empty parent directories. diff --git a/modules/home-environment.nix b/modules/home-environment.nix index 0a9936516d0d..27a71e4578f9 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -410,12 +410,12 @@ in output to {file}`/dev/null`, otherwise prints the command to standard output. - A script block should also respect the - {var}`VERBOSE` variable, and if set print - information on standard out that may be useful for debugging - any issue that may arise. The variable - {var}`VERBOSE_ARG` is set to - {option}`--verbose` if verbose output is enabled. + A script block should also respect the {var}`VERBOSE` variable, and if + set print information on standard out that may be useful for debugging + any issue that may arise. The variable {var}`VERBOSE_ARG` is set to + {option}`--verbose` if verbose output is enabled. You can also use the + provided shell function {command}`verboseEcho`, which acts as + {command}`echo` when verbose output is enabled. ''; }; diff --git a/modules/lib-bash/activation-init.sh b/modules/lib-bash/activation-init.sh index 773abcd34a2c..9a38e7c5af7d 100755 --- a/modules/lib-bash/activation-init.sh +++ b/modules/lib-bash/activation-init.sh @@ -80,7 +80,7 @@ function setupVars() { oldGenPath="$(readlink -e "$genProfilePath")" fi - $VERBOSE_RUN _i "Sanity checking oldGenNum and oldGenPath" + _iVerbose "Sanity checking oldGenNum and oldGenPath" if [[ -v oldGenNum && ! -v oldGenPath || ! -v oldGenNum && -v oldGenPath ]]; then _i $'The previous generation number and path are in conflict! These\nmust be either both empty or both set but are now set to\n\n \'%s\' and \'%s\'\n\nIf you don\'t mind losing previous profile generations then\nthe easiest solution is probably to run\n\n rm %s/home-manager*\n rm %s/current-home\n\nand trying home-manager switch again. Good luck!' \ @@ -138,6 +138,8 @@ function checkHomeDirectory() { fi } +# Note, the VERBOSE_ECHO variable is deprecated and should not be used inside +# the Home Manager project. It is provided here for backwards compatibility. if [[ -v VERBOSE ]]; then export VERBOSE_ECHO=echo export VERBOSE_ARG="--verbose" @@ -152,7 +154,7 @@ _i "Starting Home Manager activation" # Verify that we can connect to the Nix store and/or daemon. This will # also create the necessary directories in profiles and gcroots. -$VERBOSE_RUN _i "Sanity checking Nix" +_iVerbose "Sanity checking Nix" nix-build --expr '{}' --no-out-link # Also make sure that the Nix profiles path is created. @@ -169,7 +171,7 @@ if [[ -v DRY_RUN ]] ; then export DRY_RUN_CMD=echo export DRY_RUN_NULL=/dev/stdout else - $VERBOSE_RUN _i "This is a live run" + _iVerbose "This is a live run" export DRY_RUN_CMD="" export DRY_RUN_NULL=/dev/null fi @@ -178,16 +180,16 @@ if [[ -v VERBOSE ]]; then _i 'Using Nix version: %s' "$(nix-env --version)" fi -$VERBOSE_RUN _i "Activation variables:" +_iVerbose "Activation variables:" if [[ -v oldGenNum ]] ; then - $VERBOSE_ECHO " oldGenNum=$oldGenNum" - $VERBOSE_ECHO " oldGenPath=$oldGenPath" + verboseEcho " oldGenNum=$oldGenNum" + verboseEcho " oldGenPath=$oldGenPath" else - $VERBOSE_ECHO " oldGenNum undefined (first run?)" - $VERBOSE_ECHO " oldGenPath undefined (first run?)" + verboseEcho " oldGenNum undefined (first run?)" + verboseEcho " oldGenPath undefined (first run?)" fi -$VERBOSE_ECHO " newGenPath=$newGenPath" -$VERBOSE_ECHO " newGenNum=$newGenNum" -$VERBOSE_ECHO " genProfilePath=$genProfilePath" -$VERBOSE_ECHO " newGenGcPath=$newGenGcPath" -$VERBOSE_ECHO " legacyGenGcPath=$legacyGenGcPath" +verboseEcho " newGenPath=$newGenPath" +verboseEcho " newGenNum=$newGenNum" +verboseEcho " genProfilePath=$genProfilePath" +verboseEcho " newGenGcPath=$newGenGcPath" +verboseEcho " legacyGenGcPath=$legacyGenGcPath" diff --git a/modules/misc/dconf.nix b/modules/misc/dconf.nix index 291dabf2db0f..b4863a139091 100644 --- a/modules/misc/dconf.nix +++ b/modules/misc/dconf.nix @@ -111,7 +111,7 @@ in { --slurpfile new "$newState" \ '($old[] - $new[])[]' \ | while read -r key; do - $VERBOSE_ECHO "Resetting dconf key \"$key\"" + verboseEcho "Resetting dconf key \"$key\"" run $DCONF_DBUS_RUN_SESSION dconf reset "$key" done ''; diff --git a/modules/programs/bat.nix b/modules/programs/bat.nix index eb592becd657..99813e95627e 100644 --- a/modules/programs/bat.nix +++ b/modules/programs/bat.nix @@ -162,7 +162,7 @@ in { home.activation.batCache = hm.dag.entryAfter [ "linkGeneration" ] '' ( export XDG_CACHE_HOME=${escapeShellArg config.xdg.cacheHome} - $VERBOSE_ECHO "Rebuilding bat theme cache" + verboseEcho "Rebuilding bat theme cache" run ${lib.getExe package} cache --build ) ''; diff --git a/modules/programs/taskwarrior.nix b/modules/programs/taskwarrior.nix index 8de855b39cd6..e90b1eb23777 100644 --- a/modules/programs/taskwarrior.nix +++ b/modules/programs/taskwarrior.nix @@ -105,7 +105,7 @@ in { ''; home.activation.regenDotTaskRc = hm.dag.entryAfter [ "writeBoundary" ] '' - $VERBOSE_ECHO "Ensuring generated taskwarrior config included in taskrc" + verboseEcho "Ensuring generated taskwarrior config included in taskrc" if [[ ! -s "${userConf}" ]]; then # Ensure file's existence diff --git a/modules/programs/vscode.nix b/modules/programs/vscode.nix index 1b5cfe10cd6c..7680d70c44ff 100644 --- a/modules/programs/vscode.nix +++ b/modules/programs/vscode.nix @@ -258,7 +258,7 @@ in { text = extensionJson; onChange = '' run rm $VERBOSE_ARG -f ${extensionPath}/{extensions.json,.init-default-profile-extensions} - $VERBOSE_ECHO "Regenerating VSCode extensions.json" + verboseEcho "Regenerating VSCode extensions.json" run ${getExe cfg.package} --list-extensions > /dev/null ''; }; diff --git a/modules/targets/darwin/keybindings.nix b/modules/targets/darwin/keybindings.nix index 22e4a76d2ee5..96800073c1bb 100644 --- a/modules/targets/darwin/keybindings.nix +++ b/modules/targets/darwin/keybindings.nix @@ -37,7 +37,7 @@ in { # NOTE: just copy the files because symlinks won't be recognized by macOS home.activation.setCocoaKeybindings = hm.dag.entryAfter [ "writeBoundary" ] '' - $VERBOSE_ECHO "Configuring keybindings for the Cocoa Text System" + verboseEcho "Configuring keybindings for the Cocoa Text System" run install -Dm644 $VERBOSE_ARG \ "${confFile}" "${homeDir}/Library/KeyBindings/DefaultKeyBinding.dict" ''; diff --git a/modules/targets/darwin/user-defaults/default.nix b/modules/targets/darwin/user-defaults/default.nix index 2bf0b36f0657..97342d36bbfb 100644 --- a/modules/targets/darwin/user-defaults/default.nix +++ b/modules/targets/darwin/user-defaults/default.nix @@ -100,7 +100,7 @@ in { ''; home.activation.setDarwinDefaults = hm.dag.entryAfter [ "writeBoundary" ] '' - $VERBOSE_ECHO "Configuring macOS user defaults" + verboseEcho "Configuring macOS user defaults" ${concatStringsSep "\n" activationCmds} ''; }; diff --git a/xgettext b/xgettext index 8580a324f967..6a5f8b00be77 100755 --- a/xgettext +++ b/xgettext @@ -18,10 +18,12 @@ function run() { -k_iError:1 --flag=_i:1:c-format \ -k_iWarn:1 --flag=_i:1:c-format \ -k_iNote:1 --flag=_i:1:c-format \ + -k_iVerbose:1 --flag=_i:1:c-format \ -k_ip:1,2 --flag=_ip:1:c-format --flag=_ip:2:c-format \ -k_ipError:1,2 --flag=_ip:1:c-format --flag=_ip:2:c-format \ -k_ipWarn:1,2 --flag=_ip:1:c-format --flag=_ip:2:c-format \ -k_ipNote:1,2 --flag=_ip:1:c-format --flag=_ip:2:c-format \ + -k_ipVerbose:1,2 --flag=_ip:1:c-format --flag=_ip:2:c-format \ --add-comments=translators: \ -o "$output" -d "$domain" "$@" } From 6359d40f6ec0b72a38e02b333f343c3d4929ec10 Mon Sep 17 00:00:00 2001 From: Ujp8LfXBJ6wCPR Date: Wed, 24 Jan 2024 23:22:57 +0100 Subject: [PATCH 014/636] firefox: implement native messaging hosts Fixes #1586 Fixes #1487 Co-authored-by: Carl Hjerpe Co-authored-by: Robert Helgesson --- modules/programs/firefox.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index 2ce67776d30d..b19b0960496e 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -21,6 +21,11 @@ let profilesPath = if isDarwin then "${firefoxConfigPath}/Profiles" else firefoxConfigPath; + nativeMessagingHostsJoined = pkgs.symlinkJoin { + name = "home_ff_nmhs"; + paths = cfg.package.nativeMessagingHosts or cfg.nativeMessagingHosts; + }; + # The extensions path shared by all profiles; will not be supported # by future Firefox versions. extensionPath = "extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"; @@ -228,6 +233,15 @@ in { ''; }; + nativeMessagingHosts = mkOption { + type = types.listOf types.package; + default = [ ]; + description = '' + Additional packages containing native messaging hosts that should be + made available to Firefox extensions. + ''; + }; + finalPackage = mkOption { type = with types; nullOr package; readOnly = true; @@ -673,7 +687,11 @@ in { will be removed in the future. Please change to overriding the package configuration using 'programs.firefox.package' instead. You can refer to its example for how to do this. - ''; + '' ++ optional (cfg.package.nativeMessagingHosts or null != null + && cfg.nativeMessagingHosts != [ ]) '' + Using both 'programs.firefox.package.nativeMessagingHosts' and + 'programs.firefox.nativeMessagingHosts' is not supported, the latter will be ignored. + ''; programs.firefox.finalPackage = wrapPackage cfg.package; @@ -682,6 +700,8 @@ in { home.file = mkMerge ([{ "${firefoxConfigPath}/profiles.ini" = mkIf (cfg.profiles != { }) { text = profilesIni; }; + "${mozillaConfigPath}/native-messaging-hosts".source = + "${nativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts"; }] ++ flip mapAttrsToList cfg.profiles (_: profile: { "${profilesPath}/${profile.path}/.keep".text = ""; From 70688f195a294a09d31d6bfe339bb090d443e949 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Thu, 25 Jan 2024 14:56:56 -0700 Subject: [PATCH 015/636] keepassx: remove module This removes the services.keepassx module and all options related to it. This is because KeePassX has been unmaintaned for a long time, and the migration path to KeePassXC is not clear. Note, this package probably hasn't worked for nearly a year since the package was removed from Nixpkgs: https://github.com/NixOS/nixpkgs/pull/216748 Closes #4949 Signed-off-by: Sumner Evans --- modules/modules.nix | 4 +++- modules/services/keepassx.nix | 31 ------------------------------- 2 files changed, 3 insertions(+), 32 deletions(-) delete mode 100644 modules/services/keepassx.nix diff --git a/modules/modules.nix b/modules/modules.nix index d557dc1b3ce2..25f1a0938b5d 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -291,7 +291,6 @@ let ./services/kanshi.nix ./services/kbfs.nix ./services/kdeconnect.nix - ./services/keepassx.nix ./services/keybase.nix ./services/keynav.nix ./services/lieer.nix @@ -383,6 +382,9 @@ let (mkRemovedOptionModule [ "services" "password-store-sync" ] '' Use services.git-sync instead. '') + (mkRemovedOptionModule [ "services" "keepassx" ] '' + KeePassX is no longer maintained. + '') ] ++ optional useNixpkgsModule ./misc/nixpkgs.nix ++ optional (!useNixpkgsModule) ./misc/nixpkgs-disabled.nix; diff --git a/modules/services/keepassx.nix b/modules/services/keepassx.nix deleted file mode 100644 index 7f85823619d8..000000000000 --- a/modules/services/keepassx.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -{ - meta.maintainers = [ maintainers.rycee ]; - - options = { - services.keepassx = { - enable = mkEnableOption "the KeePassX password manager"; - }; - }; - - config = mkIf config.services.keepassx.enable { - assertions = [ - (hm.assertions.assertPlatform "services.keepassx" pkgs platforms.linux) - ]; - - systemd.user.services.keepassx = { - Unit = { - Description = "KeePassX password manager"; - After = [ "graphical-session-pre.target" ]; - PartOf = [ "graphical-session.target" ]; - }; - - Install = { WantedBy = [ "graphical-session.target" ]; }; - - Service = { ExecStart = "${pkgs.keepassx}/bin/keepassx -min -lock"; }; - }; - }; -} From 03958aff4415a5278d0ea462db370e9d770e904e Mon Sep 17 00:00:00 2001 From: Ryan Horiguchi Date: Thu, 25 Jan 2024 23:08:09 +0100 Subject: [PATCH 016/636] firefox: add default containers --- modules/programs/firefox.nix | 33 ++++++++++++++++++- .../firefox/container-id-out-of-range.nix | 27 +++++++++++++++ tests/modules/programs/firefox/default.nix | 1 + 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 tests/modules/programs/firefox/container-id-out-of-range.nix diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index b19b0960496e..5984187c895d 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -78,7 +78,24 @@ let version = 4; lastUserContextId = elemAt (mapAttrsToList (_: container: container.id) containers) 0; - identities = mapAttrsToList containerToIdentity containers; + identities = mapAttrsToList containerToIdentity containers ++ [ + { + userContextId = 4294967294; # 2^32 - 2 + name = "userContextIdInternal.thumbnail"; + icon = ""; + color = ""; + accessKey = ""; + public = false; + } + { + userContextId = 4294967295; # 2^32 - 1 + name = "userContextIdInternal.webextStorageLocal"; + icon = ""; + color = ""; + accessKey = ""; + public = false; + } + ]; }} ''; @@ -677,6 +694,20 @@ in { (", namely " + concatStringsSep ", " defaults); }) + (let + getContainers = profiles: + flatten + (mapAttrsToList (_: value: (attrValues value.containers)) profiles); + + findInvalidContainerIds = profiles: + filter (container: container.id >= 4294967294) + (getContainers profiles); + in { + assertion = cfg.profiles == { } + || length (findInvalidContainerIds cfg.profiles) == 0; + message = "Container id must be smaller than 4294967294 (2^32 - 2)"; + }) + (mkNoDuplicateAssertion cfg.profiles "profile") ] ++ (mapAttrsToList (_: profile: mkNoDuplicateAssertion profile.containers "container") diff --git a/tests/modules/programs/firefox/container-id-out-of-range.nix b/tests/modules/programs/firefox/container-id-out-of-range.nix new file mode 100644 index 000000000000..5dbeaedda8b8 --- /dev/null +++ b/tests/modules/programs/firefox/container-id-out-of-range.nix @@ -0,0 +1,27 @@ +{ config, lib, ... }: + +{ + imports = [ ./setup-firefox-mock-overlay.nix ]; + + config = lib.mkIf config.test.enableBig { + test.asserts.assertions.expected = + [ "Container id must be smaller than 4294967294 (2^32 - 2)" ]; + + programs.firefox = { + enable = true; + + profiles.my-profile = { + isDefault = true; + id = 1; + + containers = { + "shopping" = { + id = 4294967294; + color = "blue"; + icon = "circle"; + }; + }; + }; + }; + }; +} diff --git a/tests/modules/programs/firefox/default.nix b/tests/modules/programs/firefox/default.nix index b0c4fadb6a0b..1cd462f2e7e2 100644 --- a/tests/modules/programs/firefox/default.nix +++ b/tests/modules/programs/firefox/default.nix @@ -4,5 +4,6 @@ firefox-deprecated-native-messenger = ./deprecated-native-messenger.nix; firefox-duplicate-profile-ids = ./duplicate-profile-ids.nix; firefox-duplicate-container-ids = ./duplicate-container-ids.nix; + firefox-container-id-out-of-range = ./container-id-out-of-range.nix; firefox-policies = ./policies.nix; } From c82e52b0d96eb9f1c8334add871dce8e837d043b Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Thu, 25 Jan 2024 23:12:09 +0100 Subject: [PATCH 017/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/bbe7d8f876fbbe7c959c90ba2ae2852220573261' (2024-01-19) → 'github:NixOS/nixpkgs/612f97239e2cc474c13c9dafa0df378058c5ad8d' (2024-01-21) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index c4ba38570c5c..0716ea3b195a 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1705677747, - "narHash": "sha256-eyM3okYtMgYDgmYukoUzrmuoY4xl4FUujnsv/P6I/zI=", + "lastModified": 1705856552, + "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bbe7d8f876fbbe7c959c90ba2ae2852220573261", + "rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", "type": "github" }, "original": { From c7ce343d9bf1a329056a4dd5b32ea8cc43b55e15 Mon Sep 17 00:00:00 2001 From: GrizzlT <13691001+GrizzlT@users.noreply.github.com> Date: Wed, 24 Jan 2024 11:30:39 +0100 Subject: [PATCH 018/636] home-manager: add extendModules attribute The `home-manager.lib.homeManagerConfiguration` function now has an additional attribute that can be used to extend a Home Manager configuration with additional modules outside the project tree. It works similar to the result of `lib.nixosSystem` from Nixpkgs --- modules/default.nix | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/modules/default.nix b/modules/default.nix index ba43fec5c2cd..ad0e67646688 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -28,28 +28,34 @@ let specialArgs = { modulesPath = builtins.toString ./.; } // extraSpecialArgs; }; - module = showWarnings (let - failed = collectFailed rawModule.config; - failedStr = concatStringsSep "\n" (map (x: "- ${x}") failed); - in if failed == [ ] then - rawModule - else - throw '' + moduleChecks = raw: + showWarnings (let + failed = collectFailed raw.config; + failedStr = concatStringsSep "\n" (map (x: "- ${x}") failed); + in if failed == [ ] then + raw + else + throw '' - Failed assertions: - ${failedStr}''); + Failed assertions: + ${failedStr}''); -in { - inherit (module) options config; + withExtraAttrs = rawModule: + let module = moduleChecks rawModule; + in { + inherit (module) options config; - activationPackage = module.config.home.activationPackage; + activationPackage = module.config.home.activationPackage; - # For backwards compatibility. Please use activationPackage instead. - activation-script = module.config.home.activationPackage; + # For backwards compatibility. Please use activationPackage instead. + activation-script = module.config.home.activationPackage; - newsDisplay = rawModule.config.news.display; - newsEntries = sort (a: b: a.time > b.time) - (filter (a: a.condition) rawModule.config.news.entries); + newsDisplay = rawModule.config.news.display; + newsEntries = sort (a: b: a.time > b.time) + (filter (a: a.condition) rawModule.config.news.entries); - inherit (module._module.args) pkgs; -} + inherit (module._module.args) pkgs; + + extendModules = args: withExtraAttrs (rawModule.extendModules args); + }; +in withExtraAttrs rawModule From 690764d2dcfccf01ddfc9f19220c88182339f40f Mon Sep 17 00:00:00 2001 From: Carl Hjerpe Date: Fri, 26 Jan 2024 16:16:15 +0100 Subject: [PATCH 019/636] firefox: Reimplement FF native messaging Farm links from the selected firefox package, programs.firefox.nativeMessagingHosts and a package with a .keep file for always creating the ~/.mozilla/native-messaging-hosts folder as a regular folder with links in it. Fixes #4959 --- modules/programs/firefox.nix | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index 5984187c895d..fcf12b02fbd0 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -22,8 +22,15 @@ let if isDarwin then "${firefoxConfigPath}/Profiles" else firefoxConfigPath; nativeMessagingHostsJoined = pkgs.symlinkJoin { - name = "home_ff_nmhs"; - paths = cfg.package.nativeMessagingHosts or cfg.nativeMessagingHosts; + name = "ff_native-messaging-hosts"; + paths = [ + # Link a .keep file to keep the directory around + (pkgs.writeTextDir "lib/mozilla/native-messaging-hosts/.keep" "") + # Link package configured native messaging hosts (entire Firefox actually) + cfg.finalPackage + ] + # Link user configured native messaging hosts + ++ cfg.nativeMessagingHosts; }; # The extensions path shared by all profiles; will not be supported @@ -718,11 +725,7 @@ in { will be removed in the future. Please change to overriding the package configuration using 'programs.firefox.package' instead. You can refer to its example for how to do this. - '' ++ optional (cfg.package.nativeMessagingHosts or null != null - && cfg.nativeMessagingHosts != [ ]) '' - Using both 'programs.firefox.package.nativeMessagingHosts' and - 'programs.firefox.nativeMessagingHosts' is not supported, the latter will be ignored. - ''; + ''; programs.firefox.finalPackage = wrapPackage cfg.package; @@ -731,8 +734,11 @@ in { home.file = mkMerge ([{ "${firefoxConfigPath}/profiles.ini" = mkIf (cfg.profiles != { }) { text = profilesIni; }; - "${mozillaConfigPath}/native-messaging-hosts".source = - "${nativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts"; + "${mozillaConfigPath}/native-messaging-hosts" = { + source = + "${nativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts"; + recursive = true; + }; }] ++ flip mapAttrsToList cfg.profiles (_: profile: { "${profilesPath}/${profile.path}/.keep".text = ""; From b2f56952074cb46e93902ecaabfb04dd93733434 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 26 Jan 2024 23:04:20 +0100 Subject: [PATCH 020/636] network-manager-applet: add XDG data directory The Network Manager Applet package provides, for example, some icons that are good to have accessible in an XDG data directory. --- modules/services/network-manager-applet.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/services/network-manager-applet.nix b/modules/services/network-manager-applet.nix index b90855dd5c58..524921b71d9a 100644 --- a/modules/services/network-manager-applet.nix +++ b/modules/services/network-manager-applet.nix @@ -21,6 +21,9 @@ in { lib.platforms.linux) ]; + # The package provides some icons that are good to have available. + xdg.systemDirs.data = [ "${pkgs.networkmanagerapplet}/share" ]; + systemd.user.services.network-manager-applet = { Unit = { Description = "Network Manager applet"; From e5f2a0590a9387e17e6433b280e45d14f82683b4 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 28 Jan 2024 10:44:53 +0100 Subject: [PATCH 021/636] flake.lock: Update (#4964) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/612f97239e2cc474c13c9dafa0df378058c5ad8d' (2024-01-21) → 'github:NixOS/nixpkgs/ae5c332cbb5827f6b1f02572496b141021de335f' (2024-01-25) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 0716ea3b195a..0484420f90c0 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1705856552, - "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", + "lastModified": 1706191920, + "narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", + "rev": "ae5c332cbb5827f6b1f02572496b141021de335f", "type": "github" }, "original": { From 7a461c70ed20e7e4a2af1710fdfb89ec70473e47 Mon Sep 17 00:00:00 2001 From: mlyxshi Date: Sun, 28 Jan 2024 18:45:17 +0900 Subject: [PATCH 022/636] firefox: fix darwin NativeMessagingHostsPath --- modules/programs/firefox.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index fcf12b02fbd0..8ce84fcba721 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -21,6 +21,11 @@ let profilesPath = if isDarwin then "${firefoxConfigPath}/Profiles" else firefoxConfigPath; + nativeMessagingHostsPath = if isDarwin then + "${mozillaConfigPath}/NativeMessagingHosts" + else + "${mozillaConfigPath}/native-messaging-hosts"; + nativeMessagingHostsJoined = pkgs.symlinkJoin { name = "ff_native-messaging-hosts"; paths = [ @@ -734,7 +739,8 @@ in { home.file = mkMerge ([{ "${firefoxConfigPath}/profiles.ini" = mkIf (cfg.profiles != { }) { text = profilesIni; }; - "${mozillaConfigPath}/native-messaging-hosts" = { + + "${nativeMessagingHostsPath}" = { source = "${nativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts"; recursive = true; From ebba24a6fefa3d749291be7192ef817736a10bd1 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Sun, 28 Jan 2024 10:46:09 +0100 Subject: [PATCH 023/636] wob: add module Signed-off-by: Sefa Eyeoglu --- modules/misc/news.nix | 9 +++ modules/modules.nix | 1 + modules/services/wob.nix | 79 +++++++++++++++++++ tests/default.nix | 1 + tests/modules/services/wob/default.nix | 1 + .../services/wob/wob-service-expected.ini | 2 + .../services/wob/wob-service-expected.service | 13 +++ .../services/wob/wob-service-expected.socket | 8 ++ tests/modules/services/wob/wob-service.nix | 29 +++++++ 9 files changed, 143 insertions(+) create mode 100644 modules/services/wob.nix create mode 100644 tests/modules/services/wob/default.nix create mode 100644 tests/modules/services/wob/wob-service-expected.ini create mode 100644 tests/modules/services/wob/wob-service-expected.service create mode 100644 tests/modules/services/wob/wob-service-expected.socket create mode 100644 tests/modules/services/wob/wob-service.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index e24ed47287e7..a5f6975ab7f7 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1392,6 +1392,15 @@ in { This module replaces 'programs.rtx', which has been removed. ''; } + + { + time = "2024-01-27T22:53:00+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.wob'. + ''; + } + ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 25f1a0938b5d..6504bc42e679 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -364,6 +364,7 @@ let ./services/window-managers/spectrwm.nix ./services/window-managers/xmonad.nix ./services/wlsunset.nix + ./services/wob.nix ./services/xcape.nix ./services/xembed-sni-proxy.nix ./services/xidlehook.nix diff --git a/modules/services/wob.nix b/modules/services/wob.nix new file mode 100644 index 000000000000..8ca1befa84da --- /dev/null +++ b/modules/services/wob.nix @@ -0,0 +1,79 @@ +{ config, lib, pkgs, ... }: + +let + inherit (lib) + getExe literalExpression mkEnableOption mkIf mkOption mkPackageOption + optional; + + cfg = config.services.wob; + settingsFormat = pkgs.formats.ini { }; + + configFile = settingsFormat.generate "wob.ini" cfg.settings; +in { + meta.maintainers = with lib.maintainers; [ Scrumplex ]; + + options.services.wob = { + enable = mkEnableOption "wob"; + package = mkPackageOption pkgs "wob" { }; + + settings = mkOption { + type = settingsFormat.type; + default = { }; + example = literalExpression '' + { + "" = { + border_size = 10; + height = 50; + }; + "output.foo".name = "DP-1"; + "style.muted".background_color = "032cfc"; + } + ''; + description = '' + Configuration written to {file}`$XDG_CONFIG_HOME/wob/wob.ini`. + See {manpage}`wob.ini(5)` for documentation. + ''; + }; + + systemd = mkEnableOption "systemd service and socket for wob" + // mkOption { default = true; }; + }; + + config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.wob" pkgs lib.platforms.linux) + ]; + + systemd.user = mkIf cfg.systemd { + services.wob = { + Unit = { + Description = + "A lightweight overlay volume/backlight/progress/anything bar for Wayland"; + Documentation = "man:wob(1)"; + PartOf = "graphical-session.target"; + After = "graphical-session.target"; + ConditionEnvironment = "WAYLAND_DISPLAY"; + }; + Service = { + StandardInput = "socket"; + ExecStart = builtins.concatStringsSep " " ([ (getExe cfg.package) ] + ++ optional (cfg.settings != { }) "--config ${configFile}"); + }; + Install.WantedBy = [ "graphical-session.target" ]; + }; + + sockets.wob = { + Socket = { + ListenFIFO = "%t/wob.sock"; + SocketMode = "0600"; + RemoveOnStop = "yes"; + FlushPending = "yes"; + }; + Install.WantedBy = [ "sockets.target" ]; + }; + }; + + xdg.configFile."wob/wob.ini" = + mkIf (cfg.settings != { }) { source = configFile; }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index b3e963bbd37e..ff1373de65bf 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -261,6 +261,7 @@ in import nmtSrc { ./modules/services/window-managers/spectrwm ./modules/services/window-managers/sway ./modules/services/wlsunset + ./modules/services/wob ./modules/services/xsettingsd ./modules/systemd ./modules/targets-linux diff --git a/tests/modules/services/wob/default.nix b/tests/modules/services/wob/default.nix new file mode 100644 index 000000000000..22ed60358ce5 --- /dev/null +++ b/tests/modules/services/wob/default.nix @@ -0,0 +1 @@ +{ wob-service = ./wob-service.nix; } diff --git a/tests/modules/services/wob/wob-service-expected.ini b/tests/modules/services/wob/wob-service-expected.ini new file mode 100644 index 000000000000..25b9eba32760 --- /dev/null +++ b/tests/modules/services/wob/wob-service-expected.ini @@ -0,0 +1,2 @@ +[] +background_color=ddddddff diff --git a/tests/modules/services/wob/wob-service-expected.service b/tests/modules/services/wob/wob-service-expected.service new file mode 100644 index 000000000000..a91d5aeaebeb --- /dev/null +++ b/tests/modules/services/wob/wob-service-expected.service @@ -0,0 +1,13 @@ +[Install] +WantedBy=graphical-session.target + +[Service] +ExecStart=@wob@/bin/wob --config /nix/store/00000000000000000000000000000000-wob.ini +StandardInput=socket + +[Unit] +After=graphical-session.target +ConditionEnvironment=WAYLAND_DISPLAY +Description=A lightweight overlay volume/backlight/progress/anything bar for Wayland +Documentation=man:wob(1) +PartOf=graphical-session.target diff --git a/tests/modules/services/wob/wob-service-expected.socket b/tests/modules/services/wob/wob-service-expected.socket new file mode 100644 index 000000000000..4f004930993f --- /dev/null +++ b/tests/modules/services/wob/wob-service-expected.socket @@ -0,0 +1,8 @@ +[Install] +WantedBy=sockets.target + +[Socket] +FlushPending=yes +ListenFIFO=%t/wob.sock +RemoveOnStop=yes +SocketMode=0600 diff --git a/tests/modules/services/wob/wob-service.nix b/tests/modules/services/wob/wob-service.nix new file mode 100644 index 000000000000..ecef9eee7fff --- /dev/null +++ b/tests/modules/services/wob/wob-service.nix @@ -0,0 +1,29 @@ +{ config, ... }: + +{ + services.wob = { + enable = true; + package = config.lib.test.mkStubPackage { + name = "wob"; + outPath = "@wob@"; + }; + systemd = true; + + settings."".background_color = "ddddddff"; + }; + + nmt.script = '' + serviceFile=home-files/.config/systemd/user/wob.service + socketFile=home-files/.config/systemd/user/wob.socket + configFile=home-files/.config/wob/wob.ini + + assertFileExists $serviceFile + assertFileExists $socketFile + assertFileExists $configFile + assertFileContent $(normalizeStorePaths $serviceFile) ${ + ./wob-service-expected.service + } + assertFileContent $socketFile ${./wob-service-expected.socket} + assertFileContent $configFile ${./wob-service-expected.ini} + ''; +} From 4d54c29bce71f8c261513e0662cc573d30f3e33e Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 28 Jan 2024 10:47:33 +0100 Subject: [PATCH 024/636] home-manager: remove the export of `run` Fixes #4950 --- lib/bash/home-manager.sh | 4 ---- modules/systemd-activate.sh | 7 ++++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/bash/home-manager.sh b/lib/bash/home-manager.sh index 050ffca8e766..19cbaa687949 100644 --- a/lib/bash/home-manager.sh +++ b/lib/bash/home-manager.sh @@ -101,9 +101,6 @@ function _iVerbose() { # # If given the command line option `--silence`, then the command's standard and # error output is sent to `/dev/null` on a live run. -# -# Note, the run function is exported. I.e., it is available also to called Bash -# script. function run() { if [[ $1 == '--silence' ]]; then local silence=1 @@ -118,4 +115,3 @@ function run() { "$@" fi } -export -f run diff --git a/modules/systemd-activate.sh b/modules/systemd-activate.sh index 0eb459960d37..235f1a241cf0 100644 --- a/modules/systemd-activate.sh +++ b/modules/systemd-activate.sh @@ -110,5 +110,10 @@ function systemdPostReload() { oldGenPath="$1" newGenPath="$2" -run systemctl --user daemon-reload +if [[ -v DRY_RUN ]]; then + echo systemctl --user daemon-reload +else + systemctl --user daemon-reload +fi + systemdPostReload From d634c3abafa454551f2083b054cd95c3f287be61 Mon Sep 17 00:00:00 2001 From: Carl Hjerpe Date: Sun, 28 Jan 2024 21:18:29 +0100 Subject: [PATCH 025/636] tealdeer: add option to toggle update on activation This is a network operation that can take awhile if you're on a shitty connection. --- modules/programs/tealdeer.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/programs/tealdeer.nix b/modules/programs/tealdeer.nix index 08ba9d3f33ce..3f03c715f00d 100644 --- a/modules/programs/tealdeer.nix +++ b/modules/programs/tealdeer.nix @@ -17,6 +17,14 @@ in { options.programs.tealdeer = { enable = mkEnableOption "Tealdeer"; + updateOnActivation = mkOption { + type = with types; bool; + default = true; + description = '' + Whether to update tealdeer's cache on activation. + ''; + }; + settings = mkOption { type = tomlFormat.type; default = { }; @@ -50,9 +58,11 @@ in { source = tomlFormat.generate "tealdeer-config" cfg.settings; }; - home.activation.tealdeerCache = hm.dag.entryAfter [ "linkGeneration" ] '' - $VERBOSE_ECHO "Rebuilding tealdeer cache" - $DRY_RUN_CMD ${getExe pkgs.tealdeer} --update - ''; + home.activation = mkIf cfg.updateOnActivation { + tealdeerCache = hm.dag.entryAfter [ "linkGeneration" ] '' + $VERBOSE_ECHO "Rebuilding tealdeer cache" + $DRY_RUN_CMD ${getExe pkgs.tealdeer} --update + ''; + }; }; } From 2db6a2a42930ffff0ffd690dec3f2c0b6f4fe66d Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 1 Feb 2024 00:41:56 +0100 Subject: [PATCH 026/636] docs: add style sheets and `scrubDerivations` This adds style sheets and `scrubDerivations` from nmd, thereby removing the need to download them separately. --- docs/default.nix | 44 ++-- docs/flake.lock | 45 +++++ docs/flake.nix | 54 +++++ docs/highlight-style.css | 8 - docs/home-manager-manual.nix | 23 +-- docs/static/style.css | 7 + docs/static/style.scss | 310 +++++++++++++++++++++++++++++ docs/static/tomorrow-night.min.css | 7 + docs/static/tomorrow.min.css | 7 + modules/manual.nix | 7 - 10 files changed, 464 insertions(+), 48 deletions(-) create mode 100644 docs/flake.lock create mode 100644 docs/flake.nix delete mode 100644 docs/highlight-style.css create mode 100644 docs/static/style.css create mode 100644 docs/static/style.scss create mode 100644 docs/static/tomorrow-night.min.css create mode 100644 docs/static/tomorrow.min.css diff --git a/docs/default.nix b/docs/default.nix index b6dae7092c08..422e5ef80bce 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -7,28 +7,37 @@ let - nmdSrc = fetchTarball { - url = "https://git.sr.ht/~rycee/nmd/archive/v0.5.0.tar.gz"; - sha256 = "0hnd86jd19zb5j3hmpwmdmdiasg65lgahqv7n8frl9p1vdqz6z67"; - }; - - nmd = import nmdSrc { - inherit lib; - # The DocBook output of `nixos-render-docs` doesn't have the change - # `nmd` uses to work around the broken stylesheets in - # `docbook-xsl-ns`, so we restore the patched version here. - pkgs = pkgs // { - docbook-xsl-ns = - pkgs.docbook-xsl-ns.override { withManOptDedupPatch = true; }; - }; - }; + # Recursively replace each derivation in the given attribute set + # with the same derivation but with the `outPath` attribute set to + # the string `"\${pkgs.attribute.path}"`. This allows the + # documentation to refer to derivations through their values without + # establishing an actual dependency on the derivation output. + # + # This is not perfect, but it seems to cover a vast majority of use + # cases. + # + # Caveat: even if the package is reached by a different means, the + # path above will be shown and not e.g. + # `${config.services.foo.package}`. + scrubDerivations = prefixPath: attrs: + let + scrubDerivation = name: value: + let pkgAttrName = prefixPath + "." + name; + in if lib.isAttrs value then + scrubDerivations pkgAttrName value + // lib.optionalAttrs (lib.isDerivation value) { + outPath = "\${${pkgAttrName}}"; + } + else + value; + in lib.mapAttrs scrubDerivation attrs; # Make sure the used package is scrubbed to avoid actually # instantiating derivations. scrubbedPkgsModule = { imports = [{ _module.args = { - pkgs = lib.mkForce (nmd.scrubDerivations "pkgs" pkgs); + pkgs = lib.mkForce (scrubDerivations "pkgs" pkgs); pkgs_i686 = lib.mkForce { }; }; }]; @@ -113,7 +122,6 @@ let ''; # Generate the HTML manual pages home-manager-manual = pkgs.callPackage ./home-manager-manual.nix { - nmd = nmdSrc; home-manager-options = { home-manager = hmOptionsDocs.optionsJSON; nixos = nixosOptionsDocs.optionsJSON; @@ -124,8 +132,6 @@ let html = home-manager-manual; htmlOpenTool = pkgs.callPackage ./html-open-tool.nix { } { inherit html; }; in { - inherit nmdSrc; - options = { # TODO: Use `hmOptionsDocs.optionsJSON` directly once upstream # `nixosOptionsDoc` is more customizable. diff --git a/docs/flake.lock b/docs/flake.lock new file mode 100644 index 000000000000..4b53be81116f --- /dev/null +++ b/docs/flake.lock @@ -0,0 +1,45 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1706683685, + "narHash": "sha256-FtPPshEpxH/ewBOsdKBNhlsL2MLEFv1hEnQ19f/bFsQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "5ad9903c16126a7d949101687af0aa589b1d7d3d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "scss-reset": "scss-reset" + } + }, + "scss-reset": { + "flake": false, + "locked": { + "lastModified": 1683906868, + "narHash": "sha256-cif5Sx8Ca5vxdw/mNAgpulLH15TwmzyJFNM7JURpoaE=", + "owner": "andreymatin", + "repo": "scss-reset", + "rev": "5a7bd491ac82441e6283fb0d5d54644b913b30c7", + "type": "github" + }, + "original": { + "owner": "andreymatin", + "ref": "1.4.2", + "repo": "scss-reset", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/docs/flake.nix b/docs/flake.nix new file mode 100644 index 000000000000..f4aa9567c297 --- /dev/null +++ b/docs/flake.nix @@ -0,0 +1,54 @@ +{ + description = "Support developing Home Manager documentation"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + scss-reset = { + url = "github:andreymatin/scss-reset/1.4.2"; + flake = false; + }; + }; + + outputs = { self, nixpkgs, scss-reset }: + let + supportedSystems = [ + "aarch64-darwin" + "aarch64-linux" + "i686-linux" + "x86_64-darwin" + "x86_64-linux" + ]; + + lib = nixpkgs.lib; + + forAllSystems = lib.genAttrs supportedSystems; + + flakePkgs = pkgs: { + p-build = pkgs.writeShellScriptBin "p-build" '' + set -euo pipefail + + export PATH=${lib.makeBinPath [ pkgs.coreutils pkgs.rsass ]} + + tmpfile=$(mktemp -d) + trap "rm -r $tmpfile" EXIT + + ln -s "${scss-reset}/build" "$tmpfile/scss-reset" + + rsass --load-path="$tmpfile" --style compressed \ + ./static/style.scss > ./static/style.css + echo "Generated ./static/style.css" + ''; + }; + in { + devShells = forAllSystems (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + fpkgs = flakePkgs pkgs; + in { + default = pkgs.mkShell { + name = "hm-docs"; + packages = [ fpkgs.p-build ]; + }; + }); + }; +} diff --git a/docs/highlight-style.css b/docs/highlight-style.css deleted file mode 100644 index 0b360281cc8d..000000000000 --- a/docs/highlight-style.css +++ /dev/null @@ -1,8 +0,0 @@ -pre { - padding: 0; -} - -pre code.hljs { - border: none; - margin: 0; -} diff --git a/docs/home-manager-manual.nix b/docs/home-manager-manual.nix index 6a14c5099d89..34196d423783 100644 --- a/docs/home-manager-manual.nix +++ b/docs/home-manager-manual.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, documentation-highlighter, nmd, revision, home-manager-options +{ stdenv, lib, documentation-highlighter, revision, home-manager-options , nixos-render-docs }: let outputPath = "share/doc/home-manager"; in stdenv.mkDerivation { @@ -9,9 +9,8 @@ in stdenv.mkDerivation { src = ./manual; buildPhase = '' - mkdir -p out/media + mkdir -p out/{highlightjs,media} - mkdir -p out/highlightjs cp -t out/highlightjs \ ${documentation-highlighter}/highlight.pack.js \ ${documentation-highlighter}/LICENSE \ @@ -19,23 +18,21 @@ in stdenv.mkDerivation { ${documentation-highlighter}/loader.js substituteInPlace ./options.md \ - --replace \ - '@OPTIONS_JSON@' \ + --subst-var-by \ + OPTIONS_JSON \ ${home-manager-options.home-manager}/share/doc/nixos/options.json substituteInPlace ./nixos-options.md \ - --replace \ - '@OPTIONS_JSON@' \ + --subst-var-by \ + OPTIONS_JSON \ ${home-manager-options.nixos}/share/doc/nixos/options.json substituteInPlace ./nix-darwin-options.md \ - --replace \ - '@OPTIONS_JSON@' \ + --subst-var-by \ + OPTIONS_JSON \ ${home-manager-options.nix-darwin}/share/doc/nixos/options.json - cp ${nmd}/static/style.css out/style.css - cp -t out/highlightjs ${nmd}/static/highlightjs/tomorrow-night.min.css - cp ${./highlight-style.css} out/highlightjs/highlight-style.css + cp ${./static/style.css} out/style.css cp -r ${./release-notes} release-notes @@ -43,8 +40,6 @@ in stdenv.mkDerivation { --manpage-urls ./manpage-urls.json \ --revision ${lib.trivial.revisionWithDefault revision} \ --stylesheet style.css \ - --stylesheet highlightjs/tomorrow-night.min.css \ - --stylesheet highlightjs/highlight-style.css \ --script highlightjs/highlight.pack.js \ --script highlightjs/loader.js \ --toc-depth 1 \ diff --git a/docs/static/style.css b/docs/static/style.css new file mode 100644 index 000000000000..6e654ed4a556 --- /dev/null +++ b/docs/static/style.css @@ -0,0 +1,7 @@ +:root{--nmd-color0: #0A3E68;--nmd-color1: #268598;--nmd-color2: #B8D09E;--nmd-color3: #F6CF5E;--nmd-color4: #EC733B;--nmd-color-info: #167cb9;--nmd-color-warn: #ff6700}html{-webkit-text-size-adjust:100%}html:focus-within{scroll-behavior:smooth}body{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;min-height:100vh;position:relative;text-rendering:optimizeSpeed;width:100%}*,:after,:before{box-sizing:border-box}a:not([class]){-webkit-text-decoration-skip:ink;text-decoration-skip-ink:auto}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{border:0;font-size:100%;font:inherit;margin:0;padding:0;vertical-align:baseline}:focus{outline:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section{display:block}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}input,input:required{box-shadow:none}input:-webkit-autofill,input:-webkit-autofill:active,input:-webkit-autofill:focus,input:-webkit-autofill:hover{-webkit-box-shadow:inset 0 0 0 30px #fff}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration,input[type=search]::-webkit-search-results-button,input[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;-moz-appearance:none}input[type=search]{-webkit-appearance:none;-moz-appearance:none}input:focus{outline:0}audio,canvas,video{display:inline-block;max-width:100%}audio:not([controls]){display:none;height:0}[hidden]{display:none}a:active,a:hover{outline:0}img{height:auto;max-width:100%;vertical-align:middle}img,picture{display:inline-block}button,input{line-height:normal}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;background:0 0;border:0;cursor:pointer}button[disabled],html input[disabled]{cursor:default}[disabled]{pointer-events:none}input[type=checkbox],input[type=radio]{padding:0}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button{background:0 0;border:0}textarea{overflow:auto;resize:vertical;vertical-align:top}table{border-collapse:collapse;border-spacing:0;text-indent:0}hr{background:#000;border:0;box-sizing:content-box;height:1px;line-height:0;margin:0;overflow:visible;padding:0;page-break-after:always;width:100%}pre{font-family:monospace,monospace;font-size:100%}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:none}code,kbd,pre,samp{font-family:monospace,monospace}small,sub,sup{font-size:75%}sub,sup{line-height:0;position:relative;vertical-align:baseline}sub{bottom:-5px}sup{top:-5px}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1;margin:0;padding:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;outline:0;padding:0}legend{border:0;color:inherit;display:block;max-width:100%;white-space:normal;width:100%}fieldset{min-width:0}body:not(:-moz-handler-blocked) fieldset{display:block}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}template{display:none}body{background:white;color:#111827;max-width:min(100ch, 1024px);margin:0 auto;padding:10px;font-family:"Lucida Sans",Arial,sans-serif;font-size:16px;line-height:1.4em}@media (prefers-color-scheme: dark){body{background:#111827;color:#F9FAFB}}h1,h2,h3{color:var(--nmd-color0);font-family:"Lato",sans-serif;font-weight:300;line-height:1.125}@media (prefers-color-scheme: dark){h1,h2,h3{color:var(--nmd-color4)}}h1{font-size:48px;font-weight:300;margin:4rem 0 1.5rem}h2{font-size:32px;font-weight:300;margin:2rem 0 1rem}h3{font-size:20px;font-weight:400;margin:.5rem .25rem}p{margin:.9rem 0}p:first-child{margin-top:0}p:last-child{margin-bottom:0}a{color:var(--nmd-color0);text-decoration:underline;text-underline-offset:3px}a:visited{color:var(--nmd-color1)}a:hover{color:var(--nmd-color1)}@media (prefers-color-scheme: dark){a{color:var(--nmd-color3)}a:visited{color:var(--nmd-color2)}a:hover{color:var(--nmd-color4)}}code{font-size:90%}span.command{font-size:90%;font-family:monospace}em{font-style:italic}strong{font-weight:bold}pre{background:#F9FAFB;margin:2rem 16px;padding:10px;border:1px solid #E5E7EB;border-radius:4px;box-shadow:4px 4px 8px #E5E7EB;font-size:90%;margin-bottom:1.5rem;padding:6px;overflow:auto}@media (prefers-color-scheme: dark){pre{background:#1F2937;border-color:black;box-shadow:4px 4px 8px black}}pre span img{user-select:none}pre:has(code){padding:0}td,th{padding:2px 5px}td:first-child,th:first-child{padding-left:0}td:last-child,th:last-child{padding-right:0}dt{margin:1.2rem 0 .8rem}dd{margin-left:2rem}ul{margin:.9rem 0;padding-left:30px;list-style:disc}ul:first-child{margin-top:0}ul:last-child{margin-bottom:0}ol{margin:.9rem 0;padding-left:30px;list-style:decimal}ol:first-child{margin-top:0}ol:last-child{margin-bottom:0}li{margin:.9rem 0;padding-left:5px}li:first-child{margin-top:0}li:last-child{margin-bottom:0}.navheader hr,.navfooter hr{margin:1rem 0;background:#E5E7EB}@media (prefers-color-scheme: dark){.navheader hr,.navfooter hr{background:#4B5563}}.navheader a,.navfooter a{text-decoration:none}div.titlepage{margin:40px 0}div.titlepage hr{display:none}div.toc{background:#F9FAFB;margin:2rem 16px;padding:10px;border:1px solid #E5E7EB;border-radius:4px;box-shadow:4px 4px 8px #E5E7EB}@media (prefers-color-scheme: dark){div.toc{background:#1F2937;border-color:black;box-shadow:4px 4px 8px black}}div.toc a{text-decoration:none}div.note,div.warning{background:#F9FAFB;margin:2rem 16px;padding:10px;border:1px solid #E5E7EB;border-radius:4px;box-shadow:4px 4px 8px #E5E7EB;font-style:italic}@media (prefers-color-scheme: dark){div.note,div.warning{background:#1F2937;border-color:black;box-shadow:4px 4px 8px black}}div.note h3,div.warning h3{float:right;margin:0 0 1rem 1rem;width:42px;height:42px;content:url()}div.note h3+p,div.warning h3+p{margin-top:0}div.note h3{background-color:var(--nmd-color-info);mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E")}div.warning h3{background-color:var(--nmd-color-warn);mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E")}.term{font-weight:300}.docbook .xref img[src^=images\/callouts\/],.screen img,.programlisting img{width:1em}.calloutlist img{width:1.3em}.programlisting.language-shell .hljs-meta.prompt_{user-select:none}/*! + Theme: Tomorrow + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#4d4d4c;background:#fff}.hljs ::selection,.hljs::selection{background-color:#d6d6d6;color:#4d4d4c}.hljs-comment{color:#8e908c}.hljs-tag{color:#969896}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#4d4d4c}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#c82829}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f5871f}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#eab700}.hljs-strong{font-weight:700;color:#eab700}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#718c00}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#3e999f}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#4271ae}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#8959a8}.hljs-emphasis{color:#8959a8;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}@media (prefers-color-scheme: dark){/*! Theme: Tomorrow Night Author: Chris Kempson (http://chriskempson.com) License: ~ MIT (or more permissive) [via base16-schemes-source] Maintainer: @highlightjs/core-team Version: 2021.09.0*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#ccc;background:#2d2d2d}.hljs ::selection,.hljs::selection{background-color:#515151;color:#ccc}.hljs-comment{color:#999}.hljs-tag{color:#b4b7b4}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#ccc}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f2777a}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f99157}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fc6}.hljs-strong{font-weight:700;color:#fc6}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#9c9}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#6cc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#69c}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c9c}.hljs-emphasis{color:#c9c;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700}} diff --git a/docs/static/style.scss b/docs/static/style.scss new file mode 100644 index 000000000000..3eb0e631f1de --- /dev/null +++ b/docs/static/style.scss @@ -0,0 +1,310 @@ +:root { + --nmd-color0: #0A3E68; + --nmd-color1: #268598; + --nmd-color2: #B8D09E; + --nmd-color3: #F6CF5E; + --nmd-color4: #EC733B; + + --nmd-color-info: #167cb9; + --nmd-color-warn: #ff6700; +} + +// Copied from Tailwind CSS. +$color-gray-50: #F9FAFB; +$color-gray-100: #F3F4F6; +$color-gray-200: #E5E7EB; +$color-gray-300: #D1D5DB; +$color-gray-400: #9CA3AF; +$color-gray-500: #6B7280; +$color-gray-600: #4B5563; +$color-gray-700: #374151; +$color-gray-800: #1F2937; +$color-gray-900: #111827; + +$color-blue-50: #EFF6FF; +$color-blue-100: #DBEAFE; +$color-blue-200: #BFDBFE; +$color-blue-300: #93C5FD; +$color-blue-400: #60A5FA; +$color-blue-500: #3B82F6; +$color-blue-600: #2563EB; +$color-blue-700: #1D4ED8; +$color-blue-800: #1E40AF; +$color-blue-900: #1E3A8A; + + +@use 'scss-reset/reset'; + +@mixin boxed { + background: $color-gray-50; + margin: 2rem 16px; + padding: 10px; + border: 1px solid $color-gray-200; + border-radius: 4px; + box-shadow: 4px 4px 8px $color-gray-200; + + @media (prefers-color-scheme: dark) { + background: $color-gray-800; + border-color: black; + box-shadow: 4px 4px 8px black; + } +} + +@mixin margined { + margin: 0.9rem 0; + + &:first-child { + margin-top: 0; + } + + &:last-child { + margin-bottom: 0; + } +} + +body { + background: white; + color: $color-gray-900; + max-width: min(100ch, 1024px); + margin: 0 auto; + padding: 10px; + + font-family: 'Lucida Sans', Arial, sans-serif; + font-size: 16px; + line-height: 1.4em; + + @media (prefers-color-scheme: dark) { + background: $color-gray-900; + color: $color-gray-50; + } +} + +h1, h2, h3 { + color: var(--nmd-color0); + font-family: "Lato", sans-serif; + font-weight: 300; + line-height: 1.125; + + @media (prefers-color-scheme: dark) { + color: var(--nmd-color4); + } +} + +h1 { + font-size: 48px; + font-weight: 300; + margin: 4rem 0 1.5rem; +} + +h2 { + font-size: 32px; + font-weight: 300; + margin: 2rem 0 1rem; +} + +h3 { + font-size: 20px; + font-weight: 400; + margin: 0.5rem 0.25rem; +} + +p { + @include margined; +} + +a { + color: var(--nmd-color0); //$color-secondary-1-3; + text-decoration: underline; + text-underline-offset: 3px; + + &:visited { + color: var(--nmd-color1); + } + + &:hover { + color: var(--nmd-color1); + } + + @media (prefers-color-scheme: dark) { + color: var(--nmd-color3); + + &:visited { + color: var(--nmd-color2); + } + + &:hover { + color: var(--nmd-color4); + } + } +} + +code { + font-size: 90%; +} + +span.command { + font-size: 90%; + font-family: monospace; +} + +em { + font-style: italic; +} + +strong { + font-weight: bold; +} + +pre { + @include boxed; + + font-size: 90%; + margin-bottom: 1.5rem; + padding: 6px; + overflow: auto; + + // The callout markers should not be selectable. + span img { + user-select: none; + } +} + +pre:has(code) { + padding: 0; +} + +td, th { + padding: 2px 5px; + + &:first-child { + padding-left: 0; + } + + &:last-child { + padding-right: 0; + } +} + +dt { + margin: 1.2rem 0 0.8rem; +} + +dd { + margin-left: 2rem; +} + +div.book { + +} + +ul { + @include margined; + + padding-left: 30px; + list-style: disc; +} + +ol { + @include margined; + + padding-left: 30px; + list-style: decimal; +} + +li { + @include margined; + + padding-left: 5px; +} + +.navheader, .navfooter { + hr { + margin: 1rem 0; + background: $color-gray-200; + @media (prefers-color-scheme: dark) { + background: $color-gray-600; + } + } + + a { + text-decoration: none; + } +} + +div.titlepage { + margin: 40px 0; + + hr { + display: none; + } +} + +div.toc { + @include boxed; + + a { + text-decoration: none; + } +} + +div.note, div.warning { + @include boxed; + + font-style: italic; + + h3 { + float: right; + margin: 0 0 1rem 1rem; + width: 42px; + height: 42px; + content: url(); + } + + + h3 + p { + margin-top: 0; + } +} + +div.note { + h3 { + background-color: var(--nmd-color-info); + // From https://tabler-icons.io/i/info-square-rounded + mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E"); + -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 8h.01'%3E%3C/path%3E%3Cpath d='M11 12h1v4h1'%3E%3C/path%3E%3Cpath d='M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z'%3E%3C/path%3E%3C/svg%3E"); + } +} + +div.warning { + h3 { + background-color: var(--nmd-color-warn); + // From https://tabler-icons.io/i/alert-triangle + mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E"); + -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='42' viewBox='0 0 24 24' stroke-width='2' stroke='black' fill='none' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath stroke='none' d='M0 0h24v24H0z' fill='none'%3E%3C/path%3E%3Cpath d='M12 9v2m0 4v.01'%3E%3C/path%3E%3Cpath d='M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75'%3E%3C/path%3E%3C/svg%3E"); + } +} + +.term { + font-weight: 300; +} + +.docbook .xref img[src^=images\/callouts\/], +.screen img, +.programlisting img { + width: 1em; +} + +.calloutlist img { + width: 1.3em; +} + +/** The console prompt, e.g., `$` and `#` should not be selectable. */ +.programlisting.language-shell .hljs-meta.prompt_ { + user-select: none; +} + +@import 'tomorrow.min.css'; + +@media (prefers-color-scheme: dark) { + @import 'tomorrow-night.min.css'; +} diff --git a/docs/static/tomorrow-night.min.css b/docs/static/tomorrow-night.min.css new file mode 100644 index 000000000000..a0b3f625aaa2 --- /dev/null +++ b/docs/static/tomorrow-night.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Tomorrow Night + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#ccc;background:#2d2d2d}.hljs ::selection,.hljs::selection{background-color:#515151;color:#ccc}.hljs-comment{color:#999}.hljs-tag{color:#b4b7b4}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#ccc}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#f2777a}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f99157}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#fc6}.hljs-strong{font-weight:700;color:#fc6}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#9c9}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#6cc}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#69c}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#c9c}.hljs-emphasis{color:#c9c;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/docs/static/tomorrow.min.css b/docs/static/tomorrow.min.css new file mode 100644 index 000000000000..5785f6efcc42 --- /dev/null +++ b/docs/static/tomorrow.min.css @@ -0,0 +1,7 @@ +/*! + Theme: Tomorrow + Author: Chris Kempson (http://chriskempson.com) + License: ~ MIT (or more permissive) [via base16-schemes-source] + Maintainer: @highlightjs/core-team + Version: 2021.09.0 +*/pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}.hljs{color:#4d4d4c;background:#fff}.hljs ::selection,.hljs::selection{background-color:#d6d6d6;color:#4d4d4c}.hljs-comment{color:#8e908c}.hljs-tag{color:#969896}.hljs-operator,.hljs-punctuation,.hljs-subst{color:#4d4d4c}.hljs-operator{opacity:.7}.hljs-bullet,.hljs-deletion,.hljs-name,.hljs-selector-tag,.hljs-template-variable,.hljs-variable{color:#c82829}.hljs-attr,.hljs-link,.hljs-literal,.hljs-number,.hljs-symbol,.hljs-variable.constant_{color:#f5871f}.hljs-class .hljs-title,.hljs-title,.hljs-title.class_{color:#eab700}.hljs-strong{font-weight:700;color:#eab700}.hljs-addition,.hljs-code,.hljs-string,.hljs-title.class_.inherited__{color:#718c00}.hljs-built_in,.hljs-doctag,.hljs-keyword.hljs-atrule,.hljs-quote,.hljs-regexp{color:#3e999f}.hljs-attribute,.hljs-function .hljs-title,.hljs-section,.hljs-title.function_,.ruby .hljs-property{color:#4271ae}.diff .hljs-meta,.hljs-keyword,.hljs-template-tag,.hljs-type{color:#8959a8}.hljs-emphasis{color:#8959a8;font-style:italic}.hljs-meta,.hljs-meta .hljs-keyword,.hljs-meta .hljs-string{color:#a3685a}.hljs-meta .hljs-keyword,.hljs-meta-keyword{font-weight:700} \ No newline at end of file diff --git a/modules/manual.nix b/modules/manual.nix index 84ec7eda0e8c..23963c3c04e1 100644 --- a/modules/manual.nix +++ b/modules/manual.nix @@ -57,13 +57,6 @@ in { (mkIf cfg.manpages.enable [ docs.manPages ]) (mkIf cfg.json.enable [ docs.options.json ]) ]; - - # Whether a dependency on nmd should be introduced. - home.extraBuilderCommands = - mkIf (cfg.html.enable || cfg.manpages.enable || cfg.json.enable) '' - mkdir $out/lib - ln -s ${docs.nmdSrc} $out/lib/nmd - ''; }; } From 4d53427bce7bf3d17e699252fd84dc7468afc46e Mon Sep 17 00:00:00 2001 From: Kylie McClain Date: Wed, 31 Jan 2024 18:24:56 -0500 Subject: [PATCH 027/636] xfconf: fix config loading The `run` function export was removed in #4965. This broke the expectation in this module that `run` would be available outside of main activation script, as `$DRY_RUN_CMD` once was. Fixes #4980 --- modules/misc/xfconf.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/misc/xfconf.nix b/modules/misc/xfconf.nix index f343020e3c9b..087040085675 100644 --- a/modules/misc/xfconf.nix +++ b/modules/misc/xfconf.nix @@ -120,8 +120,10 @@ in { (channel: properties: mapAttrsToList (mkCommand channel) properties) cfg.settings; - load = pkgs.writeShellScript "load-xfconf" - (concatMapStrings concatStrings commands); + load = pkgs.writeShellScript "load-xfconf" '' + ${config.lib.bash.initHomeManagerLib} + ${concatMapStrings concatStrings commands} + ''; in '' if [[ -v DBUS_SESSION_BUS_ADDRESS ]]; then export DBUS_RUN_SESSION_CMD="" From 880d9bc2110f7cae59698f715b8ca42cdc53670c Mon Sep 17 00:00:00 2001 From: Ramses Date: Sat, 3 Feb 2024 11:14:20 +0100 Subject: [PATCH 028/636] nix: fix generation of nix.conf for nix >= 2.20 --- modules/misc/nix.nix | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/modules/misc/nix.nix b/modules/misc/nix.nix index 9e249143665b..a4456946e567 100644 --- a/modules/misc/nix.nix +++ b/modules/misc/nix.nix @@ -52,22 +52,26 @@ let checkPhase = if pkgs.stdenv.hostPlatform != pkgs.stdenv.buildPlatform then '' echo "Ignoring validation for cross-compilation" - '' else '' - echo "Validating generated nix.conf" - ln -s $out ./nix.conf - set -e - set +o pipefail - NIX_CONF_DIR=$PWD \ - ${cfg.package}/bin/nix show-config ${ - optionalString (isNixAtLeast "2.3pre") - "--no-net --option experimental-features nix-command" - } \ - |& sed -e 's/^warning:/error:/' \ - | (! grep '${ - if cfg.checkConfig then "^error:" else "^error: unknown setting" - }') - set -o pipefail - ''; + '' else + let + showCommand = + if isNixAtLeast "2.20pre" then "config show" else "show-config"; + in '' + echo "Validating generated nix.conf" + ln -s $out ./nix.conf + set -e + set +o pipefail + NIX_CONF_DIR=$PWD \ + ${cfg.package}/bin/nix ${showCommand} ${ + optionalString (isNixAtLeast "2.3pre") + "--no-net --option experimental-features nix-command" + } \ + |& sed -e 's/^warning:/error:/' \ + | (! grep '${ + if cfg.checkConfig then "^error:" else "^error: unknown setting" + }') + set -o pipefail + ''; }; semanticConfType = with types; From 1ca210648a6ca9b957efde5da957f3de6b1f0c45 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 3 Feb 2024 19:39:45 +0100 Subject: [PATCH 029/636] tests: reduce closure sizes --- .../i18n/input-method/fcitx5-stubs.nix | 15 ++++ tests/modules/programs/beets/mpdstats.nix | 6 +- .../programs/mpv/mpv-example-settings.nix | 80 +++++++++---------- .../programs/mpv/mpv-invalid-settings.nix | 29 +++---- tests/modules/programs/mpv/mpv-stubs.nix | 28 +++++++ 5 files changed, 96 insertions(+), 62 deletions(-) create mode 100644 tests/modules/programs/mpv/mpv-stubs.nix diff --git a/tests/modules/i18n/input-method/fcitx5-stubs.nix b/tests/modules/i18n/input-method/fcitx5-stubs.nix index 7710aa3c511c..2a981125606a 100644 --- a/tests/modules/i18n/input-method/fcitx5-stubs.nix +++ b/tests/modules/i18n/input-method/fcitx5-stubs.nix @@ -18,6 +18,21 @@ fcitx5-qt = { outPath = null; }; fcitx5-gtk = { outPath = null; }; fcitx5-chinese-addons = { outPath = null; }; + + gtk2 = { + buildScript = '' + mkdir -p $out/bin + echo '#/usr/bin/env bash' > $out/bin/gtk-query-immodules-2.0 + chmod +x $out/bin/* + ''; + }; + gtk3 = { + buildScript = '' + mkdir -p $out/bin + echo '#/usr/bin/env bash' > $out/bin/gtk-query-immodules-3.0 + chmod +x $out/bin/* + ''; + }; }; nixpkgs.overlays = [ diff --git a/tests/modules/programs/beets/mpdstats.nix b/tests/modules/programs/beets/mpdstats.nix index 781eaa84a1e5..d825f85bd7cb 100644 --- a/tests/modules/programs/beets/mpdstats.nix +++ b/tests/modules/programs/beets/mpdstats.nix @@ -11,10 +11,14 @@ programs.beets = { enable = true; - package = config.lib.test.mkStubPackage { outPath = "@beets@"; }; mpdIntegration.enableStats = true; }; + test.stubs = { + beets = { }; + mpd = { }; + }; + nmt.script = '' assertFileExists home-files/.config/beets/config.yaml assertFileContent \ diff --git a/tests/modules/programs/mpv/mpv-example-settings.nix b/tests/modules/programs/mpv/mpv-example-settings.nix index 58467de0b847..9974aff6ba38 100644 --- a/tests/modules/programs/mpv/mpv-example-settings.nix +++ b/tests/modules/programs/mpv/mpv-example-settings.nix @@ -1,55 +1,51 @@ { config, lib, pkgs, ... }: { - config = { - programs.mpv = { - enable = true; - package = pkgs.mpvDummy; - - bindings = { - WHEEL_UP = "seek 10"; - WHEEL_DOWN = "seek -10"; - "Alt+0" = "set window-scale 0.5"; - }; + imports = [ ./mpv-stubs.nix ]; - config = { - force-window = true; - ytdl-format = "bestvideo+bestaudio"; - cache-default = 4000000; - }; + programs.mpv = { + enable = true; - scriptOpts = { - osc = { - scalewindowed = 2.0; - vidscale = false; - visibility = "always"; - }; - }; + bindings = { + WHEEL_UP = "seek 10"; + WHEEL_DOWN = "seek -10"; + "Alt+0" = "set window-scale 0.5"; + }; - profiles = { - fast = { vo = "vdpau"; }; - "protocol.dvd" = { - profile-desc = "profile for dvd:// streams"; - alang = "en"; - }; + config = { + force-window = true; + ytdl-format = "bestvideo+bestaudio"; + cache-default = 4000000; + }; + + scriptOpts = { + osc = { + scalewindowed = 2.0; + vidscale = false; + visibility = "always"; }; + }; - defaultProfiles = [ "gpu-hq" ]; + profiles = { + fast = { vo = "vdpau"; }; + "protocol.dvd" = { + profile-desc = "profile for dvd:// streams"; + alang = "en"; + }; }; - test.stubs.mpvDummy = { }; - - nmt.script = '' - assertFileContent \ - home-files/.config/mpv/mpv.conf \ - ${./mpv-example-settings-expected-config} - assertFileContent \ - home-files/.config/mpv/input.conf \ - ${./mpv-example-settings-expected-bindings} - assertFileContent \ - home-files/.config/mpv/script-opts/osc.conf \ - ${./mpv-example-settings-expected-osc-opts} - ''; + defaultProfiles = [ "gpu-hq" ]; }; + nmt.script = '' + assertFileContent \ + home-files/.config/mpv/mpv.conf \ + ${./mpv-example-settings-expected-config} + assertFileContent \ + home-files/.config/mpv/input.conf \ + ${./mpv-example-settings-expected-bindings} + assertFileContent \ + home-files/.config/mpv/script-opts/osc.conf \ + ${./mpv-example-settings-expected-osc-opts} + ''; } diff --git a/tests/modules/programs/mpv/mpv-invalid-settings.nix b/tests/modules/programs/mpv/mpv-invalid-settings.nix index 701c823fb32c..896e34fa7b29 100644 --- a/tests/modules/programs/mpv/mpv-invalid-settings.nix +++ b/tests/modules/programs/mpv/mpv-invalid-settings.nix @@ -1,25 +1,16 @@ { config, lib, pkgs, ... }: { - config = { - programs.mpv = { - enable = true; - package = pkgs.mpvDummy; - scripts = [ pkgs.mpvScript ]; - }; + imports = [ ./mpv-stubs.nix ]; - nixpkgs.overlays = [ - (self: super: { - mpvScript = - pkgs.runCommandLocal "mpvScript" { scriptName = "something"; } - "mkdir $out"; - }) - ]; - test.stubs.mpvDummy = { }; - - test.asserts.assertions.expected = [ - '' - The programs.mpv "package" option is mutually exclusive with "scripts" option.'' - ]; + programs.mpv = { + enable = true; + package = pkgs.emptyDirectory; + scripts = [ pkgs.mpvScript ]; }; + + test.asserts.assertions.expected = [ + '' + The programs.mpv "package" option is mutually exclusive with "scripts" option.'' + ]; } diff --git a/tests/modules/programs/mpv/mpv-stubs.nix b/tests/modules/programs/mpv/mpv-stubs.nix new file mode 100644 index 000000000000..5d558ab3ec6a --- /dev/null +++ b/tests/modules/programs/mpv/mpv-stubs.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: + +{ + nixpkgs.overlays = [ + (self: super: { + mpvScript = pkgs.runCommandLocal "mpvScript" { scriptName = "something"; } + "mkdir $out"; + + mpv-unwrapped = super.mpv-unwrapped.overrideAttrs { + builder = pkgs.writeShellScript "dummy" '' + PATH=${pkgs.coreutils}/bin + mkdir -p $dev $man $out/bin $out/Applications/mpv.app/Contents/MacOS + touch $out/bin/{mpv,umpv} \ + $out/Applications/mpv.app/Contents/MacOS/{mpv,mpv-bundle} + chmod +x $out/bin/{mpv,umpv} \ + $out/Applications/mpv.app/Contents/MacOS/{mpv,mpv-bundle} + ''; + }; + + lua = pkgs.emptyDirectory.overrideAttrs { + luaversion = "0"; + withPackages = ps: pkgs.emptyDirectory; + }; + }) + ]; + + test.stubs = { yt-dlp = { }; }; +} From 230836bb7ca318aec7bad8442954da611d06a172 Mon Sep 17 00:00:00 2001 From: Juraj Hlista Date: Wed, 31 Jan 2024 17:01:18 +0100 Subject: [PATCH 030/636] hyprland: fix hyprctl crash `/tmp/hypr` must be present so `hyprctl` doesn't crash. --- modules/services/window-managers/hyprland.nix | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index 65cf0c316e2b..168bab6594bc 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -246,11 +246,13 @@ in { onChange = lib.mkIf (cfg.package != null) '' ( # Execute in subshell so we don't poision environment with vars - # This var must be set for hyprctl to function, but the value doesn't matter. - export HYPRLAND_INSTANCE_SIGNATURE="bogus" - for i in $(${cfg.finalPackage}/bin/hyprctl instances -j | jq ".[].instance" -r); do - HYPRLAND_INSTANCE_SIGNATURE=$i ${cfg.finalPackage}/bin/hyprctl reload config-only - done + if [[ -d "/tmp/hypr" ]]; then + # This var must be set for hyprctl to function, but the value doesn't matter. + export HYPRLAND_INSTANCE_SIGNATURE="bogus" + for i in $(${cfg.finalPackage}/bin/hyprctl instances -j | jq ".[].instance" -r); do + HYPRLAND_INSTANCE_SIGNATURE=$i ${cfg.finalPackage}/bin/hyprctl reload config-only + done + fi ) ''; }; From 9291f28f93a818e4496a6f71f6c77f59108d4d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Sun, 4 Feb 2024 14:10:11 +0100 Subject: [PATCH 031/636] Translate using Weblate (Turkish) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 100.0% (35 of 35 strings) Co-authored-by: Oğuz Ersen Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/tr/ Translation: Home Manager/Home Manager CLI --- home-manager/po/tr.po | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/home-manager/po/tr.po b/home-manager/po/tr.po index ef686c7e48e7..aaec4da63af3 100644 --- a/home-manager/po/tr.po +++ b/home-manager/po/tr.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2023-09-13 23:46+0200\n" -"PO-Revision-Date: 2023-10-19 04:00+0000\n" -"Last-Translator: Emre Çebi \n" +"PO-Revision-Date: 2024-02-04 13:10+0000\n" +"Last-Translator: Oğuz Ersen \n" "Language-Team: Turkish \n" "Language: tr\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.1\n" +"X-Generator: Weblate 5.4-dev\n" #: home-manager/home-manager:81 msgid "No configuration file found at %s" @@ -49,6 +49,8 @@ msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" +"Yedek Ana Dizin Yöneticisi yolu %s kullanımdan kaldırıldı ve orada bir dosya/" +"dizin bulundu." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:135 @@ -71,6 +73,24 @@ msgid "" "\n" " $ rm -r \"%s\"" msgstr "" +"Bu uyarıyı kaldırmak için aşağıdakilerden birini yapın.\n" +"\n" +"1. Ev Dizin Yöneticisi'ne yolu kullanmasını açıkça söyleyin, örneğin\n" +"\n" +" { programs.home-manager.path = \"%s\"; }\n" +"\n" +" şeklinde yapılandırmanıza ekleyebilirsiniz.\n" +"\n" +" Ev Dizin Yöneticisi'ne doğrudan içe aktarırsanız, Ev Dizin Yöneticisi " +"paketini çağırırken\n" +"\n" +" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" +"\n" +" şeklinde `path` parametresini kullanabilirsiniz.\n" +"\n" +"2. Kullanımdan kaldırılan yolu kaldırın.\n" +"\n" +" $ rm -r \"%s\"" #: home-manager/home-manager:174 msgid "Could not find suitable profile directory, tried %s and %s" From 4ab01785b85aac4dd0f0414f7c0ca4c007e64054 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 4 Feb 2024 20:20:42 +0100 Subject: [PATCH 032/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/ae5c332cbb5827f6b1f02572496b141021de335f' (2024-01-25) → 'github:NixOS/nixpkgs/b8b232ae7b8b144397fdb12d20f592e5e7c1a64d' (2024-01-31) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 0484420f90c0..7792be21acb1 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1706191920, - "narHash": "sha256-eLihrZAPZX0R6RyM5fYAWeKVNuQPYjAkCUBr+JNvtdE=", + "lastModified": 1706732774, + "narHash": "sha256-hqJlyJk4MRpcItGYMF+3uHe8HvxNETWvlGtLuVpqLU0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ae5c332cbb5827f6b1f02572496b141021de335f", + "rev": "b8b232ae7b8b144397fdb12d20f592e5e7c1a64d", "type": "github" }, "original": { From f80df90c105d081a49d123c34a57ead9dac615b9 Mon Sep 17 00:00:00 2001 From: Ujp8LfXBJ6wCPR Date: Sun, 4 Feb 2024 23:36:41 +0100 Subject: [PATCH 033/636] fish: implement shellInitLast (after others) Since the module system doesn't allow specifying order on types.lines users can't specify anything to run after what modules have put into shellInitInteractive since it runs last. This implements a fourth field that runs after all others, not to be used by HM modules, but regular users. Co-authored-by: Carl Hjerpe --- modules/programs/fish.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 7df9704d0ec1..473d816007b8 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -314,6 +314,15 @@ in { initialisation. ''; }; + + shellInitLast = mkOption { + type = types.lines; + default = ""; + description = '' + Shell script code called during interactive fish shell + initialisation, this will be the last thing executed in fish startup. + ''; + }; }; programs.fish.plugins = mkOption { @@ -469,6 +478,8 @@ in { ${cfg.interactiveShellInit} end + + ${cfg.shellInitLast} ''; } { From 1683c507c2c58a502294330de940e2b4b51bdf75 Mon Sep 17 00:00:00 2001 From: Kylie McClain Date: Sun, 4 Feb 2024 18:07:19 -0500 Subject: [PATCH 034/636] vdirsyncer: create postHook script when non-empty --- modules/programs/vdirsyncer-accounts.nix | 4 ++-- modules/programs/vdirsyncer.nix | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/programs/vdirsyncer-accounts.nix b/modules/programs/vdirsyncer-accounts.nix index 35badb927f9e..fac4d01da91d 100644 --- a/modules/programs/vdirsyncer-accounts.nix +++ b/modules/programs/vdirsyncer-accounts.nix @@ -137,8 +137,8 @@ in { }; postHook = mkOption { - type = types.lines; - default = ""; + type = types.nullOr types.lines; + default = null; description = '' Command to call for each item creation and modification. The command will be called with the path of the new/updated diff --git a/modules/programs/vdirsyncer.nix b/modules/programs/vdirsyncer.nix index ec1b387968b9..545df71b5238 100644 --- a/modules/programs/vdirsyncer.nix +++ b/modules/programs/vdirsyncer.nix @@ -26,8 +26,9 @@ let filterAttrs (_: v: v != null) ((getAttrs [ "type" "fileExt" "encoding" ] a.local) // { path = a.local.path; - postHook = pkgs.writeShellScriptBin "post-hook" a.vdirsyncer.postHook - + "/bin/post-hook"; + postHook = optionalString (a.vdirsyncer.postHook != null) + (pkgs.writeShellScriptBin "post-hook" a.vdirsyncer.postHook + + "/bin/post-hook"); }); remoteStorage = a: From 4740f2ccda184e9cc509d7a82b26d7271e0c79d9 Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Mon, 5 Feb 2024 06:10:32 +0700 Subject: [PATCH 035/636] kitty: always export `KITTY_SHELL_INTEGRATION` This ensures that `KITTY_SHELL_INTEGRATION` is manually set to the user's `shellIntegration.mode`. This is necessary because sometimes the variable is not set in subshells or splits. `shellIntegration.mode` is also now ensured to always contain `no-rc`. --- modules/programs/kitty.nix | 16 ++++++++++++---- .../kitty/example-settings-expected.conf | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index e010ba09f1dd..48ec13da4116 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -29,17 +29,20 @@ let shellIntegrationInit = { bash = '' if test -n "$KITTY_INSTALLATION_DIR"; then + export KITTY_SHELL_INTEGRATION="${cfg.shellIntegration.mode}" source "$KITTY_INSTALLATION_DIR/shell-integration/bash/kitty.bash" fi ''; fish = '' if set -q KITTY_INSTALLATION_DIR + set --global KITTY_SHELL_INTEGRATION "${cfg.shellIntegration.mode}" source "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish" set --prepend fish_complete_path "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_completions.d" end ''; zsh = '' if test -n "$KITTY_INSTALLATION_DIR"; then + export KITTY_SHELL_INTEGRATION="${cfg.shellIntegration.mode}" autoload -Uz -- "$KITTY_INSTALLATION_DIR"/shell-integration/zsh/kitty-integration kitty-integration unfunction kitty-integration @@ -48,9 +51,9 @@ let }; shellIntegrationDefaultOpt = { - default = cfg.shellIntegration.mode != "disabled"; + default = !(elem "disabled" (splitString " " cfg.shellIntegration.mode)); defaultText = literalExpression '' - config.programs.kitty.shellIntegration.mode != "disabled" + !(elem "disabled" (splitString " " config.programs.kitty.shellIntegration.mode)) ''; }; in { @@ -141,8 +144,13 @@ in { shellIntegration = { mode = mkOption { type = types.str; - default = "enabled"; + default = "no-rc"; example = "no-cursor"; + apply = (o: + let + modes = splitString " " o; + filtered = filter (m: m != "no-rc") modes; + in concatStringsSep " " (concatLists [ [ "no-rc" ] filtered ])); description = '' Set the mode of the shell integration. This accepts the same options as the `shell_integration` option of Kitty. Note that @@ -197,7 +205,7 @@ in { '') '' # Shell integration is sourced and configured manually - shell_integration no-rc ${cfg.shellIntegration.mode} + shell_integration ${cfg.shellIntegration.mode} '' (toKittyConfig cfg.settings) (toKittyKeybindings cfg.keybindings) diff --git a/tests/modules/programs/kitty/example-settings-expected.conf b/tests/modules/programs/kitty/example-settings-expected.conf index 41a209eae2f0..aca1b0c18978 100644 --- a/tests/modules/programs/kitty/example-settings-expected.conf +++ b/tests/modules/programs/kitty/example-settings-expected.conf @@ -5,7 +5,7 @@ font_size 8 # Shell integration is sourced and configured manually -shell_integration no-rc enabled +shell_integration no-rc enable_audio_bell no scrollback_lines 10000 From a28b12d7412324aa22a5f9df8909672dec33613e Mon Sep 17 00:00:00 2001 From: Rucadi Date: Mon, 5 Feb 2024 07:34:43 +0100 Subject: [PATCH 036/636] vscode: add openvscode-server In order to manage the extensions and configs from openvscode-server, the only additional requirement was some mapping missing between the name of the package and the default configDir/extensionDir --- modules/programs/vscode.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/programs/vscode.nix b/modules/programs/vscode.nix index 7680d70c44ff..f77937d66cc5 100644 --- a/modules/programs/vscode.nix +++ b/modules/programs/vscode.nix @@ -15,12 +15,14 @@ let "vscode" = "Code"; "vscode-insiders" = "Code - Insiders"; "vscodium" = "VSCodium"; + "openvscode-server" = "OpenVSCode Server"; }.${vscodePname}; extensionDir = { "vscode" = "vscode"; "vscode-insiders" = "vscode-insiders"; "vscodium" = "vscode-oss"; + "openvscode-server" = "openvscode-server"; }.${vscodePname}; userDir = if pkgs.stdenv.hostPlatform.isDarwin then From afcedcf2c8e424d0465e823cf833eb3adebe1db7 Mon Sep 17 00:00:00 2001 From: iofq Date: Mon, 5 Feb 2024 06:35:23 +0000 Subject: [PATCH 037/636] mcfly: add interfaceView option --- modules/programs/mcfly.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/programs/mcfly.nix b/modules/programs/mcfly.nix index 0a7a64800ad0..450a27380c6d 100644 --- a/modules/programs/mcfly.nix +++ b/modules/programs/mcfly.nix @@ -48,6 +48,14 @@ in { ''; }; + interfaceView = mkOption { + type = types.enum [ "TOP" "BOTTOM" ]; + default = "TOP"; + description = '' + Interface view to use. + ''; + }; + fzf.enable = mkEnableOption "McFly fzf integration"; enableLightTheme = mkOption { @@ -104,6 +112,8 @@ in { programs.fish.shellInit = mkIf cfg.enableFishIntegration fishIntegration; home.sessionVariables.MCFLY_KEY_SCHEME = cfg.keyScheme; + + home.sessionVariables.MCFLY_INTERFACE_VIEW = cfg.interfaceView; } (mkIf cfg.enableLightTheme { home.sessionVariables.MCFLY_LIGHT = "TRUE"; }) From 274bd470a544647d90d7491037fdf8af61b7d8d0 Mon Sep 17 00:00:00 2001 From: shivaraj-bh Date: Sun, 28 Jan 2024 09:41:23 +0530 Subject: [PATCH 038/636] nix-gc: add service The nix-gc service runs automatically at a specified frequency. It is managed via launchd on macOS and systemd on Linux. --- modules/modules.nix | 1 + modules/services/nix-gc.nix | 120 ++++++++++++++++++ tests/default.nix | 2 + .../modules/services/nix-gc-darwin/basic.nix | 19 +++ .../services/nix-gc-darwin/default.nix | 1 + .../nix-gc-darwin/expected-agent.plist | 24 ++++ tests/modules/services/nix-gc/basic.nix | 29 +++++ tests/modules/services/nix-gc/default.nix | 1 + .../modules/services/nix-gc/expected.service | 5 + tests/modules/services/nix-gc/expected.timer | 9 ++ 10 files changed, 211 insertions(+) create mode 100644 modules/services/nix-gc.nix create mode 100644 tests/modules/services/nix-gc-darwin/basic.nix create mode 100644 tests/modules/services/nix-gc-darwin/default.nix create mode 100644 tests/modules/services/nix-gc-darwin/expected-agent.plist create mode 100644 tests/modules/services/nix-gc/basic.nix create mode 100644 tests/modules/services/nix-gc/default.nix create mode 100644 tests/modules/services/nix-gc/expected.service create mode 100644 tests/modules/services/nix-gc/expected.timer diff --git a/modules/modules.nix b/modules/modules.nix index 6504bc42e679..d798147ef9be 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -308,6 +308,7 @@ let ./services/muchsync.nix ./services/network-manager-applet.nix ./services/nextcloud-client.nix + ./services/nix-gc.nix ./services/notify-osd.nix ./services/opensnitch-ui.nix ./services/osmscout-server.nix diff --git a/modules/services/nix-gc.nix b/modules/services/nix-gc.nix new file mode 100644 index 000000000000..01fe5ac5deb4 --- /dev/null +++ b/modules/services/nix-gc.nix @@ -0,0 +1,120 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.nix.gc; + + mkCalendarInterval = frequency: + let + freq = { + "hourly" = [{ Minute = 0; }]; + "weekly" = [{ + Weekday = 1; + Hour = 0; + Minute = 0; + }]; + "monthly" = [{ + Day = 1; + Hour = 0; + Minute = 0; + }]; + "semiannually" = [ + { + Month = 1; + Day = 1; + Hour = 0; + Minute = 0; + } + { + Month = 7; + Day = 1; + Hour = 0; + Minute = 0; + } + ]; + "annually" = [{ + Month = 1; + Day = 1; + Hour = 0; + Minute = 0; + }]; + }; + in freq.${frequency}; + + nixPackage = if config.nix.enable && config.nix.package != null then + config.nix.package + else + pkgs.nix; +in { + meta.maintainers = [ maintainers.shivaraj-bh ]; + + options = { + nix.gc = { + automatic = mkOption { + type = types.bool; + default = false; + description = '' + Automatically run the garbage collector at a specific time. + + Note: This will only garbage collect the current user's profiles. + ''; + }; + + frequency = mkOption { + type = + types.enum [ "hourly" "weekly" "monthly" "semiannually" "annually" ]; + default = "weekly"; + example = "monthly"; + description = '' + The frequency at which to run the garbage collector. + + These enums are based on special expressions from the + {manpage}`systemd.time(7)` + ''; + }; + + options = mkOption { + type = types.nullOr types.str; + default = null; + example = "--max-freed $((64 * 1024**3))"; + description = '' + Options given to {file}`nix-collect-garbage` when the + garbage collector is run automatically. + ''; + }; + }; + }; + + config = lib.mkIf cfg.automatic (mkMerge [ + (mkIf pkgs.stdenv.isLinux { + systemd.user.services.nix-gc = { + Unit = { Description = "Nix Garbage Collector"; }; + Service = { + ExecStart = "${nixPackage}/bin/nix-collect-garbage ${ + lib.optionalString (cfg.options != null) cfg.options + }"; + }; + }; + systemd.user.timers.nix-gc = { + Unit = { Description = "Nix Garbage Collector"; }; + Timer = { + OnCalendar = "${cfg.frequency}"; + Unit = "nix-gc.service"; + }; + Install = { WantedBy = [ "timers.target" ]; }; + }; + }) + + (mkIf pkgs.stdenv.isDarwin { + launchd.agents.nix-gc = { + enable = true; + config = { + ProgramArguments = [ "${nixPackage}/bin/nix-collect-garbage" ] + ++ lib.optional (cfg.options != null) cfg.options; + StartCalendarInterval = mkCalendarInterval cfg.frequency; + }; + }; + }) + ]); +} diff --git a/tests/default.nix b/tests/default.nix index ff1373de65bf..be4d8f40a111 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -161,6 +161,7 @@ in import nmtSrc { ./modules/launchd ./modules/services/git-sync-darwin ./modules/services/imapnotify-darwin + ./modules/services/nix-gc-darwin ./modules/targets-darwin ] ++ lib.optionals isLinux [ ./modules/config/i18n @@ -234,6 +235,7 @@ in import nmtSrc { ./modules/services/mpd ./modules/services/mpd-mpris ./modules/services/mpdris2 + ./modules/services/nix-gc ./modules/services/osmscout-server ./modules/services/pantalaimon ./modules/services/parcellite diff --git a/tests/modules/services/nix-gc-darwin/basic.nix b/tests/modules/services/nix-gc-darwin/basic.nix new file mode 100644 index 000000000000..f09309fe04db --- /dev/null +++ b/tests/modules/services/nix-gc-darwin/basic.nix @@ -0,0 +1,19 @@ +{ ... }: + +{ + nix.gc = { + automatic = true; + frequency = "monthly"; + options = "--delete-older-than 30d"; + }; + + test.stubs.nix = { name = "nix"; }; + + nmt.script = '' + serviceFile=LaunchAgents/org.nix-community.home.nix-gc.plist + + assertFileExists "$serviceFile" + + assertFileContent "$serviceFile" ${./expected-agent.plist} + ''; +} diff --git a/tests/modules/services/nix-gc-darwin/default.nix b/tests/modules/services/nix-gc-darwin/default.nix new file mode 100644 index 000000000000..f2fc20aa72f2 --- /dev/null +++ b/tests/modules/services/nix-gc-darwin/default.nix @@ -0,0 +1 @@ +{ nix-gc = ./basic.nix; } diff --git a/tests/modules/services/nix-gc-darwin/expected-agent.plist b/tests/modules/services/nix-gc-darwin/expected-agent.plist new file mode 100644 index 000000000000..13b16c16a06b --- /dev/null +++ b/tests/modules/services/nix-gc-darwin/expected-agent.plist @@ -0,0 +1,24 @@ + + + + + Label + org.nix-community.home.nix-gc + ProgramArguments + + @nix@/bin/nix-collect-garbage + --delete-older-than 30d + + StartCalendarInterval + + + Day + 1 + Hour + 0 + Minute + 0 + + + + \ No newline at end of file diff --git a/tests/modules/services/nix-gc/basic.nix b/tests/modules/services/nix-gc/basic.nix new file mode 100644 index 000000000000..d6511a171a40 --- /dev/null +++ b/tests/modules/services/nix-gc/basic.nix @@ -0,0 +1,29 @@ +{ ... }: + +{ + nix.gc = { + automatic = true; + frequency = "monthly"; + options = "--delete-older-than 30d"; + }; + + test.stubs.nix = { name = "nix"; }; + + nmt.script = '' + serviceFile=home-files/.config/systemd/user/nix-gc.service + + assertFileExists $serviceFile + + serviceFile=$(normalizeStorePaths $serviceFile) + + assertFileContent $serviceFile ${./expected.service} + + timerFile=home-files/.config/systemd/user/nix-gc.timer + + assertFileExists $timerFile + + timerFile=$(normalizeStorePaths $timerFile) + + assertFileContent $timerFile ${./expected.timer} + ''; +} diff --git a/tests/modules/services/nix-gc/default.nix b/tests/modules/services/nix-gc/default.nix new file mode 100644 index 000000000000..f2fc20aa72f2 --- /dev/null +++ b/tests/modules/services/nix-gc/default.nix @@ -0,0 +1 @@ +{ nix-gc = ./basic.nix; } diff --git a/tests/modules/services/nix-gc/expected.service b/tests/modules/services/nix-gc/expected.service new file mode 100644 index 000000000000..4aafd6af8272 --- /dev/null +++ b/tests/modules/services/nix-gc/expected.service @@ -0,0 +1,5 @@ +[Service] +ExecStart=@nix@/bin/nix-collect-garbage --delete-older-than 30d + +[Unit] +Description=Nix Garbage Collector diff --git a/tests/modules/services/nix-gc/expected.timer b/tests/modules/services/nix-gc/expected.timer new file mode 100644 index 000000000000..2b0c66031ebf --- /dev/null +++ b/tests/modules/services/nix-gc/expected.timer @@ -0,0 +1,9 @@ +[Install] +WantedBy=timers.target + +[Timer] +OnCalendar=monthly +Unit=nix-gc.service + +[Unit] +Description=Nix Garbage Collector From 3c6f2dd59cb8c0b06ed1fe01f297e75bbaec3003 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Mon, 5 Feb 2024 23:03:40 +0100 Subject: [PATCH 039/636] himalaya: adjust module for v1.0.0-beta --- modules/programs/himalaya.nix | 255 +++++++----------- .../programs/himalaya/basic-expected.toml | 34 +-- tests/modules/programs/himalaya/basic.nix | 2 - tests/modules/programs/himalaya/default.nix | 7 +- .../programs/himalaya/imap-smtp-expected.toml | 35 --- tests/modules/programs/himalaya/imap-smtp.nix | 58 ---- .../himalaya/maildir-sendmail-expected.toml | 16 -- .../programs/himalaya/maildir-sendmail.nix | 35 --- .../himalaya/notmuch-sendmail-expected.toml | 16 -- .../programs/himalaya/notmuch-sendmail.nix | 36 --- 10 files changed, 112 insertions(+), 382 deletions(-) delete mode 100644 tests/modules/programs/himalaya/imap-smtp-expected.toml delete mode 100644 tests/modules/programs/himalaya/imap-smtp.nix delete mode 100644 tests/modules/programs/himalaya/maildir-sendmail-expected.toml delete mode 100644 tests/modules/programs/himalaya/maildir-sendmail.nix delete mode 100644 tests/modules/programs/himalaya/notmuch-sendmail-expected.toml delete mode 100644 tests/modules/programs/himalaya/notmuch-sendmail.nix diff --git a/modules/programs/himalaya.nix b/modules/programs/himalaya.nix index 9b5a1e398428..a05782b0d723 100644 --- a/modules/programs/himalaya.nix +++ b/modules/programs/himalaya.nix @@ -8,14 +8,24 @@ let # attrs util that removes entries containing a null value compactAttrs = lib.filterAttrs (_: val: !isNull val); - # Needed for notmuch config, because the DB is here, and not in each account's dir + # needed for notmuch config, because the DB is here, and not in each + # account's dir maildirBasePath = config.accounts.email.maildirBasePath; - # make a himalaya config from a home-manager email account config + # make encryption config based on the given home-manager email + # account TLS config + mkEncryptionConfig = tls: + if tls.useStartTls then + "start-tls" + else if tls.enable then + "tls" + else + "none"; + + # make a himalaya account config based on the given home-manager + # email account config mkAccountConfig = _: account: let - # Use notmuch if it's enabled, otherwise fallback to IMAP then maildir - # Maildir is always set, so there's no easy way to detect if it's being used notmuchEnabled = account.notmuch.enable; imapEnabled = !isNull account.imap && !notmuchEnabled; maildirEnabled = !isNull account.maildir && !imapEnabled @@ -25,7 +35,7 @@ let email = account.address; display-name = account.realName; default = account.primary; - folder-aliases = { + folder.alias = { inbox = account.folders.inbox; sent = account.folders.sent; drafts = account.folders.drafts; @@ -43,202 +53,107 @@ let imapConfig = lib.optionalAttrs imapEnabled (compactAttrs { backend = "imap"; - imap-host = account.imap.host; - imap-port = account.imap.port; - imap-ssl = account.imap.tls.enable; - imap-starttls = account.imap.tls.useStartTls; - imap-login = account.userName; - imap-auth = "passwd"; - imap-passwd.cmd = builtins.concatStringsSep " " account.passwordCommand; + imap.host = account.imap.host; + imap.port = account.imap.port; + imap.encryption = mkEncryptionConfig account.imap.tls; + imap.login = account.userName; + imap.passwd.cmd = builtins.concatStringsSep " " account.passwordCommand; }); maildirConfig = lib.optionalAttrs maildirEnabled (compactAttrs { backend = "maildir"; - maildir-root-dir = account.maildir.absPath; + maildir.root-dir = account.maildir.absPath; }); notmuchConfig = lib.optionalAttrs notmuchEnabled (compactAttrs { backend = "notmuch"; - notmuch-db-path = maildirBasePath; + notmuch.database-path = maildirBasePath; }); smtpConfig = lib.optionalAttrs (!isNull account.smtp) (compactAttrs { - sender = "smtp"; - smtp-host = account.smtp.host; - smtp-port = account.smtp.port; - smtp-ssl = account.smtp.tls.enable; - smtp-starttls = account.smtp.tls.useStartTls; - smtp-login = account.userName; - smtp-auth = "passwd"; - smtp-passwd.cmd = builtins.concatStringsSep " " account.passwordCommand; + message.send.backend = "smtp"; + smtp.host = account.smtp.host; + smtp.port = account.smtp.port; + smtp.encryption = mkEncryptionConfig account.smtp.tls; + smtp.login = account.userName; + smtp.passwd.cmd = builtins.concatStringsSep " " account.passwordCommand; }); sendmailConfig = lib.optionalAttrs (isNull account.smtp && !isNull account.msmtp) { sender = "sendmail"; - sendmail-cmd = "${pkgs.msmtp}/bin/msmtp"; + sendmail.cmd = "${pkgs.msmtp}/bin/msmtp"; }; - config = globalConfig // signatureConfig // imapConfig // maildirConfig - // notmuchConfig // smtpConfig // sendmailConfig; + config = lib.attrsets.mergeAttrsList [ + globalConfig + signatureConfig + imapConfig + maildirConfig + notmuchConfig + smtpConfig + sendmailConfig + ]; in lib.recursiveUpdate config account.himalaya.settings; - # make a systemd service config from a name and a description - mkServiceConfig = name: desc: - let - inherit (config.services."himalaya-${name}") enable environment settings; - optionalArg = key: - if (key ? settings && !isNull settings."${key}") then - [ "--${key} ${settings."${key}"}" ] - else - [ ]; - in { - "himalaya-${name}" = lib.mkIf enable { - Unit = { - Description = desc; - After = [ "network.target" ]; - }; - Install = { WantedBy = [ "default.target" ]; }; - Service = { - ExecStart = lib.concatStringsSep " " - ([ "${himalaya.package}/bin/himalaya" ] ++ optionalArg "account" - ++ [ name ] ++ optionalArg "keepalive"); - ExecSearchPath = "/bin"; - Environment = - lib.mapAttrsToList (key: val: "${key}=${val}") environment; - Restart = "always"; - RestartSec = 10; - }; - }; - }; - in { meta.maintainers = with lib.hm.maintainers; [ soywod toastal ]; options = { programs.himalaya = { - enable = lib.mkEnableOption "the Himalaya email client"; + enable = lib.mkEnableOption "the email client Himalaya CLI"; package = lib.mkPackageOption pkgs "himalaya" { }; settings = lib.mkOption { type = lib.types.submodule { freeformType = tomlFormat.type; }; default = { }; description = '' - Himalaya global configuration. - See for supported values. + Himalaya CLI global configuration. + See for supported values. ''; }; }; - services = { - himalaya-notify = { - enable = lib.mkEnableOption "the Himalaya new emails notifier service"; - - environment = lib.mkOption { - type = with lib.types; attrsOf str; - default = { }; - example = lib.literalExpression '' - { - "PASSWORD_STORE_DIR" = "~/.password-store"; - } - ''; - description = '' - Extra environment variables to be exported in the service. - ''; - }; - - settings = { - account = lib.mkOption { - type = with lib.types; nullOr str; - default = null; - example = "gmail"; - description = '' - Name of the account the notifier should be started for. If - no account is given, the default one is used. - ''; - }; + services.himalaya-watch = { + enable = lib.mkEnableOption + "the email client Himalaya CLI envelopes watcher service"; - keepalive = lib.mkOption { - type = with lib.types; nullOr int; - default = null; - example = "500"; - description = '' - Notifier lifetime of the IDLE session (in seconds). - ''; - }; - }; + environment = lib.mkOption { + type = with lib.types; attrsOf str; + default = { }; + example = lib.literalExpression '' + { + "PASSWORD_STORE_DIR" = "~/.password-store"; + } + ''; + description = '' + Extra environment variables to be exported in the service. + ''; }; - himalaya-watch = { - enable = - lib.mkEnableOption "the Himalaya folder changes watcher service"; - - environment = lib.mkOption { - type = with lib.types; attrsOf str; - default = { }; - example = lib.literalExpression '' - { - "PASSWORD_STORE_DIR" = "~/.password-store"; - } - ''; - description = '' - Extra environment variables to be exported in the service. - ''; - }; - - settings = { - account = lib.mkOption { - type = with lib.types; nullOr str; - default = null; - example = "gmail"; - description = '' - Name of the account the watcher should be started for. If - no account is given, the default one is used. - ''; - }; - - keepalive = lib.mkOption { - type = with lib.types; nullOr int; - default = null; - example = "500"; - description = '' - Watcher lifetime of the IDLE session (in seconds). - ''; - }; - }; + settings.account = lib.mkOption { + type = with lib.types; nullOr str; + default = null; + example = "personal"; + description = '' + Name of the account the watcher should be started for. + If no account is given, the default one is used. + ''; }; }; accounts.email.accounts = lib.mkOption { type = lib.types.attrsOf (lib.types.submodule { options.himalaya = { - enable = lib.mkEnableOption "Himalaya for this email account"; - - # TODO: remove me for the next release - backend = lib.mkOption { - type = with lib.types; nullOr str; - default = null; - description = '' - Specifying {option}`accounts.email.accounts.*.himalaya.backend` is deprecated, - set {option}`accounts.email.accounts.*.himalaya.settings.backend` instead. - ''; - }; - - # TODO: remove me for the next release - sender = lib.mkOption { - type = with lib.types; nullOr str; - description = '' - Specifying {option}`accounts.email.accounts.*.himalaya.sender` is deprecated, - set {option}'accounts.email.accounts.*.himalaya.settings.sender' instead. - ''; - }; + enable = lib.mkEnableOption + "the email client Himalaya CLI for this email account"; settings = lib.mkOption { type = lib.types.submodule { freeformType = tomlFormat.type; }; default = { }; description = '' - Himalaya configuration for this email account. - See for supported values. + Himalaya CLI configuration for this email account. + See for supported values. ''; }; }; @@ -256,15 +171,31 @@ in { globalConfig = compactAttrs himalaya.settings; allConfig = globalConfig // accountsConfig; in tomlFormat.generate "himalaya-config.toml" allConfig; - - systemd.user.services = { } - // mkServiceConfig "notify" "Himalaya new emails notifier service" - // mkServiceConfig "watch" "Himalaya folder changes watcher service"; - - # TODO: remove me for the next release - warnings = (lib.optional ("backend" ? himalaya && !isNull himalaya.backend) - "Specifying 'accounts.email.accounts.*.himalaya.backend' is deprecated, set 'accounts.email.accounts.*.himalaya.settings.backend' instead") - ++ (lib.optional ("sender" ? himalaya && !isNull himalaya.sender) - "Specifying 'accounts.email.accounts.*.himalaya.sender' is deprecated, set 'accounts.email.accounts.*.himalaya.settings.sender' instead."); + systemd.user.services = let + inherit (config.services.himalaya-watch) enable environment settings; + optionalArg = key: + if (key ? settings && !isNull settings."${key}") then + [ "--${key} ${settings."${key}"}" ] + else + [ ]; + in { + himalaya-watch = lib.mkIf enable { + Unit = { + Description = "Email client Himalaya CLI envelopes watcher service"; + After = [ "network.target" ]; + }; + Install = { WantedBy = [ "default.target" ]; }; + Service = { + ExecStart = lib.concatStringsSep " " + ([ "${himalaya.package}/bin/himalaya" "envelopes" "watch" ] + ++ optionalArg "account"); + ExecSearchPath = "/bin"; + Environment = + lib.mapAttrsToList (key: val: "${key}=${val}") environment; + Restart = "always"; + RestartSec = 10; + }; + }; + }; }; } diff --git a/tests/modules/programs/himalaya/basic-expected.toml b/tests/modules/programs/himalaya/basic-expected.toml index 2df6b85fac65..55906e15c6c0 100644 --- a/tests/modules/programs/himalaya/basic-expected.toml +++ b/tests/modules/programs/himalaya/basic-expected.toml @@ -3,28 +3,30 @@ backend = "imap" default = true display-name = "H. M. Test" email = "hm@example.com" -imap-auth = "passwd" -imap-host = "imap.example.com" -imap-login = "home.manager" -imap-port = 993 -imap-ssl = true -imap-starttls = false -sender = "smtp" -smtp-auth = "passwd" -smtp-host = "smtp.example.com" -smtp-login = "home.manager" -smtp-port = 465 -smtp-ssl = true -smtp-starttls = false -["hm@example.com".folder-aliases] +["hm@example.com".folder.alias] drafts = "Drafts" inbox = "Inbox" sent = "Sent" trash = "Trash" -["hm@example.com".imap-passwd] +["hm@example.com".imap] +encryption = "tls" +host = "imap.example.com" +login = "home.manager" +port = 993 + +["hm@example.com".imap.passwd] cmd = "password-command" -["hm@example.com".smtp-passwd] +["hm@example.com".message.send] +backend = "smtp" + +["hm@example.com".smtp] +encryption = "tls" +host = "smtp.example.com" +login = "home.manager" +port = 465 + +["hm@example.com".smtp.passwd] cmd = "password-command" diff --git a/tests/modules/programs/himalaya/basic.nix b/tests/modules/programs/himalaya/basic.nix index 1555d1e95b99..f31a8464c450 100644 --- a/tests/modules/programs/himalaya/basic.nix +++ b/tests/modules/programs/himalaya/basic.nix @@ -10,8 +10,6 @@ with lib; imap.port = 993; smtp.port = 465; himalaya.enable = true; - himalaya.backend = test.asserts.warnings.expected; - himalaya.sender = test.asserts.warnings.expected; }; }; diff --git a/tests/modules/programs/himalaya/default.nix b/tests/modules/programs/himalaya/default.nix index b357361e2078..1cc0870520f2 100644 --- a/tests/modules/programs/himalaya/default.nix +++ b/tests/modules/programs/himalaya/default.nix @@ -1,6 +1 @@ -{ - himalaya-basic = ./basic.nix; - himalaya-imap-smtp = ./imap-smtp.nix; - himalaya-maildir-sendmail = ./maildir-sendmail.nix; - himalaya-notmuch-sendmail = ./notmuch-sendmail.nix; -} +{ himalaya-basic = ./basic.nix; } diff --git a/tests/modules/programs/himalaya/imap-smtp-expected.toml b/tests/modules/programs/himalaya/imap-smtp-expected.toml deleted file mode 100644 index 6db2542df542..000000000000 --- a/tests/modules/programs/himalaya/imap-smtp-expected.toml +++ /dev/null @@ -1,35 +0,0 @@ -email-listing-page-size = 40 - -["hm@example.com"] -backend = "imap" -default = true -display-name = "H. M. Test" -email = "hm@example.com" -email-listing-page-size = 50 -folder-listing-page-size = 50 -imap-auth = "passwd" -imap-host = "imap.example.com" -imap-login = "home.manager" -imap-port = 143 -imap-ssl = false -imap-starttls = false -sender = "smtp" -smtp-auth = "passwd" -smtp-host = "smtp.example.com" -smtp-login = "home.manager" -smtp-port = 465 -smtp-ssl = true -smtp-starttls = true - -["hm@example.com".folder-aliases] -custom = "Custom" -drafts = "D" -inbox = "In2" -sent = "Out" -trash = "Trash" - -["hm@example.com".imap-passwd] -cmd = "password-command" - -["hm@example.com".smtp-passwd] -cmd = "password-command" diff --git a/tests/modules/programs/himalaya/imap-smtp.nix b/tests/modules/programs/himalaya/imap-smtp.nix deleted file mode 100644 index c1347d23c47c..000000000000 --- a/tests/modules/programs/himalaya/imap-smtp.nix +++ /dev/null @@ -1,58 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -{ - accounts.email.accounts = { - "hm@example.com" = { - primary = true; - address = "hm@example.com"; - userName = "home.manager"; - realName = "H. M. Test"; - passwordCommand = "password-command"; - imap = { - host = "imap.example.com"; - port = 143; - tls = { enable = false; }; - }; - smtp = { - host = "smtp.example.com"; - port = 465; - tls = { - enable = true; - useStartTls = true; - }; - }; - folders = { - inbox = "In"; - sent = "Out"; - drafts = "D"; - }; - himalaya = { - enable = true; - settings = { - folder-listing-page-size = 50; - email-listing-page-size = 50; - folder-aliases = { - inbox = "In2"; - custom = "Custom"; - }; - }; - }; - }; - }; - - programs.himalaya = { - enable = true; - settings = { email-listing-page-size = 40; }; - }; - - test.stubs.himalaya = { }; - - nmt.script = '' - assertFileExists home-files/.config/himalaya/config.toml - assertFileContent home-files/.config/himalaya/config.toml ${ - ./imap-smtp-expected.toml - } - ''; -} diff --git a/tests/modules/programs/himalaya/maildir-sendmail-expected.toml b/tests/modules/programs/himalaya/maildir-sendmail-expected.toml deleted file mode 100644 index 61ae940ded38..000000000000 --- a/tests/modules/programs/himalaya/maildir-sendmail-expected.toml +++ /dev/null @@ -1,16 +0,0 @@ -email-listing-page-size = 50 - -["hm@example.com"] -backend = "maildir" -default = true -display-name = "H. M. Test" -email = "hm@example.com" -maildir-root-dir = "/home/hm-user/Maildir/hm@example.com" -sender = "sendmail" -sendmail-cmd = "msmtp" - -["hm@example.com".folder-aliases] -drafts = "Drafts" -inbox = "Inbox" -sent = "Sent" -trash = "Deleted" diff --git a/tests/modules/programs/himalaya/maildir-sendmail.nix b/tests/modules/programs/himalaya/maildir-sendmail.nix deleted file mode 100644 index d40f39ba866d..000000000000 --- a/tests/modules/programs/himalaya/maildir-sendmail.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -{ - accounts.email.accounts = { - "hm@example.com" = { - primary = true; - address = "hm@example.com"; - userName = "home.manager"; - realName = "H. M. Test"; - passwordCommand = "password-command"; - folders = { trash = "Deleted"; }; - msmtp.enable = true; - himalaya = { - enable = true; - settings = { sendmail-cmd = "msmtp"; }; - }; - }; - }; - - programs.himalaya = { - enable = true; - settings = { email-listing-page-size = 50; }; - }; - - test.stubs.himalaya = { }; - - nmt.script = '' - assertFileExists home-files/.config/himalaya/config.toml - assertFileContent home-files/.config/himalaya/config.toml ${ - ./maildir-sendmail-expected.toml - } - ''; -} diff --git a/tests/modules/programs/himalaya/notmuch-sendmail-expected.toml b/tests/modules/programs/himalaya/notmuch-sendmail-expected.toml deleted file mode 100644 index fcc00c7c8e4a..000000000000 --- a/tests/modules/programs/himalaya/notmuch-sendmail-expected.toml +++ /dev/null @@ -1,16 +0,0 @@ -email-listing-page-size = 50 - -["hm@example.com"] -backend = "notmuch" -default = true -display-name = "H. M. Test" -email = "hm@example.com" -notmuch-db-path = "/home/hm-user/Maildir" -sender = "sendmail" -sendmail-cmd = "msmtp" - -["hm@example.com".folder-aliases] -drafts = "Drafts" -inbox = "Inbox" -sent = "Sent" -trash = "Deleted" diff --git a/tests/modules/programs/himalaya/notmuch-sendmail.nix b/tests/modules/programs/himalaya/notmuch-sendmail.nix deleted file mode 100644 index ff96dfd1f2ed..000000000000 --- a/tests/modules/programs/himalaya/notmuch-sendmail.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; - -{ - accounts.email.accounts = { - "hm@example.com" = { - primary = true; - address = "hm@example.com"; - userName = "home.manager"; - realName = "H. M. Test"; - passwordCommand = "password-command"; - folders = { trash = "Deleted"; }; - notmuch.enable = true; - msmtp.enable = true; - himalaya = { - enable = true; - settings = { sendmail-cmd = "msmtp"; }; - }; - }; - }; - - programs.himalaya = { - enable = true; - settings = { email-listing-page-size = 50; }; - }; - - test.stubs.himalaya = { }; - - nmt.script = '' - assertFileExists home-files/.config/himalaya/config.toml - assertFileContent home-files/.config/himalaya/config.toml ${ - ./notmuch-sendmail-expected.toml - } - ''; -} From b319781e304c668da0ef144b1b4ee48977d4877d Mon Sep 17 00:00:00 2001 From: Scott Stevenson Date: Mon, 5 Feb 2024 22:22:43 +0000 Subject: [PATCH 040/636] home-manager: Check VISUAL before EDITOR for editor Check VISUAL for a visual editor before EDITOR, as per Unix convention and as followed by Git, crontab, mutt, and other tools. --- docs/home-manager.1 | 2 +- home-manager/home-manager | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/home-manager.1 b/docs/home-manager.1 index 1747735e1155..41406aca0f47 100644 --- a/docs/home-manager.1 +++ b/docs/home-manager.1 @@ -97,7 +97,7 @@ Instantiate the configuration and print the resulting derivation\&. .It Cm edit .RS 16 -Open the home configuration using the editor indicated by \fBEDITOR\fR\&. +Open the home configuration using the editor indicated by \fBVISUAL\fR or \fBEDITOR\fR\&. .RE .Pp diff --git a/home-manager/home-manager b/home-manager/home-manager index eb69530a8627..ba3b8d98e0ba 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -565,10 +565,14 @@ function presentNews() { } function doEdit() { - if [[ ! -v EDITOR || -z $EDITOR ]]; then - # shellcheck disable=2016 - _i 'Please set the $EDITOR environment variable' >&2 - return 1 + if [[ ! -v VISUAL || -z $VISUAL ]]; then + if [[ ! -v EDITOR || -z $EDITOR ]]; then + # shellcheck disable=2016 + _i 'Please set the $EDITOR or $VISUAL environment variable' >&2 + return 1 + fi + else + EDITOR=$VISUAL fi setConfigFile @@ -881,7 +885,7 @@ function doHelp() { echo echo " help Print this help" echo - echo " edit Open the home configuration in \$EDITOR" + echo " edit Open the home configuration in \$VISUAL or \$EDITOR" echo echo " option OPTION.NAME" echo " Inspect configuration option named OPTION.NAME." From 13dbf2623d6465d5c4db54ce8a5a630dce79c3e9 Mon Sep 17 00:00:00 2001 From: Anton Date: Tue, 6 Feb 2024 00:31:53 +0200 Subject: [PATCH 041/636] swayosd: update executable --- modules/services/swayosd.nix | 25 ++++++++++++++++------ tests/modules/services/swayosd/swayosd.nix | 5 +++-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/modules/services/swayosd.nix b/modules/services/swayosd.nix index 067c104c310f..51e7eb6dd91f 100644 --- a/modules/services/swayosd.nix +++ b/modules/services/swayosd.nix @@ -16,12 +16,22 @@ in { package = mkPackageOption pkgs "swayosd" { }; - maxVolume = mkOption { - type = types.nullOr types.ints.unsigned; + topMargin = mkOption { + type = types.nullOr (types.addCheck types.float (f: f >= 0.0 && f <= 1.0) + // { + description = "float between 0.0 and 1.0 (inclusive)"; + }); default = null; - example = 120; + example = 1.0; + description = "OSD margin from top edge (0.5 would be screen center)."; + }; + + display = mkOption { + type = types.nullOr types.str; + default = null; + example = "eDP-1"; description = '' - Sets the maximum volume. + X display to use. ''; }; }; @@ -45,9 +55,10 @@ in { Service = { Type = "simple"; - ExecStart = "${cfg.package}/bin/swayosd" - + (optionalString (cfg.maxVolume != null) - " --max-volume ${toString cfg.maxVolume}"); + ExecStart = "${cfg.package}/bin/swayosd-server" + + (optionalString (cfg.display != null) " --display ${cfg.display}") + + (optionalString (cfg.topMargin != null) + " --top-margin ${toString cfg.topMargin}"); Restart = "always"; }; diff --git a/tests/modules/services/swayosd/swayosd.nix b/tests/modules/services/swayosd/swayosd.nix index b371d86ad692..ba92d81fa4e2 100644 --- a/tests/modules/services/swayosd/swayosd.nix +++ b/tests/modules/services/swayosd/swayosd.nix @@ -7,7 +7,8 @@ name = "swayosd"; outPath = "@swayosd@"; }; - maxVolume = 10; + display = "DISPLAY"; + topMargin = 0.1; }; nmt.script = '' @@ -19,7 +20,7 @@ WantedBy=graphical-session.target [Service] - ExecStart=@swayosd@/bin/swayosd --max-volume 10 + ExecStart=@swayosd@/bin/swayosd-server --display DISPLAY --top-margin 0.100000 Restart=always Type=simple From 7b4ea8d82fdeaa71ab942a8a8f6f8add8afdfad0 Mon Sep 17 00:00:00 2001 From: NotAShelf Date: Sat, 27 Jan 2024 13:05:49 +0300 Subject: [PATCH 042/636] arrpc: add module --- modules/misc/news.nix | 6 ++++++ modules/modules.nix | 1 + modules/services/arrpc.nix | 39 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 modules/services/arrpc.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index a5f6975ab7f7..5d4c99217729 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1401,6 +1401,12 @@ in { ''; } + { + time = "2024-02-05T22:33:54+00:00"; + message = '' + A new module is available: 'services.arrpc' + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index d798147ef9be..a75037c0f2fb 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -251,6 +251,7 @@ let ./programs/zsh.nix ./programs/zsh/prezto.nix ./programs/zsh/zsh-abbr.nix + ./services/arrpc.nix ./services/autorandr.nix ./services/avizo.nix ./services/barrier.nix diff --git a/modules/services/arrpc.nix b/modules/services/arrpc.nix new file mode 100644 index 000000000000..ec003257bbf9 --- /dev/null +++ b/modules/services/arrpc.nix @@ -0,0 +1,39 @@ +{ config, pkgs, lib, ... }: +let + inherit (lib) mkIf mkOption mkPackageOption mkEnableOption types; + + cfg = config.services.arrpc; +in { + meta.maintainers = [ lib.maintainers.NotAShelf ]; + + options.services.arrpc = { + enable = mkEnableOption "arrpc"; + package = mkPackageOption pkgs "arrpc" { }; + + systemdTarget = mkOption { + type = types.str; + default = "graphical-session.target"; + example = "sway-session.target"; + description = '' + Systemd target to bind to. + ''; + }; + }; + + config = mkIf cfg.enable { + systemd.user.services.arRPC = { + Unit = { + Description = + "Discord Rich Presence for browsers, and some custom clients"; + PartOf = [ "graphical-session.target" ]; + }; + + Service = { + ExecStart = lib.getExe cfg.package; + Restart = "always"; + }; + + Install.WantedBy = [ cfg.systemdTarget ]; + }; + }; +} From f65dcd6c15db0fc2045d56ef8fdf4a03aa52e81f Mon Sep 17 00:00:00 2001 From: arjan-s Date: Mon, 5 Feb 2024 23:42:06 +0100 Subject: [PATCH 043/636] neomutt: fix crypt_use_gpgme in newer versions Fixes config load error since newer versions of neomutt don't allow `crypt_use_gpgme` to be loaded dynamically (from folder hooks) --- modules/programs/neomutt.nix | 2 +- tests/modules/programs/neomutt/hm-example.com-expected | 1 - tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf | 1 - .../modules/programs/neomutt/hm-example.com-msmtp-expected.conf | 1 - .../neomutt/hm-example.com-no-folder-change-expected.conf | 1 - .../programs/neomutt/hm-example.com-signature-command-expected | 1 - .../modules/programs/neomutt/hm-example.com-signature-expected | 1 - tests/modules/programs/neomutt/hm-example.com-starttls-expected | 1 - tests/modules/programs/neomutt/neomutt-expected.conf | 1 + .../modules/programs/neomutt/neomutt-not-primary-expected.conf | 1 + tests/modules/programs/neomutt/neomutt-with-binds-expected.conf | 1 + .../programs/neomutt/neomutt-with-named-mailboxes-expected.conf | 1 + 12 files changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/programs/neomutt.nix b/modules/programs/neomutt.nix index 968036f27efc..fa9c2624ae2f 100644 --- a/modules/programs/neomutt.nix +++ b/modules/programs/neomutt.nix @@ -224,7 +224,6 @@ let set certificate_file=${toString config.accounts.email.certificatesFile} # GPG section - set crypt_use_gpgme = yes set crypt_autosign = ${lib.hm.booleans.yesNo (gpg.signByDefault or false)} set crypt_opportunistic_encrypt = ${ lib.hm.booleans.yesNo (gpg.encryptByDefault or false) @@ -351,6 +350,7 @@ in { set message_cachedir = "${config.xdg.cacheHome}/neomutt/messages/" set editor = "${cfg.editor}" set implicit_autoview = yes + set crypt_use_gpgme = yes alternative_order text/enriched text/plain text diff --git a/tests/modules/programs/neomutt/hm-example.com-expected b/tests/modules/programs/neomutt/hm-example.com-expected index 51fdcc6ec7bf..e31f0d01acd2 100644 --- a/tests/modules/programs/neomutt/hm-example.com-expected +++ b/tests/modules/programs/neomutt/hm-example.com-expected @@ -3,7 +3,6 @@ set ssl_force_tls = yes set certificate_file=/etc/ssl/certs/ca-certificates.crt # GPG section -set crypt_use_gpgme = yes set crypt_autosign = no set crypt_opportunistic_encrypt = no set pgp_use_gpg_agent = yes diff --git a/tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf b/tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf index 576064243dcc..f377107192d3 100644 --- a/tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf +++ b/tests/modules/programs/neomutt/hm-example.com-gpg-expected.conf @@ -3,7 +3,6 @@ set ssl_force_tls = yes set certificate_file=/etc/ssl/certs/ca-certificates.crt # GPG section -set crypt_use_gpgme = yes set crypt_autosign = yes set crypt_opportunistic_encrypt = yes set pgp_use_gpg_agent = yes diff --git a/tests/modules/programs/neomutt/hm-example.com-msmtp-expected.conf b/tests/modules/programs/neomutt/hm-example.com-msmtp-expected.conf index 354cc43ee69f..6d4a845d0107 100644 --- a/tests/modules/programs/neomutt/hm-example.com-msmtp-expected.conf +++ b/tests/modules/programs/neomutt/hm-example.com-msmtp-expected.conf @@ -3,7 +3,6 @@ set ssl_force_tls = yes set certificate_file=/etc/ssl/certs/ca-certificates.crt # GPG section -set crypt_use_gpgme = yes set crypt_autosign = no set crypt_opportunistic_encrypt = no set pgp_use_gpg_agent = yes diff --git a/tests/modules/programs/neomutt/hm-example.com-no-folder-change-expected.conf b/tests/modules/programs/neomutt/hm-example.com-no-folder-change-expected.conf index e5dee06168b7..44def8ae7bd6 100644 --- a/tests/modules/programs/neomutt/hm-example.com-no-folder-change-expected.conf +++ b/tests/modules/programs/neomutt/hm-example.com-no-folder-change-expected.conf @@ -3,7 +3,6 @@ set ssl_force_tls = yes set certificate_file=/etc/ssl/certs/ca-certificates.crt # GPG section -set crypt_use_gpgme = yes set crypt_autosign = no set crypt_opportunistic_encrypt = no set pgp_use_gpg_agent = yes diff --git a/tests/modules/programs/neomutt/hm-example.com-signature-command-expected b/tests/modules/programs/neomutt/hm-example.com-signature-command-expected index c3b350670475..57825af4ebfa 100644 --- a/tests/modules/programs/neomutt/hm-example.com-signature-command-expected +++ b/tests/modules/programs/neomutt/hm-example.com-signature-command-expected @@ -3,7 +3,6 @@ set ssl_force_tls = yes set certificate_file=/etc/ssl/certs/ca-certificates.crt # GPG section -set crypt_use_gpgme = yes set crypt_autosign = no set crypt_opportunistic_encrypt = no set pgp_use_gpg_agent = yes diff --git a/tests/modules/programs/neomutt/hm-example.com-signature-expected b/tests/modules/programs/neomutt/hm-example.com-signature-expected index 66e941c1802d..c17314ed5255 100644 --- a/tests/modules/programs/neomutt/hm-example.com-signature-expected +++ b/tests/modules/programs/neomutt/hm-example.com-signature-expected @@ -3,7 +3,6 @@ set ssl_force_tls = yes set certificate_file=/etc/ssl/certs/ca-certificates.crt # GPG section -set crypt_use_gpgme = yes set crypt_autosign = no set crypt_opportunistic_encrypt = no set pgp_use_gpg_agent = yes diff --git a/tests/modules/programs/neomutt/hm-example.com-starttls-expected b/tests/modules/programs/neomutt/hm-example.com-starttls-expected index 1e5b15cac479..59aa3d1cdd54 100644 --- a/tests/modules/programs/neomutt/hm-example.com-starttls-expected +++ b/tests/modules/programs/neomutt/hm-example.com-starttls-expected @@ -3,7 +3,6 @@ set ssl_force_tls = yes set certificate_file=/etc/ssl/certs/ca-certificates.crt # GPG section -set crypt_use_gpgme = yes set crypt_autosign = no set crypt_opportunistic_encrypt = no set pgp_use_gpg_agent = yes diff --git a/tests/modules/programs/neomutt/neomutt-expected.conf b/tests/modules/programs/neomutt/neomutt-expected.conf index 7c0e5d28a819..94c13b29871d 100644 --- a/tests/modules/programs/neomutt/neomutt-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-expected.conf @@ -3,6 +3,7 @@ set header_cache = "/home/hm-user/.cache/neomutt/headers/" set message_cachedir = "/home/hm-user/.cache/neomutt/messages/" set editor = "$EDITOR" set implicit_autoview = yes +set crypt_use_gpgme = yes alternative_order text/enriched text/plain text diff --git a/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf b/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf index 4a583a02d66e..cffdace6f0fb 100644 --- a/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf @@ -3,6 +3,7 @@ set header_cache = "/home/hm-user/.cache/neomutt/headers/" set message_cachedir = "/home/hm-user/.cache/neomutt/messages/" set editor = "$EDITOR" set implicit_autoview = yes +set crypt_use_gpgme = yes alternative_order text/enriched text/plain text diff --git a/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf b/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf index 8b4bb7bce295..64ea68909d7d 100644 --- a/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf @@ -3,6 +3,7 @@ set header_cache = "/home/hm-user/.cache/neomutt/headers/" set message_cachedir = "/home/hm-user/.cache/neomutt/messages/" set editor = "$EDITOR" set implicit_autoview = yes +set crypt_use_gpgme = yes alternative_order text/enriched text/plain text diff --git a/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf b/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf index e58660fc7652..a166b355318c 100644 --- a/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf @@ -3,6 +3,7 @@ set header_cache = "/home/hm-user/.cache/neomutt/headers/" set message_cachedir = "/home/hm-user/.cache/neomutt/messages/" set editor = "$EDITOR" set implicit_autoview = yes +set crypt_use_gpgme = yes alternative_order text/enriched text/plain text From f99eace7c167b8a6a0871849493b1c613d0f1b80 Mon Sep 17 00:00:00 2001 From: GenericNerdyUsername Date: Mon, 5 Feb 2024 23:29:23 +0000 Subject: [PATCH 044/636] jetbrains-remote: add module --- modules/lib/maintainers.nix | 5 ++++ modules/misc/news.nix | 7 +++++ modules/modules.nix | 1 + modules/programs/jetbrains-remote.nix | 38 +++++++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 modules/programs/jetbrains-remote.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index f45068430b9b..f3cb327669d1 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -223,6 +223,11 @@ githubId = 33058747; name = "Gaetan Lepage"; }; + genericnerdyusername = { + email = "genericnerdyusername@proton.me"; + github = "genericnerdyusername"; + githubId = 111183546; + }; maximsmol = { email = "maximsmol@gmail.com"; github = "maximsmol"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 5d4c99217729..0b19711afd36 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1407,6 +1407,13 @@ in { A new module is available: 'services.arrpc' ''; } + + { + time = "2024-02-05T22:45:37+00:00"; + message = '' + A new module is available: 'programs.jetbrains-remote' + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index a75037c0f2fb..f8146efac8dc 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -120,6 +120,7 @@ let ./programs/ion.nix ./programs/irssi.nix ./programs/java.nix + ./programs/jetbrains-remote.nix ./programs/jq.nix ./programs/jujutsu.nix ./programs/joshuto.nix diff --git a/modules/programs/jetbrains-remote.nix b/modules/programs/jetbrains-remote.nix new file mode 100644 index 000000000000..4a9c045a9c5c --- /dev/null +++ b/modules/programs/jetbrains-remote.nix @@ -0,0 +1,38 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.programs.jetbrains-remote; + +in { + meta.maintainers = with lib.maintainers; [ genericnerdyusername ]; + + options.programs.jetbrains-remote = { + enable = mkEnableOption "JetBrains remote development system"; + + ides = mkOption { + type = types.listOf types.package; + default = [ ]; + example = literalExpression '' + with pkgs.jetbrains; [ clion pycharm-professional ]; + ''; + description = '' + IDEs accessible to the JetBrains remote development system. + ''; + }; + }; + + config = mkIf (cfg.enable && cfg.ides != [ ]) { + home.activation.jetBrainsRemote = let + mkLine = ide: + # Errors out if the symlink already exists + "${ide}/bin/${ide.meta.mainProgram}-remote-dev-server registerBackendLocationForGateway || true"; + lines = map mkLine cfg.ides; + linesStr = '' + rm $HOME/.cache/JetBrains/RemoteDev/userProvidedDist/_nix_store* + '' + concatStringsSep "\n" lines; + in hm.dag.entryAfter [ "writeBoundary" ] linesStr; + }; +} From 5b9156fa9a8b8beba917b8f9adbfd27bf63e16af Mon Sep 17 00:00:00 2001 From: "Alexis (Poliorcetics) Bourget" Date: Wed, 7 Feb 2024 08:45:44 +0100 Subject: [PATCH 045/636] zellij: use full executable path --- modules/programs/zellij.nix | 7 ++++--- tests/modules/programs/zellij/enable-shells.nix | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/modules/programs/zellij.nix b/modules/programs/zellij.nix index 44a3d69f4c3d..0906a028dd64 100644 --- a/modules/programs/zellij.nix +++ b/modules/programs/zellij.nix @@ -6,6 +6,7 @@ let cfg = config.programs.zellij; yamlFormat = pkgs.formats.yaml { }; + zellijCmd = getExe cfg.package; in { meta.maintainers = [ hm.maintainers.mainrs ]; @@ -69,16 +70,16 @@ in { }; programs.bash.initExtra = mkIf cfg.enableBashIntegration (mkOrder 200 '' - eval "$(zellij setup --generate-auto-start bash)" + eval "$(${zellijCmd} setup --generate-auto-start bash)" ''); programs.zsh.initExtra = mkIf cfg.enableZshIntegration (mkOrder 200 '' - eval "$(zellij setup --generate-auto-start zsh)" + eval "$(${zellijCmd} setup --generate-auto-start zsh)" ''); programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration (mkOrder 200 '' - eval (zellij setup --generate-auto-start fish | string collect) + eval (${zellijCmd} setup --generate-auto-start fish | string collect) ''); }; } diff --git a/tests/modules/programs/zellij/enable-shells.nix b/tests/modules/programs/zellij/enable-shells.nix index b8f800939927..c648cf7dd8b1 100644 --- a/tests/modules/programs/zellij/enable-shells.nix +++ b/tests/modules/programs/zellij/enable-shells.nix @@ -26,16 +26,16 @@ assertFileExists home-files/.bashrc assertFileContains \ home-files/.bashrc \ - 'eval "$(zellij setup --generate-auto-start bash)"' + 'eval "$(@zellij@/bin/dummy setup --generate-auto-start bash)"' assertFileExists home-files/.zshrc assertFileContains \ home-files/.zshrc \ - 'eval "$(zellij setup --generate-auto-start zsh)"' + 'eval "$(@zellij@/bin/dummy setup --generate-auto-start zsh)"' assertFileExists home-files/.config/fish/config.fish assertFileContains \ home-files/.config/fish/config.fish \ - 'eval (zellij setup --generate-auto-start fish | string collect)' + 'eval (@zellij@/bin/dummy setup --generate-auto-start fish | string collect)' ''; } From 4c0357ff874f8250fcae621d5626aba1c7161710 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 10 Feb 2024 19:59:52 +0100 Subject: [PATCH 046/636] sway: fix workspace 10 missing from default config (#4636) workspace 10 is part of upstream's default config, but was missing in home-manager. The initial "sway: add module" PR (02d60400035028d4c8affab24557344ca371b9fd) went through multiple iterations and had workspace 10 included for a brief moment. Until the author removed it in a force-push commenting > Have removed the last change which added bound ${modifer}+0 to workspace number 10 as this messed up workspace numbering in sway. The reason might have been, that sway used to sort the workspaces in the order they appeared in the config. Attribute sets in nix are sorted, but not "naturally sorted", meaning `bindsym Mod1+0 workspace number 10` comes before `bindsym Mod1+0 workspace number 1`. It's unclear if that's what really happened. A workaround would have been to use `lib.lists.naturalSort` in `keybindingsStr`. But I cannot reproduce this anymore in any way. I assume this has been fixed many years ago by now. upstream config: https://github.com/swaywm/sway/blob/020a572ed615b8fe272c7566a27ee0abe73a58d7/config.in#L113-L134 --- modules/services/window-managers/i3-sway/sway.nix | 3 +++ .../services/window-managers/sway/sway-bar-focused-colors.conf | 2 ++ .../sway/sway-bindkeys-to-code-and-extra-config.conf | 2 ++ tests/modules/services/window-managers/sway/sway-default.conf | 2 ++ .../window-managers/sway/sway-followmouse-expected.conf | 2 ++ .../window-managers/sway/sway-followmouse-legacy-expected.conf | 2 ++ tests/modules/services/window-managers/sway/sway-modules.conf | 2 ++ .../services/window-managers/sway/sway-null-package.conf | 2 ++ .../modules/services/window-managers/sway/sway-post-2003.conf | 2 ++ .../window-managers/sway/sway-workspace-default-expected.conf | 2 ++ .../window-managers/sway/sway-workspace-output-expected.conf | 2 ++ 11 files changed, 23 insertions(+) diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index 6f8ca84a324b..cc81130269be 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -91,6 +91,7 @@ let "${cfg.config.modifier}+7" = "workspace number 7"; "${cfg.config.modifier}+8" = "workspace number 8"; "${cfg.config.modifier}+9" = "workspace number 9"; + "${cfg.config.modifier}+0" = "workspace number 10"; "${cfg.config.modifier}+Shift+1" = "move container to workspace number 1"; @@ -110,6 +111,8 @@ let "move container to workspace number 8"; "${cfg.config.modifier}+Shift+9" = "move container to workspace number 9"; + "${cfg.config.modifier}+Shift+0" = + "move container to workspace number 10"; "${cfg.config.modifier}+Shift+minus" = "move scratchpad"; "${cfg.config.modifier}+minus" = "scratchpad show"; diff --git a/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf b/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf index 3db8b31a072c..448c41f47f9d 100644 --- a/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf +++ b/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf b/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf index cbf4a8c703fb..d11f6f2bca17 100644 --- a/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf +++ b/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf @@ -18,6 +18,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym --to-code Mod1+0 workspace number 10 bindsym --to-code Mod1+1 workspace number 1 bindsym --to-code Mod1+2 workspace number 2 bindsym --to-code Mod1+3 workspace number 3 @@ -31,6 +32,7 @@ bindsym --to-code Mod1+Down focus down bindsym --to-code Mod1+Left focus left bindsym --to-code Mod1+Return exec @foot@/bin/foot bindsym --to-code Mod1+Right focus right +bindsym --to-code Mod1+Shift+0 move container to workspace number 10 bindsym --to-code Mod1+Shift+1 move container to workspace number 1 bindsym --to-code Mod1+Shift+2 move container to workspace number 2 bindsym --to-code Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-default.conf b/tests/modules/services/window-managers/sway/sway-default.conf index 620e9b3f3520..71a0b13fb52f 100644 --- a/tests/modules/services/window-managers/sway/sway-default.conf +++ b/tests/modules/services/window-managers/sway/sway-default.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf b/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf index a61b6bc2475d..af259face8bb 100644 --- a/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf b/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf index 7a822d872549..1fd0003fc6ea 100644 --- a/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-modules.conf b/tests/modules/services/window-managers/sway/sway-modules.conf index 47c20a939abd..766d61de7f63 100644 --- a/tests/modules/services/window-managers/sway/sway-modules.conf +++ b/tests/modules/services/window-managers/sway/sway-modules.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-null-package.conf b/tests/modules/services/window-managers/sway/sway-null-package.conf index 11ae4a3e3a8a..67073371ff8e 100644 --- a/tests/modules/services/window-managers/sway/sway-null-package.conf +++ b/tests/modules/services/window-managers/sway/sway-null-package.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-post-2003.conf b/tests/modules/services/window-managers/sway/sway-post-2003.conf index 11ae4a3e3a8a..67073371ff8e 100644 --- a/tests/modules/services/window-managers/sway/sway-post-2003.conf +++ b/tests/modules/services/window-managers/sway/sway-post-2003.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf b/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf index 604dc774b1a1..5233c0bb2a7c 100644 --- a/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff bindsym Mod1+9 workspace number 9 +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -28,6 +29,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 diff --git a/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf b/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf index 63435cada30c..32dfd7344d3c 100644 --- a/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf @@ -16,6 +16,7 @@ client.urgent #2f343a #900000 #ffffff #900000 #900000 client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c client.background #ffffff +bindsym Mod1+0 workspace number 10 bindsym Mod1+1 workspace number 1 bindsym Mod1+2 workspace number 2 bindsym Mod1+3 workspace number 3 @@ -29,6 +30,7 @@ bindsym Mod1+Down focus down bindsym Mod1+Left focus left bindsym Mod1+Return exec @foot@/bin/foot bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 bindsym Mod1+Shift+1 move container to workspace number 1 bindsym Mod1+Shift+2 move container to workspace number 2 bindsym Mod1+Shift+3 move container to workspace number 3 From fb0196ad9d18554e035de27d4f2a906ba050b407 Mon Sep 17 00:00:00 2001 From: Rafael Carvalho Date: Sat, 10 Feb 2024 22:01:01 +0000 Subject: [PATCH 047/636] imapnotify: enable STARTTLS if enabled in email account config (#5013) * imapnotify: enable STARTTLS if enabled in email account config Since version 2.3.10 goimapnotify supports starttls. In version 2.3.11 a typo in the settings was fixed, using tlsOptions.starttls to enable it. This commit enables starttls in the goimapnotify config file if it is enabled in the email account's imap settings. * imapnotify: test generated config file Compare the generated service config file with a manually verified sample. --- modules/services/imapnotify.nix | 1 + tests/modules/services/imapnotify/imapnotify-config.json | 1 + tests/modules/services/imapnotify/imapnotify.nix | 5 +++++ 3 files changed, 7 insertions(+) create mode 100644 tests/modules/services/imapnotify/imapnotify-config.json diff --git a/modules/services/imapnotify.nix b/modules/services/imapnotify.nix index a79cba35ec6e..63e61e7c7c72 100644 --- a/modules/services/imapnotify.nix +++ b/modules/services/imapnotify.nix @@ -72,6 +72,7 @@ let inherit (account.imap) host; inherit port; tls = account.imap.tls.enable; + tlsOptions.starttls = account.imap.tls.useStartTls; username = account.userName; passwordCmd = lib.concatMapStringsSep " " lib.escapeShellArg account.passwordCommand; diff --git a/tests/modules/services/imapnotify/imapnotify-config.json b/tests/modules/services/imapnotify/imapnotify-config.json new file mode 100644 index 000000000000..21276857dd87 --- /dev/null +++ b/tests/modules/services/imapnotify/imapnotify-config.json @@ -0,0 +1 @@ +{"boxes":["Inbox"],"host":"imap.example.com","onNewMail":"@notmuch@/bin/notmuch new\n","passwordCmd":"'password-command'","port":993,"tls":true,"tlsOptions":{"starttls":false},"username":"home.manager"} \ No newline at end of file diff --git a/tests/modules/services/imapnotify/imapnotify.nix b/tests/modules/services/imapnotify/imapnotify.nix index c607c042c2d6..5a9e2b0034b8 100644 --- a/tests/modules/services/imapnotify/imapnotify.nix +++ b/tests/modules/services/imapnotify/imapnotify.nix @@ -35,5 +35,10 @@ with lib; serviceFileNormalized="$(normalizeStorePaths "$serviceFile")" assertFileExists $serviceFile assertFileContent $serviceFileNormalized ${./imapnotify.service} + + configFile="home-files/.config/imapnotify/imapnotify-hm-example.com-config.json" + configFileNormalized="$(normalizeStorePaths "$configFile")" + assertFileExists $configFile + assertFileContent $configFileNormalized ${./imapnotify-config.json} ''; } From d1d6ca9b6552fc93032b76661c83061f1cd4e6e8 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sat, 10 Feb 2024 23:45:27 +0100 Subject: [PATCH 048/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/b8b232ae7b8b144397fdb12d20f592e5e7c1a64d' (2024-01-31) → 'github:NixOS/nixpkgs/faf912b086576fd1a15fca610166c98d47bc667e' (2024-02-05) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 7792be21acb1..7a56b826ae72 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1706732774, - "narHash": "sha256-hqJlyJk4MRpcItGYMF+3uHe8HvxNETWvlGtLuVpqLU0=", + "lastModified": 1707092692, + "narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b8b232ae7b8b144397fdb12d20f592e5e7c1a64d", + "rev": "faf912b086576fd1a15fca610166c98d47bc667e", "type": "github" }, "original": { From bfd0ae29a86eff4603098683b516c67e22184511 Mon Sep 17 00:00:00 2001 From: zendo Date: Sun, 11 Feb 2024 07:23:06 +0800 Subject: [PATCH 049/636] emacs: use `overrideScope` instead of `overrideScope'` --- modules/programs/emacs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/emacs.nix b/modules/programs/emacs.nix index 7f573c79fdd8..d63721494d2b 100644 --- a/modules/programs/emacs.nix +++ b/modules/programs/emacs.nix @@ -9,7 +9,7 @@ let # Copied from all-packages.nix, with modifications to support # overrides. emacsPackages = let epkgs = pkgs.emacsPackagesFor cfg.package; - in epkgs.overrideScope' cfg.overrides; + in epkgs.overrideScope cfg.overrides; emacsWithPackages = emacsPackages.emacsWithPackages; From a09cfdbaf11c821340cff24d9ad1c264708ee12e Mon Sep 17 00:00:00 2001 From: Christian Dannie Storgaard Date: Sun, 11 Feb 2024 19:22:37 +0200 Subject: [PATCH 050/636] neomutt: Initial IMAP support (#4597) neomutt: Updated options and added tests neomutt: Added test for individual mailbox type neomutt: Formatted code neomutt: Enable ssl_force_tls based on IMAP instead of SMTP neomutt: Applied suggestions from @chayleaf neomutt: fix breaking tests --- modules/programs/neomutt-accounts.nix | 16 +++ modules/programs/neomutt.nix | 111 +++++++++++++++--- .../neomutt/account-command.sh-expected | 39 ++++++ tests/modules/programs/neomutt/default.nix | 2 + .../neomutt/hm-example.com-imap-expected.conf | 35 ++++++ .../neomutt/neomutt-with-imap-expected.conf | 34 ++++++ ...utt-with-imap-type-mailboxes-expected.conf | 36 ++++++ .../neomutt-with-imap-type-mailboxes.nix | 57 +++++++++ .../programs/neomutt/neomutt-with-imap.nix | 44 +++++++ 9 files changed, 360 insertions(+), 14 deletions(-) create mode 100644 tests/modules/programs/neomutt/account-command.sh-expected create mode 100644 tests/modules/programs/neomutt/hm-example.com-imap-expected.conf create mode 100644 tests/modules/programs/neomutt/neomutt-with-imap-expected.conf create mode 100644 tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf create mode 100644 tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes.nix create mode 100644 tests/modules/programs/neomutt/neomutt-with-imap.nix diff --git a/modules/programs/neomutt-accounts.nix b/modules/programs/neomutt-accounts.nix index 27e3b12290dc..a7ed7ec62c54 100644 --- a/modules/programs/neomutt-accounts.nix +++ b/modules/programs/neomutt-accounts.nix @@ -17,6 +17,14 @@ let default = null; description = "Name to display"; }; + + type = mkOption { + type = types.nullOr (types.enum [ "maildir" "imap" ]); + example = "imap"; + default = null; + description = + "Whether this mailbox is a maildir folder or an IMAP mailbox"; + }; }; }; @@ -75,6 +83,14 @@ in { description = "Use a different name as mailbox name"; }; + mailboxType = mkOption { + type = types.enum [ "maildir" "imap" ]; + default = "maildir"; + example = "imap"; + description = + "Whether this account uses maildir folders or IMAP mailboxes"; + }; + extraMailboxes = mkOption { type = with types; listOf (either str (submodule extraMailboxOptions)); default = [ ]; diff --git a/modules/programs/neomutt.nix b/modules/programs/neomutt.nix index fa9c2624ae2f..1067bda1acc7 100644 --- a/modules/programs/neomutt.nix +++ b/modules/programs/neomutt.nix @@ -8,6 +8,59 @@ let neomuttAccounts = filter (a: a.neomutt.enable) (attrValues config.accounts.email.accounts); + accountCommandNeeded = any (a: + a.neomutt.enable && (a.neomutt.mailboxType == "imap" + || (any (m: !isString m && m.type == "imap") a.neomutt.extraMailboxes))) + (attrValues config.accounts.email.accounts); + + accountCommand = let + imapAccounts = filter (a: + a.neomutt.enable && a.imap.host != null && a.userName != null + && a.passwordCommand != null) (attrValues config.accounts.email.accounts); + accountCase = account: + let passwordCmd = toString account.passwordCommand; + in '' + ${account.userName}@${account.imap.host}) + found=1 + username="${account.userName}" + password="$(${passwordCmd})" + ;;''; + in pkgs.writeShellScriptBin "account-command.sh" '' + # Automatically set login variables based on the current account. + # This requires NeoMutt >= 2022-05-16 + + while [ ! -z "$1" ]; do + case "$1" in + --hostname) + shift + hostname="$1" + ;; + --username) + shift + username="$1@" + ;; + --type) + shift + type="$1" + ;; + *) + exit 1 + ;; + esac + shift + done + + found= + case "''${username}''${hostname}" in + ${concatMapStringsSep "\n" accountCase imapAccounts} + esac + + if [ -n "$found" ]; then + echo "username: $username" + echo "password: $password" + fi + ''; + sidebarModule = types.submodule { options = { enable = mkEnableOption "sidebar support"; @@ -101,6 +154,21 @@ let accountFilename = account: config.xdg.configHome + "/neomutt/" + account.name; + accountRootIMAP = account: + let + userName = + lib.optionalString (account.userName != null) "${account.userName}@"; + port = lib.optionalString (account.imap.port != null) + ":${toString account.imap.port}"; + protocol = if account.imap.tls.enable then "imaps" else "imap"; + in "${protocol}://${userName}${account.imap.host}${port}"; + + accountRoot = account: + if account.neomutt.mailboxType == "imap" then + accountRootIMAP account + else + account.maildir.absPath; + genCommonFolderHooks = account: with account; { from = "'${address}'"; @@ -128,12 +196,12 @@ let smtp_pass = ''"`${passCmd}`"''; }; - genMaildirAccountConfig = account: + genAccountConfig = account: with account; let folderHook = mapAttrsToList setOption (genCommonFolderHooks account // optionalAttrs cfg.changeFolderWhenSourcingAccount { - folder = "'${account.maildir.absPath}'"; + folder = "'${accountRoot account}'"; }); in '' ${concatStringsSep "\n" folderHook} @@ -145,29 +213,40 @@ let "mailboxes" else ''named-mailboxes "${account.neomutt.mailboxName}"''; + mailroot = accountRoot account; + hookName = if account.neomutt.mailboxType == "imap" then + "account-hook" + else + "folder-hook"; extraMailboxes = concatMapStringsSep "\n" (extra: - if isString extra then - ''mailboxes "${account.maildir.absPath}/${extra}"'' + let + mailboxroot = if !isString extra && extra.type == "imap" then + accountRootIMAP account + else if !isString extra && extra.type == "maildir" then + account.maildir.absPath + else + mailroot; + in if isString extra then + ''mailboxes "${mailboxroot}/${extra}"'' else if extra.name == null then - ''mailboxes "${account.maildir.absPath}/${extra.mailbox}"'' + ''mailboxes "${mailboxroot}/${extra.mailbox}"'' else - '' - named-mailboxes "${extra.name}" "${account.maildir.absPath}/${extra.mailbox}"'') + ''named-mailboxes "${extra.name}" "${mailboxroot}/${extra.mailbox}"'') account.neomutt.extraMailboxes; in with account; '' # register account ${name} - ${mailboxes} "${maildir.absPath}/${folders.inbox}" + ${mailboxes} "${mailroot}/${folders.inbox}" ${extraMailboxes} - folder-hook ${maildir.absPath}/ " \ + ${hookName} ${mailroot}/ " \ source ${accountFilename account} " ''; mraSection = account: with account; - if account.maildir != null then - genMaildirAccountConfig account + if account.imap.host != null || account.maildir != null then + genAccountConfig account else - throw "Only maildir is supported at the moment"; + throw "Only maildir and IMAP is supported at the moment"; optionsStr = attrs: concatStringsSep "\n" (mapAttrsToList setOption attrs); @@ -219,7 +298,7 @@ let in '' # Generated by Home Manager. set ssl_force_tls = ${ - lib.hm.booleans.yesNo (smtp.tls.enable || smtp.tls.useStartTls) + lib.hm.booleans.yesNo (imap.tls.enable || imap.tls.useStartTls) } set certificate_file=${toString config.accounts.email.certificatesFile} @@ -366,7 +445,11 @@ in { "source ${pkgs.neomutt}/share/doc/neomutt/vim-keys/vim-keys.rc"} # Register accounts - ${concatMapStringsSep "\n" registerAccount neomuttAccounts} + ${ + optionalString (accountCommandNeeded) '' + set account_command = '${accountCommand}/bin/account-command.sh' + '' + }${concatMapStringsSep "\n" registerAccount neomuttAccounts} # Source primary account source ${accountFilename primary} diff --git a/tests/modules/programs/neomutt/account-command.sh-expected b/tests/modules/programs/neomutt/account-command.sh-expected new file mode 100644 index 000000000000..5698cf99ccfc --- /dev/null +++ b/tests/modules/programs/neomutt/account-command.sh-expected @@ -0,0 +1,39 @@ +#!/nix/store/00000000000000000000000000000000-bash/bin/bash +# Automatically set login variables based on the current account. +# This requires NeoMutt >= 2022-05-16 + +while [ ! -z "$1" ]; do + case "$1" in + --hostname) + shift + hostname="$1" + ;; + --username) + shift + username="$1@" + ;; + --type) + shift + type="$1" + ;; + *) + exit 1 + ;; + esac +shift +done + +found= +case "${username}${hostname}" in + home.manager@imap.example.com) + found=1 + username="home.manager" + password="$(password-command)" + ;; +esac + +if [ -n "$found" ]; then + echo "username: $username" + echo "password: $password" +fi + diff --git a/tests/modules/programs/neomutt/default.nix b/tests/modules/programs/neomutt/default.nix index 88e90c1d4b7c..d13b870e5a74 100644 --- a/tests/modules/programs/neomutt/default.nix +++ b/tests/modules/programs/neomutt/default.nix @@ -1,6 +1,7 @@ { neomutt-simple = ./neomutt.nix; neomutt-with-msmtp = ./neomutt-with-msmtp.nix; + neomutt-with-imap = ./neomutt-with-imap.nix; neomutt-not-primary = ./neomutt-not-primary.nix; neomutt-with-binds = ./neomutt-with-binds.nix; neomutt-with-binds-with-warning = ./neomutt-with-binds-with-warning.nix; @@ -9,6 +10,7 @@ neomutt-with-gpg = ./neomutt-with-gpg.nix; neomutt-no-folder-change = ./neomutt-no-folder-change.nix; neomutt-with-named-mailboxes = ./neomutt-with-named-mailboxes.nix; + neomutt-with-imap-type-mailboxes = ./neomutt-with-imap-type-mailboxes.nix; neomutt-with-signature = ./neomutt-with-signature.nix; neomutt-with-signature-command = ./neomutt-with-signature-command.nix; neomutt-with-starttls = ./neomutt-with-starttls.nix; diff --git a/tests/modules/programs/neomutt/hm-example.com-imap-expected.conf b/tests/modules/programs/neomutt/hm-example.com-imap-expected.conf new file mode 100644 index 000000000000..bfaeeab3424a --- /dev/null +++ b/tests/modules/programs/neomutt/hm-example.com-imap-expected.conf @@ -0,0 +1,35 @@ +# Generated by Home Manager. +set ssl_force_tls = yes +set certificate_file=/etc/ssl/certs/ca-certificates.crt + +# GPG section +set crypt_use_gpgme = yes +set crypt_autosign = no +set crypt_opportunistic_encrypt = no +set pgp_use_gpg_agent = yes +set mbox_type = Maildir +set sort = "threads" + +# MTA section +set smtp_pass="`password-command`" +set smtp_url='smtps://home.manager@smtp.example.com' + + + + + +# MRA section +set folder='imaps://home.manager@imap.example.com:993' +set from='hm@example.com' +set postponed='+Drafts' +set realname='H. M. Test' +set record='+Sent' +set spoolfile='+Inbox' +set trash='+Trash' + + +# Extra configuration +color status cyan default + + +unset signature diff --git a/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf b/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf new file mode 100644 index 000000000000..f3e3051e6139 --- /dev/null +++ b/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf @@ -0,0 +1,34 @@ +# Generated by Home Manager. +set header_cache = "/home/hm-user/.cache/neomutt/headers/" +set message_cachedir = "/home/hm-user/.cache/neomutt/messages/" +set editor = "$EDITOR" +set implicit_autoview = yes + +alternative_order text/enriched text/plain text + +set delete = yes + +# Binds + + +# Macros + + + + +# Register accounts +set account_command = '/nix/store/00000000000000000000000000000000-account-command.sh/bin/account-command.sh' +# register account hm@example.com +mailboxes "imaps://home.manager@imap.example.com:993/Inbox" + +account-hook imaps://home.manager@imap.example.com:993/ " \ + source /home/hm-user/.config/neomutt/hm@example.com " + + +# Source primary account +source /home/hm-user/.config/neomutt/hm@example.com + +# Extra configuration + + + diff --git a/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf b/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf new file mode 100644 index 000000000000..f8acd9fcc13f --- /dev/null +++ b/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf @@ -0,0 +1,36 @@ +# Generated by Home Manager. +set header_cache = "/home/hm-user/.cache/neomutt/headers/" +set message_cachedir = "/home/hm-user/.cache/neomutt/messages/" +set editor = "$EDITOR" +set implicit_autoview = yes + +alternative_order text/enriched text/plain text + +set delete = yes + +# Binds + + +# Macros + + + + +# Register accounts +set account_command = '/nix/store/00000000000000000000000000000000-account-command.sh/bin/account-command.sh' +# register account hm@example.com +named-mailboxes "someCustomName" "/home/hm-user/Mail/hm@example.com/Inbox" +mailboxes "/home/hm-user/Mail/hm@example.com/Sent" +named-mailboxes "Spam" "imaps://home.manager@imap.example.com:993/Junk Email" +mailboxes "/home/hm-user/Mail/hm@example.com/Trash" +folder-hook /home/hm-user/Mail/hm@example.com/ " \ + source /home/hm-user/.config/neomutt/hm@example.com " + + +# Source primary account +source /home/hm-user/.config/neomutt/hm@example.com + +# Extra configuration + + + diff --git a/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes.nix b/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes.nix new file mode 100644 index 000000000000..10dcdbed6667 --- /dev/null +++ b/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes.nix @@ -0,0 +1,57 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + imports = [ ../../accounts/email-test-accounts.nix ]; + + config = { + accounts.email.accounts = { + "hm@example.com" = { + notmuch.enable = true; + neomutt = { + enable = true; + extraConfig = '' + color status cyan default + ''; + mailboxName = "someCustomName"; + extraMailboxes = [ + "Sent" + { + mailbox = "Junk Email"; + name = "Spam"; + type = "imap"; + } + { mailbox = "Trash"; } + ]; + }; + imap.port = 993; + }; + }; + + programs.neomutt = { + enable = true; + vimKeys = false; + }; + + test.stubs.neomutt = { }; + + nmt.script = '' + assertFileExists home-files/.config/neomutt/neomuttrc + assertFileExists home-files/.config/neomutt/hm@example.com + assertFileContent $(normalizeStorePaths home-files/.config/neomutt/neomuttrc) ${ + ./neomutt-with-imap-type-mailboxes-expected.conf + } + assertFileContent home-files/.config/neomutt/hm@example.com ${ + ./hm-example.com-expected + } + + confFile=$(grep -o \ + '/nix/store/.*-account-command.sh/bin/account-command.sh' \ + $TESTED/home-files/.config/neomutt/neomuttrc) + assertFileContent "$(normalizeStorePaths "$confFile")" ${ + ./account-command.sh-expected + } + ''; + }; +} diff --git a/tests/modules/programs/neomutt/neomutt-with-imap.nix b/tests/modules/programs/neomutt/neomutt-with-imap.nix new file mode 100644 index 000000000000..3f234fde7c56 --- /dev/null +++ b/tests/modules/programs/neomutt/neomutt-with-imap.nix @@ -0,0 +1,44 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + imports = [ ../../accounts/email-test-accounts.nix ]; + + config = { + accounts.email.accounts = { + "hm@example.com" = { + neomutt = { + enable = true; + mailboxType = "imap"; + extraConfig = '' + color status cyan default + ''; + }; + imap.port = 993; + }; + }; + + programs.neomutt.enable = true; + + test.stubs.neomutt = { }; + + nmt.script = '' + assertFileExists home-files/.config/neomutt/neomuttrc + assertFileExists home-files/.config/neomutt/hm@example.com + assertFileContent $(normalizeStorePaths home-files/.config/neomutt/neomuttrc) ${ + ./neomutt-with-imap-expected.conf + } + assertFileContent home-files/.config/neomutt/hm@example.com ${ + ./hm-example.com-imap-expected.conf + } + + confFile=$(grep -o \ + '/nix/store/.*-account-command.sh/bin/account-command.sh' \ + $TESTED/home-files/.config/neomutt/neomuttrc) + assertFileContent "$(normalizeStorePaths "$confFile")" ${ + ./account-command.sh-expected + } + ''; + }; +} From 21b078306a2ab68748abf72650db313d646cf2ca Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 11 Feb 2024 21:30:00 +0100 Subject: [PATCH 051/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/faf912b086576fd1a15fca610166c98d47bc667e' (2024-02-05) → 'github:NixOS/nixpkgs/f8e2ebd66d097614d51a56a755450d4ae1632df1' (2024-02-07) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 7a56b826ae72..c48d8a7cf329 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1707092692, - "narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=", + "lastModified": 1707268954, + "narHash": "sha256-2en1kvde3cJVc3ZnTy8QeD2oKcseLFjYPLKhIGDanQ0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "faf912b086576fd1a15fca610166c98d47bc667e", + "rev": "f8e2ebd66d097614d51a56a755450d4ae1632df1", "type": "github" }, "original": { From 157bf71277c92dfc4691e5e1eb88db94043e3865 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 14 Feb 2024 11:25:28 +0100 Subject: [PATCH 052/636] mpv: create doc output in tests --- tests/modules/programs/mpv/mpv-stubs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/programs/mpv/mpv-stubs.nix b/tests/modules/programs/mpv/mpv-stubs.nix index 5d558ab3ec6a..2fee19144a6b 100644 --- a/tests/modules/programs/mpv/mpv-stubs.nix +++ b/tests/modules/programs/mpv/mpv-stubs.nix @@ -9,7 +9,7 @@ mpv-unwrapped = super.mpv-unwrapped.overrideAttrs { builder = pkgs.writeShellScript "dummy" '' PATH=${pkgs.coreutils}/bin - mkdir -p $dev $man $out/bin $out/Applications/mpv.app/Contents/MacOS + mkdir -p $dev $doc $man $out/bin $out/Applications/mpv.app/Contents/MacOS touch $out/bin/{mpv,umpv} \ $out/Applications/mpv.app/Contents/MacOS/{mpv,mpv-bundle} chmod +x $out/bin/{mpv,umpv} \ From 354643e6c1ce0762d498e5e676e7970922c89208 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 14 Feb 2024 14:44:07 +0100 Subject: [PATCH 053/636] neomutt: fix tests Caused by an unfortunate interaction between #4597 and #4999. --- tests/modules/programs/neomutt/hm-example.com-imap-expected.conf | 1 - tests/modules/programs/neomutt/neomutt-with-imap-expected.conf | 1 + .../neomutt/neomutt-with-imap-type-mailboxes-expected.conf | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/modules/programs/neomutt/hm-example.com-imap-expected.conf b/tests/modules/programs/neomutt/hm-example.com-imap-expected.conf index bfaeeab3424a..f5e9116d163e 100644 --- a/tests/modules/programs/neomutt/hm-example.com-imap-expected.conf +++ b/tests/modules/programs/neomutt/hm-example.com-imap-expected.conf @@ -3,7 +3,6 @@ set ssl_force_tls = yes set certificate_file=/etc/ssl/certs/ca-certificates.crt # GPG section -set crypt_use_gpgme = yes set crypt_autosign = no set crypt_opportunistic_encrypt = no set pgp_use_gpg_agent = yes diff --git a/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf b/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf index f3e3051e6139..005fd5b03a81 100644 --- a/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf @@ -3,6 +3,7 @@ set header_cache = "/home/hm-user/.cache/neomutt/headers/" set message_cachedir = "/home/hm-user/.cache/neomutt/messages/" set editor = "$EDITOR" set implicit_autoview = yes +set crypt_use_gpgme = yes alternative_order text/enriched text/plain text diff --git a/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf b/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf index f8acd9fcc13f..c6838d4ccd31 100644 --- a/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf @@ -3,6 +3,7 @@ set header_cache = "/home/hm-user/.cache/neomutt/headers/" set message_cachedir = "/home/hm-user/.cache/neomutt/messages/" set editor = "$EDITOR" set implicit_autoview = yes +set crypt_use_gpgme = yes alternative_order text/enriched text/plain text From 7889bfb4752b27c83c8ae9ca45f63b77fff7ef7b Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 12 Feb 2024 23:40:15 +0100 Subject: [PATCH 054/636] home-manager: overrideable URLs in generated flake When using the `init` sub-command, it is now possible to set the Home Manager and Nixpkgs input URLs. Note, for now these options are considered experimental. --- home-manager/home-manager | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index ba3b8d98e0ba..ddcd7a810d5c 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -258,6 +258,9 @@ function doInit() { withFlake=1 fi + local homeManagerUrl="github:nix-community/home-manager" + local nixpkgsUrl="github:nixos/nixpkgs/nixos-unstable" + while (( $# > 0 )); do local opt="$1" shift @@ -269,6 +272,14 @@ function doInit() { --switch) switch=1 ;; + --home-manager-url) + homeManagerUrl="$1" + shift + ;; + --nixpkgs-url) + nixpkgsUrl="$1" + shift + ;; -*) _iError "%s: unknown option '%s'" "$0" "$opt" >&2 exit 1 @@ -419,9 +430,9 @@ EOF inputs = { # Specify the source of Home Manager and Nixpkgs. - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + nixpkgs.url = "$nixpkgsUrl"; home-manager = { - url = "github:nix-community/home-manager"; + url = "$homeManagerUrl"; inputs.nixpkgs.follows = "nixpkgs"; }; }; From 043ba285c6dc20f36441d48525402bcb9743c498 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 12 Feb 2024 23:35:55 +0100 Subject: [PATCH 055/636] tests: add basic integration tests This introduces some rudimentary integration tests using the NixOS test framework. The intent is to better catch regressions when doing more elaborate changes that may affect overall Home Manager behavior. Note, the tests are currently not run automatically. --- flake.nix | 7 +- tests/integration/default.nix | 20 +++++ tests/integration/nixos/basics.nix | 44 ++++++++++ .../standalone/alice-flake-init.nix | 29 +++++++ .../standalone/alice-home-init.nix | 75 ++++++++++++++++ .../standalone/alice-home-next.nix | 12 +++ tests/integration/standalone/flake-basics.nix | 87 +++++++++++++++++++ .../standalone/standard-basics.nix | 84 ++++++++++++++++++ 8 files changed, 357 insertions(+), 1 deletion(-) create mode 100644 tests/integration/default.nix create mode 100644 tests/integration/nixos/basics.nix create mode 100644 tests/integration/standalone/alice-flake-init.nix create mode 100644 tests/integration/standalone/alice-home-init.nix create mode 100644 tests/integration/standalone/alice-home-next.nix create mode 100644 tests/integration/standalone/flake-basics.nix create mode 100644 tests/integration/standalone/standard-basics.nix diff --git a/flake.nix b/flake.nix index d047c7bf5228..02c7afacfa8f 100644 --- a/flake.nix +++ b/flake.nix @@ -118,6 +118,11 @@ tests = import ./tests { inherit pkgs; }; renameTestPkg = n: lib.nameValuePair "test-${n}"; in lib.mapAttrs' renameTestPkg tests.build; + + integrationTestPackages = let + tests = import ./tests/integration { inherit pkgs; }; + renameTestPkg = n: lib.nameValuePair "integration-test-${n}"; + in lib.mapAttrs' renameTestPkg tests; in { default = hmPkg; home-manager = hmPkg; @@ -125,7 +130,7 @@ docs-html = docs.manual.html; docs-json = docs.options.json; docs-manpages = docs.manPages; - } // testPackages); + } // testPackages // integrationTestPackages); defaultPackage = forAllSystems (system: self.packages.${system}.default); }); diff --git a/tests/integration/default.nix b/tests/integration/default.nix new file mode 100644 index 000000000000..c31030172cfa --- /dev/null +++ b/tests/integration/default.nix @@ -0,0 +1,20 @@ +{ pkgs }: + +let + nixosLib = import "${pkgs.path}/nixos/lib" { }; + + runTest = test: + nixosLib.runTest { + imports = [ test { node.pkgs = pkgs; } ]; + hostPkgs = pkgs; # the Nixpkgs package set used outside the VMs + }; + + tests = { + nixos-basics = runTest ./nixos/basics.nix; + standalone-flake-basics = runTest ./standalone/flake-basics.nix; + standalone-standard-basics = runTest ./standalone/standard-basics.nix; + }; +in tests // { + all = pkgs.linkFarm "all" + (pkgs.lib.mapAttrsToList (name: path: { inherit name path; }) tests); +} diff --git a/tests/integration/nixos/basics.nix b/tests/integration/nixos/basics.nix new file mode 100644 index 000000000000..29c2756f113d --- /dev/null +++ b/tests/integration/nixos/basics.nix @@ -0,0 +1,44 @@ +{ pkgs, ... }: + +{ + name = "nixos-basics"; + meta.maintainers = [ pkgs.lib.maintainers.rycee ]; + + nodes.machine = { ... }: { + imports = [ ../../../nixos ]; # Import the HM NixOS module. + + users.users.alice = { isNormalUser = true; }; + + home-manager.users.alice = { ... }: { + home.stateVersion = "23.11"; + home.file.test.text = "testfile"; + }; + }; + + testScript = '' + start_all() + + machine.wait_for_unit("home-manager-alice.service") + + with subtest("Home Manager file"): + # The file should be linked with the expected content. + path = "/home/alice/test" + machine.succeed(f"test -L {path}") + actual = machine.succeed(f"cat {path}") + expected = "testfile" + assert actual == expected, f"expected {path} to contain {expected}, but got {actual}" + + with subtest("GC root and profile"): + # There should be a GC root and Home Manager profile and they should point + # to the same path in the Nix store. + gcroot = "/home/alice/.local/state/home-manager/gcroots/current-home" + gcrootTarget = machine.succeed(f"readlink {gcroot}") + + profile = "/home/alice/.local/state/nix/profiles" + profileTarget = machine.succeed(f"readlink {profile}/home-manager") + profile1Target = machine.succeed(f"readlink {profile}/{profileTarget}") + + assert gcrootTarget == profile1Target, \ + f"expected GC root and profile to point to same, but pointed to {gcrootTarget} and {profile1Target}" + ''; +} diff --git a/tests/integration/standalone/alice-flake-init.nix b/tests/integration/standalone/alice-flake-init.nix new file mode 100644 index 000000000000..323b4b52f915 --- /dev/null +++ b/tests/integration/standalone/alice-flake-init.nix @@ -0,0 +1,29 @@ +{ + description = "Home Manager configuration of alice"; + + inputs = { + # Specify the source of Home Manager and Nixpkgs. + nixpkgs.url = "nixpkgs"; + home-manager = { + url = "home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { nixpkgs, home-manager, ... }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in { + homeConfigurations."alice" = home-manager.lib.homeManagerConfiguration { + inherit pkgs; + + # Specify your home configuration modules here, for example, + # the path to your home.nix. + modules = [ ./home.nix ]; + + # Optionally use extraSpecialArgs + # to pass through arguments to home.nix + }; + }; +} diff --git a/tests/integration/standalone/alice-home-init.nix b/tests/integration/standalone/alice-home-init.nix new file mode 100644 index 000000000000..c5abf850fa08 --- /dev/null +++ b/tests/integration/standalone/alice-home-init.nix @@ -0,0 +1,75 @@ +{ config, pkgs, ... }: + +{ + # Home Manager needs a bit of information about you and the paths it should + # manage. + home.username = "alice"; + home.homeDirectory = "/home/alice"; + + # This value determines the Home Manager release that your configuration is + # compatible with. This helps avoid breakage when a new Home Manager release + # introduces backwards incompatible changes. + # + # You should not change this value, even if you update Home Manager. If you do + # want to update the value, then make sure to first check the Home Manager + # release notes. + home.stateVersion = "23.11"; # Please read the comment before changing. + + # The home.packages option allows you to install Nix packages into your + # environment. + home.packages = [ + # # Adds the 'hello' command to your environment. It prints a friendly + # # "Hello, world!" when run. + # pkgs.hello + + # # It is sometimes useful to fine-tune packages, for example, by applying + # # overrides. You can do that directly here, just don't forget the + # # parentheses. Maybe you want to install Nerd Fonts with a limited number of + # # fonts? + # (pkgs.nerdfonts.override { fonts = [ "FantasqueSansMono" ]; }) + + # # You can also create simple shell scripts directly inside your + # # configuration. For example, this adds a command 'my-hello' to your + # # environment: + # (pkgs.writeShellScriptBin "my-hello" '' + # echo "Hello, ${config.home.username}!" + # '') + ]; + + # Home Manager is pretty good at managing dotfiles. The primary way to manage + # plain files is through 'home.file'. + home.file = { + # # Building this configuration will create a copy of 'dotfiles/screenrc' in + # # the Nix store. Activating the configuration will then make '~/.screenrc' a + # # symlink to the Nix store copy. + # ".screenrc".source = dotfiles/screenrc; + + # # You can also set the file content immediately. + # ".gradle/gradle.properties".text = '' + # org.gradle.console=verbose + # org.gradle.daemon.idletimeout=3600000 + # ''; + }; + + # Home Manager can also manage your environment variables through + # 'home.sessionVariables'. If you don't want to manage your shell through Home + # Manager then you have to manually source 'hm-session-vars.sh' located at + # either + # + # ~/.nix-profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # ~/.local/state/nix/profiles/profile/etc/profile.d/hm-session-vars.sh + # + # or + # + # /etc/profiles/per-user/alice/etc/profile.d/hm-session-vars.sh + # + home.sessionVariables = { + # EDITOR = "emacs"; + }; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; +} diff --git a/tests/integration/standalone/alice-home-next.nix b/tests/integration/standalone/alice-home-next.nix new file mode 100644 index 000000000000..f4ee8e8fe64e --- /dev/null +++ b/tests/integration/standalone/alice-home-next.nix @@ -0,0 +1,12 @@ +{ config, pkgs, ... }: + +{ + home.username = "alice"; + home.homeDirectory = "/home/alice"; + home.stateVersion = "23.11"; + home.packages = [ pkgs.hello ]; + home.file.test.text = "test"; + home.sessionVariables.EDITOR = "emacs"; + programs.bash.enable = true; + programs.home-manager.enable = true; +} diff --git a/tests/integration/standalone/flake-basics.nix b/tests/integration/standalone/flake-basics.nix new file mode 100644 index 000000000000..6c9c1777c9d7 --- /dev/null +++ b/tests/integration/standalone/flake-basics.nix @@ -0,0 +1,87 @@ +{ pkgs, ... }: + +{ + name = "standalone-flake-basics"; + meta.maintainers = [ pkgs.lib.maintainers.rycee ]; + + nodes.machine = { ... }: { + imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; + virtualisation.memorySize = 2048; + nix.settings.extra-experimental-features = [ "nix-command" "flakes" ]; + users.users.alice = { isNormalUser = true; }; + }; + + testScript = '' + start_all() + machine.wait_for_unit("network-online.target") + machine.wait_for_unit("multi-user.target") + + home_manager = "${../../..}" + nixpkgs = "${pkgs.path}" + + machine.succeed(f"nix registry add home-manager path:{home_manager}") + machine.succeed(f"nix registry add nixpkgs path:{nixpkgs}") + + def as_alice(cmd): + return machine.succeed(f"su - alice -c '{cmd}'") + + with subtest("Home Manager init"): + as_alice(f"nix run path:{home_manager} -- init --home-manager-url home-manager --nixpkgs-url nixpkgs --switch") + + actual = machine.succeed("ls /home/alice/.config/home-manager") + expected = "flake.lock\nflake.nix\nhome.nix\n" + assert actual == expected, \ + f"unexpected content of /home/alice/.config/home-manager: {actual}" + + machine.succeed("diff -u ${ + ./alice-home-init.nix + } /home/alice/.config/home-manager/home.nix") + machine.succeed("diff -u ${ + ./alice-flake-init.nix + } /home/alice/.config/home-manager/flake.nix") + + # The default configuration creates this link on activation. + machine.succeed("test -L /home/alice/.cache/.keep") + + with subtest("GC root and profile"): + # There should be a GC root and Home Manager profile and they should point + # to the same path in the Nix store. + gcroot = "/home/alice/.local/state/home-manager/gcroots/current-home" + gcrootTarget = machine.succeed(f"readlink {gcroot}") + + profile = "/home/alice/.local/state/nix/profiles" + profileTarget = machine.succeed(f"readlink {profile}/home-manager") + profile1Target = machine.succeed(f"readlink {profile}/{profileTarget}") + + assert gcrootTarget == profile1Target, \ + f"expected GC root and profile to point to same, but pointed to {gcrootTarget} and {profile1Target}" + + with subtest("Home Manager switch"): + as_alice("cp ${ + ./alice-home-next.nix + } /home/alice/.config/home-manager/home.nix") + + as_alice("home-manager switch") + as_alice("hello") + + actual = as_alice("echo -n $EDITOR") + assert "emacs" == actual, \ + f"expected $EDITOR to contain emacs, but found {actual}" + + with subtest("Home Manager generations"): + actual = as_alice("home-manager generations") + expected = ": id 1 ->" + assert expected in actual, \ + f"expected generations to contain {expected}, but found {actual}" + + with subtest("Home Manager uninstallation"): + as_alice("yes | home-manager uninstall -L") + + as_alice("! hello") + machine.succeed("test ! -e /home/alice/.cache/.keep") + + machine.succeed("test ! -e /home/alice/.local/share/home-manager/gcroots") + machine.succeed("test ! -e /home/alice/.local/state/home-manager") + machine.succeed("test ! -e /home/alice/.local/state/nix/profiles/home-manager") + ''; +} diff --git a/tests/integration/standalone/standard-basics.nix b/tests/integration/standalone/standard-basics.nix new file mode 100644 index 000000000000..6c514bfb037b --- /dev/null +++ b/tests/integration/standalone/standard-basics.nix @@ -0,0 +1,84 @@ +{ pkgs, ... }: + +{ + name = "standalone-standard-basics"; + meta.maintainers = [ pkgs.lib.maintainers.rycee ]; + + nodes.machine = { ... }: { + imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; + virtualisation.memorySize = 2048; + users.users.alice = { isNormalUser = true; }; + }; + + testScript = '' + start_all() + machine.wait_for_unit("network.target") + machine.wait_for_unit("multi-user.target") + + home_manager = "${../../..}" + + def as_alice(cmd): + return machine.succeed(f"su - alice -c '{cmd}'") + + # Set up a home-manager channel. + as_alice("mkdir -p /home/alice/.nix-defexpr/channels") + as_alice(f"ln -s {home_manager} /home/alice/.nix-defexpr/channels/home-manager") + + with subtest("Home Manager installation"): + as_alice("nix-shell \"\" -A install") + + actual = machine.succeed("ls /home/alice/.config/home-manager") + expected = "home.nix\n" + assert actual == expected, \ + f"unexpected content of /home/alice/.config/home-manager: {actual}" + + machine.succeed("diff -u ${ + ./alice-home-init.nix + } /home/alice/.config/home-manager/home.nix") + + # The default configuration creates this link on activation. + machine.succeed("test -L /home/alice/.cache/.keep") + + with subtest("GC root and profile"): + # There should be a GC root and Home Manager profile and they should point + # to the same path in the Nix store. + gcroot = "/home/alice/.local/state/home-manager/gcroots/current-home" + gcrootTarget = machine.succeed(f"readlink {gcroot}") + + profile = "/home/alice/.local/state/nix/profiles" + profileTarget = machine.succeed(f"readlink {profile}/home-manager") + profile1Target = machine.succeed(f"readlink {profile}/{profileTarget}") + + assert gcrootTarget == profile1Target, \ + f"expected GC root and profile to point to same, but pointed to {gcrootTarget} and {profile1Target}" + + with subtest("Home Manager switch"): + as_alice("cp ${ + ./alice-home-next.nix + } /home/alice/.config/home-manager/home.nix") + + as_alice("home-manager switch") + as_alice("hello") + + actual = as_alice("echo -n $EDITOR") + assert "emacs" == actual, \ + f"expected $EDITOR to contain emacs, but found {actual}" + + with subtest("Home Manager generations"): + actual = as_alice("home-manager generations") + expected = ": id 1 ->" + assert expected in actual, \ + f"expected generations to contain {expected}, but found {actual}" + + with subtest("Home Manager uninstallation"): + as_alice("yes | home-manager uninstall -L") + + as_alice("! hello") + machine.succeed("test ! -e /home/alice/.cache/.keep") + + # TODO: Fix uninstall to fully remove the directory. + machine.succeed("test ! -e /home/alice/.local/share/home-manager/gcroots") + machine.succeed("test ! -e /home/alice/.local/state/home-manager") + machine.succeed("test ! -e /home/alice/.local/state/nix/profiles/home-manager") + ''; +} From 07fd41171ff8f263a9e4a95e17a3db1ff8a000c9 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 15 Feb 2024 13:10:07 +0100 Subject: [PATCH 056/636] home-manager: fix incorrect log message --- home-manager/home-manager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index ddcd7a810d5c..08c01aeeaddf 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -154,7 +154,7 @@ function setHomeManagerPathVariables() { declare -gr HM_PROFILE_DIR="$globalProfilesDir" else _iError 'Could not find suitable profile directory, tried %s and %s' \ - "$HM_STATE_DIR/profiles" "$globalProfilesDir" >&2 + "$userNixStateDir/profiles" "$globalProfilesDir" >&2 exit 1 fi } From 3d6791b3897b526c82920a2ab5f61d71985b3cf8 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 15 Feb 2024 13:10:23 +0100 Subject: [PATCH 057/636] home-manager: add Nix sanity check This should ensure that the necessary profile directories are created. --- home-manager/home-manager | 4 ++ home-manager/po/home-manager.pot | 80 +++++++++++++++++--------------- modules/po/hm-modules.pot | 36 +++++++------- 3 files changed, 64 insertions(+), 56 deletions(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index 08c01aeeaddf..91202c877fb5 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -137,6 +137,10 @@ function setHomeManagerPathVariables() { return fi + _iVerbose "Sanity checking Nix" + nix-build -q --expr '{}' --no-out-link > /dev/null 2>&1 || true + nix-env -q > /dev/null 2>&1 || true + declare -r globalNixStateDir="${NIX_STATE_DIR:-/nix/var/nix}" declare -r globalProfilesDir="$globalNixStateDir/profiles/per-user/$USER" declare -r globalGcrootsDir="$globalNixStateDir/gcroots/per-user/$USER" diff --git a/home-manager/po/home-manager.pot b/home-manager/po/home-manager.pot index e5937eeccca8..4b238d100297 100644 --- a/home-manager/po/home-manager.pot +++ b/home-manager/po/home-manager.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,36 +18,36 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" -#: home-manager/home-manager:81 +#: home-manager/home-manager:58 msgid "No configuration file found at %s" msgstr "" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:98 home-manager/home-manager:102 -#: home-manager/home-manager:192 +#: home-manager/home-manager:75 home-manager/home-manager:79 +#: home-manager/home-manager:178 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" -#: home-manager/home-manager:109 +#: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" msgstr "" -#: home-manager/home-manager:124 +#: home-manager/home-manager:101 msgid "Home Manager not found at %s." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:132 +#: home-manager/home-manager:109 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:135 +#: home-manager/home-manager:112 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -68,38 +68,42 @@ msgid "" " $ rm -r \"%s\"" msgstr "" -#: home-manager/home-manager:174 +#: home-manager/home-manager:140 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:229 +#: home-manager/home-manager:215 msgid "Can't inspect options of a flake configuration" msgstr "" -#: home-manager/home-manager:291 home-manager/home-manager:314 -#: home-manager/home-manager:1034 +#: home-manager/home-manager:288 home-manager/home-manager:311 +#: home-manager/home-manager:1030 msgid "%s: unknown option '%s'" msgstr "" -#: home-manager/home-manager:296 home-manager/home-manager:1035 +#: home-manager/home-manager:293 home-manager/home-manager:1031 msgid "Run '%s --help' for usage help" msgstr "" -#: home-manager/home-manager:322 home-manager/home-manager:421 +#: home-manager/home-manager:319 home-manager/home-manager:423 msgid "The file %s already exists, leaving it unchanged..." msgstr "" -#: home-manager/home-manager:324 home-manager/home-manager:423 +#: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." msgstr "" -#: home-manager/home-manager:465 +#: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." msgstr "" #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:470 +#: home-manager/home-manager:472 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -110,7 +114,7 @@ msgid "" msgstr "" #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:475 +#: home-manager/home-manager:477 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -120,11 +124,11 @@ msgid "" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:486 +#: home-manager/home-manager:488 msgid "Can't instantiate a flake configuration" msgstr "" -#: home-manager/home-manager:562 +#: home-manager/home-manager:564 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -134,72 +138,72 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: home-manager/home-manager:576 +#: home-manager/home-manager:578 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "" -#: home-manager/home-manager:583 +#: home-manager/home-manager:586 #, sh-format -msgid "Please set the $EDITOR environment variable" +msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "" -#: home-manager/home-manager:598 +#: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" msgstr "" -#: home-manager/home-manager:676 +#: home-manager/home-manager:685 msgid "No generation with ID %s" msgstr "" -#: home-manager/home-manager:678 +#: home-manager/home-manager:687 msgid "Cannot remove the current generation %s" msgstr "" -#: home-manager/home-manager:680 +#: home-manager/home-manager:689 msgid "Removing generation %s" msgstr "" -#: home-manager/home-manager:699 +#: home-manager/home-manager:710 msgid "No generations to expire" msgstr "" -#: home-manager/home-manager:710 +#: home-manager/home-manager:721 msgid "No home-manager packages seem to be installed." msgstr "" -#: home-manager/home-manager:792 +#: home-manager/home-manager:803 msgid "Unknown argument %s" msgstr "" -#: home-manager/home-manager:816 +#: home-manager/home-manager:827 msgid "This will remove Home Manager from your system." msgstr "" -#: home-manager/home-manager:819 +#: home-manager/home-manager:830 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "" -#: home-manager/home-manager:823 +#: home-manager/home-manager:834 msgid "Really uninstall Home Manager?" msgstr "" -#: home-manager/home-manager:829 +#: home-manager/home-manager:840 msgid "Switching to empty Home Manager configuration..." msgstr "" -#: home-manager/home-manager:857 +#: home-manager/home-manager:855 msgid "Yay!" msgstr "" -#: home-manager/home-manager:862 +#: home-manager/home-manager:860 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "" -#: home-manager/home-manager:1074 +#: home-manager/home-manager:1070 msgid "expire-generations expects one argument, got %d." msgstr "" -#: home-manager/home-manager:1096 +#: home-manager/home-manager:1092 msgid "Unknown command: %s" msgstr "" diff --git a/modules/po/hm-modules.pot b/modules/po/hm-modules.pot index 3530936d0eb7..e187449c80b2 100644 --- a/modules/po/hm-modules.pot +++ b/modules/po/hm-modules.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,23 +17,23 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: modules/files.nix:234 +#: modules/files.nix:236 msgid "Creating home file links in %s" msgstr "" -#: modules/files.nix:247 +#: modules/files.nix:249 msgid "Cleaning up orphan links from %s" msgstr "" -#: modules/files.nix:263 +#: modules/files.nix:265 msgid "Creating profile generation %s" msgstr "" -#: modules/files.nix:280 +#: modules/files.nix:282 msgid "No change so reusing latest profile generation %s" msgstr "" -#: modules/home-environment.nix:640 +#: modules/home-environment.nix:622 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -49,7 +49,7 @@ msgid "" "Then try activating your Home Manager configuration again." msgstr "" -#: modules/home-environment.nix:673 +#: modules/home-environment.nix:655 msgid "Activating %s" msgstr "" @@ -57,15 +57,15 @@ msgstr "" msgid "Migrating profile from %s to %s" msgstr "" -#: modules/lib-bash/activation-init.sh:53 +#: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" -#: modules/lib-bash/activation-init.sh:81 +#: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" msgstr "" -#: modules/lib-bash/activation-init.sh:84 +#: modules/lib-bash/activation-init.sh:86 msgid "" "The previous generation number and path are in conflict! These\n" "must be either both empty or both set but are now set to\n" @@ -81,34 +81,34 @@ msgid "" "and trying home-manager switch again. Good luck!" msgstr "" -#: modules/lib-bash/activation-init.sh:95 +#: modules/lib-bash/activation-init.sh:127 msgid "Error: USER is set to \"%s\" but we expect \"%s\"" msgstr "" -#: modules/lib-bash/activation-init.sh:104 +#: modules/lib-bash/activation-init.sh:136 msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" msgstr "" -#: modules/lib-bash/activation-init.sh:119 +#: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" msgstr "" -#: modules/lib-bash/activation-init.sh:123 +#: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" msgstr "" -#: modules/lib-bash/activation-init.sh:133 +#: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" msgstr "" -#: modules/lib-bash/activation-init.sh:137 +#: modules/lib-bash/activation-init.sh:174 msgid "This is a live run" msgstr "" -#: modules/lib-bash/activation-init.sh:143 +#: modules/lib-bash/activation-init.sh:180 msgid "Using Nix version: %s" msgstr "" -#: modules/lib-bash/activation-init.sh:146 +#: modules/lib-bash/activation-init.sh:183 msgid "Activation variables:" msgstr "" From bb69e1d43ea052aa69d884ae751cb9d1999bd8b8 Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Sun, 18 Feb 2024 15:02:07 +0100 Subject: [PATCH 058/636] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Co-authored-by: Hosted Weblate Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules --- home-manager/po/ca.po | 86 +++++++++++++++++++----------------- home-manager/po/cs.po | 86 +++++++++++++++++++----------------- home-manager/po/da.po | 86 +++++++++++++++++++----------------- home-manager/po/de.po | 86 +++++++++++++++++++----------------- home-manager/po/es.po | 86 +++++++++++++++++++----------------- home-manager/po/fa.po | 86 +++++++++++++++++++----------------- home-manager/po/fi.po | 80 +++++++++++++++++---------------- home-manager/po/fr.po | 86 +++++++++++++++++++----------------- home-manager/po/id.po | 86 +++++++++++++++++++----------------- home-manager/po/it.po | 90 +++++++++++++++++++++----------------- home-manager/po/ja.po | 86 +++++++++++++++++++----------------- home-manager/po/ko.po | 86 +++++++++++++++++++----------------- home-manager/po/lt.po | 86 +++++++++++++++++++----------------- home-manager/po/nb_NO.po | 86 +++++++++++++++++++----------------- home-manager/po/nl.po | 86 +++++++++++++++++++----------------- home-manager/po/pl.po | 86 +++++++++++++++++++----------------- home-manager/po/pt.po | 86 +++++++++++++++++++----------------- home-manager/po/pt_BR.po | 90 +++++++++++++++++++++----------------- home-manager/po/ro.po | 86 +++++++++++++++++++----------------- home-manager/po/ru.po | 86 +++++++++++++++++++----------------- home-manager/po/sv.po | 86 +++++++++++++++++++----------------- home-manager/po/th.po | 80 +++++++++++++++++---------------- home-manager/po/tr.po | 86 +++++++++++++++++++----------------- home-manager/po/uk.po | 90 +++++++++++++++++++++----------------- home-manager/po/zh_Hans.po | 86 +++++++++++++++++++----------------- home-manager/po/zh_Hant.po | 86 +++++++++++++++++++----------------- modules/po/ca.po | 36 +++++++-------- modules/po/cs.po | 36 +++++++-------- modules/po/da.po | 36 +++++++-------- modules/po/de.po | 36 +++++++-------- modules/po/es.po | 36 +++++++-------- modules/po/fa.po | 36 +++++++-------- modules/po/fi.po | 36 +++++++-------- modules/po/fr.po | 36 +++++++-------- modules/po/id.po | 36 +++++++-------- modules/po/it.po | 36 +++++++-------- modules/po/ja.po | 36 +++++++-------- modules/po/ko.po | 36 +++++++-------- modules/po/lt.po | 36 +++++++-------- modules/po/nb_NO.po | 36 +++++++-------- modules/po/nl.po | 36 +++++++-------- modules/po/pl.po | 36 +++++++-------- modules/po/pt.po | 36 +++++++-------- modules/po/pt_BR.po | 40 ++++++++--------- modules/po/ro.po | 36 +++++++-------- modules/po/ru.po | 36 +++++++-------- modules/po/sv.po | 36 +++++++-------- modules/po/th.po | 36 +++++++-------- modules/po/tr.po | 36 +++++++-------- modules/po/uk.po | 36 +++++++-------- modules/po/zh_Hans.po | 36 +++++++-------- modules/po/zh_Hant.po | 36 +++++++-------- 52 files changed, 1688 insertions(+), 1488 deletions(-) diff --git a/home-manager/po/ca.po b/home-manager/po/ca.po index e72313659642..3e36abdb3a2b 100644 --- a/home-manager/po/ca.po +++ b/home-manager/po/ca.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-12-10 15:58+0000\n" "Last-Translator: Nara Díaz Viñolas \n" "Language-Team: Catalan \n" "Language-Team: Czech =2 && n<=4) ? 1 : 2;\n" "X-Generator: Weblate 5.4-dev\n" -#: home-manager/home-manager:81 +#: home-manager/home-manager:58 msgid "No configuration file found at %s" msgstr "V %s nebyl nalezen konfigurační soubor" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:98 home-manager/home-manager:102 -#: home-manager/home-manager:192 +#: home-manager/home-manager:75 home-manager/home-manager:79 +#: home-manager/home-manager:178 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -34,16 +34,16 @@ msgstr "" "Udržovat Home Manager %s v %s je zastaralé,\n" "prosím přesuňte jej do %s" -#: home-manager/home-manager:109 +#: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" msgstr "Konfigurační soubor nenalezen. Prosím vytvořte jej v %s" -#: home-manager/home-manager:124 +#: home-manager/home-manager:101 msgid "Home Manager not found at %s." msgstr "Home Manager nebyl nalezen v %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:132 +#: home-manager/home-manager:109 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -52,7 +52,7 @@ msgstr "" "adresář." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:135 +#: home-manager/home-manager:112 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -91,38 +91,42 @@ msgstr "" "\n" " $ rm -r \"%s\"" -#: home-manager/home-manager:174 +#: home-manager/home-manager:140 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Nebyl nalezen vhodný adresář profilu, byly zkoušeny %s a %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:229 +#: home-manager/home-manager:215 msgid "Can't inspect options of a flake configuration" msgstr "Nelze ověřit parametry z konfigurace flake" -#: home-manager/home-manager:291 home-manager/home-manager:314 -#: home-manager/home-manager:1034 +#: home-manager/home-manager:288 home-manager/home-manager:311 +#: home-manager/home-manager:1030 msgid "%s: unknown option '%s'" msgstr "%s: neznámý parametr '%s'" -#: home-manager/home-manager:296 home-manager/home-manager:1035 +#: home-manager/home-manager:293 home-manager/home-manager:1031 msgid "Run '%s --help' for usage help" msgstr "Spusťte '%s --help' pro vypsání nápovědy" -#: home-manager/home-manager:322 home-manager/home-manager:421 +#: home-manager/home-manager:319 home-manager/home-manager:423 msgid "The file %s already exists, leaving it unchanged..." msgstr "Soubor %s již existuje, ponechán beze změn..." -#: home-manager/home-manager:324 home-manager/home-manager:423 +#: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." msgstr "Vytvářím %s..." -#: home-manager/home-manager:465 +#: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." msgstr "Vytvářím první generaci Home Manageru..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:470 +#: home-manager/home-manager:472 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -139,7 +143,7 @@ msgstr "" "k zobrazení všech dostupných možností." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:475 +#: home-manager/home-manager:477 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -153,11 +157,11 @@ msgstr "" " %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:486 +#: home-manager/home-manager:488 msgid "Can't instantiate a flake configuration" msgstr "Nelze vytvořit instanci flake konfigurace" -#: home-manager/home-manager:562 +#: home-manager/home-manager:564 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -174,75 +178,79 @@ msgstr[2] "" "%d nepřečtených novinek.\n" "Přečtěte je pomocí příkazu \"%s news\"." -#: home-manager/home-manager:576 +#: home-manager/home-manager:578 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Neznáme nastavení \"news.display\" \"%s\"." -#: home-manager/home-manager:583 +#: home-manager/home-manager:586 #, sh-format -msgid "Please set the $EDITOR environment variable" -msgstr "Prosím nastavte proměnou prostředí $EDITOR" +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" -#: home-manager/home-manager:598 +#: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" msgstr "Sestavení nelze provést v adresáři dostupném pouze pro čtení" -#: home-manager/home-manager:676 +#: home-manager/home-manager:685 msgid "No generation with ID %s" msgstr "Generace s ID %s neexistuje" -#: home-manager/home-manager:678 +#: home-manager/home-manager:687 msgid "Cannot remove the current generation %s" msgstr "Nelze odstranit současnou generaci %s" -#: home-manager/home-manager:680 +#: home-manager/home-manager:689 msgid "Removing generation %s" msgstr "Odstraňuji generaci %s" -#: home-manager/home-manager:699 +#: home-manager/home-manager:710 msgid "No generations to expire" msgstr "Žádná generace k vypršení platnosti" -#: home-manager/home-manager:710 +#: home-manager/home-manager:721 msgid "No home-manager packages seem to be installed." msgstr "Žádný home-manager balíček není nainstalován." -#: home-manager/home-manager:792 +#: home-manager/home-manager:803 msgid "Unknown argument %s" msgstr "Neznámý parametr %s" -#: home-manager/home-manager:816 +#: home-manager/home-manager:827 msgid "This will remove Home Manager from your system." msgstr "Toto odstraní Home Manager z vašeho systému." -#: home-manager/home-manager:819 +#: home-manager/home-manager:830 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "Toto zkouška na nečisto, nic nebude odinstalováno." -#: home-manager/home-manager:823 +#: home-manager/home-manager:834 msgid "Really uninstall Home Manager?" msgstr "Opravdu odinstalovat Home Manager?" -#: home-manager/home-manager:829 +#: home-manager/home-manager:840 msgid "Switching to empty Home Manager configuration..." msgstr "Přepínám na prázdou konfiguraci Home Manageru..." -#: home-manager/home-manager:857 +#: home-manager/home-manager:855 msgid "Yay!" msgstr "Hurá!" -#: home-manager/home-manager:862 +#: home-manager/home-manager:860 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager se odinstalovává, ale váš home.nix nebyl změněn." -#: home-manager/home-manager:1074 +#: home-manager/home-manager:1070 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations očekává jeden parametr, přítomno %d." -#: home-manager/home-manager:1096 +#: home-manager/home-manager:1092 msgid "Unknown command: %s" msgstr "Neznámý příkaz: %s" #: home-manager/install.nix:18 msgid "This derivation is not buildable, please run it using nix-shell." msgstr "Tuto odvozeninu nelze sestavit, prosím spusťte ji pomocí nix-shell." + +#, sh-format +#~ msgid "Please set the $EDITOR environment variable" +#~ msgstr "Prosím nastavte proměnou prostředí $EDITOR" diff --git a/home-manager/po/da.po b/home-manager/po/da.po index 70f22ad3d07c..a93c63c04c5d 100644 --- a/home-manager/po/da.po +++ b/home-manager/po/da.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-08-27 13:52+0000\n" "Last-Translator: cafkafk \n" "Language-Team: Danish \n" "Language-Team: German \n" "Language-Team: Spanish \n" "Language-Team: Persian 1;\n" "X-Generator: Weblate 4.18-dev\n" -#: home-manager/home-manager:81 +#: home-manager/home-manager:58 msgid "No configuration file found at %s" msgstr "هیچ فایل تنظیماتی در %s پیدا نشد" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:98 home-manager/home-manager:102 -#: home-manager/home-manager:192 +#: home-manager/home-manager:75 home-manager/home-manager:79 +#: home-manager/home-manager:178 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" -#: home-manager/home-manager:109 +#: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" msgstr "هیچ فایل تنظیماتی پیدا نشد. لطفا یک فایل در %s بسازید" -#: home-manager/home-manager:124 +#: home-manager/home-manager:101 msgid "Home Manager not found at %s." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:132 +#: home-manager/home-manager:109 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:135 +#: home-manager/home-manager:112 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -69,38 +69,42 @@ msgid "" " $ rm -r \"%s\"" msgstr "" -#: home-manager/home-manager:174 +#: home-manager/home-manager:140 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:229 +#: home-manager/home-manager:215 msgid "Can't inspect options of a flake configuration" msgstr "" -#: home-manager/home-manager:291 home-manager/home-manager:314 -#: home-manager/home-manager:1034 +#: home-manager/home-manager:288 home-manager/home-manager:311 +#: home-manager/home-manager:1030 msgid "%s: unknown option '%s'" msgstr "" -#: home-manager/home-manager:296 home-manager/home-manager:1035 +#: home-manager/home-manager:293 home-manager/home-manager:1031 msgid "Run '%s --help' for usage help" msgstr "" -#: home-manager/home-manager:322 home-manager/home-manager:421 +#: home-manager/home-manager:319 home-manager/home-manager:423 msgid "The file %s already exists, leaving it unchanged..." msgstr "فایل %s از قبل وجود داشته است، بدون تغییر رها شد..." -#: home-manager/home-manager:324 home-manager/home-manager:423 +#: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." msgstr "ساختن %s..." -#: home-manager/home-manager:465 +#: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." msgstr "" #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:470 +#: home-manager/home-manager:472 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -111,7 +115,7 @@ msgid "" msgstr "" #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:475 +#: home-manager/home-manager:477 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -121,11 +125,11 @@ msgid "" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:486 +#: home-manager/home-manager:488 msgid "Can't instantiate a flake configuration" msgstr "" -#: home-manager/home-manager:562 +#: home-manager/home-manager:564 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -135,73 +139,73 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: home-manager/home-manager:576 +#: home-manager/home-manager:578 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "" -#: home-manager/home-manager:583 +#: home-manager/home-manager:586 #, sh-format -msgid "Please set the $EDITOR environment variable" -msgstr "لطفا متغیر محیطی $EDITOR را مقدار دهی کنید" +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" -#: home-manager/home-manager:598 +#: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" msgstr "" -#: home-manager/home-manager:676 +#: home-manager/home-manager:685 msgid "No generation with ID %s" msgstr "" -#: home-manager/home-manager:678 +#: home-manager/home-manager:687 msgid "Cannot remove the current generation %s" msgstr "نمی‌توان نسل فعلی %s را حذف کرد" -#: home-manager/home-manager:680 +#: home-manager/home-manager:689 msgid "Removing generation %s" msgstr "حذف کردن نسل %s" -#: home-manager/home-manager:699 +#: home-manager/home-manager:710 msgid "No generations to expire" msgstr "" -#: home-manager/home-manager:710 +#: home-manager/home-manager:721 msgid "No home-manager packages seem to be installed." msgstr "" -#: home-manager/home-manager:792 +#: home-manager/home-manager:803 msgid "Unknown argument %s" msgstr "" -#: home-manager/home-manager:816 +#: home-manager/home-manager:827 msgid "This will remove Home Manager from your system." msgstr "" -#: home-manager/home-manager:819 +#: home-manager/home-manager:830 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "" -#: home-manager/home-manager:823 +#: home-manager/home-manager:834 msgid "Really uninstall Home Manager?" msgstr "واقعاً هوم منیجر را حذف نصب کنید؟" -#: home-manager/home-manager:829 +#: home-manager/home-manager:840 msgid "Switching to empty Home Manager configuration..." msgstr "" -#: home-manager/home-manager:857 +#: home-manager/home-manager:855 #, fuzzy msgid "Yay!" msgstr "آره!" -#: home-manager/home-manager:862 +#: home-manager/home-manager:860 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "هوم منیجر حذف نصب شد اما home.nix شما دست نخورده باقی ماند." -#: home-manager/home-manager:1074 +#: home-manager/home-manager:1070 msgid "expire-generations expects one argument, got %d." msgstr "" -#: home-manager/home-manager:1096 +#: home-manager/home-manager:1092 msgid "Unknown command: %s" msgstr "دستور ناشناخته: %s" @@ -209,5 +213,9 @@ msgstr "دستور ناشناخته: %s" msgid "This derivation is not buildable, please run it using nix-shell." msgstr "" +#, sh-format +#~ msgid "Please set the $EDITOR environment variable" +#~ msgstr "لطفا متغیر محیطی $EDITOR را مقدار دهی کنید" + #~ msgid "Creating initial Home Manager configuration..." #~ msgstr "ایجاد تنظیمات اولیه Home-Manager..." diff --git a/home-manager/po/fi.po b/home-manager/po/fi.po index 466b6890a282..aed3b3972af9 100644 --- a/home-manager/po/fi.po +++ b/home-manager/po/fi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -17,36 +17,36 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -#: home-manager/home-manager:81 +#: home-manager/home-manager:58 msgid "No configuration file found at %s" msgstr "" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:98 home-manager/home-manager:102 -#: home-manager/home-manager:192 +#: home-manager/home-manager:75 home-manager/home-manager:79 +#: home-manager/home-manager:178 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" -#: home-manager/home-manager:109 +#: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" msgstr "" -#: home-manager/home-manager:124 +#: home-manager/home-manager:101 msgid "Home Manager not found at %s." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:132 +#: home-manager/home-manager:109 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:135 +#: home-manager/home-manager:112 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -67,38 +67,42 @@ msgid "" " $ rm -r \"%s\"" msgstr "" -#: home-manager/home-manager:174 +#: home-manager/home-manager:140 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:229 +#: home-manager/home-manager:215 msgid "Can't inspect options of a flake configuration" msgstr "" -#: home-manager/home-manager:291 home-manager/home-manager:314 -#: home-manager/home-manager:1034 +#: home-manager/home-manager:288 home-manager/home-manager:311 +#: home-manager/home-manager:1030 msgid "%s: unknown option '%s'" msgstr "" -#: home-manager/home-manager:296 home-manager/home-manager:1035 +#: home-manager/home-manager:293 home-manager/home-manager:1031 msgid "Run '%s --help' for usage help" msgstr "" -#: home-manager/home-manager:322 home-manager/home-manager:421 +#: home-manager/home-manager:319 home-manager/home-manager:423 msgid "The file %s already exists, leaving it unchanged..." msgstr "" -#: home-manager/home-manager:324 home-manager/home-manager:423 +#: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." msgstr "" -#: home-manager/home-manager:465 +#: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." msgstr "" #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:470 +#: home-manager/home-manager:472 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -109,7 +113,7 @@ msgid "" msgstr "" #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:475 +#: home-manager/home-manager:477 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -119,11 +123,11 @@ msgid "" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:486 +#: home-manager/home-manager:488 msgid "Can't instantiate a flake configuration" msgstr "" -#: home-manager/home-manager:562 +#: home-manager/home-manager:564 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -133,72 +137,72 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: home-manager/home-manager:576 +#: home-manager/home-manager:578 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "" -#: home-manager/home-manager:583 +#: home-manager/home-manager:586 #, sh-format -msgid "Please set the $EDITOR environment variable" +msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "" -#: home-manager/home-manager:598 +#: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" msgstr "" -#: home-manager/home-manager:676 +#: home-manager/home-manager:685 msgid "No generation with ID %s" msgstr "" -#: home-manager/home-manager:678 +#: home-manager/home-manager:687 msgid "Cannot remove the current generation %s" msgstr "" -#: home-manager/home-manager:680 +#: home-manager/home-manager:689 msgid "Removing generation %s" msgstr "" -#: home-manager/home-manager:699 +#: home-manager/home-manager:710 msgid "No generations to expire" msgstr "" -#: home-manager/home-manager:710 +#: home-manager/home-manager:721 msgid "No home-manager packages seem to be installed." msgstr "" -#: home-manager/home-manager:792 +#: home-manager/home-manager:803 msgid "Unknown argument %s" msgstr "" -#: home-manager/home-manager:816 +#: home-manager/home-manager:827 msgid "This will remove Home Manager from your system." msgstr "" -#: home-manager/home-manager:819 +#: home-manager/home-manager:830 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "" -#: home-manager/home-manager:823 +#: home-manager/home-manager:834 msgid "Really uninstall Home Manager?" msgstr "" -#: home-manager/home-manager:829 +#: home-manager/home-manager:840 msgid "Switching to empty Home Manager configuration..." msgstr "" -#: home-manager/home-manager:857 +#: home-manager/home-manager:855 msgid "Yay!" msgstr "" -#: home-manager/home-manager:862 +#: home-manager/home-manager:860 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "" -#: home-manager/home-manager:1074 +#: home-manager/home-manager:1070 msgid "expire-generations expects one argument, got %d." msgstr "" -#: home-manager/home-manager:1096 +#: home-manager/home-manager:1092 msgid "Unknown command: %s" msgstr "" diff --git a/home-manager/po/fr.po b/home-manager/po/fr.po index 6b1df46378d9..79218b508b48 100644 --- a/home-manager/po/fr.po +++ b/home-manager/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-12-25 10:10+0000\n" "Last-Translator: Louis Thevenet \n" "Language-Team: French 1;\n" "X-Generator: Weblate 5.4-dev\n" -#: home-manager/home-manager:81 +#: home-manager/home-manager:58 msgid "No configuration file found at %s" msgstr "Aucun fichier de configuration trouvé à l'emplacement %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:98 home-manager/home-manager:102 -#: home-manager/home-manager:192 +#: home-manager/home-manager:75 home-manager/home-manager:79 +#: home-manager/home-manager:178 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -34,18 +34,18 @@ msgstr "" "Garder votre Home Manager %s dans %s est obsolète,\n" "Veuillez le déplacer à %s" -#: home-manager/home-manager:109 +#: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" msgstr "" "Aucun fichier de configuration trouvé. Veuillez en créer un à l'emplacement " "%s" -#: home-manager/home-manager:124 +#: home-manager/home-manager:101 msgid "Home Manager not found at %s." msgstr "Home Manager indisponible à %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:132 +#: home-manager/home-manager:109 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -54,7 +54,7 @@ msgstr "" "dossier y a été trouvé." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:135 +#: home-manager/home-manager:112 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -90,38 +90,42 @@ msgstr "" "\n" "\t$ rm -r \"%s\"" -#: home-manager/home-manager:174 +#: home-manager/home-manager:140 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Impossible de trouver le dossier de profil approprié, essayé %s et %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:229 +#: home-manager/home-manager:215 msgid "Can't inspect options of a flake configuration" msgstr "Impossible d'inspecter les options de la configuration d'un flake" -#: home-manager/home-manager:291 home-manager/home-manager:314 -#: home-manager/home-manager:1034 +#: home-manager/home-manager:288 home-manager/home-manager:311 +#: home-manager/home-manager:1030 msgid "%s: unknown option '%s'" msgstr "%s : option inconnue '%s'" -#: home-manager/home-manager:296 home-manager/home-manager:1035 +#: home-manager/home-manager:293 home-manager/home-manager:1031 msgid "Run '%s --help' for usage help" msgstr "Exécuter « %s --help » pour de l'aide sur l'utilisation" -#: home-manager/home-manager:322 home-manager/home-manager:421 +#: home-manager/home-manager:319 home-manager/home-manager:423 msgid "The file %s already exists, leaving it unchanged..." msgstr "Le fichier %s existe déjà, il sera laissé inchangé..." -#: home-manager/home-manager:324 home-manager/home-manager:423 +#: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." msgstr "Création de %s ..." -#: home-manager/home-manager:465 +#: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." msgstr "Création de la génération initiale de Home Manager..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:470 +#: home-manager/home-manager:472 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -139,7 +143,7 @@ msgstr "" "essayez 'man home-configuration.nix'." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:475 +#: home-manager/home-manager:477 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -155,11 +159,11 @@ msgstr "" "si l'erreur semble être liée à Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:486 +#: home-manager/home-manager:488 msgid "Can't instantiate a flake configuration" msgstr "Impossible d'instancier une configuration flake" -#: home-manager/home-manager:562 +#: home-manager/home-manager:564 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -173,72 +177,72 @@ msgstr[1] "" "Il y a %d nouveaux éléments non lus et pertinents.\n" "Vous pouvez les lire en exécutant la commande \"%s news\"." -#: home-manager/home-manager:576 +#: home-manager/home-manager:578 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Configuration \"news.display\" inconnue \"%s\"." -#: home-manager/home-manager:583 +#: home-manager/home-manager:586 #, sh-format -msgid "Please set the $EDITOR environment variable" -msgstr "Veuillez définir la variable d'environnement $EDITOR" +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" -#: home-manager/home-manager:598 +#: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" msgstr "Impossible de lancer une compilation dans un dossier en écriture seule" -#: home-manager/home-manager:676 +#: home-manager/home-manager:685 msgid "No generation with ID %s" msgstr "Aucune génération avec l'ID %s" -#: home-manager/home-manager:678 +#: home-manager/home-manager:687 msgid "Cannot remove the current generation %s" msgstr "Impossible de supprimer la génération courante %s" -#: home-manager/home-manager:680 +#: home-manager/home-manager:689 msgid "Removing generation %s" msgstr "Suppression de la génération %s" -#: home-manager/home-manager:699 +#: home-manager/home-manager:710 msgid "No generations to expire" msgstr "Aucune génération expirée" -#: home-manager/home-manager:710 +#: home-manager/home-manager:721 msgid "No home-manager packages seem to be installed." msgstr "Aucun package home-manager ne semble être installé." -#: home-manager/home-manager:792 +#: home-manager/home-manager:803 msgid "Unknown argument %s" msgstr "Argument inconnu %s" -#: home-manager/home-manager:816 +#: home-manager/home-manager:827 msgid "This will remove Home Manager from your system." msgstr "Cela va supprimer Home Manager de votre système." -#: home-manager/home-manager:819 +#: home-manager/home-manager:830 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "C'est un essai, rien ne sera réellement désinstallé." -#: home-manager/home-manager:823 +#: home-manager/home-manager:834 msgid "Really uninstall Home Manager?" msgstr "Voulez-vous vraiment désinstaller Home Manager ?" -#: home-manager/home-manager:829 +#: home-manager/home-manager:840 msgid "Switching to empty Home Manager configuration..." msgstr "Changement vers une configuration vierge de Home Manager..." -#: home-manager/home-manager:857 +#: home-manager/home-manager:855 msgid "Yay!" msgstr "Yay !" -#: home-manager/home-manager:862 +#: home-manager/home-manager:860 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager est désinstallé mais votre home.nix reste intact." -#: home-manager/home-manager:1074 +#: home-manager/home-manager:1070 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations attend un argument, a obtenu %d." -#: home-manager/home-manager:1096 +#: home-manager/home-manager:1092 msgid "Unknown command: %s" msgstr "Commande inconnue : %s" @@ -246,6 +250,10 @@ msgstr "Commande inconnue : %s" msgid "This derivation is not buildable, please run it using nix-shell." msgstr "Cette dérivation ne peut être construite, essayez avec nix-shell." +#, sh-format +#~ msgid "Please set the $EDITOR environment variable" +#~ msgstr "Veuillez définir la variable d'environnement $EDITOR" + #~ msgid "Sorry, this command is not yet supported in flake setup" #~ msgstr "" #~ "Désolé, cette commande n'est pas encore prise en charge dans la " diff --git a/home-manager/po/id.po b/home-manager/po/id.po index a36e493d8d46..f924bd6b5f43 100644 --- a/home-manager/po/id.po +++ b/home-manager/po/id.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-10-04 06:02+0000\n" "Last-Translator: Reza Almanda \n" "Language-Team: Indonesian \n" "Language-Team: Italian \n" "Language-Team: Japanese \n" "Language-Team: Korean \n" "Language-Team: Lithuanian \n" "Language-Team: Norwegian Bokmål \n" "Language-Team: Dutch \n" "Language-Team: Polish =20) ? 1 : 2;\n" "X-Generator: Weblate 5.0.1-dev\n" -#: home-manager/home-manager:81 +#: home-manager/home-manager:58 msgid "No configuration file found at %s" msgstr "Nie znaleziono pliku konfiguracyjnego %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:98 home-manager/home-manager:102 -#: home-manager/home-manager:192 +#: home-manager/home-manager:75 home-manager/home-manager:79 +#: home-manager/home-manager:178 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -35,16 +35,16 @@ msgstr "" "Przechowywanie %s Home Managera w %s jest przestarzałe,\n" "proszę przenieść go do %s" -#: home-manager/home-manager:109 +#: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" msgstr "Nie znaleziono pliku konfiguracyjnego. Proszę utworzyć plik %s" -#: home-manager/home-manager:124 +#: home-manager/home-manager:101 msgid "Home Manager not found at %s." msgstr "Home Manager nie znaleziony w %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:132 +#: home-manager/home-manager:109 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -53,7 +53,7 @@ msgstr "" "katalog." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:135 +#: home-manager/home-manager:112 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -93,38 +93,42 @@ msgstr "" "\n" " $ rm -r \"%s\"" -#: home-manager/home-manager:174 +#: home-manager/home-manager:140 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Nie można znaleźć odpowiedniego katalogu profilu, próbowano %s i %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:229 +#: home-manager/home-manager:215 msgid "Can't inspect options of a flake configuration" msgstr "Nie mogę sprawdzić konfiguracji flake'a" -#: home-manager/home-manager:291 home-manager/home-manager:314 -#: home-manager/home-manager:1034 +#: home-manager/home-manager:288 home-manager/home-manager:311 +#: home-manager/home-manager:1030 msgid "%s: unknown option '%s'" msgstr "%s: nieznana opcja „%s”" -#: home-manager/home-manager:296 home-manager/home-manager:1035 +#: home-manager/home-manager:293 home-manager/home-manager:1031 msgid "Run '%s --help' for usage help" msgstr "Uruchom „%s --help” by otrzymać pomoc" -#: home-manager/home-manager:322 home-manager/home-manager:421 +#: home-manager/home-manager:319 home-manager/home-manager:423 msgid "The file %s already exists, leaving it unchanged..." msgstr "Plik %s już istnieje, pozostawianie go bez zmian..." -#: home-manager/home-manager:324 home-manager/home-manager:423 +#: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." msgstr "Tworzenie %s..." -#: home-manager/home-manager:465 +#: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." msgstr "Tworzenie pierwotnej generacji Home Managera..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:470 +#: home-manager/home-manager:472 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -142,7 +146,7 @@ msgstr "" "sprawdzić wszystkie możliwe opcje konfiguracyjne." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:475 +#: home-manager/home-manager:477 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -157,11 +161,11 @@ msgstr "" "jeśli myślisz, że problem spowodowany jest przez błąd Home Managera." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:486 +#: home-manager/home-manager:488 msgid "Can't instantiate a flake configuration" msgstr "Nie mogę utworzyć instancji konfiguracji flake'a" -#: home-manager/home-manager:562 +#: home-manager/home-manager:564 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -178,73 +182,73 @@ msgstr[2] "" "Jest %d nieodczytanych wiadomości.\n" "Możesz je odczytać uruchamiając „%s news”." -#: home-manager/home-manager:576 +#: home-manager/home-manager:578 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Nieznane ustawienie „%s” „news.display”." -#: home-manager/home-manager:583 +#: home-manager/home-manager:586 #, sh-format -msgid "Please set the $EDITOR environment variable" -msgstr "Proszę ustawić zmienną środowiskową $EDITOR" +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" -#: home-manager/home-manager:598 +#: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" msgstr "Nie mogę uruchomić budowania w katalogu tylko-do-odczytu" -#: home-manager/home-manager:676 +#: home-manager/home-manager:685 msgid "No generation with ID %s" msgstr "Brak generacji z ID %s" -#: home-manager/home-manager:678 +#: home-manager/home-manager:687 msgid "Cannot remove the current generation %s" msgstr "Nie mogę usunąć bieżącej generacji %s" -#: home-manager/home-manager:680 +#: home-manager/home-manager:689 msgid "Removing generation %s" msgstr "Usuwanie generacji %s" -#: home-manager/home-manager:699 +#: home-manager/home-manager:710 msgid "No generations to expire" msgstr "Brak wygasających generacji" -#: home-manager/home-manager:710 +#: home-manager/home-manager:721 msgid "No home-manager packages seem to be installed." msgstr "Pakiety home-manager nie wydają się być zainstalowane." -#: home-manager/home-manager:792 +#: home-manager/home-manager:803 msgid "Unknown argument %s" msgstr "Nieznany argument %s" -#: home-manager/home-manager:816 +#: home-manager/home-manager:827 msgid "This will remove Home Manager from your system." msgstr "To usunie Home Managera z twojego systemu." -#: home-manager/home-manager:819 +#: home-manager/home-manager:830 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "To jest próba, faktycznie nic nie będzie usunięte." -#: home-manager/home-manager:823 +#: home-manager/home-manager:834 msgid "Really uninstall Home Manager?" msgstr "Jesteś pewien usunięcia Home Managera?" -#: home-manager/home-manager:829 +#: home-manager/home-manager:840 msgid "Switching to empty Home Manager configuration..." msgstr "Przełączanie do pustej konfiguracji Home Managera..." -#: home-manager/home-manager:857 +#: home-manager/home-manager:855 msgid "Yay!" msgstr "Jej!" -#: home-manager/home-manager:862 +#: home-manager/home-manager:860 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "" "Home Manager jest usunięty ale twój home.nix jest pozostawiony nietknięty." -#: home-manager/home-manager:1074 +#: home-manager/home-manager:1070 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations oczekuje jednego argumentu, otrzymano %d." -#: home-manager/home-manager:1096 +#: home-manager/home-manager:1092 msgid "Unknown command: %s" msgstr "Nieznana komenda: %s" @@ -253,6 +257,10 @@ msgid "This derivation is not buildable, please run it using nix-shell." msgstr "" "Ta paczka (derivation) nie da się budować, proszę uruchom używając nix-shell." +#, sh-format +#~ msgid "Please set the $EDITOR environment variable" +#~ msgstr "Proszę ustawić zmienną środowiskową $EDITOR" + #~ msgid "Sorry, this command is not yet supported in flake setup" #~ msgstr "" #~ "Przepraszamy, ta komenda nie jest jeszcze obsługiwana w konfiguracji flake" diff --git a/home-manager/po/pt.po b/home-manager/po/pt.po index 251da89b3ab5..58eecee68b02 100644 --- a/home-manager/po/pt.po +++ b/home-manager/po/pt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-12-11 16:06+0000\n" "Last-Translator: Lucas Eduardo \n" "Language-Team: Portuguese 1;\n" "X-Generator: Weblate 5.3-dev\n" -#: home-manager/home-manager:81 +#: home-manager/home-manager:58 msgid "No configuration file found at %s" msgstr "Nenhum ficheiro de configuração encontrado em %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:98 home-manager/home-manager:102 -#: home-manager/home-manager:192 +#: home-manager/home-manager:75 home-manager/home-manager:79 +#: home-manager/home-manager:178 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -34,16 +34,16 @@ msgstr "" "Manter o %s do seu Home Manager em %s já não é suportado,\n" "por favor mova-o para %s" -#: home-manager/home-manager:109 +#: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" msgstr "Ficheiro de configuração não encontrado. Por favor crie um em %s" -#: home-manager/home-manager:124 +#: home-manager/home-manager:101 msgid "Home Manager not found at %s." msgstr "Home Manager não foi encontrado em %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:132 +#: home-manager/home-manager:109 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -52,7 +52,7 @@ msgstr "" "diretório foi encontrado lá." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:135 +#: home-manager/home-manager:112 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -91,40 +91,44 @@ msgstr "" "\n" " $ rm -r \"%s\"" -#: home-manager/home-manager:174 +#: home-manager/home-manager:140 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" "Não foi possível encontrar uma diretoria de perfil apropriada, foi tentado " "%s e %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:229 +#: home-manager/home-manager:215 msgid "Can't inspect options of a flake configuration" msgstr "Não é possivel inspecionar a opção de configuração do flake" -#: home-manager/home-manager:291 home-manager/home-manager:314 -#: home-manager/home-manager:1034 +#: home-manager/home-manager:288 home-manager/home-manager:311 +#: home-manager/home-manager:1030 msgid "%s: unknown option '%s'" msgstr "%s: opção não reconhecida '%s'" -#: home-manager/home-manager:296 home-manager/home-manager:1035 +#: home-manager/home-manager:293 home-manager/home-manager:1031 msgid "Run '%s --help' for usage help" msgstr "Execute '%s --help' para instruções de uso" -#: home-manager/home-manager:322 home-manager/home-manager:421 +#: home-manager/home-manager:319 home-manager/home-manager:423 msgid "The file %s already exists, leaving it unchanged..." msgstr "O arquivo %s já existe, deixando do jeito que está..." -#: home-manager/home-manager:324 home-manager/home-manager:423 +#: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." msgstr "Criando %s..." -#: home-manager/home-manager:465 +#: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." msgstr "Criando a geração inicial do Home Manager..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:470 +#: home-manager/home-manager:472 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -141,7 +145,7 @@ msgstr "" "ver todas as opções disponíveis." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:475 +#: home-manager/home-manager:477 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -156,11 +160,11 @@ msgstr "" "se o erro lhe parecer ser um problema do Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:486 +#: home-manager/home-manager:488 msgid "Can't instantiate a flake configuration" msgstr "Não foi possível instanciar a configuração de flake" -#: home-manager/home-manager:562 +#: home-manager/home-manager:564 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -174,72 +178,72 @@ msgstr[1] "" "Há %d novos itens relevants não lidos\n" "Leia executando o comando \"%s news\"." -#: home-manager/home-manager:576 +#: home-manager/home-manager:578 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Valor \"%s\" para configuração \"news.display\" não reconhecido." -#: home-manager/home-manager:583 +#: home-manager/home-manager:586 #, sh-format -msgid "Please set the $EDITOR environment variable" -msgstr "Por favor defina a variável de ambiente $EDITOR" +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" -#: home-manager/home-manager:598 +#: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" msgstr "Não é possível fazer o build num diretório somente leitura" -#: home-manager/home-manager:676 +#: home-manager/home-manager:685 msgid "No generation with ID %s" msgstr "Nenhuma geração com ID %s" -#: home-manager/home-manager:678 +#: home-manager/home-manager:687 msgid "Cannot remove the current generation %s" msgstr "Não foi possível remover a geração atual %s" -#: home-manager/home-manager:680 +#: home-manager/home-manager:689 msgid "Removing generation %s" msgstr "A remover a geração %s" -#: home-manager/home-manager:699 +#: home-manager/home-manager:710 msgid "No generations to expire" msgstr "Nenhuma geração a expirar" -#: home-manager/home-manager:710 +#: home-manager/home-manager:721 msgid "No home-manager packages seem to be installed." msgstr "Nenhum pacote parece instalado com home-manager." -#: home-manager/home-manager:792 +#: home-manager/home-manager:803 msgid "Unknown argument %s" msgstr "Argumento desconhecido %s" -#: home-manager/home-manager:816 +#: home-manager/home-manager:827 msgid "This will remove Home Manager from your system." msgstr "Isto irá remover o Home Manager do seu sistema." -#: home-manager/home-manager:819 +#: home-manager/home-manager:830 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "Essa é uma execução de teste, nada de fato será desinstalado." -#: home-manager/home-manager:823 +#: home-manager/home-manager:834 msgid "Really uninstall Home Manager?" msgstr "Confirma a desinstalação do Home Manager?" -#: home-manager/home-manager:829 +#: home-manager/home-manager:840 msgid "Switching to empty Home Manager configuration..." msgstr "Trocando para configuração vazia do Home Manager..." -#: home-manager/home-manager:857 +#: home-manager/home-manager:855 msgid "Yay!" msgstr "Boa!" -#: home-manager/home-manager:862 +#: home-manager/home-manager:860 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager foi desinstalado, mas o seu home.nix foi deixado intacto." -#: home-manager/home-manager:1074 +#: home-manager/home-manager:1070 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations espera um argumento, recebeu %d." -#: home-manager/home-manager:1096 +#: home-manager/home-manager:1092 msgid "Unknown command: %s" msgstr "Comando não reconhecido: %s" @@ -249,6 +253,10 @@ msgstr "" "O build dessa derivation não pode ser feito, por favor rode usando o nix-" "shell." +#, sh-format +#~ msgid "Please set the $EDITOR environment variable" +#~ msgstr "Por favor defina a variável de ambiente $EDITOR" + #~ msgid "Creating initial Home Manager configuration..." #~ msgstr "Criando a configuração inicial do Home Manager..." diff --git a/home-manager/po/pt_BR.po b/home-manager/po/pt_BR.po index aa311d80cfd6..22412dcb4c4a 100644 --- a/home-manager/po/pt_BR.po +++ b/home-manager/po/pt_BR.po @@ -7,11 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-11-30 15:04+0000\n" "Last-Translator: Gabriel Fontes \n" -"Language-Team: Portuguese (Brazil) \n" +"Language-Team: Portuguese (Brazil) \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,14 +19,14 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Weblate 5.3-dev\n" -#: home-manager/home-manager:81 +#: home-manager/home-manager:58 msgid "No configuration file found at %s" msgstr "Nenhum arquivo de configuração encontrado no %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:98 home-manager/home-manager:102 -#: home-manager/home-manager:192 +#: home-manager/home-manager:75 home-manager/home-manager:79 +#: home-manager/home-manager:178 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -34,16 +34,16 @@ msgstr "" "Manter seu Home Manager %s em %s foi descontinuado,\n" "por favor mova-o para %s" -#: home-manager/home-manager:109 +#: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" msgstr "Arquivo de configuração não encontrado. Por favor crie um em %s" -#: home-manager/home-manager:124 +#: home-manager/home-manager:101 msgid "Home Manager not found at %s." msgstr "Home Manager não encontrado em %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:132 +#: home-manager/home-manager:109 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -52,7 +52,7 @@ msgstr "" "algum arquivo/diretório nele." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:135 +#: home-manager/home-manager:112 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -92,39 +92,43 @@ msgstr "" "\n" " $ rm -r \"%s\"" -#: home-manager/home-manager:174 +#: home-manager/home-manager:140 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" "Não foi possível encontrar um diretório de perfil apropriado, tentei %s e %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:229 +#: home-manager/home-manager:215 msgid "Can't inspect options of a flake configuration" msgstr "Não é possivel inspecionar a opção de configuração do flake" -#: home-manager/home-manager:291 home-manager/home-manager:314 -#: home-manager/home-manager:1034 +#: home-manager/home-manager:288 home-manager/home-manager:311 +#: home-manager/home-manager:1030 msgid "%s: unknown option '%s'" msgstr "%s: opção não reconhecida '%s'" -#: home-manager/home-manager:296 home-manager/home-manager:1035 +#: home-manager/home-manager:293 home-manager/home-manager:1031 msgid "Run '%s --help' for usage help" msgstr "Execute '%s --help' para instruções de uso" -#: home-manager/home-manager:322 home-manager/home-manager:421 +#: home-manager/home-manager:319 home-manager/home-manager:423 msgid "The file %s already exists, leaving it unchanged..." msgstr "O arquivo %s já existe, mantendo ele sem modificações..." -#: home-manager/home-manager:324 home-manager/home-manager:423 +#: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." msgstr "Criando %s..." -#: home-manager/home-manager:465 +#: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." msgstr "Criando a geração inicial do Home Manager..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:470 +#: home-manager/home-manager:472 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -142,7 +146,7 @@ msgstr "" "ver todas as opções disponíveis." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:475 +#: home-manager/home-manager:477 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -157,11 +161,11 @@ msgstr "" "se o erro lhe parecer ser um problema do Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:486 +#: home-manager/home-manager:488 msgid "Can't instantiate a flake configuration" msgstr "Não foi possível instanciar a configuração de flake" -#: home-manager/home-manager:562 +#: home-manager/home-manager:564 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -175,72 +179,72 @@ msgstr[1] "" "Há %d novos itens relevants não lidos\n" "Leia executando o comando \"%s news\"." -#: home-manager/home-manager:576 +#: home-manager/home-manager:578 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Valor \"%s\" para configuração \"news.display\" não reconhecido." -#: home-manager/home-manager:583 +#: home-manager/home-manager:586 #, sh-format -msgid "Please set the $EDITOR environment variable" -msgstr "Por favor defina a variável de ambiente $EDITOR" +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" -#: home-manager/home-manager:598 +#: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" msgstr "Não é possível fazer o build em um diretório somente leitura" -#: home-manager/home-manager:676 +#: home-manager/home-manager:685 msgid "No generation with ID %s" msgstr "Nenhuma geração com ID %s" -#: home-manager/home-manager:678 +#: home-manager/home-manager:687 msgid "Cannot remove the current generation %s" msgstr "Não foi possível remover a geração atual %s" -#: home-manager/home-manager:680 +#: home-manager/home-manager:689 msgid "Removing generation %s" msgstr "Removendo geração %s" -#: home-manager/home-manager:699 +#: home-manager/home-manager:710 msgid "No generations to expire" msgstr "Nenhuma geração a expirar" -#: home-manager/home-manager:710 +#: home-manager/home-manager:721 msgid "No home-manager packages seem to be installed." msgstr "Nenhum pacote parece instalado com home-manager." -#: home-manager/home-manager:792 +#: home-manager/home-manager:803 msgid "Unknown argument %s" msgstr "Argumento desconhecido %s" -#: home-manager/home-manager:816 +#: home-manager/home-manager:827 msgid "This will remove Home Manager from your system." msgstr "Isso irá remover o Home Manager do seu sistema." -#: home-manager/home-manager:819 +#: home-manager/home-manager:830 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "Essa é uma execução de teste, nada de fato será desinstalado." -#: home-manager/home-manager:823 +#: home-manager/home-manager:834 msgid "Really uninstall Home Manager?" msgstr "Confirma a desinstalação do Home Manager?" -#: home-manager/home-manager:829 +#: home-manager/home-manager:840 msgid "Switching to empty Home Manager configuration..." msgstr "Trocando para configuração vazia do Home Manager..." -#: home-manager/home-manager:857 +#: home-manager/home-manager:855 msgid "Yay!" msgstr "Boa!" -#: home-manager/home-manager:862 +#: home-manager/home-manager:860 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager foi desinstalado, mas o seu home.nix foi deixado intacto." -#: home-manager/home-manager:1074 +#: home-manager/home-manager:1070 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations espera um argumento, recebeu %d." -#: home-manager/home-manager:1096 +#: home-manager/home-manager:1092 msgid "Unknown command: %s" msgstr "Comando não reconhecido: %s" @@ -250,6 +254,10 @@ msgstr "" "O build dessa derivation não pode ser feito, por favor rode usando o nix-" "shell." +#, sh-format +#~ msgid "Please set the $EDITOR environment variable" +#~ msgstr "Por favor defina a variável de ambiente $EDITOR" + #~ msgid "Creating initial Home Manager configuration..." #~ msgstr "Criando a configuração inicial do Home Manager..." diff --git a/home-manager/po/ro.po b/home-manager/po/ro.po index b58a2eb605d1..59f3f4908c4c 100644 --- a/home-manager/po/ro.po +++ b/home-manager/po/ro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-08-11 19:50+0000\n" "Last-Translator: HeartBlin913861820c094e37 \n" "Language-Team: Romanian \n" "Language-Team: Russian =20) ? 1 : 2;\n" "X-Generator: Weblate 5.3-dev\n" -#: home-manager/home-manager:81 +#: home-manager/home-manager:58 msgid "No configuration file found at %s" msgstr "Не найден файл конфигурации в %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:98 home-manager/home-manager:102 -#: home-manager/home-manager:192 +#: home-manager/home-manager:75 home-manager/home-manager:79 +#: home-manager/home-manager:178 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -35,16 +35,16 @@ msgstr "" "Файл %s вашего Home Manager находится в устаревшем месте %s\n" "пожалуйста, переместите его в %s" -#: home-manager/home-manager:109 +#: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" msgstr "Не найден файл конфигурации. Пожалуйста, создайте его в %s" -#: home-manager/home-manager:124 +#: home-manager/home-manager:101 msgid "Home Manager not found at %s." msgstr "Home Manager не был найден в %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:132 +#: home-manager/home-manager:109 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -53,7 +53,7 @@ msgstr "" "файл или папка." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:135 +#: home-manager/home-manager:112 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -92,38 +92,42 @@ msgstr "" "\n" " $ rm -r \"%s\"" -#: home-manager/home-manager:174 +#: home-manager/home-manager:140 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Не найдена подходящая директория профиля, пробовали %s и %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:229 +#: home-manager/home-manager:215 msgid "Can't inspect options of a flake configuration" msgstr "Не могу получить опции для flake-конфигурации" -#: home-manager/home-manager:291 home-manager/home-manager:314 -#: home-manager/home-manager:1034 +#: home-manager/home-manager:288 home-manager/home-manager:311 +#: home-manager/home-manager:1030 msgid "%s: unknown option '%s'" msgstr "%s: неизвестная опция '%s'" -#: home-manager/home-manager:296 home-manager/home-manager:1035 +#: home-manager/home-manager:293 home-manager/home-manager:1031 msgid "Run '%s --help' for usage help" msgstr "Выполните '%s --help', чтобы получить справку" -#: home-manager/home-manager:322 home-manager/home-manager:421 +#: home-manager/home-manager:319 home-manager/home-manager:423 msgid "The file %s already exists, leaving it unchanged..." msgstr "Файл %s уже существует и не будет изменен..." -#: home-manager/home-manager:324 home-manager/home-manager:423 +#: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." msgstr "Создание %s..." -#: home-manager/home-manager:465 +#: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." msgstr "Создаю начальное поколение Home Manager..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:470 +#: home-manager/home-manager:472 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -140,7 +144,7 @@ msgstr "" "Выполните 'man home-configuration.nix', чтобы увидеть доступные опции." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:475 +#: home-manager/home-manager:477 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -155,11 +159,11 @@ msgstr "" "если считаете, что в ошибке виноват Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:486 +#: home-manager/home-manager:488 msgid "Can't instantiate a flake configuration" msgstr "Не могу создать экземляр для flake-конфигурации" -#: home-manager/home-manager:562 +#: home-manager/home-manager:564 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -176,72 +180,72 @@ msgstr[2] "" "У вас есть %d непрочитанных и релевантных новостей.\n" "Прочтите их, выполнив команду \"%s news\"." -#: home-manager/home-manager:576 +#: home-manager/home-manager:578 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Неизвестное значение \"news.display\": \"%s\"." -#: home-manager/home-manager:583 +#: home-manager/home-manager:586 #, sh-format -msgid "Please set the $EDITOR environment variable" -msgstr "Пожалуйста, определите переменную среды $EDITOR" +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" -#: home-manager/home-manager:598 +#: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" msgstr "Не могу начать сборку в директории, защищённой от записи" -#: home-manager/home-manager:676 +#: home-manager/home-manager:685 msgid "No generation with ID %s" msgstr "Поколение под номером %s не существует" -#: home-manager/home-manager:678 +#: home-manager/home-manager:687 msgid "Cannot remove the current generation %s" msgstr "Не могу удалить текущее поколение %s" -#: home-manager/home-manager:680 +#: home-manager/home-manager:689 msgid "Removing generation %s" msgstr "Удаляю поколение %s" -#: home-manager/home-manager:699 +#: home-manager/home-manager:710 msgid "No generations to expire" msgstr "Нет поколений, которые можно просрочить" -#: home-manager/home-manager:710 +#: home-manager/home-manager:721 msgid "No home-manager packages seem to be installed." msgstr "Не обнаружено пакетов, установленных через home-manager." -#: home-manager/home-manager:792 +#: home-manager/home-manager:803 msgid "Unknown argument %s" msgstr "Неизвестный аргумент %s" -#: home-manager/home-manager:816 +#: home-manager/home-manager:827 msgid "This will remove Home Manager from your system." msgstr "Это удалит Home Manager из вашей системы." -#: home-manager/home-manager:819 +#: home-manager/home-manager:830 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "Это пробный запуск, на самом деле ничего не удаляется." -#: home-manager/home-manager:823 +#: home-manager/home-manager:834 msgid "Really uninstall Home Manager?" msgstr "Действительно хотите удалить Home Manager?" -#: home-manager/home-manager:829 +#: home-manager/home-manager:840 msgid "Switching to empty Home Manager configuration..." msgstr "Переключаюсь на пустую конфигурацию Home Manager..." -#: home-manager/home-manager:857 +#: home-manager/home-manager:855 msgid "Yay!" msgstr "Ура!" -#: home-manager/home-manager:862 +#: home-manager/home-manager:860 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager удалён, но ваш home.nix остался нетронутым." -#: home-manager/home-manager:1074 +#: home-manager/home-manager:1070 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations требует один аргумент, но передано %d." -#: home-manager/home-manager:1096 +#: home-manager/home-manager:1092 msgid "Unknown command: %s" msgstr "Неизвестная команда: %s" @@ -250,6 +254,10 @@ msgid "This derivation is not buildable, please run it using nix-shell." msgstr "" "Это определение нельзя собрать. Пожалуйста, запустите его через nix-shell." +#, sh-format +#~ msgid "Please set the $EDITOR environment variable" +#~ msgstr "Пожалуйста, определите переменную среды $EDITOR" + #~ msgid "Creating initial Home Manager configuration..." #~ msgstr "Создаю начальную конфигурацию Home Manager..." diff --git a/home-manager/po/sv.po b/home-manager/po/sv.po index 5d7d65bac93f..bf3f73097be8 100644 --- a/home-manager/po/sv.po +++ b/home-manager/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-07-17 10:03+0000\n" "Last-Translator: Luna Jernberg \n" "Language-Team: Swedish \n" @@ -20,36 +20,36 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Weblate 5.0.2\n" -#: home-manager/home-manager:81 +#: home-manager/home-manager:58 msgid "No configuration file found at %s" msgstr "ไม่พบการตั้งค่าที่ %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:98 home-manager/home-manager:102 -#: home-manager/home-manager:192 +#: home-manager/home-manager:75 home-manager/home-manager:79 +#: home-manager/home-manager:178 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" -#: home-manager/home-manager:109 +#: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" msgstr "" -#: home-manager/home-manager:124 +#: home-manager/home-manager:101 msgid "Home Manager not found at %s." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:132 +#: home-manager/home-manager:109 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:135 +#: home-manager/home-manager:112 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -70,38 +70,42 @@ msgid "" " $ rm -r \"%s\"" msgstr "" -#: home-manager/home-manager:174 +#: home-manager/home-manager:140 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:229 +#: home-manager/home-manager:215 msgid "Can't inspect options of a flake configuration" msgstr "" -#: home-manager/home-manager:291 home-manager/home-manager:314 -#: home-manager/home-manager:1034 +#: home-manager/home-manager:288 home-manager/home-manager:311 +#: home-manager/home-manager:1030 msgid "%s: unknown option '%s'" msgstr "" -#: home-manager/home-manager:296 home-manager/home-manager:1035 +#: home-manager/home-manager:293 home-manager/home-manager:1031 msgid "Run '%s --help' for usage help" msgstr "" -#: home-manager/home-manager:322 home-manager/home-manager:421 +#: home-manager/home-manager:319 home-manager/home-manager:423 msgid "The file %s already exists, leaving it unchanged..." msgstr "" -#: home-manager/home-manager:324 home-manager/home-manager:423 +#: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." msgstr "" -#: home-manager/home-manager:465 +#: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." msgstr "" #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:470 +#: home-manager/home-manager:472 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -112,7 +116,7 @@ msgid "" msgstr "" #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:475 +#: home-manager/home-manager:477 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -122,11 +126,11 @@ msgid "" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:486 +#: home-manager/home-manager:488 msgid "Can't instantiate a flake configuration" msgstr "" -#: home-manager/home-manager:562 +#: home-manager/home-manager:564 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -136,72 +140,72 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: home-manager/home-manager:576 +#: home-manager/home-manager:578 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "" -#: home-manager/home-manager:583 +#: home-manager/home-manager:586 #, sh-format -msgid "Please set the $EDITOR environment variable" +msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "" -#: home-manager/home-manager:598 +#: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" msgstr "" -#: home-manager/home-manager:676 +#: home-manager/home-manager:685 msgid "No generation with ID %s" msgstr "" -#: home-manager/home-manager:678 +#: home-manager/home-manager:687 msgid "Cannot remove the current generation %s" msgstr "" -#: home-manager/home-manager:680 +#: home-manager/home-manager:689 msgid "Removing generation %s" msgstr "" -#: home-manager/home-manager:699 +#: home-manager/home-manager:710 msgid "No generations to expire" msgstr "" -#: home-manager/home-manager:710 +#: home-manager/home-manager:721 msgid "No home-manager packages seem to be installed." msgstr "" -#: home-manager/home-manager:792 +#: home-manager/home-manager:803 msgid "Unknown argument %s" msgstr "" -#: home-manager/home-manager:816 +#: home-manager/home-manager:827 msgid "This will remove Home Manager from your system." msgstr "" -#: home-manager/home-manager:819 +#: home-manager/home-manager:830 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "" -#: home-manager/home-manager:823 +#: home-manager/home-manager:834 msgid "Really uninstall Home Manager?" msgstr "" -#: home-manager/home-manager:829 +#: home-manager/home-manager:840 msgid "Switching to empty Home Manager configuration..." msgstr "" -#: home-manager/home-manager:857 +#: home-manager/home-manager:855 msgid "Yay!" msgstr "" -#: home-manager/home-manager:862 +#: home-manager/home-manager:860 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "" -#: home-manager/home-manager:1074 +#: home-manager/home-manager:1070 msgid "expire-generations expects one argument, got %d." msgstr "" -#: home-manager/home-manager:1096 +#: home-manager/home-manager:1092 msgid "Unknown command: %s" msgstr "" diff --git a/home-manager/po/tr.po b/home-manager/po/tr.po index aaec4da63af3..9a6d15119721 100644 --- a/home-manager/po/tr.po +++ b/home-manager/po/tr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2024-02-04 13:10+0000\n" "Last-Translator: Oğuz Ersen \n" "Language-Team: Turkish \n" "Language-Team: Ukrainian =2 && n" -"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" "X-Generator: Weblate 5.0-dev\n" -#: home-manager/home-manager:81 +#: home-manager/home-manager:58 msgid "No configuration file found at %s" msgstr "Файл конфігурації не знайдено в %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:98 home-manager/home-manager:102 -#: home-manager/home-manager:192 +#: home-manager/home-manager:75 home-manager/home-manager:79 +#: home-manager/home-manager:178 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -35,16 +35,16 @@ msgstr "" "Збереження вашого Home Manager %s у %s є застарілим,\n" "будь ласка, перемістіть його до %s" -#: home-manager/home-manager:109 +#: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" msgstr "Файл конфігурації не знайдено. Будь ласка, створіть його в %s" -#: home-manager/home-manager:124 +#: home-manager/home-manager:101 msgid "Home Manager not found at %s." msgstr "Home Manager не знайдено на %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:132 +#: home-manager/home-manager:109 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -52,7 +52,7 @@ msgstr "" "Резервний шлях до Home Manager %s застарів, і там було знайдено файл/каталог." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:135 +#: home-manager/home-manager:112 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -91,38 +91,42 @@ msgstr "" "\n" " $ rm -r \"%s\"" -#: home-manager/home-manager:174 +#: home-manager/home-manager:140 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Не вдалося знайти відповідний каталог профілю, спробував %s і %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:229 +#: home-manager/home-manager:215 msgid "Can't inspect options of a flake configuration" msgstr "Неможливо перевірити параметри flake-конфігурації" -#: home-manager/home-manager:291 home-manager/home-manager:314 -#: home-manager/home-manager:1034 +#: home-manager/home-manager:288 home-manager/home-manager:311 +#: home-manager/home-manager:1030 msgid "%s: unknown option '%s'" msgstr "%s: невідомий параметр '%s'" -#: home-manager/home-manager:296 home-manager/home-manager:1035 +#: home-manager/home-manager:293 home-manager/home-manager:1031 msgid "Run '%s --help' for usage help" msgstr "Запустіть '%s --help' для отримання довідки про використання" -#: home-manager/home-manager:322 home-manager/home-manager:421 +#: home-manager/home-manager:319 home-manager/home-manager:423 msgid "The file %s already exists, leaving it unchanged..." msgstr "Файл %s вже існує, залишаючи його незмінним..." -#: home-manager/home-manager:324 home-manager/home-manager:423 +#: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." msgstr "Створення %s..." -#: home-manager/home-manager:465 +#: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." msgstr "Створення початкової генерації Home Manager..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:470 +#: home-manager/home-manager:472 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -140,7 +144,7 @@ msgstr "" "переглянути всі доступні варіанти." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:475 +#: home-manager/home-manager:477 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -155,11 +159,11 @@ msgstr "" "якщо здається, що помилка сталася через Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:486 +#: home-manager/home-manager:488 msgid "Can't instantiate a flake configuration" msgstr "Не вдається створити екземпляр flake-конфігурації" -#: home-manager/home-manager:562 +#: home-manager/home-manager:564 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -176,72 +180,72 @@ msgstr[2] "" "Є %d непрочитаних і ревалентних новин.\n" "Прочитайте їх, виконавши команду \"%s news\"." -#: home-manager/home-manager:576 +#: home-manager/home-manager:578 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Невідоме налаштування \"news.display\" \"%s\"." -#: home-manager/home-manager:583 +#: home-manager/home-manager:586 #, sh-format -msgid "Please set the $EDITOR environment variable" -msgstr "Будь ласка, встановіть змінну середовища $EDITOR" +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" -#: home-manager/home-manager:598 +#: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" msgstr "Неможливо запустити збірку в каталозі, доступному лише для читання" -#: home-manager/home-manager:676 +#: home-manager/home-manager:685 msgid "No generation with ID %s" msgstr "Немає генерації з ID %s" -#: home-manager/home-manager:678 +#: home-manager/home-manager:687 msgid "Cannot remove the current generation %s" msgstr "Не вдається видалити поточну генерацію %s" -#: home-manager/home-manager:680 +#: home-manager/home-manager:689 msgid "Removing generation %s" msgstr "Видалення генерації %s" -#: home-manager/home-manager:699 +#: home-manager/home-manager:710 msgid "No generations to expire" msgstr "Немає генерацій, термін дії яких закінчується" -#: home-manager/home-manager:710 +#: home-manager/home-manager:721 msgid "No home-manager packages seem to be installed." msgstr "Здається, не встановлено жодних пакунків home-manager." -#: home-manager/home-manager:792 +#: home-manager/home-manager:803 msgid "Unknown argument %s" msgstr "Невідомий аргумент %s" -#: home-manager/home-manager:816 +#: home-manager/home-manager:827 msgid "This will remove Home Manager from your system." msgstr "Це призведе до видалення Home Manager з вашої системи." -#: home-manager/home-manager:819 +#: home-manager/home-manager:830 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "Це пробний запуск, насправді нічого не буде видалено." -#: home-manager/home-manager:823 +#: home-manager/home-manager:834 msgid "Really uninstall Home Manager?" msgstr "Дійсно видаліть Home Manager?" -#: home-manager/home-manager:829 +#: home-manager/home-manager:840 msgid "Switching to empty Home Manager configuration..." msgstr "Перехід до порожньої конфігурації Home Manager..." -#: home-manager/home-manager:857 +#: home-manager/home-manager:855 msgid "Yay!" msgstr "Ура!" -#: home-manager/home-manager:862 +#: home-manager/home-manager:860 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager буде видалено, але ваш home.nix залишиться недоторканим." -#: home-manager/home-manager:1074 +#: home-manager/home-manager:1070 msgid "expire-generations expects one argument, got %d." msgstr "expire-generation очікує один аргумент, отримав %d." -#: home-manager/home-manager:1096 +#: home-manager/home-manager:1092 msgid "Unknown command: %s" msgstr "Невідома команда: %s" @@ -250,6 +254,10 @@ msgid "This derivation is not buildable, please run it using nix-shell." msgstr "" "Цю похідну не можна зібрати, будь ласка, запустіть її за допомогою nix-shell." +#, sh-format +#~ msgid "Please set the $EDITOR environment variable" +#~ msgstr "Будь ласка, встановіть змінну середовища $EDITOR" + #~ msgid "Sorry, this command is not yet supported in flake setup" #~ msgstr "На жаль, ця команда ще не підтримується в налаштуваннях flake" diff --git a/home-manager/po/zh_Hans.po b/home-manager/po/zh_Hans.po index 8aaee206cda3..f3a255605fa6 100644 --- a/home-manager/po/zh_Hans.po +++ b/home-manager/po/zh_Hans.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-07-31 21:25+0000\n" "Last-Translator: Vollow \n" "Language-Team: Chinese (Simplified) \n" "Language-Team: Chinese (Traditional) \n" "Language-Team: Catalan \n" "Language-Team: Czech =2 && n<=4) ? 1 : 2;\n" "X-Generator: Weblate 5.3-dev\n" -#: modules/files.nix:234 +#: modules/files.nix:236 msgid "Creating home file links in %s" msgstr "Vytváření linků na domácí soubory v %s" -#: modules/files.nix:247 +#: modules/files.nix:249 msgid "Cleaning up orphan links from %s" msgstr "Čištění osiřelých linků z %s" -#: modules/files.nix:263 +#: modules/files.nix:265 msgid "Creating profile generation %s" msgstr "Vytvářím profil generace %s" -#: modules/files.nix:280 +#: modules/files.nix:282 msgid "No change so reusing latest profile generation %s" msgstr "Žádná změna, takže bude použita profil poslední generace %s" -#: modules/home-environment.nix:640 +#: modules/home-environment.nix:622 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -63,7 +63,7 @@ msgstr "" "\n" "Poté zkuste znova aktivovat vaši Home Manager konfiguraci." -#: modules/home-environment.nix:673 +#: modules/home-environment.nix:655 msgid "Activating %s" msgstr "Aktivuji %s" @@ -71,15 +71,15 @@ msgstr "Aktivuji %s" msgid "Migrating profile from %s to %s" msgstr "Migruji profil z %s do %s" -#: modules/lib-bash/activation-init.sh:53 +#: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Nebyl nalezen vhodný adresář profilu, byly zkoušeny %s a %s" -#: modules/lib-bash/activation-init.sh:81 +#: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" msgstr "Kontrola správnosti oldGenNum a oldGenPath" -#: modules/lib-bash/activation-init.sh:84 +#: modules/lib-bash/activation-init.sh:86 msgid "" "The previous generation number and path are in conflict! These\n" "must be either both empty or both set but are now set to\n" @@ -107,34 +107,34 @@ msgstr "" "\n" "a zkusit přepínač home‐manager znova. Hodně štěstí!" -#: modules/lib-bash/activation-init.sh:95 +#: modules/lib-bash/activation-init.sh:127 msgid "Error: USER is set to \"%s\" but we expect \"%s\"" msgstr "Chyba: USER je nastaven na \"%s\", ale očekáváme \"%s\"" -#: modules/lib-bash/activation-init.sh:104 +#: modules/lib-bash/activation-init.sh:136 msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" msgstr "Chyba: HOME je nastaven na \"%s\", ale očekáváme \"%s\"" -#: modules/lib-bash/activation-init.sh:119 +#: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" msgstr "Zapínám aktivaci Home Manager" -#: modules/lib-bash/activation-init.sh:123 +#: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" msgstr "Kontrola správnosti Nix" -#: modules/lib-bash/activation-init.sh:133 +#: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" msgstr "Toto je zkušební běh" -#: modules/lib-bash/activation-init.sh:137 +#: modules/lib-bash/activation-init.sh:174 msgid "This is a live run" msgstr "Toto je běh na ostro" -#: modules/lib-bash/activation-init.sh:143 +#: modules/lib-bash/activation-init.sh:180 msgid "Using Nix version: %s" msgstr "Používám Nix verze: %s" -#: modules/lib-bash/activation-init.sh:146 +#: modules/lib-bash/activation-init.sh:183 msgid "Activation variables:" msgstr "Aktivační proměnné:" diff --git a/modules/po/da.po b/modules/po/da.po index 548f1407b04d..e01ade198a7e 100644 --- a/modules/po/da.po +++ b/modules/po/da.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-09-27 11:02+0000\n" "Last-Translator: Emil Heilbo \n" "Language-Team: Danish \n" "Language-Team: German \n" "Language-Team: Spanish \n" "Language-Team: French 1;\n" "X-Generator: Weblate 5.0-dev\n" -#: modules/files.nix:234 +#: modules/files.nix:236 msgid "Creating home file links in %s" msgstr "Création des liens de fichiers personnels dans %s" -#: modules/files.nix:247 +#: modules/files.nix:249 msgid "Cleaning up orphan links from %s" msgstr "Nettoyage des liens orphelins de %s" -#: modules/files.nix:263 +#: modules/files.nix:265 msgid "Creating profile generation %s" msgstr "Création de la génération de profil %s" -#: modules/files.nix:280 +#: modules/files.nix:282 msgid "No change so reusing latest profile generation %s" msgstr "Pas de changement, réutilisation du dernier profil génération %s" -#: modules/home-environment.nix:640 +#: modules/home-environment.nix:622 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -63,7 +63,7 @@ msgstr "" "\n" "Après, essayez encore d'activer votre configuration de Home Manager." -#: modules/home-environment.nix:673 +#: modules/home-environment.nix:655 msgid "Activating %s" msgstr "Activation de %s" @@ -71,15 +71,15 @@ msgstr "Activation de %s" msgid "Migrating profile from %s to %s" msgstr "Migration du profil de %s vers %s" -#: modules/lib-bash/activation-init.sh:53 +#: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Impossible de trouver le dossier de profil approprié, essayé %s et %s" -#: modules/lib-bash/activation-init.sh:81 +#: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" msgstr "Vérification de oldGenNum et oldGenPath" -#: modules/lib-bash/activation-init.sh:84 +#: modules/lib-bash/activation-init.sh:86 msgid "" "The previous generation number and path are in conflict! These\n" "must be either both empty or both set but are now set to\n" @@ -109,35 +109,35 @@ msgstr "" "\n" "et de réessayer home-manager switch. Bonne chance !" -#: modules/lib-bash/activation-init.sh:95 +#: modules/lib-bash/activation-init.sh:127 msgid "Error: USER is set to \"%s\" but we expect \"%s\"" msgstr "Erreur : USER vaut « %s » mais nous attendions « %s »" -#: modules/lib-bash/activation-init.sh:104 +#: modules/lib-bash/activation-init.sh:136 msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" msgstr "Erreur : HOME vaut « %s » mais nous attendions « %s »" -#: modules/lib-bash/activation-init.sh:119 +#: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" msgstr "Démarrage de l'activation de Home Manager" -#: modules/lib-bash/activation-init.sh:123 +#: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" msgstr "Vérification de Nix" -#: modules/lib-bash/activation-init.sh:133 +#: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" msgstr "Ceci est une fausse activation (essai à blanc)" -#: modules/lib-bash/activation-init.sh:137 +#: modules/lib-bash/activation-init.sh:174 msgid "This is a live run" msgstr "Ceci est une vraie activation" -#: modules/lib-bash/activation-init.sh:143 +#: modules/lib-bash/activation-init.sh:180 msgid "Using Nix version: %s" msgstr "Version de Nix : %s" -#: modules/lib-bash/activation-init.sh:146 +#: modules/lib-bash/activation-init.sh:183 msgid "Activation variables:" msgstr "Variables d'activation :" diff --git a/modules/po/id.po b/modules/po/id.po index 430822963cf0..6e17edae25df 100644 --- a/modules/po/id.po +++ b/modules/po/id.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-10-04 06:02+0000\n" "Last-Translator: Reza Almanda \n" "Language-Team: Indonesian \n" "Language-Team: Italian \n" "Language-Team: Japanese \n" "Language-Team: Korean \n" "Language-Team: Lithuanian \n" "Language-Team: Norwegian Bokmål \n" "Language-Team: Dutch \n" "Language-Team: Polish =20) ? 1 : 2;\n" "X-Generator: Weblate 4.18-dev\n" -#: modules/files.nix:234 +#: modules/files.nix:236 msgid "Creating home file links in %s" msgstr "Tworzenie dowiązań plików w %s" -#: modules/files.nix:247 +#: modules/files.nix:249 msgid "Cleaning up orphan links from %s" msgstr "Czyszczenie osieroconych linków z %s" -#: modules/files.nix:263 +#: modules/files.nix:265 msgid "Creating profile generation %s" msgstr "Tworzenie profilu generacji %s" -#: modules/files.nix:280 +#: modules/files.nix:282 msgid "No change so reusing latest profile generation %s" msgstr "Brak zmian więc używam ostatniej generacji profilu %s" -#: modules/home-environment.nix:640 +#: modules/home-environment.nix:622 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -65,7 +65,7 @@ msgstr "" "\n" "Po czym spróbuj aktywować swoją konfigurację Home Manager jeszcze raz." -#: modules/home-environment.nix:673 +#: modules/home-environment.nix:655 msgid "Activating %s" msgstr "Aktywowanie %s" @@ -73,15 +73,15 @@ msgstr "Aktywowanie %s" msgid "Migrating profile from %s to %s" msgstr "Migracja profilu z %s do %s" -#: modules/lib-bash/activation-init.sh:53 +#: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Nie można znaleźć odpowiedniego katalogu profilu, próbowano %s i %s" -#: modules/lib-bash/activation-init.sh:81 +#: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" msgstr "Sprawdzanie poprawności oldGenNum i oldGenPath" -#: modules/lib-bash/activation-init.sh:84 +#: modules/lib-bash/activation-init.sh:86 msgid "" "The previous generation number and path are in conflict! These\n" "must be either both empty or both set but are now set to\n" @@ -109,34 +109,34 @@ msgstr "" "\n" "i spróbować uruchomić home-manager switch raz jeszcze. Powodzenia!" -#: modules/lib-bash/activation-init.sh:95 +#: modules/lib-bash/activation-init.sh:127 msgid "Error: USER is set to \"%s\" but we expect \"%s\"" msgstr "" -#: modules/lib-bash/activation-init.sh:104 +#: modules/lib-bash/activation-init.sh:136 msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" msgstr "" -#: modules/lib-bash/activation-init.sh:119 +#: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" msgstr "Rozpoczynam aktywację Home Managera" -#: modules/lib-bash/activation-init.sh:123 +#: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" msgstr "Sprawdzanie poprawności Nix" -#: modules/lib-bash/activation-init.sh:133 +#: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" msgstr "To jest wykonanie testowe" -#: modules/lib-bash/activation-init.sh:137 +#: modules/lib-bash/activation-init.sh:174 msgid "This is a live run" msgstr "To jest wykonanie właściwe" -#: modules/lib-bash/activation-init.sh:143 +#: modules/lib-bash/activation-init.sh:180 msgid "Using Nix version: %s" msgstr "Używając wersji Nix: %s" -#: modules/lib-bash/activation-init.sh:146 +#: modules/lib-bash/activation-init.sh:183 msgid "Activation variables:" msgstr "Zmienne aktywacyjne:" diff --git a/modules/po/pt.po b/modules/po/pt.po index 9fb5bb415dea..73a53688d046 100644 --- a/modules/po/pt.po +++ b/modules/po/pt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-10-19 04:00+0000\n" "Last-Translator: SrGesus \n" "Language-Team: Portuguese 1;\n" "X-Generator: Weblate 5.1\n" -#: modules/files.nix:234 +#: modules/files.nix:236 msgid "Creating home file links in %s" msgstr "A criar links simbólicos em %s" -#: modules/files.nix:247 +#: modules/files.nix:249 msgid "Cleaning up orphan links from %s" msgstr "A limpar links órfãos do directório %s" -#: modules/files.nix:263 +#: modules/files.nix:265 msgid "Creating profile generation %s" msgstr "A criar geração %s para o perfil" -#: modules/files.nix:280 +#: modules/files.nix:282 msgid "No change so reusing latest profile generation %s" msgstr "Nenhuma mudança, portanto a reusar a última geração %s para o perfil" -#: modules/home-environment.nix:640 +#: modules/home-environment.nix:622 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -63,7 +63,7 @@ msgstr "" "\n" "E então tente novamente ativar a sua configuração do Home Manager." -#: modules/home-environment.nix:673 +#: modules/home-environment.nix:655 msgid "Activating %s" msgstr "Ativando %s" @@ -71,17 +71,17 @@ msgstr "Ativando %s" msgid "Migrating profile from %s to %s" msgstr "A migrar perfil de %s para %s" -#: modules/lib-bash/activation-init.sh:53 +#: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" "Não foi possível encontrar uma diretoria de perfil apropriada, foi tentado " "%s e %s" -#: modules/lib-bash/activation-init.sh:81 +#: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" msgstr "Revalidando oldGenNum e oldGenPath" -#: modules/lib-bash/activation-init.sh:84 +#: modules/lib-bash/activation-init.sh:86 msgid "" "The previous generation number and path are in conflict! These\n" "must be either both empty or both set but are now set to\n" @@ -109,34 +109,34 @@ msgstr "" "\n" "e tentar executar \"home-manager switch\" de novo. Boa sorte!" -#: modules/lib-bash/activation-init.sh:95 +#: modules/lib-bash/activation-init.sh:127 msgid "Error: USER is set to \"%s\" but we expect \"%s\"" msgstr "Erro: USER está definido como \"%s\" mas é esperado \"%s\"" -#: modules/lib-bash/activation-init.sh:104 +#: modules/lib-bash/activation-init.sh:136 msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" msgstr "Erro: HOME está definida como \"%s\" mas é esperado \"%s\"" -#: modules/lib-bash/activation-init.sh:119 +#: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" msgstr "Iniciando ativação do Home Manager" -#: modules/lib-bash/activation-init.sh:123 +#: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" msgstr "Revalidando Nix" -#: modules/lib-bash/activation-init.sh:133 +#: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" msgstr "Essa é uma execução de teste" -#: modules/lib-bash/activation-init.sh:137 +#: modules/lib-bash/activation-init.sh:174 msgid "This is a live run" msgstr "Essa é uma execução de fato" -#: modules/lib-bash/activation-init.sh:143 +#: modules/lib-bash/activation-init.sh:180 msgid "Using Nix version: %s" msgstr "Usando versão do Nix: %s" -#: modules/lib-bash/activation-init.sh:146 +#: modules/lib-bash/activation-init.sh:183 msgid "Activation variables:" msgstr "Variáveis durante ativação:" diff --git a/modules/po/pt_BR.po b/modules/po/pt_BR.po index c4858b205615..aea9b0aba6c3 100644 --- a/modules/po/pt_BR.po +++ b/modules/po/pt_BR.po @@ -7,11 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-11-30 15:04+0000\n" "Last-Translator: Gabriel Fontes \n" -"Language-Team: Portuguese (Brazil) \n" +"Language-Team: Portuguese (Brazil) \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,23 +19,23 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Weblate 5.3-dev\n" -#: modules/files.nix:234 +#: modules/files.nix:236 msgid "Creating home file links in %s" msgstr "Criando links simbólicos em %s" -#: modules/files.nix:247 +#: modules/files.nix:249 msgid "Cleaning up orphan links from %s" msgstr "Limpando links órfãos do directório %s" -#: modules/files.nix:263 +#: modules/files.nix:265 msgid "Creating profile generation %s" msgstr "Criando geração %s para o perfil" -#: modules/files.nix:280 +#: modules/files.nix:282 msgid "No change so reusing latest profile generation %s" msgstr "Nenhuma mudança, portanto reusando a última geração %s para o perfil" -#: modules/home-environment.nix:640 +#: modules/home-environment.nix:622 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -63,7 +63,7 @@ msgstr "" "\n" "E então tente novamente ativar a sua configuração do Home Manager." -#: modules/home-environment.nix:673 +#: modules/home-environment.nix:655 msgid "Activating %s" msgstr "Ativando %s" @@ -71,16 +71,16 @@ msgstr "Ativando %s" msgid "Migrating profile from %s to %s" msgstr "Migrando perfil de %s para %s" -#: modules/lib-bash/activation-init.sh:53 +#: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" "Não foi possível encontrar um diretório de perfil apropriado, tentei %s e %s" -#: modules/lib-bash/activation-init.sh:81 +#: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" msgstr "Revalidando oldGenNum e oldGenPath" -#: modules/lib-bash/activation-init.sh:84 +#: modules/lib-bash/activation-init.sh:86 msgid "" "The previous generation number and path are in conflict! These\n" "must be either both empty or both set but are now set to\n" @@ -108,34 +108,34 @@ msgstr "" "\n" "e tentar rodar \"home-manager switch\" de novo. Boa sorte!" -#: modules/lib-bash/activation-init.sh:95 +#: modules/lib-bash/activation-init.sh:127 msgid "Error: USER is set to \"%s\" but we expect \"%s\"" msgstr "Erro: USER está definido como \"%s\" mas o esperado é \"%s\"" -#: modules/lib-bash/activation-init.sh:104 +#: modules/lib-bash/activation-init.sh:136 msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" msgstr "Erro: HOME está definido como \"%s\" mas o esperado é \"%s\"" -#: modules/lib-bash/activation-init.sh:119 +#: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" msgstr "Iniciando ativação do Home Manager" -#: modules/lib-bash/activation-init.sh:123 +#: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" msgstr "Revalidando Nix" -#: modules/lib-bash/activation-init.sh:133 +#: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" msgstr "Essa é uma execução de teste" -#: modules/lib-bash/activation-init.sh:137 +#: modules/lib-bash/activation-init.sh:174 msgid "This is a live run" msgstr "Essa é uma execução de fato" -#: modules/lib-bash/activation-init.sh:143 +#: modules/lib-bash/activation-init.sh:180 msgid "Using Nix version: %s" msgstr "Usando versão do Nix: %s" -#: modules/lib-bash/activation-init.sh:146 +#: modules/lib-bash/activation-init.sh:183 msgid "Activation variables:" msgstr "Variáveis durante ativação:" diff --git a/modules/po/ro.po b/modules/po/ro.po index 98bd13a80822..022007dd2ae8 100644 --- a/modules/po/ro.po +++ b/modules/po/ro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-08-11 19:51+0000\n" "Last-Translator: HeartBlin913861820c094e37 \n" "Language-Team: Romanian \n" "Language-Team: Russian =20) ? 1 : 2;\n" "X-Generator: Weblate 5.3-dev\n" -#: modules/files.nix:234 +#: modules/files.nix:236 msgid "Creating home file links in %s" msgstr "Создаю ссылки в домашней директории %s" -#: modules/files.nix:247 +#: modules/files.nix:249 msgid "Cleaning up orphan links from %s" msgstr "Удаляю устаревшие ссылки из %s" -#: modules/files.nix:263 +#: modules/files.nix:265 msgid "Creating profile generation %s" msgstr "Создаю профиль в поколении %s" -#: modules/files.nix:280 +#: modules/files.nix:282 msgid "No change so reusing latest profile generation %s" msgstr "Изменений нет, переиспользую профиль в последнем поколении %s" -#: modules/home-environment.nix:640 +#: modules/home-environment.nix:622 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -64,7 +64,7 @@ msgstr "" "\n" "После попробуйте активировать конфигурацию снова." -#: modules/home-environment.nix:673 +#: modules/home-environment.nix:655 msgid "Activating %s" msgstr "Активирую %s" @@ -72,15 +72,15 @@ msgstr "Активирую %s" msgid "Migrating profile from %s to %s" msgstr "Переношу профиль из %s в %s" -#: modules/lib-bash/activation-init.sh:53 +#: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Не найдена подходящая директория профиля, пробовали %s и %s" -#: modules/lib-bash/activation-init.sh:81 +#: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" msgstr "Проверка oldGenNum и oldGenPath" -#: modules/lib-bash/activation-init.sh:84 +#: modules/lib-bash/activation-init.sh:86 msgid "" "The previous generation number and path are in conflict! These\n" "must be either both empty or both set but are now set to\n" @@ -109,35 +109,35 @@ msgstr "" "\n" "и повторный запуск 'home-manager switch'. Удачи!" -#: modules/lib-bash/activation-init.sh:95 +#: modules/lib-bash/activation-init.sh:127 msgid "Error: USER is set to \"%s\" but we expect \"%s\"" msgstr "Ошибка: USER установлена в \"%s\", но ожидается \"%s\"" -#: modules/lib-bash/activation-init.sh:104 +#: modules/lib-bash/activation-init.sh:136 msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" msgstr "Ошибка: HOME установлена в \"%s\", но ожидается \"%s\"" -#: modules/lib-bash/activation-init.sh:119 +#: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" msgstr "Начинаю активацию Home Manager" -#: modules/lib-bash/activation-init.sh:123 +#: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" msgstr "Проверка работоспособности Nix" -#: modules/lib-bash/activation-init.sh:133 +#: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" msgstr "Это пробный запуск" -#: modules/lib-bash/activation-init.sh:137 +#: modules/lib-bash/activation-init.sh:174 msgid "This is a live run" msgstr "Это реальный запуск" -#: modules/lib-bash/activation-init.sh:143 +#: modules/lib-bash/activation-init.sh:180 msgid "Using Nix version: %s" msgstr "Использую Nix версии: %s" -#: modules/lib-bash/activation-init.sh:146 +#: modules/lib-bash/activation-init.sh:183 msgid "Activation variables:" msgstr "Переменные для активации:" diff --git a/modules/po/sv.po b/modules/po/sv.po index f42ebeb42a39..5d4744290dd9 100644 --- a/modules/po/sv.po +++ b/modules/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-05-27 12:11+0000\n" "Last-Translator: Robert Helgesson \n" "Language-Team: Swedish \n" "Language-Team: Turkish \n" "Language-Team: Ukrainian =20) ? 1 : 2;\n" "X-Generator: Weblate 5.4-dev\n" -#: modules/files.nix:234 +#: modules/files.nix:236 msgid "Creating home file links in %s" msgstr "Створення посилань на файли в домашньому каталозі в %s" -#: modules/files.nix:247 +#: modules/files.nix:249 msgid "Cleaning up orphan links from %s" msgstr "Очищення невідомих посилань із %s" -#: modules/files.nix:263 +#: modules/files.nix:265 msgid "Creating profile generation %s" msgstr "Створення генерації профілю %s" -#: modules/files.nix:280 +#: modules/files.nix:282 msgid "No change so reusing latest profile generation %s" msgstr "Без змін, тому повторне використання останньої генерації профілю %s" -#: modules/home-environment.nix:640 +#: modules/home-environment.nix:622 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -64,7 +64,7 @@ msgstr "" "\n" "Потім спробуйте знову активувати конфігурацію Home Manager." -#: modules/home-environment.nix:673 +#: modules/home-environment.nix:655 msgid "Activating %s" msgstr "Активація %s" @@ -72,15 +72,15 @@ msgstr "Активація %s" msgid "Migrating profile from %s to %s" msgstr "Перенесення профілю з %s на %s" -#: modules/lib-bash/activation-init.sh:53 +#: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Не вдалося знайти відповідний каталог профілю, спробував %s і %s" -#: modules/lib-bash/activation-init.sh:81 +#: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" msgstr "Перевірка цілісності oldGenNum та oldGenPath" -#: modules/lib-bash/activation-init.sh:84 +#: modules/lib-bash/activation-init.sh:86 msgid "" "The previous generation number and path are in conflict! These\n" "must be either both empty or both set but are now set to\n" @@ -109,35 +109,35 @@ msgstr "" "\n" "і знову намагатися переключитися на home-manager switch. Удачі!" -#: modules/lib-bash/activation-init.sh:95 +#: modules/lib-bash/activation-init.sh:127 msgid "Error: USER is set to \"%s\" but we expect \"%s\"" msgstr "Помилка: USER встановлено на \"%s\", але очікувалося \"%s\"" -#: modules/lib-bash/activation-init.sh:104 +#: modules/lib-bash/activation-init.sh:136 msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" msgstr "Помилка: HOME встановлено на \"%s\", але очікувалося \"%s\"" -#: modules/lib-bash/activation-init.sh:119 +#: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" msgstr "Початок активації Home Manager" -#: modules/lib-bash/activation-init.sh:123 +#: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" msgstr "Перевірка адекватності Nix" -#: modules/lib-bash/activation-init.sh:133 +#: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" msgstr "Це пробний запуск" -#: modules/lib-bash/activation-init.sh:137 +#: modules/lib-bash/activation-init.sh:174 msgid "This is a live run" msgstr "Це справжній запуск" -#: modules/lib-bash/activation-init.sh:143 +#: modules/lib-bash/activation-init.sh:180 msgid "Using Nix version: %s" msgstr "Використання версії Nix: %s" -#: modules/lib-bash/activation-init.sh:146 +#: modules/lib-bash/activation-init.sh:183 msgid "Activation variables:" msgstr "Активація змінних:" diff --git a/modules/po/zh_Hans.po b/modules/po/zh_Hans.po index bf5c1c45a874..b3c9bf8f7f20 100644 --- a/modules/po/zh_Hans.po +++ b/modules/po/zh_Hans.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2023-09-13 23:46+0200\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2023-06-12 10:49+0000\n" "Last-Translator: Hongtyu Bhe \n" "Language-Team: Chinese (Simplified) \n" "Language-Team: Chinese (Traditional) Date: Sun, 18 Feb 2024 15:02:07 +0100 Subject: [PATCH 059/636] Translate using Weblate (Czech) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Indonesian) Currently translated at 66.6% (24 of 36 strings) Translate using Weblate (Romanian) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Ukrainian) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Portuguese) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Lithuanian) Currently translated at 72.2% (13 of 18 strings) Translate using Weblate (Lithuanian) Currently translated at 86.1% (31 of 36 strings) Translate using Weblate (Danish) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Dutch) Currently translated at 88.8% (32 of 36 strings) Translate using Weblate (Catalan) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Italian) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Turkish) Currently translated at 100.0% (36 of 36 strings) Translate using Weblate (Japanese) Currently translated at 88.8% (32 of 36 strings) Translate using Weblate (Korean) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Portuguese (Brazil)) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (German) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Spanish) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Polish) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Chinese (Traditional)) Currently translated at 77.7% (28 of 36 strings) Translate using Weblate (Chinese (Simplified)) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Russian) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (French) Currently translated at 97.2% (35 of 36 strings) Translate using Weblate (Norwegian Bokmål) Currently translated at 77.7% (28 of 36 strings) Translate using Weblate (Swedish) Currently translated at 97.2% (35 of 36 strings) Co-authored-by: Robert Helgesson Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ca/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/cs/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/da/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/de/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/es/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fr/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/id/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/it/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ja/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ko/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/lt/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/nb_NO/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/nl/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/pl/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/pt/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/pt_BR/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ro/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ru/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/sv/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/tr/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/uk/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/zh_Hans/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/zh_Hant/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/lt/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules --- home-manager/po/ca.po | 8 ++++---- home-manager/po/cs.po | 10 +++++----- home-manager/po/da.po | 8 ++++---- home-manager/po/de.po | 8 ++++---- home-manager/po/es.po | 8 ++++---- home-manager/po/fr.po | 8 ++++---- home-manager/po/id.po | 8 ++++---- home-manager/po/it.po | 8 ++++---- home-manager/po/ja.po | 8 ++++---- home-manager/po/ko.po | 8 ++++---- home-manager/po/lt.po | 13 ++++++------- home-manager/po/nb_NO.po | 12 ++++++------ home-manager/po/nl.po | 8 ++++---- home-manager/po/pl.po | 12 ++++++------ home-manager/po/pt.po | 8 ++++---- home-manager/po/pt_BR.po | 12 ++++++------ home-manager/po/ro.po | 8 ++++---- home-manager/po/ru.po | 12 ++++++------ home-manager/po/sv.po | 8 ++++---- home-manager/po/tr.po | 8 ++++---- home-manager/po/uk.po | 12 ++++++------ home-manager/po/zh_Hans.po | 8 ++++---- home-manager/po/zh_Hant.po | 8 ++++---- modules/po/lt.po | 12 +++++------- 24 files changed, 110 insertions(+), 113 deletions(-) diff --git a/home-manager/po/ca.po b/home-manager/po/ca.po index 3e36abdb3a2b..b4a947b2655d 100644 --- a/home-manager/po/ca.po +++ b/home-manager/po/ca.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-12-10 15:58+0000\n" -"Last-Translator: Nara Díaz Viñolas \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Catalan \n" "Language: ca\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.3-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -95,7 +95,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Comprovant Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/cs.po b/home-manager/po/cs.po index 7d6f8e895096..ec408ece1fe8 100644 --- a/home-manager/po/cs.po +++ b/home-manager/po/cs.po @@ -8,16 +8,16 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-01-05 11:06+0000\n" -"Last-Translator: FireFragment \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Czech \n" "Language: cs\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" -"X-Generator: Weblate 5.4-dev\n" +"Plural-Forms: nplurals=3; plural=((n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2);\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -93,7 +93,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Kontrola správnosti Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/da.po b/home-manager/po/da.po index a93c63c04c5d..de348823ee70 100644 --- a/home-manager/po/da.po +++ b/home-manager/po/da.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-08-27 13:52+0000\n" -"Last-Translator: cafkafk \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Danish \n" "Language: da\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.0.1-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -93,7 +93,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Tjekker fornuften af Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/de.po b/home-manager/po/de.po index 1734a541dab1..8d8641265555 100644 --- a/home-manager/po/de.po +++ b/home-manager/po/de.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-08-15 17:51+0000\n" -"Last-Translator: Simon \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: German \n" "Language: de\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.0-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -90,7 +90,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Überprüfe zur Sicherheit Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/es.po b/home-manager/po/es.po index 191c167be7f4..49400f6382b0 100644 --- a/home-manager/po/es.po +++ b/home-manager/po/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-07-17 10:03+0000\n" -"Last-Translator: gallegonovato \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Spanish \n" "Language: es\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.0-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -93,7 +93,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Chequeando Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/fr.po b/home-manager/po/fr.po index 79218b508b48..2b9d7a87aa5d 100644 --- a/home-manager/po/fr.po +++ b/home-manager/po/fr.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-12-25 10:10+0000\n" -"Last-Translator: Louis Thevenet \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: French \n" "Language: fr\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.4-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -92,7 +92,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Vérification de Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/id.po b/home-manager/po/id.po index f924bd6b5f43..0db625b3b07f 100644 --- a/home-manager/po/id.po +++ b/home-manager/po/id.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-10-04 06:02+0000\n" -"Last-Translator: Reza Almanda \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Indonesian \n" "Language: id\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.1-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -75,7 +75,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Pemeriksaan sanity Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/it.po b/home-manager/po/it.po index 01a3808a19b9..4770bb4afcc7 100644 --- a/home-manager/po/it.po +++ b/home-manager/po/it.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-12-02 23:06+0000\n" -"Last-Translator: Lorenzo Brzek \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Italian \n" "Language: it\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.3-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -95,7 +95,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Controllando Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/ja.po b/home-manager/po/ja.po index 6d358a0a0f07..6ae146b6e3a1 100644 --- a/home-manager/po/ja.po +++ b/home-manager/po/ja.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-06-12 10:49+0000\n" -"Last-Translator: Jeff Ames \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Japanese \n" "Language: ja\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.18-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -73,7 +73,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Nixの健全性検査中です" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/ko.po b/home-manager/po/ko.po index 0c42c6332388..aab624f5553d 100644 --- a/home-manager/po/ko.po +++ b/home-manager/po/ko.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-08-03 05:07+0000\n" -"Last-Translator: 박수원 \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Korean \n" "Language: ko\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.0-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -93,7 +93,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Nix가 정상인지 확인 중" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/lt.po b/home-manager/po/lt.po index 47a61eb9db15..1142dd9323a8 100644 --- a/home-manager/po/lt.po +++ b/home-manager/po/lt.po @@ -8,18 +8,17 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-10-19 04:00+0000\n" -"Last-Translator: Yogurt \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Lithuanian \n" "Language: lt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n % 10 == 1 && (n % 100 < 11 || n % 100 > " -"19)) ? 0 : ((n % 10 >= 2 && n % 10 <= 9 && (n % 100 < 11 || n % 100 > 19)) ? " -"1 : 2);\n" -"X-Generator: Weblate 5.1\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (" +"n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -76,7 +75,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Nix tikrinamas" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/nb_NO.po b/home-manager/po/nb_NO.po index 387c286f063e..bb164ff30bea 100644 --- a/home-manager/po/nb_NO.po +++ b/home-manager/po/nb_NO.po @@ -8,16 +8,16 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-03-08 07:22+0000\n" -"Last-Translator: \"Kim A. Ødegaard\" \n" -"Language-Team: Norwegian Bokmål \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" +"Language-Team: Norwegian Bokmål \n" "Language: nb_NO\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.16.2-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -71,7 +71,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Kontrollerer at Nix fungerer" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/nl.po b/home-manager/po/nl.po index d76c4694fe21..5d6573f87f2a 100644 --- a/home-manager/po/nl.po +++ b/home-manager/po/nl.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-12-02 23:06+0000\n" -"Last-Translator: Zurga \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Dutch \n" "Language: nl\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.3-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -73,7 +73,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Nix aan het sanity checken" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/pl.po b/home-manager/po/pl.po index 056df25f9a68..da6fae475fc8 100644 --- a/home-manager/po/pl.po +++ b/home-manager/po/pl.po @@ -8,17 +8,17 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-08-30 13:45+0000\n" -"Last-Translator: Marcin Kaczorek \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Polish \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " -"|| n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 5.0.1-dev\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -95,7 +95,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Sprawdzanie poprawności Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/pt.po b/home-manager/po/pt.po index 58eecee68b02..3e356d6a3066 100644 --- a/home-manager/po/pt.po +++ b/home-manager/po/pt.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-12-11 16:06+0000\n" -"Last-Translator: Lucas Eduardo \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Portuguese \n" "Language: pt\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.3-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -93,7 +93,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Revalidando Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/pt_BR.po b/home-manager/po/pt_BR.po index 22412dcb4c4a..4389446bfdd8 100644 --- a/home-manager/po/pt_BR.po +++ b/home-manager/po/pt_BR.po @@ -8,16 +8,16 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-11-30 15:04+0000\n" -"Last-Translator: Gabriel Fontes \n" -"Language-Team: Portuguese (Brazil) \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" +"Language-Team: Portuguese (Brazil) \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.3-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -94,7 +94,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Revalidando Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/ro.po b/home-manager/po/ro.po index 59f3f4908c4c..28b515aef631 100644 --- a/home-manager/po/ro.po +++ b/home-manager/po/ro.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-08-11 19:50+0000\n" -"Last-Translator: HeartBlin913861820c094e37 \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Romanian \n" "Language: ro\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " "20)) ? 1 : 2;\n" -"X-Generator: Weblate 5.0-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -95,7 +95,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Se verifică corectitudinea Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/ru.po b/home-manager/po/ru.po index ff096a895a68..7be061dce541 100644 --- a/home-manager/po/ru.po +++ b/home-manager/po/ru.po @@ -8,17 +8,17 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-12-10 16:00+0000\n" -"Last-Translator: Blezz Rot \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Russian \n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " -"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 5.3-dev\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -94,7 +94,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Проверка работоспособности Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/sv.po b/home-manager/po/sv.po index bf3f73097be8..f3bc784b173d 100644 --- a/home-manager/po/sv.po +++ b/home-manager/po/sv.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-07-17 10:03+0000\n" -"Last-Translator: Luna Jernberg \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Swedish \n" "Language: sv\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.0-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -93,7 +93,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Kontrollerar att Nix funkar" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/tr.po b/home-manager/po/tr.po index 9a6d15119721..48c39f7bb926 100644 --- a/home-manager/po/tr.po +++ b/home-manager/po/tr.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-04 13:10+0000\n" -"Last-Translator: Oğuz Ersen \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Turkish \n" "Language: tr\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -94,7 +94,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Nix denetleniyor" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/uk.po b/home-manager/po/uk.po index a292f19e26ca..535c532d55e1 100644 --- a/home-manager/po/uk.po +++ b/home-manager/po/uk.po @@ -8,17 +8,17 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-07-17 10:03+0000\n" -"Last-Translator: Dan \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Ukrainian \n" "Language: uk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " -"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 5.0-dev\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -93,7 +93,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "Перевірка адекватності Nix" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/zh_Hans.po b/home-manager/po/zh_Hans.po index f3a255605fa6..29f2bf009212 100644 --- a/home-manager/po/zh_Hans.po +++ b/home-manager/po/zh_Hans.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-07-31 21:25+0000\n" -"Last-Translator: Vollow \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Chinese (Simplified) \n" "Language: zh_Hans\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.0-dev\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -89,7 +89,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "正在进行 Nix 完整性检查" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/home-manager/po/zh_Hant.po b/home-manager/po/zh_Hant.po index 8b304ab0eeb8..ce0f8af05828 100644 --- a/home-manager/po/zh_Hant.po +++ b/home-manager/po/zh_Hant.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2021-12-29 08:48+0000\n" -"Last-Translator: WhiredPlanck \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Chinese (Traditional) \n" "Language: zh_Hant\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.10.1\n" +"X-Generator: Weblate 5.4\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -71,7 +71,7 @@ msgstr "" #: home-manager/home-manager:140 msgid "Sanity checking Nix" -msgstr "" +msgstr "正在進行 Nix 完整性檢查" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" diff --git a/modules/po/lt.po b/modules/po/lt.po index 7f7bb36951d7..8d489762b1c0 100644 --- a/modules/po/lt.po +++ b/modules/po/lt.po @@ -8,18 +8,17 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-10-19 04:00+0000\n" -"Last-Translator: Yogurt \n" +"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: Lithuanian \n" "Language: lt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n % 10 == 1 && (n % 100 < 11 || n % 100 > " -"19)) ? 0 : ((n % 10 >= 2 && n % 10 <= 9 && (n % 100 < 11 || n % 100 > 19)) ? " -"1 : 2);\n" -"X-Generator: Weblate 5.1\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (" +"n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Weblate 5.4\n" #: modules/files.nix:236 msgid "Creating home file links in %s" @@ -111,7 +110,6 @@ msgid "Starting Home Manager activation" msgstr "Pradedamas Home Manager aktivavymas" #: modules/lib-bash/activation-init.sh:157 -#, fuzzy msgid "Sanity checking Nix" msgstr "Nix tikrinamas" From 5aec43bc0f647eba521c2fb82135f7c10e2ea500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Sun, 18 Feb 2024 15:02:08 +0100 Subject: [PATCH 060/636] Translate using Weblate (Turkish) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 100.0% (36 of 36 strings) Co-authored-by: Oğuz Ersen Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/tr/ Translation: Home Manager/Home Manager CLI --- home-manager/po/tr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home-manager/po/tr.po b/home-manager/po/tr.po index 48c39f7bb926..7cbf63548aa5 100644 --- a/home-manager/po/tr.po +++ b/home-manager/po/tr.po @@ -9,7 +9,7 @@ msgstr "" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" "PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"Last-Translator: Oğuz Ersen \n" "Language-Team: Turkish \n" "Language: tr\n" @@ -185,7 +185,7 @@ msgstr "Bilinmeyen \"news.display\" seçeneği \"%s\"." #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Lütfen $EDITOR veya $VISUAL ortam değişkenini ayarlayın" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From 7671ec1931daee86161c8da1115515447667545e Mon Sep 17 00:00:00 2001 From: bittin1ddc447d824349b2 Date: Sun, 18 Feb 2024 15:02:08 +0100 Subject: [PATCH 061/636] Translate using Weblate (Swedish) Currently translated at 100.0% (36 of 36 strings) Co-authored-by: bittin1ddc447d824349b2 Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/sv/ Translation: Home Manager/Home Manager CLI --- home-manager/po/sv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home-manager/po/sv.po b/home-manager/po/sv.po index f3bc784b173d..2454def1e29d 100644 --- a/home-manager/po/sv.po +++ b/home-manager/po/sv.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-02-18 14:02+0000\n" +"Last-Translator: bittin1ddc447d824349b2 \n" "Language-Team: Swedish \n" "Language: sv\n" @@ -183,7 +183,7 @@ msgstr "Okänt \"news.display\"-värde \"%s\"." #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Vänligen ställ in miljövariabeln $EDITOR eller $VISUAL" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From 309465d20993095a1c6ee2d7eda6ef3588f165ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D1=96=D0=B9?= Date: Sun, 18 Feb 2024 15:02:08 +0100 Subject: [PATCH 062/636] Translate using Weblate (Ukrainian) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 100.0% (36 of 36 strings) Co-authored-by: Сергій Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/uk/ Translation: Home Manager/Home Manager CLI --- home-manager/po/uk.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home-manager/po/uk.po b/home-manager/po/uk.po index 535c532d55e1..28534c3416c9 100644 --- a/home-manager/po/uk.po +++ b/home-manager/po/uk.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-02-18 14:02+0000\n" +"Last-Translator: Сергій \n" "Language-Team: Ukrainian \n" "Language: uk\n" @@ -187,7 +187,7 @@ msgstr "Невідоме налаштування \"news.display\" \"%s\"." #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Будь ласка, встановіть змінну оточення $EDITOR або $VISUAL" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From 11edf9cad78cce49d09436c8d725ae36b65671dc Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 18 Feb 2024 22:48:32 +0100 Subject: [PATCH 063/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/f8e2ebd66d097614d51a56a755450d4ae1632df1' (2024-02-07) → 'github:NixOS/nixpkgs/5863c27340ba4de8f83e7e3c023b9599c3cb3c80' (2024-02-16) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index c48d8a7cf329..e985e3a0a582 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1707268954, - "narHash": "sha256-2en1kvde3cJVc3ZnTy8QeD2oKcseLFjYPLKhIGDanQ0=", + "lastModified": 1708118438, + "narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f8e2ebd66d097614d51a56a755450d4ae1632df1", + "rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80", "type": "github" }, "original": { From 738527f866e7848fa9fcef174ee78ec262fd00e5 Mon Sep 17 00:00:00 2001 From: Albert Peschar Date: Mon, 19 Feb 2024 00:09:58 +0200 Subject: [PATCH 064/636] darwin: fonts: speed up font installation * Skip font installation if the derivation hasn't changed. * Use `rsync` instead of `install` to copy font files, to avoid useless copying of pre-existent identical files. --- modules/targets/darwin/fonts.nix | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/modules/targets/darwin/fonts.nix b/modules/targets/darwin/fonts.nix index 78723c43da4c..988c5edc9792 100644 --- a/modules/targets/darwin/fonts.nix +++ b/modules/targets/darwin/fonts.nix @@ -10,20 +10,17 @@ let pathsToLink = "/share/fonts"; }; fonts = "${fontsEnv}/share/fonts"; + installDir = "${homeDir}/Library/Fonts/HomeManager"; in { # macOS won't recognize symlinked fonts config = mkIf pkgs.stdenv.hostPlatform.isDarwin { - home.activation.copyFonts = hm.dag.entryAfter [ "writeBoundary" ] '' - copyFonts() { - rm -rf ${homeDir}/Library/Fonts/HomeManager || : - - local f - find -L "${fonts}" -type f -printf '%P\0' | while IFS= read -rd "" f; do - run install $VERBOSE_ARG -Dm644 -T \ - "${fonts}/$f" "${homeDir}/Library/Fonts/HomeManager/$f" - done - } - copyFonts - ''; + home.file."Library/Fonts/.home-manager-fonts-version" = { + text = "${fontsEnv}"; + onChange = '' + run mkdir -p ${escapeShellArg installDir} + run ${pkgs.rsync}/bin/rsync $VERBOSE_ARG -acL --chmod=u+w --delete \ + ${escapeShellArgs [ "${fonts}/" installDir ]} + ''; + }; }; } From a54e05bc12d88ff2df941d0dc1183cb5235fa438 Mon Sep 17 00:00:00 2001 From: Nikita Pedorich Date: Sun, 18 Feb 2024 23:14:41 +0100 Subject: [PATCH 065/636] tealdeer: module improvements - Cache update on HM activation removed - freeformType settings - More tests added - Platform-dependent tests - Maintainer added --- modules/programs/tealdeer.nix | 81 ++++++++++++------- .../programs/tealdeer/custom-settings.nix | 35 ++++++++ .../programs/tealdeer/default-settings.nix | 12 ++- tests/modules/programs/tealdeer/default.nix | 5 +- 4 files changed, 101 insertions(+), 32 deletions(-) create mode 100644 tests/modules/programs/tealdeer/custom-settings.nix diff --git a/modules/programs/tealdeer.nix b/modules/programs/tealdeer.nix index 3f03c715f00d..55b6c22b0409 100644 --- a/modules/programs/tealdeer.nix +++ b/modules/programs/tealdeer.nix @@ -4,31 +4,64 @@ with lib; let cfg = config.programs.tealdeer; - tomlFormat = pkgs.formats.toml { }; - configDir = if pkgs.stdenv.isDarwin then "Library/Application Support" else config.xdg.configHome; + tomlFormat = pkgs.formats.toml { }; + + settingsFormat = let + updatesSection = types.submodule { + options = { + auto_update = mkEnableOption "auto-update"; + + auto_update_interval_hours = mkOption { + type = types.ints.positive; + default = 720; + example = literalExpression "24"; + description = '' + Duration, since the last cache update, after which the cache will be refreshed. + This parameter is ignored if {var}`auto_update` is set to `false`. + ''; + }; + }; + }; + in types.submodule { + freeformType = tomlFormat.type; + options = { + updates = mkOption { + type = updatesSection; + default = { }; + description = '' + Tealdeer can refresh the cache automatically when it is outdated. + This behavior can be configured in the updates section. + ''; + }; + }; + }; + in { - meta.maintainers = [ ]; + meta.maintainers = [ hm.maintainers.pedorich-n ]; + + imports = [ + (mkRemovedOptionModule [ "programs" "tealdeer" "updateOnActivation" ] '' + Updating tealdeer's cache requires network access. + The activation script should be fast and idempotent, so the option was removed. + Please use + + `programs.teadleer.settings.updates.auto_update = true` + + instead, to make sure tealdeer's cache is updated periodically. + '') + ]; options.programs.tealdeer = { enable = mkEnableOption "Tealdeer"; - updateOnActivation = mkOption { - type = with types; bool; - default = true; - description = '' - Whether to update tealdeer's cache on activation. - ''; - }; - settings = mkOption { - type = tomlFormat.type; - default = { }; - defaultText = literalExpression "{ }"; + type = types.nullOr settingsFormat; + default = null; example = literalExpression '' { display = { @@ -43,10 +76,8 @@ in { description = '' Configuration written to {file}`$XDG_CONFIG_HOME/tealdeer/config.toml` on Linux or - {file}`$HOME/Library/Application Support/tealdeer/config.toml` - on Darwin. See - - for more information. + {file}`$HOME/Library/Application Support/tealdeer/config.toml` on Darwin. + See for more information. ''; }; }; @@ -54,15 +85,9 @@ in { config = mkIf cfg.enable { home.packages = [ pkgs.tealdeer ]; - home.file."${configDir}/tealdeer/config.toml" = mkIf (cfg.settings != { }) { - source = tomlFormat.generate "tealdeer-config" cfg.settings; - }; - - home.activation = mkIf cfg.updateOnActivation { - tealdeerCache = hm.dag.entryAfter [ "linkGeneration" ] '' - $VERBOSE_ECHO "Rebuilding tealdeer cache" - $DRY_RUN_CMD ${getExe pkgs.tealdeer} --update - ''; - }; + home.file."${configDir}/tealdeer/config.toml" = + mkIf (cfg.settings != null && cfg.settings != { }) { + source = tomlFormat.generate "tealdeer-config" cfg.settings; + }; }; } diff --git a/tests/modules/programs/tealdeer/custom-settings.nix b/tests/modules/programs/tealdeer/custom-settings.nix new file mode 100644 index 000000000000..aa9768cf77db --- /dev/null +++ b/tests/modules/programs/tealdeer/custom-settings.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: { + config = { + programs.tealdeer = { + package = config.lib.test.mkStubPackage { name = "tldr"; }; + enable = true; + settings = { + updates = { + auto_update = true; + auto_update_interval_hours = 72; + }; + display = { use_pager = false; }; + }; + }; + + nmt.script = let + expectedConfDir = if pkgs.stdenv.isDarwin then + "Library/Application Support" + else + ".config"; + expectedConfigPath = "home-files/${expectedConfDir}/tealdeer/config.toml"; + in '' + assertFileExists "${expectedConfigPath}" + assertFileContent "${expectedConfigPath}" ${ + pkgs.writeText "tealdeer.config-custom.expected" '' + [display] + use_pager = false + + [updates] + auto_update = true + auto_update_interval_hours = 72 + '' + } + ''; + }; +} diff --git a/tests/modules/programs/tealdeer/default-settings.nix b/tests/modules/programs/tealdeer/default-settings.nix index 0044ca8f31c0..438b6edd1968 100644 --- a/tests/modules/programs/tealdeer/default-settings.nix +++ b/tests/modules/programs/tealdeer/default-settings.nix @@ -1,12 +1,18 @@ -{ config, ... }: { +{ config, pkgs, ... }: { config = { programs.tealdeer = { package = config.lib.test.mkStubPackage { name = "tldr"; }; enable = true; }; - nmt.script = '' - assertFileRegex activate '/nix/store/.*tealdeer.*/bin/tldr --update' + nmt.script = let + expectedConfDir = if pkgs.stdenv.isDarwin then + "Library/Application Support" + else + ".config"; + expectedConfigPath = "home-files/${expectedConfDir}/tealdeer/config.toml"; + in '' + assertPathNotExists "${expectedConfigPath}" ''; }; } diff --git a/tests/modules/programs/tealdeer/default.nix b/tests/modules/programs/tealdeer/default.nix index e9deed9393d4..147a664ea151 100644 --- a/tests/modules/programs/tealdeer/default.nix +++ b/tests/modules/programs/tealdeer/default.nix @@ -1 +1,4 @@ -{ tealdeer-default-settings = ./default-settings.nix; } +{ + tealdeer-default-settings = ./default-settings.nix; + tealdeer-custom-settings = ./custom-settings.nix; +} From 517601b37c6d495274454f63c5a483c8e3ca6be1 Mon Sep 17 00:00:00 2001 From: James Conroy-Finn Date: Mon, 19 Feb 2024 14:15:12 +0000 Subject: [PATCH 066/636] jujutsu: remove shell completion Completion is installed by the jujutsu package itself, making this additional setup redundant. https://github.com/nix-community/home-manager/pull/5016#issuecomment-1947449541 https://github.com/nix-community/home-manager/pull/5037#pullrequestreview-1888843990 --- modules/programs/jujutsu.nix | 37 ++++++------------------------------ 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/modules/programs/jujutsu.nix b/modules/programs/jujutsu.nix index c511f2dcc2a1..269c5ef93ef1 100644 --- a/modules/programs/jujutsu.nix +++ b/modules/programs/jujutsu.nix @@ -10,6 +10,12 @@ let in { meta.maintainers = [ maintainers.shikanime ]; + imports = let + mkRemovedShellIntegration = name: + mkRemovedOptionModule [ "programs" "jujutsu" "enable${name}Integration" ] + "This option is no longer necessary."; + in map mkRemovedShellIntegration [ "Bash" "Fish" "Zsh" ]; + options.programs.jujutsu = { enable = mkEnableOption "a Git-compatible DVCS that is both simple and powerful"; @@ -33,24 +39,6 @@ in { for options. ''; }; - - enableBashIntegration = mkOption { - type = types.bool; - default = true; - description = "Whether to enable Bash integration."; - }; - - enableZshIntegration = mkOption { - type = types.bool; - default = true; - description = "Whether to enable Zsh integration."; - }; - - enableFishIntegration = mkOption { - type = types.bool; - default = true; - description = "Whether to enable Fish integration."; - }; }; config = mkIf cfg.enable { @@ -59,18 +47,5 @@ in { home.file.".jjconfig.toml" = mkIf (cfg.settings != { }) { source = tomlFormat.generate "jujutsu-config" cfg.settings; }; - - programs.bash.initExtra = mkIf cfg.enableBashIntegration '' - source <(${pkgs.jujutsu}/bin/jj util completion) - ''; - - programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' - source <(${pkgs.jujutsu}/bin/jj util completion --zsh) - compdef _jj ${pkgs.jujutsu}/bin/jj - ''; - - programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' - ${pkgs.jujutsu}/bin/jj util completion --fish | source - ''; }; } From 3dda8e795f12a4f67c287cef155939e1c5fbd0a3 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 11 Aug 2023 11:09:54 +0200 Subject: [PATCH 067/636] river: add module --- modules/misc/news.nix | 8 + modules/modules.nix | 1 + modules/services/window-managers/river.nix | 212 ++++++++++++++++++ tests/default.nix | 1 + .../window-managers/river/configuration.nix | 95 ++++++++ .../window-managers/river/default.nix | 1 + .../services/window-managers/river/init | 67 ++++++ 7 files changed, 385 insertions(+) create mode 100644 modules/services/window-managers/river.nix create mode 100644 tests/modules/services/window-managers/river/configuration.nix create mode 100644 tests/modules/services/window-managers/river/default.nix create mode 100755 tests/modules/services/window-managers/river/init diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 0b19711afd36..4f955e3921e4 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1414,6 +1414,14 @@ in { A new module is available: 'programs.jetbrains-remote' ''; } + + { + time = "2024-02-21T23:01:27+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'wayland.windowManager.river'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index f8146efac8dc..08a539deabcb 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -364,6 +364,7 @@ let ./services/window-managers/i3-sway/i3.nix ./services/window-managers/i3-sway/sway.nix ./services/window-managers/i3-sway/swaynag.nix + ./services/window-managers/river.nix ./services/window-managers/spectrwm.nix ./services/window-managers/xmonad.nix ./services/wlsunset.nix diff --git a/modules/services/window-managers/river.nix b/modules/services/window-managers/river.nix new file mode 100644 index 000000000000..80ad68b74178 --- /dev/null +++ b/modules/services/window-managers/river.nix @@ -0,0 +1,212 @@ +{ config, lib, pkgs, ... }: + +let + inherit (lib) types; + cfg = config.wayland.windowManager.river; + + # Systemd integration + variables = builtins.concatStringsSep " " cfg.systemd.variables; + extraCommands = builtins.concatStringsSep " " + (map (f: "&& ${f}") cfg.systemd.extraCommands); + systemdActivation = '' + exec "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables} ${extraCommands}" + ''; + + toValue = val: + if lib.isString val || lib.isDerivation val then + toString val + else if true == val then + "enabled" + else if false == val then + "disabled" + else if lib.isInt val then + toString val + else if lib.isFloat val then + lib.strings.floatToString val + else + abort "unsupported type ${builtins.typeOf val}"; + + # Intermediary function that converts some value (attrs, str, ...) to one or several commands. + toArgs = path: value: + + let + stringValue = lib.concatStringsSep " " (path ++ [ (toValue value) ]); + finalValue = if lib.isAttrs value then + toCommand path value + else if lib.isList value then + lib.lists.flatten (map (x: toArgs path x) value) + else if value == null then + [ ] + else + [ stringValue ]; + in finalValue; + + # toCommand :: [string] -> attrs -> [string] + # Recursive function that converts an attrs to a list of commands that can be written to the + # config file. + toCommand = basePath: attrs: + lib.concatLists (lib.mapAttrsToList + (key: value: let path = basePath ++ [ key ]; in toArgs path value) attrs); + +in { + meta.maintainers = [ lib.maintainers.GaetanLepage ]; + + options.wayland.windowManager.river = { + enable = lib.mkEnableOption "the river window manager"; + + package = lib.mkPackageOption pkgs "river" { + nullable = true; + extraDescription = '' + Set to `null` to not add any river package to your path. + This should be done if you want to use the NixOS river module to install river. + ''; + }; + + xwayland.enable = lib.mkEnableOption "XWayland" // { default = true; }; + + systemd = { + enable = lib.mkEnableOption null // { + default = true; + description = '' + Whether to enable {file}`river-session.target` on + river startup. This links to {file}`graphical-session.target`}. + Some important environment variables will be imported to systemd + and D-Bus user environment before reaching the target, including + - `DISPLAY` + - `WAYLAND_DISPLAY` + - `XDG_CURRENT_DESKTOP` + - `NIXOS_OZONE_WL` + - `XCURSOR_THEME` + - `XCURSOR_SIZE` + ''; + }; + + variables = lib.mkOption { + type = types.listOf types.str; + default = [ + "DISPLAY" + "WAYLAND_DISPLAY" + "XDG_CURRENT_DESKTOP" + "NIXOS_OZONE_WL" + "XCURSOR_THEME" + "XCURSOR_SIZE" + ]; + example = [ "-all" ]; + description = '' + Environment variables to be imported in the systemd & D-Bus user + environment. + ''; + }; + + extraCommands = lib.mkOption { + type = types.listOf types.str; + default = [ + "systemctl --user stop river-session.target" + "systemctl --user start river-session.target" + ]; + description = "Extra commands to be run after D-Bus activation."; + }; + }; + + extraSessionVariables = lib.mkOption { + type = types.attrs; + default = { }; + description = "Extra session variables set when running the compositor."; + example = { MOZ_ENABLE_WAYLAND = "1"; }; + }; + + settings = lib.mkOption { + type = let + valueType = with types; + nullOr (oneOf [ + bool + int + float + str + path + (attrsOf valueType) + (listOf valueType) + ]) // { + description = "River configuration value"; + }; + in valueType; + default = { }; + description = "General settings given to `riverctl`."; + example = { + border-width = 2; + declare-mode = [ "locked" "normal" "passthrough" ]; + map.normal."Alt Q" = "close"; + input.pointer-foo-bar = { + accel-profile = "flat"; + events = true; + pointer-accel = -0.3; + tap = false; + }; + rule-add."-app-id" = { + "'bar'" = "csd"; + "'float*'"."-title"."'foo'" = "float"; + }; + set-cursor-warp = "on-output-change"; + set-repeat = "50 300"; + xcursor-theme = "someGreatTheme 12"; + spawn = [ "firefox" "'foot -a terminal'" ]; + }; + }; + + extraConfig = lib.mkOption { + type = types.lines; + default = ""; + example = '' + rivertile -view-padding 6 -outer-padding 6 & + ''; + description = + "Extra lines appended to {file}`$XDG_CONFIG_HOME/river/init`."; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "wayland.windowManager.river" pkgs + lib.platforms.linux) + ]; + + home.packages = lib.optional (cfg.package != null) cfg.package + ++ lib.optional cfg.xwayland.enable pkgs.xwayland; + + # Configuration file ~/.config/river/init + xdg.configFile."river/init".source = pkgs.writeShellScript "init" ('' + ### This file was generated with Nix. Don't modify this file directly. + + ### SHELL VARIABLES ### + ${config.lib.shell.exportAll cfg.extraSessionVariables} + + ### CONFIGURATION ### + ${lib.concatStringsSep "\n" (toCommand [ "riverctl" ] cfg.settings)} + + ### EXTRA CONFIGURATION ### + ${cfg.extraConfig} + + '' + (lib.optionalString cfg.systemd.enable '' + ### SYSTEMD INTEGRATION ### + ${systemdActivation} + '')); + + # Systemd integration + systemd.user.targets.river-session = lib.mkIf cfg.systemd.enable { + Unit = { + Description = "river compositor session"; + Documentation = [ "man:systemd.special(7)" ]; + BindsTo = [ "graphical-session.target" ]; + Wants = [ "graphical-session-pre.target" ]; + After = [ "graphical-session-pre.target" ]; + }; + }; + + systemd.user.targets.tray = { + Unit = { + Description = "Home Manager System Tray"; + Requires = [ "graphical-session-pre.target" ]; + }; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index be4d8f40a111..97fa3fbb9c32 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -260,6 +260,7 @@ in import nmtSrc { ./modules/services/window-managers/herbstluftwm ./modules/services/window-managers/hyprland ./modules/services/window-managers/i3 + ./modules/services/window-managers/river ./modules/services/window-managers/spectrwm ./modules/services/window-managers/sway ./modules/services/wlsunset diff --git a/tests/modules/services/window-managers/river/configuration.nix b/tests/modules/services/window-managers/river/configuration.nix new file mode 100644 index 000000000000..9a0199215751 --- /dev/null +++ b/tests/modules/services/window-managers/river/configuration.nix @@ -0,0 +1,95 @@ +{ ... }: + +{ + wayland.windowManager.river = { + enable = true; + xwayland.enable = true; + extraSessionVariables = { + FOO = "foo"; + BAR = "bar"; + FOURTY_TWO = 42; + }; + # systemdIntegration = true; + settings = { + attach-mode = "bottom"; + background-color = "0x002b36"; + border-color-focused = "0x93a1a1"; + border-color-unfocused = "0x586e75"; + border-color-urgent = "0xff0000"; + border-width = 2; + csd-filter-add.app-id = [ "bar" "foo" ]; + declare-mode = [ "locked" "normal" "passthrough" ]; + default-layout = "rivertile"; + float-filter-add.app-id = "mpd"; + float-filter-add.title = "popup title with spaces"; + focus-follows-cursor = "normal"; + hide-cursor.timeout = 2; + hide-cursor.when-typing = true; + input.pointer-foo-bar = { + accel-profile = "flat"; + events = true; + pointer-accel = -0.3; + tap = false; + }; + keyboard-layout."-variant".colemak."-options"."altwin:swap_alt_wincaps:escapegrp:alt_shift_toggle" = + "us,de"; + map.locked.None.XF86AudioLowerVolume.spawn = "'pamixer -d 5'"; + map.locked.None.XF86AudioRaiseVolume.spawn = "'pamixer -i 5'"; + map.normal."Alt E" = "toggle-fullscreen"; + map.normal."Alt P" = "enter-mode passthrough"; + map.normal."Alt Q" = "close"; + map.normal."Alt Return" = "spawn foot"; + map.normal."Alt T" = "toggle-float"; + map.passthrough."Alt P" = "enter-mode normal"; + map-pointer.normal."Alt BTN_LEFT" = "move-view"; + map-pointer.normal."Super BTN_LEFT" = "move-view"; + map-pointer.normal."Super BTN_MIDDLE" = "toggle-float"; + map-pointer.normal."Super BTN_RIGHT" = "resize-view"; + map-switch = { + locked = { + lid.open = "foo"; + tablet.on = "foo"; + }; + normal = { + lid = { + close = "foo"; + open = "foo"; + }; + tablet = { + off = "foo bar"; + on = "foo"; + }; + }; + }; + rule-add."-app-id" = { + "'bar'" = "csd"; + "'float*'"."-title"."'foo'" = "float"; + }; + set-cursor-warp = "on-output-change"; + set-repeat = "50 300"; + xcursor-theme = "someGreatTheme 12"; + spawn = [ "firefox" "'foot -a terminal'" ]; + }; + + extraConfig = '' + rivertile -view-padding 6 -outer-padding 6 & + some + extra config + ''; + }; + + test.stubs = { + dbus = { }; + river = { }; + xwayland = { }; + }; + + nmt.script = '' + riverInit=home-files/.config/river/init + assertFileExists "$riverInit" + assertFileIsExecutable "$riverInit" + + normalizedConfig=$(normalizeStorePaths "$riverInit") + assertFileContent "$normalizedConfig" "${./init}" + ''; +} diff --git a/tests/modules/services/window-managers/river/default.nix b/tests/modules/services/window-managers/river/default.nix new file mode 100644 index 000000000000..5d17f3f110ae --- /dev/null +++ b/tests/modules/services/window-managers/river/default.nix @@ -0,0 +1 @@ +{ river-configuration = ./configuration.nix; } diff --git a/tests/modules/services/window-managers/river/init b/tests/modules/services/window-managers/river/init new file mode 100755 index 000000000000..b7c5ede3d045 --- /dev/null +++ b/tests/modules/services/window-managers/river/init @@ -0,0 +1,67 @@ +#!/nix/store/00000000000000000000000000000000-bash/bin/bash +### This file was generated with Nix. Don't modify this file directly. + +### SHELL VARIABLES ### +export BAR="bar" +export FOO="foo" +export FOURTY_TWO="42" + +### CONFIGURATION ### +riverctl attach-mode bottom +riverctl background-color 0x002b36 +riverctl border-color-focused 0x93a1a1 +riverctl border-color-unfocused 0x586e75 +riverctl border-color-urgent 0xff0000 +riverctl border-width 2 +riverctl csd-filter-add app-id bar +riverctl csd-filter-add app-id foo +riverctl declare-mode locked +riverctl declare-mode normal +riverctl declare-mode passthrough +riverctl default-layout rivertile +riverctl float-filter-add app-id mpd +riverctl float-filter-add title popup title with spaces +riverctl focus-follows-cursor normal +riverctl hide-cursor timeout 2 +riverctl hide-cursor when-typing enabled +riverctl input pointer-foo-bar accel-profile flat +riverctl input pointer-foo-bar events enabled +riverctl input pointer-foo-bar pointer-accel -0.300000 +riverctl input pointer-foo-bar tap disabled +riverctl keyboard-layout -variant colemak -options altwin:swap_alt_wincaps:escapegrp:alt_shift_toggle us,de +riverctl map locked None XF86AudioLowerVolume spawn 'pamixer -d 5' +riverctl map locked None XF86AudioRaiseVolume spawn 'pamixer -i 5' +riverctl map normal Alt E toggle-fullscreen +riverctl map normal Alt P enter-mode passthrough +riverctl map normal Alt Q close +riverctl map normal Alt Return spawn foot +riverctl map normal Alt T toggle-float +riverctl map passthrough Alt P enter-mode normal +riverctl map-pointer normal Alt BTN_LEFT move-view +riverctl map-pointer normal Super BTN_LEFT move-view +riverctl map-pointer normal Super BTN_MIDDLE toggle-float +riverctl map-pointer normal Super BTN_RIGHT resize-view +riverctl map-switch locked lid open foo +riverctl map-switch locked tablet on foo +riverctl map-switch normal lid close foo +riverctl map-switch normal lid open foo +riverctl map-switch normal tablet off foo bar +riverctl map-switch normal tablet on foo +riverctl rule-add -app-id 'bar' csd +riverctl rule-add -app-id 'float*' -title 'foo' float +riverctl set-cursor-warp on-output-change +riverctl set-repeat 50 300 +riverctl spawn firefox +riverctl spawn 'foot -a terminal' +riverctl xcursor-theme someGreatTheme 12 + +### EXTRA CONFIGURATION ### +rivertile -view-padding 6 -outer-padding 6 & +some +extra config + + +### SYSTEMD INTEGRATION ### +exec "@dbus@/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE && systemctl --user stop river-session.target && systemctl --user start river-session.target" + + From 0b69d574162cfa6eb7919d5614a48d0185550891 Mon Sep 17 00:00:00 2001 From: gallegonovato Date: Wed, 21 Feb 2024 13:02:03 +0100 Subject: [PATCH 068/636] Translate using Weblate (Spanish) Currently translated at 100.0% (36 of 36 strings) Co-authored-by: gallegonovato Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/es/ Translation: Home Manager/Home Manager CLI --- home-manager/po/es.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/es.po b/home-manager/po/es.po index 49400f6382b0..6bf940ed6970 100644 --- a/home-manager/po/es.po +++ b/home-manager/po/es.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-02-21 12:02+0000\n" +"Last-Translator: gallegonovato \n" "Language-Team: Spanish \n" "Language: es\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -185,7 +185,7 @@ msgstr "Configuración \"news.display\" no reconocida \"%s\"." #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Por favor, defina la variable del entorno $EDITOR o $VISUAL" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From 0e0e9669547e45ea6cca2de4044c1a384fd0fe55 Mon Sep 17 00:00:00 2001 From: Joey Territo Date: Sun, 18 Feb 2024 17:00:56 -0600 Subject: [PATCH 069/636] zsh: fix broken ZDOTDIR when path contains spaces --- modules/programs/zsh.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index c375b57cff3b..392d26320267 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -22,7 +22,7 @@ let mapAttrsToList (k: v: ''hash -d ${k}="${v}"'') cfg.dirHashes ); - zdotdir = "$HOME/" + cfg.dotDir; + zdotdir = "$HOME/" + lib.escapeShellArg cfg.dotDir; bindkeyCommands = { emacs = "bindkey -e"; From 4e6d25a51bb3035af7db54cc8f7fcac23e9467dc Mon Sep 17 00:00:00 2001 From: Judson Lester Date: Tue, 20 Feb 2024 12:07:21 -0800 Subject: [PATCH 070/636] lorri: systemd allow access to cache directories Some nix builds require RW access to `.cache/nix` and `.cache/lorri`. --- modules/services/lorri.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/services/lorri.nix b/modules/services/lorri.nix index f782ff880d7f..533a53441611 100644 --- a/modules/services/lorri.nix +++ b/modules/services/lorri.nix @@ -7,7 +7,7 @@ let cfg = config.services.lorri; in { - meta.maintainers = [ maintainers.gerschtli ]; + meta.maintainers = [ maintainers.gerschtli maintainers.nyarly ]; options.services.lorri = { enable = mkEnableOption "lorri build daemon"; @@ -55,6 +55,10 @@ in { ReadWritePaths = [ # /run/user/1000 for the socket "%t" + # Needs to update own cache + "%C/lorri" + # Needs %C/nix/fetcher-cache-v1.sqlite + "%C/nix" "/nix/var/nix/gcroots/per-user/%u" ]; CacheDirectory = [ "lorri" ]; From ae7a3b5137ca3522f2802b3183de8fe5287b13d2 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Sat, 24 Feb 2024 22:04:47 +0200 Subject: [PATCH 071/636] hyprland: fix reloading Fix hyprctl erroring out due to HIS. --- modules/services/window-managers/hyprland.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index 168bab6594bc..ec0cf557f363 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -247,10 +247,8 @@ in { onChange = lib.mkIf (cfg.package != null) '' ( # Execute in subshell so we don't poision environment with vars if [[ -d "/tmp/hypr" ]]; then - # This var must be set for hyprctl to function, but the value doesn't matter. - export HYPRLAND_INSTANCE_SIGNATURE="bogus" for i in $(${cfg.finalPackage}/bin/hyprctl instances -j | jq ".[].instance" -r); do - HYPRLAND_INSTANCE_SIGNATURE=$i ${cfg.finalPackage}/bin/hyprctl reload config-only + ${cfg.finalPackage}/bin/hyprctl -i "$i" reload config-only done fi ) From 4ee704cb13a5a7645436f400b9acc89a67b9c08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20E=2E=20S=C3=B8rensen?= Date: Sat, 24 Feb 2024 21:34:39 +0100 Subject: [PATCH 072/636] xscreensaver: add package option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- modules/services/xscreensaver.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/services/xscreensaver.nix b/modules/services/xscreensaver.nix index 3ae92658f034..6205e3ee81e1 100644 --- a/modules/services/xscreensaver.nix +++ b/modules/services/xscreensaver.nix @@ -25,6 +25,13 @@ in { The settings to use for XScreenSaver. ''; }; + + package = mkOption { + type = with types; package; + default = pkgs.xscreensaver; + defaultText = lib.literalExpression "pkgs.xscreensaver"; + description = "Which xscreensaver package to use."; + }; }; }; @@ -35,7 +42,7 @@ in { ]; # To make the xscreensaver-command tool available. - home.packages = [ pkgs.xscreensaver ]; + home.packages = [ cfg.package ]; xresources.properties = mapAttrs' (n: nameValuePair "xscreensaver.${n}") cfg.settings; @@ -52,8 +59,8 @@ in { }; Service = { - ExecStart = "${pkgs.xscreensaver}/bin/xscreensaver -no-splash"; - Environment = "PATH=${makeBinPath [ pkgs.xscreensaver ]}"; + ExecStart = "${cfg.package}/bin/xscreensaver -no-splash"; + Environment = "PATH=${makeBinPath [ cfg.package ]}"; }; Install = { WantedBy = [ "graphical-session.target" ]; }; From 1d085ea4444d26aa52297758b333b449b2aa6fca Mon Sep 17 00:00:00 2001 From: XYenon Date: Tue, 27 Feb 2024 07:00:56 +0800 Subject: [PATCH 073/636] yazi: update shell integrations (#5048) --- modules/programs/yazi.nix | 12 ++++-------- .../programs/yazi/bash-integration-enabled.nix | 2 +- .../programs/yazi/nushell-integration-enabled.nix | 10 +++------- .../programs/yazi/zsh-integration-enabled.nix | 2 +- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index d0d941d139f7..c45342274c24 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -8,7 +8,7 @@ let bashIntegration = '' function ya() { - tmp="$(mktemp -t "yazi-cwd.XXXXX")" + local tmp="$(mktemp -t "yazi-cwd.XXXXX")" yazi "$@" --cwd-file="$tmp" if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then cd -- "$cwd" @@ -29,18 +29,14 @@ let ''; nushellIntegration = '' - def --env ya [args?] { + def --env ya [...args] { let tmp = (mktemp -t "yazi-cwd.XXXXX") - if ($args == null) { - yazi --cwd-file $tmp - } else { - yazi $args --cwd-file $tmp - } + yazi ...$args --cwd-file $tmp let cwd = (open $tmp) if $cwd != "" and $cwd != $env.PWD { cd $cwd } - rm -f $tmp + rm -fp $tmp } ''; in { diff --git a/tests/modules/programs/yazi/bash-integration-enabled.nix b/tests/modules/programs/yazi/bash-integration-enabled.nix index 9a8c18bf266d..ff9bc2f2bcc4 100644 --- a/tests/modules/programs/yazi/bash-integration-enabled.nix +++ b/tests/modules/programs/yazi/bash-integration-enabled.nix @@ -3,7 +3,7 @@ let shellIntegration = '' function ya() { - tmp="$(mktemp -t "yazi-cwd.XXXXX")" + local tmp="$(mktemp -t "yazi-cwd.XXXXX")" yazi "$@" --cwd-file="$tmp" if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then cd -- "$cwd" diff --git a/tests/modules/programs/yazi/nushell-integration-enabled.nix b/tests/modules/programs/yazi/nushell-integration-enabled.nix index 121e2756711e..ddd041dc043b 100644 --- a/tests/modules/programs/yazi/nushell-integration-enabled.nix +++ b/tests/modules/programs/yazi/nushell-integration-enabled.nix @@ -2,18 +2,14 @@ let shellIntegration = '' - def --env ya [args?] { + def --env ya [...args] { let tmp = (mktemp -t "yazi-cwd.XXXXX") - if ($args == null) { - yazi --cwd-file $tmp - } else { - yazi $args --cwd-file $tmp - } + yazi ...$args --cwd-file $tmp let cwd = (open $tmp) if $cwd != "" and $cwd != $env.PWD { cd $cwd } - rm -f $tmp + rm -fp $tmp } ''; in { diff --git a/tests/modules/programs/yazi/zsh-integration-enabled.nix b/tests/modules/programs/yazi/zsh-integration-enabled.nix index ef7960c5920c..c8744146ec24 100644 --- a/tests/modules/programs/yazi/zsh-integration-enabled.nix +++ b/tests/modules/programs/yazi/zsh-integration-enabled.nix @@ -3,7 +3,7 @@ let shellIntegration = '' function ya() { - tmp="$(mktemp -t "yazi-cwd.XXXXX")" + local tmp="$(mktemp -t "yazi-cwd.XXXXX")" yazi "$@" --cwd-file="$tmp" if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then cd -- "$cwd" From ecfffe363102f2c95bed6576465504c6a57bf8fe Mon Sep 17 00:00:00 2001 From: John Axel Eriksson Date: Thu, 29 Feb 2024 11:10:25 +0100 Subject: [PATCH 074/636] river: fix systemd activation (#5055) The `exec` command does not do any shell parsing and does not understand the `&&` which is how the extraCommands are added after dbus activation. There doesn't seem to be a reason for `exec` here anyway so just remove it and allow shell parsing. --- modules/services/window-managers/river.nix | 2 +- tests/modules/services/window-managers/river/init | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/services/window-managers/river.nix b/modules/services/window-managers/river.nix index 80ad68b74178..06d458411dc2 100644 --- a/modules/services/window-managers/river.nix +++ b/modules/services/window-managers/river.nix @@ -9,7 +9,7 @@ let extraCommands = builtins.concatStringsSep " " (map (f: "&& ${f}") cfg.systemd.extraCommands); systemdActivation = '' - exec "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables} ${extraCommands}" + ${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables} ${extraCommands} ''; toValue = val: diff --git a/tests/modules/services/window-managers/river/init b/tests/modules/services/window-managers/river/init index b7c5ede3d045..c266ca9e9ce2 100755 --- a/tests/modules/services/window-managers/river/init +++ b/tests/modules/services/window-managers/river/init @@ -62,6 +62,6 @@ extra config ### SYSTEMD INTEGRATION ### -exec "@dbus@/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE && systemctl --user stop river-session.target && systemctl --user start river-session.target" +@dbus@/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE && systemctl --user stop river-session.target && systemctl --user start river-session.target From 2f3367769a93b226c467551315e9e270c3f78b15 Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Thu, 29 Feb 2024 11:54:14 +0100 Subject: [PATCH 075/636] Translate using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (36 of 36 strings) Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/pt_BR/ Translation: Home Manager/Home Manager CLI Co-authored-by: guto --- home-manager/po/pt_BR.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/pt_BR.po b/home-manager/po/pt_BR.po index 4389446bfdd8..3cb16292a9f6 100644 --- a/home-manager/po/pt_BR.po +++ b/home-manager/po/pt_BR.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-02-28 13:02+0000\n" +"Last-Translator: guto \n" "Language-Team: Portuguese (Brazil) \n" "Language: pt_BR\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -186,7 +186,7 @@ msgstr "Valor \"%s\" para configuração \"news.display\" não reconhecido." #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Por favor, defina a variável de ambiente $EDITOR ou $VISUAL" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From 0992b38e5e1f3fba5cf7d386a20a39ce8ea6ee3f Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 3 Mar 2024 06:55:43 +0100 Subject: [PATCH 076/636] tests: add mkStubPackage in Nixpkgs overlay --- tests/stubs.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/stubs.nix b/tests/stubs.nix index e9ecbed703fb..b9c933ac85d4 100644 --- a/tests/stubs.nix +++ b/tests/stubs.nix @@ -70,12 +70,11 @@ in { config = { lib.test.mkStubPackage = mkStubPackage; - nixpkgs.overlays = mkIf (config.test.stubs != { }) [ - (self: super: + nixpkgs.overlays = [ (self: super: { inherit mkStubPackage; }) ] + ++ optional (config.test.stubs != { }) (self: super: mapAttrs (n: v: mkStubPackage (v // optionalAttrs (v.version == null) { version = super.${n}.version or null; - })) config.test.stubs) - ]; + })) config.test.stubs); }; } From 4de84265d7ec7634a69ba75028696d74de9a44a7 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 2 Mar 2024 21:52:18 +0100 Subject: [PATCH 077/636] fcitx5: fix tests --- tests/modules/i18n/input-method/fcitx5-stubs.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/modules/i18n/input-method/fcitx5-stubs.nix b/tests/modules/i18n/input-method/fcitx5-stubs.nix index 2a981125606a..f63f9cc1c972 100644 --- a/tests/modules/i18n/input-method/fcitx5-stubs.nix +++ b/tests/modules/i18n/input-method/fcitx5-stubs.nix @@ -15,7 +15,6 @@ }; fcitx5-configtool = { outPath = null; }; fcitx5-lua = { outPath = null; }; - fcitx5-qt = { outPath = null; }; fcitx5-gtk = { outPath = null; }; fcitx5-chinese-addons = { outPath = null; }; @@ -36,9 +35,18 @@ }; nixpkgs.overlays = [ - (self: super: { - fcitx5-with-addons = - super.fcitx5-with-addons.override { inherit (self) fcitx5-qt; }; + (final: super: { + libsForQt5 = super.libsForQt5.overrideScope' (qt5prev: qt5final: { + fcitx5-qt = super.mkStubPackage { outPath = null; }; + }); + + qt6Packages = super.qt6Packages.overrideScope' (qt6prev: qt6final: { + fcitx5-qt = super.mkStubPackage { outPath = null; }; + }); + + fcitx5-with-addons = super.fcitx5-with-addons.override { + inherit (final) libsForQt5 qt6Packages; + }; }) ]; } From d579633ff9915a8f4058d5c439281097e92380a8 Mon Sep 17 00:00:00 2001 From: Felipe Silva Date: Sun, 3 Mar 2024 14:12:42 -0300 Subject: [PATCH 078/636] khal: fix contact integration (#4836) * khal: fix contact integration - Add tests for contact+khal - Make options `color`/`priority` available for contact accounts * khal: add separate calendar for each contact collection A contact account may have multiple VCARD collections, but Khal doesn't search recursively. Collection folder names must be hardcoded, and each has its own calendar. - Add khal.collections option for contact accounts - Default to previous setup for accounts with a single collection - Add tests * khal: specify how priority is defined by Khal See https://khal.readthedocs.io/en/latest/configure.html --- modules/accounts/contacts.nix | 1 + modules/programs/khal-accounts.nix | 34 +++++++++++++++++++ modules/programs/khal-calendar-accounts.nix | 34 ------------------- modules/programs/khal-contact-accounts.nix | 15 ++++++++ modules/programs/khal.nix | 23 ++++++++++--- tests/modules/programs/khal/config.nix | 30 ++++++++++++++++ .../programs/khal/khal-config-expected | 21 ++++++++++++ 7 files changed, 120 insertions(+), 38 deletions(-) create mode 100644 modules/programs/khal-contact-accounts.nix diff --git a/modules/accounts/contacts.nix b/modules/accounts/contacts.nix index 83f57d8e24ae..272594b189be 100644 --- a/modules/accounts/contacts.nix +++ b/modules/accounts/contacts.nix @@ -126,6 +126,7 @@ in { contactOpts (import ../programs/vdirsyncer-accounts.nix) (import ../programs/khal-accounts.nix) + (import ../programs/khal-contact-accounts.nix) ]); default = { }; description = "List of contacts."; diff --git a/modules/programs/khal-accounts.nix b/modules/programs/khal-accounts.nix index ad94adc9952a..cf04a65c05e1 100644 --- a/modules/programs/khal-accounts.nix +++ b/modules/programs/khal-accounts.nix @@ -13,5 +13,39 @@ with lib; Keep khal from making any changes to this account. ''; }; + + color = mkOption { + type = types.nullOr (types.enum [ + "black" + "white" + "brown" + "yellow" + "dark gray" + "dark green" + "dark blue" + "light gray" + "light green" + "light blue" + "dark magenta" + "dark cyan" + "dark red" + "light magenta" + "light cyan" + "light red" + ]); + default = null; + description = '' + Color in which events in this calendar are displayed. + ''; + example = "light green"; + }; + + priority = mkOption { + type = types.int; + default = 10; + description = '' + Priority of a calendar used for coloring (calendar with highest priority is preferred). + ''; + }; }; } diff --git a/modules/programs/khal-calendar-accounts.nix b/modules/programs/khal-calendar-accounts.nix index 6910d627a15c..0a56ba81603f 100644 --- a/modules/programs/khal-calendar-accounts.nix +++ b/modules/programs/khal-calendar-accounts.nix @@ -20,39 +20,5 @@ with lib; type is set to discover. ''; }; - - color = mkOption { - type = types.nullOr (types.enum [ - "black" - "white" - "brown" - "yellow" - "dark gray" - "dark green" - "dark blue" - "light gray" - "light green" - "light blue" - "dark magenta" - "dark cyan" - "dark red" - "light magenta" - "light cyan" - "light red" - ]); - default = null; - description = '' - Color in which events in this calendar are displayed. - ''; - example = "light green"; - }; - - priority = mkOption { - type = types.int; - default = 10; - description = '' - Priority of a calendar used for coloring. - ''; - }; }; } diff --git a/modules/programs/khal-contact-accounts.nix b/modules/programs/khal-contact-accounts.nix new file mode 100644 index 000000000000..c58ed4d6b4b1 --- /dev/null +++ b/modules/programs/khal-contact-accounts.nix @@ -0,0 +1,15 @@ +{ config, lib, ... }: + +with lib; + +{ + options.khal = { + collections = mkOption { + type = types.nullOr (types.listOf types.str); + default = null; + description = '' + VCARD collections to be searched for contact birthdays. + ''; + }; + }; +} diff --git a/modules/programs/khal.nix b/modules/programs/khal.nix index 8fc0e0892fc9..c8037e53ba72 100644 --- a/modules/programs/khal.nix +++ b/modules/programs/khal.nix @@ -12,13 +12,25 @@ let khalCalendarAccounts = filterAttrs (_: a: a.khal.enable) config.accounts.calendar.accounts; - khalContactAccounts = mapAttrs (_: v: v // { type = "birthdays"; }) - (filterAttrs (_: a: a.khal.enable) config.accounts.contact.accounts); + # a contact account may have multiple collections, each a separate calendar + expandContactAccount = name: acct: + if acct.khal.collections != null then + listToAttrs (map (c: { + name = "${name}-${c}"; + value = recursiveUpdate acct { khal.thisCollection = c; }; + }) acct.khal.collections) + else { + ${name} = acct; + }; + + khalContactAccounts = concatMapAttrs expandContactAccount + (mapAttrs (_: v: recursiveUpdate v { khal.type = "birthdays"; }) + (filterAttrs (_: a: a.khal.enable) config.accounts.contact.accounts)); khalAccounts = khalCalendarAccounts // khalContactAccounts; primaryAccount = findSingle (a: a.primary) null null - (mapAttrsToList (n: v: v // { name = n; }) khalAccounts); + (mapAttrsToList (n: v: v // { name = n; }) khalCalendarAccounts); definedAttrs = filterAttrs (_: v: !isNull v); @@ -30,6 +42,9 @@ let "path = ${ value.local.path + "/" + (optionalString (value.khal.type == "discover") value.khal.glob) + + (optionalString + (value.khal.type == "birthdays" && value.khal ? thisCollection) + value.khal.thisCollection) }" ] ++ optional (value.khal.readOnly) "readonly = True" ++ [ (toKeyValueIfDefined (getAttrs [ "type" "color" "priority" ] value.khal)) @@ -153,7 +168,7 @@ in { locale = mkOption { type = lib.types.submodule { options = localeOptions; }; description = '' - khal locale settings. + khal locale settings. ''; default = { }; }; diff --git a/tests/modules/programs/khal/config.nix b/tests/modules/programs/khal/config.nix index a2eb8bf1383d..50218e15aa97 100644 --- a/tests/modules/programs/khal/config.nix +++ b/tests/modules/programs/khal/config.nix @@ -32,6 +32,36 @@ }; }; + accounts.contact = { + basePath = "$XDG_CONFIG_HOME/card"; + accounts = { + testcontacts = { + khal = { + enable = true; + collections = [ "default" "automaticallyCollected" ]; + }; + local.type = "filesystem"; + local.fileExt = ".vcf"; + name = "testcontacts"; + remote = { + type = "http"; + url = "https://example.com/contacts.vcf"; + }; + }; + + testcontactsNoCollections = { + khal.enable = true; + local.type = "filesystem"; + local.fileExt = ".vcf"; + name = "testcontactsNoCollections"; + remote = { + type = "http"; + url = "https://example.com/contacts.vcf"; + }; + }; + }; + }; + test.stubs = { khal = { }; }; nmt.script = '' diff --git a/tests/modules/programs/khal/khal-config-expected b/tests/modules/programs/khal/khal-config-expected index 361db2d68041..a4cf7a30e157 100644 --- a/tests/modules/programs/khal/khal-config-expected +++ b/tests/modules/programs/khal/khal-config-expected @@ -7,6 +7,27 @@ type=calendar +[[testcontacts-automaticallyCollected]] +path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontacts/automaticallyCollected +priority=10 +type=birthdays + + + +[[testcontacts-default]] +path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontacts/default +priority=10 +type=birthdays + + + +[[testcontactsNoCollections]] +path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontactsNoCollections/ +priority=10 +type=birthdays + + + [default] default_calendar=test highlight_event_days=true From 23ff9821bcaec12981e32049e8687f25f11e5ef3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 19:50:43 +0100 Subject: [PATCH 079/636] ci: bump DeterminateSystems/update-flake-lock from 20 to 21 Bumps [DeterminateSystems/update-flake-lock](https://github.com/determinatesystems/update-flake-lock) from 20 to 21. - [Release notes](https://github.com/determinatesystems/update-flake-lock/releases) - [Commits](https://github.com/determinatesystems/update-flake-lock/compare/v20...v21) --- updated-dependencies: - dependency-name: DeterminateSystems/update-flake-lock dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/update-flake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-flake.yml b/.github/workflows/update-flake.yml index 2f1eb8c658f1..6485286687a2 100644 --- a/.github/workflows/update-flake.yml +++ b/.github/workflows/update-flake.yml @@ -14,7 +14,7 @@ jobs: - name: Install Nix uses: cachix/install-nix-action@v23 - name: Update flake.lock - uses: DeterminateSystems/update-flake-lock@v20 + uses: DeterminateSystems/update-flake-lock@v21 with: token: ${{ secrets.GH_TOKEN_FOR_UPDATES }} pr-labels: dependencies From bdea159ffab9865f808b8d92fd2bef33521867b2 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Tue, 5 Mar 2024 22:53:10 +0100 Subject: [PATCH 080/636] fcitx5: fix reference to fcitx5-with-addons --- modules/i18n/input-method/fcitx5.nix | 3 ++- .../i18n/input-method/fcitx5-stubs.nix | 21 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/modules/i18n/input-method/fcitx5.nix b/modules/i18n/input-method/fcitx5.nix index 3599fd2dc840..3c2d1c191be9 100644 --- a/modules/i18n/input-method/fcitx5.nix +++ b/modules/i18n/input-method/fcitx5.nix @@ -5,7 +5,8 @@ with lib; let im = config.i18n.inputMethod; cfg = im.fcitx5; - fcitx5Package = pkgs.fcitx5-with-addons.override { inherit (cfg) addons; }; + fcitx5Package = + pkgs.libsForQt5.fcitx5-with-addons.override { inherit (cfg) addons; }; in { options = { i18n.inputMethod.fcitx5 = { diff --git a/tests/modules/i18n/input-method/fcitx5-stubs.nix b/tests/modules/i18n/input-method/fcitx5-stubs.nix index f63f9cc1c972..2390ddde89f0 100644 --- a/tests/modules/i18n/input-method/fcitx5-stubs.nix +++ b/tests/modules/i18n/input-method/fcitx5-stubs.nix @@ -13,10 +13,8 @@ $out/bin/fcitx5-config-qt ''; }; - fcitx5-configtool = { outPath = null; }; fcitx5-lua = { outPath = null; }; fcitx5-gtk = { outPath = null; }; - fcitx5-chinese-addons = { outPath = null; }; gtk2 = { buildScript = '' @@ -35,18 +33,21 @@ }; nixpkgs.overlays = [ - (final: super: { - libsForQt5 = super.libsForQt5.overrideScope' (qt5prev: qt5final: { - fcitx5-qt = super.mkStubPackage { outPath = null; }; + (final: prev: { + libsForQt5 = prev.libsForQt5.overrideScope (qt5final: qt5prev: { + fcitx5-chinese-addons = prev.mkStubPackage { outPath = null; }; + fcitx5-configtool = prev.mkStubPackage { outPath = null; }; + fcitx5-qt = prev.mkStubPackage { outPath = null; }; + + fcitx5-with-addons = qt5prev.fcitx5-with-addons.override { + inherit (final) libsForQt5 qt6Packages; + }; }); - qt6Packages = super.qt6Packages.overrideScope' (qt6prev: qt6final: { - fcitx5-qt = super.mkStubPackage { outPath = null; }; + qt6Packages = prev.qt6Packages.overrideScope (qt6final: qt6prev: { + fcitx5-qt = prev.mkStubPackage { outPath = null; }; }); - fcitx5-with-addons = super.fcitx5-with-addons.override { - inherit (final) libsForQt5 qt6Packages; - }; }) ]; } From c386fde594c016865ecc98235a0454bea782ecc7 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 6 Mar 2024 08:42:05 +0100 Subject: [PATCH 081/636] bemenu: stub package in tests --- tests/modules/programs/bemenu/basic-configuration.nix | 2 ++ tests/modules/programs/bemenu/empty-configuration.nix | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/modules/programs/bemenu/basic-configuration.nix b/tests/modules/programs/bemenu/basic-configuration.nix index 0615ae3ca765..b8d84469cb05 100644 --- a/tests/modules/programs/bemenu/basic-configuration.nix +++ b/tests/modules/programs/bemenu/basic-configuration.nix @@ -19,6 +19,8 @@ }; }; + test.stubs.bemenu = { }; + nmt.script = '' assertFileExists home-path/etc/profile.d/hm-session-vars.sh assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ diff --git a/tests/modules/programs/bemenu/empty-configuration.nix b/tests/modules/programs/bemenu/empty-configuration.nix index 5e56d9ed7fa3..d9e7296969cb 100644 --- a/tests/modules/programs/bemenu/empty-configuration.nix +++ b/tests/modules/programs/bemenu/empty-configuration.nix @@ -1,6 +1,8 @@ { programs.bemenu = { enable = true; }; + test.stubs.bemenu = { }; + nmt.script = '' assertFileExists home-path/etc/profile.d/hm-session-vars.sh assertFileNotRegex home-path/etc/profile.d/hm-session-vars.sh \ From 9daee941ab013b057df34ebb7f1c41cafabfea95 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 6 Mar 2024 08:41:05 +0100 Subject: [PATCH 082/636] gpg: fix immutable keyfile test --- tests/modules/programs/gpg/immutable-keyfiles.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/modules/programs/gpg/immutable-keyfiles.nix b/tests/modules/programs/gpg/immutable-keyfiles.nix index 4e3e2bbcc5b8..15dd2b9e7865 100644 --- a/tests/modules/programs/gpg/immutable-keyfiles.nix +++ b/tests/modules/programs/gpg/immutable-keyfiles.nix @@ -11,8 +11,8 @@ { source = pkgs.fetchurl { url = - "https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x36cacf52d098cc0e78fb0cb13573356c25c424d4"; - hash = "sha256-9Zjsb/TtOyiPzMO/Jg3CtJwSxuw7QmX0pcfZT2/1w5E="; + "https://keys.openpgp.org/pks/lookup?op=get&options=mr&search=0x44CF42371ADF842E12F116EAA9D3F98FCCF5460B"; + hash = "sha256-u01QTYEFSY1feJWX3JJjXB6thiVO4WOnrqNmzg6vIDs="; }; trust = 1; # "unknown" } @@ -44,7 +44,7 @@ # Check Trust assertFileRegex $WORKDIR/gpgtrust.txt \ - '^36CACF52D098CC0E78FB0CB13573356C25C424D4:2:$' + '^44CF42371ADF842E12F116EAA9D3F98FCCF5460B:2:$' assertFileRegex $WORKDIR/gpgtrust.txt \ '^BB847B5A69EF343CEF511B29073C282D7D6F806C:3:$' From 3c7bacf1d42e533299c5e3baf74556a0e0ac3d0e Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Tue, 5 Mar 2024 23:39:19 +0100 Subject: [PATCH 083/636] ci: remove cachix action All the extra binary cache lookups and uploads to Cachix make the build quite a bit slower than necessary. --- .github/workflows/test.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8d92789a6cda..40d4e2b33bb1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,10 +15,6 @@ jobs: - uses: cachix/install-nix-action@v23 with: nix_path: nixpkgs=channel:nixos-unstable - - uses: cachix/cachix-action@v13 - with: - name: nix-community - authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - run: | if grep -R --exclude stdlib-extended.nix literalExample modules ; then echo "Error: literalExample should be replaced by literalExpression" > /dev/stderr From 1d717f581b7b001b2a1293277a1d3386fca5b87e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Tri=C3=B1anes?= Date: Wed, 6 Mar 2024 11:54:01 +0100 Subject: [PATCH 084/636] gpg-agent: Fix nushell integration --- modules/services/gpg-agent.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index 70e4df0a5972..685698b774a2 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -27,9 +27,7 @@ let '' + optionalString cfg.enableSshSupport '' ${gpgPkg}/bin/gpg-connect-agent updatestartuptty /bye | ignore - if not "SSH_AUTH_SOCK" in $env { - $env.SSH_AUTH_SOCK = (${gpgPkg}/bin/gpgconf --list-dirs agent-ssh-socket) - } + $env.SSH_AUTH_SOCK = ($env.SSH_AUTH_SOCK? | default (${gpgPkg}/bin/gpgconf --list-dirs agent-ssh-socket)) ''; # mimic `gpgconf` output for use in `systemd` unit definitions. From 477176502a6e099192da61984cd5be896d0b5659 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Wed, 6 Mar 2024 12:37:54 +0100 Subject: [PATCH 085/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/5863c27340ba4de8f83e7e3c023b9599c3cb3c80' (2024-02-16) → 'github:NixOS/nixpkgs/b8697e57f10292a6165a20f03d2f42920dfaf973' (2024-03-03) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index e985e3a0a582..921dc8d87f2a 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1708118438, - "narHash": "sha256-kk9/0nuVgA220FcqH/D2xaN6uGyHp/zoxPNUmPCMmEE=", + "lastModified": 1709479366, + "narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5863c27340ba4de8f83e7e3c023b9599c3cb3c80", + "rev": "b8697e57f10292a6165a20f03d2f42920dfaf973", "type": "github" }, "original": { From 950673cec79298d9a1072499e0181849545376e2 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 1 Mar 2024 09:07:06 +0100 Subject: [PATCH 086/636] pueue: always write configuration file Pueue requires the configuration file to contain a `shared` entry. We therefore unconditionally add it as `shared: {}`. Fixes #4295 --- modules/services/pueue.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/services/pueue.nix b/modules/services/pueue.nix index 1431c1cd7196..f0603bb471e9 100644 --- a/modules/services/pueue.nix +++ b/modules/services/pueue.nix @@ -6,7 +6,8 @@ let cfg = config.services.pueue; yamlFormat = pkgs.formats.yaml { }; - configFile = yamlFormat.generate "pueue.yaml" cfg.settings; + configFile = + yamlFormat.generate "pueue.yaml" ({ shared = { }; } // cfg.settings); in { meta.maintainers = [ maintainers.AndersonTorres ]; @@ -39,8 +40,7 @@ in { home.packages = [ cfg.package ]; - xdg.configFile = - mkIf (cfg.settings != { }) { "pueue/pueue.yml".source = configFile; }; + xdg.configFile."pueue/pueue.yml".source = configFile; systemd.user = { services.pueued = { From 613384a51119ea34af58eb5e611e7f31dd3970d6 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 2 Mar 2024 20:00:29 +0100 Subject: [PATCH 087/636] tests: include a service in integration tests --- tests/integration/nixos/basics.nix | 53 ++++++++++++- .../standalone/alice-home-next.nix | 7 ++ tests/integration/standalone/flake-basics.nix | 77 +++++++++++++++---- .../standalone/standard-basics.nix | 75 ++++++++++++++---- 4 files changed, 178 insertions(+), 34 deletions(-) diff --git a/tests/integration/nixos/basics.nix b/tests/integration/nixos/basics.nix index 29c2756f113d..022f066ef2d5 100644 --- a/tests/integration/nixos/basics.nix +++ b/tests/integration/nixos/basics.nix @@ -7,15 +7,44 @@ nodes.machine = { ... }: { imports = [ ../../../nixos ]; # Import the HM NixOS module. - users.users.alice = { isNormalUser = true; }; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; + }; home-manager.users.alice = { ... }: { home.stateVersion = "23.11"; home.file.test.text = "testfile"; + # Enable a light-weight systemd service. + services.pueue.enable = true; + # We focus on sd-switch since that hopefully will become the default in + # the future. + systemd.user.startServices = "sd-switch"; }; }; testScript = '' + def login_as_alice(): + machine.wait_until_tty_matches("1", "login: ") + machine.send_chars("alice\n") + machine.wait_until_tty_matches("1", "Password: ") + machine.send_chars("foobar\n") + machine.wait_until_tty_matches("1", "alice\@machine") + + def logout_alice(): + machine.send_chars("exit\n") + + def alice_cmd(cmd): + return f"su -l alice --shell /bin/sh -c $'export XDG_RUNTIME_DIR=/run/user/$UID ; {cmd}'" + + def succeed_as_alice(cmd): + return machine.succeed(alice_cmd(cmd)) + + def fail_as_alice(cmd): + return machine.fail(alice_cmd(cmd)) + start_all() machine.wait_for_unit("home-manager-alice.service") @@ -28,6 +57,28 @@ expected = "testfile" assert actual == expected, f"expected {path} to contain {expected}, but got {actual}" + with subtest("Pueue service"): + login_as_alice() + + actual = succeed_as_alice("pueue status") + expected = "running" + assert expected in actual, f"expected pueue status to contain {expected}, but got {actual}" + + # Shut down pueue, then run the activation again. Afterwards, the service + # should be running. + machine.succeed("systemctl --user -M alice@.host stop pueued.service") + + fail_as_alice("pueue status") + + machine.systemctl("restart home-manager-alice.service") + machine.wait_for_unit("home-manager-alice.service") + + actual = succeed_as_alice("pueue status") + expected = "running" + assert expected in actual, f"expected pueue status to contain {expected}, but got {actual}" + + logout_alice() + with subtest("GC root and profile"): # There should be a GC root and Home Manager profile and they should point # to the same path in the Nix store. diff --git a/tests/integration/standalone/alice-home-next.nix b/tests/integration/standalone/alice-home-next.nix index f4ee8e8fe64e..04c713d8ba79 100644 --- a/tests/integration/standalone/alice-home-next.nix +++ b/tests/integration/standalone/alice-home-next.nix @@ -9,4 +9,11 @@ home.sessionVariables.EDITOR = "emacs"; programs.bash.enable = true; programs.home-manager.enable = true; + + # Enable a light-weight systemd service. + services.pueue.enable = true; + + # We focus on sd-switch since that hopefully will become the default in the + # future. + systemd.user.startServices = "sd-switch"; } diff --git a/tests/integration/standalone/flake-basics.nix b/tests/integration/standalone/flake-basics.nix index 6c9c1777c9d7..8f9627d9f48f 100644 --- a/tests/integration/standalone/flake-basics.nix +++ b/tests/integration/standalone/flake-basics.nix @@ -7,8 +7,19 @@ nodes.machine = { ... }: { imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; virtualisation.memorySize = 2048; - nix.settings.extra-experimental-features = [ "nix-command" "flakes" ]; - users.users.alice = { isNormalUser = true; }; + nix = { + registry.home-manager.to = { + type = "path"; + path = ../../..; + }; + settings.extra-experimental-features = [ "nix-command" "flakes" ]; + }; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; + }; }; testScript = '' @@ -16,17 +27,30 @@ machine.wait_for_unit("network-online.target") machine.wait_for_unit("multi-user.target") - home_manager = "${../../..}" - nixpkgs = "${pkgs.path}" + def login_as_alice(): + machine.wait_until_tty_matches("1", "login: ") + machine.send_chars("alice\n") + machine.wait_until_tty_matches("1", "Password: ") + machine.send_chars("foobar\n") + machine.wait_until_tty_matches("1", "alice\@machine") - machine.succeed(f"nix registry add home-manager path:{home_manager}") - machine.succeed(f"nix registry add nixpkgs path:{nixpkgs}") + def logout_alice(): + machine.send_chars("exit\n") - def as_alice(cmd): - return machine.succeed(f"su - alice -c '{cmd}'") + def alice_cmd(cmd): + return f"su -l alice --shell /bin/sh -c $'export XDG_RUNTIME_DIR=/run/user/$UID ; {cmd}'" - with subtest("Home Manager init"): - as_alice(f"nix run path:{home_manager} -- init --home-manager-url home-manager --nixpkgs-url nixpkgs --switch") + def succeed_as_alice(cmd): + return machine.succeed(alice_cmd(cmd)) + + def fail_as_alice(cmd): + return machine.fail(alice_cmd(cmd)) + + # Create a persistent login so that Alice has a systemd session. + login_as_alice() + + with subtest("Home Manager installation"): + succeed_as_alice("nix run home-manager -- init --home-manager-url home-manager --nixpkgs-url nixpkgs --switch") actual = machine.succeed("ls /home/alice/.config/home-manager") expected = "flake.lock\nflake.nix\nhome.nix\n" @@ -57,31 +81,50 @@ f"expected GC root and profile to point to same, but pointed to {gcrootTarget} and {profile1Target}" with subtest("Home Manager switch"): - as_alice("cp ${ + fail_as_alice("hello") + + succeed_as_alice("cp ${ ./alice-home-next.nix } /home/alice/.config/home-manager/home.nix") - as_alice("home-manager switch") - as_alice("hello") + actual = succeed_as_alice("home-manager switch") + expected = "Started pueued.service - active" + assert expected in actual, \ + f"expected home-manager switch to contain {expected}, but got {actual}" + + succeed_as_alice("hello") - actual = as_alice("echo -n $EDITOR") + actual = succeed_as_alice("echo $EDITOR").strip() assert "emacs" == actual, \ f"expected $EDITOR to contain emacs, but found {actual}" + actual = machine.succeed("systemctl --user -M alice@.host status pueued.service") + expected = "running" + assert expected in actual, \ + f"expected systemctl status pueued status to contain {expected}, but got {actual}" + + actual = succeed_as_alice("pueue status") + expected = "running" + assert expected in actual, \ + f"expected pueue status to contain {expected}, but got {actual}" + with subtest("Home Manager generations"): - actual = as_alice("home-manager generations") + actual = succeed_as_alice("home-manager generations") expected = ": id 1 ->" assert expected in actual, \ f"expected generations to contain {expected}, but found {actual}" with subtest("Home Manager uninstallation"): - as_alice("yes | home-manager uninstall -L") + succeed_as_alice("yes | home-manager uninstall -L") - as_alice("! hello") + fail_as_alice("hello") machine.succeed("test ! -e /home/alice/.cache/.keep") + # TODO: Fix uninstall to fully remove the share directory. machine.succeed("test ! -e /home/alice/.local/share/home-manager/gcroots") machine.succeed("test ! -e /home/alice/.local/state/home-manager") machine.succeed("test ! -e /home/alice/.local/state/nix/profiles/home-manager") + + logout_alice() ''; } diff --git a/tests/integration/standalone/standard-basics.nix b/tests/integration/standalone/standard-basics.nix index 6c514bfb037b..d4cac249a5fa 100644 --- a/tests/integration/standalone/standard-basics.nix +++ b/tests/integration/standalone/standard-basics.nix @@ -7,7 +7,12 @@ nodes.machine = { ... }: { imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; virtualisation.memorySize = 2048; - users.users.alice = { isNormalUser = true; }; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; + }; }; testScript = '' @@ -17,19 +22,39 @@ home_manager = "${../../..}" - def as_alice(cmd): - return machine.succeed(f"su - alice -c '{cmd}'") + def login_as_alice(): + machine.wait_until_tty_matches("1", "login: ") + machine.send_chars("alice\n") + machine.wait_until_tty_matches("1", "Password: ") + machine.send_chars("foobar\n") + machine.wait_until_tty_matches("1", "alice\@machine") + + def logout_alice(): + machine.send_chars("exit\n") + + def alice_cmd(cmd): + return f"su -l alice --shell /bin/sh -c $'export XDG_RUNTIME_DIR=/run/user/$UID ; {cmd}'" + + def succeed_as_alice(cmd): + return machine.succeed(alice_cmd(cmd)) + + def fail_as_alice(cmd): + return machine.fail(alice_cmd(cmd)) + + # Create a persistent login so that Alice has a systemd session. + login_as_alice() # Set up a home-manager channel. - as_alice("mkdir -p /home/alice/.nix-defexpr/channels") - as_alice(f"ln -s {home_manager} /home/alice/.nix-defexpr/channels/home-manager") + succeed_as_alice(" ; ".join([ + "mkdir -p /home/alice/.nix-defexpr/channels", + f"ln -s {home_manager} /home/alice/.nix-defexpr/channels/home-manager" + ])) with subtest("Home Manager installation"): - as_alice("nix-shell \"\" -A install") + succeed_as_alice("nix-shell \"\" -A install") actual = machine.succeed("ls /home/alice/.config/home-manager") - expected = "home.nix\n" - assert actual == expected, \ + assert actual == "home.nix\n", \ f"unexpected content of /home/alice/.config/home-manager: {actual}" machine.succeed("diff -u ${ @@ -53,32 +78,50 @@ f"expected GC root and profile to point to same, but pointed to {gcrootTarget} and {profile1Target}" with subtest("Home Manager switch"): - as_alice("cp ${ + fail_as_alice("hello") + + succeed_as_alice("cp ${ ./alice-home-next.nix } /home/alice/.config/home-manager/home.nix") - as_alice("home-manager switch") - as_alice("hello") + actual = succeed_as_alice("home-manager switch") + expected = "Started pueued.service - active" + assert expected in actual, \ + f"expected home-manager switch to contain {expected}, but got {actual}" - actual = as_alice("echo -n $EDITOR") + succeed_as_alice("hello") + + actual = succeed_as_alice("echo $EDITOR").strip() assert "emacs" == actual, \ f"expected $EDITOR to contain emacs, but found {actual}" + actual = machine.succeed("systemctl --user -M alice@.host status pueued.service") + expected = "running" + assert expected in actual, \ + f"expected systemctl status pueued status to contain {expected}, but got {actual}" + + actual = succeed_as_alice("pueue status") + expected = "running" + assert expected in actual, \ + f"expected pueue status to contain {expected}, but got {actual}" + with subtest("Home Manager generations"): - actual = as_alice("home-manager generations") + actual = succeed_as_alice("home-manager generations") expected = ": id 1 ->" assert expected in actual, \ f"expected generations to contain {expected}, but found {actual}" with subtest("Home Manager uninstallation"): - as_alice("yes | home-manager uninstall -L") + succeed_as_alice("yes | home-manager uninstall -L") - as_alice("! hello") + fail_as_alice("hello") machine.succeed("test ! -e /home/alice/.cache/.keep") - # TODO: Fix uninstall to fully remove the directory. + # TODO: Fix uninstall to fully remove the share directory. machine.succeed("test ! -e /home/alice/.local/share/home-manager/gcroots") machine.succeed("test ! -e /home/alice/.local/state/home-manager") machine.succeed("test ! -e /home/alice/.local/state/nix/profiles/home-manager") + + logout_alice() ''; } From 40c57ce052cc8ef1bf0c836b87263a43b69e1fb6 Mon Sep 17 00:00:00 2001 From: 7FM <41307817+7FM@users.noreply.github.com> Date: Wed, 6 Mar 2024 14:09:53 +0100 Subject: [PATCH 088/636] programs.khal: Simplify calendar setup (#5073) * programs.khal: fix build failure due to null value * calendar: allow null value for primaryCollection * calendar / programs.khal: set default values to avoid common errors --- modules/accounts/calendar.nix | 11 +++++++---- modules/programs/khal-calendar-accounts.nix | 4 ++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/accounts/calendar.nix b/modules/accounts/calendar.nix index e96f2f2dd73f..961cd0b3a676 100644 --- a/modules/accounts/calendar.nix +++ b/modules/accounts/calendar.nix @@ -18,12 +18,13 @@ let type = mkOption { type = types.enum [ "filesystem" "singlefile" ]; + default = "filesystem"; description = "The type of the storage."; }; fileExt = mkOption { type = types.nullOr types.str; - default = null; + default = ".ics"; description = "The file extension to use."; }; @@ -98,7 +99,8 @@ let }; primaryCollection = mkOption { - type = types.str; + type = types.nullOr types.str; + default = null; description = '' The primary collection of the account. Required when an account has multiple collections. @@ -106,8 +108,8 @@ let }; local = mkOption { - type = types.nullOr (localModule name); - default = null; + type = localModule name; + default = { }; description = '' Local configuration for the calendar. ''; @@ -129,6 +131,7 @@ in { options.accounts.calendar = { basePath = mkOption { type = types.str; + example = ".calendar"; apply = p: if hasPrefix "/" p then p else "${config.home.homeDirectory}/${p}"; description = '' diff --git a/modules/programs/khal-calendar-accounts.nix b/modules/programs/khal-calendar-accounts.nix index 0a56ba81603f..3aa2494e8ef0 100644 --- a/modules/programs/khal-calendar-accounts.nix +++ b/modules/programs/khal-calendar-accounts.nix @@ -5,8 +5,8 @@ with lib; { options.khal = { type = mkOption { - type = types.nullOr (types.enum [ "calendar" "discover" ]); - default = null; + type = types.enum [ "calendar" "discover" ]; + default = "calendar"; description = '' Either a single calendar (calendar which is the default) or a directory with multiple calendars (discover). ''; From ae84f4fd2c56c0766c5b12c3efda102b749aed56 Mon Sep 17 00:00:00 2001 From: FedFer98123 Date: Mon, 4 Mar 2024 19:50:48 +0100 Subject: [PATCH 089/636] Translate using Weblate (Italian) Currently translated at 100.0% (36 of 36 strings) Co-authored-by: FedFer98123 Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/it/ Translation: Home Manager/Home Manager CLI --- home-manager/po/it.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/it.po b/home-manager/po/it.po index 4770bb4afcc7..7c281a12eefb 100644 --- a/home-manager/po/it.po +++ b/home-manager/po/it.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-02-29 10:10+0000\n" +"Last-Translator: FedFer98123 \n" "Language-Team: Italian \n" "Language: it\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -187,7 +187,7 @@ msgstr "Opzione \"news.display\" sconosciuta \"%s\"." #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Per favore definisci le variabili d'ambiente $EDITOR o $VISUAL" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From 571ac9199c80e42c8e49b9095d5a93a58a17e770 Mon Sep 17 00:00:00 2001 From: Sera Karayan Date: Mon, 4 Mar 2024 19:50:48 +0100 Subject: [PATCH 090/636] Translate using Weblate (German) Currently translated at 100.0% (36 of 36 strings) Co-authored-by: Sera Karayan Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/de/ Translation: Home Manager/Home Manager CLI --- home-manager/po/de.po | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/home-manager/po/de.po b/home-manager/po/de.po index 8d8641265555..c0a8f179d829 100644 --- a/home-manager/po/de.po +++ b/home-manager/po/de.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-03-02 16:01+0000\n" +"Last-Translator: Sera Karayan \n" "Language-Team: German \n" "Language: de\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -75,18 +75,20 @@ msgstr "" "Um diese Warnung zu entfernen, führen Sie einen der folgenden Schritte aus.\n" "\n" "1. Weisen Sie Home Manager explizit an, den Pfad zu verwenden, indem Sie z. " -"B. Folgendes zu Ihrer Konfiguration hinzufügen:\n" +"B. :\n" "\n" -" { programs.home-manager.path = \"%s\"; }\n" +"……{ programs.home-manager.path = \"%s\"; }\n" "\n" -" Sollten Sie Home Manager direkt importieren, können Sie den Parameter " -"`path` verwenden, wenn Sie das Home Manager-Paket aufrufen:\n" +"…zu Ihrer Konfiguration hinzufügen.\n" "\n" -" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" +"…Sollten Sie Home Manager direkt importieren, können Sie den Parameter `path`" +" verwenden, wenn Sie das Home Manager-Paket aufrufen:\n" +"\n" +"……pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" "\n" "2. Entfernen Sie den veralteten Pfad:\n" "\n" -" $ rm -r \"%s\"" +"……$ rm -r \"%s\"" #: home-manager/home-manager:140 msgid "Sanity checking Nix" @@ -183,7 +185,7 @@ msgstr "Unbekannte \"news.display\" Einstellung \"%s\"." #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Bitte definieren Sie die $EDITOR oder $VISUAL Umgebungsvariable" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From c7e50657fb167023a79d6dd3d15be577ea97baab Mon Sep 17 00:00:00 2001 From: immwind Date: Mon, 4 Mar 2024 19:50:48 +0100 Subject: [PATCH 091/636] Translate using Weblate (Chinese (Simplified)) Currently translated at 100.0% (36 of 36 strings) Co-authored-by: immwind Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/zh_Hans/ Translation: Home Manager/Home Manager CLI --- home-manager/po/zh_Hans.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/zh_Hans.po b/home-manager/po/zh_Hans.po index 29f2bf009212..c275c4aeece2 100644 --- a/home-manager/po/zh_Hans.po +++ b/home-manager/po/zh_Hans.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-03-03 06:24+0000\n" +"Last-Translator: immwind \n" "Language-Team: Chinese (Simplified) \n" "Language: zh_Hans\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -176,7 +176,7 @@ msgstr "未知的 “news.display” 设置项 “%s”。" #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "请设置 $EDITOR 或 $VISUAL 环境变量" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From 572b070627c62eee20b9f0254128890a69894fc2 Mon Sep 17 00:00:00 2001 From: Nam Nguyen Date: Mon, 4 Mar 2024 19:50:49 +0100 Subject: [PATCH 092/636] Add translation using Weblate (Vietnamese) Co-authored-by: Nam Nguyen --- home-manager/po/vi.po | 211 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 home-manager/po/vi.po diff --git a/home-manager/po/vi.po b/home-manager/po/vi.po new file mode 100644 index 000000000000..44353875574b --- /dev/null +++ b/home-manager/po/vi.po @@ -0,0 +1,211 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Home Manager contributors +# This file is distributed under the same license as the Home Manager package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Home Manager\n" +"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: vi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: home-manager/home-manager:58 +msgid "No configuration file found at %s" +msgstr "" + +#. translators: The first '%s' specifier will be replaced by either +#. 'home.nix' or 'flake.nix'. +#: home-manager/home-manager:75 home-manager/home-manager:79 +#: home-manager/home-manager:178 +msgid "" +"Keeping your Home Manager %s in %s is deprecated,\n" +"please move it to %s" +msgstr "" + +#: home-manager/home-manager:86 +msgid "No configuration file found. Please create one at %s" +msgstr "" + +#: home-manager/home-manager:101 +msgid "Home Manager not found at %s." +msgstr "" + +#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. +#: home-manager/home-manager:109 +msgid "" +"The fallback Home Manager path %s has been deprecated and a file/directory " +"was found there." +msgstr "" + +#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. +#: home-manager/home-manager:112 +msgid "" +"To remove this warning, do one of the following.\n" +"\n" +"1. Explicitly tell Home Manager to use the path, for example by adding\n" +"\n" +" { programs.home-manager.path = \"%s\"; }\n" +"\n" +" to your configuration.\n" +"\n" +" If you import Home Manager directly, you can use the `path` parameter\n" +"\n" +" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" +"\n" +" when calling the Home Manager package.\n" +"\n" +"2. Remove the deprecated path.\n" +"\n" +" $ rm -r \"%s\"" +msgstr "" + +#: home-manager/home-manager:140 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:160 +msgid "Could not find suitable profile directory, tried %s and %s" +msgstr "" + +#. translators: Here "flake" is a noun that refers to the Nix Flakes feature. +#: home-manager/home-manager:215 +msgid "Can't inspect options of a flake configuration" +msgstr "" + +#: home-manager/home-manager:288 home-manager/home-manager:311 +#: home-manager/home-manager:1030 +msgid "%s: unknown option '%s'" +msgstr "" + +#: home-manager/home-manager:293 home-manager/home-manager:1031 +msgid "Run '%s --help' for usage help" +msgstr "" + +#: home-manager/home-manager:319 home-manager/home-manager:423 +msgid "The file %s already exists, leaving it unchanged..." +msgstr "" + +#: home-manager/home-manager:321 home-manager/home-manager:425 +msgid "Creating %s..." +msgstr "" + +#: home-manager/home-manager:467 +msgid "Creating initial Home Manager generation..." +msgstr "" + +#. translators: The "%s" specifier will be replaced by a file path. +#: home-manager/home-manager:472 +msgid "" +"All done! The home-manager tool should now be installed and you can edit\n" +"\n" +" %s\n" +"\n" +"to configure Home Manager. Run 'man home-configuration.nix' to\n" +"see all available options." +msgstr "" + +#. translators: The "%s" specifier will be replaced by a URL. +#: home-manager/home-manager:477 +msgid "" +"Uh oh, the installation failed! Please create an issue at\n" +"\n" +" %s\n" +"\n" +"if the error seems to be the fault of Home Manager." +msgstr "" + +#. translators: Here "flake" is a noun that refers to the Nix Flakes feature. +#: home-manager/home-manager:488 +msgid "Can't instantiate a flake configuration" +msgstr "" + +#: home-manager/home-manager:564 +msgid "" +"There is %d unread and relevant news item.\n" +"Read it by running the command \"%s news\"." +msgid_plural "" +"There are %d unread and relevant news items.\n" +"Read them by running the command \"%s news\"." +msgstr[0] "" +msgstr[1] "" + +#: home-manager/home-manager:578 +msgid "Unknown \"news.display\" setting \"%s\"." +msgstr "" + +#: home-manager/home-manager:586 +#, sh-format +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" + +#: home-manager/home-manager:604 +msgid "Cannot run build in read-only directory" +msgstr "" + +#: home-manager/home-manager:685 +msgid "No generation with ID %s" +msgstr "" + +#: home-manager/home-manager:687 +msgid "Cannot remove the current generation %s" +msgstr "" + +#: home-manager/home-manager:689 +msgid "Removing generation %s" +msgstr "" + +#: home-manager/home-manager:710 +msgid "No generations to expire" +msgstr "" + +#: home-manager/home-manager:721 +msgid "No home-manager packages seem to be installed." +msgstr "" + +#: home-manager/home-manager:803 +msgid "Unknown argument %s" +msgstr "" + +#: home-manager/home-manager:827 +msgid "This will remove Home Manager from your system." +msgstr "" + +#: home-manager/home-manager:830 +msgid "This is a dry run, nothing will actually be uninstalled." +msgstr "" + +#: home-manager/home-manager:834 +msgid "Really uninstall Home Manager?" +msgstr "" + +#: home-manager/home-manager:840 +msgid "Switching to empty Home Manager configuration..." +msgstr "" + +#: home-manager/home-manager:855 +msgid "Yay!" +msgstr "" + +#: home-manager/home-manager:860 +msgid "Home Manager is uninstalled but your home.nix is left untouched." +msgstr "" + +#: home-manager/home-manager:1070 +msgid "expire-generations expects one argument, got %d." +msgstr "" + +#: home-manager/home-manager:1092 +msgid "Unknown command: %s" +msgstr "" + +#: home-manager/install.nix:18 +msgid "This derivation is not buildable, please run it using nix-shell." +msgstr "" From f30d23faccdeb8237168525be65f55e44811e4c1 Mon Sep 17 00:00:00 2001 From: Alexis Rossfelder Date: Mon, 4 Mar 2024 19:50:49 +0100 Subject: [PATCH 093/636] Translate using Weblate (French) Currently translated at 100.0% (36 of 36 strings) Co-authored-by: Alexis Rossfelder Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fr/ Translation: Home Manager/Home Manager CLI --- home-manager/po/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/fr.po b/home-manager/po/fr.po index 2b9d7a87aa5d..b7a87485e60c 100644 --- a/home-manager/po/fr.po +++ b/home-manager/po/fr.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-03-04 06:44+0000\n" +"Last-Translator: Alexis Rossfelder \n" "Language-Team: French \n" "Language: fr\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -184,7 +184,7 @@ msgstr "Configuration \"news.display\" inconnue \"%s\"." #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Veuillez remplir la variable d'environnement $EDITOR ou VISUAL" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From d19bf3ae21686854760cfc5e81f269ea51072563 Mon Sep 17 00:00:00 2001 From: Languages add-on Date: Mon, 4 Mar 2024 19:50:49 +0100 Subject: [PATCH 094/636] Add translation using Weblate (Vietnamese) Co-authored-by: Languages add-on --- modules/po/vi.po | 113 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 modules/po/vi.po diff --git a/modules/po/vi.po b/modules/po/vi.po new file mode 100644 index 000000000000..816bec772fd5 --- /dev/null +++ b/modules/po/vi.po @@ -0,0 +1,113 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Home Manager contributors +# This file is distributed under the same license as the Home Manager Modules package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Home Manager Modules\n" +"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" +"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: vi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: modules/files.nix:236 +msgid "Creating home file links in %s" +msgstr "" + +#: modules/files.nix:249 +msgid "Cleaning up orphan links from %s" +msgstr "" + +#: modules/files.nix:265 +msgid "Creating profile generation %s" +msgstr "" + +#: modules/files.nix:282 +msgid "No change so reusing latest profile generation %s" +msgstr "" + +#: modules/home-environment.nix:622 +msgid "" +"Oops, Nix failed to install your new Home Manager profile!\n" +"\n" +"Perhaps there is a conflict with a package that was installed using\n" +"\"%s\"? Try running\n" +"\n" +" %s\n" +"\n" +"and if there is a conflicting package you can remove it with\n" +"\n" +" %s\n" +"\n" +"Then try activating your Home Manager configuration again." +msgstr "" + +#: modules/home-environment.nix:655 +msgid "Activating %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:22 +msgid "Migrating profile from %s to %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:54 +msgid "Could not find suitable profile directory, tried %s and %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:83 +msgid "Sanity checking oldGenNum and oldGenPath" +msgstr "" + +#: modules/lib-bash/activation-init.sh:86 +msgid "" +"The previous generation number and path are in conflict! These\n" +"must be either both empty or both set but are now set to\n" +"\n" +" '%s' and '%s'\n" +"\n" +"If you don't mind losing previous profile generations then\n" +"the easiest solution is probably to run\n" +"\n" +" rm %s/home-manager*\n" +" rm %s/current-home\n" +"\n" +"and trying home-manager switch again. Good luck!" +msgstr "" + +#: modules/lib-bash/activation-init.sh:127 +msgid "Error: USER is set to \"%s\" but we expect \"%s\"" +msgstr "" + +#: modules/lib-bash/activation-init.sh:136 +msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" +msgstr "" + +#: modules/lib-bash/activation-init.sh:153 +msgid "Starting Home Manager activation" +msgstr "" + +#: modules/lib-bash/activation-init.sh:157 +msgid "Sanity checking Nix" +msgstr "" + +#: modules/lib-bash/activation-init.sh:170 +msgid "This is a dry run" +msgstr "" + +#: modules/lib-bash/activation-init.sh:174 +msgid "This is a live run" +msgstr "" + +#: modules/lib-bash/activation-init.sh:180 +msgid "Using Nix version: %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:183 +msgid "Activation variables:" +msgstr "" From 692726d2ad5727cf14c563d0f1d2c015c021d7a5 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 4 Mar 2024 19:50:49 +0100 Subject: [PATCH 095/636] Translate using Weblate (German) Currently translated at 100.0% (36 of 36 strings) Co-authored-by: Robert Helgesson Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/de/ Translation: Home Manager/Home Manager CLI --- home-manager/po/de.po | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/home-manager/po/de.po b/home-manager/po/de.po index c0a8f179d829..6fdb20708d6f 100644 --- a/home-manager/po/de.po +++ b/home-manager/po/de.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-03-02 16:01+0000\n" -"Last-Translator: Sera Karayan \n" +"PO-Revision-Date: 2024-03-04 18:50+0000\n" +"Last-Translator: Robert Helgesson \n" "Language-Team: German \n" "Language: de\n" @@ -77,18 +77,18 @@ msgstr "" "1. Weisen Sie Home Manager explizit an, den Pfad zu verwenden, indem Sie z. " "B. :\n" "\n" -"……{ programs.home-manager.path = \"%s\"; }\n" +" { programs.home-manager.path = \"%s\"; }\n" "\n" -"…zu Ihrer Konfiguration hinzufügen.\n" +" zu Ihrer Konfiguration hinzufügen.\n" "\n" -"…Sollten Sie Home Manager direkt importieren, können Sie den Parameter `path`" -" verwenden, wenn Sie das Home Manager-Paket aufrufen:\n" +" Sollten Sie Home Manager direkt importieren, können Sie den Parameter " +"`path` verwenden, wenn Sie das Home Manager-Paket aufrufen:\n" "\n" -"……pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" +" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" "\n" "2. Entfernen Sie den veralteten Pfad:\n" "\n" -"……$ rm -r \"%s\"" +" $ rm -r \"%s\"" #: home-manager/home-manager:140 msgid "Sanity checking Nix" From 8d9fde0fba21425729905f795fe72c2840a20442 Mon Sep 17 00:00:00 2001 From: Sebastian Sellmeier Date: Tue, 5 Mar 2024 17:23:57 +0100 Subject: [PATCH 096/636] i3/sway: remove sebtm maintainer --- modules/services/window-managers/i3-sway/i3.nix | 2 +- modules/services/window-managers/i3-sway/sway.nix | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/services/window-managers/i3-sway/i3.nix b/modules/services/window-managers/i3-sway/i3.nix index 183463d3135c..8c64aee4483e 100644 --- a/modules/services/window-managers/i3-sway/i3.nix +++ b/modules/services/window-managers/i3-sway/i3.nix @@ -202,7 +202,7 @@ let ''; in { - meta.maintainers = with maintainers; [ sumnerevans sebtm ]; + meta.maintainers = with maintainers; [ sumnerevans ]; options = { xsession.windowManager.i3 = { diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index cc81130269be..88048daf4804 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -326,7 +326,6 @@ in { Scrumplex alexarice sumnerevans - sebtm oxalica ]; From f240015a3a2e03370cb86a820909af14ec1ed35a Mon Sep 17 00:00:00 2001 From: musjj <72612857+musjj@users.noreply.github.com> Date: Thu, 7 Mar 2024 00:43:55 +0700 Subject: [PATCH 097/636] gallery-dl: add package option --- modules/programs/gallery-dl.nix | 4 +++- tests/modules/programs/gallery-dl/gallery-dl.nix | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/programs/gallery-dl.nix b/modules/programs/gallery-dl.nix index accad55fb881..4f566e18bdc2 100644 --- a/modules/programs/gallery-dl.nix +++ b/modules/programs/gallery-dl.nix @@ -14,6 +14,8 @@ in { options.programs.gallery-dl = { enable = mkEnableOption "gallery-dl"; + package = mkPackageOption pkgs "gallery-dl" { }; + settings = mkOption { type = jsonFormat.type; default = { }; @@ -32,7 +34,7 @@ in { }; config = mkIf cfg.enable { - home.packages = [ pkgs.gallery-dl ]; + home.packages = [ cfg.package ]; xdg.configFile."gallery-dl/config.json" = mkIf (cfg.settings != { }) { source = jsonFormat.generate "gallery-dl-settings" cfg.settings; diff --git a/tests/modules/programs/gallery-dl/gallery-dl.nix b/tests/modules/programs/gallery-dl/gallery-dl.nix index 43d0daa9f736..2cc94e1e0836 100644 --- a/tests/modules/programs/gallery-dl/gallery-dl.nix +++ b/tests/modules/programs/gallery-dl/gallery-dl.nix @@ -1,9 +1,11 @@ -{ ... }: +{ config, ... }: { programs.gallery-dl = { enable = true; + package = config.lib.test.mkStubPackage { }; + settings = { cache.file = "~/gallery-dl/cache.sqlite3"; extractor.base-directory = "~/gallery-dl/"; From ad9254cd9af9165000ecd6ef9c23c2b8ceda01c7 Mon Sep 17 00:00:00 2001 From: Isaac Grannis <115715725+BagMan9@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:19:45 -0500 Subject: [PATCH 098/636] vdirsyncer: fix verify option type (#5096) * vdirsyncer: change verify to type path accounts..accounts..vdirsyncer.verify should not be a bool, it should be a path. * vdirsyncer: Add example of verify use --- modules/programs/vdirsyncer-accounts.nix | 5 +++-- modules/programs/vdirsyncer.nix | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/programs/vdirsyncer-accounts.nix b/modules/programs/vdirsyncer-accounts.nix index fac4d01da91d..4edd17429db8 100644 --- a/modules/programs/vdirsyncer-accounts.nix +++ b/modules/programs/vdirsyncer-accounts.nix @@ -93,9 +93,10 @@ in { }; verify = mkOption { - type = types.nullOr types.bool; + type = types.nullOr types.path; default = null; - description = "Verify SSL certificate."; + description = "Null or path to certificate to verify SSL against"; + example = "/path/to/cert.pem"; }; verifyFingerprint = mkOption { diff --git a/modules/programs/vdirsyncer.nix b/modules/programs/vdirsyncer.nix index 545df71b5238..32c0033948c9 100644 --- a/modules/programs/vdirsyncer.nix +++ b/modules/programs/vdirsyncer.nix @@ -92,7 +92,7 @@ let else if (n == "passwordPrompt") then ''password.fetch = ["prompt", "${v}"]'' else if (n == "verify") then - "verify = ${if v then "true" else "false"}" + ''verify = "${v}"'' else if (n == "verifyFingerprint") then ''verify_fingerprint = "${v}"'' else if (n == "auth") then From cf111d1a849ddfc38e9155be029519b0e2329615 Mon Sep 17 00:00:00 2001 From: bri <284789+b-@users.noreply.github.com> Date: Thu, 22 Feb 2024 11:55:26 -0500 Subject: [PATCH 099/636] zsh: improve `shell{,Global}Aliases` This commit changes the way aliases are rendered, adding the "no more flags" flag `--`, which means that, for example, the alias `"-" = "cd -";` will work as expected. (I was getting a syntax error before this change.) Additionally, now the alias key is shell escaped, which may help some edge cases. I'm honestly not sure if this part is necessary since I assume an alias can't contain spaces anyway, but it definitely shouldn't break anything. --- modules/programs/zsh.nix | 6 +++--- tests/modules/programs/pls/zsh.nix | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 392d26320267..dcff129d3552 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -15,7 +15,7 @@ let localVarsStr = config.lib.zsh.defineAll cfg.localVariables; aliasesStr = concatStringsSep "\n" ( - mapAttrsToList (k: v: "alias ${k}=${lib.escapeShellArg v}") cfg.shellAliases + mapAttrsToList (k: v: "alias -- ${lib.escapeShellArg k}=${lib.escapeShellArg v}") cfg.shellAliases ); dirHashesStr = concatStringsSep "\n" ( @@ -637,8 +637,8 @@ in # Aliases ${aliasesStr} '' - ] - ++ (mapAttrsToList (k: v: "alias -g ${k}=${lib.escapeShellArg v}") cfg.shellGlobalAliases) + ] + ++ (mapAttrsToList (k: v: "alias -g -- ${lib.escapeShellArg k}=${lib.escapeShellArg v}") cfg.shellGlobalAliases) ++ [ ('' # Named Directory Hashes ${dirHashesStr} diff --git a/tests/modules/programs/pls/zsh.nix b/tests/modules/programs/pls/zsh.nix index f3bcbf2a8fa5..3a27c4d3e577 100644 --- a/tests/modules/programs/pls/zsh.nix +++ b/tests/modules/programs/pls/zsh.nix @@ -23,10 +23,10 @@ with lib; assertFileExists home-files/.zshrc assertFileContains \ home-files/.zshrc \ - "alias ls='@pls@/bin/pls'" + "alias -- 'ls'='@pls@/bin/pls'" assertFileContains \ home-files/.zshrc \ - "alias ll='@pls@/bin/pls -d perms -d user -d group -d size -d mtime -d git'" + "alias -- 'll'='@pls@/bin/pls -d perms -d user -d group -d size -d mtime -d git'" ''; }; } From 1283bf6ebbdee4d980b7551bed4c6596805e812c Mon Sep 17 00:00:00 2001 From: novenary Date: Thu, 7 Mar 2024 12:16:58 +0200 Subject: [PATCH 100/636] xdg-user-dirs: check for existing symlink MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a non-directory, such as a file or a dead symlink, already exists, mkdir -p fails with "cannot create directory ‘...’: File exists". This is a problem when, for example, a symlink points to a directory on a filesystem that isn't mounted yet. --- modules/misc/xdg-user-dirs.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/misc/xdg-user-dirs.nix b/modules/misc/xdg-user-dirs.nix index c9912812feb2..1198ea039c1c 100644 --- a/modules/misc/xdg-user-dirs.nix +++ b/modules/misc/xdg-user-dirs.nix @@ -137,7 +137,8 @@ in { home.activation.createXdgUserDirectories = mkIf cfg.createDirectories (let directoriesList = attrValues directories; - mkdir = (dir: ''run mkdir -p $VERBOSE_ARG "${dir}"''); + mkdir = + (dir: ''[[ -L "${dir}" ]] || run mkdir -p $VERBOSE_ARG "${dir}"''); in lib.hm.dag.entryAfter [ "linkGeneration" ] (strings.concatMapStringsSep "\n" mkdir directoriesList)); }; From 0c65bfa3cf7e8621a6cd3da500f591e2e92a6259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Abdelkader=20Mart=C3=ADnez=20P=C3=A9rez?= Date: Thu, 23 Nov 2023 19:42:13 +0100 Subject: [PATCH 101/636] git-sync: allow passing extraPackages to service Sometimes extra packages are needed to successfully update a repository, for example, git-sync. --- modules/services/git-sync.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/services/git-sync.nix b/modules/services/git-sync.nix index a274da8f4886..2d90d6331b84 100644 --- a/modules/services/git-sync.nix +++ b/modules/services/git-sync.nix @@ -13,7 +13,9 @@ let Service = { Environment = [ - "PATH=${lib.makeBinPath (with pkgs; [ openssh git ])}" + "PATH=${ + lib.makeBinPath (with pkgs; [ openssh git ] ++ repo.extraPackages) + }" "GIT_SYNC_DIRECTORY=${repo.path}" "GIT_SYNC_COMMAND=${cfg.package}/bin/git-sync" "GIT_SYNC_REPOSITORY=${repo.uri}" @@ -76,6 +78,15 @@ let be triggered even without filesystem changes. ''; }; + + extraPackages = mkOption { + type = with types; listOf package; + default = [ ]; + example = literalExpression "with pkgs; [ git-crypt ]"; + description = '' + Extra packages available to git-sync. + ''; + }; }; }); From 417015af0dc2525557ab36528643c2d519ca4334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Fri, 8 Mar 2024 13:58:55 +0100 Subject: [PATCH 102/636] himalaya: adjust code for v1.0.0-beta.3 --- modules/programs/himalaya.nix | 2 +- .../modules/programs/himalaya/basic-expected.toml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/programs/himalaya.nix b/modules/programs/himalaya.nix index a05782b0d723..2d216c3dced8 100644 --- a/modules/programs/himalaya.nix +++ b/modules/programs/himalaya.nix @@ -169,7 +169,7 @@ in { config.accounts.email.accounts; accountsConfig = lib.mapAttrs mkAccountConfig enabledAccounts; globalConfig = compactAttrs himalaya.settings; - allConfig = globalConfig // accountsConfig; + allConfig = globalConfig // { accounts = accountsConfig; }; in tomlFormat.generate "himalaya-config.toml" allConfig; systemd.user.services = let inherit (config.services.himalaya-watch) enable environment settings; diff --git a/tests/modules/programs/himalaya/basic-expected.toml b/tests/modules/programs/himalaya/basic-expected.toml index 55906e15c6c0..16c70c8683e6 100644 --- a/tests/modules/programs/himalaya/basic-expected.toml +++ b/tests/modules/programs/himalaya/basic-expected.toml @@ -1,32 +1,32 @@ -["hm@example.com"] +[accounts."hm@example.com"] backend = "imap" default = true display-name = "H. M. Test" email = "hm@example.com" -["hm@example.com".folder.alias] +[accounts."hm@example.com".folder.alias] drafts = "Drafts" inbox = "Inbox" sent = "Sent" trash = "Trash" -["hm@example.com".imap] +[accounts."hm@example.com".imap] encryption = "tls" host = "imap.example.com" login = "home.manager" port = 993 -["hm@example.com".imap.passwd] +[accounts."hm@example.com".imap.passwd] cmd = "password-command" -["hm@example.com".message.send] +[accounts."hm@example.com".message.send] backend = "smtp" -["hm@example.com".smtp] +[accounts."hm@example.com".smtp] encryption = "tls" host = "smtp.example.com" login = "home.manager" port = 465 -["hm@example.com".smtp.passwd] +[accounts."hm@example.com".smtp.passwd] cmd = "password-command" From 9a3a5b4402e49ac62badff01b095f222724500a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20S=C3=A1nchez?= Date: Fri, 8 Mar 2024 13:18:28 +0000 Subject: [PATCH 103/636] rio: use XDG config for both linux and darwin `rio` now uses the same config location for both Linux and macOS: > MacOS and Linux configuration file path is `~/.config/rio/config.toml`. Ref: https://raphamorim.io/rio/docs/configuration-file --- modules/programs/rio.nix | 15 ++------------- tests/modules/programs/rio/example-settings.nix | 11 ++--------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/modules/programs/rio.nix b/modules/programs/rio.nix index 6d66c99d6d37..67b7752ce80d 100644 --- a/modules/programs/rio.nix +++ b/modules/programs/rio.nix @@ -3,8 +3,6 @@ let cfg = config.programs.rio; settingsFormat = pkgs.formats.toml { }; - - inherit (pkgs.stdenv.hostPlatform) isDarwin; in { options.programs.rio = { enable = lib.mkEnableOption null // { @@ -20,8 +18,7 @@ in { type = settingsFormat.type; default = { }; description = '' - Configuration written to $XDG_CONFIG_HOME/rio/config.toml on Linux or - $HOME/Library/Application Support/rio/config.toml on Darwin. See + Configuration written to $XDG_CONFIG_HOME/rio/config.toml. See for options. ''; }; @@ -34,19 +31,11 @@ in { } # Only manage configuration if not empty - (lib.mkIf (cfg.settings != { } && !isDarwin) { + (lib.mkIf (cfg.settings != { }) { xdg.configFile."rio/config.toml".source = if lib.isPath cfg.settings then cfg.settings else settingsFormat.generate "rio.toml" cfg.settings; }) - - (lib.mkIf (cfg.settings != { } && isDarwin) { - home.file."Library/Application Support/rio/config.toml".source = - if lib.isPath cfg.settings then - cfg.settings - else - settingsFormat.generate "rio.toml" cfg.settings; - }) ]); } diff --git a/tests/modules/programs/rio/example-settings.nix b/tests/modules/programs/rio/example-settings.nix index f3e116f03893..68fec357793f 100644 --- a/tests/modules/programs/rio/example-settings.nix +++ b/tests/modules/programs/rio/example-settings.nix @@ -1,13 +1,6 @@ { config, pkgs, ... }: let - inherit (pkgs.stdenv.hostPlatform) isDarwin; - - path = if isDarwin then - "Library/Application Support/rio/config.toml" - else - ".config/rio/config.toml"; - expected = pkgs.writeText "rio-expected.toml" '' cursor = "_" padding-x = 0 @@ -26,7 +19,7 @@ in { }; nmt.script = '' - assertFileExists home-files/"${path}" - assertFileContent home-files/"${path}" '${expected}' + assertFileExists home-files/.config/rio/config.toml + assertFileContent home-files/.config/rio/config.toml '${expected}' ''; } From 8b07ca541939211d3cc437ddfd74ebdef3d72471 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 8 Mar 2024 14:20:18 +0100 Subject: [PATCH 104/636] rio: fix docbookisms --- modules/programs/rio.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/rio.nix b/modules/programs/rio.nix index 67b7752ce80d..58c4720de1b4 100644 --- a/modules/programs/rio.nix +++ b/modules/programs/rio.nix @@ -18,8 +18,8 @@ in { type = settingsFormat.type; default = { }; description = '' - Configuration written to $XDG_CONFIG_HOME/rio/config.toml. See - for options. + Configuration written to {file}`$XDG_CONFIG_HOME/rio/config.toml`. See + for options. ''; }; }; From b550d074fbcd31ac90012596c4d3f5b775dcaddd Mon Sep 17 00:00:00 2001 From: Silmar Date: Mon, 11 Sep 2023 15:50:12 -0300 Subject: [PATCH 105/636] zk: add module --- modules/lib/maintainers.nix | 6 +++ modules/misc/news.nix | 7 ++++ modules/modules.nix | 1 + modules/programs/zk.nix | 52 +++++++++++++++++++++++++ tests/default.nix | 1 + tests/modules/programs/zk/default.nix | 1 + tests/modules/programs/zk/expected.toml | 15 +++++++ tests/modules/programs/zk/zk.nix | 30 ++++++++++++++ 8 files changed, 113 insertions(+) create mode 100644 modules/programs/zk.nix create mode 100644 tests/modules/programs/zk/default.nix create mode 100644 tests/modules/programs/zk/expected.toml create mode 100644 tests/modules/programs/zk/zk.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index f3cb327669d1..f55fa0bf0d14 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -205,6 +205,12 @@ fingerprint = "F0E0 0311 126A CD72 4392 25E6 68BF 2EAE 6D91 CAFF"; }]; }; + silmarp = { + name = "Silmar Pereira da Silva Junior"; + email = "silmarjr2@gmail.com"; + github = "silmarp"; + githubID = 67292496; + }; fendse = { email = "46252070+Fendse@users.noreply.github.com"; github = "Fendse"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 4f955e3921e4..8d681658e18f 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1422,6 +1422,13 @@ in { A new module is available: 'wayland.windowManager.river'. ''; } + + { + time = "2024-03-08T22:20:04+00:00"; + message = '' + A new module is available: 'programs.zk' + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 08a539deabcb..16206cc17d17 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -247,6 +247,7 @@ let ./programs/z-lua.nix ./programs/zathura.nix ./programs/zellij.nix + ./programs/zk.nix ./programs/zoxide.nix ./programs/zplug.nix ./programs/zsh.nix diff --git a/modules/programs/zk.nix b/modules/programs/zk.nix new file mode 100644 index 000000000000..d4abfe2797fd --- /dev/null +++ b/modules/programs/zk.nix @@ -0,0 +1,52 @@ +{ config, lib, pkgs, ... }: + +let + + cfg = config.programs.zk; + tomlFormat = pkgs.formats.toml { }; + +in { + meta.maintainers = [ lib.hm.maintainers.silmarp ]; + + options.programs.zk = { + enable = lib.mkEnableOption "zk"; + + package = lib.mkPackageOption pkgs "zk" { }; + + settings = lib.mkOption { + type = tomlFormat.type; + default = { }; + example = lib.literalExpression '' + { + note = { + language = "en"; + default-title = "Untitled"; + filename = "{{id}}-{{slug title}}"; + extension = "md"; + template = "default.md"; + id-charset = "alphanum"; + id-length = 4; + id-case = "lower"; + }; + extra = { + author = "Mickaël"; + }; + } + ''; + description = '' + Configuration written to {file}`$XDG_CONFIG_HOME/zk/config.toml`. + + See for + available options and documentation. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + home.packages = [ cfg.package ]; + + xdg.configFile."zk/config.toml" = lib.mkIf (cfg.settings != { }) { + source = tomlFormat.generate "config.toml" cfg.settings; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 97fa3fbb9c32..1e14df0c465b 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -153,6 +153,7 @@ in import nmtSrc { ./modules/programs/wezterm ./modules/programs/yazi ./modules/programs/zellij + ./modules/programs/zk ./modules/programs/zplug ./modules/programs/zsh ./modules/services/syncthing/common diff --git a/tests/modules/programs/zk/default.nix b/tests/modules/programs/zk/default.nix new file mode 100644 index 000000000000..5c3288d96bf7 --- /dev/null +++ b/tests/modules/programs/zk/default.nix @@ -0,0 +1 @@ +{ zk = ./zk.nix; } diff --git a/tests/modules/programs/zk/expected.toml b/tests/modules/programs/zk/expected.toml new file mode 100644 index 000000000000..688349e8e433 --- /dev/null +++ b/tests/modules/programs/zk/expected.toml @@ -0,0 +1,15 @@ +[extra] +author = "Mickaël" + +[note] +default-title = "Untitled" +extension = "md" +filename = "{{id}}-{{slug title}}" +id-case = "lower" +id-charset = "alphanum" +id-length = 4 +language = "en" +template = "default.md" + +[notebook] +dir = "~/notebook" diff --git a/tests/modules/programs/zk/zk.nix b/tests/modules/programs/zk/zk.nix new file mode 100644 index 000000000000..8907d1677a8c --- /dev/null +++ b/tests/modules/programs/zk/zk.nix @@ -0,0 +1,30 @@ +{ ... }: + +{ + programs.zk = { + enable = true; + settings = { + extra = { author = "Mickaël"; }; + + note = { + default-title = "Untitled"; + extension = "md"; + filename = "{{id}}-{{slug title}}"; + id-case = "lower"; + id-charset = "alphanum"; + id-length = 4; + template = "default.md"; + language = "en"; + }; + + notebook = { dir = "~/notebook"; }; + }; + }; + + test.stubs.zk = { }; + + nmt.script = '' + assertFileExists home-files/.config/zk/config.toml + assertFileContent home-files/.config/zk/config.toml ${./expected.toml} + ''; +} From bfc438e9b707502dce0474738eff562a38046dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Pobo=C5=99il?= Date: Sat, 26 Aug 2023 15:36:08 +0200 Subject: [PATCH 106/636] ranger: add module --- modules/lib/maintainers.nix | 6 + modules/misc/news.nix | 7 + modules/modules.nix | 1 + modules/programs/ranger.nix | 182 ++++++++++++++++++ tests/default.nix | 1 + .../programs/ranger/configuration-rc.conf | 13 ++ .../programs/ranger/configuration-rifle.conf | 2 + .../modules/programs/ranger/configuration.nix | 43 +++++ tests/modules/programs/ranger/default.nix | 1 + 9 files changed, 256 insertions(+) create mode 100644 modules/programs/ranger.nix create mode 100644 tests/modules/programs/ranger/configuration-rc.conf create mode 100644 tests/modules/programs/ranger/configuration-rifle.conf create mode 100644 tests/modules/programs/ranger/configuration.nix create mode 100644 tests/modules/programs/ranger/default.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index f55fa0bf0d14..52f956d14700 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -113,6 +113,12 @@ github = "foo-dogsquared"; githubId = 34962634; }; + fpob = { + name = "Filip Pobořil"; + email = "fpob@proton.me"; + github = "fpob"; + githubId = 6289078; + }; olmokramer = { name = "Olmo Kramer"; email = "olmokramer@users.noreply.github.com"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 8d681658e18f..5a40f60c2e3b 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1429,6 +1429,13 @@ in { A new module is available: 'programs.zk' ''; } + + { + time = "2024-03-08T22:23:24+00:00"; + message = '' + A new module is available: 'programs.ranger'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 16206cc17d17..ec2af169f718 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -189,6 +189,7 @@ let ./programs/pylint.nix ./programs/qcal.nix ./programs/qutebrowser.nix + ./programs/ranger.nix ./programs/rbw.nix ./programs/readline.nix ./programs/rio.nix diff --git a/modules/programs/ranger.nix b/modules/programs/ranger.nix new file mode 100644 index 000000000000..63d33fad319d --- /dev/null +++ b/modules/programs/ranger.nix @@ -0,0 +1,182 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let cfg = config.programs.ranger; + +in { + options.programs.ranger = { + enable = mkEnableOption "ranger file manager"; + + package = mkOption { + type = types.package; + default = pkgs.ranger; + defaultText = literalExpression "pkgs.ranger"; + description = "The ranger package to use."; + }; + + extraPackages = mkOption { + type = types.listOf types.package; + default = [ ]; + description = "Extra packages added to ranger."; + }; + + finalPackage = mkOption { + type = types.package; + readOnly = true; + visible = false; + description = "Resulting ranger package."; + }; + + settings = mkOption { + type = types.attrsOf + (types.oneOf [ types.bool types.float types.int types.str ]); + default = { }; + description = '' + Settings written to {file}`$XDG_CONFIG_HOME/ranger/rc.conf`. + ''; + example = { + column_ratios = "1,3,3"; + confirm_on_delete = "never"; + unicode_ellipsis = true; + scroll_offset = 8; + }; + }; + + aliases = mkOption { + type = types.attrsOf types.str; + default = { }; + description = '' + Aliases written to {file}`$XDG_CONFIG_HOME/ranger/rc.conf`. + ''; + example = { + e = "edit"; + setl = "setlocal"; + filter = "scout -prts"; + }; + }; + + mappings = mkOption { + type = types.attrsOf types.str; + default = { }; + description = '' + Mappings written to {file}`$XDG_CONFIG_HOME/ranger/rc.conf`. + ''; + example = { + Q = "quitall"; + q = "quit"; + }; + }; + + extraConfig = mkOption { + type = types.lines; + default = ""; + description = '' + Extra configuration lines to add to + {file}`$XDG_CONFIG_HOME/ranger/rc.conf`. + ''; + }; + + plugins = mkOption { + type = types.listOf (types.submodule { + options = { + name = mkOption { + type = types.str; + description = '' + Name of the plugin linked to + {file}`$XDG_CONFIG_HOME/ranger/plugins/`. In the case of a + single-file plugin, it must also have `.py` suffix. + ''; + }; + src = mkOption { + type = types.path; + description = '' + The plugin file or directory. + ''; + }; + }; + }); + default = [ ]; + description = '' + List of files to be added to {file}`$XDG_CONFIG_HOME/ranger/plugins/`. + ''; + example = literalExpression '' + [ + { + name = "zoxide"; + src = builtins.fetchGit { + url = "https://github.com/jchook/ranger-zoxide.git"; + rev = "363df97af34c96ea873c5b13b035413f56b12ead"; + }; + } + ] + ''; + }; + + rifle = mkOption { + type = types.listOf (types.submodule { + options = { + condition = mkOption { + type = types.str; + description = '' + A condition to match a file. + ''; + example = "mime ^text, label editor"; + }; + command = mkOption { + type = types.str; + description = '' + A command to run for the matching file. + ''; + example = literalExpression ''"${pkgs.vim}/bin/vim -- \"$@\""''; + }; + }; + }); + default = [ ]; + description = '' + Settings written to {file}`$XDG_CONFIG_HOME/ranger/rifle.conf`. + ''; + }; + }; + + config = mkIf cfg.enable (mkMerge [ + { + programs.ranger.finalPackage = cfg.package.overrideAttrs (oldAttrs: { + propagatedBuildInputs = oldAttrs.propagatedBuildInputs + ++ cfg.extraPackages; + }); + + home.packages = [ cfg.finalPackage ]; + + xdg.configFile."ranger/rc.conf".text = let + mkString = generators.mkValueStringDefault { }; + mkConfig = cmd: + generators.toKeyValue { + mkKeyValue = k: v: "${cmd} ${k} ${mkString v}"; + }; + in '' + ${mkConfig "set" cfg.settings} + ${mkConfig "alias" cfg.aliases} + ${mkConfig "map" cfg.mappings} + ${cfg.extraConfig} + ''; + } + + (mkIf (cfg.plugins != [ ]) { + xdg.configFile = let + toAttrs = i: { + name = "ranger/plugins/${i.name}"; + value.source = i.src; + }; + in listToAttrs (map toAttrs cfg.plugins); + }) + + (mkIf (cfg.rifle != [ ]) { + xdg.configFile."ranger/rifle.conf".text = + let lines = map (i: "${i.condition} = ${i.command}") cfg.rifle; + in concatLines lines; + }) + ]); + + meta.maintainers = [ hm.maintainers.fpob ]; +} diff --git a/tests/default.nix b/tests/default.nix index 1e14df0c465b..5084d2d1077f 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -126,6 +126,7 @@ in import nmtSrc { ./modules/programs/pyenv ./modules/programs/qcal ./modules/programs/qutebrowser + ./modules/programs/ranger ./modules/programs/readline ./modules/programs/rio ./modules/programs/ripgrep diff --git a/tests/modules/programs/ranger/configuration-rc.conf b/tests/modules/programs/ranger/configuration-rc.conf new file mode 100644 index 000000000000..ee18f4c612e2 --- /dev/null +++ b/tests/modules/programs/ranger/configuration-rc.conf @@ -0,0 +1,13 @@ +set column_ratios 1,3,3 +set confirm_on_delete never +set scroll_offset 8 +set unicode_ellipsis true + +alias e edit +alias filter scout -prts +alias setl setlocal + +map Q quitall +map q quit + +unmap gd diff --git a/tests/modules/programs/ranger/configuration-rifle.conf b/tests/modules/programs/ranger/configuration-rifle.conf new file mode 100644 index 000000000000..7a8671a1bd16 --- /dev/null +++ b/tests/modules/programs/ranger/configuration-rifle.conf @@ -0,0 +1,2 @@ +mime ^text, label editor = vim -- "$@" +mime ^text, label pager = less -- "$@" diff --git a/tests/modules/programs/ranger/configuration.nix b/tests/modules/programs/ranger/configuration.nix new file mode 100644 index 000000000000..5d534e49c140 --- /dev/null +++ b/tests/modules/programs/ranger/configuration.nix @@ -0,0 +1,43 @@ +{ ... }: + +{ + programs.ranger = { + enable = true; + settings = { + column_ratios = "1,3,3"; + confirm_on_delete = "never"; + unicode_ellipsis = true; + scroll_offset = 8; + }; + aliases = { + e = "edit"; + setl = "setlocal"; + filter = "scout -prts"; + }; + mappings = { + Q = "quitall"; + q = "quit"; + }; + extraConfig = "unmap gd"; + rifle = [ + { + condition = "mime ^text, label editor"; + command = ''vim -- "$@"''; + } + { + condition = "mime ^text, label pager"; + command = ''less -- "$@"''; + } + ]; + }; + + nmt.script = '' + assertFileExists home-files/.config/ranger/rc.conf + assertFileContent home-files/.config/ranger/rc.conf \ + ${./configuration-rc.conf} + + assertFileExists home-files/.config/ranger/rifle.conf + assertFileContent home-files/.config/ranger/rifle.conf \ + ${./configuration-rifle.conf} + ''; +} diff --git a/tests/modules/programs/ranger/default.nix b/tests/modules/programs/ranger/default.nix new file mode 100644 index 000000000000..84579d537629 --- /dev/null +++ b/tests/modules/programs/ranger/default.nix @@ -0,0 +1 @@ +{ ranger-configuration = ./configuration.nix; } From b3a9fb9d05e5117413eb87867cebd0ecc2f59b7e Mon Sep 17 00:00:00 2001 From: V Date: Thu, 29 Feb 2024 00:18:40 +0100 Subject: [PATCH 107/636] treewide: stop `run` from discarding error messages In most cases where this function is used, suppressing only the standard output is more appropriate. Culling diagnostic output hides error messages and makes debugging more difficult and confusing. `$DRY_RUN_NULL`, which the `--silence` flag replaced, was used both for suppressing standard output on its own, and for doing so along with diagnostic output; however, when the `run` function was added this distinction was lost, and both outputs would be discarded. This reintroduces the needed functionality, and changes usages of `--silence` to `--quiet` where previously only standard output was suppressed, or where this should have probably been the case anyway. Change-Id: Ifb1b52a1d1eea0117261c782d686ad7c71b43162 --- lib/bash/home-manager.sh | 12 +++++++++++- modules/files.nix | 2 +- modules/home-environment.nix | 6 ++++++ modules/lib-bash/activation-init.sh | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/lib/bash/home-manager.sh b/lib/bash/home-manager.sh index 19cbaa687949..2b9c2d01e684 100644 --- a/lib/bash/home-manager.sh +++ b/lib/bash/home-manager.sh @@ -99,16 +99,26 @@ function _iVerbose() { # Runs the given command on live run, otherwise prints the command to standard # output. # +# If given the command line option `--quiet`, then the command's standard output +# is sent to `/dev/null` on a live run. +# # If given the command line option `--silence`, then the command's standard and # error output is sent to `/dev/null` on a live run. +# +# The `--silence` and `--quiet` flags are mutually exclusive. function run() { - if [[ $1 == '--silence' ]]; then + if [[ $1 == '--quiet' ]]; then + local quiet=1 + shift + elif [[ $1 == '--silence' ]]; then local silence=1 shift fi if [[ -v DRY_RUN ]] ; then echo "$@" + elif [[ -v quiet ]] ; then + "$@" > /dev/null elif [[ -v silence ]] ; then "$@" > /dev/null 2>&1 else diff --git a/modules/files.nix b/modules/files.nix index 327cf1bbd1d6..05445e8434e8 100644 --- a/modules/files.nix +++ b/modules/files.nix @@ -274,7 +274,7 @@ in run nix-env $VERBOSE_ARG --profile "$genProfilePath" --set "$newGenPath" fi - run --silence nix-store --realise "$newGenPath" --add-root "$newGenGcPath" + run --quiet nix-store --realise "$newGenPath" --add-root "$newGenGcPath" if [[ -e "$legacyGenGcPath" ]]; then run rm $VERBOSE_ARG "$legacyGenGcPath" fi diff --git a/modules/home-environment.nix b/modules/home-environment.nix index 27a71e4578f9..1728fa4583b7 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -405,11 +405,17 @@ in : Runs the given command on live run, otherwise prints the command to standard output. + {command}`run --quiet {command}` + : Runs the given command on live run and sends its standard output to + {file}`/dev/null`, otherwise prints the command to standard output. + {command}`run --silence {command}` : Runs the given command on live run and sends its standard and error output to {file}`/dev/null`, otherwise prints the command to standard output. + The `--quiet` and `--silence` flags are mutually exclusive. + A script block should also respect the {var}`VERBOSE` variable, and if set print information on standard out that may be useful for debugging any issue that may arise. The variable {var}`VERBOSE_ARG` is set to diff --git a/modules/lib-bash/activation-init.sh b/modules/lib-bash/activation-init.sh index 9a38e7c5af7d..9e5ea200f1e9 100755 --- a/modules/lib-bash/activation-init.sh +++ b/modules/lib-bash/activation-init.sh @@ -115,7 +115,7 @@ function nixProfileRemove() { nixProfileList "$1" | xargs -rt $DRY_RUN_CMD nix profile remove $VERBOSE_ARG else if nix-env -q | grep -q "^$1$"; then - run --silence nix-env -e "$1" + run --quiet nix-env -e "$1" fi fi } From 17431970b4ebc75a92657101ccffcfc9e1f9d8f0 Mon Sep 17 00:00:00 2001 From: V Date: Thu, 29 Feb 2024 00:24:35 +0100 Subject: [PATCH 108/636] files: fix activation under Nix 2.3 In Nix 2.3, all GC roots must be stored under `/nix/var/nix/gcroots`, unless `--indirect` is specified. In Nix 2.4 and above, this flag is ignored, because all GC roots created by `--add-root` are indirect. Change-Id: I3eb3d7bc774af2ff336a2cdf312d30a99cdcb928 --- modules/files.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/files.nix b/modules/files.nix index 05445e8434e8..50f6ca8124fd 100644 --- a/modules/files.nix +++ b/modules/files.nix @@ -274,7 +274,7 @@ in run nix-env $VERBOSE_ARG --profile "$genProfilePath" --set "$newGenPath" fi - run --quiet nix-store --realise "$newGenPath" --add-root "$newGenGcPath" + run --quiet nix-store --realise "$newGenPath" --add-root "$newGenGcPath" --indirect if [[ -e "$legacyGenGcPath" ]]; then run rm $VERBOSE_ARG "$legacyGenGcPath" fi From 16311f1d3c518656f680b7d09e29e37826f9802e Mon Sep 17 00:00:00 2001 From: Liassica Date: Tue, 20 Feb 2024 19:03:20 -0600 Subject: [PATCH 109/636] borgmatic: add option for pattern matching Borgmatic has support for Borg's pattern matching. It is mutually exclusive with the existing `sourceDirectories` option, so assertions have been added to make sure that both are not set at the same time (but also that at least one of them is). Additionally, tests have been added to test the following configurations: `patterns` instead of `sourceDirectories`, both at the same time, and neither. --- modules/programs/borgmatic.nix | 46 ++++++++++++++- .../both-sourcedirectories-and-patterns.nix | 26 +++++++++ tests/modules/programs/borgmatic/default.nix | 5 ++ ...neither-sourcedirectories-nor-patterns.nix | 18 ++++++ .../borgmatic/patterns-configuration.nix | 58 +++++++++++++++++++ 5 files changed, 150 insertions(+), 3 deletions(-) create mode 100644 tests/modules/programs/borgmatic/both-sourcedirectories-and-patterns.nix create mode 100644 tests/modules/programs/borgmatic/neither-sourcedirectories-nor-patterns.nix create mode 100644 tests/modules/programs/borgmatic/patterns-configuration.nix diff --git a/modules/programs/borgmatic.nix b/modules/programs/borgmatic.nix index 19670775ad6f..ecc6f5cf3893 100644 --- a/modules/programs/borgmatic.nix +++ b/modules/programs/borgmatic.nix @@ -76,12 +76,39 @@ let (mkAfter [ (toString hmExcludeFile) ]); options = { location = { - sourceDirectories = mkOption { + sourceDirectories = mkNullableOption { type = types.listOf types.str; - description = "Directories to backup."; + default = null; + description = '' + Directories to backup. + + Mutually exclusive with [](#opt-programs.borgmatic.backups._name_.location.patterns). + ''; example = literalExpression "[config.home.homeDirectory]"; }; + patterns = mkNullableOption { + type = types.listOf types.str; + default = null; + description = '' + Patterns to include/exclude. + + See the output of `borg help patterns` for the syntax. Pattern paths + are relative to `/` even when a different recursion root is set. + + Mutually exclusive with [](#opt-programs.borgmatic.backups._name_.location.sourceDirectories). + ''; + example = literalExpression '' + [ + "R /home/user" + "- home/user/.cache" + "- home/user/Downloads" + "+ home/user/Videos/Important Video" + "- home/user/Videos" + ] + ''; + }; + repositories = mkOption { type = types.listOf (types.either types.str repositoryOption); apply = cleanRepositories; @@ -194,6 +221,7 @@ let writeConfig = config: generators.toYAML { } (removeNullValues ({ source_directories = config.location.sourceDirectories; + patterns = config.location.patterns; repositories = config.location.repositories; encryption_passcommand = config.storage.encryptionPasscommand; keep_within = config.retention.keepWithin; @@ -247,7 +275,19 @@ in { assertions = [ (lib.hm.assertions.assertPlatform "programs.borgmatic" pkgs lib.platforms.linux) - ]; + ] ++ (mapAttrsToList (backup: opts: { + assertion = opts.location.sourceDirectories == null + || opts.location.patterns == null; + message = '' + Borgmatic backup configuration "${backup}" cannot specify both 'location.sourceDirectories' and 'location.patterns'. + ''; + }) cfg.backups) ++ (mapAttrsToList (backup: opts: { + assertion = !(opts.location.sourceDirectories == null + && opts.location.patterns == null); + message = '' + Borgmatic backup configuration "${backup}" must specify one of 'location.sourceDirectories' or 'location.patterns'. + ''; + }) cfg.backups); xdg.configFile = with lib.attrsets; mapAttrs' (configName: config: diff --git a/tests/modules/programs/borgmatic/both-sourcedirectories-and-patterns.nix b/tests/modules/programs/borgmatic/both-sourcedirectories-and-patterns.nix new file mode 100644 index 000000000000..106a0c18ce8a --- /dev/null +++ b/tests/modules/programs/borgmatic/both-sourcedirectories-and-patterns.nix @@ -0,0 +1,26 @@ +{ config, pkgs, ... }: + +let + + backups = config.programs.borgmatic.backups; + +in { + programs.borgmatic = { + enable = true; + backups = { + main = { + location = { + sourceDirectories = [ "/my-stuff-to-backup" ]; + patterns = [ "R /" "+ my-stuff-to-backup" ]; + repositories = [ "/mnt/disk1" ]; + }; + }; + }; + }; + + test.stubs.borgmatic = { }; + + test.asserts.assertions.expected = ['' + Borgmatic backup configuration "main" cannot specify both 'location.sourceDirectories' and 'location.patterns'. + '']; +} diff --git a/tests/modules/programs/borgmatic/default.nix b/tests/modules/programs/borgmatic/default.nix index 53ea9be89bac..8cc0f924d4b6 100644 --- a/tests/modules/programs/borgmatic/default.nix +++ b/tests/modules/programs/borgmatic/default.nix @@ -1,5 +1,10 @@ { borgmatic-program-basic-configuration = ./basic-configuration.nix; + borgmatic-program-patterns-configuration = ./patterns-configuration.nix; + borgmatic-program-both-sourcedirectories-and-patterns = + ./both-sourcedirectories-and-patterns.nix; + borgmatic-program-neither-sourcedirectories-nor-patterns = + ./neither-sourcedirectories-nor-patterns.nix; borgmatic-program-include-hm-symlinks = ./include-hm-symlinks.nix; borgmatic-program-exclude-hm-symlinks = ./exclude-hm-symlinks.nix; borgmatic-program-exclude-hm-symlinks-nothing-else = diff --git a/tests/modules/programs/borgmatic/neither-sourcedirectories-nor-patterns.nix b/tests/modules/programs/borgmatic/neither-sourcedirectories-nor-patterns.nix new file mode 100644 index 000000000000..596fdf1cd608 --- /dev/null +++ b/tests/modules/programs/borgmatic/neither-sourcedirectories-nor-patterns.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: + +let + + backups = config.programs.borgmatic.backups; + +in { + programs.borgmatic = { + enable = true; + backups = { main = { location = { repositories = [ "/mnt/disk1" ]; }; }; }; + }; + + test.stubs.borgmatic = { }; + + test.asserts.assertions.expected = ['' + Borgmatic backup configuration "main" must specify one of 'location.sourceDirectories' or 'location.patterns'. + '']; +} diff --git a/tests/modules/programs/borgmatic/patterns-configuration.nix b/tests/modules/programs/borgmatic/patterns-configuration.nix new file mode 100644 index 000000000000..098708cad38a --- /dev/null +++ b/tests/modules/programs/borgmatic/patterns-configuration.nix @@ -0,0 +1,58 @@ +{ config, pkgs, ... }: + +let + + boolToString = bool: if bool then "true" else "false"; + backups = config.programs.borgmatic.backups; + +in { + programs.borgmatic = { + enable = true; + backups = { + main = { + location = { + patterns = [ + "R /home/user" + "+ home/user/stuff-to-backup" + "+ home/user/junk/important-file" + "- home/user/junk" + ]; + repositories = [ "/mnt/backup-drive" ]; + }; + }; + }; + }; + + test.stubs.borgmatic = { }; + + nmt.script = '' + config_file=$TESTED/home-files/.config/borgmatic.d/main.yaml + assertFileExists $config_file + + declare -A expectations + + expectations[patterns[0]]="${ + builtins.elemAt backups.main.location.patterns 0 + }" + expectations[patterns[1]]="${ + builtins.elemAt backups.main.location.patterns 1 + }" + expectations[patterns[2]]="${ + builtins.elemAt backups.main.location.patterns 2 + }" + expectations[patterns[3]]="${ + builtins.elemAt backups.main.location.patterns 3 + }" + + yq=${pkgs.yq-go}/bin/yq + + for filter in "''${!expectations[@]}"; do + expected_value="''${expectations[$filter]}" + actual_value="$($yq ".$filter" $config_file)" + + if [[ "$actual_value" != "$expected_value" ]]; then + fail "Expected '$filter' to be '$expected_value' but was '$actual_value'" + fi + done + ''; +} From b0b0c3d94345050a7f86d1ebc6c56eea4389d030 Mon Sep 17 00:00:00 2001 From: Igor Date: Tue, 27 Feb 2024 21:48:27 +0000 Subject: [PATCH 110/636] targets/generic-linux: use xdg path for defexpr Fixes warnings about the non-existent `~/.nix-defexpr` folder when using `use-xdg-base-directories = true`. Example: warning: Nix search path entry '/home/user/.nix-defexpr/channels' does not exist, ignoring Starting Home Manager activation Activating checkFilesChanged Activating checkLinkTargets Activating writeBoundary Activating installPackages replacing old 'home-manager-path' installing 'home-manager-path' Activating dconfSettings Activating linkDesktopApplications Activating linkGeneration Cleaning up orphan links from /home/user No change so reusing latest profile generation 13 Creating home file links in /home/user Activating onFilesChange Activating reloadSystemd warning: Nix search path entry '/home/user/.nix-defexpr/channels' does not exist, ignoring --- modules/targets/generic-linux.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/targets/generic-linux.nix b/modules/targets/generic-linux.nix index b5a07d5fac4e..9dce9f5c8441 100644 --- a/modules/targets/generic-linux.nix +++ b/modules/targets/generic-linux.nix @@ -99,7 +99,11 @@ in { "/usr/share/terminfo" # package default, all distros ]; in { - NIX_PATH = "$HOME/.nix-defexpr/channels\${NIX_PATH:+:}$NIX_PATH"; + NIX_PATH = if config.nix.enable + && (config.nix.settings.use-xdg-base-directories or false) then + "${config.xdg.stateHome}/nix/defexpr/channels\${NIX_PATH:+:}$NIX_PATH" + else + "$HOME/.nix-defexpr/channels\${NIX_PATH:+:}$NIX_PATH"; TERMINFO_DIRS = "${profileDirectory}/share/terminfo:$TERMINFO_DIRS\${TERMINFO_DIRS:+:}${distroTerminfoDirs}"; }; From fbec89838763831bd92e1b09222dc9477942930f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 10 Mar 2024 03:59:25 +0000 Subject: [PATCH 111/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/b8697e57f10292a6165a20f03d2f42920dfaf973' (2024-03-03) → 'github:NixOS/nixpkgs/9df3e30ce24fd28c7b3e2de0d986769db5d6225d' (2024-03-06) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 921dc8d87f2a..a897d3df3bb5 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1709479366, - "narHash": "sha256-n6F0n8UV6lnTZbYPl1A9q1BS0p4hduAv1mGAP17CVd0=", + "lastModified": 1709703039, + "narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b8697e57f10292a6165a20f03d2f42920dfaf973", + "rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d", "type": "github" }, "original": { From fe4180ad3f07a2064fed7875183509e7e0eb07cd Mon Sep 17 00:00:00 2001 From: Matt Wittmann Date: Sat, 9 Mar 2024 09:17:58 -0800 Subject: [PATCH 112/636] bat: handle existing cache in activation script Run `bat cache --build` in an empty directory to work around failure when ~/cache exists. --- modules/programs/bat.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/programs/bat.nix b/modules/programs/bat.nix index 99813e95627e..bf8040d14bce 100644 --- a/modules/programs/bat.nix +++ b/modules/programs/bat.nix @@ -159,10 +159,14 @@ in { }; }))); + # NOTE: run `bat cache --build` in an empty directory to work + # around failure when ~/cache exists + # https://github.com/sharkdp/bat/issues/1726 home.activation.batCache = hm.dag.entryAfter [ "linkGeneration" ] '' ( export XDG_CACHE_HOME=${escapeShellArg config.xdg.cacheHome} verboseEcho "Rebuilding bat theme cache" + cd "${pkgs.emptyDirectory}" run ${lib.getExe package} cache --build ) ''; From 36f873dfc8e2b6b89936ff3e2b74803d50447e0a Mon Sep 17 00:00:00 2001 From: Lin Xianyi Date: Sun, 10 Mar 2024 17:20:21 +0800 Subject: [PATCH 113/636] pqiv: add extraConfig option --- modules/programs/pqiv.nix | 40 ++++++++++++++++++------ tests/modules/programs/pqiv/settings.nix | 8 +++++ 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/modules/programs/pqiv.nix b/modules/programs/pqiv.nix index 046ed9aa96cb..ed1a0b280964 100644 --- a/modules/programs/pqiv.nix +++ b/modules/programs/pqiv.nix @@ -3,12 +3,10 @@ with lib; let - cfg = config.programs.pqiv; iniFormat = pkgs.formats.ini { }; - in { - meta.maintainers = with lib.maintainers; [ donovanglover ]; + meta.maintainers = with lib.maintainers; [ donovanglover iynaix ]; options.programs.pqiv = { enable = mkEnableOption "pqiv image viewer"; @@ -24,10 +22,9 @@ in { type = iniFormat.type; default = { }; description = '' - Configuration written to - $XDG_CONFIG_HOME/pqivrc. See - for a list of available options. To set a boolean flag, set the value to 1. + Configuration written to {file}`$XDG_CONFIG_HOME/pqivrc`. See + {manpage}`pqiv(1)` for a list of available options. To set a + boolean flag, set the value to 1. ''; example = literalExpression '' { @@ -41,6 +38,25 @@ in { }; ''; }; + + extraConfig = mkOption { + type = types.lines; + default = ""; + description = '' + Extra lines to be added to {file}`$XDG_CONFIG_HOME/pqivrc`. See + {manpage}`pqiv(1)` for a list of available options. + ''; + example = literalExpression '' + [actions] + set_cursor_auto_hide(1) + + [keybindings] + t { montage_mode_enter() } + @MONTAGE { + t { montage_mode_return_cancel() } + } + ''; + }; }; config = mkIf cfg.enable { @@ -49,8 +65,12 @@ in { home.packages = [ cfg.package ]; - xdg.configFile."pqivrc" = mkIf (cfg.settings != { }) { - source = iniFormat.generate "pqivrc" cfg.settings; - }; + xdg.configFile."pqivrc" = + mkIf (cfg.settings != { } && cfg.extraConfig != "") { + text = lib.concatLines [ + (generators.toINI { } cfg.settings) + cfg.extraConfig + ]; + }; }; } diff --git a/tests/modules/programs/pqiv/settings.nix b/tests/modules/programs/pqiv/settings.nix index 6a5abe604649..277203da5346 100644 --- a/tests/modules/programs/pqiv/settings.nix +++ b/tests/modules/programs/pqiv/settings.nix @@ -10,6 +10,10 @@ thumbnail-size = "256x256"; }; }; + extraConfig = '' + [keybindings] + t { montage_mode_enter() } + ''; }; nmt.script = '' @@ -19,6 +23,10 @@ [options] hide-info-box=1 thumbnail-size=256x256 + + [keybindings] + t { montage_mode_enter() } + '' } ''; From 017b12de5b899ef9b64e2c035ce257bfe95b8ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20K=C3=BChn?= Date: Thu, 29 Feb 2024 08:35:16 +0100 Subject: [PATCH 114/636] neomutt: adding unmailboxes option Adding unmailboxes option to neomutt, which adds the `unmailboxes` option it to every account.email with neomutt enabled. See https://www.mutt.org/doc/manual/#mailboxes for more. --- modules/programs/neomutt.nix | 18 +++++++++- tests/modules/programs/neomutt/default.nix | 1 + .../hm-example.com-unmailboxes-expected.conf | 34 +++++++++++++++++++ .../programs/neomutt/neomutt-unmailboxes.nix | 30 ++++++++++++++++ 4 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 tests/modules/programs/neomutt/hm-example.com-unmailboxes-expected.conf create mode 100644 tests/modules/programs/neomutt/neomutt-unmailboxes.nix diff --git a/modules/programs/neomutt.nix b/modules/programs/neomutt.nix index 1067bda1acc7..d338a5802995 100644 --- a/modules/programs/neomutt.nix +++ b/modules/programs/neomutt.nix @@ -296,7 +296,12 @@ let pkgs.writeText "signature.txt" account.signature.text }"; in '' - # Generated by Home Manager. + # Generated by Home Manager.${ + optionalString cfg.unmailboxes '' + + unmailboxes * + '' + } set ssl_force_tls = ${ lib.hm.booleans.yesNo (imap.tls.enable || imap.tls.useStartTls) } @@ -397,6 +402,17 @@ in { default = true; }; + unmailboxes = mkOption { + type = types.bool; + default = false; + description = '' + Set `unmailboxes *` at the start of account configurations. + It removes previous sidebar mailboxes when sourcing an account configuration. + + See for more information. + ''; + }; + extraConfig = mkOption { type = types.lines; default = ""; diff --git a/tests/modules/programs/neomutt/default.nix b/tests/modules/programs/neomutt/default.nix index d13b870e5a74..5666ade0987b 100644 --- a/tests/modules/programs/neomutt/default.nix +++ b/tests/modules/programs/neomutt/default.nix @@ -14,4 +14,5 @@ neomutt-with-signature = ./neomutt-with-signature.nix; neomutt-with-signature-command = ./neomutt-with-signature-command.nix; neomutt-with-starttls = ./neomutt-with-starttls.nix; + neomutt-unmailboxes = ./neomutt-unmailboxes.nix; } diff --git a/tests/modules/programs/neomutt/hm-example.com-unmailboxes-expected.conf b/tests/modules/programs/neomutt/hm-example.com-unmailboxes-expected.conf new file mode 100644 index 000000000000..35822ceee61c --- /dev/null +++ b/tests/modules/programs/neomutt/hm-example.com-unmailboxes-expected.conf @@ -0,0 +1,34 @@ +# Generated by Home Manager. +unmailboxes * + +set ssl_force_tls = yes +set certificate_file=/etc/ssl/certs/ca-certificates.crt + +# GPG section +set crypt_autosign = no +set crypt_opportunistic_encrypt = no +set pgp_use_gpg_agent = yes +set mbox_type = Maildir +set sort = "threads" + +# MTA section +set sendmail='msmtpq --read-envelope-from --read-recipients' + + + + + +# MRA section +set folder='/home/hm-user/Mail/hm@example.com' +set from='hm@example.com' +set postponed='+Drafts' +set realname='H. M. Test' +set record='+Sent' +set spoolfile='+Inbox' +set trash='+Trash' + + +# Extra configuration + + +unset signature diff --git a/tests/modules/programs/neomutt/neomutt-unmailboxes.nix b/tests/modules/programs/neomutt/neomutt-unmailboxes.nix new file mode 100644 index 000000000000..162379b809a9 --- /dev/null +++ b/tests/modules/programs/neomutt/neomutt-unmailboxes.nix @@ -0,0 +1,30 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + imports = [ ../../accounts/email-test-accounts.nix ]; + + config = { + accounts.email.accounts = { + "hm@example.com" = { + msmtp.enable = true; + neomutt.enable = true; + imap.port = 993; + }; + }; + + programs.neomutt.enable = true; + programs.neomutt.unmailboxes = true; + + test.stubs.neomutt = { }; + + nmt.script = '' + assertFileExists home-files/.config/neomutt/hm@example.com + assertFileContent home-files/.config/neomutt/hm@example.com ${ + ./hm-example.com-unmailboxes-expected.conf + } + ''; + }; +} + From a500de54b2e3067201a40cefa5f210f719423ddf Mon Sep 17 00:00:00 2001 From: michaelBelsanti Date: Fri, 8 Mar 2024 14:33:29 -0500 Subject: [PATCH 115/636] eza: replace enableAliases with integration options --- modules/programs/eza.nix | 47 ++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 9 deletions(-) diff --git a/modules/programs/eza.nix b/modules/programs/eza.nix index 0c6c5d7e5b56..e28c3a54c1b5 100644 --- a/modules/programs/eza.nix +++ b/modules/programs/eza.nix @@ -4,16 +4,40 @@ with lib; { imports = let + msg = '' + 'programs.eza.enableAliases' has been deprecated and replaced with integration + options per shell, for example, 'programs.eza.enableBashIntegration'. + + Note, the default for these options is 'true' so if you want to enable the + aliases you can simply remove 'rograms.eza.enableAliases' from your + configuration.''; mkRenamed = opt: mkRenamedOptionModule [ "programs" "exa" opt ] [ "programs" "eza" opt ]; - in map mkRenamed [ "enable" "enableAliases" "extraOptions" "icons" "git" ]; + in (map mkRenamed [ "enable" "extraOptions" "icons" "git" ]) + ++ [ (mkRemovedOptionModule [ "programs" "eza" "enableAliases" ] msg) ]; meta.maintainers = [ maintainers.cafkafk ]; options.programs.eza = { enable = mkEnableOption "eza, a modern replacement for {command}`ls`"; - enableAliases = mkEnableOption "recommended eza aliases (ls, ll…)"; + enableBashIntegration = mkEnableOption "Bash integration" // { + default = true; + }; + + enableZshIntegration = mkEnableOption "Zsh integration" // { + default = true; + }; + + enableFishIntegration = mkEnableOption "Fish integration" // { + default = true; + }; + + enableIonIntegration = mkEnableOption "Ion integration" // { + default = true; + }; + + enableNushellIntegration = mkEnableOption "Nushell integration"; extraOptions = mkOption { type = types.listOf types.str; @@ -49,9 +73,9 @@ with lib; args = escapeShellArgs (optional cfg.icons "--icons" ++ optional cfg.git "--git" ++ cfg.extraOptions); + optionsAlias = { eza = "eza ${args}"; }; + aliases = { - eza = "eza ${args}"; - } // optionalAttrs cfg.enableAliases { ls = "eza"; ll = "eza -l"; la = "eza -a"; @@ -61,14 +85,19 @@ with lib; in mkIf cfg.enable { home.packages = [ cfg.package ]; - programs.bash.shellAliases = aliases; + programs.bash.shellAliases = optionsAlias + // optionalAttrs cfg.enableBashIntegration aliases; - programs.zsh.shellAliases = aliases; + programs.zsh.shellAliases = optionsAlias + // optionalAttrs cfg.enableZshIntegration aliases; - programs.fish.shellAliases = aliases; + programs.fish.shellAliases = optionsAlias + // optionalAttrs cfg.enableFishIntegration aliases; - programs.ion.shellAliases = aliases; + programs.ion.shellAliases = optionsAlias + // optionalAttrs cfg.enableIonIntegration aliases; - programs.nushell.shellAliases = aliases; + programs.nushell.shellAliases = optionsAlias + // optionalAttrs cfg.enableNushellIntegration aliases; }; } From 49a266d2ca59df8a03249550e73a54626181b65d Mon Sep 17 00:00:00 2001 From: Mathis H Date: Tue, 12 Mar 2024 22:16:18 +0000 Subject: [PATCH 116/636] hyprland: add option for per-input device configs --- modules/services/window-managers/hyprland.nix | 24 ++++++++++++++++--- .../hyprland/simple-config.conf | 4 ++++ .../hyprland/simple-config.nix | 5 ++++ 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index ec0cf557f363..3048d58942b0 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -207,23 +207,41 @@ in { let indent = concatStrings (replicate indentLevel " "); + sections = filterAttrs (n: v: isAttrs v && n != "device") attrs; + mkSection = n: attrs: '' ${indent}${n} { ${toHyprconf attrs (indentLevel + 1)}${indent}} ''; - sections = filterAttrs (n: v: isAttrs v) attrs; + + mkDeviceCategory = device: '' + ${indent}device { + name=${device.name} + ${ + toHyprconf (filterAttrs (n: _: "name" != n) device) + (indentLevel + 1) + }${indent}} + ''; + + deviceCategory = lib.optionalString (hasAttr "device" attrs) + (if isList attrs.device then + (concatMapStringsSep "\n" (d: mkDeviceCategory d) attrs.device) + else + mkDeviceCategory attrs.device); mkFields = generators.toKeyValue { listsAsDuplicateKeys = true; inherit indent; }; - allFields = filterAttrs (n: v: !(isAttrs v)) attrs; + allFields = filterAttrs (n: v: !(isAttrs v) && n != "device") attrs; + importantFields = filterAttrs (n: _: (hasPrefix "$" n) || (hasPrefix "bezier" n) || (cfg.sourceFirst && (hasPrefix "source" n))) allFields; + fields = builtins.removeAttrs allFields (mapAttrsToList (n: _: n) importantFields); - in mkFields importantFields + in mkFields importantFields + deviceCategory + concatStringsSep "\n" (mapAttrsToList mkSection sections) + mkFields fields; diff --git a/tests/modules/services/window-managers/hyprland/simple-config.conf b/tests/modules/services/window-managers/hyprland/simple-config.conf index 0db599a312c7..9b15ba32a941 100644 --- a/tests/modules/services/window-managers/hyprland/simple-config.conf +++ b/tests/modules/services/window-managers/hyprland/simple-config.conf @@ -6,6 +6,10 @@ bezier=smoothOut, 0.36, 0, 0.66, -0.56 bezier=smoothIn, 0.25, 1, 0.5, 1 bezier=overshot, 0.4,0.8,0.2,1.2 source=sourced.conf +device { + name=some:device + enable=true +} animations { animation=border, 1, 2, smoothIn animation=fade, 1, 4, smoothOut diff --git a/tests/modules/services/window-managers/hyprland/simple-config.nix b/tests/modules/services/window-managers/hyprland/simple-config.nix index f45bf6b38c15..e7b11ffe1dd5 100644 --- a/tests/modules/services/window-managers/hyprland/simple-config.nix +++ b/tests/modules/services/window-managers/hyprland/simple-config.nix @@ -46,6 +46,11 @@ "$mod ALT, mouse:272, resizewindow" ]; + device = { + name = "some:device"; + enable = true; + }; + plugin = { plugin1 = { dummy = "plugin setting"; From dab2437ca0aa0b91bbb0ea72a9f10ee494833593 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 13 Mar 2024 03:59:21 +0000 Subject: [PATCH 117/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/9df3e30ce24fd28c7b3e2de0d986769db5d6225d' (2024-03-06) → 'github:NixOS/nixpkgs/3030f185ba6a4bf4f18b87f345f104e6a6961f34' (2024-03-09) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index a897d3df3bb5..5879aa404dbe 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1709703039, - "narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=", + "lastModified": 1709961763, + "narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d", + "rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34", "type": "github" }, "original": { From 1b74e3679e90fe7ad142bb5f66610a0d92ac0165 Mon Sep 17 00:00:00 2001 From: Pim Snel Date: Wed, 13 Mar 2024 12:25:47 +0100 Subject: [PATCH 118/636] docs: update home-manager-option-search URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 805d2cfcca8d..335edea7be6f 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ For a systematic overview of Home Manager and its available options, please see: - [Home Manager manual][manual] - [Home Manager configuration options][configuration options] - [3rd party Home Manager option - search](https://mipmip.github.io/home-manager-option-search/) + search](https://home-manager-options.extranix.com/) If you would like to contribute to Home Manager, then please have a look at ["Contributing" in the manual][contributing]. From 31abb4f6bc540dfa82562e81312cfdc77770f001 Mon Sep 17 00:00:00 2001 From: ShalokShalom Date: Wed, 13 Mar 2024 13:45:11 +0100 Subject: [PATCH 119/636] docs: fix broken link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 335edea7be6f..486194aaea4e 100644 --- a/README.md +++ b/README.md @@ -125,4 +125,4 @@ This project is licensed under the terms of the [MIT license](LICENSE). [manual standalone install]: https://nix-community.github.io/home-manager/#sec-install-standalone [manual]: https://nix-community.github.io/home-manager/ [nix-darwin]: https://github.com/LnL7/nix-darwin -[rollbacks]: https://nix-community.github.io/home-manager/#sec-usage-rollbacks +[rollbacks]: https://nix-community.github.io/home-manager/index.xhtml#sec-usage-rollbacks From 0906e8dfe7a4a530799681be4be8ac5b48fddc0b Mon Sep 17 00:00:00 2001 From: Norbert Melzer Date: Wed, 13 Mar 2024 13:46:29 +0100 Subject: [PATCH 120/636] eza: use `mkDefault` for aliases Using `mkDefault` for the individual aliases makes it easier to override or replace individual entries by the user, without having to use `mkForce` which is often confusing for new users. --- modules/programs/eza.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/eza.nix b/modules/programs/eza.nix index e28c3a54c1b5..3c244071fd8a 100644 --- a/modules/programs/eza.nix +++ b/modules/programs/eza.nix @@ -75,7 +75,7 @@ with lib; optionsAlias = { eza = "eza ${args}"; }; - aliases = { + aliases = builtins.mapAttrs (_name: value: lib.mkDefault value) { ls = "eza"; ll = "eza -l"; la = "eza -a"; From a82cdd288e3570ac52cffe0abaf28fac7d967b68 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 13 Mar 2024 13:47:31 +0100 Subject: [PATCH 121/636] offlineimap: disable starttls if tls is disabled Fixes #5097 --- modules/programs/offlineimap.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/programs/offlineimap.nix b/modules/programs/offlineimap.nix index 1a1845c0ff99..fcafec060d20 100644 --- a/modules/programs/offlineimap.nix +++ b/modules/programs/offlineimap.nix @@ -42,6 +42,7 @@ let starttls = imap.tls.useStartTls; } else { ssl = false; + starttls = false; }; remotePassEval = From 383296ffa45b539c28bf79ec2a272f652838ddd1 Mon Sep 17 00:00:00 2001 From: zorrobert <118135271+zorrobert@users.noreply.github.com> Date: Sun, 18 Feb 2024 22:57:35 +0100 Subject: [PATCH 122/636] joplin-desktop: add module PR #5020 --- modules/lib/maintainers.nix | 6 + modules/misc/news.nix | 7 + modules/modules.nix | 1 + modules/programs/joplin-desktop.nix | 124 ++++++++++++++++++ tests/default.nix | 1 + .../joplin-desktop/basic-configuration.json | 6 + .../joplin-desktop/basic-configuration.nix | 23 ++++ .../programs/joplin-desktop/default.nix | 1 + 8 files changed, 169 insertions(+) create mode 100644 modules/programs/joplin-desktop.nix create mode 100644 tests/modules/programs/joplin-desktop/basic-configuration.json create mode 100644 tests/modules/programs/joplin-desktop/basic-configuration.nix create mode 100644 tests/modules/programs/joplin-desktop/default.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 52f956d14700..174a7d363d4f 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -506,4 +506,10 @@ github = "britter"; githubId = 1327662; }; + zorrobert = { + name = "zorrobert"; + email = "zorrobert@mailbox.org"; + github = "zorrobert"; + githubId = 118135271; + }; } diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 5a40f60c2e3b..849ac94210b5 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1436,6 +1436,13 @@ in { A new module is available: 'programs.ranger'. ''; } + + { + time = "2024-03-13T13:28:22+00:00"; + message = '' + A new module is available: 'programs.joplin-desktop'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index ec2af169f718..fc8154e98e24 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -124,6 +124,7 @@ let ./programs/jq.nix ./programs/jujutsu.nix ./programs/joshuto.nix + ./programs/joplin-desktop.nix ./programs/just.nix ./programs/k9s.nix ./programs/kakoune.nix diff --git a/modules/programs/joplin-desktop.nix b/modules/programs/joplin-desktop.nix new file mode 100644 index 000000000000..fe46ebad180f --- /dev/null +++ b/modules/programs/joplin-desktop.nix @@ -0,0 +1,124 @@ +{ config, lib, pkgs, ... }: + +let + + cfg = config.programs.joplin-desktop; + + jsonFormat = pkgs.formats.json { }; + + # config path is the same for linux and mac + configPath = "${config.xdg.configHome}/joplin-desktop/settings.json"; + +in { + meta.maintainers = [ lib.maintainers.zorrobert ]; + + options.programs.joplin-desktop = { + enable = lib.mkEnableOption "joplin-desktop"; + + package = lib.mkPackageOption pkgs "joplin-desktop" { }; + + extraConfig = lib.mkOption { + type = lib.types.attrs; + default = { }; + example = { + "newNoteFocus" = "title"; + "markdown.plugin.mark" = true; + }; + description = '' + Use this to add other options to the Joplin config file. Settings are + written in JSON, so `"sync.interval": 600` would be written as + `"sync.interval" = 600`. + ''; + }; + + ### General + general = { + editor = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = null; + example = "kate"; + description = '' + The editor command (may include arguments) that will be used to open a + note. If none is provided Joplin will try to auto-detect the default + editor. + ''; + }; + }; + + ### Sync + sync = { + target = lib.mkOption { + type = lib.types.enum [ + null + "none" + "file-system" + "onedrive" + "nextcloud" + "webdav" + "dropbox" + "s3" + "joplin-server" + "joplin-cloud" + ]; + default = null; + example = "dropbox"; + description = "What is the type of sync target."; + }; + + interval = lib.mkOption { + type = + lib.types.enum [ null "disabled" "5m" "10m" "30m" "1h" "12h" "1d" ]; + default = null; + example = "10m"; + description = '' + Set the synchronisation interval. + ''; + }; + }; + }; + + config = lib.mkIf cfg.enable { + home.packages = [ cfg.package ]; + + home.activation = { + activateJoplinDesktopConfig = let + newConfig = jsonFormat.generate "joplin-settings.json" + (lib.attrsets.filterAttrs (n: v: (v != null) && (v != "")) ({ + # TODO: find a better way to convert nix attribute names to strings: + # sync.interval = ... -> "sync.interval" = ... + + "editor" = cfg.general.editor; + + "sync.target" = { + "none" = 0; + "file-system" = 2; + "onedrive" = 3; + "nextcloud" = 5; + "webdav" = 6; + "dropbox" = 7; + "s3" = 8; + "joplin-server" = 9; + "joplin-cloud" = 10; + }.${cfg.sync.target} or null; + + "sync.interval" = { + "disabled" = 0; + "5m" = 300; + "10m" = 600; + "30m" = 1800; + "1h" = 3600; + "12h" = 43200; + "1d" = 86400; + }.${cfg.sync.interval} or null; + } // cfg.extraConfig)); + in lib.hm.dag.entryAfter [ "linkGeneration" ] '' + # Ensure that settings.json exists. + touch ${configPath} + # Config has to be written to temporary variable because jq cannot edit files in place. + config="$(jq -s '.[0] + .[1]' ${configPath} ${newConfig})" + printf '%s\n' "$config" > ${configPath} + unset config + ''; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 5084d2d1077f..84ea67ded019 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -88,6 +88,7 @@ in import nmtSrc { ./modules/programs/i3status ./modules/programs/irssi ./modules/programs/jujutsu + ./modules/programs/joplin-desktop ./modules/programs/k9s ./modules/programs/kakoune ./modules/programs/khal diff --git a/tests/modules/programs/joplin-desktop/basic-configuration.json b/tests/modules/programs/joplin-desktop/basic-configuration.json new file mode 100644 index 000000000000..63e105ae7be6 --- /dev/null +++ b/tests/modules/programs/joplin-desktop/basic-configuration.json @@ -0,0 +1,6 @@ +{ + "newNoteFocus": "title", + "richTextBannerDismissed": true, + "sync.interval": 600, + "sync.target": 7 +} diff --git a/tests/modules/programs/joplin-desktop/basic-configuration.nix b/tests/modules/programs/joplin-desktop/basic-configuration.nix new file mode 100644 index 000000000000..9f986798fbcd --- /dev/null +++ b/tests/modules/programs/joplin-desktop/basic-configuration.nix @@ -0,0 +1,23 @@ +{ + programs.joplin-desktop = { + enable = true; + sync = { + target = "dropbox"; + interval = "10m"; + }; + extraConfig = { + "richTextBannerDismissed" = true; + "newNoteFocus" = "title"; + }; + }; + + test.stubs.joplin-desktop = { }; + + nmt.script = '' + assertFileContains activate \ + '/home/hm-user/.config/joplin-desktop/settings.json' + + generated="$(grep -o '/nix/store/.*-joplin-settings.json' $TESTED/activate)" + diff -u "$generated" ${./basic-configuration.json} + ''; +} diff --git a/tests/modules/programs/joplin-desktop/default.nix b/tests/modules/programs/joplin-desktop/default.nix new file mode 100644 index 000000000000..3ccd7320bc83 --- /dev/null +++ b/tests/modules/programs/joplin-desktop/default.nix @@ -0,0 +1 @@ +{ joplin-desktop-basic-configuration = ./basic-configuration.nix; } From 2f0db7d418e781354d8a3c50e611e3b1cd413087 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 13 Mar 2024 18:11:23 +0100 Subject: [PATCH 123/636] joplin-desktop: fix maintainer field --- modules/programs/joplin-desktop.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/joplin-desktop.nix b/modules/programs/joplin-desktop.nix index fe46ebad180f..bbf9e400d783 100644 --- a/modules/programs/joplin-desktop.nix +++ b/modules/programs/joplin-desktop.nix @@ -10,7 +10,7 @@ let configPath = "${config.xdg.configHome}/joplin-desktop/settings.json"; in { - meta.maintainers = [ lib.maintainers.zorrobert ]; + meta.maintainers = [ lib.hm.maintainers.zorrobert ]; options.programs.joplin-desktop = { enable = lib.mkEnableOption "joplin-desktop"; From 01e4a5143e92251272850a8e0fbb4518bd099087 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 14 Jan 2024 17:09:06 +0000 Subject: [PATCH 124/636] gpg-agent: migrate to 'pinentryPackage' This follows upstream's module change [1], which allows setting any package as a pinentry program. [1]: https://github.com/NixOS/nixpkgs/pull/133542 --- modules/misc/news.nix | 9 +++++++++ modules/services/gpg-agent.nix | 16 ++++++++++------ .../services/gpg-agent/default-homedir.nix | 2 +- .../services/gpg-agent/override-homedir.nix | 2 +- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 849ac94210b5..0b8588616add 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1443,6 +1443,15 @@ in { A new module is available: 'programs.joplin-desktop'. ''; } + + { + time = "2024-03-14T07:22:09+00:00"; + condition = config.services.gpg-agent.enable; + message = '' + 'services.gpg-agent.pinentryFlavor' has been removed and replaced by + 'services.gpg-agent.pinentryPackage'. + ''; + } ]; }; } diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index 685698b774a2..a5d89415741f 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -81,6 +81,11 @@ let in { meta.maintainers = [ maintainers.rycee ]; + imports = [ + (mkRemovedOptionModule [ "services" "gpg-agent" "pinentryFlavor" ] + "Use services.gpg-agent.pinentryPackage instead") + ]; + options = { services.gpg-agent = { enable = mkEnableOption "GnuPG private key agent"; @@ -192,10 +197,9 @@ in { configuration file. ''; }; - - pinentryFlavor = mkOption { - type = types.nullOr (types.enum pkgs.pinentry.flavors); - example = "gnome3"; + pinentryPackage = mkOption { + type = types.nullOr types.package; + example = literalExpression "pkgs.pinentry-gnome3"; default = null; description = '' Which pinentry interface to use. If not @@ -243,8 +247,8 @@ in { "max-cache-ttl ${toString cfg.maxCacheTtl}" ++ optional (cfg.maxCacheTtlSsh != null) "max-cache-ttl-ssh ${toString cfg.maxCacheTtlSsh}" - ++ optional (cfg.pinentryFlavor != null) - "pinentry-program ${pkgs.pinentry.${cfg.pinentryFlavor}}/bin/pinentry" + ++ optional (cfg.pinentryPackage != null) + "pinentry-program ${lib.getExe pinentryPackage}" ++ [ cfg.extraConfig ]); home.sessionVariablesExtra = optionalString cfg.enableSshSupport '' diff --git a/tests/modules/services/gpg-agent/default-homedir.nix b/tests/modules/services/gpg-agent/default-homedir.nix index 9e21eb6dba27..29efddac427d 100644 --- a/tests/modules/services/gpg-agent/default-homedir.nix +++ b/tests/modules/services/gpg-agent/default-homedir.nix @@ -5,7 +5,7 @@ with lib; { config = { services.gpg-agent.enable = true; - services.gpg-agent.pinentryFlavor = null; # Don't build pinentry package. + services.gpg-agent.pinentryPackage = null; # Don't build pinentry package. programs.gpg.enable = true; test.stubs.gnupg = { }; diff --git a/tests/modules/services/gpg-agent/override-homedir.nix b/tests/modules/services/gpg-agent/override-homedir.nix index 1a314e41436e..c50786739681 100644 --- a/tests/modules/services/gpg-agent/override-homedir.nix +++ b/tests/modules/services/gpg-agent/override-homedir.nix @@ -5,7 +5,7 @@ with lib; { config = { services.gpg-agent.enable = true; - services.gpg-agent.pinentryFlavor = null; # Don't build pinentry package. + services.gpg-agent.pinentryPackage = null; # Don't build pinentry package. programs.gpg = { enable = true; homedir = "/path/to/hash"; From 1ab3cec3a1bbb065b2d52b913d1431366028d5b5 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sun, 10 Mar 2024 10:24:45 +0000 Subject: [PATCH 125/636] rbw: simplify 'pinentry' type Following some upstream changes [1], it's now possible to use a simplified package type for the option. [1]: https://github.com/NixOS/nixpkgs/pull/133542 --- modules/misc/news.nix | 9 +++++++++ modules/programs/rbw.nix | 16 +++++----------- tests/modules/programs/rbw/rbw-stubs.nix | 8 ++------ tests/modules/programs/rbw/settings.nix | 4 ++-- tests/modules/programs/rbw/simple-settings.nix | 2 +- 5 files changed, 19 insertions(+), 20 deletions(-) diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 0b8588616add..c4a19177b707 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1452,6 +1452,15 @@ in { 'services.gpg-agent.pinentryPackage'. ''; } + + { + time = "2024-03-14T07:22:59+00:00"; + condition = config.programs.rbw.enable; + message = '' + 'programs.rbw.pinentry' has been simplified to only accept 'null' or + a package. + ''; + } ]; }; } diff --git a/modules/programs/rbw.nix b/modules/programs/rbw.nix index b6369dbc455f..5dd751d07ce4 100644 --- a/modules/programs/rbw.nix +++ b/modules/programs/rbw.nix @@ -41,9 +41,9 @@ let }; pinentry = mkOption { - type = with types; either package (enum pkgs.pinentry.flavors); - example = "gnome3"; - default = "gtk2"; + type = types.nullOr types.package; + example = literalExpression "pkgs.pinentry-gnome3"; + default = null; description = '' Which pinentry interface to use. Beware that `pinentry-gnome3` may not work on non-Gnome @@ -52,15 +52,9 @@ let ```nix services.dbus.packages = [ pkgs.gcr ]; ``` - For this reason, the default is `gtk2` for - now. ''; # we want the program in the config - apply = val: - if builtins.isString val then - "${pkgs.pinentry.${val}}/bin/pinentry" - else - "${val}/${val.binaryPath or "bin/pinentry"}"; + apply = val: if val == null then val else lib.getExe val; }; }; }; @@ -87,7 +81,7 @@ in { { email = "name@example.com"; lock_timeout = 300; - pinentry = "gnome3"; + pinentry = pkgs.pinentry-gnome3; } ''; description = '' diff --git a/tests/modules/programs/rbw/rbw-stubs.nix b/tests/modules/programs/rbw/rbw-stubs.nix index c48d88be6103..77436232dcf3 100644 --- a/tests/modules/programs/rbw/rbw-stubs.nix +++ b/tests/modules/programs/rbw/rbw-stubs.nix @@ -5,12 +5,8 @@ nixpkgs.overlays = [ (self: super: { - pinentry = { - gnome3 = - config.lib.test.mkStubPackage { outPath = "@pinentry-gnome3@"; }; - gtk2 = config.lib.test.mkStubPackage { outPath = "@pinentry-gtk2@"; }; - flavors = [ "gnome3" "gtk2" ]; - }; + pinentry-gnome3 = + config.lib.test.mkStubPackage { outPath = "@pinentry-gnome3@"; }; }) ]; } diff --git a/tests/modules/programs/rbw/settings.nix b/tests/modules/programs/rbw/settings.nix index 8cf9572bb551..ac5820186398 100644 --- a/tests/modules/programs/rbw/settings.nix +++ b/tests/modules/programs/rbw/settings.nix @@ -14,7 +14,7 @@ let "email": "name@example.com", "identity_url": "identity.example.com", "lock_timeout": 300, - "pinentry": "@pinentry-gnome3@/bin/pinentry" + "pinentry": "@pinentry-gnome3@/bin/dummy" } ''; in { @@ -27,7 +27,7 @@ in { base_url = "bitwarden.example.com"; identity_url = "identity.example.com"; lock_timeout = 300; - pinentry = "gnome3"; + pinentry = pkgs.pinentry-gnome3; }; }; diff --git a/tests/modules/programs/rbw/simple-settings.nix b/tests/modules/programs/rbw/simple-settings.nix index becf9fad197c..b690659a95fe 100644 --- a/tests/modules/programs/rbw/simple-settings.nix +++ b/tests/modules/programs/rbw/simple-settings.nix @@ -14,7 +14,7 @@ let "email": "name@example.com", "identity_url": null, "lock_timeout": 3600, - "pinentry": "@pinentry-gtk2@/bin/pinentry" + "pinentry": null } ''; in { From 587719494ed18a184c98c4d55dde9469af4446bf Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Thu, 14 Mar 2024 05:01:39 -0400 Subject: [PATCH 126/636] gpg-agent: fix broken variable reference --- modules/services/gpg-agent.nix | 2 +- tests/modules/services/gpg-agent/default-homedir.nix | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index a5d89415741f..509adfa54609 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -248,7 +248,7 @@ in { ++ optional (cfg.maxCacheTtlSsh != null) "max-cache-ttl-ssh ${toString cfg.maxCacheTtlSsh}" ++ optional (cfg.pinentryPackage != null) - "pinentry-program ${lib.getExe pinentryPackage}" + "pinentry-program ${lib.getExe cfg.pinentryPackage}" ++ [ cfg.extraConfig ]); home.sessionVariablesExtra = optionalString cfg.enableSshSupport '' diff --git a/tests/modules/services/gpg-agent/default-homedir.nix b/tests/modules/services/gpg-agent/default-homedir.nix index 29efddac427d..e23de764da05 100644 --- a/tests/modules/services/gpg-agent/default-homedir.nix +++ b/tests/modules/services/gpg-agent/default-homedir.nix @@ -5,11 +5,14 @@ with lib; { config = { services.gpg-agent.enable = true; - services.gpg-agent.pinentryPackage = null; # Don't build pinentry package. + services.gpg-agent.pinentryPackage = pkgs.pinentry-gnome3; programs.gpg.enable = true; - test.stubs.gnupg = { }; - test.stubs.systemd = { }; # depends on gnupg.override + test.stubs = { + gnupg = { }; + systemd = { }; # depends on gnupg.override + pinentry-gnome3 = { }; + }; nmt.script = '' in="${config.systemd.user.sockets.gpg-agent.Socket.ListenStream}" @@ -18,6 +21,9 @@ with lib; echo $in fail "gpg-agent socket directory not set to default value" fi + + configFile=home-files/.gnupg/gpg-agent.conf + assertFileRegex $configFile "pinentry-program @pinentry-gnome3@/bin/dummy" ''; }; } From bd9141ea97d8ccd68b97aa2febfae44683881662 Mon Sep 17 00:00:00 2001 From: zorrobert <118135271+zorrobert@users.noreply.github.com> Date: Fri, 23 Feb 2024 13:25:32 +0100 Subject: [PATCH 127/636] fusuma: add missing dependencies --- modules/services/fusuma.nix | 12 ++++++------ .../modules/services/fusuma/expected-service.service | 4 ++-- tests/modules/services/fusuma/service.nix | 1 + tests/modules/services/fusuma/settings.nix | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/services/fusuma.nix b/modules/services/fusuma.nix index e0ced97693a4..17d8b14311ca 100644 --- a/modules/services/fusuma.nix +++ b/modules/services/fusuma.nix @@ -96,10 +96,11 @@ in { extraPackages = mkOption { type = types.listOf types.package; - default = with pkgs; [ coreutils ]; - defaultText = literalExpression "pkgs.coreutils"; + default = with pkgs; [ xdotool coreutils xorg.xprop ]; + defaultText = + literalExpression "pkgs.xdotool pkgs.coreutils pkgs.xorg.xprop"; example = literalExpression '' - with pkgs; [ coreutils xdotool ]; + with pkgs; [ xdotool coreutils xorg.xprop ]; ''; description = '' Extra packages needs to bring to the scope of fusuma service. @@ -113,7 +114,7 @@ in { lib.platforms.linux) ]; - xdg.configFile."fusuma/config.yaml".source = configYaml; + xdg.configFile."fusuma/config.yml".source = configYaml; systemd.user.services.fusuma = { Unit = { @@ -124,8 +125,7 @@ in { Service = { Environment = with pkgs; "PATH=${makeBinPath cfg.extraPackages}"; - ExecStart = - "${cfg.package}/bin/fusuma -c ${config.xdg.configHome}/fusuma/config.yaml"; + ExecStart = "${cfg.package}/bin/fusuma"; }; Install = { WantedBy = [ "graphical-session.target" ]; }; diff --git a/tests/modules/services/fusuma/expected-service.service b/tests/modules/services/fusuma/expected-service.service index a86627f4c592..585d8a85eafc 100644 --- a/tests/modules/services/fusuma/expected-service.service +++ b/tests/modules/services/fusuma/expected-service.service @@ -2,8 +2,8 @@ WantedBy=graphical-session.target [Service] -Environment=PATH=@coreutils@/bin:@xdotool@/bin -ExecStart=@fusuma@/bin/fusuma -c /home/hm-user/.config/fusuma/config.yaml +Environment=PATH=@coreutils@/bin:@xdotool@/bin:@xorg.xprop@/bin +ExecStart=@fusuma@/bin/fusuma [Unit] After=graphical-session-pre.target diff --git a/tests/modules/services/fusuma/service.nix b/tests/modules/services/fusuma/service.nix index d02a75f52eee..8041bf7b80de 100644 --- a/tests/modules/services/fusuma/service.nix +++ b/tests/modules/services/fusuma/service.nix @@ -7,6 +7,7 @@ extraPackages = [ (config.lib.test.mkStubPackage { outPath = "@coreutils@"; }) (config.lib.test.mkStubPackage { outPath = "@xdotool@"; }) + (config.lib.test.mkStubPackage { outPath = "@xorg.xprop@"; }) ]; settings = { }; }; diff --git a/tests/modules/services/fusuma/settings.nix b/tests/modules/services/fusuma/settings.nix index 303a132725e3..a1500cb216c1 100644 --- a/tests/modules/services/fusuma/settings.nix +++ b/tests/modules/services/fusuma/settings.nix @@ -18,7 +18,7 @@ nmt.script = '' assertFileContent \ - home-files/.config/fusuma/config.yaml \ + home-files/.config/fusuma/config.yml \ ${./expected-settings.yaml} ''; } From ec4096e9000c0b3695c05576076449ad99e905e3 Mon Sep 17 00:00:00 2001 From: Sagi Sarussi <39622904+tuxiqae@users.noreply.github.com> Date: Thu, 14 Mar 2024 19:54:58 +0000 Subject: [PATCH 128/636] eza: fix typo in docs Changes "rograms.eza.enableAliases" to "programs.eza.enableAliases". --- modules/programs/eza.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/eza.nix b/modules/programs/eza.nix index 3c244071fd8a..2a297b25480d 100644 --- a/modules/programs/eza.nix +++ b/modules/programs/eza.nix @@ -9,7 +9,7 @@ with lib; options per shell, for example, 'programs.eza.enableBashIntegration'. Note, the default for these options is 'true' so if you want to enable the - aliases you can simply remove 'rograms.eza.enableAliases' from your + aliases you can simply remove 'programs.eza.enableAliases' from your configuration.''; mkRenamed = opt: mkRenamedOptionModule [ "programs" "exa" opt ] [ "programs" "eza" opt ]; From 601c22f8af61b9a2e47001474c595c78771aa3b2 Mon Sep 17 00:00:00 2001 From: RepentantKnight121 Date: Thu, 14 Mar 2024 10:01:44 +0100 Subject: [PATCH 129/636] Translate using Weblate (Vietnamese) Currently translated at 8.3% (3 of 36 strings) Co-authored-by: RepentantKnight121 Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/vi/ Translation: Home Manager/Home Manager CLI --- home-manager/po/vi.po | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/home-manager/po/vi.po b/home-manager/po/vi.po index 44353875574b..bfa67459b067 100644 --- a/home-manager/po/vi.po +++ b/home-manager/po/vi.po @@ -8,18 +8,20 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2024-03-14 09:01+0000\n" +"Last-Translator: RepentantKnight121 \n" +"Language-Team: Vietnamese \n" "Language: vi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5-dev\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" -msgstr "" +msgstr "Không tìm thấy tập tin cấu hình tại %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. @@ -36,7 +38,7 @@ msgstr "" #: home-manager/home-manager:101 msgid "Home Manager not found at %s." -msgstr "" +msgstr "Home Manager not found at %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:109 @@ -125,7 +127,7 @@ msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:488 msgid "Can't instantiate a flake configuration" -msgstr "" +msgstr "Không thể khởi tạo cấu hình flake" #: home-manager/home-manager:564 msgid "" From 35536fc6d621a084b04a70a6478db2aebbe828ed Mon Sep 17 00:00:00 2001 From: nbelakovski Date: Mon, 11 Mar 2024 23:07:12 -0700 Subject: [PATCH 130/636] docs: update beets and description of overriding packages The beets package no longer has the "enableCheck" option so this was confusing. Also the word override was used to mean two different things so I modified the FAQ to use the word "change" and linked to documentation regarding package overrides. --- docs/manual/faq.md | 2 +- ...age-module.md => change-package-module.md} | 30 ++++++++++++++++--- modules/programs/beets.nix | 4 +-- 3 files changed, 29 insertions(+), 7 deletions(-) rename docs/manual/faq/{override-package-module.md => change-package-module.md} (53%) diff --git a/docs/manual/faq.md b/docs/manual/faq.md index bc50174d573e..ea308f78830a 100644 --- a/docs/manual/faq.md +++ b/docs/manual/faq.md @@ -6,5 +6,5 @@ faq/session-variables.md faq/multiple-users-machines.md faq/ca-desrt-dconf.md faq/unstable.md -faq/override-package-module.md +faq/change-package-module.md ``` diff --git a/docs/manual/faq/override-package-module.md b/docs/manual/faq/change-package-module.md similarity index 53% rename from docs/manual/faq/override-package-module.md rename to docs/manual/faq/change-package-module.md index 60b847625cd4..bcb943bafbc7 100644 --- a/docs/manual/faq/override-package-module.md +++ b/docs/manual/faq/change-package-module.md @@ -1,4 +1,4 @@ -# How do I override the package used by a module? {#_how_do_i_override_the_package_used_by_a_module} +# How do I change the package used by a module? {#_how_do_i_change_the_package_used_by_a_module} By default Home Manager will install the package provided by your chosen `nixpkgs` channel but occasionally you might end up needing to change @@ -6,13 +6,35 @@ this package. This can typically be done in two ways. 1. If the module provides a `package` option, such as `programs.beets.package`, then this is the recommended way to - perform the override. For example, + perform the change. For example, ``` nix - programs.beets.package = pkgs.beets.override { enableCheck = true; }; + programs.beets.package = pkgs.beets.override { pluginOverrides = { beatport.enable = false; }; }; ``` -2. If no `package` option is available then you can typically override + See [Nix pill 17](https://nixos.org/guides/nix-pills/nixpkgs-overriding-packages.html) + for more information on package overrides. Alternatively, if you want + to use the `beets` package from Nixpkgs unstable, then a configuration like + + ``` nix + { pkgs, config, ... }: + + let + + pkgsUnstable = import {}; + + in + + { + programs.beets.package = pkgsUnstable.beets; + + # … + } + ``` + + should work OK. + +3. If no `package` option is available then you can typically change the relevant package using an [overlay](https://nixos.org/nixpkgs/manual/#chap-overlays). diff --git a/modules/programs/beets.nix b/modules/programs/beets.nix index dab98c30193a..5a2b97f331de 100644 --- a/modules/programs/beets.nix +++ b/modules/programs/beets.nix @@ -32,8 +32,8 @@ in { type = types.package; default = pkgs.beets; defaultText = literalExpression "pkgs.beets"; - example = - literalExpression "(pkgs.beets.override { enableCheck = true; })"; + example = literalExpression + "(pkgs.beets.override { pluginOverrides = { beatport.enable = false; }; })"; description = '' The `beets` package to use. Can be used to specify extensions. From 096d9c04b3e9438855aa65e24129b97a998bd3d9 Mon Sep 17 00:00:00 2001 From: Kylie McClain Date: Thu, 18 Jan 2024 12:13:01 -0500 Subject: [PATCH 131/636] qutebrowser: actually implement unbinding The documentation for the option says... > If you want a default binding to be passed through to the website, > bind it to null. but if you actually try to set a key to `null`, it causes an error. > A definition for option > `programs.qutebrowser.keyBindings."".normal' is not > of type `strings concatenated with " ;; "'. So this commit implements unbinding as it is documented. --- modules/programs/qutebrowser.nix | 9 ++++++--- tests/modules/programs/qutebrowser/keybindings.nix | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/modules/programs/qutebrowser.nix b/modules/programs/qutebrowser.nix index b6cc41ead8af..9c3ad6a86b81 100644 --- a/modules/programs/qutebrowser.nix +++ b/modules/programs/qutebrowser.nix @@ -9,7 +9,7 @@ let formatLine = o: n: v: let formatValue = v: - if builtins.isNull v then + if v == null then "None" else if builtins.isBool v then (if v then "True" else "False") @@ -29,7 +29,10 @@ let formatKeyBindings = m: b: let formatKeyBinding = m: k: c: - ''config.bind("${k}", "${escape [ ''"'' ] c}", mode="${m}")''; + if c == null then + ''config.unbind("${k}", mode="${m}")'' + else + ''config.bind("${k}", "${escape [ ''"'' ] c}", mode="${m}")''; in concatStringsSep "\n" (mapAttrsToList (formatKeyBinding m) b); formatQuickmarks = n: s: "${n} ${s}"; @@ -131,7 +134,7 @@ in { }; keyBindings = mkOption { - type = with types; attrsOf (attrsOf (separatedString " ;; ")); + type = with types; attrsOf (attrsOf (nullOr (separatedString " ;; "))); default = { }; description = '' Key bindings mapping keys to commands in different modes. This setting diff --git a/tests/modules/programs/qutebrowser/keybindings.nix b/tests/modules/programs/qutebrowser/keybindings.nix index 00e730efa147..37ccfeba3dea 100644 --- a/tests/modules/programs/qutebrowser/keybindings.nix +++ b/tests/modules/programs/qutebrowser/keybindings.nix @@ -8,6 +8,7 @@ keyBindings = { normal = { + ":" = null; "" = "spawn mpv {url}"; ",l" = ''config-cycle spellcheck.languages ["en-GB"] ["en-US"]''; "" = lib.mkMerge [ @@ -35,6 +36,7 @@ config.load_autoconfig(False) c.bindings.default = {} config.bind(",l", "config-cycle spellcheck.languages [\"en-GB\"] [\"en-US\"]", mode="normal") + config.unbind(":", mode="normal") config.bind("", "spawn mpv {url}", mode="normal") config.bind("", "config-cycle tabs.show never always ;; config-cycle statusbar.show in-mode always ;; config-cycle scrolling.bar never always", mode="normal") config.bind("", "prompt-yes", mode="prompt")'' From 029545350c013721e12139c9102f1776ca8aa9bb Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 4 Aug 2023 19:56:37 +0800 Subject: [PATCH 132/636] activitywatch: add module --- modules/misc/news.nix | 8 + modules/modules.nix | 1 + modules/services/activitywatch.nix | 266 ++++++++++++++++++ tests/default.nix | 1 + .../services/activitywatch/basic-setup.nix | 53 ++++ .../services/activitywatch/default.nix | 4 + .../activitywatch/empty-server-settings.nix | 14 + 7 files changed, 347 insertions(+) create mode 100644 modules/services/activitywatch.nix create mode 100644 tests/modules/services/activitywatch/basic-setup.nix create mode 100644 tests/modules/services/activitywatch/default.nix create mode 100644 tests/modules/services/activitywatch/empty-server-settings.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index c4a19177b707..70a943de3324 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1461,6 +1461,14 @@ in { a package. ''; } + + { + time = "2024-03-15T08:39:52+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.activitywatch'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index fc8154e98e24..cd4abb722241 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -256,6 +256,7 @@ let ./programs/zsh/prezto.nix ./programs/zsh/zsh-abbr.nix ./services/arrpc.nix + ./services/activitywatch.nix ./services/autorandr.nix ./services/avizo.nix ./services/barrier.nix diff --git a/modules/services/activitywatch.nix b/modules/services/activitywatch.nix new file mode 100644 index 000000000000..ac80725776fd --- /dev/null +++ b/modules/services/activitywatch.nix @@ -0,0 +1,266 @@ +{ config, options, lib, pkgs, ... }: + +let + inherit (lib) mkOption; + + cfg = config.services.activitywatch; + + mkWatcherService = name: cfg: + let jobName = "activitywatch-watcher-${cfg.name}"; + in lib.nameValuePair jobName { + Unit = { + Description = "ActivityWatch watcher '${cfg.name}'"; + After = [ "activitywatch.service" ]; + BindsTo = [ "activitywatch.target" ]; + }; + + Service = { + ExecStart = "${lib.getExe' cfg.package cfg.executable} ${ + lib.escapeShellArgs cfg.extraOptions + }"; + + # Some sandboxing. + LockPersonality = true; + NoNewPrivileges = true; + RestrictNamespaces = true; + }; + + Install.WantedBy = [ "activitywatch.target" ]; + }; + + # Most ActivityWatch client libraries has a function that loads with a + # certain configuration format for all watchers and itself which is nice for + # us but watchers can load configuration in any location. We just hope + # they're following it. + watcherSettingsFormat = pkgs.formats.toml { }; + + # The module interface for the watchers. + watcherType = { name, config, options, ... }: { + options = { + name = mkOption { + type = lib.types.str; + default = name; + example = "aw-watcher-afk"; + description = '' + The name of the watcher. This will be used as the directory name for + {file}`$XDG_CONFIG_HOME/activitywatch/$NAME` when + {option}`services.activitywatch.watchers..settings` is set. + ''; + }; + + package = mkOption { + type = lib.types.package; + example = lib.literalExpression "pkgs.activitywatch"; + description = '' + The derivation containing the watcher executable. + ''; + }; + + executable = mkOption { + type = lib.types.str; + default = config.name; + description = '' + The name of the executable of the watcher. This is useful in case the + watcher name is different from the executable. By default, this + option uses the watcher name. + ''; + }; + + settings = mkOption { + type = watcherSettingsFormat.type; + default = { }; + example = { + timeout = 300; + poll_time = 2; + }; + description = '' + The settings for the individual watcher in TOML format. If set, a + file will be generated at + {file}`$XDG_CONFIG_HOME/activitywatch/$NAME/$FILENAME`. + + To set the basename of the settings file, see + [](#opt-services.activitywatch.watchers._name_.settingsFilename). + ''; + }; + + settingsFilename = mkOption { + type = lib.types.str; + default = "${config.name}.toml"; + example = "config.toml"; + description = '' + The filename of the generated settings file. By default, this uses + the watcher name to be generated at + {file}`$XDG_CONFIG_HOME/activitywatch/$NAME/$NAME.toml`. + + This is useful in case the watcher requires a different name for the + configuration file. + ''; + }; + + extraOptions = mkOption { + type = with lib.types; listOf str; + default = [ ]; + example = [ "--host" "127.0.0.1" ]; + description = '' + Extra arguments to be passed to the watcher executable. + ''; + }; + }; + }; + + generateWatchersConfig = name: cfg: + let + # We're only assuming the generated filepath this since most watchers + # uses the ActivityWatch client library which has `load_config_toml` + # utility function for easily loading the configuration files. + filename = "activitywatch/${cfg.name}/${cfg.settingsFilename}"; + in lib.nameValuePair filename (lib.mkIf (cfg.settings != { }) { + source = watcherSettingsFormat.generate + "activitywatch-watcher-${cfg.name}-settings" cfg.settings; + }); +in { + meta.maintainers = with lib.maintainers; [ foo-dogsquared ]; + + options.services.activitywatch = { + enable = lib.mkEnableOption "ActivityWatch, an automated time tracker"; + + package = mkOption { + description = '' + Package containing [the Rust implementation of ActivityWatch + server](https://github.com/ActivityWatch/aw-server-rust). + ''; + type = lib.types.package; + default = pkgs.activitywatch; + defaultText = lib.literalExpression "pkgs.activitywatch"; + example = lib.literalExpression "pkgs.aw-server-rust"; + }; + + settings = mkOption { + description = '' + Configuration for `aw-server-rust` to be generated at + {file}`$XDG_CONFIG_HOME/activitywatch/aw-server-rust/config.toml`. + ''; + type = watcherSettingsFormat.type; + default = { }; + example = lib.literalExpression '' + { + port = 3012; + + custom_static = { + my-custom-watcher = "''${pkgs.my-custom-watcher}/share/my-custom-watcher/static"; + aw-keywatcher = "''${pkgs.aw-keywatcher}/share/aw-keywatcher/static"; + }; + } + ''; + }; + + extraOptions = mkOption { + description = '' + Additional arguments to be passed on to the ActivityWatch server. + ''; + type = with lib.types; listOf str; + default = [ ]; + example = [ "--port" "5999" ]; + }; + + watchers = mkOption { + description = '' + Watchers to be included with the service alongside with their + configuration. + + If a configuration is set, a file will be generated in + {file}`$XDG_CONFIG_HOME/activitywatch/$WATCHER_NAME/$WATCHER_SETTINGS_FILENAME`. + + ::: {.note} + The watchers are run with the service manager and the settings format + of the configuration is only assumed to be in TOML. Furthermore, it + assumes the watcher program is using the official client libraries + which has functions to store it in the appropriate location. + ::: + ''; + type = with lib.types; attrsOf (submodule watcherType); + default = { }; + example = lib.literalExpression '' + { + aw-watcher-afk = { + package = pkgs.activitywatch; + settings = { + timeout = 300; + poll_time = 2; + }; + }; + + aw-watcher-windows = { + package = pkgs.activitywatch; + settings = { + poll_time = 1; + exclude_title = true; + }; + }; + + my-custom-watcher = { + package = pkgs.my-custom-watcher; + executable = "mcw"; + settings = { + hello = "there"; + enable_greetings = true; + poll_time = 5; + }; + settingsFilename = "config.toml"; + }; + } + ''; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.activitywatch" pkgs + lib.platforms.linux) + ]; + + # We'll group these services with a target to make it easier to manage for + # the maintainers and the user. Win-win. + systemd.user.targets.activitywatch = { + Unit = { + Description = "ActivityWatch server"; + Requires = [ "default.target" ]; + After = [ "default.target" ]; + }; + + Install.WantedBy = [ "default.target" ]; + }; + + systemd.user.services = lib.mapAttrs' mkWatcherService cfg.watchers // { + activitywatch = { + Unit = { + Description = "ActivityWatch time tracker server"; + Documentation = [ "https://docs.activitywatch.net" ]; + BindsTo = [ "activitywatch.target" ]; + }; + + Service = { + ExecStart = "${lib.getExe' cfg.package "aw-server"} ${ + lib.escapeShellArgs cfg.extraOptions + }"; + Restart = "on-failure"; + + # Some sandboxing. + LockPersonality = true; + NoNewPrivileges = true; + RestrictNamespaces = true; + }; + + Install.WantedBy = [ "activitywatch.target" ]; + }; + }; + + xdg.configFile = lib.mapAttrs' generateWatchersConfig cfg.watchers + // lib.optionalAttrs (cfg.settings != { }) { + "activitywatch/aw-server-rust/config.toml" = { + source = watcherSettingsFormat.generate + "activitywatch-server-rust-config.toml" cfg.settings; + }; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 84ea67ded019..6ba9122957d3 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -211,6 +211,7 @@ in import nmtSrc { ./modules/programs/wpaperd ./modules/programs/xmobar ./modules/programs/yt-dlp + ./modules/services/activitywatch ./modules/services/avizo ./modules/services/barrier ./modules/services/borgmatic diff --git a/tests/modules/services/activitywatch/basic-setup.nix b/tests/modules/services/activitywatch/basic-setup.nix new file mode 100644 index 000000000000..d3a14ae87506 --- /dev/null +++ b/tests/modules/services/activitywatch/basic-setup.nix @@ -0,0 +1,53 @@ +{ config, ... }: + +let stubPackage = config.lib.test.mkStubPackage { }; + +in { + services.activitywatch = { + enable = true; + settings = { + port = 3012; + custom_static = { custom-watcher = stubPackage; }; + }; + watchers = { + # These are basically examples of a real world usage. + aw-watcher-afk.package = stubPackage; + aw-watcher-window.package = stubPackage; + + custom-watcher = { + package = stubPackage; + settings = { + foo = "bar"; + baz = 8; + }; + settingsFilename = "config.toml"; + }; + + another-custom-watcher = { + package = stubPackage; + settings = { + hello = "there"; + world = "plan"; + }; + }; + }; + }; + + nmt.script = '' + # Basic check for the bare setup. + assertFileExists home-files/.config/systemd/user/activitywatch.service + assertFileExists home-files/.config/systemd/user/activitywatch.target + + # Basic check for the watchers setup. + assertFileExists home-files/.config/systemd/user/activitywatch-watcher-aw-watcher-afk.service + assertFileExists home-files/.config/systemd/user/activitywatch-watcher-aw-watcher-window.service + + # Checking for the generated configurations (and the ones that is not + # supposed to exist). + assertFileExists home-files/.config/activitywatch/aw-server-rust/config.toml + assertFileExists home-files/.config/activitywatch/custom-watcher/config.toml + assertFileExists home-files/.config/activitywatch/another-custom-watcher/another-custom-watcher.toml + assertPathNotExists home-files/.config/activitywatch/aw-watcher-afk/aw-watcher-afk.toml + assertPathNotExists home-files/.config/activitywatch/aw-watcher-window/aw-watcher-window.toml + ''; +} diff --git a/tests/modules/services/activitywatch/default.nix b/tests/modules/services/activitywatch/default.nix new file mode 100644 index 000000000000..3b3f432171c1 --- /dev/null +++ b/tests/modules/services/activitywatch/default.nix @@ -0,0 +1,4 @@ +{ + activitywatch-basic-setup = ./basic-setup.nix; + activitywatch-empty-server-settings = ./empty-server-settings.nix; +} diff --git a/tests/modules/services/activitywatch/empty-server-settings.nix b/tests/modules/services/activitywatch/empty-server-settings.nix new file mode 100644 index 000000000000..89c65b1f0d17 --- /dev/null +++ b/tests/modules/services/activitywatch/empty-server-settings.nix @@ -0,0 +1,14 @@ +{ ... }: + +{ + services.activitywatch.enable = true; + + test.stubs.activitywatch = { }; + + nmt.script = '' + assertFileExists home-files/.config/systemd/user/activitywatch.service + assertFileExists home-files/.config/systemd/user/activitywatch.target + + assertPathNotExists home-files/.config/activitywatch/aw-server-rust/config.toml + ''; +} From ca922258e1682b435e632a5ca1910bbbed835345 Mon Sep 17 00:00:00 2001 From: Patrick Widmer Date: Sat, 11 Nov 2023 10:19:45 +0100 Subject: [PATCH 133/636] senpai: switch to scfg format --- modules/lib/generators.nix | 93 +++++++++++++++++++ modules/programs/senpai.nix | 68 ++++++++++---- tests/default.nix | 1 + tests/lib/generators/default.nix | 6 +- tests/lib/generators/tokdl.nix | 4 +- tests/lib/generators/toscfg-empty-result.txt | 0 tests/lib/generators/toscfg-empty.nix | 11 +++ .../generators/toscfg-err-dir-empty-name.nix | 12 +++ .../lib/generators/toscfg-example-result.txt | 10 ++ tests/lib/generators/toscfg-example.nix | 24 +++++ tests/modules/programs/senpai/default.nix | 4 + .../senpai/empty-settings-expected.conf | 2 + .../programs/senpai/empty-settings.nix | 20 ++++ .../senpai/example-settings-expected.conf | 13 +++ .../programs/senpai/example-settings.nix | 27 ++++++ 15 files changed, 275 insertions(+), 20 deletions(-) create mode 100644 tests/lib/generators/toscfg-empty-result.txt create mode 100644 tests/lib/generators/toscfg-empty.nix create mode 100644 tests/lib/generators/toscfg-err-dir-empty-name.nix create mode 100644 tests/lib/generators/toscfg-example-result.txt create mode 100644 tests/lib/generators/toscfg-example.nix create mode 100644 tests/modules/programs/senpai/default.nix create mode 100644 tests/modules/programs/senpai/empty-settings-expected.conf create mode 100644 tests/modules/programs/senpai/empty-settings.nix create mode 100644 tests/modules/programs/senpai/example-settings-expected.conf create mode 100644 tests/modules/programs/senpai/example-settings.nix diff --git a/modules/lib/generators.nix b/modules/lib/generators.nix index 98a03ba21077..9cb0e1cf9006 100644 --- a/modules/lib/generators.nix +++ b/modules/lib/generators.nix @@ -99,4 +99,97 @@ in attrs: '' ${concatStringsSep "\n" (mapAttrsToList convertAttributeToKDL attrs)} ''; + + toSCFG = { }: + let + inherit (lib) concatStringsSep mapAttrsToList any; + inherit (builtins) typeOf replaceStrings elem; + + # ListOf String -> String + indentStrings = let + # Although the input of this function is a list of strings, + # the strings themselves *will* contain newlines, so you need + # to normalize the list by joining and resplitting them. + unlines = lib.splitString "\n"; + lines = lib.concatStringsSep "\n"; + indentAll = lines: concatStringsSep "\n" (map (x: " " + x) lines); + in stringsWithNewlines: indentAll (unlines (lines stringsWithNewlines)); + + # String -> Bool + specialChars = s: + any (char: elem char (reserved ++ [ " " "'" "{" "}" ])) + (lib.stringToCharacters s); + + # String -> String + sanitizeString = + replaceStrings reserved [ ''\"'' "\\\\" "\\r" "\\n" "\\t" ]; + + reserved = [ ''"'' "\\" "\r" "\n" " " ]; + + # OneOf [Int Float String Bool] -> String + literalValueToString = element: + lib.throwIfNot (elem (typeOf element) [ "int" "float" "string" "bool" ]) + "Cannot convert value of type ${typeOf element} to SCFG literal." + (if element == false then + "false" + else if element == true then + "true" + else if typeOf element == "string" then + if element == "" || specialChars element then + ''"${sanitizeString element}"'' + else + element + else + toString element); + + # Bool -> ListOf (OneOf [Int Float String Bool]) -> String + toOptParamsString = cond: list: + lib.optionalString (cond) (lib.pipe list [ + (map literalValueToString) + (concatStringsSep " ") + (s: " " + s) + ]); + + # Attrset Conversion + # String -> AttrsOf Anything -> String + convertAttrsToSCFG = name: attrs: + let + optParamsString = toOptParamsString (attrs ? "_params") attrs._params; + in '' + ${name}${optParamsString} { + ${indentStrings (convertToAttrsSCFG' attrs)} + }''; + + # Attrset Conversion + # AttrsOf Anything -> ListOf String + convertToAttrsSCFG' = attrs: + mapAttrsToList convertAttributeToSCFG + (lib.filterAttrs (name: val: !isNull val && name != "_params") attrs); + + # List Conversion + # String -> ListOf (OneOf [Int Float String Bool]) -> String + convertListOfFlatAttrsToSCFG = name: list: + let optParamsString = toOptParamsString (list != [ ]) list; + in "${name}${optParamsString}"; + + # Combined Conversion + # String -> Anything -> String + convertAttributeToSCFG = name: value: + lib.throwIf (name == "") "Directive must not be empty" + (let vType = typeOf value; + in if elem vType [ "int" "float" "bool" "string" ] then + "${name} ${literalValueToString value}" + else if vType == "set" then + convertAttrsToSCFG name value + else if vType == "list" then + convertListOfFlatAttrsToSCFG name value + else + throw '' + Cannot convert type `(${typeOf value})` to SCFG: + ${name} = ${toString value} + ''); + in attrs: + lib.optionalString (attrs != { }) '' + ${concatStringsSep "\n" (convertToAttrsSCFG' attrs)} + ''; } diff --git a/modules/programs/senpai.nix b/modules/programs/senpai.nix index 24256e764915..1aaac393e82b 100644 --- a/modules/programs/senpai.nix +++ b/modules/programs/senpai.nix @@ -2,9 +2,7 @@ with lib; -let - cfg = config.programs.senpai; - cfgFmt = pkgs.formats.yaml { }; +let cfg = config.programs.senpai; in { options.programs.senpai = { enable = mkEnableOption "senpai"; @@ -16,23 +14,30 @@ in { }; config = mkOption { type = types.submodule { - freeformType = cfgFmt.type; + freeformType = types.attrsOf types.anything; options = { - addr = mkOption { + address = mkOption { type = types.str; description = '' - The address (host[:port]) of the IRC server. senpai uses TLS - connections by default unless you specify no-tls option. TLS - connections default to port 6697, plain-text use port 6667. + The address (`host[:port]`) of the IRC server. senpai uses TLS + connections by default unless you specify tls option to be false. + TLS connections default to port 6697, plain-text use port 6667. + + UR`ircs://`, `irc://`, and `irc+insecure://` URLs are supported, + in which case only the hostname and port parts will be used. If + the scheme is `ircs/irc+insecure`, tls will be overriden and set + to true/false accordingly. ''; }; - nick = mkOption { + + nickname = mkOption { type = types.str; description = '' Your nickname, sent with a NICK IRC message. It mustn't contain spaces or colons (:). ''; }; + password = mkOption { type = types.nullOr types.str; default = null; @@ -41,17 +46,28 @@ in { reside world-readable in the Nix store. ''; }; - no-tls = mkOption { - type = types.bool; - default = false; - description = "Disables TLS encryption."; + + password-cmd = mkOption { + type = types.nullOr (types.listOf types.str); + default = null; + example = [ "gopass" "show" "irc/guest" ]; + description = '' + Alternatively to providing your SASL authentication password + directly in plaintext, you can specify a command to be run to + fetch the password at runtime. This is useful if you store your + passwords in a separate (probably encrypted) file using `gpg` or a + command line password manager such as `pass` or `gopass`. If a + password-cmd is provided, the value of password will be ignored + and the first line of the output of `password-cmd` will be used + for login. + ''; }; }; }; example = literalExpression '' { - addr = "libera.chat:6697"; - nick = "nicholas"; + address = "libera.chat:6697"; + nickname = "nicholas"; password = "verysecurepassword"; } ''; @@ -63,9 +79,27 @@ in { }; config = mkIf cfg.enable { + assertions = with cfg.config; [ + { + assertion = !isNull password-cmd -> isNull password; + message = "senpai: password-cmd overrides password!"; + } + { + assertion = !cfg.config ? addr; + message = "senpai: addr is deprecated, use address instead"; + } + { + assertion = !cfg.config ? nick; + message = "senpai: nick is deprecated, use nickname instead"; + } + { + assertion = !cfg.config ? no-tls; + message = "senpai: no-tls is deprecated, use tls instead"; + } + ]; home.packages = [ cfg.package ]; - xdg.configFile."senpai/senpai.yaml".source = - cfgFmt.generate "senpai.yaml" cfg.config; + xdg.configFile."senpai/senpai.scfg".text = + lib.hm.generators.toSCFG { } cfg.config; }; meta.maintainers = [ hm.maintainers.malvo ]; diff --git a/tests/default.nix b/tests/default.nix index 6ba9122957d3..567b75d5a890 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -136,6 +136,7 @@ in import nmtSrc { ./modules/programs/sapling ./modules/programs/sbt ./modules/programs/scmpuff + ./modules/programs/senpai ./modules/programs/sftpman ./modules/programs/sioyek ./modules/programs/sm64ex diff --git a/tests/lib/generators/default.nix b/tests/lib/generators/default.nix index 37bb2004787b..da52640d1298 100644 --- a/tests/lib/generators/default.nix +++ b/tests/lib/generators/default.nix @@ -1 +1,5 @@ -{ generators-tokdl = ./tokdl.nix; } +{ + generators-tokdl = ./tokdl.nix; + generators-toscfg-empty = ./toscfg-empty.nix; + generators-toscfg-example = ./toscfg-example.nix; +} diff --git a/tests/lib/generators/tokdl.nix b/tests/lib/generators/tokdl.nix index 88c5752b8769..6e4a4047b73f 100644 --- a/tests/lib/generators/tokdl.nix +++ b/tests/lib/generators/tokdl.nix @@ -1,7 +1,7 @@ { config, lib, ... }: { - home.file."result.txt".text = lib.hm.generators.toKDL { } { + home.file."tokdl-result.txt".text = lib.hm.generators.toKDL { } { a = 1; b = "string"; c = '' @@ -47,7 +47,7 @@ nmt.script = '' assertFileContent \ - home-files/result.txt \ + home-files/tokdl-result.txt \ ${./tokdl-result.txt} ''; } diff --git a/tests/lib/generators/toscfg-empty-result.txt b/tests/lib/generators/toscfg-empty-result.txt new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/lib/generators/toscfg-empty.nix b/tests/lib/generators/toscfg-empty.nix new file mode 100644 index 000000000000..e6800481f1ac --- /dev/null +++ b/tests/lib/generators/toscfg-empty.nix @@ -0,0 +1,11 @@ +{ config, lib, ... }: + +{ + home.file."toscfg-empty-result.txt".text = lib.hm.generators.toSCFG { } { }; + + nmt.script = '' + assertFileContent \ + home-files/toscfg-empty-result.txt \ + ${./toscfg-empty-result.txt} + ''; +} diff --git a/tests/lib/generators/toscfg-err-dir-empty-name.nix b/tests/lib/generators/toscfg-err-dir-empty-name.nix new file mode 100644 index 000000000000..f9b8dcdec933 --- /dev/null +++ b/tests/lib/generators/toscfg-err-dir-empty-name.nix @@ -0,0 +1,12 @@ +{ config, lib, ... }: + +{ + home.file."toscfg-err-dir-empty-name-result.txt".text = + lib.hm.generators.toSCFG { } { "" = [ ]; }; + + nmt.script = '' + assertFileContent \ + home-files/toscfg-err-dir-empty-name-result.txt \ + ${./toscfg-err-dir-empty-name-result.txt} + ''; +} diff --git a/tests/lib/generators/toscfg-example-result.txt b/tests/lib/generators/toscfg-example-result.txt new file mode 100644 index 000000000000..7a538d5a10ce --- /dev/null +++ b/tests/lib/generators/toscfg-example-result.txt @@ -0,0 +1,10 @@ +dir { + blk1 p1 "\"p2\"" { + sub1 arg11 arg12 + sub2 arg21 arg22 + sub3 arg31 arg32 { + sub-sub1 + sub-sub2 arg321 arg322 + } + } +} diff --git a/tests/lib/generators/toscfg-example.nix b/tests/lib/generators/toscfg-example.nix new file mode 100644 index 000000000000..d38568dcd72e --- /dev/null +++ b/tests/lib/generators/toscfg-example.nix @@ -0,0 +1,24 @@ +{ config, lib, ... }: + +{ + home.file."toscfg-example-result.txt".text = lib.hm.generators.toSCFG { } { + dir = { + blk1 = { + _params = [ "p1" ''"p2"'' ]; + sub1 = [ "arg11" "arg12" ]; + sub2 = [ "arg21" "arg22" ]; + sub3 = { + _params = [ "arg31" "arg32" ]; + sub-sub1 = [ ]; + sub-sub2 = [ "arg321" "arg322" ]; + }; + }; + }; + }; + + nmt.script = '' + assertFileContent \ + home-files/toscfg-example-result.txt \ + ${./toscfg-example-result.txt} + ''; +} diff --git a/tests/modules/programs/senpai/default.nix b/tests/modules/programs/senpai/default.nix new file mode 100644 index 000000000000..d1a2ba467a77 --- /dev/null +++ b/tests/modules/programs/senpai/default.nix @@ -0,0 +1,4 @@ +{ + senpai-example-settings = ./example-settings.nix; + senpai-empty-settings = ./empty-settings.nix; +} diff --git a/tests/modules/programs/senpai/empty-settings-expected.conf b/tests/modules/programs/senpai/empty-settings-expected.conf new file mode 100644 index 000000000000..9e41645499c9 --- /dev/null +++ b/tests/modules/programs/senpai/empty-settings-expected.conf @@ -0,0 +1,2 @@ +address irc.libera.chat +nickname Guest123456 diff --git a/tests/modules/programs/senpai/empty-settings.nix b/tests/modules/programs/senpai/empty-settings.nix new file mode 100644 index 000000000000..eeed8a39c8b2 --- /dev/null +++ b/tests/modules/programs/senpai/empty-settings.nix @@ -0,0 +1,20 @@ +{ config, ... }: + +{ + config = { + programs.senpai = { + enable = true; + package = config.lib.test.mkStubPackage { }; + config = { + address = "irc.libera.chat"; + nickname = "Guest123456"; + }; + }; + + nmt.script = '' + assertFileContent \ + home-files/.config/senpai/senpai.scfg \ + ${./empty-settings-expected.conf} + ''; + }; +} diff --git a/tests/modules/programs/senpai/example-settings-expected.conf b/tests/modules/programs/senpai/example-settings-expected.conf new file mode 100644 index 000000000000..39d5b11f2c2e --- /dev/null +++ b/tests/modules/programs/senpai/example-settings-expected.conf @@ -0,0 +1,13 @@ +address irc.libera.chat +channel #rahxephon +colors { + prompt 2 +} +highlight guest senpai lenon +nickname Guest123456 +pane-widths { + nicknames 16 +} +password-cmd gopass show irc/guest +realname "Guest von Lenon" +username senpai diff --git a/tests/modules/programs/senpai/example-settings.nix b/tests/modules/programs/senpai/example-settings.nix new file mode 100644 index 000000000000..5b0a5aa267b6 --- /dev/null +++ b/tests/modules/programs/senpai/example-settings.nix @@ -0,0 +1,27 @@ +{ config, ... }: + +{ + config = { + programs.senpai = { + enable = true; + package = config.lib.test.mkStubPackage { }; + config = { + address = "irc.libera.chat"; + nickname = "Guest123456"; + password-cmd = [ "gopass" "show" "irc/guest" ]; + username = "senpai"; + realname = "Guest von Lenon"; + channel = [ "#rahxephon" ]; + highlight = [ "guest" "senpai" "lenon" ]; + pane-widths = { nicknames = 16; }; + colors = { prompt = 2; }; + }; + }; + + nmt.script = '' + assertFileContent \ + home-files/.config/senpai/senpai.scfg \ + ${./example-settings-expected.conf} + ''; + }; +} From dc2f3812b41f825ed466c24c4211160d75cb890c Mon Sep 17 00:00:00 2001 From: Sofie Date: Fri, 15 Mar 2024 13:36:03 +0100 Subject: [PATCH 134/636] nix-gc: add daily frequency option The systemd.time documentation defines the shorthands `daily` and `minutely` which are currently not included in the nix-gc module. This commit adds the `daily` option, but omits `minutely` since it's not a timescale that would make sense to run a gc for. https://www.freedesktop.org/software/systemd/man/latest/systemd.time.html --- modules/services/nix-gc.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/services/nix-gc.nix b/modules/services/nix-gc.nix index 01fe5ac5deb4..6c837330e698 100644 --- a/modules/services/nix-gc.nix +++ b/modules/services/nix-gc.nix @@ -9,6 +9,10 @@ let let freq = { "hourly" = [{ Minute = 0; }]; + "daily" = [{ + Hour = 0; + Minute = 0; + }]; "weekly" = [{ Weekday = 1; Hour = 0; @@ -62,8 +66,14 @@ in { }; frequency = mkOption { - type = - types.enum [ "hourly" "weekly" "monthly" "semiannually" "annually" ]; + type = types.enum [ + "hourly" + "daily" + "weekly" + "monthly" + "semiannually" + "annually" + ]; default = "weekly"; example = "monthly"; description = '' From 3ad5c12f3c9b36cb8185d3aef9adcab3f543660a Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Sun, 26 Nov 2023 01:09:47 +0100 Subject: [PATCH 135/636] zsh: set autosuggestion color Before, one could only toggle autosuggestion. This allows to set the style as well. --- modules/programs/zsh.nix | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index dcff129d3552..2af248918d30 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -252,6 +252,7 @@ in { imports = [ + (mkRenamedOptionModule [ "programs" "zsh" "enableAutosuggestions" ] [ "programs" "zsh" "autosuggestion" "enable" ]) (mkRenamedOptionModule [ "programs" "zsh" "enableSyntaxHighlighting" ] [ "programs" "zsh" "syntaxHighlighting" "enable" ]) (mkRenamedOptionModule [ "programs" "zsh" "zproof" ] [ "programs" "zsh" "zprof" ]) ]; @@ -352,11 +353,6 @@ in type = types.lines; }; - enableAutosuggestions = mkOption { - default = false; - description = "Enable zsh autosuggestions"; - }; - zprof.enable = mkOption { default = false; description = '' @@ -376,6 +372,24 @@ in description = "Options related to zsh-history-substring-search."; }; + autosuggestion = { + enable = mkOption { + type = types.bool; + default = false; + description = "Enable zsh autosuggestions"; + }; + + highlight = mkOption { + type = types.nullOr types.str; + default = null; + example = "fg=#ff00ff,bg=cyan,bold,underline"; + description = '' + Custom styles for autosuggestion highlighting. See + {manpage}`zshzle(1)` for syntax. + ''; + }; + }; + history = mkOption { type = historyModule; default = {}; @@ -582,13 +596,16 @@ in # as all $fpath entries will be traversed again. ${optionalString (cfg.enableCompletion && !cfg.oh-my-zsh.enable && !cfg.prezto.enable) cfg.completionInit - } + }'' - ${optionalString cfg.enableAutosuggestions - "source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh" - } + (optionalString cfg.autosuggestion.enable '' + source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh + '') + (optionalString (cfg.autosuggestion.enable && cfg.autosuggestion.highlight != null) '' + AUTOSUGGESTION_HIGHLIGHT_COLOR="${cfg.autosuggestion.highlight}" + '') - ${optionalString cfg.oh-my-zsh.enable '' + (optionalString cfg.oh-my-zsh.enable '' # oh-my-zsh extra settings for plugins ${cfg.oh-my-zsh.extraConfig} # oh-my-zsh configuration generated by NixOS @@ -602,8 +619,9 @@ in "ZSH_THEME=\"${cfg.oh-my-zsh.theme}\"" } source $ZSH/oh-my-zsh.sh - ''} + '') + '' ${optionalString cfg.prezto.enable (builtins.readFile "${pkgs.zsh-prezto}/share/zsh-prezto/runcoms/zshrc")} From b004e47e03577e1226e2fe2f1e56d67a6aa8489d Mon Sep 17 00:00:00 2001 From: Icy-Thought Date: Thu, 8 Feb 2024 15:15:55 +0100 Subject: [PATCH 136/636] zsh: correct link for syntax-highlighting styles --- modules/programs/zsh.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 2af248918d30..145d7f7979f5 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -242,7 +242,7 @@ let example = { comment = "fg=black,bold"; }; description = '' Custom styles for syntax highlighting. - See each highlighter's options: + See each highlighter style option: ''; }; }; From c781b28add41b74423ab2e64496d4fc91192e13a Mon Sep 17 00:00:00 2001 From: Icy-Thought Date: Thu, 8 Feb 2024 15:17:24 +0100 Subject: [PATCH 137/636] zsh: add patterns option to syntax-highlighting --- modules/programs/zsh.nix | 15 +++++++++++++++ .../modules/programs/zsh/syntax-highlighting.nix | 1 + 2 files changed, 16 insertions(+) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 145d7f7979f5..c4520e7a774a 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -236,6 +236,16 @@ let ''; }; + patterns = mkOption { + type = types.attrsOf types.str; + default = {}; + example = { "rm -rf *" = "fg=white,bold,bg=red"; }; + description = '' + Custom syntax highlighting for user-defined patterns. + Reference: + ''; + }; + styles = mkOption { type = types.attrsOf types.str; default = {}; @@ -673,6 +683,11 @@ in (name: value: "ZSH_HIGHLIGHT_STYLES+=(${lib.escapeShellArg name} ${lib.escapeShellArg value})") cfg.syntaxHighlighting.styles )} + ${lib.concatStringsSep "\n" ( + lib.mapAttrsToList + (name: value: "ZSH_HIGHLIGHT_PATTERNS+=(${lib.escapeShellArg name} ${lib.escapeShellArg value})") + cfg.syntaxHighlighting.patterns + )} '') (optionalString (cfg.historySubstringSearch.enable or false) diff --git a/tests/modules/programs/zsh/syntax-highlighting.nix b/tests/modules/programs/zsh/syntax-highlighting.nix index 9baf1e437792..981cefb633dc 100644 --- a/tests/modules/programs/zsh/syntax-highlighting.nix +++ b/tests/modules/programs/zsh/syntax-highlighting.nix @@ -11,6 +11,7 @@ with lib; package = pkgs.hello; highlighters = [ "brackets" "pattern" "cursor" ]; styles.comment = "fg=#6c6c6c"; + patterns."rm -rf *" = "fg=white,bold,bg=red"; }; }; From 206f457fffdb9a73596a4cb2211a471bd305243d Mon Sep 17 00:00:00 2001 From: Michael Peyton Jones Date: Sun, 26 Nov 2023 15:45:04 +0000 Subject: [PATCH 138/636] prezto: be caseSensitive by default See https://github.com/nix-community/home-manager/issues/2255. This causes a really noticeable slowdown that is quite hard to track down! --- modules/programs/zsh/prezto.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/programs/zsh/prezto.nix b/modules/programs/zsh/prezto.nix index 1aa3af1e9b44..9a94f23856fa 100644 --- a/modules/programs/zsh/prezto.nix +++ b/modules/programs/zsh/prezto.nix @@ -16,7 +16,8 @@ let caseSensitive = mkOption { type = types.nullOr types.bool; - default = null; + # See . + default = true; example = true; description = "Set case-sensitivity for completion, history lookup, etc."; From 7b3fca5adcf6c709874a8f2e0c364fe9c58db989 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 17 Mar 2024 23:35:57 +0100 Subject: [PATCH 139/636] docs: minor fixes of guidelines --- docs/manual/contributing/guidelines.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/manual/contributing/guidelines.md b/docs/manual/contributing/guidelines.md index 6094539e64c8..3493ae5697ce 100644 --- a/docs/manual/contributing/guidelines.md +++ b/docs/manual/contributing/guidelines.md @@ -69,13 +69,10 @@ All contributed code *must* pass the test suite. ## Add relevant documentation {#sec-guidelines-module-maintainer} -Many code changes require changing the documentation as well. Module -options should be documented with [Nixpkgs-flavoured -Markdown](https://nixos.org/manual/nixpkgs/unstable/#sec-contributing-markup). -Home Manager is itself documented using a combination of -[DocBook](https://tdg.docbook.org/) and -[AsciiDoc](https://asciidoc.org/). All text is hosted in Home Manager's -Git repository. +Many code changes require changing the documentation as well. The +documentation is written in +[Nixpkgs-flavoured Markdown](https://nixos.org/manual/nixpkgs/unstable/#sec-contributing-markup). +All text is hosted in Home Manager's Git repository. The HTML version of the manual containing both the module option descriptions and the documentation of Home Manager can be generated and @@ -105,6 +102,9 @@ If you are present in the nixpkgs maintainer list then you can use that entry. If you are not then you can add yourself to `modules/lib/maintainers.nix` in the Home Manager project. +As a maintainer you are expected to respond to issues and +pull-requests associated with your module. + Maintainers are encouraged to join the IRC or Matrix channel and participate when they have opportunity. From 865bef34355d7ad22141f44460ecf7f759f0ff77 Mon Sep 17 00:00:00 2001 From: "s.seidenath" Date: Sat, 7 Oct 2023 18:06:10 +0200 Subject: [PATCH 140/636] kime: fix configuration Switches the kime configuration format to use unstructured text. This is necessary since version 3 and upwards use YAML tags. --- modules/i18n/input-method/kime.nix | 46 +++++++++---------- .../i18n/input-method/kime-configuration.nix | 37 +++++++++++++-- 2 files changed, 56 insertions(+), 27 deletions(-) diff --git a/modules/i18n/input-method/kime.nix b/modules/i18n/input-method/kime.nix index 5608b54e43ae..8b3ed757f91b 100644 --- a/modules/i18n/input-method/kime.nix +++ b/modules/i18n/input-method/kime.nix @@ -1,34 +1,33 @@ -{ config, pkgs, lib, generators, ... }: -with lib; +{ config, pkgs, lib, ... }: + let + inherit (lib) literalExpression mkIf mkOption mkRemovedOptionModule types; + cfg = config.i18n.inputMethod.kime; - yamlFormat = pkgs.formats.yaml { }; in { + imports = [ + (mkRemovedOptionModule [ "i18n" "inputMethod" "kime" "config" ] '' + Please use 'i18n.inputMethod.kime.extraConfig' instead. + '') + ]; + options = { i18n.inputMethod.kime = { - config = mkOption { - type = yamlFormat.type; - default = { }; + extraConfig = mkOption { + type = types.lines; + default = ""; example = literalExpression '' - { - daemon = { - modules = ["Xim" "Indicator"]; - }; - - indicator = { - icon_color = "White"; - }; - - engine = { - hangul = { - layout = "dubeolsik"; - }; - }; - } + daemon: + modules: [Xim,Indicator] + indicator: + icon_color: White + engine: + hangul: + layout: dubeolsik ''; description = '' kime configuration. Refer to - + for details on supported values. ''; }; @@ -44,8 +43,7 @@ in { XMODIFIERS = "@im=kime"; }; - xdg.configFile."kime/config.yaml".text = - replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.config); + xdg.configFile."kime/config.yaml".text = cfg.extraConfig; systemd.user.services.kime-daemon = { Unit = { diff --git a/tests/modules/i18n/input-method/kime-configuration.nix b/tests/modules/i18n/input-method/kime-configuration.nix index fe50273fbca1..b79694608a2b 100644 --- a/tests/modules/i18n/input-method/kime-configuration.nix +++ b/tests/modules/i18n/input-method/kime-configuration.nix @@ -1,14 +1,45 @@ { config, pkgs, ... }: -{ +let + + kimeConfig = '' + daemon: + modules: [Xim,Indicator] + indicator: + icon_color: White + engine: + hangul: + layout: dubeolsik + ''; + +in { i18n.inputMethod = { enabled = "kime"; - kime.config = { engine = { hangul = { layout = "dubeolsik"; }; }; }; + kime.extraConfig = kimeConfig; }; - test.stubs.kime = { outPath = null; }; + test.stubs = { + kime = { outPath = null; }; + gtk2 = { + buildScript = '' + mkdir -p $out/bin + echo '#/usr/bin/env bash' > $out/bin/gtk-query-immodules-2.0 + chmod +x $out/bin/* + ''; + }; + gtk3 = { + buildScript = '' + mkdir -p $out/bin + echo '#/usr/bin/env bash' > $out/bin/gtk-query-immodules-3.0 + chmod +x $out/bin/* + ''; + }; + }; nmt.script = '' assertFileExists home-files/.config/systemd/user/kime-daemon.service + assertFileExists home-files/.config/kime/config.yaml + assertFileContent home-files/.config/kime/config.yaml \ + ${builtins.toFile "kime-expected.yaml" kimeConfig} ''; } From baf7659448ffa6ab6870dba1ca681a4868c3068a Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 18 Mar 2024 22:13:07 +0100 Subject: [PATCH 141/636] kime: remove documentation dependency on config --- modules/i18n/input-method/kime.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/i18n/input-method/kime.nix b/modules/i18n/input-method/kime.nix index 8b3ed757f91b..0416515f649a 100644 --- a/modules/i18n/input-method/kime.nix +++ b/modules/i18n/input-method/kime.nix @@ -27,7 +27,7 @@ in { ''; description = '' kime configuration. Refer to - + for details on supported values. ''; }; From 93dcc3daa9aa42698823305a79e0957089af652d Mon Sep 17 00:00:00 2001 From: Scott Edlund Date: Sun, 17 Mar 2024 17:54:44 +0800 Subject: [PATCH 142/636] nix.gc: let systemd use any time config --- modules/services/nix-gc.nix | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/modules/services/nix-gc.nix b/modules/services/nix-gc.nix index 6c837330e698..8ac26dfeef93 100644 --- a/modules/services/nix-gc.nix +++ b/modules/services/nix-gc.nix @@ -4,6 +4,8 @@ with lib; let cfg = config.nix.gc; + darwinIntervals = + [ "hourly" "daily" "weekly" "monthly" "semiannually" "annually" ]; mkCalendarInterval = frequency: let @@ -66,21 +68,16 @@ in { }; frequency = mkOption { - type = types.enum [ - "hourly" - "daily" - "weekly" - "monthly" - "semiannually" - "annually" - ]; + type = types.str; default = "weekly"; - example = "monthly"; + example = "03:15"; description = '' - The frequency at which to run the garbage collector. + When to run the Nix garbage collector. + + On Linux this is a string as defined by {manpage}`systemd.time(7)`. - These enums are based on special expressions from the - {manpage}`systemd.time(7)` + On Darwin it must be one of: ${toString darwinIntervals}, which are + implemented as defined in the manual page above. ''; }; @@ -117,6 +114,13 @@ in { }) (mkIf pkgs.stdenv.isDarwin { + assertions = [{ + assertion = elem cfg.frequency darwinIntervals; + message = "On Darwin nix.gc.frequency must be one of: ${ + toString darwinIntervals + }."; + }]; + launchd.agents.nix-gc = { enable = true; config = { From 6665da45dd03857a4ae600cf246435e6ae57407e Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Mon, 18 Mar 2024 23:22:02 +0100 Subject: [PATCH 143/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/3030f185ba6a4bf4f18b87f345f104e6a6961f34' (2024-03-09) → 'github:NixOS/nixpkgs/d691274a972b3165335d261cc4671335f5c67de9' (2024-03-14) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 5879aa404dbe..c62d2cc8bdea 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1709961763, - "narHash": "sha256-6H95HGJHhEZtyYA3rIQpvamMKAGoa8Yh2rFV29QnuGw=", + "lastModified": 1710451336, + "narHash": "sha256-pP86Pcfu3BrAvRO7R64x7hs+GaQrjFes+mEPowCfkxY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3030f185ba6a4bf4f18b87f345f104e6a6961f34", + "rev": "d691274a972b3165335d261cc4671335f5c67de9", "type": "github" }, "original": { From 022464438a85450abb23d93b91aa82e0addd71fb Mon Sep 17 00:00:00 2001 From: honnip Date: Tue, 19 Mar 2024 05:01:46 +0100 Subject: [PATCH 144/636] Translate using Weblate (Korean) Currently translated at 100.0% (36 of 36 strings) Co-authored-by: honnip Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ko/ Translation: Home Manager/Home Manager CLI --- home-manager/po/ko.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/ko.po b/home-manager/po/ko.po index aab624f5553d..02dacc74c736 100644 --- a/home-manager/po/ko.po +++ b/home-manager/po/ko.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-03-19 04:01+0000\n" +"Last-Translator: honnip \n" "Language-Team: Korean \n" "Language: ko\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -181,7 +181,7 @@ msgstr "알 수 없는 \"news.display\"의 설정 \"%s\"." #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "$EDITOR 또는 $VISUAL 환경 변수를 설정하십시오" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From 3583fea7866834f70960a374cb0f4a6d1ffd0fc0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 20 Mar 2024 03:59:22 +0000 Subject: [PATCH 145/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/d691274a972b3165335d261cc4671335f5c67de9' (2024-03-14) → 'github:NixOS/nixpkgs/b06025f1533a1e07b6db3e75151caa155d1c7eb3' (2024-03-19) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index c62d2cc8bdea..a6d3c676a81f 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1710451336, - "narHash": "sha256-pP86Pcfu3BrAvRO7R64x7hs+GaQrjFes+mEPowCfkxY=", + "lastModified": 1710806803, + "narHash": "sha256-qrxvLS888pNJFwJdK+hf1wpRCSQcqA6W5+Ox202NDa0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d691274a972b3165335d261cc4671335f5c67de9", + "rev": "b06025f1533a1e07b6db3e75151caa155d1c7eb3", "type": "github" }, "original": { From 1c2acec99933f9835cc7ad47e35303de92d923a4 Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Mon, 18 Mar 2024 23:20:58 -0300 Subject: [PATCH 146/636] xdg-portal: align with NixOS module Nixpkgs has recently made a few major changes to its xdg-desktop-portal package, which silently breaks our module here: - The NIXOS_XDG_DESKTOP_PORTAL_CONFIG_DIR variable patch has been removed (in favor of putting portal configurations in /etc or XDG_CONFIG_HOME). - A new variable, NIX_XDG_DESKTOP_PORTAL_DIR, was introduced in a patch to avoid setting XDG_DESKTOP_PORTAL_DIR (which also affected portal configuration reading, not only portal definitions) I updated our module to match the changes, but this breakage also made me revisit this module and look into some improvements. Long story short, I think it's worth it to make it more similar to the NixOS one, as it will make behavior more predictable and consistent. The main change is relying on the upstream linked systemd unit (instead of using systemd.user.services), and setting the environment variables globally instead of scoping it to the unit, as it's a very global thing anyway. --- modules/misc/xdg-portal.nix | 61 +++++++++---------------------- tests/modules/misc/xdg/portal.nix | 24 ++++-------- 2 files changed, 24 insertions(+), 61 deletions(-) diff --git a/modules/misc/xdg-portal.nix b/modules/misc/xdg-portal.nix index 500e02e0088c..af305374a986 100644 --- a/modules/misc/xdg-portal.nix +++ b/modules/misc/xdg-portal.nix @@ -82,28 +82,9 @@ in { config = let cfg = config.xdg.portal; - - joinedPortals = pkgs.buildEnv { - name = "xdg-portals"; - paths = cfg.extraPortals; - pathsToLink = - [ "/share/xdg-desktop-portal/portals" "/share/applications" ]; - }; - - portalConfigPath = n: - "share/xdg-desktop-portal/${ - optionalString (n != "common") "${n}-" - }portals.conf"; - mkPortalConfig = desktop: conf: - pkgs.writeTextDir (portalConfigPath desktop) - (lib.generators.toINI { } { preferred = conf; }); - - joinedPortalConfigs = pkgs.buildEnv { - name = "xdg-portal-configs"; - ignoreCollisions = true; # Let config override configPackages cfgs - paths = (mapAttrsToList mkPortalConfig cfg.config) ++ cfg.configPackages; - pathsToLink = [ "/share/xdg-desktop-portal" ]; - }; + packages = [ pkgs.xdg-desktop-portal ] ++ cfg.extraPortals; + portalsDir = + "${config.home.profileDirectory}/share/xdg-desktop-portal/portals"; in mkIf cfg.enable { warnings = optional (cfg.configPackages == [ ] && cfg.config == { }) '' xdg-desktop-portal 1.17 reworked how portal implementations are loaded, you @@ -129,29 +110,21 @@ in { ]; home = { - sessionVariables = - mkIf cfg.xdgOpenUsePortal { NIXOS_XDG_OPEN_USE_PORTAL = "1"; }; - - # Make extraPortals systemd units available to the user - packages = [ pkgs.xdg-desktop-portal ] ++ cfg.extraPortals; + packages = packages ++ cfg.configPackages; + sessionVariables = mkMerge [ + (mkIf cfg.xdgOpenUsePortal { NIXOS_XDG_OPEN_USE_PORTAL = "1"; }) + { NIX_XDG_DESKTOP_PORTAL_DIR = portalsDir; } + ]; }; - - systemd.user.services.xdg-desktop-portal = { - Unit = { - Description = "Portal service"; - PartOf = "graphical-session.target"; - }; - - Service = { - Environment = [ - "XDG_DESKTOP_PORTAL_DIR=${joinedPortals}/share/xdg-desktop-portal/portals" - ] ++ (optional (cfg.configPackages != [ ]) - "NIXOS_XDG_DESKTOP_PORTAL_CONFIG_DIR=${joinedPortalConfigs}/share/xdg-desktop-portal"); - Type = "dbus"; - BusName = "org.freedesktop.portal.Desktop"; - ExecStart = "${pkgs.xdg-desktop-portal}/libexec/xdg-desktop-portal"; - Slice = "session.slice"; - }; + systemd.user.sessionVariables = { + NIX_XDG_DESKTOP_PORTAL_DIR = portalsDir; }; + + xdg.configFile = lib.concatMapAttrs (desktop: conf: + lib.optionalAttrs (conf != { }) { + "xdg-desktop-portal/${ + lib.optionalString (desktop != "common") "${desktop}-" + }portals.conf".text = lib.generators.toINI { } { preferred = conf; }; + }) cfg.config; }; } diff --git a/tests/modules/misc/xdg/portal.nix b/tests/modules/misc/xdg/portal.nix index 5c6e4699580e..e9ac8e381f8f 100644 --- a/tests/modules/misc/xdg/portal.nix +++ b/tests/modules/misc/xdg/portal.nix @@ -10,28 +10,18 @@ lib.mkIf config.test.enableBig { }; nmt.script = '' - xdgDesktopPortal=home-files/.config/systemd/user/xdg-desktop-portal.service - assertFileExists $xdgDesktopPortal + assertFileExists home-path/share/systemd/user/xdg-desktop-portal.service + assertFileExists home-path/share/systemd/user/xdg-desktop-portal-wlr.service + assertFileExists home-path/share/systemd/user/xdg-desktop-portal-hyprland.service - xdgDesktopPortalWlr=home-path/share/systemd/user/xdg-desktop-portal-wlr.service - assertFileExists $xdgDesktopPortalWlr - - xdgDesktopPortalHyprland=home-path/share/systemd/user/xdg-desktop-portal-hyprland.service - assertFileExists $xdgDesktopPortalHyprland - - portalsDir="$(cat $TESTED/$xdgDesktopPortal | grep Environment=XDG_DESKTOP_PORTAL_DIR | cut -d '=' -f3)" - portalConfigsDir="$(cat $TESTED/$xdgDesktopPortal | grep Environment=NIXOS_XDG_DESKTOP_PORTAL_CONFIG_DIR | cut -d '=' -f3)" - - assertFileContent $portalsDir/hyprland.portal \ + assertFileContent home-path/share/xdg-desktop-portal/portals/hyprland.portal \ ${pkgs.xdg-desktop-portal-hyprland}/share/xdg-desktop-portal/portals/hyprland.portal - - assertFileContent $portalsDir/wlr.portal \ + assertFileContent home-path/share/xdg-desktop-portal/portals/wlr.portal \ ${pkgs.xdg-desktop-portal-wlr}/share/xdg-desktop-portal/portals/wlr.portal - assertFileContent $portalConfigsDir/hyprland-portals.conf \ + assertFileContent home-path/share/xdg-desktop-portal/hyprland-portals.conf \ ${pkgs.hyprland}/share/xdg-desktop-portal/hyprland-portals.conf - - assertFileContent $portalConfigsDir/sway-portals.conf \ + assertFileContent home-files/.config/xdg-desktop-portal/sway-portals.conf \ ${./sway-portals-expected.conf} ''; } From 19b87b9ae6ecfd81104a2a36ef8364f1de1b54b1 Mon Sep 17 00:00:00 2001 From: Evgeny Kurnevsky Date: Sun, 3 Sep 2023 12:01:36 +0300 Subject: [PATCH 147/636] vdirsyncer: add urlCommand and userNameCommand options --- modules/accounts/calendar.nix | 9 ---- modules/programs/vdirsyncer-accounts.nix | 14 ++++++ modules/programs/vdirsyncer.nix | 57 +++++++++++++++--------- 3 files changed, 49 insertions(+), 31 deletions(-) diff --git a/modules/accounts/calendar.nix b/modules/accounts/calendar.nix index 961cd0b3a676..bfbc3e124fed 100644 --- a/modules/accounts/calendar.nix +++ b/modules/accounts/calendar.nix @@ -58,15 +58,6 @@ let description = "User name for authentication."; }; - # userNameCommand = mkOption { - # type = types.nullOr (types.listOf types.str); - # default = null; - # example = [ "~/get-username.sh" ]; - # description = '' - # A command that prints the user name to standard output. - # ''; - # }; - passwordCommand = mkOption { type = types.nullOr (types.listOf types.str); default = null; diff --git a/modules/programs/vdirsyncer-accounts.nix b/modules/programs/vdirsyncer-accounts.nix index 4edd17429db8..7ab9521c1ab7 100644 --- a/modules/programs/vdirsyncer-accounts.nix +++ b/modules/programs/vdirsyncer-accounts.nix @@ -10,6 +10,20 @@ in { options.vdirsyncer = { enable = mkEnableOption "synchronization using vdirsyncer"; + urlCommand = mkOption { + type = types.nullOr (types.listOf types.str); + default = null; + example = [ "~/get-url.sh" ]; + description = "A command that prints the URL of the storage."; + }; + + userNameCommand = mkOption { + type = types.nullOr (types.listOf types.str); + default = null; + example = [ "~/get-username.sh" ]; + description = "A command that prints the user name to standard output."; + }; + collections = mkOption { type = types.nullOr (types.listOf collection); default = null; diff --git a/modules/programs/vdirsyncer.nix b/modules/programs/vdirsyncer.nix index 32c0033948c9..562d7b4be8f1 100644 --- a/modules/programs/vdirsyncer.nix +++ b/modules/programs/vdirsyncer.nix @@ -32,27 +32,25 @@ let }); remoteStorage = a: - filterAttrs (_: v: v != null) ((getAttrs [ - "type" - "url" - "userName" - #"userNameCommand" - "passwordCommand" - ] a.remote) // (if a.vdirsyncer == null then - { } - else - getAttrs [ - "itemTypes" - "verify" - "verifyFingerprint" - "auth" - "authCert" - "userAgent" - "tokenFile" - "clientIdCommand" - "clientSecretCommand" - "timeRange" - ] a.vdirsyncer)); + filterAttrs (_: v: v != null) + ((getAttrs [ "type" "url" "userName" "passwordCommand" ] a.remote) + // (if a.vdirsyncer == null then + { } + else + getAttrs [ + "urlCommand" + "userNameCommand" + "itemTypes" + "verify" + "verifyFingerprint" + "auth" + "authCert" + "userAgent" + "tokenFile" + "clientIdCommand" + "clientSecretCommand" + "timeRange" + ] a.vdirsyncer)); pair = a: with a.vdirsyncer; @@ -77,6 +75,8 @@ let ''post_hook = "${v}"'' else if (n == "url") then ''url = "${v}"'' + else if (n == "urlCommand") then + "url.fetch = ${listString (map wrap ([ "command" ] ++ v))}" else if (n == "timeRange") then '' start_date = "${v.start}" end_date = "${v.end}"'' else if (n == "itemTypes") then @@ -196,6 +196,9 @@ in { config = mkIf cfg.enable { assertions = let + mutuallyExclusiveOptions = + [ [ "url" "urlCommand" ] [ "userName" "userNameCommand" ] ]; + requiredOptions = t: if (t == "caldav" || t == "carddav" || t == "http") then [ "url" ] @@ -213,6 +216,7 @@ in { allowedOptions = let remoteOptions = [ + "urlCommand" "userName" "userNameCommand" "password" @@ -264,7 +268,16 @@ in { Storage ${n} is of type ${v.type}, but required option ${a} is not set. ''; - }]) required)) (removeAttrs v [ "type" "_module" ]); + }]) required) ++ map (attrs: + let + defined = attrNames (filterAttrs (n: v: v != null) + (genAttrs attrs (a: v.${a} or null))); + in { + assertion = length defined <= 1; + message = "Storage ${n} has mutually exclusive options: ${ + concatStringsSep ", " defined + }"; + }) mutuallyExclusiveOptions) (removeAttrs v [ "type" "_module" ]); storageAssertions = flatten (mapAttrsToList assertStorage localStorages) ++ flatten (mapAttrsToList assertStorage remoteStorages); From 1c2c5e4cabba4c43504ef0f8cc3f3dfa284e2dbb Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 22 Mar 2024 19:44:27 +0100 Subject: [PATCH 148/636] home-manager: fix nix-build option `-q` The `-q` option does not actually exist, nix-build expects `--quiet`. --- home-manager/home-manager | 2 +- modules/lib-bash/activation-init.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index 91202c877fb5..1fa7af0e03f3 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -138,7 +138,7 @@ function setHomeManagerPathVariables() { fi _iVerbose "Sanity checking Nix" - nix-build -q --expr '{}' --no-out-link > /dev/null 2>&1 || true + nix-build --quiet --expr '{}' --no-out-link > /dev/null 2>&1 || true nix-env -q > /dev/null 2>&1 || true declare -r globalNixStateDir="${NIX_STATE_DIR:-/nix/var/nix}" diff --git a/modules/lib-bash/activation-init.sh b/modules/lib-bash/activation-init.sh index 9e5ea200f1e9..91111e5d0d29 100755 --- a/modules/lib-bash/activation-init.sh +++ b/modules/lib-bash/activation-init.sh @@ -155,7 +155,7 @@ _i "Starting Home Manager activation" # Verify that we can connect to the Nix store and/or daemon. This will # also create the necessary directories in profiles and gcroots. _iVerbose "Sanity checking Nix" -nix-build --expr '{}' --no-out-link +nix-build --quiet --expr '{}' --no-out-link # Also make sure that the Nix profiles path is created. nix-env -q > /dev/null 2>&1 || true From eb869521cb6c895b6d351be0b9e010c578de0e4b Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Tue, 26 Mar 2024 14:24:49 -0600 Subject: [PATCH 149/636] darkman: allow no configuration Closes #4779 Signed-off-by: Sumner Evans --- modules/services/darkman.nix | 3 +- tests/modules/services/darkman/default.nix | 5 ++- .../services/darkman/no-configuration.nix | 37 +++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 tests/modules/services/darkman/no-configuration.nix diff --git a/modules/services/darkman.nix b/modules/services/darkman.nix index d11f03244edd..b399dad862ba 100644 --- a/modules/services/darkman.nix +++ b/modules/services/darkman.nix @@ -52,6 +52,7 @@ in { settings = mkOption { type = types.submodule { freeformType = yamlFormat.type; }; + default = { }; example = literalExpression '' { lat = 52.3; @@ -96,7 +97,7 @@ in { Documentation = "man:darkman(1)"; PartOf = [ "graphical-session.target" ]; BindsTo = [ "graphical-session.target" ]; - X-Restart-Triggers = + X-Restart-Triggers = mkIf (cfg.settings != { }) [ "${config.xdg.configFile."darkman/config.yaml".source}" ]; }; diff --git a/tests/modules/services/darkman/default.nix b/tests/modules/services/darkman/default.nix index 6c03491b961e..d14067b040b9 100644 --- a/tests/modules/services/darkman/default.nix +++ b/tests/modules/services/darkman/default.nix @@ -1 +1,4 @@ -{ darkman-basic-configuration = ./basic-configuration.nix; } +{ + darkman-basic-configuration = ./basic-configuration.nix; + darkman-no-configuration = ./no-configuration.nix; +} diff --git a/tests/modules/services/darkman/no-configuration.nix b/tests/modules/services/darkman/no-configuration.nix new file mode 100644 index 000000000000..1ab6346f41e8 --- /dev/null +++ b/tests/modules/services/darkman/no-configuration.nix @@ -0,0 +1,37 @@ +{ + services.darkman.enable = true; + + test.stubs = { + python = { }; + darkman = { }; + }; + + nmt.script = '' + serviceFile=$(normalizeStorePaths home-files/.config/systemd/user/darkman.service) + + assertFileExists $serviceFile + assertFileContent $serviceFile ${ + builtins.toFile "expected" '' + [Install] + WantedBy=graphical-session.target + + [Service] + BusName=nl.whynothugo.darkman + ExecStart=@darkman@/bin/dummy run + Restart=on-failure + Slice=background.slice + TimeoutStopSec=15 + Type=dbus + + [Unit] + BindsTo=graphical-session.target + Description=Darkman system service + Documentation=man:darkman(1) + PartOf=graphical-session.target + '' + } + assertPathNotExists home-files/.local/share/dark-mode.d/color-scheme-dark + assertPathNotExists home-files/.local/share/light-mode.d/color-scheme-light + ''; +} + From 179f6acaf7c068c7870542cdae72afec9427a5b0 Mon Sep 17 00:00:00 2001 From: Graham Bennett Date: Wed, 27 Mar 2024 15:45:49 +0000 Subject: [PATCH 150/636] antidote: Use builtins.storeDir (#5182) This allows the module to work for non-/nix stores. --- modules/programs/antidote.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/antidote.nix b/modules/programs/antidote.nix index b4f98b1179e5..8db5a9a821ef 100644 --- a/modules/programs/antidote.nix +++ b/modules/programs/antidote.nix @@ -10,7 +10,7 @@ let '') pluginNames)}"); parseHashId = path: - elemAt (builtins.match "/nix/store/([a-zA-Z0-9]+)-.*" path) 0; + elemAt (builtins.match "${builtins.storeDir}/([a-zA-Z0-9]+)-.*" path) 0; in { meta.maintainers = [ maintainers.hitsmaxft ]; From 3142bdcc470e1e291e1fbe942fd69e06bd00c5df Mon Sep 17 00:00:00 2001 From: Shaw Vrana Date: Wed, 27 Mar 2024 16:03:27 -0700 Subject: [PATCH 151/636] readline: optionally place config file in XDG dir Based on PR #4189 --- modules/home-environment.nix | 6 ++++ modules/programs/readline.nix | 14 ++++++++-- tests/modules/programs/readline/default.nix | 5 +++- .../programs/readline/prefer-xdg-dirs.nix | 28 +++++++++++++++++++ 4 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 tests/modules/programs/readline/prefer-xdg-dirs.nix diff --git a/modules/home-environment.nix b/modules/home-environment.nix index 1728fa4583b7..b3f6d6e25ea7 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -473,6 +473,12 @@ in will be printed when the user configuration is being built. ''; }; + + home.preferXdgDirectories = mkEnableOption "" // { + description = '' + Whether to make programs use XDG directories whenever supported. + ''; +}; }; config = { diff --git a/modules/programs/readline.nix b/modules/programs/readline.nix index b8739e37ad34..56e8ea985429 100644 --- a/modules/programs/readline.nix +++ b/modules/programs/readline.nix @@ -68,8 +68,8 @@ in { }; }; - config = mkIf cfg.enable { - home.file.".inputrc".text = let + config = mkIf cfg.enable (let + finalConfig = let configStr = concatStringsSep "\n" (optional cfg.includeSystemConfig "$include /etc/inputrc" ++ mapAttrsToList mkSetVariableStr cfg.variables @@ -80,5 +80,13 @@ in { ${configStr} ${cfg.extraConfig} ''; - }; + in mkMerge [ + (mkIf (!config.home.preferXdgDirectories) { + home.file.".inputrc".text = finalConfig; + }) + (mkIf config.home.preferXdgDirectories { + xdg.configFile.inputrc.text = finalConfig; + home.sessionVariables.INPUTRC = "${config.xdg.configHome}/inputrc"; + }) + ]); } diff --git a/tests/modules/programs/readline/default.nix b/tests/modules/programs/readline/default.nix index c95745d19cd0..614b4ce9e2e9 100644 --- a/tests/modules/programs/readline/default.nix +++ b/tests/modules/programs/readline/default.nix @@ -1 +1,4 @@ -{ readline-using-all-options = ./using-all-options.nix; } +{ + readline-using-all-options = ./using-all-options.nix; + readline-prefer-xdg-dirs = ./prefer-xdg-dirs.nix; +} diff --git a/tests/modules/programs/readline/prefer-xdg-dirs.nix b/tests/modules/programs/readline/prefer-xdg-dirs.nix new file mode 100644 index 000000000000..869b8a2cb3ec --- /dev/null +++ b/tests/modules/programs/readline/prefer-xdg-dirs.nix @@ -0,0 +1,28 @@ +{ ... }: + +{ + home.preferXdgDirectories = true; + + programs.readline = { + enable = true; + variables.bell-style = "audible"; + }; + + nmt.script = '' + assertFileContent \ + home-files/.config/inputrc \ + ${ + builtins.toFile "readline-expected" '' + # Generated by Home Manager. + + $include /etc/inputrc + set bell-style audible + + '' + } + + assertFileContains \ + home-path/etc/profile.d/hm-session-vars.sh \ + 'export INPUTRC="/home/hm-user/.config/inputrc"' + ''; +} From c0ef0dab55611c676ad7539bf4e41b3ec6fa87d2 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 28 Mar 2024 12:33:23 +0100 Subject: [PATCH 152/636] home-environment: fix formatting --- modules/home-environment.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/home-environment.nix b/modules/home-environment.nix index b3f6d6e25ea7..59497ec4a971 100644 --- a/modules/home-environment.nix +++ b/modules/home-environment.nix @@ -475,10 +475,10 @@ in }; home.preferXdgDirectories = mkEnableOption "" // { - description = '' - Whether to make programs use XDG directories whenever supported. - ''; -}; + description = '' + Whether to make programs use XDG directories whenever supported. + ''; + }; }; config = { From c09deb869b2e7a4612e489d4bbb11517f78b618e Mon Sep 17 00:00:00 2001 From: Nguyen Khanh Date: Wed, 27 Mar 2024 16:05:34 +0100 Subject: [PATCH 153/636] Translate using Weblate (Vietnamese) Currently translated at 5.5% (1 of 18 strings) Translate using Weblate (Vietnamese) Currently translated at 33.3% (12 of 36 strings) Translate using Weblate (Vietnamese) Currently translated at 11.1% (4 of 36 strings) Co-authored-by: Nguyen Khanh Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/vi/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/vi/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules --- home-manager/po/vi.po | 39 +++++++++++++++++++++++++++++---------- modules/po/vi.po | 11 +++++++---- 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/home-manager/po/vi.po b/home-manager/po/vi.po index bfa67459b067..d0a57b9bba1b 100644 --- a/home-manager/po/vi.po +++ b/home-manager/po/vi.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-03-14 09:01+0000\n" -"Last-Translator: RepentantKnight121 \n" +"PO-Revision-Date: 2024-03-27 15:05+0000\n" +"Last-Translator: Nguyen Khanh \n" "Language-Team: Vietnamese \n" "Language: vi\n" @@ -34,11 +34,11 @@ msgstr "" #: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" -msgstr "" +msgstr "Không tìm thấy tệp cấu hình. Vui lòng tạo một cái tại %s" #: home-manager/home-manager:101 msgid "Home Manager not found at %s." -msgstr "Home Manager not found at %s." +msgstr "Không tìm thấy Home Manager ở %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:109 @@ -46,6 +46,8 @@ msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" +"Đường dẫn Home Manager dự phòng %s không được dùng nữa và một tệp/thư mục đã " +"đuợc tìm thấy ở đó." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:112 @@ -68,6 +70,23 @@ msgid "" "\n" " $ rm -r \"%s\"" msgstr "" +"Để tắt cảnh báo này, hãy thực hiện một trong các thao tác sau.\n" +"\n" +"1. Chỉ định Home Manager sử dụng đường dẫn, ví dụ bằng cách thêm\n" +"\n" +"\n" +" { programs.home-manager.path = \"%s\"; }\n" +" vào cấu hình của bạn.\n" +"\n" +"Nếu bạn nhập trực tiếp Home Manager, bạn có thể sử dụng tham số `path`\n" +"\n" +" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" +"\n" +" khi gọi gói Home Manager.\n" +"\n" +"2. Xóa đường dẫn không được dùng nữa.\n" +"\n" +" $ rm -r \"%s\"" #: home-manager/home-manager:140 msgid "Sanity checking Nix" @@ -75,7 +94,7 @@ msgstr "" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" -msgstr "" +msgstr "Không thể tìm thấy thư mục hồ sơ phù hợp, đã thử %s và %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:215 @@ -85,23 +104,23 @@ msgstr "" #: home-manager/home-manager:288 home-manager/home-manager:311 #: home-manager/home-manager:1030 msgid "%s: unknown option '%s'" -msgstr "" +msgstr "%s: tùy chọn không xác định '%s'" #: home-manager/home-manager:293 home-manager/home-manager:1031 msgid "Run '%s --help' for usage help" -msgstr "" +msgstr "Chạy '%s --help' để được trợ giúp sử dụng" #: home-manager/home-manager:319 home-manager/home-manager:423 msgid "The file %s already exists, leaving it unchanged..." -msgstr "" +msgstr "Tệp %s đã tồn tại, để nguyên nó không thay đổi..." #: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." -msgstr "" +msgstr "Đang tạo %s..." #: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." -msgstr "" +msgstr "Khởi tạo thế hệ Home Manager ban đầu..." #. translators: The "%s" specifier will be replaced by a file path. #: home-manager/home-manager:472 diff --git a/modules/po/vi.po b/modules/po/vi.po index 816bec772fd5..a7c2bafbdf27 100644 --- a/modules/po/vi.po +++ b/modules/po/vi.po @@ -8,13 +8,16 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2024-03-27 15:05+0000\n" +"Last-Translator: Nguyen Khanh \n" +"Language-Team: Vietnamese \n" "Language: vi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: Weblate 5.5-dev\n" #: modules/files.nix:236 msgid "Creating home file links in %s" @@ -58,7 +61,7 @@ msgstr "" #: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" -msgstr "" +msgstr "Không thể tìm thấy thư mục hồ sơ phù hợp, đã thử %s và %s" #: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" From 30f2ec39519f4f5a8a96af808c439e730c15aeab Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 31 Mar 2024 09:07:48 +0200 Subject: [PATCH 154/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/b06025f1533a1e07b6db3e75151caa155d1c7eb3' (2024-03-19) → 'github:NixOS/nixpkgs/d8fe5e6c92d0d190646fb9f1056741a229980089' (2024-03-29) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index a6d3c676a81f..f8efa105a5db 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1710806803, - "narHash": "sha256-qrxvLS888pNJFwJdK+hf1wpRCSQcqA6W5+Ox202NDa0=", + "lastModified": 1711703276, + "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b06025f1533a1e07b6db3e75151caa155d1c7eb3", + "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", "type": "github" }, "original": { From 820be197ccf3adaad9a8856ef255c13b6cc561a6 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Sun, 31 Mar 2024 22:06:56 +0200 Subject: [PATCH 155/636] programs.khal: ability to set RGB color (#5192) The current module constrains to values in enum but khal supports RGB colors as well khal.readthedocs.io/en/latest/configure.html#the-calendars-section ! (be careful when setting an RGB value, it has to be quoted else it is ignored, got bitten by it with a manual config ) NB: It's also not possible to set addresses khal.readthedocs.io/en/latest/configure.html#the-calendars-section --- modules/programs/khal-accounts.nix | 20 ++----------------- modules/programs/khal.nix | 9 +++++---- tests/modules/programs/khal/config.nix | 1 + .../programs/khal/khal-config-expected | 5 +++++ 4 files changed, 13 insertions(+), 22 deletions(-) diff --git a/modules/programs/khal-accounts.nix b/modules/programs/khal-accounts.nix index cf04a65c05e1..846e18fa3edd 100644 --- a/modules/programs/khal-accounts.nix +++ b/modules/programs/khal-accounts.nix @@ -15,27 +15,11 @@ with lib; }; color = mkOption { - type = types.nullOr (types.enum [ - "black" - "white" - "brown" - "yellow" - "dark gray" - "dark green" - "dark blue" - "light gray" - "light green" - "light blue" - "dark magenta" - "dark cyan" - "dark red" - "light magenta" - "light cyan" - "light red" - ]); + type = types.nullOr types.str; default = null; description = '' Color in which events in this calendar are displayed. + For instance 'light green' or an RGB color '#ff0000' ''; example = "light green"; }; diff --git a/modules/programs/khal.nix b/modules/programs/khal.nix index c8037e53ba72..52e7796374ee 100644 --- a/modules/programs/khal.nix +++ b/modules/programs/khal.nix @@ -45,10 +45,11 @@ let + (optionalString (value.khal.type == "birthdays" && value.khal ? thisCollection) value.khal.thisCollection) - }" - ] ++ optional (value.khal.readOnly) "readonly = True" ++ [ - (toKeyValueIfDefined (getAttrs [ "type" "color" "priority" ] value.khal)) - ] ++ [ "\n" ]); + }\n " + ] ++ optional (value.khal.readOnly) "readonly = True" + ++ optional (value.khal.color != null) "color = '${value.khal.color}'" + ++ [ (toKeyValueIfDefined (getAttrs [ "type" "priority" ] value.khal)) ] + ++ [ "\n" ]); localeFormatOptions = let T = lib.types; diff --git a/tests/modules/programs/khal/config.nix b/tests/modules/programs/khal/config.nix index 50218e15aa97..017a04ace705 100644 --- a/tests/modules/programs/khal/config.nix +++ b/tests/modules/programs/khal/config.nix @@ -19,6 +19,7 @@ khal = { enable = true; readOnly = true; + color = "#ff0000"; type = "calendar"; }; local.type = "filesystem"; diff --git a/tests/modules/programs/khal/khal-config-expected b/tests/modules/programs/khal/khal-config-expected index a4cf7a30e157..157d650badbd 100644 --- a/tests/modules/programs/khal/khal-config-expected +++ b/tests/modules/programs/khal/khal-config-expected @@ -1,7 +1,9 @@ [calendars] [[test]] path = /home/hm-user/$XDG_CONFIG_HOME/cal/test/ + readonly = True +color = '#ff0000' priority=10 type=calendar @@ -9,6 +11,7 @@ type=calendar [[testcontacts-automaticallyCollected]] path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontacts/automaticallyCollected + priority=10 type=birthdays @@ -16,6 +19,7 @@ type=birthdays [[testcontacts-default]] path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontacts/default + priority=10 type=birthdays @@ -23,6 +27,7 @@ type=birthdays [[testcontactsNoCollections]] path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontactsNoCollections/ + priority=10 type=birthdays From 4be0464472675212654dedf3e021bd5f1d58b92f Mon Sep 17 00:00:00 2001 From: Kareem-Medhat <39652808+Kareem-Medhat@users.noreply.github.com> Date: Tue, 2 Apr 2024 02:05:46 +0200 Subject: [PATCH 156/636] home-manager: fix missing string context The `home-manager` package was being passed a `path` string pointing a store path while the string didn't have context. As a result the `home-manager` derivation was created without this path as an input source allowing it to be garbage collected even though it it being used by the `home-manager` script. This in turn caused certain warnings and errors to occur. --- flake.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 02c7afacfa8f..3a90f89c0f26 100644 --- a/flake.nix +++ b/flake.nix @@ -78,8 +78,7 @@ in throwForRemovedArgs (import ./modules { inherit pkgs lib check extraSpecialArgs; configuration = { ... }: { - imports = modules - ++ [{ programs.home-manager.path = toString ./.; }]; + imports = modules ++ [{ programs.home-manager.path = "${./.}"; }]; nixpkgs = { config = nixpkgs.lib.mkDefault pkgs.config; inherit (pkgs) overlays; @@ -112,7 +111,7 @@ inherit pkgs; inherit (releaseInfo) release isReleaseBranch; }; - hmPkg = pkgs.callPackage ./home-manager { path = toString ./.; }; + hmPkg = pkgs.callPackage ./home-manager { path = "${./.}"; }; testPackages = let tests = import ./tests { inherit pkgs; }; From 6396954c0d26ffd7601c478c11443f454926bf27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Tue, 2 Apr 2024 17:17:37 +0200 Subject: [PATCH 157/636] bacon: add package option Allows overriding the package with a different version. Useful if you need a different version and don't want (or can't) use an overlay. --- modules/programs/bacon.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/bacon.nix b/modules/programs/bacon.nix index 263d1f060504..8253c4e52512 100644 --- a/modules/programs/bacon.nix +++ b/modules/programs/bacon.nix @@ -13,6 +13,8 @@ in { options.programs.bacon = { enable = mkEnableOption "bacon, a background rust code checker"; + package = mkPackageOption pkgs "bacon" { }; + settings = mkOption { type = settingsFormat.type; example = { @@ -29,7 +31,7 @@ in { }; config = mkIf cfg.enable { - home.packages = [ pkgs.bacon ]; + home.packages = [ cfg.package ]; xdg.configFile."bacon/prefs.toml".source = settingsFormat.generate "prefs.toml" cfg.settings; From e429a60900c1c8f6c07bbd4926b79f05a98544c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jalil=20David=20Salam=C3=A9=20Messina?= Date: Tue, 2 Apr 2024 17:20:03 +0200 Subject: [PATCH 158/636] bacon: add default value for settings Currently you need to specify the settings if you want to use bacon, but the empty settings works and is the default upstream: - - [default `prefs.toml`][1] [1] https://raw.githubusercontent.com/Canop/bacon/main/defaults/default-prefs.toml --- modules/programs/bacon.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/programs/bacon.nix b/modules/programs/bacon.nix index 8253c4e52512..a24d9ffe120a 100644 --- a/modules/programs/bacon.nix +++ b/modules/programs/bacon.nix @@ -17,6 +17,7 @@ in { settings = mkOption { type = settingsFormat.type; + default = { }; example = { jobs.default = { command = [ "cargo" "build" "--all-features" "--color" "always" ]; From 81cd71995ade24333017e7930802040363ce1946 Mon Sep 17 00:00:00 2001 From: quasigod Date: Tue, 2 Apr 2024 17:39:11 -0400 Subject: [PATCH 159/636] hyprland: fix systemd variables example --- modules/services/window-managers/hyprland.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index 3048d58942b0..cf1631080e88 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -88,7 +88,7 @@ in { "WAYLAND_DISPLAY" "XDG_CURRENT_DESKTOP" ]; - example = [ "-all" ]; + example = [ "--all" ]; description = '' Environment variables to be imported in the systemd & D-Bus user environment. From aca33e99551250cfb23f384789d9fecea0254ac4 Mon Sep 17 00:00:00 2001 From: Petr Portnov | PROgrm_JARvis Date: Tue, 2 Apr 2024 23:38:23 +0200 Subject: [PATCH 160/636] Translate using Weblate (Russian) Currently translated at 100.0% (36 of 36 strings) Co-authored-by: Petr Portnov | PROgrm_JARvis Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ru/ Translation: Home Manager/Home Manager CLI --- home-manager/po/ru.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/ru.po b/home-manager/po/ru.po index 7be061dce541..52cacb05a813 100644 --- a/home-manager/po/ru.po +++ b/home-manager/po/ru.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-03-31 22:01+0000\n" +"Last-Translator: Petr Portnov | PROgrm_JARvis \n" "Language-Team: Russian \n" "Language: ru\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -187,7 +187,7 @@ msgstr "Неизвестное значение \"news.display\": \"%s\"." #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Пожалуйста, установите переменную среды $EDITOR или $VISUAL" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From 58e5ae81ceb274a249ae69659f3150419673f14c Mon Sep 17 00:00:00 2001 From: SMFloris Date: Tue, 2 Apr 2024 23:38:23 +0200 Subject: [PATCH 161/636] Translate using Weblate (Romanian) Currently translated at 100.0% (36 of 36 strings) Co-authored-by: SMFloris Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ro/ Translation: Home Manager/Home Manager CLI --- home-manager/po/ro.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/ro.po b/home-manager/po/ro.po index 28b515aef631..18f9dad7a7d6 100644 --- a/home-manager/po/ro.po +++ b/home-manager/po/ro.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-03-31 22:01+0000\n" +"Last-Translator: SMFloris \n" "Language-Team: Romanian \n" "Language: ro\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " "20)) ? 1 : 2;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -191,7 +191,7 @@ msgstr "Opțiunea \"news.display\" este necunoscută \"%s\"." #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Rugăm să setați variabila $EDITOR sau $VISUAL în variabilele de mediu" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From 80546b220e95a575c66c213af1b09fe255299438 Mon Sep 17 00:00:00 2001 From: LilleAila Date: Tue, 2 Apr 2024 23:38:23 +0200 Subject: [PATCH 162/636] =?UTF-8?q?Translate=20using=20Weblate=20(Norwegia?= =?UTF-8?q?n=20Bokm=C3=A5l)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 94.4% (17 of 18 strings) Translate using Weblate (Norwegian Bokmål) Currently translated at 86.1% (31 of 36 strings) Co-authored-by: LilleAila Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/nb_NO/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/nb_NO/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules --- home-manager/po/nb_NO.po | 18 +++++++++++------- modules/po/nb_NO.po | 16 ++++++++-------- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/home-manager/po/nb_NO.po b/home-manager/po/nb_NO.po index bb164ff30bea..97deaaf08b52 100644 --- a/home-manager/po/nb_NO.po +++ b/home-manager/po/nb_NO.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-04-02 21:38+0000\n" +"Last-Translator: LilleAila \n" "Language-Team: Norwegian Bokmål \n" "Language: nb_NO\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -27,10 +27,13 @@ msgstr "Fant ingen oppsettsfil i %s" #. 'home.nix' or 'flake.nix'. #: home-manager/home-manager:75 home-manager/home-manager:79 #: home-manager/home-manager:178 +#, fuzzy msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" +"Å holde Home Manager %s i %s er avviklet,\n" +"vennligst flytt det til %s" #: home-manager/home-manager:86 msgid "No configuration file found. Please create one at %s" @@ -38,7 +41,7 @@ msgstr "Fant ikke noen oppsettsfil. Opprett en i %s" #: home-manager/home-manager:101 msgid "Home Manager not found at %s." -msgstr "" +msgstr "Home Manager var ikke funnet på %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:109 @@ -75,7 +78,7 @@ msgstr "Kontrollerer at Nix fungerer" #: home-manager/home-manager:160 msgid "Could not find suitable profile directory, tried %s and %s" -msgstr "" +msgstr "Kunne ikke finne en passende profilmappe, prøvde %s og %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:215 @@ -92,12 +95,13 @@ msgid "Run '%s --help' for usage help" msgstr "Kjør «%s --help» for brukshjelp" #: home-manager/home-manager:319 home-manager/home-manager:423 +#, fuzzy msgid "The file %s already exists, leaving it unchanged..." -msgstr "" +msgstr "Filen %s eksisterer fra før, lar den være uendret..." #: home-manager/home-manager:321 home-manager/home-manager:425 msgid "Creating %s..." -msgstr "" +msgstr "Lager %s..." #: home-manager/home-manager:467 msgid "Creating initial Home Manager generation..." diff --git a/modules/po/nb_NO.po b/modules/po/nb_NO.po index b5f759a84cf5..b1f4cfaa0c42 100644 --- a/modules/po/nb_NO.po +++ b/modules/po/nb_NO.po @@ -8,16 +8,16 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2023-03-08 07:22+0000\n" -"Last-Translator: \"Kim A. Ødegaard\" \n" -"Language-Team: Norwegian Bokmål \n" +"PO-Revision-Date: 2024-04-02 21:38+0000\n" +"Last-Translator: LilleAila \n" +"Language-Team: Norwegian Bokmål \n" "Language: nb_NO\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.16.2-dev\n" +"X-Generator: Weblate 5.5-dev\n" #: modules/files.nix:236 msgid "Creating home file links in %s" @@ -73,7 +73,7 @@ msgstr "" #: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" -msgstr "" +msgstr "Kunne ikke finne en passende profilmappe, prøvde %s og %s" #: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" @@ -109,11 +109,11 @@ msgstr "" #: modules/lib-bash/activation-init.sh:127 msgid "Error: USER is set to \"%s\" but we expect \"%s\"" -msgstr "" +msgstr "Feil: USER er satt til \"%s\", men vi forventet \"%s\"" #: modules/lib-bash/activation-init.sh:136 msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" -msgstr "" +msgstr "Feil: HOME er satt til \"%s\", men vi forventet \"%s\"" #: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" From 7e91f2a0ba4b62b88591279d54f741a13e36245b Mon Sep 17 00:00:00 2001 From: Vonfry Date: Thu, 4 Apr 2024 14:26:54 +0800 Subject: [PATCH 163/636] xmonad: fix cp failure if libFiles with subdirectories --- modules/services/window-managers/xmonad.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/services/window-managers/xmonad.nix b/modules/services/window-managers/xmonad.nix index 59b403d30650..076f3cd47bfe 100644 --- a/modules/services/window-managers/xmonad.nix +++ b/modules/services/window-managers/xmonad.nix @@ -124,6 +124,7 @@ in { cfg.libFiles) }) for key in "''${!libFiles[@]}"; do + mkdir -p "xmonad-config/lib/$(dirname "$key")" cp "''${libFiles[$key]}" "xmonad-config/lib/$key"; done From 9de3aab0917914baad72e32023834f9b39e77610 Mon Sep 17 00:00:00 2001 From: Nathaniel Barragan Date: Thu, 4 Apr 2024 21:08:04 +0000 Subject: [PATCH 164/636] kdeconnect: add package option --- modules/services/kdeconnect.nix | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/services/kdeconnect.nix b/modules/services/kdeconnect.nix index 0c6aac31e80f..39673131489f 100644 --- a/modules/services/kdeconnect.nix +++ b/modules/services/kdeconnect.nix @@ -5,7 +5,6 @@ with lib; let cfg = config.services.kdeconnect; - package = pkgs.plasma5Packages.kdeconnect-kde; in { meta.maintainers = [ maintainers.adisbladis ]; @@ -13,6 +12,12 @@ in { options = { services.kdeconnect = { enable = mkEnableOption "KDE connect"; + package = mkOption { + type = types.package; + default = pkgs.plasma5Packages.kdeconnect-kde; + example = literalExpression "pkgs.kdePackages.kdeconnect-kde"; + description = "The KDE connect package to use"; + }; indicator = mkOption { type = types.bool; @@ -25,7 +30,7 @@ in { config = mkMerge [ (mkIf cfg.enable { - home.packages = [ package ]; + home.packages = [ cfg.package ]; assertions = [ (hm.assertions.assertPlatform "services.kdeconnect" pkgs @@ -44,7 +49,7 @@ in { Service = { Environment = "PATH=${config.home.profileDirectory}/bin"; - ExecStart = "${package}/libexec/kdeconnectd"; + ExecStart = "${cfg.package}/libexec/kdeconnectd"; Restart = "on-abort"; }; }; @@ -72,7 +77,7 @@ in { Service = { Environment = "PATH=${config.home.profileDirectory}/bin"; - ExecStart = "${package}/bin/kdeconnect-indicator"; + ExecStart = "${cfg.package}/bin/kdeconnect-indicator"; Restart = "on-abort"; }; }; From 0c73c1b8da28a24c4fe842ced3f2548d5828b550 Mon Sep 17 00:00:00 2001 From: Gabriel Venberg Date: Thu, 4 Apr 2024 16:29:27 -0500 Subject: [PATCH 165/636] zoxide: remove obsolete workaround Since version 9.3, zoxide has updated its nusehll init script to work with the latest version of nushell. --- modules/programs/zoxide.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/programs/zoxide.nix b/modules/programs/zoxide.nix index 89b634220e92..3dcbbd67bb8e 100644 --- a/modules/programs/zoxide.nix +++ b/modules/programs/zoxide.nix @@ -87,8 +87,6 @@ in { mkdir $zoxide_cache } ${cfg.package}/bin/zoxide init nushell ${cfgOptions} | - str replace "def-env" "def --env" --all | # https://github.com/ajeetdsouza/zoxide/pull/632 - str replace --all "-- $rest" "-- ...$rest" | save --force ${config.xdg.cacheHome}/zoxide/init.nu ''; extraConfig = '' From 1ffd393cba9eb12df94641238f4436cabb285c9b Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Fri, 5 Apr 2024 13:47:15 +0200 Subject: [PATCH 166/636] Translate using Weblate (Catalan) Currently translated at 100.0% (36 of 36 strings) Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ca/ Translation: Home Manager/Home Manager CLI Co-authored-by: Leix b --- home-manager/po/ca.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/ca.po b/home-manager/po/ca.po index b4a947b2655d..fe90504c0c2c 100644 --- a/home-manager/po/ca.po +++ b/home-manager/po/ca.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-02-15 16:04+0100\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-04-05 11:01+0000\n" +"Last-Translator: Leix b \n" "Language-Team: Catalan \n" "Language: ca\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #: home-manager/home-manager:58 msgid "No configuration file found at %s" @@ -186,7 +186,7 @@ msgstr "Configuració \"news.display\" no reconeguda \"%s\"." #: home-manager/home-manager:586 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Si us plau, defineix les variables de entorn $EDITOR o $VISUAL" #: home-manager/home-manager:604 msgid "Cannot run build in read-only directory" From 782eed8bb64b27acaeb7c17be4a095c85e65717f Mon Sep 17 00:00:00 2001 From: "O. C. Taskin" <42993892+octvs@users.noreply.github.com> Date: Fri, 5 Apr 2024 13:48:20 +0200 Subject: [PATCH 167/636] programs.khal: add "addresses" option + tidy up (#5221) - Add `accounts..accounts..khal.addresses` option to enable new configuration option, "addresses", from khal, which is used for showing participation status [1]. - Remove mistaken new line in khal implementation, refer to [2]. - Make additions to the existing test case to check the new addresses feature. And remove the empty lines in expected configs. [1]: https://khal.readthedocs.io/en/latest/configure.html#the-calendars-section [2]: https://github.com/nix-community/home-manager/pull/5192#pullrequestreview-1975091763 --- modules/programs/khal-accounts.nix | 9 ++++++ modules/programs/khal.nix | 4 ++- tests/modules/programs/khal/config.nix | 28 +++++++++++++++++++ .../programs/khal/khal-config-expected | 20 ++++++++++--- 4 files changed, 56 insertions(+), 5 deletions(-) diff --git a/modules/programs/khal-accounts.nix b/modules/programs/khal-accounts.nix index 846e18fa3edd..bbf222d901e6 100644 --- a/modules/programs/khal-accounts.nix +++ b/modules/programs/khal-accounts.nix @@ -31,5 +31,14 @@ with lib; Priority of a calendar used for coloring (calendar with highest priority is preferred). ''; }; + + addresses = mkOption { + type = types.listOf types.str; + default = [ ]; + description = '' + Email addresses to be associated with this account. Used to check the + participation status ("PARTSTAT"), refer to khal documentation. + ''; + }; }; } diff --git a/modules/programs/khal.nix b/modules/programs/khal.nix index 52e7796374ee..50ccb681e9ae 100644 --- a/modules/programs/khal.nix +++ b/modules/programs/khal.nix @@ -45,8 +45,10 @@ let + (optionalString (value.khal.type == "birthdays" && value.khal ? thisCollection) value.khal.thisCollection) - }\n " + }" ] ++ optional (value.khal.readOnly) "readonly = True" + ++ optional (value.khal.addresses != [ ]) + "addresses= ${lib.concatStringsSep ", " value.khal.addresses}" ++ optional (value.khal.color != null) "color = '${value.khal.color}'" ++ [ (toKeyValueIfDefined (getAttrs [ "type" "priority" ] value.khal)) ] ++ [ "\n" ]); diff --git a/tests/modules/programs/khal/config.nix b/tests/modules/programs/khal/config.nix index 017a04ace705..c4a359458805 100644 --- a/tests/modules/programs/khal/config.nix +++ b/tests/modules/programs/khal/config.nix @@ -30,6 +30,34 @@ url = "https://example.com/events.ical"; }; }; + testWithAddresss = { + khal = { + enable = true; + addresses = [ "john.doe@email.com" ]; + }; + local = { + type = "filesystem"; + fileExt = ".ics"; + }; + remote = { + type = "http"; + url = "https://example.com/events.ical"; + }; + }; + testWithMultipleAddresss = { + khal = { + enable = true; + addresses = [ "john.doe@email.com" "another.brick@on.the.wall" ]; + }; + local = { + type = "filesystem"; + fileExt = ".ics"; + }; + remote = { + type = "http"; + url = "https://example.com/events.ical"; + }; + }; }; }; diff --git a/tests/modules/programs/khal/khal-config-expected b/tests/modules/programs/khal/khal-config-expected index 157d650badbd..32fe7270f822 100644 --- a/tests/modules/programs/khal/khal-config-expected +++ b/tests/modules/programs/khal/khal-config-expected @@ -1,7 +1,6 @@ [calendars] [[test]] path = /home/hm-user/$XDG_CONFIG_HOME/cal/test/ - readonly = True color = '#ff0000' priority=10 @@ -9,9 +8,24 @@ type=calendar +[[testWithAddresss]] +path = /home/hm-user/$XDG_CONFIG_HOME/cal/testWithAddresss/ +addresses= john.doe@email.com +priority=10 +type=calendar + + + +[[testWithMultipleAddresss]] +path = /home/hm-user/$XDG_CONFIG_HOME/cal/testWithMultipleAddresss/ +addresses= john.doe@email.com, another.brick@on.the.wall +priority=10 +type=calendar + + + [[testcontacts-automaticallyCollected]] path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontacts/automaticallyCollected - priority=10 type=birthdays @@ -19,7 +33,6 @@ type=birthdays [[testcontacts-default]] path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontacts/default - priority=10 type=birthdays @@ -27,7 +40,6 @@ type=birthdays [[testcontactsNoCollections]] path = /home/hm-user/$XDG_CONFIG_HOME/card/testcontactsNoCollections/ - priority=10 type=birthdays From b787726a8413e11b074cde42704b4af32d95545c Mon Sep 17 00:00:00 2001 From: Smaug123 Date: Fri, 5 Apr 2024 14:05:00 +0100 Subject: [PATCH 168/636] home-manager: extract inline shell script to file --- modules/files.nix | 57 +++-------------------------- modules/files/check-link-targets.sh | 53 +++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 51 deletions(-) create mode 100644 modules/files/check-link-targets.sh diff --git a/modules/files.nix b/modules/files.nix index 50f6ca8124fd..59e9c25783c7 100644 --- a/modules/files.nix +++ b/modules/files.nix @@ -79,59 +79,14 @@ in (mapAttrsToList (n: v: v.target) (filterAttrs (n: v: v.force) cfg)); - check = pkgs.writeText "check" '' - ${config.lib.bash.initHomeManagerLib} - - # A symbolic link whose target path matches this pattern will be - # considered part of a Home Manager generation. - homeFilePattern="$(readlink -e ${escapeShellArg builtins.storeDir})/*-home-manager-files/*" - - forcedPaths=(${forcedPaths}) - - newGenFiles="$1" - shift - for sourcePath in "$@" ; do - relativePath="''${sourcePath#$newGenFiles/}" - targetPath="$HOME/$relativePath" + storeDir = escapeShellArg builtins.storeDir; - forced="" - for forcedPath in "''${forcedPaths[@]}"; do - if [[ $targetPath == $forcedPath* ]]; then - forced="yeah" - break - fi - done - - if [[ -n $forced ]]; then - verboseEcho "Skipping collision check for $targetPath" - elif [[ -e "$targetPath" \ - && ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then - # The target file already exists and it isn't a symlink owned by Home Manager. - if cmp -s "$sourcePath" "$targetPath"; then - # First compare the files' content. If they're equal, we're fine. - warnEcho "Existing file '$targetPath' is in the way of '$sourcePath', will be skipped since they are the same" - elif [[ ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then - # Next, try to move the file to a backup location if configured and possible - backup="$targetPath.$HOME_MANAGER_BACKUP_EXT" - if [[ -e "$backup" ]]; then - errorEcho "Existing file '$backup' would be clobbered by backing up '$targetPath'" - collision=1 - else - warnEcho "Existing file '$targetPath' is in the way of '$sourcePath', will be moved to '$backup'" - fi - else - # Fail if nothing else works - errorEcho "Existing file '$targetPath' is in the way of '$sourcePath'" - collision=1 - fi - fi - done + check = pkgs.substituteAll { + src = ./files/check-link-targets.sh; - if [[ -v collision ]] ; then - errorEcho "Please move the above files and try again or use 'home-manager switch -b backup' to back up existing files automatically." - exit 1 - fi - ''; + inherit (config.lib.bash) initHomeManagerLib; + inherit forcedPaths storeDir; + }; in '' function checkNewGenCollision() { diff --git a/modules/files/check-link-targets.sh b/modules/files/check-link-targets.sh new file mode 100644 index 000000000000..c3200d336fb6 --- /dev/null +++ b/modules/files/check-link-targets.sh @@ -0,0 +1,53 @@ +# -*- mode: sh; sh-shell: bash -*- + +@initHomeManagerLib@ + +# A symbolic link whose target path matches this pattern will be +# considered part of a Home Manager generation. +homeFilePattern="$(readlink -e @storeDir@)/*-home-manager-files/*" + +forcedPaths=(@forcedPaths@) + +newGenFiles="$1" +shift +for sourcePath in "$@" ; do + relativePath="${sourcePath#$newGenFiles/}" + targetPath="$HOME/$relativePath" + + forced="" + for forcedPath in "${forcedPaths[@]}"; do + if [[ $targetPath == $forcedPath* ]]; then + forced="yeah" + break + fi + done + + if [[ -n $forced ]]; then + verboseEcho "Skipping collision check for $targetPath" + elif [[ -e "$targetPath" \ + && ! "$(readlink "$targetPath")" == $homeFilePattern ]] ; then + # The target file already exists and it isn't a symlink owned by Home Manager. + if cmp -s "$sourcePath" "$targetPath"; then + # First compare the files' content. If they're equal, we're fine. + warnEcho "Existing file '$targetPath' is in the way of '$sourcePath', will be skipped since they are the same" + elif [[ ! -L "$targetPath" && -n "$HOME_MANAGER_BACKUP_EXT" ]] ; then + # Next, try to move the file to a backup location if configured and possible + backup="$targetPath.$HOME_MANAGER_BACKUP_EXT" + if [[ -e "$backup" ]]; then + errorEcho "Existing file '$backup' would be clobbered by backing up '$targetPath'" + collision=1 + else + warnEcho "Existing file '$targetPath' is in the way of '$sourcePath', will be moved to '$backup'" + fi + else + # Fail if nothing else works + errorEcho "Existing file '$targetPath' is in the way of '$sourcePath'" + collision=1 + fi + fi +done + +if [[ -v collision ]] ; then + errorEcho "Please move the above files and try again or use 'home-manager switch -b backup' to back up existing files automatically." + exit 1 +fi From a561ad6ab38578c812cc9af3b04f2cc60ebf48c9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 7 Apr 2024 03:59:32 +0000 Subject: [PATCH 169/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/d8fe5e6c92d0d190646fb9f1056741a229980089' (2024-03-29) → 'github:NixOS/nixpkgs/fd281bd6b7d3e32ddfa399853946f782553163b5' (2024-04-03) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index f8efa105a5db..5dd1e12d9377 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1711703276, - "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", + "lastModified": 1712163089, + "narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", + "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5", "type": "github" }, "original": { From 40a99619da804a78a0b166e5c6911108c059c3a8 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Tue, 9 Apr 2024 01:57:29 -0500 Subject: [PATCH 170/636] =?UTF-8?q?fzf:=20add=20compatibility=20with=20fzf?= =?UTF-8?q?=E2=89=A50.48.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fzf 0.48.0 [1] changed the way it integrates with shells. [1] https://github.com/junegunn/fzf/releases/tag/0.48.0 --- modules/programs/fzf.nix | 53 +++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/modules/programs/fzf.nix b/modules/programs/fzf.nix index 062df18645ed..31df95de6305 100644 --- a/modules/programs/fzf.nix +++ b/modules/programs/fzf.nix @@ -10,6 +10,35 @@ let concatStringsSep "," (mapAttrsToList (name: value: "${name}:${value}") colors); + hasShellIntegrationEmbedded = lib.versionAtLeast cfg.package.version "0.48.0"; + + bashIntegration = if hasShellIntegrationEmbedded then '' + if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then + eval "$(${getExe cfg.package} --bash)" + fi + '' else '' + if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then + . ${cfg.package}/share/fzf/completion.bash + . ${cfg.package}/share/fzf/key-bindings.bash + fi + ''; + + zshIntegration = if hasShellIntegrationEmbedded then '' + if [[ $options[zle] = on ]]; then + eval "$(${getExe cfg.package} --zsh)" + fi + '' else '' + if [[ $options[zle] = on ]]; then + . ${cfg.package}/share/fzf/completion.zsh + . ${cfg.package}/share/fzf/key-bindings.zsh + fi + ''; + + fishIntegration = if hasShellIntegrationEmbedded then '' + ${getExe cfg.package} --fish | source + '' else '' + source ${cfg.package}/share/fzf/key-bindings.fish && fzf_key_bindings + ''; in { imports = [ (mkRemovedOptionModule [ "programs" "fzf" "historyWidgetCommand" ] @@ -173,26 +202,16 @@ in { # Note, since fzf unconditionally binds C-r we use `mkOrder` to make the # initialization show up a bit earlier. This is to make initialization of # other history managers, like mcfly or atuin, take precedence. - programs.bash.initExtra = mkIf cfg.enableBashIntegration (mkOrder 200 '' - if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then - . ${cfg.package}/share/fzf/completion.bash - . ${cfg.package}/share/fzf/key-bindings.bash - fi - ''); + programs.bash.initExtra = + mkIf cfg.enableBashIntegration (mkOrder 200 bashIntegration); # Note, since fzf unconditionally binds C-r we use `mkOrder` to make the # initialization show up a bit earlier. This is to make initialization of # other history managers, like mcfly or atuin, take precedence. - programs.zsh.initExtra = mkIf cfg.enableZshIntegration (mkOrder 200 '' - if [[ $options[zle] = on ]]; then - . ${cfg.package}/share/fzf/completion.zsh - . ${cfg.package}/share/fzf/key-bindings.zsh - fi - ''); - - programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration - (mkOrder 200 '' - source ${cfg.package}/share/fzf/key-bindings.fish && fzf_key_bindings - ''); + programs.zsh.initExtra = + mkIf cfg.enableZshIntegration (mkOrder 200 zshIntegration); + + programs.fish.interactiveShellInit = + mkIf cfg.enableFishIntegration (mkOrder 200 fishIntegration); }; } From b00d0e4fe9cba0047f54e77418ddda5f17e6ef2c Mon Sep 17 00:00:00 2001 From: Jack W <29169102+Jack5079@users.noreply.github.com> Date: Tue, 9 Apr 2024 14:48:15 -0400 Subject: [PATCH 171/636] bun: add module --- modules/lib/maintainers.nix | 6 ++++ modules/misc/news.nix | 7 +++++ modules/modules.nix | 1 + modules/programs/bun.nix | 59 +++++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 modules/programs/bun.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 174a7d363d4f..2c4fbd9daabb 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -77,6 +77,12 @@ githubId = 32838899; name = "Daniel Wagenknecht"; }; + jack5079 = { + name = "Jack W."; + email = "nix@jack.cab"; + github = "jack5079"; + githubId = 29169102; + }; jkarlson = { email = "jekarlson@gmail.com"; github = "jkarlson"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 70a943de3324..97b8da7bbae4 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1469,6 +1469,13 @@ in { A new module is available: 'services.activitywatch'. ''; } + + { + time = "2024-04-08T21:43:38+00:00"; + message = '' + A new module is available: 'programs.bun'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index cd4abb722241..ff48b21a546d 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -72,6 +72,7 @@ let ./programs/broot.nix ./programs/browserpass.nix ./programs/btop.nix + ./programs/bun.nix ./programs/carapace.nix ./programs/cava.nix ./programs/chromium.nix diff --git a/modules/programs/bun.nix b/modules/programs/bun.nix new file mode 100644 index 000000000000..f186982e2761 --- /dev/null +++ b/modules/programs/bun.nix @@ -0,0 +1,59 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.programs.bun; + tomlFormat = pkgs.formats.toml { }; +in { + meta.maintainers = [ lib.hm.maintainers.jack5079 ]; + + options.programs.bun = { + enable = lib.mkEnableOption "Bun JavaScript runtime"; + + package = lib.mkPackageOption pkgs "bun" { }; + + settings = lib.mkOption { + type = tomlFormat.type; + default = { }; + example = lib.literalExpression '' + { + smol = true; + telemetry = false; + test = { + coverage = true; + coverageThreshold = 0.9; + }; + install.lockfile = { + print = "yarn"; + }; + } + ''; + description = '' + Configuration written to + {file}`$XDG_CONFIG_HOME/.bunfig.toml`. + + See + for the full list of options. + ''; + }; + + enableGitIntegration = lib.mkEnableOption "Git integration" // { + default = true; + }; + }; + + config = lib.mkIf cfg.enable { + home.packages = [ cfg.package ]; + + xdg.configFile.".bunfig.toml" = lib.mkIf (cfg.settings != { }) { + source = tomlFormat.generate "bun-config" cfg.settings; + }; + + # https://bun.sh/docs/install/lockfile#how-do-i-git-diff-bun-s-lockfile + programs.git.attributes = + lib.mkIf cfg.enableGitIntegration [ "*.lockb binary diff=lockb" ]; + programs.git.extraConfig.diff.lockb = lib.mkIf cfg.enableGitIntegration { + textconv = lib.getExe cfg.package; + binary = true; + }; + }; +} From 18f89ef74f0d48635488ccd6a5e30dc9d48a3a87 Mon Sep 17 00:00:00 2001 From: Tony Zorman Date: Wed, 10 Apr 2024 08:29:32 +0200 Subject: [PATCH 172/636] firefox: add containersForce flag Firefox, upon exit, creates the default containers.json file in place of the one that home-manager created. This leads to errors when switching to a new profile, as home-manager is careful with overwriting existing files. The added option toggles that behaviour. Closes: https://github.com/nix-community/home-manager/issues/4989 --- modules/programs/firefox.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index 8ce84fcba721..cbf78fb0404f 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -573,6 +573,17 @@ in { }; }; + containersForce = mkOption { + type = types.bool; + default = false; + description = '' + Whether to force replace the existing containers + configuration. This is recommended since Firefox will + replace the symlink on every launch, but note that you'll + lose any existing configuration by enabling this. + ''; + }; + containers = mkOption { type = types.attrsOf (types.submodule ({ name, ... }: { options = { @@ -762,6 +773,7 @@ in { "${profilesPath}/${profile.path}/containers.json" = mkIf (profile.containers != { }) { + force = profile.containersForce; text = mkContainersJson profile.containers; }; From 31357486b0ef6f4e161e002b6893eeb4fafc3ca9 Mon Sep 17 00:00:00 2001 From: Ramses Date: Wed, 10 Apr 2024 16:39:52 +0200 Subject: [PATCH 173/636] fish: use the subcommand style for the status command (#4584) The flag style has been deprecated and will eventually be removed. --- modules/programs/fish.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 473d816007b8..fc11e512414f 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -459,14 +459,14 @@ in { ${cfg.shellInit} - status --is-login; and begin + status is-login; and begin # Login shell initialisation ${cfg.loginShellInit} end - status --is-interactive; and begin + status is-interactive; and begin # Abbreviations ${abbrsStr} From 40ab43ae98cb3e6f07eaeaa3f3ed56d589da21b0 Mon Sep 17 00:00:00 2001 From: Bryn Edwards Date: Sat, 13 Apr 2024 07:27:43 +0100 Subject: [PATCH 174/636] foot: set PATH in server's systemd unit file If not set, foot's terminal spawning shortcut will not work as the `footclient` binary is not on the server's PATH. --- modules/programs/foot.nix | 1 + .../modules/programs/foot/systemd-user-service-expected.service | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/programs/foot.nix b/modules/programs/foot.nix index 79832dced7e0..52bab9383483 100644 --- a/modules/programs/foot.nix +++ b/modules/programs/foot.nix @@ -68,6 +68,7 @@ in { }; Service = { + Environment = "PATH=${makeBinPath [ cfg.package ]}"; ExecStart = "${cfg.package}/bin/foot --server"; Restart = "on-failure"; OOMPolicy = "continue"; diff --git a/tests/modules/programs/foot/systemd-user-service-expected.service b/tests/modules/programs/foot/systemd-user-service-expected.service index 517344e531d6..0c452b9df5cf 100644 --- a/tests/modules/programs/foot/systemd-user-service-expected.service +++ b/tests/modules/programs/foot/systemd-user-service-expected.service @@ -2,6 +2,7 @@ WantedBy=graphical-session.target [Service] +Environment=PATH=@foot@/bin ExecStart=@foot@/bin/foot --server OOMPolicy=continue Restart=on-failure From 8fdf329526f06886b53b94ddf433848a0d142984 Mon Sep 17 00:00:00 2001 From: MiSumiSumi Date: Sat, 13 Apr 2024 23:50:15 +0900 Subject: [PATCH 175/636] neovim: enable use of external package manager (#5225) * neovim: add extraWrapperArgs option pass external arguments to neovim-unwrapper this gives users more flexibility in managing neovim configuration * neovim: add test for `extraWrapperArgs` --- modules/programs/neovim.nix | 25 ++++++++++++++++++++++- tests/modules/programs/neovim/runtime.nix | 14 +++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index a3b87ea24e1c..fad05c1c4936 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -198,6 +198,28 @@ in { ''; }; + extraWrapperArgs = mkOption { + type = with types; listOf str; + default = [ ]; + example = literalExpression '' + [ + "--suffix" + "LIBRARY_PATH" + ":" + "''${lib.makeLibraryPath [ pkgs.stdenv.cc.cc pkgs.zlib ]}" + "--suffix" + "PKG_CONFIG_PATH" + ":" + "''${lib.makeSearchPathOutput "dev" "lib/pkgconfig" [ pkgs.stdenv.cc.cc pkgs.zlib ]}" + ] + ''; + description = '' + Extra arguments to be passed to the neovim wrapper. + This option sets environment variables required for building and running binaries + with external package managers like mason.nvim. + ''; + }; + generatedConfigViml = mkOption { type = types.lines; visible = true; @@ -415,7 +437,8 @@ in { programs.neovim.finalPackage = pkgs.wrapNeovimUnstable cfg.package (neovimConfig // { - wrapperArgs = (lib.escapeShellArgs neovimConfig.wrapperArgs) + " " + wrapperArgs = (lib.escapeShellArgs + (neovimConfig.wrapperArgs ++ cfg.extraWrapperArgs)) + " " + extraMakeWrapperArgs + " " + extraMakeWrapperLuaCArgs + " " + extraMakeWrapperLuaArgs; wrapRc = false; diff --git a/tests/modules/programs/neovim/runtime.nix b/tests/modules/programs/neovim/runtime.nix index b9d9638a8bf3..7f39c84616d5 100644 --- a/tests/modules/programs/neovim/runtime.nix +++ b/tests/modules/programs/neovim/runtime.nix @@ -20,6 +20,17 @@ with lib; }; } ]; + extraWrapperArgs = let buildDeps = with pkgs; [ stdenv.cc.cc zlib ]; + in [ + "--suffix" + "LIBRARY_PATH" + ":" + "${lib.makeLibraryPath buildDeps}" + "--suffix" + "PKG_CONFIG_PATH" + ":" + "${lib.makeSearchPathOutput "dev" "lib/pkgconfig" buildDeps}" + ]; } { extraPython3Packages = ps: with ps; [ jedi pynvim ]; @@ -33,7 +44,10 @@ with lib; nmt.script = '' ftplugin="home-files/.config/nvim/after/ftplugin/c.vim" + nvimbin="home-path/bin/nvim" assertFileExists "$ftplugin" + assertFileRegex "$nvimbin" 'LIBRARY_PATH' + assertFileRegex "$nvimbin" 'PKG_CONFIG_PATH' ''; }; } From f33d5086d3f9128aba126135ea2a901c121ebf06 Mon Sep 17 00:00:00 2001 From: Mitchell Skaggs Date: Sat, 13 Apr 2024 12:59:33 -0500 Subject: [PATCH 176/636] rio: remove redundant `lib.mdDoc` call This is an error as of https://github.com/NixOS/nixpkgs/pull/303841 It seems to have been missed in https://github.com/nix-community/home-manager/pull/4215 --- modules/programs/rio.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/rio.nix b/modules/programs/rio.nix index 58c4720de1b4..5a5ce6fa3e97 100644 --- a/modules/programs/rio.nix +++ b/modules/programs/rio.nix @@ -6,7 +6,7 @@ let in { options.programs.rio = { enable = lib.mkEnableOption null // { - description = lib.mdDoc '' + description = '' Enable Rio, a terminal built to run everywhere, as a native desktop applications by Rust/WebGPU or even in the browsers powered by WebAssembly/WebGPU. ''; From 4cc3c91601b6083c3715516d5d891fa46c679e59 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 14 Apr 2024 08:56:05 +0200 Subject: [PATCH 177/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/fd281bd6b7d3e32ddfa399853946f782553163b5' (2024-04-03) → 'github:NixOS/nixpkgs/1042fd8b148a9105f3c0aca3a6177fd1d9360ba5' (2024-04-10) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 5dd1e12d9377..629407310339 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1712163089, - "narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=", + "lastModified": 1712791164, + "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5", + "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5", "type": "github" }, "original": { From 630a0992b3627c64e34f179fab68e3d48c6991c0 Mon Sep 17 00:00:00 2001 From: Philipp Mildenberger Date: Sun, 14 Apr 2024 08:58:16 +0200 Subject: [PATCH 178/636] nushell: fix nushell config path on darwin --- modules/programs/nushell.nix | 2 +- tests/modules/programs/carapace/nushell.nix | 4 ++-- tests/modules/programs/direnv/nushell.nix | 4 ++-- tests/modules/programs/nushell/example-settings.nix | 4 ++-- tests/modules/programs/oh-my-posh/nushell.nix | 6 +++--- tests/modules/programs/yazi/nushell-integration-enabled.nix | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/programs/nushell.nix b/modules/programs/nushell.nix index 5141997168c5..2ebd9554c929 100644 --- a/modules/programs/nushell.nix +++ b/modules/programs/nushell.nix @@ -6,7 +6,7 @@ let cfg = config.programs.nushell; - configDir = if pkgs.stdenv.isDarwin then + configDir = if pkgs.stdenv.isDarwin && !config.xdg.enable then "Library/Application Support/nushell" else "${config.xdg.configHome}/nushell"; diff --git a/tests/modules/programs/carapace/nushell.nix b/tests/modules/programs/carapace/nushell.nix index a025da18c35d..d97fa8985850 100644 --- a/tests/modules/programs/carapace/nushell.nix +++ b/tests/modules/programs/carapace/nushell.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { programs = { @@ -7,7 +7,7 @@ }; nmt.script = let - configDir = if pkgs.stdenv.isDarwin then + configDir = if pkgs.stdenv.isDarwin && !config.xdg.enable then "home-files/Library/Application Support/nushell" else "home-files/.config/nushell"; diff --git a/tests/modules/programs/direnv/nushell.nix b/tests/modules/programs/direnv/nushell.nix index 46f34ebd8a4c..6655f01a8c6d 100644 --- a/tests/modules/programs/direnv/nushell.nix +++ b/tests/modules/programs/direnv/nushell.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { programs.nushell.enable = true; @@ -7,7 +7,7 @@ test.stubs.nushell = { }; nmt.script = let - configFile = if pkgs.stdenv.isDarwin then + configFile = if pkgs.stdenv.isDarwin && !config.xdg.enable then "home-files/Library/Application Support/nushell/config.nu" else "home-files/.config/nushell/config.nu"; diff --git a/tests/modules/programs/nushell/example-settings.nix b/tests/modules/programs/nushell/example-settings.nix index 73038584b628..d870eb9db0ee 100644 --- a/tests/modules/programs/nushell/example-settings.nix +++ b/tests/modules/programs/nushell/example-settings.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { programs.nushell = { @@ -34,7 +34,7 @@ test.stubs.nushell = { }; nmt.script = let - configDir = if pkgs.stdenv.isDarwin then + configDir = if pkgs.stdenv.isDarwin && !config.xdg.enable then "home-files/Library/Application Support/nushell" else "home-files/.config/nushell"; diff --git a/tests/modules/programs/oh-my-posh/nushell.nix b/tests/modules/programs/oh-my-posh/nushell.nix index ad77f821aa14..da4ffafd360b 100644 --- a/tests/modules/programs/oh-my-posh/nushell.nix +++ b/tests/modules/programs/oh-my-posh/nushell.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { programs = { @@ -16,12 +16,12 @@ }; nmt.script = let - configFile = if pkgs.stdenv.isDarwin then + configFile = if pkgs.stdenv.isDarwin && !config.xdg.enable then "home-files/Library/Application Support/nushell/config.nu" else "home-files/.config/nushell/config.nu"; - envFile = if pkgs.stdenv.isDarwin then + envFile = if pkgs.stdenv.isDarwin && !config.xdg.enable then "home-files/Library/Application Support/nushell/env.nu" else "home-files/.config/nushell/env.nu"; diff --git a/tests/modules/programs/yazi/nushell-integration-enabled.nix b/tests/modules/programs/yazi/nushell-integration-enabled.nix index ddd041dc043b..9adbaa982899 100644 --- a/tests/modules/programs/yazi/nushell-integration-enabled.nix +++ b/tests/modules/programs/yazi/nushell-integration-enabled.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: let shellIntegration = '' @@ -23,7 +23,7 @@ in { test.stubs.yazi = { }; nmt.script = let - configPath = if pkgs.stdenv.isDarwin then + configPath = if pkgs.stdenv.isDarwin && !config.xdg.enable then "home-files/Library/Application Support/nushell/config.nu" else "home-files/.config/nushell/config.nu"; From 76a1650c45df8ed130e66eeeb8275a149562c4c5 Mon Sep 17 00:00:00 2001 From: Jose Plana Date: Wed, 10 Apr 2024 10:24:46 +0200 Subject: [PATCH 179/636] k9s: fix typos in configuration file names --- modules/programs/k9s.nix | 8 ++++---- tests/modules/programs/k9s/example-settings.nix | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/programs/k9s.nix b/modules/programs/k9s.nix index 900e129e1034..a9e3fe55a471 100644 --- a/modules/programs/k9s.nix +++ b/modules/programs/k9s.nix @@ -80,7 +80,7 @@ in { type = yamlFormat.type; default = { }; description = '' - Hotkeys written to {file}`$XDG_CONFIG_HOME/k9s/hotkey.yaml`. See + Hotkeys written to {file}`$XDG_CONFIG_HOME/k9s/hotkeys.yaml`. See for supported values. ''; example = literalExpression '' @@ -101,7 +101,7 @@ in { type = yamlFormat.type; default = { }; description = '' - Plugins written to {file}`$XDG_CONFIG_HOME/k9s/plugin.yaml`. See + Plugins written to {file}`$XDG_CONFIG_HOME/k9s/plugins.yaml`. See for supported values. ''; example = literalExpression '' @@ -178,11 +178,11 @@ in { source = yamlFormat.generate "k9s-aliases" cfg.aliases; }; - "k9s/hotkey.yaml" = mkIf (cfg.hotkey != { }) { + "k9s/hotkeys.yaml" = mkIf (cfg.hotkey != { }) { source = yamlFormat.generate "k9s-hotkey" cfg.hotkey; }; - "k9s/plugin.yaml" = mkIf (cfg.plugin != { }) { + "k9s/plugins.yaml" = mkIf (cfg.plugin != { }) { source = yamlFormat.generate "k9s-plugin" cfg.plugin; }; diff --git a/tests/modules/programs/k9s/example-settings.nix b/tests/modules/programs/k9s/example-settings.nix index 7816a050fd2a..f37f192c3fb0 100644 --- a/tests/modules/programs/k9s/example-settings.nix +++ b/tests/modules/programs/k9s/example-settings.nix @@ -89,17 +89,17 @@ assertFileContent \ home-files/.config/k9s/skins/alt-skin.yaml \ ${./example-skin-expected-alt.yaml} - assertFileExists home-files/.config/k9s/hotkey.yaml + assertFileExists home-files/.config/k9s/hotkeys.yaml assertFileContent \ - home-files/.config/k9s/hotkey.yaml \ + home-files/.config/k9s/hotkeys.yaml \ ${./example-hotkey-expected.yaml} assertFileExists home-files/.config/k9s/aliases.yaml assertFileContent \ home-files/.config/k9s/aliases.yaml \ ${./example-aliases-expected.yaml} - assertFileExists home-files/.config/k9s/plugin.yaml + assertFileExists home-files/.config/k9s/plugins.yaml assertFileContent \ - home-files/.config/k9s/plugin.yaml \ + home-files/.config/k9s/plugins.yaml \ ${./example-plugin-expected.yaml} assertFileExists home-files/.config/k9s/views.yaml assertFileContent \ From 9f32c66a51d05e6d4ec0dea555bbff9135749ec7 Mon Sep 17 00:00:00 2001 From: Jose Plana Date: Wed, 10 Apr 2024 13:34:46 +0200 Subject: [PATCH 180/636] k9s: configuration files in Darwin without XDG Support alternate configuration files for k9s in darwin where XDG is not mandated and k9s expects configuration files in `~/Library/Application Support/k9s/`. --- modules/programs/k9s.nix | 63 +++++++++++++++---- tests/modules/programs/k9s/empty-settings.nix | 14 +++-- .../modules/programs/k9s/example-settings.nix | 39 +++++++----- 3 files changed, 85 insertions(+), 31 deletions(-) diff --git a/modules/programs/k9s.nix b/modules/programs/k9s.nix index a9e3fe55a471..6ef53291adfd 100644 --- a/modules/programs/k9s.nix +++ b/modules/programs/k9s.nix @@ -6,6 +6,7 @@ let cfg = config.programs.k9s; yamlFormat = pkgs.formats.yaml { }; + inherit (pkgs.stdenv.hostPlatform) isDarwin; in { meta.maintainers = with maintainers; [ @@ -33,7 +34,8 @@ in { type = yamlFormat.type; default = { }; description = '' - Configuration written to {file}`$XDG_CONFIG_HOME/k9s/config.yaml`. See + Configuration written to {file}`$XDG_CONFIG_HOME/k9s/config.yaml` (linux) + or {file}`Library/Application Support/k9s/config.yaml` (darwin), See for supported values. ''; example = literalExpression '' @@ -47,7 +49,8 @@ in { type = types.attrsOf yamlFormat.type; default = { }; description = '' - Skin files written to {file}`$XDG_CONFIG_HOME/k9s/skins/`. See + Skin files written to {file}`$XDG_CONFIG_HOME/k9s/skins/` (linux) + or {file}`Library/Application Support/k9s/skins/` (darwin). See for supported values. ''; example = literalExpression '' @@ -65,7 +68,8 @@ in { type = yamlFormat.type; default = { }; description = '' - Aliases written to {file}`$XDG_CONFIG_HOME/k9s/aliases.yaml`. See + Aliases written to {file}`$XDG_CONFIG_HOME/k9s/aliases.yaml` (linux) + or {file}`Library/Application Support/k9s/aliases.yaml` (darwin). See for supported values. ''; example = literalExpression '' @@ -80,7 +84,8 @@ in { type = yamlFormat.type; default = { }; description = '' - Hotkeys written to {file}`$XDG_CONFIG_HOME/k9s/hotkeys.yaml`. See + Hotkeys written to {file}`$XDG_CONFIG_HOME/k9s/hotkeys.yaml` (linux) + or {file}`Library/Application Support/k9s/hotkeys.yaml` (darwin). See for supported values. ''; example = literalExpression '' @@ -101,7 +106,8 @@ in { type = yamlFormat.type; default = { }; description = '' - Plugins written to {file}`$XDG_CONFIG_HOME/k9s/plugins.yaml`. See + Plugins written to {file}`$XDG_CONFIG_HOME/k9s/plugins.yaml (linux)` + or {file}`Library/Application Support/k9s/plugins.yaml` (darwin). See for supported values. ''; example = literalExpression '' @@ -132,7 +138,9 @@ in { type = yamlFormat.type; default = { }; description = '' - Resource column views written to {file}`$XDG_CONFIG_HOME/k9s/views.yaml`. + Resource column views written to + {file}`$XDG_CONFIG_HOME/k9s/views.yaml (linux)` + or {file}`Library/Application Support/k9s/views.yaml` (darwin). See for supported values. ''; example = literalExpression '' @@ -162,13 +170,19 @@ in { { }; skinFiles = mapAttrs' (name: value: - nameValuePair "k9s/skins/${name}.yaml" { - source = yamlFormat.generate "k9s-skin-${name}.yaml" value; - }) cfg.skins; + nameValuePair (if !(isDarwin && !config.xdg.enable) then + "k9s/skins/${name}.yaml" + else + "Library/Application Support/k9s/skins/${name}.yaml") { + source = yamlFormat.generate "k9s-skin-${name}.yaml" value; + }) cfg.skins; + + enableXdgConfig = !isDarwin || config.xdg.enable; + in mkIf cfg.enable { home.packages = [ cfg.package ]; - xdg.configFile = { + xdg.configFile = mkIf enableXdgConfig ({ "k9s/config.yaml" = mkIf (cfg.settings != { }) { source = yamlFormat.generate "k9s-config" (lib.recursiveUpdate skinSetting cfg.settings); @@ -189,6 +203,33 @@ in { "k9s/views.yaml" = mkIf (cfg.views != { }) { source = yamlFormat.generate "k9s-views" cfg.views; }; - } // skinFiles; + } // skinFiles); + + home.file = mkIf (!enableXdgConfig) ({ + "Library/Application Support/k9s/config.yaml" = + mkIf (cfg.settings != { }) { + source = yamlFormat.generate "k9s-config" + (lib.recursiveUpdate skinSetting cfg.settings); + }; + + "Library/Application Support/k9s/aliases.yaml" = + mkIf (cfg.aliases != { }) { + source = yamlFormat.generate "k9s-aliases" cfg.aliases; + }; + + "Library/Application Support/k9s/hotkeys.yaml" = + mkIf (cfg.hotkey != { }) { + source = yamlFormat.generate "k9s-hotkey" cfg.hotkey; + }; + + "Library/Application Support/k9s/plugins.yaml" = + mkIf (cfg.plugin != { }) { + source = yamlFormat.generate "k9s-plugin" cfg.plugin; + }; + + "Library/Application Support/k9s/views.yaml" = mkIf (cfg.views != { }) { + source = yamlFormat.generate "k9s-views" cfg.views; + }; + } // skinFiles); }; } diff --git a/tests/modules/programs/k9s/empty-settings.nix b/tests/modules/programs/k9s/empty-settings.nix index 5084be4fe065..355340054e90 100644 --- a/tests/modules/programs/k9s/empty-settings.nix +++ b/tests/modules/programs/k9s/empty-settings.nix @@ -1,11 +1,17 @@ -{ ... }: +{ pkgs, lib, ... }: { -{ programs.k9s.enable = true; + xdg.enable = lib.mkIf pkgs.stdenv.isDarwin (lib.mkForce false); + test.stubs.k9s = { }; - nmt.script = '' - assertPathNotExists home-files/.config/k9s + nmt.script = let + configDir = if !pkgs.stdenv.isDarwin then + ".config/k9s" + else + "Library/Application Support/k9s"; + in '' + assertPathNotExists home-files/${configDir} ''; } diff --git a/tests/modules/programs/k9s/example-settings.nix b/tests/modules/programs/k9s/example-settings.nix index f37f192c3fb0..23a42120b394 100644 --- a/tests/modules/programs/k9s/example-settings.nix +++ b/tests/modules/programs/k9s/example-settings.nix @@ -1,6 +1,8 @@ -{ config, ... }: +{ config, pkgs, lib, ... }: { + xdg.enable = lib.mkIf pkgs.stdenv.isDarwin (lib.mkForce false); + programs.k9s = { enable = true; package = config.lib.test.mkStubPackage { }; @@ -76,34 +78,39 @@ }; }; - nmt.script = '' - assertFileExists home-files/.config/k9s/config.yaml + nmt.script = let + configDir = if !pkgs.stdenv.isDarwin then + ".config/k9s" + else + "Library/Application Support/k9s"; + in '' + assertFileExists "home-files/${configDir}/config.yaml" assertFileContent \ - home-files/.config/k9s/config.yaml \ + "home-files/${configDir}/config.yaml" \ ${./example-config-expected.yaml} - assertFileExists home-files/.config/k9s/skins/default.yaml + assertFileExists "home-files/${configDir}/skins/default.yaml" assertFileContent \ - home-files/.config/k9s/skins/default.yaml \ + "home-files/${configDir}/skins/default.yaml" \ ${./example-skin-expected.yaml} - assertFileExists home-files/.config/k9s/skins/alt-skin.yaml + assertFileExists "home-files/${configDir}/skins/alt-skin.yaml" assertFileContent \ - home-files/.config/k9s/skins/alt-skin.yaml \ + "home-files/${configDir}/skins/alt-skin.yaml" \ ${./example-skin-expected-alt.yaml} - assertFileExists home-files/.config/k9s/hotkeys.yaml + assertFileExists "home-files/${configDir}/hotkeys.yaml" assertFileContent \ - home-files/.config/k9s/hotkeys.yaml \ + "home-files/${configDir}/hotkeys.yaml" \ ${./example-hotkey-expected.yaml} - assertFileExists home-files/.config/k9s/aliases.yaml + assertFileExists "home-files/${configDir}/aliases.yaml" assertFileContent \ - home-files/.config/k9s/aliases.yaml \ + "home-files/${configDir}/aliases.yaml" \ ${./example-aliases-expected.yaml} - assertFileExists home-files/.config/k9s/plugins.yaml + assertFileExists "home-files/${configDir}/plugins.yaml" assertFileContent \ - home-files/.config/k9s/plugins.yaml \ + "home-files/${configDir}/plugins.yaml" \ ${./example-plugin-expected.yaml} - assertFileExists home-files/.config/k9s/views.yaml + assertFileExists "home-files/${configDir}/views.yaml" assertFileContent \ - home-files/.config/k9s/views.yaml \ + "home-files/${configDir}/views.yaml" \ ${./example-views-expected.yaml} ''; } From 59d50bc582bdf439df096a9ae1781e6c9c8a7523 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Mon, 15 Apr 2024 01:40:27 -0600 Subject: [PATCH 181/636] espanso: enable module on darwin --- modules/services/espanso.nix | 34 ++++++++---- tests/default.nix | 1 + .../espanso-darwin/basic-configuration.nix | 55 +++++++++++++++++++ .../services/espanso-darwin/default.nix | 1 + .../services/espanso-darwin/launchd.plist | 29 ++++++++++ 5 files changed, 108 insertions(+), 12 deletions(-) create mode 100644 tests/modules/services/espanso-darwin/basic-configuration.nix create mode 100644 tests/modules/services/espanso-darwin/default.nix create mode 100644 tests/modules/services/espanso-darwin/launchd.plist diff --git a/modules/services/espanso.nix b/modules/services/espanso.nix index 404dfecd8582..a466b6f740a9 100644 --- a/modules/services/espanso.nix +++ b/modules/services/espanso.nix @@ -1,11 +1,9 @@ { pkgs, config, lib, ... }: let inherit (lib) - mkOption mkEnableOption mkIf maintainers literalExpression types platforms + mkOption mkEnableOption mkIf maintainers literalExpression types mkRemovedOptionModule versionAtLeast; - inherit (lib.hm.assertions) assertPlatform; - cfg = config.services.espanso; espansoVersion = cfg.package.version; @@ -99,15 +97,12 @@ in { }; config = mkIf cfg.enable { - assertions = [ - (assertPlatform "services.espanso" pkgs platforms.linux) - { - assertion = versionAtLeast espansoVersion "2"; - message = '' - The services.espanso module only supports Espanso version 2 or later. - ''; - } - ]; + assertions = [{ + assertion = versionAtLeast espansoVersion "2"; + message = '' + The services.espanso module only supports Espanso version 2 or later. + ''; + }]; home.packages = [ cfg.package ]; @@ -131,5 +126,20 @@ in { }; Install = { WantedBy = [ "default.target" ]; }; }; + + launchd.agents.espanso = { + enable = true; + config = { + ProgramArguments = [ "${cfg.package}/bin/espanso" "launcher" ]; + EnvironmentVariables.PATH = + "${cfg.package}/bin:/usr/bin:/bin:/usr/sbin:/sbin"; + KeepAlive = { + Crashed = true; + SuccessfulExit = false; + }; + ProcessType = "Background"; + RunAtLoad = true; + }; + }; }; } diff --git a/tests/default.nix b/tests/default.nix index 567b75d5a890..6253896616c4 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -163,6 +163,7 @@ in import nmtSrc { ./modules/xresources ] ++ lib.optionals isDarwin [ ./modules/launchd + ./modules/services/espanso-darwin ./modules/services/git-sync-darwin ./modules/services/imapnotify-darwin ./modules/services/nix-gc-darwin diff --git a/tests/modules/services/espanso-darwin/basic-configuration.nix b/tests/modules/services/espanso-darwin/basic-configuration.nix new file mode 100644 index 000000000000..4a2f2ee778de --- /dev/null +++ b/tests/modules/services/espanso-darwin/basic-configuration.nix @@ -0,0 +1,55 @@ +{ ... }: { + services.espanso = { + enable = true; + configs = { default = { show_notifications = false; }; }; + matches = { + base = { + matches = [ + { + trigger = ":now"; + replace = "It's {{currentdate}} {{currenttime}}"; + } + { + trigger = ":hello"; + replace = '' + line1 + line2''; + } + { + regex = ":hi(?P.*)\\."; + replace = "Hi {{person}}!"; + } + ]; + global_vars = [ + { + name = "currentdate"; + type = "date"; + params = { format = "%d/%m/%Y"; }; + } + { + name = "currenttime"; + type = "date"; + params = { format = "%R"; }; + } + ]; + }; + }; + }; + + test.stubs.espanso = { }; + + nmt.script = '' + serviceFile="LaunchAgents/org.nix-community.home.espanso.plist" + serviceFileNormalized="$(normalizeStorePaths "$serviceFile")" + assertFileExists $serviceFile + assertFileContent $serviceFileNormalized ${./launchd.plist} + + configFile=home-files/.config/espanso/config/default.yml + assertFileExists "$configFile" + assertFileContent "$configFile" ${../espanso/basic-configuration.yaml} + + matchFile=home-files/.config/espanso/match/base.yml + assertFileExists "$matchFile" + assertFileContent "$matchFile" ${../espanso/basic-matches.yaml} + ''; +} diff --git a/tests/modules/services/espanso-darwin/default.nix b/tests/modules/services/espanso-darwin/default.nix new file mode 100644 index 000000000000..6acb2f8d469c --- /dev/null +++ b/tests/modules/services/espanso-darwin/default.nix @@ -0,0 +1 @@ +{ espanso-darwin-basic-configuration = ./basic-configuration.nix; } diff --git a/tests/modules/services/espanso-darwin/launchd.plist b/tests/modules/services/espanso-darwin/launchd.plist new file mode 100644 index 000000000000..8cbc4af032f9 --- /dev/null +++ b/tests/modules/services/espanso-darwin/launchd.plist @@ -0,0 +1,29 @@ + + + + + EnvironmentVariables + + PATH + @espanso@/bin:/usr/bin:/bin:/usr/sbin:/sbin + + KeepAlive + + Crashed + + SuccessfulExit + + + Label + org.nix-community.home.espanso + ProcessType + Background + ProgramArguments + + @espanso@/bin/espanso + launcher + + RunAtLoad + + + \ No newline at end of file From 1c43dcfac48a2d622797f7ab741670fdbcf8f609 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 09:42:51 +0200 Subject: [PATCH 182/636] ci: bump peaceiris/actions-gh-pages from 3 to 4 Bumps [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) from 3 to 4. - [Release notes](https://github.com/peaceiris/actions-gh-pages/releases) - [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md) - [Commits](https://github.com/peaceiris/actions-gh-pages/compare/v3...v4) --- updated-dependencies: - dependency-name: peaceiris/actions-gh-pages dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/github_pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml index 238cb8436df5..32e670e8a607 100644 --- a/.github/workflows/github_pages.yml +++ b/.github/workflows/github_pages.yml @@ -22,7 +22,7 @@ jobs: nix-build -A docs.html cp -r result/share/doc/home-manager public - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./public From fa8c16e2452bf092ac76f09ee1fb1e9f7d0796e7 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Mon, 15 Apr 2024 19:57:48 +0200 Subject: [PATCH 183/636] systemd: add `enable` option --- modules/systemd.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/systemd.nix b/modules/systemd.nix index 041b9dfacb21..f209f65dd4dc 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -5,8 +5,8 @@ let cfg = config.systemd.user; inherit (lib) - any attrValues getAttr hm isBool literalExpression mkIf mkMerge mkOption - types; + any attrValues getAttr hm isBool literalExpression mkIf mkMerge + mkEnableOption mkOption types; settingsFormat = pkgs.formats.ini { listsAsDuplicateKeys = true; }; @@ -105,6 +105,11 @@ in { options = { systemd.user = { + enable = mkEnableOption "the user systemd service manager" // { + default = pkgs.stdenv.isLinux; + defaultText = literalExpression "pkgs.stdenv.isLinux"; + }; + systemctlPath = mkOption { default = "${pkgs.systemd}/bin/systemctl"; defaultText = literalExpression ''"''${pkgs.systemd}/bin/systemctl"''; @@ -286,7 +291,12 @@ in { # If we run under a Linux system we assume that systemd is # available, in particular we assume that systemctl is in PATH. # Do not install any user services if username is root. - config = mkIf (pkgs.stdenv.isLinux && config.home.username != "root") { + config = mkIf (cfg.enable && config.home.username != "root") { + assertions = [{ + assertion = pkgs.stdenv.isLinux; + message = "This module is only available on Linux."; + }]; + xdg.configFile = mkMerge [ (lib.listToAttrs ((buildServices "service" cfg.services) ++ (buildServices "slice" cfg.slices) From 93b917d49f0b2ab75ff91e17573e112b95fdd95c Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Wed, 17 Apr 2024 23:56:40 +0200 Subject: [PATCH 184/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/1042fd8b148a9105f3c0aca3a6177fd1d9360ba5' (2024-04-10) → 'github:NixOS/nixpkgs/5672bc9dbf9d88246ddab5ac454e82318d094bb8' (2024-04-16) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 629407310339..aeb905865332 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1712791164, - "narHash": "sha256-3sbWO1mbpWsLepZGbWaMovSO7ndZeFqDSdX0hZ9nVyw=", + "lastModified": 1713248628, + "narHash": "sha256-NLznXB5AOnniUtZsyy/aPWOk8ussTuePp2acb9U+ISA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1042fd8b148a9105f3c0aca3a6177fd1d9360ba5", + "rev": "5672bc9dbf9d88246ddab5ac454e82318d094bb8", "type": "github" }, "original": { From f46814ec7cbef9c2aef18ca1cbe89f2bb1e8c394 Mon Sep 17 00:00:00 2001 From: a-kenji Date: Wed, 17 Apr 2024 23:58:16 +0200 Subject: [PATCH 185/636] treewide: prefer the official wiki --- README.md | 2 +- docs/manual/installation.md | 2 +- docs/manual/nix-flakes.md | 2 +- docs/manual/nix-flakes/standalone.md | 2 +- modules/programs/firefox.nix | 6 +++--- modules/programs/qutebrowser.nix | 2 +- .../firefox/profile-settings-expected-bookmarks.html | 6 +++--- .../firefox/profile-settings-expected-search.json | 6 +++--- tests/modules/programs/firefox/profile-settings.nix | 11 ++++++----- 9 files changed, 20 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 486194aaea4e..4444fbbdb335 100644 --- a/README.md +++ b/README.md @@ -112,7 +112,7 @@ License This project is licensed under the terms of the [MIT license](LICENSE). [#home-manager]: https://webchat.oftc.net/?channels=home-manager -[Nix Flakes]: https://nixos.wiki/wiki/Flakes +[Nix Flakes]: https://wiki.nixos.org/wiki/Flakes [NixOS]: https://nixos.org/ [Nix]: https://nixos.org/explore.html [Nixpkgs]: https://github.com/NixOS/nixpkgs diff --git a/docs/manual/installation.md b/docs/manual/installation.md index b663b68806f2..07b1392d5161 100644 --- a/docs/manual/installation.md +++ b/docs/manual/installation.md @@ -24,7 +24,7 @@ Home Manager can be used in three primary ways: :::{.note} In this chapter we describe how to install Home Manager in the standard way using channels. If you prefer to use [Nix -Flakes](https://nixos.wiki/wiki/Flakes) then please see the instructions +Flakes](https://wiki.nixos.org/wiki/Flakes) then please see the instructions in [nix flakes](#ch-nix-flakes). ::: diff --git a/docs/manual/nix-flakes.md b/docs/manual/nix-flakes.md index 9ac5c0cf16ce..93f71feb868c 100644 --- a/docs/manual/nix-flakes.md +++ b/docs/manual/nix-flakes.md @@ -1,7 +1,7 @@ # Nix Flakes {#ch-nix-flakes} Home Manager is compatible with [Nix -Flakes](https://nixos.wiki/wiki/Flakes). But please be aware that this +Flakes](https://wiki.nixos.org/wiki/Flakes). But please be aware that this support is still experimental and may change in backwards incompatible ways. diff --git a/docs/manual/nix-flakes/standalone.md b/docs/manual/nix-flakes/standalone.md index 428f29bc5a05..4ee8278a6450 100644 --- a/docs/manual/nix-flakes/standalone.md +++ b/docs/manual/nix-flakes/standalone.md @@ -58,5 +58,5 @@ If you only want to update a single flake input, then the command You can also pass flake-related options such as `--recreate-lock-file` or `--update-input ` to `home-manager` when building or switching, and these options will be forwarded to `nix build`. See the -[NixOS Wiki page](https://nixos.wiki/wiki/Flakes) for details. +[NixOS Wiki page](https://wiki.nixos.org/wiki/Flakes) for details. ::: diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index cbf78fb0404f..cf62f82cd59b 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -459,7 +459,7 @@ in { { name = "wiki"; tags = [ "wiki" "nix" ]; - url = "https://nixos.wiki/"; + url = "https://wiki.nixos.org/"; } ]; } @@ -545,8 +545,8 @@ in { }; "NixOS Wiki" = { - urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; - iconUpdateURL = "https://nixos.wiki/favicon.png"; + urls = [{ template = "https://wiki.nixos.org/index.php?search={searchTerms}"; }]; + iconUpdateURL = "https://wiki.nixos.org/favicon.png"; updateInterval = 24 * 60 * 60 * 1000; # every day definedAliases = [ "@nw" ]; }; diff --git a/modules/programs/qutebrowser.nix b/modules/programs/qutebrowser.nix index 9c3ad6a86b81..04e5423d4f49 100644 --- a/modules/programs/qutebrowser.nix +++ b/modules/programs/qutebrowser.nix @@ -84,7 +84,7 @@ in { { w = "https://en.wikipedia.org/wiki/Special:Search?search={}&go=Go&ns0=1"; aw = "https://wiki.archlinux.org/?search={}"; - nw = "https://nixos.wiki/index.php?search={}"; + nw = "https://wiki.nixos.org/index.php?search={}"; g = "https://www.google.com/search?hl=en&q={}"; } ''; diff --git a/tests/modules/programs/firefox/profile-settings-expected-bookmarks.html b/tests/modules/programs/firefox/profile-settings-expected-bookmarks.html index d19eab612ea4..93bc195fb378 100644 --- a/tests/modules/programs/firefox/profile-settings-expected-bookmarks.html +++ b/tests/modules/programs/firefox/profile-settings-expected-bookmarks.html @@ -8,18 +8,18 @@

Bookmarks Menu

Bookmarks Toolbar

-

Home Manager +
Home Manager

wikipedia
kernel.org

Nix sites

homepage -
wiki +
wiki

Nix sites

homepage -
wiki +
wiki

diff --git a/tests/modules/programs/firefox/profile-settings-expected-search.json b/tests/modules/programs/firefox/profile-settings-expected-search.json index f17a0b91ef39..832b6c09c17c 100644 --- a/tests/modules/programs/firefox/profile-settings-expected-search.json +++ b/tests/modules/programs/firefox/profile-settings-expected-search.json @@ -31,8 +31,8 @@ "_definedAliases": [ "@nw" ], - "_iconURL": "https://nixos.wiki/favicon.png", - "_iconUpdateURL": "https://nixos.wiki/favicon.png", + "_iconURL": "https://wiki.nixos.org/favicon.png", + "_iconUpdateURL": "https://wiki.nixos.org/favicon.png", "_isAppProvided": false, "_loadPath": "[home-manager]/programs.firefox.profiles.search.search.engines.\"NixOS Wiki\"", "_metaData": { @@ -42,7 +42,7 @@ "_updateInterval": 86400000, "_urls": [ { - "template": "https://nixos.wiki/index.php?search={searchTerms}" + "template": "https://wiki.nixos.org/index.php?search={searchTerms}" } ] }, diff --git a/tests/modules/programs/firefox/profile-settings.nix b/tests/modules/programs/firefox/profile-settings.nix index 94fa9436eef4..8b781552b053 100644 --- a/tests/modules/programs/firefox/profile-settings.nix +++ b/tests/modules/programs/firefox/profile-settings.nix @@ -27,7 +27,7 @@ toolbar = true; bookmarks = [{ name = "Home Manager"; - url = "https://nixos.wiki/wiki/Home_Manager"; + url = "https://wiki.nixos.org/wiki/Home_Manager"; }]; } { @@ -51,7 +51,7 @@ { name = "wiki"; tags = [ "wiki" "nix" ]; - url = "https://nixos.wiki/"; + url = "https://wiki.nixos.org/"; } { name = "Nix sites"; @@ -62,7 +62,7 @@ } { name = "wiki"; - url = "https://nixos.wiki/"; + url = "https://wiki.nixos.org/"; } ]; } @@ -102,9 +102,10 @@ "NixOS Wiki" = { urls = [{ - template = "https://nixos.wiki/index.php?search={searchTerms}"; + template = + "https://wiki.nixos.org/index.php?search={searchTerms}"; }]; - iconUpdateURL = "https://nixos.wiki/favicon.png"; + iconUpdateURL = "https://wiki.nixos.org/favicon.png"; updateInterval = 24 * 60 * 60 * 1000; definedAliases = [ "@nw" ]; }; From 178e26895b3aef028a00a32fb7e7ed0fc660645c Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 18 Apr 2024 17:25:13 +0200 Subject: [PATCH 186/636] home-manager: error out on missing option argument Instead of an error line 958: $1: unbound variable we now emit an error such as missing argument for --cores Note, this is not perfect. In many cases you still get sub-optimal error messages. --- home-manager/home-manager | 21 +++++++++ home-manager/po/home-manager.pot | 81 +++++++++++++++++--------------- modules/po/hm-modules.pot | 14 +++--- 3 files changed, 71 insertions(+), 45 deletions(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index 1fa7af0e03f3..8e5fb4c5f5b8 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -11,6 +11,12 @@ export TEXTDOMAINDIR=@OUT@/share/locale # shellcheck disable=1091 source @HOME_MANAGER_LIB@ +function errMissingOptArg() { + # translators: For example: "home-manager: missing argument for --cores" + _iError "%s: missing argument for %s" "$0" "$1" >&2 + exit 1 +} + function setNixProfileCommands() { if [[ -e $HOME/.nix-profile/manifest.json \ || -e ${XDG_STATE_HOME:-$HOME/.local/state}/nix/profile/manifest.json ]] ; then @@ -277,10 +283,12 @@ function doInit() { switch=1 ;; --home-manager-url) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" homeManagerUrl="$1" shift ;; --nixpkgs-url) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" nixpkgsUrl="$1" shift ;; @@ -951,22 +959,27 @@ while [[ $# -gt 0 ]]; do COMMAND="$opt" ;; -A) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" HOME_MANAGER_CONFIG_ATTRIBUTE="$1" shift ;; -I) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" EXTRA_NIX_PATH+=("$1") shift ;; -b) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" export HOME_MANAGER_BACKUP_EXT="$1" shift ;; -f|--file) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" HOME_MANAGER_CONFIG="$1" shift ;; --flake) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" FLAKE_ARG="$1" shift ;; @@ -974,18 +987,23 @@ while [[ $# -gt 0 ]]; do PASSTHROUGH_OPTS+=("$opt") ;; --update-input) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" PASSTHROUGH_OPTS+=("$opt" "$1") shift ;; --override-input) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" + [[ -v 2 && $2 != -* ]] || errMissingOptArg "$opt $1" PASSTHROUGH_OPTS+=("$opt" "$1" "$2") shift 2 ;; --experimental-features) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" PASSTHROUGH_OPTS+=("$opt" "$1") shift ;; --extra-experimental-features) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" PASSTHROUGH_OPTS+=("$opt" "$1") shift ;; @@ -1003,10 +1021,13 @@ while [[ $# -gt 0 ]]; do export DRY_RUN=1 ;; --option|--arg|--argstr) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" + [[ -v 2 ]] || errMissingOptArg "$opt $1" PASSTHROUGH_OPTS+=("$opt" "$1" "$2") shift 2 ;; -j|--max-jobs|--cores|--builders) + [[ -v 1 && $1 != -* ]] || errMissingOptArg "$opt" PASSTHROUGH_OPTS+=("$opt" "$1") shift ;; diff --git a/home-manager/po/home-manager.pot b/home-manager/po/home-manager.pot index 4b238d100297..2fcdc5a6061a 100644 --- a/home-manager/po/home-manager.pot +++ b/home-manager/po/home-manager.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,36 +18,41 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -68,42 +73,42 @@ msgid "" " $ rm -r \"%s\"" msgstr "" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." msgstr "" -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "" -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "" #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -114,7 +119,7 @@ msgid "" msgstr "" #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -124,11 +129,11 @@ msgid "" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -138,72 +143,72 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "" -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" msgstr "" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "" -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "" -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "" -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "" -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 msgid "Yay!" msgstr "" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "" -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "" -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "" diff --git a/modules/po/hm-modules.pot b/modules/po/hm-modules.pot index e187449c80b2..7a33a805a218 100644 --- a/modules/po/hm-modules.pot +++ b/modules/po/hm-modules.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,23 +17,23 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: modules/files.nix:236 +#: modules/files.nix:191 msgid "Creating home file links in %s" msgstr "" -#: modules/files.nix:249 +#: modules/files.nix:204 msgid "Cleaning up orphan links from %s" msgstr "" -#: modules/files.nix:265 +#: modules/files.nix:220 msgid "Creating profile generation %s" msgstr "" -#: modules/files.nix:282 +#: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" msgstr "" -#: modules/home-environment.nix:622 +#: modules/home-environment.nix:634 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -49,7 +49,7 @@ msgid "" "Then try activating your Home Manager configuration again." msgstr "" -#: modules/home-environment.nix:655 +#: modules/home-environment.nix:667 msgid "Activating %s" msgstr "" From 7cebe921eaffd5f9880f0dab7a23789d15f6169b Mon Sep 17 00:00:00 2001 From: Hosted Weblate Date: Thu, 18 Apr 2024 17:26:10 +0200 Subject: [PATCH 187/636] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Co-authored-by: Hosted Weblate Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules --- home-manager/po/ca.po | 81 +++++++++++++++++++----------------- home-manager/po/cs.po | 81 +++++++++++++++++++----------------- home-manager/po/da.po | 81 +++++++++++++++++++----------------- home-manager/po/de.po | 81 +++++++++++++++++++----------------- home-manager/po/es.po | 81 +++++++++++++++++++----------------- home-manager/po/fa.po | 81 +++++++++++++++++++----------------- home-manager/po/fi.po | 81 +++++++++++++++++++----------------- home-manager/po/fr.po | 81 +++++++++++++++++++----------------- home-manager/po/id.po | 81 +++++++++++++++++++----------------- home-manager/po/it.po | 81 +++++++++++++++++++----------------- home-manager/po/ja.po | 81 +++++++++++++++++++----------------- home-manager/po/ko.po | 81 +++++++++++++++++++----------------- home-manager/po/lt.po | 85 ++++++++++++++++++++------------------ home-manager/po/nb_NO.po | 85 ++++++++++++++++++++------------------ home-manager/po/nl.po | 81 +++++++++++++++++++----------------- home-manager/po/pl.po | 81 +++++++++++++++++++----------------- home-manager/po/pt.po | 81 +++++++++++++++++++----------------- home-manager/po/pt_BR.po | 85 ++++++++++++++++++++------------------ home-manager/po/ro.po | 81 +++++++++++++++++++----------------- home-manager/po/ru.po | 81 +++++++++++++++++++----------------- home-manager/po/sv.po | 81 +++++++++++++++++++----------------- home-manager/po/th.po | 81 +++++++++++++++++++----------------- home-manager/po/tr.po | 81 +++++++++++++++++++----------------- home-manager/po/uk.po | 81 +++++++++++++++++++----------------- home-manager/po/vi.po | 81 +++++++++++++++++++----------------- home-manager/po/zh_Hans.po | 81 +++++++++++++++++++----------------- home-manager/po/zh_Hant.po | 81 +++++++++++++++++++----------------- modules/po/ca.po | 14 +++---- modules/po/cs.po | 14 +++---- modules/po/da.po | 14 +++---- modules/po/de.po | 14 +++---- modules/po/es.po | 14 +++---- modules/po/fa.po | 14 +++---- modules/po/fi.po | 14 +++---- modules/po/fr.po | 14 +++---- modules/po/id.po | 14 +++---- modules/po/it.po | 14 +++---- modules/po/ja.po | 14 +++---- modules/po/ko.po | 14 +++---- modules/po/lt.po | 18 ++++---- modules/po/nb_NO.po | 18 ++++---- modules/po/nl.po | 14 +++---- modules/po/pl.po | 14 +++---- modules/po/pt.po | 14 +++---- modules/po/pt_BR.po | 14 +++---- modules/po/ro.po | 14 +++---- modules/po/ru.po | 14 +++---- modules/po/sv.po | 14 +++---- modules/po/th.po | 14 +++---- modules/po/tr.po | 14 +++---- modules/po/uk.po | 14 +++---- modules/po/vi.po | 14 +++---- modules/po/zh_Hans.po | 14 +++---- modules/po/zh_Hant.po | 14 +++---- 54 files changed, 1360 insertions(+), 1225 deletions(-) diff --git a/home-manager/po/ca.po b/home-manager/po/ca.po index fe90504c0c2c..4159c95fc07d 100644 --- a/home-manager/po/ca.po +++ b/home-manager/po/ca.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-04-05 11:01+0000\n" "Last-Translator: Leix b \n" "Language-Team: Catalan \n" "Language-Team: Czech =2 && n<=4) ? 1 : 2);\n" "X-Generator: Weblate 5.4\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "V %s nebyl nalezen konfigurační soubor" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -34,16 +39,16 @@ msgstr "" "Udržovat Home Manager %s v %s je zastaralé,\n" "prosím přesuňte jej do %s" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "Konfigurační soubor nenalezen. Prosím vytvořte jej v %s" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "Home Manager nebyl nalezen v %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -52,7 +57,7 @@ msgstr "" "adresář." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -91,42 +96,42 @@ msgstr "" "\n" " $ rm -r \"%s\"" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "Kontrola správnosti Nix" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Nebyl nalezen vhodný adresář profilu, byly zkoušeny %s a %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "Nelze ověřit parametry z konfigurace flake" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "%s: neznámý parametr '%s'" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "Spusťte '%s --help' pro vypsání nápovědy" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." msgstr "Soubor %s již existuje, ponechán beze změn..." -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "Vytvářím %s..." -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "Vytvářím první generaci Home Manageru..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -143,7 +148,7 @@ msgstr "" "k zobrazení všech dostupných možností." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -157,11 +162,11 @@ msgstr "" " %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "Nelze vytvořit instanci flake konfigurace" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -178,72 +183,72 @@ msgstr[2] "" "%d nepřečtených novinek.\n" "Přečtěte je pomocí příkazu \"%s news\"." -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Neznáme nastavení \"news.display\" \"%s\"." -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" msgstr "Sestavení nelze provést v adresáři dostupném pouze pro čtení" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "Generace s ID %s neexistuje" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "Nelze odstranit současnou generaci %s" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "Odstraňuji generaci %s" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "Žádná generace k vypršení platnosti" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "Žádný home-manager balíček není nainstalován." -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "Neznámý parametr %s" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "Toto odstraní Home Manager z vašeho systému." -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "Toto zkouška na nečisto, nic nebude odinstalováno." -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "Opravdu odinstalovat Home Manager?" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "Přepínám na prázdou konfiguraci Home Manageru..." -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 msgid "Yay!" msgstr "Hurá!" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager se odinstalovává, ale váš home.nix nebyl změněn." -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations očekává jeden parametr, přítomno %d." -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "Neznámý příkaz: %s" diff --git a/home-manager/po/da.po b/home-manager/po/da.po index de348823ee70..c49a76fdd43d 100644 --- a/home-manager/po/da.po +++ b/home-manager/po/da.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-02-16 22:01+0000\n" "Last-Translator: Robert Helgesson \n" "Language-Team: Danish \n" "Language-Team: German \n" "Language-Team: Spanish \n" "Language-Team: Persian 1;\n" "X-Generator: Weblate 4.18-dev\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "هیچ فایل تنظیماتی در %s پیدا نشد" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "هیچ فایل تنظیماتی پیدا نشد. لطفا یک فایل در %s بسازید" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -69,42 +74,42 @@ msgid "" " $ rm -r \"%s\"" msgstr "" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." msgstr "فایل %s از قبل وجود داشته است، بدون تغییر رها شد..." -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "ساختن %s..." -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "" #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -115,7 +120,7 @@ msgid "" msgstr "" #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -125,11 +130,11 @@ msgid "" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -139,73 +144,73 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "" -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" msgstr "" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "نمی‌توان نسل فعلی %s را حذف کرد" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "حذف کردن نسل %s" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "" -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "" -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "" -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "واقعاً هوم منیجر را حذف نصب کنید؟" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "" -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 #, fuzzy msgid "Yay!" msgstr "آره!" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "هوم منیجر حذف نصب شد اما home.nix شما دست نخورده باقی ماند." -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "" -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "دستور ناشناخته: %s" diff --git a/home-manager/po/fi.po b/home-manager/po/fi.po index aed3b3972af9..4e3c193573e7 100644 --- a/home-manager/po/fi.po +++ b/home-manager/po/fi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Automatically generated\n" "Language-Team: none\n" @@ -17,36 +17,41 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -67,42 +72,42 @@ msgid "" " $ rm -r \"%s\"" msgstr "" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." msgstr "" -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "" -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "" #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -113,7 +118,7 @@ msgid "" msgstr "" #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -123,11 +128,11 @@ msgid "" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -137,72 +142,72 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "" -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" msgstr "" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "" -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "" -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "" -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "" -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 msgid "Yay!" msgstr "" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "" -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "" -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "" diff --git a/home-manager/po/fr.po b/home-manager/po/fr.po index b7a87485e60c..1c9388eb0ba6 100644 --- a/home-manager/po/fr.po +++ b/home-manager/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-03-04 06:44+0000\n" "Last-Translator: Alexis Rossfelder \n" "Language-Team: French 1;\n" "X-Generator: Weblate 5.5-dev\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "Aucun fichier de configuration trouvé à l'emplacement %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -34,18 +39,18 @@ msgstr "" "Garder votre Home Manager %s dans %s est obsolète,\n" "Veuillez le déplacer à %s" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "" "Aucun fichier de configuration trouvé. Veuillez en créer un à l'emplacement " "%s" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "Home Manager indisponible à %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -54,7 +59,7 @@ msgstr "" "dossier y a été trouvé." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -90,42 +95,42 @@ msgstr "" "\n" "\t$ rm -r \"%s\"" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "Vérification de Nix" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Impossible de trouver le dossier de profil approprié, essayé %s et %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "Impossible d'inspecter les options de la configuration d'un flake" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "%s : option inconnue '%s'" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "Exécuter « %s --help » pour de l'aide sur l'utilisation" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." msgstr "Le fichier %s existe déjà, il sera laissé inchangé..." -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "Création de %s ..." -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "Création de la génération initiale de Home Manager..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -143,7 +148,7 @@ msgstr "" "essayez 'man home-configuration.nix'." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -159,11 +164,11 @@ msgstr "" "si l'erreur semble être liée à Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "Impossible d'instancier une configuration flake" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -177,72 +182,72 @@ msgstr[1] "" "Il y a %d nouveaux éléments non lus et pertinents.\n" "Vous pouvez les lire en exécutant la commande \"%s news\"." -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Configuration \"news.display\" inconnue \"%s\"." -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "Veuillez remplir la variable d'environnement $EDITOR ou VISUAL" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" msgstr "Impossible de lancer une compilation dans un dossier en écriture seule" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "Aucune génération avec l'ID %s" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "Impossible de supprimer la génération courante %s" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "Suppression de la génération %s" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "Aucune génération expirée" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "Aucun package home-manager ne semble être installé." -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "Argument inconnu %s" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "Cela va supprimer Home Manager de votre système." -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "C'est un essai, rien ne sera réellement désinstallé." -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "Voulez-vous vraiment désinstaller Home Manager ?" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "Changement vers une configuration vierge de Home Manager..." -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 msgid "Yay!" msgstr "Yay !" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager est désinstallé mais votre home.nix reste intact." -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations attend un argument, a obtenu %d." -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "Commande inconnue : %s" diff --git a/home-manager/po/id.po b/home-manager/po/id.po index 0db625b3b07f..2dd2c14d2129 100644 --- a/home-manager/po/id.po +++ b/home-manager/po/id.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-02-16 22:01+0000\n" "Last-Translator: Robert Helgesson \n" "Language-Team: Indonesian \n" "Language-Team: Italian \n" "Language-Team: Japanese \n" "Language-Team: Korean \n" "Language-Team: Lithuanian =2 && (" -"n%100<10 || n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"(n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Generator: Weblate 5.4\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "Nerastas konfigūracijos failas %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 #, fuzzy msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" @@ -36,23 +41,23 @@ msgstr "" "Home Manager saugojimas %s viduje %s yra pasenes,\n" "prašome perkelti į %s" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "Nerastas konfigūracijos failas. Sukurkite jį adresu %s" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "Nerastas Home Manager šioje vietoje %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -73,42 +78,42 @@ msgid "" " $ rm -r \"%s\"" msgstr "" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "Nix tikrinamas" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Nepavyko rasti tinkamo profilio katalogo, bandyta naudoti %s ir %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "Negalima patikrinti flake konfigūracijos pasirinkimų" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "%s: nežinomas pasirinkimas „%s“" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "Paleiskite „%s --help“, kad gautumėte naudojimosi instrukcijas" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." msgstr "Failas %s jau egzistuoja, jis paliekamas nepakeistas..." -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "Kuriamas %s..." -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "Kuriama pradinė Home Manager generacija..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -127,7 +132,7 @@ msgstr "" "jei norite pamatyti visus pasirinkimus." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -142,11 +147,11 @@ msgstr "" "jei atrodo, kad klaida įvyko dėl Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "Negalima sukurti pradinės flake konfigūracijos" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -163,73 +168,73 @@ msgstr[2] "" "Yra %d neperskaitytų ir aktualių naujienų.\n" "Perskaitykite jas paleidus komandą \"%s news\"." -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Nežinomas \"news.display\" nustatymas \"%s\"." -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 #, fuzzy msgid "Cannot run build in read-only directory" msgstr "Negalima vykdyti kompiliavimo read-only kataloge" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "Nėra generacijos su ID %s" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "Negalima pašalinti esamos generacijos %s" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "Pašalinama generacija %s" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "Nėra generacijų, kurios baigtų galioti" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "Nėra instaliuotų home-manager paketų." -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "Nežinomas argumentas %s" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "Tai pašalins Home Manager iš jūsų sistemos." -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "Tai bandomasis paleidimas, niekas nebus ištrinta." -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "Tikrai išdiegti Home Manager?" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "Perjungiama į tuščią Home Manager konfigūraciją..." -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 msgid "Yay!" msgstr "Valio!" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager yra išdiegtas, bet jūsų home.nix liko nepaliestas." -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations tikisi vieno argumento, gauta %d." -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "Nežinoma komanda: %s" diff --git a/home-manager/po/nb_NO.po b/home-manager/po/nb_NO.po index 97deaaf08b52..41f5035c48df 100644 --- a/home-manager/po/nb_NO.po +++ b/home-manager/po/nb_NO.po @@ -7,11 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-04-02 21:38+0000\n" "Last-Translator: LilleAila \n" -"Language-Team: Norwegian Bokmål \n" +"Language-Team: Norwegian Bokmål \n" "Language: nb_NO\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,14 +19,19 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 5.5-dev\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "Fant ingen oppsettsfil i %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 #, fuzzy msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" @@ -35,23 +40,23 @@ msgstr "" "Å holde Home Manager %s i %s er avviklet,\n" "vennligst flytt det til %s" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "Fant ikke noen oppsettsfil. Opprett en i %s" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "Home Manager var ikke funnet på %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -72,43 +77,43 @@ msgid "" " $ rm -r \"%s\"" msgstr "" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "Kontrollerer at Nix fungerer" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Kunne ikke finne en passende profilmappe, prøvde %s og %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "Kan ikke inspisere alternativer for et flake-oppsett" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "%s: ukjent alternativ «%s»" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "Kjør «%s --help» for brukshjelp" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 #, fuzzy msgid "The file %s already exists, leaving it unchanged..." msgstr "Filen %s eksisterer fra før, lar den være uendret..." -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "Lager %s..." -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "Oppretter ny Home Manager-generasjon..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -125,7 +130,7 @@ msgstr "" "se alle tilgjengelige innstillinger." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -140,11 +145,11 @@ msgstr "" "hvis du tror feilen er forårsaket av Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "Kan ikke igangsette flak-oppsett" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -158,72 +163,72 @@ msgstr[1] "" "Det er %d uleste og relevante nyhetssaker.\n" "Les dem ved å kjøre kommandoen «%s news»." -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Ukjent «news.display»-innstilling «%s»." -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" msgstr "Kan ikke kjøre bygg i skrivebeskyttet mappe" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "Ingen generering med ID-en %s" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "Kan ikke fjerne nåværende generering %s" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "Fjerner generering %s" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "Ingen genereringer til utløp" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "Ingen «home-manager»-pakker ser ut til å være installert." -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "Ukjent parameter %s" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "Dette vil fjerne Home Manager fra systemet ditt." -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "Dette er en testkjøring. Ingenting vil bli avinstallert." -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "Vil du avinstallere Home Manager?" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "Bytter til tomt Home Manager-oppsett …" -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 msgid "Yay!" msgstr "Hurra!" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager er avinstallert, men din home.nix er levnet uforandret." -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "«expire-generations» forventet ett argument, mottok %d." -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "Ukjent kommando: %s" diff --git a/home-manager/po/nl.po b/home-manager/po/nl.po index 5d6573f87f2a..9f614ab10a3c 100644 --- a/home-manager/po/nl.po +++ b/home-manager/po/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-02-16 22:01+0000\n" "Last-Translator: Robert Helgesson \n" "Language-Team: Dutch \n" "Language-Team: Polish =20) ? 1 : 2);\n" "X-Generator: Weblate 5.4\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "Nie znaleziono pliku konfiguracyjnego %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -35,16 +40,16 @@ msgstr "" "Przechowywanie %s Home Managera w %s jest przestarzałe,\n" "proszę przenieść go do %s" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "Nie znaleziono pliku konfiguracyjnego. Proszę utworzyć plik %s" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "Home Manager nie znaleziony w %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -53,7 +58,7 @@ msgstr "" "katalog." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -93,42 +98,42 @@ msgstr "" "\n" " $ rm -r \"%s\"" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "Sprawdzanie poprawności Nix" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Nie można znaleźć odpowiedniego katalogu profilu, próbowano %s i %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "Nie mogę sprawdzić konfiguracji flake'a" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "%s: nieznana opcja „%s”" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "Uruchom „%s --help” by otrzymać pomoc" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." msgstr "Plik %s już istnieje, pozostawianie go bez zmian..." -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "Tworzenie %s..." -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "Tworzenie pierwotnej generacji Home Managera..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -146,7 +151,7 @@ msgstr "" "sprawdzić wszystkie możliwe opcje konfiguracyjne." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -161,11 +166,11 @@ msgstr "" "jeśli myślisz, że problem spowodowany jest przez błąd Home Managera." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "Nie mogę utworzyć instancji konfiguracji flake'a" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -182,73 +187,73 @@ msgstr[2] "" "Jest %d nieodczytanych wiadomości.\n" "Możesz je odczytać uruchamiając „%s news”." -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Nieznane ustawienie „%s” „news.display”." -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" msgstr "Nie mogę uruchomić budowania w katalogu tylko-do-odczytu" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "Brak generacji z ID %s" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "Nie mogę usunąć bieżącej generacji %s" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "Usuwanie generacji %s" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "Brak wygasających generacji" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "Pakiety home-manager nie wydają się być zainstalowane." -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "Nieznany argument %s" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "To usunie Home Managera z twojego systemu." -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "To jest próba, faktycznie nic nie będzie usunięte." -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "Jesteś pewien usunięcia Home Managera?" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "Przełączanie do pustej konfiguracji Home Managera..." -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 msgid "Yay!" msgstr "Jej!" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "" "Home Manager jest usunięty ale twój home.nix jest pozostawiony nietknięty." -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations oczekuje jednego argumentu, otrzymano %d." -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "Nieznana komenda: %s" diff --git a/home-manager/po/pt.po b/home-manager/po/pt.po index 3e356d6a3066..30a16bdeca6b 100644 --- a/home-manager/po/pt.po +++ b/home-manager/po/pt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-02-16 22:01+0000\n" "Last-Translator: Robert Helgesson \n" "Language-Team: Portuguese 1;\n" "X-Generator: Weblate 5.4\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "Nenhum ficheiro de configuração encontrado em %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -34,16 +39,16 @@ msgstr "" "Manter o %s do seu Home Manager em %s já não é suportado,\n" "por favor mova-o para %s" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "Ficheiro de configuração não encontrado. Por favor crie um em %s" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "Home Manager não foi encontrado em %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -52,7 +57,7 @@ msgstr "" "diretório foi encontrado lá." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -91,44 +96,44 @@ msgstr "" "\n" " $ rm -r \"%s\"" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "Revalidando Nix" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" "Não foi possível encontrar uma diretoria de perfil apropriada, foi tentado " "%s e %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "Não é possivel inspecionar a opção de configuração do flake" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "%s: opção não reconhecida '%s'" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "Execute '%s --help' para instruções de uso" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." msgstr "O arquivo %s já existe, deixando do jeito que está..." -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "Criando %s..." -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "Criando a geração inicial do Home Manager..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -145,7 +150,7 @@ msgstr "" "ver todas as opções disponíveis." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -160,11 +165,11 @@ msgstr "" "se o erro lhe parecer ser um problema do Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "Não foi possível instanciar a configuração de flake" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -178,72 +183,72 @@ msgstr[1] "" "Há %d novos itens relevants não lidos\n" "Leia executando o comando \"%s news\"." -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Valor \"%s\" para configuração \"news.display\" não reconhecido." -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" msgstr "Não é possível fazer o build num diretório somente leitura" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "Nenhuma geração com ID %s" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "Não foi possível remover a geração atual %s" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "A remover a geração %s" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "Nenhuma geração a expirar" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "Nenhum pacote parece instalado com home-manager." -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "Argumento desconhecido %s" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "Isto irá remover o Home Manager do seu sistema." -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "Essa é uma execução de teste, nada de fato será desinstalado." -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "Confirma a desinstalação do Home Manager?" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "Trocando para configuração vazia do Home Manager..." -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 msgid "Yay!" msgstr "Boa!" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager foi desinstalado, mas o seu home.nix foi deixado intacto." -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations espera um argumento, recebeu %d." -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "Comando não reconhecido: %s" diff --git a/home-manager/po/pt_BR.po b/home-manager/po/pt_BR.po index 3cb16292a9f6..44aba5636014 100644 --- a/home-manager/po/pt_BR.po +++ b/home-manager/po/pt_BR.po @@ -7,11 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-02-28 13:02+0000\n" "Last-Translator: guto \n" -"Language-Team: Portuguese (Brazil) \n" +"Language-Team: Portuguese (Brazil) \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,14 +19,19 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Weblate 5.5-dev\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "Nenhum arquivo de configuração encontrado no %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -34,16 +39,16 @@ msgstr "" "Manter seu Home Manager %s em %s foi descontinuado,\n" "por favor mova-o para %s" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "Arquivo de configuração não encontrado. Por favor crie um em %s" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "Home Manager não encontrado em %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -52,7 +57,7 @@ msgstr "" "algum arquivo/diretório nele." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -92,43 +97,43 @@ msgstr "" "\n" " $ rm -r \"%s\"" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "Revalidando Nix" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" "Não foi possível encontrar um diretório de perfil apropriado, tentei %s e %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "Não é possivel inspecionar a opção de configuração do flake" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "%s: opção não reconhecida '%s'" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "Execute '%s --help' para instruções de uso" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." msgstr "O arquivo %s já existe, mantendo ele sem modificações..." -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "Criando %s..." -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "Criando a geração inicial do Home Manager..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -146,7 +151,7 @@ msgstr "" "ver todas as opções disponíveis." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -161,11 +166,11 @@ msgstr "" "se o erro lhe parecer ser um problema do Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "Não foi possível instanciar a configuração de flake" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -179,72 +184,72 @@ msgstr[1] "" "Há %d novos itens relevants não lidos\n" "Leia executando o comando \"%s news\"." -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Valor \"%s\" para configuração \"news.display\" não reconhecido." -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "Por favor, defina a variável de ambiente $EDITOR ou $VISUAL" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" msgstr "Não é possível fazer o build em um diretório somente leitura" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "Nenhuma geração com ID %s" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "Não foi possível remover a geração atual %s" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "Removendo geração %s" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "Nenhuma geração a expirar" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "Nenhum pacote parece instalado com home-manager." -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "Argumento desconhecido %s" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "Isso irá remover o Home Manager do seu sistema." -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "Essa é uma execução de teste, nada de fato será desinstalado." -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "Confirma a desinstalação do Home Manager?" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "Trocando para configuração vazia do Home Manager..." -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 msgid "Yay!" msgstr "Boa!" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager foi desinstalado, mas o seu home.nix foi deixado intacto." -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations espera um argumento, recebeu %d." -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "Comando não reconhecido: %s" diff --git a/home-manager/po/ro.po b/home-manager/po/ro.po index 18f9dad7a7d6..bd48a4a83354 100644 --- a/home-manager/po/ro.po +++ b/home-manager/po/ro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-03-31 22:01+0000\n" "Last-Translator: SMFloris \n" "Language-Team: Romanian \n" "Language-Team: Russian =20) ? 1 : 2);\n" "X-Generator: Weblate 5.5-dev\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "Не найден файл конфигурации в %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -35,16 +40,16 @@ msgstr "" "Файл %s вашего Home Manager находится в устаревшем месте %s\n" "пожалуйста, переместите его в %s" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "Не найден файл конфигурации. Пожалуйста, создайте его в %s" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "Home Manager не был найден в %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -53,7 +58,7 @@ msgstr "" "файл или папка." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -92,42 +97,42 @@ msgstr "" "\n" " $ rm -r \"%s\"" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "Проверка работоспособности Nix" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Не найдена подходящая директория профиля, пробовали %s и %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "Не могу получить опции для flake-конфигурации" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "%s: неизвестная опция '%s'" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "Выполните '%s --help', чтобы получить справку" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." msgstr "Файл %s уже существует и не будет изменен..." -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "Создание %s..." -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "Создаю начальное поколение Home Manager..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -144,7 +149,7 @@ msgstr "" "Выполните 'man home-configuration.nix', чтобы увидеть доступные опции." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -159,11 +164,11 @@ msgstr "" "если считаете, что в ошибке виноват Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "Не могу создать экземляр для flake-конфигурации" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -180,72 +185,72 @@ msgstr[2] "" "У вас есть %d непрочитанных и релевантных новостей.\n" "Прочтите их, выполнив команду \"%s news\"." -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Неизвестное значение \"news.display\": \"%s\"." -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "Пожалуйста, установите переменную среды $EDITOR или $VISUAL" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" msgstr "Не могу начать сборку в директории, защищённой от записи" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "Поколение под номером %s не существует" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "Не могу удалить текущее поколение %s" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "Удаляю поколение %s" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "Нет поколений, которые можно просрочить" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "Не обнаружено пакетов, установленных через home-manager." -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "Неизвестный аргумент %s" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "Это удалит Home Manager из вашей системы." -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "Это пробный запуск, на самом деле ничего не удаляется." -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "Действительно хотите удалить Home Manager?" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "Переключаюсь на пустую конфигурацию Home Manager..." -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 msgid "Yay!" msgstr "Ура!" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager удалён, но ваш home.nix остался нетронутым." -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "expire-generations требует один аргумент, но передано %d." -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "Неизвестная команда: %s" diff --git a/home-manager/po/sv.po b/home-manager/po/sv.po index 2454def1e29d..428f9e10b9c1 100644 --- a/home-manager/po/sv.po +++ b/home-manager/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-02-18 14:02+0000\n" "Last-Translator: bittin1ddc447d824349b2 \n" "Language-Team: Swedish \n" @@ -20,36 +20,41 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Weblate 5.0.2\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "ไม่พบการตั้งค่าที่ %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -70,42 +75,42 @@ msgid "" " $ rm -r \"%s\"" msgstr "" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." msgstr "" -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "" -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "" #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -116,7 +121,7 @@ msgid "" msgstr "" #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -126,11 +131,11 @@ msgid "" msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -140,72 +145,72 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "" -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" msgstr "" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "" -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "" -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "" -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "" -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 msgid "Yay!" msgstr "" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "" -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "" -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "" diff --git a/home-manager/po/tr.po b/home-manager/po/tr.po index 7cbf63548aa5..e382f3b5d864 100644 --- a/home-manager/po/tr.po +++ b/home-manager/po/tr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-02-16 22:01+0000\n" "Last-Translator: Oğuz Ersen \n" "Language-Team: Turkish \n" "Language-Team: Ukrainian =20) ? 1 : 2);\n" "X-Generator: Weblate 5.4\n" -#: home-manager/home-manager:58 +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 msgid "No configuration file found at %s" msgstr "Файл конфігурації не знайдено в %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. -#: home-manager/home-manager:75 home-manager/home-manager:79 -#: home-manager/home-manager:178 +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" @@ -35,16 +40,16 @@ msgstr "" "Збереження вашого Home Manager %s у %s є застарілим,\n" "будь ласка, перемістіть його до %s" -#: home-manager/home-manager:86 +#: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "Файл конфігурації не знайдено. Будь ласка, створіть його в %s" -#: home-manager/home-manager:101 +#: home-manager/home-manager:107 msgid "Home Manager not found at %s." msgstr "Home Manager не знайдено на %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:109 +#: home-manager/home-manager:115 msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." @@ -52,7 +57,7 @@ msgstr "" "Резервний шлях до Home Manager %s застарів, і там було знайдено файл/каталог." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. -#: home-manager/home-manager:112 +#: home-manager/home-manager:118 msgid "" "To remove this warning, do one of the following.\n" "\n" @@ -91,42 +96,42 @@ msgstr "" "\n" " $ rm -r \"%s\"" -#: home-manager/home-manager:140 +#: home-manager/home-manager:146 msgid "Sanity checking Nix" msgstr "Перевірка адекватності Nix" -#: home-manager/home-manager:160 +#: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "Не вдалося знайти відповідний каталог профілю, спробував %s і %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:215 +#: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" msgstr "Неможливо перевірити параметри flake-конфігурації" -#: home-manager/home-manager:288 home-manager/home-manager:311 -#: home-manager/home-manager:1030 +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" msgstr "%s: невідомий параметр '%s'" -#: home-manager/home-manager:293 home-manager/home-manager:1031 +#: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" msgstr "Запустіть '%s --help' для отримання довідки про використання" -#: home-manager/home-manager:319 home-manager/home-manager:423 +#: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." msgstr "Файл %s вже існує, залишаючи його незмінним..." -#: home-manager/home-manager:321 home-manager/home-manager:425 +#: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." msgstr "Створення %s..." -#: home-manager/home-manager:467 +#: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." msgstr "Створення початкової генерації Home Manager..." #. translators: The "%s" specifier will be replaced by a file path. -#: home-manager/home-manager:472 +#: home-manager/home-manager:480 msgid "" "All done! The home-manager tool should now be installed and you can edit\n" "\n" @@ -144,7 +149,7 @@ msgstr "" "переглянути всі доступні варіанти." #. translators: The "%s" specifier will be replaced by a URL. -#: home-manager/home-manager:477 +#: home-manager/home-manager:485 msgid "" "Uh oh, the installation failed! Please create an issue at\n" "\n" @@ -159,11 +164,11 @@ msgstr "" "якщо здається, що помилка сталася через Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. -#: home-manager/home-manager:488 +#: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" msgstr "Не вдається створити екземпляр flake-конфігурації" -#: home-manager/home-manager:564 +#: home-manager/home-manager:572 msgid "" "There is %d unread and relevant news item.\n" "Read it by running the command \"%s news\"." @@ -180,72 +185,72 @@ msgstr[2] "" "Є %d непрочитаних і ревалентних новин.\n" "Прочитайте їх, виконавши команду \"%s news\"." -#: home-manager/home-manager:578 +#: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." msgstr "Невідоме налаштування \"news.display\" \"%s\"." -#: home-manager/home-manager:586 +#: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" msgstr "Будь ласка, встановіть змінну оточення $EDITOR або $VISUAL" -#: home-manager/home-manager:604 +#: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" msgstr "Неможливо запустити збірку в каталозі, доступному лише для читання" -#: home-manager/home-manager:685 +#: home-manager/home-manager:693 msgid "No generation with ID %s" msgstr "Немає генерації з ID %s" -#: home-manager/home-manager:687 +#: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" msgstr "Не вдається видалити поточну генерацію %s" -#: home-manager/home-manager:689 +#: home-manager/home-manager:697 msgid "Removing generation %s" msgstr "Видалення генерації %s" -#: home-manager/home-manager:710 +#: home-manager/home-manager:718 msgid "No generations to expire" msgstr "Немає генерацій, термін дії яких закінчується" -#: home-manager/home-manager:721 +#: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." msgstr "Здається, не встановлено жодних пакунків home-manager." -#: home-manager/home-manager:803 +#: home-manager/home-manager:811 msgid "Unknown argument %s" msgstr "Невідомий аргумент %s" -#: home-manager/home-manager:827 +#: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." msgstr "Це призведе до видалення Home Manager з вашої системи." -#: home-manager/home-manager:830 +#: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." msgstr "Це пробний запуск, насправді нічого не буде видалено." -#: home-manager/home-manager:834 +#: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" msgstr "Дійсно видаліть Home Manager?" -#: home-manager/home-manager:840 +#: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." msgstr "Перехід до порожньої конфігурації Home Manager..." -#: home-manager/home-manager:855 +#: home-manager/home-manager:863 msgid "Yay!" msgstr "Ура!" -#: home-manager/home-manager:860 +#: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "Home Manager буде видалено, але ваш home.nix залишиться недоторканим." -#: home-manager/home-manager:1070 +#: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." msgstr "expire-generation очікує один аргумент, отримав %d." -#: home-manager/home-manager:1092 +#: home-manager/home-manager:1113 msgid "Unknown command: %s" msgstr "Невідома команда: %s" diff --git a/home-manager/po/vi.po b/home-manager/po/vi.po index d0a57b9bba1b..336b5562a8d7 100644 --- a/home-manager/po/vi.po +++ b/home-manager/po/vi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-03-27 15:05+0000\n" "Last-Translator: Nguyen Khanh \n" "Language-Team: Vietnamese \n" "Language-Team: Chinese (Simplified) \n" "Language-Team: Chinese (Traditional) \n" "Language-Team: Catalan \n" "Language-Team: Czech =2 && n<=4) ? 1 : 2;\n" "X-Generator: Weblate 5.3-dev\n" -#: modules/files.nix:236 +#: modules/files.nix:191 msgid "Creating home file links in %s" msgstr "Vytváření linků na domácí soubory v %s" -#: modules/files.nix:249 +#: modules/files.nix:204 msgid "Cleaning up orphan links from %s" msgstr "Čištění osiřelých linků z %s" -#: modules/files.nix:265 +#: modules/files.nix:220 msgid "Creating profile generation %s" msgstr "Vytvářím profil generace %s" -#: modules/files.nix:282 +#: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" msgstr "Žádná změna, takže bude použita profil poslední generace %s" -#: modules/home-environment.nix:622 +#: modules/home-environment.nix:634 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -63,7 +63,7 @@ msgstr "" "\n" "Poté zkuste znova aktivovat vaši Home Manager konfiguraci." -#: modules/home-environment.nix:655 +#: modules/home-environment.nix:667 msgid "Activating %s" msgstr "Aktivuji %s" diff --git a/modules/po/da.po b/modules/po/da.po index e01ade198a7e..acb4666228d0 100644 --- a/modules/po/da.po +++ b/modules/po/da.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2023-09-27 11:02+0000\n" "Last-Translator: Emil Heilbo \n" "Language-Team: Danish \n" "Language-Team: German \n" "Language-Team: Spanish \n" "Language-Team: French 1;\n" "X-Generator: Weblate 5.0-dev\n" -#: modules/files.nix:236 +#: modules/files.nix:191 msgid "Creating home file links in %s" msgstr "Création des liens de fichiers personnels dans %s" -#: modules/files.nix:249 +#: modules/files.nix:204 msgid "Cleaning up orphan links from %s" msgstr "Nettoyage des liens orphelins de %s" -#: modules/files.nix:265 +#: modules/files.nix:220 msgid "Creating profile generation %s" msgstr "Création de la génération de profil %s" -#: modules/files.nix:282 +#: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" msgstr "Pas de changement, réutilisation du dernier profil génération %s" -#: modules/home-environment.nix:622 +#: modules/home-environment.nix:634 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -63,7 +63,7 @@ msgstr "" "\n" "Après, essayez encore d'activer votre configuration de Home Manager." -#: modules/home-environment.nix:655 +#: modules/home-environment.nix:667 msgid "Activating %s" msgstr "Activation de %s" diff --git a/modules/po/id.po b/modules/po/id.po index 6e17edae25df..78db0232ce77 100644 --- a/modules/po/id.po +++ b/modules/po/id.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2023-10-04 06:02+0000\n" "Last-Translator: Reza Almanda \n" "Language-Team: Indonesian \n" "Language-Team: Italian \n" "Language-Team: Japanese \n" "Language-Team: Korean \n" "Language-Team: Lithuanian =2 && (" -"n%100<10 || n%100>=20) ? 1 : 2);\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " +"(n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Generator: Weblate 5.4\n" -#: modules/files.nix:236 +#: modules/files.nix:191 msgid "Creating home file links in %s" msgstr "Kuriamos home failų nuorodos adresu %s" -#: modules/files.nix:249 +#: modules/files.nix:204 #, fuzzy msgid "Cleaning up orphan links from %s" msgstr "Valomos pamestos nuorodos iš %s" -#: modules/files.nix:265 +#: modules/files.nix:220 msgid "Creating profile generation %s" msgstr "Kuriama profilio generacija %s" -#: modules/files.nix:282 +#: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" msgstr "Nėra pakeitimų, naudojama paskutinė profilio generacija %s" -#: modules/home-environment.nix:622 +#: modules/home-environment.nix:634 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -65,7 +65,7 @@ msgstr "" "\n" "Tada pabandykite aktyvuoti Home Manager konfigūraciją iš naujo." -#: modules/home-environment.nix:655 +#: modules/home-environment.nix:667 msgid "Activating %s" msgstr "Aktyvuojamas %s" diff --git a/modules/po/nb_NO.po b/modules/po/nb_NO.po index b1f4cfaa0c42..b3754af0f4b1 100644 --- a/modules/po/nb_NO.po +++ b/modules/po/nb_NO.po @@ -7,11 +7,11 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-04-02 21:38+0000\n" "Last-Translator: LilleAila \n" -"Language-Team: Norwegian Bokmål \n" +"Language-Team: Norwegian Bokmål \n" "Language: nb_NO\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -19,23 +19,23 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n != 1;\n" "X-Generator: Weblate 5.5-dev\n" -#: modules/files.nix:236 +#: modules/files.nix:191 msgid "Creating home file links in %s" msgstr "Lager hjemmefillenker i %s" -#: modules/files.nix:249 +#: modules/files.nix:204 msgid "Cleaning up orphan links from %s" msgstr "Fjerner frakoblede lenker fra %s" -#: modules/files.nix:265 +#: modules/files.nix:220 msgid "Creating profile generation %s" msgstr "Oppretter profil for generering %s" -#: modules/files.nix:282 +#: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" msgstr "Ingen endring, gjenbruker derfor siste profilgenerering %s" -#: modules/home-environment.nix:622 +#: modules/home-environment.nix:634 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -63,7 +63,7 @@ msgstr "" "\n" "for så å aktivere ditt Home Manager-oppsett igjen." -#: modules/home-environment.nix:655 +#: modules/home-environment.nix:667 msgid "Activating %s" msgstr "Aktiverer %s" diff --git a/modules/po/nl.po b/modules/po/nl.po index 520af14269b4..418594aa14a8 100644 --- a/modules/po/nl.po +++ b/modules/po/nl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2023-12-02 23:06+0000\n" "Last-Translator: Zurga \n" "Language-Team: Dutch \n" "Language-Team: Polish =20) ? 1 : 2;\n" "X-Generator: Weblate 4.18-dev\n" -#: modules/files.nix:236 +#: modules/files.nix:191 msgid "Creating home file links in %s" msgstr "Tworzenie dowiązań plików w %s" -#: modules/files.nix:249 +#: modules/files.nix:204 msgid "Cleaning up orphan links from %s" msgstr "Czyszczenie osieroconych linków z %s" -#: modules/files.nix:265 +#: modules/files.nix:220 msgid "Creating profile generation %s" msgstr "Tworzenie profilu generacji %s" -#: modules/files.nix:282 +#: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" msgstr "Brak zmian więc używam ostatniej generacji profilu %s" -#: modules/home-environment.nix:622 +#: modules/home-environment.nix:634 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -65,7 +65,7 @@ msgstr "" "\n" "Po czym spróbuj aktywować swoją konfigurację Home Manager jeszcze raz." -#: modules/home-environment.nix:655 +#: modules/home-environment.nix:667 msgid "Activating %s" msgstr "Aktywowanie %s" diff --git a/modules/po/pt.po b/modules/po/pt.po index 73a53688d046..9bd5144a8136 100644 --- a/modules/po/pt.po +++ b/modules/po/pt.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2023-10-19 04:00+0000\n" "Last-Translator: SrGesus \n" "Language-Team: Portuguese 1;\n" "X-Generator: Weblate 5.1\n" -#: modules/files.nix:236 +#: modules/files.nix:191 msgid "Creating home file links in %s" msgstr "A criar links simbólicos em %s" -#: modules/files.nix:249 +#: modules/files.nix:204 msgid "Cleaning up orphan links from %s" msgstr "A limpar links órfãos do directório %s" -#: modules/files.nix:265 +#: modules/files.nix:220 msgid "Creating profile generation %s" msgstr "A criar geração %s para o perfil" -#: modules/files.nix:282 +#: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" msgstr "Nenhuma mudança, portanto a reusar a última geração %s para o perfil" -#: modules/home-environment.nix:622 +#: modules/home-environment.nix:634 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -63,7 +63,7 @@ msgstr "" "\n" "E então tente novamente ativar a sua configuração do Home Manager." -#: modules/home-environment.nix:655 +#: modules/home-environment.nix:667 msgid "Activating %s" msgstr "Ativando %s" diff --git a/modules/po/pt_BR.po b/modules/po/pt_BR.po index aea9b0aba6c3..a8f2b4843519 100644 --- a/modules/po/pt_BR.po +++ b/modules/po/pt_BR.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2023-11-30 15:04+0000\n" "Last-Translator: Gabriel Fontes \n" "Language-Team: Portuguese (Brazil) 1;\n" "X-Generator: Weblate 5.3-dev\n" -#: modules/files.nix:236 +#: modules/files.nix:191 msgid "Creating home file links in %s" msgstr "Criando links simbólicos em %s" -#: modules/files.nix:249 +#: modules/files.nix:204 msgid "Cleaning up orphan links from %s" msgstr "Limpando links órfãos do directório %s" -#: modules/files.nix:265 +#: modules/files.nix:220 msgid "Creating profile generation %s" msgstr "Criando geração %s para o perfil" -#: modules/files.nix:282 +#: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" msgstr "Nenhuma mudança, portanto reusando a última geração %s para o perfil" -#: modules/home-environment.nix:622 +#: modules/home-environment.nix:634 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -63,7 +63,7 @@ msgstr "" "\n" "E então tente novamente ativar a sua configuração do Home Manager." -#: modules/home-environment.nix:655 +#: modules/home-environment.nix:667 msgid "Activating %s" msgstr "Ativando %s" diff --git a/modules/po/ro.po b/modules/po/ro.po index 022007dd2ae8..d817496a79b0 100644 --- a/modules/po/ro.po +++ b/modules/po/ro.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2023-08-11 19:51+0000\n" "Last-Translator: HeartBlin913861820c094e37 \n" "Language-Team: Romanian \n" "Language-Team: Russian =20) ? 1 : 2;\n" "X-Generator: Weblate 5.3-dev\n" -#: modules/files.nix:236 +#: modules/files.nix:191 msgid "Creating home file links in %s" msgstr "Создаю ссылки в домашней директории %s" -#: modules/files.nix:249 +#: modules/files.nix:204 msgid "Cleaning up orphan links from %s" msgstr "Удаляю устаревшие ссылки из %s" -#: modules/files.nix:265 +#: modules/files.nix:220 msgid "Creating profile generation %s" msgstr "Создаю профиль в поколении %s" -#: modules/files.nix:282 +#: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" msgstr "Изменений нет, переиспользую профиль в последнем поколении %s" -#: modules/home-environment.nix:622 +#: modules/home-environment.nix:634 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -64,7 +64,7 @@ msgstr "" "\n" "После попробуйте активировать конфигурацию снова." -#: modules/home-environment.nix:655 +#: modules/home-environment.nix:667 msgid "Activating %s" msgstr "Активирую %s" diff --git a/modules/po/sv.po b/modules/po/sv.po index 5d4744290dd9..266a84d8d8be 100644 --- a/modules/po/sv.po +++ b/modules/po/sv.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2023-05-27 12:11+0000\n" "Last-Translator: Robert Helgesson \n" "Language-Team: Swedish \n" "Language-Team: Turkish \n" "Language-Team: Ukrainian =20) ? 1 : 2;\n" "X-Generator: Weblate 5.4-dev\n" -#: modules/files.nix:236 +#: modules/files.nix:191 msgid "Creating home file links in %s" msgstr "Створення посилань на файли в домашньому каталозі в %s" -#: modules/files.nix:249 +#: modules/files.nix:204 msgid "Cleaning up orphan links from %s" msgstr "Очищення невідомих посилань із %s" -#: modules/files.nix:265 +#: modules/files.nix:220 msgid "Creating profile generation %s" msgstr "Створення генерації профілю %s" -#: modules/files.nix:282 +#: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" msgstr "Без змін, тому повторне використання останньої генерації профілю %s" -#: modules/home-environment.nix:622 +#: modules/home-environment.nix:634 msgid "" "Oops, Nix failed to install your new Home Manager profile!\n" "\n" @@ -64,7 +64,7 @@ msgstr "" "\n" "Потім спробуйте знову активувати конфігурацію Home Manager." -#: modules/home-environment.nix:655 +#: modules/home-environment.nix:667 msgid "Activating %s" msgstr "Активація %s" diff --git a/modules/po/vi.po b/modules/po/vi.po index a7c2bafbdf27..a285c2bf7f56 100644 --- a/modules/po/vi.po +++ b/modules/po/vi.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" -"POT-Creation-Date: 2024-02-15 16:04+0100\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" "PO-Revision-Date: 2024-03-27 15:05+0000\n" "Last-Translator: Nguyen Khanh \n" "Language-Team: Vietnamese \n" "Language-Team: Chinese (Simplified) \n" "Language-Team: Chinese (Traditional) Date: Wed, 20 Mar 2024 08:41:18 +0100 Subject: [PATCH 188/636] qt: add adwaita platform theme Fixes #4702 and https://github.com/NixOS/nixpkgs/issues/295345. --- modules/misc/qt.nix | 160 ++++++++++++------ tests/modules/misc/qt/qt-basic.nix | 2 - .../misc/qt/qt-platform-theme-gnome.nix | 3 +- .../modules/misc/qt/qt-platform-theme-gtk.nix | 4 +- .../misc/qt/qt-platform-theme-gtk3.nix | 4 +- 5 files changed, 109 insertions(+), 64 deletions(-) diff --git a/modules/misc/qt.nix b/modules/misc/qt.nix index f02bc186e8e1..e3e5be41c60d 100644 --- a/modules/misc/qt.nix +++ b/modules/misc/qt.nix @@ -6,6 +6,7 @@ let # Map platform names to their packages. platformPackages = with pkgs; { gnome = [ qgnomeplatform qgnomeplatform-qt6 ]; + adwaita = [ qadwaitadecorations qadwaitadecorations-qt6 ]; gtk = [ libsForQt5.qtstyleplugins qt6Packages.qt6gtk2 ]; kde = [ libsForQt5.plasma-integration libsForQt5.systemsettings ]; lxqt = [ lxqt.lxqt-qtplugin lxqt.lxqt-config ]; @@ -55,56 +56,85 @@ in { qt = { enable = lib.mkEnableOption "Qt 5 and 6 configuration"; - platformTheme = lib.mkOption { + platformTheme = let + newOption = { + name = lib.mkOption { + type = with lib.types; nullOr str; + default = null; + example = "adwaita"; + relatedPackages = [ + "qgnomeplatform" + "qgnomeplatform-qt6" + "qadwaitadecorations" + "qadwaitadecorations-qt6" + [ "libsForQt5" "plasma-integration" ] + [ "libsForQt5" "qt5ct" ] + [ "libsForQt5" "qtstyleplugins" ] + [ "libsForQt5" "systemsettings" ] + [ "lxqt" "lxqt-config" ] + [ "lxqt" "lxqt-qtplugin" ] + [ "qt6Packages" "qt6ct" ] + [ "qt6Packages" "qt6gtk2" ] + ]; + description = '' + Platform theme to use for Qt applications. + + Some examples are + + `gtk` + : Use GTK theme with + [`qtstyleplugins`](https://github.com/qt/qtstyleplugins) + + `gtk3` + : Use [GTK3 integration](https://github.com/qt/qtbase/tree/dev/src/plugins/platformthemes/gtk3) + for file picker dialogs, font and theme configuration + + `adwaita` + : Use Adwaita theme with + [`qadwaitadecorations`](https://github.com/FedoraQt/QGnomePlatform) + + `gnome` (deprecated) + : Use GNOME theme with + [`qgnomeplatform`](https://github.com/FedoraQt/QGnomePlatform). + Is no longer maintained so prefer `adwaita`. + + `lxqt` + : Use LXQt theme style set using the + [`lxqt-config-appearance`](https://github.com/lxqt/lxqt-config) + application + + `qtct` + : Use Qt style set using + [`qt5ct`](https://github.com/desktop-app/qt5ct) + and [`qt6ct`](https://github.com/trialuser02/qt6ct) + applications + + `kde` + : Use Qt settings from Plasma + ''; + }; + package = lib.mkOption { + type = with lib.types; nullOr (either package (listOf package)); + default = null; + example = + lib.literalExpression "[pkgs.adwaita-qt pkgs.adwaita-qt6]"; + description = '' + Theme package to be used in Qt5/Qt6 applications. + Auto-detected from {option}`qt.platformTheme.name` if possible. + See its documentation for available options. + ''; + }; + }; + in lib.mkOption { type = with lib.types; - nullOr (enum [ "gtk" "gtk3" "gnome" "lxqt" "qtct" "kde" ]); + nullOr + (either (enum [ "gtk" "gtk3" "gnome" "adwaita" "lxqt" "qtct" "kde" ]) + (lib.types.submodule { options = newOption; })); default = null; - example = "gnome"; - relatedPackages = [ - "qgnomeplatform" - "qgnomeplatform-qt6" - [ "libsForQt5" "plasma-integration" ] - [ "libsForQt5" "qt5ct" ] - [ "libsForQt5" "qtstyleplugins" ] - [ "libsForQt5" "systemsettings" ] - [ "lxqt" "lxqt-config" ] - [ "lxqt" "lxqt-qtplugin" ] - [ "qt6Packages" "qt6ct" ] - [ "qt6Packages" "qt6gtk2" ] - ]; description = '' - Platform theme to use for Qt applications. - - The options are - - `gtk` - : Use GTK theme with - [`qtstyleplugins`](https://github.com/qt/qtstyleplugins) - - `gtk3` - : Use [GTK3 integration](https://github.com/qt/qtbase/tree/dev/src/plugins/platformthemes/gtk3) - for file picker dialogs, font and theme configuration - - `gnome` - : Use GNOME theme with - [`qgnomeplatform`](https://github.com/FedoraQt/QGnomePlatform) - - `lxqt` - : Use LXQt theme style set using the - [`lxqt-config-appearance`](https://github.com/lxqt/lxqt-config) - application - - `qtct` - : Use Qt style set using - [`qt5ct`](https://github.com/desktop-app/qt5ct) - and [`qt6ct`](https://github.com/trialuser02/qt6ct) - applications - - `kde` - : Use Qt settings from Plasma + Deprecated. Use {option}`qt.platformTheme.name` instead. ''; }; - style = { name = lib.mkOption { type = with lib.types; nullOr str; @@ -149,6 +179,7 @@ in { description = '' Theme package to be used in Qt5/Qt6 applications. Auto-detected from {option}`qt.style.name` if possible. + See its documentation for available options. ''; }; }; @@ -156,11 +187,29 @@ in { }; config = let + warnGnomeDeprecation = option: name: + lib.warnIf (name == "gnome") + "The value `gnome` for option `${option}` is deprecated. Use `adwaita` instead." + name; + + platformTheme = if (builtins.isString cfg.platformTheme) then { + name = lib.warn + "The option `qt.platformTheme` has been renamed to `qt.platformTheme.name`." + (warnGnomeDeprecation "qt.platformTheme" cfg.platformTheme); + package = null; + } else if cfg.platformTheme == null then { + name = null; + package = null; + } else { + name = + warnGnomeDeprecation "cfg.platformTheme.name" cfg.platformTheme.name; + package = cfg.platformTheme.package; + }; # Necessary because home.sessionVariables doesn't support mkIf envVars = lib.filterAttrs (n: v: v != null) { - QT_QPA_PLATFORMTHEME = if (cfg.platformTheme != null) then - styleNames.${cfg.platformTheme} or cfg.platformTheme + QT_QPA_PLATFORMTHEME = if (platformTheme.name != null) then + styleNames.${platformTheme.name} or platformTheme.name else null; QT_STYLE_OVERRIDE = cfg.style.name; @@ -181,10 +230,10 @@ in { in lib.mkIf cfg.enable { assertions = [{ - assertion = cfg.platformTheme == "gnome" -> cfg.style.name != null + assertion = platformTheme.name == "gnome" -> cfg.style.name != null && cfg.style.package != null; message = '' - `qt.platformTheme` "gnome" must have `qt.style` set to a theme that + `qt.platformTheme.name` "gnome" must have `qt.style` set to a theme that supports both Qt and Gtk, for example "adwaita", "adwaita-dark", or "breeze". ''; }]; @@ -208,13 +257,16 @@ in { # Apply theming also to apps started by systemd. systemd.user.sessionVariables = envVars // envVarsExtra; - home.packages = (lib.optionals (cfg.platformTheme != null) - platformPackages.${cfg.platformTheme} or [ ]) - ++ (lib.optionals (cfg.style.package != null) - (lib.toList cfg.style.package)); + home.packages = (lib.findFirst (x: x != null) [ ] [ + (lib.optionals (platformTheme.package != null) + (lib.toList platformTheme.package)) + (lib.optionals (platformTheme.name != null) + platformPackages.${platformTheme.name}) + ]) ++ (lib.optionals (cfg.style.package != null) + (lib.toList cfg.style.package)); xsession.importedVariables = [ "QT_PLUGIN_PATH" "QML2_IMPORT_PATH" ] - ++ lib.optionals (cfg.platformTheme != null) [ "QT_QPA_PLATFORMTHEME" ] + ++ lib.optionals (platformTheme.name != null) [ "QT_QPA_PLATFORMTHEME" ] ++ lib.optionals (cfg.style.name != null) [ "QT_STYLE_OVERRIDE" ]; }; } diff --git a/tests/modules/misc/qt/qt-basic.nix b/tests/modules/misc/qt/qt-basic.nix index 9ddddb357407..a4cadcb73f8c 100644 --- a/tests/modules/misc/qt/qt-basic.nix +++ b/tests/modules/misc/qt/qt-basic.nix @@ -1,5 +1,3 @@ -{ config, lib, pkgs, ... }: - { config = { qt.enable = true; diff --git a/tests/modules/misc/qt/qt-platform-theme-gnome.nix b/tests/modules/misc/qt/qt-platform-theme-gnome.nix index d95ef704a20b..617d99b068ab 100644 --- a/tests/modules/misc/qt/qt-platform-theme-gnome.nix +++ b/tests/modules/misc/qt/qt-platform-theme-gnome.nix @@ -1,9 +1,8 @@ -{ config, lib, pkgs, ... }: - { config = { qt = { enable = true; + # Check if still backwards compatible platformTheme = "gnome"; style.name = "adwaita"; }; diff --git a/tests/modules/misc/qt/qt-platform-theme-gtk.nix b/tests/modules/misc/qt/qt-platform-theme-gtk.nix index 070c8020a230..76a6512f87e1 100644 --- a/tests/modules/misc/qt/qt-platform-theme-gtk.nix +++ b/tests/modules/misc/qt/qt-platform-theme-gtk.nix @@ -1,10 +1,8 @@ -{ config, lib, pkgs, ... }: - { config = { qt = { enable = true; - platformTheme = "gtk"; + platformTheme.name = "gtk"; }; i18n.inputMethod.enabled = "fcitx5"; diff --git a/tests/modules/misc/qt/qt-platform-theme-gtk3.nix b/tests/modules/misc/qt/qt-platform-theme-gtk3.nix index 2b3ade9dd21e..2640881864fb 100644 --- a/tests/modules/misc/qt/qt-platform-theme-gtk3.nix +++ b/tests/modules/misc/qt/qt-platform-theme-gtk3.nix @@ -1,10 +1,8 @@ -{ config, lib, pkgs, ... }: - { config = { qt = { enable = true; - platformTheme = "gtk3"; + platformTheme.name = "gtk3"; }; nmt.script = '' From be2b17615c536c31d0ea4989a959298b115353b3 Mon Sep 17 00:00:00 2001 From: Tschai <89387771+tschai-yim@users.noreply.github.com> Date: Fri, 22 Mar 2024 08:02:38 +0100 Subject: [PATCH 189/636] qt: fix adwaita decorations link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com> --- modules/misc/qt.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/misc/qt.nix b/modules/misc/qt.nix index e3e5be41c60d..2dbb313995b0 100644 --- a/modules/misc/qt.nix +++ b/modules/misc/qt.nix @@ -91,7 +91,7 @@ in { `adwaita` : Use Adwaita theme with - [`qadwaitadecorations`](https://github.com/FedoraQt/QGnomePlatform) + [`qadwaitadecorations`](https://github.com/FedoraQt/QAdwaitaDecorations) `gnome` (deprecated) : Use GNOME theme with From 54e35e0e1c1b6b4888c34423335a448ab3ec78d5 Mon Sep 17 00:00:00 2001 From: tschai-yim <89387771+tschai-yim@users.noreply.github.com> Date: Sun, 24 Mar 2024 15:52:14 +0100 Subject: [PATCH 190/636] qt: use warnings API --- modules/misc/qt.nix | 21 ++++++++++--------- .../misc/qt/qt-platform-theme-gnome.nix | 4 ++++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/misc/qt.nix b/modules/misc/qt.nix index 2dbb313995b0..51fbac46e1b5 100644 --- a/modules/misc/qt.nix +++ b/modules/misc/qt.nix @@ -187,22 +187,17 @@ in { }; config = let - warnGnomeDeprecation = option: name: - lib.warnIf (name == "gnome") - "The value `gnome` for option `${option}` is deprecated. Use `adwaita` instead." - name; - platformTheme = if (builtins.isString cfg.platformTheme) then { - name = lib.warn - "The option `qt.platformTheme` has been renamed to `qt.platformTheme.name`." - (warnGnomeDeprecation "qt.platformTheme" cfg.platformTheme); + option = "qt.platformTheme"; + name = cfg.platformTheme; package = null; } else if cfg.platformTheme == null then { + option = null; name = null; package = null; } else { - name = - warnGnomeDeprecation "cfg.platformTheme.name" cfg.platformTheme.name; + option = "qt.platformTheme.name"; + name = cfg.platformTheme.name; package = cfg.platformTheme.package; }; @@ -238,6 +233,12 @@ in { ''; }]; + warnings = (lib.lists.optional (platformTheme.option == "qt.platformTheme") + "The option `qt.platformTheme` has been renamed to `qt.platformTheme.name`.") + ++ (lib.lists.optional + (platformTheme.name == "gnome" && platformTheme.package == null) + "The value `gnome` for option `${platformTheme.option}` is deprecated. Use `adwaita` instead."); + qt.style.package = lib.mkIf (cfg.style.name != null) (lib.mkDefault (stylePackages.${lib.toLower cfg.style.name} or null)); diff --git a/tests/modules/misc/qt/qt-platform-theme-gnome.nix b/tests/modules/misc/qt/qt-platform-theme-gnome.nix index 617d99b068ab..ab65f146a0f8 100644 --- a/tests/modules/misc/qt/qt-platform-theme-gnome.nix +++ b/tests/modules/misc/qt/qt-platform-theme-gnome.nix @@ -19,5 +19,9 @@ assertFileRegex home-path/etc/profile.d/hm-session-vars.sh \ 'QML2_IMPORT_PATH' ''; + test.asserts.warnings.expected = [ + "The option `qt.platformTheme` has been renamed to `qt.platformTheme.name`." + "The value `gnome` for option `qt.platformTheme` is deprecated. Use `adwaita` instead." + ]; }; } From ffc3600f4009ca39b6cb63b24127ca4f93792854 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Fri, 12 Apr 2024 10:19:25 -0400 Subject: [PATCH 191/636] fd: add module --- modules/misc/news.nix | 7 +++++ modules/modules.nix | 1 + modules/programs/fd.nix | 59 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 modules/programs/fd.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 97b8da7bbae4..2c00c5ed3cd9 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1476,6 +1476,13 @@ in { A new module is available: 'programs.bun'. ''; } + + { + time = "2024-04-18T22:30:49+00:00"; + message = '' + A new module is available: 'programs.fd'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index ff48b21a546d..b182a33e9ad5 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -86,6 +86,7 @@ let ./programs/emacs.nix ./programs/eww.nix ./programs/eza.nix + ./programs/fd.nix ./programs/feh.nix ./programs/firefox.nix ./programs/fish.nix diff --git a/modules/programs/fd.nix b/modules/programs/fd.nix new file mode 100644 index 000000000000..bc5b709dbde2 --- /dev/null +++ b/modules/programs/fd.nix @@ -0,0 +1,59 @@ +{ config, lib, pkgs, ... }: +with lib; { + meta.maintainers = [ maintainers.uncenter ]; + + options.programs.fd = { + enable = mkEnableOption + "fd, a simple, fast and user-friendly alternative to {command}`find`"; + + ignores = mkOption { + type = types.listOf types.str; + default = [ ]; + example = [ ".git/" "*.bak" ]; + description = "List of paths that should be globally ignored."; + }; + + hidden = mkOption { + type = types.bool; + default = false; + description = '' + Search hidden files and directories ({option}`--hidden` argument). + ''; + }; + + extraOptions = mkOption { + type = types.listOf types.str; + default = [ ]; + example = [ "--no-ignore" "--absolute-path" ]; + description = '' + Extra command line options passed to fd. + ''; + }; + + package = mkPackageOption pkgs "fd" { }; + }; + + config = let + cfg = config.programs.fd; + + args = escapeShellArgs (optional cfg.hidden "--hidden" ++ cfg.extraOptions); + + optionsAlias = { fd = "fd ${args}"; }; + in mkIf cfg.enable { + home.packages = [ cfg.package ]; + + programs.bash.shellAliases = optionsAlias; + + programs.zsh.shellAliases = optionsAlias; + + programs.fish.shellAliases = optionsAlias; + + programs.ion.shellAliases = optionsAlias; + + programs.nushell.shellAliases = optionsAlias; + + xdg.configFile."fd/ignore" = mkIf (cfg.ignores != [ ]) { + text = concatStringsSep "\n" cfg.ignores + "\n"; + }; + }; +} From f3506ba86cbc5f8620ea6b4e108146702a4627e9 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 19 Apr 2024 09:50:22 +0200 Subject: [PATCH 192/636] bash: add bash package to home.packages Fixes #5295 --- modules/programs/bash.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/programs/bash.nix b/modules/programs/bash.nix index b48dc3129327..5e7a44b53399 100644 --- a/modules/programs/bash.nix +++ b/modules/programs/bash.nix @@ -190,6 +190,8 @@ in { HISTIGNORE = escapeShellArg (concatStringsSep ":" cfg.historyIgnore); })); in mkIf cfg.enable { + home.packages = [ pkgs.bashInteractive ]; + home.file.".bash_profile".source = writeBashScript "bash_profile" '' # include .profile if it exists [[ -f ~/.profile ]] && . ~/.profile From 8ff7bb3f4d82a05a52d5242ec454bba14f5d6cc6 Mon Sep 17 00:00:00 2001 From: Henri Sota Date: Tue, 16 Apr 2024 22:44:55 +0200 Subject: [PATCH 193/636] tofi: add module --- modules/lib/maintainers.nix | 6 ++ modules/misc/news.nix | 8 +++ modules/modules.nix | 1 + modules/programs/tofi.nix | 63 +++++++++++++++++++ tests/default.nix | 1 + .../programs/tofi/basic-configuration.conf | 12 ++++ .../programs/tofi/basic-configuration.nix | 28 +++++++++ tests/modules/programs/tofi/default.nix | 1 + 8 files changed, 120 insertions(+) create mode 100644 modules/programs/tofi.nix create mode 100644 tests/modules/programs/tofi/basic-configuration.conf create mode 100644 tests/modules/programs/tofi/basic-configuration.nix create mode 100644 tests/modules/programs/tofi/default.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 2c4fbd9daabb..727d4c3c2157 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -77,6 +77,12 @@ githubId = 32838899; name = "Daniel Wagenknecht"; }; + henrisota = { + email = "henrisota@users.noreply.github.com"; + github = "henrisota"; + githubId = "56848082"; + name = "Henri Sota"; + }; jack5079 = { name = "Jack W."; email = "nix@jack.cab"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 2c00c5ed3cd9..8e3045459c03 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1483,6 +1483,14 @@ in { A new module is available: 'programs.fd'. ''; } + + { + time = "2024-04-19T09:23:52+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'programs.tofi'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index b182a33e9ad5..c283b071e84c 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -228,6 +228,7 @@ let ./programs/tiny.nix ./programs/tmate.nix ./programs/tmux.nix + ./programs/tofi.nix ./programs/topgrade.nix ./programs/translate-shell.nix ./programs/urxvt.nix diff --git a/modules/programs/tofi.nix b/modules/programs/tofi.nix new file mode 100644 index 000000000000..acc1a994d385 --- /dev/null +++ b/modules/programs/tofi.nix @@ -0,0 +1,63 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.programs.tofi; + +in { + meta.maintainers = [ hm.maintainers.henrisota ]; + + options.programs.tofi = { + enable = mkEnableOption "Tofi, a tiny dynamic menu for Wayland"; + + package = mkPackageOption pkgs "tofi" { }; + + settings = mkOption { + type = with types; + let primitive = either (either str int) bool; + in attrsOf primitive; + default = { }; + example = literalExpression '' + { + background-color = "#000000"; + border-width = 0; + font = "monospace"; + height = "100%"; + num-results = 5; + outline-width = 0; + padding-left = "35%"; + padding-top = "35%"; + result-spacing = 25; + width = "100%"; + } + ''; + description = '' + Settings to be written to the Tofi configuration file. + + See + for the full list of options. + ''; + }; + }; + + config = mkIf cfg.enable { + assertions = + [ (hm.assertions.assertPlatform "programs.tofi" pkgs platforms.linux) ]; + + home.packages = [ cfg.package ]; + + xdg.configFile."tofi/config" = mkIf (cfg.settings != { }) { + text = let + renderedSettings = generators.toINIWithGlobalSection { } { + globalSection = cfg.settings; + }; + in removeSuffix "\n\n" '' + # Generated by Home Manager. + + ${renderedSettings} + ''; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 6253896616c4..c95b288a8467 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -207,6 +207,7 @@ in import nmtSrc { ./modules/programs/swayr ./modules/programs/terminator ./modules/programs/thunderbird + ./modules/programs/tofi ./modules/programs/waybar ./modules/programs/wlogout ./modules/programs/wofi diff --git a/tests/modules/programs/tofi/basic-configuration.conf b/tests/modules/programs/tofi/basic-configuration.conf new file mode 100644 index 000000000000..3a95c23e06ee --- /dev/null +++ b/tests/modules/programs/tofi/basic-configuration.conf @@ -0,0 +1,12 @@ +# Generated by Home Manager. + +background-color=#000000 +border-width=0 +font=monospace +height=100% +num-results=5 +outline-width=0 +padding-left=35% +padding-top=35% +result-spacing=25 +width=100% diff --git a/tests/modules/programs/tofi/basic-configuration.nix b/tests/modules/programs/tofi/basic-configuration.nix new file mode 100644 index 000000000000..28b289969774 --- /dev/null +++ b/tests/modules/programs/tofi/basic-configuration.nix @@ -0,0 +1,28 @@ +{ config, pkgs, ... }: { + config = { + programs.tofi = { + enable = true; + package = pkgs.tofi; + settings = { + background-color = "#000000"; + border-width = 0; + font = "monospace"; + height = "100%"; + num-results = 5; + outline-width = 0; + padding-left = "35%"; + padding-top = "35%"; + result-spacing = 25; + width = "100%"; + }; + }; + + test.stubs.tofi = { }; + + nmt.script = '' + assertFileExists home-files/.config/tofi/config + assertFileContent home-files/.config/tofi/config \ + ${./basic-configuration.conf} + ''; + }; +} diff --git a/tests/modules/programs/tofi/default.nix b/tests/modules/programs/tofi/default.nix new file mode 100644 index 000000000000..22b89d809269 --- /dev/null +++ b/tests/modules/programs/tofi/default.nix @@ -0,0 +1 @@ +{ tofi-basic-configuration = ./basic-configuration.nix; } From b5b2b1ac63458357e205bcb2df2d0840a2acca13 Mon Sep 17 00:00:00 2001 From: Danil Suetin Date: Fri, 19 Apr 2024 15:05:08 +0500 Subject: [PATCH 194/636] helix: add ignores option --- modules/programs/helix.nix | 13 +++++++++++++ tests/modules/programs/helix/example-settings.nix | 5 +++++ tests/modules/programs/helix/ignore-expected | 2 ++ 3 files changed, 20 insertions(+) create mode 100644 tests/modules/programs/helix/ignore-expected diff --git a/modules/programs/helix.nix b/modules/programs/helix.nix index 9c5519f3ba08..96c5bdbf18f1 100644 --- a/modules/programs/helix.nix +++ b/modules/programs/helix.nix @@ -96,6 +96,16 @@ in { ''; }; + ignores = mkOption { + type = types.listOf types.str; + default = [ ]; + example = [ ".build/" "!.gitignore" ]; + description = '' + List of paths that should be globally ignored for file picker. + Supports the usual ignore and negative ignore (unignore) rules used in `.gitignore` files. + ''; + }; + themes = mkOption { type = types.attrsOf tomlFormat.type; default = { }; @@ -195,6 +205,9 @@ in { "helix/languages.toml" = mkIf (cfg.languages != { }) { source = tomlFormat.generate "helix-languages-config" cfg.languages; }; + "helix/ignore" = mkIf (cfg.ignores != [ ]) { + text = concatStringsSep "\n" cfg.ignores + "\n"; + }; }; themes = (mapAttrs' (n: v: diff --git a/tests/modules/programs/helix/example-settings.nix b/tests/modules/programs/helix/example-settings.nix index 86c6766a893b..c60883a124ff 100644 --- a/tests/modules/programs/helix/example-settings.nix +++ b/tests/modules/programs/helix/example-settings.nix @@ -43,6 +43,8 @@ with lib; }]; }; + ignores = [ ".build/" "!.gitignore" ]; + themes = { base16 = let transparent = "none"; @@ -131,6 +133,9 @@ with lib; assertFileContent \ home-files/.config/helix/languages.toml \ ${./languages-expected.toml} + assertFileContent \ + home-files/.config/helix/ignore \ + ${./ignore-expected} assertFileContent \ home-files/.config/helix/themes/base16.toml \ ${./theme-base16-expected.toml} diff --git a/tests/modules/programs/helix/ignore-expected b/tests/modules/programs/helix/ignore-expected new file mode 100644 index 000000000000..fe1c7398a862 --- /dev/null +++ b/tests/modules/programs/helix/ignore-expected @@ -0,0 +1,2 @@ +.build/ +!.gitignore From b62cad68b754224caec1e3b0dbadf86821b0b255 Mon Sep 17 00:00:00 2001 From: diniamo <55629891+diniamo@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:39:30 +0200 Subject: [PATCH 195/636] spotify-player: add module --- modules/lib/maintainers.nix | 6 + modules/misc/news.nix | 7 + modules/modules.nix | 1 + modules/programs/spotify-player.nix | 154 ++++++++++++++++++ tests/default.nix | 1 + .../modules/programs/spotify-player/app.toml | 9 + .../programs/spotify-player/default.nix | 1 + .../programs/spotify-player/keymap.toml | 19 +++ .../programs/spotify-player/settings.nix | 103 ++++++++++++ .../programs/spotify-player/theme.toml | 58 +++++++ 10 files changed, 359 insertions(+) create mode 100644 modules/programs/spotify-player.nix create mode 100644 tests/modules/programs/spotify-player/app.toml create mode 100644 tests/modules/programs/spotify-player/default.nix create mode 100644 tests/modules/programs/spotify-player/keymap.toml create mode 100644 tests/modules/programs/spotify-player/settings.nix create mode 100644 tests/modules/programs/spotify-player/theme.toml diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 727d4c3c2157..a2c568633711 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -71,6 +71,12 @@ github = "Dines97"; githubId = 19364873; }; + diniamo = { + name = "diniamo"; + email = "diniamo69@gmail.com"; + github = "diniamo"; + githubId = 55629891; + }; dwagenk = { email = "dwagenk@mailbox.org"; github = "dwagenk"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 8e3045459c03..ef5378af1715 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1491,6 +1491,13 @@ in { A new module is available: 'programs.tofi'. ''; } + + { + time = "2024-04-19T10:01:55+00:00"; + message = '' + A new module is available: 'programs.spotify-player'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index c283b071e84c..512841029868 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -211,6 +211,7 @@ let ./programs/sioyek.nix ./programs/skim.nix ./programs/sm64ex.nix + ./programs/spotify-player.nix ./programs/sqls.nix ./programs/ssh.nix ./programs/starship.nix diff --git a/modules/programs/spotify-player.nix b/modules/programs/spotify-player.nix new file mode 100644 index 000000000000..83eefe12d2f6 --- /dev/null +++ b/modules/programs/spotify-player.nix @@ -0,0 +1,154 @@ +{ config, lib, pkgs, ... }: + +let + inherit (lib) + mkEnableOption mkPackageOption mkOption types literalExpression mkIf; + + cfg = config.programs.spotify-player; + tomlFormat = pkgs.formats.toml { }; + +in { + meta.maintainers = with lib.hm.maintainers; [ diniamo ]; + + options.programs.spotify-player = { + enable = mkEnableOption "spotify-player"; + + package = mkPackageOption pkgs "spotify-player" { }; + + settings = mkOption { + type = tomlFormat.type; + default = { }; + example = literalExpression '' + { + theme = "default"; + playback_window_position = "Top"; + copy_command = { + command = "wl-copy"; + args = []; + }; + device = { + audio_cache = false; + normalization = false; + }; + } + ''; + description = '' + Configuration written to + {file}`$XDG_CONFIG_HOME/spotify-player/app.toml`. + + See + + for the full list of options. + ''; + }; + + themes = mkOption { + type = types.listOf tomlFormat.type; + default = [ ]; + example = literalExpression '' + [ + { + name = "default2"; + palette = { + black = "black"; + red = "red"; + green = "green"; + yellow = "yellow"; + blue = "blue"; + magenta = "magenta"; + cyan = "cyan"; + white = "white"; + bright_black = "bright_black"; + bright_red = "bright_red"; + bright_green = "bright_green"; + bright_yellow = "bright_yellow"; + bright_blue = "bright_blue"; + bright_magenta = "bright_magenta"; + bright_cyan = "bright_cyan"; + bright_white = "bright_white"; + }; + component_style = { + block_title = { fg = "Magenta"; }; + border = {}; + playback_track = { fg = "Cyan"; modifiers = ["Bold"]; }; + playback_artists = { fg = "Cyan"; modifiers = ["Bold"]; }; + playback_album = { fg = "Yellow"; }; + playback_metadata = { fg = "BrightBlack"; }; + playback_progress_bar = { bg = "BrightBlack"; fg = "Green"; }; + current_playing = { fg = "Green"; modifiers = ["Bold"]; }; + page_desc = { fg = "Cyan"; modifiers = ["Bold"]; }; + table_header = { fg = "Blue"; }; + selection = { modifiers = ["Bold" "Reversed"]; }; + }; + } + ] + ''; + description = '' + Configuration written to the `themes` field of + {file}`$XDG_CONFIG_HOME/spotify-player/theme.toml`. + + See + + for the full list of options. + ''; + }; + + keymaps = mkOption { + type = types.listOf tomlFormat.type; + default = [ ]; + example = literalExpression '' + [ + { + command = "NextTrack"; + key_sequence = "g n"; + } + { + command = "PreviousTrack"; + key_sequence = "g p"; + } + { + command = "Search"; + key_sequence = "C-c C-x /"; + } + { + command = "ResumePause"; + key_sequence = "M-enter"; + } + { + command = "None"; + key_sequence = "q"; + } + ] + ''; + description = '' + Configuration written to the `keymaps` field of + {file}`$XDG_CONFIG_HOME/spotify-player/keymap.toml`. + + See + + for the full list of options. + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + + xdg.configFile = { + "spotify-player/app.toml" = mkIf (cfg.settings != { }) { + source = tomlFormat.generate "spotify-player-app" cfg.settings; + }; + + "spotify-player/theme.toml" = mkIf (cfg.themes != [ ]) { + source = + tomlFormat.generate "spotify-player-theme" { inherit (cfg) themes; }; + }; + + "spotify-player/keymap.toml" = mkIf (cfg.keymaps != [ ]) { + source = tomlFormat.generate "spotify-player-keymap" { + inherit (cfg) keymaps; + }; + }; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index c95b288a8467..c4d98ef2ec0b 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -140,6 +140,7 @@ in import nmtSrc { ./modules/programs/sftpman ./modules/programs/sioyek ./modules/programs/sm64ex + ./modules/programs/spotify-player ./modules/programs/ssh ./modules/programs/starship ./modules/programs/taskwarrior diff --git a/tests/modules/programs/spotify-player/app.toml b/tests/modules/programs/spotify-player/app.toml new file mode 100644 index 000000000000..408e84b0dd24 --- /dev/null +++ b/tests/modules/programs/spotify-player/app.toml @@ -0,0 +1,9 @@ +playback_window_position = "Top" +theme = "default" +[copy_command] +args = [] +command = "wl-copy" + +[device] +audio_cache = false +normalization = false diff --git a/tests/modules/programs/spotify-player/default.nix b/tests/modules/programs/spotify-player/default.nix new file mode 100644 index 000000000000..9812b12812e2 --- /dev/null +++ b/tests/modules/programs/spotify-player/default.nix @@ -0,0 +1 @@ +{ spotify-player-settings = ./settings.nix; } diff --git a/tests/modules/programs/spotify-player/keymap.toml b/tests/modules/programs/spotify-player/keymap.toml new file mode 100644 index 000000000000..d11c86e41fc6 --- /dev/null +++ b/tests/modules/programs/spotify-player/keymap.toml @@ -0,0 +1,19 @@ +[[keymaps]] +command = "NextTrack" +key_sequence = "g n" + +[[keymaps]] +command = "PreviousTrack" +key_sequence = "g p" + +[[keymaps]] +command = "Search" +key_sequence = "C-c C-x /" + +[[keymaps]] +command = "ResumePause" +key_sequence = "M-enter" + +[[keymaps]] +command = "None" +key_sequence = "q" diff --git a/tests/modules/programs/spotify-player/settings.nix b/tests/modules/programs/spotify-player/settings.nix new file mode 100644 index 000000000000..dc7fe8c6af1b --- /dev/null +++ b/tests/modules/programs/spotify-player/settings.nix @@ -0,0 +1,103 @@ +{ + programs.spotify-player = { + enable = true; + + settings = { + theme = "default"; + playback_window_position = "Top"; + copy_command = { + command = "wl-copy"; + args = [ ]; + }; + device = { + audio_cache = false; + normalization = false; + }; + }; + + themes = [{ + name = "default2"; + palette = { + black = "black"; + red = "red"; + green = "green"; + yellow = "yellow"; + blue = "blue"; + magenta = "magenta"; + cyan = "cyan"; + white = "white"; + bright_black = "bright_black"; + bright_red = "bright_red"; + bright_green = "bright_green"; + bright_yellow = "bright_yellow"; + bright_blue = "bright_blue"; + bright_magenta = "bright_magenta"; + bright_cyan = "bright_cyan"; + bright_white = "bright_white"; + }; + component_style = { + block_title = { fg = "Magenta"; }; + border = { }; + playback_track = { + fg = "Cyan"; + modifiers = [ "Bold" ]; + }; + playback_artists = { + fg = "Cyan"; + modifiers = [ "Bold" ]; + }; + playback_album = { fg = "Yellow"; }; + playback_metadata = { fg = "BrightBlack"; }; + playback_progress_bar = { + bg = "BrightBlack"; + fg = "Green"; + }; + current_playing = { + fg = "Green"; + modifiers = [ "Bold" ]; + }; + page_desc = { + fg = "Cyan"; + modifiers = [ "Bold" ]; + }; + table_header = { fg = "Blue"; }; + selection = { modifiers = [ "Bold" "Reversed" ]; }; + }; + }]; + + keymaps = [ + { + command = "NextTrack"; + key_sequence = "g n"; + } + { + command = "PreviousTrack"; + key_sequence = "g p"; + } + { + command = "Search"; + key_sequence = "C-c C-x /"; + } + { + command = "ResumePause"; + key_sequence = "M-enter"; + } + { + command = "None"; + key_sequence = "q"; + } + ]; + }; + + test.stubs.spotify-player = { }; + + nmt.script = '' + assertFileContent home-files/.config/spotify-player/app.toml ${./app.toml} + assertFileContent home-files/.config/spotify-player/theme.toml ${ + ./theme.toml + } + assertFileContent home-files/.config/spotify-player/keymap.toml ${ + ./keymap.toml + } + ''; +} diff --git a/tests/modules/programs/spotify-player/theme.toml b/tests/modules/programs/spotify-player/theme.toml new file mode 100644 index 000000000000..cb5fa99d49ee --- /dev/null +++ b/tests/modules/programs/spotify-player/theme.toml @@ -0,0 +1,58 @@ +[[themes]] +name = "default2" + +[themes.component_style] +[themes.component_style.block_title] +fg = "Magenta" + +[themes.component_style.border] + +[themes.component_style.current_playing] +fg = "Green" +modifiers = ["Bold"] + +[themes.component_style.page_desc] +fg = "Cyan" +modifiers = ["Bold"] + +[themes.component_style.playback_album] +fg = "Yellow" + +[themes.component_style.playback_artists] +fg = "Cyan" +modifiers = ["Bold"] + +[themes.component_style.playback_metadata] +fg = "BrightBlack" + +[themes.component_style.playback_progress_bar] +bg = "BrightBlack" +fg = "Green" + +[themes.component_style.playback_track] +fg = "Cyan" +modifiers = ["Bold"] + +[themes.component_style.selection] +modifiers = ["Bold", "Reversed"] + +[themes.component_style.table_header] +fg = "Blue" + +[themes.palette] +black = "black" +blue = "blue" +bright_black = "bright_black" +bright_blue = "bright_blue" +bright_cyan = "bright_cyan" +bright_green = "bright_green" +bright_magenta = "bright_magenta" +bright_red = "bright_red" +bright_white = "bright_white" +bright_yellow = "bright_yellow" +cyan = "cyan" +green = "green" +magenta = "magenta" +red = "red" +white = "white" +yellow = "yellow" From b1a5b3d6a524c80c7dd20888bff227d52adf5f03 Mon Sep 17 00:00:00 2001 From: Felipe Silva Date: Fri, 19 Apr 2024 08:01:05 -0300 Subject: [PATCH 196/636] vdirsyncer: set `postHook` to null when not set (#5294) The `postHook` option was being processed and reset to a string, even if the user set it to null, causing issues under certain conditions (see Using `if-then-else` instead of `optionalString` keeps the option as null, instead of setting it to an empty string. --- modules/programs/vdirsyncer.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/programs/vdirsyncer.nix b/modules/programs/vdirsyncer.nix index 562d7b4be8f1..2e013af06119 100644 --- a/modules/programs/vdirsyncer.nix +++ b/modules/programs/vdirsyncer.nix @@ -26,9 +26,11 @@ let filterAttrs (_: v: v != null) ((getAttrs [ "type" "fileExt" "encoding" ] a.local) // { path = a.local.path; - postHook = optionalString (a.vdirsyncer.postHook != null) + postHook = if a.vdirsyncer.postHook != null then (pkgs.writeShellScriptBin "post-hook" a.vdirsyncer.postHook - + "/bin/post-hook"); + + "/bin/post-hook") + else + null; }); remoteStorage = a: From 0184c8180f5cbb8e3a54a239b874fe849d3073cb Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sun, 14 Aug 2022 01:37:46 +0200 Subject: [PATCH 197/636] neomutt: add some options Superficially, allow source primary account by default and show default mailbox. --- modules/programs/neomutt-accounts.nix | 6 ++++++ modules/programs/neomutt.nix | 13 ++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/modules/programs/neomutt-accounts.nix b/modules/programs/neomutt-accounts.nix index a7ed7ec62c54..bdeda863e7ac 100644 --- a/modules/programs/neomutt-accounts.nix +++ b/modules/programs/neomutt-accounts.nix @@ -76,6 +76,12 @@ in { ''; }; + showDefaultMailbox = mkOption { + type = types.bool; + default = true; + description = "Show the default mailbox (INBOX)"; + }; + mailboxName = mkOption { type = types.nullOr types.str; default = null; diff --git a/modules/programs/neomutt.nix b/modules/programs/neomutt.nix index d338a5802995..069c4de82fd8 100644 --- a/modules/programs/neomutt.nix +++ b/modules/programs/neomutt.nix @@ -235,7 +235,8 @@ let account.neomutt.extraMailboxes; in with account; '' # register account ${name} - ${mailboxes} "${mailroot}/${folders.inbox}" + ${optionalString account.neomutt.showDefaultMailbox + ''${mailboxes} "${mailroot}/${folders.inbox}"''} ${extraMailboxes} ${hookName} ${mailroot}/ " \ source ${accountFilename account} " @@ -402,6 +403,11 @@ in { default = true; }; + sourcePrimaryAccount = + mkEnableOption "source the primary account by default" // { + default = true; + }; + unmailboxes = mkOption { type = types.bool; default = false; @@ -467,8 +473,9 @@ in { '' }${concatMapStringsSep "\n" registerAccount neomuttAccounts} - # Source primary account - source ${accountFilename primary} + ${optionalString cfg.sourcePrimaryAccount '' + # Source primary account + source ${accountFilename primary}''} # Extra configuration ${optionsStr cfg.settings} From dc906b197bc20c518e497fb040bb8240543fa634 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Fri, 19 Apr 2024 08:30:58 -0300 Subject: [PATCH 198/636] kdeconnect: require "tray.target" for kdeconnect Since kdeconnect-indicator is a tray application, it should require "tray.target", as is the case for flameshot[0]. [0]: https://github.com/nix-community/home-manager/blob/b1a5b3d6a524c80c7dd20888bff227d52adf5f03/modules/services/flameshot.nix#L58 --- modules/services/kdeconnect.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/services/kdeconnect.nix b/modules/services/kdeconnect.nix index 39673131489f..65477be1d1d7 100644 --- a/modules/services/kdeconnect.nix +++ b/modules/services/kdeconnect.nix @@ -24,7 +24,6 @@ in { default = false; description = "Whether to enable kdeconnect-indicator service."; }; - }; }; @@ -43,7 +42,7 @@ in { "Adds communication between your desktop and your smartphone"; After = [ "graphical-session-pre.target" ]; PartOf = [ "graphical-session.target" ]; - }; + } // lib.optionalAttrs cfg.indicator { Requires = [ "tray.target" ]; }; Install = { WantedBy = [ "graphical-session.target" ]; }; @@ -82,6 +81,5 @@ in { }; }; }) - ]; } From 7ca7025cf2fa88bebc2190955c44263c3989b706 Mon Sep 17 00:00:00 2001 From: Ramses Date: Fri, 19 Apr 2024 16:26:23 +0200 Subject: [PATCH 199/636] alacritty: fix escape sequence in example and test See https://github.com/nix-community/home-manager/pull/4817#discussion_r1441710049 --- modules/programs/alacritty.nix | 2 +- tests/modules/programs/alacritty/settings-toml-expected.toml | 2 +- tests/modules/programs/alacritty/toml_config.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/programs/alacritty.nix b/modules/programs/alacritty.nix index 2f7845f4d347..edcd073e1db7 100644 --- a/modules/programs/alacritty.nix +++ b/modules/programs/alacritty.nix @@ -32,7 +32,7 @@ in { { key = "K"; mods = "Control"; - chars = "\\x0c"; + chars = "\\u000c"; } ]; } diff --git a/tests/modules/programs/alacritty/settings-toml-expected.toml b/tests/modules/programs/alacritty/settings-toml-expected.toml index 9b0867ee7014..018881bcdea2 100644 --- a/tests/modules/programs/alacritty/settings-toml-expected.toml +++ b/tests/modules/programs/alacritty/settings-toml-expected.toml @@ -6,7 +6,7 @@ family = "SFMono" family = "SFMono" [[keyboard.bindings]] -chars = "\x0c" +chars = "\u000c" key = "K" mods = "Control" diff --git a/tests/modules/programs/alacritty/toml_config.nix b/tests/modules/programs/alacritty/toml_config.nix index 4f15e70b8bef..02d5aabfe483 100644 --- a/tests/modules/programs/alacritty/toml_config.nix +++ b/tests/modules/programs/alacritty/toml_config.nix @@ -15,7 +15,7 @@ keyboard.bindings = [{ key = "K"; mods = "Control"; - chars = "\\x0c"; + chars = "\\u000c"; }]; font = { From 068dd4ae292b5bf64bda18a48bcd80f39dd76257 Mon Sep 17 00:00:00 2001 From: Ramses Date: Fri, 19 Apr 2024 16:57:02 +0200 Subject: [PATCH 200/636] alacritty: cleanup after 0.13 merge in nixpkgs --- modules/programs/alacritty.nix | 31 ++++++------------- .../programs/alacritty/empty-settings.nix | 4 --- .../alacritty/example-settings-expected.toml | 2 +- .../programs/alacritty/example-settings.nix | 8 ++--- .../alacritty/settings-merging-expected.yml | 1 - .../programs/alacritty/settings-merging.nix | 14 ++++----- .../programs/alacritty/toml_config.nix | 2 +- 7 files changed, 21 insertions(+), 41 deletions(-) delete mode 100644 tests/modules/programs/alacritty/settings-merging-expected.yml diff --git a/modules/programs/alacritty.nix b/modules/programs/alacritty.nix index edcd073e1db7..e799e2696492 100644 --- a/modules/programs/alacritty.nix +++ b/modules/programs/alacritty.nix @@ -4,9 +4,7 @@ with lib; let cfg = config.programs.alacritty; - useToml = lib.versionAtLeast cfg.package.version "0.13"; tomlFormat = pkgs.formats.toml { }; - configFileName = "alacritty.${if useToml then "toml" else "yml"}"; in { options = { programs.alacritty = { @@ -52,24 +50,15 @@ in { config = mkIf cfg.enable { home.packages = [ cfg.package ]; - xdg.configFile."alacritty/${configFileName}" = - lib.mkIf (cfg.settings != { }) (lib.mkMerge [ - (lib.mkIf useToml { - source = - (tomlFormat.generate configFileName cfg.settings).overrideAttrs - (finalAttrs: prevAttrs: { - buildCommand = lib.concatStringsSep "\n" [ - prevAttrs.buildCommand - # TODO: why is this needed? Is there a better way to retain escape sequences? - "substituteInPlace $out --replace '\\\\' '\\'" - ]; - }); - }) - # TODO remove this once we don't need to support Alacritty < 0.12 anymore - (lib.mkIf (!useToml) { - text = - replaceStrings [ "\\\\" ] [ "\\" ] (builtins.toJSON cfg.settings); - }) - ]); + xdg.configFile."alacritty/alacritty.toml" = lib.mkIf (cfg.settings != { }) { + source = (tomlFormat.generate "alacritty.toml" cfg.settings).overrideAttrs + (finalAttrs: prevAttrs: { + buildCommand = lib.concatStringsSep "\n" [ + prevAttrs.buildCommand + # TODO: why is this needed? Is there a better way to retain escape sequences? + "substituteInPlace $out --replace '\\\\' '\\'" + ]; + }); + }; }; } diff --git a/tests/modules/programs/alacritty/empty-settings.nix b/tests/modules/programs/alacritty/empty-settings.nix index ecc6df35a7b7..c587018e5f61 100644 --- a/tests/modules/programs/alacritty/empty-settings.nix +++ b/tests/modules/programs/alacritty/empty-settings.nix @@ -1,7 +1,3 @@ -{ config, lib, pkgs, ... }: - -with lib; - { config = { programs.alacritty.enable = true; diff --git a/tests/modules/programs/alacritty/example-settings-expected.toml b/tests/modules/programs/alacritty/example-settings-expected.toml index 723f1874c8dd..7b08aae84fc6 100644 --- a/tests/modules/programs/alacritty/example-settings-expected.toml +++ b/tests/modules/programs/alacritty/example-settings-expected.toml @@ -1,5 +1,5 @@ [[keyboard.bindings]] -chars = "\x0c" +chars = "\u000c" key = "K" mods = "Control" diff --git a/tests/modules/programs/alacritty/example-settings.nix b/tests/modules/programs/alacritty/example-settings.nix index 8aa013808c28..c8ecb206c8ea 100644 --- a/tests/modules/programs/alacritty/example-settings.nix +++ b/tests/modules/programs/alacritty/example-settings.nix @@ -1,12 +1,10 @@ -{ config, lib, pkgs, ... }: - -with lib; +{ config, ... }: { config = { programs.alacritty = { enable = true; - package = config.lib.test.mkStubPackage { version = "0.13.0"; }; + package = config.lib.test.mkStubPackage { }; settings = { window.dimensions = { @@ -17,7 +15,7 @@ with lib; keyboard.bindings = [{ key = "K"; mods = "Control"; - chars = "\\x0c"; + chars = "\\u000c"; }]; }; }; diff --git a/tests/modules/programs/alacritty/settings-merging-expected.yml b/tests/modules/programs/alacritty/settings-merging-expected.yml deleted file mode 100644 index 49d92a614e88..000000000000 --- a/tests/modules/programs/alacritty/settings-merging-expected.yml +++ /dev/null @@ -1 +0,0 @@ -{"font":{"bold":{"family":"SFMono"},"normal":{"family":"SFMono"}},"key_bindings":[{"chars":"\x0c","key":"K","mods":"Control"}],"window":{"dimensions":{"columns":200,"lines":3}}} \ No newline at end of file diff --git a/tests/modules/programs/alacritty/settings-merging.nix b/tests/modules/programs/alacritty/settings-merging.nix index 76aedf4f64c8..e08c96ebc833 100644 --- a/tests/modules/programs/alacritty/settings-merging.nix +++ b/tests/modules/programs/alacritty/settings-merging.nix @@ -1,12 +1,10 @@ -{ config, lib, pkgs, ... }: - -with lib; +{ config, lib, ... }: { config = { programs.alacritty = { enable = true; - package = config.lib.test.mkStubPackage { version = "0.12.3"; }; + package = config.lib.test.mkStubPackage { }; settings = { window.dimensions = { @@ -14,10 +12,10 @@ with lib; columns = 200; }; - key_bindings = [{ + keyboard.bindings = [{ key = "K"; mods = "Control"; - chars = "\\x0c"; + chars = "\\u000c"; }]; font = let @@ -32,8 +30,8 @@ with lib; nmt.script = '' assertFileContent \ - home-files/.config/alacritty/alacritty.yml \ - ${./settings-merging-expected.yml} + home-files/.config/alacritty/alacritty.toml \ + ${./settings-toml-expected.toml} ''; }; } diff --git a/tests/modules/programs/alacritty/toml_config.nix b/tests/modules/programs/alacritty/toml_config.nix index 02d5aabfe483..7094f9a9ddbc 100644 --- a/tests/modules/programs/alacritty/toml_config.nix +++ b/tests/modules/programs/alacritty/toml_config.nix @@ -4,7 +4,7 @@ config = { programs.alacritty = { enable = true; - package = config.lib.test.mkStubPackage { version = "0.13.0"; }; + package = config.lib.test.mkStubPackage { }; settings = { window.dimensions = { From 31c77dcc2e4b6b9f73df0e7eaa89536f175954e8 Mon Sep 17 00:00:00 2001 From: Ivan Leshchenko Date: Fri, 19 Apr 2024 11:15:54 -0400 Subject: [PATCH 201/636] sway: systemd customization --- .../services/window-managers/i3-sway/sway.nix | 39 ++++++- .../services/window-managers/sway/default.nix | 1 + .../sway/sway-systemd-variables.conf | 108 ++++++++++++++++++ .../sway/sway-systemd-variables.nix | 20 ++++ 4 files changed, 166 insertions(+), 2 deletions(-) create mode 100644 tests/modules/services/window-managers/sway/sway-systemd-variables.conf create mode 100644 tests/modules/services/window-managers/sway/sway-systemd-variables.nix diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index 88048daf4804..646af20b8b77 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -256,6 +256,11 @@ let outputStr = moduleStr "output"; seatStr = moduleStr "seat"; + variables = concatStringsSep " " cfg.systemd.variables; + extraCommands = concatStringsSep " && " cfg.systemd.extraCommands; + systemdActivation = '' + exec "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables}; ${extraCommands}"''; + configFile = pkgs.writeText "sway.conf" (concatStringsSep "\n" ((optional (cfg.extraConfigEarly != "") cfg.extraConfigEarly) ++ (if cfg.config != null then @@ -310,8 +315,7 @@ let ++ map workspaceOutputStr workspaceOutputAssign # custom mapping ) else - [ ]) ++ (optional cfg.systemd.enable '' - exec "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target"'') + [ ]) ++ (optional cfg.systemd.enable systemdActivation) ++ (optional (!cfg.xwayland) "xwayland disable") ++ [ cfg.extraConfig ])); defaultSwayPackage = pkgs.sway.override { @@ -366,6 +370,37 @@ in { * {env}`WAYLAND_DISPLAY` * {env}`SWAYSOCK` * {env}`XDG_CURRENT_DESKTOP` + * {env}`XDG_SESSION_TYPE` + * {env}`NIXOS_OZONE_WL` + * {env}`XCURSOR_THEME` + * {env}`XCURSOR_SIZE` + You can extend this list using the `systemd.variables` option. + ''; + }; + + variables = mkOption { + type = types.listOf types.str; + default = [ + "DISPLAY" + "WAYLAND_DISPLAY" + "SWAYSOCK" + "XDG_CURRENT_DESKTOP" + "XDG_SESSION_TYPE" + "NIXOS_OZONE_WL" + "XCURSOR_THEME" + "XCURSOR_SIZE" + ]; + example = [ "-all" ]; + description = '' + Environment variables imported into the systemd and D-Bus user environment. + ''; + }; + + extraCommands = mkOption { + type = types.listOf types.str; + default = [ "systemctl --user start sway-session.target" ]; + description = '' + Extra commands to run after D-Bus activation. ''; }; diff --git a/tests/modules/services/window-managers/sway/default.nix b/tests/modules/services/window-managers/sway/default.nix index 2c7f5ff76321..e3ce4a9c487f 100644 --- a/tests/modules/services/window-managers/sway/default.nix +++ b/tests/modules/services/window-managers/sway/default.nix @@ -11,6 +11,7 @@ sway-null-package = ./sway-null-package.nix; sway-post-2003 = ./sway-post-2003.nix; sway-systemd-autostart = ./sway-systemd-autostart.nix; + sway-systemd-variables = ./sway-systemd-variables.nix; sway-workspace-default = ./sway-workspace-default.nix; sway-workspace-output = ./sway-workspace-output.nix; swaynag-example-settings = ./swaynag-example-settings.nix; diff --git a/tests/modules/services/window-managers/sway/sway-systemd-variables.conf b/tests/modules/services/window-managers/sway/sway-systemd-variables.conf new file mode 100644 index 000000000000..1cbb92c32314 --- /dev/null +++ b/tests/modules/services/window-managers/sway/sway-systemd-variables.conf @@ -0,0 +1,108 @@ +font pango:monospace 8.000000 +floating_modifier Mod1 +default_border pixel 2 +default_floating_border pixel 2 +hide_edge_borders none +focus_wrapping no +focus_follows_mouse yes +focus_on_window_activation smart +mouse_warping output +workspace_layout default +workspace_auto_back_and_forth no +client.focused #4c7899 #285577 #ffffff #2e9ef4 #285577 +client.focused_inactive #333333 #5f676a #ffffff #484e50 #5f676a +client.unfocused #333333 #222222 #888888 #292d2e #222222 +client.urgent #2f343a #900000 #ffffff #900000 #900000 +client.placeholder #000000 #0c0c0c #ffffff #000000 #0c0c0c +client.background #ffffff + +bindsym Mod1+0 workspace number 10 +bindsym Mod1+1 workspace number 1 +bindsym Mod1+2 workspace number 2 +bindsym Mod1+3 workspace number 3 +bindsym Mod1+4 workspace number 4 +bindsym Mod1+5 workspace number 5 +bindsym Mod1+6 workspace number 6 +bindsym Mod1+7 workspace number 7 +bindsym Mod1+8 workspace number 8 +bindsym Mod1+9 workspace number 9 +bindsym Mod1+Down focus down +bindsym Mod1+Left focus left +bindsym Mod1+Return exec @foot@/bin/foot +bindsym Mod1+Right focus right +bindsym Mod1+Shift+0 move container to workspace number 10 +bindsym Mod1+Shift+1 move container to workspace number 1 +bindsym Mod1+Shift+2 move container to workspace number 2 +bindsym Mod1+Shift+3 move container to workspace number 3 +bindsym Mod1+Shift+4 move container to workspace number 4 +bindsym Mod1+Shift+5 move container to workspace number 5 +bindsym Mod1+Shift+6 move container to workspace number 6 +bindsym Mod1+Shift+7 move container to workspace number 7 +bindsym Mod1+Shift+8 move container to workspace number 8 +bindsym Mod1+Shift+9 move container to workspace number 9 +bindsym Mod1+Shift+Down move down +bindsym Mod1+Shift+Left move left +bindsym Mod1+Shift+Right move right +bindsym Mod1+Shift+Up move up +bindsym Mod1+Shift+c reload +bindsym Mod1+Shift+e exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit' +bindsym Mod1+Shift+h move left +bindsym Mod1+Shift+j move down +bindsym Mod1+Shift+k move up +bindsym Mod1+Shift+l move right +bindsym Mod1+Shift+minus move scratchpad +bindsym Mod1+Shift+q kill +bindsym Mod1+Shift+space floating toggle +bindsym Mod1+Up focus up +bindsym Mod1+a focus parent +bindsym Mod1+b splith +bindsym Mod1+d exec @dmenu@/bin/dmenu_run +bindsym Mod1+e layout toggle split +bindsym Mod1+f fullscreen toggle +bindsym Mod1+h focus left +bindsym Mod1+j focus down +bindsym Mod1+k focus up +bindsym Mod1+l focus right +bindsym Mod1+minus scratchpad show +bindsym Mod1+r mode resize +bindsym Mod1+s layout stacking +bindsym Mod1+space focus mode_toggle +bindsym Mod1+v splitv +bindsym Mod1+w layout tabbed + +mode "resize" { + bindsym Down resize grow height 10 px + bindsym Escape mode default + bindsym Left resize shrink width 10 px + bindsym Return mode default + bindsym Right resize grow width 10 px + bindsym Up resize shrink height 10 px + bindsym h resize shrink width 10 px + bindsym j resize grow height 10 px + bindsym k resize shrink height 10 px + bindsym l resize grow width 10 px +} + +bar { + font pango:monospace 8.000000 + mode dock + hidden_state hide + position bottom + status_command @i3status@/bin/i3status + swaybar_command @sway@/bin/swaybar + workspace_buttons yes + strip_workspace_numbers no + tray_output * + colors { + background #000000 + statusline #ffffff + separator #666666 + focused_workspace #4c7899 #285577 #ffffff + active_workspace #333333 #5f676a #ffffff + inactive_workspace #333333 #222222 #888888 + urgent_workspace #2f343a #900000 #ffffff + binding_mode #2f343a #900000 #ffffff + } +} + +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-systemd-variables.nix b/tests/modules/services/window-managers/sway/sway-systemd-variables.nix new file mode 100644 index 000000000000..aae02fef36bc --- /dev/null +++ b/tests/modules/services/window-managers/sway/sway-systemd-variables.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ ./sway-stubs.nix ]; + + wayland.windowManager.sway = { + enable = true; + package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + # overriding findutils causes issues + config.menu = "${pkgs.dmenu}/bin/dmenu_run"; + + systemd.variables = [ "XCURSOR_THEME" "XCURSOR_SIZE" ]; + }; + + nmt.script = '' + assertFileExists home-files/.config/sway/config + assertFileContent $(normalizeStorePaths home-files/.config/sway/config) \ + ${./sway-systemd-variables.conf} + ''; +} From 1f305c363ecd7c6505f03fc7baba15505f3aa630 Mon Sep 17 00:00:00 2001 From: Cynthia Fox Date: Fri, 19 Apr 2024 11:16:42 -0400 Subject: [PATCH 202/636] remmina: add module Adds a module to enable managing Remmina, an RDP client, with a Home Manager module, providing a systemd service and mimetype integration that can be disabled if so desired. --- modules/misc/news.nix | 8 ++ modules/modules.nix | 1 + modules/services/remmina.nix | 74 +++++++++++++++++++ tests/default.nix | 1 + .../modules/services/remmina/basic-config.nix | 26 +++++++ .../services/remmina/default-config.nix | 20 +++++ tests/modules/services/remmina/default.nix | 4 + 7 files changed, 134 insertions(+) create mode 100644 modules/services/remmina.nix create mode 100644 tests/modules/services/remmina/basic-config.nix create mode 100644 tests/modules/services/remmina/default-config.nix create mode 100644 tests/modules/services/remmina/default.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index ef5378af1715..8d7e17a5a82e 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1498,6 +1498,14 @@ in { A new module is available: 'programs.spotify-player'. ''; } + + { + time = "2024-04-19T14:53:17+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.remmina'. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 512841029868..96b2bec565b2 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -340,6 +340,7 @@ let ./services/recoll.nix ./services/redshift-gammastep/gammastep.nix ./services/redshift-gammastep/redshift.nix + ./services/remmina.nix ./services/rsibreak.nix ./services/safeeyes.nix ./services/screen-locker.nix diff --git a/modules/services/remmina.nix b/modules/services/remmina.nix new file mode 100644 index 000000000000..dac0471dbfc6 --- /dev/null +++ b/modules/services/remmina.nix @@ -0,0 +1,74 @@ +{ config, lib, pkgs, ... }: + +let + + inherit (lib) mkIf mkMerge mkEnableOption mkPackageOption mkOption; + + cfg = config.services.remmina; + +in { + meta.maintainers = with lib.maintainers; [ cyntheticfox ]; + + options.services.remmina = { + enable = mkEnableOption "Remmina"; + + package = mkPackageOption pkgs "remmina" { }; + + addRdpMimeTypeAssoc = mkEnableOption "Remmina RDP file open option" // { + default = true; + }; + + systemdService = { + enable = mkEnableOption "systemd Remmina service" // { default = true; }; + + startupFlags = mkOption { + type = with lib.types; listOf str; + default = [ "--icon" ]; + description = '' + Startup flags documented in the manpage to run at service startup. + ''; + }; + }; + }; + + config = mkIf cfg.enable (mkMerge [ + { home.packages = [ cfg.package ]; } + + (mkIf cfg.systemdService.enable { + systemd.user.services.remmina = { + Unit = { + Description = "Remmina remote desktop client"; + Documentation = "man:remmina(1)"; + Requires = [ "graphical-session-pre.target" ]; + }; + + Service = { + Type = "simple"; + ExecStart = "${lib.getExe cfg.package} ${ + lib.escapeShellArgs cfg.systemdService.startupFlags + }"; + Restart = "on-failure"; + }; + + Install.WantedBy = [ "graphical-session.target" ]; + }; + }) + + (mkIf (config.xdg.mimeApps.enable && cfg.addRdpMimeTypeAssoc) { + xdg.mimeApps.associations.added."application/x-rdp" = + "org.remmina.Remmina.desktop"; + + xdg.dataFile."mime/packages/application-x-rdp.xml".text = '' + + + + rdp file + + + + + + ''; + }) + ]); +} diff --git a/tests/default.nix b/tests/default.nix index c4d98ef2ec0b..3729ce98c1f7 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -255,6 +255,7 @@ in import nmtSrc { ./modules/services/polybar ./modules/services/recoll ./modules/services/redshift-gammastep + ./modules/services/remmina ./modules/services/screen-locker ./modules/services/signaturepdf ./modules/services/swayidle diff --git a/tests/modules/services/remmina/basic-config.nix b/tests/modules/services/remmina/basic-config.nix new file mode 100644 index 000000000000..2741353aee45 --- /dev/null +++ b/tests/modules/services/remmina/basic-config.nix @@ -0,0 +1,26 @@ +{ config, ... }: { + xdg.mimeApps.enable = true; + + services.remmina = { + enable = true; + package = config.lib.test.mkStubPackage { }; + + addRdpMimeTypeAssoc = false; + systemdService = { + enable = true; + startupFlags = [ "--icon" "--enable-extra-hardening" ]; + }; + }; + + nmt.script = '' + serviceFile='./home-files/.config/systemd/user/remmina.service' + + assertFileExists $serviceFile + assertFileRegex $serviceFile 'ExecStart=.*/bin/dummy' + assertFileRegex $serviceFile "dummy '--icon' '--enable-extra-hardening'" + + mimetypeFile='./home-files/.local/share/mime/packages/application-x-rdp.xml' + + assertPathNotExists $mimetypeFile + ''; +} diff --git a/tests/modules/services/remmina/default-config.nix b/tests/modules/services/remmina/default-config.nix new file mode 100644 index 000000000000..747623aff3b6 --- /dev/null +++ b/tests/modules/services/remmina/default-config.nix @@ -0,0 +1,20 @@ +{ config, ... }: { + xdg.mimeApps.enable = true; + + services.remmina = { + enable = true; + package = config.lib.test.mkStubPackage { }; + }; + + nmt.script = '' + serviceFile='./home-files/.config/systemd/user/remmina.service' + + assertFileExists $serviceFile + assertFileRegex $serviceFile 'ExecStart=.*--icon' + + mimetypeFile='./home-files/.local/share/mime/packages/application-x-rdp.xml' + + assertFileExists $mimetypeFile + assertFileRegex $mimetypeFile '' + ''; +} diff --git a/tests/modules/services/remmina/default.nix b/tests/modules/services/remmina/default.nix new file mode 100644 index 000000000000..43fa48940aed --- /dev/null +++ b/tests/modules/services/remmina/default.nix @@ -0,0 +1,4 @@ +{ + remmina-default-config = ./default-config.nix; + remmina-basic-config = ./basic-config.nix; +} From 6a171bfd84ee9b3df83f6eb76dab042219978439 Mon Sep 17 00:00:00 2001 From: Pasquale Date: Wed, 15 Dec 2021 18:31:13 +0100 Subject: [PATCH 203/636] kconfig: add module --- modules/misc/qt/kconfig.nix | 73 +++++++++++++++++++++++++++++++++++++ modules/modules.nix | 1 + 2 files changed, 74 insertions(+) create mode 100644 modules/misc/qt/kconfig.nix diff --git a/modules/misc/qt/kconfig.nix b/modules/misc/qt/kconfig.nix new file mode 100644 index 000000000000..22139f5cf967 --- /dev/null +++ b/modules/misc/qt/kconfig.nix @@ -0,0 +1,73 @@ +{ config, pkgs, lib, ... }: + +let + + cfg = config.qt.kde.settings; +in { + options.qt.kde.settings = lib.mkOption { + type = with lib.types; + let + valueType = + nullOr (oneOf [ bool int float str path (attrsOf valueType) ]) // { + description = "KDE option value"; + }; + in attrsOf valueType; + default = { }; + example = { + powermanagementprofilesrc.AC.HandleButtonEvents.lidAction = 32; + }; + description = '' + A set of values to be modified by {command}`kwriteconfig5`. + + The example value would cause the following command to run in the + activation script: + + ``` shell + kwriteconfig5 --file $XDG_CONFIG_HOME/powermanagementprofilesrc \ + --group AC \ + --group HandleButtonEvents \ + --group lidAction \ + --key lidAction \ + 32 + ``` + + Note, `null` values will delete the corresponding entry instead of + inserting any value. + ''; + }; + + config = lib.mkIf (cfg != { }) { + home.activation.kconfig = lib.hm.dag.entryAfter [ "writeBoundary" ] '' + ${let + inherit (config.xdg) configHome; + toValue = v: + let t = builtins.typeOf v; + in if v == null then + "--delete" + else if t == "bool" then + "--type bool ${builtins.toJSON v}" + else + toString v; + toLine = file: path: value: + if builtins.isAttrs value then + lib.mapAttrsToList + (group: value: toLine file (path ++ [ group ]) value) value + else + "run test -f '${configHome}/${file}' && run ${pkgs.libsForQt5.kconfig}/bin/kwriteconfig5 --file '${configHome}/${file}' ${ + lib.concatMapStringsSep " " (x: "--group ${x}") + (lib.lists.init path) + } --key '${lib.lists.last path}' ${toValue value}"; + lines = lib.flatten + (lib.mapAttrsToList (file: attrs: toLine file [ ] attrs) cfg); + in builtins.concatStringsSep "\n" lines} + + # TODO: some way to only call the dbus calls needed + run ${pkgs.libsForQt5.qttools.bin}/bin/qdbus org.kde.KWin /KWin reconfigure || echo "KWin reconfigure failed" + # the actual values are https://github.com/KDE/plasma-workspace/blob/c97dddf20df5702eb429b37a8c10b2c2d8199d4e/kcms/kcms-common_p.h#L13 + for changeType in {0..10}; do + # even if one of those calls fails the others keep running + run ${pkgs.dbus}/bin/dbus-send /KGlobalSettings org.kde.KGlobalSettings.notifyChange int32:$changeType int32:0 || echo "KGlobalSettings.notifyChange $changeType failed" + done + ''; + }; +} diff --git a/modules/modules.nix b/modules/modules.nix index 96b2bec565b2..154f2bd9c73b 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -34,6 +34,7 @@ let ./misc/numlock.nix ./misc/pam.nix ./misc/qt.nix + ./misc/qt/kconfig.nix ./misc/specialisation.nix ./misc/submodule-support.nix ./misc/tmpfiles.nix From 938357cb234e85da37109df2cdd9cc59ab9c1cc0 Mon Sep 17 00:00:00 2001 From: Masum Reza <50095635+JohnRTitor@users.noreply.github.com> Date: Fri, 19 Apr 2024 22:55:59 +0530 Subject: [PATCH 204/636] hyprland: remove enableNvidiaPatches option Hyprland no longer requires patching to work on Nvidia. --- modules/services/window-managers/hyprland.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index cf1631080e88..4401998f680e 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -28,9 +28,12 @@ in { [ "wayland" "windowManager" "hyprland" "xwayland" "hidpi" ] "HiDPI patches are deprecated. Refer to https://wiki.hyprland.org/Configuring/XWayland") - (lib.mkRenamedOptionModule # \ + (lib.mkRemovedOptionModule # \ [ "wayland" "windowManager" "hyprland" "nvidiaPatches" ] # \ - [ "wayland" "windowManager" "hyprland" "enableNvidiaPatches" ]) + "Nvidia patches are no longer needed") + (lib.mkRemovedOptionModule # \ + [ "wayland" "windowManager" "hyprland" "enableNvidiaPatches" ] # \ + "Nvidia patches are no longer needed") (lib.mkRenamedOptionModule # \ [ "wayland" "windowManager" "hyprland" "systemdIntegration" ] # \ @@ -45,10 +48,7 @@ in { finalPackage = lib.mkOption { type = lib.types.package; readOnly = true; - default = cfg.package.override { - enableXWayland = cfg.xwayland.enable; - enableNvidiaPatches = cfg.enableNvidiaPatches; - }; + default = cfg.package.override { enableXWayland = cfg.xwayland.enable; }; defaultText = lib.literalMD "`wayland.windowManager.hyprland.package` with applied configuration"; description = '' @@ -107,9 +107,6 @@ in { xwayland.enable = lib.mkEnableOption "XWayland" // { default = true; }; - enableNvidiaPatches = - lib.mkEnableOption "patching wlroots for better Nvidia support"; - settings = lib.mkOption { type = with lib.types; let From 5682ccdcaf72aef74be97e4b683545a9de27c386 Mon Sep 17 00:00:00 2001 From: gallegonovato Date: Fri, 19 Apr 2024 19:07:29 +0200 Subject: [PATCH 205/636] Translate using Weblate (Spanish) Currently translated at 100.0% (37 of 37 strings) Co-authored-by: gallegonovato Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/es/ Translation: Home Manager/Home Manager CLI --- home-manager/po/es.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home-manager/po/es.po b/home-manager/po/es.po index 9da9fa8f75bd..cafc9a0a608b 100644 --- a/home-manager/po/es.po +++ b/home-manager/po/es.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-02-21 12:02+0000\n" +"PO-Revision-Date: 2024-04-19 17:07+0000\n" "Last-Translator: gallegonovato \n" "Language-Team: Spanish \n" @@ -22,7 +22,7 @@ msgstr "" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: falta argumento para %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" From 991f6fafce729e6d7d64107a66e445114194b778 Mon Sep 17 00:00:00 2001 From: Felipe Silva Date: Fri, 19 Apr 2024 19:07:29 +0200 Subject: [PATCH 206/636] Translate using Weblate (Portuguese) Currently translated at 100.0% (37 of 37 strings) Translate using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (18 of 18 strings) Translate using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (37 of 37 strings) Co-authored-by: Felipe Silva Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/pt/ Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/pt_BR/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/pt_BR/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules --- home-manager/po/pt.po | 10 +++++----- home-manager/po/pt_BR.po | 12 ++++++------ modules/po/pt_BR.po | 16 ++++++++-------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/home-manager/po/pt.po b/home-manager/po/pt.po index 30a16bdeca6b..a5de344bd92e 100644 --- a/home-manager/po/pt.po +++ b/home-manager/po/pt.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-04-19 17:07+0000\n" +"Last-Translator: Felipe Silva \n" "Language-Team: Portuguese \n" "Language: pt\n" @@ -17,12 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: faltando argumento para %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" @@ -190,7 +190,7 @@ msgstr "Valor \"%s\" para configuração \"news.display\" não reconhecido." #: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Por favor, defina a variável de ambiente $EDITOR ou $VISUAL" #: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" diff --git a/home-manager/po/pt_BR.po b/home-manager/po/pt_BR.po index 44aba5636014..a3075d41e4d5 100644 --- a/home-manager/po/pt_BR.po +++ b/home-manager/po/pt_BR.po @@ -8,10 +8,10 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-02-28 13:02+0000\n" -"Last-Translator: guto \n" -"Language-Team: Portuguese (Brazil) \n" +"PO-Revision-Date: 2024-04-19 17:07+0000\n" +"Last-Translator: Felipe Silva \n" +"Language-Team: Portuguese (Brazil) \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -22,7 +22,7 @@ msgstr "" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: faltando argumento para %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" @@ -104,7 +104,7 @@ msgstr "Revalidando Nix" #: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" -"Não foi possível encontrar um diretório de perfil apropriado, tentei %s e %s" +"Não foi possível encontrar um diretório de perfil apropriado, tentou %s e %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:221 diff --git a/modules/po/pt_BR.po b/modules/po/pt_BR.po index a8f2b4843519..83d01927c0c1 100644 --- a/modules/po/pt_BR.po +++ b/modules/po/pt_BR.po @@ -8,16 +8,16 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2023-11-30 15:04+0000\n" -"Last-Translator: Gabriel Fontes \n" -"Language-Team: Portuguese (Brazil) \n" +"PO-Revision-Date: 2024-04-19 17:07+0000\n" +"Last-Translator: Felipe Silva \n" +"Language-Team: Portuguese (Brazil) \n" "Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.3-dev\n" +"X-Generator: Weblate 5.5-dev\n" #: modules/files.nix:191 msgid "Creating home file links in %s" @@ -25,11 +25,11 @@ msgstr "Criando links simbólicos em %s" #: modules/files.nix:204 msgid "Cleaning up orphan links from %s" -msgstr "Limpando links órfãos do directório %s" +msgstr "Limpando links órfãos de %s" #: modules/files.nix:220 msgid "Creating profile generation %s" -msgstr "Criando geração %s para o perfil" +msgstr "Criando perfil de geração %s" #: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" @@ -74,7 +74,7 @@ msgstr "Migrando perfil de %s para %s" #: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" -"Não foi possível encontrar um diretório de perfil apropriado, tentei %s e %s" +"Não foi possível encontrar um diretório de perfil apropriado, tentou %s e %s" #: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" From 7c61e400a99f33cdff3118c1e4032bcb049e1a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?O=C4=9Fuz=20Ersen?= Date: Fri, 19 Apr 2024 19:07:29 +0200 Subject: [PATCH 207/636] Translate using Weblate (Turkish) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 100.0% (37 of 37 strings) Co-authored-by: Oğuz Ersen Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/tr/ Translation: Home Manager/Home Manager CLI --- home-manager/po/tr.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home-manager/po/tr.po b/home-manager/po/tr.po index e382f3b5d864..66c89e608f9a 100644 --- a/home-manager/po/tr.po +++ b/home-manager/po/tr.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" +"PO-Revision-Date: 2024-04-19 17:07+0000\n" "Last-Translator: Oğuz Ersen \n" "Language-Team: Turkish \n" @@ -17,12 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: %s için argüman eksik" #: home-manager/home-manager:64 msgid "No configuration file found at %s" From 95888b153c24c36971c4b4b66beecf32593064fb Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Thu, 9 Nov 2023 13:14:12 -0500 Subject: [PATCH 208/636] sway: writeText -> writeTextFile The latter is more flexible and shall be used soon, splitting this change out for simpler diff later. --- .../services/window-managers/i3-sway/sway.nix | 116 +++++++++--------- 1 file changed, 60 insertions(+), 56 deletions(-) diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index 646af20b8b77..ea63e78cf148 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -261,62 +261,66 @@ let systemdActivation = '' exec "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables}; ${extraCommands}"''; - configFile = pkgs.writeText "sway.conf" (concatStringsSep "\n" - ((optional (cfg.extraConfigEarly != "") cfg.extraConfigEarly) - ++ (if cfg.config != null then - with cfg.config; - ([ - (fontConfigStr fonts) - "floating_modifier ${floating.modifier}" - (windowBorderString window floating) - "hide_edge_borders ${window.hideEdgeBorders}" - "focus_wrapping ${focus.wrapping}" - "focus_follows_mouse ${focus.followMouse}" - "focus_on_window_activation ${focus.newWindow}" - "mouse_warping ${ - if builtins.isString (focus.mouseWarping) then - focus.mouseWarping - else if focus.mouseWarping then - "output" - else - "none" - }" - "workspace_layout ${workspaceLayout}" - "workspace_auto_back_and_forth ${ - lib.hm.booleans.yesNo workspaceAutoBackAndForth - }" - "client.focused ${colorSetStr colors.focused}" - "client.focused_inactive ${colorSetStr colors.focusedInactive}" - "client.unfocused ${colorSetStr colors.unfocused}" - "client.urgent ${colorSetStr colors.urgent}" - "client.placeholder ${colorSetStr colors.placeholder}" - "client.background ${colors.background}" - (keybindingsStr { - keybindings = keybindingDefaultWorkspace; - bindsymArgs = - lib.optionalString (cfg.config.bindkeysToCode) "--to-code"; - }) - (keybindingsStr { - keybindings = keybindingsRest; - bindsymArgs = - lib.optionalString (cfg.config.bindkeysToCode) "--to-code"; - }) - (keycodebindingsStr keycodebindings) - ] ++ mapAttrsToList inputStr input - ++ mapAttrsToList outputStr output # outputs - ++ mapAttrsToList seatStr seat # seats - ++ mapAttrsToList (modeStr cfg.config.bindkeysToCode) modes # modes - ++ mapAttrsToList assignStr assigns # assigns - ++ map barStr bars # bars - ++ optional (gaps != null) gapsStr # gaps - ++ map floatingCriteriaStr floating.criteria # floating - ++ map windowCommandsStr window.commands # window commands - ++ map startupEntryStr startup # startup - ++ map workspaceOutputStr workspaceOutputAssign # custom mapping - ) - else - [ ]) ++ (optional cfg.systemd.enable systemdActivation) - ++ (optional (!cfg.xwayland) "xwayland disable") ++ [ cfg.extraConfig ])); + configFile = pkgs.writeTextFile { + name = "sway.conf"; + text = (concatStringsSep "\n" + ((optional (cfg.extraConfigEarly != "") cfg.extraConfigEarly) + ++ (if cfg.config != null then + with cfg.config; + ([ + (fontConfigStr fonts) + "floating_modifier ${floating.modifier}" + (windowBorderString window floating) + "hide_edge_borders ${window.hideEdgeBorders}" + "focus_wrapping ${focus.wrapping}" + "focus_follows_mouse ${focus.followMouse}" + "focus_on_window_activation ${focus.newWindow}" + "mouse_warping ${ + if builtins.isString (focus.mouseWarping) then + focus.mouseWarping + else if focus.mouseWarping then + "output" + else + "none" + }" + "workspace_layout ${workspaceLayout}" + "workspace_auto_back_and_forth ${ + lib.hm.booleans.yesNo workspaceAutoBackAndForth + }" + "client.focused ${colorSetStr colors.focused}" + "client.focused_inactive ${colorSetStr colors.focusedInactive}" + "client.unfocused ${colorSetStr colors.unfocused}" + "client.urgent ${colorSetStr colors.urgent}" + "client.placeholder ${colorSetStr colors.placeholder}" + "client.background ${colors.background}" + (keybindingsStr { + keybindings = keybindingDefaultWorkspace; + bindsymArgs = + lib.optionalString (cfg.config.bindkeysToCode) "--to-code"; + }) + (keybindingsStr { + keybindings = keybindingsRest; + bindsymArgs = + lib.optionalString (cfg.config.bindkeysToCode) "--to-code"; + }) + (keycodebindingsStr keycodebindings) + ] ++ mapAttrsToList inputStr input + ++ mapAttrsToList outputStr output # outputs + ++ mapAttrsToList seatStr seat # seats + ++ mapAttrsToList (modeStr cfg.config.bindkeysToCode) modes # modes + ++ mapAttrsToList assignStr assigns # assigns + ++ map barStr bars # bars + ++ optional (gaps != null) gapsStr # gaps + ++ map floatingCriteriaStr floating.criteria # floating + ++ map windowCommandsStr window.commands # window commands + ++ map startupEntryStr startup # startup + ++ map workspaceOutputStr workspaceOutputAssign # custom mapping + ) + else + [ ]) ++ (optional cfg.systemd.enable systemdActivation) + ++ (optional (!cfg.xwayland) "xwayland disable") + ++ [ cfg.extraConfig ])); + }; defaultSwayPackage = pkgs.sway.override { extraSessionCommands = cfg.extraSessionCommands; From 3a435342e2e5e2bff1d3331c2bd9e70f25693ea2 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Thu, 9 Nov 2023 13:19:45 -0500 Subject: [PATCH 209/636] sway: check config file validity Helps avoid successful build but Sway failing to start. To meaningfully test this, I had to actually use `pkgs.sway` in the test rather than the stub, but left all other tests using the stub and changed them to skipping the test. We need to pass `--unsupported-gpu` as Sway checks for `nvidia` in `/proc/modules`, and the Nix sandbox has `/proc/modules` available. --- .../services/window-managers/i3-sway/sway.nix | 24 +++++++++++++++---- .../services/window-managers/sway/default.nix | 1 + .../sway/sway-bar-focused-colors.nix | 1 + ...sway-bindkeys-to-code-and-extra-config.nix | 1 + .../sway/sway-check-config.nix | 12 ++++++++++ .../window-managers/sway/sway-default.nix | 1 + .../sway/sway-followmouse-legacy.nix | 1 + .../window-managers/sway/sway-followmouse.nix | 1 + .../window-managers/sway/sway-modules.nix | 1 + .../window-managers/sway/sway-no-xwayland.nix | 1 + .../window-managers/sway/sway-null-config.nix | 1 + .../sway/sway-null-package.nix | 1 + .../window-managers/sway/sway-post-2003.nix | 1 + .../sway/sway-systemd-autostart.nix | 1 + .../sway/sway-systemd-variables.nix | 1 + .../sway/sway-workspace-default.nix | 1 + .../sway/sway-workspace-output.nix | 1 + 17 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 tests/modules/services/window-managers/sway/sway-check-config.nix diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index ea63e78cf148..bc20e9d9bd5a 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -258,12 +258,21 @@ let variables = concatStringsSep " " cfg.systemd.variables; extraCommands = concatStringsSep " && " cfg.systemd.extraCommands; + swayPackage = if cfg.package == null then pkgs.sway else cfg.package; systemdActivation = '' exec "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables}; ${extraCommands}"''; configFile = pkgs.writeTextFile { name = "sway.conf"; - text = (concatStringsSep "\n" + + # Sway always does some init, see https://github.com/swaywm/sway/issues/4691 + checkPhase = lib.optionalString cfg.checkConfig '' + export DBUS_SESSION_BUS_ADDRESS=/dev/null + export XDG_RUNTIME_DIR=$(mktemp -d) + ${pkgs.xvfb-run}/bin/xvfb-run ${swayPackage}/bin/sway --config "$target" --validate --unsupported-gpu + ''; + + text = concatStringsSep "\n" ((optional (cfg.extraConfigEarly != "") cfg.extraConfigEarly) ++ (if cfg.config != null then with cfg.config; @@ -319,7 +328,7 @@ let else [ ]) ++ (optional cfg.systemd.enable systemdActivation) ++ (optional (!cfg.xwayland) "xwayland disable") - ++ [ cfg.extraConfig ])); + ++ [ cfg.extraConfig ]); }; defaultSwayPackage = pkgs.sway.override { @@ -469,6 +478,13 @@ in { description = "Sway configuration options."; }; + checkConfig = mkOption { + type = types.bool; + default = true; + description = + "If enabled (the default), validates the generated config file."; + }; + extraConfig = mkOption { type = types.lines; default = ""; @@ -506,9 +522,7 @@ in { home.packages = optional (cfg.package != null) cfg.package ++ optional cfg.xwayland pkgs.xwayland; - xdg.configFile."sway/config" = let - swayPackage = if cfg.package == null then pkgs.sway else cfg.package; - in { + xdg.configFile."sway/config" = { source = configFile; onChange = '' swaySocket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/sway-ipc.$UID.$(${pkgs.procps}/bin/pgrep --uid $UID -x sway || true).sock" diff --git a/tests/modules/services/window-managers/sway/default.nix b/tests/modules/services/window-managers/sway/default.nix index e3ce4a9c487f..7627aab043c1 100644 --- a/tests/modules/services/window-managers/sway/default.nix +++ b/tests/modules/services/window-managers/sway/default.nix @@ -5,6 +5,7 @@ sway-default = ./sway-default.nix; sway-followmouse = ./sway-followmouse.nix; sway-followmouse-legacy = ./sway-followmouse-legacy.nix; + sway-check-config = ./sway-check-config.nix; sway-modules = ./sway-modules.nix; sway-no-xwayland = ./sway-no-xwayland.nix; sway-null-config = ./sway-null-config.nix; diff --git a/tests/modules/services/window-managers/sway/sway-bar-focused-colors.nix b/tests/modules/services/window-managers/sway/sway-bar-focused-colors.nix index 399790fbed87..9488d00f6ea3 100644 --- a/tests/modules/services/window-managers/sway/sway-bar-focused-colors.nix +++ b/tests/modules/services/window-managers/sway/sway-bar-focused-colors.nix @@ -6,6 +6,7 @@ wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; # overriding findutils causes issues config.menu = "${pkgs.dmenu}/bin/dmenu_run"; diff --git a/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.nix b/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.nix index 0817837acc60..cf316988bed3 100644 --- a/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.nix +++ b/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.nix @@ -6,6 +6,7 @@ wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; # overriding findutils causes issues config.menu = "${pkgs.dmenu}/bin/dmenu_run"; config.bindkeysToCode = true; diff --git a/tests/modules/services/window-managers/sway/sway-check-config.nix b/tests/modules/services/window-managers/sway/sway-check-config.nix new file mode 100644 index 000000000000..e566e4fdab41 --- /dev/null +++ b/tests/modules/services/window-managers/sway/sway-check-config.nix @@ -0,0 +1,12 @@ +{ config, lib, ... }: + +lib.mkIf config.test.enableBig { + wayland.windowManager.sway = { + enable = true; + checkConfig = true; + }; + + nmt.script = '' + assertFileExists home-files/.config/sway/config + ''; +} diff --git a/tests/modules/services/window-managers/sway/sway-default.nix b/tests/modules/services/window-managers/sway/sway-default.nix index 59527247b4b4..c62effbe804e 100644 --- a/tests/modules/services/window-managers/sway/sway-default.nix +++ b/tests/modules/services/window-managers/sway/sway-default.nix @@ -6,6 +6,7 @@ wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; # overriding findutils causes issues config.menu = "${pkgs.dmenu}/bin/dmenu_run"; }; diff --git a/tests/modules/services/window-managers/sway/sway-followmouse-legacy.nix b/tests/modules/services/window-managers/sway/sway-followmouse-legacy.nix index 03f64fc24d7c..3bce48507a1d 100644 --- a/tests/modules/services/window-managers/sway/sway-followmouse-legacy.nix +++ b/tests/modules/services/window-managers/sway/sway-followmouse-legacy.nix @@ -6,6 +6,7 @@ wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; config = { focus.followMouse = false; diff --git a/tests/modules/services/window-managers/sway/sway-followmouse.nix b/tests/modules/services/window-managers/sway/sway-followmouse.nix index b8a2bc1693d3..de2e91b39316 100644 --- a/tests/modules/services/window-managers/sway/sway-followmouse.nix +++ b/tests/modules/services/window-managers/sway/sway-followmouse.nix @@ -6,6 +6,7 @@ wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; config = { focus.followMouse = "always"; diff --git a/tests/modules/services/window-managers/sway/sway-modules.nix b/tests/modules/services/window-managers/sway/sway-modules.nix index b8aa58c56ca7..287dec1765a0 100644 --- a/tests/modules/services/window-managers/sway/sway-modules.nix +++ b/tests/modules/services/window-managers/sway/sway-modules.nix @@ -6,6 +6,7 @@ wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; # overriding findutils causes issues config = { menu = "${pkgs.dmenu}/bin/dmenu_run"; diff --git a/tests/modules/services/window-managers/sway/sway-no-xwayland.nix b/tests/modules/services/window-managers/sway/sway-no-xwayland.nix index b40912671aa7..5eded3b88650 100644 --- a/tests/modules/services/window-managers/sway/sway-no-xwayland.nix +++ b/tests/modules/services/window-managers/sway/sway-no-xwayland.nix @@ -6,6 +6,7 @@ wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; config = null; systemd.enable = false; xwayland = false; diff --git a/tests/modules/services/window-managers/sway/sway-null-config.nix b/tests/modules/services/window-managers/sway/sway-null-config.nix index a859e04e6747..46e4df23e108 100644 --- a/tests/modules/services/window-managers/sway/sway-null-config.nix +++ b/tests/modules/services/window-managers/sway/sway-null-config.nix @@ -6,6 +6,7 @@ wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; config = null; systemd.enable = false; }; diff --git a/tests/modules/services/window-managers/sway/sway-null-package.nix b/tests/modules/services/window-managers/sway/sway-null-package.nix index a449b42c4911..042830d180ff 100644 --- a/tests/modules/services/window-managers/sway/sway-null-package.nix +++ b/tests/modules/services/window-managers/sway/sway-null-package.nix @@ -9,6 +9,7 @@ wayland.windowManager.sway = { enable = true; package = null; + checkConfig = false; config.menu = "${pkgs.dmenu}/bin/dmenu_run"; }; diff --git a/tests/modules/services/window-managers/sway/sway-post-2003.nix b/tests/modules/services/window-managers/sway/sway-post-2003.nix index 13aac533c0e8..3617a3b1cb69 100644 --- a/tests/modules/services/window-managers/sway/sway-post-2003.nix +++ b/tests/modules/services/window-managers/sway/sway-post-2003.nix @@ -8,6 +8,7 @@ wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; # overriding findutils causes issues config.menu = "${pkgs.dmenu}/bin/dmenu_run"; }; diff --git a/tests/modules/services/window-managers/sway/sway-systemd-autostart.nix b/tests/modules/services/window-managers/sway/sway-systemd-autostart.nix index 5a1d90e293ee..5c32c19cdd18 100644 --- a/tests/modules/services/window-managers/sway/sway-systemd-autostart.nix +++ b/tests/modules/services/window-managers/sway/sway-systemd-autostart.nix @@ -6,6 +6,7 @@ wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; # overriding findutils causes issues config.menu = "${pkgs.dmenu}/bin/dmenu_run"; diff --git a/tests/modules/services/window-managers/sway/sway-systemd-variables.nix b/tests/modules/services/window-managers/sway/sway-systemd-variables.nix index aae02fef36bc..f0b42ecc1fe6 100644 --- a/tests/modules/services/window-managers/sway/sway-systemd-variables.nix +++ b/tests/modules/services/window-managers/sway/sway-systemd-variables.nix @@ -6,6 +6,7 @@ wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; # overriding findutils causes issues config.menu = "${pkgs.dmenu}/bin/dmenu_run"; diff --git a/tests/modules/services/window-managers/sway/sway-workspace-default.nix b/tests/modules/services/window-managers/sway/sway-workspace-default.nix index 6af944eb0126..e5637fd943bb 100644 --- a/tests/modules/services/window-managers/sway/sway-workspace-default.nix +++ b/tests/modules/services/window-managers/sway/sway-workspace-default.nix @@ -6,6 +6,7 @@ wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; # overriding findutils causes issues config.menu = "${pkgs.dmenu}/bin/dmenu_run"; config.defaultWorkspace = "workspace number 9"; diff --git a/tests/modules/services/window-managers/sway/sway-workspace-output.nix b/tests/modules/services/window-managers/sway/sway-workspace-output.nix index 47fb7527e202..dcbff91e1bd6 100644 --- a/tests/modules/services/window-managers/sway/sway-workspace-output.nix +++ b/tests/modules/services/window-managers/sway/sway-workspace-output.nix @@ -15,6 +15,7 @@ in { wayland.windowManager.sway = { enable = true; package = config.lib.test.mkStubPackage { outPath = "@sway@"; }; + checkConfig = false; # overriding findutils causes issues config.menu = "${pkgs.dmenu}/bin/dmenu_run"; From a20408227466032a16e73893b09a67092258cf67 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 20 Apr 2024 00:02:59 +0200 Subject: [PATCH 210/636] firefox: fix test --- .../programs/firefox/profile-settings-expected-containers.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/programs/firefox/profile-settings-expected-containers.json b/tests/modules/programs/firefox/profile-settings-expected-containers.json index d1727cc2a8b8..8eea55558ab1 100644 --- a/tests/modules/programs/firefox/profile-settings-expected-containers.json +++ b/tests/modules/programs/firefox/profile-settings-expected-containers.json @@ -1 +1 @@ -{"identities":[{"color":"yellow","icon":"circle","name":"shopping","public":true,"userContextId":6}],"lastUserContextId":6,"version":4} +{"identities":[{"color":"yellow","icon":"circle","name":"shopping","public":true,"userContextId":6},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.thumbnail","public":false,"userContextId":4294967294},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.webextStorageLocal","public":false,"userContextId":4294967295}],"lastUserContextId":6,"version":4} From 057117a401a34259c9615ce62218aea7afdee4d3 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Fri, 19 Apr 2024 18:41:23 -0300 Subject: [PATCH 211/636] kdeconnect: fix "tray.target" requires The PR #5299[0] actually adds the requirement on "tray.target" for the kdeconnect service, when kdeconnect-indicator is set to true. What it should do is add the requirement directly to the latter. This commit fixes it. [0]: https://github.com/nix-community/home-manager/pull/5299#issue-2252834123 --- modules/services/kdeconnect.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/services/kdeconnect.nix b/modules/services/kdeconnect.nix index 65477be1d1d7..91b6657fe003 100644 --- a/modules/services/kdeconnect.nix +++ b/modules/services/kdeconnect.nix @@ -42,7 +42,7 @@ in { "Adds communication between your desktop and your smartphone"; After = [ "graphical-session-pre.target" ]; PartOf = [ "graphical-session.target" ]; - } // lib.optionalAttrs cfg.indicator { Requires = [ "tray.target" ]; }; + }; Install = { WantedBy = [ "graphical-session.target" ]; }; @@ -70,6 +70,7 @@ in { "stalonetray.service" ]; PartOf = [ "graphical-session.target" ]; + Requires = [ "tray.target" ]; }; Install = { WantedBy = [ "graphical-session.target" ]; }; From 4cec20dbf5c0a716115745ae32531e34816ecbbe Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 21 Apr 2024 08:49:42 +0200 Subject: [PATCH 212/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/5672bc9dbf9d88246ddab5ac454e82318d094bb8' (2024-04-16) → 'github:NixOS/nixpkgs/5c24cf2f0a12ad855f444c30b2421d044120c66f' (2024-04-19) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index aeb905865332..549810903f77 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1713248628, - "narHash": "sha256-NLznXB5AOnniUtZsyy/aPWOk8ussTuePp2acb9U+ISA=", + "lastModified": 1713537308, + "narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5672bc9dbf9d88246ddab5ac454e82318d094bb8", + "rev": "5c24cf2f0a12ad855f444c30b2421d044120c66f", "type": "github" }, "original": { From 147b5a5e1c04e1f27e30b6df720966422fb4bc09 Mon Sep 17 00:00:00 2001 From: JulianFP Date: Sat, 20 Apr 2024 15:29:07 +0200 Subject: [PATCH 213/636] qt: fix platform theme package install --- modules/misc/qt.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/misc/qt.nix b/modules/misc/qt.nix index 51fbac46e1b5..beb97434aaa9 100644 --- a/modules/misc/qt.nix +++ b/modules/misc/qt.nix @@ -258,7 +258,7 @@ in { # Apply theming also to apps started by systemd. systemd.user.sessionVariables = envVars // envVarsExtra; - home.packages = (lib.findFirst (x: x != null) [ ] [ + home.packages = (lib.findFirst (x: x != [ ]) [ ] [ (lib.optionals (platformTheme.package != null) (lib.toList platformTheme.package)) (lib.optionals (platformTheme.name != null) From ad83c154bdfedad9807e86dd0633729ea3b116c5 Mon Sep 17 00:00:00 2001 From: JulianFP Date: Sun, 21 Apr 2024 14:07:06 +0200 Subject: [PATCH 214/636] qt: fix `qt.platformTheme = "gtk3"` --- modules/misc/qt.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/misc/qt.nix b/modules/misc/qt.nix index beb97434aaa9..a36bd5673771 100644 --- a/modules/misc/qt.nix +++ b/modules/misc/qt.nix @@ -262,7 +262,7 @@ in { (lib.optionals (platformTheme.package != null) (lib.toList platformTheme.package)) (lib.optionals (platformTheme.name != null) - platformPackages.${platformTheme.name}) + platformPackages.${platformTheme.name} or [ ]) ]) ++ (lib.optionals (cfg.style.package != null) (lib.toList cfg.style.package)); From 2846d5230a3c3923618eabb367deaf8885df580f Mon Sep 17 00:00:00 2001 From: zorrobert <118135271+zorrobert@users.noreply.github.com> Date: Thu, 4 Apr 2024 21:49:02 +0200 Subject: [PATCH 215/636] joplin-desktop: allow undefined options This PR fixes two issues that cause rebuild to fail, see #5222. The first was caused when sync.target and sync.interval were not set, this was fixed by changing the default values from null to "undefined" and filtering these out later. The second error occurred when the .config/joplin-desktop directory didn't exist (e.g. when installing Joplin for the first time) which caused the touch command to fail. This was fixed using mkdir to ensure that .config/joplin-desktop exists. --- modules/programs/joplin-desktop.nix | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/modules/programs/joplin-desktop.nix b/modules/programs/joplin-desktop.nix index bbf9e400d783..418abff335c0 100644 --- a/modules/programs/joplin-desktop.nix +++ b/modules/programs/joplin-desktop.nix @@ -49,7 +49,7 @@ in { sync = { target = lib.mkOption { type = lib.types.enum [ - null + "undefined" "none" "file-system" "onedrive" @@ -60,15 +60,23 @@ in { "joplin-server" "joplin-cloud" ]; - default = null; + default = "undefined"; example = "dropbox"; description = "What is the type of sync target."; }; interval = lib.mkOption { - type = - lib.types.enum [ null "disabled" "5m" "10m" "30m" "1h" "12h" "1d" ]; - default = null; + type = lib.types.enum [ + "undefined" + "disabled" + "5m" + "10m" + "30m" + "1h" + "12h" + "1d" + ]; + default = "undefined"; example = "10m"; description = '' Set the synchronisation interval. @@ -90,6 +98,7 @@ in { "editor" = cfg.general.editor; "sync.target" = { + "undefined" = null; "none" = 0; "file-system" = 2; "onedrive" = 3; @@ -99,9 +108,10 @@ in { "s3" = 8; "joplin-server" = 9; "joplin-cloud" = 10; - }.${cfg.sync.target} or null; + }.${cfg.sync.target}; "sync.interval" = { + "undefined" = null; "disabled" = 0; "5m" = 300; "10m" = 600; @@ -109,10 +119,11 @@ in { "1h" = 3600; "12h" = 43200; "1d" = 86400; - }.${cfg.sync.interval} or null; + }.${cfg.sync.interval}; } // cfg.extraConfig)); in lib.hm.dag.entryAfter [ "linkGeneration" ] '' # Ensure that settings.json exists. + mkdir -p ${builtins.dirOf configPath} touch ${configPath} # Config has to be written to temporary variable because jq cannot edit files in place. config="$(jq -s '.[0] + .[1]' ${configPath} ${newConfig})" From 670d9ecc3e46a6e3265c203c2d136031a3d3548e Mon Sep 17 00:00:00 2001 From: Mirko Lenz Date: Sat, 24 Feb 2024 17:39:35 +0100 Subject: [PATCH 216/636] poetry: add module --- modules/misc/news.nix | 10 ++++ modules/modules.nix | 1 + modules/programs/poetry.nix | 55 +++++++++++++++++++ tests/default.nix | 1 + .../programs/poetry/custom-settings.nix | 27 +++++++++ .../programs/poetry/default-settings.nix | 15 +++++ tests/modules/programs/poetry/default.nix | 4 ++ 7 files changed, 113 insertions(+) create mode 100644 modules/programs/poetry.nix create mode 100644 tests/modules/programs/poetry/custom-settings.nix create mode 100644 tests/modules/programs/poetry/default-settings.nix create mode 100644 tests/modules/programs/poetry/default.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 8d7e17a5a82e..bbbf3b8fc28f 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1506,6 +1506,16 @@ in { A new module is available: 'services.remmina'. ''; } + + { + time = "2024-04-21T20:53:09+00:00"; + message = '' + A new module is available: 'programs.poetry'. + + Poetry is a tool that helps you manage Python project dependencies and + packages. See https://python-poetry.org/ for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 154f2bd9c73b..01247077baed 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -186,6 +186,7 @@ let ./programs/pistol.nix ./programs/piston-cli.nix ./programs/pls.nix + ./programs/poetry.nix ./programs/powerline-go.nix ./programs/pqiv.nix ./programs/pubs.nix diff --git a/modules/programs/poetry.nix b/modules/programs/poetry.nix new file mode 100644 index 000000000000..d297f0c78432 --- /dev/null +++ b/modules/programs/poetry.nix @@ -0,0 +1,55 @@ +{ pkgs, config, lib, ... }: + +let + + inherit (lib) mkEnableOption mkPackageOption mkOption literalExpression; + + tomlFormat = pkgs.formats.toml { }; + + configDir = if pkgs.stdenv.isDarwin then + "Library/Application Support" + else + config.xdg.configHome; + + cfg = config.programs.poetry; + +in { + meta.maintainers = with lib.maintainers; [ mirkolenz ]; + + options.programs.poetry = { + enable = mkEnableOption "poetry"; + + package = mkPackageOption pkgs "poetry" { + example = "pkgs.poetry.withPlugins (ps: with ps; [ poetry-plugin-up ])"; + extraDescription = "May be used to install custom poetry plugins."; + }; + + settings = mkOption { + type = tomlFormat.type; + default = { }; + example = literalExpression '' + { + virtualenvs.create = true; + virtualenvs.in-project = true; + } + ''; + description = '' + Configuration written to + {file}`$XDG_CONFIG_HOME/pypoetry/config.toml` on Linux or + {file}`$HOME/Library/Application Support/pypoetry/config.toml` on Darwin. + See + + for more information. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + home.packages = [ cfg.package ]; + + home.file."${configDir}/pypoetry/config.toml" = + lib.mkIf (cfg.settings != { }) { + source = tomlFormat.generate "poetry-config" cfg.settings; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 3729ce98c1f7..4b7b6ebf660e 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -122,6 +122,7 @@ in import nmtSrc { ./modules/programs/pet ./modules/programs/pistol ./modules/programs/pls + ./modules/programs/poetry ./modules/programs/powerline-go ./modules/programs/pubs ./modules/programs/pyenv diff --git a/tests/modules/programs/poetry/custom-settings.nix b/tests/modules/programs/poetry/custom-settings.nix new file mode 100644 index 000000000000..fc9793067ead --- /dev/null +++ b/tests/modules/programs/poetry/custom-settings.nix @@ -0,0 +1,27 @@ +{ pkgs, ... }: + +{ + programs.poetry = { + enable = true; + settings = { + virtualenvs.create = true; + virtualenvs.in-project = true; + }; + }; + + test.stubs.poetry = { }; + + nmt.script = let + expectedConfDir = + if pkgs.stdenv.isDarwin then "Library/Application Support" else ".config"; + expectedConfigPath = "home-files/${expectedConfDir}/pypoetry/config.toml"; + expectedConfigContent = pkgs.writeText "poetry.config-custom.expected" '' + [virtualenvs] + create = true + in-project = true + ''; + in '' + assertFileExists "${expectedConfigPath}" + assertFileContent "${expectedConfigPath}" "${expectedConfigContent}" + ''; +} diff --git a/tests/modules/programs/poetry/default-settings.nix b/tests/modules/programs/poetry/default-settings.nix new file mode 100644 index 000000000000..145cf18adb7d --- /dev/null +++ b/tests/modules/programs/poetry/default-settings.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: + +{ + programs.poetry = { enable = true; }; + + test.stubs.poetry = { }; + + nmt.script = let + expectedConfDir = + if pkgs.stdenv.isDarwin then "Library/Application Support" else ".config"; + expectedConfigPath = "home-files/${expectedConfDir}/pypoetry/config.toml"; + in '' + assertPathNotExists "${expectedConfigPath}" + ''; +} diff --git a/tests/modules/programs/poetry/default.nix b/tests/modules/programs/poetry/default.nix new file mode 100644 index 000000000000..50af2a33d0ff --- /dev/null +++ b/tests/modules/programs/poetry/default.nix @@ -0,0 +1,4 @@ +{ + poetry-default-settings = ./default-settings.nix; + poetry-custom-settings = ./custom-settings.nix; +} From 46833c3115e8858370880d892748f0927d8193c3 Mon Sep 17 00:00:00 2001 From: Nicolas Goudry Date: Mon, 22 Apr 2024 14:44:39 +0200 Subject: [PATCH 217/636] bat: allow overriding package (#5301) --- modules/programs/bat.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/programs/bat.nix b/modules/programs/bat.nix index bf8040d14bce..5d09145af660 100644 --- a/modules/programs/bat.nix +++ b/modules/programs/bat.nix @@ -6,8 +6,6 @@ let cfg = config.programs.bat; - package = pkgs.bat; - toConfigFile = attrs: let inherit (builtins) isBool attrNames; @@ -52,6 +50,8 @@ in { ''; }; + package = mkPackageOption pkgs "bat" { }; + themes = mkOption { type = types.attrsOf (types.either types.lines (types.submodule { options = { @@ -138,7 +138,7 @@ in { '']; }) { - home.packages = [ package ] ++ cfg.extraPackages; + home.packages = [ cfg.package ] ++ cfg.extraPackages; xdg.configFile = mkMerge ([({ "bat/config" = @@ -167,7 +167,7 @@ in { export XDG_CACHE_HOME=${escapeShellArg config.xdg.cacheHome} verboseEcho "Rebuilding bat theme cache" cd "${pkgs.emptyDirectory}" - run ${lib.getExe package} cache --build + run ${lib.getExe cfg.package} cache --build ) ''; } From 2ad154bd1be2441ac8c624704587734dddb9f41a Mon Sep 17 00:00:00 2001 From: bittin1ddc447d824349b2 Date: Mon, 22 Apr 2024 09:07:19 +0200 Subject: [PATCH 218/636] Translate using Weblate (Swedish) Currently translated at 100.0% (37 of 37 strings) Co-authored-by: bittin1ddc447d824349b2 Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/sv/ Translation: Home Manager/Home Manager CLI --- home-manager/po/sv.po | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/home-manager/po/sv.po b/home-manager/po/sv.po index 428f9e10b9c1..15930e49f86a 100644 --- a/home-manager/po/sv.po +++ b/home-manager/po/sv.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-02-18 14:02+0000\n" +"PO-Revision-Date: 2024-04-22 07:07+0000\n" "Last-Translator: bittin1ddc447d824349b2 \n" "Language-Team: Swedish \n" @@ -17,12 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: saknar argument för %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" From e2e7ea9b8f3de1e6a09f4fc512eae75f6e413a10 Mon Sep 17 00:00:00 2001 From: paki23 Date: Sat, 20 Apr 2024 21:06:28 +0200 Subject: [PATCH 219/636] kconfig: fix missing quoting --- modules/misc/qt/kconfig.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/misc/qt/kconfig.nix b/modules/misc/qt/kconfig.nix index 22139f5cf967..f7c35573b975 100644 --- a/modules/misc/qt/kconfig.nix +++ b/modules/misc/qt/kconfig.nix @@ -47,7 +47,7 @@ in { else if t == "bool" then "--type bool ${builtins.toJSON v}" else - toString v; + lib.escapeShellArg (toString v); toLine = file: path: value: if builtins.isAttrs value then lib.mapAttrsToList From 1451d2866d9ef3739c20f964c9c8bd6db39cc373 Mon Sep 17 00:00:00 2001 From: quasigod Date: Mon, 22 Apr 2024 12:04:34 -0400 Subject: [PATCH 220/636] foot: unset PATH in server's systemd unit file This reverts commit 40ab43ae98cb3e6f07eaeaa3f3ed56d589da21b0. --- modules/programs/foot.nix | 1 - .../modules/programs/foot/systemd-user-service-expected.service | 1 - 2 files changed, 2 deletions(-) diff --git a/modules/programs/foot.nix b/modules/programs/foot.nix index 52bab9383483..79832dced7e0 100644 --- a/modules/programs/foot.nix +++ b/modules/programs/foot.nix @@ -68,7 +68,6 @@ in { }; Service = { - Environment = "PATH=${makeBinPath [ cfg.package ]}"; ExecStart = "${cfg.package}/bin/foot --server"; Restart = "on-failure"; OOMPolicy = "continue"; diff --git a/tests/modules/programs/foot/systemd-user-service-expected.service b/tests/modules/programs/foot/systemd-user-service-expected.service index 0c452b9df5cf..517344e531d6 100644 --- a/tests/modules/programs/foot/systemd-user-service-expected.service +++ b/tests/modules/programs/foot/systemd-user-service-expected.service @@ -2,7 +2,6 @@ WantedBy=graphical-session.target [Service] -Environment=PATH=@foot@/bin ExecStart=@foot@/bin/foot --server OOMPolicy=continue Restart=on-failure From e866aae5bbbcfe6798ca05d3004a4e62f1828954 Mon Sep 17 00:00:00 2001 From: nat Date: Sun, 21 Apr 2024 18:53:24 +0200 Subject: [PATCH 221/636] amberol: add module Amberol is a small and simple music player. --- modules/misc/news.nix | 21 +++++++++++ modules/modules.nix | 3 +- modules/services/amberol.nix | 70 ++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 modules/services/amberol.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index bbbf3b8fc28f..88e43a4c0d18 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1470,6 +1470,14 @@ in { ''; } + { + time = "2024-03-28T17:02:19+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.amberol'. + ''; + } + { time = "2024-04-08T21:43:38+00:00"; message = '' @@ -1516,6 +1524,19 @@ in { packages. See https://python-poetry.org/ for more. ''; } + + { + time = "2024-04-22T18:04:47+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.amberol'. + + Amberol is a music player with no delusions of grandeur. If you just + want to play music available on your local system then Amberol is the + music player you are looking for. See https://apps.gnome.org/Amberol/ + for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 01247077baed..06d1c33156ca 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -261,8 +261,9 @@ let ./programs/zsh.nix ./programs/zsh/prezto.nix ./programs/zsh/zsh-abbr.nix - ./services/arrpc.nix ./services/activitywatch.nix + ./services/amberol.nix + ./services/arrpc.nix ./services/autorandr.nix ./services/avizo.nix ./services/barrier.nix diff --git a/modules/services/amberol.nix b/modules/services/amberol.nix new file mode 100644 index 000000000000..a630124478dc --- /dev/null +++ b/modules/services/amberol.nix @@ -0,0 +1,70 @@ +{ config, lib, pkgs, ... }: + +let + + cfg = config.services.amberol; + +in { + meta.maintainers = with lib.maintainers; [ surfaceflinger ]; + + options.services.amberol = { + enable = lib.mkEnableOption "" // { + description = '' + Whether to enable Amberol music player as a daemon. + + Note, it is necessary to add + ```nix + programs.dconf.enable = true; + ``` + to your system configuration for the daemon to work correctly. + ''; + }; + + package = lib.mkPackageOption pkgs "amberol" { }; + + enableRecoloring = lib.mkOption { + type = lib.types.bool; + default = true; + description = "UI recoloring using the album art."; + }; + + replaygain = lib.mkOption { + type = lib.types.enum [ "album" "track" "off" ]; + default = "track"; + description = "ReplayGain mode."; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.amberol" pkgs + lib.platforms.linux) + ]; + + # Running amberol will just attach itself to gapplication service. + home.packages = [ cfg.package ]; + + dconf.settings."io/bassi/Amberol" = { + background-play = true; + enable-recoloring = cfg.enableRecoloring; + replay-gain = cfg.replaygain; + }; + + systemd.user.services.amberol = { + Unit = { + Description = "Amberol music player daemon"; + Requires = [ "dbus.service" ]; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + + Install.WantedBy = [ "graphical-session.target" ]; + + Service = { + ExecStart = "${lib.getExe cfg.package} --gapplication-service"; + Restart = "on-failure"; + RestartSec = 5; + }; + }; + }; +} From 67de98ae6eed5ad6f91b1142356d71a87ba97f21 Mon Sep 17 00:00:00 2001 From: Samuel Tschiedel <431708+aisamu@users.noreply.github.com> Date: Mon, 22 Apr 2024 17:38:46 -0300 Subject: [PATCH 222/636] tealdeer: documentation typo --- modules/programs/tealdeer.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/tealdeer.nix b/modules/programs/tealdeer.nix index 55b6c22b0409..d9318d102247 100644 --- a/modules/programs/tealdeer.nix +++ b/modules/programs/tealdeer.nix @@ -50,7 +50,7 @@ in { The activation script should be fast and idempotent, so the option was removed. Please use - `programs.teadleer.settings.updates.auto_update = true` + `programs.tealdeer.settings.updates.auto_update = true` instead, to make sure tealdeer's cache is updated periodically. '') From 33a20182e3164f451b6a4ac2ecadcab5c2c36703 Mon Sep 17 00:00:00 2001 From: dotconfig404 <119617043+dotconfig404@users.noreply.github.com> Date: Tue, 23 Apr 2024 19:49:42 +0200 Subject: [PATCH 223/636] home-manager: improve session variables comment --- home-manager/home-manager | 7 ++++--- tests/integration/standalone/alice-home-init.nix | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index 8e5fb4c5f5b8..9703505df5a6 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -398,9 +398,10 @@ $xdgVars }; # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. If you don't want to manage your shell through Home - # Manager then you have to manually source 'hm-session-vars.sh' located at - # either + # 'home.sessionVariables'. These will be explicitly sourced when using a + # shell provided by Home Manager. If you don't want to manage your shell + # through Home Manager then you have to manually source 'hm-session-vars.sh' + # located at either # # ~/.nix-profile/etc/profile.d/hm-session-vars.sh # diff --git a/tests/integration/standalone/alice-home-init.nix b/tests/integration/standalone/alice-home-init.nix index c5abf850fa08..3aab189773ec 100644 --- a/tests/integration/standalone/alice-home-init.nix +++ b/tests/integration/standalone/alice-home-init.nix @@ -52,9 +52,10 @@ }; # Home Manager can also manage your environment variables through - # 'home.sessionVariables'. If you don't want to manage your shell through Home - # Manager then you have to manually source 'hm-session-vars.sh' located at - # either + # 'home.sessionVariables'. These will be explicitly sourced when using a + # shell provided by Home Manager. If you don't want to manage your shell + # through Home Manager then you have to manually source 'hm-session-vars.sh' + # located at either # # ~/.nix-profile/etc/profile.d/hm-session-vars.sh # From bfa7c06436771e3a0c666ccc6ee01e815d4c33aa Mon Sep 17 00:00:00 2001 From: Sergio Ribera <56278796+SergioRibera@users.noreply.github.com> Date: Sun, 21 Apr 2024 02:55:00 -0400 Subject: [PATCH 224/636] swayosd: add custom style option --- modules/services/swayosd.nix | 11 +++++++++++ tests/modules/services/swayosd/swayosd.nix | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/services/swayosd.nix b/modules/services/swayosd.nix index 51e7eb6dd91f..79ca7f5ee42d 100644 --- a/modules/services/swayosd.nix +++ b/modules/services/swayosd.nix @@ -26,6 +26,15 @@ in { description = "OSD margin from top edge (0.5 would be screen center)."; }; + stylePath = mkOption { + type = types.nullOr types.path; + default = null; + example = "/etc/xdg/swayosd/style.css"; + description = '' + Use a custom Stylesheet file instead of looking for one. + ''; + }; + display = mkOption { type = types.nullOr types.str; default = null; @@ -57,6 +66,8 @@ in { Type = "simple"; ExecStart = "${cfg.package}/bin/swayosd-server" + (optionalString (cfg.display != null) " --display ${cfg.display}") + + (optionalString (cfg.stylePath != null) + " --style ${escapeShellArg cfg.stylePath}") + (optionalString (cfg.topMargin != null) " --top-margin ${toString cfg.topMargin}"); Restart = "always"; diff --git a/tests/modules/services/swayosd/swayosd.nix b/tests/modules/services/swayosd/swayosd.nix index ba92d81fa4e2..88a7c536253c 100644 --- a/tests/modules/services/swayosd/swayosd.nix +++ b/tests/modules/services/swayosd/swayosd.nix @@ -8,6 +8,7 @@ outPath = "@swayosd@"; }; display = "DISPLAY"; + stylePath = "/etc/xdg/swayosd/style.css"; topMargin = 0.1; }; @@ -20,7 +21,7 @@ WantedBy=graphical-session.target [Service] - ExecStart=@swayosd@/bin/swayosd-server --display DISPLAY --top-margin 0.100000 + ExecStart=@swayosd@/bin/swayosd-server --display DISPLAY --style '/etc/xdg/swayosd/style.css' --top-margin 0.100000 Restart=always Type=simple From 2f072c127c041eec36621b8e38a531fe0fe07961 Mon Sep 17 00:00:00 2001 From: Johan Runsten Date: Wed, 24 Apr 2024 22:59:02 +0200 Subject: [PATCH 225/636] zsh: use correct autosuggestion color variable (#5320) To configure zsh's autosuggest "highlight style" we use ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE but it's currently set to AUTOSUGGESTION_HIGHLIGHT_COLOR (via autosuggestion.highlight). This change was apparently made back in 2016 or earlier. --- modules/programs/zsh.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index c4520e7a774a..3ec73f30d06a 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -612,7 +612,7 @@ in source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh '') (optionalString (cfg.autosuggestion.enable && cfg.autosuggestion.highlight != null) '' - AUTOSUGGESTION_HIGHLIGHT_COLOR="${cfg.autosuggestion.highlight}" + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="${cfg.autosuggestion.highlight}" '') (optionalString cfg.oh-my-zsh.enable '' From 4c157f84e8fbd6a0fd1688b458c6ce04d047a165 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Thu, 25 Apr 2024 12:04:09 +0200 Subject: [PATCH 226/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/5c24cf2f0a12ad855f444c30b2421d044120c66f' (2024-04-19) → 'github:NixOS/nixpkgs/6143fc5eeb9c4f00163267708e26191d1e918932' (2024-04-21) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 549810903f77..3a0d2858b830 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1713537308, - "narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=", + "lastModified": 1713714899, + "narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5c24cf2f0a12ad855f444c30b2421d044120c66f", + "rev": "6143fc5eeb9c4f00163267708e26191d1e918932", "type": "github" }, "original": { From 3ebcff8d1219c9e0fb3c880ef7959feca7ea2c4a Mon Sep 17 00:00:00 2001 From: Bjarki Gunnarsson Date: Tue, 23 Apr 2024 19:49:46 +0200 Subject: [PATCH 227/636] Translate using Weblate (Icelandic) Currently translated at 13.5% (5 of 37 strings) Add translation using Weblate (Icelandic) Co-authored-by: Bjarki Gunnarsson Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/is/ Translation: Home Manager/Home Manager CLI --- home-manager/po/is.po | 223 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 223 insertions(+) create mode 100644 home-manager/po/is.po diff --git a/home-manager/po/is.po b/home-manager/po/is.po new file mode 100644 index 000000000000..8c29d2a2461f --- /dev/null +++ b/home-manager/po/is.po @@ -0,0 +1,223 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Home Manager contributors +# This file is distributed under the same license as the Home Manager package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Home Manager\n" +"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" +"PO-Revision-Date: 2024-04-23 17:49+0000\n" +"Last-Translator: Bjarki Gunnarsson \n" +"Language-Team: Icelandic \n" +"Language: is\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n % 10 != 1 || n % 100 == 11;\n" +"X-Generator: Weblate 5.5-dev\n" + +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +#, fuzzy +msgid "%s: missing argument for %s" +msgstr "%s: vantar inntak fyrir %s" + +#: home-manager/home-manager:64 +msgid "No configuration file found at %s" +msgstr "Engin stillingaskrá fundin í %s" + +#. translators: The first '%s' specifier will be replaced by either +#. 'home.nix' or 'flake.nix'. +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 +msgid "" +"Keeping your Home Manager %s in %s is deprecated,\n" +"please move it to %s" +msgstr "" +"Það er úrelt að geyma Home Manager %s í %s,\n" +"vinsamlega færðu hann í %s" + +#: home-manager/home-manager:92 +msgid "No configuration file found. Please create one at %s" +msgstr "Engin stillingaskrá fundin. Vinsamlegast búðu hana til í %s" + +#: home-manager/home-manager:107 +msgid "Home Manager not found at %s." +msgstr "Home Manager ekki fundinn í %s." + +#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. +#: home-manager/home-manager:115 +msgid "" +"The fallback Home Manager path %s has been deprecated and a file/directory " +"was found there." +msgstr "" +"Vara Home Manager slóðin %s hefur verið úreld en skrá/mappa hefur verið " +"fundin þar." + +#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. +#: home-manager/home-manager:118 +msgid "" +"To remove this warning, do one of the following.\n" +"\n" +"1. Explicitly tell Home Manager to use the path, for example by adding\n" +"\n" +" { programs.home-manager.path = \"%s\"; }\n" +"\n" +" to your configuration.\n" +"\n" +" If you import Home Manager directly, you can use the `path` parameter\n" +"\n" +" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" +"\n" +" when calling the Home Manager package.\n" +"\n" +"2. Remove the deprecated path.\n" +"\n" +" $ rm -r \"%s\"" +msgstr "" + +#: home-manager/home-manager:146 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:166 +msgid "Could not find suitable profile directory, tried %s and %s" +msgstr "" + +#. translators: Here "flake" is a noun that refers to the Nix Flakes feature. +#: home-manager/home-manager:221 +msgid "Can't inspect options of a flake configuration" +msgstr "" + +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 +msgid "%s: unknown option '%s'" +msgstr "" + +#: home-manager/home-manager:301 home-manager/home-manager:1052 +msgid "Run '%s --help' for usage help" +msgstr "" + +#: home-manager/home-manager:327 home-manager/home-manager:431 +msgid "The file %s already exists, leaving it unchanged..." +msgstr "" + +#: home-manager/home-manager:329 home-manager/home-manager:433 +msgid "Creating %s..." +msgstr "" + +#: home-manager/home-manager:475 +msgid "Creating initial Home Manager generation..." +msgstr "" + +#. translators: The "%s" specifier will be replaced by a file path. +#: home-manager/home-manager:480 +msgid "" +"All done! The home-manager tool should now be installed and you can edit\n" +"\n" +" %s\n" +"\n" +"to configure Home Manager. Run 'man home-configuration.nix' to\n" +"see all available options." +msgstr "" + +#. translators: The "%s" specifier will be replaced by a URL. +#: home-manager/home-manager:485 +msgid "" +"Uh oh, the installation failed! Please create an issue at\n" +"\n" +" %s\n" +"\n" +"if the error seems to be the fault of Home Manager." +msgstr "" + +#. translators: Here "flake" is a noun that refers to the Nix Flakes feature. +#: home-manager/home-manager:496 +msgid "Can't instantiate a flake configuration" +msgstr "" + +#: home-manager/home-manager:572 +msgid "" +"There is %d unread and relevant news item.\n" +"Read it by running the command \"%s news\"." +msgid_plural "" +"There are %d unread and relevant news items.\n" +"Read them by running the command \"%s news\"." +msgstr[0] "" +msgstr[1] "" + +#: home-manager/home-manager:586 +msgid "Unknown \"news.display\" setting \"%s\"." +msgstr "" + +#: home-manager/home-manager:594 +#, sh-format +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" + +#: home-manager/home-manager:612 +msgid "Cannot run build in read-only directory" +msgstr "" + +#: home-manager/home-manager:693 +msgid "No generation with ID %s" +msgstr "" + +#: home-manager/home-manager:695 +msgid "Cannot remove the current generation %s" +msgstr "" + +#: home-manager/home-manager:697 +msgid "Removing generation %s" +msgstr "" + +#: home-manager/home-manager:718 +msgid "No generations to expire" +msgstr "" + +#: home-manager/home-manager:729 +msgid "No home-manager packages seem to be installed." +msgstr "" + +#: home-manager/home-manager:811 +msgid "Unknown argument %s" +msgstr "" + +#: home-manager/home-manager:835 +msgid "This will remove Home Manager from your system." +msgstr "" + +#: home-manager/home-manager:838 +msgid "This is a dry run, nothing will actually be uninstalled." +msgstr "" + +#: home-manager/home-manager:842 +msgid "Really uninstall Home Manager?" +msgstr "" + +#: home-manager/home-manager:848 +msgid "Switching to empty Home Manager configuration..." +msgstr "" + +#: home-manager/home-manager:863 +msgid "Yay!" +msgstr "" + +#: home-manager/home-manager:868 +msgid "Home Manager is uninstalled but your home.nix is left untouched." +msgstr "" + +#: home-manager/home-manager:1091 +msgid "expire-generations expects one argument, got %d." +msgstr "" + +#: home-manager/home-manager:1113 +msgid "Unknown command: %s" +msgstr "" + +#: home-manager/install.nix:18 +msgid "This derivation is not buildable, please run it using nix-shell." +msgstr "" From 6864ca2d2657d57a041110dcaf8be0c4b71346c0 Mon Sep 17 00:00:00 2001 From: Languages add-on Date: Tue, 23 Apr 2024 19:49:46 +0200 Subject: [PATCH 228/636] Add translation using Weblate (Icelandic) Co-authored-by: Languages add-on --- modules/po/is.po | 113 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 modules/po/is.po diff --git a/modules/po/is.po b/modules/po/is.po new file mode 100644 index 000000000000..4f7e3bdc17ad --- /dev/null +++ b/modules/po/is.po @@ -0,0 +1,113 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Home Manager contributors +# This file is distributed under the same license as the Home Manager Modules package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Home Manager Modules\n" +"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: is\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: modules/files.nix:191 +msgid "Creating home file links in %s" +msgstr "" + +#: modules/files.nix:204 +msgid "Cleaning up orphan links from %s" +msgstr "" + +#: modules/files.nix:220 +msgid "Creating profile generation %s" +msgstr "" + +#: modules/files.nix:237 +msgid "No change so reusing latest profile generation %s" +msgstr "" + +#: modules/home-environment.nix:634 +msgid "" +"Oops, Nix failed to install your new Home Manager profile!\n" +"\n" +"Perhaps there is a conflict with a package that was installed using\n" +"\"%s\"? Try running\n" +"\n" +" %s\n" +"\n" +"and if there is a conflicting package you can remove it with\n" +"\n" +" %s\n" +"\n" +"Then try activating your Home Manager configuration again." +msgstr "" + +#: modules/home-environment.nix:667 +msgid "Activating %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:22 +msgid "Migrating profile from %s to %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:54 +msgid "Could not find suitable profile directory, tried %s and %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:83 +msgid "Sanity checking oldGenNum and oldGenPath" +msgstr "" + +#: modules/lib-bash/activation-init.sh:86 +msgid "" +"The previous generation number and path are in conflict! These\n" +"must be either both empty or both set but are now set to\n" +"\n" +" '%s' and '%s'\n" +"\n" +"If you don't mind losing previous profile generations then\n" +"the easiest solution is probably to run\n" +"\n" +" rm %s/home-manager*\n" +" rm %s/current-home\n" +"\n" +"and trying home-manager switch again. Good luck!" +msgstr "" + +#: modules/lib-bash/activation-init.sh:127 +msgid "Error: USER is set to \"%s\" but we expect \"%s\"" +msgstr "" + +#: modules/lib-bash/activation-init.sh:136 +msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" +msgstr "" + +#: modules/lib-bash/activation-init.sh:153 +msgid "Starting Home Manager activation" +msgstr "" + +#: modules/lib-bash/activation-init.sh:157 +msgid "Sanity checking Nix" +msgstr "" + +#: modules/lib-bash/activation-init.sh:170 +msgid "This is a dry run" +msgstr "" + +#: modules/lib-bash/activation-init.sh:174 +msgid "This is a live run" +msgstr "" + +#: modules/lib-bash/activation-init.sh:180 +msgid "Using Nix version: %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:183 +msgid "Activation variables:" +msgstr "" From 0c5704eceefcb7bb238a958f532a86e3b59d76db Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Tue, 23 Apr 2024 09:52:19 -0700 Subject: [PATCH 229/636] home-manager: make newsReadIdsFile more reliable Specifically, avoid duplicate remove duplicate slashes in the `news-read-ids` file path. Also quote the use of `newsReadIdsFile` to reduce problems with potential spaces. --- home-manager/home-manager | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index 9703505df5a6..630fe39a9d21 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -742,7 +742,11 @@ function newsReadIdsFile() { touch "$path" fi - echo "$path" + # Remove duplicate slashes in case $HOME or $XDG_DATA_HOME have a trailing + # slash. Double slashes causes Nix to error out with + # + # error: syntax error, unexpected PATH_END, expecting DOLLAR_CURLY". + echo "$path" | tr -s / } # Builds the Home Manager news data file. @@ -777,7 +781,7 @@ function buildNews() { done local readIdsFile - readIdsFile=$(newsReadIdsFile) + readIdsFile="$(newsReadIdsFile)" nix-instantiate \ --no-build-output --strict \ @@ -796,7 +800,7 @@ function doShowNews() { buildNews "$newsNixFile" local readIdsFile - readIdsFile=$(newsReadIdsFile) + readIdsFile="$(newsReadIdsFile)" local news From 26e72d85e6fbda36bf2266f1447215501ec376fd Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Fri, 26 Apr 2024 22:02:25 +0200 Subject: [PATCH 230/636] home-manager: set module class to "homeManager" This enables a module system feature documented here: https://nixos.org/manual/nixpkgs/stable/index.html#module-system-lib-evalModules-param-class For example, it allows a mistake to be caught, which is loading a NixOS module into home-manager. This only works when the offending module declares what it's for with a `_class` attribute. It is not expected that users declare the `_type`, because the payoff is small. It is only expected to be set by generic code, such as functions or libraries that help with the "publishing" of modules (e.g. flake-parts, flake-utils). The class feature has been available in the module system since https://github.com/NixOS/nixpkgs/pull/197547, merged May 6, 2023. It has been part of all releases since 23.05-beta. The last NixOS release that did _not_ support it has been end-of-life for close to a year now. Example: (lib.homeManagerConfiguration { pkgs = nixpkgs.legacyPackages.x86_64-linux; modules = [{ _class = "nixos"; imports = [ ./foo.nix ]; }]; }).activation-script Corresponding error: error: The module was imported into homeManager instead of nixos. (`` can be improved by also setting `_file`, if known; a much older feature) PR #5339 --- docs/default.nix | 7 ++++++- modules/default.nix | 1 + nixos/common.nix | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/default.nix b/docs/default.nix index 422e5ef80bce..21f00fb48c60 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -55,7 +55,11 @@ let hmPath = toString ./..; buildOptionsDocs = args@{ modules, includeModuleSystemOptions ? true, ... }: - let options = (lib.evalModules { inherit modules; }).options; + let + options = (lib.evalModules { + inherit modules; + class = "homeManager"; + }).options; in pkgs.buildPackages.nixosOptionsDoc ({ options = if includeModuleSystemOptions then options @@ -160,6 +164,7 @@ in { inherit lib pkgs; check = false; } ++ [ scrubbedPkgsModule ]; + class = "homeManager"; }; in builtins.toJSON result.config.meta.maintainers); } diff --git a/modules/default.nix b/modules/default.nix index ad0e67646688..6c54148abd32 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -25,6 +25,7 @@ let rawModule = extendedLib.evalModules { modules = [ configuration ] ++ hmModules; + class = "homeManager"; specialArgs = { modulesPath = builtins.toString ./.; } // extraSpecialArgs; }; diff --git a/nixos/common.nix b/nixos/common.nix index 5da3240b97b2..08491be9b1ef 100644 --- a/nixos/common.nix +++ b/nixos/common.nix @@ -13,6 +13,7 @@ let hmModule = types.submoduleWith { description = "Home Manager module"; + class = "homeManager"; specialArgs = { lib = extendedLib; osConfig = config; From c1609d584a6b5e9e6a02010f51bd368cb4782f8e Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Tue, 26 Mar 2024 08:25:05 -0300 Subject: [PATCH 231/636] xdg-portal: improve description of `enable` option Specifically, add note about useUserPackages and pathsToLink. As suggested in . --- modules/misc/xdg-portal.nix | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/modules/misc/xdg-portal.nix b/modules/misc/xdg-portal.nix index af305374a986..b863b23ec6d1 100644 --- a/modules/misc/xdg-portal.nix +++ b/modules/misc/xdg-portal.nix @@ -2,9 +2,7 @@ let - inherit (lib) - mapAttrsToList mkEnableOption mkIf mkMerge mkOption optional optionalString - types; + inherit (lib) mkIf mkMerge mkOption optional types; associationOptions = with types; attrsOf (coercedTo (either (listOf str) str) @@ -14,8 +12,24 @@ in { meta.maintainers = [ lib.maintainers.misterio77 ]; options.xdg.portal = { - enable = mkEnableOption - "[XDG desktop integration](https://github.com/flatpak/xdg-desktop-portal)"; + enable = mkOption { + type = types.bool; + default = false; + example = true; + description = '' + Whether to enable [XDG desktop integration](https://github.com/flatpak/xdg-desktop-portal). + + Note, if you use the NixOS module and have `useUserPackages = true`, + make sure to add + + ``` nix + environment.pathsToLink = [ "/share/xdg-desktop-portal" "/share/applications" ]; + ``` + + to your system configuration so that the portal definitions and DE + provided configurations get linked. + ''; + }; extraPortals = mkOption { type = types.listOf types.package; From d1980931de8252b6ac1104b7191fd68bbbe3a291 Mon Sep 17 00:00:00 2001 From: Jan Schmitz <44864658+danjujan@users.noreply.github.com> Date: Sun, 28 Apr 2024 19:35:01 +0200 Subject: [PATCH 232/636] psd: add module PR #5349 --- modules/lib/maintainers.nix | 6 +++ modules/misc/news.nix | 12 +++++ modules/modules.nix | 1 + modules/services/psd.nix | 88 +++++++++++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 modules/services/psd.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index a2c568633711..f3dd83fe58cc 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -55,6 +55,12 @@ github = "cvoges12"; githubId = 38054771; }; + danjujan = { + name = "Jan Schmitz"; + email = "44864658+danjujan@users.noreply.github.com"; + github = "danjujan"; + githubId = 44864658; + }; d-dervishi = { email = "david.dervishi@epfl.ch"; github = "d-dervishi"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 88e43a4c0d18..f8617f54a994 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1537,6 +1537,18 @@ in { for more. ''; } + + { + time = "2024-04-28T20:27:08+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.psd'. + + Profile-sync-daemon (psd) is a tiny pseudo-daemon designed to manage + your browser's profile in tmpfs and to periodically sync it back to + your physical disc (HDD/SSD). + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 06d1c33156ca..b1e8b9b42e50 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -337,6 +337,7 @@ let ./services/plex-mpv-shim.nix ./services/polybar.nix ./services/poweralertd.nix + ./services/psd.nix ./services/pueue.nix ./services/pulseeffects.nix ./services/random-background.nix diff --git a/modules/services/psd.nix b/modules/services/psd.nix new file mode 100644 index 000000000000..477176aa3804 --- /dev/null +++ b/modules/services/psd.nix @@ -0,0 +1,88 @@ +{ config, lib, pkgs, ... }: + +let + + cfg = config.services.psd; + +in { + meta.maintainers = [ lib.hm.maintainers.danjujan ]; + + options.services.psd = { + enable = lib.mkEnableOption "Profile-sync-daemon service"; + + resyncTimer = lib.mkOption { + type = lib.types.str; + default = "1h"; + example = "1h 30min"; + description = '' + The amount of time to wait before syncing browser profiles back to the + disk. + + Takes a systemd time span, see {manpage}`systemd.time(7)`. The time unit + defaults to seconds if omitted. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.psd" pkgs lib.platforms.linux) + ]; + + home.packages = [ pkgs.profile-sync-daemon ]; + + systemd.user = { + services = let + exe = "${pkgs.profile-sync-daemon}/bin/profile-sync-daemon"; + envPath = lib.makeBinPath (with pkgs; [ + rsync + kmod + gawk + nettools + util-linux + profile-sync-daemon + ]); + in { + psd = { + Unit = { + Description = "Profile-sync-daemon"; + Wants = [ "psd-resync.service" ]; + RequiresMountsFor = [ "/home/" ]; + After = "winbindd.service"; + }; + Service = { + Type = "oneshot"; + RemainAfterExit = "yes"; + ExecStart = "${exe} startup"; + ExecStop = "${exe} unsync"; + Environment = [ "LAUNCHED_BY_SYSTEMD=1" "PATH=$PATH:${envPath}" ]; + }; + Install = { WantedBy = [ "default.target" ]; }; + }; + + psd-resync = { + Unit = { + Description = "Timed profile resync"; + After = [ "psd.service" ]; + Wants = [ "psd-resync.timer" ]; + PartOf = [ "psd.service" ]; + }; + Service = { + Type = "oneshot"; + ExecStart = "${exe} resync"; + Environment = [ "PATH=$PATH:${envPath}" ]; + }; + Install = { WantedBy = [ "default.target" ]; }; + }; + }; + + timers.psd-resync = { + Unit = { + Description = "Timer for Profile-sync-daemon"; + PartOf = [ "psd-resync.service" "psd.service" ]; + }; + Timer = { OnUnitActiveSec = cfg.resyncTimer; }; + }; + }; + }; +} From 02002a08b489b43e3ac1400609a9bf1b7c08e384 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 28 Apr 2024 22:43:49 +0200 Subject: [PATCH 233/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/6143fc5eeb9c4f00163267708e26191d1e918932' (2024-04-21) → 'github:NixOS/nixpkgs/7bb2ccd8cdc44c91edba16c48d2c8f331fb3d856' (2024-04-25) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 3a0d2858b830..513eff46f06a 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1713714899, - "narHash": "sha256-+z/XjO3QJs5rLE5UOf015gdVauVRQd2vZtsFkaXBq2Y=", + "lastModified": 1714076141, + "narHash": "sha256-Drmja/f5MRHZCskS6mvzFqxEaZMeciScCTFxWVLqWEY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "6143fc5eeb9c4f00163267708e26191d1e918932", + "rev": "7bb2ccd8cdc44c91edba16c48d2c8f331fb3d856", "type": "github" }, "original": { From c002bc08c8ea6c87198f3024e8bfd6fdb1c90c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Zwoli=C5=84ski?= Date: Sun, 28 Apr 2024 23:51:59 +0200 Subject: [PATCH 234/636] cliphist: support images in clipboard history --- modules/services/cliphist.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/modules/services/cliphist.nix b/modules/services/cliphist.nix index 6ba733fa5e87..504b519a4834 100644 --- a/modules/services/cliphist.nix +++ b/modules/services/cliphist.nix @@ -9,6 +9,14 @@ in { package = lib.mkPackageOption pkgs "cliphist" { }; + allowImages = lib.mkOption { + type = lib.types.bool; + default = true; + description = '' + Store images in clipboard history. + ''; + }; + systemdTarget = lib.mkOption { type = lib.types.str; default = "graphical-session.target"; @@ -46,5 +54,21 @@ in { Install = { WantedBy = [ cfg.systemdTarget ]; }; }; + + systemd.user.services.cliphist-images = lib.mkIf cfg.allowImages { + Unit = { + Description = "Clipboard management daemon - images"; + PartOf = [ "graphical-session.target" ]; + }; + + Service = { + Type = "simple"; + ExecStart = + "${pkgs.wl-clipboard}/bin/wl-paste --type image --watch ${cfg.package}/bin/cliphist store"; + Restart = "on-failure"; + }; + + Install = { WantedBy = [ cfg.systemdTarget ]; }; + }; }; } From 9fe79591c1005ce6f93084ae7f7dab0a2891440d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Tri=C3=B1anes?= Date: Mon, 29 Apr 2024 00:30:45 +0200 Subject: [PATCH 235/636] direnv: add nix-direnv to lib instead of sourcing Also removes use of `with lib`. --- modules/programs/direnv.nix | 19 ++++++++++--------- tests/modules/programs/direnv/nix-direnv.nix | 4 +--- .../programs/direnv/stdlib-and-nix-direnv.nix | 4 +--- tests/modules/programs/direnv/stdlib.nix | 1 + 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index fcbc46346c57..add2c8fca899 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -1,8 +1,8 @@ { config, lib, pkgs, ... }: - -with lib; - let + inherit (lib) + mkOption mkRenamedOptionModule mkRemovedOptionModule mkEnableOption types + mkPackageOption mkIf mkAfter getExe; cfg = config.programs.direnv; @@ -19,7 +19,7 @@ in { "Flake support is now always enabled.") ]; - meta.maintainers = [ maintainers.rycee ]; + meta.maintainers = [ lib.maintainers.rycee ]; options.programs.direnv = { enable = mkEnableOption "direnv, the environment switcher"; @@ -104,11 +104,12 @@ in { source = tomlFormat.generate "direnv-config" cfg.config; }; - xdg.configFile."direnv/direnvrc" = let - text = concatStringsSep "\n" (optional (cfg.stdlib != "") cfg.stdlib - ++ optional cfg.nix-direnv.enable - "source ${cfg.nix-direnv.package}/share/nix-direnv/direnvrc"); - in mkIf (text != "") { inherit text; }; + xdg.configFile."direnv/lib/hm-nix-direnv.sh" = mkIf cfg.nix-direnv.enable { + source = "${cfg.nix-direnv.package}/share/nix-direnv/direnvrc"; + }; + + xdg.configFile."direnv/direnvrc" = + lib.mkIf (cfg.stdlib != "") { text = cfg.stdlib; }; programs.bash.initExtra = mkIf cfg.enableBashIntegration ( # Using mkAfter to make it more likely to appear after other diff --git a/tests/modules/programs/direnv/nix-direnv.nix b/tests/modules/programs/direnv/nix-direnv.nix index 4c1730977300..588cd6ed63f4 100644 --- a/tests/modules/programs/direnv/nix-direnv.nix +++ b/tests/modules/programs/direnv/nix-direnv.nix @@ -10,9 +10,7 @@ with lib; nmt.script = '' assertFileExists home-files/.bashrc - assertFileRegex \ - home-files/.config/direnv/direnvrc \ - 'source /nix/store/.*nix-direnv.*/share/nix-direnv/direnvrc' + assertFileExists home-files/.config/direnv/lib/hm-nix-direnv.sh ''; }; } diff --git a/tests/modules/programs/direnv/stdlib-and-nix-direnv.nix b/tests/modules/programs/direnv/stdlib-and-nix-direnv.nix index 4e5efb8732e1..3bfd768c40d8 100644 --- a/tests/modules/programs/direnv/stdlib-and-nix-direnv.nix +++ b/tests/modules/programs/direnv/stdlib-and-nix-direnv.nix @@ -12,9 +12,7 @@ in { nmt.script = '' assertFileExists home-files/.bashrc - assertFileRegex \ - home-files/.config/direnv/direnvrc \ - 'source /nix/store/.*nix-direnv.*/share/nix-direnv/direnvrc' + assertFileExists home-files/.config/direnv/lib/hm-nix-direnv.sh assertFileRegex \ home-files/.config/direnv/direnvrc \ '${expectedContent}' diff --git a/tests/modules/programs/direnv/stdlib.nix b/tests/modules/programs/direnv/stdlib.nix index 1d06a0bc2a97..2a859132f8f0 100644 --- a/tests/modules/programs/direnv/stdlib.nix +++ b/tests/modules/programs/direnv/stdlib.nix @@ -10,6 +10,7 @@ in { programs.direnv.stdlib = expectedContent; nmt.script = '' + assertPathNotExists home-files/.config/direnv/lib/hm-nix-direnv.sh assertFileExists home-files/.bashrc assertFileRegex \ home-files/.config/direnv/direnvrc \ From 2af7c78b7bb9cf18406a193eba13ef9f99388f49 Mon Sep 17 00:00:00 2001 From: Alvaro Fresquet <29437693+afresquet@users.noreply.github.com> Date: Mon, 29 Apr 2024 09:53:42 +0200 Subject: [PATCH 236/636] thefuck: add nushell integration --- modules/programs/thefuck.nix | 14 ++++++++++++++ .../programs/thefuck/integration-disabled.nix | 3 +++ .../programs/thefuck/integration-enabled.nix | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/modules/programs/thefuck.nix b/modules/programs/thefuck.nix index 2cad4c3386ed..ab56ea0167c3 100644 --- a/modules/programs/thefuck.nix +++ b/modules/programs/thefuck.nix @@ -32,6 +32,14 @@ with lib; Whether to enable Zsh integration. ''; }; + + enableNushellIntegration = mkOption { + default = true; + type = types.bool; + description = '' + Whether to enable Nushell integration. + ''; + }; }; config = let @@ -66,5 +74,11 @@ with lib; }; programs.zsh.initExtra = mkIf cfg.enableZshIntegration shEvalCmd; + + programs.nushell = mkIf cfg.enableNushellIntegration { + extraConfig = '' + alias fuck = ${cfg.package}/bin/thefuck $"(history | last 1 | get command | get 0)" + ''; + }; }; } diff --git a/tests/modules/programs/thefuck/integration-disabled.nix b/tests/modules/programs/thefuck/integration-disabled.nix index 9a55efac0875..456963596692 100644 --- a/tests/modules/programs/thefuck/integration-disabled.nix +++ b/tests/modules/programs/thefuck/integration-disabled.nix @@ -6,8 +6,10 @@ thefuck.enableBashIntegration = false; thefuck.enableFishIntegration = false; thefuck.enableZshIntegration = false; + thefuck.enableNushellIntegration = false; bash.enable = true; zsh.enable = true; + nushell.enable = true; }; test.stubs.thefuck = { }; @@ -16,5 +18,6 @@ assertFileNotRegex home-files/.bashrc '@thefuck@/bin/thefuck' assertPathNotExists home-files/.config/fish/functions/fuck.fish assertFileNotRegex home-files/.zshrc '@thefuck@/bin/thefuck' + assertFileNotRegex home-files/.config/nushell/config.nu '@thefuck@/bin/thefuck' ''; } diff --git a/tests/modules/programs/thefuck/integration-enabled.nix b/tests/modules/programs/thefuck/integration-enabled.nix index 79cadaf81c3e..54d6b794e523 100644 --- a/tests/modules/programs/thefuck/integration-enabled.nix +++ b/tests/modules/programs/thefuck/integration-enabled.nix @@ -6,6 +6,7 @@ bash.enable = true; fish.enable = true; zsh.enable = true; + nushell.enable = true; }; test.stubs.thefuck = { }; @@ -33,5 +34,10 @@ assertFileContains \ home-files/.zshrc \ 'eval "$(@thefuck@/bin/thefuck '"'"'--alias'"'"')"' + + assertFileExists home-files/.config/nushell/config.nu + assertFileContains \ + home-files/.config/nushell/config.nu \ + 'alias fuck = @thefuck@/bin/thefuck $"(history | last 1 | get command | get 0)"' ''; } From b8d81ef15ed8ec4c72ffc610279d39aa0c4ccbf0 Mon Sep 17 00:00:00 2001 From: Lichthagel Date: Mon, 29 Apr 2024 15:49:58 +0200 Subject: [PATCH 237/636] mpv: add extraInput option --- modules/programs/mpv.nix | 21 +++++++++++++++++-- .../mpv-example-settings-expected-bindings | 3 ++- .../programs/mpv/mpv-example-settings.nix | 4 ++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/modules/programs/mpv.nix b/modules/programs/mpv.nix index eb9c9c4a7833..26cad11128c6 100644 --- a/modules/programs/mpv.nix +++ b/modules/programs/mpv.nix @@ -176,6 +176,20 @@ in { } ''; }; + + extraInput = mkOption { + description = '' + Additional lines that are appended to {file}`$XDG_CONFIG_HOME/mpv/input.conf`. + See {manpage}`mpv(1)` for the full list of options. + ''; + type = with types; lines; + default = ""; + example = '' + esc quit #! Quit + # script-binding uosc/video #! Video tracks + # additional comments + ''; + }; }; }; @@ -199,8 +213,11 @@ in { ${optionalString (cfg.profiles != { }) (renderProfiles cfg.profiles)} ''; }) - (mkIf (cfg.bindings != { }) { - xdg.configFile."mpv/input.conf".text = renderBindings cfg.bindings; + (mkIf (cfg.bindings != { } || cfg.extraInput != "") { + xdg.configFile."mpv/input.conf".text = mkMerge [ + (mkIf (cfg.bindings != { }) (renderBindings cfg.bindings)) + (mkIf (cfg.extraInput != "") cfg.extraInput) + ]; }) { xdg.configFile = mapAttrs' (name: value: diff --git a/tests/modules/programs/mpv/mpv-example-settings-expected-bindings b/tests/modules/programs/mpv/mpv-example-settings-expected-bindings index 7a2ee13b0332..d4ff9c4d085b 100644 --- a/tests/modules/programs/mpv/mpv-example-settings-expected-bindings +++ b/tests/modules/programs/mpv/mpv-example-settings-expected-bindings @@ -1,3 +1,4 @@ Alt+0 set window-scale 0.5 WHEEL_DOWN seek -10 -WHEEL_UP seek 10 \ No newline at end of file +WHEEL_UP seek 10 +# script-binding uosc/video #! Video tracks diff --git a/tests/modules/programs/mpv/mpv-example-settings.nix b/tests/modules/programs/mpv/mpv-example-settings.nix index 9974aff6ba38..002e071c16f4 100644 --- a/tests/modules/programs/mpv/mpv-example-settings.nix +++ b/tests/modules/programs/mpv/mpv-example-settings.nix @@ -12,6 +12,10 @@ "Alt+0" = "set window-scale 0.5"; }; + extraInput = '' + # script-binding uosc/video #! Video tracks + ''; + config = { force-window = true; ytdl-format = "bestvideo+bestaudio"; From 08d3cbfe4d400dad74e54815127fd67c76608a55 Mon Sep 17 00:00:00 2001 From: IldenH Date: Thu, 25 Apr 2024 19:53:11 +0200 Subject: [PATCH 238/636] firefox: update extensions option description --- modules/programs/firefox.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index cf62f82cd59b..1370d4c28f0d 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -683,6 +683,11 @@ in { Note that it is necessary to manually enable these extensions inside Firefox after the first installation. + + To automatically enable extensions add + `"extensions.autoDisableScopes" = 0;` + to + [{option}`programs.firefox.profiles..settings`](#opt-programs.firefox.profiles._name_.settings) ''; }; From ba97ffcfb2bd3ef026bb0a14d8808e9926f57fd7 Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Mon, 29 Apr 2024 20:07:27 +0200 Subject: [PATCH 239/636] Translate using Weblate (French) Currently translated at 100.0% (37 of 37 strings) Co-authored-by: Michael Thomas Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fr/ Translation: Home Manager/Home Manager CLI --- home-manager/po/fr.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/fr.po b/home-manager/po/fr.po index 1c9388eb0ba6..de1c061bf990 100644 --- a/home-manager/po/fr.po +++ b/home-manager/po/fr.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-03-04 06:44+0000\n" -"Last-Translator: Alexis Rossfelder \n" +"PO-Revision-Date: 2024-04-29 18:07+0000\n" +"Last-Translator: Michael Thomas \n" "Language-Team: French \n" "Language: fr\n" @@ -17,12 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 5.5-dev\n" +"X-Generator: Weblate 5.5.2\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s : argument manquant pour %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" From 7ec0ae18cda5e3aae80996d35f6d0ebd418f1ac8 Mon Sep 17 00:00:00 2001 From: Kento Okamoto Date: Mon, 29 Apr 2024 20:07:28 +0200 Subject: [PATCH 240/636] Translate using Weblate (Japanese) Currently translated at 89.1% (33 of 37 strings) Co-authored-by: Kento Okamoto Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ja/ Translation: Home Manager/Home Manager CLI --- home-manager/po/ja.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/ja.po b/home-manager/po/ja.po index 5d0d15d856fd..17af07a85ff4 100644 --- a/home-manager/po/ja.po +++ b/home-manager/po/ja.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-04-29 18:07+0000\n" +"Last-Translator: Kento Okamoto \n" "Language-Team: Japanese \n" "Language: ja\n" @@ -17,12 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.5.2\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: %s の引数がありません" #: home-manager/home-manager:64 msgid "No configuration file found at %s" From 1a91cb7cdbcf6b18c27bbead57241baf279d4513 Mon Sep 17 00:00:00 2001 From: Gabriel Birke Date: Mon, 29 Apr 2024 23:54:54 +0200 Subject: [PATCH 241/636] neomutt: allow binds to override vimKeys In the generated neomutt configuration, source the optional `vim-keys.rc` before applying the `binds` configuration, to allow the user to override keybindings from `vim-keys.rc`. Adapt the test files to account for the empty space left by the unset `vimKeys` option. --- modules/programs/neomutt.nix | 6 +++--- tests/modules/programs/neomutt/neomutt-expected.conf | 4 ++-- .../programs/neomutt/neomutt-not-primary-expected.conf | 4 ++-- .../programs/neomutt/neomutt-with-binds-expected.conf | 4 ++-- .../programs/neomutt/neomutt-with-imap-expected.conf | 4 ++-- .../neomutt/neomutt-with-imap-type-mailboxes-expected.conf | 4 ++-- .../neomutt/neomutt-with-named-mailboxes-expected.conf | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/programs/neomutt.nix b/modules/programs/neomutt.nix index 069c4de82fd8..588b801e4b21 100644 --- a/modules/programs/neomutt.nix +++ b/modules/programs/neomutt.nix @@ -457,15 +457,15 @@ in { set delete = yes + ${optionalString cfg.vimKeys + "source ${pkgs.neomutt}/share/doc/neomutt/vim-keys/vim-keys.rc"} + # Binds ${bindSection} # Macros ${macroSection} - ${optionalString cfg.vimKeys - "source ${pkgs.neomutt}/share/doc/neomutt/vim-keys/vim-keys.rc"} - # Register accounts ${ optionalString (accountCommandNeeded) '' diff --git a/tests/modules/programs/neomutt/neomutt-expected.conf b/tests/modules/programs/neomutt/neomutt-expected.conf index 94c13b29871d..2a45234dd936 100644 --- a/tests/modules/programs/neomutt/neomutt-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-expected.conf @@ -9,12 +9,12 @@ alternative_order text/enriched text/plain text set delete = yes -# Binds -# Macros +# Binds +# Macros # Register accounts diff --git a/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf b/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf index cffdace6f0fb..47dc8173989a 100644 --- a/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf @@ -9,12 +9,12 @@ alternative_order text/enriched text/plain text set delete = yes -# Binds -# Macros +# Binds +# Macros # Register accounts diff --git a/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf b/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf index 64ea68909d7d..05736749f973 100644 --- a/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf @@ -9,6 +9,8 @@ alternative_order text/enriched text/plain text set delete = yes + + # Binds bind editor "complete-query" bind index,pager \Cp "sidebar-prev" @@ -17,8 +19,6 @@ bind index,pager \Cp "sidebar-prev" macro index s "?" macro index,pager c "?^K=" - - # Register accounts # register account hm@example.com mailboxes "/home/hm-user/Mail/hm@example.com/Inbox" diff --git a/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf b/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf index 005fd5b03a81..02f03f6ec205 100644 --- a/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf @@ -9,12 +9,12 @@ alternative_order text/enriched text/plain text set delete = yes -# Binds -# Macros +# Binds +# Macros # Register accounts diff --git a/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf b/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf index c6838d4ccd31..51c6c6b9f3c8 100644 --- a/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-imap-type-mailboxes-expected.conf @@ -9,12 +9,12 @@ alternative_order text/enriched text/plain text set delete = yes -# Binds -# Macros +# Binds +# Macros # Register accounts diff --git a/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf b/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf index a166b355318c..605b5ed6def4 100644 --- a/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf @@ -9,12 +9,12 @@ alternative_order text/enriched text/plain text set delete = yes -# Binds -# Macros +# Binds +# Macros # Register accounts From 9fdd301a5e4d8cf4d4cf3f990e799000a54a3737 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 26 Apr 2024 21:31:43 -0500 Subject: [PATCH 242/636] lib/generators: toHyprconf init Create shared hyprlang generator for mainting Hyprland ecosystem. --- modules/lib/generators.nix | 43 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/modules/lib/generators.nix b/modules/lib/generators.nix index 9cb0e1cf9006..2aebd92c99c7 100644 --- a/modules/lib/generators.nix +++ b/modules/lib/generators.nix @@ -1,6 +1,49 @@ { lib }: { + toHyprconf = { attrs, indentLevel ? 0, importantPrefixes ? [ "$" ], }: + let + inherit (lib) + all concatMapStringsSep concatStrings concatStringsSep filterAttrs foldl + generators hasPrefix isAttrs isList mapAttrsToList replicate; + + initialIndent = concatStrings (replicate indentLevel " "); + + toHyprconf' = indent: attrs: + let + sections = + filterAttrs (n: v: isAttrs v || (isList v && all isAttrs v)) attrs; + + mkSection = n: attrs: + if lib.isList attrs then + (concatMapStringsSep "\n" (a: mkSection n a) attrs) + else '' + ${indent}${n} { + ${toHyprconf' " ${indent}" attrs}${indent}} + ''; + + mkFields = generators.toKeyValue { + listsAsDuplicateKeys = true; + inherit indent; + }; + + allFields = + filterAttrs (n: v: !(isAttrs v || (isList v && all isAttrs v))) + attrs; + + isImportantField = n: _: + foldl (acc: prev: if hasPrefix prev n then true else acc) false + importantPrefixes; + + importantFields = filterAttrs isImportantField allFields; + + fields = builtins.removeAttrs allFields + (mapAttrsToList (n: _: n) importantFields); + in mkFields importantFields + + concatStringsSep "\n" (mapAttrsToList mkSection sections) + + mkFields fields; + in toHyprconf' initialIndent attrs; + toKDL = { }: let inherit (lib) concatStringsSep splitString mapAttrsToList any; From 4fe1f064bd1a37754266eb4c190eac784ca4aaa9 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 26 Apr 2024 21:32:08 -0500 Subject: [PATCH 243/636] hyprland: use lib.generators.toHyprconf --- modules/services/window-managers/hyprland.nix | 82 ++++++----------- .../window-managers/hyprland/default.nix | 2 + .../hyprland/multiple-devices-config.conf | 60 +++++++++++++ .../hyprland/multiple-devices-config.nix | 88 +++++++++++++++++++ .../hyprland/simple-config.conf | 9 +- .../hyprland/sourceFirst-false-config.conf | 13 +++ .../hyprland/sourceFirst-false-config.nix | 34 +++++++ 7 files changed, 229 insertions(+), 59 deletions(-) create mode 100644 tests/modules/services/window-managers/hyprland/multiple-devices-config.conf create mode 100644 tests/modules/services/window-managers/hyprland/multiple-devices-config.nix create mode 100644 tests/modules/services/window-managers/hyprland/sourceFirst-false-config.conf create mode 100644 tests/modules/services/window-managers/hyprland/sourceFirst-false-config.nix diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index 4401998f680e..4f1c9e929e9d 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -9,7 +9,6 @@ let systemdActivation = '' exec-once = ${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables} ${extraCommands} ''; - in { meta.maintainers = [ lib.maintainers.fufexan ]; @@ -178,6 +177,16 @@ in { '' // { default = true; }; + + importantPrefixes = lib.mkOption { + type = with lib.types; listOf str; + default = [ "$" "bezier" "name" ] + ++ lib.optionals cfg.sourceFirst [ "source" ]; + example = [ "$" "bezier" ]; + description = '' + List of prefix of attributes to source at the top of the config. + ''; + }; }; config = lib.mkIf cfg.enable { @@ -199,65 +208,28 @@ in { shouldGenerate = cfg.systemd.enable || cfg.extraConfig != "" || cfg.settings != { } || cfg.plugins != [ ]; - toHyprconf = with lib; - attrs: indentLevel: - let - indent = concatStrings (replicate indentLevel " "); - - sections = filterAttrs (n: v: isAttrs v && n != "device") attrs; - - mkSection = n: attrs: '' - ${indent}${n} { - ${toHyprconf attrs (indentLevel + 1)}${indent}} - ''; - - mkDeviceCategory = device: '' - ${indent}device { - name=${device.name} - ${ - toHyprconf (filterAttrs (n: _: "name" != n) device) - (indentLevel + 1) - }${indent}} - ''; - - deviceCategory = lib.optionalString (hasAttr "device" attrs) - (if isList attrs.device then - (concatMapStringsSep "\n" (d: mkDeviceCategory d) attrs.device) - else - mkDeviceCategory attrs.device); - - mkFields = generators.toKeyValue { - listsAsDuplicateKeys = true; - inherit indent; - }; - allFields = filterAttrs (n: v: !(isAttrs v) && n != "device") attrs; - - importantFields = filterAttrs (n: _: - (hasPrefix "$" n) || (hasPrefix "bezier" n) - || (cfg.sourceFirst && (hasPrefix "source" n))) allFields; - - fields = builtins.removeAttrs allFields - (mapAttrsToList (n: _: n) importantFields); - in mkFields importantFields + deviceCategory - + concatStringsSep "\n" (mapAttrsToList mkSection sections) - + mkFields fields; - pluginsToHyprconf = plugins: - toHyprconf { - plugin = let - mkEntry = entry: - if lib.types.package.check entry then - "${entry}/lib/lib${entry.pname}.so" - else - entry; - in map mkEntry cfg.plugins; - } 0; + lib.hm.generators.toHyprconf { + attrs = { + plugin = let + mkEntry = entry: + if lib.types.package.check entry then + "${entry}/lib/lib${entry.pname}.so" + else + entry; + in map mkEntry cfg.plugins; + }; + inherit (cfg) importantPrefixes; + }; in lib.mkIf shouldGenerate { text = lib.optionalString cfg.systemd.enable systemdActivation + lib.optionalString (cfg.plugins != [ ]) (pluginsToHyprconf cfg.plugins) - + lib.optionalString (cfg.settings != { }) (toHyprconf cfg.settings 0) - + lib.optionalString (cfg.extraConfig != "") cfg.extraConfig; + + lib.optionalString (cfg.settings != { }) + (lib.hm.generators.toHyprconf { + attrs = cfg.settings; + inherit (cfg) importantPrefixes; + }) + lib.optionalString (cfg.extraConfig != "") cfg.extraConfig; onChange = lib.mkIf (cfg.package != null) '' ( # Execute in subshell so we don't poision environment with vars diff --git a/tests/modules/services/window-managers/hyprland/default.nix b/tests/modules/services/window-managers/hyprland/default.nix index 96cae5e453ea..ae431939cfa0 100644 --- a/tests/modules/services/window-managers/hyprland/default.nix +++ b/tests/modules/services/window-managers/hyprland/default.nix @@ -1,4 +1,6 @@ { hyprland-simple-config = ./simple-config.nix; + hyprland-multiple-devices-config = ./multiple-devices-config.nix; + hyprland-sourceFirst-false-config = ./sourceFirst-false-config.nix; hyprland-inconsistent-config = ./inconsistent-config.nix; } diff --git a/tests/modules/services/window-managers/hyprland/multiple-devices-config.conf b/tests/modules/services/window-managers/hyprland/multiple-devices-config.conf new file mode 100644 index 000000000000..5d9102973a20 --- /dev/null +++ b/tests/modules/services/window-managers/hyprland/multiple-devices-config.conf @@ -0,0 +1,60 @@ +exec-once = /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY HYPRLAND_INSTANCE_SIGNATURE WAYLAND_DISPLAY XDG_CURRENT_DESKTOP && systemctl --user stop hyprland-session.target && systemctl --user start hyprland-session.target +plugin=/path/to/plugin1 +plugin=/nix/store/00000000000000000000000000000000-foo/lib/libfoo.so +$mod=SUPER +bezier=smoothOut, 0.36, 0, 0.66, -0.56 +bezier=smoothIn, 0.25, 1, 0.5, 1 +bezier=overshot, 0.4,0.8,0.2,1.2 +source=sourced.conf +animations { + animation=border, 1, 2, smoothIn + animation=fade, 1, 4, smoothOut + animation=windows, 1, 3, overshot, popin 80% + enabled=true +} + +decoration { + col.shadow=rgba(00000099) + shadow_offset=0 5 +} + +device { + name=some:device + enable=true +} + +device { + name=some:device-secondary + enable=true +} + +input { + touchpad { + scroll_factor=0.300000 + } + accel_profile=flat + follow_mouse=1 + kb_layout=ro +} + +plugin { + plugin1 { + section { + other=dummy setting + } + dummy=plugin setting + } +} +bindm=$mod, mouse:272, movewindow +bindm=$mod, mouse:273, resizewindow +bindm=$mod ALT, mouse:272, resizewindow +# window resize +bind = $mod, S, submap, resize + +submap = resize +binde = , right, resizeactive, 10 0 +binde = , left, resizeactive, -10 0 +binde = , up, resizeactive, 0 -10 +binde = , down, resizeactive, 0 10 +bind = , escape, submap, reset +submap = reset diff --git a/tests/modules/services/window-managers/hyprland/multiple-devices-config.nix b/tests/modules/services/window-managers/hyprland/multiple-devices-config.nix new file mode 100644 index 000000000000..86d60c63291e --- /dev/null +++ b/tests/modules/services/window-managers/hyprland/multiple-devices-config.nix @@ -0,0 +1,88 @@ +{ config, lib, ... }: + +{ + wayland.windowManager.hyprland = { + enable = true; + package = lib.makeOverridable + (attrs: config.lib.test.mkStubPackage { name = "hyprland"; }) { }; + plugins = + [ "/path/to/plugin1" (config.lib.test.mkStubPackage { name = "foo"; }) ]; + settings = { + source = [ "sourced.conf" ]; + + decoration = { + shadow_offset = "0 5"; + "col.shadow" = "rgba(00000099)"; + }; + + "$mod" = "SUPER"; + + animations = { + enabled = true; + animation = [ + "border, 1, 2, smoothIn" + "fade, 1, 4, smoothOut" + "windows, 1, 3, overshot, popin 80%" + ]; + }; + + bezier = [ + "smoothOut, 0.36, 0, 0.66, -0.56" + "smoothIn, 0.25, 1, 0.5, 1" + "overshot, 0.4,0.8,0.2,1.2" + ]; + + input = { + kb_layout = "ro"; + follow_mouse = 1; + accel_profile = "flat"; + touchpad = { scroll_factor = 0.3; }; + }; + + bindm = [ + # mouse movements + "$mod, mouse:272, movewindow" + "$mod, mouse:273, resizewindow" + "$mod ALT, mouse:272, resizewindow" + ]; + + device = [ + { + name = "some:device"; + enable = true; + } + { + name = "some:device-secondary"; + enable = true; + } + ]; + + plugin = { + plugin1 = { + dummy = "plugin setting"; + section = { other = "dummy setting"; }; + }; + }; + }; + extraConfig = '' + # window resize + bind = $mod, S, submap, resize + + submap = resize + binde = , right, resizeactive, 10 0 + binde = , left, resizeactive, -10 0 + binde = , up, resizeactive, 0 -10 + binde = , down, resizeactive, 0 10 + bind = , escape, submap, reset + submap = reset + ''; + }; + + nmt.script = '' + config=home-files/.config/hypr/hyprland.conf + assertFileExists "$config" + + normalizedConfig=$(normalizeStorePaths "$config") + assertFileContent "$normalizedConfig" ${./multiple-devices-config.conf} + ''; +} diff --git a/tests/modules/services/window-managers/hyprland/simple-config.conf b/tests/modules/services/window-managers/hyprland/simple-config.conf index 9b15ba32a941..29dcd7cd8c29 100644 --- a/tests/modules/services/window-managers/hyprland/simple-config.conf +++ b/tests/modules/services/window-managers/hyprland/simple-config.conf @@ -6,10 +6,6 @@ bezier=smoothOut, 0.36, 0, 0.66, -0.56 bezier=smoothIn, 0.25, 1, 0.5, 1 bezier=overshot, 0.4,0.8,0.2,1.2 source=sourced.conf -device { - name=some:device - enable=true -} animations { animation=border, 1, 2, smoothIn animation=fade, 1, 4, smoothOut @@ -22,6 +18,11 @@ decoration { shadow_offset=0 5 } +device { + name=some:device + enable=true +} + input { touchpad { scroll_factor=0.300000 diff --git a/tests/modules/services/window-managers/hyprland/sourceFirst-false-config.conf b/tests/modules/services/window-managers/hyprland/sourceFirst-false-config.conf new file mode 100644 index 000000000000..3dc8c39c0add --- /dev/null +++ b/tests/modules/services/window-managers/hyprland/sourceFirst-false-config.conf @@ -0,0 +1,13 @@ +exec-once = /nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY HYPRLAND_INSTANCE_SIGNATURE WAYLAND_DISPLAY XDG_CURRENT_DESKTOP && systemctl --user stop hyprland-session.target && systemctl --user start hyprland-session.target +bezier=smoothOut, 0.36, 0, 0.66, -0.56 +bezier=smoothIn, 0.25, 1, 0.5, 1 +bezier=overshot, 0.4,0.8,0.2,1.2 +input { + touchpad { + scroll_factor=0.300000 + } + accel_profile=flat + follow_mouse=1 + kb_layout=ro +} +source=sourced.conf diff --git a/tests/modules/services/window-managers/hyprland/sourceFirst-false-config.nix b/tests/modules/services/window-managers/hyprland/sourceFirst-false-config.nix new file mode 100644 index 000000000000..4161cd7515f8 --- /dev/null +++ b/tests/modules/services/window-managers/hyprland/sourceFirst-false-config.nix @@ -0,0 +1,34 @@ +{ config, lib, ... }: + +{ + wayland.windowManager.hyprland = { + enable = true; + package = lib.makeOverridable + (attrs: config.lib.test.mkStubPackage { name = "hyprland"; }) { }; + settings = { + source = [ "sourced.conf" ]; + + bezier = [ + "smoothOut, 0.36, 0, 0.66, -0.56" + "smoothIn, 0.25, 1, 0.5, 1" + "overshot, 0.4,0.8,0.2,1.2" + ]; + + input = { + kb_layout = "ro"; + follow_mouse = 1; + accel_profile = "flat"; + touchpad = { scroll_factor = 0.3; }; + }; + }; + sourceFirst = false; + }; + + nmt.script = '' + config=home-files/.config/hypr/hyprland.conf + assertFileExists "$config" + + normalizedConfig=$(normalizeStorePaths "$config") + assertFileContent "$normalizedConfig" ${./sourceFirst-false-config.conf} + ''; +} From 0125041fc9ca3127fe95cf53f15c49c482ebaf70 Mon Sep 17 00:00:00 2001 From: Yomi Ikuru Date: Sat, 27 Apr 2024 16:04:12 +0100 Subject: [PATCH 244/636] maintainers: add abayomi185 as maintainer --- modules/lib/maintainers.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index f3dd83fe58cc..28327916cf11 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -7,6 +7,12 @@ # [1] https://github.com/NixOS/nixpkgs/blob/fca0d6e093c82b31103dc0dacc48da2a9b06e24b/maintainers/maintainer-list.nix#LC1 { + abayomi185 = { + name = "Yomi"; + email = "yomi+nix@yomitosh.com"; + github = "abayomi185"; + githubId = 21103047; + }; amesgen = { name = "amesgen"; email = "amesgen@amesgen.de"; From 563265988637c27ba3abe39acb9be3ba2cb35a29 Mon Sep 17 00:00:00 2001 From: Yomi Ikuru Date: Sat, 27 Apr 2024 16:03:11 +0100 Subject: [PATCH 245/636] swaync: add module Co-authored-by: Ryan Horiguchi --- modules/misc/news.nix | 12 +++ modules/modules.nix | 1 + modules/services/swaync.nix | 113 ++++++++++++++++++++++ tests/default.nix | 1 + tests/modules/services/swaync/default.nix | 1 + tests/modules/services/swaync/swaync.nix | 35 +++++++ 6 files changed, 163 insertions(+) create mode 100644 modules/services/swaync.nix create mode 100644 tests/modules/services/swaync/default.nix create mode 100644 tests/modules/services/swaync/swaync.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index f8617f54a994..b13a9d33dc69 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1549,6 +1549,18 @@ in { your physical disc (HDD/SSD). ''; } + + { + time = "2024-04-29T22:01:51+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.swaync'. + + SwayNotificationCenter is a simple notification daemon with a GTK GUI + for notifications and the control center. See + https://github.com/ErikReider/SwayNotificationCenter for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index b1e8b9b42e50..d526c35259cf 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -355,6 +355,7 @@ let ./services/stalonetray.nix ./services/status-notifier-watcher.nix ./services/swayidle.nix + ./services/swaync.nix ./services/swayosd.nix ./services/sxhkd.nix ./services/syncthing.nix diff --git a/modules/services/swaync.nix b/modules/services/swaync.nix new file mode 100644 index 000000000000..bb1f9d57cccd --- /dev/null +++ b/modules/services/swaync.nix @@ -0,0 +1,113 @@ +{ pkgs, lib, config, ... }: + +let + + cfg = config.services.swaync; + + jsonFormat = pkgs.formats.json { }; + +in { + meta.maintainers = [ lib.hm.maintainers.abayomi185 ]; + + options.services.swaync = { + enable = lib.mkEnableOption "Swaync notification daemon"; + + package = lib.mkPackageOption pkgs "swaynotificationcenter" { }; + + style = lib.mkOption { + type = lib.types.nullOr (lib.types.either lib.types.path lib.types.lines); + default = null; + example = '' + .notification-row { + outline: none; + } + + .notification-row:focus, + .notification-row:hover { + background: @noti-bg-focus; + } + + .notification { + border-radius: 12px; + margin: 6px 12px; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.3), 0 1px 3px 1px rgba(0, 0, 0, 0.7), + 0 2px 6px 2px rgba(0, 0, 0, 0.3); + padding: 0; + } + ''; + description = '' + CSS style of the bar. See + + for the documentation. + + If the value is set to a path literal, then the path will be used as the CSS file. + ''; + }; + + settings = lib.mkOption { + type = jsonFormat.type; + default = { }; + example = lib.literalExpression '' + { + positionX = "right"; + positionY = "top"; + layer = "overlay"; + control-center-layer = "top"; + layer-shell = true; + cssPriority = "application"; + control-center-margin-top = 0; + control-center-margin-bottom = 0; + control-center-margin-right = 0; + control-center-margin-left = 0; + notification-2fa-action = true; + notification-inline-replies = false; + notification-icon-size = 64; + notification-body-image-height = 100; + notification-body-image-width = 200 + }; + ''; + description = '' + Configuration written to {file}`$XDG_CONFIG_HOME/swaync/config.json`. + See + + for the documentation. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + # at-spi2-core is to minimize journalctl noise of: + # "AT-SPI: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files" + home.packages = [ cfg.package pkgs.at-spi2-core ]; + + xdg.configFile = { + "swaync/config.json".source = + jsonFormat.generate "config.json" cfg.settings; + "swaync/style.css" = lib.mkIf (cfg.style != null) { + source = if lib.isStorePath cfg.style then + cfg.style + else + pkgs.writeText "swaync/style.css" cfg.style; + }; + }; + + systemd.user.services.swaync = { + Unit = { + Description = "Swaync notification daemon"; + Documentation = "https://github.com/ErikReider/SwayNotificationCenter"; + PartOf = [ "graphical-session.target" ]; + After = [ "graphical-session-pre.target" ]; + ConditionEnvironment = "WAYLAND_DISPLAY"; + }; + + Service = { + Type = "dbus"; + BusName = "org.freedesktop.Notifications"; + ExecStart = "${cfg.package}/bin/swaync"; + Restart = "on-failure"; + }; + + Install.WantedBy = [ "graphical-session.target" ]; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 4b7b6ebf660e..15a54f08be65 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -260,6 +260,7 @@ in import nmtSrc { ./modules/services/screen-locker ./modules/services/signaturepdf ./modules/services/swayidle + ./modules/services/swaync ./modules/services/swayosd ./modules/services/sxhkd ./modules/services/syncthing/linux diff --git a/tests/modules/services/swaync/default.nix b/tests/modules/services/swaync/default.nix new file mode 100644 index 000000000000..d5682daa3ecd --- /dev/null +++ b/tests/modules/services/swaync/default.nix @@ -0,0 +1 @@ +{ swaync = ./swaync.nix; } diff --git a/tests/modules/services/swaync/swaync.nix b/tests/modules/services/swaync/swaync.nix new file mode 100644 index 000000000000..ceb3bf065017 --- /dev/null +++ b/tests/modules/services/swaync/swaync.nix @@ -0,0 +1,35 @@ +{ config, ... }: + +{ + services.swaync = { + enable = true; + package = config.lib.test.mkStubPackage { + name = "swaync"; + outPath = "@swaync@"; + }; + }; + + nmt.script = '' + assertFileContent \ + home-files/.config/systemd/user/swaync.service \ + ${ + builtins.toFile "swaync.service" '' + [Install] + WantedBy=graphical-session.target + + [Service] + BusName=org.freedesktop.Notifications + ExecStart=@swaync@/bin/swaync + Restart=on-failure + Type=dbus + + [Unit] + After=graphical-session-pre.target + ConditionEnvironment=WAYLAND_DISPLAY + Description=Swaync notification daemon + Documentation=https://github.com/ErikReider/SwayNotificationCenter + PartOf=graphical-session.target + '' + } + ''; +} From f8e6694edabe4aaa7a85aac47b43ea5d978b116d Mon Sep 17 00:00:00 2001 From: Lichthagel Date: Mon, 29 Apr 2024 23:13:35 +0200 Subject: [PATCH 246/636] files: make collision error message more helpful Most importantly, also indicate how to use file backup for NixOS and nix-darwin modules. --- modules/files/check-link-targets.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/files/check-link-targets.sh b/modules/files/check-link-targets.sh index c3200d336fb6..215ff6c3703b 100644 --- a/modules/files/check-link-targets.sh +++ b/modules/files/check-link-targets.sh @@ -48,6 +48,12 @@ for sourcePath in "$@" ; do done if [[ -v collision ]] ; then - errorEcho "Please move the above files and try again or use 'home-manager switch -b backup' to back up existing files automatically." + errorEcho "Please do one of the following: +- Move or remove the above files and try again. +- In standalone mode, use 'home-manager switch -b backup' to back up + files automatically. +- When used as a NixOS or nix-darwin module, set + 'home-manager.backupFileExtension' + to, for example, 'backup' and rebuild." exit 1 fi From 3c0df2a7e43b432b739d8e9d289dcb362a44b308 Mon Sep 17 00:00:00 2001 From: Vonixxx Date: Sun, 21 Apr 2024 13:12:43 +0200 Subject: [PATCH 247/636] freetube: add module --- modules/misc/news.nix | 11 ++++ modules/modules.nix | 1 + modules/programs/freetube.nix | 60 +++++++++++++++++++ tests/default.nix | 1 + .../programs/freetube/basic-configuration.db | 8 +++ .../programs/freetube/basic-configuration.nix | 30 ++++++++++ tests/modules/programs/freetube/default.nix | 1 + 7 files changed, 112 insertions(+) create mode 100644 modules/programs/freetube.nix create mode 100644 tests/modules/programs/freetube/basic-configuration.db create mode 100644 tests/modules/programs/freetube/basic-configuration.nix create mode 100644 tests/modules/programs/freetube/default.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index b13a9d33dc69..b189fb0087bd 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1561,6 +1561,17 @@ in { https://github.com/ErikReider/SwayNotificationCenter for more. ''; } + + { + time = "2024-04-30T18:28:28+00:00"; + message = '' + A new module is available: 'programs.freetube'. + + FreeTube is a YouTube client built around using YouTube more + privately. You can enjoy your favorite content and creators without + your habits being tracked. See https://freetubeapp.io/ for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index d526c35259cf..e14c26d522ab 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -92,6 +92,7 @@ let ./programs/firefox.nix ./programs/fish.nix ./programs/foot.nix + ./programs/freetube.nix ./programs/fuzzel.nix ./programs/fzf.nix ./programs/gallery-dl.nix diff --git a/modules/programs/freetube.nix b/modules/programs/freetube.nix new file mode 100644 index 000000000000..77700fe555ac --- /dev/null +++ b/modules/programs/freetube.nix @@ -0,0 +1,60 @@ +{ lib, pkgs, config, ... }: + +let + inherit (lib) + concatStringsSep mapAttrsToList mkIf mkEnableOption mkPackageOption mkOption + literalExpression; + + cfg = config.programs.freetube; + + settings = settings: + let + convertSetting = name: value: + builtins.toJSON { + "_id" = name; + "value" = value; + }; + in concatStringsSep "\n" (mapAttrsToList convertSetting settings) + "\n"; +in { + meta.maintainers = with lib.maintainers; [ vonixxx ]; + + options.programs.freetube = { + enable = mkEnableOption "FreeTube, a YT client for Windows, Mac, and Linux"; + + package = mkPackageOption pkgs "freetube" { }; + + settings = mkOption { + type = lib.types.attrs; + default = { }; + example = literalExpression '' + { + allowDashAv1Formats = true; + checkForUpdates = false; + defaultQuality = "1080"; + baseTheme = "catppuccinMocha"; + } + ''; + description = '' + Configuration settings for FreeTube. + + All configurable options can be deduced by enabling them through the + GUI and observing the changes in {file}`settings.db`. + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + + xdg.configFile."FreeTube/hm_settings.db" = { + source = pkgs.writeText "hm_settings.db" (settings cfg.settings); + + onChange = let + hmSettingsDb = "${config.xdg.configHome}/FreeTube/hm_settings.db"; + settingsDb = "${config.xdg.configHome}/FreeTube/settings.db"; + in '' + run install -Dm644 $VERBOSE_ARG '${hmSettingsDb}' '${settingsDb}' + ''; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 15a54f08be65..7f92c2bd37f6 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -190,6 +190,7 @@ in import nmtSrc { ./modules/programs/boxxy ./modules/programs/firefox ./modules/programs/foot + ./modules/programs/freetube ./modules/programs/fuzzel ./modules/programs/getmail ./modules/programs/gnome-terminal diff --git a/tests/modules/programs/freetube/basic-configuration.db b/tests/modules/programs/freetube/basic-configuration.db new file mode 100644 index 000000000000..50d43a11497a --- /dev/null +++ b/tests/modules/programs/freetube/basic-configuration.db @@ -0,0 +1,8 @@ +{"_id":"allowDashAv1Formats","value":true} +{"_id":"checkForBlogPosts","value":false} +{"_id":"checkForUpdates","value":false} +{"_id":"commentAutoLoadEnabled","value":true} +{"_id":"defaultQuality","value":"1080"} +{"_id":"hideHeaderLogo","value":true} +{"_id":"listType","value":"list"} +{"_id":"useRssFeeds","value":true} diff --git a/tests/modules/programs/freetube/basic-configuration.nix b/tests/modules/programs/freetube/basic-configuration.nix new file mode 100644 index 000000000000..a30d3bed462b --- /dev/null +++ b/tests/modules/programs/freetube/basic-configuration.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: + +{ + programs.freetube = { + enable = true; + settings = { + useRssFeeds = true; + hideHeaderLogo = true; + allowDashAv1Formats = true; + commentAutoLoadEnabled = true; + + checkForUpdates = false; + checkForBlogPosts = false; + + listType = "list"; + defaultQuality = "1080"; + }; + }; + + test.stubs.freetube = { }; + + nmt.script = '' + assertFileExists home-files/.config/FreeTube/hm_settings.db + assertFileContent home-files/.config/FreeTube/hm_settings.db \ + ${./basic-configuration.db} + + assertFileContains activate \ + "install -Dm644 \$VERBOSE_ARG '/home/hm-user/.config/FreeTube/hm_settings.db' '/home/hm-user/.config/FreeTube/settings.db'" + ''; +} diff --git a/tests/modules/programs/freetube/default.nix b/tests/modules/programs/freetube/default.nix new file mode 100644 index 000000000000..cb6fd4d2f915 --- /dev/null +++ b/tests/modules/programs/freetube/default.nix @@ -0,0 +1 @@ +{ freetube-basic-configuration = ./basic-configuration.nix; } From 28ef93bb8e5208ae4230f59efe7b96e115e5ddd2 Mon Sep 17 00:00:00 2001 From: Kaleo Date: Wed, 27 Dec 2023 19:57:51 +0800 Subject: [PATCH 248/636] maintainers: add kaleocheng --- modules/lib/maintainers.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 28327916cf11..1e988cc2ea6f 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -119,6 +119,12 @@ github = "JustinLovinger"; githubId = 7183441; }; + kaleo = { + name = "Kaleo Cheng"; + email = "kaleocheng@gmail.com"; + github = "kaleocheng"; + githubId = 7939352; + }; owm111 = { email = "7798336+owm111@users.noreply.github.com"; name = "Owen McGrath"; From 6d3b6dc9222c12b951169becdf4b0592ee9576ef Mon Sep 17 00:00:00 2001 From: Kaleo Date: Wed, 27 Dec 2023 20:00:49 +0800 Subject: [PATCH 249/636] conky: add module --- modules/misc/news.nix | 12 +++++ modules/modules.nix | 1 + modules/services/conky.nix | 53 +++++++++++++++++++ tests/default.nix | 1 + .../services/conky/basic-configuration.conf | 7 +++ .../services/conky/basic-configuration.nix | 30 +++++++++++ tests/modules/services/conky/default.nix | 1 + 7 files changed, 105 insertions(+) create mode 100644 modules/services/conky.nix create mode 100644 tests/modules/services/conky/basic-configuration.conf create mode 100644 tests/modules/services/conky/basic-configuration.nix create mode 100644 tests/modules/services/conky/default.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index b189fb0087bd..92d3e9f5477b 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1572,6 +1572,18 @@ in { your habits being tracked. See https://freetubeapp.io/ for more. ''; } + + { + time = "2024-04-30T21:57:23+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.conky'. + + Conky is a system monitor for X. Conky can display just about + anything, either on your root desktop or in its own window. See + https://conky.cc/ for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index e14c26d522ab..7c81102a9820 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -279,6 +279,7 @@ let ./services/clipman.nix ./services/clipmenu.nix ./services/comodoro.nix + ./services/conky.nix ./services/copyq.nix ./services/darkman.nix ./services/devilspie2.nix diff --git a/modules/services/conky.nix b/modules/services/conky.nix new file mode 100644 index 000000000000..bf7eeea8b296 --- /dev/null +++ b/modules/services/conky.nix @@ -0,0 +1,53 @@ +{ config, lib, pkgs, ... }: + +let + + cfg = config.services.conky; + +in with lib; { + meta.maintainers = [ hm.maintainers.kaleo ]; + + options = { + services.conky = { + enable = mkEnableOption "Conky, a light-weight system monitor"; + + package = mkPackageOption pkgs "conky" { }; + + extraConfig = lib.mkOption { + type = types.lines; + default = ""; + description = '' + Configuration used by the Conky daemon. Check + for + options. If not set, the default configuration, as described by + {command}`conky --print-config`, will be used. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + assertions = + [ (hm.assertions.assertPlatform "services.conky" pkgs platforms.linux) ]; + + home.packages = [ cfg.package ]; + + systemd.user.services.conky = { + Unit = { + Description = "Conky - Lightweight system monitor"; + After = [ "graphical-session.target" ]; + }; + + Service = { + Restart = "always"; + RestartSec = "3"; + ExecStart = toString ([ "${pkgs.conky}/bin/conky" ] + ++ optional (cfg.extraConfig != "") + "--config ${pkgs.writeText "conky.conf" cfg.extraConfig}"); + }; + + Install.WantedBy = [ "graphical-session.target" ]; + }; + }; +} + diff --git a/tests/default.nix b/tests/default.nix index 7f92c2bd37f6..7b714581d593 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -225,6 +225,7 @@ in import nmtSrc { ./modules/services/cliphist ./modules/services/clipman ./modules/services/comodoro + ./modules/services/conky ./modules/services/darkman ./modules/services/devilspie2 ./modules/services/dropbox diff --git a/tests/modules/services/conky/basic-configuration.conf b/tests/modules/services/conky/basic-configuration.conf new file mode 100644 index 000000000000..010eac3741b8 --- /dev/null +++ b/tests/modules/services/conky/basic-configuration.conf @@ -0,0 +1,7 @@ +conky.text = [[ + S Y S T E M I N F O + $hr + Host:$alignr $nodename + Uptime:$alignr $uptime + RAM:$alignr $mem/$memmax +]] diff --git a/tests/modules/services/conky/basic-configuration.nix b/tests/modules/services/conky/basic-configuration.nix new file mode 100644 index 000000000000..479a19239320 --- /dev/null +++ b/tests/modules/services/conky/basic-configuration.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: + +{ + services.conky = { + enable = true; + extraConfig = '' + conky.text = [[ + S Y S T E M I N F O + $hr + Host:$alignr $nodename + Uptime:$alignr $uptime + RAM:$alignr $mem/$memmax + ]] + ''; + }; + + test.stubs.conky = { }; + + nmt.script = '' + serviceFile="$TESTED/home-files/.config/systemd/user/conky.service" + + assertFileExists $serviceFile + assertFileRegex "$serviceFile" \ + 'ExecStart=@conky@/bin/conky --config .*conky.conf' + + configFile="$(grep -o '/nix.*conky.conf' "$serviceFile")" + assertFileContent "$configFile" \ + ${./basic-configuration.conf} + ''; +} diff --git a/tests/modules/services/conky/default.nix b/tests/modules/services/conky/default.nix new file mode 100644 index 000000000000..e4ca38e06764 --- /dev/null +++ b/tests/modules/services/conky/default.nix @@ -0,0 +1 @@ +{ conky-basic-configuration = ./basic-configuration.nix; } From 67d0e7db8827abc3634c02de62f3e651a0c92d8c Mon Sep 17 00:00:00 2001 From: Keivan Date: Thu, 2 May 2024 12:58:30 +0200 Subject: [PATCH 250/636] Translate using Weblate (Persian) Currently translated at 11.1% (2 of 18 strings) Translate using Weblate (Persian) Currently translated at 100.0% (37 of 37 strings) Co-authored-by: Keivan Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fa/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/fa/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules --- home-manager/po/fa.po | 97 ++++++++++++++++++++++++++++++------------- modules/po/fa.po | 13 +++--- 2 files changed, 75 insertions(+), 35 deletions(-) diff --git a/home-manager/po/fa.po b/home-manager/po/fa.po index e4255a17e49a..b3aceeb1a331 100644 --- a/home-manager/po/fa.po +++ b/home-manager/po/fa.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2023-05-28 22:49+0000\n" -"Last-Translator: Mohammad Abdolirad \n" +"PO-Revision-Date: 2024-05-02 10:58+0000\n" +"Last-Translator: Keivan \n" "Language-Team: Persian \n" "Language: fa\n" @@ -17,16 +17,16 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.18-dev\n" +"X-Generator: Weblate 5.5.3-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: مقدار %s یافت نشد" #: home-manager/home-manager:64 msgid "No configuration file found at %s" -msgstr "هیچ فایل تنظیماتی در %s پیدا نشد" +msgstr "هیچ فایل تنظیماتی در %s یافت نشد" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. @@ -36,6 +36,8 @@ msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" +"نگه داری %s در %s منسوخ شده است.\n" +"لطفا آنرا به %s انتفال دهید" #: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" @@ -43,7 +45,7 @@ msgstr "هیچ فایل تنظیماتی پیدا نشد. لطفا یک فایل #: home-manager/home-manager:107 msgid "Home Manager not found at %s." -msgstr "" +msgstr "Home manager در %s یافت نشد." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:115 @@ -51,6 +53,8 @@ msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" +"مسیر زاپاس برای Home manager در %s منسوخ شده است اما یک فایل/دایرکتوری در " +"این مسیر پیدا شد." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:118 @@ -73,28 +77,46 @@ msgid "" "\n" " $ rm -r \"%s\"" msgstr "" +"برای از بین بردن این اخطار, یکی از کار های زیر را انجام دهید.\n" +"\n" +"1. مسیر Home Manager را به صورت دقیق با اضافه کردن خط زیر\n" +"\n" +" { programs.home-manager.path = \"%s\"; }\n" +"\n" +"به کانفیگ خود, تعریف کنید\n" +"\n" +"اگر Home Manager را به طور مستقیم import کرده اید, میتوانید از پارامتر `path`" +" استفاده کنید\n" +"\n" +" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" +"\n" +"برای هنگامی که دارید پکیج Home Manager را صدا میزنید\n" +"\n" +"2. مسیر منسوخ شده را پاک کنید\n" +"\n" +" $ rm -r \"%s\"" #: home-manager/home-manager:146 msgid "Sanity checking Nix" -msgstr "" +msgstr "چک کردن پایداری Nix" #: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" -msgstr "" +msgstr "بعد از امتحان کردن %s و %s , دایرکتوری مناسب برای پروفایل یافت نشد" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" -msgstr "" +msgstr "عدم امکان بررسی گزینه‌های تنظیمات Flake" #: home-manager/home-manager:296 home-manager/home-manager:319 #: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" -msgstr "" +msgstr "%s: آپشن مورد نظر شما یافت نشد %s" #: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" -msgstr "" +msgstr "%s --help برای دیدن راهنمایی دستور رو به رو را اجرا کنید" #: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." @@ -102,11 +124,11 @@ msgstr "فایل %s از قبل وجود داشته است، بدون تغییر #: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." -msgstr "ساختن %s..." +msgstr "درحال ساختن %s..." #: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." -msgstr "" +msgstr "در حال ساخت نسخه اولیه Home Manager." #. translators: The "%s" specifier will be replaced by a file path. #: home-manager/home-manager:480 @@ -118,6 +140,12 @@ msgid "" "to configure Home Manager. Run 'man home-configuration.nix' to\n" "see all available options." msgstr "" +"پایان! ابزار home-manager نصب شده است و شما میتوانید با تغییر دادن فایل\n" +"\n" +" %s\n" +"\n" +"تنظیمات Home Manager خود را تغییر دهید. برای دیدن همه ی تنظیمات موجود\n" +"دستور 'man home-configuration.nix' را اجرا کنید." #. translators: The "%s" specifier will be replaced by a URL. #: home-manager/home-manager:485 @@ -128,11 +156,17 @@ msgid "" "\n" "if the error seems to be the fault of Home Manager." msgstr "" +"ای بابا, فرایند نصب با شکست مواجه شد! اگر بنظرتان میاید مشکل از Home Manager " +"است, لطفا یک issue در\n" +"\n" +" %s\n" +"\n" +"ایجاد کنید." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" -msgstr "" +msgstr "عدم امکان نمونه‌سازی تنظیمات flake" #: home-manager/home-manager:572 msgid "" @@ -142,24 +176,28 @@ msgid_plural "" "There are %d unread and relevant news items.\n" "Read them by running the command \"%s news\"." msgstr[0] "" +"%d خبر خوانده نشده وجود دارد.\n" +"میتوانید آن را با اجرای دستور \"%s news\" بخوانید." msgstr[1] "" +"%d خبر خوانده نشده وجود دارد.\n" +"میتوانید آنها را با اجرای دستور \"%s news\" بخوانید." #: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." -msgstr "" +msgstr "تنظیمات \"news.display\" در \"%s\" شناخته شده نیست." #: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "لطفا متغیر محلی $EDITOR و یا $VISUAL را تنظیم کنید" #: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" -msgstr "" +msgstr "نمیتوان دستور build را در یک دایکتوری read-only اجرا کرد" #: home-manager/home-manager:693 msgid "No generation with ID %s" -msgstr "" +msgstr "هیچ نسل ای با شناسه %s یافت نشد" #: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" @@ -171,44 +209,43 @@ msgstr "حذف کردن نسل %s" #: home-manager/home-manager:718 msgid "No generations to expire" -msgstr "" +msgstr "هیچ نسلی برای منسوخ کردن وجود ندارد" #: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." -msgstr "" +msgstr "بنظر میاید هیچ پکیجی از home-manager نصب نشده است." #: home-manager/home-manager:811 msgid "Unknown argument %s" -msgstr "" +msgstr "پارامتر %s شناخته نشده است" #: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." -msgstr "" +msgstr "این عمل Home Manager را از سیستم شما حذف میکند." #: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." -msgstr "" +msgstr "این یک عمل آزمایشی است, قرار نیست چیزی واقعا حذف شود." #: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" -msgstr "واقعاً هوم منیجر را حذف نصب کنید؟" +msgstr "واقعا میخواهید Home Manager را حذف کنید؟" #: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." -msgstr "" +msgstr "در حال انتقال به تنظیمات خالی Home Manager..." #: home-manager/home-manager:863 -#, fuzzy msgid "Yay!" -msgstr "آره!" +msgstr "ایول!" #: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." -msgstr "هوم منیجر حذف نصب شد اما home.nix شما دست نخورده باقی ماند." +msgstr "Home Manager حذف نصب شد اما home.nix شما دست نخورده باقی ماند." #: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." -msgstr "" +msgstr "expire-generations یک پارامتر نیاز دارد, اما %d پارامتر دریافت کرد" #: home-manager/home-manager:1113 msgid "Unknown command: %s" @@ -216,7 +253,7 @@ msgstr "دستور ناشناخته: %s" #: home-manager/install.nix:18 msgid "This derivation is not buildable, please run it using nix-shell." -msgstr "" +msgstr "این نسخه قابل build کردن نیست, لطفا آن را با nix-shell اجرا کنید." #, sh-format #~ msgid "Please set the $EDITOR environment variable" diff --git a/modules/po/fa.po b/modules/po/fa.po index fc0d7c1ff76b..d39e27a92fb8 100644 --- a/modules/po/fa.po +++ b/modules/po/fa.po @@ -8,13 +8,16 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2024-05-02 10:58+0000\n" +"Last-Translator: Keivan \n" +"Language-Team: Persian \n" "Language: fa\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 5.5.3-dev\n" #: modules/files.nix:191 msgid "Creating home file links in %s" @@ -58,7 +61,7 @@ msgstr "" #: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" -msgstr "" +msgstr "بعد از امتحان کردن %s و %s , دایرکتوری مناسب برای پروفایل یافت نشد" #: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" @@ -94,7 +97,7 @@ msgstr "" #: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" -msgstr "" +msgstr "چک کردن پایداری Nix" #: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" From 9036fe9ef8e15a819fa76f47a8b1f287903fb848 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Thu, 2 May 2024 21:58:28 +0200 Subject: [PATCH 251/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/7bb2ccd8cdc44c91edba16c48d2c8f331fb3d856' (2024-04-25) → 'github:NixOS/nixpkgs/58a1abdbae3217ca6b702f03d3b35125d88a2994' (2024-04-27) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 513eff46f06a..908e18668a39 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1714076141, - "narHash": "sha256-Drmja/f5MRHZCskS6mvzFqxEaZMeciScCTFxWVLqWEY=", + "lastModified": 1714253743, + "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7bb2ccd8cdc44c91edba16c48d2c8f331fb3d856", + "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", "type": "github" }, "original": { From e0825ea2112d09d9f0680833cd716f6aee3b973f Mon Sep 17 00:00:00 2001 From: 9p4 Date: Sat, 4 May 2024 19:28:16 -0400 Subject: [PATCH 252/636] swaync: fix style path --- modules/services/swaync.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/swaync.nix b/modules/services/swaync.nix index bb1f9d57cccd..60bcc913b70f 100644 --- a/modules/services/swaync.nix +++ b/modules/services/swaync.nix @@ -84,7 +84,7 @@ in { "swaync/config.json".source = jsonFormat.generate "config.json" cfg.settings; "swaync/style.css" = lib.mkIf (cfg.style != null) { - source = if lib.isStorePath cfg.style then + source = if builtins.isPath cfg.style || lib.isStorePath cfg.style then cfg.style else pkgs.writeText "swaync/style.css" cfg.style; From 2a44f4d09f891d8a9d72b9a7331fa8d94b066119 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 5 May 2024 03:59:36 +0000 Subject: [PATCH 253/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/58a1abdbae3217ca6b702f03d3b35125d88a2994' (2024-04-27) → 'github:NixOS/nixpkgs/63c3a29ca82437c87573e4c6919b09a24ea61b0f' (2024-05-02) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 908e18668a39..5913a4e4d7ca 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1714253743, - "narHash": "sha256-mdTQw2XlariysyScCv2tTE45QSU9v/ezLcHJ22f0Nxc=", + "lastModified": 1714635257, + "narHash": "sha256-4cPymbty65RvF1DWQfc+Bc8B233A1BWxJnNULJKQ1EY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "58a1abdbae3217ca6b702f03d3b35125d88a2994", + "rev": "63c3a29ca82437c87573e4c6919b09a24ea61b0f", "type": "github" }, "original": { From f69bf670d29d3921e00cc626d174654769d743c6 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sun, 5 May 2024 15:37:54 +0800 Subject: [PATCH 254/636] cliphist: add extraOptions option Add an extraOptions option that would be appended to the cliphist command. --- modules/services/cliphist.nix | 15 +++++++++--- .../cliphist/cliphist-extra-options.nix | 24 +++++++++++++++++++ tests/modules/services/cliphist/default.nix | 5 +++- 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 tests/modules/services/cliphist/cliphist-extra-options.nix diff --git a/modules/services/cliphist.nix b/modules/services/cliphist.nix index 504b519a4834..3599557f059f 100644 --- a/modules/services/cliphist.nix +++ b/modules/services/cliphist.nix @@ -17,6 +17,14 @@ in { ''; }; + extraOptions = lib.mkOption { + type = with lib.types; listOf str; + default = [ "-max-dedupe-search" "10" "-max-items" "500" ]; + description = '' + Flags to append to the cliphist command. + ''; + }; + systemdTarget = lib.mkOption { type = lib.types.str; default = "graphical-session.target"; @@ -31,7 +39,8 @@ in { }; }; - config = lib.mkIf cfg.enable { + config = let extraOptionsStr = lib.escapeShellArgs cfg.extraOptions; + in lib.mkIf cfg.enable { assertions = [ (lib.hm.assertions.assertPlatform "services.cliphist" pkgs lib.platforms.linux) @@ -48,7 +57,7 @@ in { Service = { Type = "simple"; ExecStart = - "${pkgs.wl-clipboard}/bin/wl-paste --watch ${cfg.package}/bin/cliphist store"; + "${pkgs.wl-clipboard}/bin/wl-paste --watch ${cfg.package}/bin/cliphist ${extraOptionsStr} store"; Restart = "on-failure"; }; @@ -64,7 +73,7 @@ in { Service = { Type = "simple"; ExecStart = - "${pkgs.wl-clipboard}/bin/wl-paste --type image --watch ${cfg.package}/bin/cliphist store"; + "${pkgs.wl-clipboard}/bin/wl-paste --type image --watch ${cfg.package}/bin/cliphist ${extraOptionsStr} store"; Restart = "on-failure"; }; diff --git a/tests/modules/services/cliphist/cliphist-extra-options.nix b/tests/modules/services/cliphist/cliphist-extra-options.nix new file mode 100644 index 000000000000..65d4fdca1ca8 --- /dev/null +++ b/tests/modules/services/cliphist/cliphist-extra-options.nix @@ -0,0 +1,24 @@ +{ ... }: { + services.cliphist = { + enable = true; + allowImages = true; + extraOptions = [ "-max-dedupe-search" "10" "-max-items" "500" ]; + }; + + test.stubs = { + cliphist = { }; + wl-clipboard = { }; + }; + + nmt.script = '' + servicePath=home-files/.config/systemd/user + + assertFileExists $servicePath/cliphist.service + assertFileExists $servicePath/cliphist-images.service + + assertFileRegex $servicePath/cliphist.service " '-max-dedupe-search' '10' " + assertFileRegex $servicePath/cliphist.service " '-max-items' '500' " + assertFileRegex $servicePath/cliphist-images.service " '-max-dedupe-search' '10' " + assertFileRegex $servicePath/cliphist-images.service " '-max-items' '500' " + ''; +} diff --git a/tests/modules/services/cliphist/default.nix b/tests/modules/services/cliphist/default.nix index 0110133223fd..d74a469b1bed 100644 --- a/tests/modules/services/cliphist/default.nix +++ b/tests/modules/services/cliphist/default.nix @@ -1 +1,4 @@ -{ cliphist-sway-session-target = ./cliphist-sway-session-target.nix; } +{ + cliphist-sway-session-target = ./cliphist-sway-session-target.nix; + cliphist-extra-options = ./cliphist-extra-options.nix; +} From fdaaf543bad047639ef0b356ea2e6caec2f1215c Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sun, 5 May 2024 04:13:18 -0500 Subject: [PATCH 255/636] hypridle: add module --- modules/misc/news.nix | 11 +++ modules/modules.nix | 1 + modules/services/hypridle.nix | 95 +++++++++++++++++++ tests/default.nix | 1 + .../services/hypridle/basic-configuration.nix | 38 ++++++++ tests/modules/services/hypridle/default.nix | 1 + tests/modules/services/hypridle/hypridle.conf | 16 ++++ 7 files changed, 163 insertions(+) create mode 100644 modules/services/hypridle.nix create mode 100644 tests/modules/services/hypridle/basic-configuration.nix create mode 100644 tests/modules/services/hypridle/default.nix create mode 100644 tests/modules/services/hypridle/hypridle.conf diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 92d3e9f5477b..ef3b98f57ca0 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1584,6 +1584,17 @@ in { https://conky.cc/ for more. ''; } + + { + time = "2024-05-05T07:22:01+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.hypridle'. + + Hypridle is a program that monitors user activity and runs commands + when idle or active. See https://github.com/hyprwm/hypridle for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 7c81102a9820..b59812b7610f 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -302,6 +302,7 @@ let ./services/gromit-mpx.nix ./services/home-manager-auto-upgrade.nix ./services/hound.nix + ./services/hypridle.nix ./services/imapnotify.nix ./services/kanshi.nix ./services/kbfs.nix diff --git a/modules/services/hypridle.nix b/modules/services/hypridle.nix new file mode 100644 index 000000000000..0e28c5438047 --- /dev/null +++ b/modules/services/hypridle.nix @@ -0,0 +1,95 @@ +{ config, lib, pkgs, ... }: +with lib; +let + + cfg = config.services.hypridle; +in { + meta.maintainers = [ maintainers.khaneliman maintainers.fufexan ]; + + options.services.hypridle = { + enable = mkEnableOption "Hypridle, Hyprland's idle daemon"; + + package = mkPackageOption pkgs "hypridle" { }; + + settings = lib.mkOption { + type = with lib.types; + let + valueType = nullOr (oneOf [ + bool + int + float + str + path + (attrsOf valueType) + (listOf valueType) + ]) // { + description = "Hypridle configuration value"; + }; + in valueType; + default = { }; + description = '' + Hypridle configuration written in Nix. Entries with the same key + should be written as lists. Variables' and colors' names should be + quoted. See for more examples. + ''; + example = lib.literalExpression '' + { + general = { + after_sleep_cmd = "hyprctl dispatch dpms on"; + ignore_dbus_inhibit = false; + lock_cmd = "hyprlock"; + }; + + listener = [ + { + timeout = 900; + on-timeout = "hyprlock"; + } + { + timeout = 1200; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + } + ''; + }; + + importantPrefixes = lib.mkOption { + type = with lib.types; listOf str; + default = [ "$" ]; + example = [ "$" ]; + description = '' + List of prefix of attributes to source at the top of the config. + ''; + }; + }; + + config = mkIf cfg.enable { + xdg.configFile."hypr/hypridle.conf" = mkIf (cfg.settings != { }) { + text = lib.hm.generators.toHyprconf { + attrs = cfg.settings; + inherit (cfg) importantPrefixes; + }; + }; + + systemd.user.services.hypridle = { + Install = { WantedBy = [ "graphical-session.target" ]; }; + + Unit = { + ConditionEnvironment = "WAYLAND_DISPLAY"; + Description = "hypridle"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + X-Restart-Triggers = + [ "${config.xdg.configFile."hypr/hypridle.conf".source}" ]; + }; + + Service = { + ExecStart = "${getExe cfg.package}"; + Restart = "always"; + RestartSec = "10"; + }; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 7b714581d593..e879c13c63dc 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -239,6 +239,7 @@ in import nmtSrc { ./modules/services/gpg-agent ./modules/services/gromit-mpx ./modules/services/home-manager-auto-upgrade + ./modules/services/hypridle ./modules/services/imapnotify ./modules/services/kanshi ./modules/services/lieer diff --git a/tests/modules/services/hypridle/basic-configuration.nix b/tests/modules/services/hypridle/basic-configuration.nix new file mode 100644 index 000000000000..461f70a5173d --- /dev/null +++ b/tests/modules/services/hypridle/basic-configuration.nix @@ -0,0 +1,38 @@ +{ pkgs, ... }: + +{ + services.hypridle = { + enable = true; + package = pkgs.hypridle; + + settings = { + general = { + after_sleep_cmd = "hyprctl dispatch dpms on"; + ignore_dbus_inhibit = false; + lock_cmd = "hyprlock"; + }; + + listener = [ + { + timeout = 900; + on-timeout = "hyprlock"; + } + { + timeout = 1200; + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + ]; + }; + }; + + test.stubs.hypridle = { }; + + nmt.script = '' + config=home-files/.config/hypr/hypridle.conf + clientServiceFile=home-files/.config/systemd/user/hypridle.service + assertFileExists $config + assertFileExists $clientServiceFile + assertFileContent $config ${./hypridle.conf} + ''; +} diff --git a/tests/modules/services/hypridle/default.nix b/tests/modules/services/hypridle/default.nix new file mode 100644 index 000000000000..c959983c0410 --- /dev/null +++ b/tests/modules/services/hypridle/default.nix @@ -0,0 +1 @@ +{ hypridle-basic-configuration = ./basic-configuration.nix; } diff --git a/tests/modules/services/hypridle/hypridle.conf b/tests/modules/services/hypridle/hypridle.conf new file mode 100644 index 000000000000..ee296337534c --- /dev/null +++ b/tests/modules/services/hypridle/hypridle.conf @@ -0,0 +1,16 @@ +general { + after_sleep_cmd=hyprctl dispatch dpms on + ignore_dbus_inhibit=false + lock_cmd=hyprlock +} + +listener { + on-timeout=hyprlock + timeout=900 +} + +listener { + on-resume=hyprctl dispatch dpms on + on-timeout=hyprctl dispatch dpms off + timeout=1200 +} From 3dfe05aa9b5646995ace887931fa60269a039777 Mon Sep 17 00:00:00 2001 From: Daru <135046711+Daru-san@users.noreply.github.com> Date: Sun, 5 May 2024 19:59:14 +0200 Subject: [PATCH 256/636] wlsunset: update options --- modules/services/wlsunset.nix | 82 +++++++++++++++---- .../wlsunset-service-expected.service | 2 +- 2 files changed, 67 insertions(+), 17 deletions(-) diff --git a/modules/services/wlsunset.nix b/modules/services/wlsunset.nix index 3bc3f2f74c5d..f3352750c137 100644 --- a/modules/services/wlsunset.nix +++ b/modules/services/wlsunset.nix @@ -11,7 +11,7 @@ in { enable = mkEnableOption "wlsunset"; package = mkOption { - type = types.package; + type = with types; package; default = pkgs.wlsunset; defaultText = "pkgs.wlsunset"; description = '' @@ -20,7 +20,9 @@ in { }; latitude = mkOption { - type = types.str; + type = with types; nullOr (either str (either float int)); + default = null; + example = -74.3; description = '' Your current latitude, between `-90.0` and `90.0`. @@ -28,7 +30,9 @@ in { }; longitude = mkOption { - type = types.str; + type = with types; nullOr (either str (either float int)); + default = null; + example = 12.5; description = '' Your current longitude, between `-180.0` and `180.0`. @@ -37,7 +41,7 @@ in { temperature = { day = mkOption { - type = types.int; + type = with types; int; default = 6500; description = '' Colour temperature to use during the day, in Kelvin (K). @@ -46,7 +50,7 @@ in { }; night = mkOption { - type = types.int; + type = with types; int; default = 4000; description = '' Colour temperature to use during the night, in Kelvin (K). @@ -56,15 +60,42 @@ in { }; gamma = mkOption { - type = types.str; - default = "1.0"; + type = with types; (either str (either float int)); + default = 1.0; + example = 0.6; description = '' Gamma value to use. ''; }; + output = mkOption { + type = with types; nullOr str; + default = null; + description = '' + Name of output to use, by default all outputs are used. + ''; + }; + + sunrise = mkOption { + type = with types; nullOr str; + default = null; + example = "06:30"; + description = '' + The time when the sun rises (in 24 hour format). + ''; + }; + + sunset = mkOption { + type = with types; nullOr str; + default = null; + example = "18:00"; + description = '' + The time when the sun sets (in 24 hour format). + ''; + }; + systemdTarget = mkOption { - type = types.str; + type = with types; str; default = "graphical-session.target"; description = '' Systemd target to bind to. @@ -76,6 +107,22 @@ in { assertions = [ (lib.hm.assertions.assertPlatform "services.wlsunset" pkgs lib.platforms.linux) + { + assertion = (cfg.sunrise != null || cfg.sunset != null) + != (cfg.latitude != null || cfg.longitude != null); + message = + "Either `sunrise` and `sunset` together or `longitude` and `latitude` together must be set for wlsunset"; + } + { + assertion = (cfg.sunrise != null) == (cfg.sunset != null); + message = + "Both `sunset` and `sunrise` together must be set for wlsunset"; + } + { + assertion = (cfg.latitude != null) == (cfg.longitude != null); + message = + "Both `latitude and `longitude` together must be set for wlsunset"; + } ]; systemd.user.services.wlsunset = { @@ -86,14 +133,17 @@ in { Service = { ExecStart = let - args = [ - "-l ${cfg.latitude}" - "-L ${cfg.longitude}" - "-t ${toString cfg.temperature.night}" - "-T ${toString cfg.temperature.day}" - "-g ${cfg.gamma}" - ]; - in "${cfg.package}/bin/wlsunset ${concatStringsSep " " args}"; + args = cli.toGNUCommandLineShell { } { + t = cfg.temperature.night; + T = cfg.temperature.day; + g = cfg.gamma; + l = cfg.latitude; + L = cfg.longitude; + S = cfg.sunrise; + s = cfg.sunset; + o = cfg.output; + }; + in "${cfg.package}/bin/wlsunset ${args}"; }; Install = { WantedBy = [ cfg.systemdTarget ]; }; diff --git a/tests/modules/services/wlsunset/wlsunset-service-expected.service b/tests/modules/services/wlsunset/wlsunset-service-expected.service index f0cf96f3ad0a..f311d900ec2d 100644 --- a/tests/modules/services/wlsunset/wlsunset-service-expected.service +++ b/tests/modules/services/wlsunset/wlsunset-service-expected.service @@ -2,7 +2,7 @@ WantedBy=test.target [Service] -ExecStart=@wlsunset@/bin/wlsunset -l 12.3 -L 128.8 -t 3500 -T 6000 -g 0.6 +ExecStart=@wlsunset@/bin/wlsunset '-L' '128.8' '-T' '6000' '-g' '0.6' '-l' '12.3' '-t' '3500' [Unit] Description=Day/night gamma adjustments for Wayland compositors. From 2b87a11125f988a9f67ee63eeaa3682bc841d9b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20DUBOIN?= <34611103+d4ilyrun@users.noreply.github.com> Date: Mon, 6 May 2024 08:17:53 +0200 Subject: [PATCH 257/636] git: add realName inside From field We currently have no way of specifying the sender's name inside the From field, making a patch sent through `git send-email` appear as coming from "xxx@domain.com". In this commit we make this field follow the standard realName format. --- modules/programs/git.nix | 4 ++-- tests/modules/programs/git/git-with-email-expected.conf | 4 ++-- tests/modules/programs/git/git-with-email.nix | 4 ++-- tests/modules/programs/git/git-with-msmtp-expected.conf | 4 ++-- tests/modules/programs/git/git-with-msmtp.nix | 5 +++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 53728060a221..3061feff77a7 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -392,7 +392,7 @@ in { nameValuePair "sendemail.${name}" (if account.msmtp.enable then { smtpServer = "${pkgs.msmtp}/bin/msmtp"; envelopeSender = "auto"; - from = address; + from = "${realName} <${address}>"; } else { smtpEncryption = if smtp.tls.enable then @@ -407,7 +407,7 @@ in { mkIf smtp.tls.enable (toString smtp.tls.certificatesFile); smtpServer = smtp.host; smtpUser = userName; - from = address; + from = "${realName} <${address}>"; } // optionalAttrs (smtp.port != null) { smtpServerPort = smtp.port; }); diff --git a/tests/modules/programs/git/git-with-email-expected.conf b/tests/modules/programs/git/git-with-email-expected.conf index c34ab1d79e32..fa027422f022 100644 --- a/tests/modules/programs/git/git-with-email-expected.conf +++ b/tests/modules/programs/git/git-with-email-expected.conf @@ -1,12 +1,12 @@ [sendemail "hm-account"] - from = "hm@example.org" + from = "H. M. Test Jr. " smtpEncryption = "tls" smtpServer = "smtp.example.org" smtpSslCertPath = "/etc/test/certificates.crt" smtpUser = "home.manager.jr" [sendemail "hm@example.com"] - from = "hm@example.com" + from = "H. M. Test " smtpEncryption = "ssl" smtpServer = "smtp.example.com" smtpSslCertPath = "/etc/ssl/certs/ca-certificates.crt" diff --git a/tests/modules/programs/git/git-with-email.nix b/tests/modules/programs/git/git-with-email.nix index ec18ecb92e04..0999eaa87a1c 100644 --- a/tests/modules/programs/git/git-with-email.nix +++ b/tests/modules/programs/git/git-with-email.nix @@ -33,8 +33,8 @@ with lib; ./git-with-email-expected.conf } - assertGitConfig "sendemail.hm@example.com.from" "hm@example.com" - assertGitConfig "sendemail.hm-account.from" "hm@example.org" + assertGitConfig "sendemail.hm@example.com.from" "H. M. Test " + assertGitConfig "sendemail.hm-account.from" "H. M. Test Jr. " ''; }; } diff --git a/tests/modules/programs/git/git-with-msmtp-expected.conf b/tests/modules/programs/git/git-with-msmtp-expected.conf index 1f2c7b794b97..8cd5d86f0f0d 100644 --- a/tests/modules/programs/git/git-with-msmtp-expected.conf +++ b/tests/modules/programs/git/git-with-msmtp-expected.conf @@ -1,5 +1,5 @@ [sendemail "hm-account"] - from = "hm@example.org" + from = "H. M. Test Jr. " smtpEncryption = "tls" smtpServer = "smtp.example.org" smtpSslCertPath = "/etc/ssl/certs/ca-certificates.crt" @@ -7,7 +7,7 @@ [sendemail "hm@example.com"] envelopeSender = "auto" - from = "hm@example.com" + from = "H. M. Test " smtpServer = "@msmtp@/bin/msmtp" [user] diff --git a/tests/modules/programs/git/git-with-msmtp.nix b/tests/modules/programs/git/git-with-msmtp.nix index dc6ba465e9d8..80e082c97f8e 100644 --- a/tests/modules/programs/git/git-with-msmtp.nix +++ b/tests/modules/programs/git/git-with-msmtp.nix @@ -7,6 +7,7 @@ with lib; config = { accounts.email.accounts."hm@example.com".msmtp.enable = true; + programs.git = { enable = true; package = pkgs.gitMinimal; @@ -33,8 +34,8 @@ with lib; assertFileContent home-files/.config/git/config \ ${./git-with-msmtp-expected.conf} - assertGitConfig "sendemail.hm@example.com.from" "hm@example.com" - assertGitConfig "sendemail.hm-account.from" "hm@example.org" + assertGitConfig "sendemail.hm@example.com.from" "H. M. Test " + assertGitConfig "sendemail.hm-account.from" "H. M. Test Jr. " assertGitConfig "sendemail.hm@example.com.smtpServer" "${pkgs.msmtp}/bin/msmtp" assertGitConfig "sendemail.hm@example.com.envelopeSender" "auto" ''; From 6ebe7be2e67be7b9b54d61ce5704f6fb466c536f Mon Sep 17 00:00:00 2001 From: Tad Fisher Date: Sun, 16 May 2021 14:54:43 -0700 Subject: [PATCH 258/636] gnome-shell: add module --- modules/misc/news.nix | 12 ++ modules/modules.nix | 1 + modules/programs/gnome-shell.nix | 115 ++++++++++++++++++ tests/default.nix | 1 + .../modules/programs/gnome-shell/default.nix | 1 + .../programs/gnome-shell/gnome-shell.nix | 94 ++++++++++++++ 6 files changed, 224 insertions(+) create mode 100644 modules/programs/gnome-shell.nix create mode 100644 tests/modules/programs/gnome-shell/default.nix create mode 100644 tests/modules/programs/gnome-shell/gnome-shell.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index ef3b98f57ca0..16f372c82d0d 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1595,6 +1595,18 @@ in { when idle or active. See https://github.com/hyprwm/hypridle for more. ''; } + + { + time = "2024-05-06T07:36:13+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'programs.gnome-shell'. + + GNOME Shell is the graphical shell of the GNOME desktop environment. + It provides basic functions like launching applications and switching + between windows, and is also a widget engine. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index b59812b7610f..98f7de8073c8 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -103,6 +103,7 @@ let ./programs/git-credential-oauth.nix ./programs/git.nix ./programs/gitui.nix + ./programs/gnome-shell.nix ./programs/gnome-terminal.nix ./programs/go.nix ./programs/gpg.nix diff --git a/modules/programs/gnome-shell.nix b/modules/programs/gnome-shell.nix new file mode 100644 index 000000000000..36a57cea94f0 --- /dev/null +++ b/modules/programs/gnome-shell.nix @@ -0,0 +1,115 @@ +{ config, lib, pkgs, ... }: + +with lib; +let + cfg = config.programs.gnome-shell; + + extensionOpts = { config, ... }: { + options = { + id = mkOption { + type = types.str; + example = "user-theme@gnome-shell-extensions.gcampax.github.com"; + description = '' + ID of the GNOME Shell extension. If not provided, it + will be obtained from `package.extensionUuid`. + ''; + }; + + package = mkOption { + type = types.package; + example = "pkgs.gnome.gnome-shell-extensions"; + description = '' + Package providing a GNOME Shell extension in + `$out/share/gnome-shell/extensions/''${id}`. + ''; + }; + }; + + config = mkIf (hasAttr "extensionUuid" config.package) { + id = mkDefault config.package.extensionUuid; + }; + }; + + themeOpts = { + options = { + name = mkOption { + type = types.str; + example = "Plata-Noir"; + description = '' + Name of the GNOME Shell theme. + ''; + }; + + package = mkOption { + type = types.nullOr types.package; + default = null; + example = literalExpression "pkgs.plata-theme"; + description = '' + Package providing a GNOME Shell theme in + `$out/share/themes/''${name}/gnome-shell`. + ''; + }; + }; + }; + +in { + meta.maintainers = [ maintainers.terlar ]; + + options.programs.gnome-shell = { + enable = mkEnableOption "GNOME Shell customization"; + + extensions = mkOption { + type = types.listOf (types.submodule extensionOpts); + default = [ ]; + example = literalExpression '' + [ + { package = pkgs.gnomeExtensions.dash-to-panel; } + { + id = "user-theme@gnome-shell-extensions.gcampax.github.com"; + package = pkgs.gnome.gnome-shell-extensions; + } + ] + ''; + description = '' + List of GNOME Shell extensions. + ''; + }; + + theme = mkOption { + type = types.nullOr (types.submodule themeOpts); + default = null; + example = literalExpression '' + { + name = "Plata-Noir"; + package = pkgs.plata-theme; + } + ''; + description = '' + Theme to use for GNOME Shell. + ''; + }; + }; + + config = mkIf cfg.enable (mkMerge [ + (mkIf (cfg.extensions != [ ]) { + dconf.settings."org/gnome/shell" = { + disable-user-extensions = false; + enabled-extensions = catAttrs "id" cfg.extensions; + }; + + home.packages = catAttrs "package" cfg.extensions; + }) + + (mkIf (cfg.theme != null) { + dconf.settings."org/gnome/shell/extensions/user-theme".name = + cfg.theme.name; + + programs.gnome-shell.extensions = [{ + id = "user-theme@gnome-shell-extensions.gcampax.github.com"; + package = pkgs.gnome.gnome-shell-extensions; + }]; + + home.packages = [ cfg.theme.package ]; + }) + ]); +} diff --git a/tests/default.nix b/tests/default.nix index e879c13c63dc..2ecffad8809a 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -193,6 +193,7 @@ in import nmtSrc { ./modules/programs/freetube ./modules/programs/fuzzel ./modules/programs/getmail + ./modules/programs/gnome-shell ./modules/programs/gnome-terminal ./modules/programs/hexchat ./modules/programs/i3blocks diff --git a/tests/modules/programs/gnome-shell/default.nix b/tests/modules/programs/gnome-shell/default.nix new file mode 100644 index 000000000000..58e4598f8e26 --- /dev/null +++ b/tests/modules/programs/gnome-shell/default.nix @@ -0,0 +1 @@ +{ gnome-shell = ./gnome-shell.nix; } diff --git a/tests/modules/programs/gnome-shell/gnome-shell.nix b/tests/modules/programs/gnome-shell/gnome-shell.nix new file mode 100644 index 000000000000..02f44e0c3376 --- /dev/null +++ b/tests/modules/programs/gnome-shell/gnome-shell.nix @@ -0,0 +1,94 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + dummy-gnome-shell-extensions = pkgs.runCommand "dummy-package" { } '' + mkdir -p $out/share/gnome-shell/extensions/dummy-package + touch $out/share/gnome-shell/extensions/dummy-package/test + ''; + + test-extension = pkgs.runCommand "test-extension" { } '' + mkdir -p $out/share/gnome-shell/extensions/test-extension + touch $out/share/gnome-shell/extensions/test-extension/test + ''; + + test-extension-uuid = pkgs.runCommand "test-extension-uuid" { + passthru.extensionUuid = "test-extension-uuid"; + } '' + mkdir -p $out/share/gnome-shell/extensions/test-extension-uuid + touch $out/share/gnome-shell/extensions/test-extension-uuid/test + ''; + + test-theme = pkgs.runCommand "test-theme" { } '' + mkdir -p $out/share/themes/Test/gnome-shell + touch $out/share/themes/Test/gnome-shell/test + ''; + + expectedEnabledExtensions = [ + "user-theme@gnome-shell-extensions.gcampax.github.com" + "test-extension" + "test-extension-uuid" + ]; + + actualEnabledExtensions = catAttrs "value" + config.dconf.settings."org/gnome/shell".enabled-extensions.value; + +in { + nixpkgs.overlays = [ + (self: super: { + gnome = super.gnome.overrideScope (gself: gsuper: { + gnome-shell-extensions = dummy-gnome-shell-extensions; + }); + }) + ]; + + programs.gnome-shell.enable = true; + + programs.gnome-shell.extensions = [ + { + id = "test-extension"; + package = test-extension; + } + { package = test-extension-uuid; } + ]; + + programs.gnome-shell.theme = { + name = "Test"; + package = test-theme; + }; + + assertions = [ + { + assertion = + config.dconf.settings."org/gnome/shell".disable-user-extensions + == false; + message = "Expected disable-user-extensions to be false."; + } + { + assertion = + all (e: elem e actualEnabledExtensions) expectedEnabledExtensions; + message = '' + Expected enabled-extensions to contain all of: + ${toString expectedEnabledExtensions} + But it was: + ${toString actualEnabledExtensions} + ''; + } + { + assertion = + config.dconf.settings."org/gnome/shell/extensions/user-theme".name + == "Test"; + message = "Expected extensions/user-theme/name to be 'Test'."; + } + ]; + + test.stubs.dconf = { }; + + nmt.script = '' + assertFileExists home-path/share/gnome-shell/extensions/dummy-package/test + assertFileExists home-path/share/gnome-shell/extensions/test-extension/test + assertFileExists home-path/share/gnome-shell/extensions/test-extension-uuid/test + assertFileExists home-path/share/themes/Test/gnome-shell/test + ''; +} From 6e277d9566de9976f47228dd8c580b97488734d4 Mon Sep 17 00:00:00 2001 From: Bruno Bigras Date: Tue, 7 May 2024 06:25:03 -0400 Subject: [PATCH 259/636] jujutsu: add ediff option Based on . --- modules/programs/jujutsu.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/programs/jujutsu.nix b/modules/programs/jujutsu.nix index 269c5ef93ef1..b1fcc7038c5d 100644 --- a/modules/programs/jujutsu.nix +++ b/modules/programs/jujutsu.nix @@ -22,6 +22,15 @@ in { package = mkPackageOption pkgs "jujutsu" { }; + ediff = mkOption { + type = types.bool; + default = config.programs.emacs.enable; + defaultText = literalExpression "config.programs.emacs.enable"; + description = '' + Enable ediff as a merge tool + ''; + }; + settings = mkOption { type = tomlFormat.type; default = { }; @@ -45,7 +54,18 @@ in { home.packages = [ cfg.package ]; home.file.".jjconfig.toml" = mkIf (cfg.settings != { }) { - source = tomlFormat.generate "jujutsu-config" cfg.settings; + source = tomlFormat.generate "jujutsu-config" (cfg.settings + // optionalAttrs (cfg.ediff) (let + emacsDiffScript = pkgs.writeShellScriptBin "emacs-ediff" '' + set -euxo pipefail + ${config.programs.emacs.package}/bin/emacsclient -c --eval "(ediff-merge-files-with-ancestor \"$1\" \"$2\" \"$3\" nil \"$4\")" + ''; + in { + merge-tools.ediff = { + program = getExe emacsDiffScript; + merge-args = [ "$left" "$right" "$base" "$output" ]; + }; + })); }; }; } From f61917cbaa6dba317e757aefd0bbb56403aff2f8 Mon Sep 17 00:00:00 2001 From: afresquet <29437693+afresquet@users.noreply.github.com> Date: Thu, 2 May 2024 02:23:11 +0200 Subject: [PATCH 260/636] fastfetch: add module PR #5363 --- modules/lib/maintainers.nix | 6 ++ modules/misc/news.nix | 11 ++++ modules/modules.nix | 1 + modules/programs/fastfetch.nix | 65 +++++++++++++++++++ tests/default.nix | 1 + .../fastfetch/basic-configuration.jsonc | 28 ++++++++ .../fastfetch/basic-configuration.nix | 39 +++++++++++ .../fastfetch/default-configuration.nix | 9 +++ tests/modules/programs/fastfetch/default.nix | 4 ++ 9 files changed, 164 insertions(+) create mode 100644 modules/programs/fastfetch.nix create mode 100755 tests/modules/programs/fastfetch/basic-configuration.jsonc create mode 100644 tests/modules/programs/fastfetch/basic-configuration.nix create mode 100644 tests/modules/programs/fastfetch/default-configuration.nix create mode 100644 tests/modules/programs/fastfetch/default.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 1e988cc2ea6f..b5175a87510a 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -13,6 +13,12 @@ github = "abayomi185"; githubId = 21103047; }; + afresquet = { + name = "Alvaro Fresquet"; + email = "alvarofresquet@gmail.com"; + github = "afresquet"; + githubId = 29437693; + }; amesgen = { name = "amesgen"; email = "amesgen@amesgen.de"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 16f372c82d0d..6319d63533a2 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1607,6 +1607,17 @@ in { between windows, and is also a widget engine. ''; } + + { + time = "2024-05-10T10:30:58+00:00"; + message = '' + A new module is available: 'programs.fastfetch'. + + Fastfetch is a Neofetch-like tool for fetching system information and + displaying them in a pretty way. See + https://github.com/fastfetch-cli/fastfetch for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 98f7de8073c8..22664091ccc4 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -87,6 +87,7 @@ let ./programs/emacs.nix ./programs/eww.nix ./programs/eza.nix + ./programs/fastfetch.nix ./programs/fd.nix ./programs/feh.nix ./programs/firefox.nix diff --git a/modules/programs/fastfetch.nix b/modules/programs/fastfetch.nix new file mode 100644 index 000000000000..32021611d042 --- /dev/null +++ b/modules/programs/fastfetch.nix @@ -0,0 +1,65 @@ +{ pkgs, lib, config, ... }: + +let + inherit (lib) mkEnableOption mkPackageOption mkOption mkIf literalExpression; + + cfg = config.programs.fastfetch; + + jsonFormat = pkgs.formats.json { }; +in { + meta.maintainers = with lib.hm.maintainers; [ afresquet ]; + + options.programs.fastfetch = { + enable = mkEnableOption "Fastfetch"; + + package = mkPackageOption pkgs "fastfetch" { }; + + settings = mkOption { + type = jsonFormat.type; + default = { }; + example = literalExpression '' + { + logo = { + source = "nixos_small"; + padding = { + right = 1; + }; + }; + display = { + binaryPrefix = "si"; + color = "blue"; + separator = "  "; + }; + modules = [ + { + type = "datetime"; + key = "Date"; + format = "{1}-{3}-{11}"; + } + { + type = "datetime"; + key = "Time"; + format = "{14}:{17}:{20}"; + } + "break" + "player" + "media" + ]; + }; + ''; + description = '' + Configuration written to {file}`$XDG_CONFIG_HOME/fastfetch/config.jsonc`. + See + for the documentation. + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + + xdg.configFile."fastfetch/config.jsonc" = mkIf (cfg.settings != { }) { + source = jsonFormat.generate "config.jsonc" cfg.settings; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 2ecffad8809a..0ebf47151522 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -71,6 +71,7 @@ in import nmtSrc { ./modules/programs/dircolors ./modules/programs/direnv ./modules/programs/emacs + ./modules/programs/fastfetch ./modules/programs/feh ./modules/programs/fish ./modules/programs/gallery-dl diff --git a/tests/modules/programs/fastfetch/basic-configuration.jsonc b/tests/modules/programs/fastfetch/basic-configuration.jsonc new file mode 100755 index 000000000000..70eabbd654f2 --- /dev/null +++ b/tests/modules/programs/fastfetch/basic-configuration.jsonc @@ -0,0 +1,28 @@ +{ + "display": { + "binaryPrefix": "si", + "color": "blue", + "separator": "  " + }, + "logo": { + "padding": { + "right": 1 + }, + "source": "nixos_small" + }, + "modules": [ + { + "format": "{1}-{3}-{11}", + "key": "Date", + "type": "datetime" + }, + { + "format": "{14}:{17}:{20}", + "key": "Time", + "type": "datetime" + }, + "break", + "player", + "media" + ] +} diff --git a/tests/modules/programs/fastfetch/basic-configuration.nix b/tests/modules/programs/fastfetch/basic-configuration.nix new file mode 100644 index 000000000000..a0b6783a859c --- /dev/null +++ b/tests/modules/programs/fastfetch/basic-configuration.nix @@ -0,0 +1,39 @@ +{ + programs.fastfetch = { + enable = true; + settings = { + logo = { + source = "nixos_small"; + padding = { right = 1; }; + }; + display = { + binaryPrefix = "si"; + color = "blue"; + separator = "  "; + }; + modules = [ + { + type = "datetime"; + key = "Date"; + format = "{1}-{3}-{11}"; + } + { + type = "datetime"; + key = "Time"; + format = "{14}:{17}:{20}"; + } + "break" + "player" + "media" + ]; + }; + }; + + test.stubs.fastfetch = { }; + + nmt.script = let configFile = "home-files/.config/fastfetch/config.jsonc"; + in '' + assertFileExists "${configFile}" + assertFileContent "${configFile}" ${./basic-configuration.jsonc} + ''; +} diff --git a/tests/modules/programs/fastfetch/default-configuration.nix b/tests/modules/programs/fastfetch/default-configuration.nix new file mode 100644 index 000000000000..428081d4d936 --- /dev/null +++ b/tests/modules/programs/fastfetch/default-configuration.nix @@ -0,0 +1,9 @@ +{ + programs.fastfetch.enable = true; + + test.stubs.fastfetch = { }; + + nmt.script = '' + assertPathNotExists "home-files/.config/fastfetch/config.jsonc" + ''; +} diff --git a/tests/modules/programs/fastfetch/default.nix b/tests/modules/programs/fastfetch/default.nix new file mode 100644 index 000000000000..d347e562e439 --- /dev/null +++ b/tests/modules/programs/fastfetch/default.nix @@ -0,0 +1,4 @@ +{ + fastfetch-default-configuration = ./default-configuration.nix; + fastfetch-basic-configuration = ./basic-configuration.nix; +} From 4855bfb6ce20225a1b0e2aae2379da909ab38350 Mon Sep 17 00:00:00 2001 From: Vincent Gatine Date: Thu, 9 May 2024 18:04:48 +0200 Subject: [PATCH 261/636] kanshi: update configuration to better match upstream --- modules/services/kanshi.nix | 177 ++++++++++++++---- .../services/kanshi/basic-configuration.nix | 5 + tests/modules/services/kanshi/default.nix | 5 +- .../services/kanshi/new-configuration.conf | 19 ++ .../services/kanshi/new-configuration.nix | 63 +++++++ 5 files changed, 232 insertions(+), 37 deletions(-) create mode 100644 tests/modules/services/kanshi/new-configuration.conf create mode 100644 tests/modules/services/kanshi/new-configuration.nix diff --git a/modules/services/kanshi.nix b/modules/services/kanshi.nix index 02fe8e3cfca3..1e6950304530 100644 --- a/modules/services/kanshi.nix +++ b/modules/services/kanshi.nix @@ -6,6 +6,48 @@ let cfg = config.services.kanshi; + directivesTag = types.attrTag { + profile = mkOption { + type = profileModule; + description = '' + profile attribute set. + ''; + }; + output = mkOption { + type = outputModule; + description = '' + output attribute set. + ''; + }; + include = mkOption { + type = types.str; + description = '' + Include as another file from _path_. + Expands shell syntax (see *wordexp*(3) for details). + ''; + }; + }; + + tagToStr = x: + if x ? profile then + profileStr x.profile + else if x ? output then + outputStr x.output + else if x ? include then + ''include "${x.include}"'' + else + throw "Unknown tags ${attrNames x}"; + + directivesStr = '' + ${concatStringsSep "\n" (map tagToStr cfg.settings)} + ''; + + oldDirectivesStr = '' + ${concatStringsSep "\n" + (mapAttrsToList (n: v: profileStr (v // { name = n; })) cfg.profiles)} + ${cfg.extraConfig} + ''; + outputModule = types.submodule { options = { @@ -113,6 +155,14 @@ let ''; }; + name = mkOption { + type = types.str; + default = ""; + description = '' + Profile name + ''; + }; + exec = mkOption { type = with types; coercedTo str singleton (listOf str); default = [ ]; @@ -127,15 +177,14 @@ let }; }; - profileStr = name: - { outputs, exec, ... }: '' - profile ${name} { - ${ - concatStringsSep "\n " - (map outputStr outputs ++ map (cmd: "exec ${cmd}") exec) - } + profileStr = { outputs, exec, ... }@args: '' + profile ${args.name or ""} { + ${ + concatStringsSep "\n " + (map outputStr outputs ++ map (cmd: "exec ${cmd}") exec) } - ''; + } + ''; in { meta.maintainers = [ hm.maintainers.nurelin ]; @@ -157,7 +206,7 @@ in { type = types.attrsOf profileModule; default = { }; description = '' - List of profiles. + Attribute set of profiles. ''; example = literalExpression '' undocked = { @@ -190,6 +239,39 @@ in { ''; }; + settings = mkOption { + type = types.listOf directivesTag; + default = [ ]; + description = '' + Ordered list of directives. + See kanshi(5) for informations. + ''; + example = literalExpression '' + { include = "path/to/included/files"; } + { output.criteria = "eDP-1"; + output.scale = 2; + } + { profile.name = "undocked"; + profile.outputs = [ + { + criteria = "eDP-1"; + } + ]; + } + { profile.name = "docked"; + profile.outputs = [ + { + criteria = "eDP-1"; + } + { + criteria = "Some Company ASDF 4242"; + transform = "90"; + } + ]; + } + ''; + }; + systemdTarget = mkOption { type = types.str; default = "sway-session.target"; @@ -199,33 +281,56 @@ in { }; }; - config = mkIf cfg.enable { - assertions = [ - (lib.hm.assertions.assertPlatform "services.kanshi" pkgs - lib.platforms.linux) - ]; - - xdg.configFile."kanshi/config".text = '' - ${concatStringsSep "\n" (mapAttrsToList profileStr cfg.profiles)} - ${cfg.extraConfig} - ''; - - systemd.user.services.kanshi = { - Unit = { - Description = "Dynamic output configuration"; - Documentation = "man:kanshi(1)"; - PartOf = cfg.systemdTarget; - Requires = cfg.systemdTarget; - After = cfg.systemdTarget; - }; + config = mkIf cfg.enable (mkMerge [ + { + assertions = [ + (lib.hm.assertions.assertPlatform "services.kanshi" pkgs + lib.platforms.linux) + { + assertion = (cfg.profiles == { } && cfg.extraConfig == "") + || (length cfg.settings) == 0; + message = + "Cannot mix kanshi.settings with kanshi.profiles or kanshi.extraConfig"; + } + ]; + } - Service = { - Type = "simple"; - ExecStart = "${cfg.package}/bin/kanshi"; - Restart = "always"; - }; + (mkIf (cfg.profiles != { }) { + warnings = [ + "kanshi.profiles option is deprecated. Use kanshi.settings instead." + ]; + }) - Install = { WantedBy = [ cfg.systemdTarget ]; }; - }; - }; + (mkIf (cfg.extraConfig != "") { + warnings = [ + "kanshi.extraConfig option is deprecated. Use kanshi.settings instead." + ]; + }) + + { + xdg.configFile."kanshi/config".text = + if cfg.profiles == { } && cfg.extraConfig == "" then + directivesStr + else + oldDirectivesStr; + + systemd.user.services.kanshi = { + Unit = { + Description = "Dynamic output configuration"; + Documentation = "man:kanshi(1)"; + PartOf = cfg.systemdTarget; + Requires = cfg.systemdTarget; + After = cfg.systemdTarget; + }; + + Service = { + Type = "simple"; + ExecStart = "${cfg.package}/bin/kanshi"; + Restart = "always"; + }; + + Install = { WantedBy = [ cfg.systemdTarget ]; }; + }; + } + ]); } diff --git a/tests/modules/services/kanshi/basic-configuration.nix b/tests/modules/services/kanshi/basic-configuration.nix index c5706e635ae3..ffb6db7b1836 100644 --- a/tests/modules/services/kanshi/basic-configuration.nix +++ b/tests/modules/services/kanshi/basic-configuration.nix @@ -47,6 +47,11 @@ ''; }; + test.asserts.warnings.expected = [ + "kanshi.profiles option is deprecated. Use kanshi.settings instead." + "kanshi.extraConfig option is deprecated. Use kanshi.settings instead." + ]; + nmt.script = '' serviceFile=home-files/.config/systemd/user/kanshi.service assertFileExists $serviceFile diff --git a/tests/modules/services/kanshi/default.nix b/tests/modules/services/kanshi/default.nix index cb6b2a6b79f9..b7704b112780 100644 --- a/tests/modules/services/kanshi/default.nix +++ b/tests/modules/services/kanshi/default.nix @@ -1 +1,4 @@ -{ kanshi-basic-configuration = ./basic-configuration.nix; } +{ + kanshi-basic-configuration = ./basic-configuration.nix; + kanshi-new-configuration = ./new-configuration.nix; +} diff --git a/tests/modules/services/kanshi/new-configuration.conf b/tests/modules/services/kanshi/new-configuration.conf new file mode 100644 index 000000000000..c0858a048083 --- /dev/null +++ b/tests/modules/services/kanshi/new-configuration.conf @@ -0,0 +1,19 @@ +include "path/to/included/file" +output "*" enable +profile nomad { + output "eDP-1" enable +} + +profile desktop { + output "eDP-1" disable + output "Iiyama North America PLE2483H-DP" enable position 0,0 + output "Iiyama North America PLE2483H-DP 1158765348486" enable mode 1920x1080 position 1920,0 scale 2.100000 transform flipped-270 + exec echo "1 two 3" + exec echo "4 five 6" +} + +profile { + output "LVDS-1" enable + exec echo "7 eight 9" +} + diff --git a/tests/modules/services/kanshi/new-configuration.nix b/tests/modules/services/kanshi/new-configuration.nix new file mode 100644 index 000000000000..9b3a36478a77 --- /dev/null +++ b/tests/modules/services/kanshi/new-configuration.nix @@ -0,0 +1,63 @@ +{ config, pkgs, ... }: { + config = { + services.kanshi = { + enable = true; + package = config.lib.test.mkStubPackage { }; + settings = [ + { include = "path/to/included/file"; } + { + output = { + criteria = "*"; + status = "enable"; + }; + } + { + profile.name = "nomad"; + profile.outputs = [{ + criteria = "eDP-1"; + status = "enable"; + }]; + } + { + profile.name = "desktop"; + profile.exec = [ ''echo "1 two 3"'' ''echo "4 five 6"'' ]; + profile.outputs = [ + { + criteria = "eDP-1"; + status = "disable"; + } + { + criteria = "Iiyama North America PLE2483H-DP"; + status = "enable"; + position = "0,0"; + } + { + criteria = "Iiyama North America PLE2483H-DP 1158765348486"; + status = "enable"; + position = "1920,0"; + scale = 2.1; + mode = "1920x1080"; + transform = "flipped-270"; + } + ]; + } + { + profile.outputs = [{ + criteria = "LVDS-1"; + status = "enable"; + }]; + profile.exec = ''echo "7 eight 9"''; + } + ]; + }; + + nmt.script = '' + serviceFile=home-files/.config/systemd/user/kanshi.service + assertFileExists $serviceFile + + assertFileExists home-files/.config/kanshi/config + assertFileContent home-files/.config/kanshi/config \ + ${./new-configuration.conf} + ''; + }; +} From c6ddd80fb1e5a286b3a5cb32ef94a2e4e346a9d3 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 22 Apr 2024 22:34:22 -0500 Subject: [PATCH 262/636] hyprlock: add module --- modules/misc/news.nix | 11 ++ modules/modules.nix | 1 + modules/programs/hyprlock.nix | 127 ++++++++++++ tests/default.nix | 1 + .../hyprlock/basic-configuration.conf | 27 +++ .../programs/hyprlock/basic-configuration.nix | 45 +++++ .../hyprlock/complex-configuration.conf | 167 ++++++++++++++++ .../hyprlock/complex-configuration.nix | 183 ++++++++++++++++++ tests/modules/programs/hyprlock/default.nix | 4 + 9 files changed, 566 insertions(+) create mode 100644 modules/programs/hyprlock.nix create mode 100644 tests/modules/programs/hyprlock/basic-configuration.conf create mode 100644 tests/modules/programs/hyprlock/basic-configuration.nix create mode 100644 tests/modules/programs/hyprlock/complex-configuration.conf create mode 100644 tests/modules/programs/hyprlock/complex-configuration.nix create mode 100644 tests/modules/programs/hyprlock/default.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 6319d63533a2..dbbca455b0b0 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1618,6 +1618,17 @@ in { https://github.com/fastfetch-cli/fastfetch for more. ''; } + + { + time = "2024-05-10T11:48:34+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'programs.hyprlock'. + + Hyprland's simple, yet multi-threaded and GPU-accelerated screen + locking utility. See https://github.com/hyprwm/hyprlock for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 22664091ccc4..056923562cae 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -118,6 +118,7 @@ let ./programs/hstr.nix ./programs/htop.nix ./programs/hyfetch.nix + ./programs/hyprlock.nix ./programs/i3blocks.nix ./programs/i3status-rust.nix ./programs/i3status.nix diff --git a/modules/programs/hyprlock.nix b/modules/programs/hyprlock.nix new file mode 100644 index 000000000000..25d87188951a --- /dev/null +++ b/modules/programs/hyprlock.nix @@ -0,0 +1,127 @@ +{ config, pkgs, lib, ... }: + +with lib; + +let + + cfg = config.programs.hyprlock; + +in { + meta.maintainers = [ maintainers.khaneliman maintainers.fufexan ]; + + options.programs.hyprlock = { + enable = mkEnableOption "" // { + description = '' + Whether to enable Hyprlock, Hyprland's GPU-accelerated lock screen + utility. + + Note that PAM must be configured to enable hyprlock to perform + authentication. The package installed through home-manager will *not* be + able to unlock the session without this configuration. + + On NixOS, it can be enabled using: + + ```nix + security.pam.services.hyprlock = {}; + ``` + ''; + }; + + package = mkPackageOption pkgs "hyprlock" { }; + + settings = lib.mkOption { + type = with lib.types; + let + valueType = nullOr (oneOf [ + bool + int + float + str + path + (attrsOf valueType) + (listOf valueType) + ]) // { + description = "Hyprlock configuration value"; + }; + in valueType; + default = { }; + example = lib.literalExpression '' + { + general = { + disable_loading_bar = true; + grace = 300; + hide_cursor = true; + no_fade_in = false; + }; + + background = [ + { + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + } + ]; + + input-field = [ + { + size = "200, 50"; + position = "0, -80"; + monitor = ""; + dots_center = true; + fade_on_empty = false; + font_color = "rgb(202, 211, 245)"; + inner_color = "rgb(91, 96, 120)"; + outer_color = "rgb(24, 25, 38)"; + outline_thickness = 5; + placeholder_text = '\'Password...'\'; + shadow_passes = 2; + } + ]; + } + ''; + description = '' + Hyprlock configuration written in Nix. Entries with the same key should + be written as lists. Variables' and colors' names should be quoted. See + for more examples. + ''; + }; + + extraConfig = lib.mkOption { + type = lib.types.lines; + default = ""; + description = '' + Extra configuration lines to add to `~/.config/hypr/hyprlock.conf`. + ''; + }; + + sourceFirst = lib.mkEnableOption '' + putting source entries at the top of the configuration + '' // { + default = true; + }; + + importantPrefixes = lib.mkOption { + type = with lib.types; listOf str; + default = [ "$" "monitor" "size" ] + ++ lib.optionals cfg.sourceFirst [ "source" ]; + example = [ "$" "monitor" "size" ]; + description = '' + List of prefix of attributes to source at the top of the config. + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + + xdg.configFile."hypr/hyprlock.conf" = + let shouldGenerate = cfg.extraConfig != "" || cfg.settings != { }; + in mkIf shouldGenerate { + text = lib.optionalString (cfg.settings != { }) + (lib.hm.generators.toHyprconf { + attrs = cfg.settings; + inherit (cfg) importantPrefixes; + }) + lib.optionalString (cfg.extraConfig != null) cfg.extraConfig; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 0ebf47151522..f5b0cbc65ffd 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -197,6 +197,7 @@ in import nmtSrc { ./modules/programs/gnome-shell ./modules/programs/gnome-terminal ./modules/programs/hexchat + ./modules/programs/hyprlock ./modules/programs/i3blocks ./modules/programs/i3status-rust ./modules/programs/imv diff --git a/tests/modules/programs/hyprlock/basic-configuration.conf b/tests/modules/programs/hyprlock/basic-configuration.conf new file mode 100644 index 000000000000..3fdf9ce3d729 --- /dev/null +++ b/tests/modules/programs/hyprlock/basic-configuration.conf @@ -0,0 +1,27 @@ +background { + monitor= + blur_passes=3 + blur_size=8 + path=screenshot +} + +general { + disable_loading_bar=true + grace=300 + hide_cursor=true + no_fade_in=false +} + +input-field { + monitor= + size=200, 50 + dots_center=true + fade_on_empty=false + font_color=rgb(202, 211, 245) + inner_color=rgb(91, 96, 120) + outer_color=rgb(24, 25, 38) + outline_thickness=5 + placeholder_text=Password... + position=0, -80 + shadow_passes=2 +} diff --git a/tests/modules/programs/hyprlock/basic-configuration.nix b/tests/modules/programs/hyprlock/basic-configuration.nix new file mode 100644 index 000000000000..c4f6821e6c0f --- /dev/null +++ b/tests/modules/programs/hyprlock/basic-configuration.nix @@ -0,0 +1,45 @@ +{ ... }: + +{ + programs.hyprlock = { + enable = true; + + settings = { + general = { + disable_loading_bar = true; + grace = 300; + hide_cursor = true; + no_fade_in = false; + }; + + background = [{ + monitor = ""; + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + }]; + + input-field = [{ + size = "200, 50"; + position = "0, -80"; + monitor = ""; + dots_center = true; + fade_on_empty = false; + font_color = "rgb(202, 211, 245)"; + inner_color = "rgb(91, 96, 120)"; + outer_color = "rgb(24, 25, 38)"; + outline_thickness = 5; + placeholder_text = ''Password...''; + shadow_passes = 2; + }]; + }; + }; + + test.stubs.hyprlock = { }; + + nmt.script = '' + assertFileContent \ + home-files/.config/hypr/hyprlock.conf \ + ${./basic-configuration.conf} + ''; +} diff --git a/tests/modules/programs/hyprlock/complex-configuration.conf b/tests/modules/programs/hyprlock/complex-configuration.conf new file mode 100644 index 000000000000..1936f43f9ebe --- /dev/null +++ b/tests/modules/programs/hyprlock/complex-configuration.conf @@ -0,0 +1,167 @@ +background { + monitor= + blur_passes=3 + blur_size=8 + brightness=0.817200 + color=rgba(25, 20, 20, 1.0) + contrast=0.891700 + noise=0.011700 + path=screenshot + vibrancy=0.168600 + vibrancy_darkness=0.050000 +} + +general { + disable_loading_bar=true + grace=300 + hide_cursor=true + ignore_empty_input=false + no_fade_in=false + no_fade_out=false +} + +image { + monitor= + size=120 + border_color=rgb(202, 211, 245) + border_size=5 + halign=center + path=/home/$USER/.face + position=0, 45 + reload_cmd= + reload_time=-1 + rotate=0.000000 + rounding=-1 + shadow_passes=1 + valign=center +} + +input-field { + monitor= + size=200, 50 + bothlock_color=-1 + capslock_color=-1 + check_color=rgb(204, 136, 34) + dots_center=true + dots_rounding=-1 + dots_size=0.330000 + dots_spacing=0.150000 + fade_on_empty=false + fade_timeout=2000 + fail_color=rgb(204, 34, 34) + fail_text=$FAIL + fail_transition=300 + font_color=rgb(202, 211, 245) + halign=center + hide_input=false + inner_color=rgb(91, 96, 120) + invert_numlock=false + numlock_color=-1 + outer_color=rgb(24, 25, 38) + outline_thickness=5 + placeholder_text=Password... + position=0, -80 + rounding=-1 + shadow_boost=1.200000 + shadow_color=rgba(0, 0, 0, 1.0) + shadow_passes=2 + shadow_size=3 + swap_font_color=false + valign=center +} + +label { + monitor= + color=rgb(202, 211, 245) + font_family=MonaspiceNe Nerd Font + font_size=100 + halign=center + position=0, 330 + rotate=0.000000 + shadow_boost=1.200000 + shadow_color=rgba(0, 0, 0, 1.0) + shadow_passes=2 + shadow_size=3 + text=$TIME + valign=center +} + +label { + monitor= + color=rgb(202, 211, 245) + font_family=MonaspiceNe Nerd Font + font_size=25 + halign=left + position=10, 0 + rotate=0.000000 + shadow_boost=1.200000 + shadow_color=rgba(0, 0, 0, 1.0) + shadow_passes=1 + shadow_size=3 + text= $USER + valign=top +} + +label { + monitor= + color=rgb(202, 211, 245) + font_family=MonaspiceNe Nerd Font + font_size=50 + halign=center + position=15, -350 + rotate=0.000000 + shadow_boost=1.200000 + shadow_color=rgba(0, 0, 0, 1.0) + shadow_passes=1 + shadow_size=3 + text=󰌾 + valign=center +} + +label { + monitor= + color=rgb(202, 211, 245) + font_family=MonaspiceNe Nerd Font + font_size=25 + halign=center + position=0, -430 + rotate=0.000000 + shadow_boost=1.200000 + shadow_color=rgba(0, 0, 0, 1.0) + shadow_passes=1 + shadow_size=3 + text=Locked + valign=center +} + +label { + monitor= + color=rgb(202, 211, 245) + font_family=MonaspiceNe Nerd Font + font_size=30 + halign=center + position=0, 210 + rotate=0.000000 + shadow_boost=1.200000 + shadow_color=rgba(0, 0, 0, 1.0) + shadow_passes=1 + shadow_size=3 + text=cmd[update:120000] echo "$(date +'%a %d %B')" + valign=center +} + +label { + monitor= + color=rgb(202, 211, 245) + font_family=MonaspiceNe Nerd Font + font_size=25 + halign=right + position=5, 8 + rotate=0.000000 + shadow_boost=1.200000 + shadow_color=rgba(0, 0, 0, 1.0) + shadow_passes=1 + shadow_size=3 + text= + valign=bottom +} diff --git a/tests/modules/programs/hyprlock/complex-configuration.nix b/tests/modules/programs/hyprlock/complex-configuration.nix new file mode 100644 index 000000000000..8544a8c52e13 --- /dev/null +++ b/tests/modules/programs/hyprlock/complex-configuration.nix @@ -0,0 +1,183 @@ +{ ... }: + +{ + programs.hyprlock = { + enable = true; + + settings = { + general = { + disable_loading_bar = true; + hide_cursor = true; + ignore_empty_input = false; + grace = 300; + no_fade_in = false; + no_fade_out = false; + }; + + background = [{ + monitor = ""; + brightness = "0.817200"; + color = "rgba(25, 20, 20, 1.0)"; + path = "screenshot"; + blur_passes = 3; + blur_size = 8; + contrast = "0.891700"; + noise = "0.011700"; + vibrancy = "0.168600"; + vibrancy_darkness = "0.050000"; + }]; + + input-field = [{ + monitor = ""; + size = "200, 50"; + position = "0, -80"; + outline_thickness = 5; + dots_center = true; + outer_color = "rgb(24, 25, 38)"; + inner_color = "rgb(91, 96, 120)"; + font_color = "rgb(202, 211, 245)"; + fade_on_empty = false; + placeholder_text = ''Password...''; + shadow_passes = 2; + bothlock_color = -1; + capslock_color = "-1"; + check_color = "rgb(204, 136, 34)"; + dots_rounding = "-1"; + dots_size = "0.330000"; + dots_spacing = "0.150000"; + fade_timeout = "2000"; + fail_color = "rgb(204, 34, 34)"; + fail_text = "$FAIL"; + fail_transition = 300; + halign = "center"; + hide_input = false; + invert_numlock = false; + numlock_color = -1; + rounding = -1; + shadow_boost = "1.200000"; + shadow_color = "rgba(0, 0, 0, 1.0)"; + shadow_size = 3; + swap_font_color = false; + valign = "center"; + }]; + + image = [{ + monitor = ""; + size = 120; + position = "0, 45"; + path = "/home/$USER/.face"; + border_color = "rgb(202, 211, 245)"; + border_size = 5; + halign = "center"; + valign = "center"; + shadow_passes = 1; + reload_cmd = ""; + reload_time = -1; + rotate = "0.000000"; + rounding = "-1"; + }]; + + label = [ + { + monitor = ""; + text = ''$TIME''; + color = "rgb(202, 211, 245)"; + font_size = 100; + font_family = "MonaspiceNe Nerd Font"; + valign = "center"; + halign = "center"; + position = "0, 330"; + shadow_passes = 2; + rotate = "0.000000"; + shadow_boost = "1.200000"; + shadow_color = "rgba(0, 0, 0, 1.0)"; + shadow_size = 3; + } + { + monitor = ""; + text = '' $USER''; + color = "rgb(202, 211, 245)"; + font_size = 25; + font_family = "MonaspiceNe Nerd Font"; + valign = "top"; + halign = "left"; + position = "10, 0"; + rotate = "0.000000"; + shadow_boost = "1.200000"; + shadow_color = "rgba(0, 0, 0, 1.0)"; + shadow_size = 3; + shadow_passes = 1; + } + { + monitor = ""; + text = ''󰌾 ''; + color = "rgb(202, 211, 245)"; + font_size = 50; + font_family = "MonaspiceNe Nerd Font"; + valign = "center"; + halign = "center"; + position = "15, -350"; + rotate = "0.000000"; + shadow_boost = "1.200000"; + shadow_color = "rgba(0, 0, 0, 1.0)"; + shadow_size = 3; + shadow_passes = 1; + } + { + monitor = ""; + text = ''Locked''; + color = "rgb(202, 211, 245)"; + font_size = 25; + font_family = "MonaspiceNe Nerd Font"; + valign = "center"; + halign = "center"; + position = "0, -430"; + rotate = "0.000000"; + shadow_boost = "1.200000"; + shadow_color = "rgba(0, 0, 0, 1.0)"; + shadow_size = 3; + shadow_passes = 1; + } + { + monitor = ""; + text = '' + cmd[update:120000] echo "$(date +'%a %d %B')"''; + color = "rgb(202, 211, 245)"; + font_size = 30; + font_family = "MonaspiceNe Nerd Font"; + valign = "center"; + halign = "center"; + position = "0, 210"; + rotate = "0.000000"; + shadow_boost = "1.200000"; + shadow_color = "rgba(0, 0, 0, 1.0)"; + shadow_size = 3; + shadow_passes = 1; + } + { + monitor = ""; + text = '' ''; + color = "rgb(202, 211, 245)"; + font_size = 25; + font_family = "MonaspiceNe Nerd Font"; + valign = "bottom"; + halign = "right"; + position = "5, 8"; + rotate = "0.000000"; + shadow_boost = "1.200000"; + shadow_color = "rgba(0, 0, 0, 1.0)"; + shadow_size = 3; + shadow_passes = 1; + } + ]; + }; + }; + + test.stubs.hyprlock = { }; + + nmt.script = '' + assertFileContent \ + home-files/.config/hypr/hyprlock.conf \ + ${./complex-configuration.conf} + ''; +} diff --git a/tests/modules/programs/hyprlock/default.nix b/tests/modules/programs/hyprlock/default.nix new file mode 100644 index 000000000000..3ea18c021f47 --- /dev/null +++ b/tests/modules/programs/hyprlock/default.nix @@ -0,0 +1,4 @@ +{ + hyprlock-basic-configuration = ./basic-configuration.nix; + hyprlock-complex-configuration = ./complex-configuration.nix; +} From 223743313bab8b0b44a57eaf9573de9f69082b4d Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Sat, 27 Apr 2024 09:54:16 -0500 Subject: [PATCH 263/636] hyprpaper: add module --- modules/misc/news.nix | 13 +++ modules/modules.nix | 1 + modules/services/hyprpaper.nix | 89 +++++++++++++++++++ tests/default.nix | 1 + .../hyprpaper/basic-configuration.nix | 30 +++++++ tests/modules/services/hyprpaper/default.nix | 1 + .../modules/services/hyprpaper/hyprpaper.conf | 7 ++ 7 files changed, 142 insertions(+) create mode 100644 modules/services/hyprpaper.nix create mode 100644 tests/modules/services/hyprpaper/basic-configuration.nix create mode 100644 tests/modules/services/hyprpaper/default.nix create mode 100644 tests/modules/services/hyprpaper/hyprpaper.conf diff --git a/modules/misc/news.nix b/modules/misc/news.nix index dbbca455b0b0..b83d0858c03a 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1629,6 +1629,19 @@ in { locking utility. See https://github.com/hyprwm/hyprlock for more. ''; } + + { + time = "2024-05-10T13:35:19+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.hyprpaper'. + + Hyprpaper is a blazing fast wallpaper utility for Hyprland with the + ability to dynamically change wallpapers through sockets. It will work + on all wlroots-based compositors, though. See + https://github.com/hyprwm/hyprpaper for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 056923562cae..e1b08087d146 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -306,6 +306,7 @@ let ./services/home-manager-auto-upgrade.nix ./services/hound.nix ./services/hypridle.nix + ./services/hyprpaper.nix ./services/imapnotify.nix ./services/kanshi.nix ./services/kbfs.nix diff --git a/modules/services/hyprpaper.nix b/modules/services/hyprpaper.nix new file mode 100644 index 000000000000..ede09b258cae --- /dev/null +++ b/modules/services/hyprpaper.nix @@ -0,0 +1,89 @@ +{ config, lib, pkgs, ... }: +with lib; +let + + cfg = config.services.hyprpaper; +in { + meta.maintainers = [ maintainers.khaneliman maintainers.fufexan ]; + + options.services.hyprpaper = { + enable = mkEnableOption "Hyprpaper, Hyprland's wallpaper daemon"; + + package = mkPackageOption pkgs "hyprpaper" { }; + + settings = lib.mkOption { + type = with lib.types; + let + valueType = nullOr (oneOf [ + bool + int + float + str + path + (attrsOf valueType) + (listOf valueType) + ]) // { + description = "Hyprpaper configuration value"; + }; + in valueType; + default = { }; + description = '' + hyprpaper configuration written in Nix. Entries with the same key + should be written as lists. Variables' and colors' names should be + quoted. See for more examples. + ''; + example = lib.literalExpression '' + { + ipc = "on"; + splash = false; + splash_offset = 2.0; + + preload = + [ "/share/wallpapers/buttons.png" "/share/wallpapers/cat_pacman.png" ]; + + wallpaper = [ + "DP-3,/share/wallpapers/buttons.png" + "DP-1,/share/wallpapers/cat_pacman.png" + ]; + } + ''; + }; + + importantPrefixes = lib.mkOption { + type = with lib.types; listOf str; + default = [ "$" ]; + example = [ "$" ]; + description = '' + List of prefix of attributes to source at the top of the config. + ''; + }; + }; + + config = mkIf cfg.enable { + xdg.configFile."hypr/hyprpaper.conf" = mkIf (cfg.settings != { }) { + text = lib.hm.generators.toHyprconf { + attrs = cfg.settings; + inherit (cfg) importantPrefixes; + }; + }; + + systemd.user.services.hyprpaper = { + Install = { WantedBy = [ "graphical-session.target" ]; }; + + Unit = { + ConditionEnvironment = "WAYLAND_DISPLAY"; + Description = "hyprpaper"; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" ]; + X-Restart-Triggers = + [ "${config.xdg.configFile."hypr/hyprpaper.conf".source}" ]; + }; + + Service = { + ExecStart = "${getExe cfg.package}"; + Restart = "always"; + RestartSec = "10"; + }; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index f5b0cbc65ffd..3b52ff404411 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -243,6 +243,7 @@ in import nmtSrc { ./modules/services/gromit-mpx ./modules/services/home-manager-auto-upgrade ./modules/services/hypridle + ./modules/services/hyprpaper ./modules/services/imapnotify ./modules/services/kanshi ./modules/services/lieer diff --git a/tests/modules/services/hyprpaper/basic-configuration.nix b/tests/modules/services/hyprpaper/basic-configuration.nix new file mode 100644 index 000000000000..7bf944fbda7d --- /dev/null +++ b/tests/modules/services/hyprpaper/basic-configuration.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: + +{ + services.hyprpaper = { + enable = true; + settings = { + ipc = "on"; + splash = false; + splash_offset = 2.0; + + preload = + [ "/share/wallpapers/buttons.png" "/share/wallpapers/cat_pacman.png" ]; + + wallpaper = [ + "DP-3,/share/wallpapers/buttons.png" + "DP-1,/share/wallpapers/cat_pacman.png" + ]; + }; + }; + + test.stubs.hyprpaper = { }; + + nmt.script = '' + config=home-files/.config/hypr/hyprpaper.conf + clientServiceFile=home-files/.config/systemd/user/hyprpaper.service + assertFileExists $config + assertFileExists $clientServiceFile + assertFileContent $config ${./hyprpaper.conf} + ''; +} diff --git a/tests/modules/services/hyprpaper/default.nix b/tests/modules/services/hyprpaper/default.nix new file mode 100644 index 000000000000..2a5abbfedf0b --- /dev/null +++ b/tests/modules/services/hyprpaper/default.nix @@ -0,0 +1 @@ +{ hyprpaper-basic-configuration = ./basic-configuration.nix; } diff --git a/tests/modules/services/hyprpaper/hyprpaper.conf b/tests/modules/services/hyprpaper/hyprpaper.conf new file mode 100644 index 000000000000..d7b4ccb4fc48 --- /dev/null +++ b/tests/modules/services/hyprpaper/hyprpaper.conf @@ -0,0 +1,7 @@ +ipc=on +preload=/share/wallpapers/buttons.png +preload=/share/wallpapers/cat_pacman.png +splash=false +splash_offset=2.000000 +wallpaper=DP-3,/share/wallpapers/buttons.png +wallpaper=DP-1,/share/wallpapers/cat_pacman.png From f55718aec361f6a5101f07e3203106f85d6cad20 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 9 Feb 2024 18:09:33 +0100 Subject: [PATCH 264/636] hyprland: add support for XDG autostart using systemd Using the option wayland.windowManager.hyprland.systemd.enableXdgAutostart users can now choose to start applications present in `$XDG_CONFIG_HOME/autostart` when starting their sway session. See 0144ac418ef633bfc9dbd89b8c199ad3a617c59f and https://github.com/nix-community/home-manager/pull/3747 --- modules/services/window-managers/hyprland.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index 4f1c9e929e9d..ff162fb307d8 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -102,6 +102,10 @@ in { ]; description = "Extra commands to be run after D-Bus activation."; }; + + enableXdgAutostart = lib.mkEnableOption '' + autostart of applications using + {manpage}`systemd-xdg-autostart-generator(8)`''; }; xwayland.enable = lib.mkEnableOption "XWayland" // { default = true; }; @@ -247,8 +251,12 @@ in { Description = "Hyprland compositor session"; Documentation = [ "man:systemd.special(7)" ]; BindsTo = [ "graphical-session.target" ]; - Wants = [ "graphical-session-pre.target" ]; + Wants = [ "graphical-session-pre.target" ] + ++ lib.optional cfg.systemd.enableXdgAutostart + "xdg-desktop-autostart.target"; After = [ "graphical-session-pre.target" ]; + Before = lib.mkIf cfg.systemd.enableXdgAutostart + [ "xdg-desktop-autostart.target" ]; }; }; From e6a315900db775da3bb3138bab8caa70dafdaf9e Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Fri, 10 May 2024 18:26:25 +0200 Subject: [PATCH 265/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/63c3a29ca82437c87573e4c6919b09a24ea61b0f' (2024-05-02) → 'github:NixOS/nixpkgs/25865a40d14b3f9cf19f19b924e2ab4069b09588' (2024-05-05) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 5913a4e4d7ca..cfe58270fed5 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1714635257, - "narHash": "sha256-4cPymbty65RvF1DWQfc+Bc8B233A1BWxJnNULJKQ1EY=", + "lastModified": 1714906307, + "narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "63c3a29ca82437c87573e4c6919b09a24ea61b0f", + "rev": "25865a40d14b3f9cf19f19b924e2ab4069b09588", "type": "github" }, "original": { From f2c5ba5e720fd584d83f2f97399dac0d26ae60b9 Mon Sep 17 00:00:00 2001 From: ilkecan Date: Fri, 18 Feb 2022 23:34:39 +0000 Subject: [PATCH 266/636] fontconfig: add defaultFonts.* options --- modules/misc/fontconfig.nix | 96 ++++++++++++++++++++++++++++++++----- 1 file changed, 85 insertions(+), 11 deletions(-) diff --git a/modules/misc/fontconfig.nix b/modules/misc/fontconfig.nix index 49fef96a983e..9bc6ac47b3d8 100644 --- a/modules/misc/fontconfig.nix +++ b/modules/misc/fontconfig.nix @@ -1,3 +1,7 @@ +# This module is heavily inspired by the corresponding NixOS module. See +# +# https://github.com/NixOS/nixpkgs/blob/23.11/nixos/modules/config/fonts/fontconfig.nix + { config, lib, pkgs, ... }: with lib; @@ -32,6 +36,50 @@ in { {command}`nix-env`. ''; }; + + defaultFonts = { + monospace = mkOption { + type = with types; listOf str; + default = [ ]; + description = '' + Per-user default monospace font(s). Multiple fonts may be listed in + case multiple languages must be supported. + ''; + }; + + sansSerif = mkOption { + type = with types; listOf str; + default = [ ]; + description = '' + Per-user default sans serif font(s). Multiple fonts may be listed + in case multiple languages must be supported. + ''; + }; + + serif = mkOption { + type = with types; listOf str; + default = [ ]; + description = '' + Per-user default serif font(s). Multiple fonts may be listed in + case multiple languages must be supported. + ''; + }; + + emoji = mkOption { + type = with types; listOf str; + default = [ ]; + description = '' + Per-user default emoji font(s). Multiple fonts may be listed in + case a font does not support all emoji. + + Note that fontconfig matches color emoji fonts preferentially, + so if you want to use a black and white font while having + a color font installed (eg. Noto Color Emoji installed alongside + Noto Emoji), fontconfig will still choose the color font even + when it is later in the list. + ''; + }; + }; }; }; @@ -71,26 +119,52 @@ in { fi ''; - xdg.configFile = { - "fontconfig/conf.d/10-hm-fonts.conf".text = '' + xdg.configFile = let + mkFontconfigConf = conf: '' - Add fonts in the Nix user profile + ${conf} + + ''; + in { + "fontconfig/conf.d/10-hm-fonts.conf".text = mkFontconfigConf '' + Add fonts in the Nix user profile - ${config.home.path}/etc/fonts/conf.d - ${config.home.path}/etc/fonts/fonts.conf + ${config.home.path}/etc/fonts/conf.d + ${config.home.path}/etc/fonts/fonts.conf - ${config.home.path}/lib/X11/fonts - ${config.home.path}/share/fonts - ${profileDirectory}/lib/X11/fonts - ${profileDirectory}/share/fonts + ${config.home.path}/lib/X11/fonts + ${config.home.path}/share/fonts + ${profileDirectory}/lib/X11/fonts + ${profileDirectory}/share/fonts - ${config.home.path}/lib/fontconfig/cache - + ${config.home.path}/lib/fontconfig/cache + ''; + + "fontconfig/conf.d/52-hm-default-fonts.conf".text = let + genDefault = fonts: name: + optionalString (fonts != [ ]) '' + + ${name} + + ${ + concatStringsSep "" (map (font: '' + ${font} + '') fonts) + } + + + ''; + in mkFontconfigConf '' + + ${genDefault cfg.defaultFonts.sansSerif "sans-serif"} + ${genDefault cfg.defaultFonts.serif "serif"} + ${genDefault cfg.defaultFonts.monospace "monospace"} + ${genDefault cfg.defaultFonts.emoji "emoji"} ''; }; }; From 5514ed321087f0b5af42564352d135acad4ff055 Mon Sep 17 00:00:00 2001 From: Akiyoshi Suda Date: Tue, 25 Oct 2022 21:31:46 +0900 Subject: [PATCH 267/636] yambar: add module --- modules/misc/news.nix | 14 +++++ modules/modules.nix | 1 + modules/programs/yambar.nix | 55 +++++++++++++++++++ tests/default.nix | 1 + tests/modules/programs/yambar/default.nix | 4 ++ .../programs/yambar/empty-settings.nix | 11 ++++ .../yambar/example-settings-expected.yml | 9 +++ .../programs/yambar/example-settings.nix | 35 ++++++++++++ 8 files changed, 130 insertions(+) create mode 100644 modules/programs/yambar.nix create mode 100644 tests/modules/programs/yambar/default.nix create mode 100644 tests/modules/programs/yambar/empty-settings.nix create mode 100644 tests/modules/programs/yambar/example-settings-expected.yml create mode 100644 tests/modules/programs/yambar/example-settings.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index b83d0858c03a..2164d66a5bfb 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1642,6 +1642,20 @@ in { https://github.com/hyprwm/hyprpaper for more. ''; } + + { + time = "2024-05-10T21:28:38+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'programs.yambar'. + + Yambar is a lightweight and configurable status panel for X11 and + Wayland, that goes to great lengths to be both CPU and battery + efficient - polling is only done when absolutely necessary. + + See https://codeberg.org/dnkl/yambar for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index e1b08087d146..4e1f0e201ada 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -254,6 +254,7 @@ let ./programs/wpaperd.nix ./programs/xmobar.nix ./programs/xplr.nix + ./programs/yambar.nix ./programs/yazi.nix ./programs/yt-dlp.nix ./programs/z-lua.nix diff --git a/modules/programs/yambar.nix b/modules/programs/yambar.nix new file mode 100644 index 000000000000..f4e0a434ae34 --- /dev/null +++ b/modules/programs/yambar.nix @@ -0,0 +1,55 @@ +{ config, lib, pkgs, ... }: + +let + + cfg = config.programs.yambar; + yamlFormat = pkgs.formats.yaml { }; + +in { + meta.maintainers = [ lib.maintainers.carpinchomug ]; + + options.programs.yambar = { + enable = lib.mkEnableOption "Yambar"; + + package = lib.mkPackageOption pkgs "yambar" { }; + + settings = lib.mkOption { + type = yamlFormat.type; + default = { }; + example = lib.literalExpression '' + bar = { + location = "top"; + height = 26; + background = "00000066"; + + right = [ + { + clock.content = [ + { + string.text = "{time}"; + } + ]; + } + ]; + }; + ''; + description = '' + Configuration written to {file}`$XDG_CONFIG_HOME/yambar/config.yml`. + See {manpage}`yambar(5)` for options. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "programs.yambar" pkgs + lib.platforms.linux) + ]; + + home.packages = [ cfg.package ]; + + xdg.configFile."yambar/config.yml" = lib.mkIf (cfg.settings != { }) { + source = yamlFormat.generate "config.yml" cfg.settings; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 3b52ff404411..4d8d49d456c4 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -219,6 +219,7 @@ in import nmtSrc { ./modules/programs/wofi ./modules/programs/wpaperd ./modules/programs/xmobar + ./modules/programs/yambar ./modules/programs/yt-dlp ./modules/services/activitywatch ./modules/services/avizo diff --git a/tests/modules/programs/yambar/default.nix b/tests/modules/programs/yambar/default.nix new file mode 100644 index 000000000000..26de56732c98 --- /dev/null +++ b/tests/modules/programs/yambar/default.nix @@ -0,0 +1,4 @@ +{ + yambar-empty-settings = ./empty-settings.nix; + yambar-example-settings = ./example-settings.nix; +} diff --git a/tests/modules/programs/yambar/empty-settings.nix b/tests/modules/programs/yambar/empty-settings.nix new file mode 100644 index 000000000000..56cdf27d05b2 --- /dev/null +++ b/tests/modules/programs/yambar/empty-settings.nix @@ -0,0 +1,11 @@ +{ ... }: + +{ + programs.yambar.enable = true; + + test.stubs.yambar = { }; + + nmt.script = '' + assertPathNotExists home-files/.config/yambar + ''; +} diff --git a/tests/modules/programs/yambar/example-settings-expected.yml b/tests/modules/programs/yambar/example-settings-expected.yml new file mode 100644 index 000000000000..0bd9120a9d16 --- /dev/null +++ b/tests/modules/programs/yambar/example-settings-expected.yml @@ -0,0 +1,9 @@ +bar: + background: '00000066' + height: 26 + location: top + right: + - clock: + content: + - string: + text: '{time}' diff --git a/tests/modules/programs/yambar/example-settings.nix b/tests/modules/programs/yambar/example-settings.nix new file mode 100644 index 000000000000..de572090c3cd --- /dev/null +++ b/tests/modules/programs/yambar/example-settings.nix @@ -0,0 +1,35 @@ +{ config, ... }: + +{ + programs.yambar = { + enable = true; + package = config.lib.test.mkStubPackage { }; + + settings = { + bar = { + location = "top"; + height = 26; + background = "00000066"; + right = [{ clock.content = [{ string.text = "{time}"; }]; }]; + }; + }; + }; + + nmt.script = '' + assertFileContent \ + home-files/.config/yambar/config.yml \ + ${ + builtins.toFile "yambar-expected.yml" '' + bar: + background: '00000066' + height: 26 + location: top + right: + - clock: + content: + - string: + text: '{time}' + '' + } + ''; +} From 15d7ec30511199349c6cf8b6cbdc5e205a6a15e8 Mon Sep 17 00:00:00 2001 From: Hraban Luyat Date: Wed, 21 Feb 2024 16:15:28 -0500 Subject: [PATCH 268/636] darwin: misc defaults (dock, menu clock, finder) --- .../darwin/user-defaults/opts-allhosts.nix | 100 +++++++++++++++++- 1 file changed, 97 insertions(+), 3 deletions(-) diff --git a/modules/targets/darwin/user-defaults/opts-allhosts.nix b/modules/targets/darwin/user-defaults/opts-allhosts.nix index 820f05b3d855..4a4f10671804 100644 --- a/modules/targets/darwin/user-defaults/opts-allhosts.nix +++ b/modules/targets/darwin/user-defaults/opts-allhosts.nix @@ -41,6 +41,19 @@ in { description = "Sets the measurement unit."; }; + ApplePressAndHoldEnabled = mkNullableOption { + type = types.bool; + example = true; + description = + "Repeat a key when it is held down (false) or display the accented character selector (true)"; + }; + + AppleShowAllExtensions = mkNullableOption { + type = types.bool; + example = true; + description = "Always show file extensions in Finder"; + }; + AppleTemperatureUnit = mkNullableOption { type = types.enum [ "Celsius" "Fahrenheit" ]; example = "Celsius"; @@ -49,6 +62,16 @@ in { AppleMetricUnits = mkNullableEnableOption "the metric system"; + KeyRepeat = mkNullableOption { + type = types.int; + example = 2; + description = '' + Interval between key repetitions when holding down a key. Lower is + faster. When setting through the control panel, 2 is the lowest value, + and 120 the highest. + ''; + }; + NSAutomaticCapitalizationEnabled = mkNullableEnableOption "automatic capitalization"; @@ -85,14 +108,50 @@ in { }; "com.apple.dock" = { + autohide = mkNullableOption { + type = types.bool; + example = true; + description = "Hide the Dock automatically"; + }; + expose-group-apps = mkNullableEnableOption + "grouping of windows by application in Mission Control"; + orientation = mkNullableOption { + type = types.enum [ "left" "bottom" "right" ]; + example = "left"; + description = "Position of the Dock on the screen"; + }; + size-immutable = mkNullableEnableOption "locking of the dock size"; tilesize = mkNullableOption { type = types.int; example = 64; description = "Sets the size of the dock."; }; - size-immutable = mkNullableEnableOption "locking of the dock size"; - expose-group-apps = mkNullableEnableOption - "grouping of windows by application in Mission Control"; + }; + + "com.apple.finder" = { + AppleShowAllFiles = mkNullableOption { + type = types.bool; + example = true; + description = "Show hidden files in Finder"; + }; + + FXRemoveOldTrashItems = mkNullableOption { + type = types.bool; + example = true; + description = "Automatically delete items from trash after 30 days"; + }; + + ShowPathBar = mkNullableOption { + type = types.bool; + example = true; + description = "Show the path bar at the bottom of a Finder window"; + }; + + ShowStatusBar = mkNullableOption { + type = types.bool; + example = true; + description = "Show the status bar at the bottom of a Finder window"; + }; }; "com.apple.menuextra.battery".ShowPercent = mkNullableOption { @@ -106,6 +165,41 @@ in { ''; }; + "com.apple.menuextra.clock" = { + IsAnalog = mkNullableEnableOption + "showing an analog clock instead of a digital one"; + + Show24Hour = mkNullableEnableOption + "showing a 24-hour clock, instead of a 12-hour clock"; + + ShowAMPM = mkNullableOption { + type = types.bool; + description = '' + Show the AM/PM label. Useful if Show24Hour is false. Default is null. + ''; + }; + + ShowDate = mkNullableOption { + type = types.enum [ 0 1 2 ]; + description = '' + Show the full date. Default is null. + + 0 = Show the date + 1 = Don't show + 2 = Don't show + + TODO: I don't know what the difference is between 1 and 2. + ''; + }; + + ShowDayOfMonth = mkNullableEnableOption "showing the day of the month"; + + ShowDayOfWeek = mkNullableEnableOption "showing the day of the week"; + + ShowSeconds = mkNullableEnableOption + "showing the clock with second precision, instead of minutes"; + }; + "com.apple.Safari" = { AutoOpenSafeDownloads = mkNullableEnableOption "opening of downloaded files"; From d939ce585c611c00ca44145a74acab04c20619ad Mon Sep 17 00:00:00 2001 From: winston Date: Sat, 11 May 2024 00:26:54 +0200 Subject: [PATCH 269/636] mopidy: make scan service depend on `mopidy-local` --- modules/services/mopidy.nix | 4 +++- .../modules/services/mopidy/basic-configuration.nix | 3 ++- tests/modules/services/mopidy/default.nix | 6 +++++- tests/modules/services/mopidy/mopidy-scan.nix | 13 +++++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 tests/modules/services/mopidy/mopidy-scan.nix diff --git a/modules/services/mopidy.nix b/modules/services/mopidy.nix index 37642a2903af..b02708578390 100644 --- a/modules/services/mopidy.nix +++ b/modules/services/mopidy.nix @@ -48,6 +48,8 @@ let configFilePaths = concatStringsSep ":" ([ "${config.xdg.configHome}/mopidy/mopidy.conf" ] ++ cfg.extraConfigFiles); + hasMopidyLocal = builtins.elem pkgs.mopidy-local cfg.extensionPackages; + in { meta.maintainers = [ hm.maintainers.foo-dogsquared ]; @@ -133,7 +135,7 @@ in { Install.WantedBy = [ "default.target" ]; }; - systemd.user.services.mopidy-scan = { + systemd.user.services.mopidy-scan = mkIf hasMopidyLocal { Unit = { Description = "mopidy local files scanner"; Documentation = [ "https://mopidy.com/" ]; diff --git a/tests/modules/services/mopidy/basic-configuration.nix b/tests/modules/services/mopidy/basic-configuration.nix index 418bfde1f6c5..2bffbd6819ef 100644 --- a/tests/modules/services/mopidy/basic-configuration.nix +++ b/tests/modules/services/mopidy/basic-configuration.nix @@ -3,6 +3,7 @@ { services.mopidy = { enable = true; + extensionPackages = [ ]; settings = { file = { enabled = true; @@ -29,7 +30,7 @@ nmt.script = '' assertFileExists home-files/.config/systemd/user/mopidy.service - assertFileExists home-files/.config/systemd/user/mopidy-scan.service + assertPathNotExists home-files/.config/systemd/user/mopidy-scan.service assertFileExists home-files/.config/mopidy/mopidy.conf assertFileContent home-files/.config/mopidy/mopidy.conf \ diff --git a/tests/modules/services/mopidy/default.nix b/tests/modules/services/mopidy/default.nix index 2f2c33d23518..6d71e1f546fc 100644 --- a/tests/modules/services/mopidy/default.nix +++ b/tests/modules/services/mopidy/default.nix @@ -1 +1,5 @@ -{ mopidy-basic-configuration = ./basic-configuration.nix; } +{ + mopidy-basic-configuration = ./basic-configuration.nix; + mopidy-scan = ./mopidy-scan.nix; +} + diff --git a/tests/modules/services/mopidy/mopidy-scan.nix b/tests/modules/services/mopidy/mopidy-scan.nix new file mode 100644 index 000000000000..58a035a6ad5f --- /dev/null +++ b/tests/modules/services/mopidy/mopidy-scan.nix @@ -0,0 +1,13 @@ +{ config, pkgs, ... }: + +{ + services.mopidy = { + enable = true; + extensionPackages = [ pkgs.mopidy-local ]; + }; + + nmt.script = '' + assertFileExists home-files/.config/systemd/user/mopidy.service + assertFileExists home-files/.config/systemd/user/mopidy-scan.service + ''; +} From d7682620185f213df384c363288093b486b2883f Mon Sep 17 00:00:00 2001 From: Milo Moisson Date: Sun, 31 Mar 2024 19:57:00 +0200 Subject: [PATCH 270/636] jujutsu: switch to XDG config home --- modules/programs/jujutsu.nix | 18 ++++++++---------- .../modules/programs/jujutsu/empty-config.nix | 2 +- .../programs/jujutsu/example-config.nix | 4 ++-- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/modules/programs/jujutsu.nix b/modules/programs/jujutsu.nix index b1fcc7038c5d..a21c71087273 100644 --- a/modules/programs/jujutsu.nix +++ b/modules/programs/jujutsu.nix @@ -34,16 +34,14 @@ in { settings = mkOption { type = tomlFormat.type; default = { }; - example = literalExpression '' - { - user = { - name = "John Doe"; - email = "jdoe@example.org"; - }; - } - ''; + example = { + user = { + name = "John Doe"; + email = "jdoe@example.org"; + }; + }; description = '' - Options to add to the {file}`.jjconfig.toml` file. See + Options to add to the {file}`config.toml` file. See for options. ''; @@ -53,7 +51,7 @@ in { config = mkIf cfg.enable { home.packages = [ cfg.package ]; - home.file.".jjconfig.toml" = mkIf (cfg.settings != { }) { + xdg.configFile."jj/config.toml" = mkIf (cfg.settings != { }) { source = tomlFormat.generate "jujutsu-config" (cfg.settings // optionalAttrs (cfg.ediff) (let emacsDiffScript = pkgs.writeShellScriptBin "emacs-ediff" '' diff --git a/tests/modules/programs/jujutsu/empty-config.nix b/tests/modules/programs/jujutsu/empty-config.nix index 12c4a2f54f84..10dd12589d30 100644 --- a/tests/modules/programs/jujutsu/empty-config.nix +++ b/tests/modules/programs/jujutsu/empty-config.nix @@ -6,6 +6,6 @@ test.stubs.jujutsu = { }; nmt.script = '' - assertPathNotExists home-files/.jjconfig.toml + assertPathNotExists home-files/.config/jj/config.toml ''; } diff --git a/tests/modules/programs/jujutsu/example-config.nix b/tests/modules/programs/jujutsu/example-config.nix index 06b68f18c0e6..d83b552b22a0 100644 --- a/tests/modules/programs/jujutsu/example-config.nix +++ b/tests/modules/programs/jujutsu/example-config.nix @@ -13,9 +13,9 @@ }; nmt.script = '' - assertFileExists home-files/.jjconfig.toml + assertFileExists home-files/.config/jj/config.toml assertFileContent \ - home-files/.jjconfig.toml \ + home-files/.config/jj/config.toml \ ${ builtins.toFile "expected.toml" '' [user] From 44677a1c96810a8e8c4ffaeaad10c842402647c1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 12 May 2024 03:59:17 +0000 Subject: [PATCH 271/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/25865a40d14b3f9cf19f19b924e2ab4069b09588' (2024-05-05) → 'github:NixOS/nixpkgs/f1010e0469db743d14519a1efd37e23f8513d714' (2024-05-09) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index cfe58270fed5..3213b2add435 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1714906307, - "narHash": "sha256-UlRZtrCnhPFSJlDQE7M0eyhgvuuHBTe1eJ9N9AQlJQ0=", + "lastModified": 1715266358, + "narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "25865a40d14b3f9cf19f19b924e2ab4069b09588", + "rev": "f1010e0469db743d14519a1efd37e23f8513d714", "type": "github" }, "original": { From 65b74b20450cd54fc6389b43ec7c7e6e58630370 Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Thu, 16 May 2024 16:03:33 -0600 Subject: [PATCH 272/636] espanso: add n8henrie to maintainers --- modules/services/espanso.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/services/espanso.nix b/modules/services/espanso.nix index a466b6f740a9..865a03ebf454 100644 --- a/modules/services/espanso.nix +++ b/modules/services/espanso.nix @@ -17,6 +17,7 @@ in { maintainers.lucasew maintainers.bobvanderlinden lib.hm.maintainers.liyangau + maintainers.n8henrie ]; options = { services.espanso = { From e3ad5108f54177e6520535768ddbf1e6af54b59d Mon Sep 17 00:00:00 2001 From: Nathan Henrie Date: Thu, 16 May 2024 13:34:13 -0600 Subject: [PATCH 273/636] espanso: remove `background` process type on Darwin This leads to a considerably slower expansion time for snippets, which severely degrades the user experience. Also, the launchd plist from the source omits this key: https://github.com/espanso/espanso/blob/8daadcc949c35a7b7aa20b7f544fdcff83e2c5f7/espanso/src/res/macos/com.federicoterzi.espanso.plist PR #5411 --- modules/services/espanso.nix | 1 - tests/modules/services/espanso-darwin/launchd.plist | 2 -- 2 files changed, 3 deletions(-) diff --git a/modules/services/espanso.nix b/modules/services/espanso.nix index 865a03ebf454..f6e27e7965be 100644 --- a/modules/services/espanso.nix +++ b/modules/services/espanso.nix @@ -138,7 +138,6 @@ in { Crashed = true; SuccessfulExit = false; }; - ProcessType = "Background"; RunAtLoad = true; }; }; diff --git a/tests/modules/services/espanso-darwin/launchd.plist b/tests/modules/services/espanso-darwin/launchd.plist index 8cbc4af032f9..ac8ff53ea3c8 100644 --- a/tests/modules/services/espanso-darwin/launchd.plist +++ b/tests/modules/services/espanso-darwin/launchd.plist @@ -16,8 +16,6 @@ Label org.nix-community.home.espanso - ProcessType - Background ProgramArguments @espanso@/bin/espanso From 25dedb0d52c20448f6a63cc346df1adbd6ef417e Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 23 May 2024 09:07:00 +0200 Subject: [PATCH 274/636] version: allow 24.11 as state version --- modules/misc/version.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/misc/version.nix b/modules/misc/version.nix index 048f784abc67..d068a3869200 100644 --- a/modules/misc/version.nix +++ b/modules/misc/version.nix @@ -21,6 +21,7 @@ in { "23.05" "23.11" "24.05" + "24.11" ]; description = '' It is occasionally necessary for Home Manager to change From 850cb322046ef1a268449cf1ceda5fd24d930b05 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 23 May 2024 11:45:08 +0200 Subject: [PATCH 275/636] ci: make dependabot consider the release-24.05 Also remove 23.05 from dependabot. --- .github/dependabot.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 76b9adfa72fc..6ba7256db518 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -10,7 +10,7 @@ updates: - package-ecosystem: "github-actions" directory: "/" - target-branch: "release-23.05" + target-branch: "release-23.11" schedule: interval: "weekly" commit-message: @@ -18,7 +18,7 @@ updates: - package-ecosystem: "github-actions" directory: "/" - target-branch: "release-23.11" + target-branch: "release-24.05" schedule: interval: "weekly" commit-message: From 548ba194d0676849424657cc41c59ab57d94b344 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 24 May 2024 17:29:26 +0200 Subject: [PATCH 276/636] home-manager: prepare release 24.05 --- README.md | 4 ++-- docs/manual/installation/nix-darwin.md | 6 +++--- docs/manual/installation/nixos.md | 6 +++--- docs/manual/installation/standalone.md | 4 ++-- docs/manual/nix-flakes/standalone.md | 6 +++--- docs/manual/usage/configuration.md | 4 ++-- docs/release-notes/rl-2405.md | 5 ++--- home-manager/home-manager | 4 ++-- modules/misc/uninstall.nix | 2 +- tests/integration/nixos/basics.nix | 2 +- tests/integration/standalone/alice-home-init.nix | 2 +- tests/integration/standalone/alice-home-next.nix | 2 +- 12 files changed, 23 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 4444fbbdb335..075ccaae8e84 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Releases Home Manager is developed against `nixpkgs-unstable` branch, which often causes it to contain tweaks for changes/packages not yet released in stable [NixOS][]. To avoid breaking users' configurations, Home Manager is released in branches -corresponding to NixOS releases (e.g. `release-23.11`). These branches get +corresponding to NixOS releases (e.g. `release-24.05`). These branches get fixes, but usually not new modules. If you need a module to be backported, then feel free to open an issue. @@ -49,7 +49,7 @@ dconf store and cannot tell whether a configuration that it is about to be overwritten was from a previous Home Manager generation or from manual configuration. -Home Manager targets [NixOS][] unstable and NixOS version 23.11 (the current +Home Manager targets [NixOS][] unstable and NixOS version 24.05 (the current stable version), it may or may not work on other Linux distributions and NixOS versions. diff --git a/docs/manual/installation/nix-darwin.md b/docs/manual/installation/nix-darwin.md index afa93e8f9421..f102530645ac 100644 --- a/docs/manual/installation/nix-darwin.md +++ b/docs/manual/installation/nix-darwin.md @@ -15,10 +15,10 @@ $ nix-channel --add https://github.com/nix-community/home-manager/archive/master $ nix-channel --update ``` -and if you follow a Nixpkgs version 23.11 channel, you can run +and if you follow a Nixpkgs version 24.05 channel, you can run ``` shell -$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager +$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager $ nix-channel --update ``` @@ -45,7 +45,7 @@ home-manager.users.eve = { pkgs, ... }: { # The state version is required and should stay at the version you # originally installed. - home.stateVersion = "23.11"; + home.stateVersion = "24.05"; }; ``` diff --git a/docs/manual/installation/nixos.md b/docs/manual/installation/nixos.md index 18a60e96cf70..d432a54be182 100644 --- a/docs/manual/installation/nixos.md +++ b/docs/manual/installation/nixos.md @@ -17,10 +17,10 @@ $ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/m $ sudo nix-channel --update ``` -and if you follow a Nixpkgs version 23.11 channel, you can run +and if you follow a Nixpkgs version 24.05 channel, you can run ``` shell -$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager +$ sudo nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager $ sudo nix-channel --update ``` @@ -44,7 +44,7 @@ home-manager.users.eve = { pkgs, ... }: { # The state version is required and should stay at the version you # originally installed. - home.stateVersion = "23.11"; + home.stateVersion = "24.05"; }; ``` diff --git a/docs/manual/installation/standalone.md b/docs/manual/installation/standalone.md index 7ca38ef65240..4afb7f347711 100644 --- a/docs/manual/installation/standalone.md +++ b/docs/manual/installation/standalone.md @@ -19,10 +19,10 @@ $ nix-channel --update ``` - and if you follow a Nixpkgs version 23.11 channel you can run + and if you follow a Nixpkgs version 24.05 channel you can run ``` shell - $ nix-channel --add https://github.com/nix-community/home-manager/archive/release-23.11.tar.gz home-manager + $ nix-channel --add https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz home-manager $ nix-channel --update ``` diff --git a/docs/manual/nix-flakes/standalone.md b/docs/manual/nix-flakes/standalone.md index 4ee8278a6450..fc967f46095f 100644 --- a/docs/manual/nix-flakes/standalone.md +++ b/docs/manual/nix-flakes/standalone.md @@ -11,10 +11,10 @@ then to generate and activate a basic configuration run the command $ nix run home-manager/master -- init --switch ``` -For Nixpkgs or NixOS version 23.11 run +For Nixpkgs or NixOS version 24.05 run ``` shell -$ nix run home-manager/release-23.11 -- init --switch +$ nix run home-manager/release-24.05 -- init --switch ``` This will generate a `flake.nix` and a `home.nix` file in @@ -30,7 +30,7 @@ $ # Edit files in ~/.config/home-manager $ nix run home-manager/$branch -- init --switch ``` -Where `$branch` is one of `master` or `release-23.11`. +Where `$branch` is one of `master` or `release-24.05`. After the initial activation has completed successfully then building and activating your flake-based configuration is as simple as diff --git a/docs/manual/usage/configuration.md b/docs/manual/usage/configuration.md index d611ec1857c0..deb046a6ba03 100644 --- a/docs/manual/usage/configuration.md +++ b/docs/manual/usage/configuration.md @@ -20,7 +20,7 @@ A fresh install of Home Manager will generate a minimal # You can update Home Manager without changing this value. See # the Home Manager release notes for a list of state version # changes in each release. - home.stateVersion = "23.11"; + home.stateVersion = "24.05"; # Let Home Manager install and manage itself. programs.home-manager.enable = true; @@ -65,7 +65,7 @@ follows: # You can update Home Manager without changing this value. See # the Home Manager release notes for a list of state version # changes in each release. - home.stateVersion = "23.11"; + home.stateVersion = "24.05"; # Let Home Manager install and manage itself. programs.home-manager.enable = true; diff --git a/docs/release-notes/rl-2405.md b/docs/release-notes/rl-2405.md index b69b34fe32ad..9bb629f72f89 100644 --- a/docs/release-notes/rl-2405.md +++ b/docs/release-notes/rl-2405.md @@ -1,7 +1,6 @@ # Release 24.05 {#sec-release-24.05} -This is the current unstable branch and the information in this section -is therefore not final. +The 24.05 release branch became stable in May, 2024. ## Highlights {#sec-release-24.05-highlights} @@ -89,4 +88,4 @@ The state version in this release includes the changes below. These changes are only active if the `home.stateVersion` option is set to \"24.05\" or later. -- Nothing, yet. +- There was no state version change in this release. diff --git a/home-manager/home-manager b/home-manager/home-manager index 630fe39a9d21..192ad072d2b1 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -359,7 +359,7 @@ $xdgVars # You should not change this value, even if you update Home Manager. If you do # want to update the value, then make sure to first check the Home Manager # release notes. - home.stateVersion = "23.11"; # Please read the comment before changing. + home.stateVersion = "24.05"; # Please read the comment before changing. # The home.packages option allows you to install Nix packages into your # environment. @@ -857,7 +857,7 @@ function doUninstall() { uninstall = true; home.username = "$USER"; home.homeDirectory = "$HOME"; - home.stateVersion = "23.11"; + home.stateVersion = "24.05"; } EOF # shellcheck disable=2064 diff --git a/modules/misc/uninstall.nix b/modules/misc/uninstall.nix index d12bde43ac4f..b34732b0b95b 100644 --- a/modules/misc/uninstall.nix +++ b/modules/misc/uninstall.nix @@ -21,7 +21,7 @@ in { config = mkIf config.uninstall { home.packages = lib.mkForce [ ]; home.file = lib.mkForce { }; - home.stateVersion = lib.mkForce "23.11"; + home.stateVersion = lib.mkForce "24.05"; home.enableNixpkgsReleaseCheck = lib.mkForce false; manual.manpages.enable = lib.mkForce false; news.display = lib.mkForce "silent"; diff --git a/tests/integration/nixos/basics.nix b/tests/integration/nixos/basics.nix index 022f066ef2d5..001623ca55b3 100644 --- a/tests/integration/nixos/basics.nix +++ b/tests/integration/nixos/basics.nix @@ -15,7 +15,7 @@ }; home-manager.users.alice = { ... }: { - home.stateVersion = "23.11"; + home.stateVersion = "24.05"; home.file.test.text = "testfile"; # Enable a light-weight systemd service. services.pueue.enable = true; diff --git a/tests/integration/standalone/alice-home-init.nix b/tests/integration/standalone/alice-home-init.nix index 3aab189773ec..ab9786f8042d 100644 --- a/tests/integration/standalone/alice-home-init.nix +++ b/tests/integration/standalone/alice-home-init.nix @@ -13,7 +13,7 @@ # You should not change this value, even if you update Home Manager. If you do # want to update the value, then make sure to first check the Home Manager # release notes. - home.stateVersion = "23.11"; # Please read the comment before changing. + home.stateVersion = "24.05"; # Please read the comment before changing. # The home.packages option allows you to install Nix packages into your # environment. diff --git a/tests/integration/standalone/alice-home-next.nix b/tests/integration/standalone/alice-home-next.nix index 04c713d8ba79..6f948b0b479d 100644 --- a/tests/integration/standalone/alice-home-next.nix +++ b/tests/integration/standalone/alice-home-next.nix @@ -3,7 +3,7 @@ { home.username = "alice"; home.homeDirectory = "/home/alice"; - home.stateVersion = "23.11"; + home.stateVersion = "24.05"; home.packages = [ pkgs.hello ]; home.file.test.text = "test"; home.sessionVariables.EDITOR = "emacs"; From d179da4e81bcd4227e8abf4b62b92c4ae214ae39 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 24 May 2024 17:30:26 +0200 Subject: [PATCH 277/636] home-manager: prepare 24.11-pre --- docs/release-notes/release-notes.md | 1 + docs/release-notes/rl-2411.md | 18 ++++++++++++++++++ home-manager/home-manager | 2 +- release.json | 2 +- 4 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 docs/release-notes/rl-2411.md diff --git a/docs/release-notes/release-notes.md b/docs/release-notes/release-notes.md index 91fc2ed5d7ef..dabeba0c9e40 100644 --- a/docs/release-notes/release-notes.md +++ b/docs/release-notes/release-notes.md @@ -4,6 +4,7 @@ This section lists the release notes for stable versions of Home Manager and the current unstable version. ```{=include=} chapters +rl-2411.md rl-2405.md rl-2311.md rl-2305.md diff --git a/docs/release-notes/rl-2411.md b/docs/release-notes/rl-2411.md new file mode 100644 index 000000000000..85eae034f92c --- /dev/null +++ b/docs/release-notes/rl-2411.md @@ -0,0 +1,18 @@ +# Release 24.11 {#sec-release-24.11} + +This is the current unstable branch and the information in this section +is therefore not final. + +## Highlights {#sec-release-24.11-highlights} + +This release has the following notable changes: + +- No changes. + +## State Version Changes {#sec-release-24.11-state-version-changes} + +The state version in this release includes the changes below. These +changes are only active if the `home.stateVersion` option is set to +\"24.11\" or later. + +- No changes. diff --git a/home-manager/home-manager b/home-manager/home-manager index 192ad072d2b1..1c3b87f0a7ac 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -1044,7 +1044,7 @@ while [[ $# -gt 0 ]]; do export VERBOSE=1 ;; --version) - echo 24.05-pre + echo 24.11-pre exit 0 ;; *) diff --git a/release.json b/release.json index c5b5ecfdd347..e5d3102cf2e7 100644 --- a/release.json +++ b/release.json @@ -1,4 +1,4 @@ { - "release": "24.05", + "release": "24.11", "isReleaseBranch": false } From e4611630c3cc8ed618b48d92f6291f65be9f7913 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 26 May 2024 01:25:03 +0200 Subject: [PATCH 278/636] ci: fix manual build in sourcehut build --- .builds/manual.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.builds/manual.yml b/.builds/manual.yml index af257412cffc..4072e5a4dccd 100644 --- a/.builds/manual.yml +++ b/.builds/manual.yml @@ -9,6 +9,7 @@ environment: NIX_CONFIG: "experimental-features = nix-command flakes" packages: - nixos.cachix + - nixos.jq tasks: - setup: | cachix use rycee @@ -26,7 +27,7 @@ tasks: if [[ $gitBranch == master ]]; then dirName="unstable" else - dirName="$(cat .release)" + dirName="$(jq -r .release < release.json)" fi rsync --delete -r --info=stats \ From 6a35d1969e4626a0f8d285e60b6cfd331e2687a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 26 May 2024 10:13:35 +0200 Subject: [PATCH 279/636] ci: bump cachix/cachix-action from 13 to 15 Bumps [cachix/cachix-action](https://github.com/cachix/cachix-action) from 13 to 15. - [Release notes](https://github.com/cachix/cachix-action/releases) - [Commits](https://github.com/cachix/cachix-action/compare/v13...v15) --- updated-dependencies: - dependency-name: cachix/cachix-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/github_pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml index 32e670e8a607..2dee0786be3c 100644 --- a/.github/workflows/github_pages.yml +++ b/.github/workflows/github_pages.yml @@ -14,7 +14,7 @@ jobs: - uses: cachix/install-nix-action@v23 with: nix_path: nixpkgs=channel:nixos-unstable - - uses: cachix/cachix-action@v13 + - uses: cachix/cachix-action@v15 with: name: nix-community authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' From fb7feac55b2b95692b58e388a608fc326ec66608 Mon Sep 17 00:00:00 2001 From: Zexin Yuan Date: Sat, 25 May 2024 13:09:11 +0200 Subject: [PATCH 280/636] Translate using Weblate (Chinese (Simplified)) Currently translated at 100.0% (37 of 37 strings) Co-authored-by: Zexin Yuan Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/zh_Hans/ Translation: Home Manager/Home Manager CLI --- home-manager/po/zh_Hans.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/zh_Hans.po b/home-manager/po/zh_Hans.po index 3ab325c701a5..6e773fcab694 100644 --- a/home-manager/po/zh_Hans.po +++ b/home-manager/po/zh_Hans.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-03-03 06:24+0000\n" -"Last-Translator: immwind \n" +"PO-Revision-Date: 2024-05-13 10:00+0000\n" +"Last-Translator: Zexin Yuan \n" "Language-Team: Chinese (Simplified) \n" "Language: zh_Hans\n" @@ -17,12 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.5-dev\n" +"X-Generator: Weblate 5.5.5-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s:缺少参数 %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" From 943f1e97fc171476f0235d7657448f9315465f18 Mon Sep 17 00:00:00 2001 From: halbGefressen Date: Sat, 25 May 2024 13:09:11 +0200 Subject: [PATCH 281/636] Translate using Weblate (German) Currently translated at 100.0% (37 of 37 strings) Co-authored-by: halbGefressen Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/de/ Translation: Home Manager/Home Manager CLI --- home-manager/po/de.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/de.po b/home-manager/po/de.po index a8109ee50936..dddccb3755d7 100644 --- a/home-manager/po/de.po +++ b/home-manager/po/de.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-03-04 18:50+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-05-21 18:02+0000\n" +"Last-Translator: halbGefressen \n" "Language-Team: German \n" "Language: de\n" @@ -17,12 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.5-dev\n" +"X-Generator: Weblate 5.6-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: Fehlendes Argument für %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" From cd29501b799c2621276376fb714cd2532fb2f0f7 Mon Sep 17 00:00:00 2001 From: Narazaki Shuji Date: Sat, 25 May 2024 13:09:11 +0200 Subject: [PATCH 282/636] Translate using Weblate (Japanese) Currently translated at 94.5% (35 of 37 strings) Co-authored-by: Narazaki Shuji Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ja/ Translation: Home Manager/Home Manager CLI --- home-manager/po/ja.po | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/home-manager/po/ja.po b/home-manager/po/ja.po index 17af07a85ff4..9d3bee0929f6 100644 --- a/home-manager/po/ja.po +++ b/home-manager/po/ja.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-04-29 18:07+0000\n" -"Last-Translator: Kento Okamoto \n" +"PO-Revision-Date: 2024-05-23 07:09+0000\n" +"Last-Translator: Narazaki Shuji \n" "Language-Team: Japanese \n" "Language: ja\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.5.2\n" +"X-Generator: Weblate 5.6-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 @@ -45,7 +45,7 @@ msgstr "設定ファイルがありません。ファイルを %s に作って #: home-manager/home-manager:107 msgid "Home Manager not found at %s." -msgstr "" +msgstr "%s にHome Managerが見つかりません。" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:115 @@ -168,7 +168,7 @@ msgstr "\"news.display\"に\"%s\"という設定は存在しません。" #: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "環境変数 $EDITOR または $VISUAL を設定してください" #: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" From 517682ed21a19c193f09f043ecd8dc4002a962c3 Mon Sep 17 00:00:00 2001 From: TANIGUCHI Kohei Date: Sat, 25 May 2024 13:09:11 +0200 Subject: [PATCH 283/636] Translate using Weblate (Japanese) Currently translated at 100.0% (37 of 37 strings) Co-authored-by: TANIGUCHI Kohei Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ja/ Translation: Home Manager/Home Manager CLI --- home-manager/po/ja.po | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/home-manager/po/ja.po b/home-manager/po/ja.po index 9d3bee0929f6..5a558d365f7b 100644 --- a/home-manager/po/ja.po +++ b/home-manager/po/ja.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-05-23 07:09+0000\n" -"Last-Translator: Narazaki Shuji \n" +"PO-Revision-Date: 2024-05-25 11:09+0000\n" +"Last-Translator: TANIGUCHI Kohei \n" "Language-Team: Japanese \n" "Language: ja\n" @@ -52,7 +52,8 @@ msgstr "%s にHome Managerが見つかりません。" msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." -msgstr "" +msgstr "フォールバックの Home Manager のパス %s " +"は非推奨ですが、そこにファイルまたはディレクトリがあります。" #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:118 @@ -75,6 +76,24 @@ msgid "" "\n" " $ rm -r \"%s\"" msgstr "" +"この警告が表示されないようにするには、以下のどれかを行ってください。\n" +"\n" +"1. Home Manager にそのパスを使うよう伝えます。例えば\n" +"\n" +" { programs.home-manager.path = \"%s\"; }\n" +"\n" +" を設定に追加します。\n" +"\n" +" もし Home Manager を直接インポートしているのであれば、 Home Manager " +"パッケージを呼び出すときに `path` パラメーターを使って\n" +"\n" +" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" +"\n" +" のようにできます。\n" +"\n" +"2. 非推奨のパスにあるものを削除します。\n" +"\n" +" $ rm -r \"%s\"" #: home-manager/home-manager:146 msgid "Sanity checking Nix" From 05e6ba83eb3585ce0aff7b41e4bd0e317d05ad4a Mon Sep 17 00:00:00 2001 From: DeeKahy Date: Sat, 25 May 2024 13:09:12 +0200 Subject: [PATCH 284/636] Translate using Weblate (Danish) Currently translated at 100.0% (37 of 37 strings) Co-authored-by: DeeKahy Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/da/ Translation: Home Manager/Home Manager CLI --- home-manager/po/da.po | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/home-manager/po/da.po b/home-manager/po/da.po index c49a76fdd43d..b05d5c231e5c 100644 --- a/home-manager/po/da.po +++ b/home-manager/po/da.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-05-25 11:09+0000\n" +"Last-Translator: DeeKahy \n" "Language-Team: Danish \n" "Language: da\n" @@ -17,12 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.6-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: manglende argument for %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" @@ -36,8 +36,8 @@ msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" -"At have din Home Manager %s i %s er forældet,\n" -"flyt den venligst til %s" +"Det er forældet at holde Home Manager %s i %s,\n" +"ryk den venligst til %s" #: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" @@ -45,7 +45,7 @@ msgstr "Ingen konfigurationsfiler fundet. Venligst lav en ved %s" #: home-manager/home-manager:107 msgid "Home Manager not found at %s." -msgstr "Home Manager kan ikke findes under %s." +msgstr "Home Manager blev ikke fundet ved %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:115 @@ -53,8 +53,8 @@ msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" -"Fallback-stien til Home Manager %s er blevet forældet, og en fil/mappe blev " -"fundet der." +"Det er forældet at bruge fallback Home Manager path %s og der blev fundet en " +"fil/mappe der." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:118 @@ -120,7 +120,7 @@ msgstr "Kør '%s --help' for brugsvejledning" #: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." -msgstr "Filen %s findes allerede, lader den være uændret..." +msgstr "Filen %s eksisterer allerede, efterlader den uændret…" #: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." @@ -189,7 +189,7 @@ msgstr "Ubekændt \"news.display\" indstilling \"%s\"." #: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Indstil venligst miljøvariablen $EDITOR eller $VISUAL" #: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" From b2a4ddf657e6ad87569665545ffaf7dd5e9a02af Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 26 May 2024 17:15:27 +0200 Subject: [PATCH 285/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/f1010e0469db743d14519a1efd37e23f8513d714' (2024-05-09) → 'github:NixOS/nixpkgs/bfb7a882678e518398ce9a31a881538679f6f092' (2024-05-24) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 3213b2add435..d89cf3528262 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1715266358, - "narHash": "sha256-doPgfj+7FFe9rfzWo1siAV2mVCasW+Bh8I1cToAXEE4=", + "lastModified": 1716509168, + "narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f1010e0469db743d14519a1efd37e23f8513d714", + "rev": "bfb7a882678e518398ce9a31a881538679f6f092", "type": "github" }, "original": { From 5d151429e1e79107acf6d06dcc5ace4e642ec239 Mon Sep 17 00:00:00 2001 From: nurelin Date: Sun, 26 May 2024 17:19:20 +0200 Subject: [PATCH 286/636] kanshi: fix configuration example --- modules/services/kanshi.nix | 84 +++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 40 deletions(-) diff --git a/modules/services/kanshi.nix b/modules/services/kanshi.nix index 1e6950304530..b503ffc7f7f1 100644 --- a/modules/services/kanshi.nix +++ b/modules/services/kanshi.nix @@ -209,24 +209,26 @@ in { Attribute set of profiles. ''; example = literalExpression '' - undocked = { - outputs = [ - { - criteria = "eDP-1"; - } - ]; - }; - docked = { - outputs = [ - { - criteria = "eDP-1"; - } - { - criteria = "Some Company ASDF 4242"; - transform = "90"; - } - ]; - }; + { + undocked = { + outputs = [ + { + criteria = "eDP-1"; + } + ]; + }; + docked = { + outputs = [ + { + criteria = "eDP-1"; + } + { + criteria = "Some Company ASDF 4242"; + transform = "90"; + } + ]; + }; + } ''; }; @@ -247,28 +249,30 @@ in { See kanshi(5) for informations. ''; example = literalExpression '' - { include = "path/to/included/files"; } - { output.criteria = "eDP-1"; - output.scale = 2; - } - { profile.name = "undocked"; - profile.outputs = [ - { - criteria = "eDP-1"; - } - ]; - } - { profile.name = "docked"; - profile.outputs = [ - { - criteria = "eDP-1"; - } - { - criteria = "Some Company ASDF 4242"; - transform = "90"; - } - ]; - } + [ + { include = "path/to/included/files"; } + { output.criteria = "eDP-1"; + output.scale = 2; + } + { profile.name = "undocked"; + profile.outputs = [ + { + criteria = "eDP-1"; + } + ]; + } + { profile.name = "docked"; + profile.outputs = [ + { + criteria = "eDP-1"; + } + { + criteria = "Some Company ASDF 4242"; + transform = "90"; + } + ]; + } + ] ''; }; From 8f8eb15c6d66afa7eef0dd6357bbb41c3aeb1099 Mon Sep 17 00:00:00 2001 From: Stanislav Asunkin <1353637+stasjok@users.noreply.github.com> Date: Tue, 28 May 2024 00:49:28 +0300 Subject: [PATCH 287/636] fd: don't create shell aliases with empty args --- modules/programs/fd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/fd.nix b/modules/programs/fd.nix index bc5b709dbde2..f8f59eb5447c 100644 --- a/modules/programs/fd.nix +++ b/modules/programs/fd.nix @@ -38,7 +38,7 @@ with lib; { args = escapeShellArgs (optional cfg.hidden "--hidden" ++ cfg.extraOptions); - optionsAlias = { fd = "fd ${args}"; }; + optionsAlias = optionalAttrs (args != "") { fd = "fd ${args}"; }; in mkIf cfg.enable { home.packages = [ cfg.package ]; From 65e0f5aa25619ee992e1eb3ad69f227a46b0a1b1 Mon Sep 17 00:00:00 2001 From: Stanislav Asunkin <1353637+stasjok@users.noreply.github.com> Date: Tue, 28 May 2024 00:50:09 +0300 Subject: [PATCH 288/636] eza: don't create shell aliases with empty args --- modules/programs/eza.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/eza.nix b/modules/programs/eza.nix index 2a297b25480d..7e002a12ea88 100644 --- a/modules/programs/eza.nix +++ b/modules/programs/eza.nix @@ -73,7 +73,7 @@ with lib; args = escapeShellArgs (optional cfg.icons "--icons" ++ optional cfg.git "--git" ++ cfg.extraOptions); - optionsAlias = { eza = "eza ${args}"; }; + optionsAlias = optionalAttrs (args != "") { eza = "eza ${args}"; }; aliases = builtins.mapAttrs (_name: value: lib.mkDefault value) { ls = "eza"; From e8482a798fd85d6316dcf42387ad30b3a079585e Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 27 May 2024 16:50:57 -0500 Subject: [PATCH 289/636] yazi: use builtin cd cd conflicts with aliases that dont support -- syntax --- modules/programs/yazi.nix | 4 ++-- tests/modules/programs/yazi/bash-integration-enabled.nix | 2 +- tests/modules/programs/yazi/fish-integration-enabled.nix | 2 +- tests/modules/programs/yazi/zsh-integration-enabled.nix | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index c45342274c24..7ae8acd6902f 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -11,7 +11,7 @@ let local tmp="$(mktemp -t "yazi-cwd.XXXXX")" yazi "$@" --cwd-file="$tmp" if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then - cd -- "$cwd" + builtin cd -- "$cwd" fi rm -f -- "$tmp" } @@ -22,7 +22,7 @@ let set tmp (mktemp -t "yazi-cwd.XXXXX") yazi $argv --cwd-file="$tmp" if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] - cd -- "$cwd" + builtin cd -- "$cwd" end rm -f -- "$tmp" end diff --git a/tests/modules/programs/yazi/bash-integration-enabled.nix b/tests/modules/programs/yazi/bash-integration-enabled.nix index ff9bc2f2bcc4..ac2e4979606b 100644 --- a/tests/modules/programs/yazi/bash-integration-enabled.nix +++ b/tests/modules/programs/yazi/bash-integration-enabled.nix @@ -6,7 +6,7 @@ let local tmp="$(mktemp -t "yazi-cwd.XXXXX")" yazi "$@" --cwd-file="$tmp" if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then - cd -- "$cwd" + builtin cd -- "$cwd" fi rm -f -- "$tmp" } diff --git a/tests/modules/programs/yazi/fish-integration-enabled.nix b/tests/modules/programs/yazi/fish-integration-enabled.nix index 02506b266bc0..6d2b9fa31387 100644 --- a/tests/modules/programs/yazi/fish-integration-enabled.nix +++ b/tests/modules/programs/yazi/fish-integration-enabled.nix @@ -6,7 +6,7 @@ let set tmp (mktemp -t "yazi-cwd.XXXXX") yazi $argv --cwd-file="$tmp" if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] - cd -- "$cwd" + builtin cd -- "$cwd" end rm -f -- "$tmp" end diff --git a/tests/modules/programs/yazi/zsh-integration-enabled.nix b/tests/modules/programs/yazi/zsh-integration-enabled.nix index c8744146ec24..d5090a6a84b9 100644 --- a/tests/modules/programs/yazi/zsh-integration-enabled.nix +++ b/tests/modules/programs/yazi/zsh-integration-enabled.nix @@ -6,7 +6,7 @@ let local tmp="$(mktemp -t "yazi-cwd.XXXXX")" yazi "$@" --cwd-file="$tmp" if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then - cd -- "$cwd" + builtin cd -- "$cwd" fi rm -f -- "$tmp" } From 0cf552f39f1f8567a8e76e14c90e2843634182b5 Mon Sep 17 00:00:00 2001 From: RoadRoller01 <76426234+RoadRoller01@users.noreply.github.com> Date: Sun, 12 May 2024 23:33:36 +0300 Subject: [PATCH 290/636] bash: add missing 'ignoreboth' to historyControl Reference: https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-HISTCONTROL --- modules/programs/bash.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/bash.nix b/modules/programs/bash.nix index 5e7a44b53399..5a328ecda6f7 100644 --- a/modules/programs/bash.nix +++ b/modules/programs/bash.nix @@ -67,8 +67,8 @@ in { }; historyControl = mkOption { - type = - types.listOf (types.enum [ "erasedups" "ignoredups" "ignorespace" ]); + type = types.listOf + (types.enum [ "erasedups" "ignoredups" "ignorespace" "ignoreboth" ]); default = [ ]; description = "Controlling how commands are saved on the history list."; }; From 7ac529c22129ee9fb024744ede18f73e6b148ede Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Wed, 22 May 2024 21:39:43 -0300 Subject: [PATCH 291/636] hyprland: onChange: check XDG_RUNTIME_DIR as well The previous check false negatives in Hyprland >= 0.40.0 --- modules/services/window-managers/hyprland.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index ff162fb307d8..ef41d85e6be1 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -237,7 +237,8 @@ in { onChange = lib.mkIf (cfg.package != null) '' ( # Execute in subshell so we don't poision environment with vars - if [[ -d "/tmp/hypr" ]]; then + XDG_RUNTIME_DIR=''${XDG_RUNTIME_DIR:-/run/user/$(id -u)} + if [[ -d "/tmp/hypr" || -d "$XDG_RUNTIME_DIR/hypr" ]]; then for i in $(${cfg.finalPackage}/bin/hyprctl instances -j | jq ".[].instance" -r); do ${cfg.finalPackage}/bin/hyprctl -i "$i" reload config-only done From 7e769959e8ec80333bb262d685333003bf013c1b Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Fri, 24 May 2024 17:26:52 -0300 Subject: [PATCH 292/636] hyprland: onChange: remove subshell comment --- modules/services/window-managers/hyprland.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index ef41d85e6be1..6b79248bae21 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -236,7 +236,7 @@ in { }) + lib.optionalString (cfg.extraConfig != "") cfg.extraConfig; onChange = lib.mkIf (cfg.package != null) '' - ( # Execute in subshell so we don't poision environment with vars + ( XDG_RUNTIME_DIR=''${XDG_RUNTIME_DIR:-/run/user/$(id -u)} if [[ -d "/tmp/hypr" || -d "$XDG_RUNTIME_DIR/hypr" ]]; then for i in $(${cfg.finalPackage}/bin/hyprctl instances -j | jq ".[].instance" -r); do From 939375b39661c7b5d2533c9cd7be6117ed98896a Mon Sep 17 00:00:00 2001 From: Jany <127505435+janydoe@users.noreply.github.com> Date: Mon, 27 May 2024 21:59:26 +0000 Subject: [PATCH 293/636] khal: add package option --- modules/programs/khal.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/khal.nix b/modules/programs/khal.nix index 50ccb681e9ae..a2e28e018136 100644 --- a/modules/programs/khal.nix +++ b/modules/programs/khal.nix @@ -168,6 +168,8 @@ in { options.programs.khal = { enable = mkEnableOption "khal, a CLI calendar application"; + package = mkPackageOption pkgs "khal" { }; + locale = mkOption { type = lib.types.submodule { options = localeOptions; }; description = '' @@ -197,7 +199,7 @@ in { }; config = mkIf cfg.enable { - home.packages = [ pkgs.khal ]; + home.packages = [ cfg.package ]; xdg.configFile."khal/config".text = concatStringsSep "\n" ([ "[calendars]" ] ++ mapAttrsToList genCalendarStr khalAccounts ++ [ From 90010df15878762ff359e4fe391355a9dcad0bcf Mon Sep 17 00:00:00 2001 From: Phani Rithvij Date: Wed, 22 May 2024 23:31:16 +0530 Subject: [PATCH 294/636] topgrade: update example config --- modules/programs/topgrade.nix | 16 +++++++++------- .../programs/topgrade/settings-expected.toml | 7 ++++--- tests/modules/programs/topgrade/settings.nix | 14 +++++++++----- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/modules/programs/topgrade.nix b/modules/programs/topgrade.nix index a49f897baa8e..0630ccabda0c 100644 --- a/modules/programs/topgrade.nix +++ b/modules/programs/topgrade.nix @@ -28,13 +28,15 @@ in { defaultText = literalExpression "{ }"; example = literalExpression '' { - assume_yes = true; - disable = [ - "flutter" - "node" - ]; - set_title = false; - cleanup = true; + misc = { + assume_yes = true; + disable = [ + "flutter" + "node" + ]; + set_title = false; + cleanup = true; + }; commands = { "Run garbage collection on Nix store" = "nix-collect-garbage"; }; diff --git a/tests/modules/programs/topgrade/settings-expected.toml b/tests/modules/programs/topgrade/settings-expected.toml index aeed3d14b0d9..5e2a47ae69cc 100644 --- a/tests/modules/programs/topgrade/settings-expected.toml +++ b/tests/modules/programs/topgrade/settings-expected.toml @@ -1,8 +1,9 @@ +[commands] +"Purge unused APT packages" = "sudo apt autoremove" + +[misc] cleanup = true disable = ["sdkman", "flutter", "node", "nix", "home_manager"] remote_topgrade_path = "bin/topgrade" remote_topgrades = ["backup", "ci"] set_title = false - -[commands] -"Purge unused APT packages" = "sudo apt autoremove" diff --git a/tests/modules/programs/topgrade/settings.nix b/tests/modules/programs/topgrade/settings.nix index e80e98b86068..1e893eb47de1 100644 --- a/tests/modules/programs/topgrade/settings.nix +++ b/tests/modules/programs/topgrade/settings.nix @@ -6,17 +6,21 @@ settings = lib.mkMerge [ { - disable = [ "sdkman" "flutter" "node" "nix" "home_manager" ]; + misc = { + disable = [ "sdkman" "flutter" "node" "nix" "home_manager" ]; - remote_topgrades = [ "backup" "ci" ]; + remote_topgrades = [ "backup" "ci" ]; - remote_topgrade_path = "bin/topgrade"; + remote_topgrade_path = "bin/topgrade"; + }; } { - set_title = false; - cleanup = true; + misc = { + set_title = false; + cleanup = true; + }; commands = { "Purge unused APT packages" = "sudo apt autoremove"; }; } ]; From 10c7c219b7dae5795fb67f465a0d86cbe29f25fa Mon Sep 17 00:00:00 2001 From: Dee Anzorge Date: Tue, 28 May 2024 00:07:22 +0200 Subject: [PATCH 295/636] listenbrainz-mpd: fix config example --- modules/services/listenbrainz-mpd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/listenbrainz-mpd.nix b/modules/services/listenbrainz-mpd.nix index 5b949ebe5f39..3cc2422167e6 100644 --- a/modules/services/listenbrainz-mpd.nix +++ b/modules/services/listenbrainz-mpd.nix @@ -24,7 +24,7 @@ in { Configuration for listenbrainz-mpd written to {file}`$XDG_CONFIG_HOME/listenbrainz-mpd/config.toml`. ''; - example = { submission.tokenFile = "/run/secrets/listenbrainz-mpd"; }; + example = { submission.token_file = "/run/secrets/listenbrainz-mpd"; }; }; }; From 373ead20606efa9181cd15ba19a5deac7ead1492 Mon Sep 17 00:00:00 2001 From: midchildan Date: Wed, 29 May 2024 00:02:06 +0900 Subject: [PATCH 296/636] tests: fix broken overlay in mpv test --- tests/modules/programs/mpv/mpv-stubs.nix | 25 ++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/modules/programs/mpv/mpv-stubs.nix b/tests/modules/programs/mpv/mpv-stubs.nix index 2fee19144a6b..caef8e69d38d 100644 --- a/tests/modules/programs/mpv/mpv-stubs.nix +++ b/tests/modules/programs/mpv/mpv-stubs.nix @@ -1,14 +1,20 @@ -{ pkgs, ... }: - { nixpkgs.overlays = [ - (self: super: { - mpvScript = pkgs.runCommandLocal "mpvScript" { scriptName = "something"; } + (final: prev: { + mpvScript = prev.runCommandLocal "mpvScript" { scriptName = "something"; } "mkdir $out"; - mpv-unwrapped = super.mpv-unwrapped.overrideAttrs { - builder = pkgs.writeShellScript "dummy" '' - PATH=${pkgs.coreutils}/bin + mpv-unwrapped = let + lua = prev.emptyDirectory.overrideAttrs { + luaversion = "0"; + passthru.withPackages = pkgsFn: prev.emptyDirectory; + }; + mpv-unwrapped' = prev.mpv-unwrapped.override { inherit lua; }; + in mpv-unwrapped'.overrideAttrs { + buildInputs = [ ]; + nativeBuildInputs = [ ]; + builder = prev.writeShellScript "dummy" '' + PATH=${final.coreutils}/bin mkdir -p $dev $doc $man $out/bin $out/Applications/mpv.app/Contents/MacOS touch $out/bin/{mpv,umpv} \ $out/Applications/mpv.app/Contents/MacOS/{mpv,mpv-bundle} @@ -16,11 +22,6 @@ $out/Applications/mpv.app/Contents/MacOS/{mpv,mpv-bundle} ''; }; - - lua = pkgs.emptyDirectory.overrideAttrs { - luaversion = "0"; - withPackages = ps: pkgs.emptyDirectory; - }; }) ]; From a9b36cbe9292a649222b89fdb9ae9907e9c74086 Mon Sep 17 00:00:00 2001 From: Sharzy Date: Wed, 29 May 2024 05:15:11 +0800 Subject: [PATCH 297/636] gpg-agent: fix usage of splitString `splitString "" "some string"` would throw exception `error: invalid regular expression` on Darwin (or accurately, on Nix built against libc++). Refer to https://github.com/NixOS/nix/issues/7208 for details. Before Nix handles that issue correctly, we should refrain from using `splitString ""`, and luckliy `lib.stringAsChars` can do the same thing. --- modules/services/gpg-agent.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index 509adfa54609..cce5ac191041 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -48,9 +48,8 @@ let hexStringToBase32 = let mod = a: b: a - a / b * b; pow2 = elemAt [ 1 2 4 8 16 32 64 128 256 ]; - splitChars = s: init (tail (splitString "" s)); - base32Alphabet = splitChars "ybndrfg8ejkmcpqxot1uwisza345h769"; + base32Alphabet = stringToCharacters "ybndrfg8ejkmcpqxot1uwisza345h769"; hexToIntTable = listToAttrs (genList (x: { name = toLower (toHexString x); value = x; @@ -76,7 +75,7 @@ let buf = buf'; bufBits = bufBits'; }; - in hexString: (foldl' go initState (splitChars hexString)).ret; + in hexString: (foldl' go initState (stringToCharacters hexString)).ret; in { meta.maintainers = [ maintainers.rycee ]; From 04bc391a90f8ae2a953035f33ddebaeccbc0a36b Mon Sep 17 00:00:00 2001 From: XYenon Date: Wed, 29 May 2024 11:01:52 +0800 Subject: [PATCH 298/636] yazi: support plugins and flavors --- modules/programs/yazi.nix | 58 ++++++++++++++++++--- tests/modules/programs/yazi/flavor/init.lua | 1 + tests/modules/programs/yazi/init.lua | 3 ++ tests/modules/programs/yazi/plugin/init.lua | 1 + tests/modules/programs/yazi/settings.nix | 9 ++++ 5 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 tests/modules/programs/yazi/flavor/init.lua create mode 100644 tests/modules/programs/yazi/init.lua create mode 100644 tests/modules/programs/yazi/plugin/init.lua diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index 7ae8acd6902f..11f4e75cf11f 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -40,17 +40,12 @@ let } ''; in { - meta.maintainers = [ maintainers.xyenon ]; + meta.maintainers = with maintainers; [ xyenon ]; options.programs.yazi = { enable = mkEnableOption "yazi"; - package = mkOption { - type = types.package; - default = pkgs.yazi; - defaultText = literalExpression "pkgs.yazi"; - description = "Yazi package to install."; - }; + package = mkPackageOption pkgs "yazi" { }; enableBashIntegration = mkEnableOption "Bash integration"; @@ -135,6 +130,48 @@ in { for the full list of options ''; }; + + initLua = mkOption { + type = with types; nullOr path; + default = null; + description = '' + The init.lua for Yazi itself. + ''; + example = literalExpression "./init.lua"; + }; + + plugins = mkOption { + type = with types; attrsOf (oneOf [ path package ]); + default = { }; + description = '' + Lua plugins. + + See https://yazi-rs.github.io/docs/plugins/overview/ for documentation. + ''; + example = literalExpression '' + { + foo = ./foo; + bar = pkgs.bar; + } + ''; + }; + + flavors = mkOption { + type = with types; attrsOf (oneOf [ path package ]); + default = { }; + description = '' + Pre-made themes. + + See https://yazi-rs.github.io/docs/flavors/overview/ for documentation. + ''; + example = literalExpression '' + { + foo = ./foo; + bar = pkgs.bar; + } + ''; + }; + }; config = mkIf cfg.enable { @@ -160,6 +197,11 @@ in { "yazi/theme.toml" = mkIf (cfg.theme != { }) { source = tomlFormat.generate "yazi-theme" cfg.theme; }; - }; + "yazi/init.lua" = mkIf (cfg.initLua != null) { source = cfg.initLua; }; + } // (mapAttrs' + (name: value: nameValuePair "yazi/plugins/${name}" { source = value; }) + cfg.plugins) // (mapAttrs' + (name: value: nameValuePair "yazi/flavors/${name}" { source = value; }) + cfg.flavors); }; } diff --git a/tests/modules/programs/yazi/flavor/init.lua b/tests/modules/programs/yazi/flavor/init.lua new file mode 100644 index 000000000000..8d06fa7a9b0d --- /dev/null +++ b/tests/modules/programs/yazi/flavor/init.lua @@ -0,0 +1 @@ +-- This is a flavor. diff --git a/tests/modules/programs/yazi/init.lua b/tests/modules/programs/yazi/init.lua new file mode 100644 index 000000000000..a22493df73ad --- /dev/null +++ b/tests/modules/programs/yazi/init.lua @@ -0,0 +1,3 @@ +require("zoxide"):setup { + update_db = true, +} diff --git a/tests/modules/programs/yazi/plugin/init.lua b/tests/modules/programs/yazi/plugin/init.lua new file mode 100644 index 000000000000..a9286c3d6d21 --- /dev/null +++ b/tests/modules/programs/yazi/plugin/init.lua @@ -0,0 +1 @@ +-- This is a plugin. diff --git a/tests/modules/programs/yazi/settings.nix b/tests/modules/programs/yazi/settings.nix index 5a540cafb4ef..4655ae8b3551 100644 --- a/tests/modules/programs/yazi/settings.nix +++ b/tests/modules/programs/yazi/settings.nix @@ -69,6 +69,9 @@ ]; }; }; + initLua = ./init.lua; + plugins = { "test.yazi" = ./plugin; }; + flavors = { "test.yazi" = ./flavor; }; }; test.stubs.yazi = { }; @@ -80,5 +83,11 @@ ${./settings-expected.toml} assertFileContent home-files/.config/yazi/theme.toml \ ${./theme-expected.toml} + assertFileContent home-files/.config/yazi/init.lua \ + ${./init.lua} + assertFileContent home-files/.config/yazi/plugins/test.yazi/init.lua \ + ${./plugin/init.lua} + assertFileContent home-files/.config/yazi/flavors/test.yazi/init.lua \ + ${./flavor/init.lua} ''; } From 1b589257f72c9c54e92d1d631e988e5346156736 Mon Sep 17 00:00:00 2001 From: Gaurav Juvekar Date: Wed, 29 May 2024 15:02:35 -0700 Subject: [PATCH 299/636] home-manager: check FQDN for '--flake .' attribute Since nixpkgs commit 993baa587c4b82e791686f6ce711bcd4ee8ef933, `networking.hostName` is not allowed to be a FQDN. Add `hostname --fqdn` to the default flake attribute names that are searched. If netorking.hostname = "hostname"; networking.domain = "example.com"; is set in the system NixOS configuration, this allows defining homeConfigurations."username@hostname.example.com" = ... and still use home-manager switch --flake . instead of having to type out home-manager switch --flake .#$(whoami)@$(hostname --fqdn) --- home-manager/home-manager | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index 1c3b87f0a7ac..612df6f44ad4 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -198,9 +198,9 @@ function setFlakeAttribute() { ;; *) local name="$USER" - # Check both long and short hostnames; long first to preserve + # Check FQDN, long, and short hostnames; long first to preserve # pre-existing behaviour in case both happen to be defined. - for n in "$USER@$(hostname)" "$USER@$(hostname -s)"; do + for n in "$USER@$(hostname --fqdn)" "$USER@$(hostname)" "$USER@$(hostname -s)"; do if [[ "$(nix eval "$flake#homeConfigurations" --apply "x: x ? \"$n\"")" == "true" ]]; then name="$n" if [[ -v VERBOSE ]]; then From 60b85414b49d5d69816c2453865adb6cc39df33a Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Thu, 30 May 2024 08:17:09 +0200 Subject: [PATCH 300/636] Translate using Weblate (Korean) Currently translated at 100.0% (37 of 37 strings) Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ko/ Translation: Home Manager/Home Manager CLI Co-authored-by: lentil32 --- home-manager/po/ko.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/ko.po b/home-manager/po/ko.po index 2b8fbd2a34df..96eae0712080 100644 --- a/home-manager/po/ko.po +++ b/home-manager/po/ko.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-03-19 04:01+0000\n" -"Last-Translator: honnip \n" +"PO-Revision-Date: 2024-05-30 06:09+0000\n" +"Last-Translator: lentil32 \n" "Language-Team: Korean \n" "Language: ko\n" @@ -17,12 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.5-dev\n" +"X-Generator: Weblate 5.6-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: %s에 대한 인자 누락" #: home-manager/home-manager:64 msgid "No configuration file found at %s" From 29c69d9a466e41d46fd3a7a9d0591ef9c113c2ae Mon Sep 17 00:00:00 2001 From: Liassica <115422798+Liassica@users.noreply.github.com> Date: Thu, 30 May 2024 02:05:10 -0500 Subject: [PATCH 301/636] kdeconnect: fix service with 24.05 package version The 24.05 update for KDE Connect moved the kdeconnectd binary from `/libexec` to `/bin`, so this fix will check the version of the package used and set the path accordingly. --- modules/services/kdeconnect.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/services/kdeconnect.nix b/modules/services/kdeconnect.nix index 91b6657fe003..656a8c9a61f5 100644 --- a/modules/services/kdeconnect.nix +++ b/modules/services/kdeconnect.nix @@ -48,7 +48,12 @@ in { Service = { Environment = "PATH=${config.home.profileDirectory}/bin"; - ExecStart = "${cfg.package}/libexec/kdeconnectd"; + ExecStart = + if strings.versionAtLeast (versions.majorMinor cfg.package.version) + "24.05" then + "${cfg.package}/bin/kdeconnectd" + else + "${cfg.package}/libexec/kdeconnectd"; Restart = "on-abort"; }; }; From 0eb314b4f0ba337e88123e0b1e57ef58346aafd9 Mon Sep 17 00:00:00 2001 From: Gaurav Juvekar Date: Thu, 30 May 2024 12:35:07 -0700 Subject: [PATCH 302/636] home-manager: use short -f instead of --fqdn MacOS doesn't support the long-style `--fqdn` option to `hostname` that was added by 1b589257f72c9c54e92d1d631e988e5346156736. Switch to short style `-f` that should be supported on every platform. --- home-manager/home-manager | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index 612df6f44ad4..5bf796b47680 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -200,7 +200,7 @@ function setFlakeAttribute() { local name="$USER" # Check FQDN, long, and short hostnames; long first to preserve # pre-existing behaviour in case both happen to be defined. - for n in "$USER@$(hostname --fqdn)" "$USER@$(hostname)" "$USER@$(hostname -s)"; do + for n in "$USER@$(hostname -f)" "$USER@$(hostname)" "$USER@$(hostname -s)"; do if [[ "$(nix eval "$flake#homeConfigurations" --apply "x: x ? \"$n\"")" == "true" ]]; then name="$n" if [[ -v VERBOSE ]]; then From c497bdc12f591e57f85a6941976daec78db3f529 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 2 Jun 2024 03:59:27 +0000 Subject: [PATCH 303/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/bfb7a882678e518398ce9a31a881538679f6f092' (2024-05-24) → 'github:NixOS/nixpkgs/ad57eef4ef0659193044870c731987a6df5cf56b' (2024-05-29) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index d89cf3528262..865072042d2e 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1716509168, - "narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=", + "lastModified": 1716948383, + "narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "bfb7a882678e518398ce9a31a881538679f6f092", + "rev": "ad57eef4ef0659193044870c731987a6df5cf56b", "type": "github" }, "original": { From bf3815854e6c24d28ad4e7df96f2d3c3beda20f1 Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Sun, 2 Jun 2024 10:14:04 +0200 Subject: [PATCH 304/636] Translate using Weblate (Finnish) Currently translated at 55.5% (10 of 18 strings) Translate using Weblate (Finnish) Currently translated at 72.9% (27 of 37 strings) Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/fi/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/fi/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules Co-authored-by: jarre johansson --- home-manager/po/fi.po | 63 ++++++++++++++++++++++++------------------- modules/po/fi.po | 40 ++++++++++++++++++--------- 2 files changed, 63 insertions(+), 40 deletions(-) diff --git a/home-manager/po/fi.po b/home-manager/po/fi.po index 4e3c193573e7..2ac20911db3c 100644 --- a/home-manager/po/fi.po +++ b/home-manager/po/fi.po @@ -8,23 +8,25 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2024-05-31 17:09+0000\n" +"Last-Translator: jarre johansson \n" +"Language-Team: Finnish \n" "Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.6-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: puuttuva argumentti kohteelle %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" -msgstr "" +msgstr "Konfiguraatiotiedostoa ei löytynyt sijainnista %s" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. @@ -37,11 +39,11 @@ msgstr "" #: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" -msgstr "" +msgstr "Konfiguraatiotiedostoa ei löytynyt. Luo sellainen sijaintiin %s" #: home-manager/home-manager:107 msgid "Home Manager not found at %s." -msgstr "" +msgstr "Home Manageria ei löytynyt sijainnista %s." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:115 @@ -74,37 +76,37 @@ msgstr "" #: home-manager/home-manager:146 msgid "Sanity checking Nix" -msgstr "" +msgstr "Nixin eheys tarkistetaan" #: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" -msgstr "" +msgstr "Sopivaa profiilihakemistoa ei löytynyt, yritettiin %s ja %s" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" -msgstr "" +msgstr "Flake-konfiguraation asetuksia ei voi tarkastella" #: home-manager/home-manager:296 home-manager/home-manager:319 #: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" -msgstr "" +msgstr "%s: tuntematon vaihtoehto '%s" #: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" -msgstr "" +msgstr "Aja '%s --help' saadaksesi käyttöohjeita" #: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." -msgstr "" +msgstr "Tiedosto %s on jo olemassa, jätetään se muuttumattomaksi..." #: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." -msgstr "" +msgstr "Luodaan tiedostoa %s..." #: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." -msgstr "" +msgstr "Luodaan alkuperäistä Home Manager -generaatiota..." #. translators: The "%s" specifier will be replaced by a file path. #: home-manager/home-manager:480 @@ -130,7 +132,7 @@ msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" -msgstr "" +msgstr "Flake-konfiguraatiota ei voi luoda" #: home-manager/home-manager:572 msgid "" @@ -140,16 +142,20 @@ msgid_plural "" "There are %d unread and relevant news items.\n" "Read them by running the command \"%s news\"." msgstr[0] "" +"Sinulla on %d lukematon ja oleellinen uutisartikkeli.\n" +"Lue se ajamalla komento \"%s news\"." msgstr[1] "" +"Sinulla on %d lukematonta ja oleellista uutisartikkelia.\n" +"Lue ne ajamalla komento \"%s news\"." #: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." -msgstr "" +msgstr "Tuntematon asetus \"news.display\" \"%s\"." #: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Aseta $EDITOR- tai $VISUAL-ympäristömuuttujaksi" #: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" @@ -161,11 +167,11 @@ msgstr "" #: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" -msgstr "" +msgstr "Nykyistä generaatiota %s ei voi poistaa" #: home-manager/home-manager:697 msgid "Removing generation %s" -msgstr "" +msgstr "Generaatio %s poistetaan" #: home-manager/home-manager:718 msgid "No generations to expire" @@ -173,35 +179,36 @@ msgstr "" #: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." -msgstr "" +msgstr "Näyttää siltä, ettei yhtään home-manager-pakettia ole asennettu." #: home-manager/home-manager:811 msgid "Unknown argument %s" -msgstr "" +msgstr "Tuntematon argumentti %s" #: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." -msgstr "" +msgstr "Tämä poistaa Home Managerin järjestelmästäsi." #: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." -msgstr "" +msgstr "Tämä on kuivaharjoitus, mitään ei oikeasti poisteta." #: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" -msgstr "" +msgstr "Haluatko varmasti poistaa Home Managerin?" #: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." -msgstr "" +msgstr "Vaihdetaan tyhjään Home Manager -konfiguraatioon..." #: home-manager/home-manager:863 msgid "Yay!" -msgstr "" +msgstr "Jes!" #: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "" +"Home Manager on poistettu, mutta home.nix-tiedostosi jää koskemattomaksi." #: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." @@ -209,7 +216,7 @@ msgstr "" #: home-manager/home-manager:1113 msgid "Unknown command: %s" -msgstr "" +msgstr "Tuntematon komento: %s" #: home-manager/install.nix:18 msgid "This derivation is not buildable, please run it using nix-shell." diff --git a/modules/po/fi.po b/modules/po/fi.po index 8733eb9566c1..c16c3080773e 100644 --- a/modules/po/fi.po +++ b/modules/po/fi.po @@ -8,21 +8,24 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2024-05-31 17:09+0000\n" +"Last-Translator: jarre johansson \n" +"Language-Team: Finnish \n" "Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.6-dev\n" #: modules/files.nix:191 msgid "Creating home file links in %s" -msgstr "" +msgstr "Luodaan kotitiedostolinkkejä sijaintiin %s" #: modules/files.nix:204 msgid "Cleaning up orphan links from %s" -msgstr "" +msgstr "Siivotaan orpoja linkkejä sijainnista %s" #: modules/files.nix:220 msgid "Creating profile generation %s" @@ -50,15 +53,15 @@ msgstr "" #: modules/home-environment.nix:667 msgid "Activating %s" -msgstr "" +msgstr "Aktivoidaan %s" #: modules/lib-bash/activation-init.sh:22 msgid "Migrating profile from %s to %s" -msgstr "" +msgstr "Siirretään profiilia sijainnista %s kohteeseen %s" #: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" -msgstr "" +msgstr "Sopivaa profiilihakemistoa ei löytynyt, yritettiin %s ja %s" #: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" @@ -79,6 +82,19 @@ msgid "" "\n" "and trying home-manager switch again. Good luck!" msgstr "" +"Edellinen generaation numero ja polku ovat ristiriidassa! Niiden on oltava " +"joko molemmat tyhjiä tai molemmat määritettyjä, mutta ne ovat nyt asetettu " +"seuraavasti:\n" +"\n" +"'%s' ja '%s'\n" +"\n" +"Jos et välitä menettää aiempia profiilin generointeja, niin helpoin ratkaisu " +"on todennäköisesti suorittaa\n" +"\n" +"rm %s/home-manager*\n" +"rm %s/current-home\n" +"\n" +"ja yrittää sitten uudelleen home-manager switch -komentoa. Onnea matkaan!" #: modules/lib-bash/activation-init.sh:127 msgid "Error: USER is set to \"%s\" but we expect \"%s\"" @@ -90,15 +106,15 @@ msgstr "" #: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" -msgstr "" +msgstr "Home Managerin aktivointi käynnistyy" #: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" -msgstr "" +msgstr "Nixin eheys tarkistetaan" #: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" -msgstr "" +msgstr "Tämä on testiajo" #: modules/lib-bash/activation-init.sh:174 msgid "This is a live run" @@ -110,4 +126,4 @@ msgstr "" #: modules/lib-bash/activation-init.sh:183 msgid "Activation variables:" -msgstr "" +msgstr "Aktivointimuuttujat:" From 62da78e1f8897706b9e5e890ffb86389b1d87333 Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Sun, 2 Jun 2024 10:15:15 +0200 Subject: [PATCH 305/636] Translate using Weblate (Vietnamese) Currently translated at 22.2% (4 of 18 strings) Translate using Weblate (Vietnamese) Currently translated at 75.6% (28 of 37 strings) Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/vi/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/vi/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules Co-authored-by: goatastronaut0212 --- home-manager/po/vi.po | 46 ++++++++++++++++++++++++++++--------------- modules/po/vi.po | 12 +++++------ 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/home-manager/po/vi.po b/home-manager/po/vi.po index 336b5562a8d7..85baac38bcf5 100644 --- a/home-manager/po/vi.po +++ b/home-manager/po/vi.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-03-27 15:05+0000\n" -"Last-Translator: Nguyen Khanh \n" +"PO-Revision-Date: 2024-06-02 08:12+0000\n" +"Last-Translator: goatastronaut0212 \n" "Language-Team: Vietnamese \n" "Language: vi\n" @@ -17,12 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.5-dev\n" +"X-Generator: Weblate 5.6-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: bị thiếu đối số cho %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" @@ -36,6 +36,8 @@ msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" +"Giữ Home Manager của bạn %s ở %s đã không còn phù hợp,\n" +"hãy chuyển nó tới %s" #: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" @@ -95,7 +97,7 @@ msgstr "" #: home-manager/home-manager:146 msgid "Sanity checking Nix" -msgstr "" +msgstr "Kiểm tra độ hợp lệ của Nix" #: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" @@ -104,7 +106,7 @@ msgstr "Không thể tìm thấy thư mục hồ sơ phù hợp, đã thử %s v #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" -msgstr "" +msgstr "Không thể kiểm tra tùy chọn của cấu hình flake" #: home-manager/home-manager:296 home-manager/home-manager:319 #: home-manager/home-manager:1051 @@ -137,6 +139,13 @@ msgid "" "to configure Home Manager. Run 'man home-configuration.nix' to\n" "see all available options." msgstr "" +"Đã hoàn thành! Công cụ home-manager giờ đạ được cài đặt và bạn có thể chỉnh " +"sửa\n" +"\n" +" %s\n" +"\n" +"để cấu hình Home Manager. Chạy lệnh 'man home-configuration.nix' để\n" +"xem toàn bộ tùy chọn có sẵn." #. translators: The "%s" specifier will be replaced by a URL. #: home-manager/home-manager:485 @@ -147,6 +156,11 @@ msgid "" "\n" "if the error seems to be the fault of Home Manager." msgstr "" +"Quá trình cài đặt đã thất bại! Vui lòng tạo 1 báo cáo lỗi tại\n" +"\n" +" %s\n" +"\n" +"nếu như lỗi đó thuộc về Home Manager." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:496 @@ -170,11 +184,11 @@ msgstr "" #: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Vui lòng đặt biến môi trường $EDITOR hoặc $VISUAL" #: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" -msgstr "" +msgstr "Không thể chạy lệnh xây dựng trong thư mục chỉ cho phép đọc" #: home-manager/home-manager:693 msgid "No generation with ID %s" @@ -194,31 +208,31 @@ msgstr "" #: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." -msgstr "" +msgstr "Không có bất kỳ gói home-manager nào được cài đặt." #: home-manager/home-manager:811 msgid "Unknown argument %s" -msgstr "" +msgstr "Không tồn tại đối số %s" #: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." -msgstr "" +msgstr "Việc này sẽ xóa Home Manager khỏi hệ thống của bạn." #: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." -msgstr "" +msgstr "Đây là chạy thử nghiệm, sẽ không có bất cư thứ gì được gỡ cài đặt." #: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" -msgstr "" +msgstr "Bạn có muốn gỡ Home Manager không?" #: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." -msgstr "" +msgstr "Chuyển đổi sang cấu hình Home Manager trống..." #: home-manager/home-manager:863 msgid "Yay!" -msgstr "" +msgstr "Tuyệt vời!" #: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." @@ -230,7 +244,7 @@ msgstr "" #: home-manager/home-manager:1113 msgid "Unknown command: %s" -msgstr "" +msgstr "Không tồn tại câu lệnh: %s" #: home-manager/install.nix:18 msgid "This derivation is not buildable, please run it using nix-shell." diff --git a/modules/po/vi.po b/modules/po/vi.po index a285c2bf7f56..09b510df83ac 100644 --- a/modules/po/vi.po +++ b/modules/po/vi.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-03-27 15:05+0000\n" -"Last-Translator: Nguyen Khanh \n" +"PO-Revision-Date: 2024-06-02 08:12+0000\n" +"Last-Translator: goatastronaut0212 \n" "Language-Team: Vietnamese \n" "Language: vi\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.5-dev\n" +"X-Generator: Weblate 5.6-dev\n" #: modules/files.nix:191 msgid "Creating home file links in %s" @@ -97,7 +97,7 @@ msgstr "" #: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" -msgstr "" +msgstr "Kiểm tra độ hợp lệ của Nix" #: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" @@ -109,8 +109,8 @@ msgstr "" #: modules/lib-bash/activation-init.sh:180 msgid "Using Nix version: %s" -msgstr "" +msgstr "Phiên bản Nix đươc sử dụng: %s" #: modules/lib-bash/activation-init.sh:183 msgid "Activation variables:" -msgstr "" +msgstr "Các biến được kích hoạt:" From 9b53a10f4c91892f5af87cf55d08fba59ca086af Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Sun, 2 Jun 2024 10:16:22 +0200 Subject: [PATCH 306/636] swayidle: wait for WAYLAND_DISPLAY To avoid this kind of message: swayidle[181123]: - [Line 1054] Unable to connect to the compositor. If your compositor is running, check or set the WAYLAND_DISPLAY environment variable. --- modules/services/swayidle.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/services/swayidle.nix b/modules/services/swayidle.nix index b28de6f0eee2..80317e42ac12 100644 --- a/modules/services/swayidle.nix +++ b/modules/services/swayidle.nix @@ -118,6 +118,7 @@ in { Unit = { Description = "Idle manager for Wayland"; Documentation = "man:swayidle(1)"; + ConditionEnvironment = "WAYLAND_DISPLAY"; PartOf = [ "graphical-session.target" ]; }; From 83bfe1bac8e0d930f36cee6874bd17e77c8754d1 Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Tue, 4 Jun 2024 06:20:47 +0200 Subject: [PATCH 307/636] nix-gc: add `persistent` option (#5490) Mirrors the `nix.gc.persistent` option in nixpkgs: https://search.nixos.org/options?channel=unstable&show=nix.gc.persistent&from=0&size=50&sort=relevance&type=packages&query=nix.gc.persistent --- modules/services/nix-gc.nix | 13 +++++++++++++ tests/modules/services/nix-gc/expected.timer | 1 + 2 files changed, 14 insertions(+) diff --git a/modules/services/nix-gc.nix b/modules/services/nix-gc.nix index 8ac26dfeef93..652c575ac1f8 100644 --- a/modules/services/nix-gc.nix +++ b/modules/services/nix-gc.nix @@ -90,6 +90,18 @@ in { garbage collector is run automatically. ''; }; + + persistent = mkOption { + type = types.bool; + default = true; + example = false; + description = '' + If true, the time when the service unit was last triggered is + stored on disk. When the timer is activated, the service unit is + triggered immediately if it would have been triggered at least once + during the time when the timer was inactive. + ''; + }; }; }; @@ -107,6 +119,7 @@ in { Unit = { Description = "Nix Garbage Collector"; }; Timer = { OnCalendar = "${cfg.frequency}"; + Persistent = cfg.persistent; Unit = "nix-gc.service"; }; Install = { WantedBy = [ "timers.target" ]; }; diff --git a/tests/modules/services/nix-gc/expected.timer b/tests/modules/services/nix-gc/expected.timer index 2b0c66031ebf..ef30df4359dc 100644 --- a/tests/modules/services/nix-gc/expected.timer +++ b/tests/modules/services/nix-gc/expected.timer @@ -3,6 +3,7 @@ WantedBy=timers.target [Timer] OnCalendar=monthly +Persistent=true Unit=nix-gc.service [Unit] From 07b2c41d2df2878a5c71229a66fb1f8ccef71c47 Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Mon, 3 Jun 2024 22:41:47 -0600 Subject: [PATCH 308/636] ci: bump all actions versions (#5496) * cachix/install-nix-action: v23 -> v27 Release: https://github.com/cachix/install-nix-action/releases/tag/v27 * actions/labeler: v4 -> v5 Release: https://github.com/actions/labeler/releases/tag/v5.0.0 * DeterminateSystems/update-flake-lock: v21 -> v22 Release: https://github.com/DeterminateSystems/update-flake-lock/releases/tag/v22 Signed-off-by: Sumner Evans --- .github/workflows/github_pages.yml | 2 +- .github/workflows/labeler.yml | 3 +-- .github/workflows/test.yml | 2 +- .github/workflows/update-flake.yml | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml index 2dee0786be3c..9f49d49a8617 100644 --- a/.github/workflows/github_pages.yml +++ b/.github/workflows/github_pages.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v23 + - uses: cachix/install-nix-action@v27 with: nix_path: nixpkgs=channel:nixos-unstable - uses: cachix/cachix-action@v15 diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index daea610a3a51..81585d85976c 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -17,8 +17,7 @@ jobs: runs-on: ubuntu-latest if: github.repository_owner == 'nix-community' steps: - - uses: actions/labeler@v4 + - uses: actions/labeler@v5 with: repo-token: ${{ secrets.GITHUB_TOKEN }} sync-labels: true - diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 40d4e2b33bb1..05d04163b540 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v23 + - uses: cachix/install-nix-action@v27 with: nix_path: nixpkgs=channel:nixos-unstable - run: | diff --git a/.github/workflows/update-flake.yml b/.github/workflows/update-flake.yml index 6485286687a2..9df8060df4a3 100644 --- a/.github/workflows/update-flake.yml +++ b/.github/workflows/update-flake.yml @@ -12,9 +12,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v23 + uses: cachix/install-nix-action@v27 - name: Update flake.lock - uses: DeterminateSystems/update-flake-lock@v21 + uses: DeterminateSystems/update-flake-lock@v22 with: token: ${{ secrets.GH_TOKEN_FOR_UPDATES }} pr-labels: dependencies From 1a577c135cad84eb0cd5a922efe2de9cc467772a Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Tue, 4 Jun 2024 00:32:53 -0600 Subject: [PATCH 309/636] ci/labeler: upgrade to v5 format Signed-off-by: Sumner Evans --- .github/labeler.yml | 64 ++++++++++++++++++++++++++------------------- 1 file changed, 37 insertions(+), 27 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index b03251e89a32..7828609bbc81 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,36 +1,46 @@ "mail": - - modules/programs/aerc*.nix - - modules/programs/alot*.nix - - tests/modules/programs/aerc/* - - tests/modules/programs/alot/* - - modules/programs/mujmap.nix - - tests/modules/programs/mujmap/* - - modules/programs/notmuch.nix - - modules/programs/neomutt* - - tests/modules/programs/neomutt/* - - modules/programs/getmail* - - modules/*/mbsync* - - tests/modules/programs/mbsync/* - - modules/programs/himalaya.nix - - tests/modules/programs/himalaya/* - - modules/programs/thunderbird.nix - - tests/modules/programs/thunderbird/* - - modules/services/imapnotify.nix +- changed-files + - any-glob-to-any-file + - modules/programs/aerc*.nix + - modules/programs/alot*.nix + - tests/modules/programs/aerc/* + - tests/modules/programs/alot/* + - modules/programs/mujmap.nix + - tests/modules/programs/mujmap/* + - modules/programs/notmuch.nix + - modules/programs/neomutt* + - tests/modules/programs/neomutt/* + - modules/programs/getmail* + - modules/*/mbsync* + - tests/modules/programs/mbsync/* + - modules/programs/himalaya.nix + - tests/modules/programs/himalaya/* + - modules/programs/thunderbird.nix + - tests/modules/programs/thunderbird/* + - modules/services/imapnotify.nix "neovim": - - modules/programs/neovim.nix - - tests/modules/programs/neovim/**/* +- changed-files + - any-glob-to-any-file + - modules/programs/neovim.nix + - tests/modules/programs/neovim/**/* "shell": - - modules/lib/zsh.nix - - modules/programs/zsh* - - modules/programs/bash* - - tests/modules/programs/zsh/**/* +- changed-files + - any-glob-to-any-file + - modules/lib/zsh.nix + - modules/programs/zsh* + - modules/programs/bash* + - tests/modules/programs/zsh/**/* "calendar": - - modules/programs/khal* - - modules/*/vdirsyncer* - - modules/accounts/calendar.nix +- changed-files + - any-glob-to-any-file + - modules/programs/khal* + - modules/*/vdirsyncer* + - modules/accounts/calendar.nix "contacts": - - modules/accounts/contacts.nix +- changed-files + - any-glob-to-any-file + - modules/accounts/contacts.nix From 2cacdd6a27477f1fa46b7026dd806de30f164d3b Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Tue, 4 Jun 2024 00:39:30 -0600 Subject: [PATCH 310/636] ci/labeler: fix upgrade to v5 format Signed-off-by: Sumner Evans --- .github/labeler.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index 7828609bbc81..cab1b5438716 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,6 +1,6 @@ "mail": -- changed-files - - any-glob-to-any-file +- changed-files: + - any-glob-to-any-file: - modules/programs/aerc*.nix - modules/programs/alot*.nix - tests/modules/programs/aerc/* @@ -20,27 +20,27 @@ - modules/services/imapnotify.nix "neovim": -- changed-files - - any-glob-to-any-file +- changed-files: + - any-glob-to-any-file: - modules/programs/neovim.nix - tests/modules/programs/neovim/**/* "shell": -- changed-files - - any-glob-to-any-file +- changed-files: + - any-glob-to-any-file: - modules/lib/zsh.nix - modules/programs/zsh* - modules/programs/bash* - tests/modules/programs/zsh/**/* "calendar": -- changed-files - - any-glob-to-any-file +- changed-files: + - any-glob-to-any-file: - modules/programs/khal* - modules/*/vdirsyncer* - modules/accounts/calendar.nix "contacts": -- changed-files - - any-glob-to-any-file +- changed-files: + - any-glob-to-any-file: - modules/accounts/contacts.nix From a7117efb3725e6197dd95424136f79147aa35e5b Mon Sep 17 00:00:00 2001 From: Jdogzz Date: Tue, 4 Jun 2024 11:23:39 -0700 Subject: [PATCH 311/636] accounts.email: add clarifying documentation Add clarifying documentation for maildirBasePath value. Also improve default text. --- modules/accounts/email.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/accounts/email.nix b/modules/accounts/email.nix index 8657c4cbd310..f3996195d2dc 100644 --- a/modules/accounts/email.nix +++ b/modules/accounts/email.nix @@ -493,13 +493,14 @@ in { maildirBasePath = mkOption { type = types.str; default = "${config.home.homeDirectory}/Maildir"; - defaultText = "$HOME/Maildir"; + defaultText = "Maildir"; apply = p: if hasPrefix "/" p then p else "${config.home.homeDirectory}/${p}"; description = '' The base directory for account maildir directories. May be a - relative path, in which case it is relative the home - directory. + relative path (e.g. the user setting this value as "MyMaildir"), + in which case it is relative the home directory (e.g. resulting + in "~/MyMaildir"). ''; }; From 8f1b183c91c65c81131bbf7d76f0d845580c60bd Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Fri, 7 Jun 2024 04:20:00 +0000 Subject: [PATCH 312/636] fcitx5: fix tests Since https://github.com/NixOS/nixpkgs/pull/308725, fcitx5-with-addons expects share/dbus-1/services/ to be present. This patch updates the fcitx5 stub to reflect that. --- tests/modules/i18n/input-method/fcitx5-stubs.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/modules/i18n/input-method/fcitx5-stubs.nix b/tests/modules/i18n/input-method/fcitx5-stubs.nix index 2390ddde89f0..9712a7518d2f 100644 --- a/tests/modules/i18n/input-method/fcitx5-stubs.nix +++ b/tests/modules/i18n/input-method/fcitx5-stubs.nix @@ -4,11 +4,15 @@ version = "0"; outPath = null; buildScript = '' - mkdir -p $out/bin $out/share/applications $out/etc/xdg/autostart + mkdir -p $out/bin $out/share/applications $out/share/dbus-1/services $out/etc/xdg/autostart touch $out/bin/fcitx5 \ $out/bin/fcitx5-config-qt \ $out/share/applications/org.fcitx.Fcitx5.desktop \ + $out/share/dbus-1/services/org.fcitx.Fcitx5.service \ $out/etc/xdg/autostart/org.fcitx.Fcitx5.desktop + # The grep usage of fcitx5-with-addons expects one of the files to match with the fcitx5.out + # https://github.com/NixOS/nixpkgs/blob/d2eb4be48705289791428c07aca8ff654c1422ba/pkgs/tools/inputmethods/fcitx5/with-addons.nix#L40-L44 + echo $out >> $out/etc/xdg/autostart/org.fcitx.Fcitx5.desktop chmod +x $out/bin/fcitx5 \ $out/bin/fcitx5-config-qt ''; From 8bdb74eaffa21cfce02d7d5d55cbde5524d50b84 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Sun, 9 Jun 2024 06:09:00 -0500 Subject: [PATCH 313/636] docs: add redirect from the previous options.html After migrating to nixos-render-docs, the extension move to .xtml. Unfortunately, this broke links to the previous Options Page. This patch provides a basic redirect support to the new Options Page. --- docs/home-manager-manual.nix | 2 ++ docs/options.html | 15 +++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 docs/options.html diff --git a/docs/home-manager-manual.nix b/docs/home-manager-manual.nix index 34196d423783..23b2d1e65586 100644 --- a/docs/home-manager-manual.nix +++ b/docs/home-manager-manual.nix @@ -32,6 +32,8 @@ in stdenv.mkDerivation { OPTIONS_JSON \ ${home-manager-options.nix-darwin}/share/doc/nixos/options.json + cp ${./options.html} out/options.html + cp ${./static/style.css} out/style.css cp -r ${./release-notes} release-notes diff --git a/docs/options.html b/docs/options.html new file mode 100644 index 000000000000..66c803fc92bc --- /dev/null +++ b/docs/options.html @@ -0,0 +1,15 @@ + + + + Redirecting… + + + + + +

Redirecting…

+ + + From 885c037109fdbc05f37da8fa1b81c5a2f91f718b Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 9 Jun 2024 13:09:33 +0200 Subject: [PATCH 314/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/ad57eef4ef0659193044870c731987a6df5cf56b?narHash=sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs%3D' (2024-05-29) → 'github:NixOS/nixpkgs/051f920625ab5aabe37c920346e3e69d7d34400e?narHash=sha256-4q0s6m0GUcN7q%2BY2DqD27iLvbcd1G50T2lv08kKxkSI%3D' (2024-06-07) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 865072042d2e..20290f1cc49d 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1716948383, - "narHash": "sha256-SzDKxseEcHR5KzPXLwsemyTR/kaM9whxeiJohbL04rs=", + "lastModified": 1717786204, + "narHash": "sha256-4q0s6m0GUcN7q+Y2DqD27iLvbcd1G50T2lv08kKxkSI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "ad57eef4ef0659193044870c731987a6df5cf56b", + "rev": "051f920625ab5aabe37c920346e3e69d7d34400e", "type": "github" }, "original": { From 8a20efbb00b096d7d30211cd306cc360c8eba38c Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Sun, 9 Jun 2024 14:11:01 +0300 Subject: [PATCH 315/636] hyprland: install xwayland if enabled Install the `xwayland` package if `cfg.xwayland.enable = true;`. This allows XWayland to work without having to enable the NixOS Hyprland option. --- modules/services/window-managers/hyprland.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index 6b79248bae21..8fbdc6b7c688 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -206,7 +206,10 @@ in { "You have enabled hyprland.systemd.enable or listed plugins in hyprland.plugins but do not have any configuration in hyprland.settings or hyprland.extraConfig. This is almost certainly a mistake."; in lib.optional inconsistent warning; - home.packages = lib.optional (cfg.package != null) cfg.finalPackage; + home.packages = lib.concatLists [ + (lib.optional (cfg.package != null) cfg.finalPackage) + (lib.optional (cfg.xwayland.enable) pkgs.xwayland) + ]; xdg.configFile."hypr/hyprland.conf" = let shouldGenerate = cfg.systemd.enable || cfg.extraConfig != "" From 3d65009effd77cb0d6e7520b68b039836a7606cf Mon Sep 17 00:00:00 2001 From: Matthieu Coudron <886074+teto@users.noreply.github.com> Date: Sun, 9 Jun 2024 13:14:04 +0200 Subject: [PATCH 316/636] waybar: remove modules-* from defaults Some prefer to handle modules-* imperatively for more flexibility, e.g., via waybar "includes" (https://github.com/Alexays/Waybar/wiki/Configuration). Current HM defaults modules-* to `[]` instead of null for most other settings, so they get written to ~/.config/waybar/config even though no explicit configuration has been made. And they take precedence over the imperative ones because of how waybar's includes work: ==== Paths to additional configuration files. Each file can contain a single object with any of the bar configuration options. In case of duplicate options, the first defined value takes precedence, i.e. including file -> first included file -> etc. Nested includes are permitted, but make sure to avoid circular imports. For a multi-bar config, the include directive affects only current bar configuration object. ==== --- modules/programs/waybar.nix | 12 ++++++------ .../programs/waybar/deprecated-modules-option.nix | 2 -- .../programs/waybar/settings-complex-expected.json | 1 - 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/modules/programs/waybar.nix b/modules/programs/waybar.nix index 9925effc926a..72d247323fb8 100644 --- a/modules/programs/waybar.nix +++ b/modules/programs/waybar.nix @@ -69,8 +69,8 @@ let }; modules-left = mkOption { - type = listOf str; - default = [ ]; + type = nullOr (listOf str); + default = null; description = "Modules that will be displayed on the left."; example = literalExpression '' [ "sway/workspaces" "sway/mode" "wlr/taskbar" ] @@ -78,8 +78,8 @@ let }; modules-center = mkOption { - type = listOf str; - default = [ ]; + type = nullOr (listOf str); + default = null; description = "Modules that will be displayed in the center."; example = literalExpression '' [ "sway/window" ] @@ -87,8 +87,8 @@ let }; modules-right = mkOption { - type = listOf str; - default = [ ]; + type = nullOr (listOf str); + default = null; description = "Modules that will be displayed on the right."; example = literalExpression '' [ "mpd" "custom/mymodule#with-css-id" "temperature" ] diff --git a/tests/modules/programs/waybar/deprecated-modules-option.nix b/tests/modules/programs/waybar/deprecated-modules-option.nix index b4d730afcf1d..09f163b0fcfd 100644 --- a/tests/modules/programs/waybar/deprecated-modules-option.nix +++ b/tests/modules/programs/waybar/deprecated-modules-option.nix @@ -31,8 +31,6 @@ with lib; "modules-center": [ "test" ], - "modules-left": [], - "modules-right": [], "test": {} } ] diff --git a/tests/modules/programs/waybar/settings-complex-expected.json b/tests/modules/programs/waybar/settings-complex-expected.json index 87e4f690d05f..e7ec8b4a3a90 100644 --- a/tests/modules/programs/waybar/settings-complex-expected.json +++ b/tests/modules/programs/waybar/settings-complex-expected.json @@ -51,7 +51,6 @@ "modules-left": [ "sway/mode" ], - "modules-right": [], "output": [ "!DP-1" ], From 892f76bd0aa09a0f7f73eb41834b8a904b6d0fad Mon Sep 17 00:00:00 2001 From: Mathis H Date: Tue, 11 Jun 2024 21:35:34 +0000 Subject: [PATCH 317/636] mpv: fix package if wrapMpv not found `wrapMpv` was removed from nixpkgs since this PR: https://github.com/NixOS/nixpkgs/pull/304349 Co-authored-by: Mario Rodas --- modules/programs/mpv.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/mpv.nix b/modules/programs/mpv.nix index 26cad11128c6..30f2a8e05d0c 100644 --- a/modules/programs/mpv.nix +++ b/modules/programs/mpv.nix @@ -55,8 +55,10 @@ let mpvPackage = if cfg.scripts == [ ] then cfg.package + else if hasAttr "wrapMpv" pkgs then + pkgs.wrapMpv pkgs.mpv-unwrapped { scripts = cfg.scripts; } else - pkgs.wrapMpv pkgs.mpv-unwrapped { scripts = cfg.scripts; }; + pkgs.mpv.override { scripts = cfg.scripts; }; in { options = { From 8d5e27b4807d25308dfe369d5a923d87e7dbfda3 Mon Sep 17 00:00:00 2001 From: midchildan Date: Thu, 13 Jun 2024 10:47:38 +0900 Subject: [PATCH 318/636] nix: add a declarative alternative to Nix channels (#4031) * nix: add options 'nixPath' and 'keepOldNixPath' By default, the system value for $NIX_PATH is kept as a fallback. To completely override the system value for $NIX_PATH: nix.keepOldNixPath = false; * nix: add more tests * nix: add a declarative alternative to Nix channels This adds a new option, 'nix.channels'. It's the Nix channels equivalent of the 'nix.registry' option, and compatible with pre-Flake Nix tooling including nix-env and nix-shell. Like 'nix.registry', this option is useful for pinning Nix channels. Channels defined in the new option can coexist with channels introduced through the nix-channel command. If the same channel exists in both, the one from Home Manager will be prioritized. * nix: add news entry * nix: make channels respect use-xdg-base-directories * nix: remove 'with lib;' --------- Co-authored-by: Michael Hoang --- modules/misc/news.nix | 11 +++ modules/misc/nix.nix | 83 ++++++++++++++++++- tests/modules/misc/nix/default.nix | 3 + tests/modules/misc/nix/empty-settings.nix | 1 + .../modules/misc/nix/example-channels-xdg.nix | 29 +++++++ tests/modules/misc/nix/example-channels.nix | 26 ++++++ tests/modules/misc/nix/example-settings.nix | 5 ++ tests/modules/misc/nix/keep-old-nix-path.nix | 16 ++++ 8 files changed, 172 insertions(+), 2 deletions(-) create mode 100644 tests/modules/misc/nix/example-channels-xdg.nix create mode 100644 tests/modules/misc/nix/example-channels.nix create mode 100644 tests/modules/misc/nix/keep-old-nix-path.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 2164d66a5bfb..1242d640b093 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1656,6 +1656,17 @@ in { See https://codeberg.org/dnkl/yambar for more. ''; } + + { + time = "2024-05-25T14:36:03+00:00"; + message = '' + Multiple new options are available: + + - 'nix.nixPath' + - 'nix.keepOldNixPath' + - 'nix.channels' + ''; + } ]; }; } diff --git a/modules/misc/nix.nix b/modules/misc/nix.nix index a4456946e567..2daa56b237b3 100644 --- a/modules/misc/nix.nix +++ b/modules/misc/nix.nix @@ -1,15 +1,40 @@ { config, lib, pkgs, ... }: -with lib; - let + inherit (lib) + boolToString concatStringsSep escape floatToString getVersion isBool + isConvertibleWithToString isDerivation isFloat isInt isList isString + literalExpression maintainers mapAttrsToList mkDefault mkEnableOption mkIf + mkMerge mkOption optionalString toPretty types versionAtLeast; + cfg = config.nix; nixPackage = cfg.package; isNixAtLeast = versionAtLeast (getVersion nixPackage); + nixPath = concatStringsSep ":" cfg.nixPath; + + useXdg = config.nix.enable + && (config.nix.settings.use-xdg-base-directories or false); + defexprDir = if useXdg then + "${config.xdg.stateHome}/nix/defexpr" + else + "${config.home.homeDirectory}/.nix-defexpr"; + + # The deploy path for declarative channels. The directory name is prefixed + # with a number to make it easier for files in defexprDir to control the order + # they'll be read relative to each other. + channelPath = "${defexprDir}/50-home-manager"; + + channelsDrv = let + mkEntry = name: drv: { + inherit name; + path = toString drv; + }; + in pkgs.linkFarm "channels" (lib.mapAttrsToList mkEntry cfg.channels); + nixConf = assert isNixAtLeast "2.2"; let @@ -102,6 +127,47 @@ in { ''; }; + nixPath = mkOption { + type = types.listOf types.str; + default = [ ]; + example = [ + "$HOME/.nix-defexpr/channels" + "darwin-config=$HOME/.config/nixpkgs/darwin-configuration.nix" + ]; + description = '' + Adds new directories to the Nix expression search path. + + Used by Nix when looking up paths in angular brackets + (e.g. ``). + ''; + }; + + keepOldNixPath = mkOption { + type = types.bool; + default = true; + example = false; + description = '' + Whether {option}`nix.nixPath` should keep the previously set values in + {env}`NIX_PATH`. + ''; + }; + + channels = lib.mkOption { + type = with lib.types; attrsOf package; + default = { }; + example = lib.literalExpression "{ inherit nixpkgs; }"; + description = '' + A declarative alternative to Nix channels. Whereas with stock channels, + you would register URLs and fetch them into the Nix store with + {manpage}`nix-channel(1)`, this option allows you to register the store + path directly. One particularly useful example is registering flake + inputs as channels. + + This option can coexist with stock Nix channels. If the same channel is + defined in both, this option takes precedence. + ''; + }; + registry = mkOption { type = types.attrsOf (types.submodule (let inputAttrs = types.attrsOf @@ -210,6 +276,19 @@ in { }; config = mkIf cfg.enable (mkMerge [ + (mkIf (cfg.nixPath != [ ] && !cfg.keepOldNixPath) { + home.sessionVariables.NIX_PATH = "${nixPath}"; + }) + + (mkIf (cfg.nixPath != [ ] && cfg.keepOldNixPath) { + home.sessionVariables.NIX_PATH = "${nixPath}\${NIX_PATH:+:$NIX_PATH}"; + }) + + (lib.mkIf (cfg.channels != { }) { + nix.nixPath = [ channelPath ]; + home.file."${channelPath}".source = channelsDrv; + }) + (mkIf (cfg.registry != { }) { xdg.configFile."nix/registry.json".source = jsonFormat.generate "registry.json" { diff --git a/tests/modules/misc/nix/default.nix b/tests/modules/misc/nix/default.nix index b0370c2e4644..4c8822bf2a03 100644 --- a/tests/modules/misc/nix/default.nix +++ b/tests/modules/misc/nix/default.nix @@ -2,4 +2,7 @@ nix-empty-settings = ./empty-settings.nix; nix-example-settings = ./example-settings.nix; nix-example-registry = ./example-registry.nix; + nix-keep-old-nix-path = ./keep-old-nix-path.nix; + nix-example-channels = ./example-channels.nix; + nix-example-channels-xdg = ./example-channels-xdg.nix; } diff --git a/tests/modules/misc/nix/empty-settings.nix b/tests/modules/misc/nix/empty-settings.nix index 18f1ab4301d4..7e5844742f3c 100644 --- a/tests/modules/misc/nix/empty-settings.nix +++ b/tests/modules/misc/nix/empty-settings.nix @@ -8,6 +8,7 @@ with lib; nmt.script = '' assertPathNotExists home-files/.config/nix + assertPathNotExists home-files/.nix-defexpr/50-home-manager ''; }; } diff --git a/tests/modules/misc/nix/example-channels-xdg.nix b/tests/modules/misc/nix/example-channels-xdg.nix new file mode 100644 index 000000000000..8ca1569f34be --- /dev/null +++ b/tests/modules/misc/nix/example-channels-xdg.nix @@ -0,0 +1,29 @@ +{ lib, config, pkgs, ... }: + +let + exampleChannel = pkgs.writeTextDir "default.nix" '' + { pkgs ? import { } }: + + { + example = pkgs.emptyDirectory; + } + ''; +in { + config = { + nix = { + package = config.lib.test.mkStubPackage { + version = lib.getVersion pkgs.nixVersions.stable; + }; + channels.example = exampleChannel; + settings.use-xdg-base-directories = true; + }; + + nmt.script = '' + assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ + 'export NIX_PATH="/home/hm-user/.local/state/nix/defexpr/50-home-manager''${NIX_PATH:+:$NIX_PATH}"' + assertFileContent \ + home-files/.local/state/nix/defexpr/50-home-manager/example/default.nix \ + ${exampleChannel}/default.nix + ''; + }; +} diff --git a/tests/modules/misc/nix/example-channels.nix b/tests/modules/misc/nix/example-channels.nix new file mode 100644 index 000000000000..4b98c55d4e40 --- /dev/null +++ b/tests/modules/misc/nix/example-channels.nix @@ -0,0 +1,26 @@ +{ config, pkgs, ... }: + +let + exampleChannel = pkgs.writeTextDir "default.nix" '' + { pkgs ? import { } }: + + { + example = pkgs.emptyDirectory; + } + ''; +in { + config = { + nix = { + package = config.lib.test.mkStubPackage { }; + channels.example = exampleChannel; + }; + + nmt.script = '' + assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ + 'export NIX_PATH="/home/hm-user/.nix-defexpr/50-home-manager''${NIX_PATH:+:$NIX_PATH}"' + assertFileContent \ + home-files/.nix-defexpr/50-home-manager/example/default.nix \ + ${exampleChannel}/default.nix + ''; + }; +} diff --git a/tests/modules/misc/nix/example-settings.nix b/tests/modules/misc/nix/example-settings.nix index 6cbcd9dfa430..df62fe8d12bd 100644 --- a/tests/modules/misc/nix/example-settings.nix +++ b/tests/modules/misc/nix/example-settings.nix @@ -17,6 +17,8 @@ with lib; ''; }; + nixPath = [ "/a" "/b/c" ]; + settings = { use-sandbox = true; show-trace = true; @@ -28,6 +30,9 @@ with lib; assertFileContent \ home-files/.config/nix/nix.conf \ ${./example-settings-expected.conf} + + assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ + 'export NIX_PATH="/a:/b/c''${NIX_PATH:+:$NIX_PATH}"' ''; }; } diff --git a/tests/modules/misc/nix/keep-old-nix-path.nix b/tests/modules/misc/nix/keep-old-nix-path.nix new file mode 100644 index 000000000000..72bd9f164421 --- /dev/null +++ b/tests/modules/misc/nix/keep-old-nix-path.nix @@ -0,0 +1,16 @@ +{ config, ... }: + +{ + config = { + nix = { + package = config.lib.test.mkStubPackage { }; + nixPath = [ "/a" "/b/c" ]; + keepOldNixPath = false; + }; + + nmt.script = '' + assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ + 'export NIX_PATH="/a:/b/c"' + ''; + }; +} From 03c45b982c4e1ec683dbcbb587cddb41691bf52a Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 16 Jun 2024 10:32:21 +0200 Subject: [PATCH 319/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/051f920625ab5aabe37c920346e3e69d7d34400e?narHash=sha256-4q0s6m0GUcN7q%2BY2DqD27iLvbcd1G50T2lv08kKxkSI%3D' (2024-06-07) → 'github:NixOS/nixpkgs/e9ee548d90ff586a6471b4ae80ae9cfcbceb3420?narHash=sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY%3D' (2024-06-13) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 20290f1cc49d..284ee49812e8 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1717786204, - "narHash": "sha256-4q0s6m0GUcN7q+Y2DqD27iLvbcd1G50T2lv08kKxkSI=", + "lastModified": 1718318537, + "narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "051f920625ab5aabe37c920346e3e69d7d34400e", + "rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420", "type": "github" }, "original": { From f2f254640ef74ee99cc4d6e76a7a13ec56ed5205 Mon Sep 17 00:00:00 2001 From: Mohamed Nehad Shalabi Date: Fri, 14 Jun 2024 22:40:58 +0200 Subject: [PATCH 320/636] Add translation using Weblate (Arabic) Co-authored-by: Mohamed Nehad Shalabi --- home-manager/po/ar.po | 217 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 home-manager/po/ar.po diff --git a/home-manager/po/ar.po b/home-manager/po/ar.po new file mode 100644 index 000000000000..ea67fd5aeb68 --- /dev/null +++ b/home-manager/po/ar.po @@ -0,0 +1,217 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Home Manager contributors +# This file is distributed under the same license as the Home Manager package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Home Manager\n" +"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ar\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 ? 4 : 5;\n" + +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 +msgid "No configuration file found at %s" +msgstr "" + +#. translators: The first '%s' specifier will be replaced by either +#. 'home.nix' or 'flake.nix'. +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 +msgid "" +"Keeping your Home Manager %s in %s is deprecated,\n" +"please move it to %s" +msgstr "" + +#: home-manager/home-manager:92 +msgid "No configuration file found. Please create one at %s" +msgstr "" + +#: home-manager/home-manager:107 +msgid "Home Manager not found at %s." +msgstr "" + +#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. +#: home-manager/home-manager:115 +msgid "" +"The fallback Home Manager path %s has been deprecated and a file/directory " +"was found there." +msgstr "" + +#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. +#: home-manager/home-manager:118 +msgid "" +"To remove this warning, do one of the following.\n" +"\n" +"1. Explicitly tell Home Manager to use the path, for example by adding\n" +"\n" +" { programs.home-manager.path = \"%s\"; }\n" +"\n" +" to your configuration.\n" +"\n" +" If you import Home Manager directly, you can use the `path` parameter\n" +"\n" +" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" +"\n" +" when calling the Home Manager package.\n" +"\n" +"2. Remove the deprecated path.\n" +"\n" +" $ rm -r \"%s\"" +msgstr "" + +#: home-manager/home-manager:146 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:166 +msgid "Could not find suitable profile directory, tried %s and %s" +msgstr "" + +#. translators: Here "flake" is a noun that refers to the Nix Flakes feature. +#: home-manager/home-manager:221 +msgid "Can't inspect options of a flake configuration" +msgstr "" + +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 +msgid "%s: unknown option '%s'" +msgstr "" + +#: home-manager/home-manager:301 home-manager/home-manager:1052 +msgid "Run '%s --help' for usage help" +msgstr "" + +#: home-manager/home-manager:327 home-manager/home-manager:431 +msgid "The file %s already exists, leaving it unchanged..." +msgstr "" + +#: home-manager/home-manager:329 home-manager/home-manager:433 +msgid "Creating %s..." +msgstr "" + +#: home-manager/home-manager:475 +msgid "Creating initial Home Manager generation..." +msgstr "" + +#. translators: The "%s" specifier will be replaced by a file path. +#: home-manager/home-manager:480 +msgid "" +"All done! The home-manager tool should now be installed and you can edit\n" +"\n" +" %s\n" +"\n" +"to configure Home Manager. Run 'man home-configuration.nix' to\n" +"see all available options." +msgstr "" + +#. translators: The "%s" specifier will be replaced by a URL. +#: home-manager/home-manager:485 +msgid "" +"Uh oh, the installation failed! Please create an issue at\n" +"\n" +" %s\n" +"\n" +"if the error seems to be the fault of Home Manager." +msgstr "" + +#. translators: Here "flake" is a noun that refers to the Nix Flakes feature. +#: home-manager/home-manager:496 +msgid "Can't instantiate a flake configuration" +msgstr "" + +#: home-manager/home-manager:572 +msgid "" +"There is %d unread and relevant news item.\n" +"Read it by running the command \"%s news\"." +msgid_plural "" +"There are %d unread and relevant news items.\n" +"Read them by running the command \"%s news\"." +msgstr[0] "" +msgstr[1] "" + +#: home-manager/home-manager:586 +msgid "Unknown \"news.display\" setting \"%s\"." +msgstr "" + +#: home-manager/home-manager:594 +#, sh-format +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" + +#: home-manager/home-manager:612 +msgid "Cannot run build in read-only directory" +msgstr "" + +#: home-manager/home-manager:693 +msgid "No generation with ID %s" +msgstr "" + +#: home-manager/home-manager:695 +msgid "Cannot remove the current generation %s" +msgstr "" + +#: home-manager/home-manager:697 +msgid "Removing generation %s" +msgstr "" + +#: home-manager/home-manager:718 +msgid "No generations to expire" +msgstr "" + +#: home-manager/home-manager:729 +msgid "No home-manager packages seem to be installed." +msgstr "" + +#: home-manager/home-manager:811 +msgid "Unknown argument %s" +msgstr "" + +#: home-manager/home-manager:835 +msgid "This will remove Home Manager from your system." +msgstr "" + +#: home-manager/home-manager:838 +msgid "This is a dry run, nothing will actually be uninstalled." +msgstr "" + +#: home-manager/home-manager:842 +msgid "Really uninstall Home Manager?" +msgstr "" + +#: home-manager/home-manager:848 +msgid "Switching to empty Home Manager configuration..." +msgstr "" + +#: home-manager/home-manager:863 +msgid "Yay!" +msgstr "" + +#: home-manager/home-manager:868 +msgid "Home Manager is uninstalled but your home.nix is left untouched." +msgstr "" + +#: home-manager/home-manager:1091 +msgid "expire-generations expects one argument, got %d." +msgstr "" + +#: home-manager/home-manager:1113 +msgid "Unknown command: %s" +msgstr "" + +#: home-manager/install.nix:18 +msgid "This derivation is not buildable, please run it using nix-shell." +msgstr "" From 6396c03229a8efa21a7550375de26620e07020b6 Mon Sep 17 00:00:00 2001 From: Languages add-on Date: Fri, 14 Jun 2024 22:40:58 +0200 Subject: [PATCH 321/636] Add translation using Weblate (Hungarian) Add translation using Weblate (Arabic) Co-authored-by: Languages add-on --- modules/po/ar.po | 113 +++++++++++++++++++++++++++++++++++++++++++++++ modules/po/hu.po | 113 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 226 insertions(+) create mode 100644 modules/po/ar.po create mode 100644 modules/po/hu.po diff --git a/modules/po/ar.po b/modules/po/ar.po new file mode 100644 index 000000000000..c2469fa54d17 --- /dev/null +++ b/modules/po/ar.po @@ -0,0 +1,113 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Home Manager contributors +# This file is distributed under the same license as the Home Manager Modules package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Home Manager Modules\n" +"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: ar\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: modules/files.nix:191 +msgid "Creating home file links in %s" +msgstr "" + +#: modules/files.nix:204 +msgid "Cleaning up orphan links from %s" +msgstr "" + +#: modules/files.nix:220 +msgid "Creating profile generation %s" +msgstr "" + +#: modules/files.nix:237 +msgid "No change so reusing latest profile generation %s" +msgstr "" + +#: modules/home-environment.nix:634 +msgid "" +"Oops, Nix failed to install your new Home Manager profile!\n" +"\n" +"Perhaps there is a conflict with a package that was installed using\n" +"\"%s\"? Try running\n" +"\n" +" %s\n" +"\n" +"and if there is a conflicting package you can remove it with\n" +"\n" +" %s\n" +"\n" +"Then try activating your Home Manager configuration again." +msgstr "" + +#: modules/home-environment.nix:667 +msgid "Activating %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:22 +msgid "Migrating profile from %s to %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:54 +msgid "Could not find suitable profile directory, tried %s and %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:83 +msgid "Sanity checking oldGenNum and oldGenPath" +msgstr "" + +#: modules/lib-bash/activation-init.sh:86 +msgid "" +"The previous generation number and path are in conflict! These\n" +"must be either both empty or both set but are now set to\n" +"\n" +" '%s' and '%s'\n" +"\n" +"If you don't mind losing previous profile generations then\n" +"the easiest solution is probably to run\n" +"\n" +" rm %s/home-manager*\n" +" rm %s/current-home\n" +"\n" +"and trying home-manager switch again. Good luck!" +msgstr "" + +#: modules/lib-bash/activation-init.sh:127 +msgid "Error: USER is set to \"%s\" but we expect \"%s\"" +msgstr "" + +#: modules/lib-bash/activation-init.sh:136 +msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" +msgstr "" + +#: modules/lib-bash/activation-init.sh:153 +msgid "Starting Home Manager activation" +msgstr "" + +#: modules/lib-bash/activation-init.sh:157 +msgid "Sanity checking Nix" +msgstr "" + +#: modules/lib-bash/activation-init.sh:170 +msgid "This is a dry run" +msgstr "" + +#: modules/lib-bash/activation-init.sh:174 +msgid "This is a live run" +msgstr "" + +#: modules/lib-bash/activation-init.sh:180 +msgid "Using Nix version: %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:183 +msgid "Activation variables:" +msgstr "" diff --git a/modules/po/hu.po b/modules/po/hu.po new file mode 100644 index 000000000000..b52c62933764 --- /dev/null +++ b/modules/po/hu.po @@ -0,0 +1,113 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Home Manager contributors +# This file is distributed under the same license as the Home Manager Modules package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Home Manager Modules\n" +"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: modules/files.nix:191 +msgid "Creating home file links in %s" +msgstr "" + +#: modules/files.nix:204 +msgid "Cleaning up orphan links from %s" +msgstr "" + +#: modules/files.nix:220 +msgid "Creating profile generation %s" +msgstr "" + +#: modules/files.nix:237 +msgid "No change so reusing latest profile generation %s" +msgstr "" + +#: modules/home-environment.nix:634 +msgid "" +"Oops, Nix failed to install your new Home Manager profile!\n" +"\n" +"Perhaps there is a conflict with a package that was installed using\n" +"\"%s\"? Try running\n" +"\n" +" %s\n" +"\n" +"and if there is a conflicting package you can remove it with\n" +"\n" +" %s\n" +"\n" +"Then try activating your Home Manager configuration again." +msgstr "" + +#: modules/home-environment.nix:667 +msgid "Activating %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:22 +msgid "Migrating profile from %s to %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:54 +msgid "Could not find suitable profile directory, tried %s and %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:83 +msgid "Sanity checking oldGenNum and oldGenPath" +msgstr "" + +#: modules/lib-bash/activation-init.sh:86 +msgid "" +"The previous generation number and path are in conflict! These\n" +"must be either both empty or both set but are now set to\n" +"\n" +" '%s' and '%s'\n" +"\n" +"If you don't mind losing previous profile generations then\n" +"the easiest solution is probably to run\n" +"\n" +" rm %s/home-manager*\n" +" rm %s/current-home\n" +"\n" +"and trying home-manager switch again. Good luck!" +msgstr "" + +#: modules/lib-bash/activation-init.sh:127 +msgid "Error: USER is set to \"%s\" but we expect \"%s\"" +msgstr "" + +#: modules/lib-bash/activation-init.sh:136 +msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" +msgstr "" + +#: modules/lib-bash/activation-init.sh:153 +msgid "Starting Home Manager activation" +msgstr "" + +#: modules/lib-bash/activation-init.sh:157 +msgid "Sanity checking Nix" +msgstr "" + +#: modules/lib-bash/activation-init.sh:170 +msgid "This is a dry run" +msgstr "" + +#: modules/lib-bash/activation-init.sh:174 +msgid "This is a live run" +msgstr "" + +#: modules/lib-bash/activation-init.sh:180 +msgid "Using Nix version: %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:183 +msgid "Activation variables:" +msgstr "" From 0a7ffb28e5df5844d0e8039c9833d7075cdee792 Mon Sep 17 00:00:00 2001 From: Balint Barna Kovari Date: Fri, 14 Jun 2024 22:40:58 +0200 Subject: [PATCH 322/636] Translate using Weblate (Hungarian) Currently translated at 5.4% (2 of 37 strings) Add translation using Weblate (Hungarian) Co-authored-by: Balint Barna Kovari Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/hu/ Translation: Home Manager/Home Manager CLI --- home-manager/po/hu.po | 218 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 home-manager/po/hu.po diff --git a/home-manager/po/hu.po b/home-manager/po/hu.po new file mode 100644 index 000000000000..88ad1d780eb1 --- /dev/null +++ b/home-manager/po/hu.po @@ -0,0 +1,218 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Home Manager contributors +# This file is distributed under the same license as the Home Manager package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Home Manager\n" +"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" +"PO-Revision-Date: 2024-06-14 20:40+0000\n" +"Last-Translator: Balint Barna Kovari \n" +"Language-Team: Hungarian \n" +"Language: hu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.6-dev\n" + +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "%s: hiányzó érték erre: %s" + +#: home-manager/home-manager:64 +msgid "No configuration file found at %s" +msgstr "Nincs konfigurációs fájl itt: %s" + +#. translators: The first '%s' specifier will be replaced by either +#. 'home.nix' or 'flake.nix'. +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 +msgid "" +"Keeping your Home Manager %s in %s is deprecated,\n" +"please move it to %s" +msgstr "" + +#: home-manager/home-manager:92 +msgid "No configuration file found. Please create one at %s" +msgstr "" + +#: home-manager/home-manager:107 +msgid "Home Manager not found at %s." +msgstr "" + +#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. +#: home-manager/home-manager:115 +msgid "" +"The fallback Home Manager path %s has been deprecated and a file/directory " +"was found there." +msgstr "" + +#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. +#: home-manager/home-manager:118 +msgid "" +"To remove this warning, do one of the following.\n" +"\n" +"1. Explicitly tell Home Manager to use the path, for example by adding\n" +"\n" +" { programs.home-manager.path = \"%s\"; }\n" +"\n" +" to your configuration.\n" +"\n" +" If you import Home Manager directly, you can use the `path` parameter\n" +"\n" +" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" +"\n" +" when calling the Home Manager package.\n" +"\n" +"2. Remove the deprecated path.\n" +"\n" +" $ rm -r \"%s\"" +msgstr "" + +#: home-manager/home-manager:146 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:166 +msgid "Could not find suitable profile directory, tried %s and %s" +msgstr "" + +#. translators: Here "flake" is a noun that refers to the Nix Flakes feature. +#: home-manager/home-manager:221 +msgid "Can't inspect options of a flake configuration" +msgstr "" + +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 +msgid "%s: unknown option '%s'" +msgstr "" + +#: home-manager/home-manager:301 home-manager/home-manager:1052 +msgid "Run '%s --help' for usage help" +msgstr "" + +#: home-manager/home-manager:327 home-manager/home-manager:431 +msgid "The file %s already exists, leaving it unchanged..." +msgstr "" + +#: home-manager/home-manager:329 home-manager/home-manager:433 +msgid "Creating %s..." +msgstr "" + +#: home-manager/home-manager:475 +msgid "Creating initial Home Manager generation..." +msgstr "" + +#. translators: The "%s" specifier will be replaced by a file path. +#: home-manager/home-manager:480 +msgid "" +"All done! The home-manager tool should now be installed and you can edit\n" +"\n" +" %s\n" +"\n" +"to configure Home Manager. Run 'man home-configuration.nix' to\n" +"see all available options." +msgstr "" + +#. translators: The "%s" specifier will be replaced by a URL. +#: home-manager/home-manager:485 +msgid "" +"Uh oh, the installation failed! Please create an issue at\n" +"\n" +" %s\n" +"\n" +"if the error seems to be the fault of Home Manager." +msgstr "" + +#. translators: Here "flake" is a noun that refers to the Nix Flakes feature. +#: home-manager/home-manager:496 +msgid "Can't instantiate a flake configuration" +msgstr "" + +#: home-manager/home-manager:572 +msgid "" +"There is %d unread and relevant news item.\n" +"Read it by running the command \"%s news\"." +msgid_plural "" +"There are %d unread and relevant news items.\n" +"Read them by running the command \"%s news\"." +msgstr[0] "" +msgstr[1] "" + +#: home-manager/home-manager:586 +msgid "Unknown \"news.display\" setting \"%s\"." +msgstr "" + +#: home-manager/home-manager:594 +#, sh-format +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" + +#: home-manager/home-manager:612 +msgid "Cannot run build in read-only directory" +msgstr "" + +#: home-manager/home-manager:693 +msgid "No generation with ID %s" +msgstr "" + +#: home-manager/home-manager:695 +msgid "Cannot remove the current generation %s" +msgstr "" + +#: home-manager/home-manager:697 +msgid "Removing generation %s" +msgstr "" + +#: home-manager/home-manager:718 +msgid "No generations to expire" +msgstr "" + +#: home-manager/home-manager:729 +msgid "No home-manager packages seem to be installed." +msgstr "" + +#: home-manager/home-manager:811 +msgid "Unknown argument %s" +msgstr "" + +#: home-manager/home-manager:835 +msgid "This will remove Home Manager from your system." +msgstr "" + +#: home-manager/home-manager:838 +msgid "This is a dry run, nothing will actually be uninstalled." +msgstr "" + +#: home-manager/home-manager:842 +msgid "Really uninstall Home Manager?" +msgstr "" + +#: home-manager/home-manager:848 +msgid "Switching to empty Home Manager configuration..." +msgstr "" + +#: home-manager/home-manager:863 +msgid "Yay!" +msgstr "" + +#: home-manager/home-manager:868 +msgid "Home Manager is uninstalled but your home.nix is left untouched." +msgstr "" + +#: home-manager/home-manager:1091 +msgid "expire-generations expects one argument, got %d." +msgstr "" + +#: home-manager/home-manager:1113 +msgid "Unknown command: %s" +msgstr "" + +#: home-manager/install.nix:18 +msgid "This derivation is not buildable, please run it using nix-shell." +msgstr "" From fab8e511d58f9c3f1cf8456abd685bfd381f7ebe Mon Sep 17 00:00:00 2001 From: bricked Date: Tue, 18 Jun 2024 15:23:11 +0200 Subject: [PATCH 323/636] firefox: update expected container settings From 0dd1c1495af6e6424695670343236f0053bf4947 Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Tue, 18 Jun 2024 23:05:42 +0200 Subject: [PATCH 324/636] Translate using Weblate (Polish) Currently translated at 100.0% (18 of 18 strings) Translate using Weblate (Polish) Currently translated at 100.0% (37 of 37 strings) Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/pl/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/pl/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules Co-authored-by: Mateusz P --- home-manager/po/pl.po | 10 +++++----- modules/po/pl.po | 14 +++++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/home-manager/po/pl.po b/home-manager/po/pl.po index c8fa742f069b..63eeed3f0d6d 100644 --- a/home-manager/po/pl.po +++ b/home-manager/po/pl.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-06-17 09:46+0000\n" +"Last-Translator: Mateusz P \n" "Language-Team: Polish \n" "Language: pl\n" @@ -18,12 +18,12 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" -"X-Generator: Weblate 5.4\n" +"X-Generator: Weblate 5.6-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: brakuje wartości dla %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" @@ -194,7 +194,7 @@ msgstr "Nieznane ustawienie „%s” „news.display”." #: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Proszę ustawić zmienną środowiskową $EDITOR lub $VISUAL" #: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" diff --git a/modules/po/pl.po b/modules/po/pl.po index 0e88a781aeab..6ce24f50fecd 100644 --- a/modules/po/pl.po +++ b/modules/po/pl.po @@ -8,17 +8,17 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2023-05-03 19:48+0000\n" -"Last-Translator: Eryk Michalak \n" +"PO-Revision-Date: 2024-06-17 09:46+0000\n" +"Last-Translator: Mateusz P \n" "Language-Team: Polish \n" "Language: pl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " -"|| n%100>=20) ? 1 : 2;\n" -"X-Generator: Weblate 4.18-dev\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " +"|| n%100>=20) ? 1 : 2);\n" +"X-Generator: Weblate 5.6-dev\n" #: modules/files.nix:191 msgid "Creating home file links in %s" @@ -112,10 +112,14 @@ msgstr "" #: modules/lib-bash/activation-init.sh:127 msgid "Error: USER is set to \"%s\" but we expect \"%s\"" msgstr "" +"Błąd: Właściwość USER ma wartość \"%s\" podczas gdy spodziewana wartość to \"" +"%s\"" #: modules/lib-bash/activation-init.sh:136 msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" msgstr "" +"Błąd: Właściwość HOME ma wartość \"%s\" podczas gdy spodziewana wartość to \"" +"%s\"" #: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" From d7830d05421d0ced83a0f007900898bdcaf2a2ca Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:11:47 +0200 Subject: [PATCH 325/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/e9ee548d90ff586a6471b4ae80ae9cfcbceb3420?narHash=sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY%3D' (2024-06-13) → 'github:NixOS/nixpkgs/b60ebf54c15553b393d144357375ea956f89e9a9?narHash=sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU%3D' (2024-06-16) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 284ee49812e8..538de1b3a803 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1718318537, - "narHash": "sha256-4Zu0RYRcAY/VWuu6awwq4opuiD//ahpc2aFHg2CWqFY=", + "lastModified": 1718530797, + "narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e9ee548d90ff586a6471b4ae80ae9cfcbceb3420", + "rev": "b60ebf54c15553b393d144357375ea956f89e9a9", "type": "github" }, "original": { From c559542f0aa87971a7f4c1b3478fe33cc904b902 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Fri, 21 Jun 2024 11:23:28 -0400 Subject: [PATCH 326/636] gtk: explicitly set default font size Fixes #5562 --- modules/misc/gtk.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/misc/gtk.nix b/modules/misc/gtk.nix index 6454eb2aeb66..e1ae250fd073 100644 --- a/modules/misc/gtk.nix +++ b/modules/misc/gtk.nix @@ -221,10 +221,9 @@ in { config = mkIf cfg.enable (let gtkIni = optionalAttrs (cfg.font != null) { - gtk-font-name = let - fontSize = - optionalString (cfg.font.size != null) " ${toString cfg.font.size}"; - in "${cfg.font.name}" + fontSize; + gtk-font-name = + let fontSize = if cfg.font.size != null then cfg.font.size else 10; + in "${cfg.font.name} ${toString fontSize}"; } // optionalAttrs (cfg.theme != null) { gtk-theme-name = cfg.theme.name; } // optionalAttrs (cfg.iconTheme != null) { gtk-icon-theme-name = cfg.iconTheme.name; @@ -245,10 +244,9 @@ in { '' + cfg4.extraCss; dconfIni = optionalAttrs (cfg.font != null) { - font-name = let - fontSize = - optionalString (cfg.font.size != null) " ${toString cfg.font.size}"; - in "${cfg.font.name}" + fontSize; + font-name = + let fontSize = if cfg.font.size != null then cfg.font.size else 10; + in "${cfg.font.name} ${toString fontSize}"; } // optionalAttrs (cfg.theme != null) { gtk-theme = cfg.theme.name; } // optionalAttrs (cfg.iconTheme != null) { icon-theme = cfg.iconTheme.name; From cd886711998fe5d9ff7979fdd4b4cbd17b1f1511 Mon Sep 17 00:00:00 2001 From: daru Date: Wed, 8 May 2024 06:16:09 +0200 Subject: [PATCH 327/636] blanket: add module --- modules/misc/news.nix | 12 ++++++ modules/modules.nix | 1 + modules/services/blanket.nix | 40 +++++++++++++++++++ tests/default.nix | 1 + .../services/blanket/basic-configuration.nix | 31 ++++++++++++++ tests/modules/services/blanket/default.nix | 1 + 6 files changed, 86 insertions(+) create mode 100644 modules/services/blanket.nix create mode 100644 tests/modules/services/blanket/basic-configuration.nix create mode 100644 tests/modules/services/blanket/default.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 1242d640b093..997c7815f3ab 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1667,6 +1667,18 @@ in { - 'nix.channels' ''; } + + { + time = "2024-06-22T05:49:48+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.blanket'. + + Blanket is a program you can use to improve your focus and increase + your productivity by listening to different sounds. See + https://github.com/rafaelmardojai/blanket for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 4e1f0e201ada..5b100d474fa9 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -274,6 +274,7 @@ let ./services/barrier.nix ./services/batsignal.nix ./services/betterlockscreen.nix + ./services/blanket.nix ./services/blueman-applet.nix ./services/borgmatic.nix ./services/cachix-agent.nix diff --git a/modules/services/blanket.nix b/modules/services/blanket.nix new file mode 100644 index 000000000000..5eeb2ab1e150 --- /dev/null +++ b/modules/services/blanket.nix @@ -0,0 +1,40 @@ +{ pkgs, lib, config, ... }: + +let + cfg = config.services.blanket; + + inherit (lib) mkIf mkEnableOption mkPackageOption hm platforms; +in { + meta.maintainers = [ lib.maintainers.daru-san ]; + + options.services.blanket = { + enable = mkEnableOption "blanket"; + + package = mkPackageOption pkgs "blanket" { }; + }; + + config = mkIf cfg.enable { + assertions = [ + (hm.assertions.assertPlatform "services.blanket" pkgs platforms.linux) + ]; + + home.packages = [ cfg.package ]; + + systemd.user.services.blanket = { + Unit = { + Description = "Blanket daemon"; + Requires = [ "dbus.service" ]; + After = [ "graphical-session-pre.target" ]; + PartOf = [ "graphical-session.target" "pipewire.service" ]; + }; + + Install.WantedBy = [ "graphical-session.target" ]; + + Service = { + ExecStart = "${cfg.package}/bin/blanket --gapplication-service"; + Restart = "on-failure"; + RestartSec = 5; + }; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 4d8d49d456c4..a5e7fe9e1ff1 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -224,6 +224,7 @@ in import nmtSrc { ./modules/services/activitywatch ./modules/services/avizo ./modules/services/barrier + ./modules/services/blanket ./modules/services/borgmatic ./modules/services/cachix-agent ./modules/services/cliphist diff --git a/tests/modules/services/blanket/basic-configuration.nix b/tests/modules/services/blanket/basic-configuration.nix new file mode 100644 index 000000000000..740c4d08df5f --- /dev/null +++ b/tests/modules/services/blanket/basic-configuration.nix @@ -0,0 +1,31 @@ +{ ... }: + +{ + services.blanket = { enable = true; }; + + test.stubs.blanket = { }; + + nmt.script = '' + clientServiceFile=home-files/.config/systemd/user/blanket.service + + assertFileExists $clientServiceFile + assertFileContent $clientServiceFile ${ + builtins.toFile "expected.service" '' + [Install] + WantedBy=graphical-session.target + + [Service] + ExecStart=@blanket@/bin/blanket --gapplication-service + Restart=on-failure + RestartSec=5 + + [Unit] + After=graphical-session-pre.target + Description=Blanket daemon + PartOf=graphical-session.target + PartOf=pipewire.service + Requires=dbus.service + '' + } + ''; +} diff --git a/tests/modules/services/blanket/default.nix b/tests/modules/services/blanket/default.nix new file mode 100644 index 000000000000..8a439a52a349 --- /dev/null +++ b/tests/modules/services/blanket/default.nix @@ -0,0 +1 @@ +{ blanket-basic-configuration = ./basic-configuration.nix; } From 8be82697f797ce2190b6e2d7b11cd384076caae7 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 23 Jun 2024 23:03:18 +0200 Subject: [PATCH 328/636] ssh-agent: fix evaluation of maintainer field --- modules/lib/maintainers.nix | 6 ++++++ modules/services/ssh-agent.nix | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index b5175a87510a..a820d53429db 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -201,6 +201,12 @@ github = "kubukoz"; githubId = 894884; }; + lheckemann = { + name = "Linus Heckemann"; + email = "git@sphalerite.org"; + github = "lheckemann"; + githubId = 341954; + }; loicreynier = { name = "Loïc Reynier"; email = "loic@loireynier.fr"; diff --git a/modules/services/ssh-agent.nix b/modules/services/ssh-agent.nix index 16db3232c6a1..88ecf38b81c2 100644 --- a/modules/services/ssh-agent.nix +++ b/modules/services/ssh-agent.nix @@ -5,7 +5,7 @@ let cfg = config.services.ssh-agent; in { - meta.maintainers = [ lib.maintainers.lheckemann ]; + meta.maintainers = [ lib.hm.maintainers.lheckemann ]; options = { services.ssh-agent = { From 6a9a1e51bbb8c301eae5aa63c9fc3c751ec5315b Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 23 Jun 2024 23:11:27 +0200 Subject: [PATCH 329/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/b60ebf54c15553b393d144357375ea956f89e9a9?narHash=sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU%3D' (2024-06-16) → 'github:NixOS/nixpkgs/d603719ec6e294f034936c0d0dc06f689d91b6c3?narHash=sha256-k3JqJrkdoYwE3fHE6xGDY676AYmyh4U2Zw%2B0Bwe5DLU%3D' (2024-06-20) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 538de1b3a803..b809cdb77098 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1718530797, - "narHash": "sha256-pup6cYwtgvzDpvpSCFh1TEUjw2zkNpk8iolbKnyFmmU=", + "lastModified": 1718895438, + "narHash": "sha256-k3JqJrkdoYwE3fHE6xGDY676AYmyh4U2Zw+0Bwe5DLU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b60ebf54c15553b393d144357375ea956f89e9a9", + "rev": "d603719ec6e294f034936c0d0dc06f689d91b6c3", "type": "github" }, "original": { From 5ccc3d6739b5e694841ced27cb5c06b50b163695 Mon Sep 17 00:00:00 2001 From: lordkekz Date: Mon, 3 Jun 2024 19:39:00 +0200 Subject: [PATCH 330/636] yazi: Ensure plugin suffix `.yazi` - Append suffix `.yazi` to symlink targets of yazi plugins, if needed - Improve some docs, especially links to upstream docs. - Update tests to make use of this feature. --- modules/programs/yazi.nix | 29 +++++++++++++++++------- tests/modules/programs/yazi/settings.nix | 7 +++++- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index 11f4e75cf11f..f96a9bdfaeea 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -144,9 +144,10 @@ in { type = with types; attrsOf (oneOf [ path package ]); default = { }; description = '' - Lua plugins. + Lua plugins. Will be linked into {file}`$XDG_CONFIG_HOME/yazi/plugins/`. - See https://yazi-rs.github.io/docs/plugins/overview/ for documentation. + See + for documentation. ''; example = literalExpression '' { @@ -162,7 +163,7 @@ in { description = '' Pre-made themes. - See https://yazi-rs.github.io/docs/flavors/overview/ for documentation. + See for documentation. ''; example = literalExpression '' { @@ -171,7 +172,6 @@ in { } ''; }; - }; config = mkIf cfg.enable { @@ -199,9 +199,22 @@ in { }; "yazi/init.lua" = mkIf (cfg.initLua != null) { source = cfg.initLua; }; } // (mapAttrs' - (name: value: nameValuePair "yazi/plugins/${name}" { source = value; }) - cfg.plugins) // (mapAttrs' - (name: value: nameValuePair "yazi/flavors/${name}" { source = value; }) - cfg.flavors); + (name: value: nameValuePair "yazi/flavors/${name}" { source = value; }) + cfg.flavors) // (let + # Make sure that the directory ends in `.yazi`, to comply with specification. + # `pluginName` is essential, it's needed to apply config in yazi's `init.lua` + ensureSuffix = pluginName: + if lib.hasSuffix ".yazi" pluginName then + "yazi/plugins/${pluginName}" + else + "yazi/plugins/${pluginName}.yazi"; + + mkPluginLink = pluginName: pluginPackage: { + name = ensureSuffix pluginName; + value.source = pluginPackage; + }; + + pluginLinks = mapAttrs' mkPluginLink cfg.plugins; + in pluginLinks); }; } diff --git a/tests/modules/programs/yazi/settings.nix b/tests/modules/programs/yazi/settings.nix index 4655ae8b3551..33b99c2c50dc 100644 --- a/tests/modules/programs/yazi/settings.nix +++ b/tests/modules/programs/yazi/settings.nix @@ -70,7 +70,10 @@ }; }; initLua = ./init.lua; - plugins = { "test.yazi" = ./plugin; }; + plugins = { + "test.yazi" = ./plugin; + "anotherTest" = ./plugin; + }; flavors = { "test.yazi" = ./flavor; }; }; @@ -87,6 +90,8 @@ ${./init.lua} assertFileContent home-files/.config/yazi/plugins/test.yazi/init.lua \ ${./plugin/init.lua} + assertFileContent home-files/.config/yazi/plugins/anotherTest.yazi/init.lua \ + ${./plugin/init.lua} assertFileContent home-files/.config/yazi/flavors/test.yazi/init.lua \ ${./flavor/init.lua} ''; From 340b98c0abb56ae24d7ee7dee64104583ad8a8c6 Mon Sep 17 00:00:00 2001 From: lordkekz Date: Mon, 3 Jun 2024 20:29:06 +0200 Subject: [PATCH 331/636] yazi: Assert that plugins have valid structure --- modules/programs/yazi.nix | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index f96a9bdfaeea..59443dd31372 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -209,12 +209,31 @@ in { else "yazi/plugins/${pluginName}.yazi"; - mkPluginLink = pluginName: pluginPackage: { + mkPluginLink = pluginName: pluginPackageOrPath: { name = ensureSuffix pluginName; - value.source = pluginPackage; + value.source = pluginPackageOrPath; }; pluginLinks = mapAttrs' mkPluginLink cfg.plugins; in pluginLinks); + + assertions = (mapAttrsToList (pluginName: pluginPackageOrPath: + let + isDir = pathIsDirectory "${pluginPackageOrPath}"; + hasInitLua = pathExists "${pluginPackageOrPath}/init.lua" + && !(pathIsDirectory "${pluginPackageOrPath}/init.lua"); + in { + assertion = isDir && hasInitLua; + message = + "Value at `programs.yazi.plugins.${pluginName}` is not a valid yazi plugin." + + (optionalString (!isDir) '' + + The path or package should be a directory, not a single file.'') + + (optionalString (!hasInitLua) '' + + The path or package must contain a file `init.lua`.'') + '' + + Evaluated value: `${pluginPackageOrPath}`''; + }) cfg.plugins); }; } From 09bc5c5949c73cf6b217badaae25feb2b4a7a2e5 Mon Sep 17 00:00:00 2001 From: Didn't read the style guide <50516935+lordkekz@users.noreply.github.com> Date: Tue, 4 Jun 2024 00:56:08 +0200 Subject: [PATCH 332/636] yazi: plugin names should be in kebab case (test) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 三咲雅 · Misaki Masa --- tests/modules/programs/yazi/settings.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/modules/programs/yazi/settings.nix b/tests/modules/programs/yazi/settings.nix index 33b99c2c50dc..f0d54faed897 100644 --- a/tests/modules/programs/yazi/settings.nix +++ b/tests/modules/programs/yazi/settings.nix @@ -71,8 +71,8 @@ }; initLua = ./init.lua; plugins = { - "test.yazi" = ./plugin; - "anotherTest" = ./plugin; + "test" = ./plugin; + "another-test" = ./plugin; }; flavors = { "test.yazi" = ./flavor; }; }; From 16f86c94ce2399ae09ae99b8f071f37bbc964b4f Mon Sep 17 00:00:00 2001 From: lordkekz Date: Wed, 5 Jun 2024 21:24:18 +0200 Subject: [PATCH 333/636] yazi: Assert plugin/flavor structure and warn about plugin/flavor suffix - Always append suffix `.yazi` to plugin's and flavor's attribute names. - Warn if the attribute names already have the suffix. - Assert that plugin's and flavor's values point to directories containing an `init.lua` file. --- modules/programs/yazi.nix | 90 +++++++++++++--------- tests/modules/programs/yazi/empty/.gitkeep | 0 tests/modules/programs/yazi/settings.nix | 23 ++++-- 3 files changed, 68 insertions(+), 45 deletions(-) create mode 100644 tests/modules/programs/yazi/empty/.gitkeep diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index 59443dd31372..db946344e831 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -144,7 +144,9 @@ in { type = with types; attrsOf (oneOf [ path package ]); default = { }; description = '' - Lua plugins. Will be linked into {file}`$XDG_CONFIG_HOME/yazi/plugins/`. + Lua plugins. + Values should be a package or path containing an `init.lua` file. + Will be linked to {file}`$XDG_CONFIG_HOME/yazi/plugins/.yazi`. See for documentation. @@ -162,6 +164,8 @@ in { default = { }; description = '' Pre-made themes. + Values should be a package or path containing an `init.lua` file. + Will be linked to {file}`$XDG_CONFIG_HOME/yazi/flavors/.yazi`. See for documentation. ''; @@ -198,42 +202,52 @@ in { source = tomlFormat.generate "yazi-theme" cfg.theme; }; "yazi/init.lua" = mkIf (cfg.initLua != null) { source = cfg.initLua; }; - } // (mapAttrs' - (name: value: nameValuePair "yazi/flavors/${name}" { source = value; }) - cfg.flavors) // (let - # Make sure that the directory ends in `.yazi`, to comply with specification. - # `pluginName` is essential, it's needed to apply config in yazi's `init.lua` - ensureSuffix = pluginName: - if lib.hasSuffix ".yazi" pluginName then - "yazi/plugins/${pluginName}" - else - "yazi/plugins/${pluginName}.yazi"; - - mkPluginLink = pluginName: pluginPackageOrPath: { - name = ensureSuffix pluginName; - value.source = pluginPackageOrPath; - }; - - pluginLinks = mapAttrs' mkPluginLink cfg.plugins; - in pluginLinks); - - assertions = (mapAttrsToList (pluginName: pluginPackageOrPath: - let - isDir = pathIsDirectory "${pluginPackageOrPath}"; - hasInitLua = pathExists "${pluginPackageOrPath}/init.lua" - && !(pathIsDirectory "${pluginPackageOrPath}/init.lua"); - in { - assertion = isDir && hasInitLua; - message = - "Value at `programs.yazi.plugins.${pluginName}` is not a valid yazi plugin." - + (optionalString (!isDir) '' - - The path or package should be a directory, not a single file.'') - + (optionalString (!hasInitLua) '' - - The path or package must contain a file `init.lua`.'') + '' - - Evaluated value: `${pluginPackageOrPath}`''; - }) cfg.plugins); + } // (mapAttrs' (name: value: + nameValuePair "yazi/flavors/${name}.yazi" { source = value; }) + cfg.flavors) // (mapAttrs' (name: value: + nameValuePair "yazi/plugins/${name}.yazi" { source = value; }) + cfg.plugins); + + warnings = filter (s: s != "") (concatLists [ + (mapAttrsToList (name: value: + optionalString (hasSuffix ".yazi" name) '' + Flavors like `programs.yazi.flavors."${name}"` should no longer have the suffix ".yazi" in their attribute name. + The flavor will be linked to `$XDG_CONFIG_HOME/yazi/flavors/${name}.yazi`. + You probably want to rename it to `programs.yazi.flavors."${ + removeSuffix ".yazi" name + }"`. + '') cfg.flavors) + (mapAttrsToList (name: value: + optionalString (hasSuffix ".yazi" name) '' + Plugins like `programs.yazi.plugins."${name}"` should no longer have the suffix ".yazi" in their attribute name. + The plugin will be linked to `$XDG_CONFIG_HOME/yazi/plugins/${name}.yazi`. + You probably want to rename it to `programs.yazi.plugins."${ + removeSuffix ".yazi" name + }"`. + '') cfg.plugins) + ]); + + assertions = let + mkAsserts = opt: + mapAttrsToList (name: value: + let + isDir = pathIsDirectory "${value}"; + msgNotDir = optionalString (!isDir) + "The path or package should be a directory, not a single file."; + hasInitLua = pathExists "${value}/init.lua" + && !(pathIsDirectory "${value}/init.lua"); + msgNoInitLua = optionalString (!hasInitLua) + "The path or package must contain a file `init.lua`."; + singularOpt = removeSuffix "s" opt; + in { + assertion = isDir && hasInitLua; + message = '' + Value at `programs.yazi.${opt}.${name}` is not a valid yazi ${singularOpt}. + ${msgNotDir} + ${msgNoInitLua} + Evaluated value: `${value}` + ''; + }) cfg.${opt}; + in (mkAsserts "flavors") ++ (mkAsserts "plugins"); }; } diff --git a/tests/modules/programs/yazi/empty/.gitkeep b/tests/modules/programs/yazi/empty/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/modules/programs/yazi/settings.nix b/tests/modules/programs/yazi/settings.nix index f0d54faed897..667038719509 100644 --- a/tests/modules/programs/yazi/settings.nix +++ b/tests/modules/programs/yazi/settings.nix @@ -71,10 +71,21 @@ }; initLua = ./init.lua; plugins = { - "test" = ./plugin; - "another-test" = ./plugin; + testplugin = ./plugin; + ## Produces warning + #"plugin-with-suffix.yazi" = ./plugin; + ## Fails assertion + #single-file-plugin = ./plugin/init.lua; + #empty-dir-plugin = ./empty; + }; + flavors = { + testflavor = ./flavor; + ## Produces warning + #"flavor-with-suffix.yazi" = ./flavor; + ## Fails assertion + #single-file-flavor = ./flavor/init.lua; + #empty-dir-flavor = ./empty; }; - flavors = { "test.yazi" = ./flavor; }; }; test.stubs.yazi = { }; @@ -88,11 +99,9 @@ ${./theme-expected.toml} assertFileContent home-files/.config/yazi/init.lua \ ${./init.lua} - assertFileContent home-files/.config/yazi/plugins/test.yazi/init.lua \ - ${./plugin/init.lua} - assertFileContent home-files/.config/yazi/plugins/anotherTest.yazi/init.lua \ + assertFileContent home-files/.config/yazi/plugins/testplugin.yazi/init.lua \ ${./plugin/init.lua} - assertFileContent home-files/.config/yazi/flavors/test.yazi/init.lua \ + assertFileContent home-files/.config/yazi/flavors/testflavor.yazi/init.lua \ ${./flavor/init.lua} ''; } From 216d51eb22f9ce1a4c50a4737a4adcdb42fb6306 Mon Sep 17 00:00:00 2001 From: lordkekz Date: Thu, 6 Jun 2024 12:05:28 +0200 Subject: [PATCH 334/636] yazi: Fix expected structure of flavors --- modules/programs/yazi.nix | 29 +++++++---- tests/modules/programs/yazi/flavor/LICENSE | 0 .../programs/yazi/flavor/LICENSE-tmtheme | 0 tests/modules/programs/yazi/flavor/README.md | 50 +++++++++++++++++++ .../modules/programs/yazi/flavor/flavor.toml | 2 + tests/modules/programs/yazi/flavor/init.lua | 1 - .../modules/programs/yazi/flavor/preview.png | 0 .../modules/programs/yazi/flavor/tmtheme.xml | 0 tests/modules/programs/yazi/settings.nix | 6 +-- 9 files changed, 75 insertions(+), 13 deletions(-) create mode 100644 tests/modules/programs/yazi/flavor/LICENSE create mode 100644 tests/modules/programs/yazi/flavor/LICENSE-tmtheme create mode 100644 tests/modules/programs/yazi/flavor/README.md create mode 100644 tests/modules/programs/yazi/flavor/flavor.toml delete mode 100644 tests/modules/programs/yazi/flavor/init.lua create mode 100644 tests/modules/programs/yazi/flavor/preview.png create mode 100644 tests/modules/programs/yazi/flavor/tmtheme.xml diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index db946344e831..cb00ecc3a444 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -164,7 +164,7 @@ in { default = { }; description = '' Pre-made themes. - Values should be a package or path containing an `init.lua` file. + Values should be a package or path containing the required files. Will be linked to {file}`$XDG_CONFIG_HOME/yazi/flavors/.yazi`. See for documentation. @@ -228,26 +228,37 @@ in { ]); assertions = let - mkAsserts = opt: + mkAsserts = opt: requiredFiles: mapAttrsToList (name: value: let isDir = pathIsDirectory "${value}"; msgNotDir = optionalString (!isDir) "The path or package should be a directory, not a single file."; - hasInitLua = pathExists "${value}/init.lua" - && !(pathIsDirectory "${value}/init.lua"); - msgNoInitLua = optionalString (!hasInitLua) - "The path or package must contain a file `init.lua`."; + isFileMissing = file: + !(pathExists "${value}/${file}") + || pathIsDirectory "${value}/${file}"; + missingFiles = filter isFileMissing requiredFiles; + msgFilesMissing = optionalString (missingFiles != [ ]) + "The ${singularOpt} is missing these files: ${ + toString missingFiles + }"; singularOpt = removeSuffix "s" opt; in { - assertion = isDir && hasInitLua; + assertion = isDir && missingFiles == [ ]; message = '' Value at `programs.yazi.${opt}.${name}` is not a valid yazi ${singularOpt}. ${msgNotDir} - ${msgNoInitLua} + ${msgFilesMissing} Evaluated value: `${value}` ''; }) cfg.${opt}; - in (mkAsserts "flavors") ++ (mkAsserts "plugins"); + in (mkAsserts "flavors" [ + "flavor.toml" + "tmtheme.xml" + "README.md" + "preview.png" + "LICENSE" + "LICENSE-tmtheme" + ]) ++ (mkAsserts "plugins" [ "init.lua" ]); }; } diff --git a/tests/modules/programs/yazi/flavor/LICENSE b/tests/modules/programs/yazi/flavor/LICENSE new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/modules/programs/yazi/flavor/LICENSE-tmtheme b/tests/modules/programs/yazi/flavor/LICENSE-tmtheme new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/modules/programs/yazi/flavor/README.md b/tests/modules/programs/yazi/flavor/README.md new file mode 100644 index 000000000000..3ba41d0dbfe6 --- /dev/null +++ b/tests/modules/programs/yazi/flavor/README.md @@ -0,0 +1,50 @@ +
+ Yazi logo +
+ +

+ Example Flavor for Yazi +

+ +## Cooking up a new flavor + +> [!NOTE] +> Please remove this section from your README before publishing. + +1. [x] Fork this repository and rename it to `your-flavor-name.yazi`. +2. [ ] Copy the **parts you need to customize** from the [default theme.toml](https://github.com/sxyazi/yazi/blob/main/yazi-config/preset/theme.toml) as `./flavor.toml`, and change them to meet your preferences. +3. [ ] Find a `.tmTheme` file on GitHub that matches the color of your flavor, copy it and it's license file as `./tmtheme.xml`, and `LICENSE-tmtheme`. +4. [ ] Modify the content and preview image in the README to fit your flavor. + +## 👀 Preview + + + +## 🎨 Installation + + + +```bash +# Linux/macOS +git clone https://github.com/username/example.yazi.git ~/.config/yazi/flavors/example.yazi + +# Windows +git clone https://github.com/username/example.yazi.git %AppData%\yazi\config\flavors\example.yazi +``` + +## ⚙️ Usage + +Add the these lines to your `theme.toml` configuration file to use it: + + + +```toml +[flavor] +use = "example" +``` + +## 📜 License + +The flavor is MIT-licensed, and the included tmTheme is also MIT-licensed. + +Check the [LICENSE](LICENSE) and [LICENSE-tmtheme](LICENSE-tmtheme) file for more details. diff --git a/tests/modules/programs/yazi/flavor/flavor.toml b/tests/modules/programs/yazi/flavor/flavor.toml new file mode 100644 index 000000000000..35e1fe770463 --- /dev/null +++ b/tests/modules/programs/yazi/flavor/flavor.toml @@ -0,0 +1,2 @@ +# This is a flavor. + diff --git a/tests/modules/programs/yazi/flavor/init.lua b/tests/modules/programs/yazi/flavor/init.lua deleted file mode 100644 index 8d06fa7a9b0d..000000000000 --- a/tests/modules/programs/yazi/flavor/init.lua +++ /dev/null @@ -1 +0,0 @@ --- This is a flavor. diff --git a/tests/modules/programs/yazi/flavor/preview.png b/tests/modules/programs/yazi/flavor/preview.png new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/modules/programs/yazi/flavor/tmtheme.xml b/tests/modules/programs/yazi/flavor/tmtheme.xml new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/modules/programs/yazi/settings.nix b/tests/modules/programs/yazi/settings.nix index 667038719509..2694dadec871 100644 --- a/tests/modules/programs/yazi/settings.nix +++ b/tests/modules/programs/yazi/settings.nix @@ -83,7 +83,7 @@ ## Produces warning #"flavor-with-suffix.yazi" = ./flavor; ## Fails assertion - #single-file-flavor = ./flavor/init.lua; + #single-file-flavor = ./flavor/flavor.toml; #empty-dir-flavor = ./empty; }; }; @@ -101,7 +101,7 @@ ${./init.lua} assertFileContent home-files/.config/yazi/plugins/testplugin.yazi/init.lua \ ${./plugin/init.lua} - assertFileContent home-files/.config/yazi/flavors/testflavor.yazi/init.lua \ - ${./flavor/init.lua} + assertFileContent home-files/.config/yazi/flavors/testflavor.yazi/flavor.toml \ + ${./flavor/flavor.toml} ''; } From 6b1f90a8ff92e81638ae6eb48cd62349c3e387bb Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 23 Jun 2024 21:11:25 +0200 Subject: [PATCH 335/636] stalonetray: move config file to XDG_CONFIG_HOME --- modules/services/stalonetray.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/services/stalonetray.nix b/modules/services/stalonetray.nix index 172d6dd9dcf6..9d4d7a53eee7 100644 --- a/modules/services/stalonetray.nix +++ b/modules/services/stalonetray.nix @@ -74,7 +74,7 @@ in { } (mkIf (cfg.config != { }) { - home.file.".stalonetrayrc".text = let + xdg.configFile."stalonetrayrc".text = let valueToString = v: if isBool v then (if v then "true" else "false") @@ -88,7 +88,7 @@ in { }) (mkIf (cfg.extraConfig != "") { - home.file.".stalonetrayrc".text = cfg.extraConfig; + xdg.configFile."stalonetrayrc".text = cfg.extraConfig; }) ]); } From d3bf2a06129c2493ec55e217be2907b92279f30f Mon Sep 17 00:00:00 2001 From: eljamm Date: Sun, 23 Jun 2024 15:01:38 +0100 Subject: [PATCH 336/636] yazi: add eljamm as maintainer --- modules/programs/yazi.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index cb00ecc3a444..77acfc6ba034 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -40,7 +40,7 @@ let } ''; in { - meta.maintainers = with maintainers; [ xyenon ]; + meta.maintainers = with maintainers; [ xyenon eljamm ]; options.programs.yazi = { enable = mkEnableOption "yazi"; From 92a26bf6df1f00cbbed16a99d2547531ff4b3a83 Mon Sep 17 00:00:00 2001 From: eljamm Date: Sun, 23 Jun 2024 15:05:25 +0100 Subject: [PATCH 337/636] yazi: add shellWrapperName & rename wrappers to yy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The program shell wrappers have been renamed from `ya` to `yy` following the introduction of the new CLI tool named `ya`. With this in mind, the `shellWrapperName` option has been introduced to provide users with more flexibility in choosing the name they're most accustomed to (ra, lf, ...). Co-authored-by: XYenon Co-authored-by: 三咲雅 · Misaki Masa --- modules/misc/news.nix | 13 +++++++++++++ modules/programs/yazi.nix | 15 ++++++++++++--- .../programs/yazi/bash-integration-enabled.nix | 2 +- .../programs/yazi/fish-integration-enabled.nix | 2 +- .../programs/yazi/nushell-integration-enabled.nix | 2 +- .../programs/yazi/zsh-integration-enabled.nix | 2 +- 6 files changed, 29 insertions(+), 7 deletions(-) diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 997c7815f3ab..e7e582f5c50b 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1679,6 +1679,19 @@ in { https://github.com/rafaelmardojai/blanket for more. ''; } + + { + time = "2024-06-26T07:07:17+00:00"; + condition = with config.programs.yazi; + enable && (enableBashIntegration || enableZshIntegration + || enableFishIntegration || enableNushellIntegration); + message = '' + Yazi's shell integration wrappers have been renamed from 'ya' to 'yy'. + + A new option `programs.yazi.shellWrapperName` is also available that + allows you to override this name. + ''; + } ]; }; } diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index 77acfc6ba034..105bbec4d611 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -7,7 +7,7 @@ let tomlFormat = pkgs.formats.toml { }; bashIntegration = '' - function ya() { + function ${cfg.shellWrapperName}() { local tmp="$(mktemp -t "yazi-cwd.XXXXX")" yazi "$@" --cwd-file="$tmp" if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then @@ -18,7 +18,7 @@ let ''; fishIntegration = '' - function ya + function ${cfg.shellWrapperName} set tmp (mktemp -t "yazi-cwd.XXXXX") yazi $argv --cwd-file="$tmp" if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] @@ -29,7 +29,7 @@ let ''; nushellIntegration = '' - def --env ya [...args] { + def --env ${cfg.shellWrapperName} [...args] { let tmp = (mktemp -t "yazi-cwd.XXXXX") yazi ...$args --cwd-file $tmp let cwd = (open $tmp) @@ -47,6 +47,15 @@ in { package = mkPackageOption pkgs "yazi" { }; + shellWrapperName = mkOption { + type = types.str; + default = "yy"; + example = "y"; + description = '' + Name of the shell wrapper to be called. + ''; + }; + enableBashIntegration = mkEnableOption "Bash integration"; enableZshIntegration = mkEnableOption "Zsh integration"; diff --git a/tests/modules/programs/yazi/bash-integration-enabled.nix b/tests/modules/programs/yazi/bash-integration-enabled.nix index ac2e4979606b..474a989f98a4 100644 --- a/tests/modules/programs/yazi/bash-integration-enabled.nix +++ b/tests/modules/programs/yazi/bash-integration-enabled.nix @@ -2,7 +2,7 @@ let shellIntegration = '' - function ya() { + function yy() { local tmp="$(mktemp -t "yazi-cwd.XXXXX")" yazi "$@" --cwd-file="$tmp" if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then diff --git a/tests/modules/programs/yazi/fish-integration-enabled.nix b/tests/modules/programs/yazi/fish-integration-enabled.nix index 6d2b9fa31387..2231035b9a88 100644 --- a/tests/modules/programs/yazi/fish-integration-enabled.nix +++ b/tests/modules/programs/yazi/fish-integration-enabled.nix @@ -2,7 +2,7 @@ let shellIntegration = '' - function ya + function yy set tmp (mktemp -t "yazi-cwd.XXXXX") yazi $argv --cwd-file="$tmp" if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] diff --git a/tests/modules/programs/yazi/nushell-integration-enabled.nix b/tests/modules/programs/yazi/nushell-integration-enabled.nix index 9adbaa982899..a2de2d8b7848 100644 --- a/tests/modules/programs/yazi/nushell-integration-enabled.nix +++ b/tests/modules/programs/yazi/nushell-integration-enabled.nix @@ -2,7 +2,7 @@ let shellIntegration = '' - def --env ya [...args] { + def --env yy [...args] { let tmp = (mktemp -t "yazi-cwd.XXXXX") yazi ...$args --cwd-file $tmp let cwd = (open $tmp) diff --git a/tests/modules/programs/yazi/zsh-integration-enabled.nix b/tests/modules/programs/yazi/zsh-integration-enabled.nix index d5090a6a84b9..0c0ec217fc4d 100644 --- a/tests/modules/programs/yazi/zsh-integration-enabled.nix +++ b/tests/modules/programs/yazi/zsh-integration-enabled.nix @@ -2,7 +2,7 @@ let shellIntegration = '' - function ya() { + function yy() { local tmp="$(mktemp -t "yazi-cwd.XXXXX")" yazi "$@" --cwd-file="$tmp" if cwd="$(cat -- "$tmp")" && [ -n "$cwd" ] && [ "$cwd" != "$PWD" ]; then From 7a88ff6ad1e001043f876ebdb1d7460cdfe874d2 Mon Sep 17 00:00:00 2001 From: Kacper Koniuszy <120419423+kkoniuszy@users.noreply.github.com> Date: Wed, 26 Jun 2024 17:41:48 +0200 Subject: [PATCH 338/636] systemd: fix sd-switch error on empty target directory After update to sd-switch 0.5.0, `home-manager switch` failed with the following error message: > Error: Error switching > > Caused by: > 0: Failed to build switch plan > 1: No such file or directory (os error 2) This was caused by a non-existing target unit directory due to no user services being managed by home-manager. This change makes sd-switch run with pkgs.emptyDirectory as the target in such cases. Closes: https://github.com/nix-community/home-manager/issues/5552 --- modules/systemd.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/systemd.nix b/modules/systemd.nix index f209f65dd4dc..1d96ec8d276e 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -336,7 +336,7 @@ in { ${pkgs.sd-switch}/bin/sd-switch \ ''${DRY_RUN:+--dry-run} $VERBOSE_ARG ${timeoutArg} \ ''${oldGenPath:+--old-units $oldGenPath/home-files/.config/systemd/user} \ - --new-units $newGenPath/home-files/.config/systemd/user + --new-units "$newUnitsDir" ''; }; @@ -354,8 +354,15 @@ in { warnEcho "Attempting to reload services anyway..." fi + newUnitsDir="$newGenPath/home-files/.config/systemd/user" + if [[ ! -e $newUnitsDir ]]; then + newUnitsDir=${pkgs.emptyDirectory} + fi + ${ensureRuntimeDir} \ ${getAttr cfg.startServices cmd} + + unset newUnitsDir else echo "User systemd daemon not running. Skipping reload." fi From 607f969f5dca2dc100cbc53e24ab49ac24ef8987 Mon Sep 17 00:00:00 2001 From: Adam Dinwoodie Date: Wed, 26 Jun 2024 17:14:48 +0100 Subject: [PATCH 339/636] systemd: don't try to restart templates If the user has template services in their systemd configuration, these can't be restarted, and will produces warnings during the activation phase. Avoid those warnings by skipping any uninstantiated templates when looking for services to start or stop. --- modules/systemd-activate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/systemd-activate.sh b/modules/systemd-activate.sh index 235f1a241cf0..ca26fea8b7b7 100644 --- a/modules/systemd-activate.sh +++ b/modules/systemd-activate.sh @@ -34,7 +34,7 @@ function systemdPostReload() { touch "$oldServiceFiles" else find "$oldUserServicePath" \ - -maxdepth 1 -name '*.service' -exec basename '{}' ';' \ + -maxdepth 1 -name '*.service' \! -name '*@.service' -exec basename '{}' ';' \ | sort \ > "$oldServiceFiles" fi @@ -43,7 +43,7 @@ function systemdPostReload() { touch "$newServiceFiles" else find "$newUserServicePath" \ - -maxdepth 1 -name '*.service' -exec basename '{}' ';' \ + -maxdepth 1 -name '*.service' \! -name '*@.service' -exec basename '{}' ';' \ | sort \ > "$newServiceFiles" fi From 1a4f12ae0bda877ec4099b429cf439aad897d7e9 Mon Sep 17 00:00:00 2001 From: "Shahar \"Dawn\" Or" Date: Wed, 26 Jun 2024 21:12:39 +0700 Subject: [PATCH 340/636] docs: introduction chapter Adds an introduction chapter to the manual. --- docs/manual/introduction.md | 32 ++++++++++++++++++++++++++++++++ docs/manual/manual.md | 1 + 2 files changed, 33 insertions(+) create mode 100644 docs/manual/introduction.md diff --git a/docs/manual/introduction.md b/docs/manual/introduction.md new file mode 100644 index 000000000000..ebdac5bd62a5 --- /dev/null +++ b/docs/manual/introduction.md @@ -0,0 +1,32 @@ +# Introduction to Home Manager {#ch-introduction} + +Home Manager is a [Nix](https://nix.dev/)-powered tool for reproducible management of the contents of users' home directories. +This includes programs, configuration files, environment variables and, well… arbitrary files. +The following example snippet of Nix code: + +```nix +programs.git = { + enable = true; + userEmail = "joe@example.org"; + userName = "joe"; +}; +``` + +would make available to a user the `git` executable and man pages and a configuration file `~/.config/git/config`: + +```ini +[user] + email = "joe@example.org" + name = "joe" +``` + +Since Home Manager is implemented in Nix, it provides several benefits: + +- Contents are reproducible — a home will be the exact same every time it is built, unless of course, an intentional change is made. + This also means you can have the exact same home on different hosts. +- Significantly faster and more powerful than various backup strategies. +- Unlike "dotfiles" repositories, Home Manager supports specifying programs, as well as their configurations. +- Supported by , so that you don't have to build from source. +- If you do want to build some programs from source, there is hardly a tool more useful than Nix for that, and the build instructions can be neatly integrated in your Home Manager usage. +- Infinitely composable, so that values in different configuration files and build instructions can share a source of truth. +- Connects you with the [most extensive](https://repology.org/repositories/statistics/total) and [most up-to-date](https://repology.org/repositories/statistics/newest) software package repository on earth, [Nixpkgs](https://github.com/NixOS/nixpkgs). diff --git a/docs/manual/manual.md b/docs/manual/manual.md index a1cfb1a0c4f2..0f81642f7c54 100644 --- a/docs/manual/manual.md +++ b/docs/manual/manual.md @@ -8,6 +8,7 @@ preface.md ``` ```{=include=} parts +introduction.md installation.md usage.md nix-flakes.md From 19e2f43e0b0aec2067e5101f7d1ec75a43f64778 Mon Sep 17 00:00:00 2001 From: Jakob Kukla Date: Fri, 28 Jun 2024 16:16:01 +0200 Subject: [PATCH 341/636] rbw: fix url option examples rbw expects a protocol for its base_url setting[1]. Otherwise fails with `rbw unlock: failed to parse base url: relative URL without a base`. [1] https://github.com/doy/rbw/blob/741a72cf0d7d45fcd32b0326b69f6238733e5a56/README.md#configuration --- modules/programs/rbw.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/rbw.nix b/modules/programs/rbw.nix index 5dd751d07ce4..b7381c67208d 100644 --- a/modules/programs/rbw.nix +++ b/modules/programs/rbw.nix @@ -19,7 +19,7 @@ let base_url = mkOption { type = with types; nullOr str; default = null; - example = "bitwarden.example.com"; + example = "https://bitwarden.example.com/"; description = "The base-url for a self-hosted bitwarden installation."; }; @@ -27,7 +27,7 @@ let identity_url = mkOption { type = with types; nullOr str; default = null; - example = "identity.example.com"; + example = "https://identity.example.com/"; description = "The identity url for your bitwarden installation."; }; From f50e2779edbc905ab131ce7ce36b14a09ab44f3c Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Fri, 28 Jun 2024 16:16:42 +0200 Subject: [PATCH 342/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/d603719ec6e294f034936c0d0dc06f689d91b6c3?narHash=sha256-k3JqJrkdoYwE3fHE6xGDY676AYmyh4U2Zw%2B0Bwe5DLU%3D' (2024-06-20) → 'github:NixOS/nixpkgs/2893f56de08021cffd9b6b6dfc70fd9ccd51eb60?narHash=sha256-ECni%2BIkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko%3D' (2024-06-24) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index b809cdb77098..508f73e5a0db 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1718895438, - "narHash": "sha256-k3JqJrkdoYwE3fHE6xGDY676AYmyh4U2Zw+0Bwe5DLU=", + "lastModified": 1719254875, + "narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d603719ec6e294f034936c0d0dc06f689d91b6c3", + "rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60", "type": "github" }, "original": { From 7e68e55d2e16d3a1e92a679430728c35a30fd24e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gutyina=20Gerg=C5=91?= Date: Fri, 28 Jun 2024 08:24:13 -0700 Subject: [PATCH 343/636] glance: add module --- modules/misc/news.nix | 11 +++ modules/modules.nix | 1 + modules/services/glance.nix | 77 +++++++++++++++++++ tests/default.nix | 1 + .../services/glance/default-settings.nix | 15 ++++ tests/modules/services/glance/default.nix | 4 + .../services/glance/example-settings.nix | 33 ++++++++ .../services/glance/glance-default-config.yml | 6 ++ .../services/glance/glance-example-config.yml | 10 +++ tests/modules/services/glance/glance.service | 9 +++ 10 files changed, 167 insertions(+) create mode 100644 modules/services/glance.nix create mode 100644 tests/modules/services/glance/default-settings.nix create mode 100644 tests/modules/services/glance/default.nix create mode 100644 tests/modules/services/glance/example-settings.nix create mode 100644 tests/modules/services/glance/glance-default-config.yml create mode 100644 tests/modules/services/glance/glance-example-config.yml create mode 100644 tests/modules/services/glance/glance.service diff --git a/modules/misc/news.nix b/modules/misc/news.nix index e7e582f5c50b..bef867bb4ada 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1692,6 +1692,17 @@ in { allows you to override this name. ''; } + + { + time = "2024-06-28T14:18:16+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.glance'. + + Glance is a self-hosted dashboard that puts all your feeds in + one place. See https://github.com/glanceapp/glance for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 5b100d474fa9..dbeebfbf7c9a 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -301,6 +301,7 @@ let ./services/fusuma.nix ./services/getmail.nix ./services/git-sync.nix + ./services/glance.nix ./services/gnome-keyring.nix ./services/gpg-agent.nix ./services/grobi.nix diff --git a/modules/services/glance.nix b/modules/services/glance.nix new file mode 100644 index 000000000000..fa4f1a8d70ef --- /dev/null +++ b/modules/services/glance.nix @@ -0,0 +1,77 @@ +{ config, lib, pkgs, ... }: + +let + cfg = config.services.glance; + + inherit (lib) mkEnableOption mkPackageOption mkOption mkIf getExe; + + settingsFormat = pkgs.formats.yaml { }; + + settingsFile = settingsFormat.generate "glance.yml" cfg.settings; + + configFilePath = "${config.xdg.configHome}/glance/glance.yml"; +in { + meta.maintainers = [ pkgs.lib.maintainers.gepbird ]; + + options.services.glance = { + enable = mkEnableOption "glance"; + + package = mkPackageOption pkgs "glance" { }; + + settings = mkOption { + type = settingsFormat.type; + default = { + pages = [{ + name = "Calendar"; + columns = [{ + size = "full"; + widgets = [{ type = "calendar"; }]; + }]; + }]; + }; + example = { + server.port = 5678; + pages = [{ + name = "Home"; + columns = [{ + size = "full"; + widgets = [ + { type = "calendar"; } + { + type = "weather"; + location = "London, United Kingdom"; + } + ]; + }]; + }]; + }; + description = '' + Configuration written to a yaml file that is read by glance. See + + for more. + ''; + }; + }; + + config = mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.glance" pkgs + lib.platforms.linux) + ]; + + home.packages = [ cfg.package ]; + + xdg.configFile."glance/glance.yml".source = settingsFile; + + systemd.user.services.glance = { + Unit = { + Description = "Glance feed dashboard server"; + PartOf = [ "graphical-session.target" ]; + }; + + Install.WantedBy = [ "graphical-session.target" ]; + + Service.ExecStart = "${getExe cfg.package} --config ${configFilePath}"; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index a5e7fe9e1ff1..28ce4f648a38 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -241,6 +241,7 @@ in import nmtSrc { ./modules/services/fnott ./modules/services/fusuma ./modules/services/git-sync + ./modules/services/glance ./modules/services/gpg-agent ./modules/services/gromit-mpx ./modules/services/home-manager-auto-upgrade diff --git a/tests/modules/services/glance/default-settings.nix b/tests/modules/services/glance/default-settings.nix new file mode 100644 index 000000000000..7b35db779c83 --- /dev/null +++ b/tests/modules/services/glance/default-settings.nix @@ -0,0 +1,15 @@ +{ ... }: + +{ + services.glance.enable = true; + + test.stubs.glance = { }; + + nmt.script = '' + configFile=home-files/.config/glance/glance.yml + serviceFile=home-files/.config/systemd/user/glance.service + + assertFileContent $configFile ${./glance-default-config.yml} + assertFileContent $serviceFile ${./glance.service} + ''; +} diff --git a/tests/modules/services/glance/default.nix b/tests/modules/services/glance/default.nix new file mode 100644 index 000000000000..893ba6516baa --- /dev/null +++ b/tests/modules/services/glance/default.nix @@ -0,0 +1,4 @@ +{ + glance-default-settings = ./default-settings.nix; + glance-example-settings = ./example-settings.nix; +} diff --git a/tests/modules/services/glance/example-settings.nix b/tests/modules/services/glance/example-settings.nix new file mode 100644 index 000000000000..9e2101d2e540 --- /dev/null +++ b/tests/modules/services/glance/example-settings.nix @@ -0,0 +1,33 @@ +{ ... }: + +{ + services.glance = { + enable = true; + settings = { + server.port = 5678; + pages = [{ + name = "Home"; + columns = [{ + size = "full"; + widgets = [ + { type = "calendar"; } + { + type = "weather"; + location = "London, United Kingdom"; + } + ]; + }]; + }]; + }; + }; + + test.stubs.glance = { }; + + nmt.script = '' + configFile=home-files/.config/glance/glance.yml + serviceFile=home-files/.config/systemd/user/glance.service + + assertFileContent $configFile ${./glance-example-config.yml} + assertFileContent $serviceFile ${./glance.service} + ''; +} diff --git a/tests/modules/services/glance/glance-default-config.yml b/tests/modules/services/glance/glance-default-config.yml new file mode 100644 index 000000000000..024a896490f5 --- /dev/null +++ b/tests/modules/services/glance/glance-default-config.yml @@ -0,0 +1,6 @@ +pages: +- columns: + - size: full + widgets: + - type: calendar + name: Calendar diff --git a/tests/modules/services/glance/glance-example-config.yml b/tests/modules/services/glance/glance-example-config.yml new file mode 100644 index 000000000000..2775916ec4ef --- /dev/null +++ b/tests/modules/services/glance/glance-example-config.yml @@ -0,0 +1,10 @@ +pages: +- columns: + - size: full + widgets: + - type: calendar + - location: London, United Kingdom + type: weather + name: Home +server: + port: 5678 diff --git a/tests/modules/services/glance/glance.service b/tests/modules/services/glance/glance.service new file mode 100644 index 000000000000..07b82d1d98af --- /dev/null +++ b/tests/modules/services/glance/glance.service @@ -0,0 +1,9 @@ +[Install] +WantedBy=graphical-session.target + +[Service] +ExecStart=@glance@/bin/dummy --config /home/hm-user/.config/glance/glance.yml + +[Unit] +Description=Glance feed dashboard server +PartOf=graphical-session.target From c2f806e60ac55c604708250ba0ebcf96bccbbafe Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 29 Jun 2024 17:20:18 +0200 Subject: [PATCH 344/636] pulseeffects: fix test evaluation Fixes #5588 --- modules/lib/maintainers.nix | 7 +++++++ modules/services/pulseeffects.nix | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index a820d53429db..1063f53a6280 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -173,6 +173,13 @@ github = "iosmanthus"; githubId = 16307070; }; + jonringer = { + email = "jonringer117@gmail.com"; + matrix = "@jonringer:matrix.org"; + github = "jonringer"; + githubId = 7673602; + name = "Jonathan Ringer"; + }; kalhauge = { name = "Christian Gram Kalhauge"; email = "kalhauge@users.noreply.github.com"; diff --git a/modules/services/pulseeffects.nix b/modules/services/pulseeffects.nix index 434adf85e8d9..3edc53499eaf 100644 --- a/modules/services/pulseeffects.nix +++ b/modules/services/pulseeffects.nix @@ -9,7 +9,7 @@ let presetOpts = optionalString (cfg.preset != "") "--load-preset ${cfg.preset}"; in { - meta.maintainers = [ maintainers.jonringer ]; + meta.maintainers = [ hm.maintainers.jonringer ]; options.services.pulseeffects = { enable = mkEnableOption '' From 36317d4d38887f7629876b0e43c8d9593c5cc48d Mon Sep 17 00:00:00 2001 From: Shogo Takata Date: Sat, 29 Jun 2024 15:19:35 +0900 Subject: [PATCH 345/636] direnv: add silent option PR #5586 --- modules/programs/direnv.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index add2c8fca899..4a763670537c 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -95,6 +95,7 @@ in { package = mkPackageOption pkgs "nix-direnv" { }; }; + silent = mkEnableOption "silent mode, that is, disabling direnv logging"; }; config = mkIf cfg.enable { @@ -163,5 +164,7 @@ in { } ) ''); + + home.sessionVariables = lib.mkIf cfg.silent { DIRENV_LOG_FORMAT = ""; }; }; } From ef74bacbb48cf5f33dda7b7565a7986fbc489a45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:49:15 +0200 Subject: [PATCH 346/636] ci: bump DeterminateSystems/update-flake-lock from 22 to 23 Bumps [DeterminateSystems/update-flake-lock](https://github.com/determinatesystems/update-flake-lock) from 22 to 23. - [Release notes](https://github.com/determinatesystems/update-flake-lock/releases) - [Commits](https://github.com/determinatesystems/update-flake-lock/compare/v22...v23) --- updated-dependencies: - dependency-name: DeterminateSystems/update-flake-lock dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/update-flake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-flake.yml b/.github/workflows/update-flake.yml index 9df8060df4a3..8ba9264d3528 100644 --- a/.github/workflows/update-flake.yml +++ b/.github/workflows/update-flake.yml @@ -14,7 +14,7 @@ jobs: - name: Install Nix uses: cachix/install-nix-action@v27 - name: Update flake.lock - uses: DeterminateSystems/update-flake-lock@v22 + uses: DeterminateSystems/update-flake-lock@v23 with: token: ${{ secrets.GH_TOKEN_FOR_UPDATES }} pr-labels: dependencies From 59ce796b2563e19821361abbe2067c3bb4143a7d Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:50:39 +0200 Subject: [PATCH 347/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/2893f56de08021cffd9b6b6dfc70fd9ccd51eb60?narHash=sha256-ECni%2BIkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko%3D' (2024-06-24) → 'github:NixOS/nixpkgs/b2852eb9365c6de48ffb0dc2c9562591f652242a?narHash=sha256-C8e9S7RzshSdHB7L%2Bv9I51af1gDM5unhJ2xO1ywxNH8%3D' (2024-06-27) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 508f73e5a0db..cbdbf0398f78 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1719254875, - "narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=", + "lastModified": 1719506693, + "narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60", + "rev": "b2852eb9365c6de48ffb0dc2c9562591f652242a", "type": "github" }, "original": { From 36e2f9da91ce8b63a549a47688ae60d47c50de4b Mon Sep 17 00:00:00 2001 From: Sumner Evans Date: Wed, 3 Jul 2024 01:39:20 -0600 Subject: [PATCH 348/636] maintainers: remove ivar ivar was removed as a maintainer from upstream nixpkgs due to inactivity: https://github.com/NixOS/nixpkgs/pull/322266 Signed-off-by: Sumner Evans --- modules/programs/sm64ex.nix | 2 +- modules/services/pbgopy.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/sm64ex.nix b/modules/programs/sm64ex.nix index 35d608baba9a..23b75808fc3e 100644 --- a/modules/programs/sm64ex.nix +++ b/modules/programs/sm64ex.nix @@ -29,7 +29,7 @@ let in "${key} ${generatedValue}"; in { - meta.maintainers = [ maintainers.ivar ]; + meta.maintainers = [ ]; options.programs.sm64ex = { enable = mkEnableOption "sm64ex"; diff --git a/modules/services/pbgopy.nix b/modules/services/pbgopy.nix index fecc64ca0f4e..3a3499e52007 100644 --- a/modules/services/pbgopy.nix +++ b/modules/services/pbgopy.nix @@ -15,7 +15,7 @@ let "--basic-auth ${escapeShellArg cfg.httpAuth}"); in { - meta.maintainers = [ maintainers.ivar ]; + meta.maintainers = [ ]; options.services.pbgopy = { enable = mkEnableOption "pbgopy"; From 269cc18d945dd44bcbc22d58df3876a5d0dbac0b Mon Sep 17 00:00:00 2001 From: sg-qwt <115715554+sg-qwt@users.noreply.github.com> Date: Thu, 4 Jul 2024 03:43:38 +0800 Subject: [PATCH 349/636] sway: fix systemd variables example --- modules/services/window-managers/i3-sway/sway.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index bc20e9d9bd5a..cd1b27febf0d 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -403,7 +403,7 @@ in { "XCURSOR_THEME" "XCURSOR_SIZE" ]; - example = [ "-all" ]; + example = [ "--all" ]; description = '' Environment variables imported into the systemd and D-Bus user environment. ''; From e9158314725af06854009b829d2249d0d6c23c79 Mon Sep 17 00:00:00 2001 From: uncenter <47499684+uncenter@users.noreply.github.com> Date: Wed, 3 Jul 2024 17:36:14 -0400 Subject: [PATCH 350/636] yazi: allow literal string for `initLua` --- modules/programs/yazi.nix | 9 +++++++-- tests/modules/programs/yazi/default.nix | 1 + tests/modules/programs/yazi/init-lua-string.nix | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 tests/modules/programs/yazi/init-lua-string.nix diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index 105bbec4d611..d7b880200d62 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -141,7 +141,7 @@ in { }; initLua = mkOption { - type = with types; nullOr path; + type = with types; nullOr (either path lines); default = null; description = '' The init.lua for Yazi itself. @@ -210,7 +210,12 @@ in { "yazi/theme.toml" = mkIf (cfg.theme != { }) { source = tomlFormat.generate "yazi-theme" cfg.theme; }; - "yazi/init.lua" = mkIf (cfg.initLua != null) { source = cfg.initLua; }; + "yazi/init.lua" = mkIf (cfg.initLua != null) + (if builtins.isPath cfg.initLua then { + source = cfg.initLua; + } else { + text = cfg.initLua; + }); } // (mapAttrs' (name: value: nameValuePair "yazi/flavors/${name}.yazi" { source = value; }) cfg.flavors) // (mapAttrs' (name: value: diff --git a/tests/modules/programs/yazi/default.nix b/tests/modules/programs/yazi/default.nix index 09d52ac3df5c..ec543c84d7b6 100644 --- a/tests/modules/programs/yazi/default.nix +++ b/tests/modules/programs/yazi/default.nix @@ -1,5 +1,6 @@ { yazi-settings = ./settings.nix; + yazi-init-lua-string = ./init-lua-string.nix; yazi-bash-integration-enabled = ./bash-integration-enabled.nix; yazi-zsh-integration-enabled = ./zsh-integration-enabled.nix; yazi-fish-integration-enabled = ./fish-integration-enabled.nix; diff --git a/tests/modules/programs/yazi/init-lua-string.nix b/tests/modules/programs/yazi/init-lua-string.nix new file mode 100644 index 000000000000..999dd6bc6f97 --- /dev/null +++ b/tests/modules/programs/yazi/init-lua-string.nix @@ -0,0 +1,14 @@ +{ ... }: { + programs.yazi = { + enable = true; + + initLua = builtins.readFile ./init.lua; + }; + + test.stubs.yazi = { }; + + nmt.script = '' + assertFileContent home-files/.config/yazi/init.lua \ + ${./init.lua} + ''; +} From 58268b4d7745f6747be18033e6f10011466ce8d4 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Wed, 3 Jul 2024 23:36:42 +0200 Subject: [PATCH 351/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/b2852eb9365c6de48ffb0dc2c9562591f652242a?narHash=sha256-C8e9S7RzshSdHB7L%2Bv9I51af1gDM5unhJ2xO1ywxNH8%3D' (2024-06-27) → 'github:NixOS/nixpkgs/00d80d13810dbfea8ab4ed1009b09100cca86ba8?narHash=sha256-H3%2BEC5cYuq%2BgQW8y0lSrrDZfH71LB4DAf%2BTDFyvwCNA%3D' (2024-07-01) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index cbdbf0398f78..b700f2083e1c 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1719506693, - "narHash": "sha256-C8e9S7RzshSdHB7L+v9I51af1gDM5unhJ2xO1ywxNH8=", + "lastModified": 1719848872, + "narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b2852eb9365c6de48ffb0dc2c9562591f652242a", + "rev": "00d80d13810dbfea8ab4ed1009b09100cca86ba8", "type": "github" }, "original": { From 0a30138c694ab3b048ac300794c2eb599dc40266 Mon Sep 17 00:00:00 2001 From: novenary Date: Tue, 2 Jul 2024 15:04:26 +0300 Subject: [PATCH 352/636] mpd: specify dependency of service on socket This allows `systemctl --user restart mpd.socket` to work properly. --- modules/services/mpd.nix | 15 +++++++--- tests/modules/services/mpd/default.nix | 1 + .../services/mpd/start-when-needed.nix | 29 +++++++++++++++++++ .../services/mpd/start-when-needed.service | 12 ++++++++ .../services/mpd/start-when-needed.socket | 8 +++++ 5 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 tests/modules/services/mpd/start-when-needed.nix create mode 100644 tests/modules/services/mpd/start-when-needed.service create mode 100644 tests/modules/services/mpd/start-when-needed.socket diff --git a/modules/services/mpd.nix b/modules/services/mpd.nix index a0011b0213a5..3d8d03be7161 100644 --- a/modules/services/mpd.nix +++ b/modules/services/mpd.nix @@ -171,10 +171,17 @@ in { ]; systemd.user.services.mpd = { - Unit = { - After = [ "network.target" "sound.target" ]; - Description = "Music Player Daemon"; - }; + Unit = mkMerge [ + { + Description = "Music Player Daemon"; + After = [ "network.target" "sound.target" ]; + } + + (mkIf cfg.network.startWhenNeeded { + Requires = [ "mpd.socket" ]; + After = [ "mpd.socket" ]; + }) + ]; Install = mkIf (!cfg.network.startWhenNeeded) { WantedBy = [ "default.target" ]; diff --git a/tests/modules/services/mpd/default.nix b/tests/modules/services/mpd/default.nix index d2fd2a2922d2..f7919b227197 100644 --- a/tests/modules/services/mpd/default.nix +++ b/tests/modules/services/mpd/default.nix @@ -1,5 +1,6 @@ { mpd-basic-configuration = ./basic-configuration.nix; mpd-before-state-version-22_11 = ./before-state-version-22_11.nix; + mpd-start-when-needed = ./start-when-needed.nix; mpd-xdg-music-dir = ./xdg-music-dir.nix; } diff --git a/tests/modules/services/mpd/start-when-needed.nix b/tests/modules/services/mpd/start-when-needed.nix new file mode 100644 index 000000000000..31017c9e3035 --- /dev/null +++ b/tests/modules/services/mpd/start-when-needed.nix @@ -0,0 +1,29 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + services.mpd = { + enable = true; + musicDirectory = "/my/music/dir"; + extraArgs = [ "--verbose" ]; + network.startWhenNeeded = true; + }; + + home.stateVersion = "22.11"; + + test.stubs.mpd = { }; + + nmt.script = '' + serviceFile=$(normalizeStorePaths home-files/.config/systemd/user/mpd.service) + assertFileContent "$serviceFile" ${./start-when-needed.service} + + socketFile=home-files/.config/systemd/user/mpd.socket + assertFileContent "$socketFile" ${./start-when-needed.socket} + + confFile=$(grep -o \ + '/nix/store/.*-mpd.conf' \ + $TESTED/home-files/.config/systemd/user/mpd.service) + assertFileContent "$confFile" ${./basic-configuration.conf} + ''; +} diff --git a/tests/modules/services/mpd/start-when-needed.service b/tests/modules/services/mpd/start-when-needed.service new file mode 100644 index 000000000000..87eb4b79a2f9 --- /dev/null +++ b/tests/modules/services/mpd/start-when-needed.service @@ -0,0 +1,12 @@ +[Service] +Environment=PATH=/home/hm-user/.nix-profile/bin +ExecStart=@mpd@/bin/mpd --no-daemon /nix/store/00000000000000000000000000000000-mpd.conf '--verbose' +ExecStartPre=/nix/store/00000000000000000000000000000000-bash/bin/bash -c "/nix/store/00000000000000000000000000000000-coreutils/bin/mkdir -p '/home/hm-user/.local/share/mpd' '/home/hm-user/.local/share/mpd/playlists'" +Type=notify + +[Unit] +After=network.target +After=sound.target +After=mpd.socket +Description=Music Player Daemon +Requires=mpd.socket diff --git a/tests/modules/services/mpd/start-when-needed.socket b/tests/modules/services/mpd/start-when-needed.socket new file mode 100644 index 000000000000..b5687b117305 --- /dev/null +++ b/tests/modules/services/mpd/start-when-needed.socket @@ -0,0 +1,8 @@ +[Install] +WantedBy=sockets.target + +[Socket] +Backlog=5 +KeepAlive=true +ListenStream=127.0.0.1:6600 +ListenStream=%t/mpd/socket From c23060ce95c4856157789b0636e1b6206be335c4 Mon Sep 17 00:00:00 2001 From: TheRealGramdalf <79593869+TheRealGramdalf@users.noreply.github.com> Date: Thu, 4 Jul 2024 23:07:22 +0000 Subject: [PATCH 353/636] hyprland: emphasize usage of the NixOS module --- modules/services/window-managers/hyprland.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/services/window-managers/hyprland.nix b/modules/services/window-managers/hyprland.nix index 8fbdc6b7c688..73602ec61cf3 100644 --- a/modules/services/window-managers/hyprland.nix +++ b/modules/services/window-managers/hyprland.nix @@ -40,7 +40,21 @@ in { ]; options.wayland.windowManager.hyprland = { - enable = lib.mkEnableOption "Hyprland wayland compositor"; + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = '' + Whether to enable configuration for Hyprland, a tiling Wayland + compositor that doesn't sacrifice on its looks. + + ::: {.note} + This module configures Hyprland and adds it to your user's {env}`PATH`, + but does not make certain system-level changes. NixOS users should + enable the NixOS module with {option}`programs.hyprland.enable`, which + makes system-level changes such as adding a desktop session entry. + ::: + ''; + }; package = lib.mkPackageOption pkgs "hyprland" { }; From 6ea6fafa3e0f1691ec1555ce4281d7d993546131 Mon Sep 17 00:00:00 2001 From: Tadeo Kondrak Date: Thu, 4 Jul 2024 17:09:47 -0600 Subject: [PATCH 354/636] mpv: remove tadeokondrak as maintainer --- modules/programs/mpv.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/mpv.nix b/modules/programs/mpv.nix index 30f2a8e05d0c..f2664e71a6ca 100644 --- a/modules/programs/mpv.nix +++ b/modules/programs/mpv.nix @@ -229,5 +229,5 @@ in { } ]); - meta.maintainers = with maintainers; [ tadeokondrak thiagokokada chuangzhu ]; + meta.maintainers = with maintainers; [ thiagokokada chuangzhu ]; } From c514e862cd5705e51edb6fe8d01146fdeec661f2 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 5 Jul 2024 01:18:45 +0200 Subject: [PATCH 355/636] treewide: fix eval after Nixpkgs maintainer changes --- modules/lib/maintainers.nix | 14 ++++++++++++++ modules/programs/gh-dash.nix | 2 +- modules/programs/hyfetch.nix | 2 +- modules/programs/script-directory.nix | 2 +- modules/services/cliphist.nix | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 1063f53a6280..f1a818155817 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -113,6 +113,13 @@ github = "jack5079"; githubId = 29169102; }; + janik = { + name = "Janik"; + email = "janik@aq0.de"; + matrix = "@janik0:matrix.org"; + github = "Janik-Haag"; + githubId = 80165193; + }; jkarlson = { email = "jekarlson@gmail.com"; github = "jkarlson"; @@ -214,6 +221,13 @@ github = "lheckemann"; githubId = 341954; }; + lilyinstarlight = { + email = "lily@lily.flowers"; + matrix = "@lily:lily.flowers"; + github = "lilyinstarlight"; + githubId = 298109; + name = "Lily Foster"; + }; loicreynier = { name = "Loïc Reynier"; email = "loic@loireynier.fr"; diff --git a/modules/programs/gh-dash.nix b/modules/programs/gh-dash.nix index 69d5482b6ad7..b351bb33a052 100644 --- a/modules/programs/gh-dash.nix +++ b/modules/programs/gh-dash.nix @@ -7,7 +7,7 @@ let yamlFormat = pkgs.formats.yaml { }; in { - meta.maintainers = [ lib.maintainers.janik ]; + meta.maintainers = [ lib.hm.maintainers.janik ]; options.programs.gh-dash = { enable = lib.mkEnableOption "GitHub CLI dashboard plugin"; diff --git a/modules/programs/hyfetch.nix b/modules/programs/hyfetch.nix index 726bc94e63b7..485ceb046515 100644 --- a/modules/programs/hyfetch.nix +++ b/modules/programs/hyfetch.nix @@ -7,7 +7,7 @@ let jsonFormat = pkgs.formats.json { }; in { - meta.maintainers = [ maintainers.lilyinstarlight ]; + meta.maintainers = [ hm.maintainers.lilyinstarlight ]; options.programs.hyfetch = { enable = mkEnableOption "hyfetch"; diff --git a/modules/programs/script-directory.nix b/modules/programs/script-directory.nix index 9f5abf65a414..bd6b3b40138e 100644 --- a/modules/programs/script-directory.nix +++ b/modules/programs/script-directory.nix @@ -1,7 +1,7 @@ { config, pkgs, lib, ... }: let cfg = config.programs.script-directory; in { - meta.maintainers = [ lib.maintainers.janik ]; + meta.maintainers = [ lib.hm.maintainers.janik ]; options.programs.script-directory = { enable = lib.mkEnableOption "script-directory"; diff --git a/modules/services/cliphist.nix b/modules/services/cliphist.nix index 3599557f059f..1877a6de0ff2 100644 --- a/modules/services/cliphist.nix +++ b/modules/services/cliphist.nix @@ -1,7 +1,7 @@ { config, lib, pkgs, ... }: let cfg = config.services.cliphist; in { - meta.maintainers = [ lib.maintainers.janik ]; + meta.maintainers = [ lib.hm.maintainers.janik ]; options.services.cliphist = { enable = From bbe6e94737289c8cb92d4d8f9199fbfe4f11c0ba Mon Sep 17 00:00:00 2001 From: 0x4A6F <0x4A6F@users.noreply.github.com> Date: Fri, 5 Jul 2024 10:12:00 +0200 Subject: [PATCH 356/636] dunst: fix warning for lib.cartesianProductOfSets "lib.cartesianProductOfSets is a deprecated alias of lib.cartesianProduct." Rename happened in nixpkgs commit `228621e42dc43f936b66e0ed042c90c511aa0535`. --- modules/services/dunst.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix index daa800cf0cd8..bd8c4adfbffd 100644 --- a/modules/services/dunst.nix +++ b/modules/services/dunst.nix @@ -172,7 +172,7 @@ in { mkPath = { basePath, theme, category }: "${basePath}/share/icons/${theme.name}/${theme.size}/${category}"; - in concatMapStringsSep ":" mkPath (cartesianProductOfSets { + in concatMapStringsSep ":" mkPath (cartesianProduct { basePath = basePaths; theme = themes; category = categories; From b7b55e285cfc92e84f243012516bbc414691b747 Mon Sep 17 00:00:00 2001 From: novenary Date: Thu, 7 Mar 2024 17:48:31 +0200 Subject: [PATCH 357/636] sway: stop sway-session.target on exit This ensures graphical-session.target is properly cycled, and that all of its members are restarted on consecutive runs. --- modules/services/window-managers/i3-sway/sway.nix | 6 +++++- .../window-managers/sway/sway-bar-focused-colors.conf | 2 +- .../sway/sway-bindkeys-to-code-and-extra-config.conf | 2 +- .../modules/services/window-managers/sway/sway-default.conf | 2 +- .../window-managers/sway/sway-followmouse-expected.conf | 2 +- .../sway/sway-followmouse-legacy-expected.conf | 2 +- .../modules/services/window-managers/sway/sway-modules.conf | 2 +- .../services/window-managers/sway/sway-null-package.conf | 2 +- .../services/window-managers/sway/sway-post-2003.conf | 2 +- .../window-managers/sway/sway-systemd-variables.conf | 2 +- .../sway/sway-workspace-default-expected.conf | 2 +- .../sway/sway-workspace-output-expected.conf | 2 +- 12 files changed, 16 insertions(+), 12 deletions(-) diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index cd1b27febf0d..c2fca36678ac 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -411,7 +411,11 @@ in { extraCommands = mkOption { type = types.listOf types.str; - default = [ "systemctl --user start sway-session.target" ]; + default = [ + "systemctl --user start sway-session.target" + "swaymsg -mt subscribe '[]' || true" + "systemctl --user stop sway-session.target" + ]; description = '' Extra commands to run after D-Bus activation. ''; diff --git a/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf b/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf index 448c41f47f9d..841bdca9c8a8 100644 --- a/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf +++ b/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf @@ -108,4 +108,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf b/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf index d11f6f2bca17..b6bf959523ec 100644 --- a/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf +++ b/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf @@ -107,5 +107,5 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" exec_always pkill flashfocus; flasfocus & diff --git a/tests/modules/services/window-managers/sway/sway-default.conf b/tests/modules/services/window-managers/sway/sway-default.conf index 71a0b13fb52f..a37e91608995 100644 --- a/tests/modules/services/window-managers/sway/sway-default.conf +++ b/tests/modules/services/window-managers/sway/sway-default.conf @@ -105,4 +105,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf b/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf index af259face8bb..5345f8f8712c 100644 --- a/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf @@ -83,4 +83,4 @@ mode "resize" { bindsym l resize grow width 10 px } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf b/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf index 1fd0003fc6ea..590dc8aae49b 100644 --- a/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf @@ -83,4 +83,4 @@ mode "resize" { bindsym l resize grow width 10 px } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-modules.conf b/tests/modules/services/window-managers/sway/sway-modules.conf index 766d61de7f63..d11691e34211 100644 --- a/tests/modules/services/window-managers/sway/sway-modules.conf +++ b/tests/modules/services/window-managers/sway/sway-modules.conf @@ -117,4 +117,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-null-package.conf b/tests/modules/services/window-managers/sway/sway-null-package.conf index 67073371ff8e..2066fcd27669 100644 --- a/tests/modules/services/window-managers/sway/sway-null-package.conf +++ b/tests/modules/services/window-managers/sway/sway-null-package.conf @@ -105,4 +105,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-post-2003.conf b/tests/modules/services/window-managers/sway/sway-post-2003.conf index 67073371ff8e..2066fcd27669 100644 --- a/tests/modules/services/window-managers/sway/sway-post-2003.conf +++ b/tests/modules/services/window-managers/sway/sway-post-2003.conf @@ -105,4 +105,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-systemd-variables.conf b/tests/modules/services/window-managers/sway/sway-systemd-variables.conf index 1cbb92c32314..2482ed450dde 100644 --- a/tests/modules/services/window-managers/sway/sway-systemd-variables.conf +++ b/tests/modules/services/window-managers/sway/sway-systemd-variables.conf @@ -105,4 +105,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf b/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf index 5233c0bb2a7c..18dd31d266f3 100644 --- a/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf @@ -104,4 +104,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf b/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf index 32dfd7344d3c..4fb7685c646e 100644 --- a/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf @@ -110,4 +110,4 @@ workspace "ABC" output "DP" workspace "3: Test" output "HDMI" workspace "!"§$%&/(){}[]=?\*#<>-_.:,;²³" output "DVI" workspace "Multiple" output "DVI" "HDMI" "DP" -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" From e3582e5151498bc4d757e8361431ace8529e7bb7 Mon Sep 17 00:00:00 2001 From: novenary Date: Thu, 7 Mar 2024 18:57:22 +0200 Subject: [PATCH 358/636] sway: unfail units before starting session target Sometimes services can fail. Failed services will generally not be restarted by systemd. To start previously failed services we can just reset their failed state before starting our session target. GNOME and Plasma do the same thing. See: https://github.com/alebastr/sway-systemd/pull/11 --- modules/services/window-managers/i3-sway/sway.nix | 1 + .../services/window-managers/sway/sway-bar-focused-colors.conf | 2 +- .../sway/sway-bindkeys-to-code-and-extra-config.conf | 2 +- tests/modules/services/window-managers/sway/sway-default.conf | 2 +- .../window-managers/sway/sway-followmouse-expected.conf | 2 +- .../window-managers/sway/sway-followmouse-legacy-expected.conf | 2 +- tests/modules/services/window-managers/sway/sway-modules.conf | 2 +- .../services/window-managers/sway/sway-null-package.conf | 2 +- tests/modules/services/window-managers/sway/sway-post-2003.conf | 2 +- .../services/window-managers/sway/sway-systemd-variables.conf | 2 +- .../window-managers/sway/sway-workspace-default-expected.conf | 2 +- .../window-managers/sway/sway-workspace-output-expected.conf | 2 +- 12 files changed, 12 insertions(+), 11 deletions(-) diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index c2fca36678ac..f4e437218d71 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -412,6 +412,7 @@ in { extraCommands = mkOption { type = types.listOf types.str; default = [ + "systemctl --user reset-failed" "systemctl --user start sway-session.target" "swaymsg -mt subscribe '[]' || true" "systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf b/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf index 841bdca9c8a8..10019319263d 100644 --- a/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf +++ b/tests/modules/services/window-managers/sway/sway-bar-focused-colors.conf @@ -108,4 +108,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user reset-failed && systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf b/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf index b6bf959523ec..28513fcd5ed7 100644 --- a/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf +++ b/tests/modules/services/window-managers/sway/sway-bindkeys-to-code-and-extra-config.conf @@ -107,5 +107,5 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user reset-failed && systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" exec_always pkill flashfocus; flasfocus & diff --git a/tests/modules/services/window-managers/sway/sway-default.conf b/tests/modules/services/window-managers/sway/sway-default.conf index a37e91608995..cefe4e0afd24 100644 --- a/tests/modules/services/window-managers/sway/sway-default.conf +++ b/tests/modules/services/window-managers/sway/sway-default.conf @@ -105,4 +105,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user reset-failed && systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf b/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf index 5345f8f8712c..f4f60ddf0756 100644 --- a/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-followmouse-expected.conf @@ -83,4 +83,4 @@ mode "resize" { bindsym l resize grow width 10 px } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user reset-failed && systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf b/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf index 590dc8aae49b..c10dbd90db6a 100644 --- a/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-followmouse-legacy-expected.conf @@ -83,4 +83,4 @@ mode "resize" { bindsym l resize grow width 10 px } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user reset-failed && systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-modules.conf b/tests/modules/services/window-managers/sway/sway-modules.conf index d11691e34211..d0302d07a9d7 100644 --- a/tests/modules/services/window-managers/sway/sway-modules.conf +++ b/tests/modules/services/window-managers/sway/sway-modules.conf @@ -117,4 +117,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user reset-failed && systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-null-package.conf b/tests/modules/services/window-managers/sway/sway-null-package.conf index 2066fcd27669..9df934b2fe97 100644 --- a/tests/modules/services/window-managers/sway/sway-null-package.conf +++ b/tests/modules/services/window-managers/sway/sway-null-package.conf @@ -105,4 +105,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user reset-failed && systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-post-2003.conf b/tests/modules/services/window-managers/sway/sway-post-2003.conf index 2066fcd27669..9df934b2fe97 100644 --- a/tests/modules/services/window-managers/sway/sway-post-2003.conf +++ b/tests/modules/services/window-managers/sway/sway-post-2003.conf @@ -105,4 +105,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user reset-failed && systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-systemd-variables.conf b/tests/modules/services/window-managers/sway/sway-systemd-variables.conf index 2482ed450dde..3710c5392c80 100644 --- a/tests/modules/services/window-managers/sway/sway-systemd-variables.conf +++ b/tests/modules/services/window-managers/sway/sway-systemd-variables.conf @@ -105,4 +105,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd XCURSOR_THEME XCURSOR_SIZE; systemctl --user reset-failed && systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf b/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf index 18dd31d266f3..4fe87282189d 100644 --- a/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-workspace-default-expected.conf @@ -104,4 +104,4 @@ bar { } } -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user reset-failed && systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" diff --git a/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf b/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf index 4fb7685c646e..7148d0030daf 100644 --- a/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf +++ b/tests/modules/services/window-managers/sway/sway-workspace-output-expected.conf @@ -110,4 +110,4 @@ workspace "ABC" output "DP" workspace "3: Test" output "HDMI" workspace "!"§$%&/(){}[]=?\*#<>-_.:,;²³" output "DVI" workspace "Multiple" output "DVI" "HDMI" "DP" -exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" +exec "/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_SESSION_TYPE NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE; systemctl --user reset-failed && systemctl --user start sway-session.target && swaymsg -mt subscribe '[]' || true && systemctl --user stop sway-session.target" From 10486e6b311b3c5ae1c3477fee058704cea7cb4a Mon Sep 17 00:00:00 2001 From: Bojun Ren Date: Sun, 7 Jul 2024 02:08:39 +0800 Subject: [PATCH 359/636] starship: fix type of settings to allow all valid value Previously, type check of `programs.starship.settings` fails for some valid settings, such as `c.commands = [["cc" "--version"]]`. The commit fix the `type` argument passed to `mkOption`, so `programs.starship.settings` can accept all valid values (of toml type). --- modules/programs/starship.nix | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/modules/programs/starship.nix b/modules/programs/starship.nix index f253fa7f07cf..9ccff7fcfda0 100644 --- a/modules/programs/starship.nix +++ b/modules/programs/starship.nix @@ -24,14 +24,7 @@ in { }; settings = mkOption { - type = with types; - let - prim = either bool (either int str); - primOrPrimAttrs = either prim (attrsOf prim); - entry = either prim (listOf primOrPrimAttrs); - entryOrAttrsOf = t: either entry (attrsOf t); - entries = entryOrAttrsOf (entryOrAttrsOf entry); - in attrsOf entries // { description = "Starship configuration"; }; + type = tomlFormat.type; default = { }; example = literalExpression '' { From 6b7ce96f34b324e4e104abc30d06955d216bac71 Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Sun, 7 Jul 2024 06:49:29 +0200 Subject: [PATCH 360/636] Translate using Weblate (Hungarian) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 43.2% (16 of 37 strings) Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/hu/ Translation: Home Manager/Home Manager CLI Co-authored-by: Ferenci Ákos --- home-manager/po/hu.po | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/home-manager/po/hu.po b/home-manager/po/hu.po index 88ad1d780eb1..a127cf1b0c03 100644 --- a/home-manager/po/hu.po +++ b/home-manager/po/hu.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-06-14 20:40+0000\n" -"Last-Translator: Balint Barna Kovari \n" +"PO-Revision-Date: 2024-07-05 14:09+0000\n" +"Last-Translator: Ferenci Ákos \n" "Language-Team: Hungarian \n" "Language: hu\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.6-dev\n" +"X-Generator: Weblate 5.7-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 @@ -36,14 +36,17 @@ msgid "" "Keeping your Home Manager %s in %s is deprecated,\n" "please move it to %s" msgstr "" +"A Home Manager %s %s elérési úton való tárolása elavult. Kérem helyezze át a " +"%s elérési úthoz" #: home-manager/home-manager:92 msgid "No configuration file found. Please create one at %s" msgstr "" +"Nem található konfigurációs fájl. Kérem hozza létre a fájlt a %s elérési úton" #: home-manager/home-manager:107 msgid "Home Manager not found at %s." -msgstr "" +msgstr "Home Manager nem található a %s elérési úton." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:115 @@ -90,23 +93,23 @@ msgstr "" #: home-manager/home-manager:296 home-manager/home-manager:319 #: home-manager/home-manager:1051 msgid "%s: unknown option '%s'" -msgstr "" +msgstr "%s: ismeretlen opció '%s'" #: home-manager/home-manager:301 home-manager/home-manager:1052 msgid "Run '%s --help' for usage help" -msgstr "" +msgstr "Futtasa a '%s --help' parancsot a használattal kapcsolatos segítségért" #: home-manager/home-manager:327 home-manager/home-manager:431 msgid "The file %s already exists, leaving it unchanged..." -msgstr "" +msgstr "A fájl %s már létezik és változatlan marad..." #: home-manager/home-manager:329 home-manager/home-manager:433 msgid "Creating %s..." -msgstr "" +msgstr "%s létrehozása..." #: home-manager/home-manager:475 msgid "Creating initial Home Manager generation..." -msgstr "" +msgstr "Kezdeti Home Manager generáció létrehozása..." #. translators: The "%s" specifier will be replaced by a file path. #: home-manager/home-manager:480 @@ -132,7 +135,7 @@ msgstr "" #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:496 msgid "Can't instantiate a flake configuration" -msgstr "" +msgstr "Flake konfiguráció nem példányosítható" #: home-manager/home-manager:572 msgid "" @@ -155,7 +158,7 @@ msgstr "" #: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" -msgstr "" +msgstr "Build futtatása nem lehetséges csak-olvasható könyvtárban" #: home-manager/home-manager:693 msgid "No generation with ID %s" @@ -167,7 +170,7 @@ msgstr "" #: home-manager/home-manager:697 msgid "Removing generation %s" -msgstr "" +msgstr "%s generáció eltávolítása" #: home-manager/home-manager:718 msgid "No generations to expire" @@ -179,7 +182,7 @@ msgstr "" #: home-manager/home-manager:811 msgid "Unknown argument %s" -msgstr "" +msgstr "Ismeretlen argumentum %s" #: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." @@ -199,7 +202,7 @@ msgstr "" #: home-manager/home-manager:863 msgid "Yay!" -msgstr "" +msgstr "Hurrá!" #: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." @@ -211,7 +214,7 @@ msgstr "" #: home-manager/home-manager:1113 msgid "Unknown command: %s" -msgstr "" +msgstr "Ismeretlen parancs: %s" #: home-manager/install.nix:18 msgid "This derivation is not buildable, please run it using nix-shell." From dfaf0ff2e7e536e404a260845e436bd888c4bb5f Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 8 Jul 2024 22:33:29 +0200 Subject: [PATCH 361/636] systemd: only set old units directory when available --- modules/systemd.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/systemd.nix b/modules/systemd.nix index 1d96ec8d276e..d480a1e453ac 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -335,7 +335,7 @@ in { in '' ${pkgs.sd-switch}/bin/sd-switch \ ''${DRY_RUN:+--dry-run} $VERBOSE_ARG ${timeoutArg} \ - ''${oldGenPath:+--old-units $oldGenPath/home-files/.config/systemd/user} \ + ''${oldUnitsDir:+--old-units $oldUnitsDir} \ --new-units "$newUnitsDir" ''; }; @@ -354,6 +354,13 @@ in { warnEcho "Attempting to reload services anyway..." fi + if [[ -v oldGenPath ]]; then + oldUnitsDir="$oldGenPath/home-files/.config/systemd/user" + if [[ ! -e $oldUnitsDir ]]; then + oldUnitsDir= + fi + fi + newUnitsDir="$newGenPath/home-files/.config/systemd/user" if [[ ! -e $newUnitsDir ]]; then newUnitsDir=${pkgs.emptyDirectory} @@ -362,7 +369,7 @@ in { ${ensureRuntimeDir} \ ${getAttr cfg.startServices cmd} - unset newUnitsDir + unset newUnitsDir oldUnitsDir else echo "User systemd daemon not running. Skipping reload." fi From 2fb5c1e0a17bc6059fa09dc411a43d75f35bb192 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 7 Jul 2024 23:13:28 +0200 Subject: [PATCH 362/636] tests: update to match new sd-switch version Also, seems Nix has become more memory hungry so increase memory allocation. --- tests/integration/nixos/basics.nix | 2 ++ tests/integration/standalone/flake-basics.nix | 4 ++-- tests/integration/standalone/standard-basics.nix | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/integration/nixos/basics.nix b/tests/integration/nixos/basics.nix index 001623ca55b3..43f537c7944c 100644 --- a/tests/integration/nixos/basics.nix +++ b/tests/integration/nixos/basics.nix @@ -7,6 +7,8 @@ nodes.machine = { ... }: { imports = [ ../../../nixos ]; # Import the HM NixOS module. + virtualisation.memorySize = 2048; + users.users.alice = { isNormalUser = true; description = "Alice Foobar"; diff --git a/tests/integration/standalone/flake-basics.nix b/tests/integration/standalone/flake-basics.nix index 8f9627d9f48f..9638862f29c1 100644 --- a/tests/integration/standalone/flake-basics.nix +++ b/tests/integration/standalone/flake-basics.nix @@ -6,7 +6,7 @@ nodes.machine = { ... }: { imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; - virtualisation.memorySize = 2048; + virtualisation.memorySize = 3072; nix = { registry.home-manager.to = { type = "path"; @@ -88,7 +88,7 @@ } /home/alice/.config/home-manager/home.nix") actual = succeed_as_alice("home-manager switch") - expected = "Started pueued.service - active" + expected = "Starting units: pueued.service" assert expected in actual, \ f"expected home-manager switch to contain {expected}, but got {actual}" diff --git a/tests/integration/standalone/standard-basics.nix b/tests/integration/standalone/standard-basics.nix index d4cac249a5fa..b994ff370eb2 100644 --- a/tests/integration/standalone/standard-basics.nix +++ b/tests/integration/standalone/standard-basics.nix @@ -85,7 +85,7 @@ } /home/alice/.config/home-manager/home.nix") actual = succeed_as_alice("home-manager switch") - expected = "Started pueued.service - active" + expected = "Starting units: pueued.service" assert expected in actual, \ f"expected home-manager switch to contain {expected}, but got {actual}" From f749fabeccb1587e4c1562e4f818cf33b8f77a51 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 10 Jul 2024 11:54:49 +0000 Subject: [PATCH 363/636] atuin: use 'lib.getExe' --- modules/programs/atuin.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/programs/atuin.nix b/modules/programs/atuin.nix index bd907ac03247..a27bcf8601f9 100644 --- a/modules/programs/atuin.nix +++ b/modules/programs/atuin.nix @@ -110,18 +110,18 @@ in { programs.bash.initExtra = mkIf cfg.enableBashIntegration '' if [[ :$SHELLOPTS: =~ :(vi|emacs): ]]; then source "${pkgs.bash-preexec}/share/bash/bash-preexec.sh" - eval "$(${cfg.package}/bin/atuin init bash ${flagsStr})" + eval "$(${lib.getExe cfg.package} init bash ${flagsStr})" fi ''; programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' if [[ $options[zle] = on ]]; then - eval "$(${cfg.package}/bin/atuin init zsh ${flagsStr})" + eval "$(${lib.getExe cfg.package} init zsh ${flagsStr})" fi ''; programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' - ${cfg.package}/bin/atuin init fish ${flagsStr} | source + ${lib.getExe cfg.package} init fish ${flagsStr} | source ''; programs.nushell = mkIf cfg.enableNushellIntegration { @@ -130,7 +130,9 @@ in { if not ($atuin_cache | path exists) { mkdir $atuin_cache } - ${cfg.package}/bin/atuin init nu ${flagsStr} | save --force ${config.xdg.cacheHome}/atuin/init.nu + ${ + lib.getExe cfg.package + } init nu ${flagsStr} | save --force ${config.xdg.cacheHome}/atuin/init.nu ''; extraConfig = '' source ${config.xdg.cacheHome}/atuin/init.nu From f79d950ac23a4c63e60bb71475d3321fbd9ace2d Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 10 Jul 2024 23:11:15 +0200 Subject: [PATCH 364/636] atuin: fix tests --- tests/modules/programs/atuin/bash.nix | 2 +- tests/modules/programs/atuin/empty-settings.nix | 2 +- tests/modules/programs/atuin/example-settings.nix | 2 +- tests/modules/programs/atuin/fish.nix | 2 +- tests/modules/programs/atuin/no-shell.nix | 2 +- tests/modules/programs/atuin/set-flags.nix | 2 +- tests/modules/programs/atuin/zsh.nix | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/modules/programs/atuin/bash.nix b/tests/modules/programs/atuin/bash.nix index a84ea99e3ab6..21d306b2fa4d 100644 --- a/tests/modules/programs/atuin/bash.nix +++ b/tests/modules/programs/atuin/bash.nix @@ -10,7 +10,7 @@ }; test.stubs = { - atuin = { }; + atuin = { name = "atuin"; }; bash-preexec = { }; }; diff --git a/tests/modules/programs/atuin/empty-settings.nix b/tests/modules/programs/atuin/empty-settings.nix index 58f126965dd5..be6b55986145 100644 --- a/tests/modules/programs/atuin/empty-settings.nix +++ b/tests/modules/programs/atuin/empty-settings.nix @@ -4,7 +4,7 @@ programs.atuin.enable = true; test.stubs = { - atuin = { }; + atuin = { name = "atuin"; }; bash-preexec = { }; }; diff --git a/tests/modules/programs/atuin/example-settings.nix b/tests/modules/programs/atuin/example-settings.nix index f2d3a887691f..98aca707da6b 100644 --- a/tests/modules/programs/atuin/example-settings.nix +++ b/tests/modules/programs/atuin/example-settings.nix @@ -13,7 +13,7 @@ }; test.stubs = { - atuin = { }; + atuin = { name = "atuin"; }; bash-preexec = { }; }; diff --git a/tests/modules/programs/atuin/fish.nix b/tests/modules/programs/atuin/fish.nix index ae3122cf15ff..49d9a2821881 100644 --- a/tests/modules/programs/atuin/fish.nix +++ b/tests/modules/programs/atuin/fish.nix @@ -11,7 +11,7 @@ lib.mkForce (builtins.toFile "empty" ""); test.stubs = { - atuin = { }; + atuin = { name = "atuin"; }; bash-preexec = { }; }; diff --git a/tests/modules/programs/atuin/no-shell.nix b/tests/modules/programs/atuin/no-shell.nix index 381bcc0caaa2..c6481e4276a5 100644 --- a/tests/modules/programs/atuin/no-shell.nix +++ b/tests/modules/programs/atuin/no-shell.nix @@ -18,7 +18,7 @@ lib.mkForce (builtins.toFile "empty" ""); test.stubs = { - atuin = { }; + atuin = { name = "atuin"; }; bash-preexec = { }; }; diff --git a/tests/modules/programs/atuin/set-flags.nix b/tests/modules/programs/atuin/set-flags.nix index 7e3a7982fe22..b6e8330d1395 100644 --- a/tests/modules/programs/atuin/set-flags.nix +++ b/tests/modules/programs/atuin/set-flags.nix @@ -17,7 +17,7 @@ lib.mkForce (builtins.toFile "empty" ""); test.stubs = { - atuin = { }; + atuin = { name = "atuin"; }; bash-preexec = { }; }; diff --git a/tests/modules/programs/atuin/zsh.nix b/tests/modules/programs/atuin/zsh.nix index 14adddcac491..2cb4fefef6d8 100644 --- a/tests/modules/programs/atuin/zsh.nix +++ b/tests/modules/programs/atuin/zsh.nix @@ -7,7 +7,7 @@ }; test.stubs = { - atuin = { }; + atuin = { name = "atuin"; }; bash-preexec = { }; }; From 57d85c6c6d625c45bbf848ed77fbdb5794aa8414 Mon Sep 17 00:00:00 2001 From: Lin Xianyi Date: Thu, 11 Jul 2024 05:13:46 +0800 Subject: [PATCH 365/636] xdg-desktop-entries: allow `terminal` to be null --- modules/misc/xdg-desktop-entries.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/misc/xdg-desktop-entries.nix b/modules/misc/xdg-desktop-entries.nix index 7ec7fa56888c..1aab6ffe7276 100644 --- a/modules/misc/xdg-desktop-entries.nix +++ b/modules/misc/xdg-desktop-entries.nix @@ -51,7 +51,7 @@ let terminal = mkOption { description = "Whether the program runs in a terminal window."; - type = types.bool; + type = types.nullOr types.bool; default = false; }; From c085b984ff2808bf322f375b10fea5a415a9c43d Mon Sep 17 00:00:00 2001 From: Johann Date: Sat, 6 Jul 2024 11:39:39 +0200 Subject: [PATCH 366/636] gnome-keyring: update package `pkgs.gnome.gnome-keyring` has been moved to `pkgs.gnome-keyring` In nixpgkgs-unstable --- modules/services/gnome-keyring.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/gnome-keyring.nix b/modules/services/gnome-keyring.nix index 460e4abd15e6..2cfa33d03852 100644 --- a/modules/services/gnome-keyring.nix +++ b/modules/services/gnome-keyring.nix @@ -49,7 +49,7 @@ in { args = concatStringsSep " " ([ "--start" "--foreground" ] ++ optional (cfg.components != [ ]) ("--components=" + concatStringsSep "," cfg.components)); - in "${pkgs.gnome.gnome-keyring}/bin/gnome-keyring-daemon ${args}"; + in "${pkgs.gnome-keyring}/bin/gnome-keyring-daemon ${args}"; Restart = "on-abort"; }; From 90ae324e2c56af10f20549ab72014804a3064c7f Mon Sep 17 00:00:00 2001 From: Chris Hodapp <108633+clhodapp@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:48:33 -0700 Subject: [PATCH 367/636] sd-switch: respect xdg directory specifications --- modules/systemd.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/systemd.nix b/modules/systemd.nix index d480a1e453ac..717a5922d48f 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -100,6 +100,8 @@ let settingsFormat.generate "user.conf" cfg.settings; }; + configHome = lib.removePrefix config.home.homeDirectory config.xdg.configHome; + in { meta.maintainers = [ lib.maintainers.rycee ]; @@ -355,13 +357,13 @@ in { fi if [[ -v oldGenPath ]]; then - oldUnitsDir="$oldGenPath/home-files/.config/systemd/user" + oldUnitsDir="$oldGenPath/home-files${configHome}/systemd/user" if [[ ! -e $oldUnitsDir ]]; then oldUnitsDir= fi fi - newUnitsDir="$newGenPath/home-files/.config/systemd/user" + newUnitsDir="$newGenPath/home-files${configHome}/systemd/user" if [[ ! -e $newUnitsDir ]]; then newUnitsDir=${pkgs.emptyDirectory} fi From a38f88045e464c7ad5686e8d5fdaac39d3360e5b Mon Sep 17 00:00:00 2001 From: "O. C. Taskin" <42993892+octvs@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:17:37 +0200 Subject: [PATCH 368/636] khard: add option to contact module for khard dir Add an extra option, accounts.contact.accounts..khard.defaultCollection to hardcode a subdirectory for khard to function as intended. Khard expects to be given a collection directory directly, from which there can be multiple of in a vdir. This contrasts khal or vdirsyncer which support recursive search. Fixes #4531 --- modules/programs/khard.nix | 15 +++++++++++-- tests/modules/programs/khard/default.nix | 1 + tests/modules/programs/khard/dirty_path.nix | 22 +++++++++++++++++++ .../programs/khard/dirty_path_expected | 8 +++++++ 4 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 tests/modules/programs/khard/dirty_path.nix create mode 100644 tests/modules/programs/khard/dirty_path_expected diff --git a/modules/programs/khard.nix b/modules/programs/khard.nix index a3e73fb07624..cbd8c1f0792e 100644 --- a/modules/programs/khard.nix +++ b/modules/programs/khard.nix @@ -68,6 +68,11 @@ in { type = with lib.types; attrsOf (submodule { options.khard.enable = lib.mkEnableOption "khard access"; + options.khard.defaultCollection = lib.mkOption { + type = types.str; + default = ""; + description = "VCARD collection to be searched by khard."; + }; }); }; }; @@ -75,11 +80,17 @@ in { config = lib.mkIf cfg.enable { home.packages = [ pkgs.khard ]; - xdg.configFile."khard/khard.conf".text = '' + xdg.configFile."khard/khard.conf".text = let + makePath = anAccount: + builtins.toString (/. + lib.concatStringsSep "/" [ + anAccount.local.path + anAccount.khard.defaultCollection + ]); + in '' [addressbooks] ${lib.concatMapStringsSep "\n" (acc: '' [[${acc.name}]] - path = ${acc.local.path} + path = ${makePath acc} '') (lib.attrValues accounts)} ${renderSettings cfg.settings} diff --git a/tests/modules/programs/khard/default.nix b/tests/modules/programs/khard/default.nix index 3762dc0f1c8b..58b7a6f74082 100644 --- a/tests/modules/programs/khard/default.nix +++ b/tests/modules/programs/khard/default.nix @@ -2,4 +2,5 @@ khard_empty_config = ./empty_config.nix; khard_basic_config = ./basic_config.nix; khard_multiple_accounts = ./multiple_accounts.nix; + khard_dirty_path = ./dirty_path.nix; } diff --git a/tests/modules/programs/khard/dirty_path.nix b/tests/modules/programs/khard/dirty_path.nix new file mode 100644 index 000000000000..07396a1449c3 --- /dev/null +++ b/tests/modules/programs/khard/dirty_path.nix @@ -0,0 +1,22 @@ +{ + accounts.contact = { + basePath = "/home/user/who/likes///"; + accounts.forward = { + local.type = "filesystem"; + khard = { + enable = true; + defaultCollection = "////slashes//a/lot"; + }; + }; + }; + + programs.khard.enable = true; + + test.stubs.khard = { }; + + nmt.script = '' + assertFileContent \ + home-files/.config/khard/khard.conf \ + ${./dirty_path_expected} + ''; +} diff --git a/tests/modules/programs/khard/dirty_path_expected b/tests/modules/programs/khard/dirty_path_expected new file mode 100644 index 000000000000..8b7bb63eb5a2 --- /dev/null +++ b/tests/modules/programs/khard/dirty_path_expected @@ -0,0 +1,8 @@ +[addressbooks] +[[forward]] +path = /home/user/who/likes/forward/slashes/a/lot + + +[general] +default_action=list + From afd2021bedff2de92dfce0e257a3d03ae65c603d Mon Sep 17 00:00:00 2001 From: "O. C. Taskin" <42993892+octvs@users.noreply.github.com> Date: Tue, 16 Jul 2024 15:19:18 +0200 Subject: [PATCH 369/636] papis: add `program.papis.package` option Add `programs.papis.package` option to override default package used. This can be useful to track latest rev from repository via a flake. --- modules/programs/papis.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/papis.nix b/modules/programs/papis.nix index b110172d9ae8..837bfc274422 100644 --- a/modules/programs/papis.nix +++ b/modules/programs/papis.nix @@ -19,6 +19,8 @@ in { options.programs.papis = { enable = mkEnableOption "papis"; + package = mkPackageOption pkgs "papis" { }; + settings = mkOption { type = with types; attrsOf (oneOf [ bool int str ]); default = { }; @@ -84,7 +86,7 @@ in { (", namely " + concatStringsSep "," defaultLibraries); }]; - home.packages = [ pkgs.papis ]; + home.packages = [ cfg.package ]; xdg.configFile."papis/config" = mkIf (cfg.libraries != { }) { text = generators.toINI { } settingsIni; }; From 635563f245309ef5320f80c7ebcb89b2398d2949 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 21 Jul 2024 03:59:25 +0000 Subject: [PATCH 370/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/00d80d13810dbfea8ab4ed1009b09100cca86ba8?narHash=sha256-H3%2BEC5cYuq%2BgQW8y0lSrrDZfH71LB4DAf%2BTDFyvwCNA%3D' (2024-07-01) → 'github:NixOS/nixpkgs/1d9c2c9b3e71b9ee663d11c5d298727dace8d374?narHash=sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0%3D' (2024-07-19) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index b700f2083e1c..685f6f60c93d 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1719848872, - "narHash": "sha256-H3+EC5cYuq+gQW8y0lSrrDZfH71LB4DAf+TDFyvwCNA=", + "lastModified": 1721379653, + "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "00d80d13810dbfea8ab4ed1009b09100cca86ba8", + "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", "type": "github" }, "original": { From 7560dc942a6fbd37ebd1310b3dbda513de2d4b82 Mon Sep 17 00:00:00 2001 From: Amit Aryeh Levy Date: Mon, 22 Jul 2024 09:48:46 -0700 Subject: [PATCH 371/636] kbfs: avoid using PrivateTmp for systemd service The kbfs service does not seem to actually work with a PrivateTmp. A PrivateTmp seems as appropriate for kbfs as anything else, but the upstream service does not use it either --- modules/services/kbfs.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/services/kbfs.nix b/modules/services/kbfs.nix index a541a32ca177..9cfe027522a6 100644 --- a/modules/services/kbfs.nix +++ b/modules/services/kbfs.nix @@ -52,7 +52,6 @@ in { "${pkgs.kbfs}/bin/kbfsfuse ${toString cfg.extraFlags} ${mountPoint}"; ExecStopPost = "/run/wrappers/bin/fusermount -u ${mountPoint}"; Restart = "on-failure"; - PrivateTmp = true; }; Install.WantedBy = [ "default.target" ]; From 465ea1f994a4e2b498b847c35caa205af7b261df Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Wed, 24 Jul 2024 05:37:28 +0000 Subject: [PATCH 372/636] swayosd: avoid restarting too quickly Should fix an issue where swayosd.service would stop without starting again after restarting too quickly. Triggered by ending a Hyprland session and logging in with tuigreet. Related: https://github.com/nix-community/home-manager/pull/4316 --- modules/services/swayosd.nix | 3 +++ tests/modules/services/swayosd/swayosd.nix | 3 +++ 2 files changed, 6 insertions(+) diff --git a/modules/services/swayosd.nix b/modules/services/swayosd.nix index 79ca7f5ee42d..869b48729364 100644 --- a/modules/services/swayosd.nix +++ b/modules/services/swayosd.nix @@ -60,6 +60,8 @@ in { After = [ "graphical-session.target" ]; ConditionEnvironment = "WAYLAND_DISPLAY"; Documentation = "man:swayosd(1)"; + StartLimitBurst = 5; + StartLimitIntervalSec = 10; }; Service = { @@ -71,6 +73,7 @@ in { + (optionalString (cfg.topMargin != null) " --top-margin ${toString cfg.topMargin}"); Restart = "always"; + RestartSec = "2s"; }; Install = { WantedBy = [ "graphical-session.target" ]; }; diff --git a/tests/modules/services/swayosd/swayosd.nix b/tests/modules/services/swayosd/swayosd.nix index 88a7c536253c..1bc7d5354787 100644 --- a/tests/modules/services/swayosd/swayosd.nix +++ b/tests/modules/services/swayosd/swayosd.nix @@ -23,6 +23,7 @@ [Service] ExecStart=@swayosd@/bin/swayosd-server --display DISPLAY --style '/etc/xdg/swayosd/style.css' --top-margin 0.100000 Restart=always + RestartSec=2s Type=simple [Unit] @@ -31,6 +32,8 @@ Description=Volume/backlight OSD indicator Documentation=man:swayosd(1) PartOf=graphical-session.target + StartLimitBurst=5 + StartLimitIntervalSec=10 '' } ''; From af70fc502a15d7e1e4c5a4c4fc8e06c2ec561e0c Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Wed, 24 Jul 2024 08:55:10 +0200 Subject: [PATCH 373/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/1d9c2c9b3e71b9ee663d11c5d298727dace8d374?narHash=sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0%3D' (2024-07-19) → 'github:NixOS/nixpkgs/68c9ed8bbed9dfce253cc91560bf9043297ef2fe?narHash=sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8%3D' (2024-07-21) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 685f6f60c93d..5e97fc2cf127 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1721379653, - "narHash": "sha256-8MUgifkJ7lkZs3u99UDZMB4kbOxvMEXQZ31FO3SopZ0=", + "lastModified": 1721562059, + "narHash": "sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1d9c2c9b3e71b9ee663d11c5d298727dace8d374", + "rev": "68c9ed8bbed9dfce253cc91560bf9043297ef2fe", "type": "github" }, "original": { From 304a011325b7ac7b8c9950333cd215a7aa146b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cezary=20Dro=C5=BCak?= Date: Wed, 27 Mar 2024 19:18:49 +0100 Subject: [PATCH 374/636] firefox: add languagePacks option Port the programs.firefox.languagePacks option from NixOS --- modules/programs/firefox.nix | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index 1370d4c28f0d..3bee6e0bb7a7 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -262,6 +262,18 @@ in { ''; }; + languagePacks = mkOption { + type = types.listOf types.str; + default = [ ]; + description = '' + The language packs to install. Available language codes can be found + on the releases page: + `https://releases.mozilla.org/pub/firefox/releases/''${version}/linux-x86_64/xpi/`, + replacing `''${version}` with the version of Firefox you have. + ''; + example = [ "en-GB" "de" ]; + }; + nativeMessagingHosts = mkOption { type = types.listOf types.package; default = [ ]; @@ -736,6 +748,14 @@ in { message = "Container id must be smaller than 4294967294 (2^32 - 2)"; }) + { + assertion = cfg.languagePacks == [ ] || cfg.package != null; + message = '' + 'programs.firefox.languagePacks' requires 'programs.firefox.package' + to be set to a non-null value. + ''; + } + (mkNoDuplicateAssertion cfg.profiles "profile") ] ++ (mapAttrsToList (_: profile: mkNoDuplicateAssertion profile.containers "container") @@ -750,6 +770,15 @@ in { programs.firefox.finalPackage = wrapPackage cfg.package; + programs.firefox.policies = { + ExtensionSettings = listToAttrs (map (lang: + nameValuePair "langpack-${lang}@firefox.mozilla.org" { + installation_mode = "normal_installed"; + install_url = + "https://releases.mozilla.org/pub/firefox/releases/${cfg.package.version}/linux-x86_64/xpi/${lang}.xpi"; + }) cfg.languagePacks); + }; + home.packages = lib.optional (cfg.finalPackage != null) cfg.finalPackage; home.file = mkMerge ([{ From bc2b96acda50229bc99925dde5c8e561e90b0b00 Mon Sep 17 00:00:00 2001 From: Masum Reza <50095635+JohnRTitor@users.noreply.github.com> Date: Fri, 26 Jul 2024 17:58:33 +0530 Subject: [PATCH 375/636] zsh: add programs.zsh.autosuggestions.strategy option (#5396) defaults to history --- modules/programs/zsh.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 3ec73f30d06a..11d77a164481 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -398,6 +398,22 @@ in {manpage}`zshzle(1)` for syntax. ''; }; + + strategy = mkOption { + type = types.listOf (types.enum [ "history" "completion" "match_prev_cmd" ]); + default = [ "history" ]; + description = '' + `ZSH_AUTOSUGGEST_STRATEGY` is an array that specifies how suggestions should be generated. + The strategies in the array are tried successively until a suggestion is found. + There are currently three built-in strategies to choose from: + + - `history`: Chooses the most recent match from history. + - `completion`: Chooses a suggestion based on what tab-completion would suggest. (requires `zpty` module) + - `match_prev_cmd`: Like `history`, but chooses the most recent match whose preceding history item matches + the most recently executed command. Note that this strategy won't work as expected with ZSH options that + don't preserve the history order such as `HIST_IGNORE_ALL_DUPS` or `HIST_EXPIRE_DUPS_FIRST`. + ''; + }; }; history = mkOption { @@ -610,6 +626,7 @@ in (optionalString cfg.autosuggestion.enable '' source ${pkgs.zsh-autosuggestions}/share/zsh-autosuggestions/zsh-autosuggestions.zsh + ZSH_AUTOSUGGEST_STRATEGY=(${concatStringsSep " " cfg.autosuggestion.strategy}) '') (optionalString (cfg.autosuggestion.enable && cfg.autosuggestion.highlight != null) '' ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="${cfg.autosuggestion.highlight}" From 180158b46ea02f1c8f794367f122e8f2a2e49cf8 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 27 Jul 2024 09:08:30 +0200 Subject: [PATCH 376/636] mcfly: add settings option --- modules/programs/mcfly.nix | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/modules/programs/mcfly.nix b/modules/programs/mcfly.nix index 450a27380c6d..d0dddba21133 100644 --- a/modules/programs/mcfly.nix +++ b/modules/programs/mcfly.nix @@ -5,6 +5,8 @@ let cfg = config.programs.mcfly; + tomlFormat = pkgs.formats.toml { }; + bashIntegration = '' eval "$(${getExe pkgs.mcfly} init bash)" '' + optionalString cfg.fzf.enable '' @@ -40,6 +42,37 @@ in { options.programs.mcfly = { enable = mkEnableOption "mcfly"; + settings = mkOption { + type = tomlFormat.type; + default = { }; + example = literalExpression '' + { + colors = { + menubar = { + bg = "black"; + fg = "red"; + }; + darkmode = { + prompt = "cyan"; + timing = "yellow"; + results_selection_fg = "cyan"; + results_selection_bg = "black"; + results_selection_hl = "red"; + }; + }; + } + ''; + description = '' + Settings written to {file}`~/.config/mcfly/config.toml`. + + Note, if your McFly database is currently in {file}`~/.mcfly`, + then this option has no effect. + Move the database to {file}`$XDG_DATA_DIR/mcfly/history.db` and + remove {file}`~/.mcfly` to make the settings take effect. See + . + ''; + }; + keyScheme = mkOption { type = types.enum [ "emacs" "vim" ]; default = "emacs"; @@ -105,6 +138,11 @@ in { { home.packages = [ pkgs.mcfly ] ++ optional cfg.fzf.enable pkgs.mcfly-fzf; + # Oddly enough, McFly expects this in the data path, not in config. + xdg.dataFile."mcfly/config.toml" = mkIf (cfg.settings != { }) { + source = tomlFormat.generate "mcfly-config.toml" cfg.settings; + }; + programs.bash.initExtra = mkIf cfg.enableBashIntegration bashIntegration; programs.zsh.initExtra = mkIf cfg.enableZshIntegration zshIntegration; From 975b83ca560d17db51a66cb2b0dc0e44213eab27 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 27 Jul 2024 09:35:13 +0200 Subject: [PATCH 377/636] treewide: fix eval after Nixpkgs maintainer changes --- modules/config/home-cursor.nix | 2 +- modules/lib/maintainers.nix | 5 +++++ modules/misc/nix.nix | 2 +- modules/programs/bottom.nix | 2 +- modules/programs/watson.nix | 2 +- modules/services/fnott.nix | 2 +- modules/services/window-managers/i3-sway/swaynag.nix | 2 +- 7 files changed, 11 insertions(+), 6 deletions(-) diff --git a/modules/config/home-cursor.nix b/modules/config/home-cursor.nix index c696908d553b..7699604841a7 100644 --- a/modules/config/home-cursor.nix +++ b/modules/config/home-cursor.nix @@ -67,7 +67,7 @@ let }; in { - meta.maintainers = [ maintainers.polykernel maintainers.league ]; + meta.maintainers = [ hm.maintainers.polykernel maintainers.league ]; imports = [ (mkAliasOptionModule [ "xsession" "pointerCursor" "package" ] [ diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index f1a818155817..6ad7bd187e45 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -445,6 +445,11 @@ github = "podocarp"; githubId = 10473184; }; + polykernel = { + github = "polykernel"; + githubId = 81340136; + name = "polykernel"; + }; mainrs = { name = "mainrs"; email = "5113257+mainrs@users.noreply.github.com"; diff --git a/modules/misc/nix.nix b/modules/misc/nix.nix index 2daa56b237b3..668d44a18c2e 100644 --- a/modules/misc/nix.nix +++ b/modules/misc/nix.nix @@ -311,5 +311,5 @@ in { }) ]); - meta.maintainers = [ maintainers.polykernel ]; + meta.maintainers = [ lib.hm.maintainers.polykernel ]; } diff --git a/modules/programs/bottom.nix b/modules/programs/bottom.nix index 810307b149c2..91d172ad2395 100644 --- a/modules/programs/bottom.nix +++ b/modules/programs/bottom.nix @@ -56,5 +56,5 @@ in { }; }; - meta.maintainers = [ maintainers.polykernel ]; + meta.maintainers = [ hm.maintainers.polykernel ]; } diff --git a/modules/programs/watson.nix b/modules/programs/watson.nix index b30dec09603c..5d0f4b7b3c74 100644 --- a/modules/programs/watson.nix +++ b/modules/programs/watson.nix @@ -14,7 +14,7 @@ let config.xdg.configHome; in { - meta.maintainers = [ maintainers.polykernel ]; + meta.maintainers = [ hm.maintainers.polykernel ]; options.programs.watson = { enable = mkEnableOption "watson, a wonderful CLI to track your time"; diff --git a/modules/services/fnott.nix b/modules/services/fnott.nix index 3d2d1dd8a028..a8d7a6370cf8 100644 --- a/modules/services/fnott.nix +++ b/modules/services/fnott.nix @@ -9,7 +9,7 @@ let iniFormat = pkgs.formats.ini { }; in { - meta.maintainers = with maintainers; [ polykernel ]; + meta.maintainers = [ hm.maintainers.polykernel ]; options = { services.fnott = { diff --git a/modules/services/window-managers/i3-sway/swaynag.nix b/modules/services/window-managers/i3-sway/swaynag.nix index fcdedd3d8721..c3f4d535d1ed 100644 --- a/modules/services/window-managers/i3-sway/swaynag.nix +++ b/modules/services/window-managers/i3-sway/swaynag.nix @@ -14,7 +14,7 @@ let }; in attrsOf confAtom; in { - meta.maintainers = with maintainers; [ polykernel ]; + meta.maintainers = [ hm.maintainers.polykernel ]; options = { wayland.windowManager.sway.swaynag = { From d0240a064db3987eb4d5204cf2400bc4452d9922 Mon Sep 17 00:00:00 2001 From: Tomodachi94 Date: Wed, 24 Jul 2024 16:36:17 -0700 Subject: [PATCH 378/636] gnome-terminal: update package name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `pkgs.gnome.gnome-terminal` package was moved to `pkgs.gnome-terminal`. The former is now a deprecated alias that throws a warning whenever a configuration enabling the module is used: ``` The ‘gnome.gnome-terminal’ was moved to top-level. Please use ‘pkgs.gnome-terminal’ directly. ``` Related: https://github.com/NixOS/nixpkgs/pull/319659 Related: https://github.com/nix-community/home-manager/pull/5611 --- modules/programs/gnome-terminal.nix | 2 +- tests/modules/programs/gnome-terminal/bad-profile-name.nix | 5 ++--- tests/modules/programs/gnome-terminal/gnome-terminal-1.nix | 4 +--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/programs/gnome-terminal.nix b/modules/programs/gnome-terminal.nix index 83cfc0274039..dafadb7e9409 100644 --- a/modules/programs/gnome-terminal.nix +++ b/modules/programs/gnome-terminal.nix @@ -316,7 +316,7 @@ in { }) ]; - home.packages = [ pkgs.gnome.gnome-terminal ]; + home.packages = [ pkgs.gnome-terminal ]; dconf.settings = let dconfPath = "org/gnome/terminal/legacy"; in { diff --git a/tests/modules/programs/gnome-terminal/bad-profile-name.nix b/tests/modules/programs/gnome-terminal/bad-profile-name.nix index ebd85440604c..308b9306efd0 100644 --- a/tests/modules/programs/gnome-terminal/bad-profile-name.nix +++ b/tests/modules/programs/gnome-terminal/bad-profile-name.nix @@ -13,9 +13,8 @@ }; }; - nixpkgs.overlays = [ - (self: super: { gnome.gnome-terminal = config.lib.test.mkStubPackage { }; }) - ]; + nixpkgs.overlays = + [ (self: super: { gnome-terminal = config.lib.test.mkStubPackage { }; }) ]; test.stubs.dconf = { }; diff --git a/tests/modules/programs/gnome-terminal/gnome-terminal-1.nix b/tests/modules/programs/gnome-terminal/gnome-terminal-1.nix index bb58983feb45..6dab6a2b4b64 100644 --- a/tests/modules/programs/gnome-terminal/gnome-terminal-1.nix +++ b/tests/modules/programs/gnome-terminal/gnome-terminal-1.nix @@ -49,9 +49,7 @@ with lib; }; nixpkgs.overlays = [ - (self: super: { - gnome.gnome-terminal = config.lib.test.mkStubPackage { }; - }) + (self: super: { gnome-terminal = config.lib.test.mkStubPackage { }; }) ]; test.stubs.dconf = { }; From cd520fbd31934deaa1cda11297a99ef1fa369dbf Mon Sep 17 00:00:00 2001 From: polykernel <81340136+polykernel@users.noreply.github.com> Date: Sun, 28 Jul 2024 11:58:33 -0400 Subject: [PATCH 379/636] maintainers: remove polykernel --- modules/config/home-cursor.nix | 2 +- modules/lib/maintainers.nix | 5 ----- modules/misc/nix.nix | 2 +- modules/programs/bottom.nix | 2 +- modules/programs/watson.nix | 2 +- modules/services/fnott.nix | 2 +- modules/services/window-managers/i3-sway/swaynag.nix | 2 +- 7 files changed, 6 insertions(+), 11 deletions(-) diff --git a/modules/config/home-cursor.nix b/modules/config/home-cursor.nix index 7699604841a7..cb9a2ab28159 100644 --- a/modules/config/home-cursor.nix +++ b/modules/config/home-cursor.nix @@ -67,7 +67,7 @@ let }; in { - meta.maintainers = [ hm.maintainers.polykernel maintainers.league ]; + meta.maintainers = [ maintainers.league ]; imports = [ (mkAliasOptionModule [ "xsession" "pointerCursor" "package" ] [ diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 6ad7bd187e45..f1a818155817 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -445,11 +445,6 @@ github = "podocarp"; githubId = 10473184; }; - polykernel = { - github = "polykernel"; - githubId = 81340136; - name = "polykernel"; - }; mainrs = { name = "mainrs"; email = "5113257+mainrs@users.noreply.github.com"; diff --git a/modules/misc/nix.nix b/modules/misc/nix.nix index 668d44a18c2e..652d3eb89179 100644 --- a/modules/misc/nix.nix +++ b/modules/misc/nix.nix @@ -311,5 +311,5 @@ in { }) ]); - meta.maintainers = [ lib.hm.maintainers.polykernel ]; + meta.maintainers = [ ]; } diff --git a/modules/programs/bottom.nix b/modules/programs/bottom.nix index 91d172ad2395..fd18fe0db278 100644 --- a/modules/programs/bottom.nix +++ b/modules/programs/bottom.nix @@ -56,5 +56,5 @@ in { }; }; - meta.maintainers = [ hm.maintainers.polykernel ]; + meta.maintainers = [ ]; } diff --git a/modules/programs/watson.nix b/modules/programs/watson.nix index 5d0f4b7b3c74..c842c519a997 100644 --- a/modules/programs/watson.nix +++ b/modules/programs/watson.nix @@ -14,7 +14,7 @@ let config.xdg.configHome; in { - meta.maintainers = [ hm.maintainers.polykernel ]; + meta.maintainers = [ ]; options.programs.watson = { enable = mkEnableOption "watson, a wonderful CLI to track your time"; diff --git a/modules/services/fnott.nix b/modules/services/fnott.nix index a8d7a6370cf8..ecbd0fd15974 100644 --- a/modules/services/fnott.nix +++ b/modules/services/fnott.nix @@ -9,7 +9,7 @@ let iniFormat = pkgs.formats.ini { }; in { - meta.maintainers = [ hm.maintainers.polykernel ]; + meta.maintainers = [ ]; options = { services.fnott = { diff --git a/modules/services/window-managers/i3-sway/swaynag.nix b/modules/services/window-managers/i3-sway/swaynag.nix index c3f4d535d1ed..924521f777af 100644 --- a/modules/services/window-managers/i3-sway/swaynag.nix +++ b/modules/services/window-managers/i3-sway/swaynag.nix @@ -14,7 +14,7 @@ let }; in attrsOf confAtom; in { - meta.maintainers = [ hm.maintainers.polykernel ]; + meta.maintainers = [ ]; options = { wayland.windowManager.sway.swaynag = { From 9fdadb1cb65093015fc8cd65a592c983b490c75c Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 28 Jul 2024 22:43:01 +0200 Subject: [PATCH 380/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/68c9ed8bbed9dfce253cc91560bf9043297ef2fe?narHash=sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8%3D' (2024-07-21) → 'github:NixOS/nixpkgs/b73c2221a46c13557b1b3be9c2070cc42cf01eb3?narHash=sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg%3D' (2024-07-27) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 5e97fc2cf127..3ba1333a1216 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1721562059, - "narHash": "sha256-Tybxt65eyOARf285hMHIJ2uul8SULjFZbT9ZaEeUnP8=", + "lastModified": 1722062969, + "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "68c9ed8bbed9dfce253cc91560bf9043297ef2fe", + "rev": "b73c2221a46c13557b1b3be9c2070cc42cf01eb3", "type": "github" }, "original": { From ea72cf548fafb2876232a3ae22fcc03d5fb354de Mon Sep 17 00:00:00 2001 From: Milo Moisson Date: Sun, 28 Jul 2024 22:54:29 +0200 Subject: [PATCH 381/636] jujutsu: support darwin guidelines for config placement Follow up to #5207, fixing jujutsu module on darwin targets. --- modules/programs/jujutsu.nix | 7 ++++++- tests/modules/programs/jujutsu/empty-config.nix | 9 ++++++--- tests/modules/programs/jujutsu/example-config.nix | 12 +++++++----- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/modules/programs/jujutsu.nix b/modules/programs/jujutsu.nix index a21c71087273..f0e1b425010f 100644 --- a/modules/programs/jujutsu.nix +++ b/modules/programs/jujutsu.nix @@ -7,6 +7,11 @@ let cfg = config.programs.jujutsu; tomlFormat = pkgs.formats.toml { }; + configDir = if pkgs.stdenv.isDarwin then + "Library/Application Support" + else + config.xdg.configHome; + in { meta.maintainers = [ maintainers.shikanime ]; @@ -51,7 +56,7 @@ in { config = mkIf cfg.enable { home.packages = [ cfg.package ]; - xdg.configFile."jj/config.toml" = mkIf (cfg.settings != { }) { + home.file."${configDir}/jj/config.toml" = mkIf (cfg.settings != { }) { source = tomlFormat.generate "jujutsu-config" (cfg.settings // optionalAttrs (cfg.ediff) (let emacsDiffScript = pkgs.writeShellScriptBin "emacs-ediff" '' diff --git a/tests/modules/programs/jujutsu/empty-config.nix b/tests/modules/programs/jujutsu/empty-config.nix index 10dd12589d30..55b5d87e87b1 100644 --- a/tests/modules/programs/jujutsu/empty-config.nix +++ b/tests/modules/programs/jujutsu/empty-config.nix @@ -1,11 +1,14 @@ -{ ... }: +{ pkgs, ... }: -{ +let + configDir = + if pkgs.stdenv.isDarwin then "Library/Application Support" else ".config"; +in { programs.jujutsu.enable = true; test.stubs.jujutsu = { }; nmt.script = '' - assertPathNotExists home-files/.config/jj/config.toml + assertPathNotExists 'home-files/${configDir}/jj/config.toml' ''; } diff --git a/tests/modules/programs/jujutsu/example-config.nix b/tests/modules/programs/jujutsu/example-config.nix index d83b552b22a0..029187786c23 100644 --- a/tests/modules/programs/jujutsu/example-config.nix +++ b/tests/modules/programs/jujutsu/example-config.nix @@ -1,6 +1,9 @@ -{ config, ... }: +{ pkgs, config, ... }: -{ +let + configDir = + if pkgs.stdenv.isDarwin then "Library/Application Support" else ".config"; +in { programs.jujutsu = { enable = true; package = config.lib.test.mkStubPackage { }; @@ -13,9 +16,8 @@ }; nmt.script = '' - assertFileExists home-files/.config/jj/config.toml - assertFileContent \ - home-files/.config/jj/config.toml \ + assertFileExists 'home-files/${configDir}/jj/config.toml' + assertFileContent 'home-files/${configDir}/jj/config.toml' \ ${ builtins.toFile "expected.toml" '' [user] From a11cfcd0a18fdf6257808da631a956800af764bf Mon Sep 17 00:00:00 2001 From: nikitax44 <49244351+nikitax44@users.noreply.github.com> Date: Mon, 29 Jul 2024 02:00:57 +0500 Subject: [PATCH 382/636] micro: add package option --- modules/programs/micro.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/micro.nix b/modules/programs/micro.nix index 0093e25f0a80..bf34f8e62c8a 100644 --- a/modules/programs/micro.nix +++ b/modules/programs/micro.nix @@ -15,6 +15,8 @@ in { programs.micro = { enable = mkEnableOption "micro, a terminal-based text editor"; + package = mkPackageOption pkgs "micro" { }; + settings = mkOption { type = jsonFormat.type; default = { }; @@ -35,7 +37,7 @@ in { }; config = mkIf cfg.enable { - home.packages = [ pkgs.micro ]; + home.packages = [ cfg.package ]; xdg.configFile."micro/settings.json".source = jsonFormat.generate "micro-settings" cfg.settings; From 587fcca66e9d11c8e2357053c096a8a727c120ab Mon Sep 17 00:00:00 2001 From: Jean Sidharta Date: Sun, 28 Jul 2024 21:37:02 +0000 Subject: [PATCH 383/636] eww: add terminal integration options Use eww's shell-completions command to generate completions for bash, zsh and fish. --- modules/programs/eww.nix | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/modules/programs/eww.nix b/modules/programs/eww.nix index 3d178f9420aa..75a109226c79 100644 --- a/modules/programs/eww.nix +++ b/modules/programs/eww.nix @@ -5,6 +5,7 @@ with lib; let cfg = config.programs.eww; + ewwCmd = "${cfg.package}/bin/eww"; in { meta.maintainers = [ hm.maintainers.mainrs ]; @@ -30,10 +31,40 @@ in { {file}`$XDG_CONFIG_HOME/eww`. ''; }; + + enableBashIntegration = mkEnableOption "Bash integration" // { + default = true; + }; + + enableZshIntegration = mkEnableOption "Zsh integration" // { + default = true; + }; + + enableFishIntegration = mkEnableOption "Fish integration" // { + default = true; + }; }; config = mkIf cfg.enable { home.packages = [ cfg.package ]; xdg.configFile."eww".source = cfg.configDir; + + programs.bash.initExtra = mkIf cfg.enableBashIntegration '' + if [[ $TERM != "dumb" ]]; then + eval "$(${ewwCmd} shell-completions --shell bash)" + fi + ''; + + programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' + if [[ $TERM != "dumb" ]]; then + eval "$(${ewwCmd} shell-completions --shell zsh)" + fi + ''; + + programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration '' + if test "$TERM" != "dumb" + eval "$(${ewwCmd} shell-completions --shell fish)" + end + ''; }; } From 792757f643cedc13f02098d8ed506d82e19ec1da Mon Sep 17 00:00:00 2001 From: bricked Date: Wed, 13 Mar 2024 00:20:41 +0100 Subject: [PATCH 384/636] firefox: support firefox derivatives Adds support for Firefox forks by introducing methods that create generic configs and options. Additional configs and options can be added in separate modules. --- modules/lib/maintainers.nix | 6 + modules/programs/firefox.nix | 979 +--------------- modules/programs/firefox/mkFirefoxModule.nix | 1017 +++++++++++++++++ tests/default.nix | 2 +- .../firefox/container-id-out-of-range.nix | 37 +- tests/modules/programs/firefox/default.nix | 9 - .../firefox/deprecated-native-messenger.nix | 27 +- .../firefox/duplicate-container-ids.nix | 55 +- .../firefox/duplicate-profile-ids.nix | 35 +- tests/modules/programs/firefox/firefox.nix | 11 + tests/modules/programs/firefox/policies.nix | 31 +- .../programs/firefox/profile-settings.nix | 303 ++--- .../firefox/setup-firefox-mock-overlay.nix | 28 +- .../programs/firefox/state-version-19_09.nix | 19 +- 14 files changed, 1356 insertions(+), 1203 deletions(-) create mode 100644 modules/programs/firefox/mkFirefoxModule.nix delete mode 100644 tests/modules/programs/firefox/default.nix create mode 100644 tests/modules/programs/firefox/firefox.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index f1a818155817..9793d5c3f6b5 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -49,6 +49,12 @@ github = "bertof"; githubId = 9915675; }; + bricked = { + name = "Bricked"; + email = "hello@bricked.dev"; + github = "brckd"; + githubId = 92804487; + }; CarlosLoboxyz = { name = "Carlos Lobo"; email = "86011416+CarlosLoboxyz@users.noreply.github.com"; diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index 3bee6e0bb7a7..ac85990ff237 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -1,974 +1,51 @@ -{ config, lib, pkgs, ... }: +{ lib, ... }: with lib; let - inherit (pkgs.stdenv.hostPlatform) isDarwin; + modulePath = [ "programs" "firefox" ]; - cfg = config.programs.firefox; + moduleName = concatStringsSep "." modulePath; - jsonFormat = pkgs.formats.json { }; + mkFirefoxModule = import ./firefox/mkFirefoxModule.nix; - mozillaConfigPath = - if isDarwin then "Library/Application Support/Mozilla" else ".mozilla"; - - firefoxConfigPath = if isDarwin then - "Library/Application Support/Firefox" - else - "${mozillaConfigPath}/firefox"; - - profilesPath = - if isDarwin then "${firefoxConfigPath}/Profiles" else firefoxConfigPath; - - nativeMessagingHostsPath = if isDarwin then - "${mozillaConfigPath}/NativeMessagingHosts" - else - "${mozillaConfigPath}/native-messaging-hosts"; - - nativeMessagingHostsJoined = pkgs.symlinkJoin { - name = "ff_native-messaging-hosts"; - paths = [ - # Link a .keep file to keep the directory around - (pkgs.writeTextDir "lib/mozilla/native-messaging-hosts/.keep" "") - # Link package configured native messaging hosts (entire Firefox actually) - cfg.finalPackage - ] - # Link user configured native messaging hosts - ++ cfg.nativeMessagingHosts; - }; - - # The extensions path shared by all profiles; will not be supported - # by future Firefox versions. - extensionPath = "extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"; - - profiles = flip mapAttrs' cfg.profiles (_: profile: - nameValuePair "Profile${toString profile.id}" { - Name = profile.name; - Path = if isDarwin then "Profiles/${profile.path}" else profile.path; - IsRelative = 1; - Default = if profile.isDefault then 1 else 0; - }) // { - General = { StartWithLastProfile = 1; }; - }; - - profilesIni = generators.toINI { } profiles; - - userPrefValue = pref: - builtins.toJSON (if isBool pref || isInt pref || isString pref then - pref - else - builtins.toJSON pref); - - mkUserJs = prefs: extraPrefs: bookmarks: - let - prefs' = lib.optionalAttrs ([ ] != bookmarks) { - "browser.bookmarks.file" = toString (firefoxBookmarksFile bookmarks); - "browser.places.importBookmarksHTML" = true; - } // prefs; - in '' - // Generated by Home Manager. - - ${concatStrings (mapAttrsToList (name: value: '' - user_pref("${name}", ${userPrefValue value}); - '') prefs')} +in { + meta.maintainers = + [ maintainers.rycee maintainers.kira-bruneau hm.maintainers.bricked ]; - ${extraPrefs} - ''; + imports = [ + (mkFirefoxModule { + inherit modulePath; + name = "Firefox"; + wrappedPackageName = "firefox"; + unwrappedPackageName = "firefox-unwrapped"; + visible = true; - mkContainersJson = containers: - let - containerToIdentity = _: container: { - userContextId = container.id; - name = container.name; - icon = container.icon; - color = container.color; - public = true; + platforms.linux = rec { + vendorPath = ".mozilla"; + configPath = "${vendorPath}/firefox"; }; - in '' - ${builtins.toJSON { - version = 4; - lastUserContextId = - elemAt (mapAttrsToList (_: container: container.id) containers) 0; - identities = mapAttrsToList containerToIdentity containers ++ [ - { - userContextId = 4294967294; # 2^32 - 2 - name = "userContextIdInternal.thumbnail"; - icon = ""; - color = ""; - accessKey = ""; - public = false; - } - { - userContextId = 4294967295; # 2^32 - 1 - name = "userContextIdInternal.webextStorageLocal"; - icon = ""; - color = ""; - accessKey = ""; - public = false; - } - ]; - }} - ''; - - firefoxBookmarksFile = bookmarks: - let - indent = level: - lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level)); - - bookmarkToHTML = indentLevel: bookmark: - '' - ${indent indentLevel}
${escapeXML bookmark.name}''; - - directoryToHTML = indentLevel: directory: '' - ${indent indentLevel}
${ - if directory.toolbar then - '' -

Bookmarks Toolbar'' - else - ''

${escapeXML directory.name}'' - }

- ${indent indentLevel}

- ${allItemsToHTML (indentLevel + 1) directory.bookmarks} - ${indent indentLevel}

''; - - itemToHTMLOrRecurse = indentLevel: item: - if item ? "url" then - bookmarkToHTML indentLevel item - else - directoryToHTML indentLevel item; - - allItemsToHTML = indentLevel: bookmarks: - lib.concatStringsSep "\n" - (map (itemToHTMLOrRecurse indentLevel) bookmarks); - - bookmarkEntries = allItemsToHTML 1 bookmarks; - in pkgs.writeText "firefox-bookmarks.html" '' - - - - Bookmarks -

Bookmarks Menu

-

- ${bookmarkEntries} -

- ''; - - mkNoDuplicateAssertion = entities: entityKind: - (let - # Return an attribute set with entity IDs as keys and a list of - # entity names with corresponding ID as value. An ID is present in - # the result only if more than one entity has it. The argument - # entities is a list of AttrSet of one id/name pair. - findDuplicateIds = entities: - filterAttrs (_entityId: entityNames: length entityNames != 1) - (zipAttrs entities); - - duplicates = findDuplicateIds (mapAttrsToList - (entityName: entity: { "${toString entity.id}" = entityName; }) - entities); - - mkMsg = entityId: entityNames: - " - ID ${entityId} is used by " + concatStringsSep ", " entityNames; - in { - assertion = duplicates == { }; - message = '' - Must not have a Firefox ${entityKind} with an existing ID but - '' + concatStringsSep "\n" (mapAttrsToList mkMsg duplicates); - }); - - wrapPackage = package: - let - # The configuration expected by the Firefox wrapper. - fcfg = { enableGnomeExtensions = cfg.enableGnomeExtensions; }; - - # A bit of hackery to force a config into the wrapper. - browserName = - package.browserName or (builtins.parseDrvName package.name).name; - - # The configuration expected by the Firefox wrapper builder. - bcfg = setAttrByPath [ browserName ] fcfg; - - in if package == null then - null - else if isDarwin then - package - else if versionAtLeast config.home.stateVersion "19.09" then - package.override (old: { - cfg = old.cfg or { } // fcfg; - extraPolicies = (old.extraPolicies or { }) // cfg.policies; - }) - else - (pkgs.wrapFirefox.override { config = bcfg; }) package { }; - -in { - meta.maintainers = [ maintainers.rycee maintainers.kira-bruneau ]; + platforms.darwin = { + vendorPath = "Library/Application Support/Mozilla"; + configPath = "Library/Application Support/Firefox"; + }; + }) - imports = [ - (mkRemovedOptionModule [ "programs" "firefox" "extensions" ] '' + (mkRemovedOptionModule (modulePath ++ [ "extensions" ]) '' Extensions are now managed per-profile. That is, change from - programs.firefox.extensions = [ foo bar ]; + ${moduleName}.extensions = [ foo bar ]; to - programs.firefox.profiles.myprofile.extensions = [ foo bar ];'') - (mkRemovedOptionModule [ "programs" "firefox" "enableAdobeFlash" ] + ${moduleName}.profiles.myprofile.extensions = [ foo bar ];'') + (mkRemovedOptionModule (modulePath ++ [ "enableAdobeFlash" ]) "Support for this option has been removed.") - (mkRemovedOptionModule [ "programs" "firefox" "enableGoogleTalk" ] + (mkRemovedOptionModule (modulePath ++ [ "enableGoogleTalk" ]) "Support for this option has been removed.") - (mkRemovedOptionModule [ "programs" "firefox" "enableIcedTea" ] + (mkRemovedOptionModule (modulePath ++ [ "enableIcedTea" ]) "Support for this option has been removed.") ]; - - options = { - programs.firefox = { - enable = mkEnableOption "Firefox"; - - package = mkOption { - type = with types; nullOr package; - default = if versionAtLeast config.home.stateVersion "19.09" then - pkgs.firefox - else - pkgs.firefox-unwrapped; - defaultText = literalExpression "pkgs.firefox"; - example = literalExpression '' - pkgs.firefox.override { - # See nixpkgs' firefox/wrapper.nix to check which options you can use - nativeMessagingHosts = [ - # Gnome shell native connector - pkgs.gnome-browser-connector - # Tridactyl native connector - pkgs.tridactyl-native - ]; - } - ''; - description = '' - The Firefox package to use. If state version ≥ 19.09 then - this should be a wrapped Firefox package. For earlier state - versions it should be an unwrapped Firefox package. - Set to `null` to disable installing Firefox. - ''; - }; - - languagePacks = mkOption { - type = types.listOf types.str; - default = [ ]; - description = '' - The language packs to install. Available language codes can be found - on the releases page: - `https://releases.mozilla.org/pub/firefox/releases/''${version}/linux-x86_64/xpi/`, - replacing `''${version}` with the version of Firefox you have. - ''; - example = [ "en-GB" "de" ]; - }; - - nativeMessagingHosts = mkOption { - type = types.listOf types.package; - default = [ ]; - description = '' - Additional packages containing native messaging hosts that should be - made available to Firefox extensions. - ''; - }; - - finalPackage = mkOption { - type = with types; nullOr package; - readOnly = true; - description = "Resulting Firefox package."; - }; - - policies = mkOption { - type = types.attrsOf jsonFormat.type; - default = { }; - description = - "[See list of policies](https://mozilla.github.io/policy-templates/)."; - example = { - DefaultDownloadDirectory = "\${home}/Downloads"; - BlockAboutConfig = true; - }; - }; - - profiles = mkOption { - type = types.attrsOf (types.submodule ({ config, name, ... }: { - options = { - name = mkOption { - type = types.str; - default = name; - description = "Profile name."; - }; - - id = mkOption { - type = types.ints.unsigned; - default = 0; - description = '' - Profile ID. This should be set to a unique number per profile. - ''; - }; - - settings = mkOption { - type = types.attrsOf (jsonFormat.type // { - description = - "Firefox preference (int, bool, string, and also attrs, list, float as a JSON string)"; - }); - default = { }; - example = literalExpression '' - { - "browser.startup.homepage" = "https://nixos.org"; - "browser.search.region" = "GB"; - "browser.search.isUS" = false; - "distribution.searchplugins.defaultLocale" = "en-GB"; - "general.useragent.locale" = "en-GB"; - "browser.bookmarks.showMobileBookmarks" = true; - "browser.newtabpage.pinned" = [{ - title = "NixOS"; - url = "https://nixos.org"; - }]; - } - ''; - description = '' - Attribute set of Firefox preferences. - - Firefox only supports int, bool, and string types for - preferences, but home-manager will automatically - convert all other JSON-compatible values into strings. - ''; - }; - - extraConfig = mkOption { - type = types.lines; - default = ""; - description = '' - Extra preferences to add to {file}`user.js`. - ''; - }; - - userChrome = mkOption { - type = types.lines; - default = ""; - description = "Custom Firefox user chrome CSS."; - example = '' - /* Hide tab bar in FF Quantum */ - @-moz-document url("chrome://browser/content/browser.xul") { - #TabsToolbar { - visibility: collapse !important; - margin-bottom: 21px !important; - } - - #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header { - visibility: collapse !important; - } - } - ''; - }; - - userContent = mkOption { - type = types.lines; - default = ""; - description = "Custom Firefox user content CSS."; - example = '' - /* Hide scrollbar in FF Quantum */ - *{scrollbar-width:none !important} - ''; - }; - - bookmarks = mkOption { - type = let - bookmarkSubmodule = types.submodule ({ config, name, ... }: { - options = { - name = mkOption { - type = types.str; - default = name; - description = "Bookmark name."; - }; - - tags = mkOption { - type = types.listOf types.str; - default = [ ]; - description = "Bookmark tags."; - }; - - keyword = mkOption { - type = types.nullOr types.str; - default = null; - description = "Bookmark search keyword."; - }; - - url = mkOption { - type = types.str; - description = "Bookmark url, use %s for search terms."; - }; - }; - }) // { - description = "bookmark submodule"; - }; - - bookmarkType = types.addCheck bookmarkSubmodule (x: x ? "url"); - - directoryType = types.submodule ({ config, name, ... }: { - options = { - name = mkOption { - type = types.str; - default = name; - description = "Directory name."; - }; - - bookmarks = mkOption { - type = types.listOf nodeType; - default = [ ]; - description = "Bookmarks within directory."; - }; - - toolbar = mkOption { - type = types.bool; - default = false; - description = '' - Make this the toolbar directory. Note, this does _not_ - mean that this directory will be added to the toolbar, - this directory _is_ the toolbar. - ''; - }; - }; - }) // { - description = "directory submodule"; - }; - - nodeType = types.either bookmarkType directoryType; - in with types; - coercedTo (attrsOf nodeType) attrValues (listOf nodeType); - default = [ ]; - example = literalExpression '' - [ - { - name = "wikipedia"; - tags = [ "wiki" ]; - keyword = "wiki"; - url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; - } - { - name = "kernel.org"; - url = "https://www.kernel.org"; - } - { - name = "Nix sites"; - toolbar = true; - bookmarks = [ - { - name = "homepage"; - url = "https://nixos.org/"; - } - { - name = "wiki"; - tags = [ "wiki" "nix" ]; - url = "https://wiki.nixos.org/"; - } - ]; - } - ] - ''; - description = '' - Preloaded bookmarks. Note, this may silently overwrite any - previously existing bookmarks! - ''; - }; - - path = mkOption { - type = types.str; - default = name; - description = "Profile path."; - }; - - isDefault = mkOption { - type = types.bool; - default = config.id == 0; - defaultText = "true if profile ID is 0"; - description = "Whether this is a default profile."; - }; - - search = { - force = mkOption { - type = with types; bool; - default = false; - description = '' - Whether to force replace the existing search - configuration. This is recommended since Firefox will - replace the symlink for the search configuration on every - launch, but note that you'll lose any existing - configuration by enabling this. - ''; - }; - - default = mkOption { - type = with types; nullOr str; - default = null; - example = "DuckDuckGo"; - description = '' - The default search engine used in the address bar and search bar. - ''; - }; - - privateDefault = mkOption { - type = with types; nullOr str; - default = null; - example = "DuckDuckGo"; - description = '' - The default search engine used in the Private Browsing. - ''; - }; - - order = mkOption { - type = with types; uniq (listOf str); - default = [ ]; - example = [ "DuckDuckGo" "Google" ]; - description = '' - The order the search engines are listed in. Any engines - that aren't included in this list will be listed after - these in an unspecified order. - ''; - }; - - engines = mkOption { - type = with types; attrsOf (attrsOf jsonFormat.type); - default = { }; - example = literalExpression '' - { - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; - - icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@np" ]; - }; - - "NixOS Wiki" = { - urls = [{ template = "https://wiki.nixos.org/index.php?search={searchTerms}"; }]; - iconUpdateURL = "https://wiki.nixos.org/favicon.png"; - updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ "@nw" ]; - }; - - "Bing".metaData.hidden = true; - "Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias - } - ''; - description = '' - Attribute set of search engine configurations. Engines - that only have {var}`metaData` specified will - be treated as builtin to Firefox. - - See [SearchEngine.jsm](https://searchfox.org/mozilla-central/rev/669329e284f8e8e2bb28090617192ca9b4ef3380/toolkit/components/search/SearchEngine.jsm#1138-1177) - in Firefox's source for available options. We maintain a - mapping to let you specify all options in the referenced - link without underscores, but it may fall out of date with - future options. - - Note, {var}`icon` is also a special option - added by Home Manager to make it convenient to specify - absolute icon paths. - ''; - }; - }; - - containersForce = mkOption { - type = types.bool; - default = false; - description = '' - Whether to force replace the existing containers - configuration. This is recommended since Firefox will - replace the symlink on every launch, but note that you'll - lose any existing configuration by enabling this. - ''; - }; - - containers = mkOption { - type = types.attrsOf (types.submodule ({ name, ... }: { - options = { - name = mkOption { - type = types.str; - default = name; - description = "Container name, e.g., shopping."; - }; - - id = mkOption { - type = types.ints.unsigned; - default = 0; - description = '' - Container ID. This should be set to a unique number per container in this profile. - ''; - }; - - # List of colors at - # https://searchfox.org/mozilla-central/rev/5ad226c7379b0564c76dc3b54b44985356f94c5a/toolkit/components/extensions/parent/ext-contextualIdentities.js#32 - color = mkOption { - type = types.enum [ - "blue" - "turquoise" - "green" - "yellow" - "orange" - "red" - "pink" - "purple" - "toolbar" - ]; - default = "pink"; - description = "Container color."; - }; - - icon = mkOption { - type = types.enum [ - "briefcase" - "cart" - "circle" - "dollar" - "fence" - "fingerprint" - "gift" - "vacation" - "food" - "fruit" - "pet" - "tree" - "chill" - ]; - default = "fruit"; - description = "Container icon."; - }; - }; - })); - default = { }; - example = { - "shopping" = { - id = 1; - color = "blue"; - icon = "cart"; - }; - "dangerous" = { - id = 2; - color = "red"; - icon = "fruit"; - }; - }; - description = '' - Attribute set of container configurations. See - [Multi-Account - Containers](https://support.mozilla.org/en-US/kb/containers) - for more information. - ''; - }; - - extensions = mkOption { - type = types.listOf types.package; - default = [ ]; - example = literalExpression '' - with pkgs.nur.repos.rycee.firefox-addons; [ - privacy-badger - ] - ''; - description = '' - List of Firefox add-on packages to install for this profile. - Some pre-packaged add-ons are accessible from the - [Nix User Repository](https://github.com/nix-community/NUR). - Once you have NUR installed run - - ```console - $ nix-env -f '' -qaP -A nur.repos.rycee.firefox-addons - ``` - - to list the available Firefox add-ons. - - Note that it is necessary to manually enable these extensions - inside Firefox after the first installation. - - To automatically enable extensions add - `"extensions.autoDisableScopes" = 0;` - to - [{option}`programs.firefox.profiles..settings`](#opt-programs.firefox.profiles._name_.settings) - ''; - }; - - }; - })); - default = { }; - description = "Attribute set of Firefox profiles."; - }; - - enableGnomeExtensions = mkOption { - type = types.bool; - default = false; - description = '' - Whether to enable the GNOME Shell native host connector. Note, you - also need to set the NixOS option - `services.gnome.gnome-browser-connector.enable` to - `true`. - ''; - }; - }; - }; - - config = mkIf cfg.enable { - assertions = [ - (let - defaults = - catAttrs "name" (filter (a: a.isDefault) (attrValues cfg.profiles)); - in { - assertion = cfg.profiles == { } || length defaults == 1; - message = "Must have exactly one default Firefox profile but found " - + toString (length defaults) + optionalString (length defaults > 1) - (", namely " + concatStringsSep ", " defaults); - }) - - (let - getContainers = profiles: - flatten - (mapAttrsToList (_: value: (attrValues value.containers)) profiles); - - findInvalidContainerIds = profiles: - filter (container: container.id >= 4294967294) - (getContainers profiles); - in { - assertion = cfg.profiles == { } - || length (findInvalidContainerIds cfg.profiles) == 0; - message = "Container id must be smaller than 4294967294 (2^32 - 2)"; - }) - - { - assertion = cfg.languagePacks == [ ] || cfg.package != null; - message = '' - 'programs.firefox.languagePacks' requires 'programs.firefox.package' - to be set to a non-null value. - ''; - } - - (mkNoDuplicateAssertion cfg.profiles "profile") - ] ++ (mapAttrsToList - (_: profile: mkNoDuplicateAssertion profile.containers "container") - cfg.profiles); - - warnings = optional (cfg.enableGnomeExtensions or false) '' - Using 'programs.firefox.enableGnomeExtensions' has been deprecated and - will be removed in the future. Please change to overriding the package - configuration using 'programs.firefox.package' instead. You can refer to - its example for how to do this. - ''; - - programs.firefox.finalPackage = wrapPackage cfg.package; - - programs.firefox.policies = { - ExtensionSettings = listToAttrs (map (lang: - nameValuePair "langpack-${lang}@firefox.mozilla.org" { - installation_mode = "normal_installed"; - install_url = - "https://releases.mozilla.org/pub/firefox/releases/${cfg.package.version}/linux-x86_64/xpi/${lang}.xpi"; - }) cfg.languagePacks); - }; - - home.packages = lib.optional (cfg.finalPackage != null) cfg.finalPackage; - - home.file = mkMerge ([{ - "${firefoxConfigPath}/profiles.ini" = - mkIf (cfg.profiles != { }) { text = profilesIni; }; - - "${nativeMessagingHostsPath}" = { - source = - "${nativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts"; - recursive = true; - }; - }] ++ flip mapAttrsToList cfg.profiles (_: profile: { - "${profilesPath}/${profile.path}/.keep".text = ""; - - "${profilesPath}/${profile.path}/chrome/userChrome.css" = - mkIf (profile.userChrome != "") { text = profile.userChrome; }; - - "${profilesPath}/${profile.path}/chrome/userContent.css" = - mkIf (profile.userContent != "") { text = profile.userContent; }; - - "${profilesPath}/${profile.path}/user.js" = mkIf (profile.settings != { } - || profile.extraConfig != "" || profile.bookmarks != [ ]) { - text = - mkUserJs profile.settings profile.extraConfig profile.bookmarks; - }; - - "${profilesPath}/${profile.path}/containers.json" = - mkIf (profile.containers != { }) { - force = profile.containersForce; - text = mkContainersJson profile.containers; - }; - - "${profilesPath}/${profile.path}/search.json.mozlz4" = mkIf - (profile.search.default != null || profile.search.privateDefault != null - || profile.search.order != [ ] || profile.search.engines != { }) { - force = profile.search.force; - source = let - settings = { - version = 6; - engines = let - # Map of nice field names to internal field names. - # This is intended to be exhaustive and should be - # updated at every version bump. - internalFieldNames = (genAttrs [ - "name" - "isAppProvided" - "loadPath" - "hasPreferredIcon" - "updateInterval" - "updateURL" - "iconUpdateURL" - "iconURL" - "iconMapObj" - "metaData" - "orderHint" - "definedAliases" - "urls" - ] (name: "_${name}")) // { - searchForm = "__searchForm"; - }; - - processCustomEngineInput = input: - (removeAttrs input [ "icon" ]) - // optionalAttrs (input ? icon) { - # Convenience to specify absolute path to icon - iconURL = "file://${input.icon}"; - } // (optionalAttrs (input ? iconUpdateURL) { - # Convenience to default iconURL to iconUpdateURL so - # the icon is immediately downloaded from the URL - iconURL = input.iconURL or input.iconUpdateURL; - } // { - # Required for custom engine configurations, loadPaths - # are unique identifiers that are generally formatted - # like: [source]/path/to/engine.xml - loadPath = '' - [home-manager]/programs.firefox.profiles.${profile.name}.search.engines."${ - replaceStrings [ "\\" ] [ "\\\\" ] input.name - }"''; - }); - - processEngineInput = name: input: - let - requiredInput = { - inherit name; - isAppProvided = input.isAppProvided or removeAttrs input - [ "metaData" ] == { }; - metaData = input.metaData or { }; - }; - in if requiredInput.isAppProvided then - requiredInput - else - processCustomEngineInput (input // requiredInput); - - buildEngineConfig = name: input: - mapAttrs' (name: value: { - name = internalFieldNames.${name} or name; - inherit value; - }) (processEngineInput name input); - - sortEngineConfigs = configs: - let - buildEngineConfigWithOrder = order: name: - let - config = configs.${name} or { - _name = name; - _isAppProvided = true; - _metaData = { }; - }; - in config // { - _metaData = config._metaData // { inherit order; }; - }; - - engineConfigsWithoutOrder = - attrValues (removeAttrs configs profile.search.order); - - sortedEngineConfigs = - (imap buildEngineConfigWithOrder profile.search.order) - ++ engineConfigsWithoutOrder; - in sortedEngineConfigs; - - engineInput = profile.search.engines // { - # Infer profile.search.default as an app provided - # engine if it's not in profile.search.engines - ${profile.search.default} = - profile.search.engines.${profile.search.default} or { }; - } // { - ${profile.search.privateDefault} = - profile.search.engines.${profile.search.privateDefault} or { }; - }; - in sortEngineConfigs (mapAttrs buildEngineConfig engineInput); - - metaData = optionalAttrs (profile.search.default != null) { - current = profile.search.default; - hash = "@hash@"; - } // optionalAttrs (profile.search.privateDefault != null) { - private = profile.search.privateDefault; - privateHash = "@privateHash@"; - } // { - useSavedOrder = profile.search.order != [ ]; - }; - }; - - # Home Manager doesn't circumvent user consent and isn't acting - # maliciously. We're modifying the search outside of Firefox, but - # a claim by Mozilla to remove this would be very anti-user, and - # is unlikely to be an issue for our use case. - disclaimer = appName: - "By modifying this file, I agree that I am doing so " - + "only within ${appName} itself, using official, user-driven search " - + "engine selection processes, and in a way which does not circumvent " - + "user consent. I acknowledge that any attempt to change this file " - + "from outside of ${appName} is a malicious act, and will be responded " - + "to accordingly."; - - salt = if profile.search.default != null then - profile.path + profile.search.default + disclaimer "Firefox" - else - null; - - privateSalt = if profile.search.privateDefault != null then - profile.path + profile.search.privateDefault - + disclaimer "Firefox" - else - null; - in pkgs.runCommand "search.json.mozlz4" { - nativeBuildInputs = with pkgs; [ mozlz4a openssl ]; - json = builtins.toJSON settings; - inherit salt privateSalt; - } '' - if [[ -n $salt ]]; then - export hash=$(echo -n "$salt" | openssl dgst -sha256 -binary | base64) - export privateHash=$(echo -n "$privateSalt" | openssl dgst -sha256 -binary | base64) - mozlz4a <(substituteStream json search.json.in --subst-var hash --subst-var privateHash) "$out" - else - mozlz4a <(echo "$json") "$out" - fi - ''; - }; - - "${profilesPath}/${profile.path}/extensions" = - mkIf (profile.extensions != [ ]) { - source = let - extensionsEnvPkg = pkgs.buildEnv { - name = "hm-firefox-extensions"; - paths = profile.extensions; - }; - in "${extensionsEnvPkg}/share/mozilla/${extensionPath}"; - recursive = true; - force = true; - }; - })); - }; } diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix new file mode 100644 index 000000000000..32ab4b47a920 --- /dev/null +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -0,0 +1,1017 @@ +{ modulePath, name, description ? null, wrappedPackageName ? null +, unwrappedPackageName ? null, platforms, visible ? false }: + +{ config, lib, pkgs, ... }: + +with lib; + +let + + inherit (pkgs.stdenv.hostPlatform) isDarwin; + + moduleName = concatStringsSep "." modulePath; + + cfg = getAttrFromPath modulePath config; + + jsonFormat = pkgs.formats.json { }; + + supportedPlatforms = flatten (attrVals (attrNames platforms) lib.platforms); + + isWrapped = versionAtLeast config.home.stateVersion "19.09" + && wrappedPackageName != null; + + defaultPackageName = + if isWrapped then wrappedPackageName else unwrappedPackageName; + + packageName = if wrappedPackageName != null then + wrappedPackageName + else + unwrappedPackageName; + + profilesPath = + if isDarwin then "${cfg.configPath}/Profiles" else cfg.configPath; + + nativeMessagingHostsPath = if isDarwin then + "${cfg.vendorPath}/NativeMessagingHosts" + else + "${cfg.vendorPath}/native-messaging-hosts"; + + nativeMessagingHostsJoined = pkgs.symlinkJoin { + name = "ff_native-messaging-hosts"; + paths = [ + # Link a .keep file to keep the directory around + (pkgs.writeTextDir "lib/mozilla/native-messaging-hosts/.keep" "") + # Link package configured native messaging hosts (entire browser actually) + cfg.finalPackage + ] + # Link user configured native messaging hosts + ++ cfg.nativeMessagingHosts; + }; + + # The extensions path shared by all profiles; will not be supported + # by future browser versions. + extensionPath = "extensions/{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"; + + profiles = flip mapAttrs' cfg.profiles (_: profile: + nameValuePair "Profile${toString profile.id}" { + Name = profile.name; + Path = if isDarwin then "Profiles/${profile.path}" else profile.path; + IsRelative = 1; + Default = if profile.isDefault then 1 else 0; + }) // { + General = { + StartWithLastProfile = 1; + Version = 2; + }; + }; + + profilesIni = generators.toINI { } profiles; + + userPrefValue = pref: + builtins.toJSON (if isBool pref || isInt pref || isString pref then + pref + else + builtins.toJSON pref); + + mkUserJs = prefs: extraPrefs: bookmarks: + let + prefs' = lib.optionalAttrs ([ ] != bookmarks) { + "browser.bookmarks.file" = toString (browserBookmarksFile bookmarks); + "browser.places.importBookmarksHTML" = true; + } // prefs; + in '' + // Generated by Home Manager. + + ${concatStrings (mapAttrsToList (name: value: '' + user_pref("${name}", ${userPrefValue value}); + '') prefs')} + + ${extraPrefs} + ''; + + mkContainersJson = containers: + let + containerToIdentity = _: container: { + userContextId = container.id; + name = container.name; + icon = container.icon; + color = container.color; + public = true; + }; + in '' + ${builtins.toJSON { + version = 4; + lastUserContextId = + elemAt (mapAttrsToList (_: container: container.id) containers) 0; + identities = mapAttrsToList containerToIdentity containers ++ [ + { + userContextId = 4294967294; # 2^32 - 2 + name = "userContextIdInternal.thumbnail"; + icon = ""; + color = ""; + accessKey = ""; + public = false; + } + { + userContextId = 4294967295; # 2^32 - 1 + name = "userContextIdInternal.webextStorageLocal"; + icon = ""; + color = ""; + accessKey = ""; + public = false; + } + ]; + }} + ''; + + browserBookmarksFile = bookmarks: + let + indent = level: + lib.concatStringsSep "" (map (lib.const " ") (lib.range 1 level)); + + bookmarkToHTML = indentLevel: bookmark: + '' + ${indent indentLevel}
${escapeXML bookmark.name}''; + + directoryToHTML = indentLevel: directory: '' + ${indent indentLevel}
${ + if directory.toolbar then + '' +

Bookmarks Toolbar'' + else + ''

${escapeXML directory.name}'' + }

+ ${indent indentLevel}

+ ${allItemsToHTML (indentLevel + 1) directory.bookmarks} + ${indent indentLevel}

''; + + itemToHTMLOrRecurse = indentLevel: item: + if item ? "url" then + bookmarkToHTML indentLevel item + else + directoryToHTML indentLevel item; + + allItemsToHTML = indentLevel: bookmarks: + lib.concatStringsSep "\n" + (map (itemToHTMLOrRecurse indentLevel) bookmarks); + + bookmarkEntries = allItemsToHTML 1 bookmarks; + in pkgs.writeText "${packageName}-bookmarks.html" '' + + + + Bookmarks +

Bookmarks Menu

+

+ ${bookmarkEntries} +

+ ''; + + mkNoDuplicateAssertion = entities: entityKind: + (let + # Return an attribute set with entity IDs as keys and a list of + # entity names with corresponding ID as value. An ID is present in + # the result only if more than one entity has it. The argument + # entities is a list of AttrSet of one id/name pair. + findDuplicateIds = entities: + filterAttrs (_entityId: entityNames: length entityNames != 1) + (zipAttrs entities); + + duplicates = findDuplicateIds (mapAttrsToList + (entityName: entity: { "${toString entity.id}" = entityName; }) + entities); + + mkMsg = entityId: entityNames: + " - ID ${entityId} is used by " + concatStringsSep ", " entityNames; + in { + assertion = duplicates == { }; + message = '' + Must not have a ${name} ${entityKind} with an existing ID but + '' + concatStringsSep "\n" (mapAttrsToList mkMsg duplicates); + }); + + wrapPackage = package: + let + # The configuration expected by the Firefox wrapper. + fcfg = { enableGnomeExtensions = cfg.enableGnomeExtensions; }; + + # A bit of hackery to force a config into the wrapper. + browserName = + package.browserName or (builtins.parseDrvName package.name).name; + + # The configuration expected by the Firefox wrapper builder. + bcfg = setAttrByPath [ browserName ] fcfg; + + in if package == null then + null + else if isDarwin then + package + else if isWrapped then + package.override (old: { + cfg = old.cfg or { } // fcfg; + extraPolicies = (old.extraPolicies or { }) // cfg.policies; + }) + else + (pkgs.wrapFirefox.override { config = bcfg; }) package { }; + +in { + options = setAttrByPath modulePath { + enable = mkOption { + type = types.bool; + default = false; + example = true; + description = '' + Whether to enable ${name}.${ + optionalString (description != null) " ${description}" + } + ${optionalString (!visible) + "See `programs.firefox` for more configuration options."} + ''; + }; + + package = mkOption { + inherit visible; + type = with types; nullOr package; + default = pkgs.${defaultPackageName}; + defaultText = literalExpression "pkgs.${packageName}"; + example = literalExpression '' + pkgs.${packageName}.override { + # See nixpkgs' firefox/wrapper.nix to check which options you can use + nativeMessagingHosts = [ + # Gnome shell native connector + pkgs.gnome-browser-connector + # Tridactyl native connector + pkgs.tridactyl-native + ]; + } + ''; + description = '' + The ${name} package to use. If state version ≥ 19.09 then + this should be a wrapped ${name} package. For earlier state + versions it should be an unwrapped ${name} package. + Set to `null` to disable installing ${name}. + ''; + }; + + languagePacks = mkOption { + type = types.listOf types.str; + default = [ ]; + description = '' + The language packs to install. Available language codes can be found + on the releases page: + `https://releases.mozilla.org/pub/firefox/releases/''${version}/linux-x86_64/xpi/`, + replacing `''${version}` with the version of Firefox you have. + ''; + example = [ "en-GB" "de" ]; + }; + + name = mkOption { + internal = true; + type = types.str; + default = name; + example = "Firefox"; + description = "The name of the browser."; + }; + + wrappedPackageName = mkOption { + internal = true; + type = with types; nullOr str; + default = wrappedPackageName; + description = "Name of the wrapped browser package."; + }; + + vendorPath = mkOption { + internal = true; + type = with types; nullOr str; + default = with platforms; + if isDarwin then + darwin.vendorPath or null + else + linux.vendorPath or null; + example = ".mozilla"; + description = + "Directory containing the native messaging hosts directory."; + }; + + configPath = mkOption { + internal = true; + type = types.str; + default = with platforms; + if isDarwin then darwin.configPath else linux.configPath; + example = ".mozilla/firefox"; + description = "Directory containing the ${name} configuration files."; + }; + + nativeMessagingHosts = optionalAttrs (cfg.vendorPath != null) (mkOption { + inherit visible; + type = types.listOf types.package; + default = [ ]; + description = '' + Additional packages containing native messaging hosts that should be + made available to ${name} extensions. + ''; + }); + + finalPackage = mkOption { + inherit visible; + type = with types; nullOr package; + readOnly = true; + description = "Resulting ${cfg.name} package."; + }; + + policies = optionalAttrs (unwrappedPackageName != null) (mkOption { + inherit visible; + type = types.attrsOf jsonFormat.type; + default = { }; + description = + "[See list of policies](https://mozilla.github.io/policy-templates/)."; + example = { + DefaultDownloadDirectory = "\${home}/Downloads"; + BlockAboutConfig = true; + }; + }); + + profiles = mkOption { + inherit visible; + type = types.attrsOf (types.submodule ({ config, name, ... }: { + options = { + name = mkOption { + type = types.str; + default = name; + description = "Profile name."; + }; + + id = mkOption { + type = types.ints.unsigned; + default = 0; + description = '' + Profile ID. This should be set to a unique number per profile. + ''; + }; + + settings = mkOption { + type = types.attrsOf (jsonFormat.type // { + description = + "${name} preference (int, bool, string, and also attrs, list, float as a JSON string)"; + }); + default = { }; + example = literalExpression '' + { + "browser.startup.homepage" = "https://nixos.org"; + "browser.search.region" = "GB"; + "browser.search.isUS" = false; + "distribution.searchplugins.defaultLocale" = "en-GB"; + "general.useragent.locale" = "en-GB"; + "browser.bookmarks.showMobileBookmarks" = true; + "browser.newtabpage.pinned" = [{ + title = "NixOS"; + url = "https://nixos.org"; + }]; + } + ''; + description = '' + Attribute set of ${name} preferences. + + ${name} only supports int, bool, and string types for + preferences, but home-manager will automatically + convert all other JSON-compatible values into strings. + ''; + }; + + extraConfig = mkOption { + type = types.lines; + default = ""; + description = '' + Extra preferences to add to {file}`user.js`. + ''; + }; + + userChrome = mkOption { + type = types.lines; + default = ""; + description = "Custom ${name} user chrome CSS."; + example = '' + /* Hide tab bar in FF Quantum */ + @-moz-document url("chrome://browser/content/browser.xul") { + #TabsToolbar { + visibility: collapse !important; + margin-bottom: 21px !important; + } + + #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header { + visibility: collapse !important; + } + } + ''; + }; + + userContent = mkOption { + type = types.lines; + default = ""; + description = "Custom ${name} user content CSS."; + example = '' + /* Hide scrollbar in FF Quantum */ + *{scrollbar-width:none !important} + ''; + }; + + bookmarks = mkOption { + type = let + bookmarkSubmodule = types.submodule ({ config, name, ... }: { + options = { + name = mkOption { + type = types.str; + default = name; + description = "Bookmark name."; + }; + + tags = mkOption { + type = types.listOf types.str; + default = [ ]; + description = "Bookmark tags."; + }; + + keyword = mkOption { + type = types.nullOr types.str; + default = null; + description = "Bookmark search keyword."; + }; + + url = mkOption { + type = types.str; + description = "Bookmark url, use %s for search terms."; + }; + }; + }) // { + description = "bookmark submodule"; + }; + + bookmarkType = types.addCheck bookmarkSubmodule (x: x ? "url"); + + directoryType = types.submodule ({ config, name, ... }: { + options = { + name = mkOption { + type = types.str; + default = name; + description = "Directory name."; + }; + + bookmarks = mkOption { + type = types.listOf nodeType; + default = [ ]; + description = "Bookmarks within directory."; + }; + + toolbar = mkOption { + type = types.bool; + default = false; + description = '' + Make this the toolbar directory. Note, this does _not_ + mean that this directory will be added to the toolbar, + this directory _is_ the toolbar. + ''; + }; + }; + }) // { + description = "directory submodule"; + }; + + nodeType = types.either bookmarkType directoryType; + in with types; + coercedTo (attrsOf nodeType) attrValues (listOf nodeType); + default = [ ]; + example = literalExpression '' + [ + { + name = "wikipedia"; + tags = [ "wiki" ]; + keyword = "wiki"; + url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; + } + { + name = "kernel.org"; + url = "https://www.kernel.org"; + } + { + name = "Nix sites"; + toolbar = true; + bookmarks = [ + { + name = "homepage"; + url = "https://nixos.org/"; + } + { + name = "wiki"; + tags = [ "wiki" "nix" ]; + url = "https://wiki.nixos.org/"; + } + ]; + } + ] + ''; + description = '' + Preloaded bookmarks. Note, this may silently overwrite any + previously existing bookmarks! + ''; + }; + + path = mkOption { + type = types.str; + default = name; + description = "Profile path."; + }; + + isDefault = mkOption { + type = types.bool; + default = config.id == 0; + defaultText = "true if profile ID is 0"; + description = "Whether this is a default profile."; + }; + + search = { + force = mkOption { + type = with types; bool; + default = false; + description = '' + Whether to force replace the existing search + configuration. This is recommended since ${name} will + replace the symlink for the search configuration on every + launch, but note that you'll lose any existing + configuration by enabling this. + ''; + }; + + default = mkOption { + type = with types; nullOr str; + default = null; + example = "DuckDuckGo"; + description = '' + The default search engine used in the address bar and search bar. + ''; + }; + + privateDefault = mkOption { + type = with types; nullOr str; + default = null; + example = "DuckDuckGo"; + description = '' + The default search engine used in the Private Browsing. + ''; + }; + + order = mkOption { + type = with types; uniq (listOf str); + default = [ ]; + example = [ "DuckDuckGo" "Google" ]; + description = '' + The order the search engines are listed in. Any engines + that aren't included in this list will be listed after + these in an unspecified order. + ''; + }; + + engines = mkOption { + type = with types; attrsOf (attrsOf jsonFormat.type); + default = { }; + example = literalExpression '' + { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + + icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + + "NixOS Wiki" = { + urls = [{ template = "https://wiki.nixos.org/index.php?search={searchTerms}"; }]; + iconUpdateURL = "https://wiki.nixos.org/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ "@nw" ]; + }; + + "Bing".metaData.hidden = true; + "Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias + } + ''; + description = '' + Attribute set of search engine configurations. Engines + that only have {var}`metaData` specified will + be treated as builtin to ${name}. + + See [SearchEngine.jsm](https://searchfox.org/mozilla-central/rev/669329e284f8e8e2bb28090617192ca9b4ef3380/toolkit/components/search/SearchEngine.jsm#1138-1177) + in Firefox's source for available options. We maintain a + mapping to let you specify all options in the referenced + link without underscores, but it may fall out of date with + future options. + + Note, {var}`icon` is also a special option + added by Home Manager to make it convenient to specify + absolute icon paths. + ''; + }; + }; + + containersForce = mkOption { + type = types.bool; + default = false; + description = '' + Whether to force replace the existing containers configuration. + This is recommended since Firefox will replace the symlink on + every launch, but note that you'll lose any existing configuration + by enabling this. + ''; + }; + + containers = mkOption { + type = types.attrsOf (types.submodule ({ name, ... }: { + options = { + name = mkOption { + type = types.str; + default = name; + description = "Container name, e.g., shopping."; + }; + + id = mkOption { + type = types.ints.unsigned; + default = 0; + description = '' + Container ID. This should be set to a unique number per container in this profile. + ''; + }; + + # List of colors at + # https://searchfox.org/mozilla-central/rev/5ad226c7379b0564c76dc3b54b44985356f94c5a/toolkit/components/extensions/parent/ext-contextualIdentities.js#32 + color = mkOption { + type = types.enum [ + "blue" + "turquoise" + "green" + "yellow" + "orange" + "red" + "pink" + "purple" + "toolbar" + ]; + default = "pink"; + description = "Container color."; + }; + + icon = mkOption { + type = types.enum [ + "briefcase" + "cart" + "circle" + "dollar" + "fence" + "fingerprint" + "gift" + "vacation" + "food" + "fruit" + "pet" + "tree" + "chill" + ]; + default = "fruit"; + description = "Container icon."; + }; + }; + })); + default = { }; + example = { + "shopping" = { + id = 1; + color = "blue"; + icon = "cart"; + }; + "dangerous" = { + id = 2; + color = "red"; + icon = "fruit"; + }; + }; + description = '' + Attribute set of container configurations. See + [Multi-Account + Containers](https://support.mozilla.org/en-US/kb/containers) + for more information. + ''; + }; + + extensions = mkOption { + type = types.listOf types.package; + default = [ ]; + example = literalExpression '' + with pkgs.nur.repos.rycee.firefox-addons; [ + privacy-badger + ] + ''; + description = '' + List of ${name} add-on packages to install for this profile. + Some pre-packaged add-ons are accessible from the + [Nix User Repository](https://github.com/nix-community/NUR). + Once you have NUR installed run + + ```console + $ nix-env -f '' -qaP -A nur.repos.rycee.firefox-addons + ``` + + to list the available ${name} add-ons. + + Note that it is necessary to manually enable these extensions + inside ${name} after the first installation. + + To automatically enable extensions add + `"extensions.autoDisableScopes" = 0;` + to + [{option}`${moduleName}.profiles..settings`](#opt-${moduleName}.profiles._name_.settings) + ''; + }; + + }; + })); + default = { }; + description = "Attribute set of ${name} profiles."; + }; + + enableGnomeExtensions = mkOption { + inherit visible; + type = types.bool; + default = false; + description = '' + Whether to enable the GNOME Shell native host connector. Note, you + also need to set the NixOS option + `services.gnome.gnome-browser-connector.enable` to + `true`. + ''; + }; + }; + + config = mkIf cfg.enable ({ + assertions = [ + (hm.assertions.assertPlatform moduleName pkgs supportedPlatforms) + + (let + defaults = + catAttrs "name" (filter (a: a.isDefault) (attrValues cfg.profiles)); + in { + assertion = cfg.profiles == { } || length defaults == 1; + message = "Must have exactly one default ${cfg.name} profile but found " + + toString (length defaults) + optionalString (length defaults > 1) + (", namely " + concatStringsSep ", " defaults); + }) + + (let + getContainers = profiles: + flatten + (mapAttrsToList (_: value: (attrValues value.containers)) profiles); + + findInvalidContainerIds = profiles: + filter (container: container.id >= 4294967294) + (getContainers profiles); + in { + assertion = cfg.profiles == { } + || length (findInvalidContainerIds cfg.profiles) == 0; + message = "Container id must be smaller than 4294967294 (2^32 - 2)"; + }) + + { + assertion = cfg.languagePacks == [ ] || cfg.package != null; + message = '' + 'programs.firefox.languagePacks' requires 'programs.firefox.package' + to be set to a non-null value. + ''; + } + + (mkNoDuplicateAssertion cfg.profiles "profile") + ] ++ (mapAttrsToList + (_: profile: mkNoDuplicateAssertion profile.containers "container") + cfg.profiles); + + warnings = optional (cfg.enableGnomeExtensions or false) '' + Using '${moduleName}.enableGnomeExtensions' has been deprecated and + will be removed in the future. Please change to overriding the package + configuration using '${moduleName}.package' instead. You can refer to + its example for how to do this. + ''; + + programs.firefox.policies = { + ExtensionSettings = listToAttrs (map (lang: + nameValuePair "langpack-${lang}@firefox.mozilla.org" { + installation_mode = "normal_installed"; + install_url = + "https://releases.mozilla.org/pub/firefox/releases/${cfg.package.version}/linux-x86_64/xpi/${lang}.xpi"; + }) cfg.languagePacks); + }; + + home.packages = lib.optional (cfg.finalPackage != null) cfg.finalPackage; + + home.file = mkMerge ([{ + "${cfg.configPath}/profiles.ini" = + mkIf (cfg.profiles != { }) { text = profilesIni; }; + }] ++ optional (cfg.vendorPath != null) { + "${nativeMessagingHostsPath}" = { + source = + "${nativeMessagingHostsJoined}/lib/mozilla/native-messaging-hosts"; + recursive = true; + }; + } ++ flip mapAttrsToList cfg.profiles (_: profile: { + "${profilesPath}/${profile.path}/.keep".text = ""; + + "${profilesPath}/${profile.path}/chrome/userChrome.css" = + mkIf (profile.userChrome != "") { text = profile.userChrome; }; + + "${profilesPath}/${profile.path}/chrome/userContent.css" = + mkIf (profile.userContent != "") { text = profile.userContent; }; + + "${profilesPath}/${profile.path}/user.js" = mkIf (profile.settings != { } + || profile.extraConfig != "" || profile.bookmarks != [ ]) { + text = + mkUserJs profile.settings profile.extraConfig profile.bookmarks; + }; + + "${profilesPath}/${profile.path}/containers.json" = + mkIf (profile.containers != { }) { + text = mkContainersJson profile.containers; + force = profile.containersForce; + }; + + "${profilesPath}/${profile.path}/search.json.mozlz4" = mkIf + (profile.search.default != null || profile.search.privateDefault != null + || profile.search.order != [ ] || profile.search.engines != { }) { + force = profile.search.force; + source = let + settings = { + version = 6; + engines = let + # Map of nice field names to internal field names. + # This is intended to be exhaustive and should be + # updated at every version bump. + internalFieldNames = (genAttrs [ + "name" + "isAppProvided" + "loadPath" + "hasPreferredIcon" + "updateInterval" + "updateURL" + "iconUpdateURL" + "iconURL" + "iconMapObj" + "metaData" + "orderHint" + "definedAliases" + "urls" + ] (name: "_${name}")) // { + searchForm = "__searchForm"; + }; + + processCustomEngineInput = input: + (removeAttrs input [ "icon" ]) + // optionalAttrs (input ? icon) { + # Convenience to specify absolute path to icon + iconURL = "file://${input.icon}"; + } // (optionalAttrs (input ? iconUpdateURL) { + # Convenience to default iconURL to iconUpdateURL so + # the icon is immediately downloaded from the URL + iconURL = input.iconURL or input.iconUpdateURL; + } // { + # Required for custom engine configurations, loadPaths + # are unique identifiers that are generally formatted + # like: [source]/path/to/engine.xml + loadPath = '' + [home-manager]/${moduleName}.profiles.${profile.name}.search.engines."${ + replaceStrings [ "\\" ] [ "\\\\" ] input.name + }"''; + }); + + processEngineInput = name: input: + let + requiredInput = { + inherit name; + isAppProvided = input.isAppProvided or removeAttrs input + [ "metaData" ] == { }; + metaData = input.metaData or { }; + }; + in if requiredInput.isAppProvided then + requiredInput + else + processCustomEngineInput (input // requiredInput); + + buildEngineConfig = name: input: + mapAttrs' (name: value: { + name = internalFieldNames.${name} or name; + inherit value; + }) (processEngineInput name input); + + sortEngineConfigs = configs: + let + buildEngineConfigWithOrder = order: name: + let + config = configs.${name} or { + _name = name; + _isAppProvided = true; + _metaData = { }; + }; + in config // { + _metaData = config._metaData // { inherit order; }; + }; + + engineConfigsWithoutOrder = + attrValues (removeAttrs configs profile.search.order); + + sortedEngineConfigs = + (imap buildEngineConfigWithOrder profile.search.order) + ++ engineConfigsWithoutOrder; + in sortedEngineConfigs; + + engineInput = profile.search.engines // { + # Infer profile.search.default as an app provided + # engine if it's not in profile.search.engines + ${profile.search.default} = + profile.search.engines.${profile.search.default} or { }; + } // { + ${profile.search.privateDefault} = + profile.search.engines.${profile.search.privateDefault} or { }; + }; + in sortEngineConfigs (mapAttrs buildEngineConfig engineInput); + + metaData = optionalAttrs (profile.search.default != null) { + current = profile.search.default; + hash = "@hash@"; + } // optionalAttrs (profile.search.privateDefault != null) { + private = profile.search.privateDefault; + privateHash = "@privateHash@"; + } // { + useSavedOrder = profile.search.order != [ ]; + }; + }; + + # Home Manager doesn't circumvent user consent and isn't acting + # maliciously. We're modifying the search outside of the browser, but + # a claim by Mozilla to remove this would be very anti-user, and + # is unlikely to be an issue for our use case. + disclaimer = appName: + "By modifying this file, I agree that I am doing so " + + "only within ${appName} itself, using official, user-driven search " + + "engine selection processes, and in a way which does not circumvent " + + "user consent. I acknowledge that any attempt to change this file " + + "from outside of ${appName} is a malicious act, and will be responded " + + "to accordingly."; + + salt = if profile.search.default != null then + profile.path + profile.search.default + disclaimer cfg.name + else + null; + + privateSalt = if profile.search.privateDefault != null then + profile.path + profile.search.privateDefault + + disclaimer cfg.name + else + null; + in pkgs.runCommand "search.json.mozlz4" { + nativeBuildInputs = with pkgs; [ mozlz4a openssl ]; + json = builtins.toJSON settings; + inherit salt privateSalt; + } '' + if [[ -n $salt ]]; then + export hash=$(echo -n "$salt" | openssl dgst -sha256 -binary | base64) + export privateHash=$(echo -n "$privateSalt" | openssl dgst -sha256 -binary | base64) + mozlz4a <(substituteStream json search.json.in --subst-var hash --subst-var privateHash) "$out" + else + mozlz4a <(echo "$json") "$out" + fi + ''; + }; + + "${profilesPath}/${profile.path}/extensions" = + mkIf (profile.extensions != [ ]) { + source = let + extensionsEnvPkg = pkgs.buildEnv { + name = "hm-firefox-extensions"; + paths = profile.extensions; + }; + in "${extensionsEnvPkg}/share/mozilla/${extensionPath}"; + recursive = true; + force = true; + }; + })); + } // setAttrByPath modulePath { finalPackage = wrapPackage cfg.package; }); +} + diff --git a/tests/default.nix b/tests/default.nix index 28ce4f648a38..1c143716f478 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -189,7 +189,7 @@ in import nmtSrc { ./modules/programs/bemenu ./modules/programs/borgmatic ./modules/programs/boxxy - ./modules/programs/firefox + ./modules/programs/firefox/firefox.nix ./modules/programs/foot ./modules/programs/freetube ./modules/programs/fuzzel diff --git a/tests/modules/programs/firefox/container-id-out-of-range.nix b/tests/modules/programs/firefox/container-id-out-of-range.nix index 5dbeaedda8b8..2ea08e880822 100644 --- a/tests/modules/programs/firefox/container-id-out-of-range.nix +++ b/tests/modules/programs/firefox/container-id-out-of-range.nix @@ -1,27 +1,32 @@ +modulePath: { config, lib, ... }: -{ - imports = [ ./setup-firefox-mock-overlay.nix ]; +with lib; - config = lib.mkIf config.test.enableBig { +let + + firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; + +in { + imports = [ firefoxMockOverlay ]; + + config = mkIf config.test.enableBig ({ test.asserts.assertions.expected = [ "Container id must be smaller than 4294967294 (2^32 - 2)" ]; + } // setAttrByPath modulePath { + enable = true; - programs.firefox = { - enable = true; - - profiles.my-profile = { - isDefault = true; - id = 1; + profiles.my-profile = { + isDefault = true; + id = 1; - containers = { - "shopping" = { - id = 4294967294; - color = "blue"; - icon = "circle"; - }; + containers = { + "shopping" = { + id = 4294967294; + color = "blue"; + icon = "circle"; }; }; }; - }; + }); } diff --git a/tests/modules/programs/firefox/default.nix b/tests/modules/programs/firefox/default.nix deleted file mode 100644 index 1cd462f2e7e2..000000000000 --- a/tests/modules/programs/firefox/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - firefox-profile-settings = ./profile-settings.nix; - firefox-state-version-19_09 = ./state-version-19_09.nix; - firefox-deprecated-native-messenger = ./deprecated-native-messenger.nix; - firefox-duplicate-profile-ids = ./duplicate-profile-ids.nix; - firefox-duplicate-container-ids = ./duplicate-container-ids.nix; - firefox-container-id-out-of-range = ./container-id-out-of-range.nix; - firefox-policies = ./policies.nix; -} diff --git a/tests/modules/programs/firefox/deprecated-native-messenger.nix b/tests/modules/programs/firefox/deprecated-native-messenger.nix index db70d405bead..87423aba3aa1 100644 --- a/tests/modules/programs/firefox/deprecated-native-messenger.nix +++ b/tests/modules/programs/firefox/deprecated-native-messenger.nix @@ -1,21 +1,26 @@ -{ config, lib, pkgs, ... }: +modulePath: +{ config, lib, ... }: with lib; -{ - imports = [ ./setup-firefox-mock-overlay.nix ]; +let - config = lib.mkIf config.test.enableBig { - programs.firefox = { - enable = true; - enableGnomeExtensions = true; - }; + moduleName = concatStringsSep "." modulePath; + firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; + +in { + imports = [ firefoxMockOverlay ]; + + config = mkIf config.test.enableBig (setAttrByPath modulePath { + enable = true; + enableGnomeExtensions = true; + } // { test.asserts.warnings.expected = ['' - Using 'programs.firefox.enableGnomeExtensions' has been deprecated and + Using '${moduleName}.enableGnomeExtensions' has been deprecated and will be removed in the future. Please change to overriding the package - configuration using 'programs.firefox.package' instead. You can refer to + configuration using '${moduleName}.package' instead. You can refer to its example for how to do this. '']; - }; + }); } diff --git a/tests/modules/programs/firefox/duplicate-container-ids.nix b/tests/modules/programs/firefox/duplicate-container-ids.nix index fce91fa02fb9..2ad99b4b7cdd 100644 --- a/tests/modules/programs/firefox/duplicate-container-ids.nix +++ b/tests/modules/programs/firefox/duplicate-container-ids.nix @@ -1,35 +1,42 @@ +modulePath: { config, lib, ... }: -{ - imports = [ ./setup-firefox-mock-overlay.nix ]; +with lib; - config = lib.mkIf config.test.enableBig { +let + + cfg = getAttrFromPath modulePath config; + + firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; + +in { + imports = [ firefoxMockOverlay ]; + + config = mkIf config.test.enableBig ({ test.asserts.assertions.expected = ['' - Must not have a Firefox container with an existing ID but + Must not have a ${cfg.name} container with an existing ID but - ID 9 is used by dangerous, shopping'']; + } // setAttrByPath modulePath { + enable = true; + + profiles = { + my-profile = { + isDefault = true; + id = 1; - programs.firefox = { - enable = true; - - profiles = { - my-profile = { - isDefault = true; - id = 1; - - containers = { - "shopping" = { - id = 9; - color = "blue"; - icon = "circle"; - }; - "dangerous" = { - id = 9; - color = "red"; - icon = "circle"; - }; + containers = { + "shopping" = { + id = 9; + color = "blue"; + icon = "circle"; + }; + "dangerous" = { + id = 9; + color = "red"; + icon = "circle"; }; }; }; }; - }; + }); } diff --git a/tests/modules/programs/firefox/duplicate-profile-ids.nix b/tests/modules/programs/firefox/duplicate-profile-ids.nix index 9b0b7c060d7c..ad946af1010a 100644 --- a/tests/modules/programs/firefox/duplicate-profile-ids.nix +++ b/tests/modules/programs/firefox/duplicate-profile-ids.nix @@ -1,23 +1,30 @@ +modulePath: { config, lib, ... }: -{ - imports = [ ./setup-firefox-mock-overlay.nix ]; +with lib; - config = lib.mkIf config.test.enableBig { +let + + cfg = getAttrFromPath modulePath config; + + firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; + +in { + imports = [ firefoxMockOverlay ]; + + config = mkIf config.test.enableBig ({ test.asserts.assertions.expected = ['' - Must not have a Firefox profile with an existing ID but + Must not have a ${cfg.name} profile with an existing ID but - ID 1 is used by first, second'']; + } // setAttrByPath modulePath { + enable = true; - programs.firefox = { - enable = true; - - profiles = { - first = { - isDefault = true; - id = 1; - }; - second = { id = 1; }; + profiles = { + first = { + isDefault = true; + id = 1; }; + second = { id = 1; }; }; - }; + }); } diff --git a/tests/modules/programs/firefox/firefox.nix b/tests/modules/programs/firefox/firefox.nix new file mode 100644 index 000000000000..6598d6ec2d14 --- /dev/null +++ b/tests/modules/programs/firefox/firefox.nix @@ -0,0 +1,11 @@ +let name = "firefox"; + +in builtins.mapAttrs (test: module: import module [ "programs" name ]) { + "${name}-profile-settings" = ./profile-settings.nix; + "${name}-state-version-19_09" = ./state-version-19_09.nix; + "${name}-deprecated-native-messenger" = ./deprecated-native-messenger.nix; + "${name}-duplicate-profile-ids" = ./duplicate-profile-ids.nix; + "${name}-duplicate-container-ids" = ./duplicate-container-ids.nix; + "${name}-container-id-out-of-range" = ./container-id-out-of-range.nix; + "${name}-policies" = ./policies.nix; +} diff --git a/tests/modules/programs/firefox/policies.nix b/tests/modules/programs/firefox/policies.nix index 7b503d3d8bb4..5e02a1916b6b 100644 --- a/tests/modules/programs/firefox/policies.nix +++ b/tests/modules/programs/firefox/policies.nix @@ -1,22 +1,29 @@ +modulePath: { config, lib, pkgs, ... }: -{ - imports = [ ./setup-firefox-mock-overlay.nix ]; +with lib; - config = lib.mkIf config.test.enableBig { - home.stateVersion = "23.05"; +let - programs.firefox = { - enable = true; - policies = { BlockAboutConfig = true; }; - package = pkgs.firefox.override { - extraPolicies = { DownloadDirectory = "/foo"; }; - }; - }; + cfg = getAttrFromPath modulePath config; + + firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; +in { + imports = [ firefoxMockOverlay ]; + + config = mkIf config.test.enableBig ({ + home.stateVersion = "23.05"; + } // setAttrByPath modulePath { + enable = true; + policies = { BlockAboutConfig = true; }; + package = pkgs.${cfg.wrappedPackageName}.override { + extraPolicies = { DownloadDirectory = "/foo"; }; + }; + }) // { nmt.script = '' jq=${lib.getExe pkgs.jq} - config_file="${config.programs.firefox.finalPackage}/lib/firefox/distribution/policies.json" + config_file="${cfg.finalPackage}/lib/${cfg.wrappedPackageName}/distribution/policies.json" assertFileExists "$config_file" diff --git a/tests/modules/programs/firefox/profile-settings.nix b/tests/modules/programs/firefox/profile-settings.nix index 8b781552b053..d7776eb4fc51 100644 --- a/tests/modules/programs/firefox/profile-settings.nix +++ b/tests/modules/programs/firefox/profile-settings.nix @@ -1,177 +1,184 @@ +modulePath: { config, lib, pkgs, ... }: -{ - imports = [ ./setup-firefox-mock-overlay.nix ]; - - config = lib.mkIf config.test.enableBig { - programs.firefox = { - enable = true; - profiles.basic.isDefault = true; - - profiles.test = { - id = 1; - settings = { - "general.smoothScroll" = false; - "browser.newtabpage.pinned" = [{ - title = "NixOS"; - url = "https://nixos.org"; - }]; - }; +with lib; + +let + + cfg = getAttrFromPath modulePath config; + + firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; + +in { + imports = [ firefoxMockOverlay ]; + + config = mkIf config.test.enableBig (setAttrByPath modulePath { + enable = true; + profiles.basic.isDefault = true; + + profiles.test = { + id = 1; + settings = { + "general.smoothScroll" = false; + "browser.newtabpage.pinned" = [{ + title = "NixOS"; + url = "https://nixos.org"; + }]; }; + }; + + profiles.bookmarks = { + id = 2; + settings = { "general.smoothScroll" = false; }; + bookmarks = [ + { + toolbar = true; + bookmarks = [{ + name = "Home Manager"; + url = "https://wiki.nixos.org/wiki/Home_Manager"; + }]; + } + { + name = "wikipedia"; + tags = [ "wiki" ]; + keyword = "wiki"; + url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; + } + { + name = "kernel.org"; + url = "https://www.kernel.org"; + } + { + name = "Nix sites"; + bookmarks = [ + { + name = "homepage"; + url = "https://nixos.org/"; + } + { + name = "wiki"; + tags = [ "wiki" "nix" ]; + url = "https://wiki.nixos.org/"; + } + { + name = "Nix sites"; + bookmarks = [ + { + name = "homepage"; + url = "https://nixos.org/"; + } + { + name = "wiki"; + url = "https://wiki.nixos.org/"; + } + ]; + } + ]; + } + ]; + }; - profiles.bookmarks = { - id = 2; - settings = { "general.smoothScroll" = false; }; - bookmarks = [ - { - toolbar = true; - bookmarks = [{ - name = "Home Manager"; - url = "https://wiki.nixos.org/wiki/Home_Manager"; + profiles.search = { + id = 3; + search = { + force = true; + default = "Google"; + privateDefault = "DuckDuckGo"; + order = [ "Nix Packages" "NixOS Wiki" ]; + engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; }]; - } - { - name = "wikipedia"; - tags = [ "wiki" ]; - keyword = "wiki"; - url = - "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; - } - { - name = "kernel.org"; - url = "https://www.kernel.org"; - } - { - name = "Nix sites"; - bookmarks = [ - { - name = "homepage"; - url = "https://nixos.org/"; - } - { - name = "wiki"; - tags = [ "wiki" "nix" ]; - url = "https://wiki.nixos.org/"; - } - { - name = "Nix sites"; - bookmarks = [ - { - name = "homepage"; - url = "https://nixos.org/"; - } - { - name = "wiki"; - url = "https://wiki.nixos.org/"; - } - ]; - } - ]; - } - ]; - }; - profiles.search = { - id = 3; - search = { - force = true; - default = "Google"; - privateDefault = "DuckDuckGo"; - order = [ "Nix Packages" "NixOS Wiki" ]; - engines = { - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { - name = "type"; - value = "packages"; - } - { - name = "query"; - value = "{searchTerms}"; - } - ]; - }]; - - icon = - "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - - definedAliases = [ "@np" ]; - }; - - "NixOS Wiki" = { - urls = [{ - template = - "https://wiki.nixos.org/index.php?search={searchTerms}"; - }]; - iconUpdateURL = "https://wiki.nixos.org/favicon.png"; - updateInterval = 24 * 60 * 60 * 1000; - definedAliases = [ "@nw" ]; - }; - - "Bing".metaData.hidden = true; - "Google".metaData.alias = "@g"; + icon = + "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + + definedAliases = [ "@np" ]; + }; + + "NixOS Wiki" = { + urls = [{ + template = + "https://wiki.nixos.org/index.php?search={searchTerms}"; + }]; + iconUpdateURL = "https://wiki.nixos.org/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = [ "@nw" ]; }; + + "Bing".metaData.hidden = true; + "Google".metaData.alias = "@g"; }; }; + }; + + profiles.searchWithoutDefault = { + id = 4; + search = { + force = true; + order = [ "Google" "Nix Packages" ]; + engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + }]; - profiles.searchWithoutDefault = { - id = 4; - search = { - force = true; - order = [ "Google" "Nix Packages" ]; - engines = { - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { - name = "type"; - value = "packages"; - } - { - name = "query"; - value = "{searchTerms}"; - } - ]; - }]; - - definedAliases = [ "@np" ]; - }; + definedAliases = [ "@np" ]; }; }; }; + }; - profiles.containers = { - id = 5; - containers = { - "shopping" = { - id = 6; - icon = "circle"; - color = "yellow"; - }; + profiles.containers = { + id = 5; + containers = { + "shopping" = { + id = 6; + icon = "circle"; + color = "yellow"; }; }; }; + } // { nmt.script = '' assertFileRegex \ - home-path/bin/firefox \ + home-path/bin/${cfg.wrappedPackageName} \ MOZ_APP_LAUNCHER - assertDirectoryExists home-files/.mozilla/firefox/basic + assertDirectoryExists home-files/${cfg.configPath}/basic assertFileContent \ - home-files/.mozilla/firefox/test/user.js \ + home-files/${cfg.configPath}/test/user.js \ ${./profile-settings-expected-user.js} assertFileContent \ - home-files/.mozilla/firefox/containers/containers.json \ + home-files/${cfg.configPath}/containers/containers.json \ ${./profile-settings-expected-containers.json} bookmarksUserJs=$(normalizeStorePaths \ - home-files/.mozilla/firefox/bookmarks/user.js) + home-files/${cfg.configPath}/bookmarks/user.js) assertFileContent \ $bookmarksUserJs \ @@ -179,7 +186,7 @@ bookmarksFile="$(sed -n \ '/browser.bookmarks.file/ {s|^.*\(/nix/store[^"]*\).*|\1|;p}' \ - $TESTED/home-files/.mozilla/firefox/bookmarks/user.js)" + $TESTED/home-files/${cfg.configPath}/bookmarks/user.js)" assertFileContent \ $bookmarksFile \ @@ -197,12 +204,12 @@ } assertFirefoxSearchContent \ - home-files/.mozilla/firefox/search/search.json.mozlz4 \ + home-files/${cfg.configPath}/search/search.json.mozlz4 \ ${./profile-settings-expected-search.json} assertFirefoxSearchContent \ - home-files/.mozilla/firefox/searchWithoutDefault/search.json.mozlz4 \ + home-files/${cfg.configPath}/searchWithoutDefault/search.json.mozlz4 \ ${./profile-settings-expected-search-without-default.json} ''; - }; + }); } diff --git a/tests/modules/programs/firefox/setup-firefox-mock-overlay.nix b/tests/modules/programs/firefox/setup-firefox-mock-overlay.nix index 0f0d182a4b33..ecbd492fa92c 100644 --- a/tests/modules/programs/firefox/setup-firefox-mock-overlay.nix +++ b/tests/modules/programs/firefox/setup-firefox-mock-overlay.nix @@ -1,16 +1,24 @@ -{ pkgs, ... }: +modulePath: +{ config, lib, pkgs, ... }: -{ +with lib; + +let + + cfg = getAttrFromPath modulePath config; + +in { nixpkgs.overlays = [ (self: super: { - firefox-unwrapped = pkgs.runCommandLocal "firefox-0" { - meta.description = "I pretend to be Firefox"; - passthru.gtk3 = null; - } '' - mkdir -p "$out"/{bin,lib} - touch "$out/bin/firefox" - chmod 755 "$out/bin/firefox" - ''; + "${cfg.wrappedPackageName}-unwrapped" = + pkgs.runCommandLocal "${cfg.wrappedPackageName}-0" { + meta.description = "I pretend to be ${cfg.name}"; + passthru.gtk3 = null; + } '' + mkdir -p "$out"/{bin,lib} + touch "$out/bin/${cfg.wrappedPackageName}" + chmod 755 "$out/bin/${cfg.wrappedPackageName}" + ''; chrome-gnome-shell = pkgs.runCommandLocal "dummy-chrome-gnome-shell" { } '' diff --git a/tests/modules/programs/firefox/state-version-19_09.nix b/tests/modules/programs/firefox/state-version-19_09.nix index c4c75970e36a..475705c314da 100644 --- a/tests/modules/programs/firefox/state-version-19_09.nix +++ b/tests/modules/programs/firefox/state-version-19_09.nix @@ -1,19 +1,24 @@ +modulePath: { config, lib, pkgs, ... }: with lib; -{ - imports = [ ./setup-firefox-mock-overlay.nix ]; +let - config = lib.mkIf config.test.enableBig { - home.stateVersion = "19.09"; + cfg = getAttrFromPath modulePath config; + + firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; - programs.firefox.enable = true; +in { + imports = [ firefoxMockOverlay ]; + config = lib.mkIf config.test.enableBig ({ + home.stateVersion = "19.09"; + } // setAttrByPath modulePath { enable = true; } // { nmt.script = '' assertFileRegex \ - home-path/bin/firefox \ + home-path/bin/${cfg.wrappedPackageName} \ MOZ_APP_LAUNCHER ''; - }; + }); } From 89670e27e101b9b30f5900fc1eb6530258d316b1 Mon Sep 17 00:00:00 2001 From: Gaurav Juvekar Date: Sun, 28 Jul 2024 20:42:18 -0700 Subject: [PATCH 385/636] home-manager: ignore hostname -f lookup errors `hostname -f` could fail depending on the resolver. Discard any stderr and test for the exit status before using the value for flake attribute lookup. I was unable to repro the exact bad exit status in #5665. With - nscd disabled, - nsswitch.conf pointing to 'files', - hostname entry removed from /etc/hosts `hostname -f` from inetutils-2.5 fell back to showing just the nodename from `uname(2)`. Injecting an empty string into the `(struct utsname).nodename` field of `uname(2)` using strace still exited with empty output and 0 exit-status. Fixes #5665 --- home-manager/home-manager | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index 5bf796b47680..ab4de5387db2 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -198,9 +198,19 @@ function setFlakeAttribute() { ;; *) local name="$USER" + + local hostnameArray=() + # FQDN lookup can fail depending on the resolver. + local fqdn + fqdn="$(hostname -f 2> /dev/null)" + if [[ $? -eq 0 ]]; then + hostnameArray+=( "$USER@$fqdn" ) + fi # Check FQDN, long, and short hostnames; long first to preserve # pre-existing behaviour in case both happen to be defined. - for n in "$USER@$(hostname -f)" "$USER@$(hostname)" "$USER@$(hostname -s)"; do + hostnameArray+=( "$USER@$(hostname)" "$USER@$(hostname -s)" ) + + for n in "${hostnameArray[@]}"; do if [[ "$(nix eval "$flake#homeConfigurations" --apply "x: x ? \"$n\"")" == "true" ]]; then name="$n" if [[ -v VERBOSE ]]; then From db40fead89db185dfd863aed5dad1d675f82a3fc Mon Sep 17 00:00:00 2001 From: Ninja3047 <1284324+Ninja3047@users.noreply.github.com> Date: Mon, 22 Jul 2024 21:51:02 -0400 Subject: [PATCH 386/636] nix-gc: call nix-collect-garbage in a shell script This will match the behavior in the upstream service which allows the user to set options to something that uses shell syntax. --- modules/services/nix-gc.nix | 5 +++-- tests/modules/services/nix-gc/basic.nix | 2 +- tests/modules/services/nix-gc/expected.service | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/services/nix-gc.nix b/modules/services/nix-gc.nix index 652c575ac1f8..0f4772046f4f 100644 --- a/modules/services/nix-gc.nix +++ b/modules/services/nix-gc.nix @@ -110,9 +110,10 @@ in { systemd.user.services.nix-gc = { Unit = { Description = "Nix Garbage Collector"; }; Service = { - ExecStart = "${nixPackage}/bin/nix-collect-garbage ${ + ExecStart = toString (pkgs.writeShellScript "nix-gc" '' + exec "${nixPackage}/bin/nix-collect-garbage ${ lib.optionalString (cfg.options != null) cfg.options - }"; + }"''); }; }; systemd.user.timers.nix-gc = { diff --git a/tests/modules/services/nix-gc/basic.nix b/tests/modules/services/nix-gc/basic.nix index d6511a171a40..507c9598534f 100644 --- a/tests/modules/services/nix-gc/basic.nix +++ b/tests/modules/services/nix-gc/basic.nix @@ -4,7 +4,7 @@ nix.gc = { automatic = true; frequency = "monthly"; - options = "--delete-older-than 30d"; + options = "--delete-older-than 30d --max-freed $((64 * 1024**3))"; }; test.stubs.nix = { name = "nix"; }; diff --git a/tests/modules/services/nix-gc/expected.service b/tests/modules/services/nix-gc/expected.service index 4aafd6af8272..73c0355ce770 100644 --- a/tests/modules/services/nix-gc/expected.service +++ b/tests/modules/services/nix-gc/expected.service @@ -1,5 +1,5 @@ [Service] -ExecStart=@nix@/bin/nix-collect-garbage --delete-older-than 30d +ExecStart=/nix/store/00000000000000000000000000000000-nix-gc [Unit] Description=Nix Garbage Collector From d34aaf7b3b4c98f2aefe0429b8946f2bcd36a59a Mon Sep 17 00:00:00 2001 From: Ninja3047 <1284324+Ninja3047@users.noreply.github.com> Date: Mon, 29 Jul 2024 16:45:50 -0400 Subject: [PATCH 387/636] nix-gc: set service type to oneshot --- modules/services/nix-gc.nix | 1 + tests/modules/services/nix-gc/expected.service | 1 + 2 files changed, 2 insertions(+) diff --git a/modules/services/nix-gc.nix b/modules/services/nix-gc.nix index 0f4772046f4f..fe7e466984fe 100644 --- a/modules/services/nix-gc.nix +++ b/modules/services/nix-gc.nix @@ -110,6 +110,7 @@ in { systemd.user.services.nix-gc = { Unit = { Description = "Nix Garbage Collector"; }; Service = { + Type = "oneshot"; ExecStart = toString (pkgs.writeShellScript "nix-gc" '' exec "${nixPackage}/bin/nix-collect-garbage ${ lib.optionalString (cfg.options != null) cfg.options diff --git a/tests/modules/services/nix-gc/expected.service b/tests/modules/services/nix-gc/expected.service index 73c0355ce770..47bca98958bd 100644 --- a/tests/modules/services/nix-gc/expected.service +++ b/tests/modules/services/nix-gc/expected.service @@ -1,5 +1,6 @@ [Service] ExecStart=/nix/store/00000000000000000000000000000000-nix-gc +Type=oneshot [Unit] Description=Nix Garbage Collector From 4fcd54df7cbb1d79cbe81209909ee8514d6b17a4 Mon Sep 17 00:00:00 2001 From: Jakub Nowak Date: Tue, 30 Jul 2024 08:33:10 +0200 Subject: [PATCH 388/636] firefox: fix userChrome example Example CSS wasn't valid for Firefox 69+. --- modules/programs/firefox/mkFirefoxModule.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index 32ab4b47a920..f22af019b066 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -402,7 +402,7 @@ in { description = "Custom ${name} user chrome CSS."; example = '' /* Hide tab bar in FF Quantum */ - @-moz-document url("chrome://browser/content/browser.xul") { + @-moz-document url(chrome://browser/content/browser.xul), url(chrome://browser/content/browser.xhtml) { #TabsToolbar { visibility: collapse !important; margin-bottom: 21px !important; From 58cef3796271aaeabaed98884d4abaab5d9d162d Mon Sep 17 00:00:00 2001 From: William Tan <1284324+Ninja3047@users.noreply.github.com> Date: Wed, 31 Jul 2024 02:27:17 -0400 Subject: [PATCH 389/636] nix-gc: remove extraneous quotes from shell script --- modules/services/nix-gc.nix | 6 +++--- tests/modules/services/nix-gc/basic.nix | 11 +++++++++++ tests/modules/services/nix-gc/nix-gc-script-expected | 2 ++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 tests/modules/services/nix-gc/nix-gc-script-expected diff --git a/modules/services/nix-gc.nix b/modules/services/nix-gc.nix index fe7e466984fe..50e8b635113e 100644 --- a/modules/services/nix-gc.nix +++ b/modules/services/nix-gc.nix @@ -111,10 +111,10 @@ in { Unit = { Description = "Nix Garbage Collector"; }; Service = { Type = "oneshot"; - ExecStart = toString (pkgs.writeShellScript "nix-gc" '' - exec "${nixPackage}/bin/nix-collect-garbage ${ + ExecStart = toString (pkgs.writeShellScript "nix-gc" + "exec ${nixPackage}/bin/nix-collect-garbage ${ lib.optionalString (cfg.options != null) cfg.options - }"''); + }"); }; }; systemd.user.timers.nix-gc = { diff --git a/tests/modules/services/nix-gc/basic.nix b/tests/modules/services/nix-gc/basic.nix index 507c9598534f..a06b67238726 100644 --- a/tests/modules/services/nix-gc/basic.nix +++ b/tests/modules/services/nix-gc/basic.nix @@ -25,5 +25,16 @@ timerFile=$(normalizeStorePaths $timerFile) assertFileContent $timerFile ${./expected.timer} + + nixgcScriptFile=$(grep -o \ + '/nix/store/.*-nix-gc' \ + $TESTED/home-files/.config/systemd/user/nix-gc.service + ) + + assertFileExists $nixgcScriptFile + + nixgcScriptFile=$(normalizeStorePaths $nixgcScriptFile) + + assertFileContent $nixgcScriptFile ${./nix-gc-script-expected} ''; } diff --git a/tests/modules/services/nix-gc/nix-gc-script-expected b/tests/modules/services/nix-gc/nix-gc-script-expected new file mode 100644 index 000000000000..0ce2a4f910eb --- /dev/null +++ b/tests/modules/services/nix-gc/nix-gc-script-expected @@ -0,0 +1,2 @@ +#!/nix/store/00000000000000000000000000000000-bash/bin/bash +exec @nix@/bin/nix-collect-garbage --delete-older-than 30d --max-freed $((64 * 1024**3)) From 6e090576c4824b16e8759ebca3958c5b09659ee8 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Wed, 31 Jul 2024 23:45:38 +0200 Subject: [PATCH 390/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/b73c2221a46c13557b1b3be9c2070cc42cf01eb3?narHash=sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg%3D' (2024-07-27) → 'github:NixOS/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d?narHash=sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k%3D' (2024-07-28) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 3ba1333a1216..ed017e149a95 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1722062969, - "narHash": "sha256-QOS0ykELUmPbrrUGmegAUlpmUFznDQeR4q7rFhl8eQg=", + "lastModified": 1722185531, + "narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b73c2221a46c13557b1b3be9c2070cc42cf01eb3", + "rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d", "type": "github" }, "original": { From afc892db74d65042031a093adb6010c4c3378422 Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Fri, 2 Aug 2024 22:21:05 +0200 Subject: [PATCH 391/636] Translate using Weblate (Vietnamese) Currently translated at 44.4% (8 of 18 strings) Translate using Weblate (Vietnamese) Currently translated at 97.2% (36 of 37 strings) Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/vi/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/vi/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules Co-authored-by: goatastronaut0212 --- home-manager/po/vi.po | 23 +++++++++++++---------- modules/po/vi.po | 14 +++++++------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/home-manager/po/vi.po b/home-manager/po/vi.po index 85baac38bcf5..749de0218673 100644 --- a/home-manager/po/vi.po +++ b/home-manager/po/vi.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-06-02 08:12+0000\n" +"PO-Revision-Date: 2024-08-01 04:09+0000\n" "Last-Translator: goatastronaut0212 \n" "Language-Team: Vietnamese \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.6-dev\n" +"X-Generator: Weblate 5.7-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 @@ -97,7 +97,7 @@ msgstr "" #: home-manager/home-manager:146 msgid "Sanity checking Nix" -msgstr "Kiểm tra độ hợp lệ của Nix" +msgstr "Kiểm tra hợp lệ của Nix" #: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" @@ -175,11 +175,12 @@ msgid_plural "" "There are %d unread and relevant news items.\n" "Read them by running the command \"%s news\"." msgstr[0] "" -msgstr[1] "" +"Có %d tin tức liên quan và chưa được đọc.\n" +"Để đọc nó hãy chạy lệnh \"%s news\"." #: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." -msgstr "" +msgstr "Không tồn tại \"news.display\" cấu hình \"%s\"." #: home-manager/home-manager:594 #, sh-format @@ -192,19 +193,19 @@ msgstr "Không thể chạy lệnh xây dựng trong thư mục chỉ cho phép #: home-manager/home-manager:693 msgid "No generation with ID %s" -msgstr "" +msgstr "Không có thế hệ với ID %s" #: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" -msgstr "" +msgstr "Không thể xóa thể hệ hiện tại %s" #: home-manager/home-manager:697 msgid "Removing generation %s" -msgstr "" +msgstr "Đang xóa thế hệ %s" #: home-manager/home-manager:718 msgid "No generations to expire" -msgstr "" +msgstr "Không có bất kỳ thế hệ nào hết hạn" #: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." @@ -237,10 +238,12 @@ msgstr "Tuyệt vời!" #: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." msgstr "" +"Home Manager đã được gỡ cài đặt nhưng home.nix của bạn sẽ được giữ nguyên " +"vẹn." #: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." -msgstr "" +msgstr "expire-generations kỳ vọng 1 đối số, có %d." #: home-manager/home-manager:1113 msgid "Unknown command: %s" diff --git a/modules/po/vi.po b/modules/po/vi.po index 09b510df83ac..827e32066dca 100644 --- a/modules/po/vi.po +++ b/modules/po/vi.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-06-02 08:12+0000\n" +"PO-Revision-Date: 2024-08-01 04:09+0000\n" "Last-Translator: goatastronaut0212 \n" "Language-Team: Vietnamese \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 5.6-dev\n" +"X-Generator: Weblate 5.7-dev\n" #: modules/files.nix:191 msgid "Creating home file links in %s" @@ -53,11 +53,11 @@ msgstr "" #: modules/home-environment.nix:667 msgid "Activating %s" -msgstr "" +msgstr "Đang khởi động %s" #: modules/lib-bash/activation-init.sh:22 msgid "Migrating profile from %s to %s" -msgstr "" +msgstr "Chuyển đổi hồ sơ từ %s tới %s" #: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" @@ -85,11 +85,11 @@ msgstr "" #: modules/lib-bash/activation-init.sh:127 msgid "Error: USER is set to \"%s\" but we expect \"%s\"" -msgstr "" +msgstr "Lỗi: USER được đặt thành \"%s\" nhưng chúng tôi kỳ vọng \"%s\"" #: modules/lib-bash/activation-init.sh:136 msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" -msgstr "" +msgstr "Lỗi: HOME được đặt thành \"%s\" nhưng chúng tôi kỳ vọng \"%s\"" #: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" @@ -97,7 +97,7 @@ msgstr "" #: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" -msgstr "Kiểm tra độ hợp lệ của Nix" +msgstr "Kiểm tra hợp lệ của Nix" #: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" From a6c743980e23f4cef6c2a377f9ffab506568413a Mon Sep 17 00:00:00 2001 From: Anomalocaridid <29845794+Anomalocaridid@users.noreply.github.com> Date: Mon, 5 Aug 2024 17:32:06 -0400 Subject: [PATCH 392/636] dunst: use `-config` flag when `configFile` is set --- modules/services/dunst.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/services/dunst.nix b/modules/services/dunst.nix index bd8c4adfbffd..5bd82a399719 100644 --- a/modules/services/dunst.nix +++ b/modules/services/dunst.nix @@ -65,9 +65,8 @@ in { }; configFile = mkOption { - type = with types; either str path; - default = "${config.xdg.configHome}/dunst/dunstrc"; - defaultText = "$XDG_CONFIG_HOME/dunst/dunstrc"; + type = with types; nullOr (either str path); + default = null; description = '' Path to the configuration file read by dunst. @@ -170,7 +169,7 @@ in { "stock" ]; - mkPath = { basePath, theme, category }: + mkPath = { basePath, theme, category, }: "${basePath}/share/icons/${theme.name}/${theme.size}/${category}"; in concatMapStringsSep ":" mkPath (cartesianProduct { basePath = basePaths; @@ -188,7 +187,9 @@ in { Service = { Type = "dbus"; BusName = "org.freedesktop.Notifications"; - ExecStart = "${cfg.package}/bin/dunst -config ${cfg.configFile}"; + ExecStart = escapeShellArgs ([ "${cfg.package}/bin/dunst" ] ++ + # Using `-config` breaks dunst's drop-ins, so only use it when an alternative path is set + optionals (cfg.configFile != null) [ "-config" cfg.configFile ]); Environment = optionalString (cfg.waylandDisplay != "") "WAYLAND_DISPLAY=${cfg.waylandDisplay}"; }; From b3d5ea65d88d67d4ec578ed11d4d2d51e3de525e Mon Sep 17 00:00:00 2001 From: Ladas552 <94762349+Ladas552@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:21:46 +0500 Subject: [PATCH 393/636] fastfetch: update example for JsonConfig settings fastfetch: update example for JsonConfig settings Using the present version of the example, trows an error: JsonConfig Error: `display.binaryPrefix` has been renamed to `display.size.binaryPrefix`. Sorry for another break change. It occurs because of change in fastfetch 2.19 of JsonConfig - moving `display.binaryPrefix` to `display.size.binaryPrefix` To not confuse the users, this commit changes the example to fit current standard See --- modules/programs/fastfetch.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/fastfetch.nix b/modules/programs/fastfetch.nix index 32021611d042..55a932f9a14a 100644 --- a/modules/programs/fastfetch.nix +++ b/modules/programs/fastfetch.nix @@ -26,7 +26,9 @@ in { }; }; display = { - binaryPrefix = "si"; + size = { + binaryPrefix = "si"; + }; color = "blue"; separator = "  "; }; From 8b7cdfceaf877086fba641bad4607f5db4c4002a Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Sun, 11 Aug 2024 20:11:05 +0200 Subject: [PATCH 394/636] Translate using Weblate (Catalan) Currently translated at 100.0% (37 of 37 strings) Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ca/ Translation: Home Manager/Home Manager CLI Co-authored-by: Tomi Ockier --- home-manager/po/ca.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/ca.po b/home-manager/po/ca.po index 4159c95fc07d..12992995aff8 100644 --- a/home-manager/po/ca.po +++ b/home-manager/po/ca.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-04-05 11:01+0000\n" -"Last-Translator: Leix b \n" +"PO-Revision-Date: 2024-08-07 17:09+0000\n" +"Last-Translator: Tomi Ockier \n" "Language-Team: Catalan \n" "Language: ca\n" @@ -17,12 +17,12 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.5-dev\n" +"X-Generator: Weblate 5.7-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%: falta un argument per %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" From 086f619dd991a4d355c07837448244029fc2d9ab Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 11 Aug 2024 20:11:24 +0200 Subject: [PATCH 395/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/52ec9ac3b12395ad677e8b62106f0b98c1f8569d?narHash=sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k%3D' (2024-07-28) → 'github:NixOS/nixpkgs/5e0ca22929f3342b19569b21b2f3462f053e497b?narHash=sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI%3D' (2024-08-09) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index ed017e149a95..4f6c687e973c 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1722185531, - "narHash": "sha256-veKR07psFoJjINLC8RK4DiLniGGMgF3QMlS4tb74S6k=", + "lastModified": 1723175592, + "narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "52ec9ac3b12395ad677e8b62106f0b98c1f8569d", + "rev": "5e0ca22929f3342b19569b21b2f3462f053e497b", "type": "github" }, "original": { From 2598861031b78aadb4da7269df7ca9ddfc3e1671 Mon Sep 17 00:00:00 2001 From: Alex Hamilton <1622250+Aehmlo@users.noreply.github.com> Date: Sun, 18 Aug 2024 09:15:31 -0400 Subject: [PATCH 396/636] bash: add package option --- modules/programs/bash.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/programs/bash.nix b/modules/programs/bash.nix index 5a328ecda6f7..3a367b9e73ac 100644 --- a/modules/programs/bash.nix +++ b/modules/programs/bash.nix @@ -29,6 +29,8 @@ in { programs.bash = { enable = mkEnableOption "GNU Bourne-Again SHell"; + package = mkPackageOption pkgs "bash" { default = "bashInteractive"; }; + enableCompletion = mkOption { type = types.bool; default = true; @@ -190,7 +192,7 @@ in { HISTIGNORE = escapeShellArg (concatStringsSep ":" cfg.historyIgnore); })); in mkIf cfg.enable { - home.packages = [ pkgs.bashInteractive ]; + home.packages = [ cfg.package ]; home.file.".bash_profile".source = writeBashScript "bash_profile" '' # include .profile if it exists From 40ddec2f8a71d9fb92735f0553dc81a8825596c4 Mon Sep 17 00:00:00 2001 From: sudoforge Date: Fri, 23 Aug 2024 04:29:12 -0700 Subject: [PATCH 397/636] zsh: add option: history.append This change adds the programs.zsh.history.append option in order to manage the configuration of the APPEND_HISTORY zsh option. --- modules/programs/zsh.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 11d77a164481..b6e46392c328 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -34,6 +34,21 @@ let historyModule = types.submodule ({ config, ... }: { options = { + append = mkOption { + type = types.bool; + default = false; + description = '' + If set, zsh sessions will append their history list to the history + file, rather than replace it. Thus, multiple parallel zsh sessions + will all have the new entries from their history lists added to the + history file, in the order that they exit. + + This file will still be periodically re-written to trim it when the + number of lines grows 20% beyond the value specified by + `programs.zsh.history.save`. + ''; + }; + size = mkOption { type = types.int; default = 10000; @@ -669,6 +684,7 @@ in mkdir -p "$(dirname "$HISTFILE")" setopt HIST_FCNTL_LOCK + ${if cfg.history.append then "setopt" else "unsetopt"} APPEND_HISTORY ${if cfg.history.ignoreDups then "setopt" else "unsetopt"} HIST_IGNORE_DUPS ${if cfg.history.ignoreAllDups then "setopt" else "unsetopt"} HIST_IGNORE_ALL_DUPS ${if cfg.history.ignoreSpace then "setopt" else "unsetopt"} HIST_IGNORE_SPACE From 25c12f07366fb98008326cc3910d4231ccf889e9 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 14 Aug 2024 18:07:46 +0200 Subject: [PATCH 398/636] tests: fix escaping of wait command --- tests/integration/nixos/basics.nix | 2 +- tests/integration/standalone/flake-basics.nix | 2 +- tests/integration/standalone/standard-basics.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/integration/nixos/basics.nix b/tests/integration/nixos/basics.nix index 43f537c7944c..e2bff229fe1e 100644 --- a/tests/integration/nixos/basics.nix +++ b/tests/integration/nixos/basics.nix @@ -33,7 +33,7 @@ machine.send_chars("alice\n") machine.wait_until_tty_matches("1", "Password: ") machine.send_chars("foobar\n") - machine.wait_until_tty_matches("1", "alice\@machine") + machine.wait_until_tty_matches("1", "alice\\@machine") def logout_alice(): machine.send_chars("exit\n") diff --git a/tests/integration/standalone/flake-basics.nix b/tests/integration/standalone/flake-basics.nix index 9638862f29c1..d79974b4bcdb 100644 --- a/tests/integration/standalone/flake-basics.nix +++ b/tests/integration/standalone/flake-basics.nix @@ -32,7 +32,7 @@ machine.send_chars("alice\n") machine.wait_until_tty_matches("1", "Password: ") machine.send_chars("foobar\n") - machine.wait_until_tty_matches("1", "alice\@machine") + machine.wait_until_tty_matches("1", "alice\\@machine") def logout_alice(): machine.send_chars("exit\n") diff --git a/tests/integration/standalone/standard-basics.nix b/tests/integration/standalone/standard-basics.nix index b994ff370eb2..a3efb04112ac 100644 --- a/tests/integration/standalone/standard-basics.nix +++ b/tests/integration/standalone/standard-basics.nix @@ -27,7 +27,7 @@ machine.send_chars("alice\n") machine.wait_until_tty_matches("1", "Password: ") machine.send_chars("foobar\n") - machine.wait_until_tty_matches("1", "alice\@machine") + machine.wait_until_tty_matches("1", "alice\\@machine") def logout_alice(): machine.send_chars("exit\n") From b18f3ebc4029c22d437e3424014c8597a8b459a0 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Tue, 13 Aug 2024 08:22:36 +0200 Subject: [PATCH 399/636] systemd: fully deprecate legacy switcher This switches `systemd.user.startServices = true` to be the same as `systemd.user.startServices = "sd-switch"`, previously it would use the "legacy" method. It also introduces a warning that triggers if the user explicitly have `systemd.user.startServices = "legacy"`. See #5452 --- modules/systemd.nix | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/modules/systemd.nix b/modules/systemd.nix index 717a5922d48f..707bb32948c5 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -183,7 +183,7 @@ in { default = "suggest"; type = with types; either bool (enum [ "suggest" "legacy" "sd-switch" ]); - apply = p: if isBool p then if p then "legacy" else "suggest" else p; + apply = p: if isBool p then if p then "sd-switch" else "suggest" else p; description = '' Whether new or changed services that are wanted by active targets should be started. Additionally, stop obsolete services from the @@ -196,17 +196,15 @@ in { {command}`systemctl` commands to run. You will have to manually run those commands after the switch. - `legacy` (or `true`) + `legacy` : Use a Ruby script to, in a more robust fashion, determine the necessary changes and automatically run the - {command}`systemctl` commands. - - `sd-switch` - : Use sd-switch, a third party application, to perform the service - updates. This tool offers more features while having a small - closure size. Note, it requires a fully functional user D-Bus - session. Once tested and deemed sufficiently robust, this will - become the default. + {command}`systemctl` commands. Note, this alternative will soon + be removed. + + `sd-switch` (or `true`) + : Use sd-switch, a tool that determines the necessary changes and + automatically apply them. ''; }; @@ -299,6 +297,12 @@ in { message = "This module is only available on Linux."; }]; + warnings = lib.optional (cfg.startServices == "legacy") '' + Having 'systemd.user.startServices = "legacy"' is deprecated and will soon be removed. + + Please change to 'systemd.user.startServices = true' to use the new systemd unit switcher (sd-switch). + ''; + xdg.configFile = mkMerge [ (lib.listToAttrs ((buildServices "service" cfg.services) ++ (buildServices "slice" cfg.slices) From 5dc25356567119127f046b347c3060a8dd607365 Mon Sep 17 00:00:00 2001 From: Szabin Hamrik Date: Thu, 22 Aug 2024 13:13:23 +0000 Subject: [PATCH 400/636] Translate using Weblate (Hungarian) Currently translated at 22.2% (4 of 18 strings) Translation: Home Manager/Home Manager Modules Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/hu/ --- modules/po/hu.po | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/po/hu.po b/modules/po/hu.po index b52c62933764..99d3e0373c01 100644 --- a/modules/po/hu.po +++ b/modules/po/hu.po @@ -8,29 +8,32 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2024-08-23 14:09+0000\n" +"Last-Translator: Szabin Hamrik \n" +"Language-Team: Hungarian \n" "Language: hu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.7.1-dev\n" #: modules/files.nix:191 msgid "Creating home file links in %s" -msgstr "" +msgstr "Hivatkozások létrehozása itt: %s" #: modules/files.nix:204 msgid "Cleaning up orphan links from %s" -msgstr "" +msgstr "Árva hivatkozások kitakarítása innen: %s" #: modules/files.nix:220 msgid "Creating profile generation %s" -msgstr "" +msgstr "%s. profil generáció létrehozása" #: modules/files.nix:237 msgid "No change so reusing latest profile generation %s" -msgstr "" +msgstr "Nincs változás, legutóbbi %s. generáció lesz használva" #: modules/home-environment.nix:634 msgid "" From c2cd2a52e02f1dfa1c88f95abeb89298d46023be Mon Sep 17 00:00:00 2001 From: name_snrl Date: Wed, 15 May 2024 04:49:17 +0500 Subject: [PATCH 401/636] submodule-support: add default values for top-level configs This way the end user can easily check whether the home-manager configuration is part of the module or not. Example of use: ```nix { lib, nixosConfig, ... }: let mkIfNixos = lib.mkIf nixosConfig != null; in { programs.foot.enable = mkIfNixos true; } ``` --- modules/misc/submodule-support.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/modules/misc/submodule-support.nix b/modules/misc/submodule-support.nix index 400e234cb6ba..82fbc0a30fe6 100644 --- a/modules/misc/submodule-support.nix +++ b/modules/misc/submodule-support.nix @@ -29,4 +29,19 @@ with lib; ''; }; }; + + config = { + # To make it easier for the end user to override the values in the + # configuration depending on the installation method, we set default values + # for the arguments that are defined in the NixOS/nix-darwin modules. + # + # Without these defaults, these attributes would simply not exist, and the + # module system can not inform modules about their non-existence; see + # https://github.com/NixOS/nixpkgs/issues/311709#issuecomment-2110861842 + _module.args = { + osConfig = mkDefault null; + nixosConfig = mkDefault null; + darwinConfig = mkDefault null; + }; + }; } From 471e3eb0a114265bcd62d11d58ba8d3421ee68eb Mon Sep 17 00:00:00 2001 From: Alex Lov Date: Sat, 31 Aug 2024 18:14:50 +0400 Subject: [PATCH 402/636] git: add option to provide difftastic package --- modules/programs/git.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 3061feff77a7..3f5cdc7cc9bc 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -222,6 +222,8 @@ in { ''; }; + package = mkPackageOption pkgs "difftastic" { }; + background = mkOption { type = types.enum [ "light" "dark" ]; default = "light"; @@ -478,11 +480,11 @@ in { }) (mkIf cfg.difftastic.enable { - home.packages = [ pkgs.difftastic ]; + home.packages = [ cfg.difftastic.package ]; programs.git.iniContent = let difftCommand = concatStringsSep " " [ - "${pkgs.difftastic}/bin/difft" + "${getExe cfg.difftastic.package}" "--color ${cfg.difftastic.color}" "--background ${cfg.difftastic.background}" "--display ${cfg.difftastic.display}" From 5130249ab20229480aa732942c9c555a38fb910a Mon Sep 17 00:00:00 2001 From: Martin Eek Gerhardsen Date: Wed, 4 Sep 2024 08:55:42 +0200 Subject: [PATCH 403/636] taskwarrior-sync: add package option Add option to change which package is used for taskwarrior-sync, to e.g. taskwarrior3. --- modules/services/taskwarrior-sync.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/services/taskwarrior-sync.nix b/modules/services/taskwarrior-sync.nix index 9c01f414babe..d3099dd78129 100644 --- a/modules/services/taskwarrior-sync.nix +++ b/modules/services/taskwarrior-sync.nix @@ -12,6 +12,8 @@ in { options.services.taskwarrior-sync = { enable = mkEnableOption "Taskwarrior periodic sync"; + package = mkPackageOption pkgs "taskwarrior" { }; + frequency = mkOption { type = types.str; default = "*:0/5"; @@ -36,7 +38,7 @@ in { Service = { CPUSchedulingPolicy = "idle"; IOSchedulingClass = "idle"; - ExecStart = "${pkgs.taskwarrior}/bin/task synchronize"; + ExecStart = "${cfg.package}/bin/task synchronize"; }; }; From 03b49187a2e41f042896a26761ca86ce90cb7f2c Mon Sep 17 00:00:00 2001 From: Lulu <10565807+lulu-berlin@users.noreply.github.com> Date: Fri, 6 Sep 2024 14:51:44 +0200 Subject: [PATCH 404/636] sway: indent sway configuration options Fix the indentation for the configuration of `input`, `output` and `seat` to match that of `mode`. --- modules/services/window-managers/i3-sway/sway.nix | 2 +- .../modules/services/window-managers/sway/sway-modules.conf | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index f4e437218d71..3acd6b17c347 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -249,7 +249,7 @@ let moduleStr = moduleType: name: attrs: '' ${moduleType} "${name}" { ${concatStringsSep "\n" - (mapAttrsToList (name: value: "${name} ${value}") attrs)} + (mapAttrsToList (name: value: " ${name} ${value}") attrs)} } ''; inputStr = moduleStr "input"; diff --git a/tests/modules/services/window-managers/sway/sway-modules.conf b/tests/modules/services/window-managers/sway/sway-modules.conf index d0302d07a9d7..d36a164ee6e3 100644 --- a/tests/modules/services/window-managers/sway/sway-modules.conf +++ b/tests/modules/services/window-managers/sway/sway-modules.conf @@ -71,15 +71,15 @@ bindsym Mod1+v splitv bindsym Mod1+w layout tabbed input "*" { -xkb_variant dvorak + xkb_variant dvorak } output "HDMI-A-2" { -bg ~/path/to/background.png fill + bg ~/path/to/background.png fill } seat "*" { -hide_cursor when-typing enable + hide_cursor when-typing enable } mode "resize" { From b00bdf59c0aa5515a0a8e1773fa19128e7efa181 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Fri, 6 Sep 2024 13:55:36 +0100 Subject: [PATCH 405/636] xdg: add option 'xdg.stateFile' --- modules/misc/xdg.nix | 12 ++++++++++++ tests/modules/misc/xdg/file-gen.nix | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/misc/xdg.nix b/modules/misc/xdg.nix index 23cbe72a2fb4..a47a33f5607a 100644 --- a/modules/misc/xdg.nix +++ b/modules/misc/xdg.nix @@ -70,6 +70,16 @@ in { ''; }; + stateFile = mkOption { + type = fileType "xdg.stateFile" "xdg.stateHome" + cfg.stateHome; + default = { }; + description = '' + Attribute set of files to link into the user's XDG + state home. + ''; + }; + stateHome = mkOption { type = types.path; defaultText = "~/.local/state"; @@ -122,6 +132,8 @@ in { cfg.configFile) (mapAttrs' (name: file: nameValuePair "${cfg.dataHome}/${name}" file) cfg.dataFile) + (mapAttrs' (name: file: nameValuePair "${cfg.stateHome}/${name}" file) + cfg.stateFile) { "${cfg.cacheHome}/.keep".text = ""; } ]; } diff --git a/tests/modules/misc/xdg/file-gen.nix b/tests/modules/misc/xdg/file-gen.nix index 47a3102c275c..7514f414ff6c 100644 --- a/tests/modules/misc/xdg/file-gen.nix +++ b/tests/modules/misc/xdg/file-gen.nix @@ -11,8 +11,8 @@ with lib; xdg.configFile.test.text = "config"; xdg.dataFile.test.text = "data"; + xdg.stateFile.test.text = "state"; home.file."${config.xdg.cacheHome}/test".text = "cache"; - home.file."${config.xdg.stateHome}/test".text = "state"; nmt.script = '' assertFileExists home-files/.dummy-config/test From 5b95e0611b498fac7c8425d1b1bc4cacfd64e7f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenci=20=C3=81kos?= Date: Mon, 2 Sep 2024 19:09:21 +0200 Subject: [PATCH 406/636] Translate using Weblate (Hungarian) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently translated at 33.3% (6 of 18 strings) Translate using Weblate (Hungarian) Currently translated at 97.2% (36 of 37 strings) Co-authored-by: Ferenci Ákos Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/hu/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/hu/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules --- home-manager/po/hu.po | 67 +++++++++++++++++++++++++++++++++---------- modules/po/hu.po | 9 +++--- 2 files changed, 57 insertions(+), 19 deletions(-) diff --git a/home-manager/po/hu.po b/home-manager/po/hu.po index a127cf1b0c03..3cfab2551a63 100644 --- a/home-manager/po/hu.po +++ b/home-manager/po/hu.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-07-05 14:09+0000\n" +"PO-Revision-Date: 2024-09-02 17:09+0000\n" "Last-Translator: Ferenci Ákos \n" "Language-Team: Hungarian \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.7-dev\n" +"X-Generator: Weblate 5.8-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 @@ -54,6 +54,8 @@ msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" +"A tartalék Home Manager fájlútvonal %s elavult és fájl/könyvtár található " +"itt." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:118 @@ -76,19 +78,37 @@ msgid "" "\n" " $ rm -r \"%s\"" msgstr "" +"A felmerült hiba elhárítására a következőket tegye:\n" +"\n" +"1. Közvetlen adja át a Home Manager-nek a fájlútvonalat, pl.:\n" +"\n" +" { programs.home-manager.path = \"%s\"; }\n" +"\n" +" sor konfigurációhoz való hozzáadásával.\n" +"\n" +" Amennyiben a Home Manager-t közvetlen importolja, használhatja a 'path' " +"paramétert\n" +"\n" +" pkgs.callPackage/path/tohome-manager-package{path = \"%s\"; }\n" +" a Home Manager csomag meghívásakor.\n" +"\n" +" 2. Távolítsa el az elavult fájlútvonalat.\n" +"\n" +" $ rm -r \"$s\"" #: home-manager/home-manager:146 msgid "Sanity checking Nix" -msgstr "" +msgstr "Nix épségének ellenőrzése" #: home-manager/home-manager:166 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" +"Nem található megfelelő profil mappa, %s és %s útvonalak lettek kipróbálva." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:221 msgid "Can't inspect options of a flake configuration" -msgstr "" +msgstr "Nem lehet a flake konfiguráció beállításait megtekinteni." #: home-manager/home-manager:296 home-manager/home-manager:319 #: home-manager/home-manager:1051 @@ -121,6 +141,13 @@ msgid "" "to configure Home Manager. Run 'man home-configuration.nix' to\n" "see all available options." msgstr "" +"Elkészült! A home-manager eszköz most már installálva van és a \n" +"\n" +" %s\n" +"\n" +"fájl szerkesztésével konfigurálhatja a Home Manager-t. \n" +"Futtassa a 'man home-configuration.nix' parancsot az összes opció " +"áttekintéséhez." #. translators: The "%s" specifier will be replaced by a URL. #: home-manager/home-manager:485 @@ -131,6 +158,11 @@ msgid "" "\n" "if the error seems to be the fault of Home Manager." msgstr "" +"Uh oh, az installáció nem sikerült! Kérem készítsen egy jelentést erről a \n" +"\n" +" %s\n" +"\n" +"helyen amennyiben a hiba a Home Manager miatt lépett fel." #. translators: Here "flake" is a noun that refers to the Nix Flakes feature. #: home-manager/home-manager:496 @@ -145,16 +177,20 @@ msgid_plural "" "There are %d unread and relevant news items.\n" "Read them by running the command \"%s news\"." msgstr[0] "" +"%d olvasatlan és releváns hírt kapott.\n" +"Olvassa el a \"%s news\" futattásával." msgstr[1] "" +"%d olvasatlan és releváns hírt kapott.\n" +"Olvassa el őket a \"%s news\" futattásával." #: home-manager/home-manager:586 msgid "Unknown \"news.display\" setting \"%s\"." -msgstr "" +msgstr "Ismeretlen \"news.display\" opció \"%s\"." #: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Kérem állítása be az $EDITOR vagy a $VISUAL környezeti változókat." #: home-manager/home-manager:612 msgid "Cannot run build in read-only directory" @@ -162,11 +198,11 @@ msgstr "Build futtatása nem lehetséges csak-olvasható könyvtárban" #: home-manager/home-manager:693 msgid "No generation with ID %s" -msgstr "" +msgstr "Nem található generáció a következő ID-val: %" #: home-manager/home-manager:695 msgid "Cannot remove the current generation %s" -msgstr "" +msgstr "A jelenlegi generáció %s nem eltávolítható" #: home-manager/home-manager:697 msgid "Removing generation %s" @@ -174,11 +210,11 @@ msgstr "%s generáció eltávolítása" #: home-manager/home-manager:718 msgid "No generations to expire" -msgstr "" +msgstr "Nincs lejárandó generáció" #: home-manager/home-manager:729 msgid "No home-manager packages seem to be installed." -msgstr "" +msgstr "Nem található installált Home Manager csomag" #: home-manager/home-manager:811 msgid "Unknown argument %s" @@ -186,19 +222,19 @@ msgstr "Ismeretlen argumentum %s" #: home-manager/home-manager:835 msgid "This will remove Home Manager from your system." -msgstr "" +msgstr "Ez a művelet eltávolítja a Home Manager-t a rendszeréről." #: home-manager/home-manager:838 msgid "This is a dry run, nothing will actually be uninstalled." -msgstr "" +msgstr "Ez egy üres járat, semmi nem lesz valójában eltávolítva." #: home-manager/home-manager:842 msgid "Really uninstall Home Manager?" -msgstr "" +msgstr "Biztosan eltávolítja a Home Managert-t?" #: home-manager/home-manager:848 msgid "Switching to empty Home Manager configuration..." -msgstr "" +msgstr "Átváltás üres Home Manager konfigurációra..." #: home-manager/home-manager:863 msgid "Yay!" @@ -206,7 +242,7 @@ msgstr "Hurrá!" #: home-manager/home-manager:868 msgid "Home Manager is uninstalled but your home.nix is left untouched." -msgstr "" +msgstr "Home Manager eltávolítva, de a home.nix fájl érintetlenül maradt." #: home-manager/home-manager:1091 msgid "expire-generations expects one argument, got %d." @@ -219,3 +255,4 @@ msgstr "Ismeretlen parancs: %s" #: home-manager/install.nix:18 msgid "This derivation is not buildable, please run it using nix-shell." msgstr "" +"Ez a származtatás nem építhető fel, kérlek futtasd nix-shell segítségével." diff --git a/modules/po/hu.po b/modules/po/hu.po index 99d3e0373c01..2b013ccc1154 100644 --- a/modules/po/hu.po +++ b/modules/po/hu.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-08-23 14:09+0000\n" -"Last-Translator: Szabin Hamrik \n" +"PO-Revision-Date: 2024-09-02 17:09+0000\n" +"Last-Translator: Ferenci Ákos \n" "Language-Team: Hungarian \n" "Language: hu\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.7.1-dev\n" +"X-Generator: Weblate 5.8-dev\n" #: modules/files.nix:191 msgid "Creating home file links in %s" @@ -62,6 +62,7 @@ msgstr "" #: modules/lib-bash/activation-init.sh:54 msgid "Could not find suitable profile directory, tried %s and %s" msgstr "" +"Nem található megfelelő profil mappa, %s és %s útvonalak lettek kipróbálva." #: modules/lib-bash/activation-init.sh:83 msgid "Sanity checking oldGenNum and oldGenPath" @@ -97,7 +98,7 @@ msgstr "" #: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" -msgstr "" +msgstr "Nix épségének ellenőrzése" #: modules/lib-bash/activation-init.sh:170 msgid "This is a dry run" From 7d569851e95e8b360a3d7a2f52c5fc6a597a7657 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Fri, 6 Sep 2024 15:03:51 +0200 Subject: [PATCH 407/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/5e0ca22929f3342b19569b21b2f3462f053e497b?narHash=sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI%3D' (2024-08-09) → 'github:NixOS/nixpkgs/12228ff1752d7b7624a54e9c1af4b222b3c1073b?narHash=sha256-Ym04C5%2BqovuQDYL/rKWSR%2BWESseQBbNAe5DsXNx5trY%3D' (2024-08-31) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 4f6c687e973c..7282c6b457c8 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1723175592, - "narHash": "sha256-M0xJ3FbDUc4fRZ84dPGx5VvgFsOzds77KiBMW/mMTnI=", + "lastModified": 1725103162, + "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5e0ca22929f3342b19569b21b2f3462f053e497b", + "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", "type": "github" }, "original": { From 127ccc3eb7e36fa75e8c3fbd8a343154f66cc1c6 Mon Sep 17 00:00:00 2001 From: DCsunset Date: Mon, 19 Aug 2024 23:58:10 +0000 Subject: [PATCH 408/636] i3/sway: support str type for font size --- .../window-managers/i3-sway/lib/options.nix | 2 +- .../i3/i3-fonts-deprecated.nix | 6 ++++- .../window-managers/i3/i3-fonts-expected.conf | 22 +++++++++++++++++++ .../services/window-managers/i3/i3-fonts.nix | 21 +++++++++++++----- 4 files changed, 43 insertions(+), 8 deletions(-) diff --git a/modules/services/window-managers/i3-sway/lib/options.nix b/modules/services/window-managers/i3-sway/lib/options.nix index 1f6820f5deec..2869c2bf8f19 100644 --- a/modules/services/window-managers/i3-sway/lib/options.nix +++ b/modules/services/window-managers/i3-sway/lib/options.nix @@ -31,7 +31,7 @@ let }; size = mkOption { - type = types.float; + type = types.either types.float types.str; default = 8.0; description = '' The font size to use for window titles. diff --git a/tests/modules/services/window-managers/i3/i3-fonts-deprecated.nix b/tests/modules/services/window-managers/i3/i3-fonts-deprecated.nix index 0216681f35d3..fefff9904129 100644 --- a/tests/modules/services/window-managers/i3/i3-fonts-deprecated.nix +++ b/tests/modules/services/window-managers/i3/i3-fonts-deprecated.nix @@ -7,7 +7,10 @@ enable = true; config = { - bars = [{ fonts = [ "FontAwesome" "Iosevka 11.500000" ]; }]; + bars = [ + { fonts = [ "FontAwesome" "Iosevka 11.500000" ]; } + { fonts = [ "FontAwesome" "Iosevka Bold Semi-Condensed 14px" ]; } + ]; fonts = [ "DejaVuSansMono" "Terminus Bold Semi-Condensed 13.500000" ]; }; }; @@ -21,5 +24,6 @@ test.asserts.warnings.expected = [ "Specifying i3.config.fonts as a list is deprecated. Use the attrset version instead." "Specifying i3.config.bars[].fonts as a list is deprecated. Use the attrset version instead." + "Specifying i3.config.bars[].fonts as a list is deprecated. Use the attrset version instead." ]; } diff --git a/tests/modules/services/window-managers/i3/i3-fonts-expected.conf b/tests/modules/services/window-managers/i3/i3-fonts-expected.conf index e2606b3207a5..9ce876874059 100644 --- a/tests/modules/services/window-managers/i3/i3-fonts-expected.conf +++ b/tests/modules/services/window-managers/i3/i3-fonts-expected.conf @@ -94,3 +94,25 @@ bar { } } +bar { + font pango:FontAwesome, Iosevka Bold Semi-Condensed 14px + mode dock + hidden_state hide + position bottom + status_command @i3status@/bin/i3status + i3bar_command @i3@/bin/i3bar + workspace_buttons yes + strip_workspace_numbers no + tray_output primary + colors { + background #000000 + statusline #ffffff + separator #666666 + focused_workspace #4c7899 #285577 #ffffff + active_workspace #333333 #5f676a #ffffff + inactive_workspace #333333 #222222 #888888 + urgent_workspace #2f343a #900000 #ffffff + binding_mode #2f343a #900000 #ffffff + } +} + diff --git a/tests/modules/services/window-managers/i3/i3-fonts.nix b/tests/modules/services/window-managers/i3/i3-fonts.nix index decd9fcca4fb..061f7a0bd734 100644 --- a/tests/modules/services/window-managers/i3/i3-fonts.nix +++ b/tests/modules/services/window-managers/i3/i3-fonts.nix @@ -7,12 +7,21 @@ enable = true; config = { - bars = [{ - fonts = { - names = [ "FontAwesome" "Iosevka" ]; - size = 11.5; - }; - }]; + bars = [ + { + fonts = { + names = [ "FontAwesome" "Iosevka" ]; + size = 11.5; + }; + } + { + fonts = { + names = [ "FontAwesome" "Iosevka" ]; + style = "Bold Semi-Condensed"; + size = "14px"; + }; + } + ]; fonts = { names = [ "DejaVuSansMono" "Terminus" ]; style = "Bold Semi-Condensed"; From aaebdea769a5c10f1c6e50ebdf5924c1a13f0cda Mon Sep 17 00:00:00 2001 From: NAHO <90870942+trueNAHO@users.noreply.github.com> Date: Fri, 30 Aug 2024 20:48:07 +0200 Subject: [PATCH 409/636] taskwarrior: support taskwarrior3 migration Support taskwarrior3 migration, following the approach in [1] to avoid breaking changes. [1]: https://github.com/NixOS/nixpkgs/pull/303632 Closes: https://github.com/nix-community/home-manager/issues/5310 Link: https://github.com/nix-community/home-manager/pull/5782 --- modules/programs/taskwarrior.nix | 3 ++- modules/services/taskwarrior-sync.nix | 3 ++- tests/modules/programs/taskwarrior/taskwarrior.nix | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/programs/taskwarrior.nix b/modules/programs/taskwarrior.nix index e90b1eb23777..9b5af43ee345 100644 --- a/modules/programs/taskwarrior.nix +++ b/modules/programs/taskwarrior.nix @@ -85,7 +85,8 @@ in { ''; }; - package = mkPackageOption pkgs "taskwarrior" { }; + package = + mkPackageOption pkgs "taskwarrior" { example = "pkgs.taskwarrior3"; }; }; }; diff --git a/modules/services/taskwarrior-sync.nix b/modules/services/taskwarrior-sync.nix index d3099dd78129..3bad924cf76f 100644 --- a/modules/services/taskwarrior-sync.nix +++ b/modules/services/taskwarrior-sync.nix @@ -12,7 +12,8 @@ in { options.services.taskwarrior-sync = { enable = mkEnableOption "Taskwarrior periodic sync"; - package = mkPackageOption pkgs "taskwarrior" { }; + package = + mkPackageOption pkgs "taskwarrior" { example = "pkgs.taskwarrior3"; }; frequency = mkOption { type = types.str; diff --git a/tests/modules/programs/taskwarrior/taskwarrior.nix b/tests/modules/programs/taskwarrior/taskwarrior.nix index f21198f5732b..163135a03ba4 100644 --- a/tests/modules/programs/taskwarrior/taskwarrior.nix +++ b/tests/modules/programs/taskwarrior/taskwarrior.nix @@ -6,6 +6,7 @@ with lib; config = { programs.taskwarrior = { enable = true; + package = pkgs.taskwarrior3; colorTheme = "dark-violets-256"; dataLocation = "/some/data/location"; config = { @@ -18,7 +19,7 @@ with lib; ''; }; - test.stubs.taskwarrior = { }; + test.stubs.taskwarrior3 = { }; nmt.script = '' assertFileExists home-files/.config/task/home-manager-taskrc From ec4c6928bbacc89cf10e9c959a7a47cbaad95344 Mon Sep 17 00:00:00 2001 From: Nina Morgan <764185+Faeranne@users.noreply.github.com> Date: Sun, 8 Sep 2024 03:52:15 -0400 Subject: [PATCH 410/636] firefox: fix selection of lastUserContextId The lastUserContextId value should match the highest context ID from the containers set in a given profile. This update ensures that this always is the case. --- modules/programs/firefox/mkFirefoxModule.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index f22af019b066..8475c95a618e 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -102,7 +102,8 @@ let ${builtins.toJSON { version = 4; lastUserContextId = - elemAt (mapAttrsToList (_: container: container.id) containers) 0; + foldlAttrs (acc: _: value: if value.id > acc then value.id else acc) 0 + containers; identities = mapAttrsToList containerToIdentity containers ++ [ { userContextId = 4294967294; # 2^32 - 2 From 8a175a89137fe798b33c476d4dae17dba5fb3fd3 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 8 Sep 2024 09:55:05 +0200 Subject: [PATCH 411/636] tests: change quoting to match new Nixpkgs behavior Fixes tests that are affected by . --- .../misc/xsession/basic-xprofile-expected.txt | 2 +- .../misc/xsession/basic-xsession-expected.txt | 2 +- tests/modules/programs/atuin/set-flags.nix | 4 ++-- tests/modules/programs/bat/bat.nix | 2 +- tests/modules/programs/bat/deprecated-options.nix | 2 +- .../programs/bemenu/basic-configuration.nix | 2 +- tests/modules/programs/gpg/immutable-keyfiles.nix | 2 +- tests/modules/programs/gpg/mutable-keyfiles.nix | 2 +- .../programs/mujmap/mujmap-defaults-expected.toml | 2 +- tests/modules/programs/pls/bash.nix | 2 +- tests/modules/programs/pls/fish.nix | 2 +- tests/modules/programs/pls/zsh.nix | 4 ++-- .../thefuck/integration-enabled-instant.nix | 4 ++-- .../programs/thefuck/integration-enabled.nix | 4 ++-- tests/modules/programs/zsh/syntax-highlighting.nix | 4 ++-- tests/modules/programs/zsh/zsh-abbr.nix | 2 +- .../modules/services/cachix-agent/basic-setup.nix | 2 +- .../services/cliphist/cliphist-extra-options.nix | 8 ++++---- ...ce-emacs-after-graphical-session-target.service | 2 +- .../services/emacs/emacs-service-emacs.service | 2 +- .../services/emacs/emacs-socket-27-emacs.service | 2 +- .../services/emacs/emacs-socket-28-emacs.service | 2 +- .../fnott/systemd-user-service-expected.service | 2 +- .../services/imapnotify/imapnotify-config.json | 2 +- .../mpd-mpris/configuration-with-password.service | 2 +- .../services/mpd/basic-configuration.service | 2 +- .../modules/services/mpd/start-when-needed.service | 2 +- .../parcellite/parcellite-expected.service | 2 +- tests/modules/services/pasystray/expected.service | 2 +- .../gammastep-basic-configuration-expected.service | 2 +- .../redshift-basic-configuration-expected.service | 2 +- tests/modules/services/remmina/basic-config.nix | 2 +- .../signaturepdf/basic-configuration.service | 2 +- tests/modules/services/swayosd/swayosd.nix | 2 +- .../services/syncthing/common/extra-options.nix | 2 +- .../modules/services/window-managers/bspwm/bspwmrc | 14 +++++++------- .../herbstluftwm-simple-config-autostart | 12 ++++++------ .../wlsunset/wlsunset-service-expected.service | 2 +- tests/modules/systemd/user-config.nix | 2 +- 39 files changed, 58 insertions(+), 58 deletions(-) diff --git a/tests/modules/misc/xsession/basic-xprofile-expected.txt b/tests/modules/misc/xsession/basic-xprofile-expected.txt index b3d591c225db..282f8f5c5de5 100644 --- a/tests/modules/misc/xsession/basic-xprofile-expected.txt +++ b/tests/modules/misc/xsession/basic-xprofile-expected.txt @@ -9,7 +9,7 @@ fi # script starts up graphical-session.target. systemctl --user stop graphical-session.target graphical-session-pre.target -systemctl --user import-environment 'DBUS_SESSION_BUS_ADDRESS' 'DISPLAY' 'SSH_AUTH_SOCK' 'XAUTHORITY' 'XDG_DATA_DIRS' 'XDG_RUNTIME_DIR' 'XDG_SESSION_ID' 'EXTRA_IMPORTED_VARIABLE' +systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS DISPLAY SSH_AUTH_SOCK XAUTHORITY XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID EXTRA_IMPORTED_VARIABLE profile extra commands diff --git a/tests/modules/misc/xsession/basic-xsession-expected.txt b/tests/modules/misc/xsession/basic-xsession-expected.txt index a95bb35abc8e..243c57622a51 100644 --- a/tests/modules/misc/xsession/basic-xsession-expected.txt +++ b/tests/modules/misc/xsession/basic-xsession-expected.txt @@ -17,4 +17,4 @@ while [ -n "$(systemctl --user --no-legend --state=deactivating list-units)" ]; sleep 0.5 done -systemctl --user unset-environment 'DBUS_SESSION_BUS_ADDRESS' 'DISPLAY' 'SSH_AUTH_SOCK' 'XAUTHORITY' 'XDG_DATA_DIRS' 'XDG_RUNTIME_DIR' 'XDG_SESSION_ID' 'EXTRA_IMPORTED_VARIABLE' +systemctl --user unset-environment DBUS_SESSION_BUS_ADDRESS DISPLAY SSH_AUTH_SOCK XAUTHORITY XDG_DATA_DIRS XDG_RUNTIME_DIR XDG_SESSION_ID EXTRA_IMPORTED_VARIABLE diff --git a/tests/modules/programs/atuin/set-flags.nix b/tests/modules/programs/atuin/set-flags.nix index b6e8330d1395..ebc68a5d10a1 100644 --- a/tests/modules/programs/atuin/set-flags.nix +++ b/tests/modules/programs/atuin/set-flags.nix @@ -25,12 +25,12 @@ assertFileExists home-files/.bashrc assertFileContains \ home-files/.bashrc \ - "eval \"\$(@atuin@/bin/atuin init bash '--disable-ctrl-r' '--disable-up-arrow')\"" + "eval \"\$(@atuin@/bin/atuin init bash --disable-ctrl-r --disable-up-arrow)\"" assertFileExists home-files/.zshrc assertFileContains \ home-files/.zshrc \ - "eval \"\$(@atuin@/bin/atuin init zsh '--disable-ctrl-r' '--disable-up-arrow')\"" + "eval \"\$(@atuin@/bin/atuin init zsh --disable-ctrl-r --disable-up-arrow)\"" assertFileExists home-files/.config/fish/config.fish assertFileContains \ home-files/.config/fish/config.fish \ diff --git a/tests/modules/programs/bat/bat.nix b/tests/modules/programs/bat/bat.nix index cd169ffb7bd7..578310486553 100644 --- a/tests/modules/programs/bat/bat.nix +++ b/tests/modules/programs/bat/bat.nix @@ -35,7 +35,7 @@ with lib; --map-syntax='*.jenkinsfile:Groovy' --map-syntax='*.props:Java Properties' --pager='less -FR' - --theme='TwoDark' + --theme=TwoDark --show-all '' } diff --git a/tests/modules/programs/bat/deprecated-options.nix b/tests/modules/programs/bat/deprecated-options.nix index 31a10413aeee..096815cbed9e 100644 --- a/tests/modules/programs/bat/deprecated-options.nix +++ b/tests/modules/programs/bat/deprecated-options.nix @@ -45,7 +45,7 @@ with lib; --map-syntax='*.jenkinsfile:Groovy' --map-syntax='*.props:Java Properties' --pager='less -FR' - --theme='TwoDark' + --theme=TwoDark '' } diff --git a/tests/modules/programs/bemenu/basic-configuration.nix b/tests/modules/programs/bemenu/basic-configuration.nix index b8d84469cb05..01708d2022d0 100644 --- a/tests/modules/programs/bemenu/basic-configuration.nix +++ b/tests/modules/programs/bemenu/basic-configuration.nix @@ -24,6 +24,6 @@ nmt.script = '' assertFileExists home-path/etc/profile.d/hm-session-vars.sh assertFileContains home-path/etc/profile.d/hm-session-vars.sh \ - "export BEMENU_OPTS=\"'--ab' '#1e1e2e' '--af' '#cdd6f4' '--fb' '#1e1e2e' '--ff' '#cdd6f4' '--hb' '#1e1e2e' '--hf' '#f9e2af' '--ignorecase' '--line-height' '28' '--nb' '#1e1e2e' '--nf' '#cdd6f4' '--prompt' 'open' '--tb' '#1e1e2e' '--tf' '#f38ba8' '--width-factor' '0.300000'\"" + "export BEMENU_OPTS=\"--ab '#1e1e2e' --af '#cdd6f4' --fb '#1e1e2e' --ff '#cdd6f4' --hb '#1e1e2e' --hf '#f9e2af' --ignorecase --line-height 28 --nb '#1e1e2e' --nf '#cdd6f4' --prompt open --tb '#1e1e2e' --tf '#f38ba8' --width-factor 0.300000\"" ''; } diff --git a/tests/modules/programs/gpg/immutable-keyfiles.nix b/tests/modules/programs/gpg/immutable-keyfiles.nix index 15dd2b9e7865..37889a11e960 100644 --- a/tests/modules/programs/gpg/immutable-keyfiles.nix +++ b/tests/modules/programs/gpg/immutable-keyfiles.nix @@ -27,7 +27,7 @@ }; nmt.script = '' - assertFileNotRegex activate "^export GNUPGHOME='/home/hm-user/.gnupg'$" + assertFileNotRegex activate "^export GNUPGHOME=/home/hm-user/.gnupg$" assertFileRegex activate \ '^install -m 0700 /nix/store/[0-9a-z]*-gpg-pubring/trustdb.gpg "/home/hm-user/.gnupg/trustdb.gpg"$' diff --git a/tests/modules/programs/gpg/mutable-keyfiles.nix b/tests/modules/programs/gpg/mutable-keyfiles.nix index ea87a3e0a886..6ffcb7053f26 100644 --- a/tests/modules/programs/gpg/mutable-keyfiles.nix +++ b/tests/modules/programs/gpg/mutable-keyfiles.nix @@ -17,7 +17,7 @@ test.stubs.systemd = { }; # depends on gnupg.override nmt.script = '' - assertFileContains activate "export GNUPGHOME='/home/hm-user/.gnupg'" + assertFileContains activate "export GNUPGHOME=/home/hm-user/.gnupg" assertFileContains activate "unset GNUPGHOME QUIET_ARG keyId importTrust" diff --git a/tests/modules/programs/mujmap/mujmap-defaults-expected.toml b/tests/modules/programs/mujmap/mujmap-defaults-expected.toml index 87b5bf402aa7..7d94afa64b17 100644 --- a/tests/modules/programs/mujmap/mujmap-defaults-expected.toml +++ b/tests/modules/programs/mujmap/mujmap-defaults-expected.toml @@ -1,6 +1,6 @@ auto_create_new_mailboxes = true fqdn = "example.com" -password_command = "'password-command'" +password_command = "password-command" username = "home.manager" [tags] diff --git a/tests/modules/programs/pls/bash.nix b/tests/modules/programs/pls/bash.nix index d6fff5f4ef31..f7e0429b520c 100644 --- a/tests/modules/programs/pls/bash.nix +++ b/tests/modules/programs/pls/bash.nix @@ -20,7 +20,7 @@ with lib; assertFileExists home-files/.bashrc assertFileContains \ home-files/.bashrc \ - "alias ls='@pls@/bin/pls'" + "alias ls=@pls@/bin/pls" assertFileContains \ home-files/.bashrc \ "alias ll='@pls@/bin/pls -d perms -d user -d group -d size -d mtime -d git'" diff --git a/tests/modules/programs/pls/fish.nix b/tests/modules/programs/pls/fish.nix index d555a11c1982..05dbb10b0fe2 100644 --- a/tests/modules/programs/pls/fish.nix +++ b/tests/modules/programs/pls/fish.nix @@ -24,7 +24,7 @@ with lib; assertFileExists home-files/.config/fish/config.fish assertFileContains \ home-files/.config/fish/config.fish \ - "alias ls '@pls@/bin/pls'" + "alias ls @pls@/bin/pls" assertFileContains \ home-files/.config/fish/config.fish \ "alias ll '@pls@/bin/pls -d perms -d user -d group -d size -d mtime -d git'" diff --git a/tests/modules/programs/pls/zsh.nix b/tests/modules/programs/pls/zsh.nix index 3a27c4d3e577..8f644e7535ad 100644 --- a/tests/modules/programs/pls/zsh.nix +++ b/tests/modules/programs/pls/zsh.nix @@ -23,10 +23,10 @@ with lib; assertFileExists home-files/.zshrc assertFileContains \ home-files/.zshrc \ - "alias -- 'ls'='@pls@/bin/pls'" + "alias -- ls=@pls@/bin/pls" assertFileContains \ home-files/.zshrc \ - "alias -- 'll'='@pls@/bin/pls -d perms -d user -d group -d size -d mtime -d git'" + "alias -- ll='@pls@/bin/pls -d perms -d user -d group -d size -d mtime -d git'" ''; }; } diff --git a/tests/modules/programs/thefuck/integration-enabled-instant.nix b/tests/modules/programs/thefuck/integration-enabled-instant.nix index 18584acbd3d3..7b89276af024 100644 --- a/tests/modules/programs/thefuck/integration-enabled-instant.nix +++ b/tests/modules/programs/thefuck/integration-enabled-instant.nix @@ -16,11 +16,11 @@ assertFileExists home-files/.bashrc assertFileContains \ home-files/.bashrc \ - 'eval "$(@thefuck@/bin/thefuck '"'"'--alias'"'"' '"'"'--enable-experimental-instant-mode'"'"')"' + 'eval "$(@thefuck@/bin/thefuck --alias --enable-experimental-instant-mode)"' assertFileExists home-files/.zshrc assertFileContains \ home-files/.zshrc \ - 'eval "$(@thefuck@/bin/thefuck '"'"'--alias'"'"' '"'"'--enable-experimental-instant-mode'"'"')"' + 'eval "$(@thefuck@/bin/thefuck --alias --enable-experimental-instant-mode)"' ''; } diff --git a/tests/modules/programs/thefuck/integration-enabled.nix b/tests/modules/programs/thefuck/integration-enabled.nix index 54d6b794e523..fb220e6cb03a 100644 --- a/tests/modules/programs/thefuck/integration-enabled.nix +++ b/tests/modules/programs/thefuck/integration-enabled.nix @@ -15,7 +15,7 @@ assertFileExists home-files/.bashrc assertFileContains \ home-files/.bashrc \ - 'eval "$(@thefuck@/bin/thefuck '"'"'--alias'"'"')"' + 'eval "$(@thefuck@/bin/thefuck --alias)"' assertFileExists home-files/.config/fish/functions/fuck.fish assertFileContains \ @@ -33,7 +33,7 @@ assertFileExists home-files/.zshrc assertFileContains \ home-files/.zshrc \ - 'eval "$(@thefuck@/bin/thefuck '"'"'--alias'"'"')"' + 'eval "$(@thefuck@/bin/thefuck --alias)"' assertFileExists home-files/.config/nushell/config.nu assertFileContains \ diff --git a/tests/modules/programs/zsh/syntax-highlighting.nix b/tests/modules/programs/zsh/syntax-highlighting.nix index 981cefb633dc..052b228bd989 100644 --- a/tests/modules/programs/zsh/syntax-highlighting.nix +++ b/tests/modules/programs/zsh/syntax-highlighting.nix @@ -19,8 +19,8 @@ with lib; nmt.script = '' assertFileContains home-files/.zshrc "source ${pkgs.hello}/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" - assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_HIGHLIGHTERS+=('brackets' 'pattern' 'cursor')" - assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_STYLES+=('comment' 'fg=#6c6c6c')" + assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_HIGHLIGHTERS+=(brackets pattern cursor)" + assertFileContains home-files/.zshrc "ZSH_HIGHLIGHT_STYLES+=(comment 'fg=#6c6c6c')" ''; }; } diff --git a/tests/modules/programs/zsh/zsh-abbr.nix b/tests/modules/programs/zsh/zsh-abbr.nix index 0e016fafe8b8..7e8370d00a3f 100644 --- a/tests/modules/programs/zsh/zsh-abbr.nix +++ b/tests/modules/programs/zsh/zsh-abbr.nix @@ -12,6 +12,6 @@ abbreviations=home-files/.config/zsh-abbr/user-abbreviations assertFileExists $abbreviations - assertFileContains $abbreviations "abbr 'ga'='git add'" + assertFileContains $abbreviations "abbr ga='git add'" ''; } diff --git a/tests/modules/services/cachix-agent/basic-setup.nix b/tests/modules/services/cachix-agent/basic-setup.nix index 0f84ae35c5f5..22c088900999 100644 --- a/tests/modules/services/cachix-agent/basic-setup.nix +++ b/tests/modules/services/cachix-agent/basic-setup.nix @@ -20,7 +20,7 @@ [Service] Environment=PATH=@nix@/bin EnvironmentFile=/home/hm-user/.config/cachix-agent.token - ExecStart='@cachix-agent@/bin/cachix' 'deploy' 'agent' 'test-agent' 'home-manager' + ExecStart=@cachix-agent@/bin/cachix deploy agent test-agent home-manager KillMode=process Restart=on-failure diff --git a/tests/modules/services/cliphist/cliphist-extra-options.nix b/tests/modules/services/cliphist/cliphist-extra-options.nix index 65d4fdca1ca8..dcf097c6cdad 100644 --- a/tests/modules/services/cliphist/cliphist-extra-options.nix +++ b/tests/modules/services/cliphist/cliphist-extra-options.nix @@ -16,9 +16,9 @@ assertFileExists $servicePath/cliphist.service assertFileExists $servicePath/cliphist-images.service - assertFileRegex $servicePath/cliphist.service " '-max-dedupe-search' '10' " - assertFileRegex $servicePath/cliphist.service " '-max-items' '500' " - assertFileRegex $servicePath/cliphist-images.service " '-max-dedupe-search' '10' " - assertFileRegex $servicePath/cliphist-images.service " '-max-items' '500' " + assertFileRegex $servicePath/cliphist.service " -max-dedupe-search 10 " + assertFileRegex $servicePath/cliphist.service " -max-items 500 " + assertFileRegex $servicePath/cliphist-images.service " -max-dedupe-search 10 " + assertFileRegex $servicePath/cliphist-images.service " -max-items 500 " ''; } diff --git a/tests/modules/services/emacs/emacs-service-emacs-after-graphical-session-target.service b/tests/modules/services/emacs/emacs-service-emacs-after-graphical-session-target.service index 193327621162..9349f9cc113e 100644 --- a/tests/modules/services/emacs/emacs-service-emacs-after-graphical-session-target.service +++ b/tests/modules/services/emacs/emacs-service-emacs-after-graphical-session-target.service @@ -2,7 +2,7 @@ WantedBy=graphical-session.target [Service] -ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon '-f' 'exwm-enable'" +ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon -f exwm-enable" Restart=on-failure SuccessExitStatus=15 Type=notify diff --git a/tests/modules/services/emacs/emacs-service-emacs.service b/tests/modules/services/emacs/emacs-service-emacs.service index 64120f4c05c7..142bc208c0ef 100644 --- a/tests/modules/services/emacs/emacs-service-emacs.service +++ b/tests/modules/services/emacs/emacs-service-emacs.service @@ -2,7 +2,7 @@ WantedBy=default.target [Service] -ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon '-f' 'exwm-enable'" +ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon -f exwm-enable" Restart=on-failure SuccessExitStatus=15 Type=notify diff --git a/tests/modules/services/emacs/emacs-socket-27-emacs.service b/tests/modules/services/emacs/emacs-socket-27-emacs.service index b44694d39a7e..fe85103c0e97 100644 --- a/tests/modules/services/emacs/emacs-socket-27-emacs.service +++ b/tests/modules/services/emacs/emacs-socket-27-emacs.service @@ -1,5 +1,5 @@ [Service] -ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon='%t/emacs/server' '-f' 'exwm-enable'" +ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon=%t/emacs/server -f exwm-enable" ExecStartPost=@coreutils@/bin/chmod --changes -w %t/emacs ExecStopPost=@coreutils@/bin/chmod --changes +w %t/emacs Restart=on-failure diff --git a/tests/modules/services/emacs/emacs-socket-28-emacs.service b/tests/modules/services/emacs/emacs-socket-28-emacs.service index 153f5d8fe598..ab711bc84bdd 100644 --- a/tests/modules/services/emacs/emacs-socket-28-emacs.service +++ b/tests/modules/services/emacs/emacs-socket-28-emacs.service @@ -1,5 +1,5 @@ [Service] -ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon='%t/emacs/server' '-f' 'exwm-enable'" +ExecStart=@runtimeShell@ -l -c "@emacs@/bin/emacs --fg-daemon=%t/emacs/server -f exwm-enable" Restart=on-failure SuccessExitStatus=15 Type=notify diff --git a/tests/modules/services/fnott/systemd-user-service-expected.service b/tests/modules/services/fnott/systemd-user-service-expected.service index 1d09bfad5514..c39a7b19b09e 100644 --- a/tests/modules/services/fnott/systemd-user-service-expected.service +++ b/tests/modules/services/fnott/systemd-user-service-expected.service @@ -1,6 +1,6 @@ [Service] BusName=org.freedesktop.Notifications -ExecStart=@fnott@/bin/fnott -c '/home/hm-user/.config/fnott/fnott.ini' +ExecStart=@fnott@/bin/fnott -c /home/hm-user/.config/fnott/fnott.ini Type=dbus [Unit] diff --git a/tests/modules/services/imapnotify/imapnotify-config.json b/tests/modules/services/imapnotify/imapnotify-config.json index 21276857dd87..646fa221289c 100644 --- a/tests/modules/services/imapnotify/imapnotify-config.json +++ b/tests/modules/services/imapnotify/imapnotify-config.json @@ -1 +1 @@ -{"boxes":["Inbox"],"host":"imap.example.com","onNewMail":"@notmuch@/bin/notmuch new\n","passwordCmd":"'password-command'","port":993,"tls":true,"tlsOptions":{"starttls":false},"username":"home.manager"} \ No newline at end of file +{"boxes":["Inbox"],"host":"imap.example.com","onNewMail":"@notmuch@/bin/notmuch new\n","passwordCmd":"password-command","port":993,"tls":true,"tlsOptions":{"starttls":false},"username":"home.manager"} \ No newline at end of file diff --git a/tests/modules/services/mpd-mpris/configuration-with-password.service b/tests/modules/services/mpd-mpris/configuration-with-password.service index 868d55539d3b..8c8290875339 100644 --- a/tests/modules/services/mpd-mpris/configuration-with-password.service +++ b/tests/modules/services/mpd-mpris/configuration-with-password.service @@ -2,7 +2,7 @@ WantedBy=default.target [Service] -ExecStart=@mpd-mpris@/bin/mpd-mpris -host 'example.com' -network 'tcp' -no-instance -port 1234 -pwd 'my_password' +ExecStart=@mpd-mpris@/bin/mpd-mpris -host example.com -network tcp -no-instance -port 1234 -pwd my_password Restart=on-failure RestartSec=5s Type=simple diff --git a/tests/modules/services/mpd/basic-configuration.service b/tests/modules/services/mpd/basic-configuration.service index 678d16d70232..feb155ac4693 100644 --- a/tests/modules/services/mpd/basic-configuration.service +++ b/tests/modules/services/mpd/basic-configuration.service @@ -3,7 +3,7 @@ WantedBy=default.target [Service] Environment=PATH=/home/hm-user/.nix-profile/bin -ExecStart=@mpd@/bin/mpd --no-daemon /nix/store/00000000000000000000000000000000-mpd.conf '--verbose' +ExecStart=@mpd@/bin/mpd --no-daemon /nix/store/00000000000000000000000000000000-mpd.conf --verbose ExecStartPre=/nix/store/00000000000000000000000000000000-bash/bin/bash -c "/nix/store/00000000000000000000000000000000-coreutils/bin/mkdir -p '/home/hm-user/.local/share/mpd' '/home/hm-user/.local/share/mpd/playlists'" Type=notify diff --git a/tests/modules/services/mpd/start-when-needed.service b/tests/modules/services/mpd/start-when-needed.service index 87eb4b79a2f9..ac98a3f97770 100644 --- a/tests/modules/services/mpd/start-when-needed.service +++ b/tests/modules/services/mpd/start-when-needed.service @@ -1,6 +1,6 @@ [Service] Environment=PATH=/home/hm-user/.nix-profile/bin -ExecStart=@mpd@/bin/mpd --no-daemon /nix/store/00000000000000000000000000000000-mpd.conf '--verbose' +ExecStart=@mpd@/bin/mpd --no-daemon /nix/store/00000000000000000000000000000000-mpd.conf --verbose ExecStartPre=/nix/store/00000000000000000000000000000000-bash/bin/bash -c "/nix/store/00000000000000000000000000000000-coreutils/bin/mkdir -p '/home/hm-user/.local/share/mpd' '/home/hm-user/.local/share/mpd/playlists'" Type=notify diff --git a/tests/modules/services/parcellite/parcellite-expected.service b/tests/modules/services/parcellite/parcellite-expected.service index 02d8243a6ebc..f1e7e2333237 100644 --- a/tests/modules/services/parcellite/parcellite-expected.service +++ b/tests/modules/services/parcellite/parcellite-expected.service @@ -2,7 +2,7 @@ WantedBy=graphical-session.target [Service] -ExecStart=@parcellite@/bin/parcellite '--no-icon' +ExecStart=@parcellite@/bin/parcellite --no-icon Restart=on-abort [Unit] diff --git a/tests/modules/services/pasystray/expected.service b/tests/modules/services/pasystray/expected.service index b2c23c518f1d..7bea7f2155a1 100644 --- a/tests/modules/services/pasystray/expected.service +++ b/tests/modules/services/pasystray/expected.service @@ -3,7 +3,7 @@ WantedBy=graphical-session.target [Service] Environment=PATH=@paprefs@/bin:@pavucontrol@/bin -ExecStart='@pasystray@/bin/pasystray' '-g' +ExecStart=@pasystray@/bin/pasystray -g [Unit] After=graphical-session-pre.target diff --git a/tests/modules/services/redshift-gammastep/gammastep-basic-configuration-expected.service b/tests/modules/services/redshift-gammastep/gammastep-basic-configuration-expected.service index d172e3a8638c..35eaf519f0b7 100644 --- a/tests/modules/services/redshift-gammastep/gammastep-basic-configuration-expected.service +++ b/tests/modules/services/redshift-gammastep/gammastep-basic-configuration-expected.service @@ -2,7 +2,7 @@ WantedBy=graphical-session.target [Service] -ExecStart=@gammastep@/bin/gammastep '-c' '/home/hm-user/.config/gammastep/config.ini' +ExecStart=@gammastep@/bin/gammastep -c /home/hm-user/.config/gammastep/config.ini Restart=on-failure RestartSec=3 diff --git a/tests/modules/services/redshift-gammastep/redshift-basic-configuration-expected.service b/tests/modules/services/redshift-gammastep/redshift-basic-configuration-expected.service index 6ee4cdda23e5..5dce5dc193bf 100644 --- a/tests/modules/services/redshift-gammastep/redshift-basic-configuration-expected.service +++ b/tests/modules/services/redshift-gammastep/redshift-basic-configuration-expected.service @@ -2,7 +2,7 @@ WantedBy=graphical-session.target [Service] -ExecStart=@redshift@/bin/redshift '-c' '/home/hm-user/.config/redshift/redshift.conf' +ExecStart=@redshift@/bin/redshift -c /home/hm-user/.config/redshift/redshift.conf Restart=on-failure RestartSec=3 diff --git a/tests/modules/services/remmina/basic-config.nix b/tests/modules/services/remmina/basic-config.nix index 2741353aee45..de8d0e08bc0d 100644 --- a/tests/modules/services/remmina/basic-config.nix +++ b/tests/modules/services/remmina/basic-config.nix @@ -17,7 +17,7 @@ assertFileExists $serviceFile assertFileRegex $serviceFile 'ExecStart=.*/bin/dummy' - assertFileRegex $serviceFile "dummy '--icon' '--enable-extra-hardening'" + assertFileRegex $serviceFile "dummy --icon --enable-extra-hardening" mimetypeFile='./home-files/.local/share/mime/packages/application-x-rdp.xml' diff --git a/tests/modules/services/signaturepdf/basic-configuration.service b/tests/modules/services/signaturepdf/basic-configuration.service index 0775fff651ef..e73b586c6fe2 100644 --- a/tests/modules/services/signaturepdf/basic-configuration.service +++ b/tests/modules/services/signaturepdf/basic-configuration.service @@ -2,7 +2,7 @@ WantedBy=default.target [Service] -ExecStart=/signaturepdf/bin/signaturepdf 9494 '-d' 'upload_max_filesize=24M' +ExecStart=/signaturepdf/bin/signaturepdf 9494 -d 'upload_max_filesize=24M' [Unit] Description=signaturepdf; signing, organizing, editing metadatas or compressing PDFs diff --git a/tests/modules/services/swayosd/swayosd.nix b/tests/modules/services/swayosd/swayosd.nix index 1bc7d5354787..7b9b2a806931 100644 --- a/tests/modules/services/swayosd/swayosd.nix +++ b/tests/modules/services/swayosd/swayosd.nix @@ -21,7 +21,7 @@ WantedBy=graphical-session.target [Service] - ExecStart=@swayosd@/bin/swayosd-server --display DISPLAY --style '/etc/xdg/swayosd/style.css' --top-margin 0.100000 + ExecStart=@swayosd@/bin/swayosd-server --display DISPLAY --style /etc/xdg/swayosd/style.css --top-margin 0.100000 Restart=always RestartSec=2s Type=simple diff --git a/tests/modules/services/syncthing/common/extra-options.nix b/tests/modules/services/syncthing/common/extra-options.nix index 016850cc37b1..df968636fa1b 100644 --- a/tests/modules/services/syncthing/common/extra-options.nix +++ b/tests/modules/services/syncthing/common/extra-options.nix @@ -13,7 +13,7 @@ lib.mkMerge [ nmt.script = '' assertFileExists home-files/.config/systemd/user/syncthing.service assertFileContains home-files/.config/systemd/user/syncthing.service \ - "ExecStart='@syncthing@/bin/syncthing' '-no-browser' '-no-restart' '-logflags=0' '-foo' '-bar \"baz\"'" + "ExecStart=@syncthing@/bin/syncthing -no-browser -no-restart '-logflags=0' -foo '-bar \"baz\"'" ''; }) (lib.mkIf pkgs.stdenv.isDarwin { diff --git a/tests/modules/services/window-managers/bspwm/bspwmrc b/tests/modules/services/window-managers/bspwm/bspwmrc index ccc07008869b..70f32ff2c7e7 100755 --- a/tests/modules/services/window-managers/bspwm/bspwmrc +++ b/tests/modules/services/window-managers/bspwm/bspwmrc @@ -1,14 +1,14 @@ extra config early -if [[ $(bspc query --desktops --names --monitor 'focused') == Desktop ]]; then - bspc monitor 'focused' -d 'desktop 1' 'd'\''esk top' +if [[ $(bspc query --desktops --names --monitor focused) == Desktop ]]; then + bspc monitor focused -d 'desktop 1' 'd'\''esk top' fi -bspc config 'border_width' '2' -bspc config 'external_rules_command' '/path/to/external rules command' -bspc config 'gapless_monocle' 'on' -bspc config 'ignore_ewmh_fullscreen' 'enter,exit' -bspc config 'split_ratio' '0.520000' +bspc config border_width 2 +bspc config external_rules_command '/path/to/external rules command' +bspc config gapless_monocle on +bspc config ignore_ewmh_fullscreen enter,exit +bspc config split_ratio 0.520000 bspc rule -r '*' bspc rule -a '*' 'center=off' 'desktop=d'\''esk top#next' 'split_dir=north' 'sticky=on' 'unknown_rule=42' diff --git a/tests/modules/services/window-managers/herbstluftwm/herbstluftwm-simple-config-autostart b/tests/modules/services/window-managers/herbstluftwm/herbstluftwm-simple-config-autostart index 78d4d7d564d2..85ef45b126f0 100644 --- a/tests/modules/services/window-managers/herbstluftwm/herbstluftwm-simple-config-autostart +++ b/tests/modules/services/window-managers/herbstluftwm/herbstluftwm-simple-config-autostart @@ -15,18 +15,18 @@ herbstclient mouseunbind --all herbstclient unrule --all herbstclient set always_show_frame true -herbstclient set default_frame_layout 'max' +herbstclient set default_frame_layout max herbstclient set frame_bg_active_color '#000000' -herbstclient set frame_gap '12' -herbstclient set frame_padding '-12' +herbstclient set frame_gap 12 +herbstclient set frame_padding -12 -for tag in '1' 'with space' 'wə1rd#ch@rs'\'''; do +for tag in 1 'with space' 'wə1rd#ch@rs'\'''; do herbstclient add "$tag" done if @herbstluftwm@/bin/herbstclient object_tree tags.by-name.default &>/dev/null; then - herbstclient use '1' - herbstclient merge_tag default '1' + herbstclient use 1 + herbstclient merge_tag default 1 fi diff --git a/tests/modules/services/wlsunset/wlsunset-service-expected.service b/tests/modules/services/wlsunset/wlsunset-service-expected.service index f311d900ec2d..fecd05b9f523 100644 --- a/tests/modules/services/wlsunset/wlsunset-service-expected.service +++ b/tests/modules/services/wlsunset/wlsunset-service-expected.service @@ -2,7 +2,7 @@ WantedBy=test.target [Service] -ExecStart=@wlsunset@/bin/wlsunset '-L' '128.8' '-T' '6000' '-g' '0.6' '-l' '12.3' '-t' '3500' +ExecStart=@wlsunset@/bin/wlsunset -L 128.8 -T 6000 -g 0.6 -l 12.3 -t 3500 [Unit] Description=Day/night gamma adjustments for Wayland compositors. diff --git a/tests/modules/systemd/user-config.nix b/tests/modules/systemd/user-config.nix index f977d2f194e2..3e6a9fcbeb9d 100644 --- a/tests/modules/systemd/user-config.nix +++ b/tests/modules/systemd/user-config.nix @@ -17,7 +17,7 @@ pkgs.writeText "expected" '' [Manager] DefaultCPUAccounting=true - DefaultEnvironment=PATH='/bin:/sbin:/some where' TEST='abc' + DefaultEnvironment=PATH='/bin:/sbin:/some where' TEST=abc LogLevel=debug '' } From 77c94148285563113246eaf9f8df5488e00c81d0 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Mon, 13 Nov 2023 13:44:03 +0100 Subject: [PATCH 412/636] k9s: allow defining custom theme file Signed-off-by: Sefa Eyeoglu --- modules/programs/k9s.nix | 20 ++++++++++++------- .../modules/programs/k9s/example-settings.nix | 5 +++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/modules/programs/k9s.nix b/modules/programs/k9s.nix index 6ef53291adfd..97944822f443 100644 --- a/modules/programs/k9s.nix +++ b/modules/programs/k9s.nix @@ -46,7 +46,7 @@ in { }; skins = mkOption { - type = types.attrsOf yamlFormat.type; + type = with types; attrsOf (either yamlFormat.type path); default = { }; description = '' Skin files written to {file}`$XDG_CONFIG_HOME/k9s/skins/` (linux) @@ -54,13 +54,16 @@ in { for supported values. ''; example = literalExpression '' - my_blue_skin = { - k9s = { - body = { - fgColor = "dodgerblue"; + { + my_blue_skin = { + k9s = { + body = { + fgColor = "dodgerblue"; + }; }; }; - }; + my_red_skin = ./red_skin.yaml; + } ''; }; @@ -174,7 +177,10 @@ in { "k9s/skins/${name}.yaml" else "Library/Application Support/k9s/skins/${name}.yaml") { - source = yamlFormat.generate "k9s-skin-${name}.yaml" value; + source = if lib.types.path.check value then + value + else + yamlFormat.generate "k9s-skin-${name}.yaml" value; }) cfg.skins; enableXdgConfig = !isDarwin || config.xdg.enable; diff --git a/tests/modules/programs/k9s/example-settings.nix b/tests/modules/programs/k9s/example-settings.nix index 23a42120b394..0000d81da6b9 100644 --- a/tests/modules/programs/k9s/example-settings.nix +++ b/tests/modules/programs/k9s/example-settings.nix @@ -39,6 +39,7 @@ }; }; }; + "default2" = ./example-skin-expected.yaml; "alt-skin" = { k9s = { body = { @@ -92,6 +93,10 @@ assertFileContent \ "home-files/${configDir}/skins/default.yaml" \ ${./example-skin-expected.yaml} + assertFileExists "home-files/${configDir}/skins/default2.yaml" + assertFileContent \ + "home-files/${configDir}/skins/default2.yaml" \ + ${./example-skin-expected.yaml} assertFileExists "home-files/${configDir}/skins/alt-skin.yaml" assertFileContent \ "home-files/${configDir}/skins/alt-skin.yaml" \ From be47a2bdf278c57c2d05e747a13ed31cef54a037 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Mon, 9 Sep 2024 08:34:44 +0200 Subject: [PATCH 413/636] k9s: remove katexochen as maintainer --- modules/programs/k9s.nix | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/programs/k9s.nix b/modules/programs/k9s.nix index 97944822f443..0dd10788395a 100644 --- a/modules/programs/k9s.nix +++ b/modules/programs/k9s.nix @@ -9,11 +9,7 @@ let inherit (pkgs.stdenv.hostPlatform) isDarwin; in { - meta.maintainers = with maintainers; [ - katexochen - liyangau - hm.maintainers.LucasWagler - ]; + meta.maintainers = with maintainers; [ liyangau hm.maintainers.LucasWagler ]; imports = [ (mkRenamedOptionModule [ "programs" "k9s" "skin" ] [ From 10541f19c584fe9633c921903d8c095d5411e041 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Sun, 8 Sep 2024 11:10:43 -0400 Subject: [PATCH 414/636] pqiv: add boolean support --- modules/programs/pqiv.nix | 17 ++++++++++++----- tests/modules/programs/pqiv/settings.nix | 6 +++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/modules/programs/pqiv.nix b/modules/programs/pqiv.nix index ed1a0b280964..a99b28de8710 100644 --- a/modules/programs/pqiv.nix +++ b/modules/programs/pqiv.nix @@ -23,14 +23,13 @@ in { default = { }; description = '' Configuration written to {file}`$XDG_CONFIG_HOME/pqivrc`. See - {manpage}`pqiv(1)` for a list of available options. To set a - boolean flag, set the value to 1. + {manpage}`pqiv(1)` for a list of available options. ''; example = literalExpression '' { options = { - lazy-load = 1; - hide-info-box = 1; + lazy-load = true; + hide-info-box = true; background-pattern = "black"; thumbnail-size = "256x256"; command-1 = "thunar"; @@ -68,7 +67,15 @@ in { xdg.configFile."pqivrc" = mkIf (cfg.settings != { } && cfg.extraConfig != "") { text = lib.concatLines [ - (generators.toINI { } cfg.settings) + (generators.toINI { + mkKeyValue = key: value: + let + value' = if isBool value then + (if value then "1" else "0") + else + toString value; + in "${key} = ${value'}"; + } cfg.settings) cfg.extraConfig ]; }; diff --git a/tests/modules/programs/pqiv/settings.nix b/tests/modules/programs/pqiv/settings.nix index 277203da5346..117fa6f04ef5 100644 --- a/tests/modules/programs/pqiv/settings.nix +++ b/tests/modules/programs/pqiv/settings.nix @@ -6,7 +6,7 @@ package = config.lib.test.mkStubPackage { name = "pqiv"; }; settings = { options = { - hide-info-box = 1; + hide-info-box = true; thumbnail-size = "256x256"; }; }; @@ -21,8 +21,8 @@ assertFileContent home-files/.config/pqivrc ${ builtins.toFile "pqiv.expected" '' [options] - hide-info-box=1 - thumbnail-size=256x256 + hide-info-box = 1 + thumbnail-size = 256x256 [keybindings] t { montage_mode_enter() } From e5fa72bad0c6f533e8d558182529ee2acc9454fe Mon Sep 17 00:00:00 2001 From: "Weblate (bot)" Date: Tue, 10 Sep 2024 08:04:35 +0200 Subject: [PATCH 415/636] Translate using Weblate (Romanian) Currently translated at 100.0% (37 of 37 strings) Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ro/ Translation: Home Manager/Home Manager CLI Co-authored-by: Felix Puscasu --- home-manager/po/ro.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/ro.po b/home-manager/po/ro.po index bd48a4a83354..b4be27ce4c3f 100644 --- a/home-manager/po/ro.po +++ b/home-manager/po/ro.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-03-31 22:01+0000\n" -"Last-Translator: SMFloris \n" +"PO-Revision-Date: 2024-09-09 10:09+0000\n" +"Last-Translator: Felix Puscasu \n" "Language-Team: Romanian \n" "Language: ro\n" @@ -18,12 +18,12 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " "20)) ? 1 : 2;\n" -"X-Generator: Weblate 5.5-dev\n" +"X-Generator: Weblate 5.8-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: Argument lipsă pentru %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" From 8a1671642826633586d12ac3158e463c7a50a112 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Wed, 11 Sep 2024 08:40:28 +0200 Subject: [PATCH 416/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/12228ff1752d7b7624a54e9c1af4b222b3c1073b?narHash=sha256-Ym04C5%2BqovuQDYL/rKWSR%2BWESseQBbNAe5DsXNx5trY%3D' (2024-08-31) → 'github:NixOS/nixpkgs/574d1eac1c200690e27b8eb4e24887f8df7ac27c?narHash=sha256-v3rIhsJBOMLR8e/RNWxr828tB%2BWywYIoajrZKFM%2B0Gg%3D' (2024-09-06) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 7282c6b457c8..28440e300221 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1725103162, - "narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=", + "lastModified": 1725634671, + "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b", + "rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c", "type": "github" }, "original": { From 51e46643429b3dc96dadf3014757582eca6adf28 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 11 Sep 2024 18:16:19 +0200 Subject: [PATCH 417/636] treewide: use non-deprecated substitute arguments --- docs/default.nix | 2 +- modules/programs/alacritty.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/default.nix b/docs/default.nix index 21f00fb48c60..dd79c4590367 100644 --- a/docs/default.nix +++ b/docs/default.nix @@ -147,7 +147,7 @@ in { substitute \ ${hmOptionsDocs.optionsJSON}/nix-support/hydra-build-products \ $out/nix-support/hydra-build-products \ - --replace \ + --replace-fail \ '${hmOptionsDocs.optionsJSON}/share/doc/nixos' \ "$out/share/doc/home-manager" ''; diff --git a/modules/programs/alacritty.nix b/modules/programs/alacritty.nix index e799e2696492..6fa7fb6e80f5 100644 --- a/modules/programs/alacritty.nix +++ b/modules/programs/alacritty.nix @@ -56,7 +56,7 @@ in { buildCommand = lib.concatStringsSep "\n" [ prevAttrs.buildCommand # TODO: why is this needed? Is there a better way to retain escape sequences? - "substituteInPlace $out --replace '\\\\' '\\'" + "substituteInPlace $out --replace-quiet '\\\\' '\\'" ]; }); }; From e1c6094075d28d496a1b0db208afd31e0b213d67 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 12 Sep 2024 13:42:59 +0200 Subject: [PATCH 418/636] systemd: unify handling of switch environment --- modules/systemd.nix | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/modules/systemd.nix b/modules/systemd.nix index 707bb32948c5..77d9df862ed1 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -325,11 +325,9 @@ in { home.activation.reloadSystemd = hm.dag.entryAfter [ "linkGeneration" ] (let cmd = { suggest = '' - PATH=${dirOf cfg.systemctlPath}:$PATH \ bash ${./systemd-activate.sh} "''${oldGenPath=}" "$newGenPath" ''; legacy = '' - PATH=${dirOf cfg.systemctlPath}:$PATH \ ${pkgs.ruby}/bin/ruby ${./systemd-activate.rb} \ "''${oldGenPath=}" "$newGenPath" "${servicesStartTimeoutMs}" ''; @@ -346,10 +344,14 @@ in { ''; }; - ensureRuntimeDir = - "XDG_RUNTIME_DIR=\${XDG_RUNTIME_DIR:-/run/user/$(id -u)}"; + # Make sure that we have an environment where we are likely to + # successfully talk with systemd. + ensureSystemd = '' + env XDG_RUNTIME_DIR="''${XDG_RUNTIME_DIR:-/run/user/$(id -u)}" \ + PATH="${dirOf cfg.systemctlPath}:$PATH" \ + ''; - systemctl = "${ensureRuntimeDir} ${cfg.systemctlPath}"; + systemctl = "${ensureSystemd} systemctl"; in '' systemdStatus=$(${systemctl} --user is-system-running 2>&1 || true) @@ -372,8 +374,7 @@ in { newUnitsDir=${pkgs.emptyDirectory} fi - ${ensureRuntimeDir} \ - ${getAttr cfg.startServices cmd} + ${ensureSystemd} ${getAttr cfg.startServices cmd} unset newUnitsDir oldUnitsDir else From da8406a6ff556b86dc368e96ca8bd81b2704a91a Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 12 Sep 2024 13:43:29 +0200 Subject: [PATCH 419/636] systemd: use getExe for sd-switch --- modules/systemd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/systemd.nix b/modules/systemd.nix index 77d9df862ed1..9d3777c65ab0 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -337,7 +337,7 @@ in { else ""; in '' - ${pkgs.sd-switch}/bin/sd-switch \ + ${lib.getExe pkgs.sd-switch} \ ''${DRY_RUN:+--dry-run} $VERBOSE_ARG ${timeoutArg} \ ''${oldUnitsDir:+--old-units $oldUnitsDir} \ --new-units "$newUnitsDir" From 2b1957a0a3db7d63c1844abb84223655c30a7eb0 Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Fri, 16 Aug 2024 13:42:11 +0800 Subject: [PATCH 420/636] home-manager: fix early exit due to FQDN error Since 89670e27e101b9b30f5900fc1eb6530258d316b1, FQDN lookup errors from `hostname -f` may cause an early exit of the whole program. This commit fixes the problem by absorbing the FQDN query inside the `if` statement. --- home-manager/home-manager | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/home-manager/home-manager b/home-manager/home-manager index ab4de5387db2..8b7bbc76a7cd 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -202,8 +202,7 @@ function setFlakeAttribute() { local hostnameArray=() # FQDN lookup can fail depending on the resolver. local fqdn - fqdn="$(hostname -f 2> /dev/null)" - if [[ $? -eq 0 ]]; then + if fqdn="$(hostname -f 2> /dev/null)"; then hostnameArray+=( "$USER@$fqdn" ) fi # Check FQDN, long, and short hostnames; long first to preserve From c82fc8cf3f75e667ad9dd3e5df721119b63723b3 Mon Sep 17 00:00:00 2001 From: Bryan Lai Date: Sat, 17 Aug 2024 14:10:12 +0800 Subject: [PATCH 421/636] home-manager: use `hostname` from GNU inetutils This partially reverts commit 89670e27e101b9b30f5900fc1eb6530258d316b1. Co-authored-by: Johannes Maier --- home-manager/default.nix | 4 ++-- home-manager/home-manager | 11 +---------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/home-manager/default.nix b/home-manager/default.nix index 5e0e1e462f39..50fda77e5cf9 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -1,5 +1,5 @@ { runCommand, lib, bash, callPackage, coreutils, findutils, gettext, gnused, jq -, less, ncurses, unixtools +, less, ncurses, inetutils # used for pkgs.path for nixos-option , pkgs @@ -38,7 +38,7 @@ in runCommand "home-manager" { less ncurses nixos-option - unixtools.hostname + inetutils # for `hostname` ] }" \ --subst-var-by HOME_MANAGER_LIB '${../lib/bash/home-manager.sh}' \ diff --git a/home-manager/home-manager b/home-manager/home-manager index 8b7bbc76a7cd..5bf796b47680 100644 --- a/home-manager/home-manager +++ b/home-manager/home-manager @@ -198,18 +198,9 @@ function setFlakeAttribute() { ;; *) local name="$USER" - - local hostnameArray=() - # FQDN lookup can fail depending on the resolver. - local fqdn - if fqdn="$(hostname -f 2> /dev/null)"; then - hostnameArray+=( "$USER@$fqdn" ) - fi # Check FQDN, long, and short hostnames; long first to preserve # pre-existing behaviour in case both happen to be defined. - hostnameArray+=( "$USER@$(hostname)" "$USER@$(hostname -s)" ) - - for n in "${hostnameArray[@]}"; do + for n in "$USER@$(hostname -f)" "$USER@$(hostname)" "$USER@$(hostname -s)"; do if [[ "$(nix eval "$flake#homeConfigurations" --apply "x: x ? \"$n\"")" == "true" ]]; then name="$n" if [[ -v VERBOSE ]]; then From ef506124579ff6280a43a9596bb2a5049872bf8e Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Sat, 31 Aug 2024 21:12:16 -0400 Subject: [PATCH 422/636] gpg-agent: add launchd service agent and sockets This adds a Darwin Launchd agent along with its sockets to make gpg-agent starts at load or whenever the sockets are needed. Fixes: https://github.com/nix-community/home-manager/issues/3864 --- .editorconfig | 3 + modules/services/gpg-agent.nix | 182 ++++++++++-------- tests/default.nix | 2 +- .../services/gpg-agent/default-homedir.nix | 2 +- .../services/gpg-agent/expected-agent.plist | 41 ++++ .../services/gpg-agent/override-homedir.nix | 10 +- 6 files changed, 152 insertions(+), 88 deletions(-) create mode 100644 tests/modules/services/gpg-agent/expected-agent.plist diff --git a/.editorconfig b/.editorconfig index a41f0862b85c..c036a7541f23 100644 --- a/.editorconfig +++ b/.editorconfig @@ -19,3 +19,6 @@ indent_style = tab [*.md] trim_trailing_whitespace = false + +[*.plist] +insert_final_newline = false diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index cce5ac191041..7af58c8df500 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -30,7 +30,7 @@ let $env.SSH_AUTH_SOCK = ($env.SSH_AUTH_SOCK? | default (${gpgPkg}/bin/gpgconf --list-dirs agent-ssh-socket)) ''; - # mimic `gpgconf` output for use in `systemd` unit definitions. + # mimic `gpgconf` output for use in the service definitions. # we cannot use `gpgconf` directly because it heavily depends on system # state, but we need the values at build time. original: # https://github.com/gpg/gnupg/blob/c6702d77d936b3e9d91b34d8fdee9599ab94ee1b/common/homedir.c#L672-L681 @@ -38,10 +38,14 @@ let let hash = substring 0 24 (hexStringToBase32 (builtins.hashString "sha1" homedir)); - in if homedir == options.programs.gpg.homedir.default then - "%t/gnupg/${dir}" + subdir = if homedir == options.programs.gpg.homedir.default then + "${dir}" + else + "d.${hash}/${dir}"; + in if pkgs.stdenv.isDarwin then + "/private/var/run/org.nix-community.home.gpg-agent/${subdir}" else - "%t/gnupg/d.${hash}/${dir}"; + "%t/gnupg/${subdir}"; # Act like `xxd -r -p | base32` but with z-base-32 alphabet and no trailing padding. # Written in Nix for purity. @@ -77,6 +81,32 @@ let }; in hexString: (foldl' go initState (stringToCharacters hexString)).ret; + # Systemd socket unit generator. + mkSocket = { desc, docs, stream, fdName }: { + Unit = { + Description = desc; + Documentation = docs; + }; + + Socket = { + ListenStream = gpgconf "${stream}"; + FileDescriptorName = "${fdName}"; + Service = "gpg-agent.service"; + SocketMode = "0600"; + DirectoryMode = "0700"; + }; + + Install = { WantedBy = [ "sockets.target" ]; }; + }; + + # Launchd agent socket generator. + mkAgentSock = name: { + SockType = "stream"; + SockPathName = gpgconf name; + SockPathMode = + 384; # Property lists don't support octal literals (0600 = 384). + }; + in { meta.maintainers = [ maintainers.rycee ]; @@ -272,90 +302,74 @@ in { '') cfg.sshKeys; }) - # The systemd units below are direct translations of the - # descriptions in the - # - # ${gpgPkg}/share/doc/gnupg/examples/systemd-user - # - # directory. - { - assertions = [ - (hm.assertions.assertPlatform "services.gpg-agent" pkgs platforms.linux) - ]; - - systemd.user.services.gpg-agent = { - Unit = { - Description = "GnuPG cryptographic agent and passphrase cache"; - Documentation = "man:gpg-agent(1)"; - Requires = "gpg-agent.socket"; - After = "gpg-agent.socket"; - # This is a socket-activated service: - RefuseManualStart = true; - }; - - Service = { - ExecStart = "${gpgPkg}/bin/gpg-agent --supervised" - + optionalString cfg.verbose " --verbose"; - ExecReload = "${gpgPkg}/bin/gpgconf --reload gpg-agent"; - Environment = [ "GNUPGHOME=${homedir}" ]; + (mkMerge [ + (mkIf pkgs.stdenv.isLinux { + systemd.user.services.gpg-agent = { + Unit = { + Description = "GnuPG cryptographic agent and passphrase cache"; + Documentation = "man:gpg-agent(1)"; + Requires = "gpg-agent.socket"; + After = "gpg-agent.socket"; + # This is a socket-activated service: + RefuseManualStart = true; + }; + + Service = { + ExecStart = "${gpgPkg}/bin/gpg-agent --supervised" + + optionalString cfg.verbose " --verbose"; + ExecReload = "${gpgPkg}/bin/gpgconf --reload gpg-agent"; + Environment = [ "GNUPGHOME=${homedir}" ]; + }; }; - }; - systemd.user.sockets.gpg-agent = { - Unit = { - Description = "GnuPG cryptographic agent and passphrase cache"; - Documentation = "man:gpg-agent(1)"; + systemd.user.sockets.gpg-agent = mkSocket { + desc = "GnuPG cryptographic agent and passphrase cache"; + docs = "man:gpg-agent(1)"; + stream = "S.gpg-agent"; + fdName = "std"; }; - Socket = { - ListenStream = gpgconf "S.gpg-agent"; - FileDescriptorName = "std"; - SocketMode = "0600"; - DirectoryMode = "0700"; + systemd.user.sockets.gpg-agent-ssh = mkIf cfg.enableSshSupport + (mkSocket ({ + desc = "GnuPG cryptographic agent (ssh-agent emulation)"; + docs = + "man:gpg-agent(1) man:ssh-add(1) man:ssh-agent(1) man:ssh(1)"; + stream = "S.gpg-agent.ssh"; + fdName = "ssh"; + })); + + systemd.user.sockets.gpg-agent-extra = mkIf cfg.enableExtraSocket + (mkSocket { + desc = + "GnuPG cryptographic agent and passphrase cache (restricted)"; + docs = "man:gpg-agent(1) man:ssh(1)"; + stream = "S.gpg-agent.extra"; + fdName = "extra"; + }); + }) + + (mkIf pkgs.stdenv.isDarwin { + launchd.agents.gpg-agent = { + enable = true; + config = { + ProgramArguments = [ "${gpgPkg}/bin/gpg-agent" "--supervised" ] + ++ optional cfg.verbose "--verbose"; + EnvironmentVariables = { GNUPGHOME = homedir; }; + KeepAlive = { + Crashed = true; + SuccessfulExit = false; + }; + ProcessType = "Background"; + RunAtLoad = cfg.enableSshSupport; + Sockets = { + Agent = mkAgentSock "S.gpg-agent"; + Ssh = mkIf cfg.enableSshSupport (mkAgentSock "S.gpg-agent.ssh"); + Extra = + mkIf cfg.enableExtraSocket (mkAgentSock "S.gpg-agent.extra"); + }; + }; }; - - Install = { WantedBy = [ "sockets.target" ]; }; - }; - } - - (mkIf cfg.enableSshSupport { - systemd.user.sockets.gpg-agent-ssh = { - Unit = { - Description = "GnuPG cryptographic agent (ssh-agent emulation)"; - Documentation = - "man:gpg-agent(1) man:ssh-add(1) man:ssh-agent(1) man:ssh(1)"; - }; - - Socket = { - ListenStream = gpgconf "S.gpg-agent.ssh"; - FileDescriptorName = "ssh"; - Service = "gpg-agent.service"; - SocketMode = "0600"; - DirectoryMode = "0700"; - }; - - Install = { WantedBy = [ "sockets.target" ]; }; - }; - }) - - (mkIf cfg.enableExtraSocket { - systemd.user.sockets.gpg-agent-extra = { - Unit = { - Description = - "GnuPG cryptographic agent and passphrase cache (restricted)"; - Documentation = "man:gpg-agent(1) man:ssh(1)"; - }; - - Socket = { - ListenStream = gpgconf "S.gpg-agent.extra"; - FileDescriptorName = "extra"; - Service = "gpg-agent.service"; - SocketMode = "0600"; - DirectoryMode = "0700"; - }; - - Install = { WantedBy = [ "sockets.target" ]; }; - }; - }) + }) + ]) ]); } diff --git a/tests/default.nix b/tests/default.nix index 1c143716f478..12bc11da7d5b 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -162,6 +162,7 @@ in import nmtSrc { ./modules/programs/zk ./modules/programs/zplug ./modules/programs/zsh + ./modules/services/gpg-agent ./modules/services/syncthing/common ./modules/xresources ] ++ lib.optionals isDarwin [ @@ -242,7 +243,6 @@ in import nmtSrc { ./modules/services/fusuma ./modules/services/git-sync ./modules/services/glance - ./modules/services/gpg-agent ./modules/services/gromit-mpx ./modules/services/home-manager-auto-upgrade ./modules/services/hypridle diff --git a/tests/modules/services/gpg-agent/default-homedir.nix b/tests/modules/services/gpg-agent/default-homedir.nix index e23de764da05..9c13520aedd1 100644 --- a/tests/modules/services/gpg-agent/default-homedir.nix +++ b/tests/modules/services/gpg-agent/default-homedir.nix @@ -2,7 +2,7 @@ with lib; -{ +mkIf pkgs.stdenv.isLinux { config = { services.gpg-agent.enable = true; services.gpg-agent.pinentryPackage = pkgs.pinentry-gnome3; diff --git a/tests/modules/services/gpg-agent/expected-agent.plist b/tests/modules/services/gpg-agent/expected-agent.plist new file mode 100644 index 000000000000..5843ff449bcf --- /dev/null +++ b/tests/modules/services/gpg-agent/expected-agent.plist @@ -0,0 +1,41 @@ + + + + + EnvironmentVariables + + GNUPGHOME + /path/to/hash + + KeepAlive + + Crashed + + SuccessfulExit + + + Label + org.nix-community.home.gpg-agent + ProcessType + Background + ProgramArguments + + @gpg@/bin/gpg-agent + --supervised + + RunAtLoad + + Sockets + + Agent + + SockPathMode + 384 + SockPathName + /private/var/run/org.nix-community.home.gpg-agent/d.wp4h7ks5zxy4dodqadgpbbpz/S.gpg-agent + SockType + stream + + + + \ No newline at end of file diff --git a/tests/modules/services/gpg-agent/override-homedir.nix b/tests/modules/services/gpg-agent/override-homedir.nix index c50786739681..82dec0f95e23 100644 --- a/tests/modules/services/gpg-agent/override-homedir.nix +++ b/tests/modules/services/gpg-agent/override-homedir.nix @@ -2,19 +2,25 @@ with lib; -{ +let inherit (pkgs.stdenv) isDarwin; +in { config = { services.gpg-agent.enable = true; services.gpg-agent.pinentryPackage = null; # Don't build pinentry package. programs.gpg = { enable = true; homedir = "/path/to/hash"; + package = config.lib.test.mkStubPackage { outPath = "@gpg@"; }; }; test.stubs.gnupg = { }; test.stubs.systemd = { }; # depends on gnupg.override - nmt.script = '' + nmt.script = if isDarwin then '' + serviceFile=LaunchAgents/org.nix-community.home.gpg-agent.plist + assertFileExists "$serviceFile" + assertFileContent "$serviceFile" ${./expected-agent.plist} + '' else '' in="${config.systemd.user.sockets.gpg-agent.Socket.ListenStream}" if [[ $in != "%t/gnupg/d.wp4h7ks5zxy4dodqadgpbbpz/S.gpg-agent" ]] then From 433e686675ba24176fe3383916a4bd1c9799c676 Mon Sep 17 00:00:00 2001 From: Zachary H <39349995+zackattackz@users.noreply.github.com> Date: Fri, 13 Sep 2024 03:58:00 -0400 Subject: [PATCH 423/636] autorandr: configModule.extraConfig Add an option to programs.autorandr's configModule to allow arbitrary extra config lines. No option exists for adding arbitrary key/values to generated autorandr profile config, as is common in other nix modules. This commit adds one. --- modules/programs/autorandr.nix | 15 ++++++++++++++- .../programs/autorandr/basic-configuration.nix | 9 ++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/modules/programs/autorandr.nix b/modules/programs/autorandr.nix index edbe83de636c..ab59d8d9ddc4 100644 --- a/modules/programs/autorandr.nix +++ b/modules/programs/autorandr.nix @@ -177,6 +177,18 @@ let default = null; example = "nearest"; }; + + extraConfig = mkOption { + type = types.lines; + description = "Extra lines to append to this profile's config."; + default = ""; + example = literalExpression '' + ''' + x-prop-non_desktop 0 + some-key some-value + ''' + ''; + }; }; }; @@ -267,7 +279,8 @@ let + concatMapStringsSep "," toString (flatten config.transform)) ++ optional (config.scale != null) ((if config.scale.method == "factor" then "scale" else "scale-from") - + " ${toString config.scale.x}x${toString config.scale.y}")) + + " ${toString config.scale.x}x${toString config.scale.y}") + ++ optional (config.extraConfig != "") config.extraConfig) else '' output ${name} off diff --git a/tests/modules/programs/autorandr/basic-configuration.nix b/tests/modules/programs/autorandr/basic-configuration.nix index e650f6005a50..d0f14ec86503 100644 --- a/tests/modules/programs/autorandr/basic-configuration.nix +++ b/tests/modules/programs/autorandr/basic-configuration.nix @@ -23,6 +23,10 @@ [ 0.0 0.6 0.0 ] # d e f [ 0.0 0.0 1.0 ] # g h i ]; + extraConfig = '' + key1 value1 + key2 value2 + ''; }; }; }; @@ -52,7 +56,10 @@ primary mode 1920x1080 filter nearest - transform 0.600000,0.000000,0.000000,0.000000,0.600000,0.000000,0.000000,0.000000,1.000000'' + transform 0.600000,0.000000,0.000000,0.000000,0.600000,0.000000,0.000000,0.000000,1.000000 + key1 value1 + key2 value2 + '' } ''; }; From ea244c5ae2205f0fced24dde2e555440303d63bc Mon Sep 17 00:00:00 2001 From: Chet Gurevitch Date: Thu, 12 Sep 2024 20:00:29 +0000 Subject: [PATCH 424/636] helix: remove outdated language-server comment --- modules/programs/helix.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/programs/helix.nix b/modules/programs/helix.nix index 96c5bdbf18f1..e529d50d7730 100644 --- a/modules/programs/helix.nix +++ b/modules/programs/helix.nix @@ -75,7 +75,6 @@ in { default = { }; example = literalExpression '' { - # the language-server option currently requires helix from the master branch at https://github.com/helix-editor/helix/ language-server.typescript-language-server = with pkgs.nodePackages; { command = "''${typescript-language-server}/bin/typescript-language-server"; args = [ "--stdio" "--tsserver-path=''${typescript}/lib/node_modules/typescript/lib" ]; From cb3ab5928cbe8ac3cfee7010ccad4c31dbc1fb5f Mon Sep 17 00:00:00 2001 From: Chet Gurevitch Date: Thu, 12 Sep 2024 20:09:22 +0000 Subject: [PATCH 425/636] helix: add example for use with evil-helix --- modules/programs/helix.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/programs/helix.nix b/modules/programs/helix.nix index e529d50d7730..01af7b14e88b 100644 --- a/modules/programs/helix.nix +++ b/modules/programs/helix.nix @@ -15,6 +15,7 @@ in { type = types.package; default = pkgs.helix; defaultText = literalExpression "pkgs.helix"; + example = literalExpression "pkgs.evil-helix"; description = "The package to use for helix."; }; From daaf0c2f8da6c7b5dc04dd62a3d98422f259551b Mon Sep 17 00:00:00 2001 From: "O. C. Taskin" <42993892+octvs@users.noreply.github.com> Date: Fri, 13 Sep 2024 10:51:33 +0200 Subject: [PATCH 426/636] kanshi: add support for output aliases - Add `services.kanshi.profiles..outputs.*.alias` to support new alias directive from kanshi [1]. - Add an assertion to reject aliases not on global scope, which are not allowed on kanshi [2]. - Add a new test to check alias rejection, `alias-assertion`. - Add relevant coverage by modifying the existing "new-configuration" test. - Kanshi also doesn't allow wildcards on global scope [3], correct the faulty test case. [1]: https://git.sr.ht/~emersion/kanshi/commit/1ed86ce523553240ceb81e9d466b88d3554a66bb [2]: https://git.sr.ht/~emersion/kanshi/tree/1605f7c81314d004104b7a1b149656947369c999/item/doc/kanshi.5.scd#L78 [3]: https://git.sr.ht/~emersion/kanshi/tree/1605f7c81314d004104b7a1b149656947369c999/item/doc/kanshi.5.scd#L80 --- modules/services/kanshi.nix | 24 ++++++++++++++++--- .../services/kanshi/alias-assertion.nix | 18 ++++++++++++++ tests/modules/services/kanshi/default.nix | 1 + .../services/kanshi/new-configuration.conf | 4 ++-- .../services/kanshi/new-configuration.nix | 6 ++--- 5 files changed, 45 insertions(+), 8 deletions(-) create mode 100644 tests/modules/services/kanshi/alias-assertion.nix diff --git a/modules/services/kanshi.nix b/modules/services/kanshi.nix index b503ffc7f7f1..3b1bdf2cf8dc 100644 --- a/modules/services/kanshi.nix +++ b/modules/services/kanshi.nix @@ -123,6 +123,15 @@ let ''; }; + alias = mkOption { + type = types.nullOr types.str; + default = null; + example = "laptopMonitor"; + description = '' + Defines an alias for the output + ''; + }; + adaptiveSync = mkOption { type = types.nullOr types.bool; default = null; @@ -135,15 +144,16 @@ let }; }; - outputStr = - { criteria, status, mode, position, scale, transform, adaptiveSync, ... }: + outputStr = { criteria, status, mode, position, scale, transform, adaptiveSync + , alias, ... }: ''output "${criteria}"'' + optionalString (status != null) " ${status}" + optionalString (mode != null) " mode ${mode}" + optionalString (position != null) " position ${position}" + optionalString (scale != null) " scale ${toString scale}" + optionalString (transform != null) " transform ${transform}" + optionalString (adaptiveSync != null) - " adaptive_sync ${if adaptiveSync then "on" else "off"}"; + " adaptive_sync ${if adaptiveSync then "on" else "off"}" + + optionalString (alias != null) " alias \$${alias}"; profileModule = types.submodule { options = { @@ -296,6 +306,14 @@ in { message = "Cannot mix kanshi.settings with kanshi.profiles or kanshi.extraConfig"; } + { + assertion = let profiles = filter (x: x ? profile) cfg.settings; + in length + (filter (x: any (a: a ? alias && a.alias != null) x.profile.outputs) + profiles) == 0; + message = + "Output kanshi.*.output.alias can only be defined on global scope"; + } ]; } diff --git a/tests/modules/services/kanshi/alias-assertion.nix b/tests/modules/services/kanshi/alias-assertion.nix new file mode 100644 index 000000000000..0dc6d7e64600 --- /dev/null +++ b/tests/modules/services/kanshi/alias-assertion.nix @@ -0,0 +1,18 @@ +{ config, pkgs, ... }: { + config = { + services.kanshi = { + enable = true; + package = config.lib.test.mkStubPackage { }; + settings = [{ + profile.name = "nomad"; + profile.outputs = [{ + criteria = "eDP-1"; + alias = "test"; + }]; + }]; + }; + + test.asserts.assertions.expected = + [ "Output kanshi.*.output.alias can only be defined on global scope" ]; + }; +} diff --git a/tests/modules/services/kanshi/default.nix b/tests/modules/services/kanshi/default.nix index b7704b112780..05e224aaa48e 100644 --- a/tests/modules/services/kanshi/default.nix +++ b/tests/modules/services/kanshi/default.nix @@ -1,4 +1,5 @@ { kanshi-basic-configuration = ./basic-configuration.nix; kanshi-new-configuration = ./new-configuration.nix; + kanshi-alias-assertion = ./alias-assertion.nix; } diff --git a/tests/modules/services/kanshi/new-configuration.conf b/tests/modules/services/kanshi/new-configuration.conf index c0858a048083..817f66329b3e 100644 --- a/tests/modules/services/kanshi/new-configuration.conf +++ b/tests/modules/services/kanshi/new-configuration.conf @@ -1,12 +1,12 @@ include "path/to/included/file" -output "*" enable +output "Iiyama North America PLE2483H-DP" alias $iiyama profile nomad { output "eDP-1" enable } profile desktop { output "eDP-1" disable - output "Iiyama North America PLE2483H-DP" enable position 0,0 + output "$iiyama" enable position 0,0 output "Iiyama North America PLE2483H-DP 1158765348486" enable mode 1920x1080 position 1920,0 scale 2.100000 transform flipped-270 exec echo "1 two 3" exec echo "4 five 6" diff --git a/tests/modules/services/kanshi/new-configuration.nix b/tests/modules/services/kanshi/new-configuration.nix index 9b3a36478a77..2c92c730d3a3 100644 --- a/tests/modules/services/kanshi/new-configuration.nix +++ b/tests/modules/services/kanshi/new-configuration.nix @@ -7,8 +7,8 @@ { include = "path/to/included/file"; } { output = { - criteria = "*"; - status = "enable"; + criteria = "Iiyama North America PLE2483H-DP"; + alias = "iiyama"; }; } { @@ -27,7 +27,7 @@ status = "disable"; } { - criteria = "Iiyama North America PLE2483H-DP"; + criteria = "$iiyama"; status = "enable"; position = "0,0"; } From 4c8647b1ed35d0e1822c7997172786dfa18cd7da Mon Sep 17 00:00:00 2001 From: Callum Leslie Date: Wed, 4 Sep 2024 09:22:09 +0100 Subject: [PATCH 427/636] trayscale: add module Trayscale is an unofficial GUI wrapper around the Tailscale CLI client. PR #5803 --- modules/lib/maintainers.nix | 8 ++++ modules/misc/news.nix | 10 +++++ modules/modules.nix | 1 + modules/services/trayscale.nix | 39 +++++++++++++++++++ tests/default.nix | 1 + tests/modules/services/trayscale/default.nix | 4 ++ .../services/trayscale/hide-window.nix | 15 +++++++ .../services/trayscale/show-window.nix | 15 +++++++ 8 files changed, 93 insertions(+) create mode 100644 modules/services/trayscale.nix create mode 100644 tests/modules/services/trayscale/default.nix create mode 100644 tests/modules/services/trayscale/hide-window.nix create mode 100644 tests/modules/services/trayscale/show-window.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 9793d5c3f6b5..832e025d3fc3 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -587,4 +587,12 @@ github = "zorrobert"; githubId = 118135271; }; + callumio = { + name = "Callum Leslie"; + email = "git+nix@cleslie.uk"; + github = "callumio"; + githubId = 16057677; + keys = + [{ fingerprint = "BC82 4BB5 1656 D144 285E A0EC D382 C4AF EECE AA90"; }]; + }; } diff --git a/modules/misc/news.nix b/modules/misc/news.nix index bef867bb4ada..eae438e268c0 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1703,6 +1703,16 @@ in { one place. See https://github.com/glanceapp/glance for more. ''; } + + { + time = "2024-09-13T08:58:17+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.trayscale'. + + An unofficial GUI wrapper around the Tailscale CLI client. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index dbeebfbf7c9a..7223fb4bf181 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -374,6 +374,7 @@ let ./services/tahoe-lafs.nix ./services/taskwarrior-sync.nix ./services/trayer.nix + ./services/trayscale.nix ./services/twmn.nix ./services/udiskie.nix ./services/unclutter.nix diff --git a/modules/services/trayscale.nix b/modules/services/trayscale.nix new file mode 100644 index 000000000000..d9853d7aae4b --- /dev/null +++ b/modules/services/trayscale.nix @@ -0,0 +1,39 @@ +{ config, lib, pkgs, ... }: + +let cfg = config.services.trayscale; +in { + meta.maintainers = [ lib.hm.maintainers.callumio ]; + + options.services.trayscale = { + enable = lib.mkEnableOption + "An unofficial GUI wrapper around the Tailscale CLI client."; + + package = lib.mkPackageOption pkgs "trayscale" { }; + + hideWindow = lib.mkOption { + type = lib.types.bool; + default = true; + description = "Whether to hide the trayscale window on startup."; + }; + }; + + config = lib.mkIf cfg.enable { + assertions = [ + (lib.hm.assertions.assertPlatform "services.trayscale" pkgs + lib.platforms.linux) + ]; + + systemd.user.services.trayscale = { + Unit = { + Description = + "An unofficial GUI wrapper around the Tailscale CLI client"; + Requires = [ "tray.target" ]; + After = [ "graphical-session-pre.target" "tray.target" ]; + PartOf = [ "graphical-session.target" ]; + }; + Install = { WantedBy = [ "graphical-session.target" ]; }; + Service.ExecStart = toString ([ "${cfg.package}/bin/trayscale" ] + ++ lib.optional cfg.hideWindow "--hide-window"); + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 12bc11da7d5b..82aa2f6c42e3 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -275,6 +275,7 @@ in import nmtSrc { ./modules/services/sxhkd ./modules/services/syncthing/linux ./modules/services/trayer + ./modules/services/trayscale ./modules/services/twmn ./modules/services/udiskie ./modules/services/window-managers/bspwm diff --git a/tests/modules/services/trayscale/default.nix b/tests/modules/services/trayscale/default.nix new file mode 100644 index 000000000000..9702b1c7c7d4 --- /dev/null +++ b/tests/modules/services/trayscale/default.nix @@ -0,0 +1,4 @@ +{ + trayscale-show-window = ./show-window.nix; + trayscale-hide-window = ./hide-window.nix; +} diff --git a/tests/modules/services/trayscale/hide-window.nix b/tests/modules/services/trayscale/hide-window.nix new file mode 100644 index 000000000000..72181e898c0c --- /dev/null +++ b/tests/modules/services/trayscale/hide-window.nix @@ -0,0 +1,15 @@ +{ ... }: { + services.trayscale = { + enable = true; + hideWindow = true; + }; + + test.stubs = { trayscale = { }; }; + + nmt.script = '' + serviceFile=home-files/.config/systemd/user/trayscale.service + assertFileExists $serviceFile + assertFileRegex $serviceFile \ + '^ExecStart=@trayscale@/bin/trayscale --hide-window$' + ''; +} diff --git a/tests/modules/services/trayscale/show-window.nix b/tests/modules/services/trayscale/show-window.nix new file mode 100644 index 000000000000..62157ab54163 --- /dev/null +++ b/tests/modules/services/trayscale/show-window.nix @@ -0,0 +1,15 @@ +{ ... }: { + services.trayscale = { + enable = true; + hideWindow = false; + }; + + test.stubs = { trayscale = { }; }; + + nmt.script = '' + serviceFile=home-files/.config/systemd/user/trayscale.service + assertFileExists $serviceFile + assertFileRegex $serviceFile \ + '^ExecStart=@trayscale@/bin/trayscale$' + ''; +} From 7923c691527d2ee85fe028c6e780ac3bf8606f06 Mon Sep 17 00:00:00 2001 From: NitroSniper Date: Thu, 12 Sep 2024 23:37:22 +0100 Subject: [PATCH 428/636] neovide: add module Neovide is a simple, no-nonsense, cross-platform graphical user interface for Neovim See . Used ruff's module as reference during creation. --- modules/lib/maintainers.nix | 6 +++ modules/misc/news.nix | 11 +++++ modules/modules.nix | 1 + modules/programs/neovide.nix | 52 ++++++++++++++++++++ tests/default.nix | 1 + tests/modules/programs/neovide/default.nix | 1 + tests/modules/programs/neovide/expected.toml | 15 ++++++ tests/modules/programs/neovide/neovide.nix | 34 +++++++++++++ 8 files changed, 121 insertions(+) create mode 100644 modules/programs/neovide.nix create mode 100644 tests/modules/programs/neovide/default.nix create mode 100644 tests/modules/programs/neovide/expected.toml create mode 100644 tests/modules/programs/neovide/neovide.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 832e025d3fc3..70f480d06177 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -276,6 +276,12 @@ github = "nilp0inter"; githubId = 1224006; }; + NitroSniper = { + name = "Nitro Sniper"; + email = "nitro@ortin.dev"; + github = "NitroSniper"; + githubId = 44097331; + }; seylerius = { email = "sable@seyleri.us"; name = "Sable Seyler"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index eae438e268c0..655546ff3f7e 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1713,6 +1713,17 @@ in { An unofficial GUI wrapper around the Tailscale CLI client. ''; } + + { + time = "2024-09-13T09:50:49+00:00"; + message = '' + A new module is available: 'programs.neovide'. + + Neovide is a simple, no-nonsense, cross-platform graphical user + interface for Neovim (an aggressively refactored and updated Vim + editor). + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 7223fb4bf181..ed2e177f267f 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -167,6 +167,7 @@ let ./programs/ncspot.nix ./programs/ne.nix ./programs/neomutt.nix + ./programs/neovide.nix ./programs/neovim.nix ./programs/newsboat.nix ./programs/nheko.nix diff --git a/modules/programs/neovide.nix b/modules/programs/neovide.nix new file mode 100644 index 000000000000..3b40fb3ebb60 --- /dev/null +++ b/modules/programs/neovide.nix @@ -0,0 +1,52 @@ +{ config, lib, pkgs, ... }: + +let + + cfg = config.programs.neovide; + settingsFormat = pkgs.formats.toml { }; + +in { + meta.maintainers = [ lib.hm.maintainers.NitroSniper ]; + + options.programs.neovide = { + enable = lib.mkEnableOption "Neovide, No Nonsense Neovim Client in Rust"; + + package = lib.mkPackageOption pkgs "neovide" { }; + + settings = lib.mkOption { + type = settingsFormat.type; + example = lib.literalExpression '' + { + fork = false; + frame = "full"; + idle = true; + maximized = false; + neovim-bin = "/usr/bin/nvim"; + no-multigrid = false; + srgb = false; + tabs = true; + theme = "auto"; + title-hidden = true; + vsync = true; + wsl = false; + + font = { + normal = []; + size = 14.0; + }; + } + ''; + description = '' + Neovide configuration. + For available settings see . + For any option not found will need to be done in your neovim's config instead. + ''; + }; + }; + + config = lib.mkIf cfg.enable { + home.packages = [ cfg.package ]; + xdg.configFile."neovide/config.toml".source = + settingsFormat.generate "config.toml" cfg.settings; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 82aa2f6c42e3..2008014b78b3 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -110,6 +110,7 @@ in import nmtSrc { ./modules/programs/ncmpcpp ./modules/programs/ne ./modules/programs/neomutt + ./modules/programs/neovide ./modules/programs/neovim ./modules/programs/newsboat ./modules/programs/nheko diff --git a/tests/modules/programs/neovide/default.nix b/tests/modules/programs/neovide/default.nix new file mode 100644 index 000000000000..f11bc33bc9d2 --- /dev/null +++ b/tests/modules/programs/neovide/default.nix @@ -0,0 +1 @@ +{ neovide-program = ./neovide.nix; } diff --git a/tests/modules/programs/neovide/expected.toml b/tests/modules/programs/neovide/expected.toml new file mode 100644 index 000000000000..0c3f0b20b718 --- /dev/null +++ b/tests/modules/programs/neovide/expected.toml @@ -0,0 +1,15 @@ +fork = false +frame = "full" +idle = true +maximized = false +neovim-bin = "/usr/bin/nvim" +no-multigrid = false +srgb = false +tabs = true +theme = "auto" +title-hidden = true +vsync = true +wsl = false +[font] +normal = [] +size = 14.0 diff --git a/tests/modules/programs/neovide/neovide.nix b/tests/modules/programs/neovide/neovide.nix new file mode 100644 index 000000000000..774964f01453 --- /dev/null +++ b/tests/modules/programs/neovide/neovide.nix @@ -0,0 +1,34 @@ +{ ... }: + +{ + programs.neovide = { + enable = true; + + settings = { + fork = false; + frame = "full"; + idle = true; + maximized = false; + neovim-bin = "/usr/bin/nvim"; + no-multigrid = false; + srgb = false; + tabs = true; + theme = "auto"; + title-hidden = true; + vsync = true; + wsl = false; + + font = { + normal = [ ]; + size = 14.0; + }; + }; + }; + + test.stubs.neovide = { }; + + nmt.script = '' + assertFileExists home-files/.config/neovide/config.toml + assertFileContent home-files/.config/neovide/config.toml ${./expected.toml} + ''; +} From 076c78edede4e7abc71af0b1610fb1fc1c0fac29 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Tue, 10 Sep 2024 13:47:02 -0300 Subject: [PATCH 429/636] fish: add `preferAbbrs` option --- modules/programs/fish.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index fc11e512414f..8cd7f9f92dcc 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -288,6 +288,16 @@ in { ''; }; + preferAbbrs = mkOption { + type = types.bool; + default = false; + example = true; + description = '' + If enabled, abbreviations will be preferred over aliases when + other modules define aliases for fish. + ''; + }; + shellInit = mkOption { type = types.lines; default = ""; From 503af483e1b328691ea3a434d331995595fb2e3d Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Tue, 10 Sep 2024 13:57:24 -0300 Subject: [PATCH 430/636] eza: add support for fish abbreviations --- modules/programs/eza.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/programs/eza.nix b/modules/programs/eza.nix index 7e002a12ea88..d55d6f56e1bc 100644 --- a/modules/programs/eza.nix +++ b/modules/programs/eza.nix @@ -91,8 +91,17 @@ with lib; programs.zsh.shellAliases = optionsAlias // optionalAttrs cfg.enableZshIntegration aliases; - programs.fish.shellAliases = optionsAlias - // optionalAttrs cfg.enableFishIntegration aliases; + programs.fish = mkMerge [ + (mkIf (!config.programs.fish.preferAbbrs) { + shellAliases = optionsAlias + // optionalAttrs cfg.enableFishIntegration aliases; + }) + + (mkIf config.programs.fish.preferAbbrs { + shellAliases = optionsAlias; + shellAbbrs = optionalAttrs cfg.enableFishIntegration aliases; + }) + ]; programs.ion.shellAliases = optionsAlias // optionalAttrs cfg.enableIonIntegration aliases; From 43845d04f83d44d744206ea9884b8206e7640633 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 11 Sep 2024 20:25:31 -0400 Subject: [PATCH 431/636] git: add diff-highlight diff pager option This adds a new diff-highlight option to make use of the simple included git diff highlighter that comes with canonical git. For more info, see https://github.com/git/git/blob/master/contrib/diff-highlight/README --- modules/programs/git.nix | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 3f5cdc7cc9bc..07d01ab9d64c 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -214,6 +214,24 @@ in { }; }; + diff-highlight = { + enable = mkEnableOption "" // { + description = '' + Enable the contrib {command}`diff-highlight` syntax highlighter. + See , + ''; + }; + + pagerOpts = mkOption { + type = types.listOf types.str; + default = [ ]; + example = [ "--tabs=4" "-RFX" ]; + description = '' + Arguments to be passed to {command}`less`. + ''; + }; + }; + difftastic = { enable = mkEnableOption "" // { description = '' @@ -360,11 +378,15 @@ in { home.packages = [ cfg.package ]; assertions = [{ assertion = let - enabled = - [ cfg.delta.enable cfg.diff-so-fancy.enable cfg.difftastic.enable ]; + enabled = [ + cfg.delta.enable + cfg.diff-so-fancy.enable + cfg.difftastic.enable + cfg.diff-highlight.enable + ]; in count id enabled <= 1; message = - "Only one of 'programs.git.delta.enable' or 'programs.git.difftastic.enable' or 'programs.git.diff-so-fancy.enable' can be set to true at the same time."; + "Only one of 'programs.git.delta.enable' or 'programs.git.difftastic.enable' or 'programs.git.diff-so-fancy.enable' or 'programs.git.diff-highlight' can be set to true at the same time."; }]; programs.git.iniContent.user = { @@ -479,6 +501,18 @@ in { }; }) + (mkIf cfg.diff-highlight.enable { + programs.git.iniContent = let + dhCommand = + "${cfg.package}/share/git/contrib/diff-highlight/diff-highlight"; + in { + core.pager = "${dhCommand} | ${getExe pkgs.less} ${ + escapeShellArgs cfg.diff-highlight.pagerOpts + }"; + interactive.diffFilter = dhCommand; + }; + }) + (mkIf cfg.difftastic.enable { home.packages = [ cfg.difftastic.package ]; From f084d653199345ad294abca921a0e25872bd75c0 Mon Sep 17 00:00:00 2001 From: Dominic Esposito <79945730+DrakoDom@users.noreply.github.com> Date: Thu, 12 Sep 2024 11:58:01 -0500 Subject: [PATCH 432/636] swaync: fix example configuration Add a semicolon after "notification-body-image-width = 200" for completeness. PR #5828 --- modules/services/swaync.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/swaync.nix b/modules/services/swaync.nix index 60bcc913b70f..5f813af30ab6 100644 --- a/modules/services/swaync.nix +++ b/modules/services/swaync.nix @@ -63,7 +63,7 @@ in { notification-inline-replies = false; notification-icon-size = 64; notification-body-image-height = 100; - notification-body-image-width = 200 + notification-body-image-width = 200; }; ''; description = '' From 898eaef7ea906ddc8e86d57957f2a701878bfb05 Mon Sep 17 00:00:00 2001 From: NikSne Date: Fri, 13 Sep 2024 05:09:16 +0200 Subject: [PATCH 433/636] Translate using Weblate (Russian) Currently translated at 100.0% (37 of 37 strings) Co-authored-by: NikSne Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/ru/ Translation: Home Manager/Home Manager CLI --- home-manager/po/ru.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/home-manager/po/ru.po b/home-manager/po/ru.po index 5a3f811a3c18..c8afd5a2f8d6 100644 --- a/home-manager/po/ru.po +++ b/home-manager/po/ru.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-03-31 22:01+0000\n" -"Last-Translator: Petr Portnov | PROgrm_JARvis \n" +"PO-Revision-Date: 2024-09-12 02:12+0000\n" +"Last-Translator: NikSne \n" "Language-Team: Russian \n" "Language: ru\n" @@ -18,12 +18,12 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " "n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -"X-Generator: Weblate 5.5-dev\n" +"X-Generator: Weblate 5.8-dev\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: отсутствует параметр для %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" From e94bee957400c8f871d9b9ea54308e15d664242c Mon Sep 17 00:00:00 2001 From: Jay Thomas Date: Fri, 13 Sep 2024 05:09:16 +0200 Subject: [PATCH 434/636] Translate using Weblate (Hindi) Currently translated at 8.1% (3 of 37 strings) Add translation using Weblate (Hindi) Co-authored-by: Jay Thomas Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/hi/ Translation: Home Manager/Home Manager CLI --- home-manager/po/hi.po | 220 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 home-manager/po/hi.po diff --git a/home-manager/po/hi.po b/home-manager/po/hi.po new file mode 100644 index 000000000000..43d87312332e --- /dev/null +++ b/home-manager/po/hi.po @@ -0,0 +1,220 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Home Manager contributors +# This file is distributed under the same license as the Home Manager package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Home Manager\n" +"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" +"PO-Revision-Date: 2024-09-13 03:09+0000\n" +"Last-Translator: Jay Thomas \n" +"Language-Team: Hindi \n" +"Language: hi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 5.8-dev\n" + +#. translators: For example: "home-manager: missing argument for --cores" +#: home-manager/home-manager:16 +msgid "%s: missing argument for %s" +msgstr "" + +#: home-manager/home-manager:64 +msgid "No configuration file found at %s" +msgstr "" + +#. translators: The first '%s' specifier will be replaced by either +#. 'home.nix' or 'flake.nix'. +#: home-manager/home-manager:81 home-manager/home-manager:85 +#: home-manager/home-manager:184 +msgid "" +"Keeping your Home Manager %s in %s is deprecated,\n" +"please move it to %s" +msgstr "" +"अपने Home Manager %s को %s में रखना अप्रचलित है,\n" +"कृपया इसे %s में स्थानांतरित करें" + +#: home-manager/home-manager:92 +msgid "No configuration file found. Please create one at %s" +msgstr "कोई कॉन्फ़िगरेशन फ़ाइल नहीं मिली। कृपया %s पर एक फ़ाइल बनाएं।" + +#: home-manager/home-manager:107 +msgid "Home Manager not found at %s." +msgstr "%s पर Home Manager नहीं मिला।" + +#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. +#: home-manager/home-manager:115 +msgid "" +"The fallback Home Manager path %s has been deprecated and a file/directory " +"was found there." +msgstr "" + +#. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. +#: home-manager/home-manager:118 +msgid "" +"To remove this warning, do one of the following.\n" +"\n" +"1. Explicitly tell Home Manager to use the path, for example by adding\n" +"\n" +" { programs.home-manager.path = \"%s\"; }\n" +"\n" +" to your configuration.\n" +"\n" +" If you import Home Manager directly, you can use the `path` parameter\n" +"\n" +" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" +"\n" +" when calling the Home Manager package.\n" +"\n" +"2. Remove the deprecated path.\n" +"\n" +" $ rm -r \"%s\"" +msgstr "" + +#: home-manager/home-manager:146 +msgid "Sanity checking Nix" +msgstr "" + +#: home-manager/home-manager:166 +msgid "Could not find suitable profile directory, tried %s and %s" +msgstr "" + +#. translators: Here "flake" is a noun that refers to the Nix Flakes feature. +#: home-manager/home-manager:221 +msgid "Can't inspect options of a flake configuration" +msgstr "" + +#: home-manager/home-manager:296 home-manager/home-manager:319 +#: home-manager/home-manager:1051 +msgid "%s: unknown option '%s'" +msgstr "" + +#: home-manager/home-manager:301 home-manager/home-manager:1052 +msgid "Run '%s --help' for usage help" +msgstr "" + +#: home-manager/home-manager:327 home-manager/home-manager:431 +msgid "The file %s already exists, leaving it unchanged..." +msgstr "" + +#: home-manager/home-manager:329 home-manager/home-manager:433 +msgid "Creating %s..." +msgstr "" + +#: home-manager/home-manager:475 +msgid "Creating initial Home Manager generation..." +msgstr "" + +#. translators: The "%s" specifier will be replaced by a file path. +#: home-manager/home-manager:480 +msgid "" +"All done! The home-manager tool should now be installed and you can edit\n" +"\n" +" %s\n" +"\n" +"to configure Home Manager. Run 'man home-configuration.nix' to\n" +"see all available options." +msgstr "" + +#. translators: The "%s" specifier will be replaced by a URL. +#: home-manager/home-manager:485 +msgid "" +"Uh oh, the installation failed! Please create an issue at\n" +"\n" +" %s\n" +"\n" +"if the error seems to be the fault of Home Manager." +msgstr "" + +#. translators: Here "flake" is a noun that refers to the Nix Flakes feature. +#: home-manager/home-manager:496 +msgid "Can't instantiate a flake configuration" +msgstr "" + +#: home-manager/home-manager:572 +msgid "" +"There is %d unread and relevant news item.\n" +"Read it by running the command \"%s news\"." +msgid_plural "" +"There are %d unread and relevant news items.\n" +"Read them by running the command \"%s news\"." +msgstr[0] "" +msgstr[1] "" + +#: home-manager/home-manager:586 +msgid "Unknown \"news.display\" setting \"%s\"." +msgstr "" + +#: home-manager/home-manager:594 +#, sh-format +msgid "Please set the $EDITOR or $VISUAL environment variable" +msgstr "" + +#: home-manager/home-manager:612 +msgid "Cannot run build in read-only directory" +msgstr "" + +#: home-manager/home-manager:693 +msgid "No generation with ID %s" +msgstr "" + +#: home-manager/home-manager:695 +msgid "Cannot remove the current generation %s" +msgstr "" + +#: home-manager/home-manager:697 +msgid "Removing generation %s" +msgstr "" + +#: home-manager/home-manager:718 +msgid "No generations to expire" +msgstr "" + +#: home-manager/home-manager:729 +msgid "No home-manager packages seem to be installed." +msgstr "" + +#: home-manager/home-manager:811 +msgid "Unknown argument %s" +msgstr "" + +#: home-manager/home-manager:835 +msgid "This will remove Home Manager from your system." +msgstr "" + +#: home-manager/home-manager:838 +msgid "This is a dry run, nothing will actually be uninstalled." +msgstr "" + +#: home-manager/home-manager:842 +msgid "Really uninstall Home Manager?" +msgstr "" + +#: home-manager/home-manager:848 +msgid "Switching to empty Home Manager configuration..." +msgstr "" + +#: home-manager/home-manager:863 +msgid "Yay!" +msgstr "" + +#: home-manager/home-manager:868 +msgid "Home Manager is uninstalled but your home.nix is left untouched." +msgstr "" + +#: home-manager/home-manager:1091 +msgid "expire-generations expects one argument, got %d." +msgstr "" + +#: home-manager/home-manager:1113 +msgid "Unknown command: %s" +msgstr "" + +#: home-manager/install.nix:18 +msgid "This derivation is not buildable, please run it using nix-shell." +msgstr "" From 7edf6ccaec8001cb20368bf1bf6a677178cae07b Mon Sep 17 00:00:00 2001 From: Languages add-on Date: Fri, 13 Sep 2024 05:09:16 +0200 Subject: [PATCH 435/636] Add translation using Weblate (Hindi) Co-authored-by: Languages add-on --- modules/po/hi.po | 113 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 modules/po/hi.po diff --git a/modules/po/hi.po b/modules/po/hi.po new file mode 100644 index 000000000000..02a7f8528515 --- /dev/null +++ b/modules/po/hi.po @@ -0,0 +1,113 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR Home Manager contributors +# This file is distributed under the same license as the Home Manager Modules package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: Home Manager Modules\n" +"Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" +"POT-Creation-Date: 2024-04-17 23:19+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: hi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: modules/files.nix:191 +msgid "Creating home file links in %s" +msgstr "" + +#: modules/files.nix:204 +msgid "Cleaning up orphan links from %s" +msgstr "" + +#: modules/files.nix:220 +msgid "Creating profile generation %s" +msgstr "" + +#: modules/files.nix:237 +msgid "No change so reusing latest profile generation %s" +msgstr "" + +#: modules/home-environment.nix:634 +msgid "" +"Oops, Nix failed to install your new Home Manager profile!\n" +"\n" +"Perhaps there is a conflict with a package that was installed using\n" +"\"%s\"? Try running\n" +"\n" +" %s\n" +"\n" +"and if there is a conflicting package you can remove it with\n" +"\n" +" %s\n" +"\n" +"Then try activating your Home Manager configuration again." +msgstr "" + +#: modules/home-environment.nix:667 +msgid "Activating %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:22 +msgid "Migrating profile from %s to %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:54 +msgid "Could not find suitable profile directory, tried %s and %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:83 +msgid "Sanity checking oldGenNum and oldGenPath" +msgstr "" + +#: modules/lib-bash/activation-init.sh:86 +msgid "" +"The previous generation number and path are in conflict! These\n" +"must be either both empty or both set but are now set to\n" +"\n" +" '%s' and '%s'\n" +"\n" +"If you don't mind losing previous profile generations then\n" +"the easiest solution is probably to run\n" +"\n" +" rm %s/home-manager*\n" +" rm %s/current-home\n" +"\n" +"and trying home-manager switch again. Good luck!" +msgstr "" + +#: modules/lib-bash/activation-init.sh:127 +msgid "Error: USER is set to \"%s\" but we expect \"%s\"" +msgstr "" + +#: modules/lib-bash/activation-init.sh:136 +msgid "Error: HOME is set to \"%s\" but we expect \"%s\"" +msgstr "" + +#: modules/lib-bash/activation-init.sh:153 +msgid "Starting Home Manager activation" +msgstr "" + +#: modules/lib-bash/activation-init.sh:157 +msgid "Sanity checking Nix" +msgstr "" + +#: modules/lib-bash/activation-init.sh:170 +msgid "This is a dry run" +msgstr "" + +#: modules/lib-bash/activation-init.sh:174 +msgid "This is a live run" +msgstr "" + +#: modules/lib-bash/activation-init.sh:180 +msgid "Using Nix version: %s" +msgstr "" + +#: modules/lib-bash/activation-init.sh:183 +msgid "Activation variables:" +msgstr "" From f69e61a2d77b721f28868b6fdc55706ca1bad49c Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Fri, 13 Sep 2024 13:36:08 -0300 Subject: [PATCH 436/636] pls: add support for fish abbreviations --- modules/programs/pls.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/programs/pls.nix b/modules/programs/pls.nix index c56c4b01f65b..b9f509a76f34 100644 --- a/modules/programs/pls.nix +++ b/modules/programs/pls.nix @@ -28,7 +28,15 @@ in { programs.bash.shellAliases = mkIf cfg.enableAliases aliases; - programs.fish.shellAliases = mkIf cfg.enableAliases aliases; + programs.fish = mkMerge [ + (mkIf (!config.programs.fish.preferAbbrs) { + shellAliases = mkIf cfg.enableAliases aliases; + }) + + (mkIf config.programs.fish.preferAbbrs { + shellAbbrs = mkIf cfg.enableAliases aliases; + }) + ]; programs.zsh.shellAliases = mkIf cfg.enableAliases aliases; }; From 0d118885b2840447b5b7f2b6097b4511ed3d02e9 Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Fri, 13 Sep 2024 13:52:06 -0300 Subject: [PATCH 437/636] lsd: add support for fish abbreviations --- modules/programs/lsd.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/programs/lsd.nix b/modules/programs/lsd.nix index c333918a88fe..0053a494fbd9 100644 --- a/modules/programs/lsd.nix +++ b/modules/programs/lsd.nix @@ -74,7 +74,15 @@ in { programs.zsh.shellAliases = mkIf cfg.enableAliases aliases; - programs.fish.shellAliases = mkIf cfg.enableAliases aliases; + programs.fish = mkMerge [ + (mkIf (!config.programs.fish.preferAbbrs) { + shellAliases = mkIf cfg.enableAliases aliases; + }) + + (mkIf config.programs.fish.preferAbbrs { + shellAbbrs = mkIf cfg.enableAliases aliases; + }) + ]; programs.lsd = mkIf (cfg.colors != { }) { settings.color.theme = "custom"; }; From c6e4ec39df78245f7ce678476ff068515763345b Mon Sep 17 00:00:00 2001 From: Heitor Augusto Date: Fri, 13 Sep 2024 13:56:28 -0300 Subject: [PATCH 438/636] z-lua: add support for fish abbreviations --- modules/programs/z-lua.nix | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/modules/programs/z-lua.nix b/modules/programs/z-lua.nix index 37a8479eea08..74dee31dcac9 100644 --- a/modules/programs/z-lua.nix +++ b/modules/programs/z-lua.nix @@ -77,16 +77,26 @@ in { })" ''; - programs.fish.shellInit = mkIf cfg.enableFishIntegration '' - source (${pkgs.z-lua}/bin/z --init fish ${ - concatStringsSep " " cfg.options - } | psub) - ''; - programs.bash.shellAliases = mkIf cfg.enableAliases aliases; programs.zsh.shellAliases = mkIf cfg.enableAliases aliases; - programs.fish.shellAliases = mkIf cfg.enableAliases aliases; + programs.fish = mkMerge [ + { + shellInit = mkIf cfg.enableFishIntegration '' + source (${pkgs.z-lua}/bin/z --init fish ${ + concatStringsSep " " cfg.options + } | psub) + ''; + } + + (mkIf (!config.programs.fish.preferAbbrs) { + shellAliases = mkIf cfg.enableAliases aliases; + }) + + (mkIf config.programs.fish.preferAbbrs { + shellAbbrs = mkIf cfg.enableAliases aliases; + }) + ]; }; } From 6c1a461a444e6ccb3f3e42bb627b510c3a722a57 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sat, 14 Sep 2024 12:14:21 +0200 Subject: [PATCH 439/636] mopidy: reduce test closure size --- tests/modules/services/mopidy/mopidy-scan.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/modules/services/mopidy/mopidy-scan.nix b/tests/modules/services/mopidy/mopidy-scan.nix index 58a035a6ad5f..3b050697c138 100644 --- a/tests/modules/services/mopidy/mopidy-scan.nix +++ b/tests/modules/services/mopidy/mopidy-scan.nix @@ -6,6 +6,20 @@ extensionPackages = [ pkgs.mopidy-local ]; }; + test.stubs = { + mopidy = { + version = "0"; + outPath = null; + buildScript = '' + mkdir -p $out/bin + touch $out/bin/mopidy + chmod +x $out/bin/mopidy + ''; + }; + + mopidy-local = { }; + }; + nmt.script = '' assertFileExists home-files/.config/systemd/user/mopidy.service assertFileExists home-files/.config/systemd/user/mopidy-scan.service From e524c57b1fa55d6ca9d8354c6ce1e538d2a1f47f Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 15 Sep 2024 01:45:42 +0200 Subject: [PATCH 440/636] mopidy: fix formatting --- tests/modules/services/mopidy/mopidy-scan.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/modules/services/mopidy/mopidy-scan.nix b/tests/modules/services/mopidy/mopidy-scan.nix index 3b050697c138..16b04292a503 100644 --- a/tests/modules/services/mopidy/mopidy-scan.nix +++ b/tests/modules/services/mopidy/mopidy-scan.nix @@ -11,10 +11,10 @@ version = "0"; outPath = null; buildScript = '' - mkdir -p $out/bin - touch $out/bin/mopidy - chmod +x $out/bin/mopidy - ''; + mkdir -p $out/bin + touch $out/bin/mopidy + chmod +x $out/bin/mopidy + ''; }; mopidy-local = { }; From 9c5f16d7034500ef11d4d6d787728878b4522874 Mon Sep 17 00:00:00 2001 From: sdaqo Date: Sat, 14 Sep 2024 14:03:37 +0200 Subject: [PATCH 441/636] borgmatic: fix service permissions Fixes #5749 --- modules/services/borgmatic.nix | 1 - tests/modules/services/borgmatic/basic-configuration.service | 1 - 2 files changed, 2 deletions(-) diff --git a/modules/services/borgmatic.nix b/modules/services/borgmatic.nix index 1e1813946165..ad9ace87bad9 100644 --- a/modules/services/borgmatic.nix +++ b/modules/services/borgmatic.nix @@ -46,7 +46,6 @@ in { # Lower CPU and I/O priority: Nice = 19; - CPUSchedulingPolicy = "batch"; IOSchedulingClass = "best-effort"; IOSchedulingPriority = 7; IOWeight = 100; diff --git a/tests/modules/services/borgmatic/basic-configuration.service b/tests/modules/services/borgmatic/basic-configuration.service index 80713fd90524..8b760293a4a8 100644 --- a/tests/modules/services/borgmatic/basic-configuration.service +++ b/tests/modules/services/borgmatic/basic-configuration.service @@ -1,5 +1,4 @@ [Service] -CPUSchedulingPolicy=batch ExecStart=/nix/store/00000000000000000000000000000000-systemd/bin/systemd-inhibit \ --who="borgmatic" \ --what="sleep:shutdown" \ From 25479e29d1aefc72a3d031f2703530d6112818a3 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Mon, 16 Sep 2024 00:47:02 +0200 Subject: [PATCH 442/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/574d1eac1c200690e27b8eb4e24887f8df7ac27c?narHash=sha256-v3rIhsJBOMLR8e/RNWxr828tB%2BWywYIoajrZKFM%2B0Gg%3D' (2024-09-06) → 'github:NixOS/nixpkgs/4f807e8940284ad7925ebd0a0993d2a1791acb2f?narHash=sha256-IiA3jfbR7K/B5%2B9byVi9BZGWTD4VSbWe8VLpp9B/iYk%3D' (2024-09-11) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 28440e300221..a653918e9df6 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1725634671, - "narHash": "sha256-v3rIhsJBOMLR8e/RNWxr828tB+WywYIoajrZKFM+0Gg=", + "lastModified": 1726062873, + "narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "574d1eac1c200690e27b8eb4e24887f8df7ac27c", + "rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f", "type": "github" }, "original": { From 76bf779881934ab476962b904a771378278290ad Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sat, 20 Apr 2024 12:46:05 -0400 Subject: [PATCH 443/636] sway: un-extract single-use variable --- modules/services/window-managers/i3-sway/sway.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index 3acd6b17c347..d2d05568c9fd 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -331,13 +331,6 @@ let ++ [ cfg.extraConfig ]); }; - defaultSwayPackage = pkgs.sway.override { - extraSessionCommands = cfg.extraSessionCommands; - extraOptions = cfg.extraOptions; - withBaseWrapper = cfg.wrapperFeatures.base; - withGtkWrapper = cfg.wrapperFeatures.gtk; - }; - in { meta.maintainers = with maintainers; [ Scrumplex @@ -357,7 +350,12 @@ in { package = mkOption { type = with types; nullOr package; - default = defaultSwayPackage; + default = pkgs.sway.override { + extraSessionCommands = cfg.extraSessionCommands; + extraOptions = cfg.extraOptions; + withBaseWrapper = cfg.wrapperFeatures.base; + withGtkWrapper = cfg.wrapperFeatures.gtk; + }; defaultText = literalExpression "${pkgs.sway}"; description = '' Sway package to use. Will override the options From a9c9cc6e50f7cbd2d58ccb1cd46a1e06e9e445ff Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Sat, 20 Apr 2024 12:51:15 -0400 Subject: [PATCH 444/636] sway: do not use `pkgs.sway` when `cfg.package = null` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Implicitly disable checkConfig when `cfg.package = null` as we don’t have any exe to use for the check - Implicitly disable `swaymsg reload` on activation, since we have no exe to use for running it See https://github.com/nix-community/home-manager/issues/5307 --- .../services/window-managers/i3-sway/sway.nix | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/modules/services/window-managers/i3-sway/sway.nix b/modules/services/window-managers/i3-sway/sway.nix index d2d05568c9fd..4148fcf1d629 100644 --- a/modules/services/window-managers/i3-sway/sway.nix +++ b/modules/services/window-managers/i3-sway/sway.nix @@ -258,7 +258,6 @@ let variables = concatStringsSep " " cfg.systemd.variables; extraCommands = concatStringsSep " && " cfg.systemd.extraCommands; - swayPackage = if cfg.package == null then pkgs.sway else cfg.package; systemdActivation = '' exec "${pkgs.dbus}/bin/dbus-update-activation-environment --systemd ${variables}; ${extraCommands}"''; @@ -269,7 +268,7 @@ let checkPhase = lib.optionalString cfg.checkConfig '' export DBUS_SESSION_BUS_ADDRESS=/dev/null export XDG_RUNTIME_DIR=$(mktemp -d) - ${pkgs.xvfb-run}/bin/xvfb-run ${swayPackage}/bin/sway --config "$target" --validate --unsupported-gpu + ${pkgs.xvfb-run}/bin/xvfb-run ${cfg.package}/bin/sway --config "$target" --validate --unsupported-gpu ''; text = concatStringsSep "\n" @@ -362,7 +361,8 @@ in { 'wrapperFeatures', 'extraSessionCommands', and 'extraOptions'. Set to `null` to not add any Sway package to your path. This should be done if you want to use the NixOS Sway - module to install Sway. + module to install Sway. Beware setting to `null` will also disable + reloading Sway when new config is activated. ''; }; @@ -483,9 +483,10 @@ in { checkConfig = mkOption { type = types.bool; - default = true; - description = - "If enabled (the default), validates the generated config file."; + default = cfg.package != null; + defaultText = + literalExpression "wayland.windowManager.sway.package != null"; + description = "If enabled, validates the generated config file."; }; extraConfig = mkOption { @@ -520,6 +521,11 @@ in { assertions = [ (hm.assertions.assertPlatform "wayland.windowManager.sway" pkgs platforms.linux) + { + assertion = cfg.checkConfig -> cfg.package != null; + message = + "programs.sway.checkConfig requires non-null programs.sway.package"; + } ]; home.packages = optional (cfg.package != null) cfg.package @@ -527,10 +533,10 @@ in { xdg.configFile."sway/config" = { source = configFile; - onChange = '' + onChange = lib.optionalString (cfg.package != null) '' swaySocket="''${XDG_RUNTIME_DIR:-/run/user/$UID}/sway-ipc.$UID.$(${pkgs.procps}/bin/pgrep --uid $UID -x sway || true).sock" if [ -S "$swaySocket" ]; then - ${swayPackage}/bin/swaymsg -s $swaySocket reload + ${cfg.package}/bin/swaymsg -s $swaySocket reload fi ''; }; From 4a4a8b145463ccfef579bb0e26275c97bf0b5bf2 Mon Sep 17 00:00:00 2001 From: bricked Date: Tue, 17 Sep 2024 17:20:22 +0000 Subject: [PATCH 445/636] firefox: fix languagepacks policy --- modules/programs/firefox/mkFirefoxModule.nix | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index 8475c95a618e..7175f60874f3 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -813,15 +813,6 @@ in { its example for how to do this. ''; - programs.firefox.policies = { - ExtensionSettings = listToAttrs (map (lang: - nameValuePair "langpack-${lang}@firefox.mozilla.org" { - installation_mode = "normal_installed"; - install_url = - "https://releases.mozilla.org/pub/firefox/releases/${cfg.package.version}/linux-x86_64/xpi/${lang}.xpi"; - }) cfg.languagePacks); - }; - home.packages = lib.optional (cfg.finalPackage != null) cfg.finalPackage; home.file = mkMerge ([{ @@ -1013,6 +1004,17 @@ in { force = true; }; })); - } // setAttrByPath modulePath { finalPackage = wrapPackage cfg.package; }); + } // setAttrByPath modulePath { + finalPackage = wrapPackage cfg.package; + + policies = { + ExtensionSettings = listToAttrs (map (lang: + nameValuePair "langpack-${lang}@firefox.mozilla.org" { + installation_mode = "normal_installed"; + install_url = + "https://releases.mozilla.org/pub/firefox/releases/${cfg.package.version}/linux-x86_64/xpi/${lang}.xpi"; + }) cfg.languagePacks); + }; + }); } From 4974dfb26e1c84d22bfdf943d41a33c9e51209a8 Mon Sep 17 00:00:00 2001 From: Matthew_Cash Date: Sun, 3 Mar 2024 00:33:53 -0800 Subject: [PATCH 446/636] thunderbird: change settings type to json Uses the JSON type, just like the Firefox module, so that nested sets can be used. --- modules/programs/thunderbird.nix | 19 +++++++++++++++++-- .../thunderbird-expected-second.js | 1 + .../programs/thunderbird/thunderbird.nix | 5 ++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/modules/programs/thunderbird.nix b/modules/programs/thunderbird.nix index c15a946ec663..2001e806f76d 100644 --- a/modules/programs/thunderbird.nix +++ b/modules/programs/thunderbird.nix @@ -7,6 +7,11 @@ let cfg = config.programs.thunderbird; + thunderbirdJson = types.attrsOf (pkgs.formats.json { }).type // { + description = + "Thunderbird preference (int, bool, string, and also attrs, list, float as a JSON string)"; + }; + enabledAccounts = attrValues (filterAttrs (_: a: a.thunderbird.enable) config.accounts.email.accounts); @@ -161,11 +166,21 @@ in { }; settings = mkOption { - type = with types; attrsOf (oneOf [ bool int str ]); + type = thunderbirdJson; default = { }; example = literalExpression '' { "mail.spellcheck.inline" = false; + "mailnews.database.global.views.global.columns" = { + selectCol = { + visible = false; + ordinal = 1; + }; + threadCol = { + visible = true; + ordinal = 2; + }; + }; } ''; description = '' @@ -216,7 +231,7 @@ in { }; settings = mkOption { - type = with types; attrsOf (oneOf [ bool int str ]); + type = thunderbirdJson; default = { }; example = literalExpression '' { diff --git a/tests/modules/programs/thunderbird/thunderbird-expected-second.js b/tests/modules/programs/thunderbird/thunderbird-expected-second.js index 085182cbee21..e4e9296a891b 100644 --- a/tests/modules/programs/thunderbird/thunderbird-expected-second.js +++ b/tests/modules/programs/thunderbird/thunderbird-expected-second.js @@ -28,6 +28,7 @@ user_pref("mail.smtpserver.smtp_bcd3ace52bed41febb6cdc2fb1303aebaa573e0d993872da user_pref("mail.smtpserver.smtp_bcd3ace52bed41febb6cdc2fb1303aebaa573e0d993872da503950901bb6c6fc.username", "home.manager.jr"); user_pref("mail.smtpservers", "smtp_bcd3ace52bed41febb6cdc2fb1303aebaa573e0d993872da503950901bb6c6fc"); user_pref("privacy.donottrackheader.enabled", true); +user_pref("second", {"nested":{"evenFurtherNested":[1,2,3]}}); user_pref("second.setting", "some-test-setting"); diff --git a/tests/modules/programs/thunderbird/thunderbird.nix b/tests/modules/programs/thunderbird/thunderbird.nix index f65f80bdfa00..1270839770ea 100644 --- a/tests/modules/programs/thunderbird/thunderbird.nix +++ b/tests/modules/programs/thunderbird/thunderbird.nix @@ -53,7 +53,10 @@ ''; }; - second.settings = { "second.setting" = "some-test-setting"; }; + second.settings = { + "second.setting" = "some-test-setting"; + second.nested.evenFurtherNested = [ 1 2 3 ]; + }; }; settings = { From d2493de5cd1da06b6a4c3e97f4e7d5dd791df457 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Wed, 18 Sep 2024 00:14:15 +0200 Subject: [PATCH 447/636] ci: remove 23.11 from dependabot --- .github/dependabot.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6ba7256db518..2aea2da27597 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,14 +8,6 @@ updates: commit-message: prefix: "ci:" - - package-ecosystem: "github-actions" - directory: "/" - target-branch: "release-23.11" - schedule: - interval: "weekly" - commit-message: - prefix: "ci:" - - package-ecosystem: "github-actions" directory: "/" target-branch: "release-24.05" From 7578176649a08abb73dfbd2755a5988766952b53 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Thu, 19 Sep 2024 13:31:52 +0200 Subject: [PATCH 448/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/4f807e8940284ad7925ebd0a0993d2a1791acb2f?narHash=sha256-IiA3jfbR7K/B5%2B9byVi9BZGWTD4VSbWe8VLpp9B/iYk%3D' (2024-09-11) → 'github:NixOS/nixpkgs/99dc8785f6a0adac95f5e2ab05cc2e1bf666d172?narHash=sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c%3D' (2024-09-16) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index a653918e9df6..203568a47972 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1726062873, - "narHash": "sha256-IiA3jfbR7K/B5+9byVi9BZGWTD4VSbWe8VLpp9B/iYk=", + "lastModified": 1726463316, + "narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4f807e8940284ad7925ebd0a0993d2a1791acb2f", + "rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172", "type": "github" }, "original": { From b6204ff489af6391eeb9feb43978fa3b81ac5d18 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:08:54 +0000 Subject: [PATCH 449/636] xscreensaver: fix type of systemd Service.Environment --- modules/services/xscreensaver.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/xscreensaver.nix b/modules/services/xscreensaver.nix index 6205e3ee81e1..c5d6126bed0d 100644 --- a/modules/services/xscreensaver.nix +++ b/modules/services/xscreensaver.nix @@ -60,7 +60,7 @@ in { Service = { ExecStart = "${cfg.package}/bin/xscreensaver -no-splash"; - Environment = "PATH=${makeBinPath [ cfg.package ]}"; + Environment = [ "PATH=${makeBinPath [ cfg.package ]}" ]; }; Install = { WantedBy = [ "graphical-session.target" ]; }; From 1d8296c46f3b688bcdf7f68ba7cf92fa6203c192 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:13:03 +0000 Subject: [PATCH 450/636] flameshot: fix type of systemd Service.Environment See #5854 --- modules/services/flameshot.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/services/flameshot.nix b/modules/services/flameshot.nix index 0c2435aeb732..ebdfd0067e4f 100644 --- a/modules/services/flameshot.nix +++ b/modules/services/flameshot.nix @@ -24,7 +24,7 @@ in { }; settings = mkOption { - type = iniFormat.type; + inherit (iniFormat) type; default = { }; example = { General = { @@ -64,7 +64,7 @@ in { Install = { WantedBy = [ "graphical-session.target" ]; }; Service = { - Environment = "PATH=${config.home.profileDirectory}/bin"; + Environment = [ "PATH=${config.home.profileDirectory}/bin" ]; ExecStart = "${cfg.package}/bin/flameshot"; Restart = "on-abort"; From ffc3a473e62da754222a816ffe986b7fd0902da2 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:13:59 +0000 Subject: [PATCH 451/636] xembed-sni-proxy: fix type of systemd Service.Environment See #5854 --- modules/services/xembed-sni-proxy.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/xembed-sni-proxy.nix b/modules/services/xembed-sni-proxy.nix index e0b1f8464e2a..4273e81a3802 100644 --- a/modules/services/xembed-sni-proxy.nix +++ b/modules/services/xembed-sni-proxy.nix @@ -41,7 +41,7 @@ in { Install = { WantedBy = [ "graphical-session.target" ]; }; Service = { - Environment = "PATH=${config.home.profileDirectory}/bin"; + Environment = [ "PATH=${config.home.profileDirectory}/bin" ]; ExecStart = "${cfg.package}/bin/xembedsniproxy"; Restart = "on-abort"; }; From 10fd27c291479bb71e5debf40c28192bb14e978b Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:14:28 +0000 Subject: [PATCH 452/636] kdeconnect: fix type of systemd Service.Environment See #5854 --- modules/services/kdeconnect.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/services/kdeconnect.nix b/modules/services/kdeconnect.nix index 656a8c9a61f5..f0b1da5be275 100644 --- a/modules/services/kdeconnect.nix +++ b/modules/services/kdeconnect.nix @@ -47,7 +47,7 @@ in { Install = { WantedBy = [ "graphical-session.target" ]; }; Service = { - Environment = "PATH=${config.home.profileDirectory}/bin"; + Environment = [ "PATH=${config.home.profileDirectory}/bin" ]; ExecStart = if strings.versionAtLeast (versions.majorMinor cfg.package.version) "24.05" then @@ -81,7 +81,7 @@ in { Install = { WantedBy = [ "graphical-session.target" ]; }; Service = { - Environment = "PATH=${config.home.profileDirectory}/bin"; + Environment = [ "PATH=${config.home.profileDirectory}/bin" ]; ExecStart = "${cfg.package}/bin/kdeconnect-indicator"; Restart = "on-abort"; }; From 80092fae03d42f41952ae9227b193674da22596e Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:14:54 +0000 Subject: [PATCH 453/636] mpd: fix type of systemd Service.Environment See #5854 --- modules/services/mpd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/mpd.nix b/modules/services/mpd.nix index 3d8d03be7161..8787ad667a78 100644 --- a/modules/services/mpd.nix +++ b/modules/services/mpd.nix @@ -188,7 +188,7 @@ in { }; Service = { - Environment = "PATH=${config.home.profileDirectory}/bin"; + Environment = [ "PATH=${config.home.profileDirectory}/bin" ]; ExecStart = "${cfg.package}/bin/mpd --no-daemon ${mpdConf} ${ escapeShellArgs cfg.extraArgs }"; From 336c792b1936cd228de505c1c239e90422dfba74 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:15:20 +0000 Subject: [PATCH 454/636] rsibreak: fix type of systemd Service.Environment See #5854 --- modules/services/rsibreak.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/rsibreak.nix b/modules/services/rsibreak.nix index 351632a0260d..d587c2dafa55 100644 --- a/modules/services/rsibreak.nix +++ b/modules/services/rsibreak.nix @@ -30,7 +30,7 @@ in { Install = { WantedBy = [ "graphical-session.target" ]; }; Service = { - Environment = "PATH=${config.home.profileDirectory}/bin"; + Environment = [ "PATH=${config.home.profileDirectory}/bin" ]; ExecStart = "${pkgs.rsibreak}/bin/rsibreak"; }; }; From 397750d269041f071bad5abffdfed7329e7e0166 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:15:43 +0000 Subject: [PATCH 455/636] xsettings: fix type of systemd Service.Environment See #5854 --- modules/services/xsettingsd.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/xsettingsd.nix b/modules/services/xsettingsd.nix index c949676fa66c..c71e9ad82cc7 100644 --- a/modules/services/xsettingsd.nix +++ b/modules/services/xsettingsd.nix @@ -82,7 +82,7 @@ in { Install.WantedBy = [ "graphical-session.target" ]; Service = { - Environment = "PATH=${config.home.profileDirectory}/bin"; + Environment = [ "PATH=${config.home.profileDirectory}/bin" ]; ExecStart = "${cfg.package}/bin/xsettingsd" + optionalString (cfg.configFile != null) " -c ${escapeShellArg cfg.configFile}"; From cacf2d27f6cd45ecc78a6a25404d4ed1ec8dd97d Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:16:40 +0000 Subject: [PATCH 456/636] kbfs: fix type of systemd Service.Environment See #5854 --- modules/services/kbfs.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/kbfs.nix b/modules/services/kbfs.nix index 9cfe027522a6..21e962968744 100644 --- a/modules/services/kbfs.nix +++ b/modules/services/kbfs.nix @@ -46,7 +46,7 @@ in { Service = let mountPoint = ''"%h/${cfg.mountPoint}"''; in { - Environment = "PATH=/run/wrappers/bin KEYBASE_SYSTEMD=1"; + Environment = [ "PATH=/run/wrappers/bin" "KEYBASE_SYSTEMD=1" ]; ExecStartPre = "${pkgs.coreutils}/bin/mkdir -p ${mountPoint}"; ExecStart = "${pkgs.kbfs}/bin/kbfsfuse ${toString cfg.extraFlags} ${mountPoint}"; From 3670a035868a8b074892bb17ee7743188f449d06 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:17:05 +0000 Subject: [PATCH 457/636] hound: fix type of systemd Service.Environment See #5854 --- modules/services/hound.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/hound.nix b/modules/services/hound.nix index ff18a381ad8c..3aaf93200b55 100644 --- a/modules/services/hound.nix +++ b/modules/services/hound.nix @@ -72,7 +72,7 @@ in { Install = { WantedBy = [ "default.target" ]; }; Service = { - Environment = "PATH=${makeBinPath [ pkgs.mercurial pkgs.git ]}"; + Environment = [ "PATH=${makeBinPath [ pkgs.mercurial pkgs.git ]}" ]; ExecStart = "${pkgs.hound}/bin/houndd ${concatStringsSep " " houndOptions}"; }; From 06c6695c8caa012bb0c7d794127ef2f94ef3137a Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:17:44 +0000 Subject: [PATCH 458/636] grobi: fix type of systemd Service.Environment See #5854 --- modules/services/grobi.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/grobi.nix b/modules/services/grobi.nix index e656a763f260..9031089c99e2 100644 --- a/modules/services/grobi.nix +++ b/modules/services/grobi.nix @@ -88,7 +88,7 @@ in { ExecStart = "${pkgs.grobi}/bin/grobi watch -v"; Restart = "always"; RestartSec = "2s"; - Environment = "PATH=${pkgs.xorg.xrandr}/bin:${pkgs.bash}/bin"; + Environment = [ "PATH=${pkgs.xorg.xrandr}/bin:${pkgs.bash}/bin" ]; }; Install = { WantedBy = [ "graphical-session.target" ]; }; From dcc1a9e6599905fe348e061b1471d82aa0a6275b Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:18:08 +0000 Subject: [PATCH 459/636] nextcloud-client: fix type of systemd Service.Environment See #5854 --- modules/services/nextcloud-client.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/nextcloud-client.nix b/modules/services/nextcloud-client.nix index b436488d1662..24b3c99dd353 100644 --- a/modules/services/nextcloud-client.nix +++ b/modules/services/nextcloud-client.nix @@ -41,7 +41,7 @@ in { }; Service = { - Environment = "PATH=${config.home.profileDirectory}/bin"; + Environment = [ "PATH=${config.home.profileDirectory}/bin" ]; ExecStart = "${cfg.package}/bin/nextcloud" + (optionalString cfg.startInBackground " --background"); }; From 7540dcc7899193ddef035b19d91eecd57dacf30c Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:18:36 +0000 Subject: [PATCH 460/636] opensnitch-ui: fix type of systemd Service.Environment See #5854 --- modules/services/opensnitch-ui.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/opensnitch-ui.nix b/modules/services/opensnitch-ui.nix index a086554cad2d..f45ee9cdbf8b 100644 --- a/modules/services/opensnitch-ui.nix +++ b/modules/services/opensnitch-ui.nix @@ -28,7 +28,7 @@ in { }; Service = { - Environment = "PATH=${config.home.profileDirectory}/bin"; + Environment = [ "PATH=${config.home.profileDirectory}/bin" ]; ExecStart = "${pkgs.opensnitch-ui}/bin/opensnitch-ui"; }; From 480d589cddf0057d7bac491bd9a08e5a083cf6cb Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:18:59 +0000 Subject: [PATCH 461/636] opensnitch-client: fix type of systemd Service.Environment See #5854 --- modules/services/owncloud-client.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/owncloud-client.nix b/modules/services/owncloud-client.nix index 2884affe41a4..3235dac9cea5 100644 --- a/modules/services/owncloud-client.nix +++ b/modules/services/owncloud-client.nix @@ -29,7 +29,7 @@ in { }; Service = { - Environment = "PATH=${config.home.profileDirectory}/bin"; + Environment = [ "PATH=${config.home.profileDirectory}/bin" ]; ExecStart = "${cfg.package}/bin/owncloud"; }; From 451606f4a843752fc18cdcc764c0e7373ede3e96 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Thu, 19 Sep 2024 16:19:27 +0000 Subject: [PATCH 462/636] polybar: fix type of systemd Service.Environment See #5854 --- modules/services/polybar.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/polybar.nix b/modules/services/polybar.nix index fbcecc5aff6e..e41646b2f094 100644 --- a/modules/services/polybar.nix +++ b/modules/services/polybar.nix @@ -220,7 +220,7 @@ in { Service = { Type = "forking"; - Environment = "PATH=${cfg.package}/bin:/run/wrappers/bin"; + Environment = [ "PATH=${cfg.package}/bin:/run/wrappers/bin" ]; ExecStart = let scriptPkg = pkgs.writeShellScriptBin "polybar-start" cfg.script; in "${scriptPkg}/bin/polybar-start"; From 87c7d4df161d0eafc0c8fe93a98ba5247a83d969 Mon Sep 17 00:00:00 2001 From: bricked Date: Thu, 19 Sep 2024 16:22:39 +0000 Subject: [PATCH 463/636] firefox: fix policies availability --- modules/programs/firefox/mkFirefoxModule.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index 7175f60874f3..23533ce50e3a 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -330,7 +330,7 @@ in { description = "Resulting ${cfg.name} package."; }; - policies = optionalAttrs (unwrappedPackageName != null) (mkOption { + policies = optionalAttrs (wrappedPackageName != null) (mkOption { inherit visible; type = types.attrsOf jsonFormat.type; default = { }; From 1f7b8188a9c9c5ba32f9a8351c55f42ecc22b77c Mon Sep 17 00:00:00 2001 From: Mike Thai <15115669+m1kethai@users.noreply.github.com> Date: Tue, 17 Sep 2024 17:58:03 -0400 Subject: [PATCH 464/636] zoxide: replace outdated flag in "options" example The "--no-aliases" option hasn't been a valid init option since 0.8.1, when it was renamed to "--no-cmd". --- modules/programs/zoxide.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/zoxide.nix b/modules/programs/zoxide.nix index 3dcbbd67bb8e..317f7f0570a6 100644 --- a/modules/programs/zoxide.nix +++ b/modules/programs/zoxide.nix @@ -26,7 +26,7 @@ in { options = mkOption { type = types.listOf types.str; default = [ ]; - example = [ "--no-aliases" ]; + example = [ "--no-cmd" ]; description = '' List of options to pass to zoxide. ''; From b5e09b85f22675923a61ef75e6e9188bd113a6e1 Mon Sep 17 00:00:00 2001 From: yuanwang Date: Fri, 9 Aug 2024 12:52:05 -0600 Subject: [PATCH 465/636] firefox: only add Version = 2 on non-darwin The `Version` field in `profiles.ini` does not seem to work on Darwin systems. Co-authored-by: bricked --- modules/programs/firefox/mkFirefoxModule.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index 23533ce50e3a..addf8ac83eb7 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -61,7 +61,8 @@ let }) // { General = { StartWithLastProfile = 1; - Version = 2; + } // lib.optionalAttrs (cfg.profileVersion == null) { + Version = cfg.profileVersion; }; }; @@ -342,6 +343,13 @@ in { }; }); + profileVersion = mkOption { + internal = true; + type = types.nullOr types.ints.unsigned; + default = if isDarwin then null else 2; + description = "profile version, set null for nix-darwin"; + }; + profiles = mkOption { inherit visible; type = types.attrsOf (types.submodule ({ config, name, ... }: { From 1786e2afdbc48e9038f7cff585069736e1d0ed44 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 20 Sep 2024 00:35:54 +0200 Subject: [PATCH 466/636] firefox: fix incorrect condition This error was introduced by me when switching from use of an explicit `if` expression to `optionalAttrs`. --- modules/programs/firefox/mkFirefoxModule.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index addf8ac83eb7..2e4c23cde182 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -61,7 +61,7 @@ let }) // { General = { StartWithLastProfile = 1; - } // lib.optionalAttrs (cfg.profileVersion == null) { + } // lib.optionalAttrs (cfg.profileVersion != null) { Version = cfg.profileVersion; }; }; From 2cf3abce034432cb357c0a6a670481819c55f564 Mon Sep 17 00:00:00 2001 From: iniw Date: Fri, 20 Sep 2024 03:47:23 -0300 Subject: [PATCH 467/636] neovim: use `home.shellAliases` Instead of manually adding it as an alias for each and every individual shell, which inevitably ends up missing some. --- modules/programs/neovim.nix | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index fad05c1c4936..8632a7ec8916 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -414,6 +414,8 @@ in { home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "nvim"; }; + home.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; }; + xdg.configFile = let hasLuaConfig = hasAttr "lua" config.programs.neovim.generatedConfigs; in mkMerge ( @@ -443,9 +445,5 @@ in { + extraMakeWrapperLuaArgs; wrapRc = false; }); - - programs.bash.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; }; - programs.fish.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; }; - programs.zsh.shellAliases = mkIf cfg.vimdiffAlias { vimdiff = "nvim -d"; }; }; } From ecaed80b18e1d179d728d862c96d2fe43699226b Mon Sep 17 00:00:00 2001 From: alejandro-angulo Date: Sat, 17 Aug 2024 10:21:57 -0700 Subject: [PATCH 468/636] kitty: remove IFD With this change the theme check happens at activation time. An integration test is also added to verify the functionality. Fixes #5110 --- modules/misc/news.nix | 18 ++++- modules/programs/kitty.nix | 64 ++++++++++------ tests/integration/default.nix | 1 + .../standalone/kitty-theme-bad-home.nix | 13 ++++ .../standalone/kitty-theme-good-home.nix | 14 ++++ tests/integration/standalone/kitty.nix | 73 +++++++++++++++++++ tests/modules/programs/kitty/default.nix | 5 +- .../programs/kitty/theme-to-themeFile.nix | 24 ++++++ 8 files changed, 185 insertions(+), 27 deletions(-) create mode 100644 tests/integration/standalone/kitty-theme-bad-home.nix create mode 100644 tests/integration/standalone/kitty-theme-good-home.nix create mode 100644 tests/integration/standalone/kitty.nix create mode 100644 tests/modules/programs/kitty/theme-to-themeFile.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 655546ff3f7e..410238792f66 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1,9 +1,6 @@ { config, lib, options, pkgs, ... }: - with lib; - let - cfg = config.news; hostPlatform = pkgs.stdenv.hostPlatform; @@ -44,7 +41,6 @@ let config = { id = mkDefault (builtins.hashString "sha256" config.message); }; }); - in { meta.maintainers = [ maintainers.rycee ]; @@ -1724,6 +1720,20 @@ in { editor). ''; } + + { + time = "2024-09-20T07:00:11+00:00"; + condition = config.programs.kitty.theme != null; + message = '' + The option 'programs.kitty.theme' has been deprecated, please use + 'programs.kitty.themeFile' instead. + + The 'programs.kitty.themeFile' option expects the file name of a + theme from `kitty-themes`, without the `.conf` suffix. See + for a + list of themes. + ''; + } ]; }; } diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index 48ec13da4116..e9594ec120bd 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -3,7 +3,6 @@ with lib; let - cfg = config.programs.kitty; eitherStrBoolInt = with types; either str (either bool int); @@ -57,6 +56,26 @@ let ''; }; in { + imports = [ + (mkChangedOptionModule [ "programs" "kitty" "theme" ] [ + "programs" + "kitty" + "themeFile" + ] (config: + let value = getAttrFromPath [ "programs" "kitty" "theme" ] config; + in if value != null then + (let + matching = filter (x: x.name == value) (builtins.fromJSON + (builtins.readFile + "${pkgs.kitty-themes}/share/kitty-themes/themes.json")); + in throwIf (length matching == 0) + "kitty-themes does not contain a theme named ${value}" + strings.removeSuffix ".conf" + (strings.removePrefix "themes/" (head matching).file)) + else + null)) + ]; + options.programs.kitty = { enable = mkEnableOption "Kitty terminal emulator"; @@ -100,16 +119,16 @@ in { ''; }; - theme = mkOption { + themeFile = mkOption { type = types.nullOr types.str; default = null; description = '' - Apply a Kitty color theme. This option takes the friendly name of - any theme given by the command {command}`kitty +kitten themes`. - See - for more details. + Apply a Kitty color theme. This option takes the file name of a theme + in `kitty-themes`, without the `.conf` suffix. See + for a + list of themes. ''; - example = "Space Gray Eighties"; + example = "SpaceGray_Eighties"; }; font = mkOption { @@ -146,11 +165,11 @@ in { type = types.str; default = "no-rc"; example = "no-cursor"; - apply = (o: + apply = o: let modes = splitString " " o; filtered = filter (m: m != "no-rc") modes; - in concatStringsSep " " (concatLists [ [ "no-rc" ] filtered ])); + in concatStringsSep " " (concatLists [ [ "no-rc" ] filtered ]); description = '' Set the mode of the shell integration. This accepts the same options as the `shell_integration` option of Kitty. Note that @@ -184,24 +203,15 @@ in { text = '' # Generated by Home Manager. # See https://sw.kovidgoyal.net/kitty/conf.html - '' + concatStringsSep "\n" ([ - + '' + concatStringsSep "\n" [ (optionalString (cfg.font != null) '' font_family ${cfg.font.name} ${optionalString (cfg.font.size != null) "font_size ${toString cfg.font.size}"} '') - (optionalString (cfg.theme != null) '' - include ${pkgs.kitty-themes}/share/kitty-themes/${ - let - matching = filter (x: x.name == cfg.theme) (builtins.fromJSON - (builtins.readFile - "${pkgs.kitty-themes}/share/kitty-themes/themes.json")); - in throwIf (length matching == 0) - "kitty-themes does not contain a theme named ${cfg.theme}" - (head matching).file - } + (optionalString (cfg.themeFile != null) '' + include ${pkgs.kitty-themes}/share/kitty-themes/themes/${cfg.themeFile}.conf '') '' # Shell integration is sourced and configured manually @@ -211,13 +221,23 @@ in { (toKittyKeybindings cfg.keybindings) (toKittyEnv cfg.environment) cfg.extraConfig - ]); + ]; } // optionalAttrs pkgs.stdenv.hostPlatform.isLinux { onChange = '' ${pkgs.procps}/bin/pkill -USR1 -u $USER kitty || true ''; }; + home.activation.checkKittyTheme = mkIf (cfg.themeFile != null) (let + themePath = + "${pkgs.kitty-themes}/share/kitty-themes/themes/${cfg.themeFile}.conf"; + in hm.dag.entryBefore [ "writeBoundary" ] '' + if [[ ! -f "${themePath}" ]]; then + errorEcho "kitty-themes does not contain the theme file ${themePath}!" + exit 1 + fi + ''); + xdg.configFile."kitty/macos-launch-services-cmdline" = mkIf (cfg.darwinLaunchOptions != null && pkgs.stdenv.hostPlatform.isDarwin) { text = concatStringsSep " " cfg.darwinLaunchOptions; diff --git a/tests/integration/default.nix b/tests/integration/default.nix index c31030172cfa..262f28faf03f 100644 --- a/tests/integration/default.nix +++ b/tests/integration/default.nix @@ -10,6 +10,7 @@ let }; tests = { + kitty = runTest ./standalone/kitty.nix; nixos-basics = runTest ./nixos/basics.nix; standalone-flake-basics = runTest ./standalone/flake-basics.nix; standalone-standard-basics = runTest ./standalone/standard-basics.nix; diff --git a/tests/integration/standalone/kitty-theme-bad-home.nix b/tests/integration/standalone/kitty-theme-bad-home.nix new file mode 100644 index 000000000000..e4851701bcf8 --- /dev/null +++ b/tests/integration/standalone/kitty-theme-bad-home.nix @@ -0,0 +1,13 @@ +{ ... }: { + home.username = "alice"; + home.homeDirectory = "/home/alice"; + home.stateVersion = "24.05"; + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + + programs.kitty = { + enable = true; + themeFile = "No Such Theme"; + }; +} diff --git a/tests/integration/standalone/kitty-theme-good-home.nix b/tests/integration/standalone/kitty-theme-good-home.nix new file mode 100644 index 000000000000..f6085b1e13c8 --- /dev/null +++ b/tests/integration/standalone/kitty-theme-good-home.nix @@ -0,0 +1,14 @@ +{ ... }: { + home.username = "alice"; + home.homeDirectory = "/home/alice"; + + home.stateVersion = "24.05"; # Please read the comment before changing. + + # Let Home Manager install and manage itself. + programs.home-manager.enable = true; + + programs.kitty = { + enable = true; + themeFile = "SpaceGray_Eighties"; + }; +} diff --git a/tests/integration/standalone/kitty.nix b/tests/integration/standalone/kitty.nix new file mode 100644 index 000000000000..8f89330cffc9 --- /dev/null +++ b/tests/integration/standalone/kitty.nix @@ -0,0 +1,73 @@ +{ pkgs, ... }: { + name = "kitty-theme-path"; + meta.maintainers = [ pkgs.lib.maintainers.rycee ]; + + nodes.machine = { ... }: { + imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ]; + virtualisation.memorySize = 2048; + users.users.alice = { + isNormalUser = true; + description = "Alice Foobar"; + password = "foobar"; + uid = 1000; + }; + }; + + testScript = '' + start_all() + machine.wait_for_unit("network.target") + machine.wait_for_unit("multi-user.target") + + home_manager = "${../../..}" + + def login_as_alice(): + machine.wait_until_tty_matches("1", "login: ") + machine.send_chars("alice\n") + machine.wait_until_tty_matches("1", "Password: ") + machine.send_chars("foobar\n") + machine.wait_until_tty_matches("1", "alice\\@machine") + + def logout_alice(): + machine.send_chars("exit\n") + + def alice_cmd(cmd): + return f"su -l alice --shell /bin/sh -c $'export XDG_RUNTIME_DIR=/run/user/$UID ; {cmd}'" + + def succeed_as_alice(cmd): + return machine.succeed(alice_cmd(cmd)) + + def fail_as_alice(cmd): + return machine.fail(alice_cmd(cmd)) + + # Create a persistent login so that Alice has a systemd session. + login_as_alice() + + # Set up a home-manager channel. + succeed_as_alice(" ; ".join([ + "mkdir -p /home/alice/.nix-defexpr/channels", + f"ln -s {home_manager} /home/alice/.nix-defexpr/channels/home-manager" + ])) + + succeed_as_alice("nix-shell \"\" -A install") + + with subtest("Switch to Bad Kitty"): + succeed_as_alice("cp ${ + ./kitty-theme-bad-home.nix + } /home/alice/.config/home-manager/home.nix") + + actual = fail_as_alice("home-manager switch") + expected = "kitty-themes does not contain the theme file" + assert expected in actual, \ + f"expected home-manager switch to contain {expected}, but got {actual}" + + with subtest("Switch to Good Kitty"): + succeed_as_alice("cp ${ + ./kitty-theme-good-home.nix + } /home/alice/.config/home-manager/home.nix") + + actual = succeed_as_alice("home-manager switch") + expected = "Activating checkKittyTheme" + assert expected in actual, \ + f"expected home-manager switch to contain {expected}, but got {actual}" + ''; +} diff --git a/tests/modules/programs/kitty/default.nix b/tests/modules/programs/kitty/default.nix index 694c43cd87ad..76016d5163bb 100644 --- a/tests/modules/programs/kitty/default.nix +++ b/tests/modules/programs/kitty/default.nix @@ -1 +1,4 @@ -{ kitty-example-settings = ./example-settings.nix; } +{ + kitty-example-settings = ./example-settings.nix; + kitty-theme-to-themeFile = ./theme-to-themeFile.nix; +} diff --git a/tests/modules/programs/kitty/theme-to-themeFile.nix b/tests/modules/programs/kitty/theme-to-themeFile.nix new file mode 100644 index 000000000000..84596bba966c --- /dev/null +++ b/tests/modules/programs/kitty/theme-to-themeFile.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, options, ... }: { + config = { + programs.kitty = { + enable = true; + theme = "Space Gray Eighties"; + }; + + test.stubs.kitty = { }; + + test.asserts.warnings.enable = true; + test.asserts.warnings.expected = [ + ("The option `programs.kitty.theme' defined in ${ + lib.showFiles options.programs.kitty.theme.files + } has been changed to `programs.kitty.themeFile' that has a different" + + " type. Please read `programs.kitty.themeFile' documentation and" + + " update your configuration accordingly.") + ]; + + nmt.script = '' + assertFileExists home-files/.config/kitty/kitty.conf + assertFileRegex home-files/.config/kitty/kitty.conf "^include .*themes/SpaceGray_Eighties\.conf$" + ''; + }; +} From f48b181f0161db6246a1bd1b05d70a7b3a87ab41 Mon Sep 17 00:00:00 2001 From: mgdbbrt <113188948+mgdbbrt@users.noreply.github.com> Date: Fri, 20 Sep 2024 09:38:42 +0200 Subject: [PATCH 469/636] ssh-agent: use POSIX conforming if condition --- modules/services/ssh-agent.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/ssh-agent.nix b/modules/services/ssh-agent.nix index 88ecf38b81c2..d2c170c21824 100644 --- a/modules/services/ssh-agent.nix +++ b/modules/services/ssh-agent.nix @@ -20,7 +20,7 @@ in { ]; home.sessionVariablesExtra = '' - if [[ -z "$SSH_AUTH_SOCK" ]]; then + if [ -z "$SSH_AUTH_SOCK" ]; then export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent fi ''; From 6b1912380e5577063401f58a2deb985fdc7cdc60 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 09:43:17 +0200 Subject: [PATCH 470/636] ci: bump DeterminateSystems/update-flake-lock from 23 to 24 Bumps [DeterminateSystems/update-flake-lock](https://github.com/determinatesystems/update-flake-lock) from 23 to 24. - [Release notes](https://github.com/determinatesystems/update-flake-lock/releases) - [Commits](https://github.com/determinatesystems/update-flake-lock/compare/v23...v24) --- updated-dependencies: - dependency-name: DeterminateSystems/update-flake-lock dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/update-flake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-flake.yml b/.github/workflows/update-flake.yml index 8ba9264d3528..ba9b5f818a7b 100644 --- a/.github/workflows/update-flake.yml +++ b/.github/workflows/update-flake.yml @@ -14,7 +14,7 @@ jobs: - name: Install Nix uses: cachix/install-nix-action@v27 - name: Update flake.lock - uses: DeterminateSystems/update-flake-lock@v23 + uses: DeterminateSystems/update-flake-lock@v24 with: token: ${{ secrets.GH_TOKEN_FOR_UPDATES }} pr-labels: dependencies From 8d7e352a4b25ac2d88a881ffa3472680af916ddc Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Fri, 20 Sep 2024 08:44:52 +0100 Subject: [PATCH 471/636] poweralertd: Enable passing CLI args to the daemon --- modules/services/poweralertd.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/services/poweralertd.nix b/modules/services/poweralertd.nix index bc02dead3948..7010b079710e 100644 --- a/modules/services/poweralertd.nix +++ b/modules/services/poweralertd.nix @@ -7,8 +7,18 @@ let cfg = config.services.poweralertd; in { meta.maintainers = [ maintainers.thibautmarty ]; - options.services.poweralertd.enable = - mkEnableOption "the Upower-powered power alertd"; + options.services.poweralertd = { + enable = mkEnableOption "the Upower-powered power alertd"; + + extraArgs = mkOption { + type = with types; listOf str; + default = [ ]; + example = [ "-s" "-S" ]; + description = '' + Extra command line arguments to pass to poweralertd. + ''; + }; + }; config = mkIf cfg.enable { assertions = [ @@ -28,7 +38,9 @@ in { Service = { Type = "simple"; - ExecStart = "${pkgs.poweralertd}/bin/poweralertd"; + ExecStart = "${pkgs.poweralertd}/bin/poweralertd ${ + utils.escapeSystemdExecArgs cfg.extraArgs + }"; Restart = "always"; }; }; From 4803bf558bdf20cb067aceb8830b7ad70113f4e3 Mon Sep 17 00:00:00 2001 From: leoTlr Date: Fri, 20 Sep 2024 11:13:54 +0200 Subject: [PATCH 472/636] swayidle: make -w optional The option -w causes swayidle to wait on timeouts/events to finish. This can cause problems with certain timout/event commands (see https://github.com/swaywm/swaylock/issues/86#issuecomment-662702180) --- docs/release-notes/rl-2411.md | 11 ++++++++++- modules/misc/news.nix | 14 ++++++++++++++ modules/services/swayidle.nix | 5 ++--- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/docs/release-notes/rl-2411.md b/docs/release-notes/rl-2411.md index 85eae034f92c..6f7a6b7b092c 100644 --- a/docs/release-notes/rl-2411.md +++ b/docs/release-notes/rl-2411.md @@ -7,7 +7,16 @@ is therefore not final. This release has the following notable changes: -- No changes. +- The swayidle module behavior has changed. Specifically, swayidle was + previously always called with a `-w` flag. This flag is now moved to + the default + [services.swayidle.extraArgs](#opt-services.swayidle.extraArgs) + value to make it optional. + + Your configuration may break if you already set this option and also + rely on the flag being automatically added. To resolve this, please + add `-w` to your assignment of + [services.swayidle.extraArgs](#opt-services.swayidle.extraArgs). ## State Version Changes {#sec-release-24.11-state-version-changes} diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 410238792f66..f8786de2f4c5 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1734,6 +1734,20 @@ in { list of themes. ''; } + + { + time = "2024-09-20T07:48:08+00:00"; + condition = hostPlatform.isLinux && config.services.swayidle.enable; + message = '' + The swayidle module behavior has changed. Specifically, swayidle was + previously always called with a `-w` flag. This flag is now moved to + the default `services.swayidle.extraArgs` value to make it optional. + + Your configuration may break if you already set this option and also + rely on the flag being automatically added. To resolve this, please + add `-w` to your assignment of `services.swayidle.extraArgs`. + ''; + } ]; }; } diff --git a/modules/services/swayidle.nix b/modules/services/swayidle.nix index 80317e42ac12..a2f7d13cb560 100644 --- a/modules/services/swayidle.nix +++ b/modules/services/swayidle.nix @@ -94,7 +94,7 @@ in { extraArgs = mkOption { type = with types; listOf str; - default = [ ]; + default = [ "-w" ]; description = "Extra arguments to pass to swayidle."; }; @@ -127,8 +127,7 @@ in { Restart = "always"; # swayidle executes commands using "sh -c", so the PATH needs to contain a shell. Environment = [ "PATH=${makeBinPath [ pkgs.bash ]}" ]; - ExecStart = - "${cfg.package}/bin/swayidle -w ${concatStringsSep " " args}"; + ExecStart = "${cfg.package}/bin/swayidle ${concatStringsSep " " args}"; }; Install = { WantedBy = [ cfg.systemdTarget ]; }; From 0b052dd8119005c6ba819db48bcc657e48f401b7 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Fri, 20 Sep 2024 11:31:51 +0200 Subject: [PATCH 473/636] swayidle: minor cleanups --- modules/services/swayidle.nix | 23 +++++----- .../services/swayidle/basic-configuration.nix | 42 +++++++++++-------- 2 files changed, 34 insertions(+), 31 deletions(-) diff --git a/modules/services/swayidle.nix b/modules/services/swayidle.nix index a2f7d13cb560..7f3376a1ce42 100644 --- a/modules/services/swayidle.nix +++ b/modules/services/swayidle.nix @@ -6,18 +6,6 @@ let cfg = config.services.swayidle; - mkTimeout = t: - [ "timeout" (toString t.timeout) (escapeShellArg t.command) ] - ++ optionals (t.resumeCommand != null) [ - "resume" - (escapeShellArg t.resumeCommand) - ]; - - mkEvent = e: [ e.event (escapeShellArg e.command) ]; - - args = cfg.extraArgs ++ (concatMap mkTimeout cfg.timeouts) - ++ (concatMap mkEvent cfg.events); - in { meta.maintainers = [ maintainers.c0deaddict ]; @@ -127,7 +115,16 @@ in { Restart = "always"; # swayidle executes commands using "sh -c", so the PATH needs to contain a shell. Environment = [ "PATH=${makeBinPath [ pkgs.bash ]}" ]; - ExecStart = "${cfg.package}/bin/swayidle ${concatStringsSep " " args}"; + ExecStart = let + mkTimeout = t: + [ "timeout" (toString t.timeout) t.command ] + ++ optionals (t.resumeCommand != null) [ "resume" t.resumeCommand ]; + + mkEvent = e: [ e.event e.command ]; + + args = cfg.extraArgs ++ (concatMap mkTimeout cfg.timeouts) + ++ (concatMap mkEvent cfg.events); + in "${getExe cfg.package} ${escapeShellArgs args}"; }; Install = { WantedBy = [ cfg.systemdTarget ]; }; diff --git a/tests/modules/services/swayidle/basic-configuration.nix b/tests/modules/services/swayidle/basic-configuration.nix index 96d9832090fc..c38f4d67d86e 100644 --- a/tests/modules/services/swayidle/basic-configuration.nix +++ b/tests/modules/services/swayidle/basic-configuration.nix @@ -3,7 +3,7 @@ { services.swayidle = { enable = true; - package = config.lib.test.mkStubPackage { }; + package = config.lib.test.mkStubPackage { outPath = "@swayidle@"; }; timeouts = [ { timeout = 50; @@ -31,24 +31,30 @@ ]; }; - nmt.script = let - escapeForRegex = builtins.replaceStrings [ "'" "*" ] [ "'\\''" "\\*" ]; - expectedArgs = escapeForRegex (lib.concatStringsSep " " [ - "-w" - "timeout 50 'notify-send -t 10000 -- \"Screen lock in 10 seconds\"'" - "timeout 60 'swaylock -fF'" - "timeout 300 'swaymsg \"output * dpms off\"' resume 'swaymsg \"output * dpms on\"'" - "before-sleep 'swaylock -fF'" - "lock 'swaylock -fF'" - ]); - in '' + nmt.script = '' serviceFile=home-files/.config/systemd/user/swayidle.service - assertFileExists $serviceFile - assertFileRegex $serviceFile 'ExecStart=.*/bin/swayidle ${expectedArgs}' - assertFileRegex $serviceFile 'Restart=always' - assertFileRegex $serviceFile 'Environment=.*PATH=${ - lib.makeBinPath [ pkgs.bash ] - }' + assertFileExists "$serviceFile" + + serviceFileNormalized="$(normalizeStorePaths "$serviceFile")" + + assertFileContent "$serviceFileNormalized" ${ + builtins.toFile "expected.service" '' + [Install] + WantedBy=graphical-session.target + + [Service] + Environment=PATH=/nix/store/00000000000000000000000000000000-bash/bin + ExecStart=@swayidle@/bin/dummy -w timeout 50 'notify-send -t 10000 -- "Screen lock in 10 seconds"' timeout 60 'swaylock -fF' timeout 300 'swaymsg "output * dpms off"' resume 'swaymsg "output * dpms on"' before-sleep 'swaylock -fF' lock 'swaylock -fF' + Restart=always + Type=simple + + [Unit] + ConditionEnvironment=WAYLAND_DISPLAY + Description=Idle manager for Wayland + Documentation=man:swayidle(1) + PartOf=graphical-session.target + '' + } ''; } From dfe4d334b172071e7189d971ddecd3a7f811b48d Mon Sep 17 00:00:00 2001 From: bhougland18 Date: Thu, 19 Sep 2024 13:05:06 -0400 Subject: [PATCH 474/636] wezterm: fix generated configuration The semi-colon breaks this config file, it is not in the Weztem documentation either. --- modules/programs/wezterm.nix | 2 +- tests/modules/programs/wezterm/empty-setting.nix | 2 +- tests/modules/programs/wezterm/example-setting.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/programs/wezterm.nix b/modules/programs/wezterm.nix index b02099a6c63c..bd3be4686ebc 100644 --- a/modules/programs/wezterm.nix +++ b/modules/programs/wezterm.nix @@ -100,7 +100,7 @@ in { -- Generated by Home Manager. -- See https://wezfurlong.org/wezterm/ - local wezterm = require 'wezterm'; + local wezterm = require 'wezterm' ${cfg.extraConfig} ''; diff --git a/tests/modules/programs/wezterm/empty-setting.nix b/tests/modules/programs/wezterm/empty-setting.nix index 8e72b3b0ef43..2f2ffa084daf 100644 --- a/tests/modules/programs/wezterm/empty-setting.nix +++ b/tests/modules/programs/wezterm/empty-setting.nix @@ -10,7 +10,7 @@ -- Generated by Home Manager. -- See https://wezfurlong.org/wezterm/ - local wezterm = require 'wezterm'; + local wezterm = require 'wezterm' return {} diff --git a/tests/modules/programs/wezterm/example-setting.nix b/tests/modules/programs/wezterm/example-setting.nix index 60b81fa2063f..2ed566a7ebc9 100644 --- a/tests/modules/programs/wezterm/example-setting.nix +++ b/tests/modules/programs/wezterm/example-setting.nix @@ -53,7 +53,7 @@ -- Generated by Home Manager. -- See https://wezfurlong.org/wezterm/ - local wezterm = require 'wezterm'; + local wezterm = require 'wezterm' return { font = wezterm.font("JetBrains Mono"), From 51e1d69f7a99446e5ef109ec5ed66b982e0434ca Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Fri, 20 Sep 2024 23:29:26 +0100 Subject: [PATCH 475/636] poweralertd: fix regression This fixes a regression introduced in 8d7e352a4b25ac2d88a881ffa3472680af916ddc. That commit made the false assumption that utils would have propagated from Nixpkgs to Home Manager. This commit copies in `escapeSystemdExecArgs` to fix the immediate issue, perhaps we can pull this in some other way later down the line. --- modules/services/poweralertd.nix | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/modules/services/poweralertd.nix b/modules/services/poweralertd.nix index 7010b079710e..9c59ad3f04ea 100644 --- a/modules/services/poweralertd.nix +++ b/modules/services/poweralertd.nix @@ -2,8 +2,22 @@ with lib; -let cfg = config.services.poweralertd; - +let + inherit (lib.strings) toJSON; + cfg = config.services.poweralertd; + escapeSystemdExecArg = arg: + let + s = if isPath arg then + "${arg}" + else if isString arg then + arg + else if isInt arg || isFloat arg || isDerivation arg then + toString arg + else + throw + "escapeSystemdExecArg only allows strings, paths, numbers and derivations"; + in replaceStrings [ "%" "$" ] [ "%%" "$$" ] (toJSON s); + escapeSystemdExecArgs = concatMapStringsSep " " escapeSystemdExecArg; in { meta.maintainers = [ maintainers.thibautmarty ]; @@ -39,7 +53,7 @@ in { Service = { Type = "simple"; ExecStart = "${pkgs.poweralertd}/bin/poweralertd ${ - utils.escapeSystemdExecArgs cfg.extraArgs + escapeSystemdExecArgs cfg.extraArgs }"; Restart = "always"; }; From 14929f7089268481d86b83ed31ffd88713dcd415 Mon Sep 17 00:00:00 2001 From: Patrick Nuckolls Date: Wed, 11 Sep 2024 16:23:08 -0700 Subject: [PATCH 476/636] zoxide: clarify `options` option The value of the option `programs.zoxide.options` is passed to `zoxide init` at shell initialization time, not to the command itself when it's called by the user from their shell. This change makes that a little bit clearer in the documentation. --- modules/programs/zoxide.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/zoxide.nix b/modules/programs/zoxide.nix index 317f7f0570a6..cab75cecfff2 100644 --- a/modules/programs/zoxide.nix +++ b/modules/programs/zoxide.nix @@ -28,7 +28,7 @@ in { default = [ ]; example = [ "--no-cmd" ]; description = '' - List of options to pass to zoxide. + List of options to pass to zoxide init. ''; }; From 04213d1ce4221f5d9b40bcee30706ce9a91d148d Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 22 Sep 2024 08:17:35 +0200 Subject: [PATCH 477/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/99dc8785f6a0adac95f5e2ab05cc2e1bf666d172?narHash=sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c%3D' (2024-09-16) → 'github:NixOS/nixpkgs/c04d5652cfa9742b1d519688f65d1bbccea9eb7e?narHash=sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK%2BWk%3D' (2024-09-19) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 203568a47972..e812d6f77c7e 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1726463316, - "narHash": "sha256-gI9kkaH0ZjakJOKrdjaI/VbaMEo9qBbSUl93DnU7f4c=", + "lastModified": 1726755586, + "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "99dc8785f6a0adac95f5e2ab05cc2e1bf666d172", + "rev": "c04d5652cfa9742b1d519688f65d1bbccea9eb7e", "type": "github" }, "original": { From 21c021862fa696c8199934e2153214ab57150cb6 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Mon, 23 Sep 2024 19:05:00 +0200 Subject: [PATCH 478/636] ci: disable the tests for macos They have been broken for a long time now and makes the PR flow quite cumbersome. Thus we disable them until somebody is able to get them to work again. --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 05d04163b540..99a2f5a1a51f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,3 +25,5 @@ jobs: - run: nix-shell --show-trace . -A install - run: yes | home-manager -I home-manager=. uninstall - run: nix-shell --show-trace --arg enableBig false --pure tests -A run.all + # Somebody please help us fix the macos tests. + if: matrix.os != 'macos-latest' From 1e22ef1518fb175d762006f9cae7f6312b8caedb Mon Sep 17 00:00:00 2001 From: K900 Date: Wed, 25 Sep 2024 09:39:06 +0300 Subject: [PATCH 479/636] direnv: update for new nushell behavior (#5880) Nushell 0.98 makes it so external commands returning non-zero is considered an exception[0]. Wrap the direnv invocation in a try-catch, so that even if direnv fails, we get the message from direnv, but not the traceback from nushell. [0]: https://www.nushell.sh/blog/2024-09-17-nushell_0_98_0.html#non-zero-exit-codes-are-now-errors-toc --- modules/programs/direnv.nix | 12 +++++++++--- tests/modules/programs/direnv/nushell.nix | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index 4a763670537c..ccfe00e6dc23 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -140,9 +140,15 @@ in { $env.config.hooks.pre_prompt? | default [] | append {|| - let direnv = (${getExe cfg.package} export json - | from json - | default {}) + let direnv = ( + try { + ${getExe cfg.package} export json + } catch { + "" + } + | from json + | default {} + ) if ($direnv | is-empty) { return } diff --git a/tests/modules/programs/direnv/nushell.nix b/tests/modules/programs/direnv/nushell.nix index 6655f01a8c6d..2304b8b6872f 100644 --- a/tests/modules/programs/direnv/nushell.nix +++ b/tests/modules/programs/direnv/nushell.nix @@ -14,6 +14,6 @@ in '' assertFileExists "${configFile}" assertFileRegex "${configFile}" \ - '^\s*let direnv = (/nix/store/.*direnv.*/bin/direnv export json$' + '^\s*/nix/store/.*direnv.*/bin/direnv export json$' ''; } From c124568e1054a62c20fbe036155cc99237633327 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:20:17 +0200 Subject: [PATCH 480/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/c04d5652cfa9742b1d519688f65d1bbccea9eb7e?narHash=sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK%2BWk%3D' (2024-09-19) → 'github:NixOS/nixpkgs/9357f4f23713673f310988025d9dc261c20e70c6?narHash=sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c%3D' (2024-09-21) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index e812d6f77c7e..557a2e855b36 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1726755586, - "narHash": "sha256-PmUr/2GQGvFTIJ6/Tvsins7Q43KTMvMFhvG6oaYK+Wk=", + "lastModified": 1726937504, + "narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c04d5652cfa9742b1d519688f65d1bbccea9eb7e", + "rev": "9357f4f23713673f310988025d9dc261c20e70c6", "type": "github" }, "original": { From 57e6b30d181ae6baff0909a61544ecbe1f642936 Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 26 Sep 2024 20:07:37 +0300 Subject: [PATCH 481/636] direnv: work around nushell bug try/catch in a pipeline does not always work correctly in 0.98, so avoid the try-catch entirely. Upstream issue: https://github.com/nushell/nushell/issues/13868 --- modules/programs/direnv.nix | 12 ++++++------ tests/modules/programs/direnv/nushell.nix | 3 +-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index ccfe00e6dc23..1b409991c7d5 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -141,12 +141,12 @@ in { | default [] | append {|| let direnv = ( - try { - ${getExe cfg.package} export json - } catch { - "" - } - | from json + # We want to get the stdout from direnv even if it exits with non-zero, + # because it will have the DIRENV_ internal variables defined. + do { ${getExe cfg.package} export json } + | complete + | get stdout + | from json --strict | default {} ) if ($direnv | is-empty) { diff --git a/tests/modules/programs/direnv/nushell.nix b/tests/modules/programs/direnv/nushell.nix index 2304b8b6872f..502b325d5ed4 100644 --- a/tests/modules/programs/direnv/nushell.nix +++ b/tests/modules/programs/direnv/nushell.nix @@ -13,7 +13,6 @@ "home-files/.config/nushell/config.nu"; in '' assertFileExists "${configFile}" - assertFileRegex "${configFile}" \ - '^\s*/nix/store/.*direnv.*/bin/direnv export json$' + assertFileRegex "${configFile}" '/nix/store/.*direnv.*/bin/direnv export json' ''; } From 853e7bd24f875bac2e3a0cf72f993e917d0f8cf5 Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 26 Sep 2024 23:03:30 +0300 Subject: [PATCH 482/636] direnv: even better nushell fix Avoid do | complete, because it swallows stderr, which can contain direnv debug output. --- modules/programs/direnv.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index 1b409991c7d5..951061f98c3d 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -143,9 +143,9 @@ in { let direnv = ( # We want to get the stdout from direnv even if it exits with non-zero, # because it will have the DIRENV_ internal variables defined. - do { ${getExe cfg.package} export json } - | complete - | get stdout + do --ignore-program-errors { ${ + getExe cfg.package + } export json } | from json --strict | default {} ) From 0afc2f0f19470e45a3941926a330f2db55ac2fbf Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 26 Sep 2024 22:19:30 +0200 Subject: [PATCH 483/636] river: reduce risk of large rebuilds in test Specifically, overriding the dbus package can cause rebuilds of many packages. --- tests/modules/services/window-managers/river/configuration.nix | 1 - tests/modules/services/window-managers/river/init | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/modules/services/window-managers/river/configuration.nix b/tests/modules/services/window-managers/river/configuration.nix index 9a0199215751..9532006fcc9f 100644 --- a/tests/modules/services/window-managers/river/configuration.nix +++ b/tests/modules/services/window-managers/river/configuration.nix @@ -79,7 +79,6 @@ }; test.stubs = { - dbus = { }; river = { }; xwayland = { }; }; diff --git a/tests/modules/services/window-managers/river/init b/tests/modules/services/window-managers/river/init index c266ca9e9ce2..8662dc91072f 100755 --- a/tests/modules/services/window-managers/river/init +++ b/tests/modules/services/window-managers/river/init @@ -62,6 +62,6 @@ extra config ### SYSTEMD INTEGRATION ### -@dbus@/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE && systemctl --user stop river-session.target && systemctl --user start river-session.target +/nix/store/00000000000000000000000000000000-dbus/bin/dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP NIXOS_OZONE_WL XCURSOR_THEME XCURSOR_SIZE && systemctl --user stop river-session.target && systemctl --user start river-session.target From ffe2d07e771580a005e675108212597e5b367d2d Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 26 Sep 2024 23:14:25 +0300 Subject: [PATCH 484/636] direnv: hopefully final nushell fix --- modules/programs/direnv.nix | 94 ++++++++++++++--------- tests/modules/programs/direnv/nushell.nix | 2 +- 2 files changed, 57 insertions(+), 39 deletions(-) diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index 951061f98c3d..4d4862afb886 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -130,46 +130,64 @@ in { ${getExe cfg.package} hook fish | source ''); - programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration ( + programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration (let + # We want to get the stdout from direnv even if it exits with non-zero, + # because it will have the DIRENV_ internal variables defined. + # + # However, nushell's current implementation of try-catch is subtly + # broken with external commands in pipelines[0]. + # + # This means we don't have a good way to ignore the exit code + # without using do | complete, which has a side effect of also + # capturing stderr, which we don't want. + # + # So, as a workaround, we wrap nushell in a second script that + # just ignores the exit code and does nothing else, allowing + # nushell to capture our stdout, but letting stderr go through + # and not causing a spurious "command failed" message. + # + # [0]: https://github.com/nushell/nushell/issues/13868 + # + # FIXME: remove the wrapper once the upstream issue is fixed + + direnvWrapped = pkgs.writeShellScript "direnv-wrapped" '' + ${getExe cfg.package} export json || true + ''; # Using mkAfter to make it more likely to appear after other # manipulations of the prompt. - mkAfter '' - $env.config = ($env.config? | default {}) - $env.config.hooks = ($env.config.hooks? | default {}) - $env.config.hooks.pre_prompt = ( - $env.config.hooks.pre_prompt? - | default [] - | append {|| - let direnv = ( - # We want to get the stdout from direnv even if it exits with non-zero, - # because it will have the DIRENV_ internal variables defined. - do --ignore-program-errors { ${ - getExe cfg.package - } export json } - | from json --strict - | default {} - ) - if ($direnv | is-empty) { - return - } - $direnv - | items {|key, value| - { - key: $key - value: (do ( - $env.ENV_CONVERSIONS? - | default {} - | get -i $key - | get -i from_string - | default {|x| $x} - ) $value) - } - } - | transpose -ird - | load-env - } - ) - ''); + in mkAfter '' + $env.config = ($env.config? | default {}) + $env.config.hooks = ($env.config.hooks? | default {}) + $env.config.hooks.pre_prompt = ( + $env.config.hooks.pre_prompt? + | default [] + | append {|| + let direnv = ( + ${direnvWrapped} + | from json --strict + | default {} + ) + if ($direnv | is-empty) { + return + } + $direnv + | items {|key, value| + { + key: $key + value: (do ( + $env.ENV_CONVERSIONS? + | default {} + | get -i $key + | get -i from_string + | default {|x| $x} + ) $value) + } + } + | transpose -ird + | load-env + } + ) + ''); home.sessionVariables = lib.mkIf cfg.silent { DIRENV_LOG_FORMAT = ""; }; }; diff --git a/tests/modules/programs/direnv/nushell.nix b/tests/modules/programs/direnv/nushell.nix index 502b325d5ed4..86293e1d7760 100644 --- a/tests/modules/programs/direnv/nushell.nix +++ b/tests/modules/programs/direnv/nushell.nix @@ -13,6 +13,6 @@ "home-files/.config/nushell/config.nu"; in '' assertFileExists "${configFile}" - assertFileRegex "${configFile}" '/nix/store/.*direnv.*/bin/direnv export json' + assertFileRegex "${configFile}" '/nix/store/.*direnv-wrapped' ''; } From 437ec62009fa8ceb684eb447d455ffba25911cf9 Mon Sep 17 00:00:00 2001 From: Sirio Balmelli Date: Sat, 28 Sep 2024 17:45:33 +0200 Subject: [PATCH 485/636] borgmatic: note Darwin platform support The current module works on Darwin as-is; mark the platform as supported. Signed-off-by: Sirio Balmelli --- modules/programs/borgmatic.nix | 5 +---- tests/default.nix | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/modules/programs/borgmatic.nix b/modules/programs/borgmatic.nix index ecc6f5cf3893..97a1d54ce3a6 100644 --- a/modules/programs/borgmatic.nix +++ b/modules/programs/borgmatic.nix @@ -272,10 +272,7 @@ in { }; config = mkIf cfg.enable { - assertions = [ - (lib.hm.assertions.assertPlatform "programs.borgmatic" pkgs - lib.platforms.linux) - ] ++ (mapAttrsToList (backup: opts: { + assertions = (mapAttrsToList (backup: opts: { assertion = opts.location.sourceDirectories == null || opts.location.patterns == null; message = '' diff --git a/tests/default.nix b/tests/default.nix index 2008014b78b3..4117ea8ea67b 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -60,6 +60,7 @@ in import nmtSrc { ./modules/programs/bacon ./modules/programs/bash ./modules/programs/bat + ./modules/programs/borgmatic ./modules/programs/bottom ./modules/programs/broot ./modules/programs/browserpass @@ -189,7 +190,6 @@ in import nmtSrc { ./modules/programs/awscli ./modules/programs/beets # One test relies on services.mpd ./modules/programs/bemenu - ./modules/programs/borgmatic ./modules/programs/boxxy ./modules/programs/firefox/firefox.nix ./modules/programs/foot From 30e04f3d477256de3eb6a7cff608e220087537d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Fri, 4 Oct 2024 09:19:02 +0200 Subject: [PATCH 486/636] pass-secret-service: add GNUPGHOME to service env vars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is nescesarry for non-default locations, and without it, many programs like element-desktop break in very confusing ways. Signed-off-by: Christina Sørensen --- modules/services/pass-secret-service.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/services/pass-secret-service.nix b/modules/services/pass-secret-service.nix index db494337e80d..c6ea599188c1 100644 --- a/modules/services/pass-secret-service.nix +++ b/modules/services/pass-secret-service.nix @@ -58,6 +58,7 @@ in { optionalString (cfg.storePath != null) "--path ${cfg.storePath}" }"; BusName = busName; + Environment = [ "GNUPGHOME=${config.programs.gpg.homedir}" ]; }; Install.WantedBy = [ "default.target" ]; From 509dbf8d45606b618e9ec3bbe4e936b7c5bc6c1e Mon Sep 17 00:00:00 2001 From: Christophe Van den Abbeele Date: Fri, 27 Sep 2024 17:55:16 +0200 Subject: [PATCH 487/636] megasync: fix issue with service failing to launch Change `After=` setting in the user service to only launch after the full `graphical-session.target`. --- modules/services/megasync.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/services/megasync.nix b/modules/services/megasync.nix index c519ba51f041..03eab490abc1 100644 --- a/modules/services/megasync.nix +++ b/modules/services/megasync.nix @@ -28,7 +28,7 @@ in { systemd.user.services.megasync = { Unit = { Description = "megasync"; - After = [ "graphical-session-pre.target" ]; + After = [ "graphical-session.target" ]; PartOf = [ "graphical-session.target" ]; }; From bc623830e619cef86a2d3750625ffe4e24ea7e64 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 11:44:28 +0200 Subject: [PATCH 488/636] ci: bump cachix/install-nix-action from 27 to 30 Bumps [cachix/install-nix-action](https://github.com/cachix/install-nix-action) from 27 to 30. - [Release notes](https://github.com/cachix/install-nix-action/releases) - [Commits](https://github.com/cachix/install-nix-action/compare/v27...v30) --- updated-dependencies: - dependency-name: cachix/install-nix-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/github_pages.yml | 2 +- .github/workflows/test.yml | 2 +- .github/workflows/update-flake.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/github_pages.yml b/.github/workflows/github_pages.yml index 9f49d49a8617..4e10f9ccb95f 100644 --- a/.github/workflows/github_pages.yml +++ b/.github/workflows/github_pages.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v27 + - uses: cachix/install-nix-action@v30 with: nix_path: nixpkgs=channel:nixos-unstable - uses: cachix/cachix-action@v15 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 99a2f5a1a51f..ff67b6760387 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v27 + - uses: cachix/install-nix-action@v30 with: nix_path: nixpkgs=channel:nixos-unstable - run: | diff --git a/.github/workflows/update-flake.yml b/.github/workflows/update-flake.yml index ba9b5f818a7b..9b0e4b44354a 100644 --- a/.github/workflows/update-flake.yml +++ b/.github/workflows/update-flake.yml @@ -12,7 +12,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v27 + uses: cachix/install-nix-action@v30 - name: Update flake.lock uses: DeterminateSystems/update-flake-lock@v24 with: From fcf5e608ac65f64463bc0ccc5ea86f2170f20689 Mon Sep 17 00:00:00 2001 From: MithicSpirit Date: Mon, 7 Oct 2024 06:18:19 -0400 Subject: [PATCH 489/636] kitty: allow float values in settings (#5925) Some settings in kitty allow floating-point values, but this was not reflected in the type. --- modules/programs/kitty.nix | 4 ++-- tests/modules/programs/kitty/example-settings-expected.conf | 1 + tests/modules/programs/kitty/example-settings.nix | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/programs/kitty.nix b/modules/programs/kitty.nix index e9594ec120bd..9854fe69c2c3 100644 --- a/modules/programs/kitty.nix +++ b/modules/programs/kitty.nix @@ -5,7 +5,7 @@ with lib; let cfg = config.programs.kitty; - eitherStrBoolInt = with types; either str (either bool int); + settingsValueType = with types; oneOf [ str bool int float ]; optionalPackage = opt: optional (opt != null && opt.package != null) opt.package; @@ -102,7 +102,7 @@ in { }; settings = mkOption { - type = types.attrsOf eitherStrBoolInt; + type = types.attrsOf settingsValueType; default = { }; example = literalExpression '' { diff --git a/tests/modules/programs/kitty/example-settings-expected.conf b/tests/modules/programs/kitty/example-settings-expected.conf index aca1b0c18978..41a9cb7728b4 100644 --- a/tests/modules/programs/kitty/example-settings-expected.conf +++ b/tests/modules/programs/kitty/example-settings-expected.conf @@ -7,6 +7,7 @@ font_size 8 # Shell integration is sourced and configured manually shell_integration no-rc +background_opacity 0.500000 enable_audio_bell no scrollback_lines 10000 update_check_interval 0 diff --git a/tests/modules/programs/kitty/example-settings.nix b/tests/modules/programs/kitty/example-settings.nix index 8d609a5abb64..8f2e0b8942af 100644 --- a/tests/modules/programs/kitty/example-settings.nix +++ b/tests/modules/programs/kitty/example-settings.nix @@ -17,6 +17,7 @@ with lib; scrollback_lines = 10000; enable_audio_bell = false; update_check_interval = 0; + background_opacity = 0.5; }; font.name = "DejaVu Sans"; From 3ac39b2a8b7cbfc0f96628d8a84867c885bc988b Mon Sep 17 00:00:00 2001 From: Akshett Rai Jindal Date: Mon, 7 Oct 2024 18:46:25 +0530 Subject: [PATCH 490/636] zathura: Fix the type for config options (#5934) * zathura: add float to acceptable types for `options` attrset The man page states that the `set` directive can take 4 types of values: INT, FLOAT, STRING, BOOL. But the FLOAT part was missing from the home-manager module * zathura: make type of `programs.zathura.options` more readable Change from cascading mess of `either` to `oneOf` --- modules/programs/zathura.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/zathura.nix b/modules/programs/zathura.nix index ba34af59075d..3e41256d3910 100644 --- a/modules/programs/zathura.nix +++ b/modules/programs/zathura.nix @@ -31,7 +31,7 @@ in { options = mkOption { default = { }; - type = with types; attrsOf (either str (either bool int)); + type = with types; attrsOf (oneOf [ str bool int float ]); description = '' Add {option}`:set` command options to zathura and make them permanent. See From 271c83e21ea81f39a42ad128384e0e6804956a88 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Mon, 7 Oct 2024 17:06:52 -0400 Subject: [PATCH 491/636] firefox: organize tests by submodule (#5698) Split off from #5697, organizes firefox tests by submodule. This is intended to match directory structure setup for the new search submodule. --- tests/modules/programs/firefox/firefox.nix | 15 +- .../programs/firefox/profile-settings.nix | 215 ------------------ .../firefox/profiles/bookmarks/default.nix | 84 +++++++ .../bookmarks/expected-bookmarks-user.js} | 0 .../bookmarks/expected-bookmarks.html} | 0 .../firefox/profiles/containers/default.nix | 32 +++ .../containers/duplicate-ids.nix} | 2 +- .../containers/expected-containers.json} | 2 +- .../containers/id-out-of-range.nix} | 2 +- .../duplicate-ids.nix} | 2 +- .../firefox/profiles/search/default.nix | 112 +++++++++ .../expected-search-without-default.json} | 0 .../search/expected-search.json} | 0 .../firefox/profiles/settings/default.nix | 43 ++++ .../settings/expected-user.js} | 0 15 files changed, 285 insertions(+), 224 deletions(-) delete mode 100644 tests/modules/programs/firefox/profile-settings.nix create mode 100644 tests/modules/programs/firefox/profiles/bookmarks/default.nix rename tests/modules/programs/firefox/{profile-settings-expected-bookmarks-user.js => profiles/bookmarks/expected-bookmarks-user.js} (100%) rename tests/modules/programs/firefox/{profile-settings-expected-bookmarks.html => profiles/bookmarks/expected-bookmarks.html} (100%) create mode 100644 tests/modules/programs/firefox/profiles/containers/default.nix rename tests/modules/programs/firefox/{duplicate-container-ids.nix => profiles/containers/duplicate-ids.nix} (90%) rename tests/modules/programs/firefox/{profile-settings-expected-containers.json => profiles/containers/expected-containers.json} (66%) rename tests/modules/programs/firefox/{container-id-out-of-range.nix => profiles/containers/id-out-of-range.nix} (86%) rename tests/modules/programs/firefox/{duplicate-profile-ids.nix => profiles/duplicate-ids.nix} (87%) create mode 100644 tests/modules/programs/firefox/profiles/search/default.nix rename tests/modules/programs/firefox/{profile-settings-expected-search-without-default.json => profiles/search/expected-search-without-default.json} (100%) rename tests/modules/programs/firefox/{profile-settings-expected-search.json => profiles/search/expected-search.json} (100%) create mode 100644 tests/modules/programs/firefox/profiles/settings/default.nix rename tests/modules/programs/firefox/{profile-settings-expected-user.js => profiles/settings/expected-user.js} (100%) diff --git a/tests/modules/programs/firefox/firefox.nix b/tests/modules/programs/firefox/firefox.nix index 6598d6ec2d14..6d92a5f49014 100644 --- a/tests/modules/programs/firefox/firefox.nix +++ b/tests/modules/programs/firefox/firefox.nix @@ -1,11 +1,16 @@ let name = "firefox"; in builtins.mapAttrs (test: module: import module [ "programs" name ]) { - "${name}-profile-settings" = ./profile-settings.nix; - "${name}-state-version-19_09" = ./state-version-19_09.nix; "${name}-deprecated-native-messenger" = ./deprecated-native-messenger.nix; - "${name}-duplicate-profile-ids" = ./duplicate-profile-ids.nix; - "${name}-duplicate-container-ids" = ./duplicate-container-ids.nix; - "${name}-container-id-out-of-range" = ./container-id-out-of-range.nix; "${name}-policies" = ./policies.nix; + "${name}-profiles-bookmarks" = ./profiles/bookmarks; + "${name}-profiles-containers" = ./profiles/containers; + "${name}-profiles-containers-duplicate-ids" = + ./profiles/containers/duplicate-ids.nix; + "${name}-profiles-containers-id-out-of-range" = + ./profiles/containers/id-out-of-range.nix; + "${name}-profiles-duplicate-ids" = ./profiles/duplicate-ids.nix; + "${name}-profiles-search" = ./profiles/search; + "${name}-profiles-settings" = ./profiles/settings; + "${name}-state-version-19_09" = ./state-version-19_09.nix; } diff --git a/tests/modules/programs/firefox/profile-settings.nix b/tests/modules/programs/firefox/profile-settings.nix deleted file mode 100644 index d7776eb4fc51..000000000000 --- a/tests/modules/programs/firefox/profile-settings.nix +++ /dev/null @@ -1,215 +0,0 @@ -modulePath: -{ config, lib, pkgs, ... }: - -with lib; - -let - - cfg = getAttrFromPath modulePath config; - - firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; - -in { - imports = [ firefoxMockOverlay ]; - - config = mkIf config.test.enableBig (setAttrByPath modulePath { - enable = true; - profiles.basic.isDefault = true; - - profiles.test = { - id = 1; - settings = { - "general.smoothScroll" = false; - "browser.newtabpage.pinned" = [{ - title = "NixOS"; - url = "https://nixos.org"; - }]; - }; - }; - - profiles.bookmarks = { - id = 2; - settings = { "general.smoothScroll" = false; }; - bookmarks = [ - { - toolbar = true; - bookmarks = [{ - name = "Home Manager"; - url = "https://wiki.nixos.org/wiki/Home_Manager"; - }]; - } - { - name = "wikipedia"; - tags = [ "wiki" ]; - keyword = "wiki"; - url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; - } - { - name = "kernel.org"; - url = "https://www.kernel.org"; - } - { - name = "Nix sites"; - bookmarks = [ - { - name = "homepage"; - url = "https://nixos.org/"; - } - { - name = "wiki"; - tags = [ "wiki" "nix" ]; - url = "https://wiki.nixos.org/"; - } - { - name = "Nix sites"; - bookmarks = [ - { - name = "homepage"; - url = "https://nixos.org/"; - } - { - name = "wiki"; - url = "https://wiki.nixos.org/"; - } - ]; - } - ]; - } - ]; - }; - - profiles.search = { - id = 3; - search = { - force = true; - default = "Google"; - privateDefault = "DuckDuckGo"; - order = [ "Nix Packages" "NixOS Wiki" ]; - engines = { - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { - name = "type"; - value = "packages"; - } - { - name = "query"; - value = "{searchTerms}"; - } - ]; - }]; - - icon = - "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - - definedAliases = [ "@np" ]; - }; - - "NixOS Wiki" = { - urls = [{ - template = - "https://wiki.nixos.org/index.php?search={searchTerms}"; - }]; - iconUpdateURL = "https://wiki.nixos.org/favicon.png"; - updateInterval = 24 * 60 * 60 * 1000; - definedAliases = [ "@nw" ]; - }; - - "Bing".metaData.hidden = true; - "Google".metaData.alias = "@g"; - }; - }; - }; - - profiles.searchWithoutDefault = { - id = 4; - search = { - force = true; - order = [ "Google" "Nix Packages" ]; - engines = { - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { - name = "type"; - value = "packages"; - } - { - name = "query"; - value = "{searchTerms}"; - } - ]; - }]; - - definedAliases = [ "@np" ]; - }; - }; - }; - }; - - profiles.containers = { - id = 5; - containers = { - "shopping" = { - id = 6; - icon = "circle"; - color = "yellow"; - }; - }; - }; - } // { - - nmt.script = '' - assertFileRegex \ - home-path/bin/${cfg.wrappedPackageName} \ - MOZ_APP_LAUNCHER - - assertDirectoryExists home-files/${cfg.configPath}/basic - - assertFileContent \ - home-files/${cfg.configPath}/test/user.js \ - ${./profile-settings-expected-user.js} - - assertFileContent \ - home-files/${cfg.configPath}/containers/containers.json \ - ${./profile-settings-expected-containers.json} - - bookmarksUserJs=$(normalizeStorePaths \ - home-files/${cfg.configPath}/bookmarks/user.js) - - assertFileContent \ - $bookmarksUserJs \ - ${./profile-settings-expected-bookmarks-user.js} - - bookmarksFile="$(sed -n \ - '/browser.bookmarks.file/ {s|^.*\(/nix/store[^"]*\).*|\1|;p}' \ - $TESTED/home-files/${cfg.configPath}/bookmarks/user.js)" - - assertFileContent \ - $bookmarksFile \ - ${./profile-settings-expected-bookmarks.html} - - function assertFirefoxSearchContent() { - compressedSearch=$(normalizeStorePaths "$1") - - decompressedSearch=$(dirname $compressedSearch)/search.json - ${pkgs.mozlz4a}/bin/mozlz4a -d "$compressedSearch" >(${pkgs.jq}/bin/jq . > "$decompressedSearch") - - assertFileContent \ - $decompressedSearch \ - "$2" - } - - assertFirefoxSearchContent \ - home-files/${cfg.configPath}/search/search.json.mozlz4 \ - ${./profile-settings-expected-search.json} - - assertFirefoxSearchContent \ - home-files/${cfg.configPath}/searchWithoutDefault/search.json.mozlz4 \ - ${./profile-settings-expected-search-without-default.json} - ''; - }); -} diff --git a/tests/modules/programs/firefox/profiles/bookmarks/default.nix b/tests/modules/programs/firefox/profiles/bookmarks/default.nix new file mode 100644 index 000000000000..7bf508ab02f7 --- /dev/null +++ b/tests/modules/programs/firefox/profiles/bookmarks/default.nix @@ -0,0 +1,84 @@ +modulePath: +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = getAttrFromPath modulePath config; + + firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath; + +in { + imports = [ firefoxMockOverlay ]; + + config = mkIf config.test.enableBig (setAttrByPath modulePath { + enable = true; + profiles.bookmarks = { + settings = { "general.smoothScroll" = false; }; + bookmarks = [ + { + toolbar = true; + bookmarks = [{ + name = "Home Manager"; + url = "https://wiki.nixos.org/wiki/Home_Manager"; + }]; + } + { + name = "wikipedia"; + tags = [ "wiki" ]; + keyword = "wiki"; + url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; + } + { + name = "kernel.org"; + url = "https://www.kernel.org"; + } + { + name = "Nix sites"; + bookmarks = [ + { + name = "homepage"; + url = "https://nixos.org/"; + } + { + name = "wiki"; + tags = [ "wiki" "nix" ]; + url = "https://wiki.nixos.org/"; + } + { + name = "Nix sites"; + bookmarks = [ + { + name = "homepage"; + url = "https://nixos.org/"; + } + { + name = "wiki"; + url = "https://wiki.nixos.org/"; + } + ]; + } + ]; + } + ]; + }; + } // { + nmt.script = '' + bookmarksUserJs=$(normalizeStorePaths \ + home-files/${cfg.configPath}/bookmarks/user.js) + + assertFileContent \ + $bookmarksUserJs \ + ${./expected-bookmarks-user.js} + + bookmarksFile="$(sed -n \ + '/browser.bookmarks.file/ {s|^.*\(/nix/store[^"]*\).*|\1|;p}' \ + $TESTED/home-files/${cfg.configPath}/bookmarks/user.js)" + + assertFileContent \ + $bookmarksFile \ + ${./expected-bookmarks.html} + ''; + }); +} diff --git a/tests/modules/programs/firefox/profile-settings-expected-bookmarks-user.js b/tests/modules/programs/firefox/profiles/bookmarks/expected-bookmarks-user.js similarity index 100% rename from tests/modules/programs/firefox/profile-settings-expected-bookmarks-user.js rename to tests/modules/programs/firefox/profiles/bookmarks/expected-bookmarks-user.js diff --git a/tests/modules/programs/firefox/profile-settings-expected-bookmarks.html b/tests/modules/programs/firefox/profiles/bookmarks/expected-bookmarks.html similarity index 100% rename from tests/modules/programs/firefox/profile-settings-expected-bookmarks.html rename to tests/modules/programs/firefox/profiles/bookmarks/expected-bookmarks.html diff --git a/tests/modules/programs/firefox/profiles/containers/default.nix b/tests/modules/programs/firefox/profiles/containers/default.nix new file mode 100644 index 000000000000..6a0d9e93f302 --- /dev/null +++ b/tests/modules/programs/firefox/profiles/containers/default.nix @@ -0,0 +1,32 @@ +modulePath: +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = getAttrFromPath modulePath config; + + firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath; + +in { + imports = [ firefoxMockOverlay ]; + + config = mkIf config.test.enableBig (setAttrByPath modulePath { + enable = true; + profiles.containers = { + containers = { + "shopping" = { + icon = "circle"; + color = "yellow"; + }; + }; + }; + } // { + nmt.script = '' + assertFileContent \ + home-files/${cfg.configPath}/containers/containers.json \ + ${./expected-containers.json} + ''; + }); +} diff --git a/tests/modules/programs/firefox/duplicate-container-ids.nix b/tests/modules/programs/firefox/profiles/containers/duplicate-ids.nix similarity index 90% rename from tests/modules/programs/firefox/duplicate-container-ids.nix rename to tests/modules/programs/firefox/profiles/containers/duplicate-ids.nix index 2ad99b4b7cdd..a60522165023 100644 --- a/tests/modules/programs/firefox/duplicate-container-ids.nix +++ b/tests/modules/programs/firefox/profiles/containers/duplicate-ids.nix @@ -7,7 +7,7 @@ let cfg = getAttrFromPath modulePath config; - firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; + firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath; in { imports = [ firefoxMockOverlay ]; diff --git a/tests/modules/programs/firefox/profile-settings-expected-containers.json b/tests/modules/programs/firefox/profiles/containers/expected-containers.json similarity index 66% rename from tests/modules/programs/firefox/profile-settings-expected-containers.json rename to tests/modules/programs/firefox/profiles/containers/expected-containers.json index 8eea55558ab1..d957b0c50947 100644 --- a/tests/modules/programs/firefox/profile-settings-expected-containers.json +++ b/tests/modules/programs/firefox/profiles/containers/expected-containers.json @@ -1 +1 @@ -{"identities":[{"color":"yellow","icon":"circle","name":"shopping","public":true,"userContextId":6},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.thumbnail","public":false,"userContextId":4294967294},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.webextStorageLocal","public":false,"userContextId":4294967295}],"lastUserContextId":6,"version":4} +{"identities":[{"color":"yellow","icon":"circle","name":"shopping","public":true,"userContextId":0},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.thumbnail","public":false,"userContextId":4294967294},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.webextStorageLocal","public":false,"userContextId":4294967295}],"lastUserContextId":0,"version":4} diff --git a/tests/modules/programs/firefox/container-id-out-of-range.nix b/tests/modules/programs/firefox/profiles/containers/id-out-of-range.nix similarity index 86% rename from tests/modules/programs/firefox/container-id-out-of-range.nix rename to tests/modules/programs/firefox/profiles/containers/id-out-of-range.nix index 2ea08e880822..f396667234c0 100644 --- a/tests/modules/programs/firefox/container-id-out-of-range.nix +++ b/tests/modules/programs/firefox/profiles/containers/id-out-of-range.nix @@ -5,7 +5,7 @@ with lib; let - firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; + firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath; in { imports = [ firefoxMockOverlay ]; diff --git a/tests/modules/programs/firefox/duplicate-profile-ids.nix b/tests/modules/programs/firefox/profiles/duplicate-ids.nix similarity index 87% rename from tests/modules/programs/firefox/duplicate-profile-ids.nix rename to tests/modules/programs/firefox/profiles/duplicate-ids.nix index ad946af1010a..dc5557b4735c 100644 --- a/tests/modules/programs/firefox/duplicate-profile-ids.nix +++ b/tests/modules/programs/firefox/profiles/duplicate-ids.nix @@ -7,7 +7,7 @@ let cfg = getAttrFromPath modulePath config; - firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; + firefoxMockOverlay = import ../setup-firefox-mock-overlay.nix modulePath; in { imports = [ firefoxMockOverlay ]; diff --git a/tests/modules/programs/firefox/profiles/search/default.nix b/tests/modules/programs/firefox/profiles/search/default.nix new file mode 100644 index 000000000000..8a4c98e9b4e3 --- /dev/null +++ b/tests/modules/programs/firefox/profiles/search/default.nix @@ -0,0 +1,112 @@ +modulePath: +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = getAttrFromPath modulePath config; + + firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath; + +in { + imports = [ firefoxMockOverlay ]; + + config = mkIf config.test.enableBig (setAttrByPath modulePath { + enable = true; + profiles = { + search = { + id = 0; + search = { + force = true; + default = "Google"; + privateDefault = "DuckDuckGo"; + order = [ "Nix Packages" "NixOS Wiki" ]; + engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + }]; + + icon = + "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + + definedAliases = [ "@np" ]; + }; + + "NixOS Wiki" = { + urls = [{ + template = + "https://wiki.nixos.org/index.php?search={searchTerms}"; + }]; + iconUpdateURL = "https://wiki.nixos.org/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = [ "@nw" ]; + }; + + "Bing".metaData.hidden = true; + "Google".metaData.alias = "@g"; + }; + }; + }; + + searchWithoutDefault = { + id = 1; + search = { + force = true; + order = [ "Google" "Nix Packages" ]; + engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + }]; + + definedAliases = [ "@np" ]; + }; + }; + }; + }; + }; + } // { + nmt.script = '' + function assertFirefoxSearchContent() { + compressedSearch=$(normalizeStorePaths "$1") + + decompressedSearch=$(dirname $compressedSearch)/search.json + ${pkgs.mozlz4a}/bin/mozlz4a -d "$compressedSearch" >(${pkgs.jq}/bin/jq . > "$decompressedSearch") + + assertFileContent \ + $decompressedSearch \ + "$2" + } + + assertFirefoxSearchContent \ + home-files/${cfg.configPath}/search/search.json.mozlz4 \ + ${./expected-search.json} + + assertFirefoxSearchContent \ + home-files/${cfg.configPath}/searchWithoutDefault/search.json.mozlz4 \ + ${./expected-search-without-default.json} + ''; + }); +} diff --git a/tests/modules/programs/firefox/profile-settings-expected-search-without-default.json b/tests/modules/programs/firefox/profiles/search/expected-search-without-default.json similarity index 100% rename from tests/modules/programs/firefox/profile-settings-expected-search-without-default.json rename to tests/modules/programs/firefox/profiles/search/expected-search-without-default.json diff --git a/tests/modules/programs/firefox/profile-settings-expected-search.json b/tests/modules/programs/firefox/profiles/search/expected-search.json similarity index 100% rename from tests/modules/programs/firefox/profile-settings-expected-search.json rename to tests/modules/programs/firefox/profiles/search/expected-search.json diff --git a/tests/modules/programs/firefox/profiles/settings/default.nix b/tests/modules/programs/firefox/profiles/settings/default.nix new file mode 100644 index 000000000000..39d329ece90b --- /dev/null +++ b/tests/modules/programs/firefox/profiles/settings/default.nix @@ -0,0 +1,43 @@ +modulePath: +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = getAttrFromPath modulePath config; + + firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath; + +in { + imports = [ firefoxMockOverlay ]; + + config = mkIf config.test.enableBig (setAttrByPath modulePath { + enable = true; + profiles = { + basic.isDefault = true; + test = { + id = 1; + settings = { + "general.smoothScroll" = false; + "browser.newtabpage.pinned" = [{ + title = "NixOS"; + url = "https://nixos.org"; + }]; + }; + }; + }; + } // { + nmt.script = '' + assertFileRegex \ + home-path/bin/${cfg.wrappedPackageName} \ + MOZ_APP_LAUNCHER + + assertDirectoryExists home-files/${cfg.configPath}/basic + + assertFileContent \ + home-files/${cfg.configPath}/test/user.js \ + ${./expected-user.js} + ''; + }); +} diff --git a/tests/modules/programs/firefox/profile-settings-expected-user.js b/tests/modules/programs/firefox/profiles/settings/expected-user.js similarity index 100% rename from tests/modules/programs/firefox/profile-settings-expected-user.js rename to tests/modules/programs/firefox/profiles/settings/expected-user.js From 038630363e7de57c36c417fd2f5d7c14773403e4 Mon Sep 17 00:00:00 2001 From: Timothy Gallion Date: Mon, 7 Oct 2024 17:39:24 -0400 Subject: [PATCH 492/636] xdg-mime type package options (#5920) * xdg-mime: allow overrides to shared-mime-info and desktop-file-utils The `xdg-mime` module now exposes packages to determine what will be run for update-mime-database and update-desktop-database. This allows users to select a different version of these packages if the are incompatible. This should, in combination with an override to the version of `shared-mime-info` (can be found here notalltim/home-manager-config#4), resolve #4955, #5102, #4682, and possibly #4941. The problem seems to stem from a mismatch in the version of `shared-mime-info` with the host. I also switched from using `buildPackages` to `pkgs` to improve cross-compilation compatibility. * xdg-mime: Add tests for xdg-mime module The xdg-mime module was missing tests so I added basic test for all the options and checked the basic behavior. It covers ensuring that the proper files/folders are created and that the package overrides work. --- modules/misc/xdg-mime.nix | 55 ++++++++++++++-------- tests/modules/misc/xdg/default.nix | 3 ++ tests/modules/misc/xdg/mime-disabled.nix | 10 ++++ tests/modules/misc/xdg/mime-expected.cache | 3 ++ tests/modules/misc/xdg/mime-packages.nix | 38 +++++++++++++++ tests/modules/misc/xdg/mime.nix | 24 ++++++++++ 6 files changed, 114 insertions(+), 19 deletions(-) create mode 100644 tests/modules/misc/xdg/mime-disabled.nix create mode 100644 tests/modules/misc/xdg/mime-expected.cache create mode 100644 tests/modules/misc/xdg/mime-packages.nix create mode 100644 tests/modules/misc/xdg/mime.nix diff --git a/modules/misc/xdg-mime.nix b/modules/misc/xdg-mime.nix index 09f62aaff9aa..78b569fa5334 100644 --- a/modules/misc/xdg-mime.nix +++ b/modules/misc/xdg-mime.nix @@ -5,33 +5,50 @@ with lib; let cfg = config.xdg.mime; + inherit (lib) getExe getExe'; in { options = { - xdg.mime.enable = mkOption { - type = types.bool; - default = pkgs.stdenv.hostPlatform.isLinux; - defaultText = - literalExpression "true if host platform is Linux, false otherwise"; - description = '' - Whether to install programs and files to support the - XDG Shared MIME-info specification and XDG MIME Applications - specification at - - and - , - respectively. - ''; + xdg.mime = { + enable = mkOption { + type = types.bool; + default = pkgs.stdenv.hostPlatform.isLinux; + defaultText = + literalExpression "true if host platform is Linux, false otherwise"; + description = '' + Whether to install programs and files to support the + XDG Shared MIME-info specification and XDG MIME Applications + specification at + + and + , + respectively. + ''; + }; + + sharedMimeInfoPackage = mkOption { + type = types.package; + default = pkgs.shared-mime-info; + defaultText = literalExpression "pkgs.shared-mime-info"; + description = "The package to use when running update-mime-database."; + }; + + desktopFileUtilsPackage = mkOption { + type = types.package; + default = pkgs.desktop-file-utils; + defaultText = literalExpression "pkgs.desktop-file-utils"; + description = + "The package to use when running update-desktop-database."; + }; }; }; - - config = mkIf config.xdg.mime.enable { + config = mkIf cfg.enable { assertions = [ (hm.assertions.assertPlatform "xdg.mime" pkgs platforms.linux) ]; home.packages = [ # Explicitly install package to provide basic mime types. - pkgs.shared-mime-info + cfg.sharedMimeInfoPackage # Make sure the target directories will be real directories. (pkgs.runCommandLocal "dummy-xdg-mime-dirs1" { } '' @@ -46,12 +63,12 @@ in { if [[ -w $out/share/mime && -w $out/share/mime/packages && -d $out/share/mime/packages ]]; then XDG_DATA_DIRS=$out/share \ PKGSYSTEM_ENABLE_FSYNC=0 \ - ${pkgs.buildPackages.shared-mime-info}/bin/update-mime-database \ + ${getExe cfg.sharedMimeInfoPackage} \ -V $out/share/mime > /dev/null fi if [[ -w $out/share/applications ]]; then - ${pkgs.buildPackages.desktop-file-utils}/bin/update-desktop-database \ + ${getExe' cfg.desktopFileUtilsPackage "update-desktop-database"} \ $out/share/applications fi ''; diff --git a/tests/modules/misc/xdg/default.nix b/tests/modules/misc/xdg/default.nix index bc2f9a9dfacc..87f74e22f0da 100644 --- a/tests/modules/misc/xdg/default.nix +++ b/tests/modules/misc/xdg/default.nix @@ -6,4 +6,7 @@ xdg-default-locations = ./default-locations.nix; xdg-user-dirs-null = ./user-dirs-null.nix; xdg-portal = ./portal.nix; + xdg-mime = ./mime.nix; + xdg-mime-disabled = ./mime-disabled.nix; + xdg-mime-package = ./mime-packages.nix; } diff --git a/tests/modules/misc/xdg/mime-disabled.nix b/tests/modules/misc/xdg/mime-disabled.nix new file mode 100644 index 000000000000..a3df63091f8b --- /dev/null +++ b/tests/modules/misc/xdg/mime-disabled.nix @@ -0,0 +1,10 @@ +{ ... }: { + config = { + xdg.mime.enable = false; + nmt.script = '' + # assert that neither application is run + assertPathNotExists home-path/share/applications/mimeinfo.cache + assertPathNotExists home-path/share/applications/mime + ''; + }; +} diff --git a/tests/modules/misc/xdg/mime-expected.cache b/tests/modules/misc/xdg/mime-expected.cache new file mode 100644 index 000000000000..6907f8f88960 --- /dev/null +++ b/tests/modules/misc/xdg/mime-expected.cache @@ -0,0 +1,3 @@ +[MIME Cache] +text/html=mime-test.desktop; +text/xml=mime-test.desktop; diff --git a/tests/modules/misc/xdg/mime-packages.nix b/tests/modules/misc/xdg/mime-packages.nix new file mode 100644 index 000000000000..0eaaddcec4f0 --- /dev/null +++ b/tests/modules/misc/xdg/mime-packages.nix @@ -0,0 +1,38 @@ +{ config, ... }: +let inherit (config.lib.test) mkStubPackage; +in { + config = { + xdg.mime.enable = true; + xdg.mime.sharedMimeInfoPackage = mkStubPackage { + name = "update-mime-database"; + buildScript = '' + mkdir -p $out/bin + echo '#!/bin/sh' > $out/bin/update-mime-database + echo 'mkdir -p $out/share/mime && touch $out/share/mime/mime.cache' >> $out/bin/update-mime-database + chmod +x $out/bin/update-mime-database + ''; + }; + xdg.mime.desktopFileUtilsPackage = mkStubPackage { + name = "desktop-file-utils"; + buildScript = '' + mkdir -p $out/bin + echo '#!/bin/sh' > $out/bin/update-desktop-database + echo 'mkdir -p $out/share/applications/ && ln -s ${ + ./mime-expected.cache + } $out/share/applications/mimeinfo.cache' >> $out/bin/update-desktop-database + chmod +x $out/bin/update-desktop-database + ''; + }; + nmt.script = '' + assertFileExists home-path/share/applications/mimeinfo.cache # Check that update-desktop-database created file + # Check that update-desktop-database file matches expected + assertFileContent \ + home-path/share/applications/mimeinfo.cache \ + ${./mime-expected.cache} + + assertDirectoryExists home-path/share/mime # Check that update-mime-database created directory + assertFileExists home-path/share/mime/mime.cache # Check that update-mime-database created file + + ''; + }; +} diff --git a/tests/modules/misc/xdg/mime.nix b/tests/modules/misc/xdg/mime.nix new file mode 100644 index 000000000000..90d21d567a13 --- /dev/null +++ b/tests/modules/misc/xdg/mime.nix @@ -0,0 +1,24 @@ +{ ... }: { + config = { + xdg.mime.enable = true; + xdg.desktopEntries = { + mime-test = { # mime info test + name = "mime-test"; + mimeType = [ "text/html" "text/xml" ]; + }; + + }; + + nmt.script = '' + assertFileExists home-path/share/applications/mimeinfo.cache # Check that update-desktop-database created file + # Check that update-desktop-database file matches expected + assertFileContent \ + home-path/share/applications/mimeinfo.cache \ + ${./mime-expected.cache} + + assertDirectoryExists home-path/share/mime # Check that update-mime-database created directory + assertDirectoryNotEmpty home-path/share/mime # Check that update-mime-database created files + + ''; + }; +} From d3ee25c07848725e924a74a4813de2ad0f5d0878 Mon Sep 17 00:00:00 2001 From: Utkarsh Sharma Date: Wed, 9 Oct 2024 16:31:58 +0200 Subject: [PATCH 493/636] Translate using Weblate (Hindi) Currently translated at 5.5% (1 of 18 strings) Translate using Weblate (Hindi) Currently translated at 13.5% (5 of 37 strings) Co-authored-by: Utkarsh Sharma Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/hi/ Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/hi/ Translation: Home Manager/Home Manager CLI Translation: Home Manager/Home Manager Modules --- home-manager/po/hi.po | 8 ++++---- modules/po/hi.po | 11 +++++++---- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/home-manager/po/hi.po b/home-manager/po/hi.po index 43d87312332e..3921eff11557 100644 --- a/home-manager/po/hi.po +++ b/home-manager/po/hi.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-09-13 03:09+0000\n" -"Last-Translator: Jay Thomas \n" +"PO-Revision-Date: 2024-10-09 14:31+0000\n" +"Last-Translator: Utkarsh Sharma \n" "Language-Team: Hindi \n" "Language: hi\n" @@ -22,11 +22,11 @@ msgstr "" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: ‌%s के लिए कोई आर्ग्यूमेंट नहीं दिया" #: home-manager/home-manager:64 msgid "No configuration file found at %s" -msgstr "" +msgstr "%s में कोई कन्फि़गरेशन फाइल नहीं मिली" #. translators: The first '%s' specifier will be replaced by either #. 'home.nix' or 'flake.nix'. diff --git a/modules/po/hi.po b/modules/po/hi.po index 02a7f8528515..80781aba5640 100644 --- a/modules/po/hi.po +++ b/modules/po/hi.po @@ -8,13 +8,16 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: Automatically generated\n" -"Language-Team: none\n" +"PO-Revision-Date: 2024-10-09 14:31+0000\n" +"Last-Translator: Utkarsh Sharma \n" +"Language-Team: Hindi \n" "Language: hi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 5.8-dev\n" #: modules/files.nix:191 msgid "Creating home file links in %s" @@ -22,7 +25,7 @@ msgstr "" #: modules/files.nix:204 msgid "Cleaning up orphan links from %s" -msgstr "" +msgstr "%s से ऑर्फे़न लिंक्स मिटाई जा रही है" #: modules/files.nix:220 msgid "Creating profile generation %s" From d47d33254fbf4fdbdee9f1f14095f689662e479d Mon Sep 17 00:00:00 2001 From: Sandro Date: Thu, 10 Oct 2024 20:29:24 +0200 Subject: [PATCH 494/636] home-manager-manual: expose options.json --- docs/home-manager-manual.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/home-manager-manual.nix b/docs/home-manager-manual.nix index 23b2d1e65586..f87803962cbf 100644 --- a/docs/home-manager-manual.nix +++ b/docs/home-manager-manual.nix @@ -59,5 +59,7 @@ in stdenv.mkDerivation { echo "doc manual $dest index.html" >> $out/nix-support/hydra-build-products ''; + passthru = { inherit home-manager-options; }; + meta = { maintainers = [ lib.maintainers.considerate ]; }; } From 8bb5d53c5847d9a9b2ad1bda49f9aa9df0de282a Mon Sep 17 00:00:00 2001 From: Andrew Voynov <37143421+Andrew15-5@users.noreply.github.com> Date: Thu, 10 Oct 2024 22:22:52 +0300 Subject: [PATCH 495/636] docs: add XDG_*_HOME mentions to xdg.*Home options --- modules/misc/xdg.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/modules/misc/xdg.nix b/modules/misc/xdg.nix index a47a33f5607a..b916e88fbab3 100644 --- a/modules/misc/xdg.nix +++ b/modules/misc/xdg.nix @@ -30,6 +30,8 @@ in { apply = toString; description = '' Absolute path to directory holding application caches. + + Sets `XDG_CACHE_HOME` for the user if `xdg.enable` is set `true`. ''; }; @@ -48,6 +50,8 @@ in { apply = toString; description = '' Absolute path to directory holding application configurations. + + Sets `XDG_CONFIG_HOME` for the user if `xdg.enable` is set `true`. ''; }; @@ -67,6 +71,8 @@ in { apply = toString; description = '' Absolute path to directory holding application data. + + Sets `XDG_DATA_HOME` for the user if `xdg.enable` is set `true`. ''; }; @@ -86,6 +92,8 @@ in { apply = toString; description = '' Absolute path to directory holding application states. + + Sets `XDG_STATE_HOME` for the user if `xdg.enable` is set `true`. ''; }; }; From 03f8e0b3b3ca4f49d11bf0264dbff465d6ae9aae Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Fri, 11 Oct 2024 00:14:36 +0200 Subject: [PATCH 496/636] snixembed: add module This is used by SafeEyes (another home-manager) module to show a systemtray icon. See https://git.sr.ht/~steef/snixembed. Fixes #5728 --- modules/misc/news.nix | 12 +++++ modules/modules.nix | 1 + modules/services/snixembed.nix | 50 +++++++++++++++++++ tests/default.nix | 1 + .../snixembed/basic-configuration.desktop | 7 +++ .../snixembed/basic-configuration.nix | 16 ++++++ .../snixembed/basic-configuration.service | 14 ++++++ tests/modules/services/snixembed/default.nix | 1 + 8 files changed, 102 insertions(+) create mode 100644 modules/services/snixembed.nix create mode 100644 tests/modules/services/snixembed/basic-configuration.desktop create mode 100644 tests/modules/services/snixembed/basic-configuration.nix create mode 100644 tests/modules/services/snixembed/basic-configuration.service create mode 100644 tests/modules/services/snixembed/default.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index f8786de2f4c5..abd9957cb2a5 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1748,6 +1748,18 @@ in { add `-w` to your assignment of `services.swayidle.extraArgs`. ''; } + + { + time = "2024-10-09T06:16:23+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.snixembed'. + + snixembed proxies StatusNotifierItems as XEmbedded systemtray-spec + icons. This is useful for some tools in some environments, e.g., Safe + Eyes in i3, lxde or mate. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index ed2e177f267f..c69c66b155f9 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -361,6 +361,7 @@ let ./services/screen-locker.nix ./services/sctd.nix ./services/signaturepdf.nix + ./services/snixembed.nix ./services/spotifyd.nix ./services/ssh-agent.nix ./services/stalonetray.nix diff --git a/modules/services/snixembed.nix b/modules/services/snixembed.nix new file mode 100644 index 000000000000..a470836b03af --- /dev/null +++ b/modules/services/snixembed.nix @@ -0,0 +1,50 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let cfg = config.services.snixembed; +in { + meta.maintainers = [ maintainers.DamienCassou ]; + + options = { + services.snixembed = { + enable = mkEnableOption + "snixembed: proxy StatusNotifierItems as XEmbedded systemtray-spec icons"; + + package = mkPackageOption pkgs "snixembed" { }; + + beforeUnits = mkOption { + type = with types; listOf str; + default = [ ]; + example = [ "safeeyes.service" ]; + description = '' + List of other units that should be started after snixembed. + ''; + }; + }; + }; + + config = mkIf cfg.enable { + assertions = [ + (hm.assertions.assertPlatform "services.snixembed" pkgs platforms.linux) + ]; + + systemd.user.services.snixembed = { + Install.WantedBy = [ "graphical-session.target" ]; + + Unit = { + Description = "snixembed"; + PartOf = [ "graphical-session.target" ]; + StartLimitIntervalSec = 100; + StartLimitBurst = 10; + Before = cfg.beforeUnits; + }; + + Service = { + ExecStart = getExe pkgs.snixembed; + Restart = "on-failure"; + RestartSec = 3; + }; + }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 4117ea8ea67b..4cc705b18c94 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -270,6 +270,7 @@ in import nmtSrc { ./modules/services/remmina ./modules/services/screen-locker ./modules/services/signaturepdf + ./modules/services/snixembed ./modules/services/swayidle ./modules/services/swaync ./modules/services/swayosd diff --git a/tests/modules/services/snixembed/basic-configuration.desktop b/tests/modules/services/snixembed/basic-configuration.desktop new file mode 100644 index 000000000000..a606d8f2fb3a --- /dev/null +++ b/tests/modules/services/snixembed/basic-configuration.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Exec=@xdg-utils@/bin/xdg-open http://localhost:9494 +Icon=/snixembed/share/snixembed/public/favicon.ico +Name=Snixembed +Terminal=false +Type=Application +Version=1.4 diff --git a/tests/modules/services/snixembed/basic-configuration.nix b/tests/modules/services/snixembed/basic-configuration.nix new file mode 100644 index 000000000000..fd8ec470140e --- /dev/null +++ b/tests/modules/services/snixembed/basic-configuration.nix @@ -0,0 +1,16 @@ +{ ... }: + +{ + services.snixembed = { + enable = true; + beforeUnits = [ "safeeyes.service" ]; + }; + + test.stubs = { snixembed = { outPath = "/snixembed"; }; }; + + nmt.script = '' + assertFileContent \ + home-files/.config/systemd/user/snixembed.service \ + ${./basic-configuration.service} + ''; +} diff --git a/tests/modules/services/snixembed/basic-configuration.service b/tests/modules/services/snixembed/basic-configuration.service new file mode 100644 index 000000000000..97e87664b6f5 --- /dev/null +++ b/tests/modules/services/snixembed/basic-configuration.service @@ -0,0 +1,14 @@ +[Install] +WantedBy=graphical-session.target + +[Service] +ExecStart=/snixembed/bin/dummy +Restart=on-failure +RestartSec=3 + +[Unit] +Before=safeeyes.service +Description=snixembed +PartOf=graphical-session.target +StartLimitBurst=10 +StartLimitIntervalSec=100 diff --git a/tests/modules/services/snixembed/default.nix b/tests/modules/services/snixembed/default.nix new file mode 100644 index 000000000000..b49917197baa --- /dev/null +++ b/tests/modules/services/snixembed/default.nix @@ -0,0 +1 @@ +{ snixembed-basic-configuration = ./basic-configuration.nix; } From 342a1d682386d3a1d74f9555cb327f2f311dda6e Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Fri, 11 Oct 2024 00:19:04 +0200 Subject: [PATCH 497/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/9357f4f23713673f310988025d9dc261c20e70c6?narHash=sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c%3D' (2024-09-21) → 'github:NixOS/nixpkgs/c31898adf5a8ed202ce5bea9f347b1c6871f32d1?narHash=sha256-yumd4fBc/hi8a9QgA9IT8vlQuLZ2oqhkJXHPKxH/tRw%3D' (2024-10-06) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 557a2e855b36..76920c875ae1 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1726937504, - "narHash": "sha256-bvGoiQBvponpZh8ClUcmJ6QnsNKw0EMrCQJARK3bI1c=", + "lastModified": 1728241625, + "narHash": "sha256-yumd4fBc/hi8a9QgA9IT8vlQuLZ2oqhkJXHPKxH/tRw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9357f4f23713673f310988025d9dc261c20e70c6", + "rev": "c31898adf5a8ed202ce5bea9f347b1c6871f32d1", "type": "github" }, "original": { From 582830954264080aae93f751c3cdc58df600d2d1 Mon Sep 17 00:00:00 2001 From: aabccd021 Date: Fri, 9 Sep 2022 07:42:53 +0700 Subject: [PATCH 498/636] vifm: add module --- modules/lib/maintainers.nix | 6 ++++ modules/misc/news.nix | 10 ++++++ modules/modules.nix | 3 +- modules/programs/vifm.nix | 33 +++++++++++++++++++ tests/default.nix | 1 + tests/modules/programs/vifm/default.nix | 4 +++ .../modules/programs/vifm/empty-settings.nix | 11 +++++++ .../programs/vifm/example-settings.nix | 21 ++++++++++++ 8 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 modules/programs/vifm.nix create mode 100644 tests/modules/programs/vifm/default.nix create mode 100644 tests/modules/programs/vifm/empty-settings.nix create mode 100644 tests/modules/programs/vifm/example-settings.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 70f480d06177..501917ffbfc2 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -7,6 +7,12 @@ # [1] https://github.com/NixOS/nixpkgs/blob/fca0d6e093c82b31103dc0dacc48da2a9b06e24b/maintainers/maintainer-list.nix#LC1 { + aabccd021 = { + name = "Muhamad Abdurahman"; + email = "aabccd021@gmail.com"; + github = "aabccd021"; + githubId = 33031950; + }; abayomi185 = { name = "Yomi"; email = "yomi+nix@yomitosh.com"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index abd9957cb2a5..732c92478b3d 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1760,6 +1760,16 @@ in { Eyes in i3, lxde or mate. ''; } + + { + time = "2024-10-11T08:23:19+00:00"; + message = '' + A new module is available: 'programs.vifm'. + + Vifm is a curses based Vim-like file manager extended with some useful + ideas from mutt. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index c69c66b155f9..72f4adaae676 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -241,8 +241,9 @@ let ./programs/translate-shell.nix ./programs/urxvt.nix ./programs/vdirsyncer.nix - ./programs/vim.nix + ./programs/vifm.nix ./programs/vim-vint.nix + ./programs/vim.nix ./programs/vscode.nix ./programs/vscode/haskell.nix ./programs/pywal.nix diff --git a/modules/programs/vifm.nix b/modules/programs/vifm.nix new file mode 100644 index 000000000000..2bf31d52d32a --- /dev/null +++ b/modules/programs/vifm.nix @@ -0,0 +1,33 @@ +{ config, lib, pkgs, ... }: + +let + + inherit (lib) mkIf mkOption types; + + cfg = config.programs.vifm; + +in { + meta.maintainers = [ lib.hm.maintainers.aabccd021 ]; + + options.programs.vifm = { + enable = lib.mkEnableOption "vifm, a Vim-like file manager"; + + package = lib.mkPackageOption pkgs "vifm" { }; + + extraConfig = mkOption { + type = types.lines; + default = ""; + example = "mark h ~/"; + description = '' + Extra lines added to the {file}`$XDG_CONFIG_HOME/vifm/vifmrc` file. + ''; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + + xdg.configFile."vifm/vifmrc" = + mkIf (cfg.extraConfig != "") { text = cfg.extraConfig; }; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 4cc705b18c94..83ed42a70d35 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -155,6 +155,7 @@ in import nmtSrc { ./modules/programs/tmux ./modules/programs/topgrade ./modules/programs/translate-shell + ./modules/programs/vifm ./modules/programs/vim-vint ./modules/programs/vscode ./modules/programs/watson diff --git a/tests/modules/programs/vifm/default.nix b/tests/modules/programs/vifm/default.nix new file mode 100644 index 000000000000..5a75a54aad7e --- /dev/null +++ b/tests/modules/programs/vifm/default.nix @@ -0,0 +1,4 @@ +{ + vifm-example-settings = ./example-settings.nix; + vifm-empty-settings = ./empty-settings.nix; +} diff --git a/tests/modules/programs/vifm/empty-settings.nix b/tests/modules/programs/vifm/empty-settings.nix new file mode 100644 index 000000000000..4e1df9c18c08 --- /dev/null +++ b/tests/modules/programs/vifm/empty-settings.nix @@ -0,0 +1,11 @@ +{ ... }: + +{ + programs.vifm.enable = true; + + test.stubs.vifm = { }; + + nmt.script = '' + assertPathNotExists home-files/.config/vifm + ''; +} diff --git a/tests/modules/programs/vifm/example-settings.nix b/tests/modules/programs/vifm/example-settings.nix new file mode 100644 index 000000000000..8f562aa62bcc --- /dev/null +++ b/tests/modules/programs/vifm/example-settings.nix @@ -0,0 +1,21 @@ +{ config, ... }: + +{ + programs.vifm = { + enable = true; + package = config.lib.test.mkStubPackage { }; + extraConfig = '' + mark h ~/ + ''; + }; + + nmt.script = '' + assertFileContent \ + home-files/.config/vifm/vifmrc \ + ${ + builtins.toFile "vifm-expected.conf" '' + mark h ~/ + '' + } + ''; +} From 65ae9c147349829d3df0222151f53f79821c5134 Mon Sep 17 00:00:00 2001 From: Perchun Pak Date: Fri, 11 Oct 2024 14:48:52 +0200 Subject: [PATCH 499/636] git: add module for `git maintenance` (#5772) Adds module for git-scm.com/docs/git-maintenance. --- modules/programs/git.nix | 77 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/modules/programs/git.nix b/modules/programs/git.nix index 07d01ab9d64c..dfdac2d4bbb1 100644 --- a/modules/programs/git.nix +++ b/modules/programs/git.nix @@ -214,6 +214,41 @@ in { }; }; + maintenance = { + enable = mkEnableOption "" // { + description = '' + Enable the automatic {command}`git maintenance`. + + See . + ''; + }; + + repositories = mkOption { + type = with types; listOf str; + default = [ ]; + description = '' + Repositories on which {command}`git maintenance` should run. + + Should be a list of absolute paths. + ''; + }; + + timers = mkOption { + type = types.attrsOf types.str; + default = { + hourly = "*-*-* 1..23:53:00"; + daily = "Tue..Sun *-*-* 0:53:00"; + weekly = "Mon 0:53:00"; + }; + description = '' + Systemd timers to create for scheduled {command}`git maintenance`. + + Key is passed to `--schedule` argument in {command}`git maintenance run` + and value is passed to `Timer.OnCalendar` in `systemd.user.timers`. + ''; + }; + }; + diff-highlight = { enable = mkEnableOption "" // { description = '' @@ -501,6 +536,48 @@ in { }; }) + (mkIf cfg.maintenance.enable { + programs.git.iniContent.maintenance.repo = cfg.maintenance.repositories; + + systemd.user.services."git-maintenance@" = { + Unit = { + Description = "Optimize Git repositories data"; + Documentation = [ "man:git-maintenance(1)" ]; + }; + + Service = { + Type = "oneshot"; + ExecStart = let exe = lib.getExe cfg.package; + in '' + "${exe}" --exec-path="${exe}" for-each-repo --config=maintenance.repo maintenance run --schedule=%i + ''; + LockPersonality = "yes"; + MemoryDenyWriteExecute = "yes"; + NoNewPrivileges = "yes"; + RestrictAddressFamilies = "AF_UNIX AF_INET AF_INET6 AF_VSOCK"; + RestrictNamespaces = "yes"; + RestrictRealtime = "yes"; + RestrictSUIDSGID = "yes"; + SystemCallArchitectures = "native"; + SystemCallFilter = "@system-service"; + }; + }; + + systemd.user.timers = let + toSystemdTimer = name: time: + lib.attrsets.nameValuePair "git-maintenance@${name}" { + Unit.Description = "Optimize Git repositories data"; + + Timer = { + OnCalendar = time; + Persistent = true; + }; + + Install.WantedBy = [ "timers.target" ]; + }; + in lib.attrsets.mapAttrs' toSystemdTimer cfg.maintenance.timers; + }) + (mkIf cfg.diff-highlight.enable { programs.git.iniContent = let dhCommand = From 2b13611eaed8326789f76f70d21d06fbb14e3e47 Mon Sep 17 00:00:00 2001 From: Kilian Mio <86004375+Mikilio@users.noreply.github.com> Date: Sat, 12 Oct 2024 00:21:33 +0200 Subject: [PATCH 500/636] floorp: add module Also fix tests for Firefox module derivatives. --- modules/modules.nix | 1 + modules/programs/floorp.nix | 29 +++ tests/default.nix | 1 + tests/modules/programs/firefox/common.nix | 15 ++ tests/modules/programs/firefox/firefox.nix | 17 +- tests/modules/programs/firefox/floorp.nix | 1 + tests/modules/programs/firefox/policies.nix | 4 +- .../programs/firefox/profile-settings.nix | 241 ++++++++++++++++++ .../firefox/profiles/bookmarks/default.nix | 8 +- .../bookmarks/expected-bookmarks-user.js | 2 +- .../firefox/profiles/search/default.nix | 34 ++- .../expected-search-without-default.json | 2 +- .../profiles/search/expected-search.json | 8 +- 13 files changed, 334 insertions(+), 29 deletions(-) create mode 100644 modules/programs/floorp.nix create mode 100644 tests/modules/programs/firefox/common.nix create mode 100644 tests/modules/programs/firefox/floorp.nix create mode 100644 tests/modules/programs/firefox/profile-settings.nix diff --git a/modules/modules.nix b/modules/modules.nix index 72f4adaae676..b6880e62f2ba 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -92,6 +92,7 @@ let ./programs/feh.nix ./programs/firefox.nix ./programs/fish.nix + ./programs/floorp.nix ./programs/foot.nix ./programs/freetube.nix ./programs/fuzzel.nix diff --git a/modules/programs/floorp.nix b/modules/programs/floorp.nix new file mode 100644 index 000000000000..0f231bdf4830 --- /dev/null +++ b/modules/programs/floorp.nix @@ -0,0 +1,29 @@ +{ lib, ... }: + +with lib; + +let + + modulePath = [ "programs" "floorp" ]; + + mkFirefoxModule = import ./firefox/mkFirefoxModule.nix; + +in { + meta.maintainers = [ hm.maintainers.bricked ]; + + imports = [ + (mkFirefoxModule { + inherit modulePath; + name = "Floorp"; + wrappedPackageName = "floorp"; + unwrappedPackageName = "floorp-unwrapped"; + visible = true; + + platforms.linux = { + configPath = ".floorp"; + vendorPath = ".floorp"; + }; + platforms.darwin = { configPath = "Library/Application Support/Floorp"; }; + }) + ]; +} diff --git a/tests/default.nix b/tests/default.nix index 83ed42a70d35..90371aafeb88 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -193,6 +193,7 @@ in import nmtSrc { ./modules/programs/bemenu ./modules/programs/boxxy ./modules/programs/firefox/firefox.nix + ./modules/programs/firefox/floorp.nix ./modules/programs/foot ./modules/programs/freetube ./modules/programs/fuzzel diff --git a/tests/modules/programs/firefox/common.nix b/tests/modules/programs/firefox/common.nix new file mode 100644 index 000000000000..7d05382f1314 --- /dev/null +++ b/tests/modules/programs/firefox/common.nix @@ -0,0 +1,15 @@ +name: +builtins.mapAttrs (test: module: import module [ "programs" name ]) { + "${name}-deprecated-native-messenger" = ./deprecated-native-messenger.nix; + "${name}-policies" = ./policies.nix; + "${name}-profiles-bookmarks" = ./profiles/bookmarks; + "${name}-profiles-containers" = ./profiles/containers; + "${name}-profiles-containers-duplicate-ids" = + ./profiles/containers/duplicate-ids.nix; + "${name}-profiles-containers-id-out-of-range" = + ./profiles/containers/id-out-of-range.nix; + "${name}-profiles-duplicate-ids" = ./profiles/duplicate-ids.nix; + "${name}-profiles-search" = ./profiles/search; + "${name}-profiles-settings" = ./profiles/settings; + "${name}-state-version-19_09" = ./state-version-19_09.nix; +} diff --git a/tests/modules/programs/firefox/firefox.nix b/tests/modules/programs/firefox/firefox.nix index 6d92a5f49014..dd126e260b90 100644 --- a/tests/modules/programs/firefox/firefox.nix +++ b/tests/modules/programs/firefox/firefox.nix @@ -1,16 +1 @@ -let name = "firefox"; - -in builtins.mapAttrs (test: module: import module [ "programs" name ]) { - "${name}-deprecated-native-messenger" = ./deprecated-native-messenger.nix; - "${name}-policies" = ./policies.nix; - "${name}-profiles-bookmarks" = ./profiles/bookmarks; - "${name}-profiles-containers" = ./profiles/containers; - "${name}-profiles-containers-duplicate-ids" = - ./profiles/containers/duplicate-ids.nix; - "${name}-profiles-containers-id-out-of-range" = - ./profiles/containers/id-out-of-range.nix; - "${name}-profiles-duplicate-ids" = ./profiles/duplicate-ids.nix; - "${name}-profiles-search" = ./profiles/search; - "${name}-profiles-settings" = ./profiles/settings; - "${name}-state-version-19_09" = ./state-version-19_09.nix; -} +import ./common.nix "firefox" diff --git a/tests/modules/programs/firefox/floorp.nix b/tests/modules/programs/firefox/floorp.nix new file mode 100644 index 000000000000..67a13659c197 --- /dev/null +++ b/tests/modules/programs/firefox/floorp.nix @@ -0,0 +1 @@ +import ./common.nix "floorp" diff --git a/tests/modules/programs/firefox/policies.nix b/tests/modules/programs/firefox/policies.nix index 5e02a1916b6b..5cda1406a34b 100644 --- a/tests/modules/programs/firefox/policies.nix +++ b/tests/modules/programs/firefox/policies.nix @@ -20,7 +20,7 @@ in { package = pkgs.${cfg.wrappedPackageName}.override { extraPolicies = { DownloadDirectory = "/foo"; }; }; - }) // { + } // { nmt.script = '' jq=${lib.getExe pkgs.jq} config_file="${cfg.finalPackage}/lib/${cfg.wrappedPackageName}/distribution/policies.json" @@ -39,5 +39,5 @@ in { fail "Expected '$config_file' to set 'policies.DownloadDirectory' to \"/foo\"" fi ''; - }; + }); } diff --git a/tests/modules/programs/firefox/profile-settings.nix b/tests/modules/programs/firefox/profile-settings.nix new file mode 100644 index 000000000000..897067625568 --- /dev/null +++ b/tests/modules/programs/firefox/profile-settings.nix @@ -0,0 +1,241 @@ +modulePath: +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = getAttrFromPath modulePath config; + + firefoxMockOverlay = import ./setup-firefox-mock-overlay.nix modulePath; + + withName = path: + pkgs.substituteAll { + src = path; + name = cfg.wrappedPackageName; + }; + +in { + imports = [ firefoxMockOverlay ]; + + config = mkIf config.test.enableBig (setAttrByPath modulePath { + enable = true; + profiles.basic.isDefault = true; + + profiles.test = { + id = 1; + settings = { + "general.smoothScroll" = false; + "browser.newtabpage.pinned" = [{ + title = "NixOS"; + url = "https://nixos.org"; + }]; + }; + }; + + profiles.bookmarks = { + id = 2; + settings = { "general.smoothScroll" = false; }; + bookmarks = [ + { + toolbar = true; + bookmarks = [{ + name = "Home Manager"; + url = "https://wiki.nixos.org/wiki/Home_Manager"; + }]; + } + { + name = "wikipedia"; + tags = [ "wiki" ]; + keyword = "wiki"; + url = "https://en.wikipedia.org/wiki/Special:Search?search=%s&go=Go"; + } + { + name = "kernel.org"; + url = "https://www.kernel.org"; + } + { + name = "Nix sites"; + bookmarks = [ + { + name = "homepage"; + url = "https://nixos.org/"; + } + { + name = "wiki"; + tags = [ "wiki" "nix" ]; + url = "https://wiki.nixos.org/"; + } + { + name = "Nix sites"; + bookmarks = [ + { + name = "homepage"; + url = "https://nixos.org/"; + } + { + name = "wiki"; + url = "https://wiki.nixos.org/"; + } + ]; + } + ]; + } + ]; + }; + + profiles.search = { + id = 3; + search = { + force = true; + default = "Google"; + privateDefault = "DuckDuckGo"; + order = [ "Nix Packages" "NixOS Wiki" ]; + engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + }]; + + icon = + "/run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + + definedAliases = [ "@np" ]; + }; + + "NixOS Wiki" = { + urls = [{ + template = + "https://wiki.nixos.org/index.php?search={searchTerms}"; + }]; + iconUpdateURL = "https://wiki.nixos.org/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = [ "@nw" ]; + }; + + "Bing".metaData.hidden = true; + "Google".metaData.alias = "@g"; + }; + }; + }; + + profiles.searchWithoutDefault = { + id = 4; + search = { + force = true; + order = [ "Google" "Nix Packages" ]; + engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { + name = "type"; + value = "packages"; + } + { + name = "query"; + value = "{searchTerms}"; + } + ]; + }]; + + definedAliases = [ "@np" ]; + }; + }; + }; + }; + + profiles.containers = { + id = 5; + containers = { + "shopping" = { + id = 6; + icon = "circle"; + color = "yellow"; + }; + }; + }; + } // { + + nmt.script = let + + noHashQuery = '' + 'def walk(f): + . as $in + | if type == "object" then + reduce keys[] as $key + ( {}; . + { ($key): ($in[$key] | walk(f)) } | f ) + elif type == "array" then + map( walk(f) ) + else + f + end; + walk(if type == "object" then + if has("hash") then .hash = null else . end | + if has("privateHash") then .privateHash = null else . end + else + . + end)' ''; + + in '' + assertFileRegex \ + home-path/bin/${cfg.wrappedPackageName} \ + MOZ_APP_LAUNCHER + + assertDirectoryExists home-files/${cfg.configPath}/basic + + assertFileContent \ + home-files/${cfg.configPath}/test/user.js \ + ${withName ./profile-settings-expected-user.js} + + assertFileContent \ + home-files/${cfg.configPath}/containers/containers.json \ + ${withName ./profile-settings-expected-containers.json} + + bookmarksUserJs=$(normalizeStorePaths \ + home-files/${cfg.configPath}/bookmarks/user.js) + + assertFileContent \ + $bookmarksUserJs \ + ${withName ./profile-settings-expected-bookmarks-user.js} + + bookmarksFile="$(sed -n \ + '/browser.bookmarks.file/ {s|^.*\(/nix/store[^"]*\).*|\1|;p}' \ + $TESTED/home-files/${cfg.configPath}/bookmarks/user.js)" + + assertFileContent \ + $bookmarksFile \ + ${withName ./profile-settings-expected-bookmarks.html} + + function assertFirefoxSearchContent() { + compressedSearch=$(normalizeStorePaths "$1") + + decompressedSearch=$(dirname $compressedSearch)/search.json + ${pkgs.mozlz4a}/bin/mozlz4a -d "$compressedSearch" >(${pkgs.jq}/bin/jq ${noHashQuery} > "$decompressedSearch") + + assertFileContent \ + $decompressedSearch \ + "$2" + } + + assertFirefoxSearchContent \ + home-files/${cfg.configPath}/search/search.json.mozlz4 \ + ${withName ./profile-settings-expected-search.json} + + assertFirefoxSearchContent \ + home-files/${cfg.configPath}/searchWithoutDefault/search.json.mozlz4 \ + ${withName ./profile-settings-expected-search-without-default.json} + ''; + }); +} diff --git a/tests/modules/programs/firefox/profiles/bookmarks/default.nix b/tests/modules/programs/firefox/profiles/bookmarks/default.nix index 7bf508ab02f7..dfbcfbd9232f 100644 --- a/tests/modules/programs/firefox/profiles/bookmarks/default.nix +++ b/tests/modules/programs/firefox/profiles/bookmarks/default.nix @@ -9,6 +9,12 @@ let firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath; + withName = path: + pkgs.substituteAll { + src = path; + name = cfg.wrappedPackageName; + }; + in { imports = [ firefoxMockOverlay ]; @@ -70,7 +76,7 @@ in { assertFileContent \ $bookmarksUserJs \ - ${./expected-bookmarks-user.js} + ${withName ./expected-bookmarks-user.js} bookmarksFile="$(sed -n \ '/browser.bookmarks.file/ {s|^.*\(/nix/store[^"]*\).*|\1|;p}' \ diff --git a/tests/modules/programs/firefox/profiles/bookmarks/expected-bookmarks-user.js b/tests/modules/programs/firefox/profiles/bookmarks/expected-bookmarks-user.js index 922d3651e2f7..47448a6e4785 100644 --- a/tests/modules/programs/firefox/profiles/bookmarks/expected-bookmarks-user.js +++ b/tests/modules/programs/firefox/profiles/bookmarks/expected-bookmarks-user.js @@ -1,6 +1,6 @@ // Generated by Home Manager. -user_pref("browser.bookmarks.file", "/nix/store/00000000000000000000000000000000-firefox-bookmarks.html"); +user_pref("browser.bookmarks.file", "/nix/store/00000000000000000000000000000000-@name@-bookmarks.html"); user_pref("browser.places.importBookmarksHTML", true); user_pref("general.smoothScroll", false); diff --git a/tests/modules/programs/firefox/profiles/search/default.nix b/tests/modules/programs/firefox/profiles/search/default.nix index 8a4c98e9b4e3..76acfcd3a1c4 100644 --- a/tests/modules/programs/firefox/profiles/search/default.nix +++ b/tests/modules/programs/firefox/profiles/search/default.nix @@ -9,6 +9,12 @@ let firefoxMockOverlay = import ../../setup-firefox-mock-overlay.nix modulePath; + withName = path: + pkgs.substituteAll { + src = path; + name = cfg.wrappedPackageName; + }; + in { imports = [ firefoxMockOverlay ]; @@ -88,12 +94,32 @@ in { }; }; } // { - nmt.script = '' + nmt.script = let + + noHashQuery = '' + 'def walk(f): + . as $in + | if type == "object" then + reduce keys[] as $key + ( {}; . + { ($key): ($in[$key] | walk(f)) } | f ) + elif type == "array" then + map( walk(f) ) + else + f + end; + walk(if type == "object" then + if has("hash") then .hash = null else . end | + if has("privateHash") then .privateHash = null else . end + else + . + end)' ''; + + in '' function assertFirefoxSearchContent() { compressedSearch=$(normalizeStorePaths "$1") decompressedSearch=$(dirname $compressedSearch)/search.json - ${pkgs.mozlz4a}/bin/mozlz4a -d "$compressedSearch" >(${pkgs.jq}/bin/jq . > "$decompressedSearch") + ${pkgs.mozlz4a}/bin/mozlz4a -d "$compressedSearch" >(${pkgs.jq}/bin/jq ${noHashQuery} > "$decompressedSearch") assertFileContent \ $decompressedSearch \ @@ -102,11 +128,11 @@ in { assertFirefoxSearchContent \ home-files/${cfg.configPath}/search/search.json.mozlz4 \ - ${./expected-search.json} + ${withName ./expected-search.json} assertFirefoxSearchContent \ home-files/${cfg.configPath}/searchWithoutDefault/search.json.mozlz4 \ - ${./expected-search-without-default.json} + ${withName ./expected-search-without-default.json} ''; }); } diff --git a/tests/modules/programs/firefox/profiles/search/expected-search-without-default.json b/tests/modules/programs/firefox/profiles/search/expected-search-without-default.json index b845dad42f03..ec1ce14c813c 100644 --- a/tests/modules/programs/firefox/profiles/search/expected-search-without-default.json +++ b/tests/modules/programs/firefox/profiles/search/expected-search-without-default.json @@ -12,7 +12,7 @@ "@np" ], "_isAppProvided": false, - "_loadPath": "[home-manager]/programs.firefox.profiles.searchWithoutDefault.search.engines.\"Nix Packages\"", + "_loadPath": "[home-manager]/programs.@name@.profiles.searchWithoutDefault.search.engines.\"Nix Packages\"", "_metaData": { "order": 2 }, diff --git a/tests/modules/programs/firefox/profiles/search/expected-search.json b/tests/modules/programs/firefox/profiles/search/expected-search.json index 832b6c09c17c..a661cf3fe1d8 100644 --- a/tests/modules/programs/firefox/profiles/search/expected-search.json +++ b/tests/modules/programs/firefox/profiles/search/expected-search.json @@ -6,7 +6,7 @@ ], "_iconURL": "file:///run/current-system/sw/share/icons/hicolor/scalable/apps/nix-snowflake.svg", "_isAppProvided": false, - "_loadPath": "[home-manager]/programs.firefox.profiles.search.search.engines.\"Nix Packages\"", + "_loadPath": "[home-manager]/programs.@name@.profiles.search.search.engines.\"Nix Packages\"", "_metaData": { "order": 1 }, @@ -34,7 +34,7 @@ "_iconURL": "https://wiki.nixos.org/favicon.png", "_iconUpdateURL": "https://wiki.nixos.org/favicon.png", "_isAppProvided": false, - "_loadPath": "[home-manager]/programs.firefox.profiles.search.search.engines.\"NixOS Wiki\"", + "_loadPath": "[home-manager]/programs.@name@.profiles.search.search.engines.\"NixOS Wiki\"", "_metaData": { "order": 2 }, @@ -68,9 +68,9 @@ ], "metaData": { "current": "Google", - "hash": "IRmKVSQlAYnvLO8kdZyNUR/g5hzVn4++T0PLPGm+kZk=", + "hash": null, "private": "DuckDuckGo", - "privateHash": "BWvqUiaCuMJ20lbymFf2dqzWyl1cgm1LZhhdWNEp0Cc=", + "privateHash": null, "useSavedOrder": true }, "version": 6 From d57112db877f07387ce7104b5ac346ede556d2d7 Mon Sep 17 00:00:00 2001 From: Nabeen Tiwaree Date: Sat, 12 Oct 2024 05:43:52 -0400 Subject: [PATCH 501/636] pls: fixed perm argument to pass via pls --- modules/programs/pls.nix | 2 +- tests/modules/programs/pls/bash.nix | 2 +- tests/modules/programs/pls/fish.nix | 2 +- tests/modules/programs/pls/zsh.nix | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/programs/pls.nix b/modules/programs/pls.nix index b9f509a76f34..8abb82618a11 100644 --- a/modules/programs/pls.nix +++ b/modules/programs/pls.nix @@ -9,7 +9,7 @@ let aliases = { ls = "${cfg.package}/bin/pls"; ll = - "${cfg.package}/bin/pls -d perms -d user -d group -d size -d mtime -d git"; + "${cfg.package}/bin/pls -d perm -d user -d group -d size -d mtime -d git"; }; in { diff --git a/tests/modules/programs/pls/bash.nix b/tests/modules/programs/pls/bash.nix index f7e0429b520c..dc1743997656 100644 --- a/tests/modules/programs/pls/bash.nix +++ b/tests/modules/programs/pls/bash.nix @@ -23,7 +23,7 @@ with lib; "alias ls=@pls@/bin/pls" assertFileContains \ home-files/.bashrc \ - "alias ll='@pls@/bin/pls -d perms -d user -d group -d size -d mtime -d git'" + "alias ll='@pls@/bin/pls -d perm -d user -d group -d size -d mtime -d git'" ''; }; } diff --git a/tests/modules/programs/pls/fish.nix b/tests/modules/programs/pls/fish.nix index 05dbb10b0fe2..c745cd7688ea 100644 --- a/tests/modules/programs/pls/fish.nix +++ b/tests/modules/programs/pls/fish.nix @@ -27,7 +27,7 @@ with lib; "alias ls @pls@/bin/pls" assertFileContains \ home-files/.config/fish/config.fish \ - "alias ll '@pls@/bin/pls -d perms -d user -d group -d size -d mtime -d git'" + "alias ll '@pls@/bin/pls -d perm -d user -d group -d size -d mtime -d git'" ''; }; } diff --git a/tests/modules/programs/pls/zsh.nix b/tests/modules/programs/pls/zsh.nix index 8f644e7535ad..bbe68abb5b55 100644 --- a/tests/modules/programs/pls/zsh.nix +++ b/tests/modules/programs/pls/zsh.nix @@ -26,7 +26,7 @@ with lib; "alias -- ls=@pls@/bin/pls" assertFileContains \ home-files/.zshrc \ - "alias -- ll='@pls@/bin/pls -d perms -d user -d group -d size -d mtime -d git'" + "alias -- ll='@pls@/bin/pls -d perm -d user -d group -d size -d mtime -d git'" ''; }; } From 64c6325b28ebd708653dd41d88f306023f296184 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Sun, 13 Oct 2024 03:59:22 +0000 Subject: [PATCH 502/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/c31898adf5a8ed202ce5bea9f347b1c6871f32d1?narHash=sha256-yumd4fBc/hi8a9QgA9IT8vlQuLZ2oqhkJXHPKxH/tRw%3D' (2024-10-06) → 'github:NixOS/nixpkgs/5633bcff0c6162b9e4b5f1264264611e950c8ec7?narHash=sha256-9UTxR8eukdg%2BXZeHgxW5hQA9fIKHsKCdOIUycTryeVw%3D' (2024-10-09) --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 76920c875ae1..0ce117f430b8 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1728241625, - "narHash": "sha256-yumd4fBc/hi8a9QgA9IT8vlQuLZ2oqhkJXHPKxH/tRw=", + "lastModified": 1728492678, + "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c31898adf5a8ed202ce5bea9f347b1c6871f32d1", + "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", "type": "github" }, "original": { From e1aec543f5caf643ca0d94b6a633101942fd065f Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Mon, 14 Oct 2024 07:01:26 -0400 Subject: [PATCH 503/636] thunderbird: support setting search engines (#5697) * firefox: split search into separate submodule file * thunderbird: support setting search engines --- modules/programs/firefox.nix | 3 +- modules/programs/firefox/mkFirefoxModule.nix | 250 ++---------------- modules/programs/firefox/profiles/search.nix | 251 +++++++++++++++++++ modules/programs/thunderbird.nix | 20 ++ 4 files changed, 288 insertions(+), 236 deletions(-) create mode 100644 modules/programs/firefox/profiles/search.nix diff --git a/modules/programs/firefox.nix b/modules/programs/firefox.nix index ac85990ff237..2a2667c35efc 100644 --- a/modules/programs/firefox.nix +++ b/modules/programs/firefox.nix @@ -11,8 +11,7 @@ let mkFirefoxModule = import ./firefox/mkFirefoxModule.nix; in { - meta.maintainers = - [ maintainers.rycee maintainers.kira-bruneau hm.maintainers.bricked ]; + meta.maintainers = [ maintainers.rycee hm.maintainers.bricked ]; imports = [ (mkFirefoxModule { diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index 2e4c23cde182..dd4920666396 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -547,93 +547,17 @@ in { description = "Whether this is a default profile."; }; - search = { - force = mkOption { - type = with types; bool; - default = false; - description = '' - Whether to force replace the existing search - configuration. This is recommended since ${name} will - replace the symlink for the search configuration on every - launch, but note that you'll lose any existing - configuration by enabling this. - ''; - }; - - default = mkOption { - type = with types; nullOr str; - default = null; - example = "DuckDuckGo"; - description = '' - The default search engine used in the address bar and search bar. - ''; - }; - - privateDefault = mkOption { - type = with types; nullOr str; - default = null; - example = "DuckDuckGo"; - description = '' - The default search engine used in the Private Browsing. - ''; - }; - - order = mkOption { - type = with types; uniq (listOf str); - default = [ ]; - example = [ "DuckDuckGo" "Google" ]; - description = '' - The order the search engines are listed in. Any engines - that aren't included in this list will be listed after - these in an unspecified order. - ''; - }; - - engines = mkOption { - type = with types; attrsOf (attrsOf jsonFormat.type); - default = { }; - example = literalExpression '' - { - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; - - icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@np" ]; - }; - - "NixOS Wiki" = { - urls = [{ template = "https://wiki.nixos.org/index.php?search={searchTerms}"; }]; - iconUpdateURL = "https://wiki.nixos.org/favicon.png"; - updateInterval = 24 * 60 * 60 * 1000; # every day - definedAliases = [ "@nw" ]; - }; - - "Bing".metaData.hidden = true; - "Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias - } - ''; - description = '' - Attribute set of search engine configurations. Engines - that only have {var}`metaData` specified will - be treated as builtin to ${name}. - - See [SearchEngine.jsm](https://searchfox.org/mozilla-central/rev/669329e284f8e8e2bb28090617192ca9b4ef3380/toolkit/components/search/SearchEngine.jsm#1138-1177) - in Firefox's source for available options. We maintain a - mapping to let you specify all options in the referenced - link without underscores, but it may fall out of date with - future options. - - Note, {var}`icon` is also a special option - added by Home Manager to make it convenient to specify - absolute icon paths. - ''; - }; + search = mkOption { + type = types.submodule (args: + import ./profiles/search.nix { + inherit (args) config; + inherit lib pkgs; + appName = cfg.name; + modulePath = modulePath ++ [ "profiles" name "search" ]; + profilePath = config.path; + }); + default = { }; + description = "Declarative search engine configuration."; }; containersForce = mkOption { @@ -853,152 +777,11 @@ in { force = profile.containersForce; }; - "${profilesPath}/${profile.path}/search.json.mozlz4" = mkIf - (profile.search.default != null || profile.search.privateDefault != null - || profile.search.order != [ ] || profile.search.engines != { }) { - force = profile.search.force; - source = let - settings = { - version = 6; - engines = let - # Map of nice field names to internal field names. - # This is intended to be exhaustive and should be - # updated at every version bump. - internalFieldNames = (genAttrs [ - "name" - "isAppProvided" - "loadPath" - "hasPreferredIcon" - "updateInterval" - "updateURL" - "iconUpdateURL" - "iconURL" - "iconMapObj" - "metaData" - "orderHint" - "definedAliases" - "urls" - ] (name: "_${name}")) // { - searchForm = "__searchForm"; - }; - - processCustomEngineInput = input: - (removeAttrs input [ "icon" ]) - // optionalAttrs (input ? icon) { - # Convenience to specify absolute path to icon - iconURL = "file://${input.icon}"; - } // (optionalAttrs (input ? iconUpdateURL) { - # Convenience to default iconURL to iconUpdateURL so - # the icon is immediately downloaded from the URL - iconURL = input.iconURL or input.iconUpdateURL; - } // { - # Required for custom engine configurations, loadPaths - # are unique identifiers that are generally formatted - # like: [source]/path/to/engine.xml - loadPath = '' - [home-manager]/${moduleName}.profiles.${profile.name}.search.engines."${ - replaceStrings [ "\\" ] [ "\\\\" ] input.name - }"''; - }); - - processEngineInput = name: input: - let - requiredInput = { - inherit name; - isAppProvided = input.isAppProvided or removeAttrs input - [ "metaData" ] == { }; - metaData = input.metaData or { }; - }; - in if requiredInput.isAppProvided then - requiredInput - else - processCustomEngineInput (input // requiredInput); - - buildEngineConfig = name: input: - mapAttrs' (name: value: { - name = internalFieldNames.${name} or name; - inherit value; - }) (processEngineInput name input); - - sortEngineConfigs = configs: - let - buildEngineConfigWithOrder = order: name: - let - config = configs.${name} or { - _name = name; - _isAppProvided = true; - _metaData = { }; - }; - in config // { - _metaData = config._metaData // { inherit order; }; - }; - - engineConfigsWithoutOrder = - attrValues (removeAttrs configs profile.search.order); - - sortedEngineConfigs = - (imap buildEngineConfigWithOrder profile.search.order) - ++ engineConfigsWithoutOrder; - in sortedEngineConfigs; - - engineInput = profile.search.engines // { - # Infer profile.search.default as an app provided - # engine if it's not in profile.search.engines - ${profile.search.default} = - profile.search.engines.${profile.search.default} or { }; - } // { - ${profile.search.privateDefault} = - profile.search.engines.${profile.search.privateDefault} or { }; - }; - in sortEngineConfigs (mapAttrs buildEngineConfig engineInput); - - metaData = optionalAttrs (profile.search.default != null) { - current = profile.search.default; - hash = "@hash@"; - } // optionalAttrs (profile.search.privateDefault != null) { - private = profile.search.privateDefault; - privateHash = "@privateHash@"; - } // { - useSavedOrder = profile.search.order != [ ]; - }; - }; - - # Home Manager doesn't circumvent user consent and isn't acting - # maliciously. We're modifying the search outside of the browser, but - # a claim by Mozilla to remove this would be very anti-user, and - # is unlikely to be an issue for our use case. - disclaimer = appName: - "By modifying this file, I agree that I am doing so " - + "only within ${appName} itself, using official, user-driven search " - + "engine selection processes, and in a way which does not circumvent " - + "user consent. I acknowledge that any attempt to change this file " - + "from outside of ${appName} is a malicious act, and will be responded " - + "to accordingly."; - - salt = if profile.search.default != null then - profile.path + profile.search.default + disclaimer cfg.name - else - null; - - privateSalt = if profile.search.privateDefault != null then - profile.path + profile.search.privateDefault - + disclaimer cfg.name - else - null; - in pkgs.runCommand "search.json.mozlz4" { - nativeBuildInputs = with pkgs; [ mozlz4a openssl ]; - json = builtins.toJSON settings; - inherit salt privateSalt; - } '' - if [[ -n $salt ]]; then - export hash=$(echo -n "$salt" | openssl dgst -sha256 -binary | base64) - export privateHash=$(echo -n "$privateSalt" | openssl dgst -sha256 -binary | base64) - mozlz4a <(substituteStream json search.json.in --subst-var hash --subst-var privateHash) "$out" - else - mozlz4a <(echo "$json") "$out" - fi - ''; - }; + "${profilesPath}/${profile.path}/search.json.mozlz4" = { + enable = profile.search.enable; + force = profile.search.force; + source = profile.search.file; + }; "${profilesPath}/${profile.path}/extensions" = mkIf (profile.extensions != [ ]) { @@ -1025,4 +808,3 @@ in { }; }); } - diff --git a/modules/programs/firefox/profiles/search.nix b/modules/programs/firefox/profiles/search.nix new file mode 100644 index 000000000000..69b771aa4930 --- /dev/null +++ b/modules/programs/firefox/profiles/search.nix @@ -0,0 +1,251 @@ +{ config, lib, pkgs, appName, modulePath, profilePath }: + +with lib; + +let + jsonFormat = pkgs.formats.json { }; + + # Map of nice field names to internal field names. + # This is intended to be exhaustive and should be + # updated at every version bump. + internalFieldNames = (genAttrs [ + "name" + "isAppProvided" + "loadPath" + "hasPreferredIcon" + "updateInterval" + "updateURL" + "iconUpdateURL" + "iconURL" + "iconMapObj" + "metaData" + "orderHint" + "definedAliases" + "urls" + ] (name: "_${name}")) // { + searchForm = "__searchForm"; + }; + + processCustomEngineInput = input: + (removeAttrs input [ "icon" ]) // optionalAttrs (input ? icon) { + # Convenience to specify absolute path to icon + iconURL = "file://${input.icon}"; + } // (optionalAttrs (input ? iconUpdateURL) { + # Convenience to default iconURL to iconUpdateURL so + # the icon is immediately downloaded from the URL + iconURL = input.iconURL or input.iconUpdateURL; + } // { + # Required for custom engine configurations, loadPaths + # are unique identifiers that are generally formatted + # like: [source]/path/to/engine.xml + loadPath = "[home-manager]/${ + concatStringsSep "." (map strings.escapeNixIdentifier + (modulePath ++ [ "engines" input.name ])) + }"; + }); + + processEngineInput = name: input: + let + requiredInput = { + inherit name; + isAppProvided = input.isAppProvided or removeAttrs input [ "metaData" ] + == { }; + metaData = input.metaData or { }; + }; + in if requiredInput.isAppProvided then + requiredInput + else + processCustomEngineInput (input // requiredInput); + + buildEngineConfig = name: input: + mapAttrs' (name: value: { + name = internalFieldNames.${name} or name; + inherit value; + }) (processEngineInput name input); + + sortEngineConfigs = configs: + let + buildEngineConfigWithOrder = order: name: + let + config = configs.${name} or { + _name = name; + _isAppProvided = true; + _metaData = { }; + }; + in config // { _metaData = config._metaData // { inherit order; }; }; + + engineConfigsWithoutOrder = attrValues (removeAttrs configs config.order); + + sortedEngineConfigs = (imap buildEngineConfigWithOrder config.order) + ++ engineConfigsWithoutOrder; + in sortedEngineConfigs; + + engineInput = config.engines // { + # Infer config.default as an app provided + # engine if it's not in config.engines + ${config.default} = config.engines.${config.default} or { }; + } // { + ${config.privateDefault} = config.engines.${config.privateDefault} or { }; + }; + + settings = { + version = 6; + engines = sortEngineConfigs (mapAttrs buildEngineConfig engineInput); + + metaData = optionalAttrs (config.default != null) { + current = config.default; + hash = "@hash@"; + } // optionalAttrs (config.privateDefault != null) { + private = config.privateDefault; + privateHash = "@privateHash@"; + } // { + useSavedOrder = config.order != [ ]; + }; + }; + + # Home Manager doesn't circumvent user consent and isn't acting + # maliciously. We're modifying the search outside of the browser, but + # a claim by Mozilla to remove this would be very anti-user, and + # is unlikely to be an issue for our use case. + disclaimer = "By modifying this file, I agree that I am doing so " + + "only within ${appName} itself, using official, user-driven search " + + "engine selection processes, and in a way which does not circumvent " + + "user consent. I acknowledge that any attempt to change this file " + + "from outside of ${appName} is a malicious act, and will be responded " + + "to accordingly."; + + salt = if config.default != null then + profilePath + config.default + disclaimer + else + null; + + privateSalt = if config.privateDefault != null then + profilePath + config.privateDefault + disclaimer + else + null; + + file = pkgs.runCommand "search.json.mozlz4" { + nativeBuildInputs = with pkgs; [ mozlz4a openssl ]; + json = builtins.toJSON settings; + inherit salt privateSalt; + } '' + if [[ -n $salt ]]; then + export hash=$(echo -n "$salt" | openssl dgst -sha256 -binary | base64) + export privateHash=$(echo -n "$privateSalt" | openssl dgst -sha256 -binary | base64) + mozlz4a <(substituteStream json search.json.in --subst-var hash --subst-var privateHash) "$out" + else + mozlz4a <(echo "$json") "$out" + fi + ''; +in { + imports = [ (pkgs.path + "/nixos/modules/misc/meta.nix") ]; + + meta.maintainers = with maintainers; [ kira-bruneau ]; + + options = { + enable = mkOption { + type = with types; bool; + default = config.default != null || config.privateDefault != null + || config.order != [ ] || config.engines != { }; + internal = true; + }; + + force = mkOption { + type = with types; bool; + default = false; + description = '' + Whether to force replace the existing search + configuration. This is recommended since ${appName} will + replace the symlink for the search configuration on every + launch, but note that you'll lose any existing configuration + by enabling this. + ''; + }; + + default = mkOption { + type = with types; nullOr str; + default = null; + example = "DuckDuckGo"; + description = '' + The default search engine used in the address bar and search + bar. + ''; + }; + + privateDefault = mkOption { + type = with types; nullOr str; + default = null; + example = "DuckDuckGo"; + description = '' + The default search engine used in the Private Browsing. + ''; + }; + + order = mkOption { + type = with types; uniq (listOf str); + default = [ ]; + example = [ "DuckDuckGo" "Google" ]; + description = '' + The order the search engines are listed in. Any engines that + aren't included in this list will be listed after these in an + unspecified order. + ''; + }; + + engines = mkOption { + type = with types; attrsOf (attrsOf jsonFormat.type); + default = { }; + example = literalExpression '' + { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + + icon = "''${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + + "NixOS Wiki" = { + urls = [{ template = "https://wiki.nixos.org/index.php?search={searchTerms}"; }]; + iconUpdateURL = "https://wiki.nixos.org/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; # every day + definedAliases = [ "@nw" ]; + }; + + "Bing".metaData.hidden = true; + "Google".metaData.alias = "@g"; # builtin engines only support specifying one additional alias + } + ''; + + description = '' + Attribute set of search engine configurations. Engines that + only have {var}`metaData` specified will be treated as builtin + to ${appName}. + + See [SearchEngine.jsm](https://searchfox.org/mozilla-central/rev/669329e284f8e8e2bb28090617192ca9b4ef3380/toolkit/components/search/SearchEngine.jsm#1138-1177) + in ${appName}'s source for available options. We maintain a + mapping to let you specify all options in the referenced link + without underscores, but it may fall out of date with future + options. + + Note, {var}`icon` is also a special option added by Home + Manager to make it convenient to specify absolute icon paths. + ''; + }; + + file = mkOption { + type = with types; path; + default = file; + internal = true; + readOnly = true; + description = '' + Resulting search.json.mozlz4 file. + ''; + }; + }; +} diff --git a/modules/programs/thunderbird.nix b/modules/programs/thunderbird.nix index 2001e806f76d..a5ba0e63eca3 100644 --- a/modules/programs/thunderbird.nix +++ b/modules/programs/thunderbird.nix @@ -225,6 +225,20 @@ in { Extra preferences to add to {file}`user.js`. ''; }; + + search = mkOption { + type = types.submodule (args: + import ./firefox/profiles/search.nix { + inherit (args) config; + inherit lib pkgs; + appName = "Thunderbird"; + modulePath = + [ "programs" "thunderbird" "profiles" name "search" ]; + profilePath = name; + }); + default = { }; + description = "Declarative search engine configuration."; + }; }; })); description = "Attribute set of Thunderbird profiles."; @@ -393,6 +407,12 @@ in { ] ++ (map (a: toThunderbirdAccount a profile) accounts))) profile.extraConfig; }; + + "${thunderbirdProfilesPath}/${name}/search.json.mozlz4" = { + enable = profile.search.enable; + force = profile.search.force; + source = profile.search.file; + }; })); }; } From 2a4fd1cfd8ed5648583dadef86966a8231024221 Mon Sep 17 00:00:00 2001 From: Sergey Date: Tue, 8 Oct 2024 22:34:31 +0100 Subject: [PATCH 504/636] eza: fix icons option Fixes the icons option for eza which was breaking completion in zsh. --- docs/release-notes/rl-2411.md | 5 +++++ modules/programs/eza.nix | 24 ++++++++++++++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/docs/release-notes/rl-2411.md b/docs/release-notes/rl-2411.md index 6f7a6b7b092c..626624640fd9 100644 --- a/docs/release-notes/rl-2411.md +++ b/docs/release-notes/rl-2411.md @@ -18,6 +18,11 @@ This release has the following notable changes: add `-w` to your assignment of [services.swayidle.extraArgs](#opt-services.swayidle.extraArgs). +- Support for Boolean values in the option + [programs.eza.icons](#opt-programs.eza.icons) is deprecated for + future removal. The new value for `true` is `"auto"`, and for + `false` it is `null`. + ## State Version Changes {#sec-release-24.11-state-version-changes} The state version in this release includes the changes below. These diff --git a/modules/programs/eza.nix b/modules/programs/eza.nix index d55d6f56e1bc..679f534998ff 100644 --- a/modules/programs/eza.nix +++ b/modules/programs/eza.nix @@ -49,10 +49,13 @@ with lib; }; icons = mkOption { - type = types.bool; - default = false; + type = types.enum [ null true false "auto" "always" "never" ]; + default = null; description = '' Display icons next to file names ({option}`--icons` argument). + + Note, the support for Boolean values is deprecated. + Setting this option to `true` corresponds to `--icons=auto`. ''; }; @@ -70,8 +73,15 @@ with lib; config = let cfg = config.programs.eza; - args = escapeShellArgs (optional cfg.icons "--icons" - ++ optional cfg.git "--git" ++ cfg.extraOptions); + iconsOption = let + v = if isBool cfg.icons then + (if cfg.icons then "auto" else null) + else + cfg.icons; + in optionals (v != null) [ "--icons" v ]; + + args = escapeShellArgs + (iconsOption ++ optional cfg.git "--git" ++ cfg.extraOptions); optionsAlias = optionalAttrs (args != "") { eza = "eza ${args}"; }; @@ -83,6 +93,12 @@ with lib; lla = "eza -la"; }; in mkIf cfg.enable { + warnings = optional (isBool cfg.icons) '' + Setting programs.eza.icons to a Boolean is deprecated. + Please update your configuration so that + + programs.eza.icons = ${if cfg.icons then ''"auto"'' else "null"}''; + home.packages = [ cfg.package ]; programs.bash.shellAliases = optionsAlias From 994a0baf7be821c6c1487ffb3ab2884a5581a293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Tri=C3=B1anes?= Date: Sat, 14 Sep 2024 14:48:32 +0200 Subject: [PATCH 505/636] nushell: add joaquintrinanes as maintainer --- modules/programs/nushell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/nushell.nix b/modules/programs/nushell.nix index 2ebd9554c929..b69ec88f0239 100644 --- a/modules/programs/nushell.nix +++ b/modules/programs/nushell.nix @@ -39,7 +39,7 @@ let }; }); in { - meta.maintainers = [ maintainers.Philipp-M ]; + meta.maintainers = [ maintainers.Philipp-M maintainers.joaquintrinanes ]; imports = [ (mkRemovedOptionModule [ "programs" "nushell" "settings" ] '' From edf15f1549a2f4e65d704f7d6ab6be715d932976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Tri=C3=B1anes?= Date: Sat, 14 Sep 2024 02:15:02 +0200 Subject: [PATCH 506/636] nushell: create generator helpers --- modules/lib/default.nix | 1 + modules/lib/nushell.nix | 65 +++++++++++++++++++++++++++++++++++++++++ modules/lib/types.nix | 23 +++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 modules/lib/nushell.nix diff --git a/modules/lib/default.nix b/modules/lib/default.nix index 5d732a83f8d1..8014c625e38f 100644 --- a/modules/lib/default.nix +++ b/modules/lib/default.nix @@ -14,4 +14,5 @@ rec { shell = import ./shell.nix { inherit lib; }; zsh = import ./zsh.nix { inherit lib; }; + nushell = import ./nushell.nix { inherit lib; }; } diff --git a/modules/lib/nushell.nix b/modules/lib/nushell.nix new file mode 100644 index 000000000000..e831380cd0c3 --- /dev/null +++ b/modules/lib/nushell.nix @@ -0,0 +1,65 @@ +{ lib }: rec { + mkNushellInline = expr: lib.setType "nushell-inline" { inherit expr; }; + + toNushell = { indent ? "", multiline ? true, asBindings ? false }@args: + v: + let + innerIndent = "${indent} "; + introSpace = if multiline then '' + + ${innerIndent}'' else + " "; + outroSpace = if multiline then '' + + ${indent}'' else + " "; + innerArgs = args // { + indent = if asBindings then indent else innerIndent; + asBindings = false; + }; + concatItems = lib.concatStringsSep introSpace; + isNushellInline = lib.isType "nushell-inline"; + + generatedBindings = assert lib.assertMsg (badVarNames == [ ]) + "Bad Nushell variable names: ${ + lib.generators.toPretty { } badVarNames + }"; + lib.concatStrings (lib.mapAttrsToList (key: value: '' + ${indent}let ${key} = ${toNushell innerArgs value} + '') v); + + isBadVarName = name: + # Extracted from https://github.com/nushell/nushell/blob/ebc7b80c23f777f70c5053cca428226b3fe00d30/crates/nu-parser/src/parser.rs#L33 + # Variables with numeric or even empty names are allowed. The only requisite is not containing any of the following characters + let invalidVariableCharacters = ".[({+-*^/=!<>&|"; + in lib.match "^[$]?[^${lib.escapeRegex invalidVariableCharacters}]+$" + name == null; + badVarNames = lib.filter isBadVarName (builtins.attrNames v); + in if asBindings then + generatedBindings + else if v == null then + "null" + else if lib.isInt v || lib.isFloat v || lib.isString v || lib.isBool v then + lib.strings.toJSON v + else if lib.isList v then + (if v == [ ] then + "[]" + else + "[${introSpace}${ + concatItems (map (value: "${toNushell innerArgs value}") v) + }${outroSpace}]") + else if lib.isAttrs v then + (if isNushellInline v then + "(${v.expr})" + else if v == { } then + "{}" + else if lib.isDerivation v then + toString v + else + "{${introSpace}${ + concatItems (lib.mapAttrsToList (key: value: + "${lib.strings.toJSON key}: ${toNushell innerArgs value}") v) + }${outroSpace}}") + else + abort "nushell.toNushell: type ${lib.typeOf v} is unsupported"; +} diff --git a/modules/lib/types.nix b/modules/lib/types.nix index 056d3165b063..14d1c2192295 100644 --- a/modules/lib/types.nix +++ b/modules/lib/types.nix @@ -107,4 +107,27 @@ in rec { mergeDefaultOption loc defs; }; + nushellValue = let + valueType = types.nullOr (types.oneOf [ + (lib.mkOptionType { + name = "nushell"; + description = "Nushell inline value"; + descriptionClass = "name"; + check = lib.isType "nushell-inline"; + }) + types.bool + types.int + types.float + types.str + types.path + (types.attrsOf valueType // { + description = "attribute set of Nushell values"; + descriptionClass = "name"; + }) + (types.listOf valueType // { + description = "list of Nushell values"; + descriptionClass = "name"; + }) + ]); + in valueType; } From 628b15d275a536fd4d4b9ab4405dd1f0eb34fe18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Tri=C3=B1anes?= Date: Sat, 14 Sep 2024 18:09:15 +0200 Subject: [PATCH 507/636] nushell: allow arbitrary environment variables --- modules/programs/nushell.nix | 27 ++++++++++++++----- .../modules/programs/nushell/env-expected.nu | 15 ++++++++++- .../programs/nushell/example-settings.nix | 14 ++++++++-- 3 files changed, 47 insertions(+), 9 deletions(-) diff --git a/modules/programs/nushell.nix b/modules/programs/nushell.nix index b69ec88f0239..6586d1e1abed 100644 --- a/modules/programs/nushell.nix +++ b/modules/programs/nushell.nix @@ -145,11 +145,24 @@ in { }; environmentVariables = mkOption { - type = types.attrsOf types.str; + type = types.attrsOf hm.types.nushellValue; default = { }; - example = { FOO = "BAR"; }; + example = literalExpression '' + { + FOO = "BAR"; + LIST_VALUE = [ "foo" "bar" ]; + NU_LIB_DIRS = lib.concatStringsSep ":" [ ./scripts ]; + PROMPT_COMMAND = lib.hm.nushell.mkNushellInline '''{|| "> "}'''; + ENV_CONVERSIONS.PATH = { + from_string = lib.hm.nushell.mkNushellInline "{|s| $s | split row (char esep) }"; + to_string = lib.hm.nushell.mkNushellInline "{|v| $v | str join (char esep) }"; + }; + } + ''; description = '' - An attribute set that maps an environment variable to a shell interpreted string. + Environment variables to be set. + + Inline values can be set with `lib.hm.nushell.mkNushellInline`. ''; }; }; @@ -173,9 +186,11 @@ in { }) (let - envVarsStr = concatStringsSep "\n" - (mapAttrsToList (k: v: "$env.${k} = ${v}") cfg.environmentVariables); - in mkIf (cfg.envFile != null || cfg.extraEnv != "" || envVarsStr != "") { + hasEnvVars = cfg.environmentVariables != { }; + envVarsStr = '' + load-env ${hm.nushell.toNushell { } cfg.environmentVariables} + ''; + in mkIf (cfg.envFile != null || cfg.extraEnv != "" || hasEnvVars) { "${configDir}/env.nu".text = mkMerge [ (mkIf (cfg.envFile != null) cfg.envFile.text) cfg.extraEnv diff --git a/tests/modules/programs/nushell/env-expected.nu b/tests/modules/programs/nushell/env-expected.nu index 07105fc5499d..50f6f767b692 100644 --- a/tests/modules/programs/nushell/env-expected.nu +++ b/tests/modules/programs/nushell/env-expected.nu @@ -1,4 +1,17 @@ $env.FOO = 'BAR' -$env.BAR = $'(echo BAZ)' \ No newline at end of file +load-env { + "ENV_CONVERSIONS": { + "PATH": { + "from_string": ({|s| $s | split row (char esep) }) + "to_string": ({|v| $v | str join (char esep) }) + } + } + "FOO": "BAR" + "LIST_VALUE": [ + "foo" + "bar" + ] + "PROMPT_COMMAND": ({|| "> "}) +} diff --git a/tests/modules/programs/nushell/example-settings.nix b/tests/modules/programs/nushell/example-settings.nix index d870eb9db0ee..4fc1402a4ec2 100644 --- a/tests/modules/programs/nushell/example-settings.nix +++ b/tests/modules/programs/nushell/example-settings.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, config, lib, ... }: { programs.nushell = { @@ -28,7 +28,17 @@ "ll" = "ls -a"; }; - environmentVariables = { BAR = "$'(echo BAZ)'"; }; + environmentVariables = { + FOO = "BAR"; + LIST_VALUE = [ "foo" "bar" ]; + PROMPT_COMMAND = lib.hm.nushell.mkNushellInline ''{|| "> "}''; + ENV_CONVERSIONS.PATH = { + from_string = + lib.hm.nushell.mkNushellInline "{|s| $s | split row (char esep) }"; + to_string = + lib.hm.nushell.mkNushellInline "{|v| $v | str join (char esep) }"; + }; + }; }; test.stubs.nushell = { }; From b53427656655174c50c050b50c497d0e91405ab7 Mon Sep 17 00:00:00 2001 From: AtomicDude Date: Thu, 17 Oct 2024 02:20:16 +0200 Subject: [PATCH 508/636] Translate using Weblate (Romanian) Currently translated at 100.0% (18 of 18 strings) Co-authored-by: AtomicDude Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/ro/ Translation: Home Manager/Home Manager Modules --- modules/po/ro.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/po/ro.po b/modules/po/ro.po index d817496a79b0..71e9243c9b4a 100644 --- a/modules/po/ro.po +++ b/modules/po/ro.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2023-08-11 19:51+0000\n" -"Last-Translator: HeartBlin913861820c094e37 \n" +"PO-Revision-Date: 2024-10-13 22:15+0000\n" +"Last-Translator: AtomicDude \n" "Language-Team: Romanian \n" "Language: ro\n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " "20)) ? 1 : 2;\n" -"X-Generator: Weblate 5.0-dev\n" +"X-Generator: Weblate 5.8-dev\n" #: modules/files.nix:191 msgid "Creating home file links in %s" @@ -26,7 +26,7 @@ msgstr "Se creează legături ale fișierelor personale în %s" #: modules/files.nix:204 msgid "Cleaning up orphan links from %s" -msgstr "Se curăță legăturiile orfane din %s" +msgstr "Se curăță legăturile orfane din %s" #: modules/files.nix:220 msgid "Creating profile generation %s" From f81be125ff5a47b2f0a2289ccb6d4c752083659b Mon Sep 17 00:00:00 2001 From: Viktor Illmer Date: Thu, 17 Oct 2024 02:20:16 +0200 Subject: [PATCH 509/636] Translate using Weblate (German) Currently translated at 100.0% (18 of 18 strings) Co-authored-by: Viktor Illmer Translate-URL: https://hosted.weblate.org/projects/home-manager/modules/de/ Translation: Home Manager/Home Manager Modules --- modules/po/de.po | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/po/de.po b/modules/po/de.po index 5783cd7d707f..d9cdbc94472e 100644 --- a/modules/po/de.po +++ b/modules/po/de.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: Home Manager Modules\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2023-12-29 02:09+0000\n" -"Last-Translator: Peter Pfeufer \n" +"PO-Revision-Date: 2024-10-15 21:37+0000\n" +"Last-Translator: Viktor Illmer \n" "Language-Team: German \n" "Language: de\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 5.4-dev\n" +"X-Generator: Weblate 5.8-rc\n" #: modules/files.nix:191 msgid "Creating home file links in %s" @@ -120,7 +120,7 @@ msgstr "Fehler: HOME ist auf \"%s\" gesetzt, aber wir erwarten \"%s\"" #: modules/lib-bash/activation-init.sh:153 msgid "Starting Home Manager activation" -msgstr "Starte Home Manager Aktivierung" +msgstr "Starte Home-Manager-Aktivierung" #: modules/lib-bash/activation-init.sh:157 msgid "Sanity checking Nix" From 5bb057a7b527f8061f5b3dfaaf06650a23034f18 Mon Sep 17 00:00:00 2001 From: Julius Marozas Date: Thu, 17 Oct 2024 02:20:16 +0200 Subject: [PATCH 510/636] Translate using Weblate (Lithuanian) Currently translated at 97.2% (36 of 37 strings) Co-authored-by: Julius Marozas Translate-URL: https://hosted.weblate.org/projects/home-manager/cli/lt/ Translation: Home Manager/Home Manager CLI --- home-manager/po/lt.po | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/home-manager/po/lt.po b/home-manager/po/lt.po index 458ac14a78a9..c635d93a61ef 100644 --- a/home-manager/po/lt.po +++ b/home-manager/po/lt.po @@ -8,22 +8,22 @@ msgstr "" "Project-Id-Version: Home Manager\n" "Report-Msgid-Bugs-To: https://github.com/nix-community/home-manager/issues\n" "POT-Creation-Date: 2024-04-17 23:19+0200\n" -"PO-Revision-Date: 2024-02-16 22:01+0000\n" -"Last-Translator: Robert Helgesson \n" +"PO-Revision-Date: 2024-10-17 00:20+0000\n" +"Last-Translator: Julius Marozas \n" "Language-Team: Lithuanian \n" "Language: lt\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && " -"(n%100<10 || n%100>=20) ? 1 : 2);\n" -"X-Generator: Weblate 5.4\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (" +"n%100<10 || n%100>=20) ? 1 : 2);\n" +"X-Generator: Weblate 5.8-rc\n" #. translators: For example: "home-manager: missing argument for --cores" #: home-manager/home-manager:16 msgid "%s: missing argument for %s" -msgstr "" +msgstr "%s: trūksta argumento %s" #: home-manager/home-manager:64 msgid "No configuration file found at %s" @@ -55,6 +55,8 @@ msgid "" "The fallback Home Manager path %s has been deprecated and a file/directory " "was found there." msgstr "" +"Atsarginis kelias %s į Home Manager jau nebenaudojamas, tačiau jame buvo " +"rastas failas/katalogas." #. translators: This message will be seen by very few users that likely are familiar with English. So feel free to leave this untranslated. #: home-manager/home-manager:118 @@ -77,6 +79,24 @@ msgid "" "\n" " $ rm -r \"%s\"" msgstr "" +"Norėdami pašalinti šį įspėjimą, atlikite vieną iš šių veiksmų.\n" +"\n" +"1. Aiškiai nurodykite kelią į Home Manager, pavyzdžiui, pridėdami\n" +"\n" +" { programs.home-manager.path = \"%s\"; }\n" +"\n" +" prie jūsų konfigūracijos.\n" +"\n" +" Jei importuojate Home Manager tiesiogiai, galite naudoti parametrą `path`." +"\n" +"\n" +" pkgs.callPackage /path/to/home-manager-package { path = \"%s\"; }\n" +"\n" +" kviečiant į Home Manager paketą.\n" +"\n" +"2. Pašalinkite nebenaudojamą kelią.\n" +"\n" +" $ rm -r \"%s\"" #: home-manager/home-manager:146 msgid "Sanity checking Nix" @@ -175,10 +195,9 @@ msgstr "Nežinomas \"news.display\" nustatymas \"%s\"." #: home-manager/home-manager:594 #, sh-format msgid "Please set the $EDITOR or $VISUAL environment variable" -msgstr "" +msgstr "Nustatykite $EDITOR arba $VISUAL aplinkos kintamuosius" #: home-manager/home-manager:612 -#, fuzzy msgid "Cannot run build in read-only directory" msgstr "Negalima vykdyti kompiliavimo read-only kataloge" From 1d9b4a3e60398572f4a760bc93f89ebeebbdb3e2 Mon Sep 17 00:00:00 2001 From: "Jeffrey C. Ollie" Date: Mon, 5 Feb 2024 19:34:52 -0600 Subject: [PATCH 511/636] fish: make generation of completions optional Add a config option to optionally disable the generation of command completions based upon man pages. --- modules/programs/fish.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/modules/programs/fish.nix b/modules/programs/fish.nix index 8cd7f9f92dcc..02141042d36e 100644 --- a/modules/programs/fish.nix +++ b/modules/programs/fish.nix @@ -253,6 +253,12 @@ in { ''; }; + generateCompletions = mkEnableOption + "the automatic generation of completions based upon installed man pages" + // { + default = true; + }; + shellAliases = mkOption { type = with types; attrsOf str; default = { }; @@ -390,9 +396,9 @@ in { }; config = mkIf cfg.enable (mkMerge [ - { - home.packages = [ cfg.package ]; + { home.packages = [ cfg.package ]; } + (mkIf cfg.generateCompletions { # Support completion for `man` by building a cache for `apropos`. programs.man.generateCaches = mkDefault true; @@ -456,7 +462,9 @@ in { set fish_complete_path $prev "${config.xdg.dataHome}/fish/home-manager_generated_completions" $post end ''; + }) + { xdg.configFile."fish/config.fish".source = fishIndent "config.fish" '' # ~/.config/fish/config.fish: DO NOT EDIT -- this file has been generated # automatically by home-manager. From 800a191f33ce7311e5070ff10d6fb5030b55fdde Mon Sep 17 00:00:00 2001 From: xwjqv <35635774+xwjqv@users.noreply.github.com> Date: Sat, 5 Oct 2024 20:26:47 +0200 Subject: [PATCH 512/636] broot: allow multiple keyboard keys per verb To allow multiple keys the verb options need to accept listOf str. --- modules/programs/broot.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/programs/broot.nix b/modules/programs/broot.nix index 6a1680e07fc4..b4cd6d620907 100644 --- a/modules/programs/broot.nix +++ b/modules/programs/broot.nix @@ -15,7 +15,7 @@ let modal = mkEnableOption "modal (vim) mode"; verbs = mkOption { - type = with types; listOf (attrsOf (either bool str)); + type = with types; listOf (attrsOf (oneOf [ bool str (listOf str) ])); default = [ ]; example = literalExpression '' [ @@ -46,6 +46,9 @@ let `key` (optional) : a keyboard key triggering execution + `keys` (optional) + : multiple keyboard keys each triggering execution + `shortcut` (optional) : an alternate way to call the verb (without the arguments part) From e43902a7d6df1ce25063d59fa35ab786fa9f7704 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 17 Oct 2024 13:51:49 +0200 Subject: [PATCH 513/636] broot: fix minor documentation bug --- modules/programs/broot.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/broot.nix b/modules/programs/broot.nix index b4cd6d620907..c1ce94776e50 100644 --- a/modules/programs/broot.nix +++ b/modules/programs/broot.nix @@ -57,7 +57,7 @@ let : whether to quit broot on execution (default: `true`) - `from_shell` (optional) + `from_shell` (optional) : whether the verb must be executed from the parent shell (default: `false`) ''; From 78a7a070bbcc3b37cc36080c2a3514207d427b3b Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:53:03 +0200 Subject: [PATCH 514/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/5633bcff0c6162b9e4b5f1264264611e950c8ec7?narHash=sha256-9UTxR8eukdg%2BXZeHgxW5hQA9fIKHsKCdOIUycTryeVw%3D' (2024-10-09) → 'github:NixOS/nixpkgs/a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c?narHash=sha256-nsNdSldaAyu6PE3YUA%2BYQLqUDJh%2BgRbBooMMekZJwvI%3D' (2024-10-14) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 0ce117f430b8..6837fdba2c3a 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1728492678, - "narHash": "sha256-9UTxR8eukdg+XZeHgxW5hQA9fIKHsKCdOIUycTryeVw=", + "lastModified": 1728888510, + "narHash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "5633bcff0c6162b9e4b5f1264264611e950c8ec7", + "rev": "a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c", "type": "github" }, "original": { From 9c1a1c7df49a9b28539ccb509b36d0b81e41391c Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 17 Oct 2024 15:29:43 +0200 Subject: [PATCH 515/636] activitywatch: reduce test closure This also reduces test flakiness. --- tests/modules/services/activitywatch/basic-setup.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/modules/services/activitywatch/basic-setup.nix b/tests/modules/services/activitywatch/basic-setup.nix index d3a14ae87506..a8ba1cb493d5 100644 --- a/tests/modules/services/activitywatch/basic-setup.nix +++ b/tests/modules/services/activitywatch/basic-setup.nix @@ -5,6 +5,7 @@ let stubPackage = config.lib.test.mkStubPackage { }; in { services.activitywatch = { enable = true; + package = stubPackage; settings = { port = 3012; custom_static = { custom-watcher = stubPackage; }; From e78cbb20276f09c1802e62d2f77fc93ec32da268 Mon Sep 17 00:00:00 2001 From: libewa Date: Sun, 26 May 2024 11:41:16 +0200 Subject: [PATCH 516/636] zed-editor: add module Add a simple module for zed-editor, a simple editor written in Rust. --- modules/lib/maintainers.nix | 5 ++ modules/misc/news.nix | 10 +++ modules/modules.nix | 1 + modules/programs/zed-editor.nix | 89 +++++++++++++++++++ tests/default.nix | 1 + tests/modules/programs/zed-editor/default.nix | 5 ++ .../programs/zed-editor/extensions.nix | 24 +++++ tests/modules/programs/zed-editor/keymap.nix | 39 ++++++++ .../modules/programs/zed-editor/settings.nix | 36 ++++++++ 9 files changed, 210 insertions(+) create mode 100644 modules/programs/zed-editor.nix create mode 100644 tests/modules/programs/zed-editor/default.nix create mode 100644 tests/modules/programs/zed-editor/extensions.nix create mode 100644 tests/modules/programs/zed-editor/keymap.nix create mode 100644 tests/modules/programs/zed-editor/settings.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 501917ffbfc2..5916024b00eb 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -349,6 +349,11 @@ githubId = 12465195; name = "Bruno BELANYI"; }; + libewa = { + email = "libewa-git@icloud.com"; + github = "libewa"; + githubId = 67926131; + }; malvo = { email = "malte@malvo.org"; github = "malte-v"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 732c92478b3d..bf5e4be7603e 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1770,6 +1770,16 @@ in { ideas from mutt. ''; } + + { + time = "2024-10-17T13:07:55+00:00"; + message = '' + A new module is available: 'programs.zed-editor'. + + Zed is a fast text editor for macOS and Linux. + See https://zed.dev for more. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index b6880e62f2ba..b2b98e2312a2 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -262,6 +262,7 @@ let ./programs/yt-dlp.nix ./programs/z-lua.nix ./programs/zathura.nix + ./programs/zed-editor.nix ./programs/zellij.nix ./programs/zk.nix ./programs/zoxide.nix diff --git a/modules/programs/zed-editor.nix b/modules/programs/zed-editor.nix new file mode 100644 index 000000000000..250d891bb41f --- /dev/null +++ b/modules/programs/zed-editor.nix @@ -0,0 +1,89 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.programs.zed-editor; + jsonFormat = pkgs.formats.json { }; + + mergedSettings = cfg.userSettings // { + # this part by @cmacrae + auto_install_extensions = lib.genAttrs cfg.extensions (_: true); + }; +in { + meta.maintainers = [ hm.maintainers.libewa ]; + + options = { + # TODO: add vscode option parity (installing extensions, configuring + # keybinds with nix etc.) + programs.zed-editor = { + enable = mkEnableOption + "Zed, the high performance, multiplayer code editor from the creators of Atom and Tree-sitter"; + + package = mkPackageOption pkgs "zed-editor" { }; + + userSettings = mkOption { + type = jsonFormat.type; + default = { }; + example = literalExpression '' + { + features = { + copilot = false; + }; + telemetry = { + metrics = false; + }; + vim_mode = false; + ui_font_size = 16; + buffer_font_size = 16; + } + ''; + description = '' + Configuration written to Zed's {file}`settings.json`. + ''; + }; + + userKeymaps = mkOption { + type = jsonFormat.type; + default = { }; + example = literalExpression '' + [ + { + context = "Workspace"; + bindings = { + ctrl-shift-t = "workspace::NewTerminal"; + }; + }; + ] + ''; + description = '' + Configuration written to Zed's {file}`keymap.json`. + ''; + }; + + extensions = mkOption { + type = types.listOf types.str; + default = [ ]; + example = literalExpression '' + [ "swift" "nix" "xy-zed" ] + ''; + description = '' + A list of the extensions Zed should install on startup. + Use the name of a repository in the [extension list](https://github.com/zed-industries/extensions/tree/main/extensions). + ''; + }; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ cfg.package ]; + + xdg.configFile."zed/settings.json" = (mkIf (mergedSettings != { }) { + source = jsonFormat.generate "zed-user-settings" mergedSettings; + }); + + xdg.configFile."zed/keymap.json" = (mkIf (cfg.userKeymaps != { }) { + source = jsonFormat.generate "zed-user-keymaps" cfg.userKeymaps; + }); + }; +} diff --git a/tests/default.nix b/tests/default.nix index 90371aafeb88..9e431e473ab0 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -161,6 +161,7 @@ in import nmtSrc { ./modules/programs/watson ./modules/programs/wezterm ./modules/programs/yazi + ./modules/programs/zed-editor ./modules/programs/zellij ./modules/programs/zk ./modules/programs/zplug diff --git a/tests/modules/programs/zed-editor/default.nix b/tests/modules/programs/zed-editor/default.nix new file mode 100644 index 000000000000..3c5c894fe905 --- /dev/null +++ b/tests/modules/programs/zed-editor/default.nix @@ -0,0 +1,5 @@ +{ + zed-extensions = ./extensions.nix; + zed-keymap = ./keymap.nix; + zed-settings = ./settings.nix; +} diff --git a/tests/modules/programs/zed-editor/extensions.nix b/tests/modules/programs/zed-editor/extensions.nix new file mode 100644 index 000000000000..82b79aed8fc4 --- /dev/null +++ b/tests/modules/programs/zed-editor/extensions.nix @@ -0,0 +1,24 @@ +{ config, ... }: + +{ + programs.zed-editor = { + enable = true; + package = config.lib.test.mkStubPackage { }; + extensions = [ "swift" "html" "xy-zed" ]; + }; + + nmt.script = let + expectedContent = builtins.toFile "expected.json" '' + { + "auto_install_extensions": { + "html": true, + "swift": true, + "xy-zed": true + } + } + ''; + in '' + assertFileExists "home-files/.config/zed/settings.json" + assertFileContent "home-files/.config/zed/settings.json" "${expectedContent}" + ''; +} diff --git a/tests/modules/programs/zed-editor/keymap.nix b/tests/modules/programs/zed-editor/keymap.nix new file mode 100644 index 000000000000..df6abebdfd9d --- /dev/null +++ b/tests/modules/programs/zed-editor/keymap.nix @@ -0,0 +1,39 @@ +# Test custom keymap functionality +{ config, ... }: + +{ + programs.zed-editor = { + enable = true; + package = config.lib.test.mkStubPackage { }; + userKeymaps = [ + { bindings = { up = "menu::SelectPrev"; }; } + { + context = "Editor"; + bindings = { escape = "editor::Cancel"; }; + } + ]; + }; + + nmt.script = let + expectedContent = builtins.toFile "expected.json" '' + [ + { + "bindings": { + "up": "menu::SelectPrev" + } + }, + { + "bindings": { + "escape": "editor::Cancel" + }, + "context": "Editor" + } + ] + ''; + + keymapPath = ".config/zed/keymap.json"; + in '' + assertFileExists "home-files/${keymapPath}" + assertFileContent "home-files/${keymapPath}" "${expectedContent}" + ''; +} diff --git a/tests/modules/programs/zed-editor/settings.nix b/tests/modules/programs/zed-editor/settings.nix new file mode 100644 index 000000000000..701caab13b04 --- /dev/null +++ b/tests/modules/programs/zed-editor/settings.nix @@ -0,0 +1,36 @@ +# Test custom keymap functionality +{ config, ... }: + +{ + programs.zed-editor = { + enable = true; + package = config.lib.test.mkStubPackage { }; + userSettings = { + theme = "XY-Zed"; + features = { copilot = false; }; + vim_mode = false; + ui_font_size = 16; + buffer_font_size = 16; + }; + }; + + nmt.script = let + expectedContent = builtins.toFile "expected.json" '' + { + "auto_install_extensions": {}, + "buffer_font_size": 16, + "features": { + "copilot": false + }, + "theme": "XY-Zed", + "ui_font_size": 16, + "vim_mode": false + } + ''; + + settingsPath = ".config/zed/settings.json"; + in '' + assertFileExists "home-files/${settingsPath}" + assertFileContent "home-files/${settingsPath}" "${expectedContent}" + ''; +} From 1834304bc3849bfec635cab408e6090d536a549f Mon Sep 17 00:00:00 2001 From: K900 Date: Thu, 17 Oct 2024 22:10:39 +0300 Subject: [PATCH 517/636] direnv: simplify, work around nushell/nushell#14112 nushell 0.99 does not like early returns in hooks. So, what if we just didn't? Rewrite the entire hook to work as one single pipeline. --- modules/programs/direnv.nix | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index 4d4862afb886..228430c249e7 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -162,28 +162,20 @@ in { $env.config.hooks.pre_prompt? | default [] | append {|| - let direnv = ( - ${direnvWrapped} - | from json --strict - | default {} - ) - if ($direnv | is-empty) { - return - } - $direnv + ${direnvWrapped} + | from json --strict + | default {} | items {|key, value| - { - key: $key - value: (do ( - $env.ENV_CONVERSIONS? - | default {} - | get -i $key - | get -i from_string - | default {|x| $x} - ) $value) - } + let value = do ( + $env.ENV_CONVERSIONS? + | default {} + | get -i $key + | get -i from_string + | default {|x| $x} + ) $value + return [ $key $value ] } - | transpose -ird + | into record | load-env } ) From cb93ab1c990c5719ec199e8c397e688de06cb46d Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 18 Oct 2024 07:54:12 +0300 Subject: [PATCH 518/636] direnv: remove nushell hack --- modules/programs/direnv.nix | 31 +++-------------------- tests/modules/programs/direnv/nushell.nix | 2 +- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index 228430c249e7..6d0af3ac10d1 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -130,39 +130,16 @@ in { ${getExe cfg.package} hook fish | source ''); - programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration (let - # We want to get the stdout from direnv even if it exits with non-zero, - # because it will have the DIRENV_ internal variables defined. - # - # However, nushell's current implementation of try-catch is subtly - # broken with external commands in pipelines[0]. - # - # This means we don't have a good way to ignore the exit code - # without using do | complete, which has a side effect of also - # capturing stderr, which we don't want. - # - # So, as a workaround, we wrap nushell in a second script that - # just ignores the exit code and does nothing else, allowing - # nushell to capture our stdout, but letting stderr go through - # and not causing a spurious "command failed" message. - # - # [0]: https://github.com/nushell/nushell/issues/13868 - # - # FIXME: remove the wrapper once the upstream issue is fixed - - direnvWrapped = pkgs.writeShellScript "direnv-wrapped" '' - ${getExe cfg.package} export json || true - ''; - # Using mkAfter to make it more likely to appear after other - # manipulations of the prompt. - in mkAfter '' + # Using mkAfter to make it more likely to appear after other + # manipulations of the prompt. + programs.nushell.extraConfig = mkIf cfg.enableNushellIntegration (mkAfter '' $env.config = ($env.config? | default {}) $env.config.hooks = ($env.config.hooks? | default {}) $env.config.hooks.pre_prompt = ( $env.config.hooks.pre_prompt? | default [] | append {|| - ${direnvWrapped} + ${getExe cfg.package} export json | from json --strict | default {} | items {|key, value| diff --git a/tests/modules/programs/direnv/nushell.nix b/tests/modules/programs/direnv/nushell.nix index 86293e1d7760..502b325d5ed4 100644 --- a/tests/modules/programs/direnv/nushell.nix +++ b/tests/modules/programs/direnv/nushell.nix @@ -13,6 +13,6 @@ "home-files/.config/nushell/config.nu"; in '' assertFileExists "${configFile}" - assertFileRegex "${configFile}" '/nix/store/.*direnv-wrapped' + assertFileRegex "${configFile}" '/nix/store/.*direnv.*/bin/direnv export json' ''; } From d4a3186de0eeb37d1e43ed65791b0af677e440a1 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 17 Oct 2024 09:19:51 -0500 Subject: [PATCH 519/636] firefox: conditional search file --- modules/programs/firefox/mkFirefoxModule.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index dd4920666396..f7403e59ae5f 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -777,11 +777,12 @@ in { force = profile.containersForce; }; - "${profilesPath}/${profile.path}/search.json.mozlz4" = { - enable = profile.search.enable; - force = profile.search.force; - source = profile.search.file; - }; + "${profilesPath}/${profile.path}/search.json.mozlz4" = + mkIf (profile.search.enable) { + enable = profile.search.enable; + force = profile.search.force; + source = profile.search.file; + }; "${profilesPath}/${profile.path}/extensions" = mkIf (profile.extensions != [ ]) { From 2ffb68e20981d78bfcc73b2271f2dfa003df182c Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 17 Oct 2024 09:29:42 -0500 Subject: [PATCH 520/636] thunderbird: conditional search file --- modules/programs/thunderbird.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/programs/thunderbird.nix b/modules/programs/thunderbird.nix index a5ba0e63eca3..ad7a1360f9ba 100644 --- a/modules/programs/thunderbird.nix +++ b/modules/programs/thunderbird.nix @@ -408,11 +408,12 @@ in { profile.extraConfig; }; - "${thunderbirdProfilesPath}/${name}/search.json.mozlz4" = { - enable = profile.search.enable; - force = profile.search.force; - source = profile.search.file; - }; + "${thunderbirdProfilesPath}/${name}/search.json.mozlz4" = + mkIf (profile.search.enable) { + enable = profile.search.enable; + force = profile.search.force; + source = profile.search.file; + }; })); }; } From 346973b338365240090eded0de62f7edce4ce3d1 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 17 Oct 2024 10:03:51 -0500 Subject: [PATCH 521/636] tests/firefox: add shared path test Used to make sure that profiles that share a common generated path still build properly. --- tests/modules/programs/firefox/common.nix | 1 + .../programs/firefox/profiles/shared-path.nix | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 tests/modules/programs/firefox/profiles/shared-path.nix diff --git a/tests/modules/programs/firefox/common.nix b/tests/modules/programs/firefox/common.nix index 7d05382f1314..a3af6d4abf81 100644 --- a/tests/modules/programs/firefox/common.nix +++ b/tests/modules/programs/firefox/common.nix @@ -12,4 +12,5 @@ builtins.mapAttrs (test: module: import module [ "programs" name ]) { "${name}-profiles-search" = ./profiles/search; "${name}-profiles-settings" = ./profiles/settings; "${name}-state-version-19_09" = ./state-version-19_09.nix; + "${name}-profiles-shared-path" = ./profiles/shared-path.nix; } diff --git a/tests/modules/programs/firefox/profiles/shared-path.nix b/tests/modules/programs/firefox/profiles/shared-path.nix new file mode 100644 index 000000000000..e6d4a06d4c41 --- /dev/null +++ b/tests/modules/programs/firefox/profiles/shared-path.nix @@ -0,0 +1,53 @@ +modulePath: +{ config, lib, ... }: + +with lib; + +let firefoxMockOverlay = import ../setup-firefox-mock-overlay.nix modulePath; +in { + imports = [ firefoxMockOverlay ]; + + config = mkIf config.test.enableBig (setAttrByPath modulePath { + enable = true; + + profiles = { + main = { + isDefault = true; + id = 1; + bookmarks = [{ + toolbar = true; + bookmarks = [{ + name = "Home Manager"; + url = "https://wiki.nixos.org/wiki/Home_Manager"; + }]; + }]; + containers = { + "shopping" = { + icon = "circle"; + color = "yellow"; + }; + }; + search = { + force = true; + default = "Google"; + privateDefault = "DuckDuckGo"; + engines = { + "Bing".metaData.hidden = true; + "Google".metaData.alias = "@g"; + }; + }; + settings = { + "general.smoothScroll" = false; + "browser.newtabpage.pinned" = [{ + title = "NixOS"; + url = "https://nixos.org"; + }]; + }; + }; + "dev-edition-default" = { + id = 2; + path = "main"; + }; + }; + }); +} From 09a0c0c02953318bf94425738c7061ffdc4cba75 Mon Sep 17 00:00:00 2001 From: joygnu Date: Thu, 10 Oct 2024 00:08:02 +0200 Subject: [PATCH 522/636] cmus: add module PR #5951 --- modules/lib/maintainers.nix | 6 ++++ modules/misc/news.nix | 9 +++++ modules/modules.nix | 1 + modules/programs/cmus.nix | 44 +++++++++++++++++++++++++ tests/default.nix | 1 + tests/modules/programs/cmus/cmus.nix | 20 +++++++++++ tests/modules/programs/cmus/default.nix | 1 + 7 files changed, 82 insertions(+) create mode 100644 modules/programs/cmus.nix create mode 100644 tests/modules/programs/cmus/cmus.nix create mode 100644 tests/modules/programs/cmus/default.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 5916024b00eb..ce88b1cf0f56 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -604,6 +604,12 @@ github = "zorrobert"; githubId = 118135271; }; + joygnu = { + name = "joygnu"; + email = "contact@joygnu.org"; + github = "joygnu"; + githubId = 152063003; + }; callumio = { name = "Callum Leslie"; email = "git+nix@cleslie.uk"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index bf5e4be7603e..6c1b9b89b421 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1780,6 +1780,15 @@ in { See https://zed.dev for more. ''; } + + { + time = "2024-10-18T14:01:07+00:00"; + message = '' + A new module is available: 'programs.cmus'. + + cmus is a small, fast and powerful console music player. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index b2b98e2312a2..133a0dffff84 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -77,6 +77,7 @@ let ./programs/carapace.nix ./programs/cava.nix ./programs/chromium.nix + ./programs/cmus.nix ./programs/command-not-found/command-not-found.nix ./programs/comodoro.nix ./programs/darcs.nix diff --git a/modules/programs/cmus.nix b/modules/programs/cmus.nix new file mode 100644 index 000000000000..ac3e46ee1251 --- /dev/null +++ b/modules/programs/cmus.nix @@ -0,0 +1,44 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + + cfg = config.programs.cmus; + +in { + meta.maintainers = [ hm.maintainers.joygnu ]; + + options.programs.cmus = { + enable = mkEnableOption "Enable cmus, the music player."; + + theme = mkOption { + type = types.lines; + default = ""; + example = "gruvbox"; + description = '' + Select color theme. A list of available color themes can be found + here: . + ''; + }; + + extraConfig = mkOption { + type = types.lines; + default = ""; + example = '' + set audio_backend = "mpd" + set status_display = "default" + ''; + description = "Extra configuration to add to cmus {file}`rc`."; + }; + }; + + config = mkIf cfg.enable { + home.packages = [ pkgs.cmus ]; + + home.file.".config/cmus/rc".text = '' + ${optionalString (cfg.theme != "") "colorscheme ${cfg.theme}"} + ${cfg.extraConfig} + ''; + }; +} diff --git a/tests/default.nix b/tests/default.nix index 9e431e473ab0..f4b03275b7d7 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -67,6 +67,7 @@ in import nmtSrc { ./modules/programs/btop ./modules/programs/carapace ./modules/programs/cava + ./modules/programs/cmus ./modules/programs/comodoro ./modules/programs/darcs ./modules/programs/dircolors diff --git a/tests/modules/programs/cmus/cmus.nix b/tests/modules/programs/cmus/cmus.nix new file mode 100644 index 000000000000..8d1bbbd3a6f7 --- /dev/null +++ b/tests/modules/programs/cmus/cmus.nix @@ -0,0 +1,20 @@ +{ ... }: + +{ + programs.cmus = { + enable = true; + theme = "gruvbox"; + extraConfig = "test"; + }; + + nmt.script = '' + assertFileContent \ + home-files/.config/cmus/rc \ + ${ + builtins.toFile "cmus-expected-rc" '' + colorscheme gruvbox + test + '' + } + ''; +} diff --git a/tests/modules/programs/cmus/default.nix b/tests/modules/programs/cmus/default.nix new file mode 100644 index 000000000000..1b606bab3fb5 --- /dev/null +++ b/tests/modules/programs/cmus/default.nix @@ -0,0 +1 @@ +{ cmus = ./cmus.nix; } From 802b3cb2d45ad66619ea8ad19b280baa460556d2 Mon Sep 17 00:00:00 2001 From: Muhammad Talal Anwar Date: Sat, 19 Oct 2024 09:01:11 +0200 Subject: [PATCH 523/636] espanso: use `launcher` command on Linux The source uses `launcher` instead of `daemon`. Additionally we remove `Type` and add `RestartSec` as defined in the source: https://github.com/espanso/espanso/blob/b421bcf73fa13506938d62425459d6c16c6a8d0a/espanso/src/res/linux/systemd.service#L5-L7C1 --- modules/services/espanso.nix | 4 ++-- tests/modules/services/espanso/basic-configuration.service | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/services/espanso.nix b/modules/services/espanso.nix index f6e27e7965be..dbfa0587556a 100644 --- a/modules/services/espanso.nix +++ b/modules/services/espanso.nix @@ -121,9 +121,9 @@ in { systemd.user.services.espanso = { Unit = { Description = "Espanso: cross platform text expander in Rust"; }; Service = { - Type = "exec"; - ExecStart = "${cfg.package}/bin/espanso daemon"; + ExecStart = "${cfg.package}/bin/espanso launcher"; Restart = "on-failure"; + RestartSec = 3; }; Install = { WantedBy = [ "default.target" ]; }; }; diff --git a/tests/modules/services/espanso/basic-configuration.service b/tests/modules/services/espanso/basic-configuration.service index 593196e5952c..2c07465a090a 100644 --- a/tests/modules/services/espanso/basic-configuration.service +++ b/tests/modules/services/espanso/basic-configuration.service @@ -2,9 +2,9 @@ WantedBy=default.target [Service] -ExecStart=@espanso@/bin/espanso daemon +ExecStart=@espanso@/bin/espanso launcher Restart=on-failure -Type=exec +RestartSec=3 [Unit] Description=Espanso: cross platform text expander in Rust From 122f70545b29ccb922e655b08acfe05bfb44ec68 Mon Sep 17 00:00:00 2001 From: Scharada Date: Fri, 18 Oct 2024 21:24:18 +0200 Subject: [PATCH 524/636] firefox: change container.json version to 5 --- modules/programs/firefox/mkFirefoxModule.nix | 2 +- .../firefox/profiles/containers/expected-containers.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index f7403e59ae5f..8ef3f12d3bc7 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -101,7 +101,7 @@ let }; in '' ${builtins.toJSON { - version = 4; + version = 5; lastUserContextId = foldlAttrs (acc: _: value: if value.id > acc then value.id else acc) 0 containers; diff --git a/tests/modules/programs/firefox/profiles/containers/expected-containers.json b/tests/modules/programs/firefox/profiles/containers/expected-containers.json index d957b0c50947..28d8143d071a 100644 --- a/tests/modules/programs/firefox/profiles/containers/expected-containers.json +++ b/tests/modules/programs/firefox/profiles/containers/expected-containers.json @@ -1 +1 @@ -{"identities":[{"color":"yellow","icon":"circle","name":"shopping","public":true,"userContextId":0},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.thumbnail","public":false,"userContextId":4294967294},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.webextStorageLocal","public":false,"userContextId":4294967295}],"lastUserContextId":0,"version":4} +{"identities":[{"color":"yellow","icon":"circle","name":"shopping","public":true,"userContextId":0},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.thumbnail","public":false,"userContextId":4294967294},{"accessKey":"","color":"","icon":"","name":"userContextIdInternal.webextStorageLocal","public":false,"userContextId":4294967295}],"lastUserContextId":0,"version":5} From 892a6443b7676207490c83d181367ba3abcb1f23 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:07:08 +0530 Subject: [PATCH 525/636] nh: add module --- modules/misc/news.nix | 12 ++++++ modules/modules.nix | 1 + modules/programs/nh.nix | 94 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 107 insertions(+) create mode 100644 modules/programs/nh.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 6c1b9b89b421..8f9a77cfadf6 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1789,6 +1789,18 @@ in { cmus is a small, fast and powerful console music player. ''; } + + { + time = "2024-10-20T07:53:54+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'programs.nh'. + + nh is yet another Nix CLI helper. Adding functionality on top of the + existing solutions, like nixos-rebuild, home-manager cli or nix + itself. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 133a0dffff84..ba8414721305 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -172,6 +172,7 @@ let ./programs/neovide.nix ./programs/neovim.nix ./programs/newsboat.nix + ./programs/nh.nix ./programs/nheko.nix ./programs/nix-index.nix ./programs/nnn.nix diff --git a/modules/programs/nh.nix b/modules/programs/nh.nix new file mode 100644 index 000000000000..a5e8dcfafa0c --- /dev/null +++ b/modules/programs/nh.nix @@ -0,0 +1,94 @@ +{ config, osConfig, lib, pkgs, ... }: + +let + + cfg = config.programs.nh; + +in { + meta.maintainers = with lib.maintainers; [ johnrtitor ]; + + options.programs.nh = { + enable = lib.mkEnableOption "nh, yet another Nix CLI helper"; + + package = lib.mkPackageOption pkgs "nh" { }; + + flake = lib.mkOption { + type = lib.types.nullOr lib.types.path; + default = null; + description = '' + The path that will be used for the {env}`FLAKE` environment variable. + + {env}`FLAKE` is used by nh as the default flake for performing actions, + like {command}`nh os switch`. + ''; + }; + + clean = { + enable = lib.mkEnableOption '' + periodic garbage collection for user profile and nix store with nh clean + user''; + + dates = lib.mkOption { + type = lib.types.singleLineStr; + default = "weekly"; + description = '' + How often cleanup is performed. + + The format is described in {manpage}`systemd.time(7)`. + ''; + }; + + extraArgs = lib.mkOption { + type = lib.types.singleLineStr; + default = ""; + example = "--keep 5 --keep-since 3d"; + description = '' + Options given to nh clean when the service is run automatically. + + See `nh clean all --help` for more information. + ''; + }; + }; + }; + + config = { + warnings = lib.optionals (!(cfg.clean.enable -> !osConfig.nix.gc.automatic)) + [ + "programs.nh.clean.enable and nix.gc.automatic (system-wide in configuration.nix) are both enabled. Please use one or the other to avoid conflict." + ]; + + assertions = [{ + assertion = (cfg.flake != null) -> !(lib.hasSuffix ".nix" cfg.flake); + message = "nh.flake must be a directory, not a nix file"; + }]; + + home = lib.mkIf cfg.enable { + packages = [ cfg.package ]; + sessionVariables = lib.mkIf (cfg.flake != null) { FLAKE = cfg.flake; }; + }; + + systemd.user = lib.mkIf cfg.clean.enable { + services.nh-clean = { + Unit.Description = "Nh clean (user)"; + + Service = { + Type = "oneshot"; + ExecStart = + "exec ${lib.getExe cfg.package} clean user ${cfg.clean.extraArgs}"; + Environment = "PATH=$PATH:${config.nix.package}"; + }; + }; + + timers.nh-clean = { + Unit.Description = "Run nh clean"; + + Timer = { + OnCalendar = cfg.clean.dates; + Persistent = true; + }; + + Install.WantedBy = [ "timers.target" ]; + }; + }; + }; +} From fe56302339bb28e3471632379d733547caec8103 Mon Sep 17 00:00:00 2001 From: Talha Can Havadar Date: Fri, 11 Oct 2024 21:19:14 +0000 Subject: [PATCH 526/636] zoxide: fix fzf bash-completion conflict When zoxide initializes after fzf it causes fzf " ** " trigger to not work. To fix the issue we needed to make zoxide initialize earlier than fzf but after bash-completion. PR #5955 --- modules/programs/zoxide.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/zoxide.nix b/modules/programs/zoxide.nix index cab75cecfff2..f5e258af9aa3 100644 --- a/modules/programs/zoxide.nix +++ b/modules/programs/zoxide.nix @@ -68,9 +68,9 @@ in { config = mkIf cfg.enable { home.packages = [ cfg.package ]; - programs.bash.initExtra = mkIf cfg.enableBashIntegration '' + programs.bash.initExtra = mkIf cfg.enableBashIntegration (mkOrder 150 '' eval "$(${cfg.package}/bin/zoxide init bash ${cfgOptions})" - ''; + ''); programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' eval "$(${cfg.package}/bin/zoxide init zsh ${cfgOptions})" From 1e27f213d77fc842603628bcf2df6681d7d08f7e Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 20 Oct 2024 23:21:28 +0200 Subject: [PATCH 527/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c?narHash=sha256-nsNdSldaAyu6PE3YUA%2BYQLqUDJh%2BgRbBooMMekZJwvI%3D' (2024-10-14) → 'github:NixOS/nixpkgs/4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0?narHash=sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c%2BcHUJwA%3D' (2024-10-18) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 6837fdba2c3a..d052ebff2c35 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1728888510, - "narHash": "sha256-nsNdSldaAyu6PE3YUA+YQLqUDJh+gRbBooMMekZJwvI=", + "lastModified": 1729256560, + "narHash": "sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c+cHUJwA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "a3c0b3b21515f74fd2665903d4ce6bc4dc81c77c", + "rev": "4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0", "type": "github" }, "original": { From 5ec753a1fc4454df9285d8b3ec0809234defb975 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Mon, 21 Oct 2024 17:58:46 -0500 Subject: [PATCH 528/636] modules/neovim: fix config generation (#5976) --- modules/programs/neovim.nix | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/modules/programs/neovim.nix b/modules/programs/neovim.nix index 8632a7ec8916..e8be25f9219b 100644 --- a/modules/programs/neovim.nix +++ b/modules/programs/neovim.nix @@ -398,6 +398,13 @@ in { customRC = cfg.extraConfig; }; + wrappedNeovim' = pkgs.wrapNeovimUnstable cfg.package (neovimConfig // { + wrapperArgs = + (lib.escapeShellArgs (neovimConfig.wrapperArgs ++ cfg.extraWrapperArgs)) + + " " + extraMakeWrapperArgs + " " + extraMakeWrapperLuaCArgs + " " + + extraMakeWrapperLuaArgs; + wrapRc = false; + }); in mkIf cfg.enable { programs.neovim.generatedConfigViml = neovimConfig.neovimRcContent; @@ -422,11 +429,10 @@ in { # writes runtime (map (x: x.runtime) pluginsNormalized) ++ [{ "nvim/init.lua" = let - luaRcContent = - lib.optionalString (neovimConfig.neovimRcContent != "") + luaRcContent = lib.optionalString (wrappedNeovim'.initRc != "") "vim.cmd [[source ${ pkgs.writeText "nvim-init-home-manager.vim" - neovimConfig.neovimRcContent + wrappedNeovim'.initRc }]]" + config.programs.neovim.extraLuaConfig + lib.optionalString hasLuaConfig config.programs.neovim.generatedConfigs.lua; @@ -437,13 +443,6 @@ in { }; }]); - programs.neovim.finalPackage = pkgs.wrapNeovimUnstable cfg.package - (neovimConfig // { - wrapperArgs = (lib.escapeShellArgs - (neovimConfig.wrapperArgs ++ cfg.extraWrapperArgs)) + " " - + extraMakeWrapperArgs + " " + extraMakeWrapperLuaCArgs + " " - + extraMakeWrapperLuaArgs; - wrapRc = false; - }); + programs.neovim.finalPackage = wrappedNeovim'; }; } From 5765fe4feb78092cf3cbe2aa5cd523513eea7769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 23 Oct 2024 22:55:42 +0200 Subject: [PATCH 529/636] accounts/calendar: fix defaultText rendering --- modules/accounts/calendar.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/accounts/calendar.nix b/modules/accounts/calendar.nix index bfbc3e124fed..86f1b38c5dde 100644 --- a/modules/accounts/calendar.nix +++ b/modules/accounts/calendar.nix @@ -12,7 +12,8 @@ let path = mkOption { type = types.str; default = "${cfg.basePath}/${name}"; - defaultText = "‹accounts.calendar.basePath›/‹name›"; + defaultText = + lib.literalExpression "‹accounts.calendar.basePath›/‹name›"; description = "The path of the storage."; }; From a4353cc43d1b4dd6bdeacea90eb92a8b7b78a9d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Wed, 23 Oct 2024 22:55:53 +0200 Subject: [PATCH 530/636] accounts/contacts: fix defaultText rendering --- modules/accounts/contacts.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/accounts/contacts.nix b/modules/accounts/contacts.nix index 272594b189be..d00f5d0711bf 100644 --- a/modules/accounts/contacts.nix +++ b/modules/accounts/contacts.nix @@ -12,7 +12,8 @@ let path = mkOption { type = types.str; default = "${cfg.basePath}/${name}"; - defaultText = "‹accounts.contact.basePath›/‹name›"; + defaultText = + lib.literalExpression "‹accounts.contact.basePath›/‹name›"; description = "The path of the storage."; }; From 0a0b1b18bdd16d3f810178c7aec9eca730699631 Mon Sep 17 00:00:00 2001 From: Omer Naveed Date: Thu, 24 Oct 2024 23:41:24 -0500 Subject: [PATCH 531/636] maintainers: remove omernaveedxyz --- modules/lib/maintainers.nix | 6 ------ modules/programs/bemenu.nix | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index ce88b1cf0f56..6b7dc8b42da6 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -432,12 +432,6 @@ github = "nurelin"; githubId = 5276274; }; - omernaveedxyz = { - name = "Omer Naveed"; - email = "omer@omernaveed.dev"; - github = "omernaveedxyz"; - githubId = 112912585; - }; otavio = { email = "otavio.salvador@ossystems.com.br"; github = "otavio"; diff --git a/modules/programs/bemenu.nix b/modules/programs/bemenu.nix index 58d24dcc2cab..f90067216f56 100644 --- a/modules/programs/bemenu.nix +++ b/modules/programs/bemenu.nix @@ -7,7 +7,7 @@ let cfg = config.programs.bemenu; in { - meta.maintainers = [ hm.maintainers.omernaveedxyz ]; + meta.maintainers = [ ]; options.programs.bemenu = { enable = mkEnableOption "bemenu"; From 454e8d6b15aafb02fd22bba0edc4cc0b06dd0f41 Mon Sep 17 00:00:00 2001 From: Willi Carlsen Date: Wed, 23 Oct 2024 14:07:07 +0200 Subject: [PATCH 532/636] granted: use assume directly The `.assume-wrapped` path is not available since the merge of https://github.com/NixOS/nixpkgs/pull/347816 Use assume directly instead. PR #5994 --- modules/programs/granted.nix | 2 +- tests/modules/programs/granted/integration-disabled.nix | 2 +- tests/modules/programs/granted/integration-enabled.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/programs/granted.nix b/modules/programs/granted.nix index a091692509f8..93cdb97df21c 100644 --- a/modules/programs/granted.nix +++ b/modules/programs/granted.nix @@ -28,7 +28,7 @@ in { programs.zsh.initExtra = mkIf cfg.enableZshIntegration '' function assume() { export GRANTED_ALIAS_CONFIGURED="true" - source ${package}/bin/.assume-wrapped "$@" + source ${package}/bin/assume "$@" unset GRANTED_ALIAS_CONFIGURED } ''; diff --git a/tests/modules/programs/granted/integration-disabled.nix b/tests/modules/programs/granted/integration-disabled.nix index 6e43b4777bba..90f8d494a9a2 100644 --- a/tests/modules/programs/granted/integration-disabled.nix +++ b/tests/modules/programs/granted/integration-disabled.nix @@ -19,7 +19,7 @@ 'export GRANTED_ALIAS_CONFIGURED="true"' assertFileNotRegex \ home-files/.zshrc \ - 'source @granted@/bin/.assume-wrapped "$@"' + 'source @granted@/bin/assume "$@"' assertFileNotRegex \ home-files/.zshrc \ 'unset GRANTED_ALIAS_CONFIGURED' diff --git a/tests/modules/programs/granted/integration-enabled.nix b/tests/modules/programs/granted/integration-enabled.nix index daf843676508..5bb903aaef06 100644 --- a/tests/modules/programs/granted/integration-enabled.nix +++ b/tests/modules/programs/granted/integration-enabled.nix @@ -18,7 +18,7 @@ 'export GRANTED_ALIAS_CONFIGURED="true"' assertFileContains \ home-files/.zshrc \ - 'source @granted@/bin/.assume-wrapped "$@"' + 'source @granted@/bin/assume "$@"' assertFileContains \ home-files/.zshrc \ 'unset GRANTED_ALIAS_CONFIGURED' From eea1bc607249f0b79fb437b5e9709aa6d2218bac Mon Sep 17 00:00:00 2001 From: DrymarchonShaun <40149778+DrymarchonShaun@users.noreply.github.com> Date: Thu, 24 Oct 2024 15:15:43 -0700 Subject: [PATCH 533/636] gpg-agent: use $TTY parameter in zsh integration --- modules/services/gpg-agent.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/services/gpg-agent.nix b/modules/services/gpg-agent.nix index 7af58c8df500..8bfe68aae3ec 100644 --- a/modules/services/gpg-agent.nix +++ b/modules/services/gpg-agent.nix @@ -18,6 +18,10 @@ let export GPG_TTY '' + optionalString cfg.enableSshSupport gpgSshSupportStr; + gpgZshInitStr = '' + export GPG_TTY=$TTY + '' + optionalString cfg.enableSshSupport gpgSshSupportStr; + gpgFishInitStr = '' set -gx GPG_TTY (tty) '' + optionalString cfg.enableSshSupport gpgSshSupportStr; @@ -287,7 +291,7 @@ in { ''; programs.bash.initExtra = mkIf cfg.enableBashIntegration gpgInitStr; - programs.zsh.initExtra = mkIf cfg.enableZshIntegration gpgInitStr; + programs.zsh.initExtra = mkIf cfg.enableZshIntegration gpgZshInitStr; programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration gpgFishInitStr; From c7cfdb386430b01fd9748139a0e9cfa40e36c265 Mon Sep 17 00:00:00 2001 From: diniamo Date: Sun, 29 Sep 2024 14:55:46 +0200 Subject: [PATCH 534/636] spotify-player: add support for actions Actions were added in the v0.19.1 release. --- modules/programs/spotify-player.nix | 44 ++++++++++++++++--- .../programs/spotify-player/keymap.toml | 13 ++++++ .../programs/spotify-player/settings.nix | 16 +++++++ 3 files changed, 66 insertions(+), 7 deletions(-) diff --git a/modules/programs/spotify-player.nix b/modules/programs/spotify-player.nix index 83eefe12d2f6..35d3933bc6c7 100644 --- a/modules/programs/spotify-player.nix +++ b/modules/programs/spotify-player.nix @@ -1,12 +1,12 @@ { config, lib, pkgs, ... }: let - inherit (lib) - mkEnableOption mkPackageOption mkOption types literalExpression mkIf; + inherit (lib) mkEnableOption mkPackageOption mkOption literalExpression mkIf; + inherit (lib.types) listOf; cfg = config.programs.spotify-player; tomlFormat = pkgs.formats.toml { }; - + tomlType = tomlFormat.type; in { meta.maintainers = with lib.hm.maintainers; [ diniamo ]; @@ -16,7 +16,7 @@ in { package = mkPackageOption pkgs "spotify-player" { }; settings = mkOption { - type = tomlFormat.type; + type = tomlType; default = { }; example = literalExpression '' { @@ -43,7 +43,7 @@ in { }; themes = mkOption { - type = types.listOf tomlFormat.type; + type = listOf tomlType; default = [ ]; example = literalExpression '' [ @@ -94,7 +94,7 @@ in { }; keymaps = mkOption { - type = types.listOf tomlFormat.type; + type = listOf tomlType; default = [ ]; example = literalExpression '' [ @@ -129,6 +129,36 @@ in { for the full list of options. ''; }; + + actions = mkOption { + type = listOf tomlType; + default = [ ]; + example = literalExpression '' + [ + { + action = "GoToArtist"; + key_sequence = "g A"; + } + { + action = "GoToAlbum"; + key_sequence = "g B"; + target = "PlayingTrack"; + } + { + action = "ToggleLiked"; + key_sequence = "C-l"; + } + ] + ''; + description = '' + Configuration written to the `actions` field of + {file}`$XDG_CONFIG_HOME/spotify-player/keymap.toml`. + + See + + for the full list of options. + ''; + }; }; config = mkIf cfg.enable { @@ -146,7 +176,7 @@ in { "spotify-player/keymap.toml" = mkIf (cfg.keymaps != [ ]) { source = tomlFormat.generate "spotify-player-keymap" { - inherit (cfg) keymaps; + inherit (cfg) keymaps actions; }; }; }; diff --git a/tests/modules/programs/spotify-player/keymap.toml b/tests/modules/programs/spotify-player/keymap.toml index d11c86e41fc6..29cac4781b99 100644 --- a/tests/modules/programs/spotify-player/keymap.toml +++ b/tests/modules/programs/spotify-player/keymap.toml @@ -1,3 +1,16 @@ +[[actions]] +action = "GoToArtist" +key_sequence = "g A" + +[[actions]] +action = "GoToAlbum" +key_sequence = "g B" +target = "PlayingTrack" + +[[actions]] +action = "ToggleLiked" +key_sequence = "C-l" + [[keymaps]] command = "NextTrack" key_sequence = "g n" diff --git a/tests/modules/programs/spotify-player/settings.nix b/tests/modules/programs/spotify-player/settings.nix index dc7fe8c6af1b..e0442360b990 100644 --- a/tests/modules/programs/spotify-player/settings.nix +++ b/tests/modules/programs/spotify-player/settings.nix @@ -87,6 +87,22 @@ key_sequence = "q"; } ]; + + actions = [ + { + action = "GoToArtist"; + key_sequence = "g A"; + } + { + action = "GoToAlbum"; + key_sequence = "g B"; + target = "PlayingTrack"; + } + { + action = "ToggleLiked"; + key_sequence = "C-l"; + } + ]; }; test.stubs.spotify-player = { }; From 82378b3f7f8c12ecfab8539df780e495e6ba4cb6 Mon Sep 17 00:00:00 2001 From: Luflosi Date: Fri, 21 Jun 2024 17:30:18 +0200 Subject: [PATCH 535/636] htop: use attrsOf instead of attrs as settings type --- modules/programs/htop.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/programs/htop.nix b/modules/programs/htop.nix index 1c569c4049a5..b4004942ceee 100644 --- a/modules/programs/htop.nix +++ b/modules/programs/htop.nix @@ -113,7 +113,8 @@ in { enable = mkEnableOption "htop"; settings = mkOption { - type = types.attrs; + type = with types; + attrsOf (oneOf [ bool int str (listOf (oneOf [ int str ])) ]); default = { }; example = literalExpression '' { From 446293584f10d56b91368f500c022f7a93edbe2c Mon Sep 17 00:00:00 2001 From: Mel Bourgeois Date: Mon, 29 Apr 2024 19:37:24 -0500 Subject: [PATCH 536/636] nixgl: add module This module enables wrapping programs which require access to libGL with nixGL on non-NixOS systems. --- modules/misc/news.nix | 12 ++++++++ modules/misc/nixgl.nix | 64 ++++++++++++++++++++++++++++++++++++++++++ modules/modules.nix | 1 + 3 files changed, 77 insertions(+) create mode 100644 modules/misc/nixgl.nix diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 8f9a77cfadf6..801391cc2dc4 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1801,6 +1801,18 @@ in { itself. ''; } + + { + time = "2024-10-25T08:18:30+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'nixGL'. + + NixGL solve the "OpenGL" problem with nix. The 'nixGL' module provides + integration of NixGL into Home Manager. See the "GPU on non-NixOS + systems" section in the Home Manager mantual for more. + ''; + } ]; }; } diff --git a/modules/misc/nixgl.nix b/modules/misc/nixgl.nix new file mode 100644 index 000000000000..b6cff7cc07d4 --- /dev/null +++ b/modules/misc/nixgl.nix @@ -0,0 +1,64 @@ +{ config, lib, pkgs, ... }: + +let cfg = config.nixGL; +in { + meta.maintainers = [ lib.maintainers.smona ]; + + options.nixGL.prefix = lib.mkOption { + type = lib.types.str; + default = ""; + example = lib.literalExpression + ''"''${inputs.nixGL.packages.x86_64-linux.nixGLIntel}/bin/nixGLIntel"''; + description = '' + The nixGL command that `lib.nixGL.wrap` should wrap packages with. + This can be used to provide libGL access to applications on non-NixOS systems. + + Some packages are wrapped by default (e.g. kitty, firefox), but you can wrap other packages + as well, with `(config.lib.nixGL.wrap )`. If this option is empty (the default), + then `lib.nixGL.wrap` is a no-op. + ''; + }; + + config = { + lib.nixGL.wrap = # Wrap a single package with the configured nixGL wrapper + pkg: + + if cfg.prefix == "" then + pkg + else + # Wrap the package's binaries with nixGL, while preserving the rest of + # the outputs and derivation attributes. + (pkg.overrideAttrs (old: { + name = "nixGL-${pkg.name}"; + + # Make sure this is false for the wrapper derivation, so nix doesn't expect + # a new debug output to be produced. We won't be producing any debug info + # for the original package. + separateDebugInfo = false; + + buildCommand = '' + set -eo pipefail + + ${ + # Heavily inspired by https://stackoverflow.com/a/68523368/6259505 + pkgs.lib.concatStringsSep "\n" (map (outputName: '' + echo "Copying output ${outputName}" + set -x + cp -rs --no-preserve=mode "${ + pkg.${outputName} + }" "''$${outputName}" + set +x + '') (old.outputs or [ "out" ]))} + + rm -rf $out/bin/* + shopt -s nullglob # Prevent loop from running if no files + for file in ${pkg.out}/bin/*; do + echo "#!${pkgs.bash}/bin/bash" > "$out/bin/$(basename $file)" + echo "exec -a \"\$0\" ${cfg.prefix} $file \"\$@\"" >> "$out/bin/$(basename $file)" + chmod +x "$out/bin/$(basename $file)" + done + shopt -u nullglob # Revert nullglob back to its normal default state + ''; + })); + }; +} diff --git a/modules/modules.nix b/modules/modules.nix index ba8414721305..3b4985083270 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -31,6 +31,7 @@ let ./misc/gtk.nix ./misc/lib.nix ./misc/news.nix + ./misc/nixgl.nix ./misc/numlock.nix ./misc/pam.nix ./misc/qt.nix From bbd4254d00e8c69c4c958ddb51fb18637ca7f9b8 Mon Sep 17 00:00:00 2001 From: Mel Bourgeois Date: Wed, 19 Jun 2024 18:25:56 -0500 Subject: [PATCH 537/636] nixgl: make desktop files point to wrapped exe Some desktop files will refer to the absolute path of the original derivation, which would bypass nixGL wrapping. So we need to replace the path with the path to the wrapper derivation to ensure the wrapped version is always launched. --- modules/misc/nixgl.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/misc/nixgl.nix b/modules/misc/nixgl.nix index b6cff7cc07d4..16a00a7559ba 100644 --- a/modules/misc/nixgl.nix +++ b/modules/misc/nixgl.nix @@ -57,6 +57,17 @@ in { echo "exec -a \"\$0\" ${cfg.prefix} $file \"\$@\"" >> "$out/bin/$(basename $file)" chmod +x "$out/bin/$(basename $file)" done + + # If .desktop files refer to the old package, replace the references + for dsk in "$out/share/applications"/*.desktop ; do + if ! grep "${pkg.out}" "$dsk" > /dev/null; then + continue + fi + src="$(readlink "$dsk")" + rm "$dsk" + sed "s|${pkg.out}|$out|g" "$src" > "$dsk" + done + shopt -u nullglob # Revert nullglob back to its normal default state ''; })); From b9fe747915d95c3ea37539cccea67d3df39526a9 Mon Sep 17 00:00:00 2001 From: Mel Bourgeois Date: Wed, 19 Jun 2024 18:35:53 -0500 Subject: [PATCH 538/636] nixgl: use makeWrapper and update docs makeWrapper is more consistent with the rest of nixpkgs & home-manager, so it should be a little more maintainable. It can also validate that the wrapper command is executable at build time. --- modules/misc/nixgl.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/misc/nixgl.nix b/modules/misc/nixgl.nix index 16a00a7559ba..c84397fc5a15 100644 --- a/modules/misc/nixgl.nix +++ b/modules/misc/nixgl.nix @@ -13,9 +13,9 @@ in { The nixGL command that `lib.nixGL.wrap` should wrap packages with. This can be used to provide libGL access to applications on non-NixOS systems. - Some packages are wrapped by default (e.g. kitty, firefox), but you can wrap other packages - as well, with `(config.lib.nixGL.wrap )`. If this option is empty (the default), - then `lib.nixGL.wrap` is a no-op. + Wrap individual packages like so: `(config.lib.nixGL.wrap )`. The returned package + can be used just like the original one, but will have access to libGL. If this option is empty (the default), + then `lib.nixGL.wrap` is a no-op. This is useful on NixOS, where the wrappers are unnecessary. ''; }; @@ -53,9 +53,12 @@ in { rm -rf $out/bin/* shopt -s nullglob # Prevent loop from running if no files for file in ${pkg.out}/bin/*; do - echo "#!${pkgs.bash}/bin/bash" > "$out/bin/$(basename $file)" - echo "exec -a \"\$0\" ${cfg.prefix} $file \"\$@\"" >> "$out/bin/$(basename $file)" - chmod +x "$out/bin/$(basename $file)" + local prog="$(basename "$file")" + makeWrapper \ + "${cfg.prefix}" \ + "$out/bin/$prog" \ + --argv0 "$prog" \ + --add-flags "$file" done # If .desktop files refer to the old package, replace the references From 199cf5634c2ed39fceae0da3b1d0a76f7d47e1b1 Mon Sep 17 00:00:00 2001 From: Mel Bourgeois Date: Wed, 26 Jun 2024 21:14:08 -0500 Subject: [PATCH 539/636] nixgl: use -q to silence grep Co-authored-by: V. <150687949+vigress8@users.noreply.github.com> --- modules/misc/nixgl.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/misc/nixgl.nix b/modules/misc/nixgl.nix index c84397fc5a15..76b05296b7a3 100644 --- a/modules/misc/nixgl.nix +++ b/modules/misc/nixgl.nix @@ -63,7 +63,7 @@ in { # If .desktop files refer to the old package, replace the references for dsk in "$out/share/applications"/*.desktop ; do - if ! grep "${pkg.out}" "$dsk" > /dev/null; then + if ! grep -q "${pkg.out}" "$dsk"; then continue fi src="$(readlink "$dsk")" From d0c036ca4904701289e0a779253f241feeacbf40 Mon Sep 17 00:00:00 2001 From: Mel Bourgeois Date: Wed, 26 Jun 2024 21:16:22 -0500 Subject: [PATCH 540/636] nixgl: ensure makeWrapper is present during build Co-authored-by: V. <150687949+vigress8@users.noreply.github.com> --- modules/misc/nixgl.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/misc/nixgl.nix b/modules/misc/nixgl.nix index 76b05296b7a3..90bd1f3aa15d 100644 --- a/modules/misc/nixgl.nix +++ b/modules/misc/nixgl.nix @@ -35,7 +35,7 @@ in { # a new debug output to be produced. We won't be producing any debug info # for the original package. separateDebugInfo = false; - + nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.makeWrapper ]; buildCommand = '' set -eo pipefail From 7dee0dc8f0c7d4f174c481f36d04b9edadba3b7e Mon Sep 17 00:00:00 2001 From: Mel Bourgeois Date: Mon, 1 Jul 2024 15:42:10 -0500 Subject: [PATCH 541/636] nixgl: reference lib directly Co-authored-by: V. <150687949+vigress8@users.noreply.github.com> --- modules/misc/nixgl.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/misc/nixgl.nix b/modules/misc/nixgl.nix index 90bd1f3aa15d..ca674ff1379a 100644 --- a/modules/misc/nixgl.nix +++ b/modules/misc/nixgl.nix @@ -41,7 +41,7 @@ in { ${ # Heavily inspired by https://stackoverflow.com/a/68523368/6259505 - pkgs.lib.concatStringsSep "\n" (map (outputName: '' + lib.concatStringsSep "\n" (map (outputName: '' echo "Copying output ${outputName}" set -x cp -rs --no-preserve=mode "${ From e61f87969ae179139164c7fb5e0bb76b791144e5 Mon Sep 17 00:00:00 2001 From: Mel Bourgeois Date: Fri, 9 Aug 2024 19:40:33 -0500 Subject: [PATCH 542/636] nixgl: Improve option documentation --- modules/misc/nixgl.nix | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/modules/misc/nixgl.nix b/modules/misc/nixgl.nix index ca674ff1379a..47314b9c2cb7 100644 --- a/modules/misc/nixgl.nix +++ b/modules/misc/nixgl.nix @@ -10,12 +10,28 @@ in { example = lib.literalExpression ''"''${inputs.nixGL.packages.x86_64-linux.nixGLIntel}/bin/nixGLIntel"''; description = '' - The nixGL command that `lib.nixGL.wrap` should wrap packages with. - This can be used to provide libGL access to applications on non-NixOS systems. + The [nixGL](https://github.com/nix-community/nixGL) command that `lib.nixGL.wrap` should prefix + package binaries with. nixGL provides your system's version of libGL to applications, enabling + them to access the GPU on non-NixOS systems. - Wrap individual packages like so: `(config.lib.nixGL.wrap )`. The returned package - can be used just like the original one, but will have access to libGL. If this option is empty (the default), - then `lib.nixGL.wrap` is a no-op. This is useful on NixOS, where the wrappers are unnecessary. + Wrap individual packages which require GPU access with the function like so: `(config.lib.nixGL.wrap )`. + The returned package can be used just like the original one, but will have access to libGL. For example: + + ```nix + # If you're using a Home Manager module to configure the package, + # pass it into the module's package argument: + programs.kitty = { + enable = true; + package = (config.lib.nixGL.wrap pkgs.kitty); + }; + + # Otherwise, pass it to any option where a package is expected: + home.packages = [ (config.lib.nixGL.wrap pkgs.hello) ]; + ``` + + If this option is empty (the default), then `lib.nixGL.wrap` is a no-op. This is useful for sharing your Home Manager + configurations between NixOS and non-NixOS systems, since NixOS already provides libGL to applications without the + need for nixGL. ''; }; @@ -35,7 +51,8 @@ in { # a new debug output to be produced. We won't be producing any debug info # for the original package. separateDebugInfo = false; - nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.makeWrapper ]; + nativeBuildInputs = old.nativeBuildInputs or [ ] + ++ [ pkgs.makeWrapper ]; buildCommand = '' set -eo pipefail From 7a5879707bb49c350aee7ab270c917584d430193 Mon Sep 17 00:00:00 2001 From: Jure Varlec Date: Wed, 10 Jul 2024 10:51:32 +0200 Subject: [PATCH 543/636] nixgl: API rework for flexibility and dual-GPU --- docs/manual/usage.md | 1 + docs/manual/usage/gpu-non-nixos.md | 70 ++++++++ modules/misc/nixgl.nix | 260 ++++++++++++++++++++++++----- 3 files changed, 292 insertions(+), 39 deletions(-) create mode 100644 docs/manual/usage/gpu-non-nixos.md diff --git a/docs/manual/usage.md b/docs/manual/usage.md index 2a569aaf9b76..88e884546de9 100644 --- a/docs/manual/usage.md +++ b/docs/manual/usage.md @@ -59,5 +59,6 @@ usage/configuration.md usage/rollbacks.md usage/dotfiles.md usage/graphical.md +usage/gpu-non-nixos.md usage/updating.md ``` diff --git a/docs/manual/usage/gpu-non-nixos.md b/docs/manual/usage/gpu-non-nixos.md new file mode 100644 index 000000000000..7b7cfbaea6d4 --- /dev/null +++ b/docs/manual/usage/gpu-non-nixos.md @@ -0,0 +1,70 @@ +# GPU on non-NixOS systems {#sec-usage-gpu-non-nixos} + +To access the GPU, programs need access to OpenGL and Vulkan libraries. While +this works transparently on NixOS, it does not on other Linux systems. A +solution is provided by [NixGL](https://github.com/nix-community/nixGL), which +can be integrated into Home Manager. + +To enable the integration, import NixGL into your home configuration, either as +a channel, or as a flake input passed via `extraSpecialArgs`. Then, set the +`nixGL.packages` option to the package set provided by NixGL. + +Once integration is enabled, it can be used in two ways: as Nix functions for +wrapping programs installed via Home Manager, and as shell commands for running +programs installed by other means (such as `nix shell`). In either case, there +are several wrappers available. They can be broadly categorized + +- by vendor: as Mesa (for Free drivers of all vendors) and Nvidia (for + Nvidia-specific proprietary drivers). +- by GPU selection: as primary and secondary (offloading). + +For example, the `mesa` wrapper provides support for running programs on the +primary GPU for Intel, AMD and Nouveau drivers, while the `mesaPrime` wrapper +does the same for the secondary GPU. + +**Note:** when using Nvidia wrappers together with flakes, your home +configuration will not be pure and needs to be built using `home-manager switch +--impure`. Otherwise, the build will fail, complaining about missing attribute +`currentTime`. + +Wrapper functions are available under `config.lib.nixGL.wrappers`. However, it +can be more convenient to use the `config.lib.nixGL.wrap` alias, which can be +configured to use any of the wrappers. It is intended to provide a customization +point when the same home configuration is used across several machines with +different hardware. There is also the `config.lib.nixGL.wrapOffload` alias for +two-GPU systems. + +Another convenience is that all wrapper functions are always available. However, +when `nixGL.packages` option is unset, they are no-ops. This allows them to be +used even when the home configuration is used on NixOS machines. The exception +is the `prime-offload` script which ignores `nixGL.packages` and is installed +into the environment whenever `nixGL.prime.installScript` is set. This script, +which can be used to start a program on a secondary GPU, does not depend on +NixGL and is useful on NixOS systems as well. + +Below is an abbreviated example for an Optimus laptop that makes use of both +Mesa and Nvidia wrappers, where the latter is used in dGPU offloading mode. It +demonstrates how to wrap `mpv` to run on the integrated Intel GPU, wrap FreeCAD +to run on the Nvidia dGPU, and how to install the wrapper scripts. It also wraps +Xonotic to run on the dGPU, but uses the wrapper function directly for +demonstration purposes. + +```nix +{ config, lib, pkgs, nixGL, ... }: +{ + nixGL.packages = nixGL.packages; + nixGL.defaultWrapper = "mesa"; + nixGL.offloadWrapper = "nvidiaPrime"; + nixGL.installScripts = [ "mesa" "nvidiaPrime" ]; + + programs.mpv = { + enable = true; + package = config.lib.nixGL.wrap pkgs.mpv; + }; + + home.packages = [ + (config.lib.nixGL.wrapOffload pkgs.freecad) + (config.lib.nixGL.wrappers.nvidiaPrime pkgs.xonotic) + ]; +} +``` diff --git a/modules/misc/nixgl.nix b/modules/misc/nixgl.nix index 47314b9c2cb7..f45c483bcfef 100644 --- a/modules/misc/nixgl.nix +++ b/modules/misc/nixgl.nix @@ -1,45 +1,166 @@ { config, lib, pkgs, ... }: -let cfg = config.nixGL; +let + cfg = config.nixGL; + wrapperListMarkdown = with builtins; + foldl' (list: name: + list + '' + - ${name} + '') "" (attrNames config.lib.nixGL.wrappers); in { meta.maintainers = [ lib.maintainers.smona ]; - options.nixGL.prefix = lib.mkOption { - type = lib.types.str; - default = ""; - example = lib.literalExpression - ''"''${inputs.nixGL.packages.x86_64-linux.nixGLIntel}/bin/nixGLIntel"''; - description = '' - The [nixGL](https://github.com/nix-community/nixGL) command that `lib.nixGL.wrap` should prefix - package binaries with. nixGL provides your system's version of libGL to applications, enabling - them to access the GPU on non-NixOS systems. - - Wrap individual packages which require GPU access with the function like so: `(config.lib.nixGL.wrap )`. - The returned package can be used just like the original one, but will have access to libGL. For example: - - ```nix - # If you're using a Home Manager module to configure the package, - # pass it into the module's package argument: - programs.kitty = { - enable = true; - package = (config.lib.nixGL.wrap pkgs.kitty); - }; - - # Otherwise, pass it to any option where a package is expected: - home.packages = [ (config.lib.nixGL.wrap pkgs.hello) ]; - ``` - - If this option is empty (the default), then `lib.nixGL.wrap` is a no-op. This is useful for sharing your Home Manager - configurations between NixOS and non-NixOS systems, since NixOS already provides libGL to applications without the - need for nixGL. - ''; + options.nixGL = { + packages = lib.mkOption { + type = with lib.types; nullOr attrs; + default = null; + example = lib.literalExpression "inputs.nixGL.packages"; + description = '' + The nixGL package set containing GPU library wrappers. This can be used + to provide OpenGL and Vulkan access to applications on non-NixOS systems + by using `(config.lib.nixGL.wrap )` for the default wrapper, or + `(config.lib.nixGL.wrappers. )` for any available + wrapper. + + The wrapper functions are always available. If this option is empty (the + default), they are a no-op. This is useful on NixOS where the wrappers + are unnecessary. + + Note that using any Nvidia wrapper requires building the configuration + with the `--impure` option. + ''; + }; + + defaultWrapper = lib.mkOption { + type = lib.types.enum (builtins.attrNames config.lib.nixGL.wrappers); + default = "mesa"; + description = '' + The package wrapper function available for use as `(config.lib.nixGL.wrap + )`. Intended to start programs on the main GPU. + + Wrapper functions can be found under `config.lib.nixGL.wrappers`. They + can be used directly, however, setting this option provides a convenient + shorthand. + + The following wrappers are available: + ${wrapperListMarkdown} + ''; + }; + + offloadWrapper = lib.mkOption { + type = lib.types.enum (builtins.attrNames config.lib.nixGL.wrappers); + default = "mesaPrime"; + description = '' + The package wrapper function available for use as + `(config.lib.nixGL.wrapOffload )`. Intended to start programs + on the secondary GPU. + + Wrapper functions can be found under `config.lib.nixGL.wrappers`. They + can be used directly, however, setting this option provides a convenient + shorthand. + + The following wrappers are available: + ${wrapperListMarkdown} + ''; + }; + + prime.card = lib.mkOption { + type = lib.types.str; + default = "1"; + example = "pci-0000_06_00_0"; + description = '' + Selects the non-default graphics card used for PRIME render offloading. + The value can be: + + - a number, selecting the n-th non-default GPU; + - a PCI bus id in the form `pci-XXX_YY_ZZ_U`; + - a PCI id in the form `vendor_id:device_id` + + For more information, consult the Mesa documentation on the `DRI_PRIME` + environment variable. + ''; + }; + + prime.nvidiaProvider = lib.mkOption { + type = with lib.types; nullOr str; + default = null; + example = "NVIDIA-G0"; + description = '' + If this option is set, it overrides the offload provider for Nvidia + PRIME offloading. Consult the proprietary Nvidia driver documentation + on the `__NV_PRIME_RENDER_OFFLOAD_PROVIDER` environment variable. + ''; + }; + + prime.installScript = lib.mkOption { + type = with lib.types; nullOr (enum [ "mesa" "nvidia" ]); + default = null; + example = "mesa"; + description = '' + If this option is set, the wrapper script `prime-offload` is installed + into the environment. It allows starting programs on the secondary GPU + selected by the `nixGL.prime.card` option. This makes sense when the + program is not already using one of nixGL PRIME wrappers, or for + programs not installed from Nixpkgs. + + This option can be set to either "mesa" or "nvidia", making the script + use one or the other graphics library. + ''; + }; + + installScripts = lib.mkOption { + type = with lib.types; + nullOr (listOf (enum (builtins.attrNames config.lib.nixGL.wrappers))); + default = null; + example = [ "mesa" "mesaPrime" ]; + description = '' + For each wrapper `wrp` named in the provided list, a wrapper script + named `nixGLWrp` is installed into the environment. These scripts are + useful for running programs not installed via Home Manager. + + The following wrappers are available: + ${wrapperListMarkdown} + ''; + }; + + vulkan.enable = lib.mkOption { + type = lib.types.bool; + default = false; + example = true; + description = '' + Whether to enable Vulkan in nixGL wrappers. + + This is disabled by default bacause Vulkan brings in several libraries + that can cause symbol version conflicts in wrapped programs. Your + mileage may vary. + ''; + }; }; - config = { - lib.nixGL.wrap = # Wrap a single package with the configured nixGL wrapper - pkg: + config = let + getWrapperExe = vendor: + let + glPackage = cfg.packages.${pkgs.system}."nixGL${vendor}"; + glExe = lib.getExe glPackage; + vulkanPackage = cfg.packages.${pkgs.system}."nixVulkan${vendor}"; + vulkanExe = if cfg.vulkan.enable then lib.getExe vulkanPackage else ""; + in "${glExe} ${vulkanExe}"; + + mesaOffloadEnv = { "DRI_PRIME" = "${cfg.prime.card}"; }; + + nvOffloadEnv = { + "DRI_PRIME" = "${cfg.prime.card}"; + "__NV_PRIME_RENDER_OFFLOAD" = "1"; + "__GLX_VENDOR_LIBRARY_NAME" = "nvidia"; + "__VK_LAYER_NV_optimus" = "NVIDIA_only"; + } // (let provider = cfg.prime.nvidiaProvider; + in if !isNull provider then { + "__NV_PRIME_RENDER_OFFLOAD_PROVIDER" = "${provider}"; + } else + { }); - if cfg.prefix == "" then + makePackageWrapper = vendor: environment: pkg: + if builtins.isNull cfg.packages then pkg else # Wrap the package's binaries with nixGL, while preserving the rest of @@ -53,11 +174,17 @@ in { separateDebugInfo = false; nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.makeWrapper ]; - buildCommand = '' + buildCommand = let + # We need an intermediate wrapper package because makeWrapper + # requires a single executable as the wrapper. + combinedWrapperPkg = + pkgs.writeShellScriptBin "nixGLCombinedWrapper-${vendor}" '' + exec ${getWrapperExe vendor} "$@" + ''; + in '' set -eo pipefail - ${ - # Heavily inspired by https://stackoverflow.com/a/68523368/6259505 + ${ # Heavily inspired by https://stackoverflow.com/a/68523368/6259505 lib.concatStringsSep "\n" (map (outputName: '' echo "Copying output ${outputName}" set -x @@ -72,10 +199,14 @@ in { for file in ${pkg.out}/bin/*; do local prog="$(basename "$file")" makeWrapper \ - "${cfg.prefix}" \ + "${lib.getExe combinedWrapperPkg}" \ "$out/bin/$prog" \ --argv0 "$prog" \ - --add-flags "$file" + --add-flags "$file" \ + ${ + lib.concatStringsSep " " (lib.attrsets.mapAttrsToList + (var: val: "--set '${var}' '${val}'") environment) + } done # If .desktop files refer to the old package, replace the references @@ -91,5 +222,56 @@ in { shopt -u nullglob # Revert nullglob back to its normal default state ''; })); + + wrappers = { + mesa = makePackageWrapper "Intel" { }; + mesaPrime = makePackageWrapper "Intel" mesaOffloadEnv; + nvidia = makePackageWrapper "Nvidia" { }; + nvidiaPrime = makePackageWrapper "Nvidia" nvOffloadEnv; + }; + in { + lib.nixGL.wrap = wrappers.${cfg.defaultWrapper}; + lib.nixGL.wrapOffload = wrappers.${cfg.offloadWrapper}; + lib.nixGL.wrappers = wrappers; + + home.packages = let + wantsPrimeWrapper = (!isNull cfg.prime.installScript); + wantsWrapper = wrapper: + (!isNull cfg.packages) && (!isNull cfg.installScripts) + && (builtins.elem wrapper cfg.installScripts); + envVarsAsScript = environment: + lib.concatStringsSep "\n" + (lib.attrsets.mapAttrsToList (var: val: "export ${var}=${val}") + environment); + in [ + (lib.mkIf wantsPrimeWrapper (pkgs.writeShellScriptBin "prime-offload" '' + ${if cfg.prime.installScript == "mesa" then + (envVarsAsScript mesaOffloadEnv) + else + (envVarsAsScript nvOffloadEnv)} + exec "$@" + '')) + + (lib.mkIf (wantsWrapper "mesa") (pkgs.writeShellScriptBin "nixGLMesa" '' + exec ${getWrapperExe "Intel"} "$@" + '')) + + (lib.mkIf (wantsWrapper "mesaPrime") + (pkgs.writeShellScriptBin "nixGLMesaPrime" '' + ${envVarsAsScript mesaOffloadEnv} + exec ${getWrapperExe "Intel"} "$@" + '')) + + (lib.mkIf (wantsWrapper "nvidia") + (pkgs.writeShellScriptBin "nixGLNvidia" '' + exec ${getWrapperExe "Nvidia"} "$@" + '')) + + (lib.mkIf (wantsWrapper "nvidia") + (pkgs.writeShellScriptBin "nixGLNvidiaPrime" '' + ${envVarsAsScript nvOffloadEnv} + exec ${getWrapperExe "Nvidia"} "$@" + '')) + ]; }; } From 8bd6e0a1a805c373686e21678bb07f23293d357b Mon Sep 17 00:00:00 2001 From: Jure Varlec Date: Wed, 2 Oct 2024 20:19:53 +0200 Subject: [PATCH 544/636] nixgl: add support for channel-based configuration --- docs/manual/usage/gpu-non-nixos.md | 15 +++++++++++++-- modules/misc/nixgl.nix | 23 +++++++++++++++++++++-- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/docs/manual/usage/gpu-non-nixos.md b/docs/manual/usage/gpu-non-nixos.md index 7b7cfbaea6d4..0aefa4ae386f 100644 --- a/docs/manual/usage/gpu-non-nixos.md +++ b/docs/manual/usage/gpu-non-nixos.md @@ -50,9 +50,9 @@ Xonotic to run on the dGPU, but uses the wrapper function directly for demonstration purposes. ```nix -{ config, lib, pkgs, nixGL, ... }: +{ config, lib, pkgs, nixgl, ... }: { - nixGL.packages = nixGL.packages; + nixGL.packages = nixgl.packages; nixGL.defaultWrapper = "mesa"; nixGL.offloadWrapper = "nvidiaPrime"; nixGL.installScripts = [ "mesa" "nvidiaPrime" ]; @@ -68,3 +68,14 @@ demonstration purposes. ]; } ``` + +The above example assumes a flake-based setup where `nixgl` was passed from the +flake. When using channels, the example would instead begin with + +```nix +{ config, lib, pkgs, ... }: +{ + nixGL.packages = import { inherit pkgs; }; + # The rest is the same as above + ... +``` diff --git a/modules/misc/nixgl.nix b/modules/misc/nixgl.nix index f45c483bcfef..2c7fcaffc33a 100644 --- a/modules/misc/nixgl.nix +++ b/modules/misc/nixgl.nix @@ -138,11 +138,30 @@ in { }; config = let + findWrapperPackage = packageAttr: + # NixGL has wrapper packages in different places depending on how you + # access it. We want HM configuration to be the same, regardless of how + # NixGL is imported. + # + # First, let's see if we have a flake. + if builtins.hasAttr pkgs.system cfg.packages then + cfg.packages.${pkgs.system}.${packageAttr} + else + # Next, let's see if we have a channel. + if builtins.hasAttr packageAttr cfg.packages then + cfg.packages.${packageAttr} + else + # Lastly, with channels, some wrappers are grouped under "auto". + if builtins.hasAttr "auto" cfg.packages then + cfg.packages.auto.${packageAttr} + else + throw "Incompatible NixGL package layout"; + getWrapperExe = vendor: let - glPackage = cfg.packages.${pkgs.system}."nixGL${vendor}"; + glPackage = findWrapperPackage "nixGL${vendor}"; glExe = lib.getExe glPackage; - vulkanPackage = cfg.packages.${pkgs.system}."nixVulkan${vendor}"; + vulkanPackage = findWrapperPackage "nixVulkan${vendor}"; vulkanExe = if cfg.vulkan.enable then lib.getExe vulkanPackage else ""; in "${glExe} ${vulkanExe}"; From c77c3bb23390a9ba91860e721edde54856fc5f7a Mon Sep 17 00:00:00 2001 From: "Giovanni Nicosia (mood)" <74420740+no-mood@users.noreply.github.com> Date: Mon, 21 Oct 2024 19:04:00 +0200 Subject: [PATCH 545/636] yazi: enable shell integration values by default Previously, - `programs.yazi.enableNushellIntegration`, - `programs.yazi.enableFishIntegration`, and - `programs.yazi.enableZshIntegration` were set to false by default. It seems more appropriate to enable these integrations by default. --- modules/programs/yazi.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index d7b880200d62..0f5117dbd4f8 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -56,13 +56,21 @@ in { ''; }; - enableBashIntegration = mkEnableOption "Bash integration"; + enableBashIntegration = mkEnableOption "Bash integration" // { + default = true; + }; - enableZshIntegration = mkEnableOption "Zsh integration"; + enableZshIntegration = mkEnableOption "Zsh integration" // { + default = true; + }; - enableFishIntegration = mkEnableOption "Fish integration"; + enableFishIntegration = mkEnableOption "Fish integration" // { + default = true; + }; - enableNushellIntegration = mkEnableOption "Nushell integration"; + enableNushellIntegration = mkEnableOption "Nushell integration" // { + default = true; + }; keymap = mkOption { type = tomlFormat.type; From 6cc03e337aa1d0222e5942f58839d965075a9781 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Mon, 21 Oct 2024 10:29:57 +0000 Subject: [PATCH 546/636] nix-gc: add `randomizedDelaySec` option There's no launchd equivalent to this option, so this is a no-op on Darwin. --- modules/services/nix-gc.nix | 13 +++++++++++++ tests/modules/services/nix-gc/basic.nix | 1 + tests/modules/services/nix-gc/expected.timer | 1 + 3 files changed, 15 insertions(+) diff --git a/modules/services/nix-gc.nix b/modules/services/nix-gc.nix index 50e8b635113e..7789aeffbb47 100644 --- a/modules/services/nix-gc.nix +++ b/modules/services/nix-gc.nix @@ -81,6 +81,18 @@ in { ''; }; + randomizedDelaySec = lib.mkOption { + default = "0"; + type = lib.types.singleLineStr; + example = "45min"; + description = '' + Add a randomized delay before each garbage collection. + The delay will be chosen between zero and this value. + This value must be a time span in the format specified by + {manpage}`systemd.time(7)` + ''; + }; + options = mkOption { type = types.nullOr types.str; default = null; @@ -121,6 +133,7 @@ in { Unit = { Description = "Nix Garbage Collector"; }; Timer = { OnCalendar = "${cfg.frequency}"; + RandomizedDelaySec = cfg.randomizedDelaySec; Persistent = cfg.persistent; Unit = "nix-gc.service"; }; diff --git a/tests/modules/services/nix-gc/basic.nix b/tests/modules/services/nix-gc/basic.nix index a06b67238726..1fc019da7745 100644 --- a/tests/modules/services/nix-gc/basic.nix +++ b/tests/modules/services/nix-gc/basic.nix @@ -4,6 +4,7 @@ nix.gc = { automatic = true; frequency = "monthly"; + randomizedDelaySec = "42min"; options = "--delete-older-than 30d --max-freed $((64 * 1024**3))"; }; diff --git a/tests/modules/services/nix-gc/expected.timer b/tests/modules/services/nix-gc/expected.timer index ef30df4359dc..70232bb4706d 100644 --- a/tests/modules/services/nix-gc/expected.timer +++ b/tests/modules/services/nix-gc/expected.timer @@ -4,6 +4,7 @@ WantedBy=timers.target [Timer] OnCalendar=monthly Persistent=true +RandomizedDelaySec=42min Unit=nix-gc.service [Unit] From c0e23159872e2e2135c7eb5cf96cd36cfe6ee1f4 Mon Sep 17 00:00:00 2001 From: Tomo Date: Fri, 25 Oct 2024 06:56:37 -0700 Subject: [PATCH 547/636] git-credential-oauth: add extraFlags option This facilitates a legitimate use-case for browserless systems. From the README: > On systems without a web browser, set the -device flag to authenticate > on another device using [OAuth device flow]: > ```ini [credential] helper = cache --timeout 7200 # two hours helper = oauth -device ``` [OAuth device flow]: https://www.rfc-editor.org/rfc/rfc8628 Please note that, for the documentation about the man-page to be accurate, https://github.com/NixOS/nixpkgs/pull/302922 must be merged. --- modules/programs/git-credential-oauth.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/modules/programs/git-credential-oauth.nix b/modules/programs/git-credential-oauth.nix index 4833e80680d9..1f4b99247b48 100644 --- a/modules/programs/git-credential-oauth.nix +++ b/modules/programs/git-credential-oauth.nix @@ -12,13 +12,26 @@ in { enable = lib.mkEnableOption "Git authentication handler for OAuth"; package = lib.mkPackageOption pkgs "git-credential-oauth" { }; + + extraFlags = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + example = lib.literalExpression ''[ "-device" ]''; + description = '' + Extra command-line arguments passed to git-credential-oauth. + + For valid arguments, see {manpage}`git-credential-oauth(1)`. + ''; + }; }; }; config = lib.mkIf cfg.enable { home.packages = [ cfg.package ]; - programs.git.extraConfig.credential.helper = - [ "${cfg.package}/bin/git-credential-oauth" ]; + programs.git.extraConfig.credential.helper = [ + ("${cfg.package}/bin/git-credential-oauth" + lib.mkIf cfg.extraFlags + " ${lib.strings.concatStringsSep " " cfg.extraFlags}") + ]; }; } From 0c0268a3c80d30b989d0aadbd65f38d4fa27a9a0 Mon Sep 17 00:00:00 2001 From: nyadiia Date: Wed, 23 Oct 2024 16:35:08 -0500 Subject: [PATCH 548/636] eza: add color option --- modules/programs/eza.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/programs/eza.nix b/modules/programs/eza.nix index 679f534998ff..f35912b8c822 100644 --- a/modules/programs/eza.nix +++ b/modules/programs/eza.nix @@ -59,6 +59,14 @@ with lib; ''; }; + colors = mkOption { + type = types.enum [ null "auto" "always" "never" ]; + default = null; + description = '' + Use terminal colors in output ({option}`--color` argument). + ''; + }; + git = mkOption { type = types.bool; default = false; @@ -80,8 +88,9 @@ with lib; cfg.icons; in optionals (v != null) [ "--icons" v ]; - args = escapeShellArgs - (iconsOption ++ optional cfg.git "--git" ++ cfg.extraOptions); + args = escapeShellArgs (iconsOption + ++ optionals (cfg.colors != null) [ "--color" cfg.colors ] + ++ optional cfg.git "--git" ++ cfg.extraOptions); optionsAlias = optionalAttrs (args != "") { eza = "eza ${args}"; }; From 93435d27d250fa986bfec6b2ff263161ff8288cb Mon Sep 17 00:00:00 2001 From: William Phetsinorath Date: Fri, 25 Oct 2024 17:06:02 +0200 Subject: [PATCH 549/636] direnv: add support for mise integration --- modules/programs/direnv.nix | 16 +++++++++++++++- tests/modules/programs/direnv/default.nix | 1 + tests/modules/programs/direnv/mise.nix | 17 +++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 tests/modules/programs/direnv/mise.nix diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index 6d0af3ac10d1..37899c4a2355 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -19,7 +19,7 @@ in { "Flake support is now always enabled.") ]; - meta.maintainers = [ lib.maintainers.rycee ]; + meta.maintainers = [ lib.maintainers.rycee lib.maintainers.shikanime ]; options.programs.direnv = { enable = mkEnableOption "direnv, the environment switcher"; @@ -95,6 +95,14 @@ in { package = mkPackageOption pkgs "nix-direnv" { }; }; + mise = { + enable = mkEnableOption '' + [mise](https://mise.jdx.dev/direnv.html), + integration of use_mise for direnv''; + + package = mkPackageOption pkgs "mise" { }; + }; + silent = mkEnableOption "silent mode, that is, disabling direnv logging"; }; @@ -112,6 +120,12 @@ in { xdg.configFile."direnv/direnvrc" = lib.mkIf (cfg.stdlib != "") { text = cfg.stdlib; }; + xdg.configFile."direnv/lib/hm-mise.sh" = mkIf cfg.mise.enable { + text = '' + eval "$(${getExe cfg.mise.package} direnv activate)" + ''; + }; + programs.bash.initExtra = mkIf cfg.enableBashIntegration ( # Using mkAfter to make it more likely to appear after other # manipulations of the prompt. diff --git a/tests/modules/programs/direnv/default.nix b/tests/modules/programs/direnv/default.nix index a0e618481f83..b61fb1e334ed 100644 --- a/tests/modules/programs/direnv/default.nix +++ b/tests/modules/programs/direnv/default.nix @@ -1,5 +1,6 @@ { direnv-bash = ./bash.nix; + direnv-mise = ./mise.nix; direnv-nix-direnv = ./nix-direnv.nix; direnv-nushell = ./nushell.nix; direnv-stdlib = ./stdlib.nix; diff --git a/tests/modules/programs/direnv/mise.nix b/tests/modules/programs/direnv/mise.nix new file mode 100644 index 000000000000..b205df6274ef --- /dev/null +++ b/tests/modules/programs/direnv/mise.nix @@ -0,0 +1,17 @@ +{ config, ... }: + +{ + programs.bash.enable = true; + programs.direnv = { + enable = true; + mise = { + enable = true; + package = config.lib.test.mkStubPackage { name = "mise"; }; + }; + }; + + nmt.script = '' + assertFileExists home-files/.bashrc + assertFileExists home-files/.config/direnv/lib/hm-mise.sh + ''; +} From 05d9bee4a5155758aec3c3807c0e342b9f253522 Mon Sep 17 00:00:00 2001 From: Tomo Date: Sat, 26 Oct 2024 23:45:32 -0700 Subject: [PATCH 550/636] git-credential-oauth: fix use of mkIf and add tests Closes #6005 --- modules/programs/git-credential-oauth.nix | 3 ++- tests/default.nix | 1 + .../programs/git-credential-oauth/basic.nix | 16 ++++++++++++++++ .../programs/git-credential-oauth/default.nix | 4 ++++ .../git-credential-oauth/extra-flags.nix | 19 +++++++++++++++++++ 5 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tests/modules/programs/git-credential-oauth/basic.nix create mode 100644 tests/modules/programs/git-credential-oauth/default.nix create mode 100644 tests/modules/programs/git-credential-oauth/extra-flags.nix diff --git a/modules/programs/git-credential-oauth.nix b/modules/programs/git-credential-oauth.nix index 1f4b99247b48..5fa54276cf5d 100644 --- a/modules/programs/git-credential-oauth.nix +++ b/modules/programs/git-credential-oauth.nix @@ -30,7 +30,8 @@ in { home.packages = [ cfg.package ]; programs.git.extraConfig.credential.helper = [ - ("${cfg.package}/bin/git-credential-oauth" + lib.mkIf cfg.extraFlags + ("${cfg.package}/bin/git-credential-oauth" + + lib.optionalString (cfg.extraFlags != [ ]) " ${lib.strings.concatStringsSep " " cfg.extraFlags}") ]; }; diff --git a/tests/default.nix b/tests/default.nix index f4b03275b7d7..3271d3052301 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -81,6 +81,7 @@ in import nmtSrc { ./modules/programs/gh-dash ./modules/programs/git ./modules/programs/git-cliff + ./modules/programs/git-credential-oauth ./modules/programs/gpg ./modules/programs/gradle ./modules/programs/granted diff --git a/tests/modules/programs/git-credential-oauth/basic.nix b/tests/modules/programs/git-credential-oauth/basic.nix new file mode 100644 index 000000000000..741adfbfb524 --- /dev/null +++ b/tests/modules/programs/git-credential-oauth/basic.nix @@ -0,0 +1,16 @@ +{ config, pkgs, ... }: + +{ + programs.git-credential-oauth = { enable = true; }; + + programs.git = { enable = true; }; + + test.stubs.git-credential-oauth = { }; + + nmt.script = '' + assertFileExists home-files/.config/git/config + assertFileContains \ + home-files/.config/git/config \ + "${config.programs.git-credential-oauth.package}/bin/git-credential-oauth" + ''; +} diff --git a/tests/modules/programs/git-credential-oauth/default.nix b/tests/modules/programs/git-credential-oauth/default.nix new file mode 100644 index 000000000000..63ecb183acb8 --- /dev/null +++ b/tests/modules/programs/git-credential-oauth/default.nix @@ -0,0 +1,4 @@ +{ + git-credential-oauth-basic = ./basic.nix; + git-credential-oauth-extra-flags = ./extra-flags.nix; +} diff --git a/tests/modules/programs/git-credential-oauth/extra-flags.nix b/tests/modules/programs/git-credential-oauth/extra-flags.nix new file mode 100644 index 000000000000..7a586ede69c4 --- /dev/null +++ b/tests/modules/programs/git-credential-oauth/extra-flags.nix @@ -0,0 +1,19 @@ +{ config, pkgs, ... }: + +{ + programs.git-credential-oauth = { + enable = true; + extraFlags = [ "-device" ]; + }; + + programs.git = { enable = true; }; + + test.stubs.git-credential-oauth = { }; + + nmt.script = '' + assertFileExists home-files/.config/git/config + assertFileContains \ + home-files/.config/git/config \ + "${config.programs.git-credential-oauth.package}/bin/git-credential-oauth -device" + ''; +} From e83414058edd339148dc142a8437edb9450574c8 Mon Sep 17 00:00:00 2001 From: home-manager-bot <106474382+home-manager-bot@users.noreply.github.com> Date: Sun, 27 Oct 2024 09:15:08 +0100 Subject: [PATCH 551/636] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0?narHash=sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c%2BcHUJwA%3D' (2024-10-18) → 'github:NixOS/nixpkgs/18536bf04cd71abd345f9579158841376fdd0c5a?narHash=sha256-RP%2BOQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM%3D' (2024-10-25) Co-authored-by: github-actions[bot] --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index d052ebff2c35..b03cf135bd98 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1729256560, - "narHash": "sha256-/uilDXvCIEs3C9l73JTACm4quuHUsIHcns1c+cHUJwA=", + "lastModified": 1729880355, + "narHash": "sha256-RP+OQ6koQQLX5nw0NmcDrzvGL8HDLnyXt/jHhL1jwjM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4c2fcb090b1f3e5b47eaa7bd33913b574a11e0a0", + "rev": "18536bf04cd71abd345f9579158841376fdd0c5a", "type": "github" }, "original": { From 8ca921e5a806b5b6171add542defe7bdac79d189 Mon Sep 17 00:00:00 2001 From: Kosta Gorodetsky Date: Fri, 1 Nov 2024 10:46:22 +0200 Subject: [PATCH 552/636] git-credential-oauth: fix ordering of git extraConfig Added `mkAfter` to `git.extraConfig` to ensure our oauth is last, as required to work with additional helpers. --- modules/programs/git-credential-oauth.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/programs/git-credential-oauth.nix b/modules/programs/git-credential-oauth.nix index 5fa54276cf5d..499c7c4c16fb 100644 --- a/modules/programs/git-credential-oauth.nix +++ b/modules/programs/git-credential-oauth.nix @@ -29,7 +29,7 @@ in { config = lib.mkIf cfg.enable { home.packages = [ cfg.package ]; - programs.git.extraConfig.credential.helper = [ + programs.git.extraConfig.credential.helper = lib.mkAfter [ ("${cfg.package}/bin/git-credential-oauth" + lib.optionalString (cfg.extraFlags != [ ]) " ${lib.strings.concatStringsSep " " cfg.extraFlags}") From 1743615b61c7285976f85b303a36cdf88a556503 Mon Sep 17 00:00:00 2001 From: Nicholas Hassan Date: Fri, 22 Dec 2023 10:54:18 +1030 Subject: [PATCH 553/636] podman: add module Adds a new Podman module for creating user containers and networks as systemd services. These are installed to the user's `$XDG_CONFIG/systemd/user` directory. --- modules/lib/maintainers.nix | 16 + modules/misc/news.nix | 14 + modules/modules.nix | 1 + modules/services/podman-linux/activation.nix | 99 ++++++ modules/services/podman-linux/containers.nix | 313 ++++++++++++++++++ modules/services/podman-linux/default.nix | 17 + .../services/podman-linux/install-quadlet.nix | 88 +++++ modules/services/podman-linux/networks.nix | 168 ++++++++++ modules/services/podman-linux/options.nix | 52 +++ modules/services/podman-linux/podman-lib.nix | 136 ++++++++ modules/services/podman-linux/services.nix | 65 ++++ tests/default.nix | 1 + .../podman-linux/container-expected.service | 51 +++ .../services/podman-linux/container.nix | 60 ++++ .../modules/services/podman-linux/default.nix | 6 + .../integration-container-expected.service | 41 +++ .../integration-network-expected.service | 29 ++ .../services/podman-linux/integration.nix | 29 ++ .../services/podman-linux/manifest.nix | 64 ++++ .../podman-linux/network-expected.service | 33 ++ .../modules/services/podman-linux/network.nix | 44 +++ 21 files changed, 1327 insertions(+) create mode 100644 modules/services/podman-linux/activation.nix create mode 100644 modules/services/podman-linux/containers.nix create mode 100644 modules/services/podman-linux/default.nix create mode 100644 modules/services/podman-linux/install-quadlet.nix create mode 100644 modules/services/podman-linux/networks.nix create mode 100644 modules/services/podman-linux/options.nix create mode 100644 modules/services/podman-linux/podman-lib.nix create mode 100644 modules/services/podman-linux/services.nix create mode 100644 tests/modules/services/podman-linux/container-expected.service create mode 100644 tests/modules/services/podman-linux/container.nix create mode 100644 tests/modules/services/podman-linux/default.nix create mode 100644 tests/modules/services/podman-linux/integration-container-expected.service create mode 100644 tests/modules/services/podman-linux/integration-network-expected.service create mode 100644 tests/modules/services/podman-linux/integration.nix create mode 100644 tests/modules/services/podman-linux/manifest.nix create mode 100644 tests/modules/services/podman-linux/network-expected.service create mode 100644 tests/modules/services/podman-linux/network.nix diff --git a/modules/lib/maintainers.nix b/modules/lib/maintainers.nix index 6b7dc8b42da6..91ecb47be228 100644 --- a/modules/lib/maintainers.nix +++ b/modules/lib/maintainers.nix @@ -43,6 +43,12 @@ github = "Avimitin"; githubId = 30021675; }; + bamhm182 = { + name = "bamhm182"; + email = "bamhm182@gmail.com"; + github = "bamhm182"; + githubId = 920269; + }; blmhemu = { name = "blmhemu"; email = "19410501+blmhemu@users.noreply.github.com"; @@ -288,6 +294,16 @@ github = "NitroSniper"; githubId = 44097331; }; + n-hass = { + name = "Nicholas Hassan"; + email = "nick@hassan.host"; + github = "n-hass"; + githubId = 72363381; + keys = [{ + longkeyid = "rsa4096/0xFC95AB946A781EE7"; + fingerprint = "FDEE 6116 DBA7 8840 7323 4466 A371 5973 2728 A6A6"; + }]; + }; seylerius = { email = "sable@seyleri.us"; name = "Sable Seyler"; diff --git a/modules/misc/news.nix b/modules/misc/news.nix index 801391cc2dc4..aeec8f9a0ebf 100644 --- a/modules/misc/news.nix +++ b/modules/misc/news.nix @@ -1813,6 +1813,20 @@ in { systems" section in the Home Manager mantual for more. ''; } + + { + time = "2024-11-01T19:44:59+00:00"; + condition = hostPlatform.isLinux; + message = '' + A new module is available: 'services.podman'. + + Podman is a daemonless container engine that lets you manage + containers, pods, and images. + + This Home Manager module allows you to define containers that will run + as systemd services. + ''; + } ]; }; } diff --git a/modules/modules.nix b/modules/modules.nix index 3b4985083270..75f8ac461c4b 100644 --- a/modules/modules.nix +++ b/modules/modules.nix @@ -352,6 +352,7 @@ let ./services/plan9port.nix ./services/playerctld.nix ./services/plex-mpv-shim.nix + ./services/podman-linux ./services/polybar.nix ./services/poweralertd.nix ./services/psd.nix diff --git a/modules/services/podman-linux/activation.nix b/modules/services/podman-linux/activation.nix new file mode 100644 index 000000000000..5791f19b0693 --- /dev/null +++ b/modules/services/podman-linux/activation.nix @@ -0,0 +1,99 @@ +{ config, podman-lib, ... }: + +{ + cleanup = '' + PATH=$PATH:${podman-lib.newuidmapPaths} + export VERBOSE=true + + DRYRUN_ENABLED() { + return $([ -n "''${DRY_RUN:-}" ] && echo 0 || echo 1) + } + + VERBOSE_ENABLED() { + return $([ -n "''${VERBOSE:-}" ] && echo 0 || echo 1) + } + + cleanup() { + local resourceType=$1 + local manifestFile="${config.xdg.configHome}/podman/$2" + local extraListCommands="''${3:-}" + [[ $resourceType = "container" ]] && extraListCommands+=" -a" + + [ ! -f "$manifestFile" ] && VERBOSE_ENABLED && echo "Manifest does not exist: $manifestFile" && return 0 + + VERBOSE_ENABLED && echo "Cleaning up ''${resourceType}s not in manifest..." || true + + loadManifest "$manifestFile" + + formatString="{{.Name}}" + [[ $resourceType = "container" ]] && formatString="{{.Names}}" + + local listOutput=$(${config.services.podman.package}/bin/podman $resourceType ls $extraListCommands --filter 'label=nix.home-manager.managed=true' --format "$formatString") + + IFS=$'\n' read -r -d "" -a podmanResources <<< "$listOutput" || true + + if [ ''${#podmanResources[@]} -eq 0 ]; then + VERBOSE_ENABLED && echo "No ''${resourceType}s available to process." || true + else + for resource in "''${podmanResources[@]}"; do + if ! isResourceInManifest "$resource"; then + removeResource "$resourceType" "$resource" + else + VERBOSE_ENABLED && echo "Keeping managed $resourceType: $resource" || true + fi + done + fi + } + + isResourceInManifest() { + local resource="$1" + for manifestEntry in "''${resourceManifest[@]}"; do + if [ "$resource" = "$manifestEntry" ]; then + return 0 # Resource found in manifest + fi + done + return 1 # Resource not found in manifest + } + + # Function to fill resourceManifest from the manifest file + loadManifest() { + local manifestFile="$1" + VERBOSE_ENABLED && echo "Loading manifest from $manifestFile..." || true + IFS=$'\n' read -r -d "" -a resourceManifest <<< "$(cat "$manifestFile")" || true + } + + removeResource() { + local resourceType="$1" + local resource="$2" + echo "Removing orphaned $resourceType: $resource" + commands=() + case "$resourceType" in + "container") + commands+="${config.services.podman.package}/bin/podman $resourceType stop $resource" + commands+="${config.services.podman.package}/bin/podman $resourceType rm -f $resource" + ;; + "network") + commands+="${config.services.podman.package}/bin/podman $resourceType rm $resource" + ;; + esac + for command in "''${commands[@]}"; do + command=$(echo $command | tr -d ';&|`') + DRYRUN_ENABLED && echo "Would run: $command" && continue || true + VERBOSE_ENABLED && echo "Running: $command" || true + if [[ "$(eval "$command")" != "$resource" ]]; then + echo -e "\tCommand failed: ''${command}" + usedByContainers=$(${config.services.podman.package}/bin/podman container ls -a --filter "$resourceType=$resource" --format "{{.Names}}") + echo -e "\t$resource in use by containers: $usedByContainers" + fi + done + } + + resourceManifest=() + [[ "$@" == *"--verbose"* ]] && VERBOSE="true" + [[ "$@" == *"--dry-run"* ]] && DRY_RUN="true" + + for type in "container" "network"; do + cleanup "$type" "''${type}s.manifest" + done + ''; +} diff --git a/modules/services/podman-linux/containers.nix b/modules/services/podman-linux/containers.nix new file mode 100644 index 000000000000..41ab291309e0 --- /dev/null +++ b/modules/services/podman-linux/containers.nix @@ -0,0 +1,313 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.podman; + + podman-lib = import ./podman-lib.nix { inherit lib config; }; + + createQuadletSource = name: containerDef: + let + mapHmNetworks = network: + if builtins.hasAttr network cfg.networks then + "podman-${network}-network.service" + else + null; + + finalConfig = let + managedNetworks = if lib.isList containerDef.network then + map mapHmNetworks containerDef.network + else if containerDef.network != null then + map mapHmNetworks [ containerDef.network ] + else + [ ]; + in (podman-lib.deepMerge { + Container = { + AddCapability = containerDef.addCapabilities; + AddDevice = containerDef.devices; + AutoUpdate = containerDef.autoUpdate; + ContainerName = name; + DropCapability = containerDef.dropCapabilities; + Entrypoint = containerDef.entrypoint; + Environment = containerDef.environment; + EnvironmentFile = containerDef.environmentFile; + Exec = containerDef.exec; + Group = containerDef.group; + Image = containerDef.image; + IP = containerDef.ip4; + IP6 = containerDef.ip6; + Label = + (containerDef.labels // { "nix.home-manager.managed" = true; }); + Network = containerDef.network; + NetworkAlias = containerDef.networkAlias; + PodmanArgs = containerDef.extraPodmanArgs; + PublishPort = containerDef.ports; + UserNS = containerDef.userNS; + User = containerDef.user; + Volume = containerDef.volumes; + }; + Install = { + WantedBy = (if containerDef.autoStart then [ + "default.target" + "multi-user.target" + ] else + [ ]); + }; + Service = { + Environment = { + PATH = (builtins.concatStringsSep ":" [ + "/run/wrappers/bin" + "/run/current-system/sw/bin" + "${config.home.homeDirectory}/.nix-profile/bin" + ]); + }; + Restart = "always"; + TimeoutStopSec = 30; + }; + Unit = { + After = [ "network.target" ] ++ managedNetworks; + Requires = managedNetworks; + Description = (if (builtins.isString containerDef.description) then + containerDef.description + else + "Service for container ${name}"); + }; + } containerDef.extraConfig); + in '' + # Automatically generated by home-manager podman container configuration + # DO NOT EDIT THIS FILE DIRECTLY + # + # ${name}.container + ${podman-lib.toQuadletIni finalConfig} + ''; + + toQuadletInternal = name: containerDef: { + assertions = podman-lib.buildConfigAsserts name containerDef.extraConfig; + resourceType = "container"; + serviceName = + "podman-${name}"; # quadlet service name: 'podman-.service' + source = + podman-lib.removeBlankLines (createQuadletSource name containerDef); + }; + + # Define the container user type as the user interface + containerDefinitionType = types.submodule { + options = { + + addCapabilities = mkOption { + type = with types; listOf str; + default = [ ]; + example = [ "CAP_DAC_OVERRIDE" "CAP_IPC_OWNER" ]; + description = "The capabilities to add to the container."; + }; + + autoStart = mkOption { + type = types.bool; + default = true; + description = '' + Whether to start the container on boot (requires user lingering). + ''; + }; + + autoUpdate = mkOption { + type = types.enum [ null "registry" "local" ]; + default = null; + example = "registry"; + description = "The autoupdate policy for the container."; + }; + + description = mkOption { + type = with types; nullOr str; + default = null; + example = "My Container"; + description = "The description of the container."; + }; + + devices = mkOption { + type = with types; listOf str; + default = [ ]; + example = [ "/dev/:/dev/" ]; + description = "The devices to mount into the container"; + }; + + dropCapabilities = mkOption { + type = with types; listOf str; + default = [ ]; + example = [ "CAP_DAC_OVERRIDE" "CAP_IPC_OWNER" ]; + description = "The capabilities to drop from the container."; + }; + + entrypoint = mkOption { + type = with types; nullOr str; + default = null; + example = "/foo.sh"; + description = "The container entrypoint."; + }; + + environment = mkOption { + type = podman-lib.primitiveAttrs; + default = { }; + example = literalExpression '' + { + VAR1 = "0:100"; + VAR2 = true; + VAR3 = 5; + } + ''; + description = "Environment variables to set in the container."; + }; + + environmentFile = mkOption { + type = with types; listOf str; + default = [ ]; + example = [ "/etc/environment" "/etc/other-env" ]; + description = '' + Paths to files containing container environment variables. + ''; + }; + + exec = mkOption { + type = with types; nullOr str; + default = null; + example = "sleep inf"; + description = "The command to run after the container start."; + }; + + extraPodmanArgs = mkOption { + type = types.listOf types.str; + default = [ ]; + example = [ + "--security-opt=no-new-privileges" + "--security-opt=seccomp=unconfined" + ]; + description = "Extra arguments to pass to the podman run command."; + }; + + extraConfig = mkOption { + type = podman-lib.extraConfigType; + default = { }; + example = literalExpression '' + { + Container = { + User = 1000; + }; + Service = { + TimeoutStartSec = 15; + }; + } + ''; + description = '' + INI sections and values to populate the Container Quadlet. + ''; + }; + + group = mkOption { + type = with types; nullOr (either int str); + default = null; + description = "The group ID inside the container."; + }; + + image = mkOption { + type = types.str; + example = "registry.access.redhat.com/ubi9-minimal:latest"; + description = "The container image."; + }; + + ip4 = mkOption { + type = with types; nullOr str; + default = null; + description = "Set an IPv4 address for the container."; + }; + + ip6 = mkOption { + type = with types; nullOr str; + default = null; + description = "Set an IPv6 address for the container."; + }; + + labels = mkOption { + type = with types; attrsOf str; + default = { }; + example = { + app = "myapp"; + some-label = "somelabel"; + }; + description = "The labels to apply to the container."; + }; + + network = mkOption { + type = with types; either str (listOf str); + default = [ ]; + apply = value: if isString value then [ value ] else value; + example = literalMD '' + `"host"` + or + `"bridge_network_1"` + or + `[ "bridge_network_1" "bridge_network_2" ]` + ''; + description = '' + The network mode or network/s to connect the container to. Equivalent + to `podman run --network=