mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
[STYLE/REFACTOR] Deadnix, Alejandra and Statix
This commit is contained in:
parent
8573c4508d
commit
d4242f9dd8
51 changed files with 465 additions and 466 deletions
|
|
@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{ config, ... }: {
|
||||
{config, ...}: {
|
||||
system.autoUpgrade = {
|
||||
enable = true;
|
||||
flake = "github:kittywitch/kittywitch#${config.networking.hostName}";
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{ config, ... }: {
|
||||
{config, ...}: {
|
||||
base16 = {
|
||||
inherit (config.home-manager.users.kat.base16) defaultSchemeName defaultScheme schemes;
|
||||
console = {
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue