diff --git a/nixos/tests/ncps-ha-pg-redis.nix b/nixos/tests/ncps-ha-pg-redis.nix index 4bf5c6832ab8..9d65f4de720c 100644 --- a/nixos/tests/ncps-ha-pg-redis.nix +++ b/nixos/tests/ncps-ha-pg-redis.nix @@ -163,25 +163,6 @@ in testScript = { nodes, ... }: - let - narinfoName = - (lib.strings.removePrefix "/nix/store/" ( - lib.strings.removeSuffix "-empty-file" pkgs.emptyFile.outPath - )) - + ".narinfo"; - - narinfoNameChars = lib.strings.stringToCharacters narinfoName; - - narinfoPath = lib.concatStringsSep "/" [ - (builtins.head nodes.minio.services.minio.dataDir) - bucket - "store/narinfo" - (lib.lists.elemAt narinfoNameChars 0) - ((lib.lists.elemAt narinfoNameChars 0) + (lib.lists.elemAt narinfoNameChars 1)) - narinfoName - "xl.meta" - ]; - in '' harmonia.start() minio.start() @@ -206,13 +187,5 @@ in client0.wait_until_succeeds("curl -f http://ncps0:8501/ | grep '\"hostname\":\"${toString nodes.ncps0.services.ncps.cache.hostName}\"' >&2") client1.wait_until_succeeds("curl -f http://ncps1:8501/ | grep '\"hostname\":\"${toString nodes.ncps1.services.ncps.cache.hostName}\"' >&2") - - client0.succeed("cat /etc/nix/nix.conf >&2") - client0.succeed("nix-store --realise ${pkgs.emptyFile}") - - client1.succeed("cat /etc/nix/nix.conf >&2") - client1.succeed("nix-store --realise ${pkgs.emptyFile}") - - minio.succeed("cat ${narinfoPath} >&2") ''; } diff --git a/nixos/tests/ncps-ha-pg.nix b/nixos/tests/ncps-ha-pg.nix index 45bb7a14b7a5..f650a1bcd1ed 100644 --- a/nixos/tests/ncps-ha-pg.nix +++ b/nixos/tests/ncps-ha-pg.nix @@ -145,25 +145,6 @@ in testScript = { nodes, ... }: - let - narinfoName = - (lib.strings.removePrefix "/nix/store/" ( - lib.strings.removeSuffix "-empty-file" pkgs.emptyFile.outPath - )) - + ".narinfo"; - - narinfoNameChars = lib.strings.stringToCharacters narinfoName; - - narinfoPath = lib.concatStringsSep "/" [ - (builtins.head nodes.minio.services.minio.dataDir) - bucket - "store/narinfo" - (lib.lists.elemAt narinfoNameChars 0) - ((lib.lists.elemAt narinfoNameChars 0) + (lib.lists.elemAt narinfoNameChars 1)) - narinfoName - "xl.meta" - ]; - in '' harmonia.start() minio.start() @@ -184,13 +165,5 @@ in client0.wait_until_succeeds("curl -f http://ncps0:8501/ | grep '\"hostname\":\"${toString nodes.ncps0.services.ncps.cache.hostName}\"' >&2") client1.wait_until_succeeds("curl -f http://ncps1:8501/ | grep '\"hostname\":\"${toString nodes.ncps1.services.ncps.cache.hostName}\"' >&2") - - client0.succeed("cat /etc/nix/nix.conf >&2") - client0.succeed("nix-store --realise ${pkgs.emptyFile}") - - client1.succeed("cat /etc/nix/nix.conf >&2") - client1.succeed("nix-store --realise ${pkgs.emptyFile}") - - minio.succeed("cat ${narinfoPath} >&2") ''; } diff --git a/nixos/tests/ncps.nix b/nixos/tests/ncps.nix index c2528e55b136..ecda50d5f92d 100644 --- a/nixos/tests/ncps.nix +++ b/nixos/tests/ncps.nix @@ -63,23 +63,6 @@ testScript = { nodes, ... }: - let - narinfoName = - (lib.strings.removePrefix "/nix/store/" ( - lib.strings.removeSuffix "-empty-file" pkgs.emptyFile.outPath - )) - + ".narinfo"; - - narinfoNameChars = lib.strings.stringToCharacters narinfoName; - - narinfoPath = lib.concatStringsSep "/" [ - nodes.ncps.services.ncps.cache.storage.local - "store/narinfo" - (lib.lists.elemAt narinfoNameChars 0) - ((lib.lists.elemAt narinfoNameChars 0) + (lib.lists.elemAt narinfoNameChars 1)) - narinfoName - ]; - in '' start_all() @@ -92,6 +75,9 @@ client.succeed("cat /etc/nix/nix.conf >&2") client.succeed("nix-store --realise ${pkgs.emptyFile}") - ncps.succeed("cat ${narinfoPath} >&2") + # Verify that the NAR file exists in the cache storage + # We query the NAR hash from the client and then check if a file with that hash exists in the ncps storage + nar_hash = client.succeed("nix-store -q --hash ${pkgs.emptyFile}").strip().split(":")[1] + ncps.succeed(f"find ${nodes.ncps.services.ncps.cache.storage.local} -type f | grep {nar_hash}") ''; } diff --git a/pkgs/by-name/nc/ncps/package.nix b/pkgs/by-name/nc/ncps/package.nix index e857a342c383..b926379be6d0 100644 --- a/pkgs/by-name/nc/ncps/package.nix +++ b/pkgs/by-name/nc/ncps/package.nix @@ -33,16 +33,16 @@ let finalAttrs = { pname = "ncps"; - version = "0.7.3"; + version = "0.8.2"; src = fetchFromGitHub { owner = "kalbasit"; repo = "ncps"; tag = "v${finalAttrs.version}"; - hash = "sha256-6mpEe0i5NYQb5WK2/478VFkMNa6xqAIU1uwwhH2zc2M="; + hash = "sha256-1VWEN1HYV52H/LCfAvFv3R9DxQbHNRnyay3p2BY8dCg="; }; - vendorHash = "sha256-nnt4HIG4Fs7RhHjVb7mYJ39UgvFKc46Cu42cURMmr1s="; + vendorHash = "sha256-AcgC+zTS3eVsbcs0jim4zDBGc3lIjwPbdVT7/KQ9Lkc="; ldflags = [ "-X github.com/kalbasit/ncps/pkg/ncps.Version=v${finalAttrs.version}"