Skip to content

Nimor111/nixos-config

Repository files navigation

NixOS/nix-darwin configuration

Steps to use

  1. Create a new configuration in the machine directory (with a default.nix and a hardware.nix) and symlink the default.nix to /etc/nixos/configuration.nix:
    sudo ln -s machine/<machine>/default.nix /etc/nixos/configuration.nix
        

    If you’re on darwin:

    sudo ln -s machine/<machine>/default.nix $HOME/.nixpkgs/darwin-configuration.nix
        
  2. Symlink the overlays:
    sudo ln -s overlays /etc/nixos/overlays
        

    If you’re on darwin:

    sudo ln -s overlays $HOME/.nixpkgs/overlays
        
  3. Remove your channels ( I use a fixed version of nixpkgs managed by niv )
    nix-channel --remove <channel_name>
    # the root channel as well
    sudo nix-channel --remove <channel_name>
        
  4. Rebuild the nixos configuration:
    nix-shell --run 'rebuild'
        

Structure

  • machine - machine configurations
  • modules - reusable chunks to build a machine configuration. Includes modules from home-manager and nixos
  • overlays - nixpkgs overlays
  • pkgs - custom packages that are either not in nixpkgs or are newer versions
  • source.* - niv files

Credits - configs I have taken ideas and code from