This commit is contained in:
shimun 2020-12-27 20:19:11 +01:00
parent 45dd09183d
commit e860157ba3
Signed by: shimun
GPG Key ID: E81D8382DC2F971B
2 changed files with 30 additions and 2 deletions

View File

@ -22,8 +22,15 @@ let
buildInputs = [ gmp ];
};
};
client = pkgs.writeShellScriptBin "brownpaper" ''
PATH=${pkgs.bash}/bin/:${pkgs.gnupg}/bin/:${pkgs.curl}/bin/:$PATH ${./bp.sh} "$@"
client = with pkgs; runCommandLocal "brownpaper" {
script = ./bp.sh;
nativeBuildInputs = [ makeWrapper ];
} ''
makeWrapper $script $out/bin/brownpaper \
--prefix PATH : ${lib.makeBinPath [ bash curl gnupg ]}
'';
# client = pkgs.writeShellScriptBin "brownpaper" ''
# PATH=${pkgs.bash}/bin/:${pkgs.gnupg}/bin/:${pkgs.curl}/bin/:$PATH ${./bp.sh} "$@"
# '';
in
{ server = callPackage (crate2nix_tools.generatedCargoNix { inherit name; src = filteredSrc; }) { inherit pkgs; defaultCrateOverrides = overrides; }; inherit client; }

21
flake.nix Normal file
View File

@ -0,0 +1,21 @@
{
description = "Brownpaper pastebin";
outputs = { self, nixpkgs }: rec {
nixosModules.brownpaper = import ./mod.nix;
packages =
let
pkg = system:
let
pkgs = import nixpkgs { inherit system; };
bp = pkgs.callPackage ./default.nix { inherit pkgs; };
in
{ brownpaper = bp.client; };
in
{
"x86_64-linux" = pkg "x86_64-linux";
"aarch64-linux" = pkg "aarch64-linux";
"i686-linux" = pkg "i686-linux";
};
};
}