config/hosts/sopp/default.nix

157 lines
5.3 KiB
Nix
Raw Normal View History

2023-06-18 22:17:36 +02:00
{ config, pkgs, lib, ... }:
{
# Bootloader
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user = "pbsds";
# 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.package = config.boot.kernelPackages.nvidiaPackages.latest;
#hardware.nvidia.modesetting.enable = false; # makes atom behave, but mpv refuses to start
# PRIME:
#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 = [
./hardware-configuration.nix
2023-06-23 21:45:16 +02:00
../../hardware/gpu/cuda.nix
../../hardware/gpu/intel.nix
2023-06-30 12:26:00 +02:00
../../hardware/printer/hp-laserjet-p1005.nix
2023-06-24 19:11:49 +02:00
../../profiles/auto-upgrade.nix
2023-06-18 22:17:36 +02:00
../../users # home-manager
../../users/pbsds
../../profiles/mounts/reidun-nfs.nix
../../profiles/shell/base.nix
../../profiles/shell/archives.nix
../../profiles/shell/nix-utils.nix
2023-06-24 20:23:38 +02:00
../../profiles/shell/binfmt-emu.nix
2023-06-18 22:17:36 +02:00
2023-06-29 02:16:16 +02:00
../../profiles/desktop/base.nix
2023-06-18 22:17:36 +02:00
../../profiles/desktop/gnome # configures gdm
#../../profiles/desktop/sound/alsa.nix
#../../profiles/desktop/sound/pulseaudio.nix
../../profiles/desktop/sound/pipewire.nix
../../profiles/desktop/steam.nix
../../profiles/desktop/flatpak.nix
../../profiles/remote-builders
#../../profiles/autossh-reverse-tunnels
#../../profiles/domeneshop-dyndns # handled by noximilien
];
networking.firewall.allowedTCPPorts = [ 57621 ]; # spotify local discovery
services.thermald.enable = true;
# Virtualization
#virtualisation.podman.enable = true;
#virtualisation.podman.dockerCompat = true; # alias docker to podman
#virtualisation.oci-containers.backend = "podman"; # default
# 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
# Installed system packages
environment.systemPackages = with pkgs; [
cage
weston
];
# TODO: remove? Move?
programs.dconf.enable = true;
# OpenSSH
services.openssh.enable = true;
services.openssh.settings.X11Forwarding = true;
# System fonts
fonts.fontDir.enable = true; # creates /run/current-system/sw/share/X11/fonts
fonts.enableDefaultFonts = true; # dejavu, freefont, gyre, liberation, unifont, noto-fonts-emoji
fonts.fonts = with pkgs; [
noto-fonts # includes Cousine
noto-fonts-cjk
noto-fonts-emoji
noto-fonts-extra
];
2023-06-24 20:23:38 +02:00
# nvidia bad
nixpkgs.config.packageOverrides = (pkgs: {
discord = pkgs.discord.overrideAttrs (old: rec {
2023-06-29 03:05:46 +02:00
desktopItem = old.desktopItem.override (old: {
#exec = "${pkgs.coreutils}/bin/env NIXOS_OZONE_WL=1 ${old.exec}";
exec = "${pkgs.coreutils-full}/bin/env NIXOS_OZONE_WL=1 Discord";
});
postInstall = ''
ln -sf "${desktopItem}/share/applications" $out/share/
'' + old.postInstall;
});
2023-06-29 03:05:46 +02:00
slack = pkgs.slack.overrideAttrs (old: {
postInstall = old.postInstall or "" + ''
substituteInPlace $out/share/applications/slack.desktop \
--replace "$out/bin/slack " "$out/bin/slack --disable-gpu --in-process-gpu "
'';
});
2023-06-24 20:23:38 +02:00
element-desktop = pkgs.element-desktop.overrideAttrs (old: {
desktopItem = old.desktopItem.override (old: {
exec = "element-desktop --disable-gpu --in-process-gpu %u";
2023-06-24 20:23:38 +02:00
});
});
});
2023-06-18 22:17:36 +02:00
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "23.05"; # Did you read the comment?
}