-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
flake.nix
45 lines (40 loc) · 1.35 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
description = "fzf-make is the command line tool that execute make target using fuzzy finder with preview window.";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
cargoTOML = builtins.fromTOML (builtins.readFile ./Cargo.toml);
in
rec
{
devShells.default = pkgs.mkShell {
inputsFrom = [ packages.fzf-make ];
packages = with pkgs; [ rustfmt clippy typos ];
};
formatter = pkgs.nixpkgs-fmt;
packages = rec {
fzf-make = pkgs.rustPlatform.buildRustPackage {
pname = "fzf-make";
inherit (cargoTOML.package) version;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [ pkgs.makeBinaryWrapper ];
postInstall =
let
runtimeDeps = with pkgs; [ bat gnugrep gnumake ];
in
''
wrapProgram $out/bin/fzf-make \
--set SHELL ${pkgs.runtimeShell} \
--suffix PATH : ${pkgs.lib.makeBinPath runtimeDeps}
'';
};
default = fzf-make;
};
});
}