{ pkgs, inputs, self, ... }: let targetSystem = self.nixosConfigurations.radiantwavekiosk.config.system.build.toplevel; diskoScript = self.nixosConfigurations.radiantwavekiosk.config.system.build.diskoScript; in { ############################################################ # System configuration ############################################################ nix.settings = { experimental-features = [ "nix-command" "flakes" ]; substituters = [ "https://cache.nixos.org" ]; flake-registry = ""; connect-timeout = 0; }; nix.registry.nixpkgs = pkgs.lib.mkForce { to = { type = "path"; path = "${inputs.nixpkgs}"; }; }; nix.extraOptions = '' netrc-file = /etc/nix/netrc ''; environment.variables.KIOSK_FLAKE = "${self}"; environment.etc."nix/netrc" = { text = '' password eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjIwODgzODk2ODEsIm5iZiI6MTc3MjgxMzY4MSwic3ViIjoia2lvc2siLCJodHRwczovL2p3dC5hdHRpYy5ycy92MSI6eyJjYWNoZXMiOnsia2lvc2siOnsiciI6MX19fX0.N6Ktrmmu1LSy2PP8uNF25VHRP1dxPZJ4M0MR1kUpVi0 ''; mode = "0400"; }; networking.networkmanager.enable = true; ############################################################ # User configuration ############################################################ users.users.root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL4qWNZnYU5JaqR9c2qh6oFZktzVNBOx42PfDaGofCL6 cnclack@pm.me macbook" ]; ############################################################ # Service configuration ############################################################ services.openssh.enable = true; systemd.services.NetworkManager-wait-online.enable = false; systemd.services.zero-touch-install = { description = "Zero-Touch Kiosk Installation"; wantedBy = [ "multi-user.target" ]; # Make sure we own tty1 exclusively - getty@tty1 will otherwise # try to spawn a login prompt on the same console. conflicts = [ "getty@tty1.service" ]; after = [ "systemd-udev-settle.service" "getty@tty1.service" ]; path = with pkgs; [ nix git util-linux nixos-install-tools curl networkmanager mount umount disko ]; environment = { NIX_PATH = "nixpkgs=${inputs.nixpkgs}"; KIOSK_FLAKE = "${self}"; DISKO_SCRIPT = "${diskoScript}"; }; serviceConfig = { StandardInput = "tty"; StandardOutput = "tty"; StandardError = "tty"; TTYPath = "/dev/tty1"; TTYReset = true; TTYVHangup = true; TTYVTDisallocate = true; }; script = '' set -euo pipefail echo "Running disko script..." echo "Script: $DISKO_SCRIPT" ${diskoScript} echo "Installing RadiantWave" echo "Closure Path: ${targetSystem}" nixos-install \ --system "${targetSystem}" \ --no-root-passwd \ --no-channel-copy echo "============================================" echo " Installation complete!" echo " Please shut down and remove the flash drive before restarting" echo "============================================" sleep 10000000 ''; }; }