32 lines
795 B
Nix
32 lines
795 B
Nix
{ ... }:
|
|
let
|
|
sources = import ./nix/sources.nix;
|
|
nixpkgs = import sources.nixpkgs { };
|
|
gitignore = import sources.gitignore { };
|
|
|
|
rusty-parts = nixpkgs.pkgs.rustPlatform.buildRustPackage {
|
|
name = "zettel";
|
|
src = gitignore.gitignoreSource ./.;
|
|
|
|
# note: when updating, this needs to be set to all 1's so that Nix will
|
|
# re-fetch the dependencies from crates.io
|
|
cargoSha256 = "1mwljyqzxsmww7k33qc1c3wc0l3yr2q5xcim68m3hb4xprvyvhjp";
|
|
verifyCargoDeps = true;
|
|
};
|
|
in with nixpkgs;
|
|
stdenv.mkDerivation {
|
|
name = "zettel";
|
|
src = ./bin;
|
|
|
|
buildInputs = [ ];
|
|
buildPhase = "true";
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp * $out/bin
|
|
# do these second so rusty binaries will take precedence overy shelly ones.
|
|
cp ${rusty-parts}/bin/* $out/bin
|
|
'';
|
|
}
|
|
|