Nix-Config/system/configuration.nix

88 lines
1.9 KiB
Nix
Raw Normal View History

2023-02-05 14:48:47 +00:00
{ config, pkgs, ... }:
2023-02-23 12:26:53 +00:00
let
2023-02-06 09:21:35 +00:00
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
2023-02-05 14:48:47 +00:00
{
imports =
2023-02-05 16:57:39 +00:00
[
2023-02-05 14:48:47 +00:00
./hardware-configuration.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
2023-02-23 12:26:53 +00:00
networking.hostName = "ritchie";
2023-02-06 09:21:35 +00:00
networking.networkmanager.enable = true;
2023-02-05 14:48:47 +00:00
time.timeZone = "Europe/London";
# Enable sound.
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
users.users.tsv = {
isNormalUser = true;
2023-02-23 12:26:53 +00:00
extraGroups = [
2023-02-05 16:57:39 +00:00
"wheel"
"docker"
2023-02-23 12:26:53 +00:00
];
2023-02-05 14:48:47 +00:00
initialPassword = "password";
};
2023-02-17 11:51:36 +00:00
nix.settings.trusted-users = [ "root" "tsv" ];
2023-03-09 18:49:28 +00:00
nix = {
extraOptions = "experimental-features = nix-command flakes";
package = pkgs.nixFlakes;
};
2023-02-05 14:48:47 +00:00
services.xserver.enable = true;
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
2023-02-06 09:21:35 +00:00
hardware.nvidia.modesetting.enable = true;
services.xserver.videoDrivers = ["nvidia" ];
hardware.opengl.enable = true;
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
hardware.nvidia.prime = {
sync.enable = true;
nvidiaBusId = "PCI:1:0:0";
intelBusId = "PCI:0:2:0";
};
hardware.bluetooth.enable = true;
2023-02-05 14:48:47 +00:00
environment.systemPackages = with pkgs; [
wget
tmux
git
2023-02-23 12:26:53 +00:00
pciutils
2023-02-06 09:21:35 +00:00
nvidia-offload
2023-03-03 16:28:23 +00:00
xdg-desktop-portal
xdg-desktop-portal-gtk
xdg-desktop-portal-kde
2023-02-05 14:48:47 +00:00
];
nixpkgs.config.allowUnfree = true;
2023-02-05 16:57:39 +00:00
virtualisation.docker.enable = true;
2023-02-05 14:48:47 +00:00
services.openssh.enable = true;
2023-02-05 16:57:39 +00:00
system.stateVersion = "22.11"; # Don't change this
2023-02-05 14:48:47 +00:00
}