diff options
Diffstat (limited to '')
18 files changed, 377 insertions, 110 deletions
diff --git a/modules/by-name/at/atuin/secrets/user_id.age b/modules/by-name/at/atuin/secrets/user_id.age index 8bfc370d..6ac3bcd6 100644 --- a/modules/by-name/at/atuin/secrets/user_id.age +++ b/modules/by-name/at/atuin/secrets/user_id.age @@ -1,13 +1,14 @@ -----BEGIN AGE ENCRYPTED FILE----- -YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB4cmN5R1haeElTZnhmNHha -MERLd2M0V2k1UFU2NlMzU0NWNlVVNEM5c1VBCnZqUktBUFF4eEsvUUwrQkJmclhz -WTJuMktGV09XK0x3WkQ4b0dwd0FGOXcKLT4gc3NoLWVkMjU1MTkgelpFb25nIDhE -dlQyMXJRVmI1MnRBMjAydEJHdE1TNGxlWTRoSGlYUS9Pb1Mrd1BOM2cKaE8vdHM2 -aUZKclVzcHdMaCtiWnVkMWhGZm1ubG5DRGZ4VG41V0VCL1ZyVQotPiBzc2gtZWQy -NTUxOSA3SGZGVXcgMlFIUDBhL2tkcndlT0JyelVzeEJMV0orcHp3WGN1dFU5aytj -NUMwaFMwRQpjYkJpZmQrL1JxOUxPcXE3TEdyYko2YmI2UkdibWpIaUk0TEV2ZzAz -NlJFCi0+IFBRaHdiLWdyZWFzZSAuZ08tXCBURjBMQS4KTVFGcUJpaFdrMDdCU0Vm -R0F0UWR4cU96WWNCSzR3Ci0tLSBkeWRKdk1tQ2t4WnR6aVczejNhRnhISEE0YkZq -U2VEd2I3SjQvbHN0WS9RChDEY9Z7GS4vCEtNetRMX1eLrOY9G+D4SGYcEOXqgrKq -V1q/nnUtKj8qw3X0bfesuBKfz4DsO7t9IjfCn/nFIU4ifFtR +YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSB0T3hFUm1NZU1RU2IxNWsx +ZFh2ckVsTnNBZVVqMm9HaGFOTmtKMlh3M2xzClJ1N0RsbFJYYWhnYktpYnFaYWNY +c2VGRzZoMW1GOENsV3FoTEJ1OWVDQ00KLT4gc3NoLWVkMjU1MTkgelpFb25nIDlY +MnRoMFB4dTUyS0pIenVjelRxRERXZ2ptVURZWGttZWR5R25NMWYzekUKaVRDKzJj +cCtRY0F6VVFGUlIyeGhLSThXMVFvNEl2Y0tMdHpSOEI4cjVtTQotPiBzc2gtZWQy +NTUxOSA3SGZGVXcgbjNpdGZZa1NxbEw3YkV4UmxTb0dtSlFPM1htK1QzWXBaRGdv +ZUdTYkoxSQpMcHZCMnNPR0QySkovQ0I1THVPK3Z5RlFCbGJ5Zk5teDBKbUFvY1p4 +T3lzCi0+IGtrVXxkQlItZ3JlYXNlIDBRO3cKWnk5M2MyTUExRDBYd25RdkxRQWla +bnpTU1J0T1NMbVZldGpCbVZOTFZuV29ZRll0UDJwdHo0YWoKLS0tIFI5RG9WSDZu +am9RYnFONE9wZ3pVaG1tVnBLNTZqK3d4NFhhT1F1bWlORzAKz44Fafb+Ck5aMxJF +5/pNNcYE3IRUqjKTWjmSO+fBFVPnlfIIc6gKFhO4Nm05QIxqzSW08PbBhVYFH65u +ivRjFHUg+Gp3 -----END AGE ENCRYPTED FILE----- diff --git a/modules/by-name/fo/foot/module.nix b/modules/by-name/fo/foot/module.nix index d818aac0..b698eee9 100644 --- a/modules/by-name/fo/foot/module.nix +++ b/modules/by-name/fo/foot/module.nix @@ -11,6 +11,7 @@ config, lib, libraries, + pkgs, ... }: let cfg = config.soispha.foot; @@ -20,25 +21,28 @@ in { }; config = lib.mkIf cfg.enable { + # TODO: Maybe we can use the xdg-autostart mechanism for this? <2026-06-23> + soispha.programs.river.init.autoStart = [ + ["${lib.getExe' pkgs.foot "footclient"}"] + ]; + home-manager.users.soispha = { programs.foot = { enable = true; server.enable = true; settings = { main = { + include = "${./theme.ini}"; font = "SauceCodePro Nerd Font Mono:size=12"; horizontal-letter-offset = -1; vertical-letter-offset = -1; }; - # environment = { - # COLORTERM = "truecolor"; - # }; "regex:hashes" = { regex = "([a-fA-F0-9]{7,128})"; launch = "git show \${match}"; }; "regex:paths" = { - regex = "([^ '\"`=:\\\\[\\\\(]*/)([^/: '\"`\\\\)\\\\]]*)"; + regex = "([^ '\"`=:\\\\[\\\\(]*/[^/: '\"`\\\\)\\\\]*)"; launch = "ll \${match}"; }; @@ -54,29 +58,6 @@ in { }; }; }; - - systemd.user.services = let - footCfg = config.home-manager.users.soispha.programs.foot; - inherit (footCfg.server) systemdTarget; - in { - foot-initial-term = { - Unit = { - Description = "Fast, lightweight and minimalistic Wayland terminal emulator."; - Documentation = "man:foot(1)"; - PartOf = [systemdTarget]; - After = [systemdTarget]; - ConditionEnvironment = "WAYLAND_DISPLAY"; - }; - - Service = { - ExecStart = "${lib.getExe' footCfg.package "footclient"}"; - }; - - Install = { - WantedBy = [systemdTarget]; - }; - }; - }; }; }; } diff --git a/modules/by-name/fo/foot/theme.ini b/modules/by-name/fo/foot/theme.ini new file mode 100644 index 00000000..f5f36039 --- /dev/null +++ b/modules/by-name/fo/foot/theme.ini @@ -0,0 +1,40 @@ +# From https://github.com/mbadolato/iTerm2-Color-Schemes/blob/75bc70670c28b5dc97625af38deb3ae49f4363e6/foot/Carbonfox.ini +# Other themes I considered: +# - ayu-mirage +# - catppuccin-mocha +# - chiba-dark +# - iterm +# - kitty +# - modus-vivendi +# - modus-vivendi-tinted +# - molokai +# - tokyonight-storm +# - visibone +# - xterm +# - poimandres +# -*- conf -*- +# VisiBone + +[colors-dark] +cursor=161616 f2f4f8 +foreground=f2f4f8 +background=161616 +regular0=282828 +regular1=ee5396 +regular2=25be6a +regular3=08bdba +regular4=78a9ff +regular5=be95ff +regular6=33b1ff +regular7=dfdfe0 +bright0=484848 +bright1=f16da6 +bright2=46c880 +bright3=2dc7c4 +bright4=8cb6ff +bright5=c8a5ff +bright6=52bdff +bright7=e4e4e5 +selection-foreground=f2f4f8 +selection-background=2a2a2a + diff --git a/modules/by-name/i3/i3bar-river/module.nix b/modules/by-name/i3/i3bar-river/module.nix index 8a2203aa..982ec1e3 100644 --- a/modules/by-name/i3/i3bar-river/module.nix +++ b/modules/by-name/i3/i3bar-river/module.nix @@ -110,7 +110,26 @@ in { }; config = lib.mkIf cfg.enable { - soispha.programs.river.init.backgroundStart = [cfg.package]; + systemd.user.services."i3bar-river" = { + description = "Highly customizable Wayland bar for river"; + partOf = ["graphical-session.target"]; + after = ["graphical-session.target"]; + requisite = ["graphical-session.target"]; + + path = [ + pkgs.bash # `sh` is needed for starting the status command + + # TODO: This should be a wrapper of the status command <2026-06-23> + pkgs.btrfs-progs # `btrfs` is needed by the storage block in the status command + ]; + + serviceConfig = { + ExecStart = "${lib.getExe cfg.package}"; + ExecReload = "kill -SIGUSR2 $MAINPID"; + Restart = "on-failure"; + }; + wantedBy = ["graphical-session.target"]; + }; home-manager.users.soispha = { programs.i3bar-river = { diff --git a/modules/by-name/lf/lf/keybindings/default.nix b/modules/by-name/lf/lf/keybindings/default.nix index b6b7a548..d7f8eb95 100644 --- a/modules/by-name/lf/lf/keybindings/default.nix +++ b/modules/by-name/lf/lf/keybindings/default.nix @@ -15,50 +15,69 @@ "'\"'" = null; ";" = null; "\"'\"" = null; - c = null; - d = null; - e = null; - j = null; - k = null; - m = null; - f = null; # Sorting - kn = ":set sortby natural; set info"; - ks = ":set sortby size; set info size"; - kt = ":set sortby time; set info time"; - ka = ":set sortby atime; set info atime"; - kc = ":set sortby ctime; set info ctime"; - ke = ":set sortby ext; set info"; + # k = null; + k = { + n = ":set sortby natural; set info"; + s = ":set sortby size; set info size"; + t = ":set sortby time; set info time"; + a = ":set sortby atime; set info atime"; + c = ":set sortby ctime; set info ctime"; + e = ":set sortby ext; set info"; + }; # Searching l = "search-next"; L = "search-prev"; - # File Openers - ee = "\$\$EDITOR \"$f\""; - es = "\$ nvim -S \"$f\""; + # File edit + # e = null; + e = { + e = "\$\$EDITOR \"$f\""; + s = "\$ nvim -S \"$f\""; + }; + u = "view_file"; - cc = "\$sudo -e \"$f\""; - fe = "execute"; - fl = "follow_link"; - cp = "set_clipboard_path"; + + # f = null; + f = { + e = "execute"; + l = "follow_link"; + }; + + # c = null; + c = { + p = "set_clipboard_path"; + s = "stripspace"; + h = "chmod"; + }; # Archive Mappings - au = "archive_decompress"; - aa = "archive_compress"; + a = { + u = "archive_decompress"; + a = "archive_compress"; + }; - # Trash Mappings - dd = "trash"; - jc = "trash_clear"; - jr = "trash_restore"; + D = { + D = "delete"; + }; + # d = null; + d = { + # Trash Mappings + d = "trash"; - # Dragon Mapping - dr = "dragon"; - ds = "dragon_stay"; - di = "dragon_individual"; + # Dragon Mapping + r = "dragon"; + s = "dragon_stay"; + i = "dragon_individual"; + }; - cs = "stripspace"; + # j = null; + j = { + c = "trash_clear"; + r = "trash_restore"; + }; # Vim keys h = "updir"; @@ -68,30 +87,36 @@ # Basic Functions "." = "set hidden!"; - DD = "delete"; p = "paste"; x = "cut"; y = "copy"; "<enter>" = "open"; - mk = "mk_link"; - mf = "mk_file"; - md = "mk_directory"; - ms = "mk_script"; + # m = null; + m = { + k = "mk_link"; + f = "mk_file"; + d = "mk_directory"; + s = "mk_script"; + }; + + b = { + g = "set_wallpaper"; + }; - ch = "chmod"; - bg = "set_wallpaper"; r = ":rename; cmd-end"; R = "reload"; C = "clear"; U = "unselect"; - # Movement - nu = "cd /run/user/${builtins.toString uid}"; - ne = "cd /etc"; - nd = "cd ${downloadDir}"; - nt = "cd /tmp"; - nh = "cd_project_root"; + # (walking) Movement + w = { + u = "cd /run/user/${builtins.toString uid}"; + e = "cd /etc"; + d = "cd ${downloadDir}"; + t = "cd /tmp"; + h = "cd_project_root"; + }; g = "cd_lf_make_map"; } diff --git a/modules/by-name/lf/lf/module.nix b/modules/by-name/lf/lf/module.nix index daa236e6..0a0e193f 100644 --- a/modules/by-name/lf/lf/module.nix +++ b/modules/by-name/lf/lf/module.nix @@ -17,7 +17,19 @@ ... }: let commands = import ./commands {inherit pkgs sysLib shell_library system;}; - keybindings = import ./keybindings {inherit (cfg.keymaps) uid downloadDir;}; + keybindings_raw = import ./keybindings {inherit (cfg.keymaps) uid downloadDir;}; + + process = prefix: attrs: + lib.mapAttrsToList (name: value: + if (builtins.isAttrs value) + then + (process name value) + ++ [(lib.nameValuePair name null)] + else if prefix == null + then (lib.nameValuePair name value) + else (lib.nameValuePair (prefix + name) value)) + attrs; + keybindings = builtins.listToAttrs (lib.lists.flatten (process null keybindings_raw)); packages = import ./wrappers {inherit pkgs;}; diff --git a/modules/by-name/ly/ly/module.nix b/modules/by-name/ly/ly/module.nix index dedabe81..e2d3b0ae 100644 --- a/modules/by-name/ly/ly/module.nix +++ b/modules/by-name/ly/ly/module.nix @@ -31,6 +31,7 @@ Terminal=true ''; + # TODO: This could use the `services.display-manager.sessionPackages` option <2026-06-23> customSessionsDir = pkgs.runCommand "custom-sessions" {} /* @@ -39,8 +40,22 @@ '' mkdir "$out"; cp "${riverDesktop}/share/applications/river.desktop" "$out" - cp "${shellDesktop}" "$out" + cp "${shellDesktop}" "$out/zsh.desktop" ''; + + setup = pkgs.writeShellApplication { + name = "setup"; + + bashOptions = []; + + runtimeInputs = [ + pkgs.findutils + pkgs.systemd + ]; + inheritPath = true; + + text = builtins.readFile ./setup.sh; + }; in { options.soispha.programs.ly = { enable = lib.mkEnableOption "ly"; @@ -84,6 +99,11 @@ in { dur_file_path = "${./blackhole-smooth-240x67.dur}"; full_color = true; + # NOTE: This does the same as the default nixos setup cmd, but we don't + # immidiately start the `graphical-session.target`. That is started by river's + # init. <2026-06-23> + setup_cmd = "${lib.getExe setup}"; + custom_sessions = "${customSessionsDir}"; # Clear the screen before starting up (otherwise error messages might linger on @@ -98,12 +118,12 @@ in { clock = "%c"; hibernate_cmd = "systemctl hibernate"; - inactivity_cmd = "systmectl suspend-then-hibernate"; + inactivity_cmd = "systemctl suspend-then-hibernate"; restart_cmd = "reboot"; shutdown_cmd = "shutdown $PLATFORM_SHUTDOWN_ARG now"; sleep_cmd = "systemctl suspend"; - inactivity_delay = 30; # unit is seconds + inactivity_delay = 120; # unit is seconds }; }; }; diff --git a/modules/by-name/ly/ly/setup.sh b/modules/by-name/ly/ly/setup.sh new file mode 100644 index 00000000..6e8bed2b --- /dev/null +++ b/modules/by-name/ly/ly/setup.sh @@ -0,0 +1,47 @@ +#! /usr/bin/env bash + +# Shared environment setup for graphical sessions. + +# shellcheck disable=1091 +. /etc/profile + +cd "$HOME" || { + echo 1>&2 "No HOME :(" + exit 1 +} + +if [ -z "$_DID_SYSTEMD_CAT" ]; then + export _DID_SYSTEMD_CAT=1 + exec systemd-cat -t xsession "$0" "$@" +fi + + +# Import environment variables into the systemd user environment. +/run/current-system/systemd/bin/systemctl --user import-environment DBUS_SESSION_BUS_ADDRESS DISPLAY XAUTHORITY XDG_SESSION_ID + +# Speed up application start by 50-150ms according to +# https://kdemonkey.blogspot.com/2008/04/magic-trick.html +compose_cache="${XCOMPOSECACHE:-$HOME/.compose-cache}" +mkdir -p "$compose_cache" +# To avoid accidentally deleting a wrongly set up XCOMPOSECACHE directory, +# defensively try to delete cache *files* only, following the file format specified in +# https://gitlab.freedesktop.org/xorg/lib/libx11/-/blob/master/modules/im/ximcp/imLcIm.c#L353-358 +# sprintf (*res, "%s/%c%d_%03x_%08x_%08x", dir, _XimGetMyEndian(), XIM_CACHE_VERSION, (unsigned int)sizeof (DefTree), hash, hash2); +find "$compose_cache" -maxdepth 1 -regextype posix-extended -regex '.*/[Bl][0-9]+_[0-9a-f]{3}_[0-9a-f]{8}_[0-9a-f]{8}' -delete +unset compose_cache + +# Work around KDE errors when a user first logs in and +# .local/share doesn't exist yet. +mkdir -p "${XDG_DATA_HOME:-$HOME/.local/share}" + +unset _DID_SYSTEMD_CAT + + +if test "$1"; then + # Run the supplied session command. + exec "$@" +else + # TODO: Do we need this? Should not the session always exist? + echo "error: unknown session $1" 1>&2 + exit 1 +fi diff --git a/modules/by-name/ni/nixpkgs/module.nix b/modules/by-name/ni/nixpkgs/module.nix index 84d8e074..1ded8444 100644 --- a/modules/by-name/ni/nixpkgs/module.nix +++ b/modules/by-name/ni/nixpkgs/module.nix @@ -22,7 +22,13 @@ in { example = "x86_64-linux"; type = lib.types.str; }; + unfreePackageNames = lib.mkOption { + description = "Names of unfree packages to allow"; + example = "[ steam steam-unwrapped ]"; + type = lib.types.listOf lib.types.str; + }; }; + config = let myPkgsOverlay = self: super: packageSets.soispha; in @@ -39,11 +45,7 @@ in { hostSystem = cfg.systemName; allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - # the plugin is lacking an license and is thus unfree, effectively - # its okay though (TODO: investigate <2026-05-11>)? - "cmp-calc" - ]; + builtins.elem (lib.getName pkg) cfg.unfreePackageNames; }; }; }; diff --git a/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix b/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix index 315f3fc7..48883bd3 100644 --- a/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix +++ b/modules/by-name/nv/nvim/plgs/nvim-cmp/default.nix @@ -14,6 +14,12 @@ }: let cfg = config.soispha.programs.nvim; in { + soispha.nixpkgs.unfreePackageNames = [ + # the plugin is lacking an license and is thus unfree, effectively + # its okay though (TODO: investigate <2026-05-11>)? + "cmp-calc" + ]; + home-manager.users.soispha.programs.nixvim = lib.mkIf cfg.enable { opts.completeopt = [ "menu" # Show completions in a menu diff --git a/modules/by-name/qu/qutebrowser/settings/default.nix b/modules/by-name/qu/qutebrowser/settings/default.nix index 282c5816..b0259c22 100644 --- a/modules/by-name/qu/qutebrowser/settings/default.nix +++ b/modules/by-name/qu/qutebrowser/settings/default.nix @@ -502,11 +502,11 @@ in { "@du" = duckduckgo; # NIX - "@np" = "https://search.nixos.org/packages?type=packages&query={}"; # Nix packages + "@np" = "https://search.nixos.org/packages?channel=unstable&type=packages&query={}"; # Nix packages "@ng" = "https://noogle.dev/q?term={}"; # Nix functions - "@no" = "https://search.nixos.org/options?type=options&query={}"; # NixOS options + "@no" = "https://search.nixos.org/options?channel=unstable&type=options&query={}"; # NixOS options "@nh" = "https://home-manager-options.extranix.com/?query={}&release=master"; # Home-Manager options "@ni" = "https://github.com/NixOS/nixpkgs/issues?q=is%3Aissue+is%3Aopen+{}"; # Nixpkgs issues diff --git a/modules/by-name/ri/river/keymap.nix b/modules/by-name/ri/river/keymap.nix index eacfd75b..1d4b8c3e 100644 --- a/modules/by-name/ri/river/keymap.nix +++ b/modules/by-name/ri/river/keymap.nix @@ -44,7 +44,7 @@ in { "<LEFT_SUPER>" = { # Spawn standard programs "r" = { - "a" = mkSpawn pkgs.alacritty "" {}; + "a" = mkSpawn' pkgs.foot "footclient" "" {}; "b" = mkSpawn pkgs.tskm "open select" {once = true;}; "k" = mkSpawn pkgs.keepassxc "" {once = true;}; # "s" = mkSpawn pkgs.signal-desktop "" {once = true;}; diff --git a/modules/by-name/ri/river/module.nix b/modules/by-name/ri/river/module.nix index bafaf0a3..7eb30014 100644 --- a/modules/by-name/ri/river/module.nix +++ b/modules/by-name/ri/river/module.nix @@ -35,7 +35,9 @@ else builtins.map esa input ); in "err_fail ${program} &"; - longRunningPrograms = builtins.concatStringsSep "\n" (builtins.map mkLrProgram cfg.init.backgroundStart); + longRunningPrograms = + builtins.concatStringsSep "\n" (builtins.map mkLrProgram + cfg.init.autoStart); keymapFormat = pkgs.formats.json {}; keymapGenerate = name: value: @@ -163,12 +165,14 @@ in { ''; }; - backgroundStart = lib.mkOption { - type = lib.types.listOf (lib.types.either lib.types.package (lib.types.listOf lib.types.str)); - description = "List of programs to start in the background"; + autoStart = lib.mkOption { + type = + lib.types.listOf (lib.types.either lib.types.package (lib.types.listOf + lib.types.str)); + description = "List of programs to be started at river start"; example = '' [ - pkgs.gammastep + ''${lib.getExe pkgs.foot} ] ''; }; @@ -235,14 +239,49 @@ in { # ${text} ${other_stuff} ''; + + sessionVars = + (builtins.attrNames config.environment.sessionVariables) + ++ (builtins.attrNames config.home-manager.users.soispha.home.sessionVariables) + ++ [ + "WAYLAND_DISPLAY" + "DISPLAY" + "XDG_RUNTIME_DIR" + ]; + + part = acc: vars: let + firstTen = lib.lists.take 5 vars; + in + if firstTen == [] + then acc + else part (acc ++ [firstTen]) (lib.lists.removePrefix firstTen vars); + + partedSessionVars = part [] sessionVars; + + mkEnvSet = prefix: vars: let + stringVars = builtins.concatStringsSep " " vars; + in ''err_fail ${riverctl} spawn "${prefix} ${stringVars}"''; + + dbusEnvs = + builtins.map + (mkEnvSet "${lib.getExe' pkgs.dbus "dbus-update-activation-environment"} --verbose --systemd") + partedSessionVars; + systemdUserEnvs = + builtins.map + (mkEnvSet "systemctl --user --verbose import-environment") + partedSessionVars; in builtins.readFile ./init_base.sh + # bash mkHeading "Environment variables" '' - err_fail ${riverctl} spawn "${lib.getExe' pkgs.dbus "dbus-update-activation-environment"} --verbose --systemd SEATD_SOCK DISPLAY WAYLAND_DISPLAY DESKTOP_SESSION=river XDG_CURRENT_DESKTOP=river" export XDG_CURRENT_DESKTOP=river DESKTOP_SESSION=river; '' + + mkHeading "Informing dbus about changed env-vars" (builtins.concatStringsSep "\n" dbusEnvs) + + mkHeading "Informing systemd user about changed env-vars" (builtins.concatStringsSep "\n" systemdUserEnvs) + + mkHeading "Starting graphical-session-target" '' + err_fail systemctl --user start nixos-fake-graphical-session.target + '' + mkHeading "Key Mappings" keymappings + mkHeading "Rules" ruleSetup + mkHeading "General Settings" generalSettings diff --git a/modules/by-name/st/steam/module.nix b/modules/by-name/st/steam/module.nix index 87cdc709..aaa36fd3 100644 --- a/modules/by-name/st/steam/module.nix +++ b/modules/by-name/st/steam/module.nix @@ -19,15 +19,12 @@ in { }; config = lib.mkIf cfg.enable { - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - # NOTE: These are not really applied. Needs to be at - # <modules/by-name/ni/nixpkgs/config.nix> for some reason. <2025-04-25> - "steam" - "steam-unwrapped" - "steam-original" - "steam-run" - ]; + soispha.nixpkgs.unfreePackageNames = [ + "steam" + "steam-unwrapped" + "steam-original" + "steam-run" + ]; programs.steam = { enable = true; diff --git a/modules/common/abstract-nord.png b/modules/by-name/sw/swaybg/images/abstract-nord.png Binary files differindex 5ef498bf..5ef498bf 100644 --- a/modules/common/abstract-nord.png +++ b/modules/by-name/sw/swaybg/images/abstract-nord.png diff --git a/modules/common/abstract-nord.png.license b/modules/by-name/sw/swaybg/images/abstract-nord.png.license index eae6a84c..eae6a84c 100644 --- a/modules/common/abstract-nord.png.license +++ b/modules/by-name/sw/swaybg/images/abstract-nord.png.license diff --git a/modules/by-name/sw/swaybg/module.nix b/modules/by-name/sw/swaybg/module.nix new file mode 100644 index 00000000..fa6a079a --- /dev/null +++ b/modules/by-name/sw/swaybg/module.nix @@ -0,0 +1,35 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + pkgs, + libraries, + ... +}: let + cfg = config.soispha.programs.swaybg; +in { + options.soispha.programs.swaybg = { + enable = libraries.base.options.mkEnable "swaybg"; + }; + + config = lib.mkIf cfg.enable { + systemd.user.services."swaybg" = { + description = "Background display for river"; + partOf = ["graphical-session.target"]; + after = ["graphical-session.target"]; + requisite = ["graphical-session.target"]; + serviceConfig = { + ExecStart = "${lib.getExe pkgs.swaybg} --image ${./images/abstract-nord.png}"; + }; + wantedBy = ["graphical-session.target"]; + }; + }; +} diff --git a/modules/by-name/sw/swayidle/module.nix b/modules/by-name/sw/swayidle/module.nix new file mode 100644 index 00000000..a29b5952 --- /dev/null +++ b/modules/by-name/sw/swayidle/module.nix @@ -0,0 +1,43 @@ +# nixos-config - My current NixOS configuration +# +# Copyright (C) 2025 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: GPL-3.0-or-later +# +# This file is part of my nixos-config. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>. +{ + config, + lib, + libraries, + ... +}: let + cfg = config.soispha.programs.swayidle; +in { + options.soispha.programs.swayidle = { + enable = libraries.base.options.mkEnable "swayidle"; + }; + + config = lib.mkIf cfg.enable { + home-manager.users.soispha = { + services.swayidle = { + enable = true; + events = { + "before-sleep" = "swaylock -f "; + }; + + timeouts = [ + { + timeout = 180; + command = "swaylock -fF"; + } + { + timeout = 360; + command = "systemctl suspend-then-hibernate"; + } + ]; + }; + }; + }; +} |
