Linux (NixOS) Deployment
Guide to deploying this configuration on NixOS.
Status
Section titled “Status”📋 Planned - NixOS support is designed but not yet fully implemented.
This document describes the planned NixOS deployment strategy.
Overview
Section titled “Overview”This configuration will support NixOS deployment with:
- Shared modules with macOS (nix-darwin)
- Linux-specific base configuration
- Systemd service management
- Multi-architecture support (x86_64, aarch64)
Prerequisites
Section titled “Prerequisites”- NixOS installation media
- x86_64 or aarch64 system
- Administrator access
- Network connectivity
Planned Structure
Section titled “Planned Structure”Linux Base Module
Section titled “Linux Base Module”nix/modules/linux-base.nix
(placeholder exists):
{ config, pkgs, lib, ... }:{ # NixOS base configuration boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true;
networking.networkmanager.enable = true;
services.openssh.enable = true;
system.stateVersion = "24.11";}
NixOS Configuration
Section titled “NixOS Configuration”In flake.nix
:
nixosConfigurations.linux-workstation = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; modules = [ ./nix/modules/common.nix ./nix/modules/linux-base.nix ./nix/profiles/cloud-cli.nix ./nix/profiles/developer.nix ./hosts/linux-workstation.nix
home-manager.nixosModules.home-manager { home-manager.users.wikigen = import ./home/users/wikigen.nix; } ];};
Installation Steps (Planned)
Section titled “Installation Steps (Planned)”1. Boot NixOS Installer
Section titled “1. Boot NixOS Installer”# Boot from USB/ISO# Connect to networksudo systemctl start wpa_supplicant
2. Partition Disk
Section titled “2. Partition Disk”# UEFI systemparted /dev/sda -- mklabel gptparted /dev/sda -- mkpart ESP fat32 1MiB 512MiBparted /dev/sda -- set 1 esp onparted /dev/sda -- mkpart primary 512MiB 100%
# Formatmkfs.fat -F 32 -n boot /dev/sda1mkfs.ext4 -L nixos /dev/sda2
# Mountmount /dev/disk/by-label/nixos /mntmkdir -p /mnt/bootmount /dev/disk/by-label/boot /mnt/boot
3. Clone Configuration
Section titled “3. Clone Configuration”# Clone to /mntcd /mntgit clone https://github.com/yourusername/Config.git /mnt/etc/nixoscd /mnt/etc/nixos
4. Install NixOS
Section titled “4. Install NixOS”# Installnixos-install --flake .#linux-workstation
# Set root passwordnixos-install --root /mnt --no-root-passwd
# Rebootreboot
5. Post-Install
Section titled “5. Post-Install”# Update systemnixos-rebuild switch --flake /etc/nixos#linux-workstation
# Update flakecd /etc/nixosnix flake updatenixos-rebuild switch --flake .#linux-workstation
Differences from macOS
Section titled “Differences from macOS”Package Manager
Section titled “Package Manager”# macOS: Homebrew for GUI appshomebrew.casks = [ "app" ];
# NixOS: All packages via Nixenvironment.systemPackages = [ pkgs.app ];
Services
Section titled “Services”# macOS: launchdlaunchd.user.agents.myservice = { ... };
# NixOS: systemdsystemd.user.services.myservice = { ... };
User Management
Section titled “User Management”# NixOS: Declarative usersusers.users.wikigen = { isNormalUser = true; extraGroups = [ "wheel" "networkmanager" ]; shell = pkgs.zsh;};
Roadmap
Section titled “Roadmap”Phase 1: Basic Support
Section titled “Phase 1: Basic Support”- Complete linux-base.nix module
- Test on VM
- Document installation process
- Add example NixOS configuration
Phase 2: Feature Parity
Section titled “Phase 2: Feature Parity”- All profiles working on Linux
- Systemd service equivalents
- Linux-specific optimizations
- Multi-user support
Phase 3: Advanced Features
Section titled “Phase 3: Advanced Features”- Impermanence setup
- Secure boot
- Full disk encryption
- Remote deployment
Testing (When Implemented)
Section titled “Testing (When Implemented)”# Build VM for testingnix build .#nixosConfigurations.linux-workstation.config.system.build.vm
# Run VM./result/bin/run-linux-workstation-vm
# Test installationnixos-rebuild build-vm --flake .#linux-workstation
Next Steps
Section titled “Next Steps”- Darwin Deployment - macOS deployment (current)
- Cloud Deployment - EC2/GCE deployment (planned)
- Design Doc - Architecture details
Related Documentation
Section titled “Related Documentation”- Structure Guide - Module system
- Design Philosophy - Platform strategy
External References
Section titled “External References”- NixOS Manual - Official docs
- NixOS Installation - Install guide
- NixOS Options - Configuration options
Status: 📋 Planned - Contribute on GitHub