mirror of
https://github.com/genebean/dots.git
synced 2026-03-27 09:27:44 -04:00
Migrate kiosk-entryway to NixOS from MX Linux
This commit is contained in:
parent
d0591e2bf3
commit
bb544798aa
9 changed files with 301 additions and 50 deletions
116
modules/hosts/nixos/kiosk-entryway/default.nix
Normal file
116
modules/hosts/nixos/kiosk-entryway/default.nix
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
{ config, lib, pkgs, username, ... }: {
|
||||
imports = [
|
||||
./disk-config.nix
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
system.stateVersion = "24.11";
|
||||
|
||||
boot.supportedFilesystems = lib.mkForce [
|
||||
"vfat"
|
||||
"ext4"
|
||||
];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
wlr-randr
|
||||
];
|
||||
|
||||
hardware = {
|
||||
enableRedistributableFirmware = true;
|
||||
graphics.enable = true;
|
||||
};
|
||||
|
||||
networking = {
|
||||
firewall.enable = false;
|
||||
wireless = {
|
||||
enable = true;
|
||||
networks = {
|
||||
# Home
|
||||
"Diagon Alley".pskRaw = "ext:psk_diagon_alley";
|
||||
# Public networks
|
||||
"Gallery Row-GuestWiFi" = {};
|
||||
"LocalTies Guest".pskRaw = "ext:psk_local_ties";
|
||||
};
|
||||
secretsFile = "${config.sops.secrets.wifi_creds.path}";
|
||||
};
|
||||
};
|
||||
|
||||
nixpkgs.overlays = [
|
||||
(final: super: {
|
||||
makeModulesClosure = x:
|
||||
super.makeModulesClosure (x // { allowMissing = true; });
|
||||
})
|
||||
];
|
||||
|
||||
services = {
|
||||
cage = let
|
||||
kioskProgram = pkgs.writeShellScript "kiosk.sh" ''
|
||||
WAYLAND_DISPLAY=wayland-0 wlr-randr --output HDMI-A-1
|
||||
/etc/profiles/per-user/gene/bin/chromium-browser
|
||||
'';
|
||||
in {
|
||||
enable = true;
|
||||
program = kioskProgram;
|
||||
user = "gene";
|
||||
environment = {
|
||||
WLR_LIBINPUT_NO_DEVICES = "1"; # boot up even if no mouse/keyboard connected
|
||||
};
|
||||
};
|
||||
prometheus.exporters.node = {
|
||||
enable = true;
|
||||
enabledCollectors = [
|
||||
"logind"
|
||||
"systemd"
|
||||
"network_route"
|
||||
];
|
||||
disabledCollectors = [
|
||||
"textfile"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
sops = {
|
||||
age.keyFile = "${config.users.users.${username}.home}/.config/sops/age/keys.txt";
|
||||
defaultSopsFile = ./secrets.yaml;
|
||||
secrets = {
|
||||
local_git_config = {
|
||||
owner = "${username}";
|
||||
path = "${config.users.users.${username}.home}/.gitconfig-local";
|
||||
};
|
||||
local_private_env = {
|
||||
owner = "${username}";
|
||||
path = "${config.users.users.${username}.home}/.private-env";
|
||||
};
|
||||
wifi_creds = {
|
||||
sopsFile = ../../common/secrets.yaml;
|
||||
restartUnits = [
|
||||
"wpa_supplicant.service"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services.cage-tty1 = {
|
||||
wants = [
|
||||
"wpa_supplicant.service"
|
||||
];
|
||||
};
|
||||
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
description = "Gene Liverman";
|
||||
extraGroups = [ "networkmanager" "wheel" ];
|
||||
linger = true;
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFvLaPTfG3r+bcbI6DV4l69UgJjnwmZNCQk79HXyf1Pt gene@rainbow-planet"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIIp42X5DZ713+bgbOO+GXROufUFdxWo7NjJbGQ285x3N gene.liverman@ltnglobal.com"
|
||||
];
|
||||
};
|
||||
|
||||
zramSwap = {
|
||||
enable = true;
|
||||
algorithm = "zstd";
|
||||
memoryPercent = 90;
|
||||
};
|
||||
}
|
||||
|
||||
42
modules/hosts/nixos/kiosk-entryway/disk-config.nix
Normal file
42
modules/hosts/nixos/kiosk-entryway/disk-config.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
# Example to create a bios compatible gpt partition
|
||||
{ lib, ... }:
|
||||
{
|
||||
disko.devices = {
|
||||
disk.disk1 = {
|
||||
device = lib.mkDefault "/dev/sda";
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
name = "boot";
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
};
|
||||
esp = {
|
||||
name = "ESP";
|
||||
size = "500M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
};
|
||||
};
|
||||
root = {
|
||||
name = "root";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
mountOptions = [
|
||||
"defaults"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "sd_mod" "rtsx_pci_sdmmc" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp4s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
23
modules/hosts/nixos/kiosk-entryway/home-gene.nix
Normal file
23
modules/hosts/nixos/kiosk-entryway/home-gene.nix
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{ ... }: {
|
||||
home.stateVersion = "24.11";
|
||||
|
||||
programs = {
|
||||
chromium = {
|
||||
enable = true;
|
||||
commandLineArgs = [
|
||||
"--app=http://192.168.22.22:8123/kiosk-entryway/immich?kiosk"
|
||||
"--kiosk"
|
||||
"--noerrdialogs"
|
||||
"--disable-infobars"
|
||||
"--no-first-run"
|
||||
"--ozone-platform=wayland"
|
||||
"--enable-features=OverlayScrollbar"
|
||||
"--start-maximized"
|
||||
"--force-dark-mode"
|
||||
"--hide-crash-restore-bubble"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
22
modules/hosts/nixos/kiosk-entryway/secrets.yaml
Normal file
22
modules/hosts/nixos/kiosk-entryway/secrets.yaml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
local_git_config: ENC[AES256_GCM,data:9eq+YMK1wRewtTOCYdq9haD9XhMKcKCXeYlioxn5kAAreUJdjw/D92O33958eXvA3TbvRJGpioN0iZZribay7q+e2zoW+SfITwetfKa9xIeU2UQF3f6jB9juh5mqWZBXGxx+An3tIg9jNjtHRRzK7nzp6Uyxy5TNEfBKPwU=,iv:mAMMKaEWN9DvVGDDc8tNKE6LXxTnd7NKe5VXL1vmCp0=,tag:EhJkL9V3J+020uUSVsL8BA==,type:str]
|
||||
local_private_env: ENC[AES256_GCM,data:66Ii8OUAwROOyfSFAWhCdpq8OiTEwGqn6y51Tp3FnOYYuDepJmsh/ikBAkoowVUWf4F4RdABtauLCqOuRg==,iv:xZMtNffbdnbUbohcmr0ZprxdaeFNvp5VfHOyRh+hrhU=,tag:Tq+fo2QJxZvcMAE1oIudBA==,type:str]
|
||||
sops:
|
||||
kms: []
|
||||
gcp_kms: []
|
||||
azure_kv: []
|
||||
hc_vault: []
|
||||
age:
|
||||
- recipient: age1xaaf9enkf669w0cfnlx4ksd9g2kvvkuskp4xw7x84x6u492ulquqfjez5s
|
||||
enc: |
|
||||
-----BEGIN AGE ENCRYPTED FILE-----
|
||||
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBCdmUzblhaQ09UdEIzc2xw
|
||||
OEh2V2JFTWZXdVdUVDJlTElGd2hnQ2x6aTBjCk85Vk0wMy9VdXFIUmNQNXFxYmF1
|
||||
VkwzelAreUdUY2JDSVlrRitwbXlvOHMKLS0tIHVNUHBTTU44TmpXQyt6OUthOGo5
|
||||
eEtid0paSEttc3FLamFJZ2FWZDVQSGcKG8gAV8xuSyYUxbRJqC+2WcwsuLQ0/Ngv
|
||||
gFy5WVrDl61qq6MtI59ELHQiM6/Jv7x5Gv0Nmfy6q8ABtP6rSns/HA==
|
||||
-----END AGE ENCRYPTED FILE-----
|
||||
lastmodified: "2025-04-03T16:37:52Z"
|
||||
mac: ENC[AES256_GCM,data:c/cGUUlyWJIcJ4sgJEv2EhGvOcE73V953hrOVq3l2PX23mm01rQF5NzXJ0PrEc17kpAPrmnS5CK45KBuN+38WQW6WsCPN+gjzoYzyo6X3W+LaHcSwJd48gRfC/1FXjDvoz7l2o3nmyPncaAzqINTj7ccTzMwgHjrfRNVv+aVWXY=,iv:tV++nZK6zl3dP1Bf+rsB0ivpRZj3r2RCPSGQj19Wdfg=,tag:SbRcxjF57bKZvZ+zl/pBLA==,type:str]
|
||||
pgp: []
|
||||
unencrypted_suffix: _unencrypted
|
||||
version: 3.9.4
|
||||
Loading…
Add table
Add a link
Reference in a new issue