Refactor modules style
This commit is contained in:
parent
ed2a7f94cf
commit
cc95386f1a
44 changed files with 455 additions and 297 deletions
20
nixosModules/services/sops-nix/default.nix
Normal file
20
nixosModules/services/sops-nix/default.nix
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{ inputs, config, pkgs, lib, ... }:
|
||||
let rootPath = ./.; in
|
||||
{
|
||||
options = {
|
||||
sops-nix.enable = lib.mkEnableOption "Enables nix-sops for secret management";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.sops-nix.enable {
|
||||
imports = [ inputs.sops-nix.nixosModules.sops ];
|
||||
|
||||
sops = {
|
||||
defaultSopsFile = rootPath + "secrets.yaml";
|
||||
defaultSopsFormat = "yaml";
|
||||
age.keyFile = "/home/" + config.user.name + ".config/sops/age/keys.txt";
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
sops
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue