-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
48 lines (46 loc) · 1.04 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
{
inputs = {
lib-aggregate = {
url = "github:nix-community/lib-aggregate";
};
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
};
outputs =
inputs:
let
inherit (inputs.lib-aggregate) lib;
diffingLambda =
pkgs:
pkgs.substituteAll {
name = "diffing";
src = ./diffing.py;
dir = "bin";
isExecutable = true;
strictexpr = ./assets/strict-expr.nix;
expr = ./assets/expr.nix;
# Minimal diffoscope should be enough.
diffoscope = lib.getExe pkgs.diffoscopeMinimal;
postInstall = ''
sed -i '1 i#!${pkgs.python3.interpreter}' $out/bin/diffing
'';
};
in
lib.flake-utils.eachDefaultSystem (
system:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
in
{
packages.default = diffingLambda pkgs;
}
)
// {
overlays.default = (
_: prev: {
diffing = diffingLambda prev;
}
);
};
}