forked from dwarfmaster/arkenfox-nixos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
92 lines (82 loc) · 2.67 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
91
92
{
description = "Utilities to use arkenfox's user.js for Firefox";
inputs = {
nixpkgs.url = "nixpkgs/release-21.11";
master = {
url = "github:arkenfox/user.js";
flake = false;
};
"100.0" = {
url = "github:arkenfox/user.js/v100";
flake = false;
};
"99.0" = {
url = "github:arkenfox/user.js/99.0";
flake = false;
};
"98.0" = {
url = "github:arkenfox/user.js/98.0";
flake = false;
};
"97.0" = {
url = "github:arkenfox/user.js/97.0";
flake = false;
};
"96.0" = {
url = "github:arkenfox/user.js/96.0";
flake = false;
};
"95.0" = {
url = "github:arkenfox/user.js/95.0";
flake = false;
};
"94.0" = {
url = "github:arkenfox/user.js/94.0";
flake = false;
};
"93.0" = {
url = "github:arkenfox/user.js/93.0";
flake = false;
};
};
outputs = inputs@{ self, nixpkgs, ... }:
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
inherit (pkgs) lib callPackage;
inherit (lib) mapAttrs mapAttrs' nameValuePair;
js = builtins.removeAttrs inputs [ "self" "nixpkgs" ];
extractor = callPackage ./extractor { };
extract = import ./extractor/extract.nix { inherit pkgs extractor; };
versions = builtins.attrNames js;
docs = pkgs:
(mapAttrs'
(version: extracted: nameValuePair "arkenfox-v${version}-doc-static"
(pkgs.callPackage ./doc { inherit extracted version; }))
self.lib.arkenfox.extracted)
// (mapAttrs'
(version: extracted: nameValuePair "arkenfox-v${version}-doc"
(pkgs.callPackage ./doc { inherit extracted version; css = "/style.css"; }))
self.lib.arkenfox.extracted);
type = extracted: import ./type.nix { inherit extracted pkgs; lib = pkgs.lib; };
in {
packages.x86_64-linux = {
arkenfox-extractor = extractor;
arkenfox-doc-css = pkgs.writeText "style.css" (builtins.readFile ./doc/style.css);
} // (docs pkgs);
defaultPackage.x86_64-linux = extractor;
overlays = {
arkenfox = final: prev: ({
arkenfox-extractor = prev.callPackage ./extractor { };
arkenfox-doc-css = pkgs.writeText "style.css" (builtins.readFile ./doc/style.css);
} // (docs prev));
};
overlay = self.overlays.arkenfox;
lib.arkenfox = {
supportedVersions = versions;
extracted = mapAttrs (_: v: import "${extract v}") js;
types = mapAttrs (_: type) self.lib.arkenfox.extracted;
};
hmModules.arkenfox = import ./hm.nix self.lib.arkenfox.extracted;
hmModule = self.hmModules.arkenfox;
};
}