Skip to content

Repository files navigation

nixos-config

Useful admin commands

Print all gc-roots not part of the current system

$ sudo -i nix-store --gc --print-roots | grep -E -v '^(/nix/var|/run/current-system|/run/booted-system|/proc|{memory|{censored)'

Store management

The command nix-collect-garbage is mostly an alias of nix-store --gc. That is, it deletes all unreachable store objects in the Nix store to clean up your system. However, it provides two additional options, --delete-old and --delete-older-than, which also delete old profiles. These options are the equivalent of running nix-env --delete-generations with various augments on multiple profiles, prior to running nix-collect-garbage (or just nix-store --gc) without any flags. The flakes equivalent is nix store gc.

Why-depends for current profile

$ nix why-depends /nix/var/nix/profiles/per-user/$USER/profile $FLAKES_OUTPUT_OR_STORE_PATH

Buoy

DigitalOcean droplet to achieve external port forwarding to my server behind a router I can't administer.

Build base image

$ nix build .\#nixosConfigurations.buoy.config.system.build.digitalOceanImage

For uploading to DigitalOcean's image repo as a base for new droplets.

NixOS remote build

$ nixos-rebuild switch --flake .\#buoy --target-host achuie@buoy --use-remote-sudo

Build locally on a NixOS system, then deploy to an existing droplet.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages