From 7ea7cb5138f8e555451fde8f9399235413ecc0d2 Mon Sep 17 00:00:00 2001 From: Hunter Halloran Date: Fri, 5 Dec 2025 12:59:41 -0500 Subject: [PATCH] kiosk mode for tablets --- hosts/default.nix | 4 ++- sw-kiosk.nix | 74 +++++++++++++++++++++++++++++++++++++++++++++++ sw.nix | 2 +- 3 files changed, 78 insertions(+), 2 deletions(-) create mode 100644 sw-kiosk.nix diff --git a/hosts/default.nix b/hosts/default.nix index 739a4b8..744e6ae 100644 --- a/hosts/default.nix +++ b/hosts/default.nix @@ -8,7 +8,6 @@ let commonModules = [ ../boot.nix - ../sw.nix ../users home-manager.nixosModules.home-manager disko.nixosModules.disko @@ -89,6 +88,7 @@ in system = "x86_64-linux"; extraModules = [ ./nix-laptop.nix + ../sw.nix ]; }; @@ -97,6 +97,7 @@ in system = "x86_64-linux"; extraModules = [ ./nix-desktop.nix + ../sw.nix ]; }; @@ -105,6 +106,7 @@ in system = "x86_64-linux"; extraModules = [ ./nix-surface.nix + ../sw-kiosk.nix inputs.nixos-hardware.nixosModules.microsoft-surface-go ]; }; diff --git a/sw-kiosk.nix b/sw-kiosk.nix new file mode 100644 index 0000000..48021c8 --- /dev/null +++ b/sw-kiosk.nix @@ -0,0 +1,74 @@ +{ pkgs, inputs, ... }: + +{ + services.cage = { + enable = true; + program = "${(pkgs.writeShellScriptBin "chromium-kiosk" '' + ${pkgs.chromium}/bin/chromium --kiosk "https://ha.factory.uga.edu" + '')}/bin/chromium-kiosk;"; + }; + + # Enable networking + networking.networkmanager.enable = true; + + # Enable sound with pipewire. + services.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + environment.systemPackages = with pkgs; [ + htop + binutils + (chromium.override { + commandLineArgs = [ "--enable-features=TouchpadOverscrollHistoryNavigation" ]; + }) + oh-my-posh + zsh + git + inputs.lazyvim-nixvim.packages.${stdenv.hostPlatform.system}.nvim + ]; + + programs.chromium = { + enable = true; + extensions = [ + "ecdaoooilnflogancccpapbeebbpkhoj" # Chrome Virtual Keyboard + ]; + }; + + programs.zsh.enable = true; + programs.nix-ld.enable = true; + + fonts.packages = with pkgs; [ + nerd-fonts.fira-code + ]; + fonts.fontconfig = { + enable = true; + defaultFonts.monospace = [ "FiraCode Nerd Font Mono" ]; + }; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + programs.mtr.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + # Bluetooth + hardware.bluetooth.enable = true; + + # Firewall + networking.firewall.enable = true; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; +} diff --git a/sw.nix b/sw.nix index 1b289ea..a9c2037 100644 --- a/sw.nix +++ b/sw.nix @@ -86,6 +86,6 @@ # Sensors services.thermald.enable = true; - # Enable the OpenSSH daemon. + # Enable the OpenSSH daemon. services.openssh.enable = true; }