Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
61 lines (55 loc) · 1.98 KB
/
Copy pathflake.nix
File metadata and controls
61 lines (55 loc) · 1.98 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
{
description = "Maple: self-hosted OpenTelemetry ingest, storage and dashboard (Maple Local)";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs =
{ self, nixpkgs }:
let
lib = nixpkgs.lib;
release = lib.importJSON ./nix/release.json;
# Platforms the pinned release has a bundle for, among those nixpkgs still
# supports (unstable dropped x86_64-darwin in 26.11).
systems = lib.intersectLists [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
] (builtins.attrNames release.assets);
linuxSystems = lib.filter (lib.hasSuffix "-linux") systems;
forAll = list: f: lib.genAttrs list (system: f system);
# Maple is FSL-1.1-ALv2, which nixpkgs counts as unfree; building it from
# this flake should not require a global allowUnfree.
mapleFor = pkgs: pkgs.callPackage ./nix/package.nix { };
pkgsFor =
system:
import nixpkgs {
inherit system;
config.allowUnfreePredicate = pkg: lib.getName pkg == "maple";
};
in
{
packages = forAll systems (
system:
let
maple = mapleFor (pkgsFor system);
in
{
inherit maple;
default = maple;
}
);
# Builds from the consumer's nixpkgs, so it needs maple allowed there:
# nixpkgs.config.allowUnfreePredicate = p: lib.getName p == "maple";
overlays.default = final: _prev: { maple = mapleFor final; };
nixosModules.maple = import ./nix/module.nix {
defaultPackage = pkgs: self.packages.${pkgs.stdenv.hostPlatform.system}.maple;
};
nixosModules.default = self.nixosModules.maple;
checks = forAll linuxSystems (system: {
package = self.packages.${system}.maple;
nixos = import ./nix/test.nix {
pkgs = pkgsFor system;
module = self.nixosModules.maple;
};
});
formatter = forAll systems (system: (pkgsFor system).nixfmt);
};
}