forked from kyu08/fzf-make
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
51 lines (45 loc) · 1.52 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
46
47
48
49
50
51
{
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);
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"tree-sitter-just-0.0.1" = "sha256-b42Dt9X0gaHjywb+tahNomGfDx9ZP+roudNuGAhKYPg=";
};
};
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";
src = ./.;
inherit (cargoTOML.package) version;
inherit cargoLock;
nativeBuildInputs = [ pkgs.makeBinaryWrapper ];
postInstall =
let
runtimeDeps = with pkgs; [ gnugrep gnumake ];
in
''
wrapProgram $out/bin/fzf-make \
--set SHELL ${pkgs.runtimeShell} \
--suffix PATH : ${pkgs.lib.makeBinPath runtimeDeps}
'';
};
default = fzf-make;
};
});
}