feat: niri, new winters ip, mail fixes
Some checks failed
Flake check / Check flake (push) Has been cancelled

This commit is contained in:
Leon Schwarzäugl 2025-08-24 14:56:50 +02:00
parent 9eb02e84ad
commit 7abc476d51
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
59 changed files with 1808 additions and 965 deletions

View file

@ -11,6 +11,7 @@
timer
e
swarselcheck
swarselcheck-niri
waybarupdate
opacitytoggle
fs-diff

View file

@ -1,4 +1,4 @@
{ self, lib, config, pkgs, globals, ... }:
{ self, lib, config, pkgs, globals, inputs, ... }:
let
inherit (config.swarselsystems) homeDir isPublic isNixos;
inherit (config.repo.secrets.common.emacs) radicaleUser;
@ -56,17 +56,19 @@ in
packageRequires = [ epkgs.jsonrpc epkgs.eglot ];
})
(epkgs.trivialBuild rec {
pname = "calfw";
version = "1.0.0-20231002";
src = pkgs.fetchFromGitHub {
owner = "haji-ali";
repo = "emacs-calfw";
rev = "bc99afee611690f85f0cd0bd33300f3385ddd3d3";
hash = "sha256-0xMII1KJhTBgQ57tXJks0ZFYMXIanrOl9XyqVmu7a7Y=";
};
packageRequires = [ epkgs.howm ];
})
(inputs.nixpkgs-dev.legacyPackages.${pkgs.system}.emacsPackagesFor pkgs.emacs-git-pgtk).calfw
# epkgs.calfw
# (epkgs.trivialBuild rec {
# pname = "calfw";
# version = "1.0.0-20231002";
# src = pkgs.fetchFromGitHub {
# owner = "haji-ali";
# repo = "emacs-calfw";
# rev = "bc99afee611690f85f0cd0bd33300f3385ddd3d3";
# hash = "sha256-0xMII1KJhTBgQ57tXJks0ZFYMXIanrOl9XyqVmu7a7Y=";
# };
# packageRequires = [ epkgs.howm ];
# })
(epkgs.trivialBuild rec {
pname = "fast-scroll";

View file

@ -7,11 +7,14 @@ in
config = lib.mkIf config.swarselmodules.gpgagent {
services.gpg-agent = {
enable = true;
verbose = true;
enableZshIntegration = true;
enableScDaemon = true;
enableSshSupport = true;
enableExtraSocket = true;
pinentry.package = pkgs.pinentry.gtk2;
pinentry.package = pkgs.wayprompt;
pinentry.program = "pinentry-wayprompt";
# pinentry.package = pkgs.pinentry.gtk2;
defaultCacheTtl = 600;
maxCacheTtl = 7200;
extraConfig = ''

View file

@ -1,16 +1,16 @@
{ lib, config, ... }:
{ self, lib, pkgs, config, ... }:
{
options.swarselmodules.kanshi = lib.mkEnableOption "kanshi settings";
config = lib.mkIf config.swarselmodules.kanshi {
swarselsystems = {
monitors = {
homedesktop = {
homedesktop = rec {
name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
mode = "2560x1440";
scale = "1";
position = "0,0";
workspace = "1:";
output = "DP-11";
workspace = "11:M";
output = name;
};
};
};
@ -36,6 +36,7 @@
{
profile = {
name = "lidopen";
exec = [ "${pkgs.swaybg}/bin/swaybg --output '${config.swarselsystems.sharescreen}' --image ${config.swarselsystems.wallpaper} --mode ${config.stylix.imageScalingMode}" ];
outputs = [
{
criteria = "eDP-2";
@ -46,41 +47,51 @@
};
}
{
profile = {
name = "lidopen";
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "enable";
scale = 1.7;
position = "2560,0";
}
{
criteria = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
scale = 1.0;
mode = "2560x1440";
position = "0,0";
}
];
};
profile =
let
monitor = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
in
{
name = "lidopen";
exec = [ "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/standwp.png --mode ${config.stylix.imageScalingMode}" ];
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "enable";
scale = 1.7;
position = "2560,0";
}
{
criteria = monitor;
scale = 1.0;
mode = "2560x1440";
position = "0,0";
}
];
};
}
{
profile = {
name = "lidclosed";
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "disable";
position = "2560,0";
}
{
criteria = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
scale = 1.0;
mode = "2560x1440";
position = "0,0";
}
];
};
profile =
let
monitor = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
in
{
name = "lidclosed";
exec = [ "${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/standwp.png --mode ${config.stylix.imageScalingMode}" ];
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "disable";
position = "2560,0";
}
{
criteria = monitor;
scale = 1.0;
mode = "2560x1440";
position = "0,0";
}
];
};
}
];
};

View file

@ -119,6 +119,7 @@ in
account = {
Timeout = 120;
PipelineDepth = 1;
AuthMechs = "LOGIN";
};
};
};

View file

@ -0,0 +1,204 @@
{ config, pkgs, lib, vars, ... }:
{
options.swarselmodules.niri = lib.mkEnableOption "niri settings";
config = lib.mkIf config.swarselmodules.niri {
programs.niri = {
package = pkgs.niri-unstable; # which package to use for niri validation
settings = {
xwayland-satellite = {
enable = true;
path = "${lib.getExe pkgs.xwayland-satellite-unstable}";
};
prefer-no-csd = true;
layer-rules = [
{ matches = [{ namespace = "^notifications$"; }]; block-out-from = "screencast"; }
{ matches = [{ namespace = "^wallpaper$"; }]; place-within-backdrop = true; }
];
window-rules = [
{
matches = [{ app-id = ".*"; }];
opacity = 0.95;
default-column-width = { proportion = 0.5; };
shadow = {
enable = true;
draw-behind-window = true;
};
geometry-corner-radius = { top-left = 2.0; top-right = 2.0; bottom-left = 2.0; bottom-right = 2.0; };
}
{ matches = [{ app-id = "at.yrlf.wl_mirror"; }]; opacity = 1.0; }
{ matches = [{ app-id = "Gimp"; }]; opacity = 1.0; }
{ matches = [{ app-id = "firefox"; }]; opacity = 0.99; }
{ matches = [{ app-id = "^special.*"; }]; default-column-width = { proportion = 0.9; }; open-on-workspace = "Scratchpad"; }
{ matches = [{ app-id = "chromium-browser"; }]; opacity = 0.99; }
{ matches = [{ app-id = "^qalculate-gtk$"; }]; open-floating = true; }
{ matches = [{ app-id = "^blueman$"; }]; open-floating = true; }
{ matches = [{ app-id = "^pavucontrol$"; }]; open-floating = true; }
{ matches = [{ app-id = "^syncthingtray$"; }]; open-floating = true; }
{ matches = [{ app-id = "^Element$"; }]; open-floating = true; default-column-width = { proportion = 0.5; }; block-out-from = "screencast"; }
# { matches = [{ app-id = "^Element$"; }]; default-column-width = { proportion = 0.9; }; open-on-workspace = "Scratchpad"; block-out-from = "screencast"; }
{ matches = [{ app-id = "^vesktop$"; }]; open-floating = true; default-column-width = { proportion = 0.5; }; block-out-from = "screencast"; }
# { matches = [{ app-id = "^vesktop$"; }]; default-column-width = { proportion = 0.9; }; open-on-workspace = "Scratchpad"; block-out-from = "screencast"; }
{ matches = [{ app-id = "^com.nextcloud.desktopclient.nextcloud$"; }]; open-floating = true; }
{ matches = [{ title = ".*1Password.*"; }]; excludes = [{ app-id = "^firefox$"; } { app-id = "^emacs$"; } { app-id = "^kitty$"; }]; open-floating = true; block-out-from = "screencast"; }
{ matches = [{ title = "(?:Open|Save) (?:File|Folder|As)"; }]; open-floating = true; }
{ matches = [{ title = "^Add$"; }]; open-floating = true; }
{ matches = [{ title = "^Picture-in-Picture$"; }]; open-floating = true; }
{ matches = [{ title = "Syncthing Tray"; }]; open-floating = true; }
{ matches = [{ title = "^Emacs Popup Frame$"; }]; open-floating = true; }
{ matches = [{ title = "^Emacs Popup Anchor$"; }]; open-floating = true; }
{ matches = [{ app-id = "^spotifytui$"; }]; open-floating = true; default-column-width = { proportion = 0.5; }; }
{ matches = [{ app-id = "^kittyterm$"; }]; open-floating = true; default-column-width = { proportion = 0.5; }; }
];
environment = {
DISPLAY = ":0";
} // vars.waylandSessionVariables;
screenshot-path = "~/Pictures/Screenshots/screenshot_%Y-%m-%d-%H%M%S.png";
input = {
mod-key = "Super";
keyboard = {
xkb = {
layout = "us";
variant = "altgr-intl";
};
};
mouse = {
natural-scroll = false;
};
touchpad = {
enable = true;
tap = true;
tap-button-map = "left-right-middle";
natural-scroll = true;
scroll-method = "two-finger";
click-method = "clickfinger";
disabled-on-external-mouse = true;
drag = true;
drag-lock = false;
dwt = true;
dwtp = true;
};
};
cursor = {
hide-after-inactive-ms = 2000;
hide-when-typing = true;
};
layout = {
background-color = "transparent";
border = {
enable = true;
width = 1;
};
focus-ring = {
enable = false;
};
gaps = 5;
};
binds = with config.lib.niri.actions; let
sh = spawn "sh" "-c";
in
{
# "Mod+Super_L" = spawn "killall -SIGUSR1 .waybar-wrapped";
"Mod+z".action = spawn "killall -SIGUSR1 .waybar-wrapped";
"Mod+Shift+t".action = toggle-window-rule-opacity;
# "Mod+Escape".action = "mode $exit";
"Mod+m".action = focus-workspace-previous;
"Mod+Shift+Space".action = toggle-window-floating;
"Mod+Shift+f".action = toggle-windowed-fullscreen;
"Mod+q".action = close-window;
"Mod+f".action = spawn "firefox";
"Mod+Space".action = spawn "fuzzel";
"Mod+Shift+c".action = spawn "qalculate-gtk";
"Mod+Ctrl+p".action = spawn "1password" "--quick-acces";
"Mod+Shift+Escape".action = spawn "kitty" "-o" "confirm_os_window_close=0" "btm";
"Mod+h".action = sh ''hyprpicker | wl-copy'';
# "Mod+s".action = spawn "grim" "-g" "\"$(slurp)\"" "-t" "png" "-" "|" "wl-copy" "-t" "image/png";
"Mod+s".action = screenshot { show-pointer = false; };
# "Mod+Shift+s".action = spawn "slurp" "|" "grim" "-g" "-" "Pictures/Screenshots/$(date +'screenshot_%Y-%m-%d-%H%M%S.png')";
"Mod+Shift+s".action = screenshot-window { write-to-disk = true; };
# "Mod+Shift+v".action = spawn "wf-recorder" "-g" "'$(slurp -f %o -or)'" "-f" "~/Videos/screenrecord_$(date +%Y-%m-%d-%H%M%S).mkv";
"Mod+e".action = sh "emacsclient -nquc -a emacs -e '(dashboard-open)'";
"Mod+c".action = sh "emacsclient -ce '(org-capture)'";
"Mod+t".action = sh "emacsclient -ce '(org-agenda)'";
"Mod+Shift+m".action = sh "emacsclient -ce '(mu4e)'";
"Mod+Shift+a".action = sh "emacsclient -ce '(swarsel/open-calendar)'";
"Mod+a".action = spawn "swarselcheck-niri" "-s";
"Mod+x".action = spawn "swarselcheck-niri" "-k";
"Mod+d".action = spawn "swarselcheck-niri" "-d";
"Mod+w".action = spawn "swarselcheck-niri" "-e";
"Mod+p".action = spawn "pass-fuzzel";
"Mod+o".action = spawn "pass-fuzzel" "--otp";
"Mod+Shift+p".action = spawn "pass-fuzzel" "--type";
"Mod+Shift+o".action = spawn "pass-fuzzel" "--otp" "--type";
"Mod+Left".action = focus-column-or-monitor-left;
"Mod+Right".action = focus-column-or-monitor-right;
"Mod+Down".action = focus-window-or-workspace-down;
"Mod+Up".action = focus-window-or-workspace-up;
"Mod+Shift+Left".action = move-column-left;
"Mod+Shift+Right".action = move-column-right;
"Mod+Shift+Down".action = move-window-down-or-to-workspace-down;
"Mod+Shift+Up".action = move-window-up-or-to-workspace-up;
# "Mod+Ctrl+Shift+c".action = "reload";
# "Mod+Ctrl+Shift+r".action = "exec swarsel-displaypower";
# "Mod+Shift+e".action = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
# "Mod+r".action = "mode resize";
# "Mod+Return".action = "exec kitty";
"Mod+Return".action = spawn "swarselzellij";
"XF86AudioRaiseVolume".action = spawn "swayosd-client" "--output-volume" "raise";
"XF86AudioLowerVolume".action = spawn "swayosd-client" "--output-volume" "lower";
"XF86AudioMute".action = spawn "swayosd-client" "--output-volume" "mute-toggle";
"XF86MonBrightnessUp".action = spawn "swayosd-client" "--brightness raise";
"XF86MonBrightnessDown".action = spawn "swayosd-client" "--brightness lower";
"XF86Display".action = spawn "wl-mirror" "eDP-1";
"Mod+Escape".action = spawn "wlogout";
"Mod+Equal".action = set-column-width "+10%";
"Mod+Minus".action = set-column-width "-10%";
"Mod+1".action = focus-workspace 1;
"Mod+2".action = focus-workspace 2;
"Mod+3".action = focus-workspace 3;
"Mod+4".action = focus-workspace 4;
"Mod+5".action = focus-workspace 5;
"Mod+6".action = focus-workspace 6;
"Mod+7".action = focus-workspace 7;
"Mod+8".action = focus-workspace 8;
"Mod+9".action = focus-workspace 9;
"Mod+0".action = focus-workspace 0;
"Mod+Shift+1".action = move-column-to-index 1;
"Mod+Shift+2".action = move-column-to-index 2;
"Mod+Shift+3".action = move-column-to-index 3;
"Mod+Shift+4".action = move-column-to-index 4;
"Mod+Shift+5".action = move-column-to-index 5;
"Mod+Shift+6".action = move-column-to-index 6;
"Mod+Shift+7".action = move-column-to-index 7;
"Mod+Shift+8".action = move-column-to-index 8;
"Mod+Shift+9".action = move-column-to-index 9;
"Mod+Shift+0".action = move-column-to-index 0;
};
spawn-at-startup = [
{ command = [ "vesktop" "--start-minimized" "--enable-speech-dispatcher" "--ozone-platform-hint=auto" "--enable-features=WaylandWindowDecorations" "--enable-wayland-ime" ]; }
{ command = [ "element-desktop" "--hidden" "--enable-features=UseOzonePlatform" "--ozone-platform=wayland" "--disable-gpu-driver-bug-workarounds" ]; }
{ command = [ "anki" ]; }
{ command = [ "obsidian" ]; }
{ command = [ "nm-applet" ]; }
{ command = [ "niri" "msg" "action" "focus-workspace" "2" ]; }
];
workspaces = {
# "01-Main" = {
# name = "Scratchpad";
# };
"99-Scratchpad" = {
name = "";
};
};
};
};
};
}

View file

@ -70,6 +70,7 @@
restic
# "big" programs
obs-studio
gimp
inkscape
zoom-us
@ -80,7 +81,7 @@
# spotify
vesktop # discord client
# nextcloud-client # enables a systemd service that I do not want
spotify-player
stable.spotify-player
element-desktop
nicotine-plus
stable.transmission_3
@ -135,8 +136,8 @@
# wayland stuff
wtype
wl-mirror
wl-clipboard
stable.wl-mirror
wf-recorder
kanshi

View file

@ -19,7 +19,7 @@
user = "root";
};
"winters" = {
hostname = "192.168.1.2";
hostname = "192.168.178.24";
user = "root";
};
"minecraft" = {

View file

@ -1,4 +1,4 @@
{ self, config, lib, vars, ... }:
{ config, lib, vars, ... }:
let
eachOutput = _: monitor: {
inherit (monitor) name;
@ -201,22 +201,14 @@ in
"${modifier}+r" = "mode resize";
# "${modifier}+Return" = "exec kitty";
"${modifier}+Return" = "exec swarselzellij";
"${modifier}+Print" = "exec screenshare";
# exec swaymsg move workspace to "$(swaymsg -t get_outputs | jq '[.[] | select(.active == true)] | .[(map(.focused) | index(true) + 1) % length].name')"
# "XF86AudioRaiseVolume" = "exec pa 5%";
# "XF86AudioRaiseVolume" = "exec pamixer -i 5";
"XF86AudioRaiseVolume" = "exec swayosd-client --output-volume raise";
# "XF86AudioLowerVolume" = "exec pactl set-sink-volume @DEFAULT_SINK@ -5%";
# "XF86AudioLowerVolume" = "exec pamixer -d 5";
"XF86AudioLowerVolume" = "exec swayosd-client --output-volume lower";
# "XF86AudioMute" = "exec pactl set-sink-mute @DEFAULT_SINK@ toggle";
# "XF86AudioMute" = "exec pamixer -t";
"XF86AudioMute" = "exec swayosd-client --output-volume mute-toggle";
# "XF86MonBrightnessUp" = "exec brightnessctl set +5%";
"XF86MonBrightnessUp" = "exec swayosd-client --brightness raise";
# "XF86MonBrightnessDown" = "exec brightnessctl set 5%-";
"XF86MonBrightnessDown" = "exec swayosd-client --brightness lower";
"XF86Display" = "exec wl-mirror eDP-1";
# "--no-repeat Super_L" = "exec killall -SIGUSR1 .waybar-wrapped";
# "${modifier}+z" = "exec killall -SIGUSR1 .waybar-wrapped";
}
config.swarselsystems.keybindings;
modes = {
@ -231,14 +223,14 @@ in
};
};
defaultWorkspace = "workspace 1:";
output = {
"${config.swarselsystems.sharescreen}" = {
bg = "${self}/files/wallpaper/lenovowp.png ${config.stylix.imageScalingMode}";
};
"Philips Consumer Electronics Company PHL BDM3270 AU11806002320" = {
bg = "${self}/files/wallpaper/standwp.png ${config.stylix.imageScalingMode}";
};
};
# output = {
# "${config.swarselsystems.sharescreen}" = {
# bg = "${self}/files/wallpaper/lenovowp.png ${config.stylix.imageScalingMode}";
# };
# "Philips Consumer Electronics Company PHL BDM3270 AU11806002320" = {
# bg = "${self}/files/wallpaper/standwp.png ${config.stylix.imageScalingMode}";
# };
# };
input = config.swarselsystems.standardinputs;
workspaceOutputAssign =
let

View file

@ -70,20 +70,29 @@ in
enable = true;
systemd = {
enable = true;
target = "sway-session.target";
# target = "sway-session.target";
inherit (config.wayland.systemd) target;
};
settings = {
mainBar = {
ipc = true;
id = "bar-0";
# mode = "hide";
# mode = "overlay";
# passthrough = false;
# start_hidden = true;
layer = "top";
position = "top";
modules-left = [ "sway/workspaces" "custom/outer-right-arrow-dark" "sway/window" ];
modules-left = [ "sway/workspaces" "niri/workspaces" "custom/outer-right-arrow-dark" "niri/window" "sway/window" ];
modules-center = [ "sway/mode" "privacy" "custom/github" "custom/configwarn" "custom/nix-updates" ];
"sway/mode" = {
format = "<span style=\"italic\" font-weight=\"bold\">{}</span>";
};
"niri/window" = {
format = "<span style=\"italic\" font-weight=\"bold\">{title} ({app_id})</span>";
};
modules-right = config.swarselsystems.waybarModules;
"custom/pseudobat" = lib.mkIf (!config.swarselsystems.isLaptop) {

View file

@ -59,9 +59,8 @@ in
};
};
msmtp = {
enable = false;
enable = true;
extraConfig = {
account = "work";
auth = "xoauth2";
host = "outlook.office365.com";
protocol = "smtp";
@ -73,10 +72,11 @@ in
passwordeval = "pizauth show work";
};
};
mu.enable = false;
mu.enable = true;
mbsync = {
enable = false;
enable = true;
expunge = "both";
patterns = [ "INBOX" ];
extraConfig = {
account = {
AuthMechs = "XOAUTH2";
@ -85,19 +85,19 @@ in
};
};
wayland.windowManager.sway.config = {
output = {
"Applied Creative Technology Transmitter QUATTRO201811" = {
bg = "${self}/files/wallpaper/navidrome.png ${config.stylix.imageScalingMode}";
};
"Hewlett Packard HP Z24i CN44250RDT" = {
bg = "${self}/files/wallpaper/op6wp.png ${config.stylix.imageScalingMode}";
};
"HP Inc. HP 732pk CNC4080YL5" = {
bg = "${self}/files/wallpaper/botanicswp.png ${config.stylix.imageScalingMode}";
};
};
};
# wayland.windowManager.sway.config = {
# output = {
# "Applied Creative Technology Transmitter QUATTRO201811" = {
# bg = "${self}/files/wallpaper/navidrome.png ${config.stylix.imageScalingMode}";
# };
# "Hewlett Packard HP Z24i CN44250RDT" = {
# bg = "${self}/files/wallpaper/op6wp.png ${config.stylix.imageScalingMode}";
# };
# "HP Inc. HP 732pk CNC4080YL5" = {
# bg = "${self}/files/wallpaper/botanicswp.png ${config.stylix.imageScalingMode}";
# };
# };
# };
stylix = {
targets.firefox.profileNames =
@ -278,6 +278,10 @@ in
{
profile = {
name = "lidopen";
exec = [
"${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP 732pk CNC4080YL5' --image ${self}/files/wallpaper/botanicswp.png --mode ${config.stylix.imageScalingMode}"
"${pkgs.swaybg}/bin/swaybg --output 'Hewlett Packard HP Z24i CN44250RDT' --image ${self}/files/wallpaper/op6wp.png --mode ${config.stylix.imageScalingMode}"
];
outputs = [
{
criteria = config.swarselsystems.sharescreen;
@ -302,27 +306,39 @@ in
};
}
{
profile = {
name = "lidopen";
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "enable";
scale = 1.7;
position = "2560,0";
}
{
criteria = "Applied Creative Technology Transmitter QUATTRO201811";
scale = 1.0;
mode = "1280x720";
position = "10000,10000";
}
];
};
profile =
let
monitor = "Applied Creative Technology Transmitter QUATTRO201811";
in
{
name = "lidopen";
exec = [
"${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/navidrome.png --mode ${config.stylix.imageScalingMode}"
"${pkgs.kanshare}/bin/kanshare ${config.swarselsystems.sharescreen} '${monitor}'"
];
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "enable";
scale = 1.7;
position = "2560,0";
}
{
criteria = "Applied Creative Technology Transmitter QUATTRO201811";
scale = 1.0;
mode = "1280x720";
position = "10000,10000";
}
];
};
}
{
profile = {
name = "lidclosed";
exec = [
"${pkgs.swaybg}/bin/swaybg --output 'HP Inc. HP 732pk CNC4080YL5' --image ${self}/files/wallpaper/botanicswp.png --mode ${config.stylix.imageScalingMode}"
"${pkgs.swaybg}/bin/swaybg --output 'Hewlett Packard HP Z24i CN44250RDT' --image ${self}/files/wallpaper/op6wp.png --mode ${config.stylix.imageScalingMode}"
];
outputs = [
{
criteria = config.swarselsystems.sharescreen;
@ -345,28 +361,47 @@ in
};
}
{
profile = {
name = "lidclosed";
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "disable";
}
{
criteria = "Applied Creative Technology Transmitter QUATTRO201811";
scale = 1.0;
mode = "1280x720";
position = "10000,10000";
}
];
};
profile =
let
monitor = "Applied Creative Technology Transmitter QUATTRO201811";
in
{
name = "lidclosed";
exec = [
"${pkgs.swaybg}/bin/swaybg --output '${monitor}' --image ${self}/files/wallpaper/navidrome.png --mode ${config.stylix.imageScalingMode}"
];
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "disable";
}
{
criteria = "Applied Creative Technology Transmitter QUATTRO201811";
scale = 1.0;
mode = "1280x720";
position = "10000,10000";
}
];
};
}
];
};
};
systemd.user.services.pizauth.Service = {
ExecStartPost = [
"${pkgs.toybox}/bin/sleep 1"
"//bin/sh -c '${lib.getExe pkgs.pizauth} restore < ${homeDir}/.pizauth.state'"
];
};
swarselservices.pizauth = {
enable = true;
extraConfig = ''
auth_notify_cmd = "if [[ \"$(notify-send -A \"Open $PIZAUTH_ACCOUNT\" -t 30000 'pizauth authorisation')\" == \"0\" ]]; then open \"$PIZAUTH_URL\"; fi";
error_notify_cmd = "notify-send -t 90000 \"pizauth error for $PIZAUTH_ACCOUNT\" \"$PIZAUTH_MSG\"";
token_event_cmd = "pizauth dump > ${homeDir}/.pizauth.state";
'';
accounts = {
work = {
authUri = "https://login.microsoftonline.com/common/oauth2/v2.0/authorize";
@ -444,70 +479,60 @@ in
{ command = "1password"; }
];
monitors = {
main = {
name = "BOE 0x0BC9 Unknown";
mode = "2560x1600"; # TEMPLATE
scale = "1";
position = "2560,0";
workspace = "15:L";
output = "eDP-2";
};
homedesktop = {
name = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
mode = "2560x1440";
scale = "1";
position = "0,0";
workspace = "1:";
output = "DP-11";
};
work_back_middle = {
work_back_middle = rec {
name = "LG Electronics LG Ultra HD 0x000305A6";
mode = "2560x1440";
scale = "1";
position = "5120,0";
workspace = "1:";
output = "DP-10";
# output = "DP-10";
output = name;
};
work_front_left = {
work_front_left = rec {
name = "LG Electronics LG Ultra HD 0x0007AB45";
mode = "3840x2160";
scale = "1";
position = "5120,0";
workspace = "1:";
output = "DP-7";
# output = "DP-7";
output = name;
};
work_back_right = {
work_back_right = rec {
name = "HP Inc. HP Z32 CN41212T55";
mode = "3840x2160";
scale = "1";
position = "5120,0";
workspace = "1:";
output = "DP-3";
# output = "DP-3";
output = name;
};
work_middle_middle_main = {
work_middle_middle_main = rec {
name = "HP Inc. HP 732pk CNC4080YL5";
mode = "3840x2160";
scale = "1";
position = "-1280,0";
workspace = "11:M";
output = "DP-8";
# output = "DP-8";
output = name;
};
work_middle_middle_side = {
work_middle_middle_side = rec {
name = "Hewlett Packard HP Z24i CN44250RDT";
mode = "1920x1200";
transform = "270";
scale = "1";
position = "-2480,0";
workspace = "12:S";
output = "DP-9";
# output = "DP-9";
output = name;
};
work_seminary = {
work_seminary = rec {
name = "Applied Creative Technology Transmitter QUATTRO201811";
mode = "1280x720";
scale = "1";
position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse
workspace = "14:T";
output = "DP-4";
# output = "DP-4";
output = name;
};
};
inputs = {
@ -531,9 +556,6 @@ in
xkb_variant = "altgr-intl";
};
};
keybindings = {
"Mod4+Ctrl+Shift+p" = "exec screenshare";
};
};
};

View file

@ -0,0 +1,23 @@
{ lib, config, ... }:
let
moduleName = "keyd";
in
{
options.swarselmodules.${moduleName} = lib.mkEnableOption "${moduleName} tools config";
config = lib.mkIf config.swarselmodules.${moduleName} {
services.keyd = {
enable = true;
keyboards = {
default = {
ids = [ "*" ];
settings = {
main = {
leftmeta = "overload(meta, macro(rightmeta+z))";
rightmeta = "overload(meta, macro(rightmeta+z))";
};
};
};
};
};
};
}

View file

@ -99,25 +99,26 @@ in
${wlan1} = {
connection = {
id = wlan1;
permissions = "";
# permissions = "";
type = "wifi";
};
ipv4 = {
dns-search = "";
# dns-search = "";
method = "auto";
};
ipv6 = {
addr-gen-mode = "stable-privacy";
dns-search = "";
# dns-search = "";
method = "auto";
};
wifi = {
mac-address-blacklist = "";
# mac-address-blacklist = "";
mode = "infrastructure";
band = "a";
ssid = wlan1;
};
wifi-security = {
auth-alg = "open";
# auth-alg = "open";
key-mgmt = "wpa-psk";
psk = "$WLAN1_PW";
};

View file

@ -0,0 +1,25 @@
{ lib, config, pkgs, ... }:
let
moduleName = "niri";
in
{
options.swarselmodules.${moduleName} = lib.mkEnableOption "${moduleName} settings";
config = lib.mkIf config.swarselmodules.${moduleName} {
environment.systemPackages = with pkgs; [
wl-clipboard
wayland-utils
libsecret
cage
gamescope
xwayland-satellite-unstable
];
niri-flake.cache.enable = true;
programs.niri = {
enable = true;
package = pkgs.niri-unstable; # the actual niri that will be installed and used
};
};
}

View file

@ -23,7 +23,6 @@
dbus
swaylock-effects
syncthingtray-minimal
wl-mirror
swayosd
# secure boot
@ -48,8 +47,6 @@
# better make for general tasks
just
screenshare
fullscreen
# keyboards
qmk
@ -61,6 +58,7 @@
# kde-connect
xdg-desktop-portal
xdg-desktop-portal-gtk
xdg-desktop-portal-wlr
# bluetooth

View file

@ -13,6 +13,11 @@ in
comment = "Sway compositor managed by UWSM";
binPath = "/run/current-system/sw/bin/sway";
};
niri = {
prettyName = "Niri";
comment = "Niri compositor managed by UWSM";
binPath = "/run/current-system/sw/bin/niri-session";
};
};
};
};

View file

@ -4,11 +4,11 @@
config = lib.mkIf config.swarselmodules.xdg-portal {
xdg.portal = {
enable = true;
config = {
common = {
default = "wlr";
};
};
# config = {
# common = {
# default = "wlr";
# };
# };
wlr.enable = true;
wlr.settings.screencast = {
output_name = "eDP-1";

View file

@ -39,6 +39,18 @@ in
);
};
hosts = mkOption {
type = types.attrsOf (
types.submodule {
options = {
ipv4 = mkOption {
type = types.str;
};
};
}
);
};
domains = {
main = mkOption {
type = types.str;

View file

@ -24,7 +24,7 @@ in
emacs-radicale-pw = { owner = mainUser; };
});
templates = {
authinfo = {
authinfo = lib.mkIf modules.emacs {
path = "${homeDir}/.emacs.d/.authinfo";
content = ''
machine ${globals.services.radicale.domain} login ${radicaleUser} password ${config.sops.placeholder.emacs-radicale-pw}

View file

@ -12,7 +12,7 @@ in
users = {
root = {
inherit (globals.root) hashedPassword;
shell = pkgs.zsh;
# shell = pkgs.zsh;
};
"${config.swarselsystems.mainUser}" = {
isNormalUser = true;

View file

@ -1,28 +1,9 @@
{ self, lib, pkgs, config, configName, ... }:
let
inherit (config.swarselsystems) mainUser homeDir xdgDir;
inherit (config.swarselsystems) mainUser homeDir;
iwd = config.networking.networkmanager.wifi.backend == "iwd";
owner = mainUser;
sopsFile = self + /secrets/work/secrets.yaml;
swarselService = name: description: execStart: {
"${name}" = {
enable = true;
inherit description;
serviceConfig = {
ExecStart = execStart;
User = mainUser;
Group = "users";
Environment = [
"PATH=/run/current-system/sw/bin:/etc/profiles/per-user/${mainUser}/bin"
"XDG_RUNTIME_DIR=${xdgDir}"
"WAYLAND_DISPLAY=wayland-1"
];
Type = "oneshot";
StandardOutput = "journal";
StandardError = "journal";
};
};
};
in
{
options.swarselmodules.optional.work = lib.mkEnableOption "optional work settings";
@ -124,6 +105,7 @@ in
mac-address = "E8:65:38:52:63:FF";
mac-address-randomization = "1";
mode = "infrastructure";
band = "a";
ssid = "VBC";
};
wifi-security = {
@ -171,10 +153,6 @@ in
};
environment.systemPackages = with pkgs; [
# (python39.withPackages (ps: with ps; [
# cryptography
# ]))
# docker
stable24_11.python39
qemu
packer
@ -228,19 +206,12 @@ in
};
udev.extraRules = ''
# share screen when dongle detected
SUBSYSTEM=="usb", ACTION=="add", ATTRS{idVendor}=="343c", ATTRS{idProduct}=="0000", TAG+="systemd", ENV{SYSTEMD_WANTS}="swarsel-screenshare.service"
# lock screen when yubikey removed
ACTION=="remove", ENV{PRODUCT}=="3/1050/407/110", RUN+="${pkgs.systemd}/bin/systemctl suspend"
'';
};
systemd.services = lib.mkMerge [
(swarselService "swarsel-screenshare" "Start screensharing after HDMI dongle is detected" "${pkgs.screenshare}/bin/screenshare -h")
];
# cgroups v1 is required for centos7 dockers
# specialisation = {
# cgroup_v1.configuration = {

View file

@ -5,6 +5,7 @@ let
servicePort = 27701;
serviceName = "ankisync";
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
ankiUser = globals.user.name;
in
@ -41,7 +42,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -1,8 +1,9 @@
{ lib, config, ... }:
{ lib, config, globals, ... }:
let
servicePort = 8888;
serviceName = "atuin";
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
in
{
options.swarselmodules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
@ -23,7 +24,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -1,10 +1,11 @@
{ self, lib, config, ... }:
{ self, lib, config, globals, ... }:
let
servicePort = 80;
serviceUser = "firefly-iii";
serviceGroup = serviceUser;
serviceName = "firefly-iii";
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
nginxGroup = "nginx";
@ -81,7 +82,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -7,6 +7,7 @@ let
serviceGroup = serviceUser;
serviceName = "forgejo";
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
kanidmDomain = globals.services.kanidm.domain;
in
@ -132,7 +133,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -1,10 +1,11 @@
{ self, lib, config, ... }:
{ self, lib, config, globals, ... }:
let
servicePort = 80;
serviceName = "freshrss";
serviceUser = "freshrss";
serviceGroup = serviceName;
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
inherit (config.swarselsystems) sopsFile;
in
@ -77,7 +78,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -4,6 +4,7 @@ let
serviceUser = "immich";
serviceName = "immich";
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
in
{
options.swarselmodules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
@ -33,7 +34,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -1,9 +1,10 @@
{ pkgs, lib, config, ... }:
{ pkgs, lib, config, globals, ... }:
let
servicePort = 8096;
serviceName = "jellyfin";
serviceUser = "jellyfin";
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
in
{
options.swarselmodules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
@ -37,7 +38,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -1,8 +1,9 @@
{ pkgs, lib, config, ... }:
{ pkgs, lib, config, globals, ... }:
let
servicePort = 8088;
serviceName = "jenkins";
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
in
{
options.swarselmodules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
@ -21,7 +22,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -8,6 +8,7 @@ let
serviceGroup = serviceUser;
serviceName = "kanidm";
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
oauth2ProxyDomain = globals.services.oauth2Proxy.domain;
immichDomain = globals.services.immich.domain;
@ -237,7 +238,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -1,4 +1,4 @@
{ self, lib, config, pkgs, ... }:
{ self, lib, config, pkgs, globals, ... }:
let
inherit (config.swarselsystems) sopsFile;
@ -6,6 +6,7 @@ let
serviceName = "kavita";
serviceUser = "kavita";
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
in
{
options.swarselmodules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
@ -41,7 +42,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -1,4 +1,4 @@
{ self, lib, config, ... }:
{ self, lib, config, globals, ... }:
let
serviceUser = "koillection";
serviceDB = "koillection";
@ -6,6 +6,7 @@ let
servicePort = 2282;
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceDir = "/Vault/data/koillection";
serviceAddress = globals.hosts.winters.ipv4;
postgresUser = config.systemd.services.postgresql.serviceConfig.User; # postgres
postgresPort = config.services.postgresql.settings.port; # 5432
@ -107,7 +108,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -1,4 +1,4 @@
{ lib, config, pkgs, ... }:
{ lib, config, pkgs, globals, ... }:
let
inherit (config.swarselsystems) sopsFile;
@ -6,6 +6,7 @@ let
serviceName = "matrix";
serviceDomain = config.repo.secrets.common.services.domains.matrix;
serviceUser = "matrix-synapse";
serviceAddress = globals.hosts.winters.ipv4;
federationPort = 8448;
whatsappPort = 29318;
@ -293,7 +294,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -5,6 +5,7 @@ let
serviceGroup = serviceUser;
serviceName = "grafana";
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
prometheusPort = 9090;
prometheusUser = "prometheus";
@ -209,12 +210,12 @@ in
upstreams = {
"${grafanaUpstream}" = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
"${prometheusUpstream}" = {
servers = {
"192.168.1.2:${builtins.toString prometheusPort}" = { };
"${serviceAddress}:${builtins.toString prometheusPort}" = { };
};
};
};

View file

@ -1,10 +1,11 @@
{ pkgs, config, lib, ... }:
{ pkgs, config, lib, globals, ... }:
let
servicePort = 4040;
serviceName = "navidrome";
serviceUser = "navidrome";
serviceGroup = serviceUser;
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
in
{
options.swarselmodules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
@ -84,7 +85,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -1,4 +1,4 @@
{ pkgs, lib, config, ... }:
{ pkgs, lib, config, globals, ... }:
let
inherit (config.repo.secrets.local.nextcloud) adminuser;
inherit (config.swarselsystems) sopsFile;
@ -8,6 +8,7 @@ let
serviceGroup = serviceUser;
serviceName = "nextcloud";
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
in
{
options.swarselmodules.server.${serviceName} = lib.mkEnableOption "enable ${serviceName} on server";
@ -51,7 +52,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -7,6 +7,7 @@ let
serviceGroup = serviceUser;
serviceName = "paperless";
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
tikaPort = 9998;
gotenbergPort = 3002;
@ -101,7 +102,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -1,4 +1,4 @@
{ self, lib, config, ... }:
{ self, lib, config, globals, ... }:
let
sopsFile = self + /secrets/winters/secrets2.yaml;
@ -7,6 +7,7 @@ let
serviceUser = "radicale";
serviceGroup = serviceUser;
serviceDomain = config.repo.secrets.common.services.domains.${serviceName};
serviceAddress = globals.hosts.winters.ipv4;
cfg = config.services.${serviceName};
in
@ -85,7 +86,7 @@ in
upstreams = {
${serviceName} = {
servers = {
"192.168.1.2:${builtins.toString servicePort}" = { };
"${serviceAddress}:${builtins.toString servicePort}" = { };
};
};
};

View file

@ -1,12 +1,14 @@
{ lib, config, configName, ... }:
{ lib, config, configName, globals, ... }:
let
inherit (config.swarselsystems.syncthing) serviceDomain;
inherit (config.swarselsystems.syncthing) serviceIP;
servicePort = 8384;
serviceUser = "syncthing";
serviceGroup = serviceUser;
serviceName = "syncthing";
serviceAddress = globals.hosts.winters.ipv4;
specificServiceName = "syncthing-${configName}";
inherit (config.swarselsystems.syncthing) serviceDomain;
inherit (config.swarselsystems.syncthing) serviceIP;
cfg = config.services.${serviceName};
devices = config.swarselsystems.syncthing.syncDevices;
@ -22,7 +24,7 @@ in
};
serviceIP = lib.mkOption {
type = lib.types.str;
default = "192.168.1.2";
default = "${serviceAddress}";
};
syncDevices = lib.mkOption {
type = lib.types.listOf lib.types.str;