FINALLY, it was stylix that was breaking the desktop!!!
This commit is contained in:
parent
ec7429d384
commit
32f2213e88
10 changed files with 317 additions and 234 deletions
26
default.nix
26
default.nix
|
@ -1,26 +0,0 @@
|
||||||
{ inputs, config, lib, pkgs, ... }:
|
|
||||||
let
|
|
||||||
inherit (builtins) toString;
|
|
||||||
inherit (lib.modules) mkAliasOptionModule mkIf;
|
|
||||||
inherit (lib.my) mapModulesRec' mapModules mkSysUser mkHmUser;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
imports = [
|
|
||||||
inputs.sops-nix.nixosModules.sops
|
|
||||||
];
|
|
||||||
|
|
||||||
config = {
|
|
||||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
|
||||||
|
|
||||||
environment.variables = {
|
|
||||||
NIXPKGS_ALLOW_UNFREE = "1";
|
|
||||||
};
|
|
||||||
|
|
||||||
sops = {
|
|
||||||
defaultSopsFile = ./secrets/secrets.yml;
|
|
||||||
defaultSopsFormat = "yml";
|
|
||||||
|
|
||||||
age.keyFile = "/home/";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -74,12 +74,7 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosModules =
|
nixosModules = mapModulesRec ./modules import;
|
||||||
{
|
|
||||||
sneeuwvlok = import ./.;
|
|
||||||
}
|
|
||||||
// mapModulesRec ./modules import;
|
|
||||||
|
|
||||||
nixosConfigurations = mapHosts ./hosts {};
|
nixosConfigurations = mapHosts ./hosts {};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ in rec
|
||||||
inputs.nixos-boot.nixosModules.default
|
inputs.nixos-boot.nixosModules.default
|
||||||
({ options, config, ...}: {
|
({ options, config, ...}: {
|
||||||
nixpkgs.pkgs = pkgs;
|
nixpkgs.pkgs = pkgs;
|
||||||
|
|
||||||
networking.hostName = mkDefault (removeSuffix ".nix" (baseNameOf path));
|
networking.hostName = mkDefault (removeSuffix ".nix" (baseNameOf path));
|
||||||
|
|
||||||
system = {
|
system = {
|
||||||
|
@ -57,7 +57,6 @@ in rec
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
(filterAttrs (n: v: !elem n ["system"]) attrs)
|
(filterAttrs (n: v: !elem n ["system"]) attrs)
|
||||||
../. # ../default.nix
|
|
||||||
(import path)
|
(import path)
|
||||||
]
|
]
|
||||||
++ (map (user: {
|
++ (map (user: {
|
||||||
|
|
|
@ -51,135 +51,222 @@ in
|
||||||
sharedModules = [
|
sharedModules = [
|
||||||
inputs.plasma-manager.homeManagerModules.plasma-manager
|
inputs.plasma-manager.homeManagerModules.plasma-manager
|
||||||
];
|
];
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.${user}.programs.plasma = {
|
users.${user}.programs.plasma = {
|
||||||
enable = true;
|
enable = true;
|
||||||
immutableByDefault = false;
|
immutableByDefault = true;
|
||||||
windows.allowWindowsToRememberPositions = true;
|
windows.allowWindowsToRememberPositions = true;
|
||||||
|
|
||||||
workspace = {
|
workspace = {
|
||||||
colorScheme = "CatppuccinMocha";
|
colorScheme = "CatppuccinMocha";
|
||||||
};
|
wallpaper = config.stylix.image;
|
||||||
|
|
||||||
spectacle.shortcuts = {
|
|
||||||
captureRectangularRegion = "Meta+Shift+S";
|
|
||||||
};
|
|
||||||
|
|
||||||
kwin = {
|
|
||||||
edgeBarrier = 0;
|
|
||||||
cornerBarrier = false;
|
|
||||||
|
|
||||||
effects = {
|
|
||||||
translucency.enable = true;
|
|
||||||
|
|
||||||
blur = {
|
|
||||||
enable = true;
|
|
||||||
strength = 5;
|
|
||||||
noiseStrength = 5;
|
|
||||||
};
|
|
||||||
|
|
||||||
snapHelper.enable = true;
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
panels = [
|
spectacle.shortcuts = {
|
||||||
# Windows-like panel at the bottom
|
captureRectangularRegion = "Meta+Shift+S";
|
||||||
{
|
|
||||||
location = "bottom";
|
|
||||||
widgets = [
|
|
||||||
"org.kde.plasma.kickoff"
|
|
||||||
{
|
|
||||||
name = "org.kde.plasma.icontasks";
|
|
||||||
config = {
|
|
||||||
launchers = [
|
|
||||||
"preferred://browser"
|
|
||||||
"applications:org.kde.konsole.desktop"
|
|
||||||
"applications:org.kde.dolphin.desktop"
|
|
||||||
"applications:equibop.desktop"
|
|
||||||
"applications:code.desktop"
|
|
||||||
"applications:com.obsproject.Studio"
|
|
||||||
"applications:spotify.desktop"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
"org.kde.plasma.systemtray"
|
|
||||||
"org.kde.plasma.digitalclock"
|
|
||||||
];
|
|
||||||
floating = true;
|
|
||||||
minLength = 1743;
|
|
||||||
maxLength = 1920;
|
|
||||||
hiding = "dodgewindows";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
powerdevil = {
|
|
||||||
AC = {
|
|
||||||
powerButtonAction = "shutDown";
|
|
||||||
whenLaptopLidClosed = "doNothing";
|
|
||||||
|
|
||||||
autoSuspend.action = "nothing";
|
|
||||||
dimDisplay.enable = false;
|
|
||||||
|
|
||||||
turnOffDisplay = {
|
|
||||||
idleTimeout = "never";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
battery = {
|
|
||||||
powerButtonAction = "shutDown";
|
|
||||||
whenLaptopLidClosed = "doNothing";
|
|
||||||
|
|
||||||
autoSuspend.action = "nothing";
|
kwin = {
|
||||||
dimDisplay.enable = false;
|
edgeBarrier = 0;
|
||||||
|
cornerBarrier = false;
|
||||||
|
|
||||||
turnOffDisplay = {
|
effects = {
|
||||||
idleTimeout = "never";
|
translucency.enable = true;
|
||||||
};
|
|
||||||
|
blur = {
|
||||||
|
enable = true;
|
||||||
|
strength = 5;
|
||||||
|
noiseStrength = 5;
|
||||||
|
};
|
||||||
|
|
||||||
|
snapHelper.enable = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
lowBattery = {
|
|
||||||
powerButtonAction = "shutDown";
|
|
||||||
whenLaptopLidClosed = "doNothing";
|
|
||||||
|
|
||||||
autoSuspend.action = "nothing";
|
panels = [
|
||||||
dimDisplay.enable = false;
|
# Windows-like panel at the bottom
|
||||||
|
{
|
||||||
|
location = "bottom";
|
||||||
|
floating = true;
|
||||||
|
lengthMode = "fill";
|
||||||
|
height = 32;
|
||||||
|
hiding = "dodgewindows";
|
||||||
|
screen = "all";
|
||||||
|
widgets = [
|
||||||
|
{
|
||||||
|
kickoff = {
|
||||||
|
applicationsDisplayMode = "list";
|
||||||
|
compactDisplayStyle = false;
|
||||||
|
favoritesDisplayMode = "grid";
|
||||||
|
sortAlphabetically = true;
|
||||||
|
showButtonsFor = {
|
||||||
|
custom = [
|
||||||
|
"shutdown"
|
||||||
|
"reboot"
|
||||||
|
"logout"
|
||||||
|
"lock-screen"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
showActionButtonCaptions = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
appMenu = {
|
||||||
|
compactView = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
panelSpacer = {
|
||||||
|
expanding = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
iconTasks = {
|
||||||
|
appearance = {
|
||||||
|
fill = false;
|
||||||
|
highlightWindows = true;
|
||||||
|
iconSpacing = "medium";
|
||||||
|
indicateAudioStreams = true;
|
||||||
|
rows = {
|
||||||
|
multirowView = "never";
|
||||||
|
maximum = null;
|
||||||
|
};
|
||||||
|
showTooltips = true;
|
||||||
|
};
|
||||||
|
behavior = {
|
||||||
|
grouping = {
|
||||||
|
clickAction = "showPresentWindowsEffect";
|
||||||
|
method = "byProgramName";
|
||||||
|
};
|
||||||
|
minimizeActiveTaskOnClick = true;
|
||||||
|
newTasksAppearOn = "right";
|
||||||
|
showTasks = {
|
||||||
|
onlyInCurrentActivity = true;
|
||||||
|
onlyInCurrentDesktop = true;
|
||||||
|
onlyMinimized = false;
|
||||||
|
onlyInCurrentScreen = false;
|
||||||
|
};
|
||||||
|
sortingMethod = "manually";
|
||||||
|
unhideOnAttentionNeeded = true;
|
||||||
|
wheel = {
|
||||||
|
ignoreMinimizedTasks = true;
|
||||||
|
switchBetweenTasks = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
launchers = [
|
||||||
|
"applications:org.kde.dolphin.desktop"
|
||||||
|
"preferred://browser"
|
||||||
|
"preferred://terminal"
|
||||||
|
"preferred://editor"
|
||||||
|
"applications:vesktop.desktop"
|
||||||
|
"applications:steam.desktop"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
panelSpacer = {
|
||||||
|
expanding = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
systemTray = {
|
||||||
|
icons = {
|
||||||
|
scaleToFit = true;
|
||||||
|
spacing = "small";
|
||||||
|
};
|
||||||
|
items = {
|
||||||
|
hidden = [
|
||||||
|
"org.kde.plasma.brightness"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
pin = false;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
digitalClock = {
|
||||||
|
date = {
|
||||||
|
enable = true;
|
||||||
|
format = "shortDate";
|
||||||
|
position = "belowTime";
|
||||||
|
};
|
||||||
|
time = {
|
||||||
|
format = "24h";
|
||||||
|
showSeconds = "onlyInTooltip";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
turnOffDisplay = {
|
powerdevil = {
|
||||||
idleTimeout = "never";
|
AC = {
|
||||||
};
|
powerButtonAction = "shutDown";
|
||||||
};
|
whenLaptopLidClosed = "doNothing";
|
||||||
};
|
|
||||||
|
|
||||||
kscreenlocker = {
|
autoSuspend.action = "nothing";
|
||||||
autoLock = false;
|
dimDisplay.enable = false;
|
||||||
lockOnResume = false;
|
|
||||||
lockOnStartup = false;
|
|
||||||
|
|
||||||
appearance = {
|
turnOffDisplay = {
|
||||||
alwaysShowClock = true;
|
idleTimeout = "never";
|
||||||
showMediaControls = true;
|
};
|
||||||
};
|
};
|
||||||
};
|
battery = {
|
||||||
|
powerButtonAction = "shutDown";
|
||||||
|
whenLaptopLidClosed = "doNothing";
|
||||||
|
|
||||||
configFile = {
|
autoSuspend.action = "nothing";
|
||||||
kdeglobals = {
|
dimDisplay.enable = false;
|
||||||
General = {
|
|
||||||
# enable font antialiasing
|
turnOffDisplay = {
|
||||||
XftAntialias = true;
|
idleTimeout = "never";
|
||||||
XftHintStyle = "hintslight";
|
};
|
||||||
XftSubPixel = "rgb";
|
};
|
||||||
};
|
lowBattery = {
|
||||||
|
powerButtonAction = "shutDown";
|
||||||
|
whenLaptopLidClosed = "doNothing";
|
||||||
|
|
||||||
|
autoSuspend.action = "nothing";
|
||||||
|
dimDisplay.enable = false;
|
||||||
|
|
||||||
|
turnOffDisplay = {
|
||||||
|
idleTimeout = "never";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
kwalletrc = {
|
|
||||||
Wallet.Enabled = false;
|
kscreenlocker = {
|
||||||
|
autoLock = false;
|
||||||
|
lockOnResume = false;
|
||||||
|
lockOnStartup = false;
|
||||||
|
|
||||||
|
appearance = {
|
||||||
|
alwaysShowClock = true;
|
||||||
|
showMediaControls = true;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
plasmarc = {
|
|
||||||
General = {
|
configFile = {
|
||||||
RaiseMaximumVolume = true;
|
kdeglobals = {
|
||||||
VolumeStep = 2;
|
General = {
|
||||||
};
|
# enable font antialiasing
|
||||||
};
|
XftAntialias = true;
|
||||||
kcminputrc = {
|
XftHintStyle = "hintslight";
|
||||||
Keyboard.NumLock.value = 0;
|
XftSubPixel = "rgb";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
kwalletrc = {
|
||||||
|
Wallet.Enabled = false;
|
||||||
|
};
|
||||||
|
plasmarc = {
|
||||||
|
General = {
|
||||||
|
RaiseMaximumVolume = true;
|
||||||
|
VolumeStep = 2;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
kcminputrc = {
|
||||||
|
Keyboard.NumLock.value = 0;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -25,8 +25,8 @@ in {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
background-blur-radius = 20;
|
background-blur-radius = 20;
|
||||||
theme = "dark:stylix,light:stylix";
|
# theme = "dark:stylix,light:stylix";
|
||||||
window-theme = config.stylix.polarity;
|
# window-theme = config.stylix.polarity;
|
||||||
background-opacity = 0.8;
|
background-opacity = 0.8;
|
||||||
minimum-contrast = 1.1;
|
minimum-contrast = 1.1;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,19 +1,25 @@
|
||||||
{ config, options, lib, pkgs, user, ... }:
|
{ config, lib, user, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.${user}.shell.toolset.starship = let
|
options.modules.${user}.shell.toolset.starship = {
|
||||||
inherit (lib.options) mkEnableOption;
|
enable = mkEnableOption "fancy pansy shell prompt";
|
||||||
in {
|
|
||||||
enable = mkEnableOption "minimal shell ricing";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf config.modules.${user}.shell.toolset.starship.enable {
|
config = mkIf config.modules.${user}.shell.toolset.starship.enable {
|
||||||
home-manager.users.${user}.programs.starship = {
|
home-manager.users.${user}.programs.starship = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = let
|
settings = let
|
||||||
inherit (config.lib.stylix.colors) cyan red magenta yellow green blue;
|
# inherit (config.lib.stylix.colors) cyan red magenta yellow green blue;
|
||||||
|
|
||||||
|
cyan = "#00ffff";
|
||||||
|
red = "#ff0000";
|
||||||
|
magenta = "#ff00ff";
|
||||||
|
yellow = "#ffff00";
|
||||||
|
green = "#00ff00";
|
||||||
|
blue = "#0000ff";
|
||||||
in {
|
in {
|
||||||
scan_timeout = 10;
|
scan_timeout = 10;
|
||||||
add_newline = true;
|
add_newline = true;
|
||||||
|
|
|
@ -1,19 +1,13 @@
|
||||||
{ inputs, config, options, lib, pkgs, user, ... }:
|
{ config, lib, pkgs, user, ... }:
|
||||||
let
|
let
|
||||||
inherit (builtins) getEnv map;
|
inherit (lib) mkIf mkDefault;
|
||||||
inherit (lib.attrsets) attrValues mapAttrsToList;
|
inherit (lib.options) mkOption mkEnableOption;
|
||||||
inherit (lib.meta) getExe;
|
inherit (lib.types) nullOr enum;
|
||||||
inherit (lib.modules) mkIf mkMerge;
|
|
||||||
inherit (lib.strings) concatStringsSep optionalString;
|
|
||||||
|
|
||||||
cfg = config.modules.${user}.themes;
|
cfg = config.modules.${user}.themes;
|
||||||
desktop = config.modules.${user}.desktop;
|
|
||||||
in {
|
in {
|
||||||
|
|
||||||
options.modules.${user}.themes = let
|
options.modules.${user}.themes = {
|
||||||
inherit (lib.options) mkOption mkEnableOption;
|
|
||||||
inherit (lib.types) nullOr enum;
|
|
||||||
in {
|
|
||||||
enable = mkEnableOption "Theming (Stylix)";
|
enable = mkEnableOption "Theming (Stylix)";
|
||||||
|
|
||||||
theme = mkOption {
|
theme = mkOption {
|
||||||
|
@ -33,6 +27,24 @@ in {
|
||||||
config = mkIf (cfg.enable) {
|
config = mkIf (cfg.enable) {
|
||||||
modules.theming.enable = true;
|
modules.theming.enable = true;
|
||||||
|
|
||||||
|
environment.sessionVariables = { QT_QPA_PLATFORMTHEME = "kde"; };
|
||||||
|
|
||||||
|
home-manager.users.${user} = {
|
||||||
|
xdg.configFile."menus/applications.menu".source = "${pkgs.kdePackages.plasma-workspace}/etc/xdg/menus/plasma-applications.menu";
|
||||||
|
|
||||||
|
qt = {
|
||||||
|
enable = true;
|
||||||
|
platformTheme.package = with pkgs.kdePackages; [
|
||||||
|
plasma-integration
|
||||||
|
systemsettings
|
||||||
|
];
|
||||||
|
style = {
|
||||||
|
package = pkgs.kdePackages.breeze;
|
||||||
|
name = mkDefault "Breeze";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
stylix = {
|
stylix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
autoEnable = true;
|
autoEnable = true;
|
||||||
|
|
|
@ -14,6 +14,10 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
environment.variables = {
|
||||||
|
NIXPKGS_ALLOW_UNFREE = "1";
|
||||||
|
};
|
||||||
|
|
||||||
nix.settings = let
|
nix.settings = let
|
||||||
inherit (lib) elem attrNames filterAttrs;
|
inherit (lib) elem attrNames filterAttrs;
|
||||||
|
|
||||||
|
@ -22,6 +26,7 @@ in
|
||||||
{
|
{
|
||||||
trusted-users = users;
|
trusted-users = users;
|
||||||
allowed-users = users;
|
allowed-users = users;
|
||||||
|
experimental-features = [ "nix-command" "flakes" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,70 +1,77 @@
|
||||||
{ pkgs, ... }:
|
{ inputs, pkgs, ... }:
|
||||||
{
|
{
|
||||||
environment.systemPackages = with pkgs; [
|
imports = [
|
||||||
kdePackages.kwallet-pam
|
inputs.sops-nix.nixosModules.sops
|
||||||
bitwarden
|
];
|
||||||
sops
|
|
||||||
];
|
|
||||||
|
|
||||||
security = {
|
config = {
|
||||||
sudo.execWheelOnly = true;
|
environment.systemPackages = with pkgs; [
|
||||||
acme.acceptTerms = true;
|
bitwarden
|
||||||
polkit.enable = true;
|
sops
|
||||||
pam = {
|
];
|
||||||
u2f = {
|
|
||||||
enable = true;
|
|
||||||
settings.cue = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
services.kwallet = {
|
sops = {
|
||||||
name = "kwallet";
|
defaultSopsFile = ./secrets/secrets.yml;
|
||||||
enableKwallet = true;
|
defaultSopsFormat = "yml";
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.firewall.enable = true;
|
age.keyFile = "/home/";
|
||||||
programs.gnupg.agent.enable = true;
|
|
||||||
|
|
||||||
boot = {
|
|
||||||
loader.systemd-boot = {
|
|
||||||
editor = false;
|
|
||||||
configurationLimit = 50;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
kernelModules = [ "tcp_bbr" ];
|
security = {
|
||||||
kernel.sysctl = {
|
sudo.execWheelOnly = true;
|
||||||
## TCP hardening
|
acme.acceptTerms = true;
|
||||||
# Prevent bogus ICMP errors from filling up logs.
|
polkit.enable = true;
|
||||||
"net.ipv4.icmp_ignore_bogus_error_responses" = 1;
|
pam = {
|
||||||
# Reverse path filtering causes the kernel to do source validation of
|
u2f = {
|
||||||
# packets received from all interfaces. This can mitigate IP spoofing.
|
enable = true;
|
||||||
"net.ipv4.conf.default.rp_filter" = 1;
|
settings.cue = true;
|
||||||
"net.ipv4.conf.all.rp_filter" = 1;
|
};
|
||||||
# Do not accept IP source route packets (we're not a router)
|
};
|
||||||
"net.ipv4.conf.all.accept_source_route" = 0;
|
};
|
||||||
"net.ipv6.conf.all.accept_source_route" = 0;
|
|
||||||
# Don't send ICMP redirects (again, we're on a router)
|
|
||||||
"net.ipv4.conf.all.send_redirects" = 0;
|
|
||||||
"net.ipv4.conf.default.send_redirects" = 0;
|
|
||||||
# Refuse ICMP redirects (MITM mitigations)
|
|
||||||
"net.ipv4.conf.all.accept_redirects" = 0;
|
|
||||||
"net.ipv4.conf.default.accept_redirects" = 0;
|
|
||||||
"net.ipv4.conf.all.secure_redirects" = 0;
|
|
||||||
"net.ipv4.conf.default.secure_redirects" = 0;
|
|
||||||
"net.ipv6.conf.all.accept_redirects" = 0;
|
|
||||||
"net.ipv6.conf.default.accept_redirects" = 0;
|
|
||||||
# Protects against SYN flood attacks
|
|
||||||
"net.ipv4.tcp_syncookies" = 1;
|
|
||||||
# Incomplete protection again TIME-WAIT assassination
|
|
||||||
"net.ipv4.tcp_rfc1337" = 1;
|
|
||||||
|
|
||||||
## TCP optimization
|
networking.firewall.enable = true;
|
||||||
# Enable TCP Fast Open for incoming and outgoing connections
|
programs.gnupg.agent.enable = true;
|
||||||
"net.ipv4.tcp_fastopen" = 3;
|
|
||||||
# Bufferbloat mitigations + slight improvement in throughput & latency
|
boot = {
|
||||||
"net.ipv4.tcp_congestion_control" = "bbr";
|
loader.systemd-boot = {
|
||||||
"net.core.default_qdisc" = "cake";
|
editor = false;
|
||||||
|
configurationLimit = 50;
|
||||||
|
};
|
||||||
|
|
||||||
|
kernelModules = [ "tcp_bbr" ];
|
||||||
|
kernel.sysctl = {
|
||||||
|
## TCP hardening
|
||||||
|
# Prevent bogus ICMP errors from filling up logs.
|
||||||
|
"net.ipv4.icmp_ignore_bogus_error_responses" = 1;
|
||||||
|
# Reverse path filtering causes the kernel to do source validation of
|
||||||
|
# packets received from all interfaces. This can mitigate IP spoofing.
|
||||||
|
"net.ipv4.conf.default.rp_filter" = 1;
|
||||||
|
"net.ipv4.conf.all.rp_filter" = 1;
|
||||||
|
# Do not accept IP source route packets (we're not a router)
|
||||||
|
"net.ipv4.conf.all.accept_source_route" = 0;
|
||||||
|
"net.ipv6.conf.all.accept_source_route" = 0;
|
||||||
|
# Don't send ICMP redirects (again, we're on a router)
|
||||||
|
"net.ipv4.conf.all.send_redirects" = 0;
|
||||||
|
"net.ipv4.conf.default.send_redirects" = 0;
|
||||||
|
# Refuse ICMP redirects (MITM mitigations)
|
||||||
|
"net.ipv4.conf.all.accept_redirects" = 0;
|
||||||
|
"net.ipv4.conf.default.accept_redirects" = 0;
|
||||||
|
"net.ipv4.conf.all.secure_redirects" = 0;
|
||||||
|
"net.ipv4.conf.default.secure_redirects" = 0;
|
||||||
|
"net.ipv6.conf.all.accept_redirects" = 0;
|
||||||
|
"net.ipv6.conf.default.accept_redirects" = 0;
|
||||||
|
# Protects against SYN flood attacks
|
||||||
|
"net.ipv4.tcp_syncookies" = 1;
|
||||||
|
# Incomplete protection again TIME-WAIT assassination
|
||||||
|
"net.ipv4.tcp_rfc1337" = 1;
|
||||||
|
|
||||||
|
## TCP optimization
|
||||||
|
# Enable TCP Fast Open for incoming and outgoing connections
|
||||||
|
"net.ipv4.tcp_fastopen" = 3;
|
||||||
|
# Bufferbloat mitigations + slight improvement in throughput & latency
|
||||||
|
"net.ipv4.tcp_congestion_control" = "bbr";
|
||||||
|
"net.core.default_qdisc" = "cake";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,16 @@
|
||||||
{ inputs, config, options, lib, pkgs, ... }:
|
{ inputs, config, lib, ... }:
|
||||||
let
|
let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf;
|
||||||
|
inherit (lib.options) mkEnableOption;
|
||||||
|
|
||||||
cfg = config.modules.theming;
|
cfg = config.modules.theming;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.stylix.nixosModules.stylix
|
inputs.stylix.nixosModules.stylix
|
||||||
];
|
];
|
||||||
|
|
||||||
options.modules.theming = let
|
options.modules.theming = {
|
||||||
inherit (lib.options) mkEnableOption;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
enable = mkEnableOption "enable theming";
|
enable = mkEnableOption "enable theming";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue