timers/flake.nix

35 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2023-06-20 20:12:02 +02:00
{
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 {
2023-08-26 09:33:48 +02:00
src = pkgs.lib.sourceFilesBySuffices ./. [ ".rs" ".toml" ".lock" ];
2023-08-25 18:18:45 +02:00
nativeBuildInputs = with pkgs; [ installShellFiles ];
meta.mainProgram = "timers";
2023-08-25 18:18:45 +02:00
postInstall = ''
2023-08-26 09:35:02 +02:00
$out/bin/timers manpage timers.1
installManPage timers.1
2023-08-25 18:18:45 +02:00
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 {
2023-06-20 20:12:02 +02:00
buildInputs = [ cargo rustc rustfmt pre-commit rustPackages.clippy rust-analyzer ];
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
});
}