package release script

This commit is contained in:
Pim Kunis 2024-04-27 00:26:02 +02:00
parent 993a0da9e7
commit 0fbc5c8d8d
2 changed files with 20 additions and 0 deletions

View file

@ -21,5 +21,6 @@
./blog-pim.nix
./forgejo-nix-action.nix
./atticd.nix
./release.nix
];
}

19
release.nix Normal file
View file

@ -0,0 +1,19 @@
{ nixpkgs, flutils, ... }: flutils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
createScript = name: runtimeInputs: scriptPath:
let
script = (pkgs.writeScriptBin name (builtins.readFile scriptPath)).overrideAttrs (old: {
buildCommand = "${old.buildCommand}\n patchShebangs $out";
});
in
pkgs.symlinkJoin {
inherit name;
paths = [ script ] ++ runtimeInputs;
buildInputs = [ pkgs.makeWrapper ];
postBuild = "wrapProgram $out/bin/${name} --set PATH $out/bin";
};
in
{
packages.release = createScript "release" (with pkgs; [ nix docker-client git ]) ./release.sh;
})