noise-rs/flake.nix

62 lines
1.8 KiB
Nix
Raw Normal View History

2025-06-07 11:24:20 +02:00
{
inputs = {
naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
2025-06-13 13:09:18 +02:00
outputs =
{
self,
nixpkgs,
utils,
naersk,
}:
utils.lib.eachDefaultSystem (
system:
2025-06-07 11:24:20 +02:00
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
in
{
2025-06-18 09:30:08 +02:00
packages.default = naersk-lib.buildPackage rec {
2025-06-15 19:12:07 +02:00
src = ./.;
nativeBuildInputs = with pkgs; [
libnotify
2025-07-02 23:07:43 +02:00
installShellFiles
2025-06-15 19:12:07 +02:00
];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath nativeBuildInputs;
RUST_SRC_PATH = pkgs.rustPlatform.rustLibSrc;
2025-07-02 23:07:43 +02:00
postInstall =
with pkgs;
lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
# installShellCompletion --cmd noise \
# --bash <($out/bin/fd --generate-completions bash) \
# --fish <($out/bin/fd --generate-completions fish)
# installShellCompletion --zsh contrib/completion/_fd
installShellCompletion --cmd noise \
--bash <($out/bin/noise --generate-completions bash) \
--zsh <($out/bin/noise --generate-completions zsh) \
--fish <($out/bin/noise --generate-completions fish)
'';
2025-06-15 19:12:07 +02:00
};
2025-06-13 13:09:18 +02:00
devShell =
with pkgs;
mkShell {
buildInputs = [
cargo
rustc
rustfmt
pre-commit
rustPackages.clippy
libnotify
];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
2025-06-15 19:12:07 +02:00
RUST_BACKTRACE = 1;
2025-06-13 13:09:18 +02:00
};
2025-06-07 11:24:20 +02:00
}
);
}