-
-
Notifications
You must be signed in to change notification settings - Fork 28
/
flake.nix
81 lines (67 loc) · 2.18 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
{
description = "nix-index database";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs =
{ self, nixpkgs, ... }:
let
inherit (nixpkgs) lib;
testSystems = [
"x86_64-linux"
"aarch64-linux"
];
systems = testSystems ++ [
"x86_64-darwin"
"aarch64-darwin"
];
mkPackages =
pkgs:
let
generated = import ./generated.nix;
nix-index-database =
(pkgs.fetchurl {
url = generated.url + pkgs.stdenv.system;
hash = generated.hashes.${pkgs.stdenv.system};
}).overrideAttrs
{
__structuredAttrs = true;
unsafeDiscardReferences.out = true;
};
in
{
inherit nix-index-database;
nix-index-with-db = pkgs.callPackage ./nix-index-wrapper.nix { inherit nix-index-database; };
comma-with-db = pkgs.callPackage ./comma-wrapper.nix { inherit nix-index-database; };
};
in
{
packages = lib.genAttrs systems (
system:
(mkPackages nixpkgs.legacyPackages.${system})
// {
default = self.packages.${system}.nix-index-with-db;
}
);
legacyPackages = builtins.mapAttrs (
systemName: systemPackages:
builtins.mapAttrs (
name: pkg:
lib.warn ''
nix-index-database's "legacyPackages.${systemName}.${name}" output is deprecated and will be removed
please switch to "packages.${systemName}.${name}" instead
'' pkg
) systemPackages
) self.packages;
overlays.nix-index = final: _prev: mkPackages final;
darwinModules.nix-index = import ./darwin-module.nix self;
hmModules.nix-index = import ./home-manager-module.nix self;
nixosModules.nix-index = import ./nixos-module.nix self;
checks = lib.genAttrs testSystems (
system:
import ./tests.nix {
inherit system nixpkgs;
nixIndexModule = self.nixosModules.nix-index;
}
);
formatter = lib.genAttrs systems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
};
}