mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-02-20 00:47:52 +01:00
hosts: add skrot
Co-authored-by: System administrator <root@skrot.pvv.ntnu.no> Reviewed-on: https://git.pvv.ntnu.no/Drift/pvv-nixos-config/pulls/124 Co-authored-by: Vegard Bieker Matthey <VegardMatthey@protonmail.com> Co-committed-by: Vegard Bieker Matthey <VegardMatthey@protonmail.com>
This commit is contained in:
committed by
Vegard Bieker Matthey
parent
0d40c7d7a7
commit
b5fecc94a7
63
hosts/skrot/configuration.nix
Normal file
63
hosts/skrot/configuration.nix
Normal file
@@ -0,0 +1,63 @@
|
||||
{
|
||||
fp,
|
||||
lib,
|
||||
config,
|
||||
values,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
# Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./disk-config.nix
|
||||
(fp /base)
|
||||
];
|
||||
|
||||
boot.consoleLogLevel = 0;
|
||||
|
||||
sops.defaultSopsFile = fp /secrets/skrot/skrot.yaml;
|
||||
|
||||
systemd.network.networks."enp2s0" = values.defaultNetworkConfig // {
|
||||
matchConfig.Name = "enp2s0";
|
||||
address = with values.hosts.skrot; [
|
||||
(ipv4 + "/25")
|
||||
(ipv6 + "/64")
|
||||
];
|
||||
};
|
||||
|
||||
sops.secrets = {
|
||||
"dibbler/postgresql/password" = {
|
||||
owner = "dibbler";
|
||||
group = "dibbler";
|
||||
};
|
||||
};
|
||||
|
||||
services.dibbler = {
|
||||
enable = true;
|
||||
kioskMode = true;
|
||||
limitScreenWidth = 80;
|
||||
limitScreenHeight = 42;
|
||||
|
||||
settings = {
|
||||
general.quit_allowed = false;
|
||||
database = {
|
||||
type = "postgresql";
|
||||
postgresql = {
|
||||
username = "pvv_vv";
|
||||
dbname = "pvv_vv";
|
||||
host = "postgres.pvv.ntnu.no";
|
||||
password_file = config.sops.secrets."dibbler/postgresql/password".path;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."serial-getty@ttyUSB0" = lib.mkIf (!config.virtualisation.isVmVariant) {
|
||||
enable = true;
|
||||
wantedBy = [ "getty.target" ]; # to start at boot
|
||||
serviceConfig.Restart = "always"; # restart when session is closed
|
||||
};
|
||||
|
||||
system.stateVersion = "25.11"; # Did you read the comment? Nah bro
|
||||
}
|
||||
41
hosts/skrot/disk-config.nix
Normal file
41
hosts/skrot/disk-config.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
disko.devices = {
|
||||
disk = {
|
||||
main = {
|
||||
device = "/dev/sda";
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
ESP = {
|
||||
type = "EF00";
|
||||
size = "1G";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = [ "umask=0077" ];
|
||||
};
|
||||
};
|
||||
plainSwap = {
|
||||
size = "8G";
|
||||
content = {
|
||||
type = "swap";
|
||||
discardPolicy = "both";
|
||||
resumeDevice = false;
|
||||
};
|
||||
};
|
||||
root = {
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "ext4";
|
||||
mountpoint = "/";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
15
hosts/skrot/hardware-configuration.nix
Normal file
15
hosts/skrot/hardware-configuration.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -59,7 +59,7 @@
|
||||
# zramSwap.enable = true;
|
||||
|
||||
networking = {
|
||||
hostName = "skrot";
|
||||
hostName = "skrott";
|
||||
defaultGateway = values.hosts.gateway;
|
||||
defaultGateway6 = values.hosts.gateway6;
|
||||
interfaces.eth0 = {
|
||||
|
||||
Reference in New Issue
Block a user