From 4cf467173b686d845be316a4bf4d8d22bf70f618 Mon Sep 17 00:00:00 2001 From: EmergentMind <7410928+EmergentMind@users.noreply.github.com> Date: Sat, 23 Dec 2023 14:42:08 -0700 Subject: [PATCH] Update README.md Add home-manager usage example that is inline with current recommended sops-nix installation approach. The required import path is substantially different than that of the other example, which has been retained. --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 33a2d39..ea4d94a 100644 --- a/README.md +++ b/README.md @@ -727,7 +727,27 @@ Instead of running as an activation script, sops-nix runs as a systemd user serv And instead of decrypting to `/run/secrets`, the secrets are decrypted to `$XDG_RUNTIME_DIR/secrets` that is located on a tmpfs or similar non-persistent filesystem. Depending on whether you use home-manager system-wide or using a home.nix, you have to import it in a different way. -This example show the `channel` approach from the example [Install: nix-channel](#nix-channel) for simplicity, but all other methods work as well. +This exmaple shows the `flake` approach from the recommended example [Install: Flakes (current recommendation)](#Flakes (current recommendation)) + +```nix +{ + # NixOS system-wide home-manager configuration + home-manager.sharedModules = [ + inputs.sops-nix.homeManagerModules.sops + ]; +} +``` + +```nix +{ + # Configuration via home.nix + imports = [ + inputs.sops-nix.homeManagerModules.sops + ]; +} +``` + +This example show the `channel` approach from the example [Install: nix-channel](#nix-channel). All other methods work as well. ```nix {