feat: add systemd Nix rootfs

This commit is contained in:
blazblue547-afk committed 2026-06-17 12:55:11 -04:00
1 parent 9e86817361
commit 1c3099dbac
38 files changed
+735 -1190

No files matched your search

-15
View File
@@ -1,15 +0,0 @@
root:x:0:
tty:x:5:
disk:x:6:
audio:x:29:forge
utmp:x:43:
video:x:44:forge
messagebus:x:81:
users:x:100:forge
input:x:104:forge
systemd-journal:x:190:
systemd-network:x:192:
systemd-resolve:x:193:
nixbld:x:30000:nixbld1,nixbld2,nixbld3,nixbld4,nixbld5,nixbld6,nixbld7,nixbld8,nixbld9,nixbld10,nixbld11,nixbld12,nixbld13,nixbld14,nixbld15,nixbld16,nixbld17,nixbld18,nixbld19,nixbld20,nixbld21,nixbld22,nixbld23,nixbld24,nixbld25,nixbld26,nixbld27,nixbld28,nixbld29,nixbld30,nixbld31,nixbld32
forge:x:1000:
nobody:x:65534:
-15
View File
@@ -1,15 +0,0 @@
root:*::
tty:*::
disk:*::
audio:*::forge
utmp:*::
video:*::forge
messagebus:*::
users:*::forge
input:*::forge
systemd-journal:*::
systemd-network:*::
systemd-resolve:*::
nixbld:*::nixbld1,nixbld2,nixbld3,nixbld4,nixbld5,nixbld6,nixbld7,nixbld8,nixbld9,nixbld10,nixbld11,nixbld12,nixbld13,nixbld14,nixbld15,nixbld16,nixbld17,nixbld18,nixbld19,nixbld20,nixbld21,nixbld22,nixbld23,nixbld24,nixbld25,nixbld26,nixbld27,nixbld28,nixbld29,nixbld30,nixbld31,nixbld32
forge:!::
nobody:*::
-1
View File
@@ -1 +0,0 @@
forgeos
-1
View File
@@ -1 +0,0 @@
ForgeOS \r (\m)
-3
View File
@@ -1,3 +0,0 @@
# ForgeOS ships a small BusyBox-compatible neofetch implementation.
# Keep this distro name available for tools that read neofetch-style config.
ascii_distro="forgeos"
-11
View File
@@ -1,11 +0,0 @@
passwd: files
group: files
shadow: files
hosts: files dns
networks: files
protocols: files
services: files
ethers: files
rpc: files
-3
View File
@@ -1,3 +0,0 @@
NAME=ForgeOS
ID=forgeos
PRETTY_NAME="ForgeOS"
-7
View File
@@ -1,7 +0,0 @@
#%PAM-1.0
auth required pam_unix.so nullok
account required pam_unix.so
password required pam_unix.so sha512 shadow
session required pam_unix.so
session optional pam_systemd.so
-6
View File
@@ -1,6 +0,0 @@
#%PAM-1.0
auth required pam_deny.so
account required pam_deny.so
password required pam_deny.so
session required pam_deny.so
-4
View File
@@ -1,4 +0,0 @@
#%PAM-1.0
account required pam_unix.so no_pass_expiry
session optional pam_systemd.so
-38
View File
@@ -1,38 +0,0 @@
root:x:0:0:root:/root:/bin/sh
forge:x:1000:1000:ForgeOS User:/home/forge:/bin/sh
systemd-network:x:192:192:systemd Network Management:/:/bin/sh
systemd-resolve:x:193:193:systemd Resolver:/:/bin/sh
messagebus:x:81:81:System Message Bus:/:/bin/sh
nixbld1:x:30001:30000:Nix build user 1:/var/empty:/sbin/nologin
nixbld2:x:30002:30000:Nix build user 2:/var/empty:/sbin/nologin
nixbld3:x:30003:30000:Nix build user 3:/var/empty:/sbin/nologin
nixbld4:x:30004:30000:Nix build user 4:/var/empty:/sbin/nologin
nixbld5:x:30005:30000:Nix build user 5:/var/empty:/sbin/nologin
nixbld6:x:30006:30000:Nix build user 6:/var/empty:/sbin/nologin
nixbld7:x:30007:30000:Nix build user 7:/var/empty:/sbin/nologin
nixbld8:x:30008:30000:Nix build user 8:/var/empty:/sbin/nologin
nixbld9:x:30009:30000:Nix build user 9:/var/empty:/sbin/nologin
nixbld10:x:30010:30000:Nix build user 10:/var/empty:/sbin/nologin
nixbld11:x:30011:30000:Nix build user 11:/var/empty:/sbin/nologin
nixbld12:x:30012:30000:Nix build user 12:/var/empty:/sbin/nologin
nixbld13:x:30013:30000:Nix build user 13:/var/empty:/sbin/nologin
nixbld14:x:30014:30000:Nix build user 14:/var/empty:/sbin/nologin
nixbld15:x:30015:30000:Nix build user 15:/var/empty:/sbin/nologin
nixbld16:x:30016:30000:Nix build user 16:/var/empty:/sbin/nologin
nixbld17:x:30017:30000:Nix build user 17:/var/empty:/sbin/nologin
nixbld18:x:30018:30000:Nix build user 18:/var/empty:/sbin/nologin
nixbld19:x:30019:30000:Nix build user 19:/var/empty:/sbin/nologin
nixbld20:x:30020:30000:Nix build user 20:/var/empty:/sbin/nologin
nixbld21:x:30021:30000:Nix build user 21:/var/empty:/sbin/nologin
nixbld22:x:30022:30000:Nix build user 22:/var/empty:/sbin/nologin
nixbld23:x:30023:30000:Nix build user 23:/var/empty:/sbin/nologin
nixbld24:x:30024:30000:Nix build user 24:/var/empty:/sbin/nologin
nixbld25:x:30025:30000:Nix build user 25:/var/empty:/sbin/nologin
nixbld26:x:30026:30000:Nix build user 26:/var/empty:/sbin/nologin
nixbld27:x:30027:30000:Nix build user 27:/var/empty:/sbin/nologin
nixbld28:x:30028:30000:Nix build user 28:/var/empty:/sbin/nologin
nixbld29:x:30029:30000:Nix build user 29:/var/empty:/sbin/nologin
nixbld30:x:30030:30000:Nix build user 30:/var/empty:/sbin/nologin
nixbld31:x:30031:30000:Nix build user 31:/var/empty:/sbin/nologin
nixbld32:x:30032:30000:Nix build user 32:/var/empty:/sbin/nologin
nobody:x:65534:65534:nobody:/:/bin/sh
-16
View File
@@ -1,16 +0,0 @@
PATH=/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin
export PATH
PS1='[forgeos \w]# '
export PS1
alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
if [ -d /etc/profile.d ]; then
for profile_script in /etc/profile.d/*.sh; do
[ -r "$profile_script" ] && . "$profile_script"
done
unset profile_script
fi
-38
View File
@@ -1,38 +0,0 @@
root:$6$forgeos$gPbch8oHqLnms/ljQGrpqE5btu4FY8J9ryX.9/CfzBY6CyakPaoEkHapeKRjkZbg3BdAdZz6eDzPD0YOV3CYK0:20620:0:99999:7:::
forge:$6$forgeos$gPbch8oHqLnms/ljQGrpqE5btu4FY8J9ryX.9/CfzBY6CyakPaoEkHapeKRjkZbg3BdAdZz6eDzPD0YOV3CYK0:20620:0:99999:7:::
systemd-network:*:20620:0:99999:7:::
systemd-resolve:*:20620:0:99999:7:::
messagebus:*:20620:0:99999:7:::
nixbld1:!:20620:0:99999:7:::
nixbld2:!:20620:0:99999:7:::
nixbld3:!:20620:0:99999:7:::
nixbld4:!:20620:0:99999:7:::
nixbld5:!:20620:0:99999:7:::
nixbld6:!:20620:0:99999:7:::
nixbld7:!:20620:0:99999:7:::
nixbld8:!:20620:0:99999:7:::
nixbld9:!:20620:0:99999:7:::
nixbld10:!:20620:0:99999:7:::
nixbld11:!:20620:0:99999:7:::
nixbld12:!:20620:0:99999:7:::
nixbld13:!:20620:0:99999:7:::
nixbld14:!:20620:0:99999:7:::
nixbld15:!:20620:0:99999:7:::
nixbld16:!:20620:0:99999:7:::
nixbld17:!:20620:0:99999:7:::
nixbld18:!:20620:0:99999:7:::
nixbld19:!:20620:0:99999:7:::
nixbld20:!:20620:0:99999:7:::
nixbld21:!:20620:0:99999:7:::
nixbld22:!:20620:0:99999:7:::
nixbld23:!:20620:0:99999:7:::
nixbld24:!:20620:0:99999:7:::
nixbld25:!:20620:0:99999:7:::
nixbld26:!:20620:0:99999:7:::
nixbld27:!:20620:0:99999:7:::
nixbld28:!:20620:0:99999:7:::
nixbld29:!:20620:0:99999:7:::
nixbld30:!:20620:0:99999:7:::
nixbld31:!:20620:0:99999:7:::
nixbld32:!:20620:0:99999:7:::
nobody:*:20620:0:99999:7:::
-1
View File
@@ -1 +0,0 @@
/bin/sh
@@ -1,6 +0,0 @@
[Match]
Name=en* eth*
[Network]
DHCP=yes
IPv6AcceptRA=yes
@@ -1,20 +0,0 @@
disable *
enable forgeos-login@tty1.service
enable serial-getty@ttyAMA0.service
enable forgeos-bootdiag.service
enable forgeos-console-banner.service
enable dbus.service
enable dbus.socket
enable systemd-logind.service
enable systemd-logind-varlink.socket
enable systemd-networkd.service
enable systemd-networkd.socket
enable systemd-resolved.service
enable systemd-resolved-monitor.socket
enable systemd-resolved-varlink.socket
enable systemd-udevd.service
enable systemd-udevd-control.socket
enable systemd-udevd-kernel.socket
enable forgeos-nix-bootstrap.service
enable nix-daemon.service
enable nix-daemon.socket
@@ -1,12 +0,0 @@
[Unit]
Description=Record ForgeOS boot diagnostics
Documentation=man:systemd.service(5)
After=local-fs.target systemd-udevd.service
ConditionPathExists=/sbin/forgeos-bootdiag
[Service]
Type=oneshot
ExecStart=/sbin/forgeos-bootdiag systemd
[Install]
WantedBy=multi-user.target
@@ -1,12 +0,0 @@
[Unit]
Description=Print ForgeOS console banner
Documentation=man:systemd.service(5)
After=systemd-logind.service systemd-user-sessions.service
ConditionPathExists=/sbin/forgeos-console-banner
[Service]
Type=oneshot
ExecStart=/sbin/forgeos-console-banner
[Install]
WantedBy=multi-user.target
@@ -1,12 +0,0 @@
[Unit]
Description=Repair ForgeOS user home ownership
Documentation=man:systemd.service(5)
After=local-fs.target
Before=systemd-user-sessions.service getty.target getty@tty1.service serial-getty@ttyAMA0.service
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'if [ -d /home/forge ]; then chown -R 1000:1000 /home/forge && chmod 700 /home/forge; fi'
[Install]
WantedBy=multi-user.target
@@ -1,26 +0,0 @@
[Unit]
Description=ForgeOS login prompt on %I
Documentation=man:systemd.service(5)
Wants=systemd-logind.service
After=systemd-logind.service systemd-user-sessions.service getty-pre.target
Before=getty.target
ConditionPathExists=/dev/%I
IgnoreOnIsolate=yes
[Service]
ExecStart=-/sbin/getty -L 0 %I linux
Type=idle
Restart=always
RestartSec=0
UtmpIdentifier=%I
StandardInput=tty
StandardOutput=tty
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
IgnoreSIGPIPE=no
SendSIGHUP=yes
[Install]
WantedBy=getty.target
@@ -1,24 +0,0 @@
[Unit]
Description=ForgeOS root shell on %I
Documentation=man:systemd.service(5)
After=systemd-logind.service systemd-user-sessions.service
Before=getty.target
IgnoreOnIsolate=yes
[Service]
Type=simple
ExecStart=-/bin/sh -l
Restart=always
RestartSec=0
StandardInput=tty
StandardOutput=tty
StandardError=tty
TTYPath=/dev/%I
TTYReset=yes
TTYVHangup=yes
KillMode=process
IgnoreSIGPIPE=no
SendSIGHUP=yes
[Install]
WantedBy=getty.target
-2
View File
@@ -1,2 +0,0 @@
cd /root
exec /bin/sh
-124
View File
@@ -1,124 +0,0 @@
#!/bin/sh
set -u
show_help() {
cat <<'EOF'
Usage: neofetch [--help] [--version]
Print ForgeOS system information with the ForgeOS ASCII logo.
EOF
}
case "${1:-}" in
--help|-h)
show_help
exit 0
;;
--version|-V)
echo "ForgeOS neofetch 1.0"
exit 0
;;
--*)
echo "neofetch: unsupported option: $1" >&2
exit 1
;;
esac
if [ -t 1 ] && [ -z "${NO_COLOR:-}" ]; then
reset="$(printf '\033[0m')"
bold="$(printf '\033[1m')"
logo_color="$(printf '\033[36m')"
key_color="$(printf '\033[1;37m')"
else
reset=''
bold=''
logo_color=''
key_color=''
fi
os_release="${NEOFETCH_OS_RELEASE:-/etc/os-release}"
host_file="${NEOFETCH_HOSTNAME:-/etc/hostname}"
desktop_file="${NEOFETCH_DESKTOP_FILE:-/etc/forgeos-desktop}"
os_name="ForgeOS"
if [ -r "$os_release" ]; then
os_name="$(sed -n 's/^PRETTY_NAME=//p' "$os_release" | head -n 1 | sed 's/^"//;s/"$//')"
[ -n "$os_name" ] || os_name="$(sed -n 's/^NAME=//p' "$os_release" | head -n 1 | sed 's/^"//;s/"$//')"
[ -n "$os_name" ] || os_name="ForgeOS"
fi
host="$(cat "$host_file" 2>/dev/null || hostname 2>/dev/null || echo forgeos)"
kernel="$(uname -sr 2>/dev/null || echo unknown)"
arch="$(uname -m 2>/dev/null || echo unknown)"
shell_name="${SHELL:-/bin/sh}"
terminal="${TERM:-linux}"
init_name="systemd"
desktop="console"
if [ -r "$desktop_file" ]; then
desktop="$(sed -n 's/^NAME=//p' "$desktop_file" | head -n 1 | sed 's/^"//;s/"$//')"
[ -n "$desktop" ] || desktop="Openbox"
fi
uptime_text="unknown"
if [ -r /proc/uptime ]; then
uptime_seconds="$(cut -d. -f1 /proc/uptime 2>/dev/null | awk '{print $1}')"
case "$uptime_seconds" in
''|*[!0-9]*)
;;
*)
days=$((uptime_seconds / 86400))
hours=$(((uptime_seconds % 86400) / 3600))
mins=$(((uptime_seconds % 3600) / 60))
if [ "$days" -gt 0 ]; then
uptime_text="${days}d ${hours}h ${mins}m"
elif [ "$hours" -gt 0 ]; then
uptime_text="${hours}h ${mins}m"
else
uptime_text="${mins}m"
fi
;;
esac
fi
cpu="$arch"
if [ -r /proc/cpuinfo ]; then
cpu="$(sed -n 's/^model name[[:space:]]*:[[:space:]]*//p' /proc/cpuinfo | head -n 1)"
[ -n "$cpu" ] || cpu="$arch"
fi
memory="unknown"
if [ -r /proc/meminfo ]; then
mem_total="$(awk '/^MemTotal:/ {print int($2 / 1024)}' /proc/meminfo)"
mem_available="$(awk '/^MemAvailable:/ {print int($2 / 1024)}' /proc/meminfo)"
if [ -n "$mem_total" ] && [ -n "$mem_available" ]; then
mem_used=$((mem_total - mem_available))
memory="${mem_used}MiB / ${mem_total}MiB"
fi
fi
line() {
logo_line="$1"
label="$2"
value="$3"
if [ -n "$label" ]; then
printf '%b%-37s%b %b%s%b %s\n' "$logo_color" "$logo_line" "$reset" "$key_color" "$label" "$reset" "$value"
else
printf '%b%s%b\n' "$logo_color" "$logo_line" "$reset"
fi
}
printf '%b%s@%s%b\n' "$bold" "${USER:-root}" "$host" "$reset"
line ' ______ ____ _____' 'OS:' "$os_name"
line ' / ____/___ _________ ____ / __ \/ ___/' 'Host:' "$host"
line ' / /_ / __ \/ ___/ __ `/ _ \/ / / /\__ \' 'Kernel:' "$kernel"
line ' / __/ / /_/ / / / /_/ / __/ /_/ /__/ /' 'Uptime:' "$uptime_text"
line '/_/ \____/_/ \__, /\___/\____/____/' 'Shell:' "$shell_name"
line ' /____/' 'Terminal:' "$terminal"
line ' forged from source' 'Desktop:' "$desktop"
line '' 'Init:' "$init_name"
line '' 'CPU:' "$cpu"
line '' 'Memory:' "$memory"
line '' 'Packages:' 'overlay + source-built core'
@@ -1,5 +0,0 @@
d /home/forge 0700 forge forge -
z /home/forge 0700 forge forge -
z /root 0700 root root -
z /etc/shadow 0600 root root -
z /etc/gshadow 0600 root root -
@@ -1,7 +0,0 @@
______ ____ _____
/ ____/___ _________ ____ / __ \/ ___/
/ /_ / __ \/ ___/ __ `/ _ \/ / / /\__ \
/ __/ / /_/ / / / /_/ / __/ /_/ /__/ /
/_/ \____/_/ \__, /\___/\____/____/
/____/
forged from source