Bridge to NixOS

Updated

September 4, 2026

Bridge to NixOS

Goal: Convert Fedora+Nix habits into a first NixOS host with minimal conceptual shock—reuse flakes, Home Manager knowledge, and store literacy.


What stays the same

You already do on Fedora On NixOS
/nix/store, closures, GC roots Identical store model
nix build / run / develop Identical
flake.lock discipline Identical (+ host config in same monorepo often)
Home Manager modules for git/shell Same options; different wiring
direnv + project flakes Identical

What is new

New concept Meaning
nixosConfigurations Flake output describing whole machines
Module system services.openssh.enable = true; merges options
nixos-rebuild switch --flake Activate system generation
Bootloader generations Roll back from GRUB/systemd-boot
environment.systemPackages System-wide packages (not just profile)
Systemd system units via Nix Beyond user HM services
Disko / fileSystems Disk layout as code
Fedora era                          NixOS era
──────────                          ─────────
dnf upgrade                         nixos-rebuild (flake pin)
/etc hand edits                     modules in git
~/.config via HM standalone         HM standalone OR nixos module
nix profile thin toolkit            systemPackages + HM

Porting checklist (HM → NixOS)

  1. Keep programs.* and home.packages modules almost as-is.
  2. Move OS concerns out of HM: sound, printing, kernel, networking—use NixOS modules.
  3. Wire HM as NixOS module:
# sketch — details in Home layout / host parts
{
  inputs.home-manager.nixosModules.home-manager
  {
    home-manager.useGlobalPkgs = true;
    home-manager.useUserPackages = true;
    home-manager.users.alice = import ./home.nix;
  }
}
  1. Replace nix profile tools with environment.systemPackages or HM packages deliberately.
  2. Retire dnf habits for software you now declare—keep mental note of firmware/kernel still “special.”

First NixOS learning loop (preview)

Do this on a VM (Lab 0), not your only laptop:

  1. Install NixOS (graphical or minimal) — Install
  2. Put host in a flake — Flake host
  3. nixos-rebuild switch --flake .#hostname
  4. Break sshd/firewall intentionally; roll back a generation — Rebuild and generations
  5. Import your HM config

Success metric: wipe VM disk, rebuild from flake + backup secrets, services return.


Dual-stack monorepo sketch

{
  description = "Machines and homes";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-26.05";
    home-manager.url = "github:nix-community/home-manager/release-26.05";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = { self, nixpkgs, home-manager, ... }: {
    homeConfigurations.alice = /* Fedora path */;
    nixosConfigurations.lab = nixpkgs.lib.nixosSystem {
      system = "x86_64-linux";
      modules = [ ./hosts/lab/configuration.nix ];
    };
    devShells.x86_64-linux.default = /* shared */;
  };
}

One mental model: outputs are different products from the same factory.


Skills you should already have (gate)

Before NixOS host part, from this bridge path:

  • Nix installed via Fedora (or documented equivalent)
  • Flakes + lock for a real project
  • direnv workflow
  • HM standalone generation/rollback
  • Store GC literacy
  • Written dnf vs Nix policy

Lab

  1. Draft hosts/lab/configuration.nix on paper or in git with only: hostname, user, ssh, firewall—without installing yet.
  2. List HM modules you will import unchanged.
  3. Schedule a VM install using Lab 0 chapters.

Checkpoint

  • You can list what changes and what does not when moving to NixOS
  • You have a transition shape (A/B/C) written down
  • You are ready for part 03-nixos-host/ without relearning store/flakes

Further depth