From c37f3fc5e4c0d7616eef5608660a7f30d90a31f4 Mon Sep 17 00:00:00 2001 From: Hadi Date: Wed, 29 Jul 2026 10:32:10 +0200 Subject: [PATCH 1/7] ok Signed-off-by: Hadi --- home/programs/ghostty/default.nix | 11 +- home/programs/nvf/languages.nix | 3 +- home/system/clipboard/default.nix | 10 + home/system/hypridle/default.nix | 31 +++ home/system/hyprland/bindings.nix | 2 +- home/system/hyprland/default.nix | 6 + home/system/swaync/default.nix | 10 +- home/system/tofi/desktop-actions.nix | 185 +++++++++++++++++ home/system/waybar/default.nix | 2 +- home/system/waybar/scripts.nix | 287 ++++++++++++++++++++++++--- home/system/waybar/settings.nix | 3 +- hosts/laptop/home.nix | 4 +- hosts/work/configuration.nix | 3 +- hosts/work/home.nix | 2 + nixos/tuigreet.nix | 4 + todo | 9 - 16 files changed, 517 insertions(+), 55 deletions(-) create mode 100644 home/system/clipboard/default.nix create mode 100644 home/system/hypridle/default.nix diff --git a/home/programs/ghostty/default.nix b/home/programs/ghostty/default.nix index 292d0b2a..3196fda2 100644 --- a/home/programs/ghostty/default.nix +++ b/home/programs/ghostty/default.nix @@ -24,6 +24,9 @@ in { window-padding-x = 10; confirm-close-surface = false; window-padding-y = 10; + # Reuse a single background daemon (started at login, see hyprland exec-once) + # so every window opens instantly instead of cold-starting a new process. + gtk-single-instance = true; clipboard-read = "allow"; clipboard-write = "allow"; copy-on-select = "clipboard"; @@ -31,14 +34,6 @@ in { custom-shader = "${cursorShaders}/cursor_warp.glsl"; custom-shader-animation = "always"; keybind = [ - # "ctrl+j=goto_split:left" - # "ctrl+i=goto_split:up" - # "ctrl+k=goto_split:down" - # "ctrl+l=goto_split:right" - # "shift+ctrl+h=new_split:left" - # "shift+ctrl+j=new_split:down" - # "shift+ctrl+k=new_split:up" - # "shift+ctrl+l=new_split:right" "shift+ctrl+tab=new_tab" ]; }; diff --git a/home/programs/nvf/languages.nix b/home/programs/nvf/languages.nix index efc96f32..3a9b3f20 100644 --- a/home/programs/nvf/languages.nix +++ b/home/programs/nvf/languages.nix @@ -1,4 +1,4 @@ -{...}: { +{pkgs, ...}: { vim = { diagnostics = { enable = true; @@ -25,6 +25,7 @@ context.enable = true; highlight.enable = true; textobjects.enable = true; + grammars = [pkgs.vimPlugins.nvim-treesitter.grammarPlugins.http]; }; lsp = { enable = true; diff --git a/home/system/clipboard/default.nix b/home/system/clipboard/default.nix new file mode 100644 index 00000000..67a3a3af --- /dev/null +++ b/home/system/clipboard/default.nix @@ -0,0 +1,10 @@ +# Clipboard history: cliphist watches the Wayland clipboard and stores every +# entry (text + images) so it can be recalled later via the `clipboard-menu` +# script (tofi). Uses the home-manager module so the watcher services are +# managed the same way as swaync/hypridle. +{...}: { + services.cliphist = { + enable = true; + allowImages = true; + }; +} diff --git a/home/system/hypridle/default.nix b/home/system/hypridle/default.nix new file mode 100644 index 00000000..2de6d479 --- /dev/null +++ b/home/system/hypridle/default.nix @@ -0,0 +1,31 @@ +# hypridle handles idle management: lock the screen, turn the display off, and +# suspend after periods of inactivity. The `caffeine-toggle` script pauses it. +{...}: { + services.hypridle = { + enable = true; + settings = { + general = { + # Avoid starting multiple hyprlock instances. + lock_cmd = "pidof hyprlock || hyprlock"; + before_sleep_cmd = "loginctl lock-session"; + after_sleep_cmd = "hyprctl dispatch dpms on"; + }; + + listener = [ + { + timeout = 300; # 5 min → lock + on-timeout = "loginctl lock-session"; + } + { + timeout = 360; # 6 min → screen off + on-timeout = "hyprctl dispatch dpms off"; + on-resume = "hyprctl dispatch dpms on"; + } + { + timeout = 1800; # 30 min → suspend + on-timeout = "systemctl suspend"; + } + ]; + }; + }; +} diff --git a/home/system/hyprland/bindings.nix b/home/system/hyprland/bindings.nix index 067c50d7..a80c3433 100644 --- a/home/system/hyprland/bindings.nix +++ b/home/system/hyprland/bindings.nix @@ -124,7 +124,7 @@ in { ) # Quick launch - "$mod,RETURN, exec, uwsm app -- ${pkgs.ghostty}/bin/ghostty" # Ghostty (terminal) + "$mod,RETURN, exec, ${pkgs.ghostty}/bin/ghostty +new-window" # Ghostty (terminal, via daemon D-Bus) "$mod,E, exec, uwsm app -- ${pkgs-stable.thunar}/bin/thunar" # Thunar "$mod, SPACE, exec, tofi-drun" # Launcher "$mod, N, exec, swaync-client -t" # Notification center diff --git a/home/system/hyprland/default.nix b/home/system/hyprland/default.nix index 357ccafe..e8b2e634 100644 --- a/home/system/hyprland/default.nix +++ b/home/system/hyprland/default.nix @@ -38,6 +38,7 @@ in { hyprshot hyprpicker swappy + satty imv wf-recorder wlr-randr @@ -61,6 +62,10 @@ in { ",prefered,auto,1" # default ]; + exec-once = [ + "systemctl --user start app-com.mitchellh.ghostty.service" + ]; + env = [ "XDG_CURRENT_DESKTOP,Hyprland" "XDG_SESSION_TYPE,wayland" @@ -118,6 +123,7 @@ in { layerrule = [ "match:namespace launcher, animation popin 70%" + "match:namespace swaync-control-center, animation slide right" ]; windowrule = [ diff --git a/home/system/swaync/default.nix b/home/system/swaync/default.nix index aa7321e6..c4bd77ec 100644 --- a/home/system/swaync/default.nix +++ b/home/system/swaync/default.nix @@ -76,8 +76,8 @@ in { { label = "󰍭"; type = "toggle"; - command = "swayosd-client --input-volume mute-toggle"; - "update-command" = "wpctl get-volume @DEFAULT_SOURCE@ | grep -q MUTED && echo true || echo false"; + command = "mic-mute"; + "update-command" = "mic-status"; } { label = "󰌾"; @@ -111,7 +111,6 @@ in { --border-radius: ${toString rounding}px; --border-radius-s: ${toString gaps-in}px; --border-radius-xl: ${toString (rounding - 2)}px; - --shadow: 2px 4px 10px rgba(0,0,0,0.15); } .notification { padding: 5px; } @@ -210,7 +209,6 @@ in { .control-center .notification-background { background: @center-notification-bg; - box-shadow: var(--shadow); } .control-center .notification-background .close-button, @@ -272,7 +270,6 @@ in { .widget-mpris { border-radius: var(--border-radius); - box-shadow: var(--shadow); } .mpris-overlay { @@ -302,7 +299,6 @@ in { border-radius: var(--border-radius); padding: 10px 15px; background: @background-alt; - box-shadow: var(--shadow); color: @text; } @@ -343,7 +339,6 @@ in { padding: 10px 15px; border-radius: var(--border-radius); background: @background-alt; - box-shadow: var(--shadow); color: @text; } @@ -375,7 +370,6 @@ in { padding: 5px 15px; margin-bottom: 5px; background: @background-alt; - box-shadow: var(--shadow); } .widget-buttons-grid button { diff --git a/home/system/tofi/desktop-actions.nix b/home/system/tofi/desktop-actions.nix index e12c7f28..3e6791a5 100644 --- a/home/system/tofi/desktop-actions.nix +++ b/home/system/tofi/desktop-actions.nix @@ -90,6 +90,116 @@ terminal = false; }; + color-pick = { + name = "Pick Color"; + exec = "color-pick"; + icon = "color-select-symbolic"; + comment = "Pick a screen color to the clipboard"; + categories = ["Utility"]; + terminal = false; + settings.Keywords = "color;picker;hex;eyedropper;"; + }; + + screenshot-region = { + name = "Screenshot Region"; + exec = "hyprshot -m region"; + icon = "screenshot-recorded-symbolic"; + comment = "Capture a selected region"; + categories = ["Utility"]; + terminal = false; + settings.Keywords = "screenshot;capture;region;"; + }; + + screenshot-window = { + name = "Screenshot Window"; + exec = "hyprshot -m window"; + icon = "screenshot-recorded-symbolic"; + comment = "Capture the active window"; + categories = ["Utility"]; + terminal = false; + settings.Keywords = "screenshot;capture;window;"; + }; + + screenshot-screen = { + name = "Screenshot Screen"; + exec = "hyprshot -m output"; + icon = "screenshot-recorded-symbolic"; + comment = "Capture the whole screen"; + categories = ["Utility"]; + terminal = false; + settings.Keywords = "screenshot;capture;screen;monitor;"; + }; + + screenshot-edit = { + name = "Screenshot & Annotate"; + exec = "screenshot-edit"; + icon = "edit-symbolic"; + comment = "Capture a region and open it in Satty"; + categories = ["Utility"]; + terminal = false; + settings.Keywords = "screenshot;annotate;satty;edit;"; + }; + + record-toggle = { + name = "Screen Recording"; + exec = "record-toggle"; + icon = "media-record-symbolic"; + comment = "Start or stop screen recording"; + categories = ["Utility" "AudioVideo"]; + terminal = false; + settings.Keywords = "record;recording;screencast;video;"; + }; + + power-cycle = { + name = "Power Profile"; + exec = "power-cycle"; + icon = "power-profile-balanced-symbolic"; + comment = "Cycle power-saver / balanced / performance"; + categories = ["System"]; + terminal = false; + settings.Keywords = "power;profile;performance;battery;"; + }; + + airplane-toggle = { + name = "Airplane Mode"; + exec = "airplane-toggle"; + icon = "airplane-mode-symbolic"; + comment = "Toggle Wi-Fi and Bluetooth together"; + categories = ["System"]; + terminal = false; + settings.Keywords = "airplane;flight;wifi;bluetooth;offline;"; + }; + + clipboard-menu = { + name = "Clipboard History"; + exec = "clipboard-menu"; + icon = "edit-paste-symbolic"; + comment = "Pick a past clipboard entry"; + categories = ["Utility"]; + terminal = false; + settings.Keywords = "clipboard;history;paste;cliphist;"; + }; + + emoji-picker = { + name = "Emoji Picker"; + exec = "emoji-picker"; + icon = "face-smile-symbolic"; + comment = "Pick an emoji and type it"; + categories = ["Utility"]; + terminal = false; + settings.Keywords = "emoji;emoticon;smiley;symbol;"; + }; + + caffeine-toggle = { + name = "Keep Awake"; + exec = "caffeine-toggle"; + icon = "my-caffeine-on-symbolic"; + comment = "Pause or resume idle locking and suspend"; + categories = ["System"]; + terminal = false; + settings.Keywords = "caffeine;idle;awake;inhibit;suspend;"; + }; + logout = { name = "Logout"; exec = "hyprctl dispatch exit"; @@ -99,6 +209,81 @@ terminal = false; }; + dnd-toggle = { + name = "Do Not Disturb"; + exec = "dnd-toggle"; + icon = "notifications-disabled-symbolic"; + comment = "Toggle Do Not Disturb"; + categories = ["System"]; + terminal = false; + settings.Keywords = "dnd;notifications;disturb;swaync;silence;"; + }; + + vol-mute = { + name = "Mute Volume"; + exec = "vol-mute"; + icon = "audio-volume-muted-symbolic"; + comment = "Toggle output mute"; + categories = ["System"]; + terminal = false; + }; + + vol-up = { + name = "Volume Up"; + exec = "vol-up"; + icon = "audio-volume-high-symbolic"; + comment = "Raise the volume by 5%"; + categories = ["System"]; + terminal = false; + }; + + vol-down = { + name = "Volume Down"; + exec = "vol-down"; + icon = "audio-volume-low-symbolic"; + comment = "Lower the volume by 5%"; + categories = ["System"]; + terminal = false; + }; + + bright-up = { + name = "Brightness Up"; + exec = "bright-up"; + icon = "display-brightness-high-symbolic"; + comment = "Raise the brightness by 5%"; + categories = ["System"]; + terminal = false; + }; + + bright-down = { + name = "Brightness Down"; + exec = "bright-down"; + icon = "display-brightness-low-symbolic"; + comment = "Lower the brightness by 5%"; + categories = ["System"]; + terminal = false; + }; + + output-cycle = { + name = "Cycle Audio Output"; + exec = "output-cycle"; + icon = "audio-speakers-symbolic"; + comment = "Switch to the next audio output"; + categories = ["System"]; + terminal = false; + settings.Keywords = "audio;output;sink;speaker;headphones;"; + }; + + input-cycle = { + name = "Cycle Audio Input"; + exec = "input-cycle"; + icon = "audio-input-microphone-symbolic"; + comment = "Switch to the next audio input"; + categories = ["System"]; + terminal = false; + settings.Keywords = "audio;input;source;microphone;mic;"; + }; + spotatui = { name = "Spotify"; exec = "ghostty -e spotatui"; diff --git a/home/system/waybar/default.nix b/home/system/waybar/default.nix index 357e4c83..27bb342e 100644 --- a/home/system/waybar/default.nix +++ b/home/system/waybar/default.nix @@ -20,7 +20,7 @@ in { iw hyprsunset ] - ++ (with scripts; [vol-up vol-down vol-mute mic-mute bright-up bright-down nightshift-toggle focus-toggle waybar-toggle wifi-toggle bluetooth-toggle]); + ++ (with scripts; [vol-up vol-down vol-mute mic-mute bright-up bright-down nightshift-toggle focus-toggle waybar-toggle wifi-toggle bluetooth-toggle dnd-toggle output-cycle input-cycle color-pick screenshot-edit record-toggle power-cycle airplane-toggle clipboard-menu emoji-picker caffeine-toggle mic-status]); wayland.windowManager.hyprland.settings.exec-once = [ "waybar" diff --git a/home/system/waybar/scripts.nix b/home/system/waybar/scripts.nix index d239ba92..f1928a62 100644 --- a/home/system/waybar/scripts.nix +++ b/home/system/waybar/scripts.nix @@ -31,35 +31,111 @@ OSD_TEXT="󰃠 $BRIGHT%" fi ''; + + # Résout $src : source par défaut, sinon première source disponible. + # Certaines machines n'ont pas de source audio par défaut (@DEFAULT_AUDIO_SOURCE@ non résolu). + micSource = '' + src=$(${pkgs.wireplumber}/bin/wpctl inspect @DEFAULT_AUDIO_SOURCE@ 2>/dev/null | sed -n 's/^id \([0-9]*\),.*/\1/p') + if [ -z "$src" ]; then + src=$(${pkgs.pipewire}/bin/pw-dump | ${pkgs.jq}/bin/jq -r \ + '[.[] | select(.info.props."media.class"=="Audio/Source") | .id] | .[0] // empty') + fi + ''; + + # tofi en mode dmenu vertical : la config globale est un lanceur horizontal de + # 36px de haut, inutilisable pour une liste. On surcharge la géométrie. + tofiMenu = "${pkgs.tofi}/bin/tofi --horizontal false --anchor center --width 700 --height 500 --margin-top 0 --margin-left 0 --margin-right 0 --num-results 10"; in { bluetoothScript = pkgs.writeShellScript "waybar-bluetooth" '' - if bluetoothctl show 2>/dev/null | grep -q "Powered: yes"; then - device=$(bluetoothctl devices Connected 2>/dev/null | head -1 | cut -d' ' -f3-) - if [ -n "$device" ]; then - printf '{"text": "%s", "class": "connected", "tooltip": "Bluetooth\\n %s"}\n' "$device" "$device" - else - printf '{"text": "󰂰", "class": "on", "tooltip": "Bluetooth on"}\n' - fi + jq=${pkgs.jq}/bin/jq + nl=$'\n' + # bluetoothctl bloque sans contrôleur par défaut → toujours borné par timeout. + bt() { timeout 3 ${pkgs.bluez}/bin/bluetoothctl "$@" 2>/dev/null; } + + powered=$(bt show | awk '/Powered:/ { print $2; exit }') + if [ "$powered" != "yes" ]; then + "$jq" -cn '{ text: "󰂲", class: "off", tooltip: "Bluetooth off" }' + exit 0 + fi + + tip="" + add_tip() { tip="''${tip:+$tip$nl}$1"; } + + count=0 + for mac in $(bt devices Connected | awk '{ print $2 }'); do + count=$((count + 1)) + info=$(bt info "$mac") + name=$(printf '%s' "$info" | sed -n 's/^[[:space:]]*Name: //p' | head -1) + [ -z "$name" ] && name="$mac" + batt=$(printf '%s' "$info" | sed -n 's/.*Battery Percentage:.*(\([0-9][0-9]*\)).*/\1/p' | head -1) + add_tip "󰂱 $name''${batt:+ · $batt%}" + done + + if [ "$count" -gt 0 ]; then + "$jq" -cn --arg tooltip "$tip" '{ text: "󰂰", class: "connected", tooltip: $tooltip }' else - printf '{"text": "󰂲", "class": "off", "tooltip": "Bluetooth off"}\n' + "$jq" -cn '{ text: "󰂰", class: "on", tooltip: "Bluetooth on" }' fi ''; networkScript = pkgs.writeShellScript "waybar-network" '' - for iface in $(${pkgs.iproute2}/bin/ip -br link show | awk '$2 == "UP" {print $1}' | grep -vE '^(lo|tun|proton|wg[0-9]|ppp|vpn|docker|br-|veth|virbr)'); do - ip=$(${pkgs.iproute2}/bin/ip addr show "$iface" 2>/dev/null | grep 'inet ' | awk '{print $2}' | cut -d/ -f1 | head -1) - if [ -n "$ip" ]; then - if [[ "$iface" == wl* ]]; then - ssid=$(${pkgs.iw}/bin/iw dev "$iface" link 2>/dev/null | grep SSID | sed 's/.*SSID: //') - signal=$(${pkgs.iw}/bin/iw dev "$iface" link 2>/dev/null | grep signal | awk '{print $2}') - printf '{"text": "󰤨", "class": "wifi", "tooltip": " %s\\n %s dBm"}\n' "$ssid" "$signal" - else - printf '{"text": "󰛳", "class": "ethernet", "tooltip": " %s\\n %s"}\n' "$iface" "$ip" - fi - exit 0 + nmcli=${pkgs.networkmanager}/bin/nmcli + ip=${pkgs.iproute2}/bin/ip + jq=${pkgs.jq}/bin/jq + nl=$'\n' + + text="" + tip="" + class="disconnected" + add_seg() { text="''${text:+$text }$1"; } + add_tip() { tip="''${tip:+$tip$nl}$1"; } + + # ── Ethernet ──────────────────────────────────────────────── + eth=$("$nmcli" -t -f DEVICE,TYPE,STATE device status 2>/dev/null \ + | awk -F: '$2 == "ethernet" && $3 == "connected" { print $1; exit }') + if [ -n "$eth" ]; then + eth_ip=$("$ip" -4 -br addr show "$eth" 2>/dev/null | awk '{ print $3 }' | cut -d/ -f1) + add_seg "󰛳" + class="ethernet" + add_tip "󰛳 Ethernet''${eth_ip:+ · $eth_ip}" + fi + + # ── Wi-Fi ─────────────────────────────────────────────────── + wifi=$("$nmcli" -t -f ACTIVE,SSID,SIGNAL device wifi 2>/dev/null | grep -m1 '^yes:') + if [ -n "$wifi" ]; then + ssid=$(printf '%s' "$wifi" | cut -d: -f2) + signal=$(printf '%s' "$wifi" | cut -d: -f3) + if [ "''${signal:-0}" -ge 80 ]; then icon="󰤨" + elif [ "''${signal:-0}" -ge 60 ]; then icon="󰤥" + elif [ "''${signal:-0}" -ge 40 ]; then icon="󰤢" + elif [ "''${signal:-0}" -ge 20 ]; then icon="󰤟" + else icon="󰤯" fi - done - printf '{"text": "󰤭", "class": "disconnected", "tooltip": "Disconnected"}\n' + add_seg "$icon" + [ "$class" = "disconnected" ] && class="wifi" + add_tip "$icon ''${ssid:-Wi-Fi}''${signal:+ · $signal%}" + fi + + # ── VPN (nmcli, fallback interfaces) ──────────────────────── + vpn=$("$nmcli" -t -f TYPE,NAME connection show --active 2>/dev/null \ + | awk -F: '$1 == "vpn" || $1 == "wireguard" { print $2; exit }') + if [ -z "$vpn" ]; then + vpn=$("$ip" -br link show 2>/dev/null \ + | awk '($2 == "UP" || $2 == "UNKNOWN") && $1 ~ /^(tun|wg|proton|ppp)/ { sub(/@.*/, "", $1); print $1; exit }') + fi + if [ -n "$vpn" ]; then + add_seg "󰦝" + add_tip "󰦝 VPN · $vpn" + fi + + # ── Rien ──────────────────────────────────────────────────── + if [ -z "$text" ]; then + text="󰤭" + tip="Disconnected" + fi + + "$jq" -cn --arg text "$text" --arg class "$class" --arg tooltip "$tip" \ + '{ text: $text, class: $class, tooltip: $tooltip }' ''; vol-up = pkgs.writeShellScriptBin "vol-up" '' @@ -81,8 +157,12 @@ in { ''; mic-mute = pkgs.writeShellScriptBin "mic-mute" '' - ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_SOURCE@ toggle - if ${pkgs.wireplumber}/bin/wpctl get-volume @DEFAULT_SOURCE@ | grep -q MUTED; then + wpctl=${pkgs.wireplumber}/bin/wpctl + ${micSource} + [ -z "$src" ] && exit 0 + + "$wpctl" set-mute "$src" toggle + if "$wpctl" get-volume "$src" | grep -q MUTED; then OSD_TEXT="󰍭 Muted" else OSD_TEXT="󰍬 Live" @@ -90,6 +170,15 @@ in { ${updateOsd} ''; + mic-status = pkgs.writeShellScriptBin "mic-status" '' + ${micSource} + if [ -n "$src" ] && ${pkgs.wireplumber}/bin/wpctl get-volume "$src" | grep -q MUTED; then + echo true + else + echo false + fi + ''; + bright-up = pkgs.writeShellScriptBin "bright-up" '' ${pkgs.brightnessctl}/bin/brightnessctl set 5%+ ${brightGetText} @@ -160,5 +249,157 @@ in { fi ''; + dnd-toggle = pkgs.writeShellScriptBin "dnd-toggle" '' + state=$(${pkgs.swaynotificationcenter}/bin/swaync-client -d) + if [ "$state" = "true" ]; then + OSD_TEXT="󰂛 Do Not Disturb On" + else + OSD_TEXT="󰂚 Do Not Disturb Off" + fi + ${updateOsd} + ''; + + output-cycle = pkgs.writeShellScriptBin "output-cycle" '' + wpctl=${pkgs.wireplumber}/bin/wpctl + jq=${pkgs.jq}/bin/jq + pwdump=${pkgs.pipewire}/bin/pw-dump + + # IDs des sinks dans l'ordre de pw-dump. + ids=($("$pwdump" | "$jq" -r '.[] | select(.info.props."media.class"=="Audio/Sink") | .id')) + n=''${#ids[@]} + [ "$n" -eq 0 ] && exit 0 + + cur=$("$wpctl" inspect @DEFAULT_AUDIO_SINK@ 2>/dev/null | sed -n 's/^id \([0-9]*\),.*/\1/p') + + next_index=0 + for i in "''${!ids[@]}"; do + if [ "''${ids[$i]}" = "$cur" ]; then + next_index=$(( (i + 1) % n )) + break + fi + done + next=''${ids[$next_index]} + + "$wpctl" set-default "$next" + desc=$("$pwdump" | "$jq" -r --argjson id "$next" '.[] | select(.id==$id) | .info.props."node.description"') + OSD_TEXT="󰓃 ''${desc:-Output}" + ${updateOsd} + ''; + + input-cycle = pkgs.writeShellScriptBin "input-cycle" '' + wpctl=${pkgs.wireplumber}/bin/wpctl + jq=${pkgs.jq}/bin/jq + pwdump=${pkgs.pipewire}/bin/pw-dump + + # IDs des sources dans l'ordre de pw-dump. + ids=($("$pwdump" | "$jq" -r '.[] | select(.info.props."media.class"=="Audio/Source") | .id')) + n=''${#ids[@]} + [ "$n" -eq 0 ] && exit 0 + + cur=$("$wpctl" inspect @DEFAULT_AUDIO_SOURCE@ 2>/dev/null | sed -n 's/^id \([0-9]*\),.*/\1/p') + + next_index=0 + for i in "''${!ids[@]}"; do + if [ "''${ids[$i]}" = "$cur" ]; then + next_index=$(( (i + 1) % n )) + break + fi + done + next=''${ids[$next_index]} + + "$wpctl" set-default "$next" + desc=$("$pwdump" | "$jq" -r --argjson id "$next" '.[] | select(.id==$id) | .info.props."node.description"') + OSD_TEXT="󰍬 ''${desc:-Input}" + ${updateOsd} + ''; + + color-pick = pkgs.writeShellScriptBin "color-pick" '' + # hyprpicker -a copie déjà la couleur dans le presse-papier. + color=$(${pkgs.hyprpicker}/bin/hyprpicker -a 2>/dev/null) + if [ -n "$color" ]; then + OSD_TEXT="󰈊 $color" + else + OSD_TEXT="󰈊 Cancelled" + fi + ${updateOsd} + ''; + + screenshot-edit = pkgs.writeShellScriptBin "screenshot-edit" '' + ${pkgs.hyprshot}/bin/hyprshot -m region --raw 2>/dev/null \ + | ${pkgs.satty}/bin/satty --filename - + ''; + + record-toggle = pkgs.writeShellScriptBin "record-toggle" '' + if pgrep -x wf-recorder >/dev/null; then + # -INT laisse wf-recorder finaliser le fichier proprement. + pkill -INT -x wf-recorder + OSD_TEXT="󰕧 Recording saved" + else + dir="$HOME/Videos" + mkdir -p "$dir" + file="$dir/rec-$(date +%Y%m%d-%H%M%S).mp4" + ${pkgs.wf-recorder}/bin/wf-recorder -f "$file" >/dev/null 2>&1 & + OSD_TEXT="󰑊 Recording…" + fi + ${updateOsd} + ''; + + power-cycle = pkgs.writeShellScriptBin "power-cycle" '' + ppd=${pkgs.power-profiles-daemon}/bin/powerprofilesctl + cur=$("$ppd" get) + case "$cur" in + power-saver) next=balanced; icon="󰾅" ;; + balanced) next=performance; icon="󰓅" ;; + performance) next=power-saver; icon="󰌪" ;; + *) next=balanced; icon="󰾅" ;; + esac + "$ppd" set "$next" + OSD_TEXT="$icon ''${next^}" + ${updateOsd} + ''; + + airplane-toggle = pkgs.writeShellScriptBin "airplane-toggle" '' + # Réutilise nmcli + bluetoothctl (sans privilège) plutôt que rfkill. + on=false + nmcli radio wifi 2>/dev/null | grep -q enabled && on=true + bluetoothctl show 2>/dev/null | grep -q "Powered: yes" && on=true + if $on; then + nmcli radio wifi off 2>/dev/null + bluetoothctl power off >/dev/null 2>&1 || true + OSD_TEXT="󰀝 Airplane On" + else + nmcli radio wifi on 2>/dev/null + bluetoothctl power on >/dev/null 2>&1 || true + OSD_TEXT="󰀞 Airplane Off" + fi + ${updateOsd} + ''; + + clipboard-menu = pkgs.writeShellScriptBin "clipboard-menu" '' + ${pkgs.cliphist}/bin/cliphist list \ + | ${tofiMenu} --prompt-text "Clipboard: " \ + | ${pkgs.cliphist}/bin/cliphist decode \ + | ${pkgs.wl-clipboard}/bin/wl-copy + ''; + + emoji-picker = pkgs.writeShellScriptBin "emoji-picker" '' + export PATH="${pkgs.wtype}/bin:${pkgs.wl-clipboard}/bin:$PATH" + export BEMOJI_PICKER_CMD="${tofiMenu} --prompt-text 'emoji: '" + # -t tape l'emoji (wtype), -c le copie aussi. + exec ${pkgs.bemoji}/bin/bemoji -t -c + ''; + + caffeine-toggle = pkgs.writeShellScriptBin "caffeine-toggle" '' + # Met hypridle en pause (reste éveillé) ou le réactive. + if systemctl --user is-active --quiet hypridle; then + systemctl --user stop hypridle + OSD_TEXT="󰅶 Keep Awake On" + else + systemctl --user start hypridle + OSD_TEXT="󰾫 Keep Awake Off" + fi + ${updateOsd} + ''; + # TODO: Run in background } diff --git a/home/system/waybar/settings.nix b/home/system/waybar/settings.nix index be284c8e..0ad43121 100644 --- a/home/system/waybar/settings.nix +++ b/home/system/waybar/settings.nix @@ -1,5 +1,6 @@ { config, + pkgs, networkScript, bluetoothScript, ... @@ -48,7 +49,7 @@ in { "custom/bluetooth" = { exec = "${bluetoothScript}"; - exec-if = "bluetoothctl show 2>/dev/null | grep -q Controller"; + exec-if = "${pkgs.bluez}/bin/bluetoothctl list 2>/dev/null | grep -q Controller"; return-type = "json"; interval = 5; on-click-right = "blueman-manager &"; diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 474e3203..e3a54763 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -15,7 +15,6 @@ ../../home/programs/nix-utils ../../home/programs/spotatui ../../home/programs/yazi - ../../home/programs/desktop-actions # TODO: ../../home/programs/group/basic-apps.nix ../../home/programs/group/cybersecurity.nix @@ -27,10 +26,11 @@ ../../home/system/hyprland ../../home/system/waybar ../../home/system/swaync - ../../home/system/swayosd ../../home/system/tofi ../../home/system/mime ../../home/system/udiskie + ../../home/system/clipboard + ../../home/system/hypridle ./variables.nix # Mostly user-specific configuration ./secrets # CHANGEME: You should probably remove this line, this is where I store my secrets diff --git a/hosts/work/configuration.nix b/hosts/work/configuration.nix index 438e88f2..3c984518 100644 --- a/hosts/work/configuration.nix +++ b/hosts/work/configuration.nix @@ -11,6 +11,7 @@ ../../nixos/users.nix ../../nixos/utils.nix ../../nixos/hyprland.nix + ../../nixos/docker.nix ../../home/programs/helium/system.nix # I hate browser's configuration.. # You should let those lines as is @@ -28,9 +29,9 @@ services.usbguard.rules = '' allow id 1d6b:0002 serial "0000:00:14.0" name "xHCI Host Controller" hash "jEP/6WzviqdJ5VSeTUY8PatCNBKeaREvo2OqdplND/o=" parent-hash "rV9bfLq7c2eA4tYjVjwO4bxhm+y6GgZpl9J60L0fBkY=" with-interface 09:00:00 with-connect-type "" allow id 1d6b:0003 serial "0000:00:14.0" name "xHCI Host Controller" hash "prM+Jby/bFHCn2lNjQdAMbgc6tse3xVx+hZwjOPHSdQ=" parent-hash "rV9bfLq7c2eA4tYjVjwO4bxhm+y6GgZpl9J60L0fBkY=" with-interface 09:00:00 with-connect-type "" - allow id 17ef:608d serial "" name "Lenovo USB Optical Mouse" hash "klpDZuv1jhWGNqZLOl+KXF+75Ir3PfBm6D6ncjoLRBU=" parent-hash "jEP/6WzviqdJ5VSeTUY8PatCNBKeaREvo2OqdplND/o=" via-port "1-7" with-interface 03:01:02 with-connect-type "hotplug" allow id 17ef:6190 serial "" name "Lenovo Calliope USB Keyboard G2" hash "CfZ9R/aoXGm7BN/ojVEzKQwVoxCUtRWMuACrE7BL/5Y=" parent-hash "jEP/6WzviqdJ5VSeTUY8PatCNBKeaREvo2OqdplND/o=" via-port "1-10" with-interface { 03:01:01 03:00:00 } with-connect-type "hotplug" allow id 0781:5581 name " SanDisk 3.2Gen1" + allow id 17ef:608d name "Lenovo USB Optical Mouse" ''; networking.firewall.allowedTCPPorts = [9001]; diff --git a/hosts/work/home.nix b/hosts/work/home.nix index 875904e7..72c3ab39 100644 --- a/hosts/work/home.nix +++ b/hosts/work/home.nix @@ -27,6 +27,8 @@ ../../home/system/tofi ../../home/system/mime ../../home/system/udiskie + ../../home/system/clipboard + ../../home/system/hypridle ./variables.nix # Mostly user-specific configuration ./secrets # CHANGEME: You should probably remove this line, this is where I store my secrets diff --git a/nixos/tuigreet.nix b/nixos/tuigreet.nix index 126b02b9..23197276 100644 --- a/nixos/tuigreet.nix +++ b/nixos/tuigreet.nix @@ -47,6 +47,10 @@ in { # literally no documentation about this anywhere. # might be good to write about this... # https://www.reddit.com/r/NixOS/comments/u0cdpi/tuigreet_with_xmonad_how/ + # Unlock the gnome-keyring with the login password so apps (browser + # secrets via libsecret, ProtonVPN credentials, …) don't reprompt. + security.pam.services.greetd.enableGnomeKeyring = true; + systemd.services.greetd.serviceConfig = { Type = "idle"; StandardInput = "tty"; diff --git a/todo b/todo index 057aaa95..9f50e7fe 100644 --- a/todo +++ b/todo @@ -1,12 +1,3 @@ -- [ ] Configuration waybar -- [ ] Configuration sway-nc -- [ ] Configuration sway-osd -- [ ] Configuration hyprlock -- [x] Gaming/Focus mode -- [ ] Configuration Rofi/Drun -- [ ] Helium plus rapide ? service/deamon ? -- [ ] Ghostty service/deamon ? -- [ ] Tofi service/deamon ? - [ ] Clean files - [ ] NVF dans Nur - [ ] Check claude: Sécu, mots en français, faute, ... From 9cef5b8f76f327dc46a9bde48a9d4f852756dfea Mon Sep 17 00:00:00 2001 From: Hadi Date: Wed, 29 Jul 2026 10:33:31 +0200 Subject: [PATCH 2/7] docs: spec for reusable NVF flake Co-Authored-By: Claude Opus 4.8 --- .../2026-07-29-nvf-reusable-flake-design.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 docs/superpowers/specs/2026-07-29-nvf-reusable-flake-design.md diff --git a/docs/superpowers/specs/2026-07-29-nvf-reusable-flake-design.md b/docs/superpowers/specs/2026-07-29-nvf-reusable-flake-design.md new file mode 100644 index 00000000..6937fee2 --- /dev/null +++ b/docs/superpowers/specs/2026-07-29-nvf-reusable-flake-design.md @@ -0,0 +1,134 @@ +# NVF config en flake réutilisable + +**Date:** 2026-07-29 +**Statut:** Approuvé (design) + +## Objectif + +Permettre à n'importe qui de réutiliser la configuration NVF (Neovim via +[nvf](https://github.com/notashelf/nvf)) de ce dépôt, de deux façons : + +1. **`nix run`** — lancer le nvim standalone sans home-manager. +2. **Module home-manager** — importer un module dans sa propre config, qui + s'adapte automatiquement à *son* thème stylix. + +Le tout sans traîner les inputs lourds du monorepo (nixarr, blog, +awesome-wallpapers, etc.), et en supportant Linux **et** macOS. + +## État actuel + +- `home/programs/nvf/flake.nix` n'est **pas** un vrai flake : c'est une fonction + `{ inputs, pkgs, system, ... }` fusionnée dans les outputs du flake racine via + `import ./home/programs/nvf/flake.nix args`. +- Elle expose déjà `packages..nvim`, `apps..nvim` et + `homeManagerModules.nvim`, mais : + - uniquement pour `x86_64-linux` (system codé en dur) ; + - `homeManagerModules.nvim` importe `default.nix`, qui **exige `inputs`** + (via `inputs.nvf...`) — un tiers devrait le fournir lui-même ; + - un tiers qui consomme le flake racine tire **tous** les inputs lourds. +- Les hosts consomment nvf en important **directement le dossier** + (`imports = [ ../../home/programs/nvf ]` → `default.nix`), `inputs` venant des + `extraSpecialArgs` du monorepo. `homeManagerModules.nvim` n'est donc **pas** + utilisé en interne aujourd'hui. +- `default.nix` référence `config.lib.stylix.colors` **sans garde** → un + consommateur sans stylix aurait une erreur d'évaluation. + +## Design + +### 1. `home/programs/nvf/flake.nix` → vrai flake + +Remplace la fonction actuelle. Inputs minimaux, outputs multi-systèmes. + +- `inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"` (stable) +- `inputs.nvf.url = "github:notashelf/nvf"` +- Systèmes : `x86_64-linux`, `aarch64-linux`, `aarch64-darwin`, `x86_64-darwin` + via un helper `forAllSystems` (`nixpkgs.lib.genAttrs`). +- Liste de modules partagée : `options.nix`, `languages.nix`, `picker.nix`, + `snacks.nix`, `keymaps.nix`, `utils.nix`, `mini.nix`. + +Outputs : + +- `packages..nvim` (+ `.default`) = `(nvf.lib.neovimConfiguration { inherit pkgs modules; }).neovim` +- `apps..nvim` (+ `.default`) pointant vers `${nvim}/bin/nvim` +- `homeManagerModules.nvim` (+ `.default`) : + `{ imports = [ nvf.homeManagerModules.default ./default.nix ]; }` + — `nvf` capturé depuis les inputs **du flake**, donc le tiers n'a rien à fournir. +- `formatter.` = `pkgs.alejandra` + +### 2. `home/programs/nvf/default.nix` — découplé + garde stylix + +- Signature : `{ config, lib, ... }` — plus de `inputs`. +- Retirer `imports = [ inputs.nvf.homeManagerModules.default ]` (désormais dans + le wrapper `homeManagerModules.nvim` du flake). +- Rendre l'override stylix conditionnel : + + ```nix + vim.luaConfigRC = lib.mkIf (config ? stylix && config.stylix.enable) { + hl-overrides = let c = config.lib.stylix.colors; in '' ... ''; + }; + ``` + + - Avec stylix → nvim prend la palette du consommateur. + - Sans stylix → nvim marche, thème natif nvf. + +### 3. Flake racine (`flake.nix`) + +- Ajouter l'input : + + ```nix + nvf-config = { + url = "path:./home/programs/nvf"; + inputs.nixpkgs.follows = "nixpkgs-stable"; + inputs.nvf.follows = "nvf"; + }; + ``` + +- Retirer la ligne `(import ./home/programs/nvf/flake.nix args)` du `merge`. +- Ré-exposer, pour garder `nix run .#nvim` depuis la racine : + + ```nix + packages.${system}.nvim = inputs.nvf-config.packages.${system}.nvim; + apps.${system}.nvim = inputs.nvf-config.apps.${system}.nvim; + ``` + +### 4. Hosts + +`hosts/laptop/home.nix`, `hosts/work/home.nix`, `hosts/server/home.nix` : + +```nix +# avant +imports = [ ../../home/programs/nvf ]; +# après +imports = [ inputs.nvf-config.homeManagerModules.default ]; +``` + +Toi et les tiers utilisez ainsi exactement le même module. + +## Locks + +Deux `flake.lock` distincts : racine + `home/programs/nvf/flake.lock`. + +| Contexte | Lock qui fait foi | +|----------|-------------------| +| Toi, via le monorepo (`follows`) | Lock **racine** ; le lock du sous-flake est ignoré. | +| Tiers, `github:.../nixos?dir=home/programs/nvf` | Lock du **sous-flake**. | +| `nix run ./home/programs/nvf#nvim` | Lock du sous-flake. | + +**Friction connue :** le `path:` input est épinglé dans le lock racine. Après +édition de la config nvim, faire `nix flake update nvf-config` (ou +`--update-input nvf-config`) pour que le monorepo reprenne les changements. + +## Décisions clés (YAGNI) + +- **Flake dédié dans le monorepo** (pas dépôt séparé) — source unique, pas de + synchro à gérer. +- **Garde stylix optionnelle** plutôt qu'exigence dure — coût nul, évite un + footgun pour les tiers non-stylixés. +- **Multi-système** — trivial via `genAttrs`, permet l'usage sur macOS. + +## Vérification + +- `nix flake check ./home/programs/nvf` +- `nix run ./home/programs/nvf#nvim` (lance nvim standalone) +- `nix flake check` à la racine +- Rebuild d'un host (ex. laptop) sans régression nvim, thème stylix conservé. From 835114e5c93737ff03b34a9dca092ad55e806d1d Mon Sep 17 00:00:00 2001 From: Hadi Date: Wed, 29 Jul 2026 11:23:19 +0200 Subject: [PATCH 3/7] oui Signed-off-by: Hadi --- .gitignore | 1 + flake.lock | 20 +++++ flake.nix | 8 +- home/programs/nvf/default.nix | 30 ++++---- home/programs/nvf/flake.lock | 133 ++++++++++++++++++++++++++++++++++ home/programs/nvf/flake.nix | 66 +++++++++++------ hosts/laptop/home.nix | 8 +- hosts/server/home.nix | 8 +- hosts/work/home.nix | 8 +- 9 files changed, 237 insertions(+), 45 deletions(-) create mode 100644 home/programs/nvf/flake.lock diff --git a/.gitignore b/.gitignore index 1be5a966..fd137b02 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .sops.yaml .claude/ old/ +docs/superpowers/ diff --git a/flake.lock b/flake.lock index 91e426ca..ffd94547 100644 --- a/flake.lock +++ b/flake.lock @@ -872,6 +872,25 @@ "type": "github" } }, + "nvf-config": { + "inputs": { + "nixpkgs": [ + "nixpkgs-stable" + ], + "nvf": [ + "nvf" + ] + }, + "locked": { + "path": "./home/programs/nvf", + "type": "path" + }, + "original": { + "path": "./home/programs/nvf", + "type": "path" + }, + "parent": [] + }, "root": { "inputs": { "awesome-wallpapers": "awesome-wallpapers", @@ -888,6 +907,7 @@ "notashelf-tuigreet": "notashelf-tuigreet", "nur": "nur", "nvf": "nvf", + "nvf-config": "nvf-config", "sops-nix": "sops-nix", "stylix": "stylix" } diff --git a/flake.nix b/flake.nix index 3170a61e..e1eda39b 100644 --- a/flake.nix +++ b/flake.nix @@ -10,6 +10,11 @@ nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-26.05"; nixos-hardware.url = "github:NixOS/nixos-hardware"; nvf.url = "github:notashelf/nvf"; + nvf-config = { + url = "path:./home/programs/nvf"; + inputs.nixpkgs.follows = "nixpkgs-stable"; + inputs.nvf.follows = "nvf"; + }; nur = { url = "github:nix-community/nur"; inputs.nixpkgs.follows = "nixpkgs"; @@ -66,11 +71,12 @@ merge = nixpkgs.lib.foldl nixpkgs.lib.recursiveUpdate {}; in merge [ - (import ./home/programs/nvf/flake.nix args) (import ./home/programs/group/flake.nix args) (import ./home/programs/nixy/flake.nix args) { formatter.${system} = pkgs.alejandra; + packages.${system}.nvim = inputs.nvf-config.packages.${system}.nvim; + apps.${system}.nvim = inputs.nvf-config.apps.${system}.nvim; nixosConfigurations = { h-laptop = import ./hosts/laptop/flake.nix args; h-work = import ./hosts/work/flake.nix args; diff --git a/home/programs/nvf/default.nix b/home/programs/nvf/default.nix index d0acf432..2900bac7 100644 --- a/home/programs/nvf/default.nix +++ b/home/programs/nvf/default.nix @@ -1,12 +1,8 @@ { - inputs, config, + lib, ... -}: let - c = config.lib.stylix.colors; -in { - imports = [inputs.nvf.homeManagerModules.default]; - +}: { home.sessionVariables = { EDITOR = "nvim"; }; @@ -14,15 +10,19 @@ in { programs.nvf = { enable = true; settings = { - vim.luaConfigRC.hl-overrides = '' - local function apply_hl() - vim.api.nvim_set_hl(0, "MiniStarterHeader", { fg = "#${c.base0D}", bold = true }) - vim.api.nvim_set_hl(0, "SnacksPickerBorder", { fg = "#${c.base0D}" }) - vim.api.nvim_set_hl(0, "SnacksPickerTitle", { fg = "#${c.base0D}", bold = true }) - end - apply_hl() - vim.api.nvim_create_autocmd("ColorScheme", { pattern = "*", callback = apply_hl }) - ''; + vim.luaConfigRC = lib.mkIf (config ? stylix && config.stylix.enable) { + hl-overrides = let + c = config.lib.stylix.colors; + in '' + local function apply_hl() + vim.api.nvim_set_hl(0, "MiniStarterHeader", { fg = "#${c.base0D}", bold = true }) + vim.api.nvim_set_hl(0, "SnacksPickerBorder", { fg = "#${c.base0D}" }) + vim.api.nvim_set_hl(0, "SnacksPickerTitle", { fg = "#${c.base0D}", bold = true }) + end + apply_hl() + vim.api.nvim_create_autocmd("ColorScheme", { pattern = "*", callback = apply_hl }) + ''; + }; imports = [ ./options.nix ./languages.nix diff --git a/home/programs/nvf/flake.lock b/home/programs/nvf/flake.lock new file mode 100644 index 00000000..c82848e8 --- /dev/null +++ b/home/programs/nvf/flake.lock @@ -0,0 +1,133 @@ +{ + "nodes": { + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1777699697, + "narHash": "sha256-Eg9b/rq/ECYwNwEXs5i9wHyhxNI0JrYx2srdI2uZMaQ=", + "ref": "refs/heads/main", + "rev": "382052b74656a369c5408822af3f2501e9b1af81", + "revCount": 94, + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + }, + "original": { + "type": "git", + "url": "https://git.lix.systems/lix-project/flake-compat.git" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "nvf", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1778716662, + "narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "mnw": { + "locked": { + "lastModified": 1780772958, + "narHash": "sha256-VKKe8r4pwCGWZ3Yr9CPN129R4S3CKLSrlYqdYz3vKpM=", + "owner": "Gerg-L", + "repo": "mnw", + "rev": "0871dbf63a53610c95db04439ed8ea4d6ec9c160", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "mnw", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1785133411, + "narHash": "sha256-Yjv0WEg39KRYS0rBdTbu6Fc/or/ihAKk13W9sQ6VWd0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2f5a153c270b70cb0f8c11f46d96d6d3bc39f4e3", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-26.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1781216227, + "narHash": "sha256-9mUW6gNwoN2SWc/l0fW4svPNOulXLl8ijqKyeSOGgJE=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "a0374025a863d007d98e3297f6aa46cc3141c2f0", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-26.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nvf": { + "inputs": { + "flake-compat": "flake-compat", + "flake-parts": "flake-parts", + "mnw": "mnw", + "nixpkgs": "nixpkgs_2", + "systems": "systems" + }, + "locked": { + "lastModified": 1781997110, + "narHash": "sha256-6D6xtYN5t1kZGNd69eMZsRBkgX5Df1roErn/kFR1C+A=", + "owner": "notashelf", + "repo": "nvf", + "rev": "320f60b97075a58d38b90fc5e39f478421dbd38a", + "type": "github" + }, + "original": { + "owner": "notashelf", + "repo": "nvf", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "nvf": "nvf" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/home/programs/nvf/flake.nix b/home/programs/nvf/flake.nix index b9fdd4f8..bd1198c6 100644 --- a/home/programs/nvf/flake.nix +++ b/home/programs/nvf/flake.nix @@ -1,11 +1,19 @@ { - inputs, - pkgs, - system, - ... -}: let - nvimConfig = inputs.nvf.lib.neovimConfiguration { - inherit pkgs; + description = "Hadi's NVF Neovim configuration"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"; + nvf.url = "github:notashelf/nvf"; + }; + + outputs = { + self, + nixpkgs, + nvf, + ... + }: let + systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"]; + forAllSystems = f: nixpkgs.lib.genAttrs systems f; modules = [ ./options.nix ./languages.nix @@ -15,23 +23,35 @@ ./utils.nix ./mini.nix ]; - }; -in { - packages.${system}.nvim = nvimConfig.neovim; + in { + packages = forAllSystems (system: let + pkgs = nixpkgs.legacyPackages.${system}; + nvim = (nvf.lib.neovimConfiguration {inherit pkgs modules;}).neovim; + in { + inherit nvim; + default = nvim; + }); - apps.${system}.nvim = { - type = "app"; - program = "${nvimConfig.neovim}/bin/nvim"; - }; - defaultApp.${system} = { - type = "app"; - program = "${nvimConfig.neovim}/bin/nvim"; - }; + apps = forAllSystems (system: let + nvim = { + type = "app"; + program = "${self.packages.${system}.nvim}/bin/nvim"; + }; + in { + inherit nvim; + default = nvim; + }); - homeManagerModules.nvim = { - imports = [ - inputs.nvf.homeManagerModules.default - ./default.nix - ]; + homeManagerModules = rec { + nvim = { + imports = [ + nvf.homeManagerModules.default + ./default.nix + ]; + }; + default = nvim; + }; + + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); }; } diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index e3a54763..45699f65 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -1,11 +1,15 @@ -{config, ...}: { +{ + config, + inputs, + ... +}: { imports = [ # Programs ../../home/programs/helium ../../home/programs/proton ../../home/programs/proton/auto-start-vpn.nix ../../home/programs/ghostty - ../../home/programs/nvf + inputs.nvf-config.homeManagerModules.default ../../home/programs/shell ../../home/programs/git ../../home/programs/git/lazygit.nix diff --git a/hosts/server/home.nix b/hosts/server/home.nix index 5eafaa16..5254b9a1 100644 --- a/hosts/server/home.nix +++ b/hosts/server/home.nix @@ -1,10 +1,14 @@ -{config, ...}: { +{ + config, + inputs, + ... +}: { imports = [ # Mostly user-specific configuration ./variables.nix # Programs - ../../home/programs/nvf + inputs.nvf-config.homeManagerModules.default ../../home/programs/shell ../../home/programs/git ../../home/programs/git/lazygit.nix diff --git a/hosts/work/home.nix b/hosts/work/home.nix index 72c3ab39..d9aec79d 100644 --- a/hosts/work/home.nix +++ b/hosts/work/home.nix @@ -1,10 +1,14 @@ -{config, ...}: { +{ + config, + inputs, + ... +}: { imports = [ # Programs + inputs.nvf-config.homeManagerModules.default ../../home/programs/proton ../../home/programs/helium ../../home/programs/ghostty - ../../home/programs/nvf ../../home/programs/shell ../../home/programs/git ../../home/programs/git/lazygit.nix From 0d901aa10c7b2dbb9abf5b8ec259f1c09ff4e457 Mon Sep 17 00:00:00 2001 From: Hadi Date: Wed, 29 Jul 2026 13:14:27 +0200 Subject: [PATCH 4/7] t Signed-off-by: Hadi --- .github/assets/README_template.md | 1 - .gitignore | 1 + docs/GROUPS.md | 44 ------ .../2026-07-29-nvf-reusable-flake-design.md | 134 ------------------ flake.lock | 4 +- flake.nix | 5 +- home/programs/ghostty/default.nix | 61 -------- home/programs/group/dev-packages.nix | 17 --- home/programs/group/dev.nix | 15 +- home/programs/group/flake.nix | 21 --- home/programs/group/misc.nix | 11 -- .../{ => gui}/helium/bookmarks/default.nix | 0 .../helium/bookmarks/entertainment.nix | 0 .../{ => gui}/helium/bookmarks/general.nix | 0 .../{ => gui}/helium/bookmarks/infosec.nix | 0 .../{ => gui}/helium/bookmarks/jack.nix | 0 .../{ => gui}/helium/bookmarks/other.nix | 0 .../{ => gui}/helium/bookmarks/tools.nix | 0 home/programs/{ => gui}/helium/default.nix | 4 +- home/programs/{ => gui}/helium/system.nix | 0 home/programs/gui/pkgs.nix | 16 +++ .../{ => gui}/proton/auto-start-vpn.nix | 0 home/programs/{ => gui}/proton/default.nix | 0 home/programs/{ => gui}/thunar/default.nix | 0 home/programs/tui/ghostty/default.nix | 40 ++++++ home/programs/{ => tui}/git/default.nix | 5 +- home/programs/{ => tui}/git/lazygit.nix | 0 home/programs/{ => tui}/git/signing.nix | 0 home/programs/tui/ilovetui/default.nix | 23 +++ home/programs/{ => tui}/nix-utils/default.nix | 0 home/programs/{ => tui}/nixy/default.nix | 0 home/programs/{ => tui}/nixy/flake.nix | 0 home/programs/{ => tui}/nixy/package.nix | 0 home/programs/{ => tui}/nvf/default.nix | 0 home/programs/{ => tui}/nvf/flake.lock | 0 home/programs/{ => tui}/nvf/flake.nix | 0 home/programs/{ => tui}/nvf/keymaps.nix | 0 home/programs/{ => tui}/nvf/languages.nix | 0 home/programs/{ => tui}/nvf/mini.nix | 0 home/programs/{ => tui}/nvf/options.nix | 0 home/programs/{ => tui}/nvf/picker.nix | 0 home/programs/{ => tui}/nvf/snacks.nix | 0 home/programs/{ => tui}/nvf/utils.nix | 0 .../{group/basic-apps.nix => tui/pkgs.nix} | 22 ++- home/programs/{ => tui}/shell/default.nix | 0 home/programs/{ => tui}/shell/direnv.nix | 0 home/programs/{ => tui}/shell/eza.nix | 0 home/programs/{ => tui}/shell/fzf.nix | 0 home/programs/{ => tui}/shell/starship.nix | 0 home/programs/{ => tui}/shell/zoxide.nix | 0 home/programs/{ => tui}/shell/zsh.nix | 4 +- home/programs/{ => tui}/spotatui/default.nix | 0 home/programs/{ => tui}/yazi/default.nix | 0 home/system/swaync/default.nix | 10 ++ home/system/waybar/scripts.nix | 20 ++- home/system/waybar/settings.nix | 6 +- hosts/laptop/configuration.nix | 2 +- hosts/laptop/home.nix | 38 ++--- hosts/laptop/secrets/default.nix | 1 - hosts/laptop/variables.nix | 2 + hosts/server/hardware-configuration.nix | 2 +- hosts/work/configuration.nix | 4 +- hosts/work/home.nix | 35 +++-- hosts/work/secrets/default.nix | 1 - hosts/work/variables.nix | 2 + nixos/docker.nix | 3 +- nixos/hyprland.nix | 7 + nixos/nvidia.nix | 2 - nixos/omen.nix | 10 +- todo | 7 +- 70 files changed, 206 insertions(+), 374 deletions(-) delete mode 100644 docs/GROUPS.md delete mode 100644 docs/superpowers/specs/2026-07-29-nvf-reusable-flake-design.md delete mode 100644 home/programs/ghostty/default.nix delete mode 100644 home/programs/group/dev-packages.nix delete mode 100644 home/programs/group/flake.nix delete mode 100644 home/programs/group/misc.nix rename home/programs/{ => gui}/helium/bookmarks/default.nix (100%) rename home/programs/{ => gui}/helium/bookmarks/entertainment.nix (100%) rename home/programs/{ => gui}/helium/bookmarks/general.nix (100%) rename home/programs/{ => gui}/helium/bookmarks/infosec.nix (100%) rename home/programs/{ => gui}/helium/bookmarks/jack.nix (100%) rename home/programs/{ => gui}/helium/bookmarks/other.nix (100%) rename home/programs/{ => gui}/helium/bookmarks/tools.nix (100%) rename home/programs/{ => gui}/helium/default.nix (98%) rename home/programs/{ => gui}/helium/system.nix (100%) create mode 100644 home/programs/gui/pkgs.nix rename home/programs/{ => gui}/proton/auto-start-vpn.nix (100%) rename home/programs/{ => gui}/proton/default.nix (100%) rename home/programs/{ => gui}/thunar/default.nix (100%) create mode 100644 home/programs/tui/ghostty/default.nix rename home/programs/{ => tui}/git/default.nix (85%) rename home/programs/{ => tui}/git/lazygit.nix (100%) rename home/programs/{ => tui}/git/signing.nix (100%) create mode 100644 home/programs/tui/ilovetui/default.nix rename home/programs/{ => tui}/nix-utils/default.nix (100%) rename home/programs/{ => tui}/nixy/default.nix (100%) rename home/programs/{ => tui}/nixy/flake.nix (100%) rename home/programs/{ => tui}/nixy/package.nix (100%) rename home/programs/{ => tui}/nvf/default.nix (100%) rename home/programs/{ => tui}/nvf/flake.lock (100%) rename home/programs/{ => tui}/nvf/flake.nix (100%) rename home/programs/{ => tui}/nvf/keymaps.nix (100%) rename home/programs/{ => tui}/nvf/languages.nix (100%) rename home/programs/{ => tui}/nvf/mini.nix (100%) rename home/programs/{ => tui}/nvf/options.nix (100%) rename home/programs/{ => tui}/nvf/picker.nix (100%) rename home/programs/{ => tui}/nvf/snacks.nix (100%) rename home/programs/{ => tui}/nvf/utils.nix (100%) rename home/programs/{group/basic-apps.nix => tui/pkgs.nix} (75%) rename home/programs/{ => tui}/shell/default.nix (100%) rename home/programs/{ => tui}/shell/direnv.nix (100%) rename home/programs/{ => tui}/shell/eza.nix (100%) rename home/programs/{ => tui}/shell/fzf.nix (100%) rename home/programs/{ => tui}/shell/starship.nix (100%) rename home/programs/{ => tui}/shell/zoxide.nix (100%) rename home/programs/{ => tui}/shell/zsh.nix (97%) rename home/programs/{ => tui}/spotatui/default.nix (100%) rename home/programs/{ => tui}/yazi/default.nix (100%) diff --git a/.github/assets/README_template.md b/.github/assets/README_template.md index d08e74a3..b083562e 100644 --- a/.github/assets/README_template.md +++ b/.github/assets/README_template.md @@ -120,7 +120,6 @@ sudo nixos-rebuild switch --flake ~/.config/nixos#yourhostname - [WALLPAPERS](https://github.com/anotherhadi/awesome-wallpapers): An awesome collection of wallpapers - [NEOVIM](docs/NEOVIM.md): How to use the Neovim config in your own flake -- [GROUPS](docs/GROUPS.md): Reusable package groups (dev, cybersecurity) - [CONTRIBUTING](docs/CONTRIBUTING.md): How to contribute - [LICENSE](LICENSE): MIT License diff --git a/.gitignore b/.gitignore index fd137b02..885944c2 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .claude/ old/ docs/superpowers/ +.superpowers/ diff --git a/docs/GROUPS.md b/docs/GROUPS.md deleted file mode 100644 index a8b6ac48..00000000 --- a/docs/GROUPS.md +++ /dev/null @@ -1,44 +0,0 @@ -# Groups - -Groups are curated sets of packages exposed as flake outputs. Each group has two forms: - -- **`homeManagerModules.`** — full home-manager module (packages + files + systemd units) -- **`packages.`** — standalone environment for `nix shell` (packages only) - -## Available groups - -- dev (go, bun, air, ...) -- cybersecurity (nmap, john, dirb, ffuf, ...) - -For the Cybersecurity group, the home-manager module also sets up: - -- `~/Cyber/wordlists/` with SecLists, fuzz4bounty, and hashcat rules -- `~/Cyber/tmp/` as a temporary workspace - -## Use in another flake - -Add this repo as an input: - -```nix -inputs.nixy.url = "github:anotherhadi/nixy"; -``` - -Import the home-manager module in your home configuration: - -```nix -{ inputs, ... }: { - imports = [ - inputs.nixy.homeManagerModules.cybersecurity - # inputs.nixy.homeManagerModules.dev - ]; -} -``` - -## Quick shell without installing - -```sh -nix shell github:anotherhadi/nixy#cybersecurity -nix shell github:anotherhadi/nixy#dev -``` - -This drops you into a shell with all tools in `PATH`. No home-manager required, no wordlists or systemd units. diff --git a/docs/superpowers/specs/2026-07-29-nvf-reusable-flake-design.md b/docs/superpowers/specs/2026-07-29-nvf-reusable-flake-design.md deleted file mode 100644 index 6937fee2..00000000 --- a/docs/superpowers/specs/2026-07-29-nvf-reusable-flake-design.md +++ /dev/null @@ -1,134 +0,0 @@ -# NVF config en flake réutilisable - -**Date:** 2026-07-29 -**Statut:** Approuvé (design) - -## Objectif - -Permettre à n'importe qui de réutiliser la configuration NVF (Neovim via -[nvf](https://github.com/notashelf/nvf)) de ce dépôt, de deux façons : - -1. **`nix run`** — lancer le nvim standalone sans home-manager. -2. **Module home-manager** — importer un module dans sa propre config, qui - s'adapte automatiquement à *son* thème stylix. - -Le tout sans traîner les inputs lourds du monorepo (nixarr, blog, -awesome-wallpapers, etc.), et en supportant Linux **et** macOS. - -## État actuel - -- `home/programs/nvf/flake.nix` n'est **pas** un vrai flake : c'est une fonction - `{ inputs, pkgs, system, ... }` fusionnée dans les outputs du flake racine via - `import ./home/programs/nvf/flake.nix args`. -- Elle expose déjà `packages..nvim`, `apps..nvim` et - `homeManagerModules.nvim`, mais : - - uniquement pour `x86_64-linux` (system codé en dur) ; - - `homeManagerModules.nvim` importe `default.nix`, qui **exige `inputs`** - (via `inputs.nvf...`) — un tiers devrait le fournir lui-même ; - - un tiers qui consomme le flake racine tire **tous** les inputs lourds. -- Les hosts consomment nvf en important **directement le dossier** - (`imports = [ ../../home/programs/nvf ]` → `default.nix`), `inputs` venant des - `extraSpecialArgs` du monorepo. `homeManagerModules.nvim` n'est donc **pas** - utilisé en interne aujourd'hui. -- `default.nix` référence `config.lib.stylix.colors` **sans garde** → un - consommateur sans stylix aurait une erreur d'évaluation. - -## Design - -### 1. `home/programs/nvf/flake.nix` → vrai flake - -Remplace la fonction actuelle. Inputs minimaux, outputs multi-systèmes. - -- `inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-26.05"` (stable) -- `inputs.nvf.url = "github:notashelf/nvf"` -- Systèmes : `x86_64-linux`, `aarch64-linux`, `aarch64-darwin`, `x86_64-darwin` - via un helper `forAllSystems` (`nixpkgs.lib.genAttrs`). -- Liste de modules partagée : `options.nix`, `languages.nix`, `picker.nix`, - `snacks.nix`, `keymaps.nix`, `utils.nix`, `mini.nix`. - -Outputs : - -- `packages..nvim` (+ `.default`) = `(nvf.lib.neovimConfiguration { inherit pkgs modules; }).neovim` -- `apps..nvim` (+ `.default`) pointant vers `${nvim}/bin/nvim` -- `homeManagerModules.nvim` (+ `.default`) : - `{ imports = [ nvf.homeManagerModules.default ./default.nix ]; }` - — `nvf` capturé depuis les inputs **du flake**, donc le tiers n'a rien à fournir. -- `formatter.` = `pkgs.alejandra` - -### 2. `home/programs/nvf/default.nix` — découplé + garde stylix - -- Signature : `{ config, lib, ... }` — plus de `inputs`. -- Retirer `imports = [ inputs.nvf.homeManagerModules.default ]` (désormais dans - le wrapper `homeManagerModules.nvim` du flake). -- Rendre l'override stylix conditionnel : - - ```nix - vim.luaConfigRC = lib.mkIf (config ? stylix && config.stylix.enable) { - hl-overrides = let c = config.lib.stylix.colors; in '' ... ''; - }; - ``` - - - Avec stylix → nvim prend la palette du consommateur. - - Sans stylix → nvim marche, thème natif nvf. - -### 3. Flake racine (`flake.nix`) - -- Ajouter l'input : - - ```nix - nvf-config = { - url = "path:./home/programs/nvf"; - inputs.nixpkgs.follows = "nixpkgs-stable"; - inputs.nvf.follows = "nvf"; - }; - ``` - -- Retirer la ligne `(import ./home/programs/nvf/flake.nix args)` du `merge`. -- Ré-exposer, pour garder `nix run .#nvim` depuis la racine : - - ```nix - packages.${system}.nvim = inputs.nvf-config.packages.${system}.nvim; - apps.${system}.nvim = inputs.nvf-config.apps.${system}.nvim; - ``` - -### 4. Hosts - -`hosts/laptop/home.nix`, `hosts/work/home.nix`, `hosts/server/home.nix` : - -```nix -# avant -imports = [ ../../home/programs/nvf ]; -# après -imports = [ inputs.nvf-config.homeManagerModules.default ]; -``` - -Toi et les tiers utilisez ainsi exactement le même module. - -## Locks - -Deux `flake.lock` distincts : racine + `home/programs/nvf/flake.lock`. - -| Contexte | Lock qui fait foi | -|----------|-------------------| -| Toi, via le monorepo (`follows`) | Lock **racine** ; le lock du sous-flake est ignoré. | -| Tiers, `github:.../nixos?dir=home/programs/nvf` | Lock du **sous-flake**. | -| `nix run ./home/programs/nvf#nvim` | Lock du sous-flake. | - -**Friction connue :** le `path:` input est épinglé dans le lock racine. Après -édition de la config nvim, faire `nix flake update nvf-config` (ou -`--update-input nvf-config`) pour que le monorepo reprenne les changements. - -## Décisions clés (YAGNI) - -- **Flake dédié dans le monorepo** (pas dépôt séparé) — source unique, pas de - synchro à gérer. -- **Garde stylix optionnelle** plutôt qu'exigence dure — coût nul, évite un - footgun pour les tiers non-stylixés. -- **Multi-système** — trivial via `genAttrs`, permet l'usage sur macOS. - -## Vérification - -- `nix flake check ./home/programs/nvf` -- `nix run ./home/programs/nvf#nvim` (lance nvim standalone) -- `nix flake check` à la racine -- Rebuild d'un host (ex. laptop) sans régression nvim, thème stylix conservé. diff --git a/flake.lock b/flake.lock index ffd94547..917290af 100644 --- a/flake.lock +++ b/flake.lock @@ -882,11 +882,11 @@ ] }, "locked": { - "path": "./home/programs/nvf", + "path": "./home/programs/tui/nvf", "type": "path" }, "original": { - "path": "./home/programs/nvf", + "path": "./home/programs/tui/nvf", "type": "path" }, "parent": [] diff --git a/flake.nix b/flake.nix index e1eda39b..20824686 100644 --- a/flake.nix +++ b/flake.nix @@ -11,7 +11,7 @@ nixos-hardware.url = "github:NixOS/nixos-hardware"; nvf.url = "github:notashelf/nvf"; nvf-config = { - url = "path:./home/programs/nvf"; + url = "path:./home/programs/tui/nvf"; inputs.nixpkgs.follows = "nixpkgs-stable"; inputs.nvf.follows = "nvf"; }; @@ -71,8 +71,7 @@ merge = nixpkgs.lib.foldl nixpkgs.lib.recursiveUpdate {}; in merge [ - (import ./home/programs/group/flake.nix args) - (import ./home/programs/nixy/flake.nix args) + (import ./home/programs/tui/nixy/flake.nix args) { formatter.${system} = pkgs.alejandra; packages.${system}.nvim = inputs.nvf-config.packages.${system}.nvim; diff --git a/home/programs/ghostty/default.nix b/home/programs/ghostty/default.nix deleted file mode 100644 index 3196fda2..00000000 --- a/home/programs/ghostty/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - pkgs, - config, - ... -}: let - cursorShaders = pkgs.fetchFromGitHub { - owner = "sahaj-b"; - repo = "ghostty-cursor-shaders"; - rev = "06d4e90fb5410e9c4d0b3131584060adddf89406"; - hash = "sha256-G/UIr1bKnxn1AcHl/4FL/jou6b7M2VeREslYVELxdmw="; - }; - c = config.lib.stylix.colors; -in { - home.sessionVariables = { - TERMINAL = "ghostty"; - TERM = "ghostty"; - }; - - programs.ghostty = { - enable = true; - installVimSyntax = true; - enableZshIntegration = true; - settings = { - window-padding-x = 10; - confirm-close-surface = false; - window-padding-y = 10; - # Reuse a single background daemon (started at login, see hyprland exec-once) - # so every window opens instantly instead of cold-starting a new process. - gtk-single-instance = true; - clipboard-read = "allow"; - clipboard-write = "allow"; - copy-on-select = "clipboard"; - app-notifications = false; - custom-shader = "${cursorShaders}/cursor_warp.glsl"; - custom-shader-animation = "always"; - keybind = [ - "shift+ctrl+tab=new_tab" - ]; - }; - }; - - home.file.".config/ilovetui/config.yaml".text = '' - colors: - base00: "#${c.base00}" # Background - base01: "#${c.base01}" # Lighter Background / Status Bars - base02: "#${c.base02}" # Selection Background - base03: "#${c.base03}" # Comments / Invisibles - base04: "#${c.base04}" # Dark Foreground / Status Bars - base05: "#${c.base05}" # Default Foreground - base06: "#${c.base06}" # Light Foreground - base07: "#${c.base07}" # Light Background - base08: "#${c.base08}" # Variables / Errors / Diff Deleted - base09: "#${c.base09}" # Integers / Constants / Booleans - base0a: "#${c.base0A}" # Classes / Warnings / Search Background - base0b: "#${c.base0B}" # Strings / Success / Diff Inserted - base0c: "#${c.base0C}" # Support / Regex / Escape Characters - base0d: "#${c.base0D}" # Functions / Methods / Headings / Accent - base0e: "#${c.base0E}" # Keywords / Storage / Diff Changed - base0f: "#${c.base0F}" # Embedded / Misc - ''; -} diff --git a/home/programs/group/dev-packages.nix b/home/programs/group/dev-packages.nix deleted file mode 100644 index cd2701ed..00000000 --- a/home/programs/group/dev-packages.nix +++ /dev/null @@ -1,17 +0,0 @@ -{ - pkgs, - pkgs-stable, -}: -(with pkgs; [ - go - claude-code -]) -++ (with pkgs-stable; [ - nodejs - air - duckdb - python3 - jq - nix-prefetch-github - rsync -]) diff --git a/home/programs/group/dev.nix b/home/programs/group/dev.nix index 9cb187e7..59dec446 100644 --- a/home/programs/group/dev.nix +++ b/home/programs/group/dev.nix @@ -3,5 +3,18 @@ pkgs-stable, ... }: { - home.packages = import ./dev-packages.nix {inherit pkgs pkgs-stable;}; + home.packages = with pkgs; + [ + go + claude-code + ] + ++ (with pkgs-stable; [ + nodejs + air + duckdb + python3 + jq + nix-prefetch-github + rsync + ]); } diff --git a/home/programs/group/flake.nix b/home/programs/group/flake.nix deleted file mode 100644 index 148de11f..00000000 --- a/home/programs/group/flake.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - inputs, - pkgs, - pkgs-stable, - system, - ... -}: let - devPackages = import ./dev-packages.nix {inherit pkgs pkgs-stable;}; - cyberPackages = import ./cybersecurity-packages.nix {inherit pkgs pkgs-stable;}; -in { - packages.${system} = { - dev = pkgs.buildEnv { - name = "dev-tools"; - paths = devPackages; - }; - cybersecurity = pkgs.buildEnv { - name = "cybersecurity-tools"; - paths = cyberPackages; - }; - }; -} diff --git a/home/programs/group/misc.nix b/home/programs/group/misc.nix deleted file mode 100644 index ddf112b3..00000000 --- a/home/programs/group/misc.nix +++ /dev/null @@ -1,11 +0,0 @@ -{pkgs-stable, ...}: { - home.packages = with pkgs-stable; [ - tty-solitaire - bastet - peaclock - cbonsai - pipes - cmatrix - fastfetch - ]; -} diff --git a/home/programs/helium/bookmarks/default.nix b/home/programs/gui/helium/bookmarks/default.nix similarity index 100% rename from home/programs/helium/bookmarks/default.nix rename to home/programs/gui/helium/bookmarks/default.nix diff --git a/home/programs/helium/bookmarks/entertainment.nix b/home/programs/gui/helium/bookmarks/entertainment.nix similarity index 100% rename from home/programs/helium/bookmarks/entertainment.nix rename to home/programs/gui/helium/bookmarks/entertainment.nix diff --git a/home/programs/helium/bookmarks/general.nix b/home/programs/gui/helium/bookmarks/general.nix similarity index 100% rename from home/programs/helium/bookmarks/general.nix rename to home/programs/gui/helium/bookmarks/general.nix diff --git a/home/programs/helium/bookmarks/infosec.nix b/home/programs/gui/helium/bookmarks/infosec.nix similarity index 100% rename from home/programs/helium/bookmarks/infosec.nix rename to home/programs/gui/helium/bookmarks/infosec.nix diff --git a/home/programs/helium/bookmarks/jack.nix b/home/programs/gui/helium/bookmarks/jack.nix similarity index 100% rename from home/programs/helium/bookmarks/jack.nix rename to home/programs/gui/helium/bookmarks/jack.nix diff --git a/home/programs/helium/bookmarks/other.nix b/home/programs/gui/helium/bookmarks/other.nix similarity index 100% rename from home/programs/helium/bookmarks/other.nix rename to home/programs/gui/helium/bookmarks/other.nix diff --git a/home/programs/helium/bookmarks/tools.nix b/home/programs/gui/helium/bookmarks/tools.nix similarity index 100% rename from home/programs/helium/bookmarks/tools.nix rename to home/programs/gui/helium/bookmarks/tools.nix diff --git a/home/programs/helium/default.nix b/home/programs/gui/helium/default.nix similarity index 98% rename from home/programs/helium/default.nix rename to home/programs/gui/helium/default.nix index 769275cc..b8a094f2 100644 --- a/home/programs/helium/default.nix +++ b/home/programs/gui/helium/default.nix @@ -111,7 +111,7 @@ in { xdg.desktopEntries.helium = { name = "Helium"; - genericName = "Navigateur Web"; + genericName = "Web Browser"; exec = "${config.programs.helium.package}/bin/helium %U"; icon = "${config.programs.helium.package}/share/icons/hicolor/256x256/apps/helium.png"; terminal = false; @@ -128,7 +128,7 @@ in { xdg.desktopEntries.helium-private = { name = "Helium (Private window)"; - genericName = "Navigateur Web"; + genericName = "Web Browser"; exec = "${config.programs.helium.package}/bin/helium --incognito %U"; icon = "${config.programs.helium.package}/share/icons/hicolor/256x256/apps/helium.png"; terminal = false; diff --git a/home/programs/helium/system.nix b/home/programs/gui/helium/system.nix similarity index 100% rename from home/programs/helium/system.nix rename to home/programs/gui/helium/system.nix diff --git a/home/programs/gui/pkgs.nix b/home/programs/gui/pkgs.nix new file mode 100644 index 00000000..6f365241 --- /dev/null +++ b/home/programs/gui/pkgs.nix @@ -0,0 +1,16 @@ +{pkgs-stable, ...}: { + home.packages = with pkgs-stable; [ + vlc # Video player + obsidian # Note taking app + textpieces # Manipulate texts + resources # Resource monitor + gnome-clocks # Clocks app + gnome-text-editor # Basic graphic text editor + ticktick # Todo app + pinta # Image editor + switcheroo # Convert images between different formats + onlyoffice-desktopeditors # Office suite + blanket # Listen to different sounds + signal-desktop # Messaging app + ]; +} diff --git a/home/programs/proton/auto-start-vpn.nix b/home/programs/gui/proton/auto-start-vpn.nix similarity index 100% rename from home/programs/proton/auto-start-vpn.nix rename to home/programs/gui/proton/auto-start-vpn.nix diff --git a/home/programs/proton/default.nix b/home/programs/gui/proton/default.nix similarity index 100% rename from home/programs/proton/default.nix rename to home/programs/gui/proton/default.nix diff --git a/home/programs/thunar/default.nix b/home/programs/gui/thunar/default.nix similarity index 100% rename from home/programs/thunar/default.nix rename to home/programs/gui/thunar/default.nix diff --git a/home/programs/tui/ghostty/default.nix b/home/programs/tui/ghostty/default.nix new file mode 100644 index 00000000..fea74e9a --- /dev/null +++ b/home/programs/tui/ghostty/default.nix @@ -0,0 +1,40 @@ +# Ghostty is a terminal emulator +{ + pkgs, + config, + ... +}: let + cursorShaders = pkgs.fetchFromGitHub { + owner = "sahaj-b"; + repo = "ghostty-cursor-shaders"; + rev = "06d4e90fb5410e9c4d0b3131584060adddf89406"; + hash = "sha256-G/UIr1bKnxn1AcHl/4FL/jou6b7M2VeREslYVELxdmw="; + }; + c = config.lib.stylix.colors; +in { + home.sessionVariables = { + TERMINAL = "ghostty"; + TERM = "ghostty"; + }; + + programs.ghostty = { + enable = true; + installVimSyntax = true; + enableZshIntegration = true; + settings = { + window-padding-x = 10; + confirm-close-surface = false; + window-padding-y = 10; + gtk-single-instance = true; + clipboard-read = "allow"; + clipboard-write = "allow"; + copy-on-select = "clipboard"; + app-notifications = false; + custom-shader = "${cursorShaders}/cursor_warp.glsl"; + custom-shader-animation = "always"; + keybind = [ + "shift+ctrl+tab=new_tab" + ]; + }; + }; +} diff --git a/home/programs/git/default.nix b/home/programs/tui/git/default.nix similarity index 85% rename from home/programs/git/default.nix rename to home/programs/tui/git/default.nix index 49f5e9c9..e82f566c 100644 --- a/home/programs/git/default.nix +++ b/home/programs/tui/git/default.nix @@ -16,6 +16,8 @@ in { "node_modules" "result" "result-*" + ".superpowers/" + "docs/superpowers/" ]; settings = { user.name = username; @@ -40,13 +42,10 @@ in { d = "diff"; ps = "!git push origin $(git rev-parse --abbrev-ref HEAD)"; pl = "!git pull origin $(git rev-parse --abbrev-ref HEAD)"; - af = "!git add $(git ls-files -m -o --exclude-standard | sk -m)"; st = "status"; br = "branch"; - df = "!git hist | peco | awk '{print $2}' | xargs -I {} git diff {}^ {}"; hist = ''log --pretty=format:"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)" --graph --date=relative --decorate --all''; llog = ''log --graph --name-status --pretty=format:"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset" --date=relative''; - edit-unmerged = "!f() { git ls-files --unmerged | cut -f2 | sort -u ; }; hx `f`"; }; }; }; diff --git a/home/programs/git/lazygit.nix b/home/programs/tui/git/lazygit.nix similarity index 100% rename from home/programs/git/lazygit.nix rename to home/programs/tui/git/lazygit.nix diff --git a/home/programs/git/signing.nix b/home/programs/tui/git/signing.nix similarity index 100% rename from home/programs/git/signing.nix rename to home/programs/tui/git/signing.nix diff --git a/home/programs/tui/ilovetui/default.nix b/home/programs/tui/ilovetui/default.nix new file mode 100644 index 00000000..8f5af11e --- /dev/null +++ b/home/programs/tui/ilovetui/default.nix @@ -0,0 +1,23 @@ +{config, ...}: let + c = config.lib.stylix.colors; +in { + home.file.".config/ilovetui/config.yaml".text = '' + colors: + base00: "#${c.base00}" # Background + base01: "#${c.base01}" # Lighter Background / Status Bars + base02: "#${c.base02}" # Selection Background + base03: "#${c.base03}" # Comments / Invisibles + base04: "#${c.base04}" # Dark Foreground / Status Bars + base05: "#${c.base05}" # Default Foreground + base06: "#${c.base06}" # Light Foreground + base07: "#${c.base07}" # Light Background + base08: "#${c.base08}" # Variables / Errors / Diff Deleted + base09: "#${c.base09}" # Integers / Constants / Booleans + base0a: "#${c.base0A}" # Classes / Warnings / Search Background + base0b: "#${c.base0B}" # Strings / Success / Diff Inserted + base0c: "#${c.base0C}" # Support / Regex / Escape Characters + base0d: "#${c.base0D}" # Functions / Methods / Headings / Accent + base0e: "#${c.base0E}" # Keywords / Storage / Diff Changed + base0f: "#${c.base0F}" # Embedded / Misc + ''; +} diff --git a/home/programs/nix-utils/default.nix b/home/programs/tui/nix-utils/default.nix similarity index 100% rename from home/programs/nix-utils/default.nix rename to home/programs/tui/nix-utils/default.nix diff --git a/home/programs/nixy/default.nix b/home/programs/tui/nixy/default.nix similarity index 100% rename from home/programs/nixy/default.nix rename to home/programs/tui/nixy/default.nix diff --git a/home/programs/nixy/flake.nix b/home/programs/tui/nixy/flake.nix similarity index 100% rename from home/programs/nixy/flake.nix rename to home/programs/tui/nixy/flake.nix diff --git a/home/programs/nixy/package.nix b/home/programs/tui/nixy/package.nix similarity index 100% rename from home/programs/nixy/package.nix rename to home/programs/tui/nixy/package.nix diff --git a/home/programs/nvf/default.nix b/home/programs/tui/nvf/default.nix similarity index 100% rename from home/programs/nvf/default.nix rename to home/programs/tui/nvf/default.nix diff --git a/home/programs/nvf/flake.lock b/home/programs/tui/nvf/flake.lock similarity index 100% rename from home/programs/nvf/flake.lock rename to home/programs/tui/nvf/flake.lock diff --git a/home/programs/nvf/flake.nix b/home/programs/tui/nvf/flake.nix similarity index 100% rename from home/programs/nvf/flake.nix rename to home/programs/tui/nvf/flake.nix diff --git a/home/programs/nvf/keymaps.nix b/home/programs/tui/nvf/keymaps.nix similarity index 100% rename from home/programs/nvf/keymaps.nix rename to home/programs/tui/nvf/keymaps.nix diff --git a/home/programs/nvf/languages.nix b/home/programs/tui/nvf/languages.nix similarity index 100% rename from home/programs/nvf/languages.nix rename to home/programs/tui/nvf/languages.nix diff --git a/home/programs/nvf/mini.nix b/home/programs/tui/nvf/mini.nix similarity index 100% rename from home/programs/nvf/mini.nix rename to home/programs/tui/nvf/mini.nix diff --git a/home/programs/nvf/options.nix b/home/programs/tui/nvf/options.nix similarity index 100% rename from home/programs/nvf/options.nix rename to home/programs/tui/nvf/options.nix diff --git a/home/programs/nvf/picker.nix b/home/programs/tui/nvf/picker.nix similarity index 100% rename from home/programs/nvf/picker.nix rename to home/programs/tui/nvf/picker.nix diff --git a/home/programs/nvf/snacks.nix b/home/programs/tui/nvf/snacks.nix similarity index 100% rename from home/programs/nvf/snacks.nix rename to home/programs/tui/nvf/snacks.nix diff --git a/home/programs/nvf/utils.nix b/home/programs/tui/nvf/utils.nix similarity index 100% rename from home/programs/nvf/utils.nix rename to home/programs/tui/nvf/utils.nix diff --git a/home/programs/group/basic-apps.nix b/home/programs/tui/pkgs.nix similarity index 75% rename from home/programs/group/basic-apps.nix rename to home/programs/tui/pkgs.nix index 1ede123d..9ea0bf54 100644 --- a/home/programs/group/basic-apps.nix +++ b/home/programs/tui/pkgs.nix @@ -4,19 +4,6 @@ ... }: { home.packages = with pkgs-stable; [ - vlc # Video player - obsidian # Note taking app - textpieces # Manipulate texts - resources # Ressource monitor - gnome-clocks # Clocks app - gnome-text-editor # Basic graphic text editor - ticktick # Todo app - pinta # Image editor - switcheroo # Convert images between different formats - onlyoffice-desktopeditors # Office suite - blanket # Listen to different sounds - signal-desktop # Messaging app - # I love TUIs caligula # User-friendly, lightweight TUI for disk imaging (ISO, USB BOOT) dysk # A terminal-based disk usage analyzer @@ -40,5 +27,14 @@ pastel # Command-line tool to generate, analyze, convert and manipulate colors imagemagick # Image manipulation tool chafa # Image to ANSI/Unicode converter and more. + + # Just cool + tty-solitaire + bastet + peaclock + cbonsai + pipes + cmatrix + fastfetch ]; } diff --git a/home/programs/shell/default.nix b/home/programs/tui/shell/default.nix similarity index 100% rename from home/programs/shell/default.nix rename to home/programs/tui/shell/default.nix diff --git a/home/programs/shell/direnv.nix b/home/programs/tui/shell/direnv.nix similarity index 100% rename from home/programs/shell/direnv.nix rename to home/programs/tui/shell/direnv.nix diff --git a/home/programs/shell/eza.nix b/home/programs/tui/shell/eza.nix similarity index 100% rename from home/programs/shell/eza.nix rename to home/programs/tui/shell/eza.nix diff --git a/home/programs/shell/fzf.nix b/home/programs/tui/shell/fzf.nix similarity index 100% rename from home/programs/shell/fzf.nix rename to home/programs/tui/shell/fzf.nix diff --git a/home/programs/shell/starship.nix b/home/programs/tui/shell/starship.nix similarity index 100% rename from home/programs/shell/starship.nix rename to home/programs/tui/shell/starship.nix diff --git a/home/programs/shell/zoxide.nix b/home/programs/tui/shell/zoxide.nix similarity index 100% rename from home/programs/shell/zoxide.nix rename to home/programs/tui/shell/zoxide.nix diff --git a/home/programs/shell/zsh.nix b/home/programs/tui/shell/zsh.nix similarity index 97% rename from home/programs/shell/zsh.nix rename to home/programs/tui/shell/zsh.nix index f043388b..212b634c 100644 --- a/home/programs/shell/zsh.nix +++ b/home/programs/tui/shell/zsh.nix @@ -104,7 +104,7 @@ alias -s {csv,tsv,parquet,pqt,arrow,db,sqlite,xls,xlsx,xlsm,xlsb,fwf}=tw alias -s {png,jpg,jpeg,gif,pdf}=xdg-open - # 3. Global Aliases (Remplacés n'importe où dans la commande, pas seulement au début) + # 3. Global Aliases (expanded anywhere in the command, not just at the start) alias -g G="| grep" alias -g L="| less" alias -g V="| nvim" @@ -114,7 +114,7 @@ alias -g C="| wl-copy" alias -g NE="2>/dev/null" alias -g ND=">/dev/null" - alias -g NUL=">/dev/null 2>1" + alias -g NUL=">/dev/null 2>&1" # search history based on what's typed in the prompt autoload -U history-search-end diff --git a/home/programs/spotatui/default.nix b/home/programs/tui/spotatui/default.nix similarity index 100% rename from home/programs/spotatui/default.nix rename to home/programs/tui/spotatui/default.nix diff --git a/home/programs/yazi/default.nix b/home/programs/tui/yazi/default.nix similarity index 100% rename from home/programs/yazi/default.nix rename to home/programs/tui/yazi/default.nix diff --git a/home/system/swaync/default.nix b/home/system/swaync/default.nix index c4bd77ec..68b323a2 100644 --- a/home/system/swaync/default.nix +++ b/home/system/swaync/default.nix @@ -403,4 +403,14 @@ in { }; stylix.targets.swaync.enable = false; + + # GTK 4.22 defaults to the Vulkan renderer, which compiles its graphics + # pipelines lazily on the first frame. The control center has many distinct + # visual elements, so the first open triggers a big burst of pipeline + # compilation (a multi-second stall on a cold boot) while later opens reuse + # the in-process cache. The GL (ngl) renderer avoids this: it stays + # GPU-accelerated and benefits from Mesa's on-disk shader cache, so the + # first open is as fast as the rest. Scoped to swaync so other GTK4 apps + # keep the Vulkan renderer. + systemd.user.services.swaync.Service.Environment = ["GSK_RENDERER=ngl"]; } diff --git a/home/system/waybar/scripts.nix b/home/system/waybar/scripts.nix index f1928a62..da71fa76 100644 --- a/home/system/waybar/scripts.nix +++ b/home/system/waybar/scripts.nix @@ -32,8 +32,8 @@ fi ''; - # Résout $src : source par défaut, sinon première source disponible. - # Certaines machines n'ont pas de source audio par défaut (@DEFAULT_AUDIO_SOURCE@ non résolu). + # Resolve $src: the default source, otherwise the first available source. + # Some machines have no default audio source (@DEFAULT_AUDIO_SOURCE@ unresolved). micSource = '' src=$(${pkgs.wireplumber}/bin/wpctl inspect @DEFAULT_AUDIO_SOURCE@ 2>/dev/null | sed -n 's/^id \([0-9]*\),.*/\1/p') if [ -z "$src" ]; then @@ -42,8 +42,8 @@ fi ''; - # tofi en mode dmenu vertical : la config globale est un lanceur horizontal de - # 36px de haut, inutilisable pour une liste. On surcharge la géométrie. + # tofi in vertical dmenu mode: the global config is a 36px-tall horizontal + # launcher, unusable for a list, so override the geometry here. tofiMenu = "${pkgs.tofi}/bin/tofi --horizontal false --anchor center --width 700 --height 500 --margin-top 0 --margin-left 0 --margin-right 0 --num-results 10"; in { bluetoothScript = pkgs.writeShellScript "waybar-bluetooth" '' @@ -264,7 +264,7 @@ in { jq=${pkgs.jq}/bin/jq pwdump=${pkgs.pipewire}/bin/pw-dump - # IDs des sinks dans l'ordre de pw-dump. + # Sink IDs in pw-dump order. ids=($("$pwdump" | "$jq" -r '.[] | select(.info.props."media.class"=="Audio/Sink") | .id')) n=''${#ids[@]} [ "$n" -eq 0 ] && exit 0 @@ -291,7 +291,7 @@ in { jq=${pkgs.jq}/bin/jq pwdump=${pkgs.pipewire}/bin/pw-dump - # IDs des sources dans l'ordre de pw-dump. + # Source IDs in pw-dump order. ids=($("$pwdump" | "$jq" -r '.[] | select(.info.props."media.class"=="Audio/Source") | .id')) n=''${#ids[@]} [ "$n" -eq 0 ] && exit 0 @@ -314,7 +314,7 @@ in { ''; color-pick = pkgs.writeShellScriptBin "color-pick" '' - # hyprpicker -a copie déjà la couleur dans le presse-papier. + # hyprpicker -a already copies the color to the clipboard. color=$(${pkgs.hyprpicker}/bin/hyprpicker -a 2>/dev/null) if [ -n "$color" ]; then OSD_TEXT="󰈊 $color" @@ -359,7 +359,7 @@ in { ''; airplane-toggle = pkgs.writeShellScriptBin "airplane-toggle" '' - # Réutilise nmcli + bluetoothctl (sans privilège) plutôt que rfkill. + # Reuse nmcli + bluetoothctl (unprivileged) instead of rfkill. on=false nmcli radio wifi 2>/dev/null | grep -q enabled && on=true bluetoothctl show 2>/dev/null | grep -q "Powered: yes" && on=true @@ -390,7 +390,7 @@ in { ''; caffeine-toggle = pkgs.writeShellScriptBin "caffeine-toggle" '' - # Met hypridle en pause (reste éveillé) ou le réactive. + # Pause hypridle (stay awake) or resume it. if systemctl --user is-active --quiet hypridle; then systemctl --user stop hypridle OSD_TEXT="󰅶 Keep Awake On" @@ -400,6 +400,4 @@ in { fi ${updateOsd} ''; - - # TODO: Run in background } diff --git a/home/system/waybar/settings.nix b/home/system/waybar/settings.nix index 0ad43121..3bb3790e 100644 --- a/home/system/waybar/settings.nix +++ b/home/system/waybar/settings.nix @@ -1,5 +1,6 @@ { config, + lib, pkgs, networkScript, bluetoothScript, @@ -7,6 +8,7 @@ }: let gaps-out = config.theme.gaps-out; c = config.lib.stylix.colors; + hasBattery = config.var.hasBattery or false; in { programs.waybar.settings = [ { @@ -14,7 +16,9 @@ in { position = "top"; height = config.theme.bar-height; margin = "${toString gaps-out} ${toString gaps-out} 0"; - modules-center = ["custom/osd" "custom/osd-sep" "clock" "tray" "hyprland/workspaces" "custom/network" "custom/bluetooth" "battery"]; + modules-center = + ["custom/osd" "custom/osd-sep" "clock" "tray" "hyprland/workspaces" "custom/network" "custom/bluetooth"] + ++ lib.optional hasBattery "battery"; # ── Modules ───────────────────────────────────────────────────────── diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index f372233c..78030600 100644 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -13,7 +13,7 @@ ../../nixos/utils.nix ../../nixos/hyprland.nix ../../nixos/usbguard.nix - ../../home/programs/helium/system.nix # I hate browser's configuration.. + ../../home/programs/gui/helium/system.nix # I hate browser's configuration.. ../../nixos/omen.nix # CHANGEME: For my laptop only, remove this (OMEN 16) diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index 45699f65..a6c225a5 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -5,25 +5,31 @@ }: { imports = [ # Programs - ../../home/programs/helium - ../../home/programs/proton - ../../home/programs/proton/auto-start-vpn.nix - ../../home/programs/ghostty - inputs.nvf-config.homeManagerModules.default - ../../home/programs/shell - ../../home/programs/git - ../../home/programs/git/lazygit.nix - ../../home/programs/git/signing.nix # CHANGEME: Change the key or remove this file - ../../home/programs/thunar - ../../home/programs/nixy - ../../home/programs/nix-utils - ../../home/programs/spotatui - ../../home/programs/yazi - ../../home/programs/group/basic-apps.nix + ## GUI + ../../home/programs/gui/proton + ../../home/programs/gui/proton/auto-start-vpn.nix + ../../home/programs/gui/helium + ../../home/programs/gui/thunar + ../../home/programs/gui/pkgs.nix + + ## TUI + inputs.nvf-config.homeManagerModules.default + ../../home/programs/tui/ghostty + ../../home/programs/tui/ilovetui + ../../home/programs/tui/shell + ../../home/programs/tui/git + ../../home/programs/tui/git/lazygit.nix + ../../home/programs/tui/git/signing.nix # CHANGEME: Change the key or remove this file + ../../home/programs/tui/nixy + ../../home/programs/tui/nix-utils + ../../home/programs/tui/spotatui + ../../home/programs/tui/yazi + ../../home/programs/tui/pkgs.nix + + ## GROUPS ../../home/programs/group/cybersecurity.nix ../../home/programs/group/dev.nix - ../../home/programs/group/misc.nix # System (Desktop environment like stuff) ../../home/system/hyprlock diff --git a/hosts/laptop/secrets/default.nix b/hosts/laptop/secrets/default.nix index 0b18108a..de54455c 100644 --- a/hosts/laptop/secrets/default.nix +++ b/hosts/laptop/secrets/default.nix @@ -52,7 +52,6 @@ in { - *work ''; - systemd.user.services.mbsync.Unit.After = ["sops-nix.service"]; home.packages = with pkgs; [ sops age diff --git a/hosts/laptop/variables.nix b/hosts/laptop/variables.nix index c703f538..48128572 100644 --- a/hosts/laptop/variables.nix +++ b/hosts/laptop/variables.nix @@ -26,6 +26,8 @@ autoUpgrade = false; autoGarbageCollector = true; + + hasBattery = true; }; # DON'T TOUCH THIS diff --git a/hosts/server/hardware-configuration.nix b/hosts/server/hardware-configuration.nix index c7bbfe2a..e2c94a4e 100644 --- a/hosts/server/hardware-configuration.nix +++ b/hosts/server/hardware-configuration.nix @@ -38,7 +38,7 @@ options = [ "subvol=/" "compress=zstd" - ]; # adapte selon si t'as des subvolumes + ]; # adjust depending on whether you use subvolumes }; swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking diff --git a/hosts/work/configuration.nix b/hosts/work/configuration.nix index 3c984518..f67566e5 100644 --- a/hosts/work/configuration.nix +++ b/hosts/work/configuration.nix @@ -12,7 +12,7 @@ ../../nixos/utils.nix ../../nixos/hyprland.nix ../../nixos/docker.nix - ../../home/programs/helium/system.nix # I hate browser's configuration.. + ../../home/programs/gui/helium/system.nix # I hate browser's configuration.. # You should let those lines as is ./hardware-configuration.nix @@ -37,5 +37,5 @@ networking.firewall.allowedTCPPorts = [9001]; # Don't touch this - system.stateVersion = "24.05"; + system.stateVersion = "26.05"; } diff --git a/hosts/work/home.nix b/hosts/work/home.nix index d9aec79d..a0b9dcfd 100644 --- a/hosts/work/home.nix +++ b/hosts/work/home.nix @@ -5,23 +5,28 @@ }: { imports = [ # Programs - inputs.nvf-config.homeManagerModules.default - ../../home/programs/proton - ../../home/programs/helium - ../../home/programs/ghostty - ../../home/programs/shell - ../../home/programs/git - ../../home/programs/git/lazygit.nix - ../../home/programs/thunar - ../../home/programs/nixy - ../../home/programs/nix-utils - ../../home/programs/spotatui - ../../home/programs/yazi - ../../home/programs/group/basic-apps.nix + ## GUI + ../../home/programs/gui/proton + ../../home/programs/gui/helium + ../../home/programs/gui/thunar + ../../home/programs/gui/pkgs.nix + + ## TUI + inputs.nvf-config.homeManagerModules.default + ../../home/programs/tui/ghostty + ../../home/programs/tui/shell + ../../home/programs/tui/git + ../../home/programs/tui/git/lazygit.nix + ../../home/programs/tui/nixy + ../../home/programs/tui/nix-utils + ../../home/programs/tui/spotatui + ../../home/programs/tui/yazi + ../../home/programs/tui/pkgs.nix + + ## GROUPS ../../home/programs/group/cybersecurity.nix ../../home/programs/group/dev.nix - ../../home/programs/group/misc.nix # System (Desktop environment like stuff) ../../home/system/hyprlock @@ -43,7 +48,7 @@ homeDirectory = "/home/" + config.var.username; # Don't touch this - stateVersion = "24.05"; + stateVersion = "26.05"; }; wayland.windowManager.hyprland.settings.monitor = [ diff --git a/hosts/work/secrets/default.nix b/hosts/work/secrets/default.nix index c2bf4cf4..b93d1a8e 100644 --- a/hosts/work/secrets/default.nix +++ b/hosts/work/secrets/default.nix @@ -49,7 +49,6 @@ in { - *work ''; - systemd.user.services.mbsync.Unit.After = ["sops-nix.service"]; home.packages = with pkgs; [ sops age diff --git a/hosts/work/variables.nix b/hosts/work/variables.nix index 9247e0c5..f8569301 100644 --- a/hosts/work/variables.nix +++ b/hosts/work/variables.nix @@ -26,6 +26,8 @@ autoUpgrade = false; autoGarbageCollector = true; + + hasBattery = false; }; # DON'T TOUCH THIS diff --git a/nixos/docker.nix b/nixos/docker.nix index cf586fdf..bea0536d 100644 --- a/nixos/docker.nix +++ b/nixos/docker.nix @@ -1,5 +1,4 @@ -{config, pkgs, ...}: { +{config, ...}: { virtualisation.docker.enable = true; - virtualisation.docker.package = pkgs.docker_29; users.users."${config.var.username}".extraGroups = ["docker"]; } diff --git a/nixos/hyprland.nix b/nixos/hyprland.nix index 056c8f61..b0ac2a90 100644 --- a/nixos/hyprland.nix +++ b/nixos/hyprland.nix @@ -5,5 +5,12 @@ withUWSM = true; }; + # Generic Wayland hints (Chromium/Electron and Firefox), applied on every + # Hyprland host regardless of the GPU. + environment.variables = { + NIXOS_OZONE_WL = "1"; + MOZ_ENABLE_WAYLAND = "1"; + }; + security.pam.services.hyprlock = {}; } diff --git a/nixos/nvidia.nix b/nixos/nvidia.nix index 919b5b7d..62c02b64 100644 --- a/nixos/nvidia.nix +++ b/nixos/nvidia.nix @@ -16,11 +16,9 @@ in { environment.variables = { LIBVA_DRIVER_NAME = "nvidia"; __GLX_VENDOR_LIBRARY_NAME = "nvidia"; - NIXOS_OZONE_WL = "1"; __GL_GSYNC_ALLOWED = "1"; __GL_VRR_ALLOWED = "1"; NVD_BACKEND = "direct"; - MOZ_ENABLE_WAYLAND = "1"; }; nixpkgs.config.nvidia.acceptLicense = true; diff --git a/nixos/omen.nix b/nixos/omen.nix index cc16439e..e0ebfbdb 100644 --- a/nixos/omen.nix +++ b/nixos/omen.nix @@ -13,12 +13,16 @@ }: stdenv.mkDerivation (finalAttrs: { pname = "hp-omen-linux-module"; - version = "rebase-6.14"; + version = "rebase-6.15"; + # Upstream only rebases per kernel branch and currently tops out at + # rebase-6.15, while linuxPackages_latest is already on 7.x. If the + # module ever fails to build against a newer kernel, either bump this + # to a fresh upstream branch or fall back to a stable kernel. src = fetchFromGitHub { owner = "ranisalt"; repo = "hp-omen-linux-module"; - rev = finalAttrs.version; - sha256 = "sha256-2zCm29bdboSjRm/caMjBPGNc0tZXPUnIIYlHxxfhAok="; + rev = "d4b9b5adb84581c3874ca3985dc749c40c3ece67"; # rebase-6.15 + sha256 = "sha256-IOXHzcCB0n1InMjeIu3XYEJ4bhbHS3NIlS8/+4XIwkQ="; }; setSourceRoot = '' export sourceRoot=$(pwd)/${finalAttrs.src.name}/src diff --git a/todo b/todo index 9f50e7fe..4d496c53 100644 --- a/todo +++ b/todo @@ -1,3 +1,4 @@ -- [ ] Clean files -- [ ] NVF dans Nur -- [ ] Check claude: Sécu, mots en français, faute, ... +- Clean files +- Check claude: Sécu, mots en français, faute, ... +- LOW BATTERY OSD +- a jour ./docs/NEOVIM.md From def37f0b3a3948cfec112c949285daacf0ba60c6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 29 Jul 2026 11:15:03 +0000 Subject: [PATCH 5/7] Update README.md (auto) --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0afe625a..3e85dfbb 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,6 @@ sudo nixos-rebuild switch --flake ~/.config/nixos#yourhostname - [WALLPAPERS](https://github.com/anotherhadi/awesome-wallpapers): An awesome collection of wallpapers - [NEOVIM](docs/NEOVIM.md): How to use the Neovim config in your own flake -- [GROUPS](docs/GROUPS.md): Reusable package groups (dev, cybersecurity) - [CONTRIBUTING](docs/CONTRIBUTING.md): How to contribute - [LICENSE](LICENSE): MIT License From ee0cb3cf68803cf5657849cd5f7a0a1245020a8d Mon Sep 17 00:00:00 2001 From: Hadi Date: Thu, 30 Jul 2026 13:38:20 +0200 Subject: [PATCH 6/7] t Signed-off-by: Hadi --- home/programs/gui/helium/default.nix | 1 + home/system/termfilechooser/default.nix | 24 ++++++++++++++++++++++++ hosts/laptop/home.nix | 1 + hosts/work/home.nix | 1 + nixos/utils.nix | 17 ++++++++++++----- todo | 1 + 6 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 home/system/termfilechooser/default.nix diff --git a/home/programs/gui/helium/default.nix b/home/programs/gui/helium/default.nix index b8a094f2..c1c92377 100644 --- a/home/programs/gui/helium/default.nix +++ b/home/programs/gui/helium/default.nix @@ -91,6 +91,7 @@ nativeBuildInputs = [pkgs.makeWrapper]; postBuild = '' wrapProgram $out/bin/helium \ + --set-default GTK_USE_PORTAL 1 \ --run ${lib.escapeShellArg (toString patchScript)} ''; }; diff --git a/home/system/termfilechooser/default.nix b/home/system/termfilechooser/default.nix new file mode 100644 index 00000000..a85ab280 --- /dev/null +++ b/home/system/termfilechooser/default.nix @@ -0,0 +1,24 @@ +# Use yazi as the file picker for portal dialogs (browser "select file(s)" and +# "save download to..."). The backend is xdg-desktop-portal-termfilechooser, +# enabled system-wide in nixos/utils.nix (extraPortals + FileChooser routing). +{ + config, + pkgs, + ... +}: let + wrapper = "${pkgs.xdg-desktop-portal-termfilechooser}/share/xdg-desktop-portal-termfilechooser/yazi-wrapper.sh"; + # ghostty must run in the foreground instead of handing off to the + # single-instance daemon, otherwise the wrapper returns before you've picked + # anything and the portal reads an empty selection. + termcmd = "ghostty --gtk-single-instance=false --title=termfilechooser -e"; +in { + xdg.configFile."xdg-desktop-portal-termfilechooser/config".text = '' + [filechooser] + cmd=${wrapper} + default_dir=$HOME + open_mode=suggested + save_mode=suggested + env=TERMCMD=${termcmd} + PATH=${config.home.profileDirectory}/bin:/run/current-system/sw/bin:/run/wrappers/bin + ''; +} diff --git a/hosts/laptop/home.nix b/hosts/laptop/home.nix index a6c225a5..6960493d 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -38,6 +38,7 @@ ../../home/system/swaync ../../home/system/tofi ../../home/system/mime + ../../home/system/termfilechooser ../../home/system/udiskie ../../home/system/clipboard ../../home/system/hypridle diff --git a/hosts/work/home.nix b/hosts/work/home.nix index a0b9dcfd..430940b5 100644 --- a/hosts/work/home.nix +++ b/hosts/work/home.nix @@ -35,6 +35,7 @@ ../../home/system/swaync ../../home/system/tofi ../../home/system/mime + ../../home/system/termfilechooser ../../home/system/udiskie ../../home/system/clipboard ../../home/system/hypridle diff --git a/nixos/utils.nix b/nixos/utils.nix index 6e62989b..cec705c1 100644 --- a/nixos/utils.nix +++ b/nixos/utils.nix @@ -119,13 +119,20 @@ in { xdgOpenUsePortal = true; config = { common.default = ["gtk"]; - hyprland.default = [ - "gtk" - "hyprland" - ]; + hyprland = { + default = [ + "gtk" + "hyprland" + ]; + # Pick files / choose download paths with yazi instead of the GTK dialog + "org.freedesktop.portal.FileChooser" = ["termfilechooser"]; + }; }; - extraPortals = [pkgs.xdg-desktop-portal-gtk]; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-termfilechooser + ]; }; security.rtkit.enable = true; diff --git a/todo b/todo index 4d496c53..1a0d3440 100644 --- a/todo +++ b/todo @@ -2,3 +2,4 @@ - Check claude: Sécu, mots en français, faute, ... - LOW BATTERY OSD - a jour ./docs/NEOVIM.md +yazi as a file chooser From 2ea661c8f45c13ea6ad31a506aab1ff471da1e26 Mon Sep 17 00:00:00 2001 From: Hadi Date: Thu, 30 Jul 2026 13:54:23 +0200 Subject: [PATCH 7/7] oui Signed-off-by: Hadi --- nixos/utils.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nixos/utils.nix b/nixos/utils.nix index cec705c1..caba604d 100644 --- a/nixos/utils.nix +++ b/nixos/utils.nix @@ -124,8 +124,10 @@ in { "gtk" "hyprland" ]; - # Pick files / choose download paths with yazi instead of the GTK dialog - "org.freedesktop.portal.FileChooser" = ["termfilechooser"]; + # Pick files / choose download paths with yazi instead of the GTK dialog. + # Key MUST use the "impl" interface name, else xdg-desktop-portal + # ignores it and falls back to the default (gtk). See portals.conf(5). + "org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"]; }; };