nixos-config/system/eddie/configuration.nix

482 lines
11 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, lib, inputs, outputs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
./razer-speaker-fix.nix
];
nixpkgs = {
# You can add overlays here
overlays = [
# Add overlays your own flake exports (from overlays and pkgs dir):
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
];
# Configure your nixpkgs instance
config = {
# Disable if you don't want unfree packages
allowUnfree = true;
};
};
nix = let
flakeInputs = lib.filterAttrs (_: lib.isType "flake") inputs;
in {
# gc = {
# automatic = true;
# dates = "daily";
# options = "--delete-older-than +3";
# };
settings = {
# Enable flakes and new 'nix' command
experimental-features = "nix-command flakes";
# Workaround for https://github.com/NixOS/nix/issues/9574
nix-path = config.nix.nixPath;
};
# Opinionated: disable channels
# channel.enable = false;
# Opinionated: make flake registry and nix path match flake inputs
registry = lib.mapAttrs (_: flake: {inherit flake;}) flakeInputs;
nixPath = lib.mapAttrsToList (n: _: "${n}=flake:${n}") flakeInputs;
};
# List packages installed in system profile. To search, run:
environment.systemPackages = with pkgs; [
wget
libGL
home-manager
curl
git-lfs
tailscale
rsync
gnupg
clinfo
alsa-utils
psutils
alsa-tools
util-linux
libgtop
ulauncher
fontconfig
freetype
egl-wayland
glfw-wayland
openssl
xwayland-satellite
];
# Bootloader.
boot = {
loader = {
systemd-boot.enable = true;
systemd-boot.configurationLimit = 8;
efi.canTouchEfiVariables = true;
};
kernelPackages = pkgs.unstable.linuxPackages_6_12;
initrd.kernelModules = [ "nvidia" "nvidia_modeset" "nvidia_uvm" "nvidia_drm" "snd-virmidi" ];
kernelParams = [ "nvidia_drm.fbdev=1" "nvidia_drm.modeset=1" ];
};
systemd.services.tailscaled.after = ["NetworkManager-wait-online.service"];
documentation = {
dev.enable = true;
man.generateCaches = false;
};
hardware = {
openrazer = {
enable = true;
users = [ "emenel" ];
};
graphics = {
enable = true;
enable32Bit = true;
extraPackages = [
pkgs.rocmPackages.clr.icd
pkgs.amdvlk
];
extraPackages32 = [
pkgs.driversi686Linux.amdvlk
];
};
enableAllFirmware = true;
firmware = [
pkgs.sof-firmware
pkgs.alsa-firmware
];
nvidia = {
# Modesetting is required.
open = true;
modesetting.enable = true;
powerManagement.enable = true;
powerManagement.finegrained = true;
# forceFullCompositionPipeline = true;
package = config.boot.kernelPackages.nvidiaPackages.beta;
prime = {
amdgpuBusId = "PCI:101:0:0";
nvidiaBusId = "PCI:1:0:0";
offload = {
enable = true;
enableOffloadCmd = true;
};
#reverseSync.enable = true;
#sync.enable = true;
};
nvidiaSettings = true;
};
};
# specialisation = {
# gpupower.configuration = {
# system.nixos.tags = [ "gpupower" ];
# hardware.nvidia = {
# prime.offload.enable = lib.mkForce false;
# prime.offload.enableOffloadCmd = lib.mkForce false;
# prime.sync.enable = lib.mkForce true;
# powerManagement.finegrained = lib.mkForce false;
# };
# };
# };
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"
'';
security.polkit.enable = true;
security.rtkit.enable = true;
services.xserver.videoDrivers = [ "nvidia" "modesetting" ];
networking = {
hostName = "eddie";
domain = "local";
nameservers = [ "1.1.1.1" "1.0.0.1" ];
networkmanager = {
enable = true;
wifi.powersave = true;
};
};
services.resolved = {
enable = true;
extraConfig = ''
LLMNR=no
ReadEtcHosts=no
DNSSEC=no
'';
};
# Set your time zone.
time.timeZone = "America/Toronto";
# Select internationalisation properties.
i18n.defaultLocale = "en_CA.UTF-8";
services.xserver.enable = true;
# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
services.xserver.desktopManager.gnome.enable = true;
services.xserver.deviceSection = ''Option "TearFree" "true"''; # For amdgpu.
# services.xserver.enableTearFree = true;
services.gnome.gnome-keyring.enable = true;
services.gnome.gnome-settings-daemon.enable = true;
services.picom = {
enable = true;
vSync = true;
};
programs.niri.enable = true;
# programs.waybar.enable = true;
programs.nh = {
enable = true;
clean = {
enable = true;
dates = "daily";
extraArgs = "--keep-since 4d --keep 3";
};
flake = "/home/emenel/source/nixos-config";
package = pkgs.unstable.nh;
};
programs.dconf.enable = true;
programs.gpaste.enable = true;
programs.xwayland.enable = true;
services.xserver.xkb = {
layout = "us";
variant = "";
};
services.printing = {
enable = true;
drivers = [
pkgs.epson-escpr
pkgs.epson-escpr2
];
};
services.tailscale.enable = true;
services.envfs.enable = true;
services.gnome.sushi.enable = true;
xdg.portal = {
enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gnome
pkgs.xdg-desktop-portal-gtk
pkgs.xdg-desktop-portal
];
};
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa = {
enable = true;
support32Bit = true;
};
pulse.enable = true;
jack.enable = true;
wireplumber = {
enable = true;
};
extraConfig = {
pipewire."91-null-sinks" = {
"context.modules" = [
{
name = "libpipewire-module-loopback";
args = {
"node.description" = "Default Playback";
"capture.props" = {
"node.name" = "BixSix_or_fallback_Playback";
"media.class" = "Audio/Sink";
"audio.position" = "[FL FR]";
};
"playback.props" = {
"node.name" = "playback.BixSixWithFallbackPlayback";
"audio.position" = "[AUX14 AUX15]";
"target.object" = "alsa_output.usb-Solid_State_Logic_BiG_SiX-00.pro-output-0";
"stream.dont-remix" = true;
"node.passive" = true;
};
};
}
];
};
pipewire."92-low-latency" = {
context.properties = {
default.clock.rate = 48000;
default.clock.quantum = 32;
default.clock.min-quantum = 32;
default.clock.max-quantum = 32;
};
};
pipewire-pulse."92-low-latency" = {
context.modules = [
{
name = "libpipewire-module-protocol-pulse";
args = {
pulse.min.req = "32/48000";
pulse.default.req = "32/48000";
pulse.max.req = "32/48000";
pulse.min.quantum = "32/48000";
pulse.max.quantum = "32/48000";
};
}
];
stream.properties = {
node.latency = "32/48000";
resample.quality = 1;
};
};
};
};
programs.steam = {
enable = true;
protontricks.enable = true;
extraCompatPackages = [ pkgs.proton-ge-bin ];
};
# enable fish and launch it from bash for interactive shells
programs.fish.enable = true;
environment.pathsToLink = [ "/share/fish" ];
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;
services.dbus.implementation = "broker";
#programs.gnupg.enable = true;
programs.git.enable = true;
services.gnome.core-developer-tools.enable = true;
environment.gnome.excludePackages = with pkgs; [
cheese
geary
gnome-music
gnome-tour
];
services.accounts-daemon.enable = true;
services.gnome.gnome-online-accounts.enable = true;
services.kmonad = {
enable = true;
keyboards = {
sinc = {
device = "/dev/input/by-id/usb-Keebio_Sinc_Rev._4-event-kbd";
config = builtins.readFile ../../dotfiles/dot_config/kmonad/sinc.kbd;
};
razer = {
extraGroups = [ "openrazer" ];
device = "/dev/input/by-id/usb-Razer_Razer_Blade-if01-event-kbd";
config = builtins.readFile ../../dotfiles/dot_config/kmonad/razer.kbd;
};
};
};
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;
programs.appimage = {
enable = true;
binfmt = true;
package = pkgs.appimage-run.override {
extraPkgs = pkgs: [ pkgs.libxcrypt.out ];
};
};
programs.nix-ld.enable = true;
programs.nix-ld.libraries = with pkgs; [
zlib
zstd
stdenv.cc.cc
curlFull
openssl.out
attr
libssh
libxcrypt.out
bzip2
libxml2
acl
libsodium
util-linux
xz
systemd
fontconfig
freetype
gnutls
util-linux
libGL.dev
psutils
egl-wayland
eglexternalplatform
glfw-wayland
glfw
libGLU.dev
libuv.out
libressl.out
libudev-zero.out
];
services.udev.packages = with pkgs; [
via
vial
];
fonts.fontconfig = {
enable = true;
useEmbeddedBitmaps = true;
};
powerManagement = {
enable = true;
};
services.power-profiles-daemon.enable = true;
# enable the OpenSSH daemon.
services.openssh.enable = true;
services.avahi = {
enable = true;
nssmdns4 = true;
};
# add user accounts
users.users.emenel = {
isNormalUser = true;
description = "emenel";
extraGroups = [ "networkmanager" "wheel" "uinput" "uucp" "dialout" "input" "audio" "video" "libvirtd" "nvidia" "cups" "openrazer" "plugdev" ];
packages = with pkgs; [
git
];
};
#do not change
system.stateVersion = "24.05";
}