beginning of dendritic rebuild

This commit is contained in:
serenity-F 2026-04-22 03:15:28 +10:00
parent 080e929cbc
commit d924909d3b
No known key found for this signature in database
56 changed files with 121 additions and 149 deletions

207
old/home/desktop/default.nix Executable file
View file

@ -0,0 +1,207 @@
{ inputs, config, pkgs, lib, flakePath, homeDirectory, ... }:
let
# Base desktop theme
#serenityos-base = import ./serenityos-base.nix { inherit pkgs; };
#line-icons = import ./line-icons.nix { inherit pkgs; };
in {
imports = [
# Import common desktop configs
./xdg-mime.nix # file associations
./wofi.nix # launcher
./niri # WM
# Import user theme(s)
../resources/theme
../resources/theme/SerenityOS.nix
];
# Services
systemd.user.startServices = "sd-switch"; # cant remember
services = {
# GTK keyring for password prompts
gnome-keyring = {
enable = true; # enables gnome-keyring
};
# Phone <-> Desktop integration
kdeconnect = {
enable = false; # enables kdeconnect
indicator = false; # enables tray applet
};
# Disk automount service
udiskie = {
enable = true; # enables udiskie
tray = "always"; # enables tray applet
notify = true; # sends notification on disk mount
automount = true; # automatically mount new disk
};
};
xdg = {
# Creates user directory variables
userDirs = {
enable = true;
createDirectories = true;
extraConfig = {
FLAKE = "${flakePath}";
SYNC = "${homeDirectory}/Sync";
};
};
# Enables portals
portal = {
enable = true;
xdgOpenUsePortal = false;
# Extra portal config
config = {
common."org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
common.default = [ "gtk" "wlr" "gnome" ];
sway.default = [ "gtk" "wlr" "gnome" ];
};
# Packages to use for config
configPackages = with pkgs; [
xdg-desktop-portal-gtk
xdg-desktop-portal-wlr
xdg-desktop-portal-gnome
];
# Extra portals to enable
extraPortals = with pkgs; [
xdg-desktop-portal-gtk
xdg-desktop-portal-wlr
xdg-desktop-portal-gnome
];
};
};
qt = {
# Enables QT
enable = true;
# Specifies the base theme to use
#platformTheme.name = "Colloid-dark";
#style = {
#name = "Colloid-dark";
#package = pkgs.colloid-kde;
#};
};
gtk = {
# Enables GTK
enable = true;
# Specifies the font to use
font = {
name = "${config.theme.font}";
size = 10;
};
# Specifies the icon theme to use
iconTheme = {
name = "Flat-Remix-Grey-Darkest";
package = pkgs.flat-remix-icon-theme;
};
# Specifies the base theme to use
theme = lib.mkForce {
name = "Colloid-Dark";
package = pkgs.colloid-gtk-theme;
};
# Tries to force a dark theme globally
gtk3.extraConfig.gtk-application-prefer-dark-theme = 1;
gtk4.extraConfig.gtk-application-prefer-dark-theme = 1;
};
# Fonts
# surely there is a better way to do fonts ?
fonts = { fontconfig = { enable = true; }; };
home = {
# Sets user session variables
sessionVariables = {
GTK_THEME = "Colloid-Teal-Dark-Dracula"; # i haev no idea what im doing
BROWSER = "firefox"; # furry browser
TERMINAL = "kitty"; # furry terminal
NIXPKGS_ALLOW_UNFREE = 1; # unfortunately
};
# Copies cursor theme files to the relevant location
file.".icons/bibata".source = "${pkgs.bibata-cursors}/share/icons/Bibata-Modern-Classic";
# Specifies pointer theme and size
pointerCursor = {
gtk.enable = true; # GTK cursor
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 12;
};
# Base package set to include in home/desktop configuration
packages = with pkgs; [
# Networking
#networkmanagerapplet # Tray applet for networkmanager
#networkmanager # Network manager ...
# Security
gnome-keyring # Keyring for login prompts
gnome-secrets # GTK password manager
keepass-diff # CLI-tool to diff kbdx files
keepassxc # Feature rich password manager
seahorse # GTK secrets managment
soteria # GTK/rust desktop-agnostic polkit agent
# Desktop Features
brightnessctl # Display brightness control
wdisplays # Display configuration
wlr-randr # Display modesetting
wlsunset # Bluelight filter
wl-clipboard # Clipboard service
# Desktop App Suite
gnome-calculator # Simple calculator
appimage-run # Runs appimages
file-roller # Simple archive manager
themix-gui # GTK theme creation tool
nautilus # Simple file manager
swayimg # Terminal based image viewer
zathura # Simple PDF viewer
gparted # GUI partition editor
# Wayland
wayland-protocols
wayland-utils
xwayland
wlroots
# QT
libsForQt5.qt5.qtwayland
libsForQt5.qt5ct
# Misc.
libnotify # Notifier library
libva # Library for ???
meson # Package builder
];
};
## ORGANISE THIS MESS
# https://mynixos.com/home-manager/options/home.file.%3Cname%3E
# https://nix-community.github.io/home-manager/options.xhtml#opt-home.file
# https://nix-community.github.io/home-manager/options.xhtml#opt-home.activation
# need option for `zfs set mountpoint=/myspecialfolder mypool`
# need to set up auto luks unlock with sops-nix
## Provides LUKS key for Asphodel
#environment.etc."crypttab".text = ''
#Asphodel /dev/disk/by-uuid/45f5f6ad-a676-4bc1-ad4b-e3e26b5697f4 ${config.sops.secrets.asphodelLuksPassword}
#'';
## Mounts Asphodel to typical media location
#fileSystems."/run/media/${user}/Asphodel".device =
#"/dev/mapper/Asphodel";
#home.file = { # Files and directories to copy to ${homeDirectory}
## Example format for home.file
#"Foo" = { # Name for the copied file
#source = ./Foo; # Source is relative to this file
#target = "Desired/Path/To/Foo"; # Target path for Foo within ${homeDirectory}
#recursive = true; # Unsure if necessary for most things
#};
#};
# Syncthing program service
#syncthing = {
#enable = false; # enables syncthing
#tray.enable = true; # enables tray applet
#guiAddress = "home.syncthing:8384"; # local addess to use
#};
}

135
old/home/desktop/niri/binds.nix Executable file
View file

@ -0,0 +1,135 @@
{ config, pkgs, lib, ... }:
let
widthDivisions = [ 1.0 2.0 3.0 4.0 ];
heightDivisions = [ 1.0 2.0 3.0 4.0 ];
# black magic, expected output:
# [ { proportion = 1.0 / 1.0 }
# { proportion = 1.0 / 2.0 }
# ...
# { proportion = 2.0 / 1.0 }
# { proportion = 2.0 / 3.0 }
# ...
# { proportion = 4.0 / 4.0 } ]
getProportions = divisions: lib.lists.unique(lib.lists.flatten( # TODO: make this a callable function
map(x: map(y:
{ proportion = x / y; }
) divisions) divisions
));
# then get all the unique outputs (removing double ups of 0.5 or others)
columnWidths = getProportions widthDivisions;
columnWidthsFiltered = builtins.filter(x: builtins.lessThan x.proportion 1.0) columnWidths; # just get the values that are below 1
windowHeights = getProportions heightDivisions;
windowHeightsFiltered = builtins.filter(x: builtins.lessThan x.proportion 1.0) windowHeights;
in {
## Goals:
## - Way to open new windows in specific areas of the creen
## - Way to spawn terminals floating
## - Interact with Noctalia shell more with binds
# credit sodiboo for this one in particular
programs.niri.settings.layout = {
preset-column-widths = builtins.sort( # sort list for predictable behaviour
a: b: builtins.lessThan a.proportion b.proportion
) columnWidthsFiltered;
default-column-width.proportion = 1.0 / 3.0;
preset-window-heights = builtins.sort(
a: b: builtins.lessThan a.proportion b.proportion
) windowHeightsFiltered;
};
programs.niri.settings.binds = with config.lib.niri.actions; {
## Window manager controls
# Debug & Utility
"Mod+Shift+Slash".action = show-hotkey-overlay; # I am forgetful
"Mod+Shift+Escape" = { # Ensures niri keybinds are read
action = toggle-keyboard-shortcuts-inhibit;
allow-inhibiting = false;
};
# Session management
"Ctrl+Alt+Delete".action = quit; # Log out
#"Mod+Escape".action.spawn = "<lock>"; # Screen lock
"Mod+Shift+P".action = power-off-monitors; # Power saving
# Task management
"Mod+Q".action = close-window;
"Mod+Q".repeat = false; # No window decorations lol
"Mod+O".action = toggle-overview;
"Mod+O".repeat = false; # Multi-tasking
"Mod+Tab".action = spawn "${pkgs.wofi}/bin/wofi";
"Mod+Tab".repeat = false; # App launcher
# Terminal
"Mod+Return".action = spawn "${pkgs.kitty}/bin/kitty";
"Mod+Return".repeat = false;
#"Mod+Shift+Return".action = spawn floating "${pkgs.kitty}/bin/kitty";
#"Mod+Shift+Return".repeat = false;
# Keyboard focus controls
"Mod+H".action = focus-column-left;
"Mod+L".action = focus-column-right; # VIM binds
"Mod+J".action = focus-window-or-workspace-down;
"Mod+K".action = focus-window-or-workspace-up;
"Mod+Left".action = focus-column-left;
"Mod+Right".action = focus-column-right; # Regular binds
"Mod+Down".action = focus-workspace-down;
"Mod+Up".action = focus-workspace-up;
# Mouse focus controls
"Mod+WheelScrollLeft".action = focus-column-left;
"Mod+WheelScrollLeft".cooldown-ms = 200;
"Mod+WheelScrollRight".action = focus-column-right;
"Mod+WheelScrollRight".cooldown-ms = 200;
"Mod+WheelScrollDown".action = focus-workspace-down;
"Mod+WheelScrollDown".cooldown-ms = 200;
"Mod+WheelScrollUp".action = focus-workspace-up;
"Mod+WheelScrollUp".cooldown-ms = 200;
# Movement controls
"Mod+Shift+H".action = move-column-left;
"Mod+Shift+L".action = move-column-right; # VIM binds
"Mod+Shift+J".action = move-column-to-workspace-down;
"Mod+Shift+K".action = move-column-to-workspace-up;
"Mod+Shift+Left".action = move-column-left;
"Mod+Shift+Right".action = move-column-right; # Regular binds
"Mod+Shift+Down".action = move-column-to-workspace-down;
"Mod+Shift+Up".action = move-column-to-workspace-up;
# Size controls
#"Mod+1".action = set-column-width "25%";
#"Mod+2".action = set-column-width "50%";
#"Mod+3".action = set-column-width "75%";
#"Mod+4".action = set-column-width "100%";
"Mod+Minus".action = switch-preset-column-width-back;
"Mod+Equal".action = switch-preset-column-width;
"Mod+Shift+Minus".action = switch-preset-window-height-back;
"Mod+Shift+Equal".action = switch-preset-window-height;
"Mod+C".action = center-visible-columns;
"Mod+F".action = maximize-column;
"Mod+Shift+F".action = fullscreen-window;
"Mod+Ctrl+F".action = expand-column-to-available-width;
"Mod+Space".action = toggle-window-floating;
"Mod+Shift+Space".action = switch-focus-between-floating-and-tiling;
# Screen capture
"Mod+S".action.screenshot = {show-pointer = false;};
"Mod+Shift+S".action.screenshot-window = []; # Screenshot
"Mod+Shift+Alt+S".action.screenshot-screen = {show-pointer = true;};
#"Mod+hypothetical+bind".action.screenshot-all-screens = {show-pointer = true;};
#"Mod+hypothetical+bind".action.record-area = {show-pointer = true;};
#"Mod+hypothetical+bind".action.record-window = {show-pointer = true;};
#"Mod+hypothetical+bind".action.record-entire-screen = {show-pointer = true;};
#"Mod+hypothetical+bind".action.record-all-screens = {show-pointer = true;};
};
}

145
old/home/desktop/niri/default.nix Executable file
View file

@ -0,0 +1,145 @@
{ inputs, config, pkgs, lib, ... }:
let
in {
imports = [
inputs.niri.homeModules.niri
#inputs.noctalia.homeModules.default
./noctalia.nix
./window-rules.nix
#./visual.nix
./binds.nix
];
#xdg.configFile."niri/config.kdl".source = ./niri.kdl;
home.packages = with pkgs; [ jq xwayland-satellite-unstable ];
programs = {
niri = {
enable = true;
package = pkgs.niri-unstable;
settings = {
environment = {
MOZ_ENABLE_WAYLAND = "1";
NIXOS_OZONE_WL = "1";
XDG_SESSION_TYPE = "wayland";
XDG_CURRENT_DESKTOP = "niri";
QT_QPA_PLATFORM = "wayland;xcb";
QT_QPA_PLATFORMTHEME = "qt5ct";
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
SDL_VIDEODRIVER = "wayland";
WLR_RENDERER = "vulkan";
DISPLAY = ":0";
};
xwayland-satellite = {
enable = true;
path = lib.getExe pkgs.xwayland-satellite-unstable;
};
outputs."DP-4" = {
mode = {
width = 3440;
height = 1440;
refresh = 74.924;
};
position = {
x = 1920;
y = 0;
};
scale = 1.0;
variable-refresh-rate = "on-demand";
focus-at-startup = true;
};
outputs."HDMI-A-2" = {
mode = {
width = 1920;
height = 1080;
refresh = 60.0;
};
position = {
x = 0;
y = 360;
};
scale = 1.0;
};
input = {
focus-follows-mouse = {
enable = true;
max-scroll-amount = "0%";
};
keyboard = { numlock = true; };
mouse = {
enable = true;
natural-scroll = false;
};
touchpad = {
enable = true;
natural-scroll = true;
};
trackpoint = { enable = true; };
};
prefer-no-csd = true;
layout = {
gaps = 8;
struts = {
left = 2;
right = 2;
top = 2;
bottom = 4;
};
center-focused-column = "never";
preset-column-widths = [
#{proportion = 0.25;}
{ proportion = 0.33333; }
{ proportion = 0.5; }
{
proportion = 0.66667;
}
#{proportion = 0.75;}
{ proportion = 1.0; }
];
border = { enable = false; };
focus-ring = {
enable = true;
width = 2;
active.gradient = {
from = "#00cdff";
to = "#80c8ff";
angle = 45;
};
inactive.gradient = {
from = "#705050";
to = "#505070";
angle = 45;
};
};
};
animations = {
enable = true;
slowdown = 1.25;
};
spawn-at-startup = [
{ argv = [ "xwayland-satellite" ]; }
{ argv = [ "noctalia-shell" ]; }
{ argv = [ "kitty" "btop" ]; }
];
hotkey-overlay = {
skip-at-startup = true;
hide-not-bound = false;
};
};
};
};
}

View file

@ -0,0 +1,99 @@
{
inputs, outputs, config, pkgs, lib,
user, userDescription,
homeDirectory,
wallpapersPath, wallpaper,
avatarsPath, avatar,
...
}:
{
#home-manager.users.${user} = {
# import the home manager module
imports = [ inputs.noctalia.homeModules.default ];
# configure options
# https://docs.noctalia.dev/getting-started/nixos/
programs.noctalia-shell = {
enable = true;
settings = {
# configure noctalia here
general = {
avatarImage = "${avatar}";
radiusRatio = 0.2;
showSessionButtonOnLockScreen = false;
showHibernateOnLockScreen = true;
};
location = {
monthBeforeDay = true;
name = "Brisbane, Australia";
};
colorSchemes = { predefinedScheme = "Monochrome"; };
wallpaper = {
directory = "${wallpapersPath}";
hideWallpaperFilenames = true;
};
appLauncher = {
terminalCommand = "kitty -e";
showCategories = false;
};
bar = {
density = "comfortable";
position = "top";
showCapsule = false;
monitors = [ "DP-4" ];
floating = true;
marginVertical = 0.25;
marginHorizontal = 0.5;
widgets = {
left = [{
icon = "rocket";
id = "CustomButton";
leftClickExec = "wofi";
}];
center = [{
hideUnoccupied = false;
id = "Workspace";
labelMode = "none";
}];
right = [
{ id = "Tray"; }
{ id = "WiFi"; }
{ id = "Bluetooth"; }
{
alwaysShowPercentage = false;
id = "Battery";
warningThreshold = 30;
}
{
formatHorizontal = "HH:mm";
formatVertical = "HH mm";
id = "Clock";
useMonospacedFont = true;
usePrimaryColor = true;
}
{
id = "ControlCenter";
useDistroLogo = true;
}
];
};
};
#ControlCenter = { };
};
# this may also be a string or a path to a JSON file,
# but in this case must include *all* settings.
};
#};
}

View file

@ -0,0 +1,51 @@
_:
let
windowRules = [
{
geometry-corner-radius = let radius = 16.0;
in {
bottom-left = radius;
bottom-right = radius;
top-left = radius;
top-right = radius;
};
clip-to-geometry = true;
draw-border-with-background = false;
}
{
matches = [{ app-id = "kitty"; }];
opacity = 0.95;
}
{
matches = [{ is-floating = true; }];
default-floating-position = {
relative-to = "top-left";
x = 1720;
y = 720;
};
max-height = 720;
max-width = 1720;
opacity = 0.95;
shadow.enable = true;
}
{
matches = [{title = "python\s[A-Za-z]+\.py";}];
open-floating = true;
open-focused = true;
}
{
matches = [{title = "Python Turtle Graphics";}];
open-floating = true;
open-focused = true;
}
];
in {
programs.niri.settings = {
window-rules = windowRules;
layout = { background-color = "transparent"; };
layer-rules = [{
matches = [{ namespace = "^noctalia-wallpaper*"; }];
place-within-backdrop = true;
}];
};
}

100
old/home/desktop/wofi.nix Executable file
View file

@ -0,0 +1,100 @@
{ config, ... }: {
programs.wofi = {
enable = true;
settings = {
term = "kitty";
show = "drun";
width = 500;
height = 300;
prompt = "Programs";
normal_window = true;
key_exit = "Escape";
key_expand = "Tab";
layer = "top";
gtk_dark = true;
orientation = "vertical";
halign = "fill";
line_wrap = "off";
dynamic_lines = false;
allow_markup = true;
allow_images = true;
image_size = 24;
hide_scroll = true;
hide_search = false;
exec_search = false;
parse_search = false;
insensitive = true;
no_actions = true;
sort_order = "default";
filter_rate = 100;
## Steam not launching from wofi, but will launch in terminal
## See: core/modules/gaming.nix
## https://github.com/ValveSoftware/steam-for-linux/issues/9940
disable_prime = false;
};
style = ''
/** ********** Fonts ********** **/
* {
font-family: "${config.theme.font}";
font-weight: 500;
font-size: 12px;
}
#window {
background-color: #${config.theme.colors.alt-bg};
color: #${config.theme.colors.alt-fg};
border-radius: ${toString config.theme.rounding}px;
}
#outer-box {
padding: 20px;
}
#input {
background-color: #${config.theme.colors.bg};
border: 0px solid #${config.theme.colors.primary-bg};
padding: 8px 12px;
}
#scroll {
margin-top: 20px;
}
#inner-box {}
#img {
padding-right: 8px;
}
#text {
color: #${config.theme.colors.color7};
}
#text:selected {
color: #${config.theme.colors.fg};
}
#entry {
padding: 6px;
}
#entry:selected {
background-color: #${config.theme.colors.primary-bg};
color: #${config.theme.colors.primary-fg};
}
#unselected {}
#selected {}
#input,
#entry:selected {
border-radius: ${toString (config.theme.rounding - 10)}px;
}
'';
};
}

84
old/home/desktop/xdg-mime.nix Executable file
View file

@ -0,0 +1,84 @@
# Mime allows us to configure the default applications for each file type
{
xdg = {
mime.enable = true;
configFile."mimeapps.list" = {
#enable = true; # enables ? following declarations
force = true; # forces the following declarations
};
#desktopEntries = { };
mimeApps = {
enable = true;
associations = {
added = {
## General Desktop
#"text/plain" = [ "nvim.desktop" ];
"text/markdown" = [ "obsidian.desktop" ];
"inode/directory" = [ "nautilus.desktop" ];
## Multimedia
"image/gif" = [ "gimp.desktop" ];
"image/png" = [ "gimp.desktop" ];
"image/jpg" = [ "gimp.desktop" ];
"image/jpeg" = [ "gimp.desktop" ];
"image/webp" = [ "gimp.desktop" ];
"audio/aac" = [ "vlc.desktop" ];
"audio/mp4" = [ "vlc.desktop" ];
"audio/ogg" = [ "vlc.desktop" ];
"audio/opus" = [ "vlc.desktop" ];
"audio/mpeg" = [ "vlc.desktop" ];
"audio/aiff" = [ "vlc.desktop" ];
"audio/flac" = [ "vlc.desktop" ];
## Web
"text/css" = [ "firefox.desktop" ];
"text/html" = [ "firefox.desktop" ];
"application/json" = [ "nvim.desktop" ];
};
};
defaultApplications = {
## General Desktop
"text/plain" = [ "nvim.desktop" ];
"text/markdown" = [ "nvim.desktop" ];
"inode/directory" = [ "yazi.desktop" ];
"application/pdf" = [ "zathura.desktop" ];
"application/zip" = [ "org.gnome.FileRoller.desktop" ];
## Multimedia
"image/gif" = [ "swayimg.desktop" ];
"image/png" = [ "swayimg.desktop" ];
"image/jpg" = [ "swayimg.desktop" ];
"image/jpeg" = [ "swayimg.desktop" ];
"image/webp" = [ "swayimg.desktop" ];
"audio/aac" = [ "strawberry.desktop" ];
"audio/mp4" = [ "strawberry.desktop" ];
"audio/ogg" = [ "strawberry.desktop" ];
"audio/opus" = [ "strawberry.desktop" ];
"audio/mpeg" = [ "strawberry.desktop" ];
"audio/aiff" = [ "strawberry.desktop" ];
"audio/flac" = [ "strawberry.desktop" ];
"audio/vnd.wav" = [ "strawberry.desktop" ];
"video/mp4" = [ "vlc.desktop" ];
"video/mpeg" = [ "vlc.desktop" ];
"video/webm" = [ "vlc.desktop" ];
"video/x-m4v" = [ "vlc.desktop" ];
"video/x-msvideo" = [ "vlc.desktop" ];
"video/quicktime" = [ "vlc.desktop" ];
"video/x-matroska" = [ "vlc.desktop" ];
## Web
"text/css" = [ "nvim.desktop" ];
"text/html" = [ "nvim.desktop" ];
"application/json" = [ "firefox.desktop" ];
"x-scheme-handler/ftp" = [ "firefox.desktop" ];
"x-scheme-handler/http" = [ "firefox.desktop" ];
"x-scheme-handler/https" = [ "firefox.desktop" ];
## Code
"text/x-shellscript" = [ "nvim.desktop" ];
"text/x-xml" = [ "nvim.desktop" ];
"text/x-yaml" = [ "nvim.desktop" ];
"text/x-toml" = [ "nvim.desktop" ];
"text/x-nix" = [ "nvim.desktop" ];
"text/x-rust" = [ "nvim.desktop" ];
"text/x-python" = [ "nvim.desktop" ];
};
};
};
}