From ec628240b01433e306e045c6f820298e3eec13d4 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Thu, 28 Nov 2024 16:33:51 +0100 Subject: [PATCH] README: add a few useful commands --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 16698dc..d97bb87 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![built with nix](https://builtwithnix.org/badge.svg)](https://builtwithnix.org) + # Nix Dotfiles These are my dotfiles for several nix machines. @@ -16,6 +17,7 @@ Here are some of the interesting files and dirs: | `/secrets` | Encrypted [sops-nix][sops-nix] secrets. | | `flake.nix` | The root of everyting. Defines the inputs and outputs of the project. Also applies misc overlays and adds config-wide modules. See [Nix Flakes][nix-flakes] for more information. | + ## Hosts | Host | Machine type | Purpose | @@ -25,6 +27,7 @@ Here are some of the interesting files and dirs: | `Dosei` | Dell Optiplex | Work computer, mostly used for development and testing. | | `Europa` | Dell Optiplex | Other work computer, used as nix builder for `Dosei`. | + ## home-manager configuration | Path | Purpose | @@ -36,6 +39,28 @@ Here are some of the interesting files and dirs: | `/home/services` | Configuration for services/daemons that are user-specific. | | `/home/shell.nix` | Shell-agnostic configuration. This includes aliases, envvars, functions, etc. | + +## Some useful long commands + +Build configuration without switching: + +``` +nix build .#nixosConfigurations.tsuki.config.system.build.toplevel -L +``` + +Check why configuration depends on package: + +``` +NIXPKGS_ALLOW_INSECURE=1 nix why-depends .#nixosConfigurations.tsuki.config.system.build.toplevel .#pkgs.suspiciousPackage +``` + +Re-encrypt sops secrets with new key: + +``` +sops updatekeys secrets/hosts/file.yml +``` + + [home-manager]: https://github.com/nix-community/home-manager [nixos-search]: https://search.nixos.org/options [sops-nix]: https://github.com/Mic92/sops-nix