!XLCFfvFhUkYwOMLbVx:nixos.org

agenix

255 Members
age-encrypted secrets for NixOS https://github.com/ryantm/agenix/81 Servers

Load older messages


SenderMessageTime
3 Apr 2024
@lsbgkdlpqhswnccwnabaflt:matrix.orgsmrtakSD card is not the problem, looks like it has something to do with this: https://discourse.nixos.org/t/why-and-how-nix-shell-uses-tmpfs/11049 but I could be wrong19:46:23
@k900:0upti.meK900It is very much the problem 20:42:16
5 Apr 2024
@lsbgkdlpqhswnccwnabaflt:matrix.orgsmrtak does this cmd completes on your opi5 correctly?
nix shell nixpkgs#ragenix
13:28:24
@k900:0upti.meK900Just use normal agenix13:37:26
@k900:0upti.meK900Instead of ragenix13:37:29
@k900:0upti.meK900They're compatible and agenix definitely works fine13:37:35
@lsbgkdlpqhswnccwnabaflt:matrix.orgsmrtak

for me it ends like this:

[nix-shell:~/nix-config]$ nix shell nixpkgs#ragenix
error: flake 'flake:nixpkgs' does not provide attribute 'packages.aarch64-linux.ragenix', 'legacyPackages.aarch64-linux.ragenix' or 'ragenix'
14:31:14
@k900:0upti.meK900That's because there's no ragenix package in nixpkgs14:31:56
@k900:0upti.meK900It's defined in the ragenix flake14:32:01
@k900:0upti.meK900(but also seriously just use normal agenix)14:32:10
@lsbgkdlpqhswnccwnabaflt:matrix.orgsmrtakok, I'll try to change it to agenix, thank you14:36:14
@lsbgkdlpqhswnccwnabaflt:matrix.orgsmrtak

hurray! \o/
thank you one more time!

setting up /etc...
updating GRUB 2 menu...
installing the GRUB 2 boot loader into /boot/...
Installing for arm64-efi platform.
Installation finished. No error reported.
installation finished!

[nix-shell:~/nix-config]$ echo $?
0

14:59:59
8 Apr 2024
@reddima100:matrix.orgDima joined the room.06:32:46
@lychee:lefishe.club@lychee:lefishe.club changed their display name from lychee to kay.17:10:52
@r522:matrix.org522 joined the room.19:30:32
9 Apr 2024
@dclmatrix:matrix.org@dclmatrix:matrix.org joined the room.03:35:45
@raf:notashelf.dev@raf:notashelf.dev joined the room.17:53:32
@5m5z3q888q5prxkg:chat.lightnovel-dungeon.de@5m5z3q888q5prxkg:chat.lightnovel-dungeon.de changed their profile picture.23:12:29
10 Apr 2024
@nhnn:nhnn.devnhnn joined the room.14:18:45
@nhnn:nhnn.devnhnnHello, is it possible to mock agenix secrets in NixOS tests?14:19:39
@5m5z3q888q5prxkg:chat.lightnovel-dungeon.de@5m5z3q888q5prxkg:chat.lightnovel-dungeon.de
├─ nixium on  WORK-IN-PROGRESS [+] via ❄️  impure (NiXium-devshell-env)
╰───❯ ragenix -e test.age
Error:
   0: No rule for the given file test.age

Location:
   src/main.rs:39

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Why is this giving me no rule err?

21:01:05
@adam:robins.wtf@adam:robins.wtfbecause secrets.nix doesn't have an entry for it21:14:31
@5m5z3q888q5prxkg:chat.lightnovel-dungeon.de@5m5z3q888q5prxkg:chat.lightnovel-dungeon.dei am trying to make a secret file21:14:09
@adam:robins.wtf@adam:robins.wtf(r)agenix requires a secrets.nix that configures the files and the keys that will be encrypted with21:15:40
@5m5z3q888q5prxkg:chat.lightnovel-dungeon.de@5m5z3q888q5prxkg:chat.lightnovel-dungeon.deoh i see, works now21:15:44
@adam:robins.wtf@adam:robins.wtf
In reply to @nhnn:nhnn.dev
Hello, is it possible to mock agenix secrets in NixOS tests?

I wrote this module for mocking age secrets:

{ lib, pkgs, ... }:
{
  options = {
    age.secrets = lib.mkOption {
      type = lib.types.attrsOf (
        lib.types.submodule (
          { name, config, ... }:
          let
            secretConfig = config;
          in
          {
            freeformType = (pkgs.formats.json { }).type;
            options = {
              testString = lib.mkOption {
                type = lib.types.str;
                description = lib.mdDoc "String to return with path. Use this in place of the encrypted age file.";
              };
            };
            config = {
              path = "/somepath";
            };
          }
        )
      );
      description = "Mock age module";
      default = { };
    };
  };
}
21:16:37
@5m5z3q888q5prxkg:chat.lightnovel-dungeon.de@5m5z3q888q5prxkg:chat.lightnovel-dungeon.dethanks!21:15:47
@adam:robins.wtf@adam:robins.wtf
In reply to @nhnn:nhnn.dev
Hello, is it possible to mock agenix secrets in NixOS tests?
*

I wrote this module for mocking age secrets:

{ lib, pkgs, ... }:
{
  options = {
    age.secrets = lib.mkOption {
      type = lib.types.attrsOf (
        lib.types.submodule (
          { name, config, ... }:
          let
            secretConfig = config;
          in
          {
            freeformType = (pkgs.formats.json { }).type;
            options = {
              testString = lib.mkOption {
                type = lib.types.str;
                description = lib.mdDoc "String to return with path. Use this in place of the encrypted age file.";
              };
            };
            config = {
              path = "/somepath";
            };
          }
        )
      );
      description = "Mock age module";
      default = { };
    };
  };
}

and an example use

        age.secrets."consul-gossip-encrypt.json".testString = builtins.toJSON {
          encrypt = "2Jb1bY7186nApvmwG+fwQuaI7EehjIV/XQ6xDDJ+114=";
        };
21:17:40
11 Apr 2024
@nhnn:nhnn.devnhnn
In reply to@adam:robins.wtf

I wrote this module for mocking age secrets:

{ lib, pkgs, ... }:
{
  options = {
    age.secrets = lib.mkOption {
      type = lib.types.attrsOf (
        lib.types.submodule (
          { name, config, ... }:
          let
            secretConfig = config;
          in
          {
            freeformType = (pkgs.formats.json { }).type;
            options = {
              testString = lib.mkOption {
                type = lib.types.str;
                description = lib.mdDoc "String to return with path. Use this in place of the encrypted age file.";
              };
            };
            config = {
              path = "/somepath";
            };
          }
        )
      );
      description = "Mock age module";
      default = { };
    };
  };
}

and an example use

        age.secrets."consul-gossip-encrypt.json".testString = builtins.toJSON {
          encrypt = "2Jb1bY7186nApvmwG+fwQuaI7EehjIV/XQ6xDDJ+114=";
        };
it will not work in runtime, right?
08:10:20
@nhnn:nhnn.devnhnni don't quite understand how it supposed to work08:11:10

Show newer messages


Back to Room ListRoom Version: 6