Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

home-manager: Change defaultSymlinkPath to "<user-home>/.secrets" #530

Merged
merged 2 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,9 @@ sops-nix also provides a home-manager module.
This module provides a subset of features provided by the system-wide sops-nix since features like the creation of the ramfs and changing the owner of the secrets are not available for non-root users.

Instead of running as an activation script, sops-nix runs as a systemd user service called `sops-nix.service`.
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.
And instead of decrypting to `/run/secrets`, the secrets are stored decrypted to `$XDG_RUNTIME_DIR/secrets` that is located on a tmpfs or similar non-persistent filesystem. Additionally secrets are symlinked to the user home-directory in the `.secrets`-directory which is used as reference
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. the secrets are stored decrypted to $XDG_RUNTIME_DIR/secrets

ls -l $XDG_RUNTIME_DIR/secrets
"/run/user/1000/secrets": No such file or directory (os error 2)

Below it refers to "${config.xdg.configHome}/sops-nix/secrets"


  1. Additionally secrets are symlinked to the user home-directory in the .secrets-directory

Where exactly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry need to update this

  1. It's ls -l $XDG_RUNTIME_DIR/secrets.d/ and there are folders like e.g. "1" which contains the actual secrets-files.

  2. this is a left-over from my first proposal and changed later:
    Correct is ~/.config/sops-nix/secrets - will PR soonTM

will PR soonTM (otherwise if you want/can feel free) 🙏🏻

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already happend #550

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 🙏🏻

for the `.path` value in nix. Because of that, the home-manager option `home.homeDirectory` is used to determinate the home-directory on evaluation,
this has to be set manually if home-manager is used standalone or on non NixOS systems.

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 shows the `flake` approach from the recommended example [Install: Flakes (current recommendation)](#Flakes (current recommendation))
Expand Down
2 changes: 1 addition & 1 deletion modules/home-manager/sops.nix
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ in {

defaultSymlinkPath = lib.mkOption {
type = lib.types.str;
default = "%r/secrets";
default = "${config.xdg.configHome}/sops-nix/secrets";
description = ''
Default place where the latest generation of decrypt secrets
can be found.
Expand Down