refactor: Move sw into properly nested modules with unconditional import
This commit is contained in:
@@ -7,37 +7,77 @@
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
lib.mkMerge [
|
||||
(import ./kiosk-browser.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
inputs
|
||||
;
|
||||
})
|
||||
(import ./services.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
inputs
|
||||
;
|
||||
})
|
||||
(import ./net.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
inputs
|
||||
;
|
||||
})
|
||||
(import ./programs.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
inputs
|
||||
;
|
||||
})
|
||||
]
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.athenix.sw.stateless-kiosk;
|
||||
in
|
||||
{
|
||||
options.athenix.sw.stateless-kiosk = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Enable stateless kiosk mode for diskless PXE boot systems.
|
||||
|
||||
Includes:
|
||||
- Sway (Wayland compositor)
|
||||
- Chromium in fullscreen kiosk mode
|
||||
- MAC address-based URL routing
|
||||
- Network-only boot (no local storage)
|
||||
- Auto-start browser on boot
|
||||
|
||||
Recommended for: Assembly line stations, diskless kiosks, PXE boot displays
|
||||
'';
|
||||
example = true;
|
||||
};
|
||||
|
||||
kioskUrl = mkOption {
|
||||
type = types.str;
|
||||
default = "https://ha.factory.uga.edu";
|
||||
description = ''
|
||||
Default URL to display in the kiosk browser.
|
||||
|
||||
Note: For stateless-kiosk, MAC address-based routing may override this.
|
||||
See sw/stateless-kiosk/mac-hostmap.nix for MAC-to-URL mappings.
|
||||
'';
|
||||
example = "https://homeassistant.lan:8123/lovelace/dashboard";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable (mkMerge [
|
||||
(import ./kiosk-browser.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
inputs
|
||||
;
|
||||
})
|
||||
(import ./services.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
inputs
|
||||
;
|
||||
})
|
||||
(import ./net.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
inputs
|
||||
;
|
||||
})
|
||||
(import ./programs.nix {
|
||||
inherit
|
||||
config
|
||||
lib
|
||||
pkgs
|
||||
inputs
|
||||
;
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user