-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
137 lines (116 loc) · 3.44 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
{
description = "My personal NUR repository";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
flake-linter = {
url = "gitlab:kira-bruneau/flake-linter";
inputs = {
flake-utils.follows = "flake-utils";
nixpkgs.follows = "nixpkgs";
};
};
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
nix-fast-build.url = "github:Mic92/nix-fast-build";
};
outputs =
{
flake-utils,
flake-linter,
nixpkgs,
nix-fast-build,
...
}:
{
overlays = import ./overlays;
nixosModules = import ./nixos/modules;
}
// flake-utils.lib.eachDefaultSystem (
system:
let
lib = nixpkgs.lib;
pkgs = import nixpkgs {
config = {
allowUnfreePredicate =
pkg:
builtins.elem (builtins.parseDrvName (lib.getName pkg)).name [
"anytype"
"anytype-heart"
"anytype-nmh"
"clonehero"
"habitica"
"habitica-client"
"jakirica"
"jakirica-client"
"virtualparadise"
];
};
inherit system;
};
flake-linter-lib = flake-linter.lib.${system};
paths = flake-linter-lib.partitionToAttrs flake-linter-lib.commonPaths (
builtins.filter (
path:
(builtins.all (ignore: !(lib.hasSuffix ignore path)) [
"pkgs/applications/audio/zynaddsubfx/default.nix"
"pkgs/tools/graphics/mangohud/default.nix"
])
) (flake-linter-lib.walkFlake ./.)
);
linter = flake-linter-lib.makeFlakeLinter {
root = ./.;
settings = {
markdownlint = {
paths = paths.markdown;
settings = {
MD013 = false;
};
};
nixf-tidy-fix = {
paths = paths.nix;
settings = {
variable-lookup = true;
};
};
nixfmt-rfc-style.paths = paths.nix;
prettier.paths = paths.markdown;
};
};
nurPkgs = import ./pkgs { inherit lib; } (pkgs // nurPkgs) pkgs;
flatNurPkgs = flake-utils.lib.flattenTree nurPkgs;
in
rec {
packages = flake-utils.lib.filterPackages system flatNurPkgs;
checks = packages // {
flake-linter = linter.check;
};
apps = {
sync = {
type = "app";
program = lib.getExe (
nurPkgs.callPackage ./maintainers/scripts/sync.nix {
nix-fast-build = nix-fast-build.packages.${system}.default;
inherit nixpkgs;
}
);
};
update = {
type = "app";
program = toString (
nurPkgs.callPackage ./maintainers/scripts/update.nix {
packages = builtins.concatMap (
name:
let
package = flatNurPkgs.${name};
attrPath = builtins.replaceStrings [ "/" ] [ "." ] name;
in
if package ? updateScript then [ { inherit package attrPath; } ] else [ ]
) (builtins.attrNames flatNurPkgs);
inherit nixpkgs;
}
);
};
inherit (linter) fix;
};
}
);
}