2024-09-22 01:04:11 -04: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’).
|
|
|
|
|
|
2024-09-28 21:03:16 -04:00
|
|
|
|
{ nixos-hardware, config, pkgs, musnix, ... }:
|
2024-09-22 01:04:11 -04:00
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
imports =
|
|
|
|
|
[ # Include the results of the hardware scan.
|
|
|
|
|
./hardware-configuration.nix
|
|
|
|
|
];
|
|
|
|
|
|
2024-09-23 23:35:58 -04:00
|
|
|
|
# Bootloader.
|
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
|
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
|
|
|
boot.kernelPackages = pkgs.linuxPackages_zen;
|
2024-09-22 01:04:11 -04:00
|
|
|
|
|
2024-09-25 23:50:11 -04:00
|
|
|
|
systemd.services.tailscaled.after = ["NetworkManager-wait-online.service"];
|
|
|
|
|
|
|
|
|
|
boot = {
|
2024-09-24 16:11:23 -04:00
|
|
|
|
# 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" ];
|
2024-09-25 23:50:11 -04:00
|
|
|
|
graphics.enable = true;
|
2024-09-24 16:11:23 -04:00
|
|
|
|
|
|
|
|
|
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).
|
2024-09-26 22:00:05 -04:00
|
|
|
|
powerManagement.finegrained = true;
|
2024-09-24 16:11:23 -04:00
|
|
|
|
|
|
|
|
|
# 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;
|
|
|
|
|
|
2024-09-26 22:00:05 -04:00
|
|
|
|
forceFullCompositionPipeline = true;
|
2024-09-24 16:11:23 -04:00
|
|
|
|
|
|
|
|
|
prime = {
|
|
|
|
|
amdgpuBusId = "PCI:0:2:0";
|
|
|
|
|
nvidiaBusId = "PCI:41:0:0";
|
|
|
|
|
offload = {
|
|
|
|
|
enable = true;
|
|
|
|
|
enableOffloadCmd = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#reverseSync.enable = true;
|
|
|
|
|
#sync.enable = true;
|
|
|
|
|
};
|
|
|
|
|
nvidiaSettings = true;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-28 21:03:16 -04:00
|
|
|
|
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"
|
|
|
|
|
'';
|
|
|
|
|
|
2024-09-24 16:11:23 -04:00
|
|
|
|
services.xserver.videoDrivers = [ "nvidia" ];
|
|
|
|
|
|
2024-09-23 23:35:58 -04:00
|
|
|
|
networking.hostName = "eddie";
|
2024-09-22 01:04:11 -04:00
|
|
|
|
|
|
|
|
|
# Enable networking
|
|
|
|
|
networking.networkmanager.enable = true;
|
|
|
|
|
|
|
|
|
|
# Set your time zone.
|
|
|
|
|
time.timeZone = "America/Toronto";
|
|
|
|
|
|
|
|
|
|
# Select internationalisation properties.
|
|
|
|
|
i18n.defaultLocale = "en_CA.UTF-8";
|
|
|
|
|
|
2024-09-27 10:28:41 -04:00
|
|
|
|
nix.nixPath = [ "nixos-config=/home/emenel/source/nixos-config" ];
|
2024-09-23 23:35:58 -04:00
|
|
|
|
|
|
|
|
|
nix.package = pkgs.nixFlakes;
|
2024-09-22 01:04:11 -04:00
|
|
|
|
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
|
|
|
|
|
|
|
|
# Enable the X11 windowing system
|
|
|
|
|
services.xserver.enable = true;
|
|
|
|
|
|
2024-09-24 16:11:23 -04:00
|
|
|
|
#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;
|
|
|
|
|
|
2024-09-22 01:04:11 -04:00
|
|
|
|
# Enable the GNOME Desktop Environment.
|
|
|
|
|
services.xserver.displayManager.gdm.enable = true;
|
|
|
|
|
services.xserver.desktopManager.gnome.enable = true;
|
|
|
|
|
|
2024-09-24 16:11:23 -04:00
|
|
|
|
programs.dconf.enable = true;
|
|
|
|
|
|
2024-09-22 01:04:11 -04:00
|
|
|
|
# Configure keymap in X11
|
|
|
|
|
services.xserver.xkb = {
|
|
|
|
|
layout = "us";
|
|
|
|
|
variant = "";
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# Enable CUPS to print documents.
|
|
|
|
|
services.printing.enable = true;
|
|
|
|
|
|
2024-09-24 23:46:34 -04:00
|
|
|
|
services.tailscale.enable = true;
|
|
|
|
|
|
2024-09-27 16:18:32 -04:00
|
|
|
|
#services.emacs = {
|
|
|
|
|
# enable = true;
|
|
|
|
|
# package = pkgs.emacs;
|
|
|
|
|
#};
|
2024-09-27 15:36:18 -04:00
|
|
|
|
|
2024-09-22 01:04:11 -04:00
|
|
|
|
# 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;
|
2024-09-28 20:28:06 -04:00
|
|
|
|
jack.enable = true;
|
|
|
|
|
wireplumber.enable = true;
|
2024-09-22 01:04:11 -04:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
# 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";
|
2024-09-29 13:45:20 -04:00
|
|
|
|
extraGroups = [ "networkmanager" "wheel" "uinput" "input" "audio" "video" "libvirtd" "nvidia" "cups" ];
|
2024-09-22 01:04:11 -04:00
|
|
|
|
openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFvtBCUQEi7r6mXdaULEaMMvGH1IWZBX9tXpjbIECar2 matt@emenel.ca" ];
|
|
|
|
|
packages = with pkgs; [
|
2024-09-23 09:46:14 -04:00
|
|
|
|
git
|
2024-09-22 01:04:11 -04:00
|
|
|
|
];
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-23 09:46:14 -04:00
|
|
|
|
# enable fish and launch it from bash for interactive shells
|
|
|
|
|
programs.fish.enable = true;
|
|
|
|
|
programs.bash = {
|
2024-09-27 14:17:11 -04:00
|
|
|
|
interactiveShellInit = ''
|
|
|
|
|
if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]]
|
2024-09-23 23:35:58 -04:00
|
|
|
|
then
|
|
|
|
|
shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION=""
|
|
|
|
|
exec ${pkgs.fish}/bin/fish $LOGIN_OPTION
|
|
|
|
|
fi
|
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.flatpak.enable = true;
|
2024-09-22 01:04:11 -04:00
|
|
|
|
|
|
|
|
|
# Allow unfree packages
|
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
|
|
|
|
|
|
|
|
# List packages installed in system profile. To search, run:
|
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
|
|
|
wget
|
2024-09-23 09:46:14 -04:00
|
|
|
|
home-manager
|
2024-09-22 01:04:11 -04:00
|
|
|
|
curl
|
|
|
|
|
git
|
2024-09-24 23:46:34 -04:00
|
|
|
|
tailscale
|
2024-09-22 01:04:11 -04:00
|
|
|
|
rsync
|
2024-09-27 11:24:24 -04:00
|
|
|
|
kmonad
|
2024-09-29 13:45:20 -04:00
|
|
|
|
];
|
2024-09-27 11:24:24 -04:00
|
|
|
|
|
|
|
|
|
services.kmonad = {
|
2024-09-27 10:49:12 -04:00
|
|
|
|
enable = true;
|
2024-09-27 11:24:24 -04:00
|
|
|
|
keyboards = {
|
2024-09-27 12:08:18 -04:00
|
|
|
|
quefrency = {
|
2024-09-27 11:52:38 -04:00
|
|
|
|
device = "/dev/input/by-id/usb-Keebio_Quefrency_Rev._5-event-kbd";
|
2024-09-27 12:08:18 -04:00
|
|
|
|
config = builtins.readFile ../../dotfiles/dot_config/kmonad/quefrency.kbd;
|
2024-09-27 11:30:08 -04:00
|
|
|
|
};
|
2024-09-27 12:08:18 -04:00
|
|
|
|
razer = {
|
2024-09-28 11:50:26 -04:00
|
|
|
|
device = "/dev/input/by-id/usb-Razer_Razer_Blade-if01-event-kbd";
|
2024-09-27 12:08:18 -04:00
|
|
|
|
config = builtins.readFile ../../dotfiles/dot_config/kmonad/razer.kbd;
|
|
|
|
|
};
|
2024-09-27 10:43:53 -04:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-29 13:45:20 -04:00
|
|
|
|
programs.virt-manager.enable = true;
|
|
|
|
|
|
|
|
|
|
virtualisation = {
|
|
|
|
|
libvirtd = {
|
|
|
|
|
enable = true;
|
|
|
|
|
qemu = {
|
|
|
|
|
package = pkgs.qemu_kvm;
|
|
|
|
|
swtpm.enable = true;
|
|
|
|
|
ovmf.enable = true;
|
|
|
|
|
ovmf.packages = [ pkgs.OVMFFull.fd ];
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
spiceUSBRedirection.enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
services.qemuGuest.enable = true;
|
|
|
|
|
services.spice-vdagentd.enable = true;
|
|
|
|
|
|
2024-09-28 20:28:06 -04:00
|
|
|
|
programs.steam = {
|
|
|
|
|
enable = true;
|
|
|
|
|
extraCompatPackages = [ pkgs.proton-ge-bin ];
|
|
|
|
|
};
|
2024-09-22 01:04:11 -04:00
|
|
|
|
|
|
|
|
|
# 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;
|
|
|
|
|
|
2024-09-28 20:28:06 -04:00
|
|
|
|
|
|
|
|
|
#do not change
|
|
|
|
|
system.stateVersion = "24.05";
|
2024-09-22 01:04:11 -04:00
|
|
|
|
|
|
|
|
|
}
|