stuff
This commit is contained in:
parent
7c96c25441
commit
95bd8269dc
11
flake.nix
11
flake.nix
|
@ -131,14 +131,19 @@
|
|||
|
||||
synit = simpleTest {
|
||||
name = "synit";
|
||||
nodes.machine = {
|
||||
nodes.machine = { config, lib, utils, ... }: {
|
||||
imports = [ self.nixosModules.synit ];
|
||||
|
||||
boot.initrd.verbose = true;
|
||||
environment.etc."syndicate/services/test-gateway.pr".text = ''
|
||||
<require-service <relay-listener <tcp "192.168.1.1" 9001> $gatekeeper>>
|
||||
<bind <ref { oid: "syndicate" key: #x"" }> $config #f>
|
||||
'';
|
||||
nixpkgs.pkgs = pkgs';
|
||||
synit.logProgram = "${pkgs.busybox}/bin/cat";
|
||||
};
|
||||
testScript = ''
|
||||
start_all()
|
||||
machine.wait_for_unit("foo.service")
|
||||
machine.wait_for_open_port(9001)
|
||||
'';
|
||||
};
|
||||
|
||||
|
|
|
@ -130,5 +130,5 @@ mkdir -p \
|
|||
# Start Synit.
|
||||
echo "starting Synit..."
|
||||
exec @synit_pid1@ \
|
||||
--log @synit_log@ \
|
||||
--log @logProgram@ \
|
||||
--server-path @syndicate_server@
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
|
||||
{
|
||||
options.synit.logProgram = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = pkgs.writeScript "synit-log" ''
|
||||
#!${pkgs.execline}/bin/execlineb -P
|
||||
foreground { ${pkgs.coreutils}/bin/mkdir -p /var/log/synit }
|
||||
${pkgs.s6}/bin/s6-log t /var/log/synit
|
||||
'';
|
||||
defaultText = "s6-log";
|
||||
};
|
||||
|
||||
config = {
|
||||
|
||||
system.build.bootStage2 = lib.mkForce (pkgs.substituteAll {
|
||||
|
@ -10,14 +20,10 @@
|
|||
isExecutable = true;
|
||||
inherit (config.boot) readOnlyNixStore;
|
||||
inherit (config.system.build) earlyMountScript;
|
||||
path = lib.makeBinPath [ pkgs.busybox pkgs.eudev pkgs.util-linux ];
|
||||
path = lib.makeBinPath [ pkgs.busybox pkgs.eudev pkgs.mdevd pkgs.util-linux ];
|
||||
inherit (pkgs) eudev;
|
||||
synit_pid1 = "${pkgs.synit-pid1}/bin/synit-pid1";
|
||||
synit_log = pkgs.writeScript "synit-log" ''
|
||||
#!${pkgs.execline}/bin/execlineb -P
|
||||
foreground { ${pkgs.coreutils}/bin/mkdir -p /var/log/synit }
|
||||
${pkgs.s6}/bin/s6-log t /var/log/synit
|
||||
'';
|
||||
inherit (config.synit) logProgram;
|
||||
syndicate_server = "${pkgs.syndicate-server}/bin/syndicate-server";
|
||||
|
||||
postBootCommands = pkgs.writeText "local-cmds" ''
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<require-service <daemon mdevd>>
|
||||
<daemon mdevd ["@mdevd@/bin/mdevd" "-v" "3"]>
|
||||
|
||||
<require-service <daemon mdevd-coldplug>>
|
||||
<depends-on <daemonmdevd-coldplug> <service-state <daemon mdevd> up>>
|
||||
<daemon mdevd-coldplug <one-shot ["@mdevd@/bin/mdevd-coldplug" "-v" "3"]>>
|
|
@ -19,8 +19,7 @@ in {
|
|||
|
||||
"syndicate/core".source = substituteDirectory {
|
||||
src = ./core;
|
||||
udevd = "${pkgs.eudev}/bin/udevd";
|
||||
udevadm = "${pkgs.eudev}/bin/udevadm";
|
||||
inherit (pkgs) mdevd;
|
||||
hostnameOneShot =
|
||||
"${pkgs.busybox}/bin/busybox hostname ${config.networking.hostName}";
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue