123 lines
2.8 KiB
Nix
123 lines
2.8 KiB
Nix
{ config, pkgs, inputs, ... }:
|
|
|
|
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
|
|
{
|
|
imports =
|
|
[
|
|
./hardware-configuration.nix
|
|
];
|
|
|
|
# Use the systemd-boot EFI boot loader.
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
networking.hostName = "ritchie";
|
|
networking.networkmanager.enable = true;
|
|
|
|
i18n.defaultLocale = "en_GB.UTF-8";
|
|
time.timeZone = "Europe/London";
|
|
|
|
# Enable sound.
|
|
security.rtkit.enable = true;
|
|
services.pipewire = {
|
|
enable = true;
|
|
alsa.enable = true;
|
|
alsa.support32Bit = true;
|
|
pulse.enable = true;
|
|
};
|
|
|
|
users.groups.tmux.gid = 1000; # Used for tmux pairing
|
|
systemd.tmpfiles.rules = [
|
|
"d /var/tmux_share 2770 tsv tmux"
|
|
];
|
|
|
|
users.users.tsv = {
|
|
isNormalUser = true;
|
|
extraGroups = [
|
|
"wheel"
|
|
"docker"
|
|
"tmux"
|
|
"networkmanager"
|
|
];
|
|
initialPassword = "password";
|
|
};
|
|
|
|
users.users.foxsoft = {
|
|
isNormalUser = true;
|
|
extraGroups = [
|
|
"tmux"
|
|
];
|
|
openssh.authorizedKeys.keyFiles = [
|
|
../users/foxsoft/authorized_keys
|
|
];
|
|
};
|
|
|
|
nix.settings.trusted-users = [ "root" "tsv" ];
|
|
|
|
nix = {
|
|
extraOptions = "experimental-features = nix-command flakes";
|
|
package = pkgs.nixFlakes;
|
|
};
|
|
|
|
services.xserver.enable = true;
|
|
services.xserver.displayManager.sddm.enable = true;
|
|
services.xserver.desktopManager.plasma5.enable = true;
|
|
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;
|
|
|
|
environment.systemPackages = [
|
|
pkgs.wget
|
|
pkgs.tmux
|
|
pkgs.git
|
|
pkgs.pciutils
|
|
pkgs.xdg-desktop-portal
|
|
pkgs.xdg-desktop-portal-gtk
|
|
pkgs.xdg-desktop-portal-kde
|
|
inputs.devenv.packages.x86_64-linux.devenv
|
|
];
|
|
|
|
environment.variables.LC_ALL = "en_GB.UTF-8";
|
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
nixpkgs.overlays = [
|
|
(self: super: {
|
|
# Experimental features in Waybar gives us access to workspace selectors
|
|
waybar = super.waybar.overrideAttrs (oldAttrs: {
|
|
mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ];
|
|
});
|
|
})
|
|
inputs.codeium.overlays.x86_64-linux.default
|
|
];
|
|
|
|
|
|
virtualisation.docker.enable = true;
|
|
|
|
services.openssh = {
|
|
enable = true;
|
|
settings.PasswordAuthentication = false;
|
|
};
|
|
|
|
system.stateVersion = "22.11"; # Don't change this
|
|
}
|
|
|