Skip to content

How to use agenix-rekey to set env var for nushell through home-manager? #106

@caniko

Description

@caniko

I tried this:

{ config, inputs, lib, ... }:
{
  age.secrets = {
    pypi-cpypi.rekeyFile = "${inputs.self}/age/secrets/modules/pypi/pypi-cpypi.age";
  };

  programs.nushell.environmentVariables =
    let
      cpypiPassword = config.age.secrets.pypi-cpypi.path;
    in
    {
      POETRY_HTTP_BASIC_CPYPI_PASSWORD = cpypiPassword;
      UV_INDEX_CPYPI_PASSWORD = cpypiPassword;
    };
}

But it is only saving the path as env var. What am I doing wrong? It should support absolute paths according to what I found below.

From home manager description:

programs.nushell.environmentVariables

Description
Environment variables to be set.

Inline values can be set with lib.hm.nushell.mkNushellInline.
Type
attribute set of (null or (Nushell inline value) or boolean or signed integer or floating point number or string or absolute path or (attribute set of Nushell values) or (list of Nushell values))
Default

{ }

Example

{
FOO = "BAR";
LIST_VALUE = [ "foo" "bar" ];
PROMPT_COMMAND = lib.hm.nushell.mkNushellInline ''{|| "> "}'';
ENV_CONVERSIONS.PATH = {
from_string = lib.hm.nushell.mkNushellInline "{|s| $s | split row (char esep) }";
to_string = lib.hm.nushell.mkNushellInline "{|v| $v | str join (char esep) }";
};
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions