diff options
Diffstat (limited to '')
33 files changed, 443 insertions, 207 deletions
diff --git a/hosts/by-name/apzu/hardware.nix b/hosts/by-name/apzu/hardware.nix index 70b041e7..d037473a 100644 --- a/hosts/by-name/apzu/hardware.nix +++ b/hosts/by-name/apzu/hardware.nix @@ -33,6 +33,12 @@ boot = { kernelModules = ["kvm-intel" "rtw89"]; + kernelParams = [ + # Use the newer experimental xe driver + # "i915.force_probe=!9a49" + # "xe.force_probe=9a49" + ]; + initrd.availableKernelModules = ["xhci_pci" "vmd" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc"]; }; } @@ -1,6 +1,6 @@ let nixpkgsVersion = "26.05"; - lanzabooteVersion = "v1.0.0"; + lanzabooteVersion = "v1.1.0"; in { "agenix" = { url = "github:ryantm/agenix/main"; diff --git a/modules/by-name/at/atuin/module.nix b/modules/by-name/at/atuin/module.nix index e55e358e..caabdf40 100644 --- a/modules/by-name/at/atuin/module.nix +++ b/modules/by-name/at/atuin/module.nix @@ -30,7 +30,7 @@ in { owner = "soispha"; group = "users"; }; - user_id = lib.mkIf cfg.enableAge { + atuin_user_id = lib.mkIf cfg.enableAge { file = ./secrets/user_id.age; mode = "700"; owner = "soispha"; 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/ca/cargo/module.nix b/modules/by-name/ca/cargo/module.nix index d36a11e5..6a0675d3 100644 --- a/modules/by-name/ca/cargo/module.nix +++ b/modules/by-name/ca/cargo/module.nix @@ -27,8 +27,7 @@ in { cargoHome = "${config.home-manager.users.soispha.xdg.dataHome}/cargo"; settings = { - # {cargo-cache-home} means $CARGO_HOME - build.build-dir = "{cargo-cache-home}/shared-target/"; + build.build-dir = "${config.home-manager.users.soispha.xdg.cacheHome}/cargo/shared-target/"; }; }; }; 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"; + } + ]; + }; + }; + }; +} diff --git a/modules/by-name/xd/xdg/module.nix b/modules/by-name/xd/xdg/module.nix index c2d60f3b..9430d82f 100644 --- a/modules/by-name/xd/xdg/module.nix +++ b/modules/by-name/xd/xdg/module.nix @@ -41,15 +41,15 @@ }; cfg = config.soispha.xdg; + + inherit (config.home-manager.users.soispha.home) homeDirectory; in { options.soispha.xdg = { enable = lib.mkEnableOption "xdg"; }; config = lib.mkIf cfg.enable { - home-manager.users.soispha.xdg = let - inherit (config.home-manager.users.soispha.home) homeDirectory; - in { + home-manager.users.soispha.xdg = { enable = true; configFile."xdg-desktop-portal-termfilechooser/config".source = tfcConfigFile; diff --git a/modules/common/default.nix b/modules/common/default.nix index 680514a1..e5172921 100644 --- a/modules/common/default.nix +++ b/modules/common/default.nix @@ -116,9 +116,6 @@ # Should not be synchronized "~/.local/share/unison" - # It's pointless to synchronize that - "~/.local/share/cargo/shared-target" - # These are just to big to be synchronized (# TODO: Work around that <2024-08-31> ) "~/.local/share/Steam" ] @@ -222,16 +219,10 @@ pointer-1133-49970-Logitech_Gaming_Mouse_G502 = [["pointer-accel" "0"] ["accel-profile" "none"]]; pointer-12951-6505-ZSA_Technology_Labs_Moonlander_Mark_I = [["pointer-accel" "0"] ["accel-profile" "none"]]; }; - backgroundStart = [ - # TODO(@bpeetz): Move these to systemd units/their own modules <2025-05-18> - - ["${lib.getExe pkgs.swaybg}" "--image" "${./abstract-nord.png}"] - pkgs.swayidle - ]; }; }; mpv.enable = true; - steam.enable = false; + steam.enable = true; ssh.enable = true; swaylock.enable = true; timewarrior.enable = true; diff --git a/modules/home.legacy/conf/default.nix b/modules/home.legacy/conf/default.nix index 89502a64..b50068ea 100644 --- a/modules/home.legacy/conf/default.nix +++ b/modules/home.legacy/conf/default.nix @@ -24,6 +24,5 @@ ./prusa_slicer ./python ./starship - ./swayidle ]; } diff --git a/modules/home.legacy/conf/swayidle/config b/modules/home.legacy/conf/swayidle/config deleted file mode 100644 index a48f670b..00000000 --- a/modules/home.legacy/conf/swayidle/config +++ /dev/null @@ -1,5 +0,0 @@ -timeout 180 'swaylock -fF' - -timeout 360 'systemctl suspend-then-hibernate' - -before-sleep 'swaylock -f' diff --git a/modules/home.legacy/conf/swayidle/config.license b/modules/home.legacy/conf/swayidle/config.license deleted file mode 100644 index eae6a84c..00000000 --- a/modules/home.legacy/conf/swayidle/config.license +++ /dev/null @@ -1,9 +0,0 @@ -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>. diff --git a/modules/home.legacy/conf/swayidle/default.nix b/modules/home.legacy/conf/swayidle/default.nix deleted file mode 100644 index 4483c8b9..00000000 --- a/modules/home.legacy/conf/swayidle/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -# 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>. -{...}: { - # TODO: This fails to hibernate when the hardware swap was not previously activated. <2025-04-04> - xdg.configFile."swayidle/config".source = ./config; - - # services.swayidle = { - # enable = true; - # events = [ - # { - # event = "before-sleep"; - # command = "${pkgs.swaylock}/bin/swaylock -f "; - # } - # ]; - # timeouts = [ - # { - # timeout = 180; - # command = "${pkgs.swaylock}/bin/swaylock -fFu "; - # } - # { - # timeout = 360; - # # TODO: systemctl is installed? - # command = "systemctl suspend-then-hibernate"; - # } - # ]; - # # systemdTarget = ""; # TODO: this might be usefull - # }; -} diff --git a/npins/sources.json b/npins/sources.json index 85928737..f7d5476a 100644 --- a/npins/sources.json +++ b/npins/sources.json @@ -22,9 +22,9 @@ }, "branch": "main", "submodules": false, - "revision": "478ccf2b33ee06f43a27378992280b8f62de6531", + "revision": "3ba41b526d57368bfa8d151fd777865370c24f6b", "url": null, - "hash": "sha256-h7Madx8B9ECeQcpoN79eI2l4+QSSD9o5Sl8vMNRcvxY=" + "hash": "sha256-6upceGLe7W2i00Qsv4fPQUuAIAUpHK8Tm/dsmoQ4SzI=" }, "unflake_git_https---git-foss-syndicate-org-bpeetz-qmk_layout_ref_prime": { "type": "Git", @@ -181,6 +181,19 @@ "url": "https://github.com/nix-community/impermanence/archive/7b1d382faf603b6d264f58627330f9faa5cba149.tar.gz", "hash": "sha256-03+JxvzmfwRu+5JafM0DLbxgHttOQZkUtDWBmeUkN8Y=" }, + "unflake_github_nix-community_lanzaboote_ref_master": { + "type": "Git", + "repository": { + "type": "GitHub", + "owner": "nix-community", + "repo": "lanzaboote" + }, + "branch": "master", + "submodules": false, + "revision": "0403b4b7e8b2612657f0053a4c315e6c43eee9e6", + "url": "https://github.com/nix-community/lanzaboote/archive/0403b4b7e8b2612657f0053a4c315e6c43eee9e6.tar.gz", + "hash": "sha256-4JLkQvN7/f77TyxXXtoEuUfovMqMLOgWpBaLMNX1dns=" + }, "unflake_github_nix-community_lanzaboote_ref_v1-0-0": { "type": "GitRelease", "repository": { @@ -245,9 +258,9 @@ }, "branch": "main", "submodules": false, - "revision": "19a4e5efa14d15aaeb947db6e700591e4acdb295", - "url": "https://github.com/nix-community/nixvim/archive/19a4e5efa14d15aaeb947db6e700591e4acdb295.tar.gz", - "hash": "sha256-h8eBVfQ+UZRc52vqGHrtD0gT4cSw41G4PW+iK06Y3nc=" + "revision": "e3c908fdf6dff268b04ffb6758bcfc7c018489b9", + "url": "https://github.com/nix-community/nixvim/archive/e3c908fdf6dff268b04ffb6758bcfc7c018489b9.tar.gz", + "hash": "sha256-Kx1zxra9sZ215H3OiWUfkulu8N2v3iu19wqlzpD/Ac0=" }, "unflake_github_nix-systems_default": { "type": "Git", @@ -349,9 +362,9 @@ }, "branch": "nixos-unstable-small", "submodules": false, - "revision": "51effaf9783e0226281ad10e95a4af6c8a145316", - "url": "https://github.com/nixos/nixpkgs/archive/51effaf9783e0226281ad10e95a4af6c8a145316.tar.gz", - "hash": "sha256-tyh5yzbIN2ftH+uilyTWR6WCMZQeh3m5iOowTLNodyk=" + "revision": "25b882bfb833fb4d692e83b22d466732b64ebc8c", + "url": "https://github.com/nixos/nixpkgs/archive/25b882bfb833fb4d692e83b22d466732b64ebc8c.tar.gz", + "hash": "sha256-LActLimqQUa9LTzcVaO7Z5Yl6TEjcjkr5lzNrZX3COc=" }, "unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable": { "type": "Git", diff --git a/pkgs/by-name/hi/hibernate/hibernate.sh b/pkgs/by-name/hi/hibernate/hibernate.sh index 4a68e0d7..5f2a524a 100755 --- a/pkgs/by-name/hi/hibernate/hibernate.sh +++ b/pkgs/by-name/hi/hibernate/hibernate.sh @@ -10,7 +10,8 @@ # 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>. -# TODO(@bpeetz): This functionality could be moved to `tskm`. <2025-04-14> +# TODO(@bpeetz): The task context reset functionality could be moved to `tskm`. <2025-04-14> +# TODO: This whole script should be a systemd service with Before=hibernate.target <2026-06-26> context="$(task _get rc.context)" [ "$context" ] && task context none @@ -19,6 +20,10 @@ context="$(task _get rc.context)" active="$(task +ACTIVE _ids)" [ "$active" ] && task stop "$active" +# Make sure that the swayidle service is actually running. Otherwise we don't get a +# screenlock upon hibernate-resume. +systemctl --user start swayidle.service + systemctl hibernate "$@" # vim: ft=sh diff --git a/pkgs/by-name/lf/lf-make-map/src/mapping/map_key.rs b/pkgs/by-name/lf/lf-make-map/src/mapping/map_key.rs index d90eb963..6d88d5af 100644 --- a/pkgs/by-name/lf/lf-make-map/src/mapping/map_key.rs +++ b/pkgs/by-name/lf/lf-make-map/src/mapping/map_key.rs @@ -48,8 +48,8 @@ impl PartialOrd for MapKey { } impl MapKey { - pub fn new_from_part_path(part_path: &str, resolution: usize) -> Vec<Self> { - let key = Self::part_path_to_key(part_path, resolution); + pub fn new_from_part_path(part_path: &str, resolution: usize, full_path: &str) -> Vec<Self> { + let key = Self::path_part_to_key(part_path, resolution, Some(full_path)); key.chars() .map(|ch| Self { @@ -63,7 +63,7 @@ impl MapKey { pub fn new_ones_from_path(path: &str, number_of_chars: usize) -> Vec<Self> { let key: Vec<MapKey> = path .split('/') - .flat_map(|part| Self::new_from_part_path(part, number_of_chars)) + .flat_map(|part| Self::new_from_part_path(part, number_of_chars, path)) .collect(); debug!( @@ -80,10 +80,10 @@ impl MapKey { // debug!("Incrementing: '{}' ('{}')", &self, &self.part_path); let added_chars = if new_resolution < self.part_path.len() { - MapKey::part_path_to_key(&self.part_path, new_resolution) + MapKey::path_part_to_key(&self.part_path, new_resolution, None) } else { let mut generated_chars = - MapKey::part_path_to_key(&self.part_path, self.part_path.len()); + MapKey::path_part_to_key(&self.part_path, self.part_path.len(), None); generated_chars.extend( (0..(new_resolution - self.part_path.len())) @@ -112,16 +112,21 @@ impl MapKey { values.iter().map(|value| value.key).collect() } - fn part_path_to_key(part: &str, number_of_chars: usize) -> String { - fn make(pat: char, part: &str, number_of_chars: usize) -> String { + fn path_part_to_key(part: &str, number_of_chars: usize, full_path: Option<&str>) -> String { + fn make(pat: char, part: &str, number_of_chars: usize, full_path: Option<&str>) -> String { let mut acc = String::new(); - if !part.split(pat).all(|part| !part.is_empty()) { + if part.split(pat).all(|split| split.is_empty()) { panic!( "\ -Can't turn this path '{}' to a mapping. -This should not happen, please report the bug!", - part +Failed to split path part `{part}`, with pattern `{pat}`, because all resulting split parts are empty. {} +This should not happen, please report this bug!", { + if let Some(full_path) = full_path { + format!("(Full path was: `{full_path}`)") + } else { + String::new() + } + } ) } @@ -148,9 +153,9 @@ This should not happen, please report the bug!", } let value = if part.contains('_') && !part.starts_with('_') && !part.ends_with('_') { - make('_', part, number_of_chars) + make('_', part, number_of_chars, full_path) } else if part.contains('-') && !part.starts_with('-') && !part.ends_with('-') { - make('-', part, number_of_chars) + make('-', part, number_of_chars, full_path) } else if part.starts_with('.') { // HACK: Special case for directories like ~/.config ~/.local and so on. // We just drop the starting '.' and it's easier to type. <2026-06-02> diff --git a/pkgs/by-name/ta/tails-iso/update.sh b/pkgs/by-name/ta/tails-iso/update.sh index 5a2a81cd..10336449 100755 --- a/pkgs/by-name/ta/tails-iso/update.sh +++ b/pkgs/by-name/ta/tails-iso/update.sh @@ -48,7 +48,7 @@ new_version="$(curl --follow https://download.tails.net/tails/stable/ 2>/dev/nul if [ "$old_version" = "$new_version" ]; then # No need to update. - info exit 0 + exit 0 fi final_version="amd64-$new_version" diff --git a/unflake.nix b/unflake.nix index 0f4bd7ec..11b30d52 100644 --- a/unflake.nix +++ b/unflake.nix @@ -49,16 +49,16 @@ let home-manager = "unflake_github_nix-community_home-manager"; nixpkgs = "unflake_github_nixos_nixpkgs_ref_nixos-unstable"; }; - unflake_github_nix-community_nixos-generators_ref_master = { - nixlib = "unflake_github_nix-community_nixpkgs-lib"; - nixpkgs = "unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable"; - }; - unflake_github_nix-community_lanzaboote_ref_v1-0-0 = { + unflake_github_nix-community_lanzaboote_ref_master = { crane = "unflake_github_ipetkov_crane"; nixpkgs = "unflake_github_nixos_nixpkgs_ref_nixos-unstable"; pre-commit = "unflake_github_cachix_pre-commit-hooks-nix"; rust-overlay = "unflake_github_oxalica_rust-overlay"; }; + unflake_github_nix-community_nixos-generators_ref_master = { + nixlib = "unflake_github_nix-community_nixpkgs-lib"; + nixpkgs = "unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable"; + }; unflake_github_nix-community_home-manager = { nixpkgs = "unflake_github_nixos_nixpkgs_ref_nixpkgs-unstable"; }; @@ -144,8 +144,8 @@ let unflake_github_nix-community_disko_ref_master = inject "unflake_github_nix-community_disko_ref_master" "flake.nix" ""; unflake_github_nix-community_home-manager_ref_master = inject "unflake_github_nix-community_home-manager_ref_master" "flake.nix" ""; unflake_github_nix-community_impermanence_ref_master = inject "unflake_github_nix-community_impermanence_ref_master" "flake.nix" ""; + unflake_github_nix-community_lanzaboote_ref_master = inject "unflake_github_nix-community_lanzaboote_ref_master" "flake.nix" ""; unflake_github_nix-community_nixos-generators_ref_master = inject "unflake_github_nix-community_nixos-generators_ref_master" "flake.nix" ""; - unflake_github_nix-community_lanzaboote_ref_v1-0-0 = inject "unflake_github_nix-community_lanzaboote_ref_v1-0-0" "flake.nix" ""; unflake_github_nix-community_home-manager = inject "unflake_github_nix-community_home-manager" "flake.nix" ""; unflake_github_nix-community_nixpkgs-lib = inject "unflake_github_nix-community_nixpkgs-lib" "flake.nix" ""; unflake_github_nix-systems_default_ref_future-26-11 = inject "unflake_github_nix-systems_default_ref_future-26-11" "flake.nix" ""; @@ -174,7 +174,7 @@ let flake-compat = universe.unflake_git_https---git-lix-systems-lix-project-flake-compat_ref_main; home-manager = universe.unflake_github_nix-community_home-manager_ref_master; impermanence = universe.unflake_github_nix-community_impermanence_ref_master; - lanzaboote = universe.unflake_github_nix-community_lanzaboote_ref_v1-0-0; + lanzaboote = universe.unflake_github_nix-community_lanzaboote_ref_master; library = universe.unflake_git_https---git-foss-syndicate-org-vhack-eu-nix-library_ref_prime; nix-index-database = universe.unflake_github_nix-community_nix-index-database_ref_main; nixos-generators = universe.unflake_github_nix-community_nixos-generators_ref_master; |
