Skip to content

Using sops with arion-compose #195

Open
@nviets

Description

I am trying to set up a container that needs a secret stored with sops-nix. My .sops.yaml and secrets/ are set up, but I'm not sure how to configure my arion-compose.nix file. I have something like:

{ lib, config, pkgs, ... }: let
  mb_key = ''
    export MY_KEY=${config.sops.secrets."my_key".path}
  '';
in {
  project.name = "alma";
  services = {
    gui.service = {
      hostname = "gui";
      image = "almalinux:9";
      command = [
        "${pkgs.writeScript "entrypoint" "${mb_key}"}"
      ];
    };
};

But it's failing on:

error: attribute 'sops' missing

       at /home/nviets/repos/alma-docker/arion-compose.nix:4:21:

            3|   wb_key = ''
            4|     export MY_KEY=${config.sops.secrets."workbench_key".path}
             |                     ^
            5|   '';

Thanks in advance!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions