refactor: compose hosts and home-manager features explicitly
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
flake.modules.nixos."deluge-service" =
|
||||
flake.modules.nixos.deluge-service =
|
||||
{ ... }:
|
||||
{
|
||||
sops.secrets.deluge-auth-file = { };
|
||||
@@ -10,7 +10,7 @@
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.homeManager."deluge-client" =
|
||||
flake.modules.homeManager.deluge-client =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [ pkgs.deluge ];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ ... }:
|
||||
{
|
||||
flake.modules.nixos."ssh-agent-auth" = {
|
||||
flake.modules.nixos.ssh-agent-auth = {
|
||||
security.pam = {
|
||||
sshAgentAuth.enable = true;
|
||||
services.sudo.sshAgentAuth = true;
|
||||
@@ -12,18 +12,15 @@
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
isServer = config.meta.host.kind == "server";
|
||||
hostUserNames = builtins.attrNames config.meta.host.users;
|
||||
in
|
||||
{
|
||||
services.openssh.openFirewall = true;
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
openFirewall = isServer;
|
||||
settings = {
|
||||
PermitRootLogin = "no";
|
||||
PasswordAuthentication = false;
|
||||
AllowUsers = hostUserNames;
|
||||
AllowUsers = builtins.attrNames config.meta.host.users;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user