refactor!: switch to dendritic pattern
BREAKING CHANGE: complete reorganization of the repository
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
{
|
||||
flake.modules.homeManager.gpg = {
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.security.gpg;
|
||||
in {
|
||||
options.home.security.gpg = {
|
||||
enable = mkEnableOption "Enable GPG";
|
||||
pinentry.package = mkOption {
|
||||
type = types.package;
|
||||
default = pkgs.pinentry-gnome3;
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
programs.gpg = {
|
||||
inherit (cfg) enable;
|
||||
mutableKeys = true;
|
||||
mutableTrust = true;
|
||||
};
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
enableSshSupport = false;
|
||||
pinentry.package = cfg.pinentry.package;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
{config, ...}: let
|
||||
m = config.flake.modules.homeManager;
|
||||
in {
|
||||
flake.modules.homeManager.security = {
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.security;
|
||||
in {
|
||||
imports = [
|
||||
m.gpg
|
||||
m.ssh
|
||||
];
|
||||
options.home.security.fullDesktop = mkEnableOption "Enable all modules";
|
||||
config.home.security = {
|
||||
gpg.enable = mkDefault cfg.fullDesktop;
|
||||
ssh.enable = mkDefault cfg.fullDesktop;
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
flake.modules.homeManager.ssh = {
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.home.security.ssh;
|
||||
in {
|
||||
options.home.security.ssh = {
|
||||
enable = mkEnableOption "enables SSH";
|
||||
hosts = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
programs.ssh = mkIf cfg.enable {
|
||||
enable = true;
|
||||
enableDefaultConfig = false;
|
||||
includes = lists.optional (cfg.hosts != null) cfg.hosts;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user