2
0
Fork 0
Genode Packages collection https://git.sr.ht/~ehmry/genodepkgs/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
genodepkgs/nixos-modules/systemd.nix

33 lines
1.0 KiB

{ config, pkgs, lib, ... }:
with lib; {
options.systemd.services = lib.mkOption {
type = types.attrsOf (types.submodule ({ name, config, ... }: {
options.genode.enable = lib.mkOption {
type = types.bool;
default = false;
description = "Translate this systemd unit to a Genode subsystem.";
};
}));
};
config.services.klogd.enable = false;
# The default is determined by checking the Linux version
# which cannot be evaluated here.
config.genode.init.subinits = mapAttrs' (name: service:
let name' = "services." + name;
in {
name = name';
value = {
inputs = with pkgs; with genodePackages; [ bash libc posix vfs_pipe ];
configFile = pkgs.writeText "${name'}.dhall" ''
${./systemd-runner.dhall} {
, coreutils = "${pkgs.coreutils}"
, execStart = "${toString service.serviceConfig.ExecStart}"
}
'';
};
}) (filterAttrs (name: service: service.genode.enable)
config.systemd.services);
}