diff options
author | Gutyina Gergő <gutyina.gergo.2@gmail.com> | 2024-01-07 23:40:40 +0100 |
---|---|---|
committer | github-actions[bot] <github-actions[bot]@users.noreply.github.com> | 2024-01-14 17:32:39 +0000 |
commit | 2fec2de6bc72ab9aae7e8139938c1ead927e0fa5 (patch) | |
tree | 4c3e0836f095fe02ddd8997063ed7fc0fdbeb26a | |
parent | 47e1e6f3409853223e4009baed3f9de4d423e4f9 (diff) |
nixos/c2fmzq-server: allow setting bool settings to false
(cherry picked from commit 7247d16af6a32d5bdc176d0be4858be2ad463d1f)
-rw-r--r-- | nixos/modules/services/web-apps/c2fmzq-server.nix | 6 | ||||
-rw-r--r-- | nixos/tests/c2fmzq.nix | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/nixos/modules/services/web-apps/c2fmzq-server.nix b/nixos/modules/services/web-apps/c2fmzq-server.nix index 54c4bf1b09ca5..87938fe160e14 100644 --- a/nixos/modules/services/web-apps/c2fmzq-server.nix +++ b/nixos/modules/services/web-apps/c2fmzq-server.nix @@ -7,7 +7,11 @@ let argsFormat = { type = with lib.types; attrsOf (nullOr (oneOf [ bool int str ])); - generate = lib.cli.toGNUCommandLineShell { }; + generate = lib.cli.toGNUCommandLineShell { + mkBool = k: v: [ + "--${k}=${if v then "true" else "false"}" + ]; + }; }; in { options.services.c2fmzq-server = { diff --git a/nixos/tests/c2fmzq.nix b/nixos/tests/c2fmzq.nix index 59addbde24ed5..0dd89f6881dd9 100644 --- a/nixos/tests/c2fmzq.nix +++ b/nixos/tests/c2fmzq.nix @@ -12,6 +12,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { # make sure multiple freeform options evaluate allow-new-accounts = true; auto-approve-new-accounts = true; + licenses = false; }; }; environment = { @@ -74,5 +75,8 @@ import ./make-test-python.nix ({ pkgs, lib, ... }: { with subtest("Test that PWA is served"): msg = machine.succeed("curl -sSfL http://localhost:8080") assert "c2FmZQ" in msg, f"Could not find 'c2FmZQ' in the output:\n{msg}" + + with subtest("A setting with false value is properly passed"): + machine.succeed("systemctl show -p ExecStart --value c2fmzq-server.service | grep -F -- '--licenses=false'"); ''; }) |