config/hosts/nixos/sopp/configuration.nix

130 lines
4.3 KiB
Nix
Raw Permalink Normal View History

2024-11-08 17:32:45 +01:00
{ config, pkgs, lib, modulesPath, ... }:
2023-06-18 22:17:36 +02:00
{
# Bootloader
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
2024-11-08 17:32:45 +01:00
# for testing only, not for building
# (from ./binfmt.nix)
boot.binfmt.addEmulatedSystemsToNixSandbox = false;
boot.binfmt.emulatedSystems = [
"aarch64-linux"
"armv7l-linux"
"riscv64-linux"
];
#nix.settings.system = "x86_64-linux";
#nix.settings.extra-platforms = [ "i686-linux" ];
2023-12-03 20:57:02 +01:00
boot.kernel.sysctl."vm.swappiness" = lib.mkDefault 10; # 0-100, commonly 60
2024-08-14 17:09:15 +02:00
boot.kernelModules = [ "xhci_pci" ]; # add driver to stage-1 to make the usb dock not prevent boot - https://github.com/NixOS/nixpkgs/issues/171625#issuecomment-2068283656
2023-12-03 20:57:02 +01:00
2024-10-19 18:53:16 +02:00
services.displayManager.autoLogin.enable = true;
services.displayManager.autoLogin.user = "pbsds";
2023-06-18 22:17:36 +02:00
# tmp: https://github.com/NixOS/nixpkgs/issues/103746#issuecomment-945091229
systemd.services."getty@tty1".enable = false;
systemd.services."autovt@tty1".enable = false;
2023-06-24 19:11:49 +02:00
#boot.kernelPackages = pkgs.linuxPackages_latest;
#hardware.nvidia.modesetting.enable = false; # makes atom behave, but mpv refuses to start
2024-02-26 11:03:25 +01:00
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta;
2023-06-24 19:11:49 +02:00
2024-11-15 04:49:41 +01:00
# The open source driver does not support Pascal GPUs (1080)
# https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/nvidia/pascal/default.nix
hardware.nvidia.open = false;
2023-07-09 00:10:03 +02:00
# PRIME: (lspci)
2023-09-07 01:44:45 +02:00
#hardware.nvidia.prime.intelBusId = "PCI:0:02:0";
#hardware.nvidia.prime.nvidiaBusId = "PCI:1:00:0";
2023-06-18 22:17:36 +02:00
imports = [
2024-11-08 17:32:45 +01:00
{
/* disabledModules = [ "${modulesPath}/nixos/modules/system/boot/binfmt.nix" ]; */
disabledModules = [ "system/boot/binfmt.nix" ];
imports = [ ./binfmt.nix ];
}
2023-06-18 22:17:36 +02:00
./hardware-configuration.nix
../../../profiles/sshd.nix
../../../profiles/no-suspend.nix
#../../../profiles/oci/podman.nix
../../../profiles/oci/docker.nix
../../../profiles/oci/distrobox.nix
2023-06-18 22:17:36 +02:00
../../../users/pbsds
../../../users/pbsds/syncthing.nix
2023-06-18 22:17:36 +02:00
../../../profiles/mounts/freon-nfs.nix
../../../profiles/mounts/reidun-nfs.nix
2024-11-15 04:50:06 +01:00
/* ../../../profiles/mounts/meconium-nfs.nix */
2023-06-18 22:17:36 +02:00
../../../profiles/shell.nix
2023-06-18 22:17:36 +02:00
2024-10-19 20:40:40 +02:00
../../../profiles/desktop
../../../profiles/desktop/gnome # configures gdm
#../../../profiles/desktop/sound/alsa.nix
#../../../profiles/desktop/sound/pulseaudio.nix
../../../profiles/desktop/sound/pipewire.nix
2023-06-18 22:17:36 +02:00
../../../profiles/desktop/steam.nix
#../../../profiles/desktop/xboxdrv.nix # TODO: try out
../../../profiles/desktop/lutris.nix
../../../profiles/desktop/flatpak.nix
2023-06-18 22:17:36 +02:00
../../../profiles/known-hosts.nix
#../../../profiles/domeneshop-dyndns.nix # handled by noximilien
2023-06-18 22:17:36 +02:00
];
networking.firewall.allowedTCPPorts = [ 57621 ]; # spotify local discovery
2024-10-20 17:24:33 +02:00
hardware.bluetooth.enable = true;
2024-10-09 16:59:03 +02:00
environment.systemPackages = [
pkgs.pbsds.v4l2-play
2024-10-17 22:45:24 +02:00
/* pkgs.librealsense-gui */
2024-10-09 16:59:03 +02:00
];
2023-06-18 22:17:36 +02:00
# Networking
2023-06-22 19:19:55 +02:00
/**/
2023-06-18 22:17:36 +02:00
networking.networkmanager.enable = true;
#networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
2023-06-22 19:19:55 +02:00
networking.interfaces.enp3s0.wakeOnLan.enable = true;
2023-06-19 03:35:47 +02:00
networking.interfaces.enp3s0.ipv4.addresses = [
2023-06-18 22:17:36 +02:00
{ address = "192.168.1.7"; prefixLength = 24; }
];
networking.defaultGateway.address = "192.168.1.254";
networking.defaultGateway.interface = "enp3s0";
networking.nameservers = [
"192.168.1.254"
"8.8.8.8"
"1.1.1.1"
];
#networking.useDHCP = true;
2023-06-22 19:19:55 +02:00
/** /
systemd.network.enable = true;
systemd.network.networks."50-static" = {
matchConfig.Name = "enp3s0";
address = [ "192.168.1.7/24" ];
gateway = [ "192.168.1.254" ];
dns = [ "192.168.1.254" "8.8.8.8" "1.1.1.1" ];
domains = [ config.networking.domain ]; # set by flake
networkConfig.IPv6AcceptRA = false;
linkConfig.RequiredForOnline = "routable"; # dependency for network-online.target
};
/** /
systemd.network.networks."51-dhcp" = {
matchConfig.Name = "enp3s0";
networkConfig.DHCP = "yes";
networkConfig.IPv6AcceptRA = true;
linkConfig.RequiredForOnline = "no"; # not always connected and not required to be online
};
/**/
2023-06-18 22:17:36 +02:00
#TODO: avahi? resolved? https://git.pvv.ntnu.no/Drift/pvv-nixos-config/src/main/base.nix#L15-L18
# TODO: remove? Move?
programs.dconf.enable = true;
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
}