UGA Innovation Factory - NixOS Systems
This repository contains the NixOS configuration for the Innovation Factory's fleet of laptops, desktops, and surface tablets.
Repository Structure
flake.nix: The entry point for the configuration.inventory.nix: Defines the fleet inventory (host types, counts, and device-specific overrides).users.nix: Defines user accounts, passwords, and package sets.hosts/: Contains the logic for generating host configurations and hardware-specific types.sw/: Software modules (Desktop, Kiosk, Python, Neovim, etc.).
Quick Start
Updating the System
The system includes a utility script update-system that handles rebuilding and switching configurations. It automatically detects if it is running on a Surface tablet and offloads the build to a more powerful host if necessary.
To apply changes to the current system:
update-system
This command pulls the latest configuration from GitHub and rebuilds the system.
If your configuration uses external flakes (e.g., via flakeUrl), you may need to allow impure evaluation:
update-system --impure
Manual Rebuilds
If you need to rebuild manually or target a specific host:
# Local build
sudo nixos-rebuild switch --flake .
# Build for a specific host
sudo nixos-rebuild switch --flake .#nix-laptop1
Updating Flake Inputs
To update the lockfile (nixpkgs, home-manager versions, etc.):
nix flake update
Configuration Guide
Adding a New User
- Open
users.nix. - Add a new entry to
modules.users.accounts. - Generate a hashed password using
mkpasswd -m sha-512(requireswhoispackage or similar). - Commit and push.
Assigning Users to Hosts
By default, only root and engr-ugaif are enabled. To enable a specific student user on a specific device:
- Open
inventory.nix. - Locate the host type (e.g.,
nix-laptop). - Add or update the
devicessection for the specific index:
nix-laptop = {
count = 2;
devices = {
"1" = { extraUsers = [ "student_username" ]; };
};
};
Using External Flakes for User Configuration
Users can manage their own Home Manager configuration in a separate flake repository. To use this:
- Open
users.nix. - In the user's configuration block, set the
flakeUrloption:
hdh20267 = {
# ... other settings ...
flakeUrl = "github:hdh20267/dotfiles";
};
The external flake must provide a homeManagerModules.default output. Note that using this feature may require running update-system --impure if the flake is not locked in the system's flake.lock.
Adding a New Host
- Open
inventory.nix. - Increment the
countfor the relevant host type. - The new host will be named sequentially (e.g.,
nix-laptop3).
Development
Python Environment
The system comes with pixi and uv for Python project management. It is recommended to use these tools for project-specific environments rather than installing global Python packages.
pixi init my_project
cd my_project
pixi add pandas numpy