timers/flake.nix

33 lines
1.1 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
naersk.url = "github:nix-community/naersk/master";
naersk.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, utils, naersk }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
in
{
packages.default = naersk-lib.buildPackage {
src = pkgs.lib.sourceFilesBySuffices ./. [ ".rs" ".toml" ".lock" ];
nativeBuildInputs = with pkgs; [ installShellFiles ];
meta.mainProgram = "timers";
postInstall = ''
installShellCompletion --cmd timers \
--bash <($out/bin/timers completions bash) \
--fish <($out/bin/timers completions fish) \
--zsh <($out/bin/timers completions zsh) \
'';
};
devShells.default = with pkgs; mkShell {
buildInputs = [ cargo rustc rustfmt pre-commit rustPackages.clippy rust-analyzer ];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
});
}