update system

This commit is contained in:
2025-11-05 14:13:32 +01:00
parent 69eafb5594
commit d5eb686f7f
18 changed files with 350 additions and 212 deletions

View File

@@ -24,7 +24,7 @@ in
":AerialNext<CR>";
}
{
key = "fs";
key = "<leader>fs";
mode = "n";
action = # vim
":Telescope aerial<CR>";
@@ -54,7 +54,7 @@ in
};
which-key.settings.spec = [
{
__unkeyed-1 = "fs";
__unkeyed-1 = "<leader>fs";
group = "Symbols";
icon = "󰡱";
}

View File

@@ -13,19 +13,19 @@ in
telescope = {
enable = true;
keymaps = {
"ff" = {
"<leader>ff" = {
action = "git_files";
mode = "n";
};
"fa" = {
"<leader>fa" = {
action = "find_files";
mode = "n";
};
"fg" = {
"<leader>fg" = {
action = "live_grep";
mode = "n";
};
"fc" = {
"<leader>fc" = {
action = "buffers";
mode = "n";
};
@@ -33,27 +33,27 @@ in
};
which-key.settings.spec = [
{
__unkeyed-1 = "f";
__unkeyed-1 = "<leader>f";
group = "Find";
icon = "󰍉";
}
{
__unkeyed-1 = "ff";
__unkeyed-1 = "<leader>ff";
desc = "File";
icon = "󰈢";
}
{
__unkeyed-1 = "fa";
__unkeyed-1 = "<leader>fa";
desc = "All Files";
icon = "󱪡";
}
{
__unkeyed-1 = "fg";
__unkeyed-1 = "<leader>fg";
desc = "Grep";
icon = "󰑑";
}
{
__unkeyed-1 = "fc";
__unkeyed-1 = "<leader>fc";
desc = "Current";
icon = "󰈙";
}

View File

@@ -10,7 +10,7 @@ in
config = lib.mkIf cfg.enable {
keymaps = [
{
key = "ft";
key = "<leader>t";
mode = "n";
action = # vim
"<cmd>:Neotree toggle<CR>";
@@ -20,24 +20,28 @@ in
web-devicons.enable = true;
neo-tree = {
enable = true;
filesystem = {
useLibuvFileWatcher = true;
followCurrentFile.enabled = true;
filteredItems.visible = true;
settings = {
event_handlers = [
{
event = "neo_tree_buffer_leave";
handler.__raw = ''
function()
require('neo-tree').close_all()
end
'';
}
];
filesystem = {
use_libuv_file_watcher = true;
follow_current_file.enabled = true;
filtered_items.visible = true;
};
popupBorderStyle = "rounded";
};
popupBorderStyle = "rounded";
filesystem.window.mappings.f = "noop";
window.mappings.f = "noop";
eventHandlers.neo_tree_buffer_leave = # lua
''
function()
require('neo-tree').close_all()
end
'';
};
which-key.settings.spec = [
{
__unkeyed-1 = "ft";
__unkeyed-1 = "<leader>t";
desc = "Tree";
icon = "󰙅";
}

View File

@@ -2,13 +2,15 @@
{
programs.git = {
enable = true;
userName = "Thea Schöbl";
userEmail = "dev@theaninova.de";
signing = {
key = "6C9E EFC5 1AE0 0131 78DE B9C8 68FF FB1E C187 88CA";
signByDefault = true;
};
extraConfig = {
user = {
email = "dev@theaninova.de";
name = "Thea Schöbl";
};
pull.rebase = true;
init.defaultBranch = "main";
merge = {

View File

@@ -56,7 +56,6 @@
tree.enable = true;
};
languages = {
angular.enable = true;
c.enable = true;
css = {
enable = true;

View File

@@ -2,27 +2,36 @@ let
transparent = color: "alpha(${color}, {{custom.transparency}})";
mkBgColor = color: {
${color} = {
background = "{{colors.${color}.default.hex}}";
background_lift = "{{colors.${color}_dim.default.hex}}";
background = "{{colors.${color}_dim.default.hex}}";
foreground = "{{colors.on_${color}.default.hex}}";
};
};
mkColor = color: {
${color} = {
standalone = "{{colors.${color}_fixed_dim.default.hex}}";
background = "{{colors.${color}_fixed.default.hex}}";
foreground = "{{colors.on_${color}_fixed.default.hex}}";
};
};
mkSemantic = color: {
${color} = {
standalone = "{{colors.${color}.default.hex}}";
background = "{{colors.${color}_container.default.hex}}";
foreground = "{{colors.on_${color}_container.default.hex}}";
background = "{{colors.${color}.default.hex}}";
foreground = "{{colors.on_${color}.default.hex}}";
};
};
colors =
(mkColor "primary")
// (mkColor "secondary")
// (mkColor "tertiary")
// (mkColor "danger")
// (mkColor "warning")
// (mkColor "success")
// (mkColor "error")
// (mkColor "info")
// (mkSemantic "danger")
// (mkSemantic "warning")
// (mkSemantic "success")
// (mkSemantic "error")
// (mkSemantic "info")
// (mkBgColor "background")
// (mkBgColor "surface")
// (mkBgColor "surface_variant")
// {
outline = "{{colors.outline.default.hex}}";
@@ -40,11 +49,33 @@ let
};
};
gtk = {
# https://github.com/AvengeMedia/DankMaterialShell/blob/master/matugen/templates/gtk-colors.css
gtk = rec {
accent_color = colors.primary.standalone;
accent_bg_color = colors.primary.background;
accent_fg_color = colors.primary.foreground;
window_bg_color = transparent colors.surface.background;
window_fg_color = colors.surface.foreground;
popover_bg_color = transparent colors.surface.background;
popover_fg_color = colors.surface.foreground;
headerbar_bg_color = transparent colors.surface.background;
headerbar_fg_color = colors.surface.foreground;
view_bg_color = transparent colors.surface.background_lift;
view_fg_color = colors.surface.foreground;
card_bg_color = colors.surface.background_lift;
card_fg_color = colors.surface.foreground;
sidebar_bg_color = window_bg_color;
sidebar_fg_color = window_fg_color;
sidebar_border_color = colors.surface.background;
sidebar_backdrop_color = window_bg_color;
destructive_color = colors.danger.standalone;
destructive_bg_color = colors.danger.background;
destructive_fg_color = colors.danger.foreground;
@@ -61,45 +92,31 @@ let
error_bg_color = colors.error.background;
error_fg_color = colors.error.foreground;
window_bg_color = transparent colors.background.background;
window_fg_color = colors.background.foreground;
/*
headerbar_border_color = colors.outline;
headerbar_backdrop_color = transparent colors.background.background;
headerbar_shade_color = colors.shade.default;
headerbar_darker_shade_color = colors.shade.darker;
view_bg_color = transparent colors.background.background;
view_fg_color = colors.background.foreground;
card_shade_color = colors.shade.default;
headerbar_bg_color = transparent colors.background.background;
headerbar_fg_color = colors.background.foreground;
headerbar_border_color = colors.outline;
headerbar_backdrop_color = transparent colors.background.background;
headerbar_shade_color = colors.shade.default;
headerbar_darker_shade_color = colors.shade.darker;
dialog_bg_color = transparent colors.background.background;
dialog_fg_color = colors.background.foreground;
popover_shade_color = colors.shade.default;
card_bg_color = colors.container.default;
card_fg_color = colors.container.foreground;
card_shade_color = colors.shade.default;
shade_color = colors.shade.default;
scrollbar_outline_color = colors.outline;
dialog_bg_color = transparent colors.background.background;
dialog_fg_color = colors.background.foreground;
thumbnail_bg_color = colors.secondary.background;
thumbnail_fg_color = colors.secondary.foreground;
popover_bg_color = transparent colors.background.background;
popover_fg_color = colors.background.foreground;
popover_shade_color = colors.shade.default;
sidebar_shade_color = colors.shade.default;
shade_color = colors.shade.default;
scrollbar_outline_color = colors.outline;
thumbnail_bg_color = colors.secondary.background;
thumbnail_fg_color = colors.secondary.foreground;
sidebar_bg_color = transparent colors.background.background;
sidebar_fg_color = colors.background.foreground;
sidebar_backdrop_color = transparent colors.background.background;
sidebar_shade_color = colors.shade.default;
secondary_sidebar_bg_color = transparent colors.surface_variant.background;
secondary_sidebar_fg_color = colors.surface_variant.foreground;
secondary_sidebar_backdrop_color = transparent colors.surface_variant.background;
secondary_sidebar_shade_color = colors.shade.default;
secondary_sidebar_bg_color = transparent colors.surface_variant.background;
secondary_sidebar_fg_color = colors.surface_variant.foreground;
secondary_sidebar_backdrop_color = transparent colors.surface_variant.background;
secondary_sidebar_shade_color = colors.shade.default;
*/
};
in
builtins.concatStringsSep "\n" (

View File

@@ -1,6 +1,7 @@
{
pkgs,
lib,
osConfig,
config,
...
}:
@@ -241,7 +242,6 @@ in
exit 1
fi
THEME_SERVICE_PATH="${config.xdg.configHome}/systemd/user/theme-init.timer"
if [ "$MODE" = "auto" ]; then
TIME=$(sunwait poll ${builtins.toString cfg.auto-dark.lat}N ${builtins.toString cfg.auto-dark.lon}E || :)
@@ -270,29 +270,21 @@ in
systemctl --user daemon-reload &> /dev/null || :
systemctl --user restart theme-init.timer &> /dev/null || :
if command -v niri &> /dev/null; then
niri msg action do-screen-transition --delay-ms 500
fi
if [ "$MODE" = "light" ]; then
GTK_THEME="adw-gtk3"
GTK_THEME="adw-gtk3"
else
GTK_THEME="adw-gtk3-dark"
GTK_THEME="adw-gtk3-dark"
fi
matugen image "$WALLPAPER" --type scheme-${cfg.flavour} --contrast ${builtins.toString cfg.contrast} --mode "$MODE"
sed -i "s/set background=dark/set background=$MODE/g" ${config.xdg.configHome}/nvim/colors/md3-evo.vim
dconf write /org/gnome/desktop/interface/gtk-theme "'$GTK_THEME'"
dconf write /org/gnome/desktop/interface/color-scheme "'prefer-$MODE'"
if command -v hyprctl &> /dev/null; then
hyprctl reload
fi
if which swaync-client; then
swaync-client --reload-css
fi
for i in $(pgrep -u "$USER" -x nvim); do
kill -USR1 "$i"
done
dconf write /org/gnome/desktop/interface/icon-theme "'Adwaita'"
'';
}
);
@@ -309,6 +301,9 @@ in
"@import './theme.css';";
gtk4.extraCss = # css
"@import './theme.css';";
theme = {
name = "Adwaita";
};
iconTheme = {
name = "Tela";
package = pkgs.tela-icon-theme;
@@ -379,12 +374,23 @@ in
'';
};
programs = {
kitty = {
extraConfig = ''
include ${config.xdg.configHome}/kitty/theme.conf
# TODO: include is coming in the next release
/*
xdg.configFile.niri-config = {
enable = osConfig.programs.niri.enable;
target = "niri/override.kdl";
text = ''
include "${config.xdg.configHome}/niri/config.kdl"
include "${config.programs.matugen.settings.templates.niri.output_path}"
'';
};
home.sessionVariables.NIRI_CONFIG = "${config.xdg.configHome}/niri/override.kdl";
*/
programs = {
kitty.extraConfig = ''
include ${config.programs.matugen.settings.templates.kitty.output_path}
'';
nixvim = {
opts.termguicolors = true;
@@ -405,15 +411,14 @@ in
enable = true;
settings = {
config = {
reload_apps = true;
version_check = false;
reload_apps_list = {
kitty = config.programs.kitty.enable;
waybar = config.programs.waybar.enable;
dunst = config.services.dunst.enable;
};
set_wallpaper = true;
wallpaper_tool = "Swww";
wallpaper.command = lib.getExe pkgs.swww;
custom_colors =
let
@@ -465,23 +470,17 @@ in
templates =
let
gtk = pkgs.writeText "gtk4.css" (import ./gtk.nix);
signal =
name: signal:
(pkgs.writeShellScript "kill-${name}" ''
pkill -${signal} -u "$USER" -x ${name} || :
'');
in
{
kitty = {
input_path = ./kitty.conf;
output_path = "${config.xdg.configHome}/kitty/theme.conf";
};
nvim = {
input_path = ./nvim.vim;
output_path = "${config.xdg.configHome}/nvim/colors/md3-evo.vim";
};
hyprland = {
input_path = ./hyprland.conf;
output_path = "${config.xdg.configHome}/hypr/theme.conf";
};
anyrun = {
input_path = ./anyrun.css;
output_path = "${config.xdg.configHome}/anyrun/theme.css";
post_hook = signal "nvim" "USR1";
};
gtk3 = {
input_path = gtk;
@@ -495,15 +494,49 @@ in
input_path = ./discord.css;
output_path = "${config.xdg.configHome}/vesktop/themes/matugen.theme.css";
};
}
// (lib.optionalAttrs osConfig.programs.niri.enable {
niri = {
input_path = ./niri.kdl;
output_path = "${config.xdg.configHome}/niri/md3-evo.kdl";
};
})
// (lib.optionalAttrs config.programs.kitty.enable {
kitty = {
input_path = ./kitty.conf;
output_path = "${config.xdg.configHome}/kitty/theme.conf";
post_hook = signal ".kitty-wrapped" "USR1";
};
})
// (lib.optionalAttrs osConfig.programs.hyprland.enable {
hyprland = {
input_path = ./hyprland.conf;
output_path = "${config.xdg.configHome}/hypr/theme.conf";
post_hook = pkgs.writeShellScript "reload-hyprland-theme" ''
if command -v hyprctl &> /dev/null; then
hyprctl reload
fi
'';
};
})
// (lib.optionalAttrs config.programs.waybar.enable {
waybar = {
input_path = ./waybar.css;
output_path = "${config.xdg.configHome}/waybar/style.css";
post_hook = signal "waybar" "USR2";
};
})
// (lib.optionalAttrs config.services.swaync.enable {
swaync = {
input_path = ./swaync.css;
output_path = "${config.xdg.configHome}/swaync/style.css";
post_hook = pkgs.writeShellScript "reload-swaync" ''
if which swaync-client; then
swaync-client --reload-css
fi
'';
};
};
});
};
};
};

View File

@@ -0,0 +1,12 @@
layout {
gaps {{custom.padding}}
struts {{custom.double_padding}}
}
overview {
backdrop-color "{{colors.surface.default.hex}}"
}
window-rule {
geometry-corner-radius {{custom.radius}}
}

View File

@@ -37,7 +37,7 @@ let g:terminal_color_14 = "{{colors.cyan.default.hex}}"
let g:terminal_color_15 = "{{colors.on_surface_variant.default.hex}}"
set termguicolors
set background=dark
set background={{mode | to_lower}}
if exists("g:neovide")
hi! Normal guibg={{colors.surface.default.hex}} guifg={{colors.on_surface.default.hex}}

View File

@@ -22,8 +22,8 @@ in
home = {
sessionVariables = {
NIXOS_OZONE_WL = "1";
GDK_BACKEND = "wayland,x11,*";
QT_QPA_PLATFORM = "wayland;xcb";
GDK_BACKEND = "wayland";
QT_QPA_PLATFORM = "wayland";
SDL_VIDEODRIVER = "wayland";
};
@@ -32,6 +32,7 @@ in
# fonts
noto-fonts
# gnome packages
qalculate-gtk
evince
baobab
gnome.gvfs
@@ -52,13 +53,6 @@ in
};
programs = {
dankMaterialShell = {
enable = true;
niri = {
enableSpawn = true;
enableKeybinds = false;
};
};
niri.settings = {
binds = {
"Mod+Left".action.focus-column-left = [ ];
@@ -75,29 +69,30 @@ in
"Mod+Shift+Down".action.move-window-down-or-to-workspace-down = [ ];
"Mod+C".action.close-window = [ ];
"Mod+M".action.center-window = [ ];
/*
"Mod+M".action.spawn = [
(pkgs.writeShellScript "qalculate" ''
if niri msg --json windows | jq -e 'any(.[]; .app_id == "qalculate-gtk")'; then
pkill qalculate-gtk
else
qalculate-gtk &
fi
'')
];
*/
"Mod+T".action.spawn = [ "kitty" ];
"Mod+V".action.maximize-column = [ ];
"Mod+P".action.fullscreen-window = [ ];
"Mod+D".action.fullscreen-window = [ ];
"Mod+P".action.toggle-window-floating = [ ];
"Mod+Space".action.spawn = [
"dms"
"ipc"
"spotlight"
"toggle"
];
"Mod+MouseMiddle".action.toggle-overview = [ ];
"Mod+Shift+V".action.screenshot = [ ];
# "Mod+Shift+C".action.pick-color = [ ];
};
overview.zoom = 0.8;
window-rules = [
{
geometry-corner-radius = {
top-left = 24.0;
top-right = 24.0;
bottom-left = 24.0;
bottom-right = 24.0;
};
clip-to-geometry = true;
tiled-state = true;
}
@@ -109,6 +104,17 @@ in
matches = [ { app-id = "firefox"; } ];
default-column-width.fixed = 1500;
}
{
matches = [ { app-id = "qalculate-gtk"; } ];
open-floating = true;
default-column-width.fixed = 1000;
default-window-height.fixed = 800;
default-floating-position = {
x = 0;
y = 0;
relative-to = "bottom";
};
}
];
layout = {
always-center-single-column = true;
@@ -128,17 +134,31 @@ in
};
};
programs.dankMaterialShell.greeter = {
enable = true;
compositor.name = "niri";
configHome = "/home/${username}";
};
services = {
kmscon = {
enable = true;
hwRender = true;
};
greetd = {
enable = true;
greeterManagesPlymouth = false;
settings = {
initial_session = {
command = "${pkgs.niri}/bin/niri-session";
user = username;
};
default_session = {
command = "${lib.getExe pkgs.tuigreet} --asterisks --remember --user-menu --cmd '${pkgs.niri}/bin/niri-session'";
user = username;
};
};
};
dbus = {
enable = true;
implementation = "broker";
};
pcscd.enable = true;
gvfs.enable = true;
};
};
}

View File

@@ -36,6 +36,23 @@ in
"move ${pipPadding} ${pipPadding},${firefoxPipInitial}"
];
};
programs.niri.settings.window-rules = [
{
matches = [
{
app-id = "firefox";
title = "Picture-in-Picture";
}
];
open-focused = false;
open-floating = true;
default-floating-position = {
x = homeConfig.theme.md3-evo.padding;
y = homeConfig.theme.md3-evo.padding;
relative-to = "top-left";
};
}
];
};
};
}

View File

@@ -25,6 +25,7 @@ in
"ignorealpha 0.3, anyrun"
];
};
programs.niri.settings.binds."Mod+Space".action.spawn = [ (lib.getExe pkgs.walker) ];
home.packages = with pkgs; [
walker
wl-clipboard

View File

@@ -20,6 +20,8 @@ in
enable = true;
settings = {
mainBar = {
layer = "top";
height = 24;
reload_style_on_change = true;
exclusive = true;
@@ -35,25 +37,24 @@ in
modules-center = [
"clock"
];
modules-right =
[
"privacy"
"gamemode"
"tray"
"pulseaudio"
]
++ (
if cfg.mobile then
[ "backlight" ]
else
[
"custom/brightness"
]
)
++ [
# "custom/theme"
# "network"
];
modules-right = [
"privacy"
"gamemode"
"tray"
"pulseaudio"
]
++ (
if cfg.mobile then
[ "backlight" ]
else
[
"custom/brightness"
]
)
++ [
# "custom/theme"
# "network"
];
"pulseaudio" = {
format = "{icon} {volume}%";

View File

@@ -28,6 +28,19 @@ in
];
};
# WARN: sometimes the VM will place hard-coded/hashed paths in the config,
# which breaks after NixOS updates because hashes change.
# The error might look something like
# "Unable to find efi firmware that is compatible with the current configuration".
# To fix this, manually edit the VM config in the VM manager in the XML tab of the Boot Options.
# Replace
# <loader readonly="yes" secure="yes" type="pflash" format="raw">/nix/store/yd1rlziy0cnjjp78zc7wr9dcv5hah16w-qemu-10.1.0/share/qemu/edk2-x86_64-secure-code.fd</loader>
# <nvram template="/nix/store/yd1rlziy0cnjjp78zc7wr9dcv5hah16w-qemu-10.1.0/share/qemu/edk2-i386-vars.fd" templateFormat="raw" format="raw">/var/lib/libvirt/qemu/nvram/win11_VARS.fd</nvram>
# with
# <loader readonly="yes" secure="yes" type="pflash" format="raw">/run/libvirt/nix-ovmf/edk2-x86_64-secure-code.fd</loader>
# <nvram template="/run/libvirt/nix-ovmf/edk2-i386-vars.fd" templateFormat="raw" format="raw">/var/lib/libvirt/qemu/nvram/win11_VARS.fd</nvram>
environment.systemPackages = with pkgs; [
virt-manager
virt-viewer
@@ -37,16 +50,13 @@ in
win-virtio
win-spice
adwaita-icon-theme
qemu
];
virtualisation = {
libvirtd = {
enable = true;
qemu = {
swtpm.enable = true;
ovmf.enable = true;
ovmf.packages = [ pkgs.OVMFFull.fd ];
};
qemu.swtpm.enable = true;
};
spiceUSBRedirection.enable = true;
};