timers/flake.nix

35 lines
1.2 KiB
Nix

{
inputs = {
naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
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 = ''
$out/bin/timers manpage timers.1
installManPage timers.1
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;
};
});
}