Skip to content

Commit be6e63f

Browse files
committed
nix: package extension that use node-gyp
1 parent ec7334e commit be6e63f

File tree

4 files changed

+26
-13
lines changed

4 files changed

+26
-13
lines changed

extensions/dbus/package.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{ mkVicinaeExtension, node-gyp }:
2+
mkVicinaeExtension {
3+
name = "dbus";
4+
src = ./.;
5+
buildInputs = [ node-gyp ];
6+
}

extensions/systemd/package.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{ mkVicinaeExtension, node-gyp }:
2+
mkVicinaeExtension {
3+
name = "systemd";
4+
src = ./.;
5+
buildInputs = [ node-gyp ];
6+
}

flake.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,22 @@
4141
in
4242
{
4343
packages = forEachSystem (
44-
{ system, ... }:
44+
{ pkgs, system }:
4545
lib.pipe (builtins.readDir ./extensions) [
4646
(lib.filterAttrs (_name: type: type == "directory"))
4747
(lib.mapAttrs (
4848
name: _type:
49-
vicinae.packages.${system}.mkVicinaeExtension {
50-
pname = name;
51-
src = ./extensions/${name};
52-
}
49+
let
50+
inherit (vicinae.packages.${system}) mkVicinaeExtension;
51+
in
52+
if builtins.readDir ./extensions/${name} ? "package.nix" then
53+
pkgs.callPackage ./extensions/${name}/package.nix { inherit mkVicinaeExtension; }
54+
else
55+
mkVicinaeExtension {
56+
pname = name;
57+
src = ./extensions/${name};
58+
}
5359
))
54-
(lib.flip builtins.removeAttrs [
55-
# TODO: fails to build due to node-gyp
56-
"dbus"
57-
"systemd"
58-
])
5960
]
6061
);
6162

0 commit comments

Comments
 (0)