Compare commits

..

14 commits

Author SHA1 Message Date
d472a99976
discord experimentatioj 2024-08-02 19:17:44 -07:00
4a7d8858e5
some security touchups 2024-08-01 17:15:47 -07:00
5558bf7ee8
update apps 2024-08-01 17:05:28 -07:00
a88bfaa5d7
window rules 2024-08-01 16:27:47 -07:00
4291e0cbb4
clipse 2024-08-01 16:27:41 -07:00
d1f61ed5e1
window rules and clipboard persist fix 2024-08-01 16:12:56 -07:00
369a767b08
mess around with fish 2024-08-01 03:41:23 -07:00
96c27a348f
gammastep 2024-08-01 02:34:26 -07:00
f0354690b5
window rules 2024-08-01 02:21:00 -07:00
1a519aeeae
cooler wezterm 2024-08-01 01:49:14 -07:00
e7098c477f
better qt i guess 2024-08-01 01:42:01 -07:00
69a20370bc
fix micro theme 2024-08-01 01:37:08 -07:00
b5714e30bb
deprecate gtk2 2024-07-27 02:12:52 -07:00
ef5252e13c
hyprland changes 2024-07-26 01:59:14 -07:00
11 changed files with 189 additions and 78 deletions

View file

@ -17,16 +17,18 @@
# debug # debug
strace ltrace lsof strace ltrace lsof
# apps # apps
firefox qalculate-gtk krita inkscape handbrake firefox qalculate-gtk krita inkscape onlyoffice-bin vlc
# compatibility # compatibility
wineWowPackages.waylandFull winetricks wineWowPackages.waylandFull winetricks
# misc # misc
bat file which prismlauncher yt-dlp wl-screenrec bat file which yt-dlp wl-screenrec
# games
prismlauncher
] ++ (with pkgs.my; [ ] ++ (with pkgs.my; [
# none yet # none yet
]) ++ (with pkgs.gnome; [ ]) ++ (with pkgs.gnome; [
# yay gnomeware!!!!!!!!!!!!!! yum # yay gnomeware!!!!!!!!!!!!!! yum
nautilus gnome-disk-utility ghex pkgs.gnome-text-editor pkgs.baobab file-roller gnome-system-monitor loupe nautilus gnome-font-viewer gnome-disk-utility ghex pkgs.gnome-text-editor pkgs.baobab file-roller gnome-system-monitor loupe
]); ]);
modules = { modules = {
@ -55,6 +57,8 @@
waybar.enable = true; waybar.enable = true;
batsignal.enable = true; batsignal.enable = true;
wob.enable = true; wob.enable = true;
gammastep.enable = true;
clipse.enable = true;
# display manager # display manager
sddm.enable = true; sddm.enable = true;

View file

@ -0,0 +1,37 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.clipse;
in {
options.modules.desktop.clipse = {
enable = mkEnableOption "Enable clipse, a generic clipboard manager";
package = mkOption {
type = types.package;
default = pkgs.clipse;
};
};
config = mkIf cfg.enable {
# runtime dependencies
user.packages = with pkgs; [ wl-clipboard ];
hm.wayland.windowManager.hyprland.settings = let
class = "clipse";
in {
exec-once = [ "${lib.getExe cfg.package} -listen-shell" ];
windowrulev2 = [
"float, class:^${class}$"
"size 622 652, class:^${class}$"
"center, class:^${class}$"
"stayfocused, class:^${class}$"
"dimaround, class:^${class}$"
];
bind = [
"$mod, V, exec, ${lib.getExe pkgs.wezterm} start --class ${class} -e '${lib.getExe cfg.package}'"
];
};
};
}

View file

@ -0,0 +1,21 @@
{ lib, config, pkgs, ... }:
with lib;
let
cfg = config.modules.desktop.gammastep;
in {
options.modules.desktop.gammastep = {
enable = mkEnableOption "Enable gammastep, a blue-light filter for Wayland desktop environments";
};
config = mkIf cfg.enable {
hm.wayland.windowManager.hyprland.settings.exec-once = [ "${pkgs.gammastep}/bin/gammastep-indicator" ];
hm.services.gammastep = {
enable = true;
# portland, oregon
latitude = 45.3112;
longitude = -122.4055;
provider = "manual";
};
};
}

View file

@ -174,7 +174,7 @@ in {
exec-once = [ exec-once = [
"${lib.getExe pkgs.networkmanagerapplet}" # network applet "${lib.getExe pkgs.networkmanagerapplet}" # network applet
"${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" # polkit agent "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1" # polkit agent
"${lib.getExe pkgs.wl-clip-persist} --clipboard primary" # to fix wl clipboards disappearing "${lib.getExe pkgs.wl-clip-persist} --clipboard regular" # to fix wl clipboards disappearing
]; ];
env = [ env = [
@ -197,35 +197,56 @@ in {
# common popups # common popups
"float, class:org.gnome.FileRoller" "float, class:org.gnome.FileRoller"
"size 1100 650, class:org.gnome.FileRoller" "size 1100 650, class:org.gnome.FileRoller"
"center, class:org.gnome.FileRoller"
"float, class:org.gnome.Loupe" "float, class:org.gnome.Loupe"
"size 1100 650, class:org.gnome.Loupe" "size 1100 650, class:org.gnome.Loupe"
"center class:org.gnome.Loupe"
"float, class:com.gabm.satty" "float, class:com.gabm.satty"
"size 1100 650, class:com.gabm.satty" "size 1100 650, class:com.gabm.satty"
"center 1100 650, class:com.gabm.satty"
"float, initialTitle:^Open Folder$" "float, initialTitle:^Open Folder$"
"size 1100 650, initialTitle:^Open Folder$" "size 1100 650, initialTitle:^Open Folder$"
"center, initialTitle:^Open Folder$"
"float, initialTitle:^Open File$" "float, initialTitle:^Open File$"
"size 1100 650, initialTitle:^Open File$" "size 1100 650, initialTitle:^Open File$"
"center, initialTitle:^Open File$"
"float, initialTitle:^Open Files$" "float, initialTitle:^Open Files$"
"size 1100 650, initialTitle:^Open Files$" "size 1100 650, initialTitle:^Open Files$"
"center, initialTitle:^Open Files$"
"float, initialTitle:^Save As$" "float, initialTitle:^Save As$"
"size 1100 650, initialTitle:^Save As$" "size 1100 650, initialTitle:^Save As$"
"center, initialTitle:^Save As$"
"float, initialTitle:^Select a file to open$" "float, initialTitle:^Select a file to open$"
"size 1100 650, initialTitle:^Select a file to open$" "size 1100 650, initialTitle:^Select a file to open$"
"center, initialTitle:^Select a file to open$"
"float, initialTitle:^File Upload$" "float, initialTitle:^File Upload$"
"size 1100 650, initialTitle:^File Upload$" "size 1100 650, initialTitle:^File Upload$"
"center, initialTitle:^File Upload$"
"float, class:\.exe$" "float, class:\.exe$"
# fix focus # fix focus
"stayfocused, class:^gcr-prompter" "stayfocused, class:^gcr-prompter"
"dimaround, class:^gcr-prompter"
"stayfocused, class:^pinentry-" "stayfocused, class:^pinentry-"
"dimaround, class:^pinentry-"
"stayfocused, class:^polkit-" "stayfocused, class:^polkit-"
"dimaround, class:^polkit-"
"stayfocused, class:^rofi-" "stayfocused, class:^rofi-"
# firefox pip
"float, title:^Picture-in-Picture$"
"pin, title:^Picture-in-Picture$"
"noborder, title:^Picture-in-Picture$"
"keepaspectratio, title:^Picture-in-Picture$"
# discord pip
"pin, initialTitle:^Discord Popout$"
"float, initialTitle:^Discord Popout$"
# workspace moving # workspace moving
"workspace 1, class:^firefox" "workspace 1 silent, class:^firefox"
"workspace 2, class:code-url-handler" "workspace 2 silent, class:code-url-handler"
"workspace 4, class:vesktop" "workspace 4 silent, class:vesktop"
]; ];
blurls = [ blurls = [
@ -249,9 +270,9 @@ in {
popups = true; popups = true;
}; };
drop_shadow = false; drop_shadow = true;
#shadow_range = 4; shadow_range = 4;
#shadow_render_power = 3; shadow_render_power = 3;
}; };
animations = { animations = {

View file

@ -73,8 +73,8 @@ in {
col.inactive_border=$surface0 col.inactive_border=$surface0
} }
decoration { decoration {
col.shadow=$surface0 col.shadow=$crust
col.shadow_inactive=$surface0 col.shadow_inactive=$crust
} }
misc { misc {
background_color=$crust background_color=$crust
@ -95,6 +95,10 @@ in {
}; };
rofi = ./rofi.rasi; rofi = ./rofi.rasi;
wezterm = ''
config.color_scheme = 'Catppuccin ${pascalCase variant}'
'';
}; };
}; };
} }

View file

@ -58,6 +58,8 @@ in {
}; };
rofi = mkOpt (nullOr path) null; rofi = mkOpt (nullOr path) null;
wezterm = mkOpt (nullOr str) null;
}; };
config = mkIf (cfg.active != null) { config = mkIf (cfg.active != null) {
@ -78,12 +80,14 @@ in {
cursorTheme = cfg.cursorTheme; cursorTheme = cfg.cursorTheme;
iconTheme = cfg.iconTheme; iconTheme = cfg.iconTheme;
theme = cfg.gtkTheme; theme = cfg.gtkTheme;
gtk3.extraConfig.gtk-application-prefer-dark-theme = mkIf cfg.dark "1";
gtk4.extraConfig.gtk-application-prefer-dark-theme = mkIf cfg.dark "1";
}; };
hm.qt = { qt = {
enable = true; enable = true;
platformTheme.name = "gtk"; platformTheme = "gnome";
style.name = "gtk2"; style = "adwaita";
}; };
hm.home.pointerCursor = { hm.home.pointerCursor = {

View file

@ -13,40 +13,40 @@ in {
tmp.useTmpfs = lib.mkDefault true; tmp.useTmpfs = lib.mkDefault true;
tmp.cleanOnBoot = lib.mkDefault (!config.boot.tmp.useTmpfs); tmp.cleanOnBoot = lib.mkDefault (!config.boot.tmp.useTmpfs);
kernel.sysctl = { kernel.sysctl = {
# magic sysrq key, allows low-level commands through keyboard input # magic sysrq key, allows low-level commands through keyboard input
"kernel.sysrq" = 0; "kernel.sysrq" = 0;
## TCP hardening ## TCP hardening
# prevent bogus ICMP errors from filling up logs # prevent bogus ICMP errors from filling up logs
"net.ipv4.icmp_ignore_bogus_error_responses" = 1; "net.ipv4.icmp_ignore_bogus_error_responses" = 1;
# do not accept IP source packets (we are not a router) # do not accept IP source packets (we are not a router)
"net.ipv4.conf.all.accept_source_route" = 0; "net.ipv4.conf.all.accept_source_route" = 0;
"net.ipv6.conf.all.accept_source_route" = 0; "net.ipv6.conf.all.accept_source_route" = 0;
# don't send ICMP redirects (again, we're not a router) # don't send ICMP redirects (again, we're not a router)
"net.ipv4.conf.all.send_redirects" = 0; "net.ipv4.conf.all.send_redirects" = 0;
"net.ipv4.conf.default.send_redirects" = 0; "net.ipv4.conf.default.send_redirects" = 0;
# refuse ICMP redirects (MITM mitigations) # refuse ICMP redirects (MITM mitigations)
"net.ipv4.conf.all.accept_redirects" = 0; "net.ipv4.conf.all.accept_redirects" = 0;
"net.ipv4.conf.default.accept_redirects" = 0; "net.ipv4.conf.default.accept_redirects" = 0;
"net.ipv4.conf.all.secure_redirects" = 0; "net.ipv4.conf.all.secure_redirects" = 0;
"net.ipv4.conf.default.secure_redirects" = 0; "net.ipv4.conf.default.secure_redirects" = 0;
"net.ipv6.conf.all.accept_redirects" = 0; "net.ipv6.conf.all.accept_redirects" = 0;
"net.ipv6.conf.default.accept_redirects" = 0; "net.ipv6.conf.default.accept_redirects" = 0;
# protects against SYN flood attacks # protects against SYN flood attacks
"net.ipv4.tcp_syncookies" = 1; "net.ipv4.tcp_syncookies" = 1;
# incomplete protection against TIME-WAIT assassination # incomplete protection against TIME-WAIT assassination
"net.ipv4.tcp_rfc1337" = 1; "net.ipv4.tcp_rfc1337" = 1;
## TCP optimization ## TCP optimization
# TCP fastopen # TCP fastopen
"net.ipv4.tcp_fastopen" = 3; "net.ipv4.tcp_fastopen" = 3;
# bufferbloat mitigations + improvement in throughput and latency # bufferbloat mitigations + improvement in throughput and latency
"net.ipv4.tcp_conjestion_control" = "bbr"; "net.ipv4.tcp_conjestion_control" = "bbr";
"net.core.default_qdisc" = "cake"; "net.core.default_qdisc" = "cake";
};
kernelModules = [ "tcp_bbr" ];
}; };
kernelModules = [ "tcp_bbr" ];
};
security = { security = {
# prevents replacing the kernel without a reboot # prevents replacing the kernel without a reboot
@ -59,6 +59,8 @@ in {
# personal computer? no firewall ty :3 # personal computer? no firewall ty :3
networking.firewall.enable = false; networking.firewall.enable = false;
# TODO: usbguard
} // (mkIf cfg.useDoas { } // (mkIf cfg.useDoas {
security.sudo.enable = false; security.sudo.enable = false;
security.doas.enable = true; security.doas.enable = true;

View file

@ -5,7 +5,6 @@ let
cfg = config.modules.software.distractions.discord; cfg = config.modules.software.distractions.discord;
flags = [ flags = [
"--flag-switches-begin" "--flag-switches-begin"
"--flag-switches-end"
"--disable-gpu-memory-buffer-video-frames" "--disable-gpu-memory-buffer-video-frames"
"--enable-accelerated-mjpeg-decode" "--enable-accelerated-mjpeg-decode"
"--enable-accelerated-video" "--enable-accelerated-video"
@ -13,36 +12,38 @@ let
"--enable-native-gpu-memory-buffers" "--enable-native-gpu-memory-buffers"
"--enable-zero-copy" "--enable-zero-copy"
"--ignore-gpu-blocklist" "--ignore-gpu-blocklist"
"--disable-features=UseOzonePlatform" "--enable-features=UseOzonePlatform"
"--enable-features=VaapiVideoDecoder" "--enable-features=VaapiVideoDecoder"
"--enable-features=VaapiVideoEncoder"
"--enable-features=WebRTCPipeWireCapturer"
"--flag-switches-end"
]; ];
vanillaDiscordPackage = pkgs.discord-canary.override {
withOpenASAR = true;
withVencord = true;
};
package = if cfg.armcord then pkgs.armcord else (if cfg.vesktop then pkgs.vesktop else vanillaDiscordPackage);
in { in {
options.modules.software.distractions.discord = { options.modules.software.distractions.discord = {
enable = mkEnableOption "Enable discord, a social messaging app"; enable = mkEnableOption "Enable discord, a social messaging app";
vesktop = mkEnableOption "Use vesktop, an alternative discord client."; armcord = mkEnableOption "Use Armcord, an alternative Electron client";
vesktop = mkEnableOption "Use Vesktop, an alternative Electron client with vencord preinstalled";
}; };
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable {
(mkIf (!cfg.vesktop) { assertions = [
user.packages = let {
discord = (pkgs.discord-canary.override { assertion = !(cfg.armcord && cfg.vesktop);
withOpenASAR = true; message = "You must either enable Armcord or Vesktop, not both";
withVencord = true; }
}).overrideAttrs (old: { ];
preInstall = ''
gappsWrapperArgs=+("--add-flags" "${concatStringsSep " " flags}") user.packages = [
''; (package.overrideAttrs (old: {
}); preInstall = ''
in [ discord ]; gappsWrapperArgs+=("--add-flags" "${concatStringsSep " " flags}")
}) '';
(mkIf cfg.vesktop { }))
user.packages = [ ];
(pkgs.vesktop.overrideAttrs (old: { };
preInstall = ''
gappsWrapperArgs+=("--add-flags" "${concatStringsSep " " flags}")
'';
}))
];
})
]);
} }

View file

@ -12,6 +12,7 @@ in {
schemeName = "generated"; schemeName = "generated";
in mkIf cfg.enable { in mkIf cfg.enable {
environment.variables.EDITOR = "micro"; environment.variables.EDITOR = "micro";
environment.variables.MICRO_TRUECOLOR = "1";
hm.programs.micro = { hm.programs.micro = {
enable = true; enable = true;
@ -23,7 +24,7 @@ in {
tabsize = 2; tabsize = 2;
tabstospaces = true; tabstospaces = true;
colorScheme = schemeName; colorscheme = schemeName;
}; };
}; };

View file

@ -10,9 +10,17 @@ in {
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
user.packages = with pkgs; [ bat fd fzf grc ]; # runtime dependencies of plugins
user.packages = with pkgs; [
environment.systemPackages = with pkgs.fishPlugins; [ fzf-fish tide ]; # fzf-fish
bat fd fzf
# grc
grc
# tide
fishPlugins.tide
# done
libnotify
];
users.defaultUserShell = pkgs.fish; users.defaultUserShell = pkgs.fish;
programs.fish.enable = true; programs.fish.enable = true;
@ -20,7 +28,14 @@ in {
colorScript = nix-colors-lib.shellThemeFromScheme { scheme = config.colorScheme; }; colorScript = nix-colors-lib.shellThemeFromScheme { scheme = config.colorScheme; };
in { in {
enable = true; enable = true;
plugins = [ { name = "grc"; src = pkgs.fishPlugins.grc.src; } ]; plugins = with pkgs.fishPlugins; [
{ name = "fzf-fish"; src = fzf-fish.src; }
{ name = "grc"; src = grc.src; }
{ name = "tide"; src = tide.src; }
{ name = "done"; src = done.src; }
{ name = "autopair"; src = autopair.src; }
];
interactiveShellInit = '' interactiveShellInit = ''
sh ${colorScript} sh ${colorScript}
''; '';

View file

@ -24,11 +24,12 @@ in {
config.font_size = ${toString fonts.monospaceBitmap.size} config.font_size = ${toString fonts.monospaceBitmap.size}
config.freetype_load_flags = 'MONOCHROME' config.freetype_load_flags = 'MONOCHROME'
config.enable_wayland = false config.enable_wayland = false
config.color_scheme = 'Catppuccin Mocha'
config.use_fancy_tab_bar = false config.use_fancy_tab_bar = false
config.use_resize_increments = true config.use_resize_increments = true
config.initial_cols = 120 config.initial_cols = 120
config.initial_rows = 40 config.initial_rows = 40
config.window_background_opacity = 0.8
${config.modules.desktop.themes.wezterm or ""}
config.window_frame = { config.window_frame = {
font = wezterm.font '${fonts.sansSerif.family}', font = wezterm.font '${fonts.sansSerif.family}',