add kanshi, sep. wps, navidrome update, tools

This commit is contained in:
Leon Schwarzäugl 2025-03-19 17:14:49 +01:00
parent 6311d0c01e
commit 431cd97efe
Signed by: swarsel
GPG key ID: 26A54C31F2A4FD84
23 changed files with 889 additions and 544 deletions

View file

@ -297,10 +297,6 @@ When setting this option normally, the password would normally be written world-
inputs = { }; inputs = { };
}; };
nix-topology.url = "github:oddlama/nix-topology"; nix-topology.url = "github:oddlama/nix-topology";
scenefx = {
url = "github:wlrfx/scenefx";
inputs.nixpkgs.follows = "nixpkgs";
};
#+end_src #+end_src
** let ** let
:PROPERTIES: :PROPERTIES:
@ -852,6 +848,8 @@ My work machine. Built for more security, this is the gold standard of my config
}; };
hardware = { hardware = {
enableAllFirmware = true;
cpu.amd.updateMicrocode = true;
amdgpu = { amdgpu = {
opencl.enable = true; opencl.enable = true;
amdvlk = { amdvlk = {
@ -863,23 +861,23 @@ My work machine. Built for more security, this is the gold standard of my config
programs.fw-fanctrl = { programs.fw-fanctrl = {
enable = true; enable = true;
config = { # config = {
defaultStrategy = "lazy"; # defaultStrategy = "lazy";
strategies = { # strategies = {
"lazy" = { # "lazy" = {
fanSpeedUpdateFrequency = 5; # fanSpeedUpdateFrequency = 5;
movingAverageInterval = 30; # movingAverageInterval = 30;
speedCurve = [ # speedCurve = [
{ temp = 0; speed = 15; } # { temp = 0; speed = 15; }
{ temp = 50; speed = 15; } # { temp = 50; speed = 15; }
{ temp = 65; speed = 25; } # { temp = 65; speed = 25; }
{ temp = 70; speed = 35; } # { temp = 70; speed = 35; }
{ temp = 75; speed = 50; } # { temp = 75; speed = 50; }
{ temp = 85; speed = 100; } # { temp = 85; speed = 100; }
]; # ];
}; # };
}; # };
}; # };
}; };
networking = { networking = {
@ -892,7 +890,14 @@ My work machine. Built for more security, this is the gold standard of my config
services = { services = {
fwupd.enable = true; fwupd.enable = true;
udev.extraRules = '' udev.extraRules = ''
# Make Framework 16 Ethernet Module work reliably
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20" ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20"
# disable Wakup on Framework Laptop 16 Keyboard
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0018", ATTR{power/wakeup}="disabled"
# disable Wakup on Framework Laptop 16 Numpad Module
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0014", ATTR{power/wakeup}="disabled"
''; '';
}; };
@ -913,14 +918,11 @@ My work machine. Built for more security, this is the gold standard of my config
isNixos = true; isNixos = true;
flakePath = "/home/swarsel/.dotfiles"; flakePath = "/home/swarsel/.dotfiles";
cpuCount = 16; cpuCount = 16;
# temperatureHwmon = { temperatureHwmon = {
# isAbsolutePath = true; isAbsolutePath = true;
# path = "/sys/devices/platform/thinkpad_hwmon/hwmon/"; path = "/sys/devices/virtual/thermal/thermal_zone0/";
# input-filename = "temp1_input"; input-filename = "temp4_input";
# }; };
# ------ -----
# | DP-4 | |eDP-1|
# ------ -----
startup = [ startup = [
{ command = "nextcloud --background"; } { command = "nextcloud --background"; }
{ command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; } { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; }
@ -998,7 +1000,7 @@ My work machine. Built for more security, this is the gold standard of my config
mode = "1280x720"; mode = "1280x720";
scale = "1"; scale = "1";
position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse
workspace = "12:S"; workspace = "14:T";
output = "DP-4"; output = "DP-4";
}; };
}; };
@ -1041,6 +1043,7 @@ My work machine. Built for more security, this is the gold standard of my config
} }
#+end_src #+end_src
***** hardware-configuration ***** hardware-configuration
@ -1049,17 +1052,36 @@ My work machine. Built for more security, this is the gold standard of my config
:END: :END:
#+begin_src nix :tangle hosts/nixos/nbl-imba-2/hardware-configuration.nix #+begin_src nix :tangle hosts/nixos/nbl-imba-2/hardware-configuration.nix
{ config, lib, modulesPath, ... }: { config, pkgs, lib, modulesPath, ... }:
{ {
imports = imports =
[ [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
# Fix Wlan after suspend or Hibernate
environment.etc."systemd/system-sleep/fix-wifi.sh".source =
pkgs.writeShellScript "fix-wifi.sh" ''
case $1/$2 in
pre/*)
${pkgs.kmod}/bin/modprobe -r mt7921e mt792x_lib mt76
echo 1 > /sys/bus/pci/devices/0000:04:00.0/remove
;;
post/*)
${pkgs.kmod}/bin/modprobe mt7921e
echo 1 > /sys/bus/pci/rescan
;;
esac
'';
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "cryptd" "usbhid" "sd_mod" "r8152" ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "cryptd" "usbhid" "sd_mod" "r8152" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ "sg" ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.kernelParams = [
"mem_sleep_default=deep"
"amd_pstate=passive"
# Fix screen flickering issue at the cost of battery life (disable PSR and PSR-SU, keep PR enabled) # Fix screen flickering issue at the cost of battery life (disable PSR and PSR-SU, keep PR enabled)
# TODO: figure out if this is worth it # TODO: figure out if this is worth it
# test PSR/PR state with 'sudo grep '' /sys/kernel/debug/dri/0000*/eDP-2/*_capability' # test PSR/PR state with 'sudo grep '' /sys/kernel/debug/dri/0000*/eDP-2/*_capability'
@ -1067,7 +1089,8 @@ My work machine. Built for more security, this is the gold standard of my config
# https://old.reddit.com/r/framework/comments/1goh7hc/anyone_else_get_this_screen_flickering_issue/ # https://old.reddit.com/r/framework/comments/1goh7hc/anyone_else_get_this_screen_flickering_issue/
# https://www.reddit.com/r/NixOS/comments/1hjruq1/graphics_corruption_on_kernel_6125_and_up/ # https://www.reddit.com/r/NixOS/comments/1hjruq1/graphics_corruption_on_kernel_6125_and_up/
# https://gitlab.freedesktop.org/drm/amd/-/issues/3797 # https://gitlab.freedesktop.org/drm/amd/-/issues/3797
boot.kernelParams = [ "amdgpu.dcdebugmask=0x410" ]; "amdgpu.dcdebugmask=0x410"
];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.initrd.luks.devices."cryptroot" = { boot.initrd.luks.devices."cryptroot" = {
@ -2415,7 +2438,7 @@ This app checks for different apps that I keep around in the scratchpad for quic
#+begin_src shell :tangle scripts/swarselzellij.sh #+begin_src shell :tangle scripts/swarselzellij.sh
KITTIES=$(($(pgrep -P 1 kitty | wc -l) - 1)) KITTIES=$(($(pgrep -P 1 kitty | wc -l) - 1))
if [[ $KITTIES -lt 1 ]]; then if ((KITTIES < 1)); then
exec kitty -o confirm_os_window_close=0 zellij attach --create main exec kitty -o confirm_os_window_close=0 zellij attach --create main
else else
exec kitty -o confirm_os_window_close=0 zellij attach --create "temp $KITTIES" exec kitty -o confirm_os_window_close=0 zellij attach --create "temp $KITTIES"
@ -2604,21 +2627,10 @@ This utility checks if there are updated packages in nixpkgs-unstable. It does s
#+begin_src shell :tangle scripts/screenshare.sh #+begin_src shell :tangle scripts/screenshare.sh
SHARESCREEN="$(nix eval --raw ~/.dotfiles#nixosConfigurations."$(hostname)".config.home-manager.users."$(whoami)".swarselsystems.sharescreen)" SHARESCREEN="$(nix eval --raw ~/.dotfiles#nixosConfigurations."$(hostname)".config.home-manager.users."$(whoami)".swarselsystems.sharescreen)"
touch /tmp/screenshare.state
STATE=$(< /tmp/screenshare.state)
if [[ $STATE != "1" ]]; then
wl-mirror "$SHARESCREEN" & wl-mirror "$SHARESCREEN" &
sleep 0.1 sleep 0.1
swaymsg output "$SHARESCREEN" mode "$SWARSEL_LO_RES" swaymsg '[app_id=at.yrlf.wl_mirror] move to workspace 14:T'
echo 1 > /tmp/screenshare.state
swaymsg '[app_id=at.yrlf.wl_mirror] move to workspace 12:S'
swaymsg '[app_id=at.yrlf.wl_mirror] fullscreen' swaymsg '[app_id=at.yrlf.wl_mirror] fullscreen'
else
swaymsg output "$SHARESCREEN" mode "$SWARSEL_HI_RES"
echo 0 > /tmp/screenshare.state
swaymsg '[app_id=at.yrlf.wl_mirror] kill'
fi
#+end_src #+end_src
@ -3543,157 +3555,6 @@ This script allows for quick git branch switching.
#+end_src #+end_src
**** swayfxoki
#+begin_src nix :tangle pkgs/swayfxoki/default.nix
{
lib,
fetchFromGitHub,
stdenv,
systemd,
meson,
replaceVars,
swaybg,
ninja,
pkg-config,
gdk-pixbuf,
librsvg,
wayland-protocols,
libdrm,
libinput,
cairo,
pango,
wayland,
libGL,
libxkbcommon,
pcre2,
cmake,
json_c,
libevdev,
scdoc,
scenefx,
wayland-scanner,
xcbutilwm,
wlroots_0_18,
testers,
nixosTests,
# Used by the NixOS module:
isNixOS ? false,
enableXWayland ? true,
systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd,
trayEnabled ? systemdSupport,
...
}:
stdenv.mkDerivation (finalAttrs: {
inherit
enableXWayland
isNixOS
systemdSupport
trayEnabled
;
pname = "swayfx-unwrapped";
version = "0.5";
src = fetchFromGitHub {
owner = "WillPower3309";
repo = "swayfx";
tag = "0.5";
hash = "sha256-gdab7zkjp/S7YVCP1t/OfOdUXZRwNvNSuRFGWEJScF8=";
};
patches =
[
./load-configuration-from-etc.patch
(replaceVars ./fix-paths.patch {
inherit swaybg;
})
];
strictDeps = true;
depsBuildBuild = [ pkg-config ];
nativeBuildInputs = [
meson
ninja
pkg-config
scdoc
wayland-scanner
cmake
];
buildInputs = [
cairo
gdk-pixbuf
json_c
libdrm
libevdev
libGL
libinput
librsvg
libxkbcommon
pango
pcre2
scenefx
wayland
wayland-protocols
(wlroots_0_18.override { inherit (finalAttrs) enableXWayland; })
] ++ lib.optionals finalAttrs.enableXWayland [ xcbutilwm ];
mesonFlags =
let
inherit (lib.strings) mesonEnable mesonOption;
# The "sd-bus-provider" meson option does not include a "none" option,
# but it is silently ignored iff "-Dtray=disabled". We use "basu"
# (which is not in nixpkgs) instead of "none" to alert us if this
# changes: https://github.com/swaywm/sway/issues/6843#issuecomment-1047288761
# assert trayEnabled -> systemdSupport && dbusSupport;
sd-bus-provider = if systemdSupport then "libsystemd" else "basu";
in
[
(mesonOption "sd-bus-provider" sd-bus-provider)
(mesonEnable "tray" finalAttrs.trayEnabled)
];
passthru = {
tests = {
basic = nixosTests.swayfx;
version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "sway --version";
version = "swayfx version ${finalAttrs.version}";
};
};
};
meta = {
description = "Sway, but with eye candy!";
homepage = "https://github.com/WillPower3309/swayfx";
changelog = "https://github.com/WillPower3309/swayfx/releases/tag/${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
ricarch97
];
platforms = lib.platforms.linux;
mainProgram = "sway";
longDescription = ''
Fork of Sway, an incredible and one of the most well established Wayland
compositors, and a drop-in replacement for the i3 window manager for X11.
SwayFX adds extra options and effects to the original Sway, such as rounded corners,
shadows and inactive window dimming to bring back some of the Picom X11
compositor functionality, which was commonly used with the i3 window manager.
'';
};
})
#+end_src
**** project **** project
#+begin_src shell :tangle scripts/project.sh #+begin_src shell :tangle scripts/project.sh
@ -3782,6 +3643,112 @@ AppImage version of mgba in which the lua scripting works.
#+end_src #+end_src
**** swarsel-navidrome
#+begin_src nix :tangle pkgs/swarsel-navidrome/default.nix
{
buildGo123Module,
buildPackages,
fetchFromGitHub,
fetchNpmDeps,
lib,
nodejs,
npmHooks,
pkg-config,
stdenv,
ffmpeg-headless,
taglib,
zlib,
nixosTests,
nix-update-script,
ffmpegSupport ? true,
...
}:
buildGo123Module rec {
pname = "navidrome";
version = "0.55.1";
src = fetchFromGitHub {
owner = "navidrome";
repo = "navidrome";
rev = "v${version}";
hash = "sha256-74sN2qZVjsD5i3BkJKYcpL3vZsVIg0H5RI70oRdZpi0=";
};
vendorHash = "sha256-bI0iDhATvNylKnI81eeUpgsm8YqySPyinPgBbcO0y4I=";
npmRoot = "ui";
npmDeps = fetchNpmDeps {
inherit src;
sourceRoot = "${src.name}/ui";
hash = "sha256-PaE1xcZX9wZRcKeqQCXbdhi4cIBWBL8ZQdww6AOB7sQ=";
};
nativeBuildInputs = [
buildPackages.makeWrapper
nodejs
npmHooks.npmConfigHook
pkg-config
];
overrideModAttrs = oldAttrs: {
nativeBuildInputs = lib.filter (drv: drv != npmHooks.npmConfigHook) oldAttrs.nativeBuildInputs;
preBuild = null;
};
buildInputs = [
taglib
zlib
];
ldflags = [
"-X github.com/navidrome/navidrome/consts.gitSha=${src.rev}"
"-X github.com/navidrome/navidrome/consts.gitTag=v${version}"
];
CGO_CFLAGS = lib.optionals stdenv.cc.isGNU [ "-Wno-return-local-addr" ];
postPatch = ''
patchShebangs ui/bin/update-workbox.sh
'';
preBuild = ''
make buildjs
'';
tags = [
"netgo"
];
postFixup = lib.optionalString ffmpegSupport ''
wrapProgram $out/bin/navidrome \
--prefix PATH : ${lib.makeBinPath [ ffmpeg-headless ]}
'';
passthru = {
tests.navidrome = nixosTests.navidrome;
updateScript = nix-update-script { };
};
meta = {
description = "Navidrome Music Server and Streamer compatible with Subsonic/Airsonic";
mainProgram = "navidrome";
homepage = "https://www.navidrome.org/";
license = lib.licenses.gpl3Only;
sourceProvenance = with lib.sourceTypes; [ fromSource ];
maintainers = with lib.maintainers; [
aciceri
squalus
];
# Broken on Darwin: sandbox-exec: pattern serialization length exceeds maximum (NixOS/nix#4119)
broken = stdenv.hostPlatform.isDarwin;
};
}
#+end_src
*** Overlays (additions, overrides, nixpkgs-stable) *** Overlays (additions, overrides, nixpkgs-stable)
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: h:5e3e21e0-57af-4dad-b32f-6400af9b7aab :CUSTOM_ID: h:5e3e21e0-57af-4dad-b32f-6400af9b7aab
@ -3811,7 +3778,7 @@ When adding a new entry here, do not forget to add it in the default output of t
}; };
# mgba = final.swarsel-mgba; # mgba = final.swarsel-mgba;
swayfx-unwrapped = final.swayfxoki; navidrome = final.swarsel-navidrome;
retroarch = prev.retroarch.withCores (cores: with cores; [ retroarch = prev.retroarch.withCores (cores: with cores; [
snes9x # snes snes9x # snes
@ -3851,7 +3818,6 @@ When adding a new entry here, do not forget to add it in the default output of t
// (inputs.nur.overlays.default final prev) // (inputs.nur.overlays.default final prev)
// (inputs.emacs-overlay.overlay final prev) // (inputs.emacs-overlay.overlay final prev)
// (inputs.nix-topology.overlays.default final prev) // (inputs.nix-topology.overlays.default final prev)
// (inputs.scenefx.overlays.insert final prev)
// (inputs.nixgl.overlay final prev); // (inputs.nixgl.overlay final prev);
} }
@ -6234,14 +6200,38 @@ I am using distrobox to quickly circumvent isses that I cannot immediately solve
This turns off the display when the lid is closed. This turns off the display when the lid is closed.
#+begin_src nix :tangle profiles/nixos/common/lid.nix #+begin_src nix :tangle profiles/nixos/common/lid.nix
_: _:
{ {
services.logind = { services.logind = {
lidSwitch = "suspend"; lidSwitch = "suspend";
lidSwitchDocked = "ignore"; lidSwitchDocked = "ignore";
}; };
services.acpid = { services.acpid = {
enable = true; enable = true;
handlers.lidClosed = {
event = "button/lid \\w+ close";
action = ''
cat /sys/class/backlight/amdgpu_bl1/device/enabled
if grep -Fxq disabled /sys/class/backlight/amdgpu_bl1/device/enabled
then
echo "Lid closed. Disabling fprintd."
systemctl stop fprintd
ln -s /dev/null /run/systemd/transient/fprintd.service
systemctl daemon-reload
fi
'';
};
handlers.lidOpen = {
event = "button/lid \\w+ open";
action = ''
if ! $(systemctl is-active --quiet fprintd); then
echo "Lid open. Enabling fprintd."
rm -f /run/systemd/transient/fprintd.service
systemctl daemon-reload
systemctl start fprintd
fi
'';
};
lidEventCommands = lidEventCommands =
'' ''
export PATH=$PATH:/run/current-system/sw/bin export PATH=$PATH:/run/current-system/sw/bin
@ -6259,7 +6249,7 @@ This turns off the display when the lid is closed.
fi fi
''; '';
}; };
} }
#+end_src #+end_src
**** Low battery notification **** Low battery notification
@ -6715,9 +6705,10 @@ Here we just define some aliases for rebuilding the system, and we allow some in
MPVCommandTemplate = "mpv --audio-device=%d --no-audio-display --pause %f"; MPVCommandTemplate = "mpv --audio-device=%d --no-audio-display --pause %f";
Jukebox = { Jukebox = {
Enabled = true; Enabled = true;
Default = "pch"; Default = "default";
Devices = [ Devices = [
[ "pch" "alsa/sysdefault:CARD=PCH" ] # use mpv --audio-device=help to get these
[ "default" "alsa/sysdefault:CARD=PCH" ]
]; ];
}; };
# Switch using --impure as these credential files are not stored within the flake # Switch using --impure as these credential files are not stored within the flake
@ -8680,8 +8671,9 @@ This holds packages that I can use as provided, or with small modifications (as
# wayland stuff # wayland stuff
wtype wtype
wl-clipboard wl-clipboard
wl-mirror stable.wl-mirror
wf-recorder wf-recorder
kanshi
# screenshotting tools # screenshotting tools
grim grim
@ -8819,7 +8811,6 @@ It is very convenient to have SSH aliases in place for machines that I use. This
ServerAliveInterval 20 ServerAliveInterval 20
''; '';
matchBlocks = { matchBlocks = {
# Local machines
"pfsense" = { "pfsense" = {
hostname = "192.168.1.1"; hostname = "192.168.1.1";
user = "root"; user = "root";
@ -8834,7 +8825,7 @@ It is very convenient to have SSH aliases in place for machines that I use. This
}; };
"sync" = { "sync" = {
hostname = "193.122.53.173"; hostname = "193.122.53.173";
user = "root"; #this is a oracle vm server but needs root due to nixos-infect user = "root";
}; };
"songdiver" = { "songdiver" = {
hostname = "89.168.100.65"; hostname = "89.168.100.65";
@ -8844,10 +8835,6 @@ It is very convenient to have SSH aliases in place for machines that I use. This
hostname = "46.232.248.161"; hostname = "46.232.248.161";
user = "root"; user = "root";
}; };
"efficient" = {
hostname = "g0.complang.tuwien.ac.at";
user = "ep01427399";
};
}; };
}; };
} }
@ -8873,6 +8860,7 @@ This section has been notably empty ever since switching to stylix. Only Emacs i
targets = { targets = {
emacs.enable = false; emacs.enable = false;
waybar.enable = false; waybar.enable = false;
sway.useWallpaper = false;
}; };
} }
config.swarselsystems.stylix); config.swarselsystems.stylix);
@ -10574,7 +10562,7 @@ I am currently using SwayFX, which adds some nice effects to sway, like rounded
Currently, I am too lazy to explain every option here, but most of it is very self-explaining in any case. Currently, I am too lazy to explain every option here, but most of it is very self-explaining in any case.
#+begin_src nix :tangle profiles/home/common/sway.nix #+begin_src nix :tangle profiles/home/common/sway.nix
{ config, lib, ... }: { self, config, lib, ... }:
let let
inherit (config.swarselsystems) monitors; inherit (config.swarselsystems) monitors;
workplaceSets = lib.mapAttrs' lib.swarselsystems.eachOutput monitors; workplaceSets = lib.mapAttrs' lib.swarselsystems.eachOutput monitors;
@ -10679,6 +10667,7 @@ Currently, I am too lazy to explain every option here, but most of it is very se
"${modifier}+Ctrl+Shift+r" = "exec swarsel-displaypower"; "${modifier}+Ctrl+Shift+r" = "exec swarsel-displaypower";
"${modifier}+Shift+e" = "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'"; "${modifier}+Shift+e" = "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'";
"${modifier}+r" = "mode resize"; "${modifier}+r" = "mode resize";
# "${modifier}+Return" = "exec kitty";
"${modifier}+Return" = "exec swarselzellij"; "${modifier}+Return" = "exec swarselzellij";
"${modifier}+Print" = "exec screenshare"; "${modifier}+Print" = "exec screenshare";
# "XF86AudioRaiseVolume" = "exec pa 5%"; # "XF86AudioRaiseVolume" = "exec pa 5%";
@ -10704,7 +10693,15 @@ Currently, I am too lazy to explain every option here, but most of it is very se
}; };
}; };
defaultWorkspace = "workspace 1:一"; defaultWorkspace = "workspace 1:一";
output = lib.mapAttrs' lib.swarselsystems.eachMonitor monitors; # output = lib.mapAttrs' lib.swarselsystems.eachMonitor monitors;
output = {
"${config.swarselsystems.sharescreen}" = {
bg = "${self}/wallpaper/lenovowp.png ${config.stylix.imageScalingMode}";
};
"Philips Consumer Electronics Company PHL BDM3270 AU11806002320" = {
bg = "${self}/wallpaper/standwp.png ${config.stylix.imageScalingMode}";
};
};
input = config.swarselsystems.standardinputs; input = config.swarselsystems.standardinputs;
workspaceOutputAssign = workplaceOutputs; workspaceOutputAssign = workplaceOutputs;
startup = config.swarselsystems.startup ++ [ startup = config.swarselsystems.startup ++ [
@ -10737,6 +10734,8 @@ Currently, I am too lazy to explain every option here, but most of it is very se
{ title = "^Add$"; } { title = "^Add$"; }
{ title = "^Picture-in-Picture$"; } { title = "^Picture-in-Picture$"; }
{ title = "Syncthing Tray"; } { title = "Syncthing Tray"; }
{ title = "^spotifytui$"; }
{ title = "^kittyterm$"; }
{ app_id = "vesktop"; } { app_id = "vesktop"; }
{ window_role = "pop-up"; } { window_role = "pop-up"; }
{ window_role = "bubble"; } { window_role = "bubble"; }
@ -10866,12 +10865,97 @@ Currently, I am too lazy to explain every option here, but most of it is very se
seat * hide_cursor 2000 seat * hide_cursor 2000
exec kanshi
exec_always kill -1 $(pidof kanshi)
bindswitch --locked lid:on exec kanshictl switch lidclosed
bindswitch --locked lid:off exec kanshictl switch lidopen
${swayfxSettings} ${swayfxSettings}
"; ";
}; };
} }
#+end_src #+end_src
**** Kanshi
#+begin_src nix :tangle profiles/home/common/kanshi.nix
{ config, ... }:
{
services.kanshi = {
enable = true;
settings = [
{
# laptop screen
output = {
criteria = config.swarselsystems.sharescreen;
mode = config.swarselsystems.highResolution;
scale = 1.0;
};
}
{
# home main screen
output = {
criteria = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
scale = 1.0;
mode = "2560x1440";
};
}
{
profile = {
name = "lidopen";
outputs = [
{
criteria = "eDP-2";
status = "enable";
scale = 1.0;
}
];
};
}
{
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 = {
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";
}
];
};
}
];
};
}
#+end_src
**** gpg-agent **** gpg-agent
:PROPERTIES: :PROPERTIES:
:CUSTOM_ID: h:7d384e3b-1be7-4644-b304-ada4af0b692b :CUSTOM_ID: h:7d384e3b-1be7-4644-b304-ada4af0b692b
@ -11066,7 +11150,7 @@ The rest of the settings is at [[#h:fb3f3e01-7df4-4b06-9e91-aa9cac61a431][gaming
The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]]. Here, I am setting up the different firefox profiles that I need for the SSO sites that I need to access at work as well as a few ssh shorthands. The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]]. Here, I am setting up the different firefox profiles that I need for the SSO sites that I need to access at work as well as a few ssh shorthands.
#+begin_src nix :tangle profiles/home/optional/work.nix :noweb yes #+begin_src nix :tangle profiles/home/optional/work.nix :noweb yes
{ config, pkgs, lib, ... }: { self, config, pkgs, lib, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
stable.teams-for-linux stable.teams-for-linux
@ -11086,6 +11170,21 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]]
DOCUMENT_DIR_PRIV = lib.mkForce "${config.home.homeDirectory}/Documents/Private"; DOCUMENT_DIR_PRIV = lib.mkForce "${config.home.homeDirectory}/Documents/Private";
DOCUMENT_DIR_WORK = lib.mkForce "${config.home.homeDirectory}/Documents/Work"; DOCUMENT_DIR_WORK = lib.mkForce "${config.home.homeDirectory}/Documents/Work";
}; };
wayland.windowManager.sway.config = {
output = {
"Applied Creative Technology Transmitter QUATTRO201811" = {
bg = "${self}/wallpaper/navidrome.png ${config.stylix.imageScalingMode}";
};
"Hewlett Packard HP Z24i CN44250RDT" = {
bg = "${self}/wallpaper/op6wp.png ${config.stylix.imageScalingMode}";
};
"HP Inc. HP 732pk CNC4080YL5" = {
bg = "${self}/wallpaper/botanicswp.png ${config.stylix.imageScalingMode}";
};
};
};
programs = { programs = {
git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at"; git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at";
@ -11184,6 +11283,124 @@ The rest of the settings is at [[#h:bbf2ecb6-c8ff-4462-b5d5-d45b28604ddf][work]]
}; };
}; };
services = {
kanshi = {
settings = [
{
# seminary room
output = {
criteria = "Applied Creative Technology Transmitter QUATTRO201811";
scale = 1.0;
mode = "1280x720";
};
}
{
# work main screen
output = {
criteria = "HP Inc. HP 732pk CNC4080YL5";
scale = 1.0;
mode = "3840x2160";
};
}
{
# work side screen
output = {
criteria = "Hewlett Packard HP Z24i CN44250RDT";
scale = 1.0;
mode = "1920x1200";
transform = "270";
};
}
{
profile = {
name = "lidopen";
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "enable";
scale = 1.5;
position = "1462,0";
}
{
criteria = "HP Inc. HP 732pk CNC4080YL5";
scale = 1.4;
mode = "3840x2160";
position = "-1280,0";
}
{
criteria = "Hewlett Packard HP Z24i CN44250RDT";
scale = 1.0;
mode = "1920x1200";
transform = "90";
position = "-2480,0";
}
];
};
}
{
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 = {
name = "lidclosed";
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "disable";
}
{
criteria = "HP Inc. HP 732pk CNC4080YL5";
scale = 1.4;
mode = "3840x2160";
position = "-1280,0";
}
{
criteria = "Hewlett Packard HP Z24i CN44250RDT";
scale = 1.0;
mode = "1920x1200";
transform = "270";
position = "-2480,0";
}
];
};
}
{
profile = {
name = "lidclosed";
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "disable";
}
{
criteria = "Applied Creative Technology Transmitter QUATTRO201811";
scale = 1.0;
mode = "1280x720";
position = "10000,10000";
}
];
};
}
];
};
};
xdg = { xdg = {
mimeApps = { mimeApps = {
defaultApplications = { defaultApplications = {

View file

@ -3,7 +3,6 @@
pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run {
src = "${self}"; src = "${self}";
hooks = { hooks = {
check-added-large-files.enable = true;
check-case-conflicts.enable = true; check-case-conflicts.enable = true;
check-executables-have-shebangs.enable = true; check-executables-have-shebangs.enable = true;
check-shebang-scripts-are-executable.enable = false; check-shebang-scripts-are-executable.enable = false;

27
flake.lock generated
View file

@ -446,11 +446,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1741730296, "lastModified": 1741868525,
"narHash": "sha256-WR983BGc2wSc8ks8C2Tq/eevkRJ9oiYnBQ6ykgoXtms=", "narHash": "sha256-jikLF3o6cmIwTq3BNE1KZADzL/OprjACoVkrJEKf8hQ=",
"owner": "TamtamHero", "owner": "TamtamHero",
"repo": "fw-fanctrl", "repo": "fw-fanctrl",
"rev": "c80945681dabb6bc57bc3e113e850294582d6d38", "rev": "f97a5e9447c6def10f097d8dbd449ebb4e3ed253",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1378,7 +1378,6 @@
"nswitch-rcm-nix": "nswitch-rcm-nix", "nswitch-rcm-nix": "nswitch-rcm-nix",
"nur": "nur", "nur": "nur",
"pre-commit-hooks": "pre-commit-hooks_2", "pre-commit-hooks": "pre-commit-hooks_2",
"scenefx": "scenefx",
"sops-nix": "sops-nix", "sops-nix": "sops-nix",
"stylix": "stylix", "stylix": "stylix",
"systems": "systems_3", "systems": "systems_3",
@ -1427,26 +1426,6 @@
"type": "github" "type": "github"
} }
}, },
"scenefx": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1740440098,
"narHash": "sha256-kcK57JKbQ+tr0W10ipe2yGvWa9nJD+mLCMo3w2sp8AQ=",
"owner": "wlrfx",
"repo": "scenefx",
"rev": "1775286a04a3c60d6b15221693586ac8174a0b88",
"type": "github"
},
"original": {
"owner": "wlrfx",
"repo": "scenefx",
"type": "github"
}
},
"scss-reset": { "scss-reset": {
"flake": false, "flake": false,
"locked": { "locked": {

View file

@ -76,10 +76,6 @@
inputs = { }; inputs = { };
}; };
nix-topology.url = "github:oddlama/nix-topology"; nix-topology.url = "github:oddlama/nix-topology";
scenefx = {
url = "github:wlrfx/scenefx";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = outputs =
inputs@{ self inputs@{ self

View file

@ -45,6 +45,8 @@ in
}; };
hardware = { hardware = {
enableAllFirmware = true;
cpu.amd.updateMicrocode = true;
amdgpu = { amdgpu = {
opencl.enable = true; opencl.enable = true;
amdvlk = { amdvlk = {
@ -56,23 +58,23 @@ in
programs.fw-fanctrl = { programs.fw-fanctrl = {
enable = true; enable = true;
config = { # config = {
defaultStrategy = "lazy"; # defaultStrategy = "lazy";
strategies = { # strategies = {
"lazy" = { # "lazy" = {
fanSpeedUpdateFrequency = 5; # fanSpeedUpdateFrequency = 5;
movingAverageInterval = 30; # movingAverageInterval = 30;
speedCurve = [ # speedCurve = [
{ temp = 0; speed = 15; } # { temp = 0; speed = 15; }
{ temp = 50; speed = 15; } # { temp = 50; speed = 15; }
{ temp = 65; speed = 25; } # { temp = 65; speed = 25; }
{ temp = 70; speed = 35; } # { temp = 70; speed = 35; }
{ temp = 75; speed = 50; } # { temp = 75; speed = 50; }
{ temp = 85; speed = 100; } # { temp = 85; speed = 100; }
]; # ];
}; # };
}; # };
}; # };
}; };
networking = { networking = {
@ -85,7 +87,14 @@ in
services = { services = {
fwupd.enable = true; fwupd.enable = true;
udev.extraRules = '' udev.extraRules = ''
# Make Framework 16 Ethernet Module work reliably
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20" ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="0bda", ATTR{idProduct}=="8156", ATTR{power/autosuspend}="20"
# disable Wakup on Framework Laptop 16 Keyboard
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0018", ATTR{power/wakeup}="disabled"
# disable Wakup on Framework Laptop 16 Numpad Module
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0014", ATTR{power/wakeup}="disabled"
''; '';
}; };
@ -106,14 +115,11 @@ in
isNixos = true; isNixos = true;
flakePath = "/home/swarsel/.dotfiles"; flakePath = "/home/swarsel/.dotfiles";
cpuCount = 16; cpuCount = 16;
# temperatureHwmon = { temperatureHwmon = {
# isAbsolutePath = true; isAbsolutePath = true;
# path = "/sys/devices/platform/thinkpad_hwmon/hwmon/"; path = "/sys/devices/virtual/thermal/thermal_zone0/";
# input-filename = "temp1_input"; input-filename = "temp4_input";
# }; };
# ------ -----
# | DP-4 | |eDP-1|
# ------ -----
startup = [ startup = [
{ command = "nextcloud --background"; } { command = "nextcloud --background"; }
{ command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; } { command = "vesktop --start-minimized --enable-speech-dispatcher --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime"; }
@ -191,7 +197,7 @@ in
mode = "1280x720"; mode = "1280x720";
scale = "1"; scale = "1";
position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse position = "10000,10000"; # i.e. this screen is inaccessible by moving the mouse
workspace = "12:S"; workspace = "14:T";
output = "DP-4"; output = "DP-4";
}; };
}; };

View file

@ -1,14 +1,33 @@
{ config, lib, modulesPath, ... }: { config, pkgs, lib, modulesPath, ... }:
{ {
imports = imports =
[ [
(modulesPath + "/installer/scan/not-detected.nix") (modulesPath + "/installer/scan/not-detected.nix")
]; ];
# Fix Wlan after suspend or Hibernate
environment.etc."systemd/system-sleep/fix-wifi.sh".source =
pkgs.writeShellScript "fix-wifi.sh" ''
case $1/$2 in
pre/*)
${pkgs.kmod}/bin/modprobe -r mt7921e mt792x_lib mt76
echo 1 > /sys/bus/pci/devices/0000:04:00.0/remove
;;
post/*)
${pkgs.kmod}/bin/modprobe mt7921e
echo 1 > /sys/bus/pci/rescan
;;
esac
'';
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "cryptd" "usbhid" "sd_mod" "r8152" ]; boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "cryptd" "usbhid" "sd_mod" "r8152" ];
boot.initrd.kernelModules = [ ]; boot.initrd.kernelModules = [ "sg" ];
boot.kernelModules = [ "kvm-amd" ]; boot.kernelModules = [ "kvm-amd" ];
boot.kernelParams = [
"mem_sleep_default=deep"
"amd_pstate=passive"
# Fix screen flickering issue at the cost of battery life (disable PSR and PSR-SU, keep PR enabled) # Fix screen flickering issue at the cost of battery life (disable PSR and PSR-SU, keep PR enabled)
# TODO: figure out if this is worth it # TODO: figure out if this is worth it
# test PSR/PR state with 'sudo grep '' /sys/kernel/debug/dri/0000*/eDP-2/*_capability' # test PSR/PR state with 'sudo grep '' /sys/kernel/debug/dri/0000*/eDP-2/*_capability'
@ -16,7 +35,8 @@
# https://old.reddit.com/r/framework/comments/1goh7hc/anyone_else_get_this_screen_flickering_issue/ # https://old.reddit.com/r/framework/comments/1goh7hc/anyone_else_get_this_screen_flickering_issue/
# https://www.reddit.com/r/NixOS/comments/1hjruq1/graphics_corruption_on_kernel_6125_and_up/ # https://www.reddit.com/r/NixOS/comments/1hjruq1/graphics_corruption_on_kernel_6125_and_up/
# https://gitlab.freedesktop.org/drm/amd/-/issues/3797 # https://gitlab.freedesktop.org/drm/amd/-/issues/3797
boot.kernelParams = [ "amdgpu.dcdebugmask=0x410" ]; "amdgpu.dcdebugmask=0x410"
];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.initrd.luks.devices."cryptroot" = { boot.initrd.luks.devices."cryptroot" = {

View file

@ -17,7 +17,7 @@ let
}; };
# mgba = final.swarsel-mgba; # mgba = final.swarsel-mgba;
swayfx-unwrapped = final.swayfxoki; navidrome = final.swarsel-navidrome;
retroarch = prev.retroarch.withCores (cores: with cores; [ retroarch = prev.retroarch.withCores (cores: with cores; [
snes9x # snes snes9x # snes
@ -57,7 +57,6 @@ in
// (inputs.nur.overlays.default final prev) // (inputs.nur.overlays.default final prev)
// (inputs.emacs-overlay.overlay final prev) // (inputs.emacs-overlay.overlay final prev)
// (inputs.nix-topology.overlays.default final prev) // (inputs.nix-topology.overlays.default final prev)
// (inputs.scenefx.overlays.insert final prev)
// (inputs.nixgl.overlay final prev); // (inputs.nixgl.overlay final prev);
} }

View file

@ -0,0 +1,99 @@
{ buildGo123Module
, buildPackages
, fetchFromGitHub
, fetchNpmDeps
, lib
, nodejs
, npmHooks
, pkg-config
, stdenv
, ffmpeg-headless
, taglib
, zlib
, nixosTests
, nix-update-script
, ffmpegSupport ? true
, ...
}:
buildGo123Module rec {
pname = "navidrome";
version = "0.55.1";
src = fetchFromGitHub {
owner = "navidrome";
repo = "navidrome";
rev = "v${version}";
hash = "sha256-74sN2qZVjsD5i3BkJKYcpL3vZsVIg0H5RI70oRdZpi0=";
};
vendorHash = "sha256-bI0iDhATvNylKnI81eeUpgsm8YqySPyinPgBbcO0y4I=";
npmRoot = "ui";
npmDeps = fetchNpmDeps {
inherit src;
sourceRoot = "${src.name}/ui";
hash = "sha256-PaE1xcZX9wZRcKeqQCXbdhi4cIBWBL8ZQdww6AOB7sQ=";
};
nativeBuildInputs = [
buildPackages.makeWrapper
nodejs
npmHooks.npmConfigHook
pkg-config
];
overrideModAttrs = oldAttrs: {
nativeBuildInputs = lib.filter (drv: drv != npmHooks.npmConfigHook) oldAttrs.nativeBuildInputs;
preBuild = null;
};
buildInputs = [
taglib
zlib
];
ldflags = [
"-X github.com/navidrome/navidrome/consts.gitSha=${src.rev}"
"-X github.com/navidrome/navidrome/consts.gitTag=v${version}"
];
CGO_CFLAGS = lib.optionals stdenv.cc.isGNU [ "-Wno-return-local-addr" ];
postPatch = ''
patchShebangs ui/bin/update-workbox.sh
'';
preBuild = ''
make buildjs
'';
tags = [
"netgo"
];
postFixup = lib.optionalString ffmpegSupport ''
wrapProgram $out/bin/navidrome \
--prefix PATH : ${lib.makeBinPath [ ffmpeg-headless ]}
'';
passthru = {
tests.navidrome = nixosTests.navidrome;
updateScript = nix-update-script { };
};
meta = {
description = "Navidrome Music Server and Streamer compatible with Subsonic/Airsonic";
mainProgram = "navidrome";
homepage = "https://www.navidrome.org/";
license = lib.licenses.gpl3Only;
sourceProvenance = with lib.sourceTypes; [ fromSource ];
maintainers = with lib.maintainers; [
aciceri
squalus
];
# Broken on Darwin: sandbox-exec: pattern serialization length exceeds maximum (NixOS/nix#4119)
broken = stdenv.hostPlatform.isDarwin;
};
}

View file

@ -1,143 +0,0 @@
{ lib
, fetchFromGitHub
, stdenv
, systemd
, meson
, replaceVars
, swaybg
, ninja
, pkg-config
, gdk-pixbuf
, librsvg
, wayland-protocols
, libdrm
, libinput
, cairo
, pango
, wayland
, libGL
, libxkbcommon
, pcre2
, cmake
, json_c
, libevdev
, scdoc
, scenefx
, wayland-scanner
, xcbutilwm
, wlroots_0_18
, testers
, nixosTests
, # Used by the NixOS module:
isNixOS ? false
, enableXWayland ? true
, systemdSupport ? lib.meta.availableOn stdenv.hostPlatform systemd
, trayEnabled ? systemdSupport
, ...
}:
stdenv.mkDerivation (finalAttrs: {
inherit
enableXWayland
isNixOS
systemdSupport
trayEnabled
;
pname = "swayfx-unwrapped";
version = "0.5";
src = fetchFromGitHub {
owner = "WillPower3309";
repo = "swayfx";
tag = "0.5";
hash = "sha256-gdab7zkjp/S7YVCP1t/OfOdUXZRwNvNSuRFGWEJScF8=";
};
patches =
[
./load-configuration-from-etc.patch
(replaceVars ./fix-paths.patch {
inherit swaybg;
})
];
strictDeps = true;
depsBuildBuild = [ pkg-config ];
nativeBuildInputs = [
meson
ninja
pkg-config
scdoc
wayland-scanner
cmake
];
buildInputs = [
cairo
gdk-pixbuf
json_c
libdrm
libevdev
libGL
libinput
librsvg
libxkbcommon
pango
pcre2
scenefx
wayland
wayland-protocols
(wlroots_0_18.override { inherit (finalAttrs) enableXWayland; })
] ++ lib.optionals finalAttrs.enableXWayland [ xcbutilwm ];
mesonFlags =
let
inherit (lib.strings) mesonEnable mesonOption;
# The "sd-bus-provider" meson option does not include a "none" option,
# but it is silently ignored iff "-Dtray=disabled". We use "basu"
# (which is not in nixpkgs) instead of "none" to alert us if this
# changes: https://github.com/swaywm/sway/issues/6843#issuecomment-1047288761
# assert trayEnabled -> systemdSupport && dbusSupport;
sd-bus-provider = if systemdSupport then "libsystemd" else "basu";
in
[
(mesonOption "sd-bus-provider" sd-bus-provider)
(mesonEnable "tray" finalAttrs.trayEnabled)
];
passthru = {
tests = {
basic = nixosTests.swayfx;
version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "sway --version";
version = "swayfx version ${finalAttrs.version}";
};
};
};
meta = {
description = "Sway, but with eye candy!";
homepage = "https://github.com/WillPower3309/swayfx";
changelog = "https://github.com/WillPower3309/swayfx/releases/tag/${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
ricarch97
];
platforms = lib.platforms.linux;
mainProgram = "sway";
longDescription = ''
Fork of Sway, an incredible and one of the most well established Wayland
compositors, and a drop-in replacement for the i3 window manager for X11.
SwayFX adds extra options and effects to the original Sway, such as rounded corners,
shadows and inactive window dimming to bring back some of the Picom X11
compositor functionality, which was commonly used with the i3 window manager.
'';
};
})

View file

@ -1,11 +0,0 @@
--- a/sway/config.c
+++ b/sway/config.c
@@ -276,7 +276,7 @@
if (!(config->active_bar_modifiers = create_list())) goto cleanup;
- if (!(config->swaybg_command = strdup("swaybg"))) goto cleanup;
+ if (!(config->swaybg_command = strdup("@swaybg@/bin/swaybg"))) goto cleanup;
if (!(config->config_chain = create_list())) goto cleanup;
config->current_config_path = NULL;

View file

@ -1,48 +0,0 @@
From 92283df3acbffa5c1bb21f23cdd686113d905114 Mon Sep 17 00:00:00 2001
From: Patrick Hilhorst <git@hilhorst.be>
Date: Wed, 31 Mar 2021 21:14:13 +0200
Subject: [PATCH] Load configs from /etc but fallback to /nix/store
This change will load all configuration files from /etc, to make it easy
to override them, but fallback to /nix/store/.../etc/sway/config to make
Sway work out-of-the-box with the default configuration on non NixOS
systems.
Original patch by Michael Weiss, updated for Sway 1.6 by Patrick Hilhorst
Co-authored-by: Michael Weiss <dev.primeos@gmail.com>
---
meson.build | 3 ++-
sway/config.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index b7a29660..8ae8ceb3 100644
--- a/meson.build
+++ b/meson.build
@@ -164,7 +164,8 @@ if scdoc.found()
endforeach
endif
-add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
+add_project_arguments('-DSYSCONFDIR="/@0@"'.format(sysconfdir), language : 'c')
+add_project_arguments('-DNIX_SYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c')
version = '"@0@"'.format(meson.project_version())
git = find_program('git', native: true, required: false)
diff --git a/sway/config.c b/sway/config.c
index 76b9ec08..fb5b51aa 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -374,7 +374,8 @@ static char *get_config_path(void) {
{ .prefix = home, .config_folder = ".i3"},
{ .prefix = config_home, .config_folder = "i3"},
{ .prefix = SYSCONFDIR, .config_folder = "sway"},
- { .prefix = SYSCONFDIR, .config_folder = "i3"}
+ { .prefix = SYSCONFDIR, .config_folder = "i3"},
+ { .prefix = NIX_SYSCONFDIR, .config_folder = "sway"},
};
size_t num_config_paths = sizeof(config_paths)/sizeof(config_paths[0]);
--
2.30.1

View file

@ -0,0 +1,73 @@
{ config, ... }:
{
services.kanshi = {
enable = true;
settings = [
{
# laptop screen
output = {
criteria = config.swarselsystems.sharescreen;
mode = config.swarselsystems.highResolution;
scale = 1.0;
};
}
{
# home main screen
output = {
criteria = "Philips Consumer Electronics Company PHL BDM3270 AU11806002320";
scale = 1.0;
mode = "2560x1440";
};
}
{
profile = {
name = "lidopen";
outputs = [
{
criteria = "eDP-2";
status = "enable";
scale = 1.0;
}
];
};
}
{
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 = {
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";
}
];
};
}
];
};
}

View file

@ -131,8 +131,9 @@
# wayland stuff # wayland stuff
wtype wtype
wl-clipboard wl-clipboard
wl-mirror stable.wl-mirror
wf-recorder wf-recorder
kanshi
# screenshotting tools # screenshotting tools
grim grim

View file

@ -8,7 +8,6 @@ _:
ServerAliveInterval 20 ServerAliveInterval 20
''; '';
matchBlocks = { matchBlocks = {
# Local machines
"pfsense" = { "pfsense" = {
hostname = "192.168.1.1"; hostname = "192.168.1.1";
user = "root"; user = "root";
@ -23,7 +22,7 @@ _:
}; };
"sync" = { "sync" = {
hostname = "193.122.53.173"; hostname = "193.122.53.173";
user = "root"; #this is a oracle vm server but needs root due to nixos-infect user = "root";
}; };
"songdiver" = { "songdiver" = {
hostname = "89.168.100.65"; hostname = "89.168.100.65";
@ -33,10 +32,6 @@ _:
hostname = "46.232.248.161"; hostname = "46.232.248.161";
user = "root"; user = "root";
}; };
"efficient" = {
hostname = "g0.complang.tuwien.ac.at";
user = "ep01427399";
};
}; };
}; };
} }

View file

@ -6,6 +6,7 @@
targets = { targets = {
emacs.enable = false; emacs.enable = false;
waybar.enable = false; waybar.enable = false;
sway.useWallpaper = false;
}; };
} }
config.swarselsystems.stylix); config.swarselsystems.stylix);

View file

@ -1,4 +1,4 @@
{ config, lib, ... }: { self, config, lib, ... }:
let let
inherit (config.swarselsystems) monitors; inherit (config.swarselsystems) monitors;
workplaceSets = lib.mapAttrs' lib.swarselsystems.eachOutput monitors; workplaceSets = lib.mapAttrs' lib.swarselsystems.eachOutput monitors;
@ -103,6 +103,7 @@ in
"${modifier}+Ctrl+Shift+r" = "exec swarsel-displaypower"; "${modifier}+Ctrl+Shift+r" = "exec swarsel-displaypower";
"${modifier}+Shift+e" = "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'"; "${modifier}+Shift+e" = "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'";
"${modifier}+r" = "mode resize"; "${modifier}+r" = "mode resize";
# "${modifier}+Return" = "exec kitty";
"${modifier}+Return" = "exec swarselzellij"; "${modifier}+Return" = "exec swarselzellij";
"${modifier}+Print" = "exec screenshare"; "${modifier}+Print" = "exec screenshare";
# "XF86AudioRaiseVolume" = "exec pa 5%"; # "XF86AudioRaiseVolume" = "exec pa 5%";
@ -128,7 +129,15 @@ in
}; };
}; };
defaultWorkspace = "workspace 1:"; defaultWorkspace = "workspace 1:";
output = lib.mapAttrs' lib.swarselsystems.eachMonitor monitors; # output = lib.mapAttrs' lib.swarselsystems.eachMonitor monitors;
output = {
"${config.swarselsystems.sharescreen}" = {
bg = "${self}/wallpaper/lenovowp.png ${config.stylix.imageScalingMode}";
};
"Philips Consumer Electronics Company PHL BDM3270 AU11806002320" = {
bg = "${self}/wallpaper/standwp.png ${config.stylix.imageScalingMode}";
};
};
input = config.swarselsystems.standardinputs; input = config.swarselsystems.standardinputs;
workspaceOutputAssign = workplaceOutputs; workspaceOutputAssign = workplaceOutputs;
startup = config.swarselsystems.startup ++ [ startup = config.swarselsystems.startup ++ [
@ -161,6 +170,8 @@ in
{ title = "^Add$"; } { title = "^Add$"; }
{ title = "^Picture-in-Picture$"; } { title = "^Picture-in-Picture$"; }
{ title = "Syncthing Tray"; } { title = "Syncthing Tray"; }
{ title = "^spotifytui$"; }
{ title = "^kittyterm$"; }
{ app_id = "vesktop"; } { app_id = "vesktop"; }
{ window_role = "pop-up"; } { window_role = "pop-up"; }
{ window_role = "bubble"; } { window_role = "bubble"; }
@ -290,6 +301,12 @@ in
seat * hide_cursor 2000 seat * hide_cursor 2000
exec kanshi
exec_always kill -1 $(pidof kanshi)
bindswitch --locked lid:on exec kanshictl switch lidclosed
bindswitch --locked lid:off exec kanshictl switch lidopen
${swayfxSettings} ${swayfxSettings}
"; ";
}; };

View file

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { self, config, pkgs, lib, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
stable.teams-for-linux stable.teams-for-linux
@ -18,6 +18,21 @@
DOCUMENT_DIR_PRIV = lib.mkForce "${config.home.homeDirectory}/Documents/Private"; DOCUMENT_DIR_PRIV = lib.mkForce "${config.home.homeDirectory}/Documents/Private";
DOCUMENT_DIR_WORK = lib.mkForce "${config.home.homeDirectory}/Documents/Work"; DOCUMENT_DIR_WORK = lib.mkForce "${config.home.homeDirectory}/Documents/Work";
}; };
wayland.windowManager.sway.config = {
output = {
"Applied Creative Technology Transmitter QUATTRO201811" = {
bg = "${self}/wallpaper/navidrome.png ${config.stylix.imageScalingMode}";
};
"Hewlett Packard HP Z24i CN44250RDT" = {
bg = "${self}/wallpaper/op6wp.png ${config.stylix.imageScalingMode}";
};
"HP Inc. HP 732pk CNC4080YL5" = {
bg = "${self}/wallpaper/botanicswp.png ${config.stylix.imageScalingMode}";
};
};
};
programs = { programs = {
git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at"; git.userEmail = "leon.schwarzaeugl@imba.oeaw.ac.at";
@ -116,6 +131,124 @@
}; };
}; };
services = {
kanshi = {
settings = [
{
# seminary room
output = {
criteria = "Applied Creative Technology Transmitter QUATTRO201811";
scale = 1.0;
mode = "1280x720";
};
}
{
# work main screen
output = {
criteria = "HP Inc. HP 732pk CNC4080YL5";
scale = 1.0;
mode = "3840x2160";
};
}
{
# work side screen
output = {
criteria = "Hewlett Packard HP Z24i CN44250RDT";
scale = 1.0;
mode = "1920x1200";
transform = "270";
};
}
{
profile = {
name = "lidopen";
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "enable";
scale = 1.5;
position = "1462,0";
}
{
criteria = "HP Inc. HP 732pk CNC4080YL5";
scale = 1.4;
mode = "3840x2160";
position = "-1280,0";
}
{
criteria = "Hewlett Packard HP Z24i CN44250RDT";
scale = 1.0;
mode = "1920x1200";
transform = "90";
position = "-2480,0";
}
];
};
}
{
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 = {
name = "lidclosed";
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "disable";
}
{
criteria = "HP Inc. HP 732pk CNC4080YL5";
scale = 1.4;
mode = "3840x2160";
position = "-1280,0";
}
{
criteria = "Hewlett Packard HP Z24i CN44250RDT";
scale = 1.0;
mode = "1920x1200";
transform = "270";
position = "-2480,0";
}
];
};
}
{
profile = {
name = "lidclosed";
outputs = [
{
criteria = config.swarselsystems.sharescreen;
status = "disable";
}
{
criteria = "Applied Creative Technology Transmitter QUATTRO201811";
scale = 1.0;
mode = "1280x720";
position = "10000,10000";
}
];
};
}
];
};
};
xdg = { xdg = {
mimeApps = { mimeApps = {
defaultApplications = { defaultApplications = {

View file

@ -6,6 +6,30 @@ _:
}; };
services.acpid = { services.acpid = {
enable = true; enable = true;
handlers.lidClosed = {
event = "button/lid \\w+ close";
action = ''
cat /sys/class/backlight/amdgpu_bl1/device/enabled
if grep -Fxq disabled /sys/class/backlight/amdgpu_bl1/device/enabled
then
echo "Lid closed. Disabling fprintd."
systemctl stop fprintd
ln -s /dev/null /run/systemd/transient/fprintd.service
systemctl daemon-reload
fi
'';
};
handlers.lidOpen = {
event = "button/lid \\w+ open";
action = ''
if ! $(systemctl is-active --quiet fprintd); then
echo "Lid open. Enabling fprintd."
rm -f /run/systemd/transient/fprintd.service
systemctl daemon-reload
systemctl start fprintd
fi
'';
};
lidEventCommands = lidEventCommands =
'' ''
export PATH=$PATH:/run/current-system/sw/bin export PATH=$PATH:/run/current-system/sw/bin

View file

@ -51,9 +51,10 @@ in
MPVCommandTemplate = "mpv --audio-device=%d --no-audio-display --pause %f"; MPVCommandTemplate = "mpv --audio-device=%d --no-audio-display --pause %f";
Jukebox = { Jukebox = {
Enabled = true; Enabled = true;
Default = "pch"; Default = "default";
Devices = [ Devices = [
[ "pch" "alsa/sysdefault:CARD=PCH" ] # use mpv --audio-device=help to get these
[ "default" "alsa/sysdefault:CARD=PCH" ]
]; ];
}; };
# Switch using --impure as these credential files are not stored within the flake # Switch using --impure as these credential files are not stored within the flake

View file

@ -5,8 +5,6 @@
default_shell "zsh" default_shell "zsh"
copy_on_select true copy_on_select true
on_force_close "detach" on_force_close "detach"
session_name "main"
attach_to_session true
default_layout "default" default_layout "default"
layout_dir "${config.home.homeDirectory}/.config/zellij/layouts" layout_dir "${config.home.homeDirectory}/.config/zellij/layouts"

View file

@ -1,17 +1,6 @@
SHARESCREEN="$(nix eval --raw ~/.dotfiles#nixosConfigurations."$(hostname)".config.home-manager.users."$(whoami)".swarselsystems.sharescreen)" SHARESCREEN="$(nix eval --raw ~/.dotfiles#nixosConfigurations."$(hostname)".config.home-manager.users."$(whoami)".swarselsystems.sharescreen)"
touch /tmp/screenshare.state wl-mirror "$SHARESCREEN" &
STATE=$(< /tmp/screenshare.state) sleep 0.1
swaymsg '[app_id=at.yrlf.wl_mirror] move to workspace 14:T'
if [[ $STATE != "1" ]]; then swaymsg '[app_id=at.yrlf.wl_mirror] fullscreen'
wl-mirror "$SHARESCREEN" &
sleep 0.1
swaymsg output "$SHARESCREEN" mode "$SWARSEL_LO_RES"
echo 1 > /tmp/screenshare.state
swaymsg '[app_id=at.yrlf.wl_mirror] move to workspace 12:S'
swaymsg '[app_id=at.yrlf.wl_mirror] fullscreen'
else
swaymsg output "$SHARESCREEN" mode "$SWARSEL_HI_RES"
echo 0 > /tmp/screenshare.state
swaymsg '[app_id=at.yrlf.wl_mirror] kill'
fi

View file

@ -1,6 +1,6 @@
KITTIES=$(($(pgrep -P 1 kitty | wc -l) - 1)) KITTIES=$(($(pgrep -P 1 kitty | wc -l) - 1))
if [[ $KITTIES -lt 1 ]]; then if ((KITTIES < 1)); then
exec kitty -o confirm_os_window_close=0 zellij attach --create main exec kitty -o confirm_os_window_close=0 zellij attach --create main
else else
exec kitty -o confirm_os_window_close=0 zellij attach --create "temp $KITTIES" exec kitty -o confirm_os_window_close=0 zellij attach --create "temp $KITTIES"

BIN
wallpaper/botanicswp.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 MiB