20 lines
660 B
Nix
20 lines
660 B
Nix
|
{ 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;
|
||
|
})
|