Remove compound process stuff, it was a bad idea
This commit is contained in:
parent
0a637bfb8a
commit
8acd35909f
|
@ -1,24 +0,0 @@
|
|||
{ pkgs ? import <nixpkgs> { inherit system; }
|
||||
, system ? builtins.currentSystem
|
||||
, stateDir ? "/var"
|
||||
, runtimeDir ? "${stateDir}/run"
|
||||
, logDir ? "${stateDir}/log"
|
||||
, cacheDir ? "${stateDir}/cache"
|
||||
, tmpDir ? (if stateDir == "/var" then "/tmp" else "${stateDir}/tmp")
|
||||
, forceDisableUserChange ? false
|
||||
, processManager
|
||||
, compoundProcessManager ? "supervisord"
|
||||
}:
|
||||
|
||||
let
|
||||
createCompoundProcess = import ../../nixproc/create-compound-process/create-compound-process.nix {
|
||||
inherit pkgs system stateDir logDir runtimeDir tmpDir forceDisableUserChange processManager;
|
||||
};
|
||||
in
|
||||
{
|
||||
webappsSystem = {
|
||||
pkg = import ./webapps-system.nix {
|
||||
inherit createCompoundProcess stateDir forceDisableUserChange compoundProcessManager;
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
{createCompoundProcess, compoundProcessManager, stateDir, forceDisableUserChange}:
|
||||
|
||||
createCompoundProcess {
|
||||
name = "webapps-system";
|
||||
stateDir = "${stateDir}/lib/webapps-system";
|
||||
exprFile = ../webapps-agnostic/processes.nix;
|
||||
inherit forceDisableUserChange;
|
||||
processManager = compoundProcessManager;
|
||||
overrides = {
|
||||
sysvinit.runlevels = [ 3 4 5 ];
|
||||
};
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
{pkgs, system, stateDir, logDir, runtimeDir, tmpDir, forceDisableUserChange, processManager}:
|
||||
|
||||
let
|
||||
createManagedProcess = import ../../nixproc/create-managed-process/agnostic/create-managed-process-universal.nix {
|
||||
inherit pkgs runtimeDir stateDir logDir tmpDir forceDisableUserChange processManager;
|
||||
};
|
||||
|
||||
compoundLogDir = logDir;
|
||||
compoundRuntimeDir = runtimeDir;
|
||||
in
|
||||
|
||||
{ name, exprFile
|
||||
, processManager
|
||||
, stateDir ? "/var"
|
||||
, runtimeDir ? "${stateDir}/run"
|
||||
, logDir ? "${stateDir}/log"
|
||||
, cacheDir ? "${stateDir}/cache"
|
||||
, tmpDir ? (if stateDir == "/var" then "/tmp" else "${stateDir}/tmp")
|
||||
, forceDisableUserChange ? false
|
||||
, path ? []
|
||||
, extraParams ? {}
|
||||
, overrides ? {}
|
||||
}:
|
||||
|
||||
let
|
||||
processArgs =
|
||||
if processManager == "sysvinit" then import ./generate-sysvinit-args.nix {
|
||||
inherit pkgs system exprFile stateDir runtimeDir logDir cacheDir tmpDir forceDisableUserChange extraParams;
|
||||
}
|
||||
else if processManager == "disnix" then import ./generate-disnix-args.nix {
|
||||
inherit pkgs system exprFile stateDir runtimeDir logDir cacheDir tmpDir forceDisableUserChange extraParams;
|
||||
}
|
||||
else if processManager == "bsdrc" then import ./generate-bsdrc-args.nix {
|
||||
inherit pkgs system exprFile stateDir runtimeDir logDir cacheDir tmpDir forceDisableUserChange extraParams;
|
||||
}
|
||||
else if processManager == "supervisord" then import ./generate-supervisord-args.nix {
|
||||
inherit pkgs system name compoundLogDir compoundRuntimeDir exprFile stateDir runtimeDir cacheDir logDir tmpDir forceDisableUserChange extraParams;
|
||||
}
|
||||
|
||||
# We can't embed launchd, cygrunsrv, because these supervisor processes cannot be managed by anything else
|
||||
# Managing docker containers does not make sense
|
||||
# In theory, systemd could work in containers, but workarounds need to be applied, e.g. cgroup permissions
|
||||
|
||||
else throw "Unsupported process manager: ${processManager}";
|
||||
|
||||
commonTools = (import ../../tools { inherit pkgs system; }).common;
|
||||
in
|
||||
createManagedProcess (pkgs.lib.recursiveUpdate {
|
||||
inherit name path overrides;
|
||||
initialize = ''
|
||||
${commonTools}/bin/nixproc-init-state --state-dir "${stateDir}" --log-dir "${logDir}" --runtime-dir "${runtimeDir}" --cache-dir "${cacheDir}" --tmp-dir "${tmpDir}" ${pkgs.lib.optionalString forceDisableUserChange "--force-disable-user-change"}
|
||||
'';
|
||||
} processArgs)
|
|
@ -1,29 +0,0 @@
|
|||
{ pkgs, system
|
||||
, exprFile
|
||||
, stateDir
|
||||
, runtimeDir
|
||||
, logDir
|
||||
, cacheDir
|
||||
, tmpDir
|
||||
, forceDisableUserChange
|
||||
, extraParams
|
||||
}:
|
||||
|
||||
let
|
||||
generateCompoundProxyScript = import ./generate-compound-proxy.nix {
|
||||
inherit (pkgs) stdenv writeTextFile;
|
||||
};
|
||||
|
||||
profile = import ../create-managed-process/bsdrc/build-bsdrc-env.nix {
|
||||
inherit pkgs system exprFile stateDir runtimeDir cacheDir logDir tmpDir forceDisableUserChange extraParams;
|
||||
};
|
||||
|
||||
tools = (import ../../tools { inherit pkgs system; }).bsdrc;
|
||||
|
||||
proxyScript = generateCompoundProxyScript {
|
||||
startCommand = "${tools}/bin/nixproc-bsdrc-runactivity start ${profile}";
|
||||
stopCommand = "${tools}/bin/nixproc-bsdrc-runactivity -r stop ${profile}";
|
||||
};
|
||||
in
|
||||
{ foregroundProcess = proxyScript;
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
{ pkgs, system
|
||||
, exprFile
|
||||
, stateDir
|
||||
, runtimeDir
|
||||
, logDir
|
||||
, cacheDir
|
||||
, tmpDir
|
||||
, forceDisableUserChange
|
||||
, extraParams
|
||||
}:
|
||||
|
||||
let
|
||||
generateCompoundProxyScript = import ./generate-compound-proxy.nix {
|
||||
inherit (pkgs) stdenv writeTextFile;
|
||||
};
|
||||
|
||||
disnixDataDir = "${pkgs.disnix}/share/disnix";
|
||||
|
||||
profile = import ../create-managed-process/disnix/build-disnix-env.nix {
|
||||
inherit pkgs system exprFile stateDir runtimeDir cacheDir logDir tmpDir forceDisableUserChange extraParams disnixDataDir;
|
||||
};
|
||||
|
||||
emptyProfile = import ../create-managed-process/disnix/build-disnix-env.nix {
|
||||
inherit pkgs system stateDir runtimeDir cacheDir logDir tmpDir forceDisableUserChange extraParams disnixDataDir;
|
||||
exprFile = null;
|
||||
};
|
||||
|
||||
proxyScript = generateCompoundProxyScript {
|
||||
path = [ pkgs.dysnomia pkgs.disnix ];
|
||||
startCommand = "disnix-activate ${profile}";
|
||||
stopCommand = "disnix-activate -o ${profile} ${emptyProfile}";
|
||||
};
|
||||
in
|
||||
{ foregroundProcess = proxyScript;
|
||||
}
|
|
@ -1,30 +0,0 @@
|
|||
{ pkgs, system
|
||||
|
||||
, name
|
||||
, compoundRuntimeDir
|
||||
, compoundLogDir
|
||||
|
||||
, exprFile
|
||||
, stateDir
|
||||
, runtimeDir
|
||||
, logDir
|
||||
, cacheDir
|
||||
, tmpDir
|
||||
, forceDisableUserChange
|
||||
, extraParams
|
||||
}:
|
||||
|
||||
let
|
||||
profile = import ../create-managed-process/supervisord/build-supervisord-env.nix {
|
||||
inherit pkgs system exprFile stateDir runtimeDir cacheDir logDir tmpDir forceDisableUserChange extraParams;
|
||||
};
|
||||
|
||||
pidFile = "${compoundRuntimeDir}/${name}.pid";
|
||||
logFile = "${compoundLogDir}/${name}.log";
|
||||
in
|
||||
{
|
||||
process = "${pkgs.pythonPackages.supervisor}/bin/supervisord";
|
||||
args = [ "--configuration" "${profile}/supervisord.conf" "--logfile" logFile "--pidfile" pidFile ];
|
||||
foregroundProcessExtraArgs = [ "--nodaemon" ];
|
||||
inherit pidFile;
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{ pkgs, system
|
||||
, exprFile
|
||||
, stateDir
|
||||
, runtimeDir
|
||||
, logDir
|
||||
, cacheDir
|
||||
, tmpDir
|
||||
, forceDisableUserChange
|
||||
, extraParams
|
||||
}:
|
||||
|
||||
let
|
||||
generateCompoundProxyScript = import ./generate-compound-proxy.nix {
|
||||
inherit (pkgs) stdenv writeTextFile;
|
||||
};
|
||||
|
||||
profile = import ../create-managed-process/sysvinit/build-sysvinit-env.nix {
|
||||
inherit pkgs system exprFile stateDir runtimeDir cacheDir logDir tmpDir forceDisableUserChange extraParams;
|
||||
};
|
||||
|
||||
tools = (import ../../tools { inherit pkgs system; }).sysvinit;
|
||||
|
||||
proxyScript = generateCompoundProxyScript {
|
||||
startCommand = "${tools}/bin/nixproc-sysvinit-runactivity start ${profile}";
|
||||
stopCommand = "${tools}/bin/nixproc-sysvinit-runactivity -r stop ${profile}";
|
||||
};
|
||||
in
|
||||
{ foregroundProcess = proxyScript;
|
||||
}
|
|
@ -5,7 +5,7 @@ let
|
|||
inherit pkgs system;
|
||||
}).sysvinit;
|
||||
|
||||
generateCompoundProxy = import ../create-compound-process/generate-compound-proxy.nix {
|
||||
generateCompoundProxy = import ./generate-compound-proxy.nix {
|
||||
inherit (pkgs) stdenv writeTextFile;
|
||||
};
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ let
|
|||
inherit pkgs system;
|
||||
}).sysvinit;
|
||||
|
||||
generateCompoundProxy = import ../create-compound-process/generate-compound-proxy.nix {
|
||||
generateCompoundProxy = import ./generate-compound-proxy.nix {
|
||||
inherit (pkgs) stdenv writeTextFile;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue