diff --git a/modules/nixos/agenix/default.nix b/modules/nixos/agenix/default.nix deleted file mode 100644 --- a/modules/nixos/agenix/default.nix +++ /dev/null @@ -1,54 +0,0 @@ -{ - config, - lib, - pkgs, - inputs, - ... -}: -with lib; let - cfg = config.system.agenix; -in { - options.system.agenix = { - enable = - mkEnableOption "Enable agenix"; - - identityPaths = mkOption { - default = ["/persistent/age-tpm.txt"]; - example = '' - ["/persistent/age-tpm.txt", "/etc/ssh/ssh_host_ed25519_key"] - ''; - type = types.listOf types.str; - description = '' - List of identity paths for agenix - ''; - }; - secrets = mkOption { - default = ["/persistent/age-tpm.txt"]; - example = '' - ["/persistent/age-tpm.txt", "/etc/ssh/ssh_host_ed25519_key"] - ''; - type = types.listOf types.str; - description = '' - List of identity paths for agenix - ''; - }; - }; - - config = mkIf cfg.enable { - # Load the TPM drivers in the initram to allow for decryption of agenix - # secrets. - boot.initrd.availableKernelModules = ["tpm_crb" "tpm_tis"]; - - age = with inputs; { - identityPaths = cfg.identityPaths; - ageBin = "PATH=$PATH:${lib.makeBinPath [pkgs.age-plugin-tpm]} ${pkgs.age}/bin/age"; - secrets = { - password.file = "${nix-secrets}/password.age"; - }; - }; - environment.systemPackages = with pkgs; [ - age - age-plugin-tpm - ]; - }; -} diff --git a/modules/nixos/boot/default.nix b/modules/nixos/system/boot/default.nix rename from modules/nixos/boot/default.nix rename to modules/nixos/system/boot/default.nix --- a/modules/nixos/boot/default.nix +++ b/modules/nixos/system/boot/default.nix diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix --- a/modules/nixos/default.nix +++ b/modules/nixos/default.nix @@ -2,8 +2,7 @@ # Add your reusable NixOS modules to this directory, on their own file (https://wiki.nixos.org/wiki/Module). # These should be stuff you would like to share with others, not your personal configurations. { # List your module files here - # my-module = import ./my-module.nix; - agenix = import ./agenix/default.nix; - boot = import ./boot/default.nix; - impermanence = import ./impermanence/default.nix; + agenix = import ./system/agenix/default.nix; + boot = import ./system/boot/default.nix; + impermanence = import ./system/impermanence/default.nix; } diff --git a/modules/nixos/impermanence/default.nix b/modules/nixos/system/impermanence/default.nix rename from modules/nixos/impermanence/default.nix rename to modules/nixos/system/impermanence/default.nix --- a/modules/nixos/impermanence/default.nix +++ b/modules/nixos/system/impermanence/default.nix