57 lines
1.5 KiB
Nix
57 lines
1.5 KiB
Nix
{
|
|
inputs = {
|
|
naersk.url = "github:nix-community/naersk/master";
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs =
|
|
{
|
|
nixpkgs,
|
|
utils,
|
|
naersk,
|
|
...
|
|
}:
|
|
utils.lib.eachDefaultSystem (
|
|
system:
|
|
let
|
|
pkgs = import nixpkgs { inherit system; };
|
|
naersk-lib = pkgs.callPackage naersk { };
|
|
in
|
|
{
|
|
packages.default = naersk-lib.buildPackage rec {
|
|
src = ./.;
|
|
nativeBuildInputs = with pkgs; [
|
|
libnotify
|
|
installShellFiles
|
|
];
|
|
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath nativeBuildInputs;
|
|
|
|
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
|
|
|
|
postInstall =
|
|
with pkgs;
|
|
lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
|
installShellCompletion --cmd noise \
|
|
--bash <($out/bin/noise --generate-completions bash) \
|
|
--zsh <($out/bin/noise --generate-completions zsh) \
|
|
--fish <($out/bin/noise --generate-completions fish)
|
|
'';
|
|
};
|
|
devShell =
|
|
with pkgs;
|
|
mkShell {
|
|
buildInputs = [
|
|
cargo
|
|
rustc
|
|
rustfmt
|
|
pre-commit
|
|
rustPackages.clippy
|
|
libnotify
|
|
];
|
|
RUST_SRC_PATH = rustPlatform.rustLibSrc;
|
|
RUST_BACKTRACE = 1;
|
|
};
|
|
}
|
|
);
|
|
}
|