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);
}
@@ -1,4 +1,5 @@
{
programs.atuin.enable = true; # shell history and more in rust
programs.atuin = {
flags = [
"--disable-up-arrow"
@@ -1,6 +1,7 @@
{
imports = [
./atuin.nix
./direnv.nix
./fish.nix
./ghostty.nix
./helix.nix
+7
View File
@@ -0,0 +1,7 @@
{
programs.direnv.enable = true;
programs.direnv = {
silent = true;
nix-direnv.enable = true;
};
}
@@ -5,6 +5,7 @@
}: let
inherit (lib) getExe;
in {
programs.fish.enable = true; # friendly interactive shell in rust
programs.fish = {
shellAliases = {
cd = "z";
@@ -4,6 +4,7 @@
perSystem,
...
}: {
programs.ghostty.enable = true;
programs.ghostty = {
package = perSystem.ghostty.ghostty;
settings = {
@@ -6,8 +6,18 @@
}: let
inherit (lib) getExe;
in {
programs.helix.enable = true;
programs.helix = {
# defaultEditor = true;
package = pkgs.helix.overrideAttrs (previousAttrs: {
patches =
(previousAttrs.patches or [])
++ [
./loader.patch
./term.patch
];
});
settings = {
editor = {
bufferline = "multiple";
@@ -110,6 +120,7 @@ in {
name = "typst";
auto-format = true;
formatter.command = getExe pkgs.typstyle;
formatter.args = ["-l" "100"];
language-servers = ["tinymist"];
}
{
+10
View File
@@ -0,0 +1,10 @@
--- a/helix-loader/src/config.rs
+++ b/helix-loader/src/config.rs
@@ -11,7 +11,6 @@ pub fn default_lang_config() -> toml::Value {
pub fn user_lang_config() -> Result<toml::Value, toml::de::Error> {
let config = [
crate::config_dir(),
- crate::find_workspace().0.join(".helix"),
]
.into_iter()
.map(|path| path.join("languages.toml"))
@@ -3,6 +3,7 @@
lib,
...
}: {
programs.oh-my-posh.enable = true;
programs.oh-my-posh = {
settings = {
# version = 2;
+17
View File
@@ -0,0 +1,17 @@
--- a/helix-term/src/config.rs
+++ b/helix-term/src/config.rs
@@ -58,12 +58,11 @@ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
impl Config {
pub fn load(
global: Result<String, ConfigLoadError>,
- local: Result<String, ConfigLoadError>,
+ _local: Result<String, ConfigLoadError>,
) -> Result<Config, ConfigLoadError> {
let global_config: Result<ConfigRaw, ConfigLoadError> =
global.and_then(|file| toml::from_str(&file).map_err(ConfigLoadError::BadConfig));
- let local_config: Result<ConfigRaw, ConfigLoadError> =
- local.and_then(|file| toml::from_str(&file).map_err(ConfigLoadError::BadConfig));
+ let local_config: Result<ConfigRaw, ConfigLoadError> = Err(ConfigLoadError::default());
let res = match (global_config, local_config) {
(Ok(global), Ok(local)) => {
let mut keys = keymap::default();
@@ -5,6 +5,7 @@
lib,
...
}: {
programs.wezterm.enable = true;
programs.wezterm = {
# package = inputs.wezterm.packages.${pkgs.system}.default;
extraConfig = let
@@ -4,6 +4,7 @@
lib,
...
}: {
programs.yazi.enable = true;
programs.yazi = {
shellWrapperName = "y";
settings = {
+33 -8
View File
@@ -1,4 +1,5 @@
{
pkgs,
lib,
config,
...
@@ -12,10 +13,10 @@ in {
};
config = mkIf cfg.enable {
security.rtkit = {
enable = true;
args = ["--no-canary"];
};
# security.rtkit = {
# enable = true;
# args = ["--no-canary"];
# };
services.pulseaudio.enable = false;
services.pipewire = {
enable = true;
@@ -25,13 +26,14 @@ in {
# "context.properties" = {
# "default.clock.rate" = 48000;
# "default.clock.quantum" = 32;
# "default.clock.min-quantum" = 32;
# "default.clock.min-quantum" = 2048;
# "default.clock.max-quantum" = 32;
# };
# };
wireplumber.extraConfig."10-alsa-vm" = {
"api.alsa.period-size" = 1024 / 2; # seems to fix random crackling
};
# wireplumber.extraConfig."10-alsa-vm" = {
# "api.alsa.period-size" = 1024; # seems to fix random crackling
# "api.alsa.headroom" = 128;
# };
extraConfig.pipewire-pulse."93-auto-connect" = {
"pulse.cmd" = [
{
@@ -60,5 +62,28 @@ in {
# };
# };
};
services.pipewire.wireplumber.configPackages = [
(pkgs.writeTextDir "share/wireplumber/main.lua.d/10-disable-suspend.conf" ''
monitor.alsa.rules = [
{
matches = [
{
# Matches all sources
node.name = "~alsa_input.*"
},
{
# Matches all sinks
node.name = "~alsa_output.*"
}
]
actions = {
update-props = {
session.suspend-timeout-seconds = 0
}
}
}
]
'')
];
};
}
+4
View File
@@ -26,6 +26,10 @@ in {
config.common."org.freedesktop.impl.portal.Secret" = ["gnome-keyring"];
};
environment.systemPackages = with pkgs; [
libnotify
];
module.gnome-keyring.enable = true;
module.pipewire.enable = true;
+17
View File
@@ -0,0 +1,17 @@
{
config,
lib,
inputs,
...
}: let
inherit (inputs) mysecrets;
inherit (config.networking) hostName;
in {
# imports = with inputs; [
# nixos-facter-modules.nixosModules.facter
# ];
hardware.facter.reportPath = "${mysecrets}/facter/${hostName}.json";
systemd.network.wait-online.enable = false;
networking.dhcpcd.enable = lib.mkForce false;
networking.networkmanager.dhcp = "internal";
}
@@ -7,6 +7,7 @@
imports = [
# inputs.chaotic.nixosModules.default
./slim.nix
./uutils.nix
];
boot = {
consoleLogLevel = 0;
+63
View File
@@ -0,0 +1,63 @@
{pkgs, ...}: let
coreutils-full-name =
"coreuutils-full"
+ builtins.concatStringsSep ""
(builtins.genList (_: "_") (builtins.stringLength pkgs.coreutils-full.version));
coreutils-name =
"coreuutils"
+ builtins.concatStringsSep ""
(builtins.genList (_: "_") (builtins.stringLength pkgs.coreutils.version));
findutils-name =
"finduutils"
+ builtins.concatStringsSep ""
(builtins.genList (_: "_") (builtins.stringLength pkgs.findutils.version));
diffutils-name =
"diffuutils"
+ builtins.concatStringsSep ""
(builtins.genList (_: "_") (builtins.stringLength pkgs.diffutils.version));
in {
system.replaceDependencies.replacements = [
# coreutils
{
# system
oldDependency = pkgs.coreutils-full;
newDependency = pkgs.symlinkJoin {
# Make the name length match so it builds
name = coreutils-full-name;
paths = [pkgs.uutils-coreutils-noprefix];
};
}
{
# applications
oldDependency = pkgs.coreutils;
newDependency = pkgs.symlinkJoin {
# Make the name length match so it builds
name = coreutils-name;
paths = [pkgs.uutils-coreutils-noprefix];
};
}
# findutils
# {
# # applications
# oldDependency = pkgs.findutils;
# newDependency = pkgs.symlinkJoin {
# # Make the name length match so it builds
# name = findutils-name;
# paths = [pkgs.uutils-findutils];
# };
# }
# diffutils
# {
# # applications
# oldDependency = pkgs.diffutils;
# newDependency = pkgs.symlinkJoin {
# # Make the name length match so it builds
# name = diffutils-name;
# paths = [pkgs.uutils-diffutils];
# };
# }
];
}
@@ -105,6 +105,10 @@
"iommu.strict=1"
"iommu=force"
# "lockdown=integrity" # confidentiality
"kvm_amd.sev=1"
"kvm_amd.sev_es=1"
"kvm_amd.sev_snp=1"
# "mitigations=auto,nosmt"
"module.sig_enforce=1"
"page_alloc.shuffle=1"
"randomize_kstack_offset=on"
@@ -33,6 +33,6 @@
InterceptUnknown = true;
ProcMonitorMethod = "ebpf";
};
scx.scheduler = "scx_flash";
scx.scheduler = "scx_rustland";
};
}
@@ -37,6 +37,19 @@
themes = {
dark = {
tomorrow = {
polarity = "dark";
base16Scheme = fromBase16Schemes "tomorrow-night";
# image = wallpapers.abstract.lambda;
inherit (interIosevka) serif monospace;
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Classic";
size = 24;
};
};
ashes = {
polarity = "dark";
base16Scheme = fromBase16Schemes "classic-dark";
@@ -215,6 +228,32 @@
};
};
light = {
tomorrow = {
polarity = "light";
base16Scheme = fromBase16Schemes "tomorrow";
# image = wallpapers.abstract.lambda;
inherit (interIosevka) serif monospace;
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 24;
};
};
selenized = {
polarity = "light";
base16Scheme = fromBase16Schemes "selenized-white";
# image = wallpapers.abstract.lambda;
inherit (interIosevka) serif monospace;
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
size = 24;
};
};
rose-pine-dawn = {
polarity = "light";
base16Scheme = fromBase16Schemes "rose-pine-dawn";
-14
View File
@@ -1,14 +0,0 @@
{
config,
inputs,
...
}: let
inherit (inputs) mysecrets;
inherit (config.networking) hostName;
in {
imports = with inputs; [
nixos-facter-modules.nixosModules.facter
];
facter.reportPath = "${mysecrets}/facter/${hostName}.json";
systemd.network.wait-online.enable = false;
}
+2 -2
View File
@@ -5,9 +5,9 @@
...
}: {
imports = with inputs; [
nix-index-database.hmModules.nix-index
nix-index-database.homeModules.nix-index
self.homeModules.desktop
self.homeModules.programs
# self.homeModules.programs
];
inherit (osConfig) desktop;
+36 -33
View File
@@ -11,8 +11,16 @@
inherit (osConfig.virtualisation) libvirtd;
inherit (osConfig.hardware) bluetooth;
in {
imports = with flake.homeModules; [
programs
imports = with flake.modules.homePrograms; [
atuin
direnv
fish
helix
oh-my-posh
syncthing
wezterm
wl-kbptr
yazi
];
systemd.user.settings.Manager.DefaultEnvironment = {
@@ -31,16 +39,6 @@ in {
programs =
lib.attrsets.recursiveUpdate
{
atuin.enable = true;
fish.enable = true; # friendly interactive shell in rust
oh-my-posh.enable = true;
helix.enable = true;
yazi.enable = true;
wezterm.enable = true;
ghostty.enable = true;
bat.enable = true; # cat in rust
btop.enable = true;
# direnv.enable = true;
@@ -75,6 +73,7 @@ in {
git.signing.format = "ssh";
git.settings.alias.cl = "clone";
git.settings.alias.co = "checkout";
git.settings.sequence.editor = lib.getExe pkgs.git-interactive-rebase-tool;
keychain.keys = ["id_ed25519"];
@@ -115,7 +114,10 @@ in {
systemctl-tui # systemctl tui in rust
trashy # trash cli in rust
up # ultimate plumber in go
wiremix # pavucontrol for wireplumber in rust
]
++ [
# various wrappers
(perSystem.mypackages.prismlauncher-bwrapped.override {
addPkgs = with pkgs; [mangohud gamemode gamescope glfw3-minecraft];
packageOverrides = {
@@ -128,26 +130,14 @@ in {
};
})
(perSystem.mypackages.zen-browser-bwrapped.override {
bwrapperOpts = {
sockets.x11 = false;
};
bwrapperOpts.sockets.x11 = false;
})
(perSystem.mypackages.legcord-bwrapped.override {
bwrapperOpts = {
sockets.x11 = false;
};
bwrapperOpts.sockets.x11 = false;
})
(perSystem.mypackages.helium-browser-bwrapped.override {
bwrapperOpts = {
sockets.x11 = false;
mounts.readWrite = [
# "$XDG_DOCUMENTS_DIR"
"$XDG_DOWNLOAD_DIR"
# "$XDG_MUSIC_DIR"
# "$XDG_VIDEOS_DIR"
# "$XDG_PICTURES_DIR"
];
};
bwrapperOpts.sockets.x11 = false;
bwrapperOpts.mounts.readWrite = ["$XDG_DOWNLOAD_DIR"];
})
(pkgs.mkBwrapper rec {
app = {
@@ -197,6 +187,19 @@ in {
runtimeInputs = with pkgs; [rbw wl-clipboard];
text = ''rbw get --clipboard "$1" && sleep 5 && wl-copy -c'';
})
(pkgs.writeShellApplication {
name = "bw-get";
runtimeInputs = with pkgs; [bitwarden-cli jq wl-clipboard csvlens];
text = ''
bw get item \
"$(bw list items \
| jq -r '["name","user","id"], (.[] | [(.name), (.login.username), (.id)]) | @csv' \
| csvlens)" \
| jq -r '.login.password' \
| wl-copy \
&& sleep 5 && wl-copy -c
'';
})
(pkgs.writeShellApplication {
name = "rbw-totp";
runtimeInputs = with pkgs; [rbw wl-clipboard];
@@ -207,7 +210,7 @@ in {
# misc apps
adwaita-icon-theme
# vial # qmk keyboard configuring app
pinentry-qt # pinentry for rbw
pinentry-gnome3 # pinentry for rbw
(mkIf libvirtd.enable virt-manager) # libvirt gui
# waycheck # check wayland protocols
gpu-screen-recorder-gtk
@@ -218,10 +221,10 @@ in {
# gnome-text-editor
helvum # pipewire patchbay in rust
# junction # app chooser
mission-center # task manager in rust (partly)
(mkIf bluetooth.enable overskride) # bluetooth gui in rust
# mission-center # task manager in rust (partly)
# (mkIf bluetooth.enable overskride) # bluetooth gui in rust
pika-backup # borg gui in rust
pwvucontrol # pipewire gui in rust
# pwvucontrol # pipewire gui in rust
perSystem.zmx.default
# sonusmix # pipewire routing tool in rust
];