-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
68 lines (67 loc) · 2.08 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
description = "fzf-raindrop";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
fzf-raindrop = pkgs.stdenv.mkDerivation {
name = "fzf-raindrop";
src = ./.;
nativeBuildInputs = [ pkgs.makeWrapper ];
postFixup = with pkgs; ''
wrapProgram "$out/bin/fzf-raindrop" \
--prefix PATH : "${lib.makeBinPath [ duckdb fzf jq ]}"
'';
installPhase = ''
mkdir -p $out/bin
cp fzf-raindrop $out/bin/fzf-raindrop
chmod +x $out/bin/fzf-raindrop
'';
meta = {
description = "fzf-raindrop";
homepage = "https://github.com/thenbe/fzf-raindrop";
license = pkgs.lib.licenses.gpl3;
};
};
in
{
packages.default = fzf-raindrop;
apps.default = { program = "${fzf-raindrop}/bin/fzf-raindrop"; type = "app"; };
devShells.default = with pkgs; mkShell {
packages = [
sleek # sql formatter
];
};
devShells.demo =
let
pypkgs = pkgs.python311Packages;
in
pkgs.mkShell {
venvDir = "./venv";
packages = [
pypkgs.python
pypkgs.venvShellHook
pypkgs.pandas
pypkgs.faker
];
postVenvCreation = ''
unset SOURCE_DATE_EPOCH
'';
postShellHook = ''
unset SOURCE_DATE_EPOCH
'';
shellHook = ''
echo "Entering demo environment"
echo "Setting 'FZF_RAINDROP_DATA_DIR' to $(pwd)/generated"
export FZF_RAINDROP_DATA_DIR=$(pwd)/generated
mkdir -p generated
echo 'Next step: Launch a demo by running: `python fake.py && nix run .`'
'';
};
}
);
}