infrastructure/nixos/hosts/other/null/configuration.nix

123 lines
3.4 KiB
Nix
Raw Normal View History

2022-08-20 11:34:41 +02:00
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help).
2022-08-20 12:55:59 +02:00
{ config, pkgs, lib, ... }:
2022-08-20 12:16:29 +02:00
let
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
export __NV_PRIME_RENDER_OFFLOAD=1
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
exec "$@"
'';
in
2022-08-20 11:34:41 +02:00
{
imports =
2022-08-20 12:16:29 +02:00
[
# Include the results of the hardware scan.
2022-08-20 11:34:41 +02:00
./hardware-configuration.nix
];
2022-08-20 12:55:59 +02:00
# home-manager
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.users.victor = import ./home.nix;
2022-08-20 11:34:41 +02:00
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.loader.efi.efiSysMountPoint = "/boot/efi";
# Enable networking
networking.networkmanager.enable = true;
2022-08-20 12:55:59 +02:00
networking.interfaces.wlp0s20f3.useDHCP = true;
fileSystems."/".options = [ "compress=zstd" ];
2022-08-20 11:34:41 +02:00
# Select internationalisation properties.
i18n.defaultLocale = "en_GB.utf8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "en_DK.utf8";
LC_IDENTIFICATION = "en_DK.utf8";
LC_MEASUREMENT = "en_DK.utf8";
LC_MONETARY = "en_DK.utf8";
LC_NAME = "en_DK.utf8";
LC_NUMERIC = "en_DK.utf8";
LC_PAPER = "en_DK.utf8";
LC_TELEPHONE = "en_DK.utf8";
LC_TIME = "en_DK.utf8";
};
# Enable the X11 windowing system.
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services.xserver = {
layout = "us";
xkbVariant = "altgr-intl";
2022-08-20 12:16:29 +02:00
xkbOptions = "caps:swapescape";
videoDrivers = [ "nvidia" ];
};
# hardware.nvidia.modesetting.enable = true;
hardware.nvidia.prime = {
offload.enable = true;
intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
};
2022-08-20 12:55:59 +02:00
hardware.opengl.extraPackages = with pkgs; [
vaapiVdpau
];
2022-08-20 11:34:41 +02:00
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
# If you want to use JACK applications, uncomment this
#jack.enable = true;
# use the example session manager (no others are packaged yet so this is enabled by default,
# no need to redefine it in your config for now)
#media-session.enable = true;
};
environment.systemPackages = with pkgs; [
2022-08-20 13:12:42 +02:00
gnome.gnome-tweaks
2022-08-20 12:16:29 +02:00
pciutils
nvidia-offload
vim
2022-08-20 11:34:41 +02:00
];
2022-08-20 13:54:45 +02:00
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
dedicatedServer.openFirewall = true;
};
2022-08-20 12:55:59 +02:00
services.fstrim.enable = true;
2022-08-20 11:34:41 +02:00
# 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. Its 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 = "22.05"; # Did you read the comment?
}