dotfiles/hosts/Arendia/default.nix

122 lines
4.1 KiB
Nix

{ pkgs, lib, inputs, config, nixos-06cb-009a-fingerprint-sensor, ... }:
let
serverIP = "10.0.0.1";
in {
imports = [
(import ../Common/default.nix { inherit inputs pkgs config; })
(import ../Common/desktop.nix { inherit inputs pkgs config; })
(import ../Common/nfs.nix { inherit pkgs serverIP; })
(import ../Common/zfs.nix {inherit inputs pkgs config; })
(import ../Common/android.nix {inherit inputs pkgs config; })
];
hardware.graphics.extraPackages = [
pkgs.intel-compute-runtime
pkgs.intel-media-driver
];
# boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = ["mitigations=off"];
programs.steam = {
enable = true;
gamescopeSession.enable = true;
};
zramSwap.enable = true;
services.upower.enable = true;
services.thermald.enable = true;
services.logind.extraConfig = ''HandlePowerKey=ignore'';
services.throttled = {
enable = true;
};
networking.hostId = "b6c5c9af";
networking.interfaces.wlan0.useDHCP = lib.mkDefault false;
networking.wireless.iwd.enable = true;
networking.wireless.iwd.settings = {
IPv6 = {
Enabled = true;
};
Settings = {
AutoConnect = true;
};
General = {
EnableNetworkConfiguration = true;
};
};
# services."06cb-009a-fingerprint-sensor" = {
# enable = true;
# backend = "python-validity";
# };
services."06cb-009a-fingerprint-sensor" = {
enable = true;
backend = "libfprint-tod";
calib-data-file = ./files/calib-data-2.bin;
};
# virtualisation
virtualisation.libvirtd.enable = true;
virtualisation.libvirtd.qemu.ovmf.enable = true;
virtualisation.spiceUSBRedirection.enable = true;
programs.virt-manager.enable = true;
users.users.user.extraGroups = [ "libvirtd" ];
services.tlp = {
enable = true;
settings = {
START_CHARGE_THRESH_BAT0 = 40; # 40 and bellow it starts to charge
STOP_CHARGE_THRESH_BAT0 = 80; # 80 and above it stops charging
START_CHARGE_THRESH_BAT1 = 40; # 40 and bellow it starts to charge
STOP_CHARGE_THRESH_BAT1 = 80; # 80 and above it stops charging
};
};
systemd.network.enable = true;
networking.useNetworkd = true;
systemd.network.config.networkConfig = {
ManageForeignRoutingPolicyRules = false;
ManageForeignRoutes = false;
SpeedMeter = true;
};
systemd.services.systemd-networkd-wait-online.enable = lib.mkForce false;
networking.wg-quick.interfaces = {
Tunnel = {
address = [ "10.0.0.7/24" "2a02:a03f:83ad:2101::7/128" ];
privateKeyFile = "/home/user/.secrets/Wireguard/Arendia.key";
listenPort = 51820;
autostart = false;
postUp = "resolvectl dns Tunnel 10.0.0.1; resolvectl domain Tunnel ~thomasave.be;";
dns = ["10.0.0.1"];
peers = [{
publicKey = "/9ppjm3yeD0duDvxrqgcHscHmftXko+0s2RbivNEy2c=";
allowedIPs = [ "0.0.0.0/0" "::/0" ];
endpoint = "ipv4.thomasave.be:13231";
persistentKeepalive = 25;
}];
};
OPNsense = {
address = [ "10.0.0.7/24" "2a02:a03f:83ad:2101::7/128" ];
privateKeyFile = "/home/user/.secrets/Wireguard/Arendia.key";
listenPort = 51820;
autostart = true;
postUp = "resolvectl dns OPNsense 10.0.0.1; resolvectl domain OPNsense ~thomasave.be;";
dns = ["10.0.0.1"];
peers = [{
publicKey = "/9ppjm3yeD0duDvxrqgcHscHmftXko+0s2RbivNEy2c=";
allowedIPs = [ "10.0.0.1/8" "192.168.1.2/32" ];
endpoint = "ipv4.thomasave.be:13231";
persistentKeepalive = 25;
}];
};
};
systemd.services."wg-quick-OPNsense" = {
serviceConfig = { Restart = "on-failure"; RestartSec = "2s"; };
unitConfig.StartLimitIntervalSec = 0;
};
environment.systemPackages = with pkgs; [
gcc
];
fonts.fontDir.enable = true;
}