mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-05-20 21:41:12 +02:00
Compare commits
7 Commits
hashed-ini
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d7f05e56d | ||
|
|
4a67eddf52 | ||
|
|
08a23bd380 | ||
|
|
28b67c3578 | ||
|
|
e5804c043a | ||
|
|
9c227f3022 | ||
|
|
69fdf709d7 |
@@ -39,6 +39,7 @@ revert the changes on the next nightly rebuild (tends to happen when everybody i
|
|||||||
| bikkje | Virtual | Experimental login box |
|
| bikkje | Virtual | Experimental login box |
|
||||||
| [brzeczyszczykiewicz][brz] | Physical | Shared music player |
|
| [brzeczyszczykiewicz][brz] | Physical | Shared music player |
|
||||||
| [georg][geo] | Physical | Shared music player |
|
| [georg][geo] | Physical | Shared music player |
|
||||||
|
| [gluttony][glu] | Virtual | General purpose compute |
|
||||||
| [ildkule][ild] | Virtual | Logging and monitoring host, prometheus, grafana, ... |
|
| [ildkule][ild] | Virtual | Logging and monitoring host, prometheus, grafana, ... |
|
||||||
| [kommode][kom] | Virtual | Gitea + Gitea pages |
|
| [kommode][kom] | Virtual | Gitea + Gitea pages |
|
||||||
| [lupine][lup] | Physical | Gitea CI/CD runners |
|
| [lupine][lup] | Physical | Gitea CI/CD runners |
|
||||||
@@ -57,6 +58,7 @@ revert the changes on the next nightly rebuild (tends to happen when everybody i
|
|||||||
[bic]: https://wiki.pvv.ntnu.no/wiki/Maskiner/bicep
|
[bic]: https://wiki.pvv.ntnu.no/wiki/Maskiner/bicep
|
||||||
[brz]: https://wiki.pvv.ntnu.no/wiki/Maskiner/brzęczyszczykiewicz
|
[brz]: https://wiki.pvv.ntnu.no/wiki/Maskiner/brzęczyszczykiewicz
|
||||||
[geo]: https://wiki.pvv.ntnu.no/wiki/Maskiner/georg
|
[geo]: https://wiki.pvv.ntnu.no/wiki/Maskiner/georg
|
||||||
|
[glu]: https://wiki.pvv.ntnu.no/wiki/Maskiner/gluttony
|
||||||
[ild]: https://wiki.pvv.ntnu.no/wiki/Maskiner/ildkule
|
[ild]: https://wiki.pvv.ntnu.no/wiki/Maskiner/ildkule
|
||||||
[kom]: https://wiki.pvv.ntnu.no/wiki/Maskiner/kommode
|
[kom]: https://wiki.pvv.ntnu.no/wiki/Maskiner/kommode
|
||||||
[lup]: https://wiki.pvv.ntnu.no/wiki/Maskiner/lupine
|
[lup]: https://wiki.pvv.ntnu.no/wiki/Maskiner/lupine
|
||||||
|
|||||||
@@ -84,8 +84,6 @@
|
|||||||
|
|
||||||
# users.mutableUsers = lib.mkDefault false;
|
# users.mutableUsers = lib.mkDefault false;
|
||||||
|
|
||||||
users.users.root.initialHashedPassword = "$y$j9T$ahP6GAdttD17OMBo7Yqeh.$Ad7qBcFvTL7HrJ9uTtrQzksN3220Nj9t/CrP6DwgK34"; # generated using mkpasswd, see huttiheita root on vaultwarden
|
|
||||||
|
|
||||||
users.groups."drift".name = "drift";
|
users.groups."drift".name = "drift";
|
||||||
|
|
||||||
# Trusted users on the nix builder machines
|
# Trusted users on the nix builder machines
|
||||||
|
|||||||
@@ -7,7 +7,13 @@
|
|||||||
"ax25"
|
"ax25"
|
||||||
"batman-adv"
|
"batman-adv"
|
||||||
"can"
|
"can"
|
||||||
|
"dccp"
|
||||||
|
"ipx"
|
||||||
|
"llc"
|
||||||
|
"n-hdlc"
|
||||||
"netrom"
|
"netrom"
|
||||||
|
"p8022"
|
||||||
|
"p8023"
|
||||||
"psnap"
|
"psnap"
|
||||||
"rds"
|
"rds"
|
||||||
"rose"
|
"rose"
|
||||||
@@ -23,7 +29,6 @@
|
|||||||
"cramfs"
|
"cramfs"
|
||||||
"efs"
|
"efs"
|
||||||
"exofs"
|
"exofs"
|
||||||
"orangefs"
|
|
||||||
"freevxfs"
|
"freevxfs"
|
||||||
"gfs2"
|
"gfs2"
|
||||||
"hfs"
|
"hfs"
|
||||||
@@ -35,10 +40,12 @@
|
|||||||
"nilfs2"
|
"nilfs2"
|
||||||
"ntfs"
|
"ntfs"
|
||||||
"omfs"
|
"omfs"
|
||||||
|
"orangefs"
|
||||||
"qnx4"
|
"qnx4"
|
||||||
"qnx6"
|
"qnx6"
|
||||||
"sysv"
|
"sysv"
|
||||||
"ubifs"
|
"ubifs"
|
||||||
|
"udf"
|
||||||
"ufs"
|
"ufs"
|
||||||
|
|
||||||
# Legacy hardware
|
# Legacy hardware
|
||||||
|
|||||||
@@ -1,17 +1,24 @@
|
|||||||
{ ... }:
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
modulesToBan = [
|
||||||
|
# copy.fail
|
||||||
|
"af_alg"
|
||||||
|
"algif_aead"
|
||||||
|
"algif_hash"
|
||||||
|
"algif_rng"
|
||||||
|
"algif_skcipher"
|
||||||
|
|
||||||
|
# dirtyfrag / Fragnesia
|
||||||
|
"esp4"
|
||||||
|
"esp6"
|
||||||
|
"rxrpc"
|
||||||
|
|
||||||
|
# PinTheft
|
||||||
|
"rds"
|
||||||
|
];
|
||||||
|
in
|
||||||
{
|
{
|
||||||
boot.blacklistedKernelModules = [
|
boot.blacklistedKernelModules = modulesToBan;
|
||||||
"rxrpc" # dirtyfrag
|
|
||||||
"esp6" # dirtyfrag
|
boot.extraModprobeConfig = lib.concatMapStringsSep "\n" (mod: "install ${mod} ${lib.getExe' pkgs.coreutils "false"}") modulesToBan;
|
||||||
"esp4" # dirtyfrag
|
|
||||||
];
|
|
||||||
boot.extraModprobeConfig = ''
|
|
||||||
# dirtyfrag
|
|
||||||
install esp4 /bin/false
|
|
||||||
# dirtyfrag
|
|
||||||
install esp6 /bin/false
|
|
||||||
# dirtyfrag
|
|
||||||
install rxrpc /bin/false
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,6 @@
|
|||||||
# Let's not spam LetsEncrypt in `nixos-rebuild build-vm` mode:
|
# Let's not spam LetsEncrypt in `nixos-rebuild build-vm` mode:
|
||||||
virtualisation.vmVariant = {
|
virtualisation.vmVariant = {
|
||||||
security.acme.defaults.server = "https://127.0.0.1";
|
security.acme.defaults.server = "https://127.0.0.1";
|
||||||
|
users.users.root.initialPassword = "root";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,4 +64,11 @@ in
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedUDPPortRanges = [
|
||||||
|
{
|
||||||
|
from = cfg.settings.rtc.port_range_start;
|
||||||
|
to = cfg.settings.rtc.port_range_end;
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
37
hosts/bicep/services/postgresql/cleanup-timers.nix
Normal file
37
hosts/bicep/services/postgresql/cleanup-timers.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.services.postgresql;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
systemd.services = {
|
||||||
|
postgresql-repack = {
|
||||||
|
requires = [ "postgresql.service" ];
|
||||||
|
after = [ "postgresql.target" ];
|
||||||
|
description = "Repack all PostgreSQL databases";
|
||||||
|
startAt = "Mon 06:00:00";
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = "postgres";
|
||||||
|
Group = "postgres";
|
||||||
|
|
||||||
|
ExecStart = "${lib.getExe cfg.package.pkgs.pg_repack} --port=${builtins.toString cfg.settings.port} --all";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
postgresql-vacuum-analyze = {
|
||||||
|
requires = [ "postgresql.service" ];
|
||||||
|
after = [ "postgresql.target" ];
|
||||||
|
description = "Vacuum and analyze all PostgreSQL databases";
|
||||||
|
startAt = "Tue 06:00:00";
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = "postgres";
|
||||||
|
Group = "postgres";
|
||||||
|
|
||||||
|
ExecStart = "${lib.getExe' cfg.package "psql"} --port=${builtins.toString cfg.settings.port} -tAc 'VACUUM ANALYZE'";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -3,11 +3,15 @@ let
|
|||||||
cfg = config.services.postgresql;
|
cfg = config.services.postgresql;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [ ./backup.nix ];
|
imports = [
|
||||||
|
./backup.nix
|
||||||
|
./cleanup-timers.nix
|
||||||
|
];
|
||||||
|
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.postgresql_18;
|
package = pkgs.postgresql_18;
|
||||||
|
extensions = ps: with ps; [ pg_repack ];
|
||||||
enableTCPIP = true;
|
enableTCPIP = true;
|
||||||
|
|
||||||
authentication = ''
|
authentication = ''
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
"sd_mod"
|
"sd_mod"
|
||||||
];
|
];
|
||||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||||
boot.kernelModules = [ ];
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
fileSystems."/boot" = {
|
||||||
device = "/dev/disk/by-uuid/933A-3005";
|
device = "/dev/disk/by-uuid/BD97-FCA0";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
options = [
|
options = [
|
||||||
"fmask=0077"
|
"fmask=0077"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by 'nixos-generate-config'
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by 'nixos-generate-config'
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by 'nixos-generate-config'
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by 'nixos-generate-config'
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|||||||
@@ -86,10 +86,10 @@ in rec {
|
|||||||
ipv6 = pvv-ipv6 167;
|
ipv6 = pvv-ipv6 167;
|
||||||
};
|
};
|
||||||
gluttony = {
|
gluttony = {
|
||||||
ipv4 = "129.241.100.118";
|
ipv4 = "129.241.100.37";
|
||||||
ipv4_internal = "192.168.20.77";
|
ipv4_internal = "192.168.1.219";
|
||||||
ipv4_internal_gw = "192.168.20.1";
|
ipv4_internal_gw = "192.168.1.1";
|
||||||
ipv6 = "2001:700:305:aa07::3b3";
|
ipv6 = "2001:700:305:8a0f:f816:3eff:fe9b:7a46";
|
||||||
};
|
};
|
||||||
wenche = {
|
wenche = {
|
||||||
ipv4 = pvv-ipv4 240;
|
ipv4 = pvv-ipv4 240;
|
||||||
|
|||||||
Reference in New Issue
Block a user