33 lines
666 B
Nix
Executable File
33 lines
666 B
Nix
Executable File
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let cfg = config.sydnix.sops;
|
|
in {
|
|
options = {
|
|
sydnix.sops = {
|
|
enable = mkEnableOption "Sops";
|
|
keyFile = mkOption {
|
|
description = "Path to an Age key file.";
|
|
type = types.path;
|
|
default = config.home.homeDirectory + "/key.txt";
|
|
};
|
|
secrets = mkOption {
|
|
description = "Secrets passed directly to sops-nix.";
|
|
};
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = [
|
|
pkgs.sops
|
|
];
|
|
|
|
sops = {
|
|
age.keyFile = cfg.keyFile;
|
|
defaultSopsFile = ../../users/${config.home.username}/secrets.yaml;
|
|
secrets = cfg.secrets;
|
|
};
|
|
};
|
|
}
|