rp5: new kernel and tailscale #16

Merged
Daholli merged 5 commits from rp5 into main 2025-02-14 12:40:23 +01:00
4 changed files with 92 additions and 67 deletions
Showing only changes of commit 56d5196f56 - Show all commits

View file

@ -0,0 +1,29 @@
{
lib,
config,
namespace,
...
}:
let
cfg = config.${namespace}.services.openssh;
inherit (lib) mkIf mkEnableOption;
in
{
options.${namespace}.services.openssh = {
enable = mkEnableOption "Enable SSH";
};
config = mkIf cfg.enable {
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
services.fail2ban = {
enable = true;
};
};
}

View file

@ -0,0 +1,48 @@
{
lib,
config,
namespace,
...
}:
let
cfg = config.${namespace}.services.remotebuild;
inherit (lib) mkIf mkEnableOption;
in
{
options.${namespace}.services.remotebuild = {
enable = mkEnableOption "Enable remotebuild";
};
config = mkIf cfg.enable {
users.users.remotebuild = {
isNormalUser = true;
createHome = false;
group = "remotebuild";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYZjG+XPNoVHVdCel5MK4mwvtoFCqDY1WMI1yoU71Rd root@yggdrasil"
];
};
users.groups.remotebuild = { };
nix = {
nrBuildUsers = 64;
settings = {
trusted-users = [ "remotebuild" ];
min-free = 10 * 1024 * 1024;
max-free = 200 * 1024 * 1024;
max-jobs = "auto";
cores = 0;
};
};
systemd.services.nix-daemon.serviceConfig = {
MemoryAccounting = true;
MemoryMax = "90%";
OOMScoreAdjust = 500;
};
};
}

View file

@ -19,42 +19,6 @@ in
raspberry-pi-5 raspberry-pi-5
]; ];
security.sudo.wheelNeedsPassword = false;
users.users.remotebuild = {
isNormalUser = true;
createHome = false;
group = "remotebuild";
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJYZjG+XPNoVHVdCel5MK4mwvtoFCqDY1WMI1yoU71Rd root@yggdrasil"
];
};
users.groups.remotebuild = { };
nixpkgs.hostPlatform = {
system = "aarch64-linux";
};
nix = {
nrBuildUsers = 64;
settings = {
trusted-users = [ "remotebuild" ];
min-free = 10 * 1024 * 1024;
max-free = 200 * 1024 * 1024;
max-jobs = "auto";
cores = 0;
};
};
systemd.services.nix-daemon.serviceConfig = {
MemoryAccounting = true;
MemoryMax = "90%";
OOMScoreAdjust = 500;
};
services.tailscale = { services.tailscale = {
enable = true; enable = true;
useRoutingFeatures = "server"; useRoutingFeatures = "server";
@ -83,16 +47,15 @@ in
}; };
}; };
}; };
}; firewall = {
allowedTCPPorts = [
networking.firewall = { 53
allowedTCPPorts = [ 80
53 ];
80 allowedUDPPorts = [
]; 53
allowedUDPPorts = [ ];
53 };
];
}; };
services.adguardhome = { services.adguardhome = {
@ -134,7 +97,6 @@ in
"https://adguardteam.github.io/HostlistsRegistry/assets/filter_24.txt" "https://adguardteam.github.io/HostlistsRegistry/assets/filter_24.txt"
"https://adguardteam.github.io/HostlistsRegistry/assets/filter_47.txt" "https://adguardteam.github.io/HostlistsRegistry/assets/filter_47.txt"
]; ];
}; };
}; };
@ -165,17 +127,14 @@ in
}; };
}; };
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
${namespace} = { ${namespace} = {
submodules.basics = enabled; submodules.basics = enabled;
services = {
openssh = enabled;
remotebuild = enabled;
};
system = { system = {
# cachemiss for webkit gtk # cachemiss for webkit gtk
hardware.networking.enable = mkForce false; hardware.networking.enable = mkForce false;

View file

@ -39,18 +39,6 @@ in
}; };
}; };
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
services.fail2ban = {
enable = true;
};
services.nginx = { services.nginx = {
enable = true; enable = true;
recommendedProxySettings = true; recommendedProxySettings = true;
@ -199,6 +187,7 @@ in
enable = true; enable = true;
inherit sopsFile; inherit sopsFile;
}; };
openssh = enabled;
}; };
security = { security = {