Flake Templates

We provide four templates, depending on your needs:

Available templates

You can easily initialize one of our templates using Omnix1:

1

If you do not use Omnix, you must use nix flake init, and manually change the template values such as username and hostname.

NixOS only

NixOS configuration only, with home-manager

nix --accept-flake-config run github:juspay/omnix -- \
  init -o ~/nix-config github:srid/nixos-unified#linux

macOS only

nix-darwin configuration only, with home-manager

nix --accept-flake-config run github:juspay/omnix -- \
  init -o ~/nix-config github:srid/nixos-unified#macos

Home only

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

nix --accept-flake-config run github:juspay/omnix -- \
  init -o ~/nix-config github:srid/nixos-unified#home

After initializing the template

Run nix run .#activate (nix run .#activate $USER if you are using the last template, “Home only”) to activate the configuration.

  • on macOS, if you get an error about /etc/nix/nix.conf, run:
    sudo mv /etc/nix/nix.conf /etc/nix/nix.conf.before-nix-darwin
    nix --extra-experimental-features "nix-command flakes" run .#activate
    
  • on macOS, if you had used Determinate Systems nix-installer, you may want to uninstall that Nix, such that we use the one provided by nix-darwin,
    sudo -i nix-env --uninstall nix
    
2

If you are on an Intel Mac, also change nixpkgs.hostPlatform accordingly.