-
Notifications
You must be signed in to change notification settings - Fork 5
/
flake.nix
90 lines (76 loc) · 2.65 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
description = "Nix with a modified frontend, by dramforever";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
nixConfig = {
extra-substituters = [ "https://dram.cachix.org" ];
extra-trusted-public-keys = [ "dram.cachix.org-1:baoy1SXpwYdKbqdTbfKGTKauDDeDlHhUpC+QuuILEMY=" ];
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system: rec {
checks = {
inherit (packages)
# nix-dram-progress # broken
nix-dram
nix-search nix-search-pretty
nix-nar-listing;
};
defaultPackage = packages.nix-dram;
defaultApp = apps.nix-dram;
apps = {
nix-dram = {
type = "app";
program = "${packages.nix-dram}/bin/nix";
};
default = apps.nix-dram;
};
packages =
let pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
in {
inherit (pkgs)
nix-dram nix-dram-progress
nix-search nix-search-pretty
nix-nar-listing;
default = packages.nix-dram;
};
}) // {
overlay = final: prev: {
nix-search-pretty =
final.haskellPackages.callPackage ./nix-search-pretty {};
nix-nar-listing =
final.haskellPackages.callPackage ./nix-nar-listing {};
make-nix-dram = { nix }: nix.overrideAttrs (old: {
name = "nix-dram-" + old.version;
patches = (old.patches or []) ++ [
./nix-patches/nix-flake-default.patch
./nix-patches/nix-search-meta.patch
./nix-patches/nix-environment.patch
];
});
nix-dram = final.make-nix-dram {
nix = final.nixVersions.latest;
};
nix-dram-progress = final.callPackage ({ nix }: nix.overrideAttrs (old: {
name = "nix-dram-" + old.version;
patches = (old.patches or []) ++ [
./nix-patches/nix-flake-default.patch
./nix-patches/nix-search-meta.patch
./nix-patches/nix-environment.patch
(final.fetchpatch {
name = "nix-progress.diff";
url = "https://github.com/NixOS/nix/compare/480426a...1af0a16.diff";
sha256 = "sha256-vR7kGQMLHcf2qnaycyrv8h9M5iZjIC+GxD9kfqM3lzQ=";
})
];
})) {
nix = final.nixVersions.latest;
};
nix-search = final.writeShellScriptBin "nix-search" ''
${final.nix-dram}/bin/nix search --json "$@" | ${final.nix-search-pretty}/bin/nix-search-pretty
'';
};
};
}