Skip to content
Snippets Groups Projects
Commit 9221812d authored by Jean-Paul Calderone's avatar Jean-Paul Calderone
Browse files

add a utility for making a nix release app

parent 49696f70
No related branches found
No related tags found
No related merge requests found
...@@ -54,6 +54,7 @@ A nix flake for use with Haskell, for Least Authority. ...@@ -54,6 +54,7 @@ A nix flake for use with Haskell, for Least Authority.
]; ];
}; };
packages = hslib.packages {}; packages = hslib.packages {};
apps.release = hslib.apps.release { };
}); });
} }
``` ```
...@@ -76,6 +76,24 @@ rec { ...@@ -76,6 +76,24 @@ rec {
}; };
apps = { apps = {
# Upload a candidate or (with `--publish`) publish a release.
release = { }: {
type = "app";
program = "${
pkgs.writeShellApplication {
name = "release";
runtimeInputs = with pkgs; [cabal-install];
text = ''
set -x
sdist=$(cabal sdist | tail -n 1)
haddocks=$(cabal haddock --haddock-for-hackage | tail -n 1)
cabal upload "$@" "$sdist"
cabal upload "$@" --documentation "$haddocks"
'';
}
}/bin/release";
};
# Create a program that runs hlint. # Create a program that runs hlint.
hlint = { hlint = {
# An argv to pass to hlint in addition to any arguments passed on the # An argv to pass to hlint in addition to any arguments passed on the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment