switch to s6-linux-init and s6-rc
This is at the point where it runs a getty and a pile of s6-supervise processes, though it doesn't seem to run the things being supervised
This commit is contained in:
parent
6be5b90c96
commit
45025f128a
12 changed files with 404 additions and 22 deletions
37
pkgs/pseudofile/default.nix
Normal file
37
pkgs/pseudofile/default.nix
Normal file
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
writeText
|
||||
, lib
|
||||
}:
|
||||
filename : attrset :
|
||||
let
|
||||
inherit (lib.debug) traceSeqN;
|
||||
inherit (lib.attrsets) mapAttrsToList;
|
||||
visit = prefix: attrset:
|
||||
let
|
||||
qprint = msg : builtins.replaceStrings ["\n" "=" "\""] ["=0A" "=3D" "=22"] msg;
|
||||
l =
|
||||
mapAttrsToList
|
||||
(filename: attrs:
|
||||
let
|
||||
attrs' = {type = "f"; } // attrs;
|
||||
mode = if attrs ? mode then attrs.mode else
|
||||
(if attrs'.type == "d" then "0755" else "0644");
|
||||
line = "${prefix}/${filename} ${attrs'.type} ${mode} 0 0";
|
||||
in
|
||||
if attrs'.type == "f" then
|
||||
"${line} echo -n \"${qprint attrs'.file}\" |qprint -d"
|
||||
else if attrs'.type == "d" then
|
||||
(visit "${prefix}/${filename}" attrs.contents) +
|
||||
"\n" + line
|
||||
else if attrs'.type == "s" then
|
||||
"${line} ${attrs'.target}"
|
||||
else if attrs'.type == "l" then
|
||||
"${prefix}/${filename} l ${attrs'.target}"
|
||||
else if attrs'.type == "i" then
|
||||
"${line} ${attrs.subtype}"
|
||||
else
|
||||
line)
|
||||
attrset;
|
||||
in builtins.concatStringsSep "\n" l;
|
||||
res = (visit "" attrset);
|
||||
in writeText filename res
|
Loading…
Add table
Add a link
Reference in a new issue