summaryrefslogtreecommitdiff
path: root/nixos/modules/openrc.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/openrc.nix')
-rw-r--r--nixos/modules/openrc.nix59
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}"
+ '';
+ };
+
+}