shell-customization #4

Open
lbailly wants to merge 61 commits from shell-customization into main
2 changed files with 37 additions and 0 deletions
Showing only changes of commit c24c659ee1 - Show all commits

24
modules/ubus/default.nix Normal file
View 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
View 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";
}