1769288238

This commit is contained in:
2026-01-24 22:57:18 +02:00
parent fa32ae5510
commit 84020b1572
94 changed files with 1428 additions and 1024 deletions
@@ -0,0 +1,10 @@
{
dconf.settings = {
"org/gnome/desktop/wm/preferences" = {
button-layout = "icon:minimize,maximize,close";
};
# "org/gnome/desktop/interface" = {
# icon-theme = config.gtk.iconTheme.name;
# };
};
}
@@ -0,0 +1,15 @@
{
lib,
importWithArgs,
...
}:
lib.mkMerge [
(import ./dconf.nix)
(importWithArgs ./mimeapps.nix)
(importWithArgs ./packages.nix)
# (importWithArgs ./programs/niri.nix)
# (import ./programs/satty.nix)
(importWithArgs ./programs/wl-kbptr.nix)
(importWithArgs ./services.nix)
(importWithArgs ./stylix.nix)
]
@@ -0,0 +1,54 @@
{
# config,
# lib,
pkgs,
...
}: {
home.packages = with pkgs; [
browsers # app chooser in rust (and without bugs)
celluloid # mpv gui in libadwaita
file-roller # archive manager
gnome-text-editor
helvum # pipewire patchbay in rust
# junction # app chooser
loupe # image viewer and editor in rust
nautilus # file manager
papers # pdf reader in rust
];
xdg = {
configFile."mimeapps.list".force = true;
mime.enable = true;
mimeApps = {
enable = true;
defaultApplications = let
archive_manager = ["org.gnome.FileRoller.desktop"];
file_manager = ["org.gnome.Nautilus.desktop"];
image_viewer = ["org.gnome.Loupe.desktop"];
pdf_reader = ["org.gnome.Papers.desktop"];
video_player = ["io.github.celluloid_player.Celluloid.desktop"];
web_browser = ["software.Browsers.desktop"];
in {
# TODO: add text/ mimetypes for gnome-editor
"application/pdf" = pdf_reader;
"application/vnd.rar" = archive_manager;
"application/x-7z-compressed" = archive_manager;
"application/x-bzip2-compressed-tar" = archive_manager;
"application/x-compressed-tar" = archive_manager;
"application/x-xz-compressed-tar" = archive_manager;
"application/zip" = archive_manager;
"image/jpeg" = image_viewer;
"image/png" = image_viewer;
"inode/directory" = file_manager;
"text/html" = web_browser;
"video/mp4" = video_player;
"video/mpeg" = video_player;
"video/x-matroska" = video_player;
"video/x-mpeg" = video_player;
"x-scheme-handler/about" = web_browser;
"x-scheme-handler/http" = web_browser;
"x-scheme-handler/https" = web_browser;
"x-scheme-handler/unknown" = web_browser;
};
};
};
}
@@ -0,0 +1,9 @@
{pkgs, ...}: {
home.packages = with pkgs; [
# gui libadwaita utilities
helvum # pipewire patchbay in rust
pwvucontrol # pipewire gui in rust
wdisplays # wlroots display configurator
wlrctl
];
}
@@ -0,0 +1,7 @@
{
imports = [
# ./niri.nix
# ./satty.nix
./wl-kbptr.nix
];
}
@@ -0,0 +1,423 @@
{
config,
lib,
pkgs,
perSystem,
...
}:
with lib; let
binds = {
suffixes,
prefixes,
substitutions ? {},
}: let
replacer = replaceStrings (attrNames substitutions) (attrValues substitutions);
format = prefix: suffix: let
actual-suffix =
if isList suffix.action
then {
action = head suffix.action;
args = tail suffix.action;
}
else {
inherit (suffix) action;
args = [];
};
action = replacer "${prefix.action}-${actual-suffix.action}";
in {
name = "${prefix.key}+${suffix.key}";
value.action.${action} = actual-suffix.args;
};
pairs = attrs: fn:
concatMap (
key:
fn {
inherit key;
action = attrs.${key};
}
) (attrNames attrs);
in
listToAttrs (pairs prefixes (prefix: pairs suffixes (suffix: [(format prefix suffix)])));
in {
programs.niri.settings = {
environment = {
DMS_SCREENSHOT_EDITOR = "satty";
ELECTRON_OZONE_PLATFORM_HINT = "auto";
QT_QPA_PLATFORM = "wayland";
QT_QPA_PLATFORMTHEME = "gtk3";
QT_QPA_PLATFORMTHEME_QT6 = "gtk3";
XDG_CURRENT_DESKTOP = "niri";
};
input = {
keyboard = {
xkb = {
layout = "us,ua";
variant = "colemak_dh_ortho,";
};
repeat-delay = 200;
repeat-rate = 50;
track-layout = "window";
};
mouse = {
accel-speed = 0.0;
accel-profile = "flat";
};
touchpad = {
tap = true;
dwt = true;
natural-scroll = true;
click-method = "clickfinger";
};
tablet.map-to-output = "eDP-1";
touch.map-to-output = "eDP-1";
};
animations.enable = true;
animations.slowdown = 0.4;
clipboard.disable-primary = true;
hotkey-overlay.skip-at-startup = true;
prefer-no-csd = true;
xwayland-satellite.path = lib.getExe perSystem.xwst.xwayland-satellite;
overview.workspace-shadow.enable = false;
# TODO: enable when implemented in github:sodiboo/niri-flake
# recent-windows.highlight.corner-radius = 12;
screenshot-path = "${config.xdg.userDirs.pictures}/screenshots/screenshot-%Y-%m-%d-%H-%M-%S.png";
layout = {
gaps = 3;
struts.left = 32;
struts.right = 32;
always-center-single-column = true;
center-focused-column = "on-overflow";
# default-column-display = "tabbed";
empty-workspace-above-first = true;
default-column-width.proportion = 2.0 / 3.0;
preset-column-widths = [
{proportion = 1.0 / 3.0;}
{proportion = 1.0 / 2.0;}
{proportion = 2.0 / 3.0;}
];
background-color = "transparent";
border.enable = true;
border.width = 1;
focus-ring.enable = false;
shadow.enable = false;
tab-indicator = let
i = 4;
in {
position = "bottom";
gaps-between-tabs = i;
corner-radius = i;
width = i;
place-within-column = true;
# hide-when-single-tab = true;
# place-within-column = true;
};
};
binds = with config.lib.niri.actions; let
dms-ipc = spawn "dms" "ipc";
sh = spawn "sh" "-c";
focus = spawn "wlrctl" "window" "focus";
focus-meet = pkgs.writeShellApplication {
name = "focus-zen-google-meet";
runtimeInputs = with pkgs; [wlrctl jq gnugrep config.programs.niri.package];
text = ''
wlrctl window focus app_id:app.zen_browser.zen \
title:"$(niri msg --json windows \
| jq -r '.[].title' \
| grep -E 'Meet: "[a-zA-Z0-9-]+?"')"
'';
};
focus-equicord = pkgs.writeShellApplication {
name = "focus-equicord";
runtimeInputs = with pkgs; [wlrctl jq gnugrep config.programs.niri.package];
text = ''
wlrctl window focus app_id:equibop \
title:"$(niri msg --json windows \
| jq -r '.[].title' \
| grep -E 'Meet: "[a-zA-Z0-9-]+?"')"
'';
};
in
lib.attrsets.mergeAttrsList [
{
"Mod+Shift+Slash".action = show-hotkey-overlay;
"Mod+Tab".action = focus-workspace-previous;
"Mod+C".action = center-column;
"Mod+Q".action = close-window;
"Mod+M".action = maximize-column;
"Mod+Ctrl+M".action = fullscreen-window;
"Mod+Shift+M".action = maximize-window-to-edges;
"Mod+Ctrl+Shift+M".action = toggle-windowed-fullscreen;
"Mod+S".action = set-column-width "50%";
"Mod+Shift+S".action = set-column-width "33%";
"Mod+Ctrl+S".action = set-column-width "67%";
"Mod+T" = {action = toggle-column-tabbed-display;};
"Mod+F".action = switch-focus-between-floating-and-tiling;
"Mod+Ctrl+F".action = toggle-window-floating;
"Mod+Ctrl+Comma".action = consume-or-expel-window-left;
"Mod+Ctrl+Period".action = consume-or-expel-window-right;
"Mod+Minus".action = set-column-width "-10%";
"Mod+Equal".action = set-column-width "+10%";
"Mod+Plus".action = set-column-width "+10%";
"Mod+Shift+Minus".action = set-window-height "-10%";
"Mod+Shift+Plus".action = set-window-height "+10%";
"Print".action = dms-ipc "niri" "screenshot";
"Ctrl+Print".action = dms-ipc "niri" "screenshotScreen";
"Shift+Print".action = dms-ipc "niri" "screenshotWindow";
"Mod+Space" = {action = switch-layout "next";};
"Mod+Ctrl+Space" = {
repeat = false;
action = toggle-overview;
};
"Mod+Return" = {action = sh "$TERMINAL";};
"Mod+R".action = sh "wl-kbptr -o modes=floating,click";
"Mod+Ctrl+R".action = sh "while wl-kbptr -o modes=split,click; do :; done";
"Mod+Shift+R".action = sh "wl-kbptr -o modes=tile,bisect,click";
"Super+Alt+G".action = spawn "${lib.getExe focus-meet}";
"Super+Alt+G".hotkey-overlay.title = "Focus Google Meet";
"Super+Alt+U".action = focus "app.zen_browser.zen" "state:inactive";
"Super+Alt+B".action = focus "io.github.ungoogled_software.ungoogled_chromium" "state:inactive";
"Super+Alt+D".action = focus "equibop";
"Super+Alt+T".action = focus "io.github.kukuruzka165.materialgram";
"Mod+D" = {
action = spawn "vicinae" "toggle";
hotkey-overlay.title = "Toggle Application Launcher";
};
# "Mod+N" = {
# action = dms-ipc "notifications" "toggle";
# hotkey-overlay.title = "Toggle Notification Center";
# };
# "Mod+Comma" = {
# action = dms-ipc "settings" "toggle";
# hotkey-overlay.title = "Toggle Settings";
# };
# "Mod+P" = {
# action = dms-ipc "notepad" "toggle";
# hotkey-overlay.title = "Toggle Notepad";
# };
"Mod+Ctrl+L" = {
action = dms-ipc "lock" "lock";
hotkey-overlay.title = "Toggle Lock Screen";
};
"Mod+Ctrl+Q" = {
action = dms-ipc "powermenu" "toggle";
hotkey-overlay.title = "Toggle Power Menu";
};
"XF86AudioRaiseVolume" = {
allow-when-locked = true;
action = dms-ipc "audio" "increment" "3";
};
"XF86AudioLowerVolume" = {
allow-when-locked = true;
action = dms-ipc "audio" "decrement" "3";
};
"XF86AudioMute" = {
allow-when-locked = true;
action = dms-ipc "audio" "mute";
};
"Shift+XF86AudioMute" = {
allow-when-locked = true;
action = dms-ipc "audio" "micmute";
};
"XF86AudioMicMute" = {
allow-when-locked = true;
action = dms-ipc "audio" "micmute";
};
"XF86AudioPlay".action = dms-ipc "mpris" "playPause";
"XF86AudioPause".action = dms-ipc "mpris" "pause";
"XF86AudioPrev".action = dms-ipc "mpris" "previous";
"XF86AudioNext".action = dms-ipc "mpris" "next";
"Mod+Alt+N" = {
allow-when-locked = true;
action = dms-ipc "night" "toggle";
hotkey-overlay.title = "Toggle Night Mode";
};
"Mod+V" = {
action = spawn "vicinae" "vicinae://extensions/vicinae/clipboard/history";
hotkey-overlay.title = "Toggle Clipboard Manager";
};
"XF86MonBrightnessUp" = {
allow-when-locked = true;
action = dms-ipc "brightness" "increment" "5" "";
};
"XF86MonBrightnessDown" = {
allow-when-locked = true;
action = dms-ipc "brightness" "decrement" "5" "";
};
}
(let
left = "N";
down = "E";
up = "I";
right = "O";
in
binds rec {
suffixes = {
"Left" = "column-left";
"Down" = "window-or-workspace-down";
"Up" = "window-or-workspace-up";
"Right" = "column-right";
${left} = suffixes."Left";
${down} = suffixes."Down";
${up} = suffixes."Up";
${right} = suffixes."Right";
};
prefixes = {
"Mod" = "focus";
"Mod+Ctrl" = "move";
"Mod+Shift" = "focus-monitor";
"Mod+Shift+Ctrl" = "move-window-to-monitor";
};
substitutions = {
"monitor-column" = "monitor";
"monitor-window-or-workspace" = "monitor";
"move-window-or-workspace" = "move-window";
};
})
# {
# "Mod+V".action = switch-focus-between-floating-and-tiling;
# "Mod+Shift+V".action = toggle-window-floating;
# }
(binds {
suffixes."Home" = "first";
suffixes."End" = "last";
prefixes."Mod" = "focus-column";
prefixes."Mod+Ctrl" = "move-column-to";
})
(binds {
# PageDown and PageUp
suffixes."Prior" = "workspace-up";
suffixes."Next" = "workspace-down";
suffixes."WheelScrollUp" = "workspace-up";
suffixes."WheelScrollDown" = "workspace-down";
prefixes."Mod" = "focus";
prefixes."Mod+Ctrl" = "move-column-to";
prefixes."Mod+Shift" = "move";
})
(binds {
suffixes = builtins.listToAttrs (
map (n: {
name = toString n;
value = [
"workspace"
(n + 1)
]; # workspace 1 is empty; workspace 2 is the logical first.
}) (range 1 9)
);
prefixes."Mod" = "focus";
prefixes."Mod+Ctrl" = "move-window-to";
})
];
window-rules = [
{
clip-to-geometry = true;
geometry-corner-radius = let
r = 12.0;
in {
top-left = r;
top-right = r;
bottom-left = r;
bottom-right = r;
};
}
# {
# matches = [{is-active = false;}];
# draw-border-with-background = false;
# opacity = 0.9;
# }
{
matches = [
{title = "Picture-in-Picture";}
{title = "Картинка в картинці";}
{
# telegram's picture-in-picture mode
app-id = "io.github.kukuruzka165.materialgram";
title = "materialgram";
}
];
open-floating = true;
}
# {
# matches = [
# {
# # telegram's picture-in-picture mode
# app-id = "io.github.kukuruzka165.materialgram";
# title = "materialgram";
# }
# ];
# }
{
matches = [
{app-id = "re.sonny.Junction";}
{app-id = "com.github.hluk.copyq";}
{title = "Zen - Choose User Profile";}
];
open-floating = true;
open-focused = true;
}
{
matches = [
{app-id = "org.keepassxc.KeePassXC";}
{app-id = "org.gnome.World.Secrets";}
{app-id = "Bitwarden";}
{app-id = "io.github.kukuruzka165.materialgram";}
{app-id = "org.telegram.desktop";}
{app-id = "org.signal.Signal";}
{app-id = "WebCord";}
{app-id = "equibop";}
];
block-out-from = "screencast";
}
{
matches = [
{app-id = "Alacritty";}
{app-id = "com.mitchellh.ghostty";}
{app-id = "org.wezfurlong.wezterm";}
{app-id = "app.zen_browser.zen";}
];
# default-column-width = {proportion = 1.0;};
draw-border-with-background = false;
}
{
matches = [{app-id = "org.quickshell";}];
open-floating = true;
}
];
layer-rules = [
{
matches = [{namespace = "^quickshell$";}];
place-within-backdrop = true;
}
];
};
}
@@ -0,0 +1,3 @@
{
programs.satty.enable = true;
}
@@ -0,0 +1,51 @@
{config, ...}: {
programs.wl-kbptr = {
enable = true;
settings = with config.lib.stylix.colors.withHashtag; rec {
general.cancellation_status_code = 1;
mode_floating = {
source = "detect";
label_color = base05;
label_select_color = base0A;
unselectable_bg_color = "#2222";
selectable_bg_color = base01 + "66";
selectable_border_color = base01;
label_font_family = config.stylix.fonts.sansSerif.name;
label_font_size = "12 50% 100";
label_symbols = "abcdefghijklmnopqrstuvwxyz";
};
mode_tile = {
label_font_size = "8 50% 100";
inherit
(mode_floating)
label_color
label_select_color
unselectable_bg_color
selectable_bg_color
selectable_border_color
label_font_family
label_symbols
;
};
mode_bisect = {
inherit (mode_floating) label_color unselectable_bg_color label_font_family;
label_font_size = 20;
label_padding = "12";
pointer_size = 24;
pointer_color = base08;
even_area_bg_color = base0C + "aa";
even_area_border_color = base0C;
odd_area_bg_color = base0D + "aa";
odd_area_border_color = base0D;
history_border_color = base01;
};
mode_split = {
inherit (mode_bisect) pointer_size pointer_color history_border_color;
bg_color = mode_floating.unselectable_bg_color;
area_bg_color = mode_floating.selectable_bg_color;
vertical_color = base09;
horizontal_color = mode_bisect.odd_area_border_color;
};
};
};
}
@@ -0,0 +1,44 @@
{
# config,
pkgs,
lib,
...
}: {
services = {
gnome-keyring = {
enable = true;
components = ["secrets"];
};
# kanshi = import ../../niri/services/kanshi;
# udiskie = {
# enable = true;
# automount = false;
# notify = true;
# tray = "auto";
# };
};
# systemd.user.services = let
# mkGraphicalService = config: lib.attrsets.recursiveUpdate graphicalService config;
# graphicalService = {
# Install.WantedBy = ["niri.service"];
# Unit = {
# Requisite = ["graphical-session.target"];
# PartOf = ["graphical-session.target"];
# After = ["graphical-session.target"];
# };
# Service = {
# Restart = "on-failure";
# TimeoutStopSec = 10;
# RestartSec = 1;
# };
# };
# in {
# polkit-agent = mkGraphicalService {
# Service = {
# Type = "simple";
# ExecStart = pkgs.mate.mate-polkit + "/libexec/polkit-mate-authentication-agent-1";
# };
# };
# };
}
@@ -0,0 +1,52 @@
{
config,
pkgs,
lib,
...
}: {
# dconf.settings = {
# "org/gnome/desktop/interface" = {
# icon-theme = config.gtk.iconTheme.name;
# color-scheme =
# if config.stylix.polarity == "dark"
# then lib.mkDefault "prefer-dark"
# else lib.mkDefault "prefer-light";
# };
# };
# stylix.targets.niri.enable = false;
# stylix.targets.gtk.enable = false;
# gtk = {
# enable = true;
# theme = {
# name = "adw-gtk3";
# package = pkgs.adw-gtk3;
# };
# };
#
# stylix.targets.qt.enable = false;
qt = {
enable = true;
platformTheme.name = "gtk3";
};
stylix.targets = {
qt.enable = false;
# gtk.enable = false;
};
gtk = {
enable = true;
# iconTheme = {
# name =
# if config.stylix.polarity == "dark"
# then "Papirus-Dark"
# else "Papirus-Light";
# package =
# if (removeSuffix "-light" theme) == "nord"
# then pkgs.papirus-nord
# else pkgs.papirus-icon-theme;
# };
};
}
+6 -79
View File
@@ -1,94 +1,21 @@
{
osConfig,
perSystem,
config,
pkgs,
lib,
...
}:
with lib; let
inherit (osConfig.module.stylix) theme;
# inherit (osConfig.module.stylix) theme;
cfg = config.desktop.cosmic;
in {
options = {
desktop.cosmic.enable =
mkEnableOption "enable cosmic desktop";
};
config = mkIf cfg.enable {
stylix.targets = {
qt.enable = false;
gtk.enable = false;
};
home.packages = with pkgs; [
helvum
loupe
papers
junction
celluloid
mission-center
dconf
libnotify
playerctl
wdisplays
pwvucontrol
wl-clipboard
];
gtk = {
enable = true;
iconTheme = {
name =
if config.stylix.polarity == "dark"
then "Papirus-Dark"
else "Papirus-Light";
package =
if (removeSuffix "-light" theme) == "nord"
then pkgs.papirus-nord
else pkgs.papirus-icon-theme;
};
};
qt = {
enable = true;
platformTheme.name = "gtk3";
};
services = {
gnome-keyring = {
enable = true;
components = ["secrets"];
};
};
dconf.settings = {
"org/gnome/desktop/wm/preferences" = {
button-layout = "icon:minimize,maximize,close";
};
"org/gnome/desktop/interface" = {
icon-theme = config.gtk.iconTheme.name;
};
};
xdg = {
mime.enable = true;
mimeApps = {
enable = true;
defaultApplications = let
file_manager = ["org.gnome.Nautilus.desktop"];
image_viewer = ["org.gnome.Loupe.desktop"];
pdf_reader = ["org.gnome.Papers.desktop"];
video_player = ["io.github.celluloid_player.Celluloid.desktop"];
web_browser = ["re.sonny.Junction.desktop"];
in {
"application/pdf" = pdf_reader;
"image/jpeg" = image_viewer;
"image/png" = image_viewer;
"inode/directory" = file_manager;
"text/html" = web_browser;
"video/mp4" = video_player;
"video/mpeg" = video_player;
"video/x-matroska" = video_player;
"video/x-mpeg" = video_player;
"x-scheme-handler/about" = web_browser;
"x-scheme-handler/http" = web_browser;
"x-scheme-handler/https" = web_browser;
"x-scheme-handler/unknown" = web_browser;
};
};
};
};
config = let
importWithArgs = file: import file {inherit config inputs lib perSystem pkgs importWithArgs;};
in
mkIf cfg.enable (importWithArgs ./config);
}
-7
View File
@@ -1,7 +0,0 @@
{
programs.atuin = {
flags = [
"--disable-up-arrow"
];
};
}
-15
View File
@@ -1,15 +0,0 @@
{
imports = [
./atuin.nix
./fish.nix
./ghostty.nix
./helix.nix
./kitty.nix
./oh-my-posh.nix
./syncthing.nix
./wezterm.nix
./wl-kbptr.nix
./yazi.nix
./zed-editor.nix
];
}
-34
View File
@@ -1,34 +0,0 @@
{
pkgs,
lib,
...
}: let
inherit (lib) getExe;
in {
programs.fish = {
shellAliases = {
cd = "z";
ed = "$EDITOR";
jf = "jj-fzf"; # think of jeff
jo = "joshuto"; # think of josh
l = "ls -lah";
la = "ls -ah";
ll = "ls -lh";
p = "pueue";
s = "systemctl";
stui = "systemctl-tui";
};
shellAbbrs = {
pa = "pueue add --";
pl = "pueue log";
};
interactiveShellInit = ''
bind \e\[3\;5~ kill-word
bind \cH backward-kill-word
set fish_greeting
set fish_cursor_default block blink
# ${getExe pkgs.bat-extras.batman} --export-env | source
if test -e ~/.profile; source ~/.profile; end
'';
};
}
-17
View File
@@ -1,17 +0,0 @@
{
config,
lib,
perSystem,
...
}: {
programs.ghostty = {
package = perSystem.ghostty.ghostty;
settings = {
gtk-single-instance = true;
window-decoration = "client";
keybind = [
"ctrl+shift+f=close_surface"
];
};
};
}
-179
View File
@@ -1,179 +0,0 @@
{
pkgs,
config,
lib,
...
}: let
inherit (lib) getExe;
in {
programs.helix = {
# defaultEditor = true;
settings = {
editor = {
bufferline = "multiple";
cursorline = true;
inline-diagnostics.cursor-line = "warning";
line-number = "relative";
lsp = {
display-messages = true;
display-inlay-hints = true;
};
cursor-shape = {
insert = "bar";
normal = "block";
select = "underline";
};
statusline = {
left = ["mode" "spinner" "version-control"];
center = ["file-name"];
right = ["diagnostics" "selections" "position" "file-encoding" "file-line-ending" "file-type"];
separator = "|";
};
soft-wrap = {
enable = true;
max-wrap = 25;
max-indent-retain = 0;
wrap-indicator = "";
};
};
keys = {
insert.C-c = "normal_mode";
normal = {
esc = ["collapse_selection" "keep_primary_selection"];
space = {
space = "file_picker";
w = ":w";
q = ":q";
x = ":x";
n = ":n";
"," = "goto_previous_buffer";
"." = "goto_next_buffer";
l = ":reflow";
};
};
};
};
languages = {
language-server = {
# markdown-oxide.command = getExe pkgs.markdown-oxide;
# nixd.command = getExe pkgs.nixd;
# pyright = {
# command = getExe pkgs.pyright;
# args = ["-"];
# };
# rust-analyzer.command = getExe pkgs.rust-analyzer;
# texlab.command = getExe pkgs.texlab;
bash-language-server = {
command = getExe pkgs.bash-language-server;
environment = {
"SHELLCHECK_PATH" = getExe pkgs.shellcheck;
"SHFMT_PATH" = getExe pkgs.shfmt;
};
};
clangd.command = "${pkgs.clang-tools}/bin/clangd";
# fsac = {
# command = getExe pkgs.fsautocomplete;
# config = {
# editor.formatOnSave = true;
# AutomaticWorkspaceInit = true;
# FSharp.ExternalAutocomplete = true;
# FSharp.linting.fsharplint.enabled = true;
# FSharp.linting.fsharplint.configFile = "fsharplint.json";
# FSharp.formatting.fantomas.enabled = true;
# };
# };
nil = {
command = getExe pkgs.nil;
config = {
formatting.command = [(getExe pkgs.alejandra)];
};
};
ruff = {
command = getExe pkgs.ruff;
args = ["server"];
};
tinymist.command = getExe pkgs.tinymist;
vscode-json-language-server.command = getExe pkgs.nodePackages.vscode-json-languageserver;
yaml-language-server.command = getExe pkgs.yaml-language-server;
zk = {
command = getExe pkgs.zk;
args = ["lsp"];
};
};
language = [
{
name = "nix";
auto-format = true;
language-servers = ["nil"];
}
{
name = "typst";
auto-format = true;
formatter.command = getExe pkgs.typstyle;
language-servers = ["tinymist"];
}
{
name = "markdown";
# auto-format = true;
language-servers = ["zk" "markdown-oxide"];
}
{
name = "c";
auto-format = true;
# formatter.command = "${pkgs.clang-tools}/bin/clang-format";
}
{
name = "cpp";
auto-format = true;
# formatter.command = "${pkgs.clang-tools}/bin/clang-format";
}
# {
# name = "fsharp";
# auto-format = true;
# language-servers = ["fsac"];
# scope = "source.fs";
# roots = ["fsproj" "sln" ".git"];
# }
# {
# name = "rust";
# auto-format = true;
# language-servers = ["rust-analyzer"];
# formatter.command = getExe pkgs.rustfmt;
# }
{
name = "json";
auto-format = true;
formatter.command = getExe pkgs.jq;
language-servers = ["vscode-json-language-server"];
}
{
name = "yaml";
auto-format = true;
formatter.command = getExe pkgs.yamlfmt;
formatter.args = ["-"];
language-servers = ["yaml-language-server"];
}
{
name = "bash";
auto-format = true;
# formatter.command = getExe pkgs.shfmt;
# formatter.args = ["-"];
}
{
name = "python";
auto-format = true;
language-servers = [
{
name = "ruff";
# only-features = ["format" "diagnostics"];
}
# {
# name = "pyright";
# except-features = ["format" "diagnostics"];
# }
];
}
];
};
};
}
-14
View File
@@ -1,14 +0,0 @@
{
config,
lib,
...
}: {
programs.kitty = {
settings = {
tab_bar_edge = "bottom";
tab_bar_align = "left";
tab_bar_style = "fade";
# tab_separator = " ";
};
};
}
-122
View File
@@ -1,122 +0,0 @@
{
config,
lib,
...
}: {
programs.oh-my-posh = {
settings = {
# version = 2;
final_space = true;
shell_integration = true;
console_title_template = "{{ .Shell }} in {{ .Folder }}";
blocks = [
{
type = "prompt";
alignment = "left";
overflow = "hidden";
segments = [
{
type = "path";
style = "plain";
background = "transparent";
foreground = "blue";
template = "{{ .Path }}";
properties = {
style = "full";
};
}
{
type = "text";
style = "plain";
background = "transparent";
template = "{{ if .Env.BW_SESSION }} 󰞀{{ end }}";
}
{
type = "nix-shell";
style = "plain";
background = "transparent";
template = "{{ if ne .Type \"unknown\" }} {{ end }}";
}
{
type = "git";
style = "plain";
foreground = "p:grey";
background = "transparent";
template = " {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}*{{ end }} <cyan>{{ if gt .Behind 0 }}{{ end }}{{ if gt .Ahead 0 }}{{ end }}</>";
properties = {
branch_icon = "";
commit_icon = "@";
fetch_status = true;
};
}
];
}
{
type = "prompt";
alignment = "right";
segments = [
{
type = "session";
style = "plain";
foreground = "white";
background = "transparent";
template = "{{ if .SSHSession }} {{ .UserName }}@{{ .HostName }}{{ end }}";
}
{
style = "plain";
foreground = "white";
background = "transparent";
properties = {
charged_icon = "󰁹";
charging_icon = "󱟡";
discharging_icon = "󱟟";
};
template = "{{ if not .Error }} {{ .Icon }} {{ .Percentage }}%{{ end }}";
type = "battery";
}
];
}
{
type = "rprompt";
overflow = "hidden";
segments = [
{
type = "executiontime";
style = "plain";
foreground = "yellow";
background = "transparent";
template = "{{.FormattedMs}}";
properties = {
threshold = 5000;
};
}
];
}
{
type = "prompt";
alignment = "left";
newline = true;
segments = [
{
type = "text";
style = "plain";
foreground_templates = ["{{if gt .Code 0}}red{{end}}" "{{if eq .Code 0}}magenta{{end}}"];
background = "transparent";
template = ">";
}
];
}
];
transient_prompt = {
foreground_templates = ["{{if gt .Code 0}}red{{end}}" "{{if eq .Code 0}}magenta{{end}}"];
background = "transparent";
template = "> ";
};
secondary_prompt = {
foreground = "magenta";
background = "transparent";
template = "-> ";
};
};
};
}
-26
View File
@@ -1,26 +0,0 @@
{
config,
lib,
...
}:
with lib; let
cfg = config.syncthing;
in {
options = {
syncthing.enable = mkEnableOption "enable syncthing";
};
config = mkIf cfg.enable {
services.syncthing = {
enable = true;
overrideDevices = false;
overrideFolders = false;
tray.enable = true;
settings = {
options = {
urAccepted = -1;
relaysEnabled = true;
};
};
};
};
}
-191
View File
@@ -1,191 +0,0 @@
{
config,
# inputs,
# pkgs,
lib,
...
}: {
programs.wezterm = {
# package = inputs.wezterm.packages.${pkgs.system}.default;
extraConfig = let
arrows = {
left = "LeftArrow";
down = "DownArrow";
up = "UpArrow";
right = "RightArrow";
};
homerow-arrows = {
left = "n";
down = "e";
up = "i";
right = "o";
};
genNavigation = keys: ''
{ key = '${keys.left}', mods = 'LEADER', action = act.ActivatePaneDirection 'Left' },
{ key = '${keys.down}', mods = 'LEADER', action = act.ActivatePaneDirection 'Down' },
{ key = '${keys.up}', mods = 'LEADER', action = act.ActivatePaneDirection 'Up' },
{ key = '${keys.right}', mods = 'LEADER', action = act.ActivatePaneDirection 'Right' },
{ key = '${keys.left}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Left' },
{ key = '${keys.down}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Down' },
{ key = '${keys.up}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Up' },
{ key = '${keys.right}', mods = 'CTRL|SHIFT', action = act.ActivatePaneDirection 'Right' },
'';
in
# lua
''
local wezterm = require 'wezterm'
local act = wezterm.action
local resurrect = wezterm.plugin.require("https://github.com/MLFlexer/resurrect.wezterm")
local workspace_switcher = wezterm.plugin.require("https://github.com/MLFlexer/smart_workspace_switcher.wezterm")
wezterm.on("augment-command-palette", function(window, pane)
local workspace_state = resurrect.workspace_state
return {
{
brief = "Window | Workspace: Switch Workspace",
icon = "md_briefcase_arrow_up_down",
action = workspace_switcher.switch_workspace(),
},
{
brief = "Window | Workspace: Rename Workspace",
icon = "md_briefcase_edit",
action = wezterm.action.PromptInputLine({
description = "Enter new name for workspace",
action = wezterm.action_callback(function(window, pane, line)
if line then
wezterm.mux.rename_workspace(wezterm.mux.get_active_workspace(), line)
resurrect.state_manager.save_state(workspace_state.get_workspace_state())
end
end),
}),
},
}
end)
return {
front_end = 'WebGpu',
unix_domains = {
{
name = 'unix',
},
},
enable_kitty_graphics = true,
window_padding = {
left = 0,
right = 0,
top = 0,
bottom = 0,
},
use_fancy_tab_bar = false,
inactive_pane_hsb = {
-- saturation = 0.8,
brightness = 0.7,
},
-- window_frame = {
-- font = wezterm.font { family = 'Cantarell', weight = 'Bold' },
-- },
disable_default_key_bindings = true,
leader = { key = 'Space', mods = 'CTRL', timeout_milliseconds = 2000 },
keys = {
{
key = "w",
mods = "LEADER",
action = resurrect.window_state.save_window_action(),
},
{
key = "t",
mods = "LEADER",
action = resurrect.tab_state.save_tab_action(),
},
{
key = "s",
mods = "LEADER",
action = wezterm.action_callback(function(win, pane)
resurrect.state_manager.save_state(resurrect.workspace_state.get_workspace_state())
resurrect.window_state.save_window_action()
end),
},
{
key = "r",
mods = "LEADER",
action = wezterm.action_callback(function(win, pane)
resurrect.fuzzy_loader.fuzzy_load(win, pane, function(id, label)
local type = string.match(id, "^([^/]+)") -- match before '/'
id = string.match(id, "([^/]+)$") -- match after '/'
id = string.match(id, "(.+)%..+$") -- remove file extention
local opts = {
relative = true,
restore_text = true,
on_pane_restore = resurrect.tab_state.default_on_pane_restore,
}
if type == "workspace" then
local state = resurrect.state_manager.load_state(id, "workspace")
resurrect.workspace_state.restore_workspace(state, opts)
elseif type == "window" then
local state = resurrect.state_manager.load_state(id, "window")
resurrect.window_state.restore_window(pane:window(), state, opts)
elseif type == "tab" then
local state = resurrect.state_manager.load_state(id, "tab")
resurrect.tab_state.restore_tab(pane:tab(), state, opts)
end
end)
end),
},
{
key = "d",
mods = "LEADER",
action = wezterm.action_callback(function(win, pane)
resurrect.fuzzy_loader.fuzzy_load(win, pane, function(id)
resurrect.state_manager.delete_state(id)
end,
{
title = "Delete State",
description = "Select State to Delete and press Enter = accept, Esc = cancel, / = filter",
fuzzy_description = "Search State to Delete: ",
is_fuzzy = true,
})
end),
},
{
key = 'p',
mods = 'LEADER',
action = wezterm.action.ActivateCommandPalette,
},
{ key = 'Enter', mods = 'SHIFT|CTRL', action = act.ActivateCopyMode },
{ key = 'R', mods = 'SHIFT|CTRL', action = act.ReloadConfiguration },
{ key = '=', mods = 'CTRL', action = act.IncreaseFontSize },
{ key = '-', mods = 'CTRL', action = act.DecreaseFontSize },
{ key = '0', mods = 'CTRL', action = act.ResetFontSize },
{ key = 'C', mods = 'SHIFT|CTRL', action = act.CopyTo 'Clipboard' },
-- { key = 'N', mods = 'SHIFT|CTRL', action = act.SpawnWindow },
{ key = 'l', mods = 'SHIFT|CTRL', action = act.CharSelect{ copy_on_select = true, copy_to = 'ClipboardAndPrimarySelection' } },
{ key = 'v', mods = 'SHIFT|CTRL', action = act.PasteFrom 'Clipboard' },
{ key = '<', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(-1) },
{ key = '>', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(1) },
{ key = 'Tab', mods = 'CTRL|SHIFT', action = act.ActivateTabRelative(-1) },
{ key = 'Tab', mods = 'CTRL', action = act.ActivateTabRelative(1) },
{ key = '%', mods = 'SHIFT|CTRL', action = act.SplitVertical { domain = 'CurrentPaneDomain' }, },
{ key = '"', mods = 'SHIFT|CTRL', action = act.SplitHorizontal { domain = 'CurrentPaneDomain' }, },
-- pane navigation
${genNavigation arrows}
${genNavigation homerow-arrows}
{ key = 't', mods = 'SHIFT|CTRL', action = act.SpawnTab 'CurrentPaneDomain' },
{ key = 'w', mods = 'SHIFT|CTRL', action = act.CloseCurrentTab{ confirm = false } },
{ key = 'f', mods = 'SHIFT|CTRL', action = act.CloseCurrentPane{ confirm = false } },
{ key = 'b', mods = 'LEADER|CTRL', action = act.SendString '\x02', },
{ key = 'Enter', mods = 'LEADER', action = act.ActivateCopyMode, },
-- { key = 'p', mods = 'LEADER', action = act.PasteFrom 'PrimarySelection', },
{ key = 'k', mods = 'SHIFT|CTRL', action = act.Multiple
{
act.ClearScrollback 'ScrollbackAndViewport',
act.SendKey { key = 'L', mods = 'CTRL' },
},
},
},
}
'';
};
}
-28
View File
@@ -1,28 +0,0 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.programs.wl-kbptr;
iniFormat = pkgs.formats.ini {listsAsDuplicateKeys = true;};
in {
options = {
programs.wl-kbptr = {
enable = mkEnableOption "enable niri desktop";
settings = mkOption {
inherit (iniFormat) type;
default = {};
};
};
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
wl-kbptr
];
xdg.configFile."wl-kbptr/config" = mkIf (cfg.settings != {}) {
source = iniFormat.generate "wl-kbptr-config" cfg.settings;
};
};
}
-106
View File
@@ -1,106 +0,0 @@
{
pkgs,
# config,
lib,
...
}: {
programs.yazi = {
shellWrapperName = "y";
settings = {
opener = {
open = [
{
run = "xdg-open \"$@\"";
orphan = true;
desc = "Open";
}
];
edit = [
{
run = "$EDITOR \"$@\"";
block = true;
desc = "Edit";
}
];
dragdrop = [
{
run = "${lib.getExe pkgs.ripdrag} -ab \"$@\"";
desc = "Drag'n'drop";
orphan = true;
for = "unix";
}
];
};
open.rules = [
{
mime = "text/*";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.json";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.yaml";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.yml";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.toml";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.sh";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.ini";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.conf";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.csv";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.go";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.html";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.c";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.cpp";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.rs";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.nix";
use = ["edit" "open" "dragdrop"];
}
{
name = "*.py";
use = ["edit" "open" "dragdrop"];
}
{
name = "*";
use = ["open" "edit" "dragdrop"];
}
];
};
};
}
-150
View File
@@ -1,150 +0,0 @@
{
config,
pkgs,
lib,
...
}: let
inherit (lib) getExe mkForce;
in {
programs.zed-editor = {
extensions = [
"bash"
"fsharp"
"justfile"
"nix"
"typst"
];
userSettings = {
vim_mode = true;
ui_font_size = mkForce 16;
buffer_font_size = mkForce 16;
# features = {inline_completion_provider = "none";};
auto_update = false;
languages = {
"FSharp" = {
language-servers = [
"fsautocomplete"
];
};
"Nix" = {
language-servers = [
"nil"
];
# formatter = {
# external.command = getExe pkgs.alejandra;
# };
};
# "Rust" = {
# formatter = {
# external = {
# command = getExe pkgs.rustfmt;
# arguments = ["--edition" "2021"];
# };
# };
# };
"typst" = {
language-servers = ["tinymist"];
format_on_save = "on";
# formatter = {
# external = {
# command = getExe pkgs.typstyle;
# arguments = ["-i" "{buffer_path}"];
# };
# };
};
"Python" = {
format_on_save = "on";
formatter = [
{
language_server = {
name = "ruff";
};
}
];
language_servers = ["ruff"];
};
};
lsp = {
bash-language-server = {
binary = {
path = getExe pkgs.bash-language-server;
env = {
"SHELLCHECK_PATH" = getExe pkgs.shellcheck;
"SHFMT_PATH" = getExe pkgs.shfmt;
};
};
};
fsautocomplete = {
binary = {
path = getExe pkgs.fsautocomplete;
};
settings = {
AutomaticWorkspaceInit = true;
FSharp.ExternalAutocomplete = true;
FSharp.linting.fsharplint.enabled = true;
FSharp.linting.fsharplint.configFile = "fsharplint.json";
FSharp.formatting.fantomas.enabled = true;
};
};
clangd = {
binary = {
arguments = [];
path = "${pkgs.clang-tools}/bin/clangd";
};
};
# rust-analyzer = {
# binary = {
# arguments = [];
# path = getExe pkgs.rust-analyzer;
# };
# };
ruff = {
binary = {
arguments = [];
path = getExe pkgs.ruff;
};
};
# nixd = {
# binary = {
# arguments = [];
# path = getExe pkgs.nixd;
# };
# initialization_options.formatting.command = [(getExe pkgs.alejandra)];
# };
nil = {
binary = {
arguments = [];
path = getExe pkgs.nil;
};
settings.formatting.command = [(getExe pkgs.alejandra)];
};
# texlab = {
# binary = {
# arguments = [];
# path = getExe pkgs.texlab;
# };
# };
tinymist = {
binary = {
arguments = [];
path = getExe pkgs.tinymist;
};
};
vscode-json-language-server = {
binary = {
path = getExe pkgs.nodePackages.vscode-json-languageserver;
};
};
yaml-language-server = {
binary = {
path = getExe pkgs.yaml-language-server;
};
};
};
telemetry = {
diagnostics = false;
metrics = false;
};
};
};
}