have actual implementation for sops secrets (#363)

This commit is contained in:
Pierre Penninckx 2024-11-23 00:24:47 +01:00 committed by GitHub
parent 7a10a805c2
commit b80c840743
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 39 additions and 5 deletions

View file

@ -1,4 +1,6 @@
# Upcoming Release
<!---
Template:
## New Features
@ -8,6 +10,29 @@
## Other Changes
-->
# v0.2.2 (unreleased)
## User Facing Backwards Compatible Changes
- Fix: add implementation for `sops.nix` module.
## Other Changes
- Use VERSION when rendering manual too.
# v0.2.1
## User Facing Backwards Compatible Changes
- Add `sops.nix` module to `nixosModules.default`.
## Other Changes
- Auto-tagging of git repo when VERSION file gets updated.
- Add VERSION file to track version.
# v0.2.0
## New Features

View file

@ -1 +1 @@
0.2.1
0.2.2

View file

@ -1,9 +1,11 @@
{ lib, pkgs, ... }:
{ config, lib, pkgs, ... }:
let
inherit (lib) mkOption;
inherit (lib) mapAttrs mkOption;
inherit (lib.types) attrsOf anything submodule;
contracts = pkgs.callPackage ../contracts {};
cfg = config.shb.sops;
in
{
options.shb.sops = {
@ -22,7 +24,8 @@ in
are managed by the [shb.sops.secret.<name>.request](#blocks-sops-options-shb.sops.secret._name_.request) option.
'';
type = anything;
type = attrsOf anything;
default = {};
};
resultCfg = {
@ -33,4 +36,10 @@ in
}));
};
};
config = {
sops.secrets = let
mkSecret = n: secretCfg: secretCfg.request // secretCfg.settings;
in mapAttrs mkSecret cfg.secret;
};
}