nixos-config/system/eddie/configuration.nix

247 lines
7.4 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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).
{ nixos-hardware, config, pkgs, musnix, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernelPackages = pkgs.linuxPackages_zen;
systemd.services.tailscaled.after = ["NetworkManager-wait-online.service"];
boot = {
# TODO: confirm this works
# https://forums.developer.nvidia.com/t/550-54-14-cannot-create-sg-table-for-nvkmskapimemory-spammed-when-launching-chrome-on-wayland/284775/26
initrd.kernelModules = [ "nvidia" "i915" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" ];
# extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
kernelParams = [ "nvidia-drm.fbdev=1" ];
};
hardware = {
openrazer.enable = true;
openrazer.users = [ "emenel" ];
graphics.enable = true;
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "555.58.02";
sha256_64bit = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM=";
sha256_aarch64 = "sha256-8hyRiGB+m2hL3c9MDA/Pon+Xl6E788MZ50WrrAGUVuY=";
openSha256 = "sha256-8hyRiGB+m2hL3c9MDA/Pon+Xl6E788MZ50WrrAGUVuY=";
settingsSha256 = "sha256-ZpuVZybW6CFN/gz9rx+UJvQ715FZnAOYfHn5jt5Z2C8=";
persistencedSha256 = "sha256-xctt4TPRlOJ6r5S54h5W6PT6/3Zy2R4ASNFPu8TSHKM=";
};
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = true;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
forceFullCompositionPipeline = true;
prime = {
amdgpuBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:41:0:0";
offload = {
enable = true;
enableOffloadCmd = true;
};
#reverseSync.enable = true;
#sync.enable = true;
};
nvidiaSettings = true;
};
};
musnix = {
enable = true;
alsaSeq.enable = true;
rtcqs.enable = true;
};
services.udev.extraRules = ''
DEVPATH=="/devices/virtual/misc/cpu_dma_latency", OWNER="root", GROUP="audio", MODE="0660"
'';
services.xserver.videoDrivers = [ "nvidia" ];
networking.hostName = "eddie";
# Enable networking
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/Toronto";
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
nix.nixPath = [ "nixos-config=/home/emenel/source/nixos-config" ];
nix.package = pkgs.nixFlakes;
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Enable the X11 windowing system
services.xserver.enable = true;
#services.greetd = {
# enable = true;
# settings = rec {
# initial_session = {
# command = "${pkgs.greetd.tuigreet}/bin/tuigreet --sessions ${config.services.xserver.displayManager.sessionData.desktops}/share/xsessions:${config.services.xserver.displayManager.sessionData.desktops}/share/wayland-sessions --remember --remember-user-session";
# user = "greeter";
# };
# default_session = initial_session;
# };
#};
#security.pam.services.greetd.enableGnomeKeyring = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
programs.dconf.enable = true;
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
services.tailscale.enable = true;
#services.emacs = {
# enable = true;
# package = pkgs.emacs;
#};
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# Define a user account. Don't forget to set a password with passwd.
users.users.emenel = {
isNormalUser = true;
description = "emenel";
extraGroups = [ "networkmanager" "wheel" "uinput" "input" "audio" "video" ];
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFvtBCUQEi7r6mXdaULEaMMvGH1IWZBX9tXpjbIECar2 matt@emenel.ca" ];
packages = with pkgs; [
git
];
};
# enable fish and launch it from bash for interactive shells
programs.fish.enable = true;
programs.bash = {
interactiveShellInit = ''
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
then
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
fi
'';
};
services.flatpak.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# List packages installed in system profile. To search, run:
environment.systemPackages = with pkgs; [
wget
home-manager
curl
git
tailscale
rsync
#kanata
kmonad
emacs
];
#systemd.services.kanata = {
# enable = true;
# wantedBy = [ "default.target" ];
# description = "kanata";
# serviceConfig = {
# ExecStart = "/home/emenel/.nix-profile/bin/kanata --cfg /home/emenel/.config/kanata/main.kbd";
# };
#};
services.kmonad = {
enable = true;
keyboards = {
quefrency = {
device = "/dev/input/by-id/usb-Keebio_Quefrency_Rev._5-event-kbd";
config = builtins.readFile ../../dotfiles/dot_config/kmonad/quefrency.kbd;
};
razer = {
device = "/dev/input/by-id/usb-Razer_Razer_Blade-if01-event-kbd";
config = builtins.readFile ../../dotfiles/dot_config/kmonad/razer.kbd;
};
};
};
programs.steam = {
enable = true;
extraCompatPackages = [ pkgs.proton-ge-bin ];
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
#serivces.openssh.permitRootLogin = "no";
#services.openssh.passwordAuthentication = true;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
#do not change
system.stateVersion = "24.05";
}