feat: move stuff around a bit, created new modules.

This commit is contained in:
CronyAkatsuki 2026-01-25 19:46:53 +01:00
parent 12fadadc5c
commit 506525af35
12 changed files with 247 additions and 215 deletions

View file

@ -35,6 +35,8 @@
# Use the xanmod kernel
boot.kernelPackages = pkgs.cachyosKernels.linuxPackages-cachyos-latest-lto-x86_64-v3;
# Setup userspace schedulers
services.scx = {
enable = true;
scheduler = "scx_lavd";
@ -43,12 +45,6 @@
# Get nicer hostname
networking.hostName = "skadi"; # Define your hostname.
# Enable flakes
nix.settings.experimental-features = ["nix-command" "flakes"];
# Enable trusted users
nix.settings.trusted-users = ["root" "@wheel"];
# Setup gpu
hardware.graphics = {
enable = true;
@ -90,151 +86,8 @@
LC_TIME = "hr_HR.UTF-8";
};
# # Enable the X11 windowing system.
# services.xserver.enable = true;
#
# # Configure keymap in X11
# services.xserver.xkb = {
# layout = "us";
# variant = "";
# options = "caps:escape";
# };
# Enable seatd
services.seatd.enable = true;
# Enable flatpak
services.flatpak = {
enable = true;
packages = [
"com.dec05eba.gpu_screen_recorder"
];
uninstallUnmanaged = true;
update.auto = {
enable = true;
onCalendar = "weekly";
};
};
networking.firewall.allowedTCPPorts = [42000 42001];
# Enable coolercontrol to setup fancurves
programs.coolercontrol = {
enable = true;
};
# Setup gpu fan curves and light undervolt
services.lact.enable = true;
# Setup display brightness changing using ddcutil
hardware.i2c.enable = true;
# Setup rgb control
services.hardware.openrgb.enable = true;
# Needed modules to have fan control and ntsync
boot.kernelModules = ["coretemp" "nct6775" "ntsync"];
# Enable ratbagd to customize mouse options
services.ratbagd.enable = true;
# Enable dconf
programs.dconf.enable = true;
# Enable AAGL
# programs.anime-game-launcher.enable = true;
# Enable sleepy launcher
programs.sleepy-launcher.enable = true;
# Enable sound with pipewire.
security.rtkit.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
alsa = {
enable = true;
support32Bit = true;
};
wireplumber.extraConfig = {
"51-disable-suspension" = {
"monitor.alsa.rules" = [
{
matches = [
{
node.name = "~alsa_input.*";
}
{
node.name = "~alsa_output.*";
}
];
actions = {
update-props = {
"session.suspend-timeout-seconds" = 0;
};
};
}
];
"monitor.bluez.rules" = [
{
matches = [
{
node.name = "~alsa_input.*";
}
{
node.name = "~alsa_output.*";
}
];
actions = {
update-props = {
"session.suspend-timeout-seconds" = 0;
};
};
}
];
};
};
extraConfig = {
pipewire."99-silent.bell.conf" = {
"context.properties" = {
"modules.x11.bell" = false;
};
};
pipewire."92-low-latency" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.quantum" = 64;
"default.clock.min-quantum" = 64;
"default.clock.max-quantum" = 64;
};
};
pipewire-pulse."92-low-latency" = {
"context.properties" = [
{
name = "libpipewire-module-protocol-pulse";
args = {};
}
];
"pulse.properties" = {
"pulse.min.req" = "64/48000";
"pulse.default.req" = "64/48000";
"pulse.max.req" = "64/48000";
"pulse.min.quantum" = "64/48000";
"pulse.max.quantum" = "64/48000";
};
"stream.properties" = {
"node.latency" = "64/48000";
"resample.quality" = 1;
};
};
};
};
# Fix not saving my state
hardware.alsa.enablePersistence = true;
# Enable appimages
programs.appimage = {
enable = true;
@ -256,60 +109,6 @@
users.mutableUsers = false;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
# Setup community cache
nix.settings = {
substituters = [
"https://nix-community.cachix.org"
"https://hyprland.cachix.org"
"https://ezkea.cachix.org"
"https://nix-gaming.cachix.org"
"https://cache.nixos-cuda.org"
"https://deploy-rs.cachix.org"
"https://attic.xuyh0120.win/lantian"
];
trusted-substituters = [
"https://hyprland.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"ezkea.cachix.org-1:ioBmUbJTZIKsHmWWXPe1FSFbeVe+afhfgqgTSNd34eI="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
"cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M="
"deploy-rs.cachix.org-1:xfNobmiwF/vzvK1gpfediPwpdIP0rpDV2rYqx40zdSI="
"lantian:EeAUQ+W+6r7EtwnmYjeVwx5kOGEBpjlBfPlzGlTNvHc="
];
};
# setup custom packages
nixpkgs = {
overlays = [
(final: prev: {
# Fix for wl-clipboard not having support for not setting sensitive for password managers
wl-clipboard = prev.wl-clipboard.overrideAttrs (old: {
version = "24-04-25";
src = prev.fetchFromGitHub {
owner = "bugaevc";
repo = "wl-clipboard";
rev = "aaa927ee7f7d91bcc25a3b68f60d01005d3b0f7f";
hash = "sha256-V8JAai4gZ1nzia4kmQVeBwidQ+Sx5A5on3SJGSevrUU=";
};
});
})
(import inputs.emacs-overlay)
inputs.nix-cachyos-kernel.overlays.pinned
];
};
# Optimise storage
nix.optimise = {
automatic = true;
dates = ["weekly"];
};
# Enable my flake specific settings
crony.gaming.enable = true;
crony.additional-hardware.enable = true;
@ -323,9 +122,10 @@
crony.sunshine.enable = true;
crony.bluetooth.enable = true;
crony.localsend.enable = true;
# Setup spice usb redirection
virtualisation.spiceUSBRedirection.enable = true;
crony.flatpak.enable = true;
crony.qemu.enable = true;
crony.pc-services.enable = true;
crony.pipewire.enable = true;
# Mount additional drive for games
fileSystems."/mnt/games" = {
@ -354,12 +154,8 @@
libva-utils
alsa-utils
ddcutil
quickemu
];
# Enable nixd to see nixpkgs path
nix.nixPath = ["nixpkgs=${inputs.nixpkgs}"];
# DO NOT CHANGE
system.stateVersion = "24.11";
}

View file

@ -29,6 +29,10 @@
./kanata.nix
./keyd.nix
./localsend.nix
./nix-options.nix
./flatpak.nix
./pc-services.nix
./pipewire.nix
];
crony.bluetooth.enable = lib.mkDefault true;
@ -60,4 +64,7 @@
crony.kanata.enable = lib.mkDefault false;
crony.keyd.enable = lib.mkDefault true;
crony.localsend.enable = lib.mkDefault false;
crony.flatpak.enable = lib.mkDefault false;
crony.pc-services.enable = lib.mkDefault false;
crony.pipewire.enable = lib.mkDefault false;
}

View file

@ -0,0 +1,26 @@
{
config,
lib,
...
}: {
options = {
crony.flatpak.enable = lib.mkEnableOption "Enable and install flatpak packages.";
};
config = lib.mkIf config.crony.flatpak.enable {
# Enable flatpak
services.flatpak = {
enable = true;
packages = [
"com.dec05eba.gpu_screen_recorder"
];
uninstallUnmanaged = true;
update.auto = {
enable = true;
onCalendar = "weekly";
};
};
};
}

View file

@ -9,6 +9,9 @@
crony.gaming.enable = lib.mkEnableOption "enable gaming related stuff, like steam and gamemode";
};
config = lib.mkIf config.crony.gaming.enable {
# Setup ntsync
boot.kernelModules = ["ntsync"];
# Install steam
programs.steam = {
enable = true;
@ -36,6 +39,7 @@
};
};
};
# Setup esync
systemd.settings.Manager = {
DefaultLimitNOFILE = 1048576;
@ -49,6 +53,9 @@
}
];
# Enable sleepy launcher
programs.sleepy-launcher.enable = true;
# Setup switch pro controller
hardware.steam-hardware.enable = true;
services.joycond.enable = true;

View file

@ -34,5 +34,14 @@
# Setup fstrim
services.fstrim.enable = true;
# Enable seatd
services.seatd.enable = true;
# Enable ratbagd to customize mouse options
services.ratbagd.enable = true;
# Enable dconf
programs.dconf.enable = true;
};
}

View file

@ -0,0 +1,64 @@
{inputs, ...}: {
# Enable flakes
nix.settings.experimental-features = ["nix-command" "flakes"];
# Enable trusted users
nix.settings.trusted-users = ["root" "@wheel"];
# Setup community cache
nix.settings = {
substituters = [
"https://nix-community.cachix.org"
"https://hyprland.cachix.org"
"https://ezkea.cachix.org"
"https://nix-gaming.cachix.org"
"https://cache.nixos-cuda.org"
"https://deploy-rs.cachix.org"
"https://attic.xuyh0120.win/lantian"
];
trusted-substituters = [
"https://hyprland.cachix.org"
];
trusted-public-keys = [
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"ezkea.cachix.org-1:ioBmUbJTZIKsHmWWXPe1FSFbeVe+afhfgqgTSNd34eI="
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
"cache.nixos-cuda.org:74DUi4Ye579gUqzH4ziL9IyiJBlDpMRn9MBN8oNan9M="
"deploy-rs.cachix.org-1:xfNobmiwF/vzvK1gpfediPwpdIP0rpDV2rYqx40zdSI="
"lantian:EeAUQ+W+6r7EtwnmYjeVwx5kOGEBpjlBfPlzGlTNvHc="
];
};
# setup custom packages
nixpkgs = {
overlays = [
(final: prev: {
# Fix for wl-clipboard not having support for not setting sensitive for password managers
wl-clipboard = prev.wl-clipboard.overrideAttrs (old: {
version = "24-04-25";
src = prev.fetchFromGitHub {
owner = "bugaevc";
repo = "wl-clipboard";
rev = "aaa927ee7f7d91bcc25a3b68f60d01005d3b0f7f";
hash = "sha256-V8JAai4gZ1nzia4kmQVeBwidQ+Sx5A5on3SJGSevrUU=";
};
});
})
(import inputs.emacs-overlay)
inputs.nix-cachyos-kernel.overlays.pinned
];
};
# Optimise storage
nix.optimise = {
automatic = true;
dates = ["weekly"];
};
# Enable nixd to see nixpkgs path
nix.nixPath = ["nixpkgs=${inputs.nixpkgs}"];
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
}

View file

@ -15,8 +15,5 @@
loadModels = ["gpt-oss:20b"];
environmentVariables = {OLLAMA_KEEP_ALIVE = "2m";};
};
# systemd.services.ollama.wantedBy = lib.mkForce [];
# systemd.services.ollama-model-loader.wantedBy = lib.mkForce [];
};
}

View file

@ -8,7 +8,6 @@
};
config = lib.mkIf config.crony.oom.enable {
nix.settings.max-jobs = 8;
services.earlyoom = {
enable = true;
enableNotifications = true;

View file

@ -0,0 +1,28 @@
{
config,
lib,
...
}: {
options = {
crony.pc-services.enable = lib.mkEnableOption "Enable and setup pc related service for gpu/fan/rgb management.";
};
config = lib.mkIf config.crony.pc-services.enable {
# Enable coolercontrol to setup fancurves
programs.coolercontrol = {
enable = true;
};
# Setup gpu fan curves and light undervolt
services.lact.enable = true;
# Setup display brightness changing using ddcutil
hardware.i2c.enable = true;
# Setup rgb control
services.hardware.openrgb.enable = true;
# Needed modules to have fan control
boot.kernelModules = ["coretemp" "nct6775"];
};
}

View file

@ -0,0 +1,97 @@
{
config,
lib,
...
}: {
options = {
crony.pipewire.enable = lib.mkEnableOption "Enable and setup pipewire with settings.";
};
config = lib.mkIf config.crony.pipewire.enable {
# Enable sound with pipewire.
security.rtkit.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
alsa = {
enable = true;
support32Bit = true;
};
wireplumber.extraConfig = {
"51-disable-suspension" = {
"monitor.alsa.rules" = [
{
matches = [
{
node.name = "~alsa_input.*";
}
{
node.name = "~alsa_output.*";
}
];
actions = {
update-props = {
"session.suspend-timeout-seconds" = 0;
};
};
}
];
"monitor.bluez.rules" = [
{
matches = [
{
node.name = "~alsa_input.*";
}
{
node.name = "~alsa_output.*";
}
];
actions = {
update-props = {
"session.suspend-timeout-seconds" = 0;
};
};
}
];
};
};
extraConfig = {
pipewire."99-silent.bell.conf" = {
"context.properties" = {
"modules.x11.bell" = false;
};
};
pipewire."92-low-latency" = {
"context.properties" = {
"default.clock.rate" = 48000;
"default.clock.quantum" = 64;
"default.clock.min-quantum" = 64;
"default.clock.max-quantum" = 64;
};
};
pipewire-pulse."92-low-latency" = {
"context.properties" = [
{
name = "libpipewire-module-protocol-pulse";
args = {};
}
];
"pulse.properties" = {
"pulse.min.req" = "64/48000";
"pulse.default.req" = "64/48000";
"pulse.max.req" = "64/48000";
"pulse.min.quantum" = "64/48000";
"pulse.max.quantum" = "64/48000";
};
"stream.properties" = {
"node.latency" = "64/48000";
"resample.quality" = 1;
};
};
};
};
# Fix not saving my state
hardware.alsa.enablePersistence = true;
};
}

View file

@ -15,5 +15,8 @@
qemu
quickemu
];
# Setup spice usb redirection
virtualisation.spiceUSBRedirection.enable = true;
};
}

View file

@ -15,7 +15,6 @@
};
networking.wg-quick.interfaces.wg1 = {
autostart = false;
# configFile = "${config.age.secrets.wg-home.path}";
configFile = "${config.age.secrets.wg-ymir-home.path}";
};
};