forked from vicinaehq/extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
85 lines (77 loc) · 2.12 KB
/
flake.nix
File metadata and controls
85 lines (77 loc) · 2.12 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
74
75
76
77
78
79
80
81
82
83
84
85
{
description = "Extensions for the Vicinae launcher";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
vicinae = {
url = "github:vicinaehq/vicinae";
inputs = {
nixpkgs.follows = "nixpkgs";
systems.follows = "systems";
};
};
};
nixConfig = {
extra-substituters = [ "https://vicinae.cachix.org" ];
extra-trusted-public-keys = [ "vicinae.cachix.org-1:1kDrfienkGHPYbkpNj1mWTr7Fm1+zcenzgTizIcI3oc=" ];
};
outputs =
{
self,
nixpkgs,
systems,
vicinae,
}:
let
inherit (nixpkgs) lib;
forEachSystem =
f:
lib.genAttrs (import systems) (
system:
f {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
}
);
in
{
packages = forEachSystem (
{ system, pkgs, ... }:
lib.pipe (builtins.readDir ./extensions) [
(lib.filterAttrs (_name: type: type == "directory"))
(lib.mapAttrs (
name: _type:
vicinae.packages.${system}.mkVicinaeExtension {
pname = "vicinae-extension-${name}";
version = "0";
src = ./extensions/${name};
postPatch = ''
substituteInPlace tsconfig.json --replace "../../" "${./.}/"
'';
}
))
(lib.flip builtins.removeAttrs [
# TODO: fails to build due to node-gyp
"dbus"
"systemd"
])
]
);
# Build each package instead of just checking they are derivations
checks = forEachSystem ({ system, ... }: self.packages.${system});
devShells = forEachSystem (
{ pkgs, system }:
{
default = pkgs.mkShell {
packages = with pkgs; [
vicinae.packages.${system}.default
self.formatter.${system}
nodejs
typescript-language-server
];
};
}
);
formatter = forEachSystem ({ pkgs, ... }: pkgs.nixfmt-tree);
};
}