Flake Templates

We provide four templates, depending on your needs:

Available templates

Both platforms

NixOS, nix-darwin, home-manager configuration combined, with common modules.

nix flake init -t github:srid/nixos-flake

NixOS only

NixOS configuration only, with home-manager

nix flake init -t github:srid/nixos-flake#linux

macOS only

nix-darwin configuration only, with home-manager

nix flake init -t github:srid/nixos-flake#macos

Home only

home-manager configuration only (useful if you use other Linux distros or do not have admin access to the machine)

nix flake init -t github:srid/nixos-flake#home

After initializing the template

  • open the generated flake.nix and change the user (from “john”) as well as hostname (from “example1”) to match that of your environment (Run echo $USER and hostname -s to determine the new values). 1
  • Then run nix run .#activate (nix run .#activate $USER if you are using the 4th template, “Home only”) to activate the configuration.
Footnotes
1.
If you are on an Intel Mac, change mkARMMacosSystem to mkIntelMacosSystem.
Links to this page