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
|
|
|
|
{
|
2023-08-25 16:48:52 +02:00
|
|
|
packages.default = naersk-lib.buildPackage {
|
|
|
|
src = ./.;
|
2023-08-25 18:18:45 +02:00
|
|
|
nativeBuildInputs = with pkgs; [ installShellFiles ];
|
2023-08-25 16:48:52 +02:00
|
|
|
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) \
|
|
|
|
'';
|
2023-08-25 16:48:52 +02:00
|
|
|
};
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
}
|