No description
Find a file
2025-06-30 14:32:30 -07:00
home-manager modularize configs 2025-06-30 14:32:30 -07:00
modules modularize configs 2025-06-30 14:29:03 -07:00
nixos modularize configs 2025-06-30 14:32:30 -07:00
old_config modularize configs 2025-06-30 14:32:30 -07:00
overlays hashes 2025-06-19 02:14:26 -07:00
pkgs tmuxai installed 2025-05-15 04:32:02 -07:00
scripts modularize configs 2025-06-30 14:32:30 -07:00
flake.lock flake update 2025-06-28 08:31:16 -07:00
flake.nix modularize configs 2025-06-30 14:32:30 -07:00
log2.txt tmuxai 2025-05-15 04:23:41 -07:00
logs dns 2025-06-26 16:11:23 -07:00
README.md modularize configs 2025-06-30 14:32:30 -07:00

NixOS Configuration Refactor

This document outlines the new, modular structure of the NixOS configuration and explains how to revert to the previous setup if necessary.

New Directory Structure

The configuration has been reorganized to be more modular and easier to manage. Here is an overview of the new structure:

.
├── flake.nix
├── home-manager/
│   ├── death916-homelab.nix
│   └── home.nix
├── modules/
│   ├── home-manager/
│   │   └── common.nix
│   └── nixos/
│       ├── common/
│       │   ├── base.nix
│       │   └── tailscale.nix
│       ├── homelab/
│       │   ├── networking.nix
│       │   ├── services.nix
│       │   └── user.nix
│       └── laptop/
│           ├── desktop.nix
│           └── user.nix
├── nixos/
│   ├── configuration.nix
│   └── homelab.nix
├── old_config/         # <-- Your previous configuration is backed up here
└── scripts/
    └── nh-push         # <-- New helper script

Key Changes

  • Modularization: The main configuration.nix and homelab.nix files have been split into smaller, more focused modules located in the modules/ directory. This makes the code cleaner and easier to navigate.
  • Shared vs. Specific Config: Common settings shared between both the laptop and homelab are now in modules/nixos/common/ and modules/home-manager/common.nix. Machine-specific configurations are in their respective laptop/ and homelab/ subdirectories.
  • flake.nix: The flake now uses specialArgs to pass overlays and other shared values to the modules, reducing redundancy.
  • nh-push script: A new script has been added at scripts/nh-push. This script wraps the nh os switch command and automatically runs git push after a successful build, streamlining the update process.

How to Revert the Changes

If you encounter any issues with the new configuration, you can easily revert to your previous setup. Your old files are safely archived in the old_config/ directory.

To revert, follow these steps:

  1. Delete the new configuration files:

    rm -rf flake.nix nixos/ modules/ home-manager/ scripts/
    
  2. Restore the old configuration from the backup:

    mv old_config/* .
    rmdir old_config
    
  3. Rebuild your system:

    After restoring the files, run your usual NixOS rebuild command, for example:

    sudo nixos-rebuild switch --flake .#homelab
    

This will restore your system to the exact state it was in before these changes were made.