Move more of jokum

slightly less stupid this time
This commit is contained in:
Daniel Olsen 2023-03-26 14:42:45 +02:00 committed by Root Bicep
parent bddd7e438d
commit 38e3202c9e
4 changed files with 75 additions and 29 deletions

View File

@ -1,35 +1,34 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }: { config, lib, pkgs, modulesPath, ... }:
# FIXME: please don't use me, I'm from bekkalokk
{ {
imports = [ ]; imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "ata_piix" "mptspi" "uhci_hcd" "ehci_pci" "sd_mod" "sr_mod" ]; boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "hpsa" "ohci_pci" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
fileSystems."/" = fileSystems."/" =
{ device = "/dev/disk/by-uuid/cdcafe3a-01d8-4bdf-9a3d-78705b581090"; { device = "/dev/disk/by-uuid/31a67903-dc00-448a-a24a-36e820318fe5";
fsType = "ext4"; fsType = "ext4";
}; };
fileSystems."/boot" = swapDevices = [ ];
{ device = "/dev/disk/by-uuid/1CB4-280D";
fsType = "vfat";
};
swapDevices =
[ { device = "/dev/disk/by-uuid/3eaace48-91ec-4d46-be86-fd26877d8b86"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's # (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction # still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`. # with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true; networking.useDHCP = lib.mkDefault true;
# networking.interfaces.ens33.useDHCP = lib.mkDefault true; # networking.interfaces.enp6s0f0.useDHCP = lib.mkDefault true;
# networking.interfaces.enp6s0f1.useDHCP = lib.mkDefault true;
# networking.interfaces.enp6s0f2.useDHCP = lib.mkDefault true;
# networking.interfaces.enp6s0f3.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;

View File

@ -3,8 +3,49 @@
{ {
# lfmao # lfmao
containers.jokum = { containers.jokum = {
interfaces = [ "ens10f1" ]; autoStart = true;
# wtf # wtf
path = inputs.self.nixosConfigurations.jokum.config.system.build.toplevel; #path = inputs.self.nixosConfigurations.jokum.config.system.build.toplevel;
interfaces = [ "enp6s0f1" ];
bindMounts = {
"/data" = { hostPath = "/data/jokum"; isReadOnly = false; };
};
config = {config, pkgs, ...}: let
inherit values inputs;
in {
imports = [
inputs.sops-nix.nixosModules.sops
inputs.matrix-next.nixosModules.synapse
../../jokum/services/matrix
../../jokum/services/nginx
];
_module.args = {
inherit values inputs;
};
sops.defaultSopsFile = ../../../secrets/jokum/jokum.yaml;
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
sops.age.keyFile = "/var/lib/sops-nix/key.txt";
sops.age.generateKey = true;
services.openssh = {
enable = true;
permitRootLogin = "yes";
};
systemd.network.enable = true;
networking.useHostResolvConf = false;
systemd.network.networks."30-enp6s0f1" = values.defaultNetworkConfig // {
matchConfig.Name = "enp6s0f1";
address = with values.hosts.jokum; [ (ipv4 + "/25") (ipv6 + "/64") ]
++ (with values.services.turn; [ (ipv4 + "/25") (ipv6 + "/64") ]);
};
system.stateVersion = "21.05";
};
}; };
} }

View File

@ -2,13 +2,14 @@
{ {
services.postgresql = { services.postgresql = {
enable = true; enable = true;
package = pkgs.postgresql_15;
enableTCPIP = true; enableTCPIP = true;
authentication = pkgs.lib.mkOverride 10 '' dataDir = "/data/postgresql";
local all all trust
host all all 127.0.0.0/8 trust authentication = ''
host all all ::1/128 trust host all all 129.241.210.128/25 md5
host all all 241.129.241.128/25 host all all 2001:700:300:1900::/64 md5
''; '';
# Hilsen https://pgconfigurator.cybertec-postgresql.com/ # Hilsen https://pgconfigurator.cybertec-postgresql.com/
@ -68,4 +69,7 @@
wal_recycle = true; wal_recycle = true;
}; };
}; };
networking.firewall.allowedTCPPorts = [ 5432 ];
networking.firewall.allowedUDPPorts = [ 5432 ];
} }

View File

@ -2,19 +2,21 @@
{ {
imports = [ imports = [
../../base.nix ../../base.nix
../../misc/metrics-exporters.nix # ../../misc/metrics-exporters.nix
../../misc/rust-motd.nix ../../misc/rust-motd.nix
./services/matrix # ./services/matrix
./services/nginx # ./services/nginx
]; ];
sops.defaultSopsFile = ../../secrets/jokum/jokum.yaml; # sops.defaultSopsFile = ../../secrets/jokum/jokum.yaml;
sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ]; # sops.age.sshKeyPaths = [ "/etc/ssh/ssh_host_ed25519_key" ];
sops.age.keyFile = "/var/lib/sops-nix/key.txt"; # sops.age.keyFile = "/var/lib/sops-nix/key.txt";
sops.age.generateKey = true; # sops.age.generateKey = true;
boot.kernel.enable = false;
boot.isContainer = true; boot.isContainer = true;
boot.loader.initScript.enable = true;
networking.useHostResolvConf = false; networking.useHostResolvConf = false;
networking.hostName = "jokum"; # Define your hostname. networking.hostName = "jokum"; # Define your hostname.