{ config, lib, pkgs, ... }: let substituteDirectory = args: pkgs.stdenvNoCC.mkDerivation ({ name = if args ? name then args.name else baseNameOf (toString args.src); builder = ./substitute-dir.sh; preferLocalBuild = true; allowSubstitutes = false; } // args); in { environment.etc = { "syndicate/boot".source = substituteDirectory { src = ./boot; getty = "${pkgs.busybox}/bin/busybox getty"; inherit (config.services.getty) loginProgram; }; "syndicate/core".source = substituteDirectory { src = ./core; hostnameOneShot = "${pkgs.busybox}/bin/busybox hostname ${config.networking.hostName}"; inherit (pkgs) mdevd; mdevdConf = pkgs.writeText "mdevd.conf" '' -$MODALIAS=.* 0:0 660 +importas -iu MODALIAS MODALIAS ${pkgs.kmod}/bin/modprobe -q $MODALIAS ''; mdevdPath = lib.strings.makeBinPath [ pkgs.execline pkgs.busybox ]; }; }; }