Skip to content

Commit

Permalink
✨ Added plymouth, fastanime and kernel optimizations via sysctl
Browse files Browse the repository at this point in the history
  • Loading branch information
theobori committed Nov 20, 2024
1 parent 5ce7d0c commit 7c97da3
Show file tree
Hide file tree
Showing 7 changed files with 184 additions and 14 deletions.
83 changes: 69 additions & 14 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@
url = "github:Gerg-L/spicetify-nix";
inputs.nixpkgs.follows = "nixpkgs";
};

fast-anime = {
url = "github:Benex254/FastAnime";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs =
Expand Down
20 changes: 20 additions & 0 deletions modules/home/cli/programs/fast-anime/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
lib,
config,
namespace,
pkgs,
...
}:
let
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;

cfg = config.${namespace}.cli.programs.fast-anime;
in
{
options.${namespace}.cli.programs.fast-anime = {
enable = mkBoolOpt false "Whether or not to enable fast-anime.";
};

config = mkIf cfg.enable { home.packages = with pkgs; [ fast-anime ]; };
}
3 changes: 3 additions & 0 deletions modules/home/roles/desktop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ in
development = enabled;
};

cli.programs.fast-anime = enabled;
multimedia.mpv = enabled;

multimedia.calibre = enabled;

programs = {
inkscape = enabled;
obsidian = enabled;
Expand Down
23 changes: 23 additions & 0 deletions modules/nixos/boot/plymouth/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
config,
lib,
namespace,
...
}:
let
inherit (lib) mkIf;
inherit (lib.${namespace}) mkBoolOpt;

cfg = config.${namespace}.boot.plymouth;
in
{
options.${namespace}.boot.plymouth = {
enable = mkBoolOpt false "Whether or not to enable plymouth.";
};

config = mkIf cfg.enable {
boot.plymouth = {
enable = true;
};
};
}
3 changes: 3 additions & 0 deletions overlays/fast-anime/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{ inputs, ... }:

_final: prev: { fast-anime = inputs.fast-anime.packages.${prev.system}.default; }
61 changes: 61 additions & 0 deletions systems/x86_64-linux/laptop/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,70 @@ in
efiInstallAsRemovable = true;
};
supportedFilesystems = [ "ntfs" ];

kernel.sysctl = {
#Do less swapping
"vm.swappiness" = 10;
"vm.dirty_ratio" = 60;
"vm.dirty_background_ratio" = 2;

# Number of times SYNACKs for passive TCP connection.
"net.ipv4.tcp_synack_retries" = 2;

# Allowed local port range
"net.ipv4.ip_local_port_range" = "2000 65535";

# Protect Against TCP Time-Wait
"net.ipv4.tcp_rfc1337" = 1;

# Decrease the time default value for tcp_fin_timeout connection
"net.ipv4.tcp_fin_timeout" = 15;

# Decrease the time default value for connections to keep alive
"net.ipv4.tcp_keepalive_time" = 300;
"net.ipv4.tcp_keepalive_probes" = 5;
"net.ipv4.tcp_keepalive_intvl" = 15;

### TUNING NETWORK PERFORMANCE ###

# Default Socket Receive Buffer
"net.core.rmem_default" = 31457280;

# Maximum Socket Receive Buffer
"net.core.rmem_max" = 12582912;

# Default Socket Send Buffer
"net.core.wmem_default" = 31457280;

# Maximum Socket Send Buffer
"net.core.wmem_max" = 12582912;

# Increase number of incoming connections
"net.core.somaxconn" = 4096;

# Increase number of incoming connections backlog
"net.core.netdev_max_backlog" = 65536;

# Increase the maximum amount of option memory buffers
"net.core.optmem_max" = 25165824;

# Increase the maximum total buffer-space allocatable
# This is measured in units of pages (4096 bytes)
"net.ipv4.tcp_mem" = "65536 131072 262144";
"net.ipv4.udp_mem" = "65536 131072 262144";

# Increase the read-buffer space allocatable
"net.ipv4.tcp_rmem" = "8192 87380 16777216";
"net.ipv4.udp_rmem_min" = 16384;

# Increase the write-buffer-space allocatable
"net.ipv4.tcp_wmem" = "8192 65536 16777216";
"net.ipv4.udp_wmem_min" = 16384;
};
};

${namespace} = {
boot.plymouth = enabled;
security.doas = enabled;

desktops.plasma6 = enabled;
Expand Down

0 comments on commit 7c97da3

Please sign in to comment.