From 0992b38e5e1f3fba5cf7d386a20a39ce8ea6ee3f Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 3 Mar 2024 06:55:43 +0100 Subject: [PATCH 001/198] 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 e9ecbed7..b9c933ac 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 002/198] 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 2a981125..f63f9cc1 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 003/198] 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 83f57d8e..272594b1 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 ad94adc9..cf04a65c 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 6910d627..0a56ba81 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 00000000..c58ed4d6 --- /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 8fc0e089..c8037e53 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 a2eb8bf1..50218e15 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 361db2d6..a4cf7a30 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 004/198] 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 2f1eb8c6..64852866 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 005/198] 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 3599fd2d..3c2d1c19 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 f63f9cc1..2390ddde 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 006/198] 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 0615ae3c..b8d84469 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 5e56d9ed..d9e72969 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 007/198] 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 4e3e2bbc..15dd2b9e 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 008/198] 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 8d92789a..40d4e2b3 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 009/198] 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 70e4df0a..685698b7 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 010/198] 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 e985e3a0..921dc8d8 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 011/198] 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 1431c1cd..f0603bb4 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 012/198] 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 29c2756f..022f066e 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 f4ee8e8f..04c713d8 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 6c9c1777..8f9627d9 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}" - 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 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 6c514bfb..d4cac249 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 013/198] 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 e96f2f2d..961cd0b3 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 0a56ba81..3aa2494e 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 014/198] 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 4770bb4a..7c281a12 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 015/198] 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 8d864126..c0a8f179 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 016/198] 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 29f2bf00..c275c4ae 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 017/198] 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 00000000..44353875 --- /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 018/198] 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 2b9d7a87..b7a87485 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 019/198] 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 00000000..816bec77 --- /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 020/198] 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 c0a8f179..6fdb2070 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 021/198] 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 183463d3..8c64aee4 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 cc811302..88048daf 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 022/198] 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 accad55f..4f566e18 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 43d0daa9..2cc94e1e 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 023/198] 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 fac4d01d..4edd1742 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 545df71b..32c00339 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 024/198] 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 392d2632..dcff129d 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 f3bcbf2a..3a27c4d3 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 025/198] 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 c9912812..1198ea03 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 026/198] 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 a274da8f..2d90d633 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 027/198] 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 a05782b0..2d216c3d 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 55906e15..16c70c86 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 028/198] 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 6d66c99d..67b7752c 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 f3e116f0..68fec357 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 029/198] 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 67b7752c..58c4720d 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 030/198] 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 f3cb3276..f55fa0bf 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 4f955e39..8d681658 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 08a539de..16206cc1 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 00000000..d4abfe27 --- /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 97fa3fbb..1e14df0c 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 00000000..5c3288d9 --- /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 00000000..688349e8 --- /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 00000000..8907d167 --- /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 031/198] 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 f55fa0bf..52f956d1 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 8d681658..5a40f60c 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 16206cc1..ec2af169 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 00000000..63d33fad --- /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 1e14df0c..5084d2d1 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 00000000..ee18f4c6 --- /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 00000000..7a8671a1 --- /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 00000000..5d534e49 --- /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 00000000..84579d53 --- /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 032/198] 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 19cbaa68..2b9c2d01 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 327cf1bb..05445e84 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 27a71e45..1728fa45 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 9a38e7c5..9e5ea200 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 033/198] 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 05445e84..50f6ca81 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 034/198] 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 19670775..ecc6f5cf 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 00000000..106a0c18 --- /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 53ea9be8..8cc0f924 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 00000000..596fdf1c --- /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 00000000..098708ca --- /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 035/198] 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 b5a07d5f..9dce9f5c 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 036/198] 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 921dc8d8..a897d3df 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 037/198] 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 99813e95..bf8040d1 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 038/198] 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 046ed9aa..ed1a0b28 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 6a5abe60..277203da 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 039/198] 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 1067bda1..d338a580 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 d13b870e..5666ade0 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 00000000..35822cee --- /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 00000000..162379b8 --- /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 040/198] 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 0c6c5d7e..e28c3a54 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 041/198] 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 ec0cf557..3048d589 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 0db599a3..9b15ba32 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 f45bf6b3..e7b11ffe 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 042/198] 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 a897d3df..5879aa40 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 043/198] 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 805d2cfc..335edea7 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 044/198] docs: fix broken link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 335edea7..486194aa 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 045/198] 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 e28c3a54..3c244071 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 046/198] 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 1a1845c0..fcafec06 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 047/198] 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 52f956d1..174a7d36 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 5a40f60c..849ac942 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 ec2af169..fc8154e9 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 00000000..fe46ebad --- /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 5084d2d1..84ea67de 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 00000000..63e105ae --- /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 00000000..9f986798 --- /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 00000000..3ccd7320 --- /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 048/198] 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 fe46ebad..bbf9e400 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 049/198] 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 849ac942..0b858861 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 685698b7..a5d89415 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 9e21eb6d..29efddac 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 1a314e41..c5078673 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 050/198] 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 0b858861..c4a19177 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 b6369dbc..5dd751d0 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 c48d88be..77436232 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 8cf9572b..ac582018 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 becf9fad..b690659a 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 051/198] 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 a5d89415..509adfa5 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 29efddac..e23de764 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 052/198] 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 e0ced976..17d8b143 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 a86627f4..585d8a85 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 d02a75f5..8041bf7b 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 303a1327..a1500cb2 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 053/198] 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 3c244071..2a297b25 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 054/198] 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 44353875..bfa67459 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 055/198] 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 bc50174d..ea308f78 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 60b84762..bcb943ba 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 dab98c30..5a2b97f3 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 056/198] 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 b6cc41ea..9c3ad6a8 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 00e730ef..37ccfeba 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 057/198] 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 c4a19177..70a943de 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 fc8154e9..cd4abb72 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 00000000..ac807257 --- /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 84ea67de..6ba91229 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 00000000..d3a14ae8 --- /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 00000000..3b3f4321 --- /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 00000000..89c65b1f --- /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 058/198] 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 98a03ba2..9cb0e1cf 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 24256e76..1aaac393 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 6ba91229..567b75d5 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 37bb2004..da52640d 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 88c5752b..6e4a4047 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 00000000..e69de29b diff --git a/tests/lib/generators/toscfg-empty.nix b/tests/lib/generators/toscfg-empty.nix new file mode 100644 index 00000000..e6800481 --- /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 00000000..f9b8dcde --- /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 00000000..7a538d5a --- /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 00000000..d38568dc --- /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 00000000..d1a2ba46 --- /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 00000000..9e416454 --- /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 00000000..eeed8a39 --- /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 00000000..39d5b11f --- /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 00000000..5b0a5aa2 --- /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 059/198] 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 01fe5ac5..6c837330 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 060/198] 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 dcff129d..2af24891 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 061/198] 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 2af24891..145d7f79 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 062/198] 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 145d7f79..c4520e7a 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 9baf1e43..981cefb6 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 063/198] 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 1aa3af1e..9a94f238 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 064/198] 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 6094539e..3493ae56 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 065/198] 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 5608b54e..8b3ed757 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 fe50273f..b7969460 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 066/198] 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 8b3ed757..0416515f 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 067/198] 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 6c837330..8ac26dfe 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. - These enums are based on special expressions from the - {manpage}`systemd.time(7)` + On Linux this is a string as defined by {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 068/198] 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 5879aa40..c62d2cc8 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 069/198] 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 aab624f5..02dacc74 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 070/198] 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 c62d2cc8..a6d3c676 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 071/198] 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 500e02e0..af305374 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.sessionVariables = { + 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"; - }; - }; + 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 5c6e4699..e9ac8e38 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 072/198] 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 961cd0b3..bfbc3e12 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 4edd1742..7ab9521c 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 32c00339..562d7b4b 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 073/198] 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 91202c87..1fa7af0e 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 9e5ea200..91111e5d 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 074/198] 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 d11f0324..b399dad8 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 6c03491b..d14067b0 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 00000000..1ab6346f --- /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 075/198] 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 b4f98b11..8db5a9a8 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 076/198] 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 1728fa45..b3f6d6e2 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 b8739e37..56e8ea98 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 c95745d1..614b4ce9 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 00000000..869b8a2c --- /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 077/198] 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 b3f6d6e2..59497ec4 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 078/198] 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 bfa67459..d0a57b9b 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 816bec77..a7c2bafb 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 079/198] 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 a6d3c676..f8efa105 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 080/198] 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 cf04a65c..846e18fa 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 c8037e53..52e77963 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 50218e15..017a04ac 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 a4cf7a30..157d650b 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 081/198] 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 02c7afac..3a90f89c 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 082/198] 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 263d1f06..8253c4e5 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 083/198] 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 8253c4e5..a24d9ffe 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 084/198] 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 3048d589..cf163108 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 085/198] 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 7be061dc..52cacb05 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 086/198] 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 28b515ae..18f9dad7 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 087/198] =?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 bb164ff3..97deaaf0 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 b5f759a8..b1f4cfaa 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 088/198] 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 59b403d3..076f3cd4 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 089/198] 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 0c6aac31..39673131 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 090/198] 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 89b63422..3dcbbd67 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 091/198] 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 b4a947b2..fe90504c 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 092/198] 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 846e18fa..bbf222d9 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 52e77963..50ccb681 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 017a04ac..c4a35945 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 157d650b..32fe7270 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 093/198] 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 50f6ca81..59e9c257 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} + storeDir = escapeShellArg builtins.storeDir; - # 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/*" + check = pkgs.substituteAll { + src = ./files/check-link-targets.sh; - 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 - ''; + 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 00000000..c3200d33 --- /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 094/198] 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 f8efa105..5dd1e12d 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 095/198] =?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 | 51 +++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 16 deletions(-) diff --git a/modules/programs/fzf.nix b/modules/programs/fzf.nix index 062df186..31df95de 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.zsh.initExtra = + mkIf cfg.enableZshIntegration (mkOrder 200 zshIntegration); - programs.fish.interactiveShellInit = mkIf cfg.enableFishIntegration - (mkOrder 200 '' - source ${cfg.package}/share/fzf/key-bindings.fish && fzf_key_bindings - ''); + 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 096/198] 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 174a7d36..2c4fbd9d 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 70a943de..97b8da7b 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 cd4abb72..ff48b21a 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 00000000..f186982e --- /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 097/198] 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 8ce84fcb..cbf78fb0 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 098/198] 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 473d8160..fc11e512 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 099/198] 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 79832dce..52bab938 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 517344e5..0c452b9d 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 100/198] 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 a3b87ea2..fad05c1c 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 b9d9638a..7f39c846 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 101/198] 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 58c4720d..5a5ce6fa 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 102/198] 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 5dd1e12d..62940731 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 103/198] 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 51419971..2ebd9554 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 a025da18..d97fa898 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 46f34ebd..6655f01a 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 73038584..d870eb9d 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 ad77f821..da4ffafd 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 ddd041dc..9adbaa98 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 104/198] 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 900e129e..a9e3fe55 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 7816a050..f37f192c 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 105/198] 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 a9e3fe55..6ef53291 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 5084be4f..35534005 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 f37f192c..23a42120 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 106/198] 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 404dfecd..a466b6f7 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 567b75d5..62538966 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 00000000..4a2f2ee7 --- /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 00000000..6acb2f8d --- /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 00000000..8cbc4af0 --- /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 107/198] 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 238cb843..32e670e8 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 108/198] 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 041b9dfa..f209f65d 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 109/198] 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 62940731..aeb90586 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 110/198] 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 486194aa..4444fbbd 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 b663b688..07b1392d 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 9ac5c0cf..93f71feb 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 428f29bc..4ee8278a 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 cbf78fb0..cf62f82c 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 9c3ad6a8..04e5423d 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 d19eab61..93bc195f 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 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 f17a0b91..832b6c09 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 94fa9436..8b781552 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 111/198] 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 1fa7af0e..8e5fb4c5 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 4b238d10..2fcdc5a6 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 e187449c..7a33a805 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 112/198] 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 fe90504c..4159c95f 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 de348823..c49a76fd 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 aed3b397..4e3c1935 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 b7a87485..1c9388eb 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 0db625b3..2dd2c14d 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 97deaaf0..41f5035c 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 5d6573f8..9f614ab1 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 3e356d6a..30a16bde 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 3cb16292..44aba563 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 18f9dad7..bd48a4a8 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 2454def1..428f9e10 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 7cbf6354..e382f3b5 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 d0a57b9b..336b5562 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 e01ade19..acb46662 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 6e17edae..78db0232 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 b1f4cfaa..b3754af0 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 520af142..418594aa 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 73a53688..9bd5144a 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 aea9b0ab..a8f2b484 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 022007dd..d817496a 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 5d474429..266a84d8 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 a7c2bafb..a285c2bf 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 113/198] 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 f02bc186..e3e5be41 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 9ddddb35..a4cadcb7 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 d95ef704..617d99b0 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 070c8020..76a6512f 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 2b3ade9d..26408818 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 114/198] 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 e3e5be41..2dbb3139 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 115/198] 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 2dbb3139..51fbac46 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 617d99b0..ab65f146 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 116/198] 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 97b8da7b..2c00c5ed 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 ff48b21a..b182a33e 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 00000000..bc5b709d --- /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 117/198] 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 b48dc312..5e7a44b5 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 118/198] 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 2c4fbd9d..727d4c3c 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 2c00c5ed..8e304545 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 b182a33e..c283b071 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 00000000..acc1a994 --- /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 62538966..c95b288a 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 00000000..3a95c23e --- /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 00000000..28b28996 --- /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 00000000..22b89d80 --- /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 119/198] 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 9c5519f3..96c5bdbf 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 86c6766a..c60883a1 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 00000000..fe1c7398 --- /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 120/198] 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 727d4c3c..a2c56863 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 8e304545..ef5378af 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 c283b071..51284102 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 00000000..83eefe12 --- /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 c95b288a..c4d98ef2 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 00000000..408e84b0 --- /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 00000000..9812b128 --- /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 00000000..d11c86e4 --- /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 00000000..dc7fe8c6 --- /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 00000000..cb5fa99d --- /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 121/198] 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 562d7b4b..2e013af0 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 122/198] 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 a7ed7ec6..bdeda863 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 d338a580..069c4de8 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 123/198] 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 39673131..65477be1 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 124/198] 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 2f7845f4..edcd073e 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 9b0867ee..018881bc 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 4f15e70b..02d5aabf 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 125/198] 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 edcd073e..e799e269 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 ecc6df35..c587018e 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 723f1874..7b08aae8 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 8aa01380..c8ecb206 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 49d92a61..00000000 --- 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 76aedf4f..e08c96eb 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 02d5aabf..7094f9a9 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 126/198] 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 88048daf..646af20b 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 2c7f5ff7..e3ce4a9c 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 00000000..1cbb92c3 --- /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 00000000..aae02fef --- /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 127/198] 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 ef5378af..8d7e17a5 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 51284102..96b2bec5 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 00000000..dac0471d --- /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 c4d98ef2..3729ce98 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 00000000..2741353a --- /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 00000000..747623af --- /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 00000000..43fa4894 --- /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 128/198] 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 00000000..22139f5c --- /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 96b2bec5..154f2bd9 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 129/198] 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 cf163108..4401998f 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 130/198] 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 9da9fa8f..cafc9a0a 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 131/198] 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 30a16bde..a5de344b 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 44aba563..a3075d41 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 a8f2b484..83d01927 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 132/198] 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 e382f3b5..66c89e60 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 133/198] 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 646af20b..ea63e78c 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 134/198] 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 ea63e78c..bc20e9d9 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 e3ce4a9c..7627aab0 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 399790fb..9488d00f 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 0817837a..cf316988 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 00000000..e566e4fd --- /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 59527247..c62effbe 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 03f64fc2..3bce4850 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 b8a2bc16..de2e91b3 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 b8aa58c5..287dec17 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 b4091267..5eded3b8 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 a859e04e..46e4df23 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 a449b42c..042830d1 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 13aac533..3617a3b1 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 5a1d90e2..5c32c19c 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 aae02fef..f0b42ecc 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 6af944eb..e5637fd9 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 47fb7527..dcbff91e 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 135/198] 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 d1727cc2..8eea5555 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 136/198] 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 65477be1..91b6657f 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 137/198] 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 aeb90586..54981090 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 138/198] 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 51fbac46..beb97434 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 139/198] 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 beb97434..a36bd567 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 140/198] 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 bbf9e400..418abff3 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 141/198] 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 8d7e17a5..bbbf3b8f 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 154f2bd9..01247077 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 00000000..d297f0c7 --- /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 3729ce98..4b7b6ebf 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 00000000..fc979306 --- /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 00000000..145cf18a --- /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 00000000..50af2a33 --- /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 142/198] 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 bf8040d1..5d09145a 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 143/198] 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 428f9e10..15930e49 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 144/198] 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 22139f5c..f7c35573 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 145/198] 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 52bab938..79832dce 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 0c452b9d..517344e5 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 146/198] 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 bbbf3b8f..88e43a4c 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 01247077..06d1c331 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 00000000..a6301244 --- /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 147/198] 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 55b6c22b..d9318d10 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 148/198] 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 8e5fb4c5..9703505d 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 c5abf850..3aab1897 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 149/198] 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 51e7eb6d..79ca7f5e 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 ba92d81f..88a7c536 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 150/198] 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 c4520e7a..3ec73f30 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 151/198] 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 54981090..3a0d2858 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 152/198] 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 00000000..8c29d2a2 --- /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 153/198] 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 00000000..4f7e3bdc --- /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 154/198] 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 9703505d..630fe39a 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 155/198] 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 422e5ef8..21f00fb4 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 ad0e6764..6c54148a 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 5da3240b..08491be9 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 156/198] 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 af305374..b863b23e 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 157/198] 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 a2c56863..f3dd83fe 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 88e43a4c..f8617f54 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 06d1c331..b1e8b9b4 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 00000000..477176aa --- /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 158/198] 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 3a0d2858..513eff46 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 159/198] 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 6ba733fa..504b519a 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 160/198] 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 fcbc4634..add2c8fc 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 4c173097..588cd6ed 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 4e5efb87..3bfd768c 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 1d06a0bc..2a859132 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 161/198] 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 2cad4c33..ab56ea01 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 9a55efac..45696359 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 79cadaf8..54d6b794 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 162/198] 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 eb9c9c4a..26cad111 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 7a2ee13b..d4ff9c4d 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 9974aff6..002e071c 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 163/198] 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 cf62f82c..1370d4c2 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 164/198] 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 1c9388eb..de1c061b 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 165/198] 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 5d0d15d8..17af07a8 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 166/198] 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 069c4de8..588b801e 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 94c13b29..2a45234d 100644 --- a/tests/modules/programs/neomutt/neomutt-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-expected.conf @@ -9,14 +9,14 @@ alternative_order text/enriched text/plain text set delete = yes + + # Binds # Macros - - # Register accounts # register account hm@example.com mailboxes "/home/hm-user/Mail/hm@example.com/Inbox" diff --git a/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf b/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf index cffdace6..47dc8173 100644 --- a/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-not-primary-expected.conf @@ -9,14 +9,14 @@ alternative_order text/enriched text/plain text set delete = yes + + # Binds # Macros - - # Register accounts # register account hm-account mailboxes "/home/hm-user/Mail/hm-account/Inbox" diff --git a/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf b/tests/modules/programs/neomutt/neomutt-with-binds-expected.conf index 64ea6890..05736749 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 005fd5b0..02f03f6e 100644 --- a/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-imap-expected.conf @@ -9,14 +9,14 @@ 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 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 c6838d4c..51c6c6b9 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,14 +9,14 @@ 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 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 a166b355..605b5ed6 100644 --- a/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf +++ b/tests/modules/programs/neomutt/neomutt-with-named-mailboxes-expected.conf @@ -9,14 +9,14 @@ alternative_order text/enriched text/plain text set delete = yes + + # Binds # Macros - - # Register accounts # register account hm@example.com named-mailboxes "someCustomName" "/home/hm-user/Mail/hm@example.com/Inbox" From 9fdd301a5e4d8cf4d4cf3f990e799000a54a3737 Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Fri, 26 Apr 2024 21:31:43 -0500 Subject: [PATCH 167/198] 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 9cb0e1cf..2aebd92c 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 168/198] 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 4401998f..4f1c9e92 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 96cae5e4..ae431939 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 00000000..5d910297 --- /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 00000000..86d60c63 --- /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 9b15ba32..29dcd7cd 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 00000000..3dc8c39c --- /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 00000000..4161cd75 --- /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 169/198] 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 f3dd83fe..28327916 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 170/198] 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 f8617f54..b13a9d33 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 b1e8b9b4..d526c352 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 00000000..bb1f9d57 --- /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 4b7b6ebf..15a54f08 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 00000000..d5682daa --- /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 00000000..ceb3bf06 --- /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 171/198] 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 c3200d33..215ff6c3 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 172/198] 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 b13a9d33..b189fb00 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 d526c352..e14c26d5 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 00000000..77700fe5 --- /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 15a54f08..7f92c2bd 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 00000000..50d43a11 --- /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 00000000..a30d3bed --- /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 00000000..cb6fd4d2 --- /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 173/198] 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 28327916..1e988cc2 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 174/198] 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 b189fb00..92d3e9f5 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 e14c26d5..7c81102a 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 00000000..bf7eeea8 --- /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 7f92c2bd..7b714581 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 00000000..010eac37 --- /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 00000000..479a1923 --- /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 00000000..e4ca38e0 --- /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 175/198] 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 e4255a17..b3aceeb1 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 fc0d7c1f..d39e27a9 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 176/198] 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 513eff46..908e1866 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 177/198] 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 bb1f9d57..60bcc913 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 178/198] 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 908e1866..5913a4e4 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 179/198] 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 504b519a..3599557f 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 00000000..65d4fdca --- /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 01101332..d74a469b 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 180/198] 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 92d3e9f5..ef3b98f5 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 7c81102a..b59812b7 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 00000000..0e28c543 --- /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 7b714581..e879c13c 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 00000000..461f70a5 --- /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 00000000..c959983c --- /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 00000000..ee296337 --- /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 181/198] 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 3bc3f2f7..f3352750 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 f0cf96f3..f311d900 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 182/198] 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 53728060..3061feff 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 c34ab1d7..fa027422 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 ec18ecb9..0999eaa8 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 1f2c7b79..8cd5d86f 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 dc6ba465..80e082c9 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 183/198] 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 ef3b98f5..16f372c8 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 b59812b7..98f7de80 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 00000000..36a57cea --- /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 e879c13c..2ecffad8 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 00000000..58e4598f --- /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 00000000..02f44e0c --- /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 184/198] 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 269c5ef9..b1fcc703 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 185/198] 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 1e988cc2..b5175a87 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 16f372c8..6319d635 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 98f7de80..22664091 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 00000000..32021611 --- /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 2ecffad8..0ebf4715 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 00000000..70eabbd6 --- /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 00000000..a0b6783a --- /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 00000000..428081d4 --- /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 00000000..d347e562 --- /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 186/198] kanshi: update configuration to better match upstream --- modules/services/kanshi.nix | 175 ++++++++++++++---- .../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, 231 insertions(+), 36 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 02fe8e3c..1e695030 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) - ]; + 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"; + } + ]; + } - xdg.configFile."kanshi/config".text = '' - ${concatStringsSep "\n" (mapAttrsToList profileStr cfg.profiles)} - ${cfg.extraConfig} - ''; + (mkIf (cfg.profiles != { }) { + warnings = [ + "kanshi.profiles option is deprecated. Use kanshi.settings instead." + ]; + }) - systemd.user.services.kanshi = { - Unit = { - Description = "Dynamic output configuration"; - Documentation = "man:kanshi(1)"; - PartOf = cfg.systemdTarget; - Requires = cfg.systemdTarget; - After = 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 ]; }; }; - - 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 c5706e63..ffb6db7b 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 cb6b2a6b..b7704b11 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 00000000..c0858a04 --- /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 00000000..9b3a3647 --- /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 187/198] 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 6319d635..dbbca455 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 22664091..05692356 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 00000000..25d87188 --- /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 0ebf4715..f5b0cbc6 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 00000000..3fdf9ce3 --- /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 00000000..c4f6821e --- /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 00000000..1936f43f --- /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 00000000..8544a8c5 --- /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 00000000..3ea18c02 --- /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 188/198] 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 dbbca455..b83d0858 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 05692356..e1b08087 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 00000000..ede09b25 --- /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 f5b0cbc6..3b52ff40 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 00000000..7bf944fb --- /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 00000000..2a5abbfe --- /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 00000000..d7b4ccb4 --- /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 189/198] 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 4f1c9e92..ff162fb3 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 190/198] 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 5913a4e4..cfe58270 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 191/198] fontconfig: add defaultFonts.* options --- modules/misc/fontconfig.nix | 100 +++++++++++++++++++++++++++++++----- 1 file changed, 87 insertions(+), 13 deletions(-) diff --git a/modules/misc/fontconfig.nix b/modules/misc/fontconfig.nix index 49fef96a..9bc6ac47 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,27 +119,53 @@ in { fi ''; - xdg.configFile = { - "fontconfig/conf.d/10-hm-fonts.conf".text = '' + xdg.configFile = let + mkFontconfigConf = conf: '' - Add fonts in the Nix user profile - - ${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/fontconfig/cache + ${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}/lib/X11/fonts + ${config.home.path}/share/fonts + ${profileDirectory}/lib/X11/fonts + ${profileDirectory}/share/fonts + + ${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 192/198] 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 b83d0858..2164d66a 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 e1b08087..4e1f0e20 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 00000000..f4e0a434 --- /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 3b52ff40..4d8d49d4 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 00000000..26de5673 --- /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 00000000..56cdf27d --- /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 00000000..0bd9120a --- /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 00000000..de572090 --- /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 193/198] 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 820f05b3..4a4f1067 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 194/198] 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 37642a29..b0270857 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 418bfde1..2bffbd68 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 2f2c33d2..6d71e1f5 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 00000000..58a035a6 --- /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 195/198] 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 b1fcc703..a21c7108 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 12c4a2f5..10dd1258 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 06b68f18..d83b552b 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 196/198] 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 cfe58270..3213b2ad 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 197/198] 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 a466b6f7..865a03eb 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 198/198] 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 865a03eb..f6e27e79 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 8cbc4af0..ac8ff53e 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