Merge pull request #330511 from zimbatm/nar-serve-package

nixos/nar-serve: 0.6.1 -> 0.7.0
This commit is contained in:
Jonas Chevalier 2024-07-31 09:59:48 +02:00 committed by GitHub
commit 6952047399
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 4 deletions

View File

@ -12,6 +12,8 @@ in
services.nar-serve = {
enable = mkEnableOption "serving NAR file contents via HTTP";
package = mkPackageOption pkgs "nar-serve" { };
port = mkOption {
type = types.port;
default = 8383;
@ -32,6 +34,17 @@ in
- gs:// for binary caches stored in Google Cloud Storage
'';
};
domain = mkOption {
type = types.str;
default = "";
description = ''
When set, enables the feature of serving <nar-hash>.<domain>
on top of <domain>/nix/store/<nar-hash>-<pname>.
Useful to preview static websites where paths are absolute.
'';
};
};
};
@ -47,7 +60,7 @@ in
serviceConfig = {
Restart = "always";
RestartSec = "5s";
ExecStart = "${pkgs.nar-serve}/bin/nar-serve";
ExecStart = lib.getExe cfg.package;
DynamicUser = true;
};
};

View File

@ -4,16 +4,16 @@
}:
buildGoModule rec {
pname = "nar-serve";
version = "0.6.1";
version = "0.7.0";
src = fetchFromGitHub {
owner = "numtide";
repo = "nar-serve";
rev = "v${version}";
hash = "sha256-cSOYHYJJEGzFtkD4mjTmYBiM9CaWKt64xgV/JeNHpfM=";
hash = "sha256-8QuMS00EutmqzAIPxyJEPxM8EHiWlSKs6E2Htoh3Kes=";
};
vendorHash = "sha256-RpjLs4+9abbbysYAlPDUXBLe1cz4Lp+QmR1yv+LpYwQ=";
vendorHash = "sha256-td9NYHGYJYPlIj2tnf5I/GnJQOOgODc6TakHFwxyvLQ=";
doCheck = false;