Fix everything.
This commit is contained in:
parent
11075719cb
commit
3d25d316fe
118 changed files with 180 additions and 244 deletions
4
system/services/general/apparmor/default.nix
Normal file
4
system/services/general/apparmor/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
security.apparmor.enable = true;
|
||||
}
|
12
system/services/general/default.nix
Normal file
12
system/services/general/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./apparmor
|
||||
./earlyoom
|
||||
./libvirtd
|
||||
./snowflake
|
||||
./ssh
|
||||
./tlp
|
||||
./userborn
|
||||
];
|
||||
}
|
4
system/services/general/earlyoom/default.nix
Normal file
4
system/services/general/earlyoom/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
services.earlyoom.enable = true;
|
||||
}
|
39
system/services/general/libvirtd/default.nix
Normal file
39
system/services/general/libvirtd/default.nix
Normal file
|
@ -0,0 +1,39 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
options.system.libvirtd.enable = lib.mkEnableOption "Enable libvirtd services";
|
||||
|
||||
config = lib.mkIf config.system.libvirtd.enable {
|
||||
virtualisation.libvirtd = {
|
||||
enable = true;
|
||||
onBoot = "ignore";
|
||||
onShutdown = "shutdown";
|
||||
qemu = {
|
||||
ovmf = {
|
||||
enable = true;
|
||||
packages = with pkgs; [ OVMFFull.fd ];
|
||||
};
|
||||
vhostUserPackages = with pkgs; [ virtiofsd ];
|
||||
swtpm.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
programs.virt-manager.enable = true;
|
||||
|
||||
environment.persistence."/persist".directories = [
|
||||
"/var/lib/libvirt/dnsmasq"
|
||||
"/var/lib/libvirt/nwfilter"
|
||||
"/var/lib/libvirt/qemu"
|
||||
"/var/lib/libvirt/secrets"
|
||||
"/var/lib/libvirt/storage"
|
||||
"/var/lib/libvirt/swtpm"
|
||||
];
|
||||
|
||||
# Needed to make NAT work
|
||||
networking.firewall.trustedInterfaces = [
|
||||
"virbr0"
|
||||
"virbr1"
|
||||
];
|
||||
|
||||
systemd.tmpfiles.rules = [ "f /dev/shm/looking-glass 0660 - libvirtd -" ];
|
||||
};
|
||||
}
|
4
system/services/general/snowflake/default.nix
Normal file
4
system/services/general/snowflake/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
services.snowflake-proxy.enable = true;
|
||||
}
|
22
system/services/general/ssh/default.nix
Normal file
22
system/services/general/ssh/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ lib, ... }:
|
||||
{
|
||||
imports = [ ./fail2ban ];
|
||||
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
settings = {
|
||||
PermitRootLogin = lib.mkForce "no";
|
||||
PrintLastLog = "no";
|
||||
PasswordAuthentication = false;
|
||||
UsePAM = false;
|
||||
X11Forwarding = false;
|
||||
};
|
||||
};
|
||||
|
||||
environment.persistence."/persist".files = [
|
||||
"/etc/ssh/ssh_host_ed25519_key"
|
||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||
"/etc/ssh/ssh_host_rsa_key"
|
||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
||||
];
|
||||
}
|
10
system/services/general/ssh/fail2ban/default.nix
Normal file
10
system/services/general/ssh/fail2ban/default.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{ ... }:
|
||||
{
|
||||
services.fail2ban = {
|
||||
enable = true;
|
||||
maxretry = 5;
|
||||
bantime = "10m";
|
||||
};
|
||||
|
||||
environment.persistence."/persist".directories = [ "/var/lib/fail2ban" ];
|
||||
}
|
4
system/services/general/tlp/default.nix
Normal file
4
system/services/general/tlp/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
services.tlp.enable = true;
|
||||
}
|
4
system/services/general/userborn/default.nix
Normal file
4
system/services/general/userborn/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ ... }:
|
||||
{
|
||||
services.userborn.enable = true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue