chore: nix fmt

This commit is contained in:
514fpv 2025-01-13 11:52:09 +08:00
parent a80bd4ed3b
commit 7266fff06e
Signed by: koishi
SSH key fingerprint: SHA256:axz0uIzzY+5W19i7QOUuiw5LSqhKfCBKPf3L4xFRxLw
128 changed files with 3402 additions and 2013 deletions

View file

@ -1,7 +1,11 @@
{ pkgs
, lib
, config
, ... }: with lib; let
{
pkgs,
lib,
config,
...
}:
with lib;
let
cfg = config.global.auth;
pub = lib.pipe ./pub [
builtins.readDir
@ -10,9 +14,12 @@
(foldr (payload: keys: (splitString "\n" payload) ++ keys) [ ])
(foldr (candidate: keys: keys ++ (if candidate == "" then [ ] else [ candidate ])) [ ])
];
in {
in
{
options.global.auth = {
enable = mkEnableOption "identity authentication in various software" // { default = true; };
enable = mkEnableOption "identity authentication in various software" // {
default = true;
};
openssh = {
enable = mkEnableOption "openssh server";
password = mkEnableOption "password authentication";
@ -42,10 +49,13 @@ in {
settings.PasswordAuthentication = cfg.openssh.password;
};
networking.firewall.allowedTCPPorts = [ 1300 ] ++ # utility port
optional (cfg.openssh.enable && (cfg.openssh.port != null)) cfg.openssh.port;
networking.firewall.allowedTCPPorts =
[ 1300 ]
# utility port
++ optional (cfg.openssh.enable && (cfg.openssh.port != null)) cfg.openssh.port;
environment.persistence."/nix/persist/fhs".directories = [ ] ++
optional cfg.openssh.enable "/etc/ssh";
environment.persistence."/nix/persist/fhs".directories =
[ ]
++ optional cfg.openssh.enable "/etc/ssh";
};
}