This commit is contained in:
Lucy Hochkamp 2025-07-23 14:24:23 +02:00
parent 93a675c06a
commit 9ca7a8d8f6
No known key found for this signature in database
20 changed files with 631 additions and 194 deletions

View file

@ -10,26 +10,41 @@ in
{
options.xyno.desktop.audio.enable = lib.mkEnableOption "enable pipewire and stuff";
config = lib.mkIf cfg.enable {
services.pipewire = {
enable = true;
# raopOpenFirewall = true; # airplay
pulse.enable = true;
extraConfig.pipewire = {
"9-clock-allow-higher" = {
"context.properties" = {
"default.clock.allowed-rates" = [ "44100" "48000" "96000" "192000" ];
services.pipewire = {
enable = true;
# raopOpenFirewall = true; # airplay
pulse.enable = true;
extraConfig.pipewire = {
"9-clock-allow-higher" = {
"context.properties" = {
"default.clock.allowed-rates" = [
"44100"
"48000"
"96000"
"192000"
];
};
};
# "10-raop-discover" = {
# "context.modules" = [
# {
# name = "libpipewire-module-raop-discover";
# args = { };
# }
# ];
# };
};
extraConfig.pipewire-pulse = {
"10-zeroconf" = {
"pulse.cmd" = [
{
cmd = "load-module";
args = "module-zeroconf-discover";
}
];
};
};
# "10-raop-discover" = {
# "context.modules" = [
# {
# name = "libpipewire-module-raop-discover";
# args = { };
# }
# ];
# };
};
};
};
}

View file

@ -13,7 +13,7 @@ in
lib.mkEnableOption "install some commonly used programs";
config = lib.mkIf cfg.enable {
home-manager.users.${config.xyno.system.user.name} = lib.mkIf config.xyno.presets.home-manager.enable ({...}: {
xyno.alacritty.enable = true;
# xyno.alacritty.enable = true;
xyno.helix.enable = true;
});
programs.steam = {
@ -37,14 +37,17 @@ in
signal-desktop
obsidian
diebahn
vlc
mpv
lutris
libreoffice-qt6-fresh
inkscape
easyeffects
appimage-run
unstable.keepassxc
inputs.zen-browser.packages."${pkgs.system}".default
qalculate-qt
wl-clipboard-rs
wdisplays
];

View file

@ -13,14 +13,14 @@ in
type = lib.types.str;
default = "niri.service";
};
options.xyno.desktop.foot.package= lib.mkOption {
options.xyno.desktop.foot.package = lib.mkOption {
type = lib.types.package;
default = pkgs.foot;
};
config = lib.mkIf cfg.enable {
# should be socket activated tm
# systemd.user.services.foot.wantedBy = lib.mkForce [ cfg.wantedBy ];
# systemd.user.sockets.foot.wantedBy = lib.mkForce [ cfg.wantedBy ];
# systemd.user.services.foot-server.wantedBy = lib.mkForce [ cfg.wantedBy ];
systemd.user.sockets.foot-server.wantedBy = lib.mkForce [ cfg.wantedBy ];
systemd.packages = [ cfg.package ];
xyno.desktop.niri.term = lib.mkDefault "footclient";
programs.foot = {

View file

@ -1,32 +0,0 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.xyno.desktop.mate-polkit;
in
{
options.xyno.desktop.mate-polkit.enable = lib.mkEnableOption "enable mate-polkit as the gui polkit thing";
options.xyno.desktop.mate-polkit.wantedBy = lib.mkOption {
type = lib.types.str;
default = "niri.service";
};
options.xyno.desktop.mate-polkit.package = lib.mkOption {
type = lib.types.package;
default = pkgs.mate.mate-polkit; # we're using mate polkit as it seems to be the only maintained gtk polkit thing (and we're using all the other gtk shit anyways)
};
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
systemd.user.services.mate-polkit = {
unitConfig.PartOf = "graphical-session.target";
unitConfig.After = "graphical-session.target";
unitConfig.Requisite = "graphical-session.target";
serviceConfig.Restart = "on-failure";
wantedBy = [ cfg.wantedBy ];
script = "exec ${cfg.package}/libexec/polkit-mate-authentication-agent-1";
};
};
}

View file

@ -1,4 +1,5 @@
{
inputs,
pkgs,
config,
lib,
@ -11,6 +12,7 @@ let
"org.pulseaudio.pavucontrol"
"KeePassXC"
"org.gnome.NautilusPreviewer"
"io.github.Qalculate.qalculate-qt"
];
matchFloat = lib.concatStringsSep "\n" (
map (x: ''
@ -42,32 +44,72 @@ in
{ ... }:
{
xyno.dark-theme.enable = true;
home.file.".config/xdg-desktop-portal-termfilechooser/config".text = ''
[filechooser]
cmd=${pkgs.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh
default_dir=$HOME
env=TERMCMD=footclient --app-id floating-alacritty
open_mode = suggested
save_mode = suggested
'';
}
);
xdg.portal = {
extraPortals = [
pkgs.xdg-desktop-portal-termfilechooser
];
config.niri.default = [
"gnome"
"gtk"
];
# config.niri."org.freedesktop.impl.portal.FileChooser" = [ "termfilechooser" ];
config.niri."org.freedesktop.impl.portal.Access" = [ "gtk" ];
config.niri."org.freedesktop.impl.portal.Notification" = [ "gtk" ];
config.niri."org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
};
# xdg.portal = {
# enable = true;
# wlr.enable = true;
# };
environment.systemPackages = with pkgs;[
playerctl
xwayland-satellite
];
programs.niri.enable = true;
programs.niri.package = inputs.niri.packages.${pkgs.system}.default.overrideAttrs (prev: {
patches = prev.patches ++ [
(pkgs.fetchurl {
url = "https://patch-diff.githubusercontent.com/raw/YaLTeR/niri/pull/1907.patch";
hash = "sha256-XhG8Ga1/QMPXrF0FjQuBk8KZISbof4Md4kM73cG1SYQ=";
})
];
});
environment.etc."niri/config.kdl".mode = "444"; # copy file so niri detects changes
environment.etc."niri/config.kdl".text = ''
// xwayland
spawn-at-startup "${pkgs.xwayland-satellite}/bin/xwayland-satellite"
environment {
DISPLAY ":0"
animations {
off
}
// keybinds
binds {
Mod+D { spawn "${cfg.launcher}"; }
Mod+Alt+L { spawn "lock"; }
Mod+T { spawn "${cfg.term}"; }
Mod+Y { spawn "${cfg.term} yazi"; }
Mod+Y { spawn "${cfg.term}" "--app-id" "floating-alacritty" "yazi"; }
Mod+P { spawn "keepassxc"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.1-"; }
Mod+S { spawn "qalculate-qt"; }
Mod+Shift+N { spawn "makoctl" "dismiss" "-a"; }
Mod+N { spawn "makoctl" "dismiss"; }
Mod+E { spawn "makoctl" "menu" "fuzzel -d"; }
XF86AudioRaiseVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.03+"; }
XF86AudioLowerVolume allow-when-locked=true { spawn "wpctl" "set-volume" "@DEFAULT_AUDIO_SINK@" "0.03-"; }
XF86AudioMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SINK@" "toggle"; }
XF86AudioMicMute allow-when-locked=true { spawn "wpctl" "set-mute" "@DEFAULT_AUDIO_SOURCE@" "toggle"; }
XF86AudioNext allow-when-locked=true { spawn "playerctl" "next"; }
XF86AudioPrev allow-when-locked=true { spawn "playerctl" "previous"; }
XF86AudioPlay allow-when-locked=true { spawn "playerctl" "play-pause"; }
XF86AudioPause allow-when-locked=true { spawn "playerctl" "pause"; }
Mod+Q { close-window; }
@ -284,10 +326,19 @@ in
Super+Backslash { focus-workspace "scratchpad"; }
}
layout {
gaps 12
// center-focused-column "always"
gaps 8
shadow {
on
}
background-color "transparent"
struts {
right 16
left 16
}
default-column-width { proportion 0.33333; }
tab-indicator {
hide-when-single-tab
position "top"
@ -300,6 +351,11 @@ in
// scratchpad
// workspace "scratchpad"
// Put swaybg inside the overview backdrop.
layer-rule {
match namespace="^wpaperd.*$"
place-within-backdrop true
}
screenshot-path "~/Pictures/screenshots/screenshot-%Y-%m-%d %H-%M-%S.png"
// Indicate screencasted windows with red colors.
@ -353,11 +409,13 @@ in
}
input {
workspace-auto-back-and-forth
focus-follows-mouse
// workspace-auto-back-and-forth
focus-follows-mouse max-scroll-amount="10%"
keyboard {
xkb {
layout "eu"
// options "compose:lalt"
}
}
touchpad {

View file

@ -424,7 +424,7 @@ in
};
options.xyno.desktop.waybar.package = lib.mkOption {
type = lib.types.package;
default = pkgs.unstable.waybar.override { hyprlandSupport = false; }; # we don't use it and hyprland seems to not build on current master
default = pkgs.unstable.waybar;
};
options.xyno.desktop.waybar.mode = lib.mkOption {
type = lib.types.str;

View file

@ -26,6 +26,11 @@ in
config = builtins.readFile ./kmonad/k70.kbd;
};
wire = {
device = "/dev/input/by-id/usb-Razer_Razer_BlackWidow_Chroma_V2-event-kbd";
config = builtins.readFile ./kmonad/chroma_v2.kbd;
};
};
};
};

View file

@ -0,0 +1,89 @@
(defcfg
;; ** For Linux **
input (device-file "/dev/input/by-id/usb-Razer_Razer_BlackWidow_Chroma_V2-event-kbd")
;; input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
output (uinput-sink "KMonad output")
;; ** For Windows **
;; input (low-level-hook)
;; output (send-event-sink)
;; ** For MacOS **
;; input (iokit-name "my-keyboard-product-string")
;; output (kext)
fallthrough true
)
(defsrc
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w e r t y u i o p [ ]
caps a s d f g h j k l ; ' \ ret
lsft 102d z x c v b n m , . / rsft
lctl lmet lalt spc ralt rmet cmp rctl
)
(defalias
ext (layer-toggle extend) ;; Bind 'ext' to the Extend Layer
)
(defalias
cpy C-c
pst C-v
cut C-x
udo C-z
all C-a
fnd C-f
bk Back
fw Forward
)
(defalias
num (layer-toggle num)
)
(deflayer colemak-dh
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ]
esc (tap-hold-next-release 200 a lctrl) (tap-hold-next-release 200 r ralt) (tap-hold-next-release 200 s lmet) t g m n (tap-hold-next-release 200 e rmet) (tap-hold-next-release 200 i lalt) (tap-hold-next-release 200 o rctrl) ' \\ ret
lsft z x c d v 102d k h , . / rsft
lctl lmet lalt spc ralt rmet _ _
)
(deflayer num
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ]
esc 1 2 3 4 5 6 7 8 9 0 ' \\ ret
lsft z x c d v 102d k h , . / rsft
lctl lmet lalt spc ralt rmet _ _
)
(deflayer colemak-dhk
esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
tab q w f p b j l u y ; [ ]
@ext a r s t g k n e i o ' \\ ret
lsft z x c d v 102d m h , . / rsft
lctl lmet lalt spc ralt rmet _ _
)
(deflayer extend
_ play rewind previoussong nextsong ejectcd refresh brdn brup www mail prog1 prog2
_ f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 _
_ esc @bk @fnd @fw ins pgup home up end menu prnt slck
_ lalt lmet lsft lctl ralt pgdn lft down rght del caps _ _
_ @udo @cut @cpy tab @pst _ pgdn bks lsft lctl comp _
_ _ _ ret _ _ _ _
)
(deflayer empty
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _
)

View file

@ -8,7 +8,6 @@
./desktop/foot.nix
./desktop/fuzzel.nix
./desktop/mako.nix
./desktop/mate-polkit.nix
./desktop/niri.nix
./desktop/shikane.nix
./desktop/swayidle.nix
@ -17,6 +16,7 @@
./hardware/kmonad.nix
./networking/networkd.nix
./presets/cli.nix
./presets/common.nix
./presets/gui.nix
./presets/home-manager.nix
./system/user.nix

View file

@ -13,6 +13,50 @@ in
config = lib.mkIf cfg.enable {
systemd.network.enable = true;
networking.useNetworkd = true;
networking = {
dhcpcd.enable = false;
useDHCP = true;
useHostResolvConf = false;
};
# systemd.network.networks."60-wifi-client" = {
# matchConfig = {
# WLANInterfaceType = "station";
# };
# networkConfig = {
# DHCP = "yes";
# # IPv6AcceptRA = true;
# KeepConfiguration = "no";
# IPv6PrivacyExtensions = "kernel";
# };
# linkConfig.RequiredForOnline = "routable";
# dhcpV4Config = {
# RouteMetric = 1025;
# # IPv6OnlyMode = "yes";
# };
# ipv6AcceptRAConfig = {
# # UsePREF64 = true;
# RouteMetric = 1025;
# };
# };
# systemd.network.networks."60-ethernet-dhcp" = {
# matchConfig = {
# Kind = "!*";
# Type = "either";
# # Name = "en*";
# };
# linkConfig.RequiredForOnline = "routable";
# dhcpV4Config = {
# # IPv6OnlyMode = "yes";
# };
# networkConfig = {
# DHCP = "yes";
# # IPv6AcceptRA = true;
# KeepConfiguration = "no";
# IPv6PrivacyExtensions = "kernel";
# };
# # ipv6AcceptRAConfig.UsePREF64 = true;
# };
networking.wireless.iwd.enable = cfg.enableWifi;
# services.clatd.enable = true;
};
}

View file

@ -15,6 +15,27 @@ in
xyno.cli.starship.enable = true;
security.sudo.enable = false;
# Opitionally
i18n.defaultLocale = "en_US.UTF-8";
# i18n.extraLocales = ["de_DE.UTF-8"];
i18n.extraLocaleSettings = {
LC_CTYPE = "en_US.UTF8";
LC_ADDRESS = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MESSAGES = "en_US.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "en_US.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
LC_COLLATE = "de_DE.UTF-8";
};
home-manager.users.xyno.home.sessionVariables.LOCALE_ARCHIVE_2_27 =
lib.mkForce "/run/current-system/sw/lib/locale/locale-archive";
home-manager.users.xyno.systemd.user.sessionVariables.LOCALE_ARCHIVE_2_27 =
lib.mkForce "/run/current-system/sw/lib/locale/locale-archive";
nix.settings = {
substituters = [
"https://cache.lix.systems"
@ -51,6 +72,13 @@ in
enable = true;
};
services.pcscd.enable = true;
programs.gnupg.agent = {
enable = true;
# pinentrywlavor = "curses";
# enableSSHSupport = true;
};
environment.systemPackages = with pkgs; [
jq
fd
@ -80,7 +108,7 @@ in
programs.mosh.enable = true;
environment.variables.EDITOR = "hx";
environment.variables.VISUAL = "hx";
environment.variables.PAGER= "moar";
environment.variables.PAGER = "moar";
environment.shellAliases = {
l = "ls -alh";

View file

@ -0,0 +1,17 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.xyno.common;
in
{
options.xyno.common.enable = lib.mkEnableOption "enables common settings";
config = lib.mkIf cfg.enable {
boot.initrd.systemd.enable = true;
hardware.keyboard.zsa.enable = true;
programs.nh.enable = true;
};
}

View file

@ -16,7 +16,8 @@ in
config = lib.mkIf cfg.enable {
xyno.desktop.niri.enable = true;
xyno.desktop.audio.enable = lib.mkDefault true;
xyno.desktop.mate-polkit.enable = true;
security.soteria.enable = true;
security.rtkit.enable = true;
xyno.hardware.kmonad.enable = true;
# wayland on electron
environment.sessionVariables.NIXOS_OZONE_WL = "1";
@ -31,7 +32,19 @@ in
qt = {
enable = true;
style = "breeze";
platformTheme = "kde";
platformTheme = "lxqt";
};
programs.yazi = {
settings.keymap.manager.prepend_keymap = [
{
on = "y";
run = [
''shell -- for path in "$@"; do echo "file://$path"; done | ${pkgs.wl-clipboard-rs}/bin/wl-copy -t text/uri-list''
"yank"
];
}
];
};
# setup printing
@ -42,11 +55,14 @@ in
openFirewall = true;
};
services.printing.enable = true;
services.printing.stateless = true;
services.system-config-printer.enable = true;
# enable the gnome shit
services.gnome.gnome-keyring.enable = true;
services.gnome.gnome-online-accounts.enable = true;
services.gnome.core-utilities.enable = true;
services.gnome.gcr-ssh-agent.enable = lib.mkForce false;
services.gnome.sushi.enable = true;
services.gnome.gnome-settings-daemon.enable = true;
services.gvfs.enable = true;
@ -55,33 +71,34 @@ in
enable = true;
settings.default = [ "foot.desktop" ];
};
xdg.portal.xdgOpenUsePortal = true;
environment.sessionVariables.GTK_USE_PORTAL = "1";
home-manager.users.${config.xyno.system.user.name} =
{ pkgs, ... }:
{
xdg.mimeApps = {
enable = true;
defaultApplications = {
"x-scheme-handler/mailto" = [ "aerc.desktop" ];
"inode/directory" = [ "org.gnome.Nautilus.desktop" ];
"application/x-gnome-saved-search" = [ "org.gnome.Nautilus.desktop" ];
"x-scheme-handler/http" = "userapp-Zen-D2P132.desktop";
"x-scheme-handler/https" = "userapp-Zen-D2P132.desktop";
"x-scheme-handler/chrome" = "userapp-Zen-D2P132.desktop";
"text/html" = "userapp-Zen-D2P132.desktop";
"application/x-extension-htm" = "userapp-Zen-D2P132.desktop";
"application/x-extension-html" = "userapp-Zen-D2P132.desktop";
"application/x-extension-shtml" = "userapp-Zen-D2P132.desktop";
"application/xhtml+xml" = "userapp-Zen-D2P132.desktop";
"application/x-extension-xhtml" = "userapp-Zen-D2P132.desktop";
"application/x-extension-xht" = "userapp-Zen-D2P132.desktop";
"application/pdf" = "org.gnome.Evince.desktop";
# home-manager.users.${config.xyno.system.user.name} =
# { pkgs, ... }:
# {
# xdg.mimeApps = {
# enable = true;
# defaultApplications = {
# "x-scheme-handler/mailto" = [ "aerc.desktop" ];
# "inode/directory" = [ "org.gnome.Nautilus.desktop" ];
# "application/x-gnome-saved-search" = [ "org.gnome.Nautilus.desktop" ];
# "x-scheme-handler/http" = "userapp-Zen-D2P132.desktop";
# "x-scheme-handler/https" = "userapp-Zen-D2P132.desktop";
# "x-scheme-handler/chrome" = "userapp-Zen-D2P132.desktop";
# "text/html" = "userapp-Zen-D2P132.desktop";
# "application/x-extension-htm" = "userapp-Zen-D2P132.desktop";
# "application/x-extension-html" = "userapp-Zen-D2P132.desktop";
# "application/x-extension-shtml" = "userapp-Zen-D2P132.desktop";
# "application/xhtml+xml" = "userapp-Zen-D2P132.desktop";
# "application/x-extension-xhtml" = "userapp-Zen-D2P132.desktop";
# "application/x-extension-xht" = "userapp-Zen-D2P132.desktop";
# "application/pdf" = "org.gnome.Evince.desktop";
};
};
};
# };
# };
# };
environment.systemPackages = with pkgs; [
kdePackages.breeze-gtk
@ -98,6 +115,7 @@ in
source-code-pro # Default monospace font in 3.32
source-sans
b612
lxqt.lxqt-config
];

View file

@ -0,0 +1,22 @@
{
pkgs,
lib,
config,
...
}:
let
cfg = config.xyno.impermanence;
in
{
options.xyno.impermanence = {
enable = lib.mkEnableOption "erase all your darlings (they hate you anyways)";
extraFiles = lib.mkOption { type = lib.types.listOf lib.types.str; };
extraDirectories = lib.mkOption { type = lib.types.listOf lib.types.str; };
};
config = lib.mkIf cfg.enable {
imports = [ ]; # TODO
impermanence.extraFiles = cfg.extraFiles;
impermanence.extraDirectories = cfg.extraDirectories;
};
}