feat: move stuff around a bit, created new modules.
This commit is contained in:
parent
12fadadc5c
commit
506525af35
12 changed files with 247 additions and 215 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
26
modules/linux/nixos/flatpak.nix
Normal file
26
modules/linux/nixos/flatpak.nix
Normal 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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
64
modules/linux/nixos/nix-options.nix
Normal file
64
modules/linux/nixos/nix-options.nix
Normal 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;
|
||||
}
|
||||
|
|
@ -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 [];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
};
|
||||
|
||||
config = lib.mkIf config.crony.oom.enable {
|
||||
nix.settings.max-jobs = 8;
|
||||
services.earlyoom = {
|
||||
enable = true;
|
||||
enableNotifications = true;
|
||||
|
|
|
|||
28
modules/linux/nixos/pc-services.nix
Normal file
28
modules/linux/nixos/pc-services.nix
Normal 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"];
|
||||
};
|
||||
}
|
||||
97
modules/linux/nixos/pipewire.nix
Normal file
97
modules/linux/nixos/pipewire.nix
Normal 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;
|
||||
};
|
||||
}
|
||||
|
|
@ -15,5 +15,8 @@
|
|||
qemu
|
||||
quickemu
|
||||
];
|
||||
|
||||
# Setup spice usb redirection
|
||||
virtualisation.spiceUSBRedirection.enable = true;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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}";
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue