This commit is contained in:
shimun 2020-12-12 14:43:22 +01:00
parent c02abb516c
commit a91d1225d9
Signed by: shimun
GPG Key ID: E81D8382DC2F971B
2 changed files with 7 additions and 3 deletions

2
bp.sh
View File

@ -5,5 +5,5 @@ GPG_ARGS="$([ ! -z "$BROWNPAPER_KEY" ] && echo "--local-user $BROWNPAPER_KEY")"
if [ ! -z "$1" ]; then
printf "$1" | gpg --sign -a $GPG_ARGS | curl -s --data @- -X POST $BP_ENDPOINT/new -Ls $CURL_ARGS
else
gpg --sign -a $GPG_ARGS | curl -s --data @- -X POST $BROWNPAPER_ENDPOINT/new -Ls $CURL_ARGS
gpg --sign -a $GPG_ARGS | curl -s --data @- -X POST $BP_ENDPOINT/new -Ls $CURL_ARGS
fi

View File

@ -5,7 +5,7 @@
, src ? (builtins.filterSource (path: type: baseNameOf path != "target") ./.)
}:
let
crate2nix_tools = import "${builtins.fetchTarball { url = "https://github.com/kolloch/crate2nix/archive/0.8.0.tar.gz"; sha256 = "17mmf5sqn0fmpqrf52icq92nf1sy5yacwx9vafk43piaq433ba56"; }}/tools.nix" { };
crate2nix_tools = import "${builtins.fetchTarball { url = "https://github.com/kolloch/crate2nix/archive/0.8.0.tar.gz"; sha256 = "17mmf5sqn0fmpqrf52icq92nf1sy5yacwx9vafk43piaq433ba56"; }}/tools.nix" { inherit pkgs; };
overrides = pkgs.defaultCrateOverrides // rec {
nettle-sys = attrs: with pkgs; {
nativeBuildInputs = [ clang nettle pkg-config ];
@ -17,4 +17,8 @@ let
};
brownpaper = sequoia-openpgp; # requires gmp as well
};
in callPackage (crate2nix_tools.generatedCargoNix { inherit name src; }) { inherit pkgs stdenv; defaultCrateOverrides = overrides; }
client = pkgs.writeShellScript "brownpaper" ''
PATH=$PATH:${pkgs.gnupg}/bin/:${pkgs.curl}/bin/ ${./bp.sh} $@
'';
in
{ server = (crate2nix_tools.generatedCargoNix { inherit name src; }); inherit client; }