formatter and lxc configuration

This commit is contained in:
UGA Innovation Factory
2025-12-10 14:52:34 +00:00
parent d4835360f5
commit 14202a8233
23 changed files with 742 additions and 308 deletions

View File

@@ -1,4 +1,10 @@
{ config, lib, pkgs, inputs, ... }:
{
config,
lib,
pkgs,
inputs,
...
}:
# ============================================================================
# Software Module Entry Point
@@ -22,20 +28,23 @@ in
enable = mkEnableOption "Standard Workstation Configuration";
type = mkOption {
type = types.enum [ "desktop" "kiosk" ];
type = types.enum [
"desktop"
"kiosk"
];
default = "desktop";
description = "Type of system configuration: 'desktop' for normal OS, 'kiosk' for tablet/kiosk mode.";
};
extraPackages = mkOption {
type = types.listOf types.package;
default = [];
default = [ ];
description = "Extra packages to install.";
};
excludePackages = mkOption {
type = types.listOf types.package;
default = [];
default = [ ];
description = "Packages to exclude from the default list.";
};
@@ -49,37 +58,57 @@ in
config = mkIf cfg.enable (mkMerge [
{
nixpkgs.config.allowUnfree = true;
programs.zsh.enable = true;
programs.nix-ld.enable = true;
environment.systemPackages = with pkgs; subtractLists cfg.excludePackages [
htop
binutils
zsh
git
oh-my-posh
inputs.lazyvim-nixvim.packages.${stdenv.hostPlatform.system}.nvim
# Custom update script
(writeShellScriptBin "update-system" ''
HOSTNAME=$(hostname)
FLAKE_URI="github:UGA-Innovation-Factory/nixos-systems"
# Pass arguments like --impure to nixos-rebuild
EXTRA_ARGS="$@"
environment.systemPackages =
with pkgs;
subtractLists cfg.excludePackages [
htop
binutils
zsh
git
oh-my-posh
inputs.lazyvim-nixvim.packages.${stdenv.hostPlatform.system}.nvim
# Custom update script
(writeShellScriptBin "update-system" ''
HOSTNAME=$(hostname)
FLAKE_URI="github:UGA-Innovation-Factory/nixos-systems"
if [[ "$HOSTNAME" == nix-surface* ]]; then
echo "Detected Surface tablet. Using remote build host."
sudo nixos-rebuild switch --flake "$FLAKE_URI" --build-host engr-ugaif@192.168.11.133 --refresh $EXTRA_ARGS
else
echo "Updating local system..."
sudo nixos-rebuild switch --flake "$FLAKE_URI" --refresh $EXTRA_ARGS
fi
'')
];
# Pass arguments like --impure to nixos-rebuild
EXTRA_ARGS="$@"
if [[ "$HOSTNAME" == nix-surface* ]]; then
echo "Detected Surface tablet. Using remote build host."
sudo nixos-rebuild switch --flake "$FLAKE_URI" --build-host engr-ugaif@192.168.11.133 --refresh $EXTRA_ARGS
else
echo "Updating local system..."
sudo nixos-rebuild switch --flake "$FLAKE_URI" --refresh $EXTRA_ARGS
fi
'')
];
}
# Import Desktop or Kiosk modules based on type
(mkIf (cfg.type == "desktop") (import ./desktop { inherit config lib pkgs inputs; }))
(mkIf (cfg.type == "kiosk") (import ./kiosk { inherit config lib pkgs inputs; }))
(mkIf (cfg.type == "desktop") (
import ./desktop {
inherit
config
lib
pkgs
inputs
;
}
))
(mkIf (cfg.type == "kiosk") (
import ./kiosk {
inherit
config
lib
pkgs
inputs
;
}
))
]);
}

View File

@@ -1,5 +1,25 @@
{ config, lib, pkgs, inputs, ... }:
{
config,
lib,
pkgs,
inputs,
...
}:
lib.mkMerge [
(import ./programs.nix { inherit config lib pkgs inputs; })
(import ./services.nix { inherit config lib pkgs inputs; })
(import ./programs.nix {
inherit
config
lib
pkgs
inputs
;
})
(import ./services.nix {
inherit
config
lib
pkgs
inputs
;
})
]

View File

@@ -1,4 +1,10 @@
{ config, lib, pkgs, inputs, ... }:
{
config,
lib,
pkgs,
inputs,
...
}:
with lib;
@@ -15,7 +21,8 @@ let
teams-for-linux
wpsoffice
];
in {
in
{
environment.systemPackages = subtractLists cfg.excludePackages (basePackages ++ cfg.extraPackages);
programs.mtr.enable = true;

View File

@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
modules.sw.python.enable = lib.mkDefault true;

View File

@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
# ============================================================================
# Ghostty Terminfo Module
@@ -8,7 +13,7 @@
# adds it to the system packages.
let
ghostty-terminfo = pkgs.runCommand "ghostty-terminfo" {} ''
ghostty-terminfo = pkgs.runCommand "ghostty-terminfo" { } ''
mkdir -p $out/share/terminfo
cat > ghostty.info <<'EOF'
xterm-ghostty|ghostty|Ghostty,

View File

@@ -1,6 +1,33 @@
{ config, lib, pkgs, inputs, ... }:
{
config,
lib,
pkgs,
inputs,
...
}:
lib.mkMerge [
(import ./programs.nix { inherit config lib pkgs inputs; })
(import ./services.nix { inherit config lib pkgs inputs; })
(import ./gsettings.nix { inherit config lib pkgs inputs; })
(import ./programs.nix {
inherit
config
lib
pkgs
inputs
;
})
(import ./services.nix {
inherit
config
lib
pkgs
inputs
;
})
(import ./gsettings.nix {
inherit
config
lib
pkgs
inputs
;
})
]

View File

@@ -1,50 +1,58 @@
{ config, lib, inputs, ... }:
{
config,
lib,
inputs,
...
}:
let
cfg = config.modules.sw;
in {
in
{
programs.dconf = {
enable = true;
profiles.user = {
databases = [{
settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
clock-format = "12h";
clock-show-weekday = true;
show-battery-percentage = true;
databases = [
{
settings = {
"org/gnome/desktop/interface" = {
color-scheme = "prefer-dark";
clock-format = "12h";
clock-show-weekday = true;
show-battery-percentage = true;
};
"org/gnome/desktop/media-handling" = {
automount = false;
automount-open = false;
autorun-never = true;
};
"org/gnome/settings-daemon/plugins/power" = {
sleep-inactive-ac-type = "nothing";
};
"org/gnome/desktop/lockdown" = {
disable-lock-screen = true;
};
"org/gnome/desktop/screensaver" = {
lock-enabled = false;
};
"org/gnome/desktop/session" = {
idle-delay = inputs.nixpkgs.lib.gvariant.mkUint32 0;
};
"org/gnome/desktop/input-sources" = {
sources = "[('ibus', 'xkb:us::eng')]";
};
"org/gnome/desktop/mru-sources" = {
sources = "[('ibus', 'xkb:us::eng')]";
};
"sm/puri/phosh" = {
lock-enabled = false;
};
"org/gnome/desktop/a11y/applications" = {
screen-keyboard-enabled = true;
};
};
"org/gnome/desktop/media-handling" = {
automount = false;
automount-open = false;
autorun-never = true;
};
"org/gnome/settings-daemon/plugins/power" = {
sleep-inactive-ac-type = "nothing";
};
"org/gnome/desktop/lockdown" = {
disable-lock-screen = true;
};
"org/gnome/desktop/screensaver" = {
lock-enabled = false;
};
"org/gnome/desktop/session" = {
idle-delay = inputs.nixpkgs.lib.gvariant.mkUint32 0;
};
"org/gnome/desktop/input-sources" = {
sources = "[('ibus', 'xkb:us::eng')]";
};
"org/gnome/desktop/mru-sources" = {
sources = "[('ibus', 'xkb:us::eng')]";
};
"sm/puri/phosh" = {
lock-enabled = false;
};
"org/gnome/desktop/a11y/applications" = {
screen-keyboard-enabled = true;
};
};
}];
}
];
};
};
}

View File

@@ -1,4 +1,10 @@
{ config, lib, pkgs, inputs, ... }:
{
config,
lib,
pkgs,
inputs,
...
}:
with lib;
@@ -13,7 +19,8 @@ let
phoc
gsettings-desktop-schemas
];
in {
in
{
environment.systemPackages = subtractLists cfg.excludePackages (basePackages ++ cfg.extraPackages);
programs.chromium = {

View File

@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
{
services.xserver = {
@@ -28,7 +33,7 @@
enable = true;
ibus.engines = [ pkgs.ibus-engines.m17n ];
};
services.gnome.gnome-keyring.enable = lib.mkForce false;
environment.sessionVariables = {
@@ -36,9 +41,10 @@
GDK_DPI_SCALE = "0.5";
# Make GLib / gsettings actually see schemas
XDG_DATA_DIRS = [ "/run/current-system/sw/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}" ];
GSETTINGS_SCHEMA_DIR =
"/run/current-system/sw/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}/glib-2.0/schemas";
XDG_DATA_DIRS = [
"/run/current-system/sw/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}"
];
GSETTINGS_SCHEMA_DIR = "/run/current-system/sw/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}/glib-2.0/schemas";
};
environment.etc."machine-info".text = ''
@@ -46,12 +52,12 @@
'';
services.logind.settings.Login = {
HandlePowerKey="ignore";
HandleSuspendKey="ignore";
HandleHibernateKey="ignore";
HandleLidSwitch="ignore";
HandleLidSwitchExternalPower="ignore";
IdleAction="ignore";
HandlePowerKey = "ignore";
HandleSuspendKey = "ignore";
HandleHibernateKey = "ignore";
HandleLidSwitch = "ignore";
HandleLidSwitchExternalPower = "ignore";
IdleAction = "ignore";
};
# Enable networking
@@ -90,7 +96,7 @@
systemd.user.services.squeekboard = {
description = "Squeekboard on-screen keyboard";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${pkgs.squeekboard}/bin/squeekboard";
@@ -101,7 +107,7 @@
systemd.user.services."force-osk" = {
description = "Force the OSK to Enable";
wantedBy = [ "chromium-kiosk.service" ];
partOf = [ "chromium-kiosk.service" ];
partOf = [ "chromium-kiosk.service" ];
serviceConfig = {
ExecStartPre = ''
@@ -117,7 +123,7 @@
systemd.user.services."force-input-sources" = {
description = "Force the Gsettings Input Sources";
wantedBy = [ "chromium-kiosk.service" ];
partOf = [ "chromium-kiosk.service" ];
partOf = [ "chromium-kiosk.service" ];
serviceConfig = {
ExecStartPre = ''
@@ -137,7 +143,7 @@
systemd.user.services."chromium-kiosk" = {
description = "Chromium kiosk";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = ''

View File

@@ -5,16 +5,19 @@
# ============================================================================
# This module configures Neovim, specifically setting up TreeSitter parsers
# to ensure syntax highlighting works correctly.
# https://github.com/nvim-treesitter/nvim-treesitter#i-get-query-error-invalid-node-type-at-position
xdg.configFile."nvim/parser".source =
let
parsers = pkgs.symlinkJoin {
name = "treesitter-parsers";
paths = (pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: with plugins; [
c
lua
])).dependencies;
paths =
(pkgs.vimPlugins.nvim-treesitter.withPlugins (
plugins: with plugins; [
c
lua
]
)).dependencies;
};
in
"${parsers}/parser";

View File

@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
# ============================================================================
# Python Environment
@@ -11,7 +16,8 @@ with lib;
let
cfg = config.modules.sw.python;
in {
in
{
options.modules.sw.python = {
enable = mkEnableOption "Python development tools (pixi, uv)";
};

View File

@@ -1,4 +1,10 @@
{ pkgs, config, osConfig, lib, ... }:
{
pkgs,
config,
osConfig,
lib,
...
}:
# ============================================================================
# Shell Theme Configuration
@@ -14,7 +20,7 @@ let
};
# Make a root variant with red username (wraps {{ .UserName }} with ANSI red)
jyumppRootTheme = pkgs.runCommand "jyumpp-root.omp.json" {} ''
jyumppRootTheme = pkgs.runCommand "jyumpp-root.omp.json" { } ''
sed -E 's|\{\{[[:space:]]*\.UserName[[:space:]]*\}\}|<#FF3B30>{{ .UserName }}</>|g' \
${jyumppTheme} > $out
'';