refactor: Module to ugaif and readme update

This commit is contained in:
UGA Innovation Factory
2025-12-15 15:32:40 -05:00
committed by Hunter Halloran
parent c46b0aa685
commit 205f03337a
31 changed files with 577 additions and 271 deletions

View File

@@ -16,7 +16,7 @@
with lib;
let
cfg = config.modules.sw;
cfg = config.ugaif.sw;
in
{
imports = [
@@ -25,7 +25,7 @@ in
./updater.nix
];
options.modules.sw = {
options.ugaif.sw = {
enable = mkEnableOption "Standard Workstation Configuration";
type = mkOption {

View File

@@ -9,7 +9,7 @@
with lib;
let
cfg = config.modules.sw;
cfg = config.ugaif.sw;
basePackages = with pkgs; [
tmux
man

View File

@@ -6,7 +6,7 @@
}:
{
modules.sw.python.enable = lib.mkDefault true;
ugaif.sw.python.enable = lib.mkDefault true;
services.displayManager.sddm.enable = true;
services.desktopManager.plasma6.enable = true;

View File

@@ -9,7 +9,7 @@
with lib;
let
cfg = config.modules.sw;
cfg = config.ugaif.sw;
basePackages = with pkgs; [
tmux
man

View File

@@ -15,10 +15,10 @@
with lib;
let
cfg = config.modules.sw.python;
cfg = config.ugaif.sw.python;
in
{
options.modules.sw.python = {
options.ugaif.sw.python = {
enable = mkEnableOption "Python development tools (pixi, uv)" // {
default = true;
};

View File

@@ -9,15 +9,35 @@
}:
lib.mkMerge [
(import ./kiosk-browser.nix {
inherit config lib pkgs inputs;
inherit
config
lib
pkgs
inputs
;
})
(import ./services.nix {
inherit config lib pkgs inputs;
inherit
config
lib
pkgs
inputs
;
})
(import ./net.nix {
inherit config lib pkgs inputs;
inherit
config
lib
pkgs
inputs
;
})
(import ./programs.nix {
inherit config lib pkgs inputs;
inherit
config
lib
pkgs
inputs
;
})
]

View File

@@ -1,7 +1,11 @@
# This module configures Chromium for kiosk mode under Sway.
# It includes a startup script that determines the kiosk URL based on the machine's MAC address.
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
macCaseBuilder = (import ./mac-hostmap.nix { inherit lib; }).macCaseBuilder;

View File

@@ -13,15 +13,16 @@ let
# varName: the shell variable to assign
# prefix: optional string to prepend to the value (default: "")
# attrset: attribute set to use (default: hostmap)
macCaseBuilder = {
varName,
prefix ? "",
attrset ? hostmap
}:
macCaseBuilder =
{
varName,
prefix ? "",
attrset ? hostmap,
}:
lib.concatStringsSep "\n" (
lib.mapAttrsToList (mac: val: " ${mac}) ${varName}=${prefix}${val} ;;") attrset
);
in
in
{
inherit hostmap macCaseBuilder;
}

View File

@@ -1,5 +1,11 @@
# This module configures the network for the stateless kiosk using base networking (no systemd-networkd).
{ config, lib, pkgs, inputs, ... }:
{
config,
lib,
pkgs,
inputs,
...
}:
{
networking = {
useNetworkd = false;

View File

@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
programs.sway = {
enable = true;

View File

@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
macCaseBuilder = (import ./mac-hostmap.nix { inherit lib; }).macCaseBuilder;
shellCases = macCaseBuilder {

View File

@@ -6,7 +6,7 @@
}:
let
cfg = config.modules.sw;
cfg = config.ugaif.sw;
in
{
programs.dconf = {

View File

@@ -9,7 +9,7 @@
with lib;
let
cfg = config.modules.sw;
cfg = config.ugaif.sw;
basePackages = with pkgs; [
libcamera
chromium

View File

@@ -155,7 +155,7 @@
--noerrdialogs \
--disable-session-crashed-bubble \
--disable-infobars \
${config.modules.sw.kioskUrl}
${config.ugaif.sw.kioskUrl}
'';
};
};

View File

@@ -8,7 +8,7 @@
with lib;
{
options.modules.sw.remoteBuild = lib.mkOption {
options.ugaif.sw.remoteBuild = lib.mkOption {
type = types.submodule {
options = {
hosts = mkOption {
@@ -29,7 +29,7 @@ with lib;
};
config = {
modules.sw.remoteBuild.enable = lib.mkDefault (config.modules.sw.type == "tablet-kiosk");
ugaif.sw.remoteBuild.enable = lib.mkDefault (config.ugaif.sw.type == "tablet-kiosk");
environment.systemPackages = [
(pkgs.writeShellScriptBin "update-system" ''
@@ -62,18 +62,15 @@ with lib;
description = "System daemon to one-shot run the Nix updater from fleet flake as root";
serviceConfig = {
Type = "oneshot";
ExecStart =
ExecStart =
let
hosts = config.modules.sw.remoteBuild.hosts;
hosts = config.ugaif.sw.remoteBuild.hosts;
builders = lib.strings.concatMapStringsSep ";" (x: x) hosts;
rebuildCmd = "${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --refresh";
source = "--flake github:UGA-Innovation-Factory/nixos-systems";
remoteBuildFlags = if config.modules.sw.remoteBuild.enable
then
''--builders "${builders}"''
else "";
remoteBuildFlags = if config.ugaif.sw.remoteBuild.enable then ''--builders "${builders}"'' else "";
in
"${rebuildCmd} ${remoteBuildFlags} --print-build-logs ${source}#${config.networking.hostName}";
"${rebuildCmd} ${remoteBuildFlags} --print-build-logs ${source}#${config.networking.hostName}";
User = "root";
Group = "root";
TimeoutStartSec = "0";