-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathflake.nix
61 lines (49 loc) · 1.56 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
{
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: import ./default.nix { inherit pkgs; };
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);
};
}