tweaking and tidying

This commit is contained in:
serenity-F 2026-04-21 23:51:45 +10:00
parent b9e4db2a38
commit 260910529d
No known key found for this signature in database
10 changed files with 225 additions and 357 deletions

View file

@ -3,29 +3,28 @@
## https://github.com/musnix/musnix
## https://nixos.wiki/wiki/Audio_production
{ pkgs, user, ... }:
{ user, ... }:
{
users.users.${user}.extraGroups = [ "audio" ];
## SHOULD BE ELSEWHERE - temporary testing declarations
environment.systemPackages = with pkgs; [
helm
vital
];
# Permissions & Security
security.rtkit.enable = true;
users.users.${user}.extraGroups = [ "audio" ]; # adds user to audio group
services.udev = { # needed for security
extraRules = ''
KERNEL=="rtc0", GROUP="audio"
KERNEL=="hpet", GROUP="audio"
'';
};
# Available kernel modules
boot = {
kernelModules = [ "snd-seq" "snd-rawmidi" ];
kernelParams = [ "preempt=full" ];
};
## Can't remember what this does,
## recommended to be enabled though
security = {
rtkit.enable = true;
# realtime audio priority (initially for JACK2)
pam.loginLimits = [
security.pam.loginLimits = [
{
domain = "@audio";
item = "memlock";
@ -51,14 +50,6 @@
value = "99999";
}
];
};
services.udev = {
extraRules = ''
KERNEL=="rtc0", GROUP="audio"
KERNEL=="hpet", GROUP="audio"
'';
};
# Musnix for audio production
musnix = {
@ -70,23 +61,19 @@
# Pipewire baybee
services = {
# Not using pulse directly
pulseaudio = { enable = false; };
pulseaudio = { enable = false; }; # not directly using pulse
pipewire = {
enable = true;
jack.enable = true;
pulse.enable = true;
wireplumber.enable = true;
enable = true; # enables pipewire
alsa = {
enable = true;
support32Bit = true;
enable = true; # enables alsa through pipewire
support32Bit = true; # enables 32bit application support
};
# Low latency config
jack.enable = true; # enables jack through pipewire
pulse.enable = true; # enables pulse through pipewire
wireplumber.enable = true; # enables wireplumber
extraConfig = {
pipewire."92-low-latency" = {
# Low latency optimisations
pipewire."92-low-latency" = { # for pipewire
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.allowed-rates" = [ 44100 48000 96000 192000 ];
@ -95,7 +82,7 @@
"default.clock.max-quantum" = 384;
};
};
pipewire-pulse."92-low-latency" = {
pipewire-pulse."92-low-latency" = { # for pulseaudio
stream.properties = {
node.latency = "256/48000";
resample.quality = 1;
@ -113,12 +100,10 @@
pulse.max.quantum = "384/48000";
};
}];
};
};
};
};
};
};
}

17
core/bufferBuff.nix Normal file
View file

@ -0,0 +1,17 @@
{ ... }:
{
# Increased download buffer as it caused issues previously
nix.settings.download-buffer-size = [ "268435456" ];
# Temporarily increasing max open files for my bloated flake
systemd.settings.Manager = { DefaultLimitNOFILE = "8192:524288"; };
sercurity.pam.loginLimits = [{
domain = "*";
type = "soft";
item = "nofile";
value = "8192";
}];
}

View file

@ -1,50 +1,35 @@
{ inputs, lib, pkgs, user, ... }:
{ inputs, pkgs, user, ... }:
{
imports = [
# Not sure we need the home-manager import here
inputs.home-manager.nixosModules.home-manager
# Semi-modularised config
../home # user-level/additional packages
# Shared modules to import
./audio.nix # musnix and audio options
./display.nix # base display and output options
./regreet.nix # login manager
./packages.nix # core/essential packages
];
# Make sure this is set !
system = { stateVersion = "24.11"; };
# Core security options
security = {
sudo.execWheelOnly = true; # sets sudo auth to @wheel only
polkit = { # enables system polkit ???
enable = true;
polkit.enable = true; # enables system polkit ???
};
## Temporarily ncreasing max open files
## needed for my huge ass bloaty flake
pam.loginLimits = [{
domain = "*";
type = "soft";
item = "nofile";
value = "8192";
}];
};
systemd.settings.Manager = { DefaultLimitNOFILE = "8192:524288"; };
# Settings for the nix package manager and daemon
nix = {
settings = {
cores = 6; # sets nix to use most available cores during rebuild
cores = 12; # sets nix to use most available cores during rebuild
max-jobs = "auto"; # automatically determines max job count
allow-dirty = false; # refuses to allow rebuilds when git tree is dirty
auto-optimise-store = true; # automatically optimised nix store on rebuild
download-buffer-size = [ # increased download buffer as it caused issues previously
"268435456"
];
allowed-users = [ "@wheel" ]; # restricts `nix` command to @wheel
trusted-users = [ # adds root, @wheel, and ${primaryUser} to trusted users
"root"
@ -72,11 +57,11 @@
enableAllHardware = true; # enables all hardware modules
enableAllFirmware = true; # enables all firmware modules
#enableRedistributableFirmware = true; # enables redistributables
usbStorage.manageShutdown = true; # graceful usb storage shutdown
sensor.hddtemp = {
enable = true; # enables temperature readings for mechanical drives
drives = [ "/dev/disk/by-uuid/*" ]; # tries to find drives with sensors by uuid
};
usbStorage.manageShutdown = true; # graceful usb storage shutdown
};
# Manual pages and caching
@ -103,7 +88,4 @@
};
};
# Make sure this is set !
system = { stateVersion = "24.11"; };
}

View file

@ -1,4 +1,4 @@
{ inputs, pkgs, label, lib, niri, ... }:
{ pkgs, label, lib, ... }:
let
@ -116,11 +116,11 @@ in
};
};
## Utter junk from here on out, pls fix
## - - - - - - - - - - - - - - - - - - -
# Utter junk from here on out, pls fix
# - - - - - - - - - - - - - - - - - - -
## I put fonts here because i didn't know where tf else to put them lol
## duplicate to home-manager config ?
# I put fonts here because i didn't know where tf else to put them lol
# duplicate to home-manager config ?
fonts = {
packages = with pkgs;
[ spleen terminus_font terminus_font_ttf nerd-fonts.symbols-only ]
@ -136,27 +136,18 @@ in
};
};
## Dunno if i did this right, but possible needed for keyring/polkit stuff ?
#Dunno if i did this right, but possible needed for keyring/polkit stuff ?
security.pam.services.serenity.enableGnomeKeyring = true;
## Move this
# Move this
programs = {
gnome-disks.enable = true; # For when bimbo needs to manage disks
seahorse.enable = true; # GTK secrets management
droidcam.enable = true; # Use android device as a webcam
obs-studio = { # screen capture, recording, and sharing
enable = true;
enableVirtualCamera = true; # virtual webcam
plugins = with pkgs.obs-studio-plugins; [
#droidcam-obs # enables droidcam integration
];
};
};
## Move these
# Move these
services = {
libinput.enable = true; # don't think we NEED this tbh - unsure
#gvfs.enable = true; # virtual filesystem, needed this for ... something
dbus.enable = true; # dbus is for ... unsure
upower.enable = true; # no clue
udisks2.enable = true; # disk management service

View file

@ -2,6 +2,34 @@
{
environment = {
# These are important apparently :uh:
sessionVariables = {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_BIN_HOME = "$HOME/.local/bin";
XDG_DATA_HOME = "$HOME/.local/share";
# Steam needs this to find Proton-GE
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d";
# Note: this doesn't replace PATH, it just adds this to it
PATH = [ "\${XDG_BIN_HOME}" ];
NIXOS_OZONE_WL = "1";
SDL_VIDEODRIVER = "x11,wayland,windows";
};
# Games and misc.
systemPackages = with pkgs; [
piper # Open mouse config
vassal # FOSSy board game sim
cockatrice # Magical the gathering, but free
prismlauncher # Modded Minecraft client
osu-lazer-bin # Rhythm is just a click away!
inputs.nix-gaming.packages.${pkgs.system}.osu-mime
#inputs.nix-gaming.packages.${pkgs.system}.osu-lazer-bin
];
};
# Adding primary user to gamemode group
users.users.${user}.extraGroups = [ "gamemode" ];
# Gaming mouse config
@ -18,54 +46,40 @@
];
};
environment = {
# Games and misc.
systemPackages = with pkgs; [
piper # Open mouse config
vassal # FOSSy board game sim
cockatrice # Magical the gathering, but free
prismlauncher # Modded Minecraft client
osu-lazer-bin # Rhythm is just a click away!
inputs.nix-gaming.packages.${pkgs.system}.osu-mime
#inputs.nix-gaming.packages.${pkgs.system}.osu-lazer-bin
];
# These are important apparently :uh:
sessionVariables = {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_BIN_HOME = "$HOME/.local/bin";
XDG_DATA_HOME = "$HOME/.local/share";
# Steam needs this to find Proton-GE
STEAM_EXTRA_COMPAT_TOOLS_PATHS = "\${HOME}/.steam/root/compatibilitytools.d";
# Note: this doesn't replace PATH, it just adds this to it
PATH = [ "\${XDG_BIN_HOME}" ];
NIXOS_OZONE_WL = "1";
SDL_VIDEODRIVER = "x11,wayland,windows";
};
};
## TIDY BELOW ##
programs = {
# Java, just in case i guess ?
java.enable = true;
# This should help games run more betterer
java.enable = true; # just in case
gamescope = {
enable = true;
capSysNice = true;
enable = true; # compositor for games
capSysNice = true; # should make games run better
};
# Steam
steam = {
enable = true; # enables steam itself
protontricks.enable = true; # enables protontricks
gamescopeSession.enable = true; # compositor for games
extraCompatPackages = with pkgs; [ proton-ge-bin ]; # glorious eggroll
package = pkgs.steam.override { # no clue lol
extraLibraries = pkgs: [ pkgs.xorg.libxcb ]; # what
extraPkgs = pkgs: with pkgs; [ # absolutely clueless lol
libpng
libpulseaudio
libvorbis
stdenv.cc.cc.lib
libkrb5
keyutils
gamemode
] ++ (with pkgs.xorg; [ libXi libXcursor libXinerama libXScrnSaver ]);
};
};
# "GameMode" - https://nixos.wiki/wiki/Gamemode
# (config copy-pasted from mynixos)
gamemode = {
enable = false;
settings = {
general = {
renice = 10;
};
## Warning: GPU optimisations have the potential to damage hardware
general.renice = 10;
# Warning: GPU optimisations have the potential to damage hardware
gpu = {
apply_gpu_optimisations = "accept-responsibility";
gpu_device = 0;
@ -78,33 +92,6 @@
};
};
# Steam itself
steam = {
# Enables steam itself
enable = true;
# Enables protontricks
protontricks.enable = true;
# This should help games run more betterer
gamescopeSession.enable = true;
## No clue what this is doing
#package = pkgs.steam.override {
#extraLibraries = pkgs: [ pkgs.xorg.libxcb ];
## No clue what this shit does
#extraPkgs = pkgs:
#with pkgs; [
#libpng
#libpulseaudio
#libvorbis
#stdenv.cc.cc.lib
#libkrb5
#keyutils
#gamemode
#] ++ (with pkgs.xorg; [ libXi libXcursor libXinerama libXScrnSaver ]);
#};
#extraPackages = with pkgs; [ ];
# Gotta have the glorious eggroll
extraCompatPackages = with pkgs; [ proton-ge-bin ];
};
};
}

View file

@ -1,8 +1,8 @@
{ pkgs, user, ... }:
{
imports = [
imports = [
# Host-specific config files
./network.nix
./hardware.nix
@ -15,115 +15,75 @@
../../../core/virtualisation.nix
];
# ooh, hostname - this one's important!
# Name of this computer ?
networking.hostName = "hades";
## ## ## ## ##
# Boot options
boot = {
kernelPackages =
pkgs.linuxPackages_latest; # use the latest compatible linux kernel
supportedFilesystems =
[ "vfat" "ext4" ]; # adds fat32 and ext3 filesystems to defaults
# Linux kernel version selection
kernelPackages = pkgs.linuxPackages_latest; # latest compatible
# Bootloader settings
loader = {
efi.canTouchEfiVariables = true;
systemd-boot = {
enable = true;
systemd-boot.enable = true; # better than grub
efi.canTouchEfiVariables = true; # needed for stuff:tm:
};
# Filesystem support at boot
supportedFilesystems = [
"vfat" # fat32
"ext4" # ext4
#"ntfs" # windows lol
];
# Decryption via LUKS
initrd.luks = {
# Primary boot drive
devices."luks-55f7d546-fac9-4ea0-a21e-4c50ecc0d67d" = {
device = "/dev/disk/by-uuid/55f7d546-fac9-4ea0-a21e-4c50ecc0d67d";
};
initrd.luks.devices."luks-55f7d546-fac9-4ea0-a21e-4c50ecc0d67d".device = "/dev/disk/by-uuid/55f7d546-fac9-4ea0-a21e-4c50ecc0d67d";
# Uhhhhhhh
#Asphodel = { # secondary partition on Tartarus drive
# Secondary storage drive
#devices.Asphodel = { # secondary partition on Tartarus drive
#device = "/dev/disk/by-uuid/45f5f6ad-a676-4bc1-ad4b-e3e26b5697f4";
#preLVM =false;
#preLVM = false;
#};
#};
};
## ## ## ## ##
# Hades specific Razer peripherals
users.users.${user}.extraGroups = [ "openrazer" ];
hardware.openrazer = {
enable = true;
users = [ "${user}" ];
};
};
# Hardware
services.xserver.videoDrivers = [ "amdgpu" ]; # makes x use amd
hardware = {
# GPU and graphics
graphics = {
enable = true;
enable32Bit = true;
# Packages for the iGPU inside Hades
# - disabled for now:tm:
extraPackages = with pkgs;
[
#intel-compute-runtime
#intel-media-driver
#libvdpau-va-gl
#vaapiIntel
#vaapiVdpau
];
};
# Driver packages for the dGPU inside Hades
amdgpu = {
initrd.enable = true;
opencl.enable = true;
overdrive = {
enable = true;
#ppfeaturemask = "0xffffffff";
};
overdrive.enable = true; # overclocking lol
initrd.enable = true; # for video at boot
opencl.enable = true; # gpu tech idk lol
};
};
# Peripherals
hardware.openrazer = {
enable = true; # enables openrazer daemon
users = [ "${user}" ]; # giving primary user permissions (again)
};
users.users.${user} = { # giving primary user permissions (again)
extraGroups = [ "openrazer" ];
};
services = {
# Tells X to use amdgpu drivers
xserver.videoDrivers = [ "amdgpu" ];
# Openrgb background service
hardware.openrgb.enable = true;
# Peripheral input remapping
hardware.openrgb.enable = true; # rgb control
input-remapper = {
enable = true;
enable = true; # needed to remap some stuff
enableUdevRules = true; # hotplug support
};
};
programs = {
# For tweaking system performance
#corectrl = {
#enable = true;
# Allows tweaking GPU performance
#gpuOverclock = {
#enable = true;
# Needed for radeon GPU overclocking
#ppfeaturemask = "0xfffd7fff";
#};
#};
# Performance tweaking continued
#tuxclocker = {
#enable = true;
#enableAMD = true;
#useUnfree = true;
#};
};
# Some packages for managing the hardware inside Hades
# Packages
environment.systemPackages = with pkgs; [
# GPU firmware and control
#umr # tweaking
lact # tweaking
# Hardware & Firmware
radeontop # monitoring
#amdgpu_top # monitoring
#radeontools # tweaking
#radeon-profile # tweaking
nvtopPackages.amd # monitoring
# peripherals & Input
@ -131,12 +91,7 @@
razergenie # Razer frontend
openrazer-daemon # Razer daemon
openrgb-with-all-plugins # RGB control
];
# Systemd services for lact
systemd = {
packages = with pkgs; [ lact ];
services.lactd.wantedBy = [ "multi-user.target" ];
};
}

View file

@ -1,9 +1,7 @@
{ inputs, outputs, pkgs, flakePath, niri, tidalcycles, ... }:
{ pkgs, flakePath, niri, ... }:
{
imports = [ ];
# Activation Scripts - runs after using `sudo nixos-rebuild switch`
system.activationScripts.diff = {
supportsDryActivation = true;
@ -16,109 +14,71 @@
'';
};
## Nixpkgs Settings
# Nixpkgs Settings
nixpkgs = {
config = {
# Not doing full-FOSS lol
allowUnfree = true;
allowBroken = true;
# Place insecure packages here
#permittedInsecurePackages = [
#"olm-3.2.16"
#];
# Place package overrides here
#packageOverrides = pkgs: {
allowUnfree = true; # not doing full foss lol
allowBroken = true; # I like 'em broken
permittedInsecurePackages = [ ]; # insert obvious joke here
#packageOverrides = pkgs: { # package overrides here
#sygil-plymouth = pkgs.callPackage /home/serenity/repos/sygil-plymouth/package.nix { };
#};
};
# Place package overlays here
overlays = [
niri.overlays.niri
#inputs.tidalcycles.overlays.default
#inputs.mac-style-plymouth.overlays.default
#inputs.sygil-plymouth.overlays.default
#inputs.sygil-plymouth-clean.overlays.default
## to use overlays exported from other flakes:
#neovim-nightly-overlay.overlays.default
## or define it inline, for example:
#(final: prev: {
#hi = final.hello.overrideAttrs (oldAttrs: {
#patches = [ ./change-hello-to-hi.patch ];
#});
#})
# Enabled overlays
niri.overlays.nixos-rebuild # latest niri
# Disabled overlays
#inputs.tidalcycles.overlays.default # programmatic music
#inputs.mac-style-plymouth.overlays.default # for theme
#inputs.sygil-plymouth.overlays.default # indev theme
];
};
## Nix settings for package related stuff
nix = {
settings = {
substituters = [ # for pkgs not in or out of date in nixpkgs
"https://cache.iog.io"
];
trusted-public-keys = [
trusted-public-keys = [ # keys to sign the packages
"hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ="
];
};
};
## System-level Programs
# System-level Programs
programs = {
# Core terminal suite
git = { enable = true; }; # Mandatory version control
fish = { enable = true; }; # A catgirls favourite shell
neovim = { enable = true; }; # Neovim declared here too, just in case
# NixOS CLI helper
nh = {
enable = true;
enable = true; # nixos cli helper
flake = "${flakePath}"; # Declared in flake.nix
};
# For handling encryption keys
gnupg.agent = {
enable = true;
enableSSHSupport = true;
enable = true; # handles encryption keys
enableSSHSupport = true; # ssh good, lol
#pinentryPackage = [ ];
};
# For running unpackaged binaries
nix-ld = {
enable = true;
enable = true; # runs unpackaged binaries
#libraries = with pkgs; [ ];
};
# To run "normal" linux applications seamlessly
appimage = {
enable = true;
enable = true; # runs "normal" linux applications
binfmt = true;
};
};
# Flatpak, just in case
services.flatpak.enable = true;
services.flatpak.enable = true; # flatpak just in case
environment = {
# Environment Variables
variables = { # sets neovim to default editor in other apps
EDITOR = "nvim";
VISUAL = "nvim";
SYSTEMD_EDITOR = "nvim";
};
# Install a stub ELF loader to print an informative
# error message in the event that a user attempts
# to run an ELF binary not compiled for NixOS.
stub-ld.enable = true;
## System-level Packages
# System-level Packages
systemPackages = with pkgs; [
# Nix specific tools
#cabal2nix
nix-tree # Dependency tree viewer for nix store
@ -126,13 +86,11 @@
nix-index # Database for nixpkgs
nix-prefetch # provides info on a url
nix-output-monitor # Shows extra information on nix commands
# Filsesystem utilities
ddrutility # Set of tools for HDD rescure
exfatprogs # ExFAT filesystem
btrfs-progs # BTRFS filesystem
ntfs3g # NTFS filesystem
# CLI tools & utilities
fd # Find, but faster
bc # Calculator
@ -163,6 +121,10 @@
smartmontools # Tools for monitoring HDD health
magic-wormhole # Direct file sharing
];
# Install a stub ELF loader to print an informative
# error message in the event that a user attempts
# to run an ELF binary not compiled for NixOS.
stub-ld.enable = true;
};
}

View file

@ -29,8 +29,6 @@ in {
#phodav # for vm fileshare
];
virtualisation = {
#cores = 4; # fine for now
#graphics = true; # run qemu in gui or no gui mode
spiceUSBRedirection.enable = true; # for USB passthrough
libvirtd = {
enable = true;
@ -40,13 +38,6 @@ in {
runAsRoot = true; # for `passthrough` security on fileshare
};
};
#sharedDirectories = { # list of directories to share to VMs
#Public = { # ~/Public
#securityModel = "passthrough";
#source = "${sharePublicSourceDirectory}";
#target = "${sharePublicTargetDirectory}";
#};
#};
};
}

View file

@ -3,8 +3,8 @@
let
## Black magic wizardry from https://wiki.nixos.org/wiki/ZFS
## - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Black magic wizardry from https://wiki.nixos.org/wiki/ZFS
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
zfsCompatibleKernelPackages = lib.filterAttrs (name: kernelPackages:
(builtins.match "linux_[0-9]+_[0-9]+" name) != null
&& (builtins.tryEval kernelPackages).success
@ -13,7 +13,7 @@ let
latestKernelPackage = lib.last
(lib.sort (a: b: (lib.versionOlder a.kernel.version b.kernel.version))
(builtins.attrValues zfsCompatibleKernelPackages));
## - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
in {
@ -27,7 +27,6 @@ in {
#forceImportRoot = false;
};
};
environment.systemPackages = with pkgs; [ zfs ];
networking = { hostId = "603b0c8b"; }; # Unsure why this is here actually ?
services = {

View file

@ -14,30 +14,29 @@ in {
imports = [ ];
## Primary user configuration -
## to create additional users, copy all options
## below to a new file akin to `u-username.nix`,
## or `u-username/default.nix` with more modules,
## making sure to replace all instances of
## `${primaryUser}` with the new username.
# Primary user configuration -
# to create additional users, copy all options
# below to a new file akin to `u-username.nix`,
# or `u-username/default.nix` with more modules,
# making sure to replace all instances of
# `${primaryUser}` with the new username.
## Needed for sops-nix to handle loginPassword
# Needed for sops-nix to handle loginPassword
#sops.secrets.loginPassword.neededForUsers = true;
#users.mutableUsers = false;
## System-level user declarations
# System-level user declarations
users.users = {
${user} = {
description = "${userDescription}";
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
#hashedPasswordFile = config.sops.secrets.loginPassword.path;
## A catgirl's favourite shell
shell = pkgs.fish;
shell = pkgs.fish; # catgirls favourite shell
};
};
## home-manager configuration
# home-manager configuration
home-manager = {
verbose = true; # enables verbose output on activation
extraSpecialArgs = { # passes in specialArgs from flake.nix
@ -52,12 +51,12 @@ in {
users = {
${user} = {
imports = [
## Home configuration -
## currently all users share the same home
## configuration, though each has separate
## home directories. Additional modules
## can be declared alongside `u-username/default.nix`
## and then imported in this section.
# Home configuration -
# currently all users share the same home
# configuration, though each has separate
# home directories. Additional modules
# can be declared alongside `u-username/default.nix`
# and then imported in this section.
#./resources/theme
./desktop
./terminal