nix-darwin

nix-darwin

Summary

  • is a community project that aims to provide support for using the Nix package manager on macOS
  • provides support for using nix on macOS and enables to config macOS with nix
  • home-manager provides a module that allows you to prepare user environments directly from the nix-darwin configuration file
    • basically use home-manager via nix-darwin CLI
  • nix-darwin configuration has to include (below) which will introduce a new NixOS option called home-manager whose type is an attribute set that maps user names to Home Manager configurations
{ self, inputs, config, lib, pkgs, ... }: {
  # bootsrap primary user
  user = {
    description = "Rich";
    name = "${config.user.name}";
    home = "${
        if pkgs.stdenvNoCC.isDarwin then "/Users" else "/home"
      }/${config.user.name}";
    shell = pkgs.zsh;
  };

  # bootstrap home-manager config
  hm = import ./home-manager;

  # Enable home-manager
  home-manager = {
    extraSpecialArgs = { inherit self inputs; };
    useGlobalPkgs = true;
    useUserPackages = true;
    backupFileExtension = "backup";
  };

Notes mentioning this note