timers/flake.nix

33 lines
1.1 KiB
Nix
Raw Permalink Normal View History

2023-06-20 20:12:02 +02:00
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
2023-08-26 09:40:12 +02:00
naersk.url = "github:nix-community/naersk/master";
naersk.inputs.nixpkgs.follows = "nixpkgs";
2023-06-20 20:12:02 +02:00
};
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 = ''
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;
};
});
}