Skip to content

unlobito/system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

system

get started (on macOS) 🏃

first, authorise SSH keys in GitLab (user profile / deploy keys).

second, install Lix using the one-liner:

$ curl -sSf -L https://install.lix.systems/lix | sh -s -- install

third, ensure Lix is installed correctly:

$ nix run nixpkgs#hello

fourth, check flake.nix: make sure there's a darwinConfigurations section for the current hostname

last, but not least, once you're ready to commit:

$ nix run nix-darwin -- switch --flake .

rebuilding 🔧

after initial setup, we can use a shorter command to rebuild the system:

$ darwin-rebuild switch --flake .

Homebrew

Formulae are managed by nix-darwin's homebrew module, mostly through modules/darwin/brew.nix.

homebrew.global.brewfile is enabled, permitting use of brew bundle to preview missing packages against the current state.

List dependencies that haven't been installed:

$ brew bundle check -v

List unexpected installed dependencies:

# Needs --force to actually cleanup, see --help
$ brew bundle cleanup

get started (on NixOS) 🏃

first, download and install NixOS.

second, authorise SSH keys in GitLab (user profile / deploy keys).

third, move /etc/nixos to our home directory:

$ sudo mv /etc/nixos ~/system && sudo chown -R $USER ~/system

fourth, gently initialise the git repository while preserving nixos-generate-config output:

# this could probably be less convoluted?
$ mv {hardware-configuration.nix,configuration.nix} ..
$ git init && git remote add origin [email protected]:htw/system.git && git fetch origin
$ git reset --hard origin/main
$ mv ../hardware-configuration.nix ./modules/hardware/$(hostname).nix

fifth, check flake.nix: make sure there's a nixosConfigurations section for the current hostname (use ../configuration.nix as a reference)

last, but not least, once you're ready to commit:

$ sudo nixos-rebuild switch --flake .

notes

influences

further reading

About

lix configuration for macOS+NixOS - mirror of https://gitlab.canidae.systems/htw/system

Resources

Stars

Watchers

Forks