feat: Export formatter and lxc configuration from flake
This commit is contained in:
committed by
Hunter Halloran
parent
faf4afcd3b
commit
01d1a36650
@@ -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
|
||||
;
|
||||
}
|
||||
))
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user