This repository contains the setup of my personal devices through dendritic Nix, including:
- MacBook Pro M4 Pro (Nix Darwin)
- Framework Desktop (NixOS)
In case you need to generate the hardware configuration:
nix run github:nix-community/nixos-anywhere -- --generate-hardware-config nixos-generate-config ./hosts/framework-desktop/hardware-configuration.nix --flake .#neos --target-host nixos@192.168.1.89In case you want to use the existing hardware configuration
nix run github:nix-community/nixos-anywhere -- --flake .#neos --target-host nixos@192.168.1.89Use deploy-rs to deploy changes remotely:
deploy --skip-checks .#neossudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0 /dev/nvme0n1p2- https://nixos.org/manual/nixos/stable/#sec-installation-manual
- https://github.com/nix-community/nixos-anywhere
- https://github.com/serokell/deploy-rs
- https://discourse.nixos.org/t/full-disk-encryption-tpm2/29454/2
It is recommended to install Nix using the Determinate installer.
From the official documentation:
It installs either Nix or Determinate Nix (with flakes enabled by default), it offers support for seamlessly uninstalling Nix, it enables Nix to survive macOS upgrades, and much more.
Run the following command to apply changes to the system:
cd /etc/nix-darwin/
sudo darwin-rebuild switchRun the following command to update the flake.lock with the latest available software packages.
cd /etc/nix-darwin/
nix flake updateParticularly useful to free some space in the disk
nix-collect-garbage -dWhen initializing a new project using nix flakes, use the following command to start with a template.
nix flake new -t github:nix-community/nix-direnv .nix-shell -p sops --run "sops hosts/framework-desktop/system/neos-secrets.yaml"Execute a backup:
sudo systemctl start restic-backups-backblaze.serviceCheck snapshots:
sudo restic-backblaze snapshotsTo restore the last backup into the restore-backup directory we run:
sudo restic-backblaze restore latest --target restore-backup