28
modules/home/sops.nix
Normal file
28
modules/home/sops.nix
Normal file
@@ -0,0 +1,28 @@
|
||||
{ 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 {
|
||||
sops = {
|
||||
age.keyFile = cfg.keyFile;
|
||||
defaultSopsFile = ../../users/${config.home.username}/secrets.yaml;
|
||||
secrets = cfg.secrets;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user