Compare commits
6
Commits
25b758304d
...
6bd11be8b5
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6bd11be8b5 | ||
|
|
f294828409 | ||
|
|
953271eeee | ||
|
|
70f3cef03a | ||
|
|
c9a5a4dec9 | ||
|
|
37cc35bb1b |
@@ -25,6 +25,7 @@
|
||||
modules = [
|
||||
{ nixpkgs.hostPlatform = "x86_64-linux"; }
|
||||
self.nixosModules.Sovran_SystemsOS
|
||||
/etc/nixos/hardware-configuration.nix
|
||||
/etc/nixos/role-state.nix
|
||||
/etc/nixos/custom.nix
|
||||
];
|
||||
|
||||
+28
-3
@@ -339,6 +339,23 @@ class InstallerWindow(Adw.ApplicationWindow):
|
||||
"Node (Bitcoin-only)"),
|
||||
]
|
||||
|
||||
# Detect internal (non-USB) drives to gate role availability
|
||||
try:
|
||||
raw = run(["lsblk", "-b", "-dno", "NAME,SIZE,TYPE,RO,TRAN", "-e", "7,11"])
|
||||
internal_disks = []
|
||||
for line in raw.splitlines():
|
||||
parts = line.split()
|
||||
if len(parts) >= 4 and parts[2] == "disk" and parts[3] == "0":
|
||||
tran = parts[4] if len(parts) >= 5 else ""
|
||||
if tran != "usb":
|
||||
internal_disks.append(parts[0])
|
||||
except Exception:
|
||||
internal_disks = []
|
||||
|
||||
has_second_drive = len(internal_disks) >= 2
|
||||
|
||||
NEEDS_DATA_DRIVE = {"Server+Desktop", "Node (Bitcoin-only)"}
|
||||
|
||||
self._role_radios = []
|
||||
radio_group = None
|
||||
cards_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=8)
|
||||
@@ -348,14 +365,22 @@ class InstallerWindow(Adw.ApplicationWindow):
|
||||
for label, desc, key in roles:
|
||||
card = Adw.ActionRow()
|
||||
card.set_title(label)
|
||||
|
||||
available = has_second_drive or key not in NEEDS_DATA_DRIVE
|
||||
if not available:
|
||||
card.set_subtitle(desc + "\n⚠ Requires a second internal drive (not detected)")
|
||||
card.set_sensitive(False)
|
||||
else:
|
||||
card.set_subtitle(desc)
|
||||
|
||||
radio = Gtk.CheckButton()
|
||||
radio.set_name(key)
|
||||
if radio_group is None:
|
||||
radio.set_sensitive(available)
|
||||
|
||||
if radio_group is None and available:
|
||||
radio_group = radio
|
||||
radio.set_active(True)
|
||||
else:
|
||||
elif radio_group is not None:
|
||||
radio.set_group(radio_group)
|
||||
|
||||
card.add_prefix(radio)
|
||||
@@ -814,7 +839,6 @@ class InstallerWindow(Adw.ApplicationWindow):
|
||||
status = Adw.StatusPage()
|
||||
status.set_title("Drives Ready")
|
||||
status.set_description("Your drives have been partitioned successfully.")
|
||||
status.set_icon_name("emblem-ok-symbolic")
|
||||
status.set_vexpand(True)
|
||||
|
||||
details = Adw.PreferencesGroup()
|
||||
@@ -883,6 +907,7 @@ class InstallerWindow(Adw.ApplicationWindow):
|
||||
run(["sudo", "mkdir", "-p", "/etc/nixos"])
|
||||
run(["sudo", "cp", "/mnt/etc/nixos/role-state.nix", "/etc/nixos/role-state.nix"])
|
||||
run(["sudo", "cp", "/mnt/etc/nixos/custom.nix", "/etc/nixos/custom.nix"])
|
||||
run(["sudo", "cp", "/mnt/etc/nixos/hardware-configuration.nix", "/etc/nixos/hardware-configuration.nix"])
|
||||
|
||||
run_stream([
|
||||
"sudo", "nixos-install",
|
||||
|
||||
Reference in New Issue
Block a user