Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
59 lines (55 loc) · 1.52 KB
/
Copy pathflake.nix
File metadata and controls
59 lines (55 loc) · 1.52 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
{
description = "Visualization for Freifunk open mesh network nodes";
inputs = {
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst";
treefmt-nix = {
url = "github:numtide/treefmt-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
nixpkgs,
treefmt-nix,
self,
...
}:
let
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
];
forEachSupportedSystem =
f: nixpkgs.lib.genAttrs supportedSystems (system: f (import nixpkgs { inherit system; }));
treefmtEval = forEachSupportedSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
in
{
devShells = forEachSupportedSystem (pkgs: {
default = pkgs.mkShellNoCC {
packages = with pkgs; [
nodejs_26
typescript
prettier
];
};
});
packages = forEachSupportedSystem (
pkgs:
let
package = builtins.fromJSON (builtins.readFile ./package.json);
inherit (package) version;
src = ./.;
in
{
default = pkgs.callPackage ./nix/package.nix { inherit version src; };
}
);
formatter = forEachSupportedSystem (
pkgs: treefmtEval.${pkgs.stdenv.hostPlatform.system}.config.build.wrapper
);
checks = forEachSupportedSystem (pkgs: {
formatting = treefmtEval.${pkgs.stdenv.hostPlatform.system}.config.build.check self;
});
};
}