diff --git a/flake.lock b/flake.lock index 8e1f4cc..2692bd2 100644 --- a/flake.lock +++ b/flake.lock @@ -198,6 +198,26 @@ "type": "github" } }, + "cachyos-settings-nix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772570303, + "narHash": "sha256-6Ln0SnXvNIL7vko8ZpLkegajsfbdVbkuoT0jLMDefYA=", + "owner": "Daaboulex", + "repo": "cachyos-settings-nix", + "rev": "e0d227d4394dc59bf5ced7ef7fc128685370c592", + "type": "github" + }, + "original": { + "owner": "Daaboulex", + "repo": "cachyos-settings-nix", + "type": "github" + } + }, "crane": { "locked": { "lastModified": 1765145449, @@ -2215,6 +2235,7 @@ "aagl": "aagl", "agenix": "agenix", "auto-cpufreq": "auto-cpufreq", + "cachyos-settings-nix": "cachyos-settings-nix", "deploy-rs": "deploy-rs", "disko": "disko", "emacs-overlay": "emacs-overlay", diff --git a/flake.nix b/flake.nix index 0cf8150..bed96ce 100644 --- a/flake.nix +++ b/flake.nix @@ -155,6 +155,12 @@ # Proton cachyos proton-cachyos.url = "github:powerofthe69/proton-cachyos-nix"; + + # Cachyos settings + cachyos-settings-nix = { + url = "github:Daaboulex/cachyos-settings-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { diff --git a/helpers.nix b/helpers.nix index 5102c1b..d1b91e7 100644 --- a/helpers.nix +++ b/helpers.nix @@ -30,6 +30,7 @@ inputs.auto-cpufreq.nixosModules.default inputs.nix-flatpak.nixosModules.nix-flatpak inputs.lanzaboote.nixosModules.lanzaboote + inputs.cachyos-settings-nix.nixosModules.default ] else []; homeManagerModules = diff --git a/hosts/skadi/configuration.nix b/hosts/skadi/configuration.nix index 14c76a0..622ea96 100644 --- a/hosts/skadi/configuration.nix +++ b/hosts/skadi/configuration.nix @@ -170,6 +170,7 @@ crony.flatpak.enable = true; crony.qemu.enable = true; crony.pc-services.enable = true; + crony.cachyos.settings.enable = true; # # Try out greetd with tuigreet # services.greetd = { diff --git a/modules/linux/nixos/boot.nix b/modules/linux/nixos/boot.nix index 2f342c8..a7de6ab 100644 --- a/modules/linux/nixos/boot.nix +++ b/modules/linux/nixos/boot.nix @@ -8,19 +8,6 @@ }; config = lib.mkIf config.crony.boot.enable { - boot.kernel.sysctl = { - # Cachy os adopted values - "vm.swappiness" = 100; - "vm.vfs_cache_pressure" = 50; - "vm.dirty_bytes" = 268435456; - "vm.page-cluster" = 1; - "vm.dirty_background_bytes" = 67108864; - "vm.dirty_writeback_centisecs" = 1500; - "net.core.netdev_max_backlog" = 4096; - "fs.file-max" = 2097152; - # Disable watchdog - "kernel.nmi_watchdog" = 0; - }; boot.consoleLogLevel = 3; boot.kernelParams = ["quiet" "udev.log_priority=3"]; }; diff --git a/modules/linux/nixos/cachyos-settings.nix b/modules/linux/nixos/cachyos-settings.nix new file mode 100644 index 0000000..2595b00 --- /dev/null +++ b/modules/linux/nixos/cachyos-settings.nix @@ -0,0 +1,17 @@ +{ + config, + inputs, + lib, + ... +}: { + options = { + crony.cachyos.settings.enable = lib.mkEnableOption "Enable and setup cachyos settings."; + }; + + config = lib.mkIf config.crony.cachyos.settings.enable { + cachyos.settings = { + enable = true; + nvidia.enable = true; + }; + }; +} diff --git a/modules/linux/nixos/default.nix b/modules/linux/nixos/default.nix index 0a3a12d..b01a4c5 100644 --- a/modules/linux/nixos/default.nix +++ b/modules/linux/nixos/default.nix @@ -33,6 +33,7 @@ ./flatpak.nix ./pc-services.nix ./pipewire.nix + ./cachyos-settings.nix ]; crony.bluetooth.enable = lib.mkDefault true; @@ -67,4 +68,5 @@ crony.flatpak.enable = lib.mkDefault false; crony.pc-services.enable = lib.mkDefault false; crony.pipewire.enable = lib.mkDefault false; + crony.cachyos.settings.enable = lib.mkDefault false; } diff --git a/modules/linux/nixos/gaming.nix b/modules/linux/nixos/gaming.nix index e6887e3..6480bfd 100644 --- a/modules/linux/nixos/gaming.nix +++ b/modules/linux/nixos/gaming.nix @@ -9,9 +9,6 @@ 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; @@ -46,9 +43,6 @@ }; # Setup esync - systemd.settings.Manager = { - DefaultLimitNOFILE = 1048576; - }; security.pam.loginLimits = [ { domain = "*"; diff --git a/modules/linux/nixos/general-services.nix b/modules/linux/nixos/general-services.nix index 759e504..528df32 100644 --- a/modules/linux/nixos/general-services.nix +++ b/modules/linux/nixos/general-services.nix @@ -15,23 +15,6 @@ # Enable firmware updater services.fwupd.enable = true; - # Enable zram swap device - zramSwap = { - enable = true; - memoryPercent = 60; - }; - - # Setup swapfile - swapDevices = [ - { - device = "/var/lib/swapfile"; - size = 32 * 1024; - } - ]; - - # Setup ntp - services.timesyncd.enable = true; - # Setup fstrim services.fstrim.enable = true;