pkgs/den-http-get-updater: support list to prefetch

This commit is contained in:
Wroclaw 2025-04-07 18:37:34 +02:00
parent b188a5239c
commit 5cedeec18c
2 changed files with 90 additions and 43 deletions

View file

@ -10,14 +10,16 @@ let self = {
url = "https://github.com/nix-community/nixos-vscode-server/archive/${lock.nixos-vscode-server.revision}.tar.gz";
updateScript = pkgs.den-http-get-updater {
fileLocation = lockFile;
previousHash = lock.nixos-vscode-server.sha256;
previousVersion = lock.nixos-vscode-server.revision;
versionUrl = "https://api.github.com/repos/nix-community/nixos-vscode-server/commits";
contentParser = "jq -rc '.[0].sha' <<< \"$newVersion\"";
prefetchUrlLocation = {
file = ./inputs.nix;
attrpath = "nixos-vscode-server.url";
};
prefetchList = [{
previousHash = lock.nixos-vscode-server.sha256;
prefetchUrlLocation = {
file = ./inputs.nix;
attrpath = "nixos-vscode-server.url";
};
}];
};
outPath = builtins.fetchTarball {
inherit url;
@ -29,13 +31,15 @@ let self = {
url = "https://github.com/NixOS/nixpkgs/archive/${lock.nixpkgs.revision}.tar.gz";
updateScript = pkgs.den-http-get-updater {
fileLocation = lockFile;
previousHash = lock.nixpkgs.sha256;
previousVersion = lock.nixpkgs.revision;
versionUrl = "https://channels.nixos.org/nixos-24.11/git-revision";
prefetchUrlLocation = {
file = ./inputs.nix;
attrpath = "nixpkgs.url";
};
prefetchList = [{
previousHash = lock.nixpkgs.sha256;
prefetchUrlLocation = {
file = ./inputs.nix;
attrpath = "nixpkgs.url";
};
}];
};
outPath = builtins.fetchTarball {
inherit url;
@ -47,13 +51,15 @@ let self = {
url = "https://github.com/NixOS/nixpkgs/archive/${lock.nixpkgs-unstable.revision}.tar.gz";
updateScript = pkgs.den-http-get-updater {
fileLocation = lockFile;
previousHash = lock.nixpkgs-unstable.sha256;
previousVersion = lock.nixpkgs-unstable.revision;
versionUrl = "https://channels.nixos.org/nixos-unstable/git-revision";
prefetchUrlLocation = {
file = ./inputs.nix;
attrpath = "nixpkgs-unstable.url";
};
prefetchList = [{
previousHash = lock.nixpkgs-unstable.sha256;
prefetchUrlLocation = {
file = ./inputs.nix;
attrpath = "nixpkgs-unstable.url";
};
}];
};
outPath = builtins.fetchTarball {
inherit url;
@ -65,14 +71,16 @@ let self = {
url = "https://github.com/lilyinstarlight/nixos-cosmic/archive/${lock.cosmic-modules.revision}.tar.gz";
updateScript = pkgs.den-http-get-updater {
fileLocation = lockFile;
previousHash = lock.cosmic-modules.sha256;
previousVersion = lock.cosmic-modules.revision;
versionUrl = "https://api.github.com/repos/lilyinstarlight/nixos-cosmic/commits";
contentParser = "jq -rc '.[0].sha' <<< \"$newVersion\"";
prefetchUrlLocation = {
file = ./inputs.nix;
attrpath = "cosmic-modules.url";
};
prefetchList = [{
previousHash = lock.cosmic-modules.sha256;
prefetchUrlLocation = {
file = ./inputs.nix;
attrpath = "cosmic-modules.url";
};
}];
};
outPath = builtins.fetchTarball {
inherit url;