nix/system/quiver.nix
2023-04-10 18:37:28 +10:00

189 lines
4.8 KiB
Nix
Executable file
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.

{ config, lib, pkgs, modulesPath, ... }:
let
flake-compat = builtins.fetchTarball "https://github.com/edolstra/flake-compat/archive/master.tar.gz";
hyprland = (import flake-compat {
src = builtins.fetchTarball "https://github.com/hyprwm/Hyprland/archive/master.tar.gz";
}).defaultNix;
in {
nixpkgs.overlays = [
(self: super: {
system76-scheduler = pkgs.callPackage ./syspkgs/system76-scheduler.nix {};
kwin-system76-scheduler-integration = pkgs.libsForQt5.callPackage ./syspkgs/kwin-system76-scheduler-integration.nix {};
})
];
nix.settings = {
substituters = [ "https://hyprland.cachix.org" ];
trusted-public-keys = ["hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="];
};
imports =
[ hyprland.nixosModules.default ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbcore" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" "i2c-dev" ];
boot.extraModulePackages = [ ];
boot.kernelParams = [ "nvidia_drm.modeset=1" "mitigations=off" "acpi_enforce_resources=lax" "preempt=full" ];
boot.loader.efi.canTouchEfiVariables = true;
# boot.plymouth.enable = true;
boot.supportedFilesystems = [ "ntfs" ];
security.tpm2.enable = true;
networking.useDHCP = lib.mkDefault true;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
environment.sessionVariables = rec {
WLR_NO_HARDWARE_CURSORS = "1";
GBM_BACKEND = "nvidia-drm";
NVD_BACKEND = "direct";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
LIBVA_DRIVER_NAME = "nvidia";
__GL_GSYNC_ALLOWED = "1";
__GL_VRR_ALLOWED = "1";
EDITOR = "hx";
};
virtualisation = {
podman = {
enable = true;
dockerCompat = true;
defaultNetwork.settings.dns_enabled = true;
};
};
services.minidlna = {
enable = true;
settings = {
notify_interval = 120;
friendly_name = "PC";
media_dir = [ "A,/data/Music/Slsk" ];
};
};
# programs.hyprland = {
# enable = true;
# xwayland = {
# enable = true;
# hidpi = false;
# };
# nvidiaPatches = true;
# };
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
hardware.nvidia.modesetting.enable = true;
hardware.nvidia.powerManagement.enable = true;
programs.xwayland.enable = true;
systemd.services.no-rgb = {
wantedBy = [ "multi-user.target" ];
description = "rgb led turn-off-er";
serviceConfig = {
Type = "oneshot";
ExecStart = ''${pkgs.openrgb}/bin/openrgb -d "HyperX Fury RGB" -m static -c 000000'';
};
};
systemd.services."com.system76.Scheduler" = {
wantedBy = [ "multi-user.target" ];
description = "the system76 process scheduler";
serviceConfig = {
Type = "dbus";
ExecStart = ''${pkgs.system76-scheduler}/bin/system76-scheduler daemon'';
ExecReload = ''${pkgs.system76-scheduler}/bin/system76-scheduler daemon reload'';
BusName = "com.system76.Scheduler";
};
};
services.dbus.packages = [
pkgs.kwin-system76-scheduler-integration
pkgs.system76-scheduler
];
systemd.packages = [
pkgs.kwin-system76-scheduler-integration
pkgs.system76-scheduler
];
environment.etc = {
"system76-scheduler".source = "${pkgs.system76-scheduler}/etc/system76-scheduler";
};
services.hardware.openrgb = {
enable = true;
motherboard = "amd";
};
hardware.ckb-next.enable = true;
xdg.portal = {
enable = true;
wlr = {
enable = true;
# settings = {
# screencast = {
# output_name = "DP-1";
# max_fps = 60;
# chooser_type = "simple";
# chooser_nvidia = "${pkgs.slurp}/bin/slurp -f %o -or";
# };
# };
};
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
];
};
environment.systemPackages = with pkgs;
[
ckb-next
openrgb
wl-clipboard
wl-clipboard-x11
xclip
system76-scheduler
kwin-system76-scheduler-integration
];
networking.hostName = "quiver"; # Define your hostname.
users.users.bolt = {
isNormalUser = true;
extraGroups = [ "wheel" ]; # Enable sudo for the user.
};
fileSystems."/" =
{ device = "/dev/disk/by-uuid/d227445f-6120-4768-8e1b-011f097505c1";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/6B75-AF9F";
fsType = "vfat";
};
fileSystems."/data" = {
device = "/dev/disk/by-uuid/39D4F78C658E8B56";
fsType = "ntfs";
options = [ "rw" "uid=1000" "gid=100" ];
};
# swapDevices = [ {
# device = "/dev/disk/by-uuid/7fde28ec-80f9-4228-8597-c3a57bfbf619";
# size = 4096;
# }
# ];
networking.firewall = {
allowedUDPPorts = [ 1900 ];
allowedTCPPorts = [ 8200 2234 ];
};
}