From e113d9775de4d943fc98cd8fa50a0642e202b3a4 Mon Sep 17 00:00:00 2001 From: Matt Nish-Lapidus Date: Sun, 29 Jun 2025 14:53:28 -0400 Subject: [PATCH] changing scripts to get swayidle working --- flake.lock | 109 ++++++++++++++---- flake.nix | 5 + .../dotfiles/dot_local/bin/dim-all-monitors | 6 +- .../dot_local/bin/lock-power-off-monitors | 2 +- .../dotfiles/dot_local/bin/lock-suspend | 4 +- .../dotfiles/dot_local/bin/mirror-laptop | 2 +- .../bin/niri-delayed-launch-at-startup | 2 +- .../dot_local/bin/niri-screenshot-window | 2 +- homes/emenel/dotfiles/dot_local/bin/on-unlock | 4 +- homes/emenel/dotfiles/dot_local/bin/piku | 2 +- homes/emenel/dotfiles/dot_local/bin/reaper | 2 +- .../dotfiles/dot_local/bin/session-lock | 4 +- homes/emenel/dotfiles/dot_local/bin/wezapp | 2 +- .../emenel/dotfiles/dot_local/bin/wezappfloat | 2 +- .../emenel/dotfiles/dot_local/bin/wezlauncher | 2 +- hosts/eddie/configuration.nix | 13 ++- hosts/eddie/razer-speaker-fix.nix | 2 +- modules/home/file-chooser/yazi-wrapper.sh | 2 +- modules/home/shell-conf.nix | 6 +- modules/home/sway-idle-lock.nix | 22 ++-- 20 files changed, 137 insertions(+), 58 deletions(-) diff --git a/flake.lock b/flake.lock index 1521d5d..34562da 100644 --- a/flake.lock +++ b/flake.lock @@ -90,11 +90,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1751127789, - "narHash": "sha256-Z0s5KRmigd6doImx6Kh4GRP/hlY8jMtT8KC1mqcPHv4=", + "lastModified": 1751216990, + "narHash": "sha256-KMcGSznyttkf3C2Gv4LNCPYOfvjj7Qk/Mu2Og2yCsbk=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "c5cc6bc833e686b5477e1a7054c5a0ee3039d413", + "rev": "562e5da816da90627ed5775d4ba6f968bde0ff57", "type": "github" }, "original": { @@ -103,6 +103,28 @@ "type": "github" } }, + "envfs": { + "inputs": { + "flake-parts": "flake-parts_2", + "nixpkgs": [ + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix_2" + }, + "locked": { + "lastModified": 1750727754, + "narHash": "sha256-Jkl9YSIDqZqmymdChoiZAmbdps7JIAcfgszZ1YCoGPk=", + "owner": "Mic92", + "repo": "envfs", + "rev": "5e51a84f22679426402eb2ad8f96120185e1306d", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "envfs", + "type": "github" + } + }, "flake-compat": { "locked": { "lastModified": 1733328505, @@ -201,6 +223,27 @@ } }, "flake-parts_2": { + "inputs": { + "nixpkgs-lib": [ + "envfs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709336216, + "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { "inputs": { "nixpkgs-lib": "nixpkgs-lib_2" }, @@ -415,11 +458,11 @@ ] }, "locked": { - "lastModified": 1750973805, - "narHash": "sha256-BZXgag7I0rnL/HMHAsBz3tQrfKAibpY2vovexl2lS+Y=", + "lastModified": 1751146119, + "narHash": "sha256-gvjG95TCnUVJkvQvLMlnC4NqiqFyBdJk3o8/RwuHeaU=", "owner": "nix-community", "repo": "home-manager", - "rev": "080e8b48b0318b38143d5865de9334f46d51fce3", + "rev": "76d0c31fce2aa0c71409de953e2f9113acd5b656", "type": "github" }, "original": { @@ -561,11 +604,11 @@ "xwayland-satellite-unstable": "xwayland-satellite-unstable" }, "locked": { - "lastModified": 1751106385, - "narHash": "sha256-lP/ZZk9doHFD/GR7sKh+PadDijURRDki6S8adVMt7v8=", + "lastModified": 1751179061, + "narHash": "sha256-E3SA2IZf72CR3wklJM+cF1ZOVjy6r8ZqbsOPXodNjWo=", "owner": "sodiboo", "repo": "niri-flake", - "rev": "d6be81f7553b90cd0e9528ddd7df665705b536e3", + "rev": "cc5722e779f3b32bdd918e473777c39da67ab1b6", "type": "github" }, "original": { @@ -659,7 +702,7 @@ }, "nix-rice": { "inputs": { - "flake-parts": "flake-parts_2", + "flake-parts": "flake-parts_3", "git-hooks-nix": "git-hooks-nix", "kitty-themes-src": "kitty-themes-src", "nixpkgs": [ @@ -782,11 +825,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1750646418, - "narHash": "sha256-4UAN+W0Lp4xnUiHYXUXAPX18t+bn6c4Btry2RqM9JHY=", + "lastModified": 1751048012, + "narHash": "sha256-MYbotu4UjWpTsq01wglhN5xDRfZYLFtNk7SBY0BcjkU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1f426f65ac4e6bf808923eb6f8b8c2bfba3d18c5", + "rev": "a684c58d46ebbede49f280b653b9e56100aa3877", "type": "github" }, "original": { @@ -996,6 +1039,7 @@ "disko": "disko", "emacs-lsp-booster": "emacs-lsp-booster", "emacs-overlay": "emacs-overlay", + "envfs": "envfs", "home-manager": "home-manager", "isd": "isd", "musnix": "musnix", @@ -1227,6 +1271,27 @@ "type": "github" } }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "envfs", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1710781103, + "narHash": "sha256-nehQK/XTFxfa6rYKtbi8M1w+IU1v5twYhiyA4dg1vpg=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "7ee5aaac63c30d3c97a8c56efe89f3b2aa9ae564", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "uv2nix": { "inputs": { "nixpkgs": [ @@ -1343,11 +1408,11 @@ "rust-overlay": "rust-overlay_2" }, "locked": { - "lastModified": 1750821680, - "narHash": "sha256-Bu5unTxnqok2RoU5P394Gh0vRaoyI/5xlOOJDF6akrc=", + "lastModified": 1751176151, + "narHash": "sha256-7bK5eoK0ySlct/cbehTrkGcTcSMOLXSnh+RJiswVzEU=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "2e7c318ac2bbf699b6ab92ef91e661e16415dfac", + "rev": "91d463851e24c190cc912471861b5414ac8fe65c", "type": "github" }, "original": { @@ -1376,11 +1441,11 @@ "xwayland-satellite-unstable": { "flake": false, "locked": { - "lastModified": 1750821680, - "narHash": "sha256-Bu5unTxnqok2RoU5P394Gh0vRaoyI/5xlOOJDF6akrc=", + "lastModified": 1751176151, + "narHash": "sha256-7bK5eoK0ySlct/cbehTrkGcTcSMOLXSnh+RJiswVzEU=", "owner": "Supreeeme", "repo": "xwayland-satellite", - "rev": "2e7c318ac2bbf699b6ab92ef91e661e16415dfac", + "rev": "91d463851e24c190cc912471861b5414ac8fe65c", "type": "github" }, "original": { @@ -1419,11 +1484,11 @@ ] }, "locked": { - "lastModified": 1751127508, - "narHash": "sha256-fU2FQKNxO5gkADRFMS2S54M/LKsTewMpGRm+KJRLdFo=", + "lastModified": 1751200680, + "narHash": "sha256-sVep+p1XtL4tpArd1of+8mA3mJ9T0NsHNOCLGKxxRns=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "5962b5db7babbb1607dcd2d1d6db9ab540cc108d", + "rev": "35ba63ea42a57e8470e605b178e5228a29edbcbe", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 74b1853..d2816c0 100644 --- a/flake.nix +++ b/flake.nix @@ -13,6 +13,11 @@ inputs.nixpkgs.follows = "nixpkgs"; }; + envfs = { + url = "github:Mic92/envfs"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + disko = { url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/homes/emenel/dotfiles/dot_local/bin/dim-all-monitors b/homes/emenel/dotfiles/dot_local/bin/dim-all-monitors index 11ae5a3..ecf7950 100755 --- a/homes/emenel/dotfiles/dot_local/bin/dim-all-monitors +++ b/homes/emenel/dotfiles/dot_local/bin/dim-all-monitors @@ -1,3 +1,3 @@ -#!/bin/sh -brillo -e -O -brillo -e -u 150000 -S 15 +#!/usr/bin/env sh +/run/current-system/sw/bin/brillo -e -O +/run/current-system/sw/bin/brillo -e -u 150000 -S 15 diff --git a/homes/emenel/dotfiles/dot_local/bin/lock-power-off-monitors b/homes/emenel/dotfiles/dot_local/bin/lock-power-off-monitors index 69a4956..e069ef4 100755 --- a/homes/emenel/dotfiles/dot_local/bin/lock-power-off-monitors +++ b/homes/emenel/dotfiles/dot_local/bin/lock-power-off-monitors @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env sh niri msg action power-off-monitors diff --git a/homes/emenel/dotfiles/dot_local/bin/lock-suspend b/homes/emenel/dotfiles/dot_local/bin/lock-suspend index 6dba79c..d897846 100755 --- a/homes/emenel/dotfiles/dot_local/bin/lock-suspend +++ b/homes/emenel/dotfiles/dot_local/bin/lock-suspend @@ -1,2 +1,2 @@ -#!/bin/sh -systemctl suspend +#!/usr/bin/env sh +/run/current-system/sw/bin/systemctl suspend diff --git a/homes/emenel/dotfiles/dot_local/bin/mirror-laptop b/homes/emenel/dotfiles/dot_local/bin/mirror-laptop index 4751175..f308cc6 100755 --- a/homes/emenel/dotfiles/dot_local/bin/mirror-laptop +++ b/homes/emenel/dotfiles/dot_local/bin/mirror-laptop @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env sh wl-present mirror eDP-1 diff --git a/homes/emenel/dotfiles/dot_local/bin/niri-delayed-launch-at-startup b/homes/emenel/dotfiles/dot_local/bin/niri-delayed-launch-at-startup index 50ea852..611d7d1 100755 --- a/homes/emenel/dotfiles/dot_local/bin/niri-delayed-launch-at-startup +++ b/homes/emenel/dotfiles/dot_local/bin/niri-delayed-launch-at-startup @@ -1,3 +1,3 @@ -#!/bin/sh +#!/usr/bin/env sh sleep 10 /etc/profiles/per-user/emenel/bin/filen-desktop diff --git a/homes/emenel/dotfiles/dot_local/bin/niri-screenshot-window b/homes/emenel/dotfiles/dot_local/bin/niri-screenshot-window index 6afe4ec..36d08ad 100755 --- a/homes/emenel/dotfiles/dot_local/bin/niri-screenshot-window +++ b/homes/emenel/dotfiles/dot_local/bin/niri-screenshot-window @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env sh niri msg action screenshot-window --id="$(niri msg --json pick-window | jq .id)" diff --git a/homes/emenel/dotfiles/dot_local/bin/on-unlock b/homes/emenel/dotfiles/dot_local/bin/on-unlock index 0ab7e3e..90c84b7 100755 --- a/homes/emenel/dotfiles/dot_local/bin/on-unlock +++ b/homes/emenel/dotfiles/dot_local/bin/on-unlock @@ -1,2 +1,2 @@ -#!/bin/sh -brillo -e -u 15000 -I +#!/usr/bin/env sh +/run/current-system/sw/bin/brillo -e -u 15000 -I diff --git a/homes/emenel/dotfiles/dot_local/bin/piku b/homes/emenel/dotfiles/dot_local/bin/piku index f7faf0c..1f0a604 100755 --- a/homes/emenel/dotfiles/dot_local/bin/piku +++ b/homes/emenel/dotfiles/dot_local/bin/piku @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh # TODO: support config locations: # ./.piku-server diff --git a/homes/emenel/dotfiles/dot_local/bin/reaper b/homes/emenel/dotfiles/dot_local/bin/reaper index 1bc1ea5..4ee78a2 100755 --- a/homes/emenel/dotfiles/dot_local/bin/reaper +++ b/homes/emenel/dotfiles/dot_local/bin/reaper @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env sh GDK_BACKEND=x11 /etc/profiles/per-user/emenel/bin/reaper diff --git a/homes/emenel/dotfiles/dot_local/bin/session-lock b/homes/emenel/dotfiles/dot_local/bin/session-lock index aa14ed5..ca6a422 100755 --- a/homes/emenel/dotfiles/dot_local/bin/session-lock +++ b/homes/emenel/dotfiles/dot_local/bin/session-lock @@ -1,2 +1,2 @@ -#!/bin/sh -pidof swaylock || swaylock +#!/usr/bin/env sh +/run/current-system/sw/bin/pidof /etc/profiles/per-user/emenel/bin/swaylock || /etc/profiles/per-user/emenel/bin/swaylock diff --git a/homes/emenel/dotfiles/dot_local/bin/wezapp b/homes/emenel/dotfiles/dot_local/bin/wezapp index e12f20a..40e44a8 100755 --- a/homes/emenel/dotfiles/dot_local/bin/wezapp +++ b/homes/emenel/dotfiles/dot_local/bin/wezapp @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env sh wezterm --config-file /home/emenel/.config/wezterm/launcher.lua start --always-new-process "$1" diff --git a/homes/emenel/dotfiles/dot_local/bin/wezappfloat b/homes/emenel/dotfiles/dot_local/bin/wezappfloat index 6c8bd44..ecc93dd 100755 --- a/homes/emenel/dotfiles/dot_local/bin/wezappfloat +++ b/homes/emenel/dotfiles/dot_local/bin/wezappfloat @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env sh wezterm --config-file /home/emenel/.config/wezterm/launcher.lua start --class floatapp --always-new-process "$1" diff --git a/homes/emenel/dotfiles/dot_local/bin/wezlauncher b/homes/emenel/dotfiles/dot_local/bin/wezlauncher index 8cd6882..4993cdb 100755 --- a/homes/emenel/dotfiles/dot_local/bin/wezlauncher +++ b/homes/emenel/dotfiles/dot_local/bin/wezlauncher @@ -1,2 +1,2 @@ -#!/bin/sh +#!/usr/bin/env sh wezterm --config-file /home/emenel/.config/wezterm/launcher.lua start --class launcher --always-new-process "$1" diff --git a/hosts/eddie/configuration.nix b/hosts/eddie/configuration.nix index 87f36fb..6823f08 100644 --- a/hosts/eddie/configuration.nix +++ b/hosts/eddie/configuration.nix @@ -96,6 +96,11 @@ ]; }; + extraOptions = '' + keep-outputs = true + keep-derivations = true + ''; + # registry = { # emenel-templates.flake = inputs.emenel-templates; # }; @@ -274,7 +279,7 @@ clean = { enable = true; dates = "daily"; - extraArgs = "--keep 4"; + extraArgs = "--keep 4 --nogcroots"; }; flake = "/home/emenel/source/nixos-config"; package = pkgs.nh; @@ -296,7 +301,11 @@ ]; }; services.tailscale.enable = true; - services.envfs.enable = true; + + services.envfs = { + enable = true; + extraFallbackPathCommands = "ln -s $''{pkgs.bash}/bin/bash $out/bash"; + }; services.gnome.sushi.enable = true; diff --git a/hosts/eddie/razer-speaker-fix.nix b/hosts/eddie/razer-speaker-fix.nix index 1278aa1..b8cdc60 100644 --- a/hosts/eddie/razer-speaker-fix.nix +++ b/hosts/eddie/razer-speaker-fix.nix @@ -8,7 +8,7 @@ path = [ "/run/current-system/bin/" "/run/current-system/sw/" ]; script = '' -#!/bin/sh +#!/usr/bin/env sh hda-verb /dev/snd/hwC3D0 0x20 0x500 0x7 hda-verb /dev/snd/hwC3D0 0x20 0x500 0x7 hda-verb /dev/snd/hwC3D0 0x20 0x500 0x10 diff --git a/modules/home/file-chooser/yazi-wrapper.sh b/modules/home/file-chooser/yazi-wrapper.sh index ec7f9a1..ee102cb 100755 --- a/modules/home/file-chooser/yazi-wrapper.sh +++ b/modules/home/file-chooser/yazi-wrapper.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/usr/bin/env sh set -ex diff --git a/modules/home/shell-conf.nix b/modules/home/shell-conf.nix index c0b4d7f..1453c5d 100644 --- a/modules/home/shell-conf.nix +++ b/modules/home/shell-conf.nix @@ -90,9 +90,9 @@ ]; programs = { - # bash = { - # enable = true; - # }; + bash = { + enable = true; + }; nix-index = { enable = true; enableFishIntegration = true; diff --git a/modules/home/sway-idle-lock.nix b/modules/home/sway-idle-lock.nix index ea5c7b6..7b4e230 100644 --- a/modules/home/sway-idle-lock.nix +++ b/modules/home/sway-idle-lock.nix @@ -1,4 +1,4 @@ - +{ pkgs, ... }: { services.swayidle = { enable = true; @@ -24,31 +24,31 @@ # battery timers { timeout = 90; - command = "systemd-ac-power || loginctl lock-session"; + command = "${pkgs.systemd}/bin/systemd-ac-power || ${pkgs.systemd}/bin/loginctl lock-session"; } { timeout = 120; - command = "systemd-ac-power || /home/emenel/.local/bin/lock-power-off-monitors"; + command = "${pkgs.systemd}/bin/systemd-ac-power || /home/emenel/.local/bin/lock-power-off-monitors"; } { timeout = 180; - command = "systemd-ac-power || /home/emenel/.local/bin/lock-suspend"; + command = "${pkgs.systemd}/bin/systemd-ac-power || /home/emenel/.local/bin/lock-suspend"; } # ac power timers { timeout = 180; - command = "systemd-ac-power && loginctl lock-session"; + command = "${pkgs.systemd}/bin/systemd-ac-power && ${pkgs.systemd}/bin/loginctl lock-session"; } { timeout = 240; - command = "systemd-ac-power || /home/emenel/.local/bin/lock-power-off-monitors"; + command = "${pkgs.systemd}/bin/systemd-ac-power || /home/emenel/.local/bin/lock-power-off-monitors"; } { timeout = 600; - command = "systemd-ac-power && /home/emenel/.local/bin/lock-suspend"; + command = "${pkgs.systemd}/bin/systemd-ac-power && /home/emenel/.local/bin/lock-suspend"; } ]; @@ -58,11 +58,11 @@ programs.swaylock = { enable = true; settings = { - color = "808080"; - font-size = 24; + color = "000000"; + font-size = 32; indicator-idle-visible = true; - indicator-radius = 100; - line-color = "ffffff"; + indicator-radius = 250; + line-color = "cccccc"; show-failed-attempts = true; }; };