Skip to content

francescobozzo/nix-dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

132 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nix Configuration

This repository contains the setup of my personal devices through dendritic Nix, including:

  • MacBook Pro M4 Pro (Nix Darwin)
  • Framework Desktop (NixOS)

NixOS

Installation

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.89

In case you want to use the existing hardware configuration

nix run github:nix-community/nixos-anywhere -- --flake .#neos --target-host nixos@192.168.1.89

Deployment

Use deploy-rs to deploy changes remotely:

deploy --skip-checks .#neos

LUKS + TPM2

sudo systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0 /dev/nvme0n1p2

Resources

MacOS

Install Nix

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.

Build the system

Run the following command to apply changes to the system:

cd /etc/nix-darwin/
sudo darwin-rebuild switch

Update Nix Flake

Run the following command to update the flake.lock with the latest available software packages.

cd /etc/nix-darwin/
nix flake update

Clean up unused resources

Particularly useful to free some space in the disk

nix-collect-garbage -d

Project folder

When 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 .

Resources

Secrets

nix-shell -p sops --run "sops hosts/framework-desktop/system/neos-secrets.yaml"

Backup

Execute a backup:

sudo systemctl start restic-backups-backblaze.service

Check snapshots:

sudo restic-backblaze snapshots

To restore the last backup into the restore-backup directory we run:

sudo restic-backblaze restore latest --target restore-backup

References

About

Declarative Nix configuration for my hosts

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages