From 5b0df5aee24d664ef25f8ef2b091c0b71df5cc0c Mon Sep 17 00:00:00 2001 From: catvayor Date: Thu, 26 Sep 2024 17:38:59 +0200 Subject: [PATCH] feat(seedrng): use it --- modules/s6/default.nix | 4 +++- modules/s6/scripts/rc.init | 2 ++ modules/s6/scripts/rc.shutdown | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/s6/default.nix b/modules/s6/default.nix index cd05de7..14de5ba 100644 --- a/modules/s6/default.nix +++ b/modules/s6/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: let inherit (pkgs) execline @@ -31,6 +31,8 @@ let mkdir $out cp -r $src $out/scripts chmod -R +w $out + substituteInPlace $out/scripts/{rc.init,rc.shutdown} \ + --replace-warn 'pkgs.seedrng' "${lib.getExe' pkgs.seedrng "seedrng"}" ''; }; service = dir { diff --git a/modules/s6/scripts/rc.init b/modules/s6/scripts/rc.init index c098ffb..59ffc8c 100755 --- a/modules/s6/scripts/rc.init +++ b/modules/s6/scripts/rc.init @@ -32,6 +32,8 @@ else mkdir -m 0751 -p /run/services/state fi +pkgs.seedrng + ### If your services are managed by s6-rc: ### (replace /run/service with your scandir) s6-rc-init -d -c /etc/s6-rc/compiled /run/service diff --git a/modules/s6/scripts/rc.shutdown b/modules/s6/scripts/rc.shutdown index 81fac67..15e88ac 100755 --- a/modules/s6/scripts/rc.shutdown +++ b/modules/s6/scripts/rc.shutdown @@ -4,6 +4,7 @@ ### Things to do before hardware halt/reboot/poweroff. ### Ideally, it should be a single call to the service manager, ### telling it to bring all the services down. +pkgs.seedrng ### If your s6-linux-init-maker invocation was made with the -1 ### option, messages from rc.shutdown will appear on /dev/console