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 1be5a966..885944c2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .sops.yaml .claude/ old/ +docs/superpowers/ +.superpowers/ 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 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/flake.lock b/flake.lock index 91e426ca..917290af 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/tui/nvf", + "type": "path" + }, + "original": { + "path": "./home/programs/tui/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..20824686 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/tui/nvf"; + inputs.nixpkgs.follows = "nixpkgs-stable"; + inputs.nvf.follows = "nvf"; + }; nur = { url = "github:nix-community/nur"; inputs.nixpkgs.follows = "nixpkgs"; @@ -66,11 +71,11 @@ 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) + (import ./home/programs/tui/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/ghostty/default.nix b/home/programs/ghostty/default.nix deleted file mode 100644 index 292d0b2a..00000000 --- a/home/programs/ghostty/default.nix +++ /dev/null @@ -1,66 +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; - clipboard-read = "allow"; - clipboard-write = "allow"; - copy-on-select = "clipboard"; - app-notifications = false; - 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" - ]; - }; - }; - - 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 97% rename from home/programs/helium/default.nix rename to home/programs/gui/helium/default.nix index 769275cc..c1c92377 100644 --- a/home/programs/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)} ''; }; @@ -111,7 +112,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 +129,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/nvf/default.nix b/home/programs/nvf/default.nix deleted file mode 100644 index d0acf432..00000000 --- a/home/programs/nvf/default.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ - inputs, - config, - ... -}: let - c = config.lib.stylix.colors; -in { - imports = [inputs.nvf.homeManagerModules.default]; - - home.sessionVariables = { - EDITOR = "nvim"; - }; - - 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 }) - ''; - imports = [ - ./options.nix - ./languages.nix - ./picker.nix - ./snacks.nix - ./keymaps.nix - ./utils.nix - ./mini.nix - ]; - }; - }; -} diff --git a/home/programs/nvf/flake.nix b/home/programs/nvf/flake.nix deleted file mode 100644 index b9fdd4f8..00000000 --- a/home/programs/nvf/flake.nix +++ /dev/null @@ -1,37 +0,0 @@ -{ - inputs, - pkgs, - system, - ... -}: let - nvimConfig = inputs.nvf.lib.neovimConfiguration { - inherit pkgs; - modules = [ - ./options.nix - ./languages.nix - ./picker.nix - ./snacks.nix - ./keymaps.nix - ./utils.nix - ./mini.nix - ]; - }; -in { - packages.${system}.nvim = nvimConfig.neovim; - - apps.${system}.nvim = { - type = "app"; - program = "${nvimConfig.neovim}/bin/nvim"; - }; - defaultApp.${system} = { - type = "app"; - program = "${nvimConfig.neovim}/bin/nvim"; - }; - - homeManagerModules.nvim = { - imports = [ - inputs.nvf.homeManagerModules.default - ./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/tui/nvf/default.nix b/home/programs/tui/nvf/default.nix new file mode 100644 index 00000000..2900bac7 --- /dev/null +++ b/home/programs/tui/nvf/default.nix @@ -0,0 +1,37 @@ +{ + config, + lib, + ... +}: { + home.sessionVariables = { + EDITOR = "nvim"; + }; + + programs.nvf = { + enable = true; + settings = { + 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 + ./picker.nix + ./snacks.nix + ./keymaps.nix + ./utils.nix + ./mini.nix + ]; + }; + }; +} diff --git a/home/programs/tui/nvf/flake.lock b/home/programs/tui/nvf/flake.lock new file mode 100644 index 00000000..c82848e8 --- /dev/null +++ b/home/programs/tui/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/tui/nvf/flake.nix b/home/programs/tui/nvf/flake.nix new file mode 100644 index 00000000..bd1198c6 --- /dev/null +++ b/home/programs/tui/nvf/flake.nix @@ -0,0 +1,57 @@ +{ + 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 + ./picker.nix + ./snacks.nix + ./keymaps.nix + ./utils.nix + ./mini.nix + ]; + in { + packages = forAllSystems (system: let + pkgs = nixpkgs.legacyPackages.${system}; + nvim = (nvf.lib.neovimConfiguration {inherit pkgs modules;}).neovim; + in { + inherit nvim; + default = nvim; + }); + + apps = forAllSystems (system: let + nvim = { + type = "app"; + program = "${self.packages.${system}.nvim}/bin/nvim"; + }; + in { + inherit nvim; + default = nvim; + }); + + homeManagerModules = rec { + nvim = { + imports = [ + nvf.homeManagerModules.default + ./default.nix + ]; + }; + default = nvim; + }; + + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); + }; +} 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 96% rename from home/programs/nvf/languages.nix rename to home/programs/tui/nvf/languages.nix index efc96f32..3a9b3f20 100644 --- a/home/programs/nvf/languages.nix +++ b/home/programs/tui/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/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/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..68b323a2 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 { @@ -409,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/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/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..da71fa76 100644 --- a/home/system/waybar/scripts.nix +++ b/home/system/waybar/scripts.nix @@ -31,35 +31,111 @@ OSD_TEXT="󰃠 $BRIGHT%" fi ''; + + # 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 + src=$(${pkgs.pipewire}/bin/pw-dump | ${pkgs.jq}/bin/jq -r \ + '[.[] | select(.info.props."media.class"=="Audio/Source") | .id] | .[0] // empty') + fi + ''; + + # 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" '' - 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,155 @@ in { fi ''; - # TODO: Run in background + 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 + + # 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 + + 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 + + # 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 + + 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 already copies the color to the clipboard. + 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" '' + # 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 + 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" '' + # Pause hypridle (stay awake) or resume it. + 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} + ''; } diff --git a/home/system/waybar/settings.nix b/home/system/waybar/settings.nix index be284c8e..3bb3790e 100644 --- a/home/system/waybar/settings.nix +++ b/home/system/waybar/settings.nix @@ -1,11 +1,14 @@ { config, + lib, + pkgs, networkScript, bluetoothScript, ... }: let gaps-out = config.theme.gaps-out; c = config.lib.stylix.colors; + hasBattery = config.var.hasBattery or false; in { programs.waybar.settings = [ { @@ -13,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 ───────────────────────────────────────────────────────── @@ -48,7 +53,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/configuration.nix b/hosts/laptop/configuration.nix index e1763aca..4cdc4e9f 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 73058f82..6960493d 100644 --- a/hosts/laptop/home.nix +++ b/hosts/laptop/home.nix @@ -1,25 +1,35 @@ -{config, ...}: { +{ + config, + inputs, + ... +}: { imports = [ # Programs - ../../home/programs/helium - ../../home/programs/proton - ../../home/programs/proton/auto-start-vpn.nix - ../../home/programs/ghostty - ../../home/programs/nvf - ../../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 @@ -28,7 +38,10 @@ ../../home/system/swaync ../../home/system/tofi ../../home/system/mime + ../../home/system/termfilechooser ../../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/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/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/configuration.nix b/hosts/work/configuration.nix index 438e88f2..f67566e5 100644 --- a/hosts/work/configuration.nix +++ b/hosts/work/configuration.nix @@ -11,7 +11,8 @@ ../../nixos/users.nix ../../nixos/utils.nix ../../nixos/hyprland.nix - ../../home/programs/helium/system.nix # I hate browser's configuration.. + ../../nixos/docker.nix + ../../home/programs/gui/helium/system.nix # I hate browser's configuration.. # You should let those lines as is ./hardware-configuration.nix @@ -28,13 +29,13 @@ 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]; # 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 875904e7..430940b5 100644 --- a/hosts/work/home.nix +++ b/hosts/work/home.nix @@ -1,23 +1,32 @@ -{config, ...}: { +{ + config, + inputs, + ... +}: { imports = [ # Programs - ../../home/programs/proton - ../../home/programs/helium - ../../home/programs/ghostty - ../../home/programs/nvf - ../../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 @@ -26,7 +35,10 @@ ../../home/system/swaync ../../home/system/tofi ../../home/system/mime + ../../home/system/termfilechooser ../../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 @@ -37,7 +49,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/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/nixos/utils.nix b/nixos/utils.nix index 6e62989b..caba604d 100644 --- a/nixos/utils.nix +++ b/nixos/utils.nix @@ -119,13 +119,22 @@ 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. + # 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"]; + }; }; - 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 057aaa95..1a0d3440 100644 --- a/todo +++ b/todo @@ -1,12 +1,5 @@ -- [ ] 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, ... +- Clean files +- Check claude: Sécu, mots en français, faute, ... +- LOW BATTERY OSD +- a jour ./docs/NEOVIM.md +yazi as a file chooser