forked from DGNum/liminix
68 lines
1.3 KiB
Nix
68 lines
1.3 KiB
Nix
{ pkgs, ... }:
|
|
let
|
|
inherit (pkgs.pseudofile) dir symlink;
|
|
"getty.service" = {
|
|
file =
|
|
let
|
|
login = pkgs.writeScript "login" ''
|
|
#!/bin/ash
|
|
exec /bin/ash
|
|
'';
|
|
in
|
|
''
|
|
[Unit]
|
|
Description="Serial shell"
|
|
|
|
[Service]
|
|
ExecStart=${pkgs.util-linux}/bin/agetty --login-program ${login} ttyS0
|
|
'';
|
|
mode = "0644";
|
|
};
|
|
"default.target" = {
|
|
file = ''
|
|
[Unit]
|
|
Description="target to boot"
|
|
Wants=getty.service
|
|
After=getty.service
|
|
AllowIsolate=yes
|
|
'';
|
|
};
|
|
"sysinit.target" = {
|
|
file = ''
|
|
[Unit]
|
|
Description="sysinit.target"
|
|
'';
|
|
};
|
|
in
|
|
{
|
|
config = {
|
|
kernel.config = {
|
|
CGROUPS = "y";
|
|
DEVTMPFS = "y";
|
|
INOTIFY_USER = "y";
|
|
SIGNALFD = "y";
|
|
TIMERFD = "y";
|
|
EPOLL = "y";
|
|
UNIX = "y";
|
|
SYSFS = "y";
|
|
PROC_FS = "y";
|
|
FHANDLE = "y";
|
|
};
|
|
boot.commandLine = [
|
|
"systemd.log_level=7"
|
|
#"systemd.crash_shell=true"
|
|
];
|
|
filesystem = dir {
|
|
etc = dir {
|
|
systemd = dir {
|
|
system = dir {
|
|
inherit "default.target" "getty.service" "sysinit.target";
|
|
};
|
|
};
|
|
};
|
|
bin = dir {
|
|
init = symlink "${pkgs.systemd}/bin/init";
|
|
};
|
|
};
|
|
};
|
|
}
|