profiles/agenix: move into default config

This commit is contained in:
Gabriel Arazas 2022-07-09 13:56:36 +08:00
parent 7ad9a62f2c
commit 30c7ee0203
4 changed files with 9 additions and 28 deletions

View File

@ -110,6 +110,7 @@
# Only use imports as minimally as possible with the absolute
# requirements of a host.
imports = [
inputs.agenix.nixosModules.age
inputs.home-manager.nixosModules.home-manager
];
@ -187,6 +188,14 @@
home-manager.sharedModules =
lib'.modulesToList (lib'.filesToAttr ./modules/home-manager);
home-manager.extraSpecialArgs = { inherit inputs system self; };
# Enabling some things for agenix.
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
services.sshd.enable = true;
services.openssh.enable = true;
};
mkUser = { system ? defaultSystem, extraModules ? [ ] }:

View File

@ -24,7 +24,6 @@
# My custom configuration with my custom modules starts here.
profiles = {
agenix.enable = true;
archiving.enable = true;
system = {
enable = true;

View File

@ -1,19 +0,0 @@
# A module that automates setting up agenix for your system.
{ inputs, lib, options, config, system, ... }:
let cfg = config.profiles.agenix;
in {
options.profiles.agenix.enable =
lib.mkEnableOption "agenix-related config on your system";
imports = [ inputs.agenix.nixosModules.age ];
config = lib.mkIf cfg.enable {
# Enable all relevant services.
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
services.sshd.enable = true;
services.openssh.enable = true;
};
}

View File

@ -41,14 +41,6 @@ in {
lib.mkEnableOption "backup setup with BorgBackup";
config = lib.mkIf cfg.enable {
assertions = [{
assertion = config.profiles.agenix.enable;
message = ''
Agenix module is not enabled. This is needed for the borg configuration
we're using.
'';
}];
age.secrets.borg-password.file = lib.getSecret "archive/password";
age.secrets.borg-patterns.file = lib.getSecret "archive/borg-patterns";
age.secrets.borg-patterns-local.file =