tidying code

This commit is contained in:
serenity-F 2025-12-30 23:12:55 +10:00
parent 77485acf8c
commit dd6e309f1f
23 changed files with 14 additions and 607 deletions

99
home/desktop/sway/sway.nix Executable file
View file

@ -0,0 +1,99 @@
{ lib, pkgs, config, ... }:
with lib;
with pkgs;
let
in {
imports = [ ./swayfx.nix ];
wayland.windowManager.sway = {
enable = true;
extraSessionCommands = ''
export NIXOS_OZONE_WL=1
export SDL_VIDEODRIVER=wayland,windows
export QT_QPA_PLATFORM=wayland
export QT_WAYLAND_DISABLE_WINDOWDECORATION="1"
export XDG_CURRENT_DESKTOP=sway
export XDG_SESSION_TYPE=wayland
export QT_QPA_PLATFORMTHEME=qt5ct
'';
extraConfig = "";
xwayland = true;
checkConfig = false;
package = pkgs.swayfx;
wrapperFeatures = {
base = true;
gtk = true;
};
systemd = {
enable = true;
#xdgAutostart = true;
#extraCommands = [
#];
## Needed for soteria - https://github.com/NixOS/nixpkgs/issues/373290
variables = [ "--all" ];
};
swaynag = {
enable = true;
settings = { };
};
config = {
output = {
eDP-1 = {
## Set HIDP scale (pixel integer scaling)
scale = "2";
};
};
defaultWorkspace = "workspace number 0";
## Use Wofi as menu
menu = "menu";
## Use kitty as default terminal
terminal = "kitty";
## Startup scripts and programs
startup = [
{ command = "startupExtra"; }
{
command = "startup";
} # defined in `home/scripts/startup.nix`
#{ command = "kitty"; }
{ command = "kitty btop"; }
];
modifier = "Mod4";
floating = {
modifier = "Mod4";
titlebar = false;
};
## Window and focus settings
window = { };
focus = {
followMouse = true;
mouseWarping = false;
newWindow = "smart";
};
keybindings =
mkOptionDefault (import ./keybinds.nix { inherit pkgs config; });
};
};
home = {
packages = with pkgs; [ ];
sessionVariables = {
XDG_SESSION_TYPE = "wayland";
XDG_CURRENT_DESKTOP = "sway";
SDL_VIDEODRIVER = "wayland";
# needs qt5.qtwayland in systemPackages
QT_QPA_PLATFORM = "wayland";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
};
};
}

142
home/desktop/sway/swayfx.nix Executable file
View file

@ -0,0 +1,142 @@
## Sway eyecandy options - https://github.com/WillPower3309/swayfx
{ self, inputs, outputs, lib, config, pkgs, ... }:
with lib;
with pkgs;
let
bg-color = "#424242";
inactive-bg-color = "#424242";
text-color = "#4f97d7";
inactive-text-color = "#676E7D";
urgent-bg-color = "#E53935";
colorSchemeDark = rec {
primary = {
normal = {
background = "181818";
foreground = "b9b9b9";
};
bright = {
background = bright.black;
foreground = bright.white;
};
};
normal = {
black = "252525";
gray = "5b5b5b";
red = "ed4a46";
green = "70b433";
yellow = "dbb32d";
blue = "368aeb";
magenta = "eb6eb7";
cyan = "3fc5b7";
white = "777777";
};
bright = {
black = "3b3b3b";
gray = "7b7b7b";
red = "ff5e56";
green = "83c746";
yellow = "efc541";
blue = "4f9cfe";
magenta = "ff81ca";
cyan = "56d8c9";
white = "dedede";
};
};
colorScheme = colorSchemeDark;
font = "Spleen-32x64";
bgColor = colorScheme.primary.normal.background;
fgColor = colorScheme.primary.bright.foreground;
acColor = colorScheme.normal.red;
acColor2 = colorScheme.normal.yellow;
in {
imports = [ ];
wayland.windowManager.sway = {
extraSessionCommands = "";
extraConfig = "
default_border pixel 3
smart_corner_radius enable
corner_radius 15
shadows enable
shadows_on_csd enable
shadow_blur_radius 10
blur enable
blur_xray disable
blur_passes 4
blur_radius 1
";
config = rec {
## Use waybar as desktop statusbar
bars = [{
command = "${waybar}/bin/waybar";
position = "top";
fonts = { size = 15.0; };
}];
## Borders
window = {
titlebar = false;
border = 1;
};
floating = { border = 1; };
gaps.smartBorders = "on";
## Gaps
gaps = {
inner = 5;
outer = 5;
smartGaps = false;
};
## Fonts
fonts = {
names = [ "Spleen-32x64" ];
size = 10.0;
};
## Colours
colors = {
focused = {
border = bg-color;
childBorder = bg-color;
background = bg-color;
text = text-color;
indicator = "#00ff00";
};
unfocused = {
border = inactive-bg-color;
childBorder = inactive-bg-color;
background = inactive-bg-color;
text = inactive-text-color;
indicator = "#00ff00";
};
focusedInactive = {
border = inactive-bg-color;
childBorder = inactive-bg-color;
background = inactive-bg-color;
text = inactive-text-color;
indicator = "#00ff00";
};
urgent = {
border = urgent-bg-color;
childBorder = urgent-bg-color;
background = urgent-bg-color;
text = text-color;
indicator = "#00ff00";
};
};
};
};
}