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.

systemd.nix 1.0KB

123456789101112131415161718192021222324252627282930313233
  1. { config, pkgs, lib, ... }:
  2. with lib; {
  3. options.systemd.services = lib.mkOption {
  4. type = types.attrsOf (types.submodule ({ name, config, ... }: {
  5. options.genode.enable = lib.mkOption {
  6. type = types.bool;
  7. default = false;
  8. description = "Translate this systemd unit to a Genode subsystem.";
  9. };
  10. }));
  11. };
  12. config.services.klogd.enable = false;
  13. # The default is determined by checking the Linux version
  14. # which cannot be evaluated here.
  15. config.genode.init.subinits = mapAttrs' (name: service:
  16. let name' = "services." + name;
  17. in {
  18. name = name';
  19. value = {
  20. inputs = with pkgs; with genodePackages; [ bash libc posix vfs_pipe ];
  21. configFile = pkgs.writeText "${name'}.dhall" ''
  22. ${./systemd-runner.dhall} {
  23. , coreutils = "${pkgs.coreutils}"
  24. , execStart = "${toString service.serviceConfig.ExecStart}"
  25. }
  26. '';
  27. };
  28. }) (filterAttrs (name: service: service.genode.enable)
  29. config.systemd.services);
  30. }