[STYLE/REFACTOR] Deadnix, Alejandra and Statix

This commit is contained in:
Kat Inskip 2023-04-25 16:48:32 -07:00
parent 8573c4508d
commit d4242f9dd8
Signed by: kat
GPG key ID: 465E64DECEA8CF0F
51 changed files with 465 additions and 466 deletions

View file

@ -1,31 +1,40 @@
{ config, pkgs, lib, ... }: let
# TODO: solve lib usage
inherit (lib.lists) concatLists elem;
inherit (lib.attrsets) mapAttrsToList;
commonUser = {
openssh.authorizedKeys.keys = concatLists (mapAttrsToList
(_: user:
if elem "wheel" user.extraGroups then
user.openssh.authorizedKeys.keys
else
[ ])
config.users.users);
};
{
config,
lib,
...
}: let
# TODO: solve lib usage
inherit (lib.lists) concatLists elem;
inherit (lib.attrsets) mapAttrsToList;
commonUser = {
openssh.authorizedKeys.keys = concatLists (mapAttrsToList
(_: user:
if elem "wheel" user.extraGroups
then user.openssh.authorizedKeys.keys
else [])
config.users.users);
};
in {
security.sudo.extraRules = [{
users = [ "deploy" ];
commands = [ {
command = "ALL";
options = [
"NOPASSWD"
"SETENV"
security.sudo.extraRules = [
{
users = ["deploy"];
commands = [
{
command = "ALL";
options = [
"NOPASSWD"
"SETENV"
];
}
];
} ];
}];
}
];
users.users = {
root = commonUser;
deploy = commonUser // {
isNormalUser = true;
};
deploy =
commonUser
// {
isNormalUser = true;
};
};
}

View file

@ -1,6 +1,6 @@
{ config, ... }: {
{config, ...}: {
system.autoUpgrade = {
enable = true;
flake = "github:kittywitch/kittywitch#${config.networking.hostName}";
};
}
}

View file

@ -1,4 +1,4 @@
{ config, ... }: {
{config, ...}: {
base16 = {
inherit (config.home-manager.users.kat.base16) defaultSchemeName defaultScheme schemes;
console = {

View file

@ -1,4 +1,4 @@
{ pkgs, ... }: {
{pkgs, ...}: {
fonts.fonts = [
pkgs.tamzen
];
@ -12,7 +12,7 @@
];
};
console = {
packages = [ pkgs.tamzen ];
packages = [pkgs.tamzen];
font = "Tamzen7x14";
earlySetup = true;
keyMap = "uk";

View file

@ -1,6 +1,6 @@
_: {
users.groups.secrets = {};
systemd.tmpfiles.rules = [
"v /var/lib/secrets 700 deploy secrets"
];
}
users.groups.secrets = {};
systemd.tmpfiles.rules = [
"v /var/lib/secrets 700 deploy secrets"
];
}

View file

@ -1,19 +1,31 @@
{ config, lib, std, ... }: let
{
config,
lib,
std,
...
}: let
inherit (lib.modules) mkDefault;
inherit (std) list;
in {
networking.firewall = {
allowedTCPPorts = [ (list.unsafeHead config.services.openssh.ports) ];
allowedUDPPortRanges = [ { from = 60000; to = 61000; } ];
allowedTCPPorts = [(list.unsafeHead config.services.openssh.ports)];
allowedUDPPortRanges = [
{
from = 60000;
to = 61000;
}
];
};
services.openssh = {
enable = true;
/* knownHosts.katca = {
/*
knownHosts.katca = {
certAuthority = true;
publicKey = builtins.readFile ./ca-pubkey.pem;
}; */
kexAlgorithms = [ "curve25519-sha256@libssh.org" ];
};
*/
kexAlgorithms = ["curve25519-sha256@libssh.org"];
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;

View file

@ -2,11 +2,11 @@ _: {
services.tzupdate.enable = true;
systemd.timers."tzupdate" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnBootSec = "5m";
OnUnitActiveSec = "5m";
Unit = "tzupdate.service";
};
wantedBy = ["timers.target"];
timerConfig = {
OnBootSec = "5m";
OnUnitActiveSec = "5m";
Unit = "tzupdate.service";
};
};
}