forked from DGNum/liminix
t #2
2 changed files with 37 additions and 0 deletions
24
modules/ubus/default.nix
Normal file
24
modules/ubus/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
## ubus
|
||||||
|
## ====
|
||||||
|
##
|
||||||
|
## ubus is a micro-bus à la D-Bus for all your needs.
|
||||||
|
|
||||||
|
{ lib, pkgs, config, ...}:
|
||||||
|
let
|
||||||
|
inherit (lib) mkOption types;
|
||||||
|
inherit (pkgs) liminix;
|
||||||
|
in {
|
||||||
|
options = {
|
||||||
|
system.service.ubus = mkOption {
|
||||||
|
type = liminix.lib.types.serviceDefn;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
config = {
|
||||||
|
system.service.ubus = liminix.callService ./service.nix {
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.ubus;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
13
modules/ubus/service.nix
Normal file
13
modules/ubus/service.nix
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
liminix
|
||||||
|
, writeText
|
||||||
|
, lib
|
||||||
|
}:
|
||||||
|
{ package } :
|
||||||
|
let
|
||||||
|
inherit (liminix.services) longrun;
|
||||||
|
in longrun {
|
||||||
|
# Long term: make it unique so that user can spawn multiple buses if they want.
|
||||||
|
name = "ubus";
|
||||||
|
run = "${package}/bin/ubusd";
|
||||||
|
}
|
Loading…
Reference in a new issue