Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
73 lines (66 loc) · 1.99 KB
/
Copy pathflake.nix
File metadata and controls
73 lines (66 loc) · 1.99 KB
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
{
description = "Official Flixur plugins repository";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
flake-utils.url = "github:numtide/flake-utils";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
flixur = {
url = "git+https://forge.xela.codes/xela/flixur.git";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
flake-utils,
flixur,
treefmt-nix,
}:
{
# default overlay exposing all packages under a flixurPlugins set
overlays.default = final: prev: {
flixurPlugins = import ./default.nix final;
};
}
# expose each plugin as a package too
// flake-utils.lib.eachDefaultSystem (
system:
let
lib = nixpkgs.lib;
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
treefmtEval = treefmt-nix.lib.evalModule pkgs ./treefmt.nix;
pluginkitManifestSchema = "${flixur}/pluginkit/manifest.schema.json";
in
{
packages = pkgs.flixurPlugins;
# validate plugin manifests against the schema
checks.manifests =
let
plugins = lib.filterAttrs (
name: type: type == "directory" && builtins.pathExists "${./.}/${name}/manifest.json"
) (builtins.readDir ./.);
in
pkgs.runCommand "check-manifests"
{
nativeBuildInputs = [ pkgs.check-jsonschema ];
}
''
for manifest in ${
lib.escapeShellArgs (lib.mapAttrsToList (name: _: "${./.}/${name}/manifest.json") plugins)
}; do
check-jsonschema --schemafile ${pluginkitManifestSchema} "$manifest"
done
touch $out
'';
formatter = treefmtEval.config.build.wrapper;
checks.format = treefmtEval.config.build.check self;
}
);
}