Merge pull request #192864 from alyaeanyx/nix-serve-package-option

nixos/nix-serve: add package option
This commit is contained in:
Christian Kögler 2022-10-02 11:39:28 +02:00 committed by GitHub
commit 6845ddc94b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,6 +26,15 @@ in
'';
};
package = mkOption {
type = types.package;
default = pkgs.nix-serve;
defaultText = literalExpression "pkgs.nix-serve";
description = lib.mdDoc ''
nix-serve package to use.
'';
};
openFirewall = mkOption {
type = types.bool;
default = false;
@ -70,7 +79,7 @@ in
${lib.optionalString (cfg.secretKeyFile != null) ''
export NIX_SECRET_KEY_FILE="$CREDENTIALS_DIRECTORY/NIX_SECRET_KEY_FILE"
''}
exec ${pkgs.nix-serve}/bin/nix-serve --listen ${cfg.bindAddress}:${toString cfg.port} ${cfg.extraParams}
exec ${cfg.package}/bin/nix-serve --listen ${cfg.bindAddress}:${toString cfg.port} ${cfg.extraParams}
'';
serviceConfig = {