Skip to content

bromanko/nix-config

Repository files navigation

bromanko's Nix Configuration

This is my Nix configuration. It supports my macOS, nixOS, and home-manager configurations.

Usage

Requirements

Nix and Flakes must be installed in order to build the derivations. Running the included ./install-nix.sh script will set those up.

Building and Applying

You can now build a system configuration by running nix build and specifying the configuration target:

For nix-darwin (macOS):

nix build .#darwinConfigurations.bromanko-personal-mbp.system
./result/sw/bin/darwin-rebuild switch --flake .#bromanko-personal-mbp

For nixos:

nixos-rebuild switch --flake .#nixosConfigurations.dev-vm

For home-manager:

nix build .#homeManagerConfigurations.fb-devserver.activationPackage
./result/activate

Home Manager Configuration

The home-manager configuration is decoupled from the nixos or Darwin modules. This allows me to use the same config for both environments managed by nixos/nix-darwin and plain home-manager. Unfortunately it makes the organization of modules messy. The modules defining home-manager options must be in separate files from the config itself. This is because I need to import the home-manager config manually outside of the module loading process.

  • The /home-manager folder contains the home-manager config and will get imported under a home-manager option.
  • The /modules/home-manager folder contains the options for enabling home-manager configuration.

References

This setup is heavily inspired by:

About

bromanko's Nix system configurations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published