diff --git a/flake.nix b/flake.nix index 2de4b25..50ad703 100644 --- a/flake.nix +++ b/flake.nix @@ -21,5 +21,6 @@ ./blog-pim.nix ./forgejo-nix-action.nix ./atticd.nix + ./release.nix ]; } diff --git a/release.nix b/release.nix new file mode 100644 index 0000000..ba68cc9 --- /dev/null +++ b/release.nix @@ -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; +})