From 4c0a4740a76ce61b419d51336073764284118aaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sat, 9 Apr 2022 16:23:35 +0200 Subject: WIP --- nixos/modules/openrc.nix | 59 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 nixos/modules/openrc.nix (limited to 'nixos/modules/openrc.nix') diff --git a/nixos/modules/openrc.nix b/nixos/modules/openrc.nix new file mode 100644 index 0000000..7b68efc --- /dev/null +++ b/nixos/modules/openrc.nix @@ -0,0 +1,59 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + + options = { + + rc = { + conf = { + parallel = mkOption { + type = types.bool; + default = false; + description = '' + If you want the rc system to try and start services in parallel for + a slight speed improvement. When running in parallel we prefix the + service output with its name as the output will get jumbled up. + ''; + }; + interactive = mkOption { + type = types.bool; + default = false; + description = '' + Set to true and you'll be able to press the I key during boot so you + can choose to start specific services. Set to false to disable this + feature. This feature is automatically disabled if rc_parallel is + set to false. + ''; + }; + logger = mkOption { + type = types.bool; + default = true; + description = '' + Logger launches a logging daemon to log the entire rc process to + /var/log/rc.log + NOTE: Linux systems require the devfs service to be started before + logging can take place and as such cannot log the sysinit runlevel. + ''; + }; + }; + }; + + }; + + + config = let + + rc_bool = enabled: if enabled then "YES" else "NO"; + + in { + environment.etc."rc.conf".text = '' + # Global OpenRC configuration settings + rc_parallel="${rc_bool config.rc.conf.parallel}" + rc_interactive="${rc_bool config.rc.conf.interactive}" + rc_logger="${rc_bool config.rc.conf.logger}" + ''; + }; + +} -- cgit v1.2.3