-
Notifications
You must be signed in to change notification settings - Fork 4
/
flake.nix
42 lines (38 loc) · 1.15 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.inputs.flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
ruby = pkgs.ruby_3_2.withPackages (ps: with ps; [ nokogiri ]);
deps = [ ruby pkgs.gnuplot pkgs.gnome3.eog pkgs.libertinus ];
in
{
devShells.default =
pkgs.mkShell {
nativeBuildInputs = deps;
};
packages.default =
pkgs.stdenv.mkDerivation {
pname = "nom";
version = "0.1.6";
src = ./.;
buildInputs = deps;
installPhase = ''
mkdir -p $out/{bin,share/nom}
cp -r lib bin $out/share/nom
bin=$out/bin/nom
cat > $bin <<EOF
#!/bin/sh -e
export PATH="${pkgs.gnuplot}/bin:${pkgs.gnome3.eog}/bin:$PATH"
exec ${ruby}/bin/ruby $out/share/nom/bin/nom "\$@"
EOF
chmod +x $bin
'';
};
}
);
}