diff options
author | Karel Kočí <cynerd@email.cz> | 2022-04-09 16:23:35 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2022-04-09 16:23:35 +0200 |
commit | 4c0a4740a76ce61b419d51336073764284118aaf (patch) | |
tree | 24f3f50a36cc66f37e849f47bdab3f0ab1852c97 /nixos/modules/openrc.nix | |
parent | 6a039e268369f7e9055e19d733849da26ab0208b (diff) | |
download | nix-openrc-4c0a4740a76ce61b419d51336073764284118aaf.tar.gz nix-openrc-4c0a4740a76ce61b419d51336073764284118aaf.tar.bz2 nix-openrc-4c0a4740a76ce61b419d51336073764284118aaf.zip |
Diffstat (limited to 'nixos/modules/openrc.nix')
-rw-r--r-- | nixos/modules/openrc.nix | 59 |
1 files changed, 59 insertions, 0 deletions
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}" + ''; + }; + +} |