diff --git a/default.nix b/default.nix index 81930bf..903ac9d 100755 --- a/default.nix +++ b/default.nix @@ -36,6 +36,8 @@ in { useXkbConfig = mkDefault true; }; + services.earlyoom.enable = true; + services.automatic-timezoned.enable = mkDefault true; time.timeZone = mkDefault null; # handled by automatic-timezoned diff --git a/hosts/flubber-machine/default.nix b/hosts/flubber-machine/default.nix new file mode 100755 index 0000000..e7764b9 --- /dev/null +++ b/hosts/flubber-machine/default.nix @@ -0,0 +1,113 @@ +{ config, lib, pkgs, ... }: + +{ + imports = [ + ./hardware.nix + ]; + + hm.home.packages = with pkgs; [ + # archives + zip xz unrar unzip p7zip zstd lrzip + # utils + ffmpeg ripgrep ripgrep-all jq libqalculate imagemagick pandoc + # dev + sqlitebrowser sqlite-analyzer + # nix + nix-output-monitor nix-prefetch-scripts nix-top + # system + btop duf lm_sensors ethtool pciutils usbutils powertop killall + # debug + strace ltrace lsof helvum + # apps + firefox qalculate-gtk krita inkscape onlyoffice-desktopeditors vlc nicotine-plus transmission_4-gtk font-manager obs-studio imhex pwvucontrol nautilus gnome-disk-utility gnome-text-editor baobab file-roller gnome-system-monitor loupe gnome-weather kdePackages.kdenlive video-trimmer blanket + # compatibility + wineWowPackages.waylandFull winetricks + # misc + bat file which packwiz yt-dlp fastfetch hyfetch trashy wev + # games + prismlauncher + ] ++ (with pkgs.my; [ + # none yet + ]); + + boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; + + modules = { + security.useDoas = true; + + hardware = { + bluetooth.enable = true; + pipewire.enable = true; + print.enable = true; + pointer.enable = true; + tablet.enable = true; + networking.enable = true; + }; + dev = { + enable = true; + }; + desktop = { + # set to `x11` or `wayland`, improves compat + envProto = "wayland"; + + # window manager / desktop environment + niri.enable = true; + + # accessories + hyprlock.enable = true; + hypridle.enable = true; + hypridle.desktop = true; + swww.enable = true; + gnome-keyring.enable = true; + mate-polkit.enable = true; + dunst.enable = true; + rofi.enable = true; + waybar.enable = true; + batsignal.enable = true; + wob.enable = true; + gammastep.enable = true; + # fuzzel.enable = true; + # cliphist.enable = true; + wl-clip-persist.enable = true; + vicinae.enable = true; + + # display manager + regreet.enable = true; + + # theme, see `modules/desktop/themes` + themes.active = "catppuccin"; + + # monitors, see `modules/desktop/monitors` + monitors.enable = true; + monitors.monitors = [ + { name = "DP-2"; scale = 1.0; } + { name = "DP-3"; scale = 2.0; vrr = true; } + ]; + }; + software = { + # system + system.eza.enable = true; + system.wezterm.enable = true; + system.fish.enable = true; + system.syncthing.enable = true; + system.flatpak.enable = true; + system.mpv.enable = true; + system.ananicy.enable = true; + system.kdeconnect.enable = true; + # editors + editors.micro.enable = true; + editors.vscode.enable = true; + # dev + dev.git.enable = true; + # distractions + distractions.discord.enable = true; + distractions.discord.vesktop = true; + distractions.steam.enable = true; + distractions.steam.useGamescope = true; + # tools + tools.gpg.enable = true; + tools.rbw.enable = true; + tools.noisetorch.enable = true; + }; + }; +} diff --git a/hosts/flubber-machine/hardware.nix b/hosts/flubber-machine/hardware.nix new file mode 100755 index 0000000..929b5ec --- /dev/null +++ b/hosts/flubber-machine/hardware.nix @@ -0,0 +1,49 @@ +{ inputs, config, lib, pkgs, modulesPath, ... }: + +{ + imports = + [ + inputs.hardware.nixosModules.common-cpu-amd + inputs.hardware.nixosModules.common-gpu-amd + inputs.hardware.nixosModules.common-pc-ssd + inputs.hardware.nixosModules.common-pc + + (modulesPath + "/installer/scan/not-detected.nix") + + ./omen-30l-gt13-1xxx.nix + ]; + + boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" "amdgpu" ]; + boot.extraModulePackages = [ ]; + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/5da6bab0-856a-4e65-8ff6-5b70fe3764b8"; + fsType = "btrfs"; + options = [ "noatime" ]; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/AA0D-269D"; + fsType = "vfat"; + options = [ "fmask=0022" "dmask=0022" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/d937e754-ba63-4fc0-be78-60f456392373"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.end0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlan0.useDHCP = lib.mkDefault true; + + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/flubber-machine/meta.nix b/hosts/flubber-machine/meta.nix new file mode 100644 index 0000000..efab059 --- /dev/null +++ b/hosts/flubber-machine/meta.nix @@ -0,0 +1,3 @@ +{ + system = "x86_64-linux"; +} diff --git a/hosts/flubber-machine/omen-30l-gt13-1xxx.nix b/hosts/flubber-machine/omen-30l-gt13-1xxx.nix new file mode 100644 index 0000000..79193bf --- /dev/null +++ b/hosts/flubber-machine/omen-30l-gt13-1xxx.nix @@ -0,0 +1,19 @@ +{ pkgs, lib, ... }: +{ + # support power features such as suspend to ram + powerManagement.enable = true; + + environment.variables = { + AMD_VULKAN_ICD = "RADV"; + LIBVA_DRIVER_NAME= "radeonsi"; + VDPAU_DRIVER = "radeonsi"; + }; + + environment.systemPackages = with pkgs; [ amdgpu_top ]; + + # fix audio issues + # Is this even needed. I'm losing my mindddddd + # https://forums.linuxmint.com/viewtopic.php?t=445461 + # https://help.ubuntu.com/community/HdaIntelSoundHowto + boot.extraModprobeConfig = ''options snd_hda_intel model=generic''; +} diff --git a/hosts/goopnet-interface/default.nix b/hosts/goopnet-interface/default.nix index cdf6c99..08f3735 100755 --- a/hosts/goopnet-interface/default.nix +++ b/hosts/goopnet-interface/default.nix @@ -19,7 +19,7 @@ # debug strace ltrace lsof helvum # apps - firefox qalculate-gtk krita inkscape onlyoffice-desktopeditors vlc nicotine-plus transmission_4-gtk font-manager obs-studio imhex pwvucontrol nautilus gnome-disk-utility gnome-text-editor baobab file-roller gnome-system-monitor loupe gnome-weather kdePackages.kdenlive blanket + firefox qalculate-gtk krita inkscape onlyoffice-desktopeditors vlc nicotine-plus transmission_4-gtk font-manager obs-studio imhex pwvucontrol nautilus gnome-disk-utility gnome-text-editor baobab file-roller gnome-system-monitor loupe gnome-weather kdePackages.kdenlive video-trimmer blanket # compatibility wineWowPackages.waylandFull winetricks # misc @@ -38,7 +38,6 @@ pipewire.enable = true; print.enable = true; pointer.enable = true; - tablet.enable = true; networking.enable = true; }; dev = { @@ -59,12 +58,12 @@ mate-polkit.enable = true; dunst.enable = true; rofi.enable = true; - fuzzel.enable = true; waybar.enable = true; batsignal.enable = true; wob.enable = true; gammastep.enable = true; # cliphist.enable = true; + # fuzzel.enable = true; wl-clip-persist.enable = true; vicinae.enable = true; @@ -97,7 +96,7 @@ dev.git.enable = true; # distractions distractions.discord.enable = true; - distractions.discord.equibop = true; + distractions.discord.vesktop = true; distractions.steam.enable = true; distractions.steam.useGamescope = true; # tools diff --git a/hosts/goopnet-interface/hardware.nix b/hosts/goopnet-interface/hardware.nix index adff5be..a23ecfb 100755 --- a/hosts/goopnet-interface/hardware.nix +++ b/hosts/goopnet-interface/hardware.nix @@ -24,7 +24,7 @@ fileSystems."/" = { device = "/dev/disk/by-uuid/0f09afdc-88e4-4764-818b-77828931278f"; fsType = "ext4"; - options = [ "noatime" "nodiratime" "discard" ]; + options = [ "noatime" ]; }; fileSystems."/boot" = diff --git a/modules/desktop/monitors.nix b/modules/desktop/monitors.nix index 3e35a9f..5aea8af 100644 --- a/modules/desktop/monitors.nix +++ b/modules/desktop/monitors.nix @@ -12,6 +12,7 @@ in { a list of monitor configurations. each entry should be an attribute set with the following keys: - `name`: The name of the monitor to configure - `scale`: The scale factor to apply to the monitor + - `vrr`?: Whether or not the display supports variable refresh rate. Defaults to false note: the first monitor in the list will be considered the "primary" monitor ''; example = [ @@ -26,6 +27,7 @@ in { name = monitor.name; value = { scale = monitor.scale; + variable-refresh-rate = monitor.vrr or false; }; }) cfg.monitors); }; diff --git a/modules/fstrim.nix b/modules/hardware/fs/fstrim.nix similarity index 95% rename from modules/fstrim.nix rename to modules/hardware/fs/fstrim.nix index 5ddaebc..3d7212a 100644 --- a/modules/fstrim.nix +++ b/modules/hardware/fs/fstrim.nix @@ -22,7 +22,7 @@ with lib; interval = "weekly"; }; - # tweak fstim service to run only when on AC power + # tweak fstrim service to run only when on AC power # and to be nice to other processes # (this is a good idea for any service that runs periodically) systemd.services.fstrim = { diff --git a/modules/hardware/fs/lvm.nix b/modules/hardware/fs/lvm.nix new file mode 100644 index 0000000..5da4992 --- /dev/null +++ b/modules/hardware/fs/lvm.nix @@ -0,0 +1,7 @@ +{ config, lib, ... }: + +with lib; +{ + # i don't use lvm, can be disabled + services.lvm.enable = mkDefault false; +} diff --git a/modules/hardware/fs/scrub.nix b/modules/hardware/fs/scrub.nix new file mode 100644 index 0000000..0f2eaf3 --- /dev/null +++ b/modules/hardware/fs/scrub.nix @@ -0,0 +1,16 @@ +{ config, lib, ... }: + +with lib; +let + supportedFilesystems = builtins.map (builtins.getAttr "fsType") (builtins.attrValues config.fileSystems); + mkScrubConfig = fsType: { + enable = builtins.elem fsType supportedFilesystems; + interval = "weekly"; + }; +in { + services.btrfs.autoScrub = mkScrubConfig "btrfs"; + services.zfs.autoScrub = mkScrubConfig "zfs"; + + # bcachefs exists but it was "ejected from the kernel" for "repeated violations of kernel dev. guidelines" + # linus "tech tips" torvalds said himself "nobody sane uses bcachefs and expects it to be stable" (https://en.wikipedia.org/wiki/Bcachefs#Stability) +} diff --git a/modules/software/distractions/discord.nix b/modules/software/distractions/discord.nix index 255e14b..f7f3f11 100644 --- a/modules/software/distractions/discord.nix +++ b/modules/software/distractions/discord.nix @@ -8,24 +8,15 @@ let withVencord = true; }; finalPackage = - if cfg.equibop then pkgs.equibop else if cfg.vesktop then pkgs.vesktop else vanillaDiscordPackage; in { options.modules.software.distractions.discord = { enable = mkEnableOption "Enable Discord, a social messaging app"; vesktop = mkEnableOption "Use Vesktop, an alternative Electron client with Vencord preinstalled"; - equibop = mkEnableOption "Use Equibop, a fork of Vesktop with Equicord preinstalled"; }; config = mkIf cfg.enable { - assertions = [ - { - assertion = !(cfg.vesktop && cfg.equibop); - message = "You must either enable Vesktop or Equibop, not both"; - } - ]; - user.packages = [ finalPackage ];