refactor: share workstation setup and boot-staged updates
Use dev-owned checkouts and one update policy on both hosts. Keep only hardware and deployment identity in host modules, use the same SDDM/UWSM workstation module in the VM, and install a host-configured manual switch command with lock regression tests.
This commit is contained in:
+36
-26
@@ -1,47 +1,57 @@
|
||||
# Opt-in physical workstation integration. Never imported by the EC2 host.
|
||||
# Local hardware/session integration. Shared by the laptop and graphical VM,
|
||||
# not the headless EC2 host; all application/user settings live in common.nix.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
managedHyprlandSession =
|
||||
pkgs.runCommand "hyprland-managed-session"
|
||||
{
|
||||
passthru.providedSessions = [ "hyprland-uwsm" ];
|
||||
}
|
||||
''
|
||||
mkdir -p "$out/share/wayland-sessions"
|
||||
ln -s ${config.programs.hyprland.package}/share/wayland-sessions/hyprland-uwsm.desktop \
|
||||
"$out/share/wayland-sessions/hyprland-uwsm.desktop"
|
||||
'';
|
||||
in
|
||||
{
|
||||
networking.networkmanager.enable = true;
|
||||
networking.networkmanager = {
|
||||
enable = true;
|
||||
plugins = [ pkgs.networkmanager-openvpn ];
|
||||
};
|
||||
networking.dhcpcd.enable = false;
|
||||
users.users.dev.extraGroups = [ "networkmanager" ];
|
||||
|
||||
services.xserver.enable = true;
|
||||
services.displayManager = {
|
||||
sddm.enable = true;
|
||||
defaultSession = "hyprland-uwsm";
|
||||
# Plain Hyprland bypasses the UWSM-owned bar/idle/polkit services.
|
||||
sessionPackages = lib.mkForce [ managedHyprlandSession ];
|
||||
};
|
||||
services.printing.enable = true;
|
||||
services.udisks2.enable = true;
|
||||
services.gvfs.enable = true;
|
||||
services.fwupd.enable = true;
|
||||
home-manager.users.dev.services.udiskie.enable = true;
|
||||
environment.systemPackages = [ pkgs.networkmanagerapplet ];
|
||||
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = false;
|
||||
};
|
||||
services.blueman.enable = true;
|
||||
# Keep Blueman's manager/mechanism, not a second tray applet next to ashell.
|
||||
services.upower.enable = true;
|
||||
services.power-profiles-daemon.enable = true;
|
||||
# Retain Blueman's manager without a second tray applet next to ashell.
|
||||
home-manager.users.dev.xdg.configFile."autostart/blueman.desktop".text = ''
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Blueman
|
||||
Hidden=true
|
||||
'';
|
||||
services.upower.enable = true;
|
||||
services.power-profiles-daemon.enable = true;
|
||||
services.udisks2.enable = true;
|
||||
home-manager.users.dev.services.udiskie.enable = true;
|
||||
environment.systemPackages = [ pkgs.networkmanagerapplet ];
|
||||
|
||||
programs.regreet = {
|
||||
enable = true;
|
||||
theme.name = "Adwaita-dark";
|
||||
font = {
|
||||
package = pkgs.inter;
|
||||
name = "Inter";
|
||||
size = 13;
|
||||
};
|
||||
settings.GTK.application_prefer_dark_theme = true;
|
||||
};
|
||||
# No autologin. The physical host must supply a secure credential file.
|
||||
assertions = [
|
||||
{
|
||||
assertion = config.users.users.dev.hashedPasswordFile != null;
|
||||
message = "workstation.nix requires users.users.dev.hashedPasswordFile (provision outside the Nix store); no production password is invented.";
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user