From 50564f6eb2cb7365629e0f72eb3ed789e4afc2d6 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 20 Aug 2025 23:52:45 +0200 Subject: [PATCH 01/21] refactor(nvim): dynamically manage lsp files --- modules/home-manager/cli/neovim/default.nix | 38 ++++++++++++------- modules/home-manager/cli/neovim/files/lsp.lua | 10 ----- 2 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 modules/home-manager/cli/neovim/files/lsp.lua diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index 7ea800d..fc251d1 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -10,12 +10,28 @@ let url = "https://ftp.nluug.nl/vim/runtime/spell/fr.utf-8.sug"; sha256 = "0294bc32b42c90bbb286a89e23ca3773b7ef50eff1ab523b1513d6a25c6b3f58"; }; + + ## Dynamically create LSP servers configurations list regarding + ## files in `./files/lsp` + lspConfigFiles = lib.mapAttrs' ( + k: _: lib.nameValuePair + ("${config.xdg.configHome}/nvim/lsp/${k}") + ({ source = ./files/lsp/${k};}) + ) (builtins.readDir ./files/lsp); + + ## This variable contains neovim LSP activations + lspLuaConfig = lib.attrsets.mapAttrsToList ( + k: v: + "vim.lsp.enable('${lib.removeSuffix ".lua" k}')" + ) (builtins.readDir ./files/lsp); + +## Tony plugins to have a proper helm linting. nvim-k8s-lsp = pkgs.vimUtils.buildVimPlugin { pname = "nvim-k8s-lsp"; version = "main"; src = builtins.fetchGit { url = "https://github.com/tonychg/nvim-k8s-lsp.git"; - rev = "395f6d6b91da55c12b26a2ef1ace7a922a756712"; + rev = "930aa20bcd54f2d6f16040e98ff4068b292c6c7f"; ref = "main"; }; }; @@ -25,18 +41,10 @@ in enable = mkEnableOption "enable Neovim text editor"; }; config = mkIf cfg.enable { - home.file."${config.xdg.configHome}/nvim/spell/fr.utf-8.spl".source = nvim-spell-fr-utf8-dictionary; - home.file."${config.xdg.configHome}/nvim/spell/fr.utf-8.sug".source = nvim-spell-fr-utf8-suggestions; - - home.file."${config.xdg.configHome}/nvim/lsp/bash.lua".source = ./files/lsp/bash.lua; - home.file."${config.xdg.configHome}/nvim/lsp/go.lua".source = ./files/lsp/go.lua; - home.file."${config.xdg.configHome}/nvim/lsp/helm.lua".source = ./files/lsp/helm.lua; - home.file."${config.xdg.configHome}/nvim/lsp/lua.lua".source = ./files/lsp/lua.lua; - home.file."${config.xdg.configHome}/nvim/lsp/nills.lua".source = ./files/lsp/nills.lua; - home.file."${config.xdg.configHome}/nvim/lsp/pylsp.lua".source = ./files/lsp/pylsp.lua; - home.file."${config.xdg.configHome}/nvim/lsp/terraformls.lua".source = ./files/lsp/terraformls.lua; - home.file."${config.xdg.configHome}/nvim/lsp/tflint.lua".source = ./files/lsp/tflint.lua; - home.file."${config.xdg.configHome}/nvim/lsp/yaml.lua".source = ./files/lsp/yaml.lua; + home.file = lspConfigFiles // { + "${config.xdg.configHome}/nvim/spell/fr.utf-8.spl".source = nvim-spell-fr-utf8-dictionary; + "${config.xdg.configHome}/nvim/spell/fr.utf-8.sug".source = nvim-spell-fr-utf8-suggestions; + }; programs.neovim = { enable = true; @@ -70,7 +78,9 @@ in extraLuaConfig = (builtins.readFile ./files/options.lua) + (builtins.readFile ./files/keybindings.lua) - + (builtins.readFile ./files/lsp.lua) + + '' + ${ lib.concatStringsSep "\n" lspLuaConfig} + '' ; plugins = with pkgs.vimPlugins; [ { diff --git a/modules/home-manager/cli/neovim/files/lsp.lua b/modules/home-manager/cli/neovim/files/lsp.lua deleted file mode 100644 index dfa5dee..0000000 --- a/modules/home-manager/cli/neovim/files/lsp.lua +++ /dev/null @@ -1,10 +0,0 @@ --- LSP configuration -vim.lsp.enable('bash') -vim.lsp.enable('go') -vim.lsp.enable('helm') -vim.lsp.enable('lua') -vim.lsp.enable('nills') -vim.lsp.enable('pylsp') -vim.lsp.enable('terraformls') -vim.lsp.enable('tflint') -vim.lsp.enable('yaml') From 0b49ad2e921297da812dd0b7c49493f9452be44a Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 20 Aug 2025 23:52:45 +0200 Subject: [PATCH 02/21] refactor(nvim): dynamically manage lsp files --- modules/home-manager/cli/neovim/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index fc251d1..a86a177 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -25,7 +25,7 @@ let "vim.lsp.enable('${lib.removeSuffix ".lua" k}')" ) (builtins.readDir ./files/lsp); -## Tony plugins to have a proper helm linting. + ## Tony plugins to have a proper helm linting. nvim-k8s-lsp = pkgs.vimUtils.buildVimPlugin { pname = "nvim-k8s-lsp"; version = "main"; From 93bb0be9be302121357ce839bffd59d13fde2c33 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 15:19:17 +0200 Subject: [PATCH 03/21] feat(home-manager): install nixgl --- flake.nix | 3 ++- home-manager/default.nix | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 251eabc..21b1c7b 100644 --- a/flake.nix +++ b/flake.nix @@ -51,11 +51,12 @@ overlays = [ nixgl.overlay ]; }; extraSpecialArgs = { - inherit stateVersion inputs; + inherit stateVersion inputs nixgl; hostname = hostname; username = username; }; modules = [ + { nixpkgs.overlays = [ nixgl.overlay ];} ./home-manager/default.nix ]; }; diff --git a/home-manager/default.nix b/home-manager/default.nix index befa969..f70cd47 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -1,4 +1,4 @@ -{ inputs, lib, stateVersion, username, hostname, ... }: +{ inputs, lib, stateVersion, username, hostname, nixgl, ... }: { imports = [ inputs.sops-nix.homeManagerModules.sops @@ -12,7 +12,9 @@ nixpkgs.config.allowUnfree = true; programs.home-manager.enable = true; fonts.fontconfig.enable = true; - + nixGL.packages = nixgl.packages; + nixGL.defaultWrapper = "mesa"; + nixGL.installScripts = ["mesa"]; home = { inherit stateVersion username; homeDirectory = "/home/${username}"; From e93c365d1b9367e7018af946e3bbe265c7f719ba Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 15:28:12 +0200 Subject: [PATCH 04/21] chore(sway): acctivate nixgl --- modules/home-manager/desktop/sway/includes/sway.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/home-manager/desktop/sway/includes/sway.nix b/modules/home-manager/desktop/sway/includes/sway.nix index 004322b..d556c05 100644 --- a/modules/home-manager/desktop/sway/includes/sway.nix +++ b/modules/home-manager/desktop/sway/includes/sway.nix @@ -6,6 +6,7 @@ in { config = mkIf config.modules.desktop.sway.enable { wayland.windowManager.sway = { + package = config.lib.nixGL.wrap pkgs.sway; enable = true; wrapperFeatures.gtk = true; systemd.enable = true; From 40da37234ad3e285c5cf7efc10ee29141e6b3e8a Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 15:37:21 +0200 Subject: [PATCH 05/21] chore(sway): xdg portal is now configured with home-manager --- modules/home-manager/desktop/sway/default.nix | 14 ++++++++++++++ modules/nixos/desktop/sway/default.nix | 15 --------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 57a6c16..7de3dd6 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -158,6 +158,20 @@ in desktop = "${config.home.homeDirectory}/documents"; publicShare = "${config.home.homeDirectory}/tmp/public"; }; + portal = { + enable = true; + extraPortals = with pkgs; [ + xdg-desktop-portal-wlr + xdg-desktop-portal-gtk + ]; + xdgOpenUsePortal = true; + config = { + sway.default = [ + "wlr" + "gtk" + ]; + }; + }; }; }; } diff --git a/modules/nixos/desktop/sway/default.nix b/modules/nixos/desktop/sway/default.nix index 5d65618..c7427a8 100644 --- a/modules/nixos/desktop/sway/default.nix +++ b/modules/nixos/desktop/sway/default.nix @@ -16,20 +16,5 @@ in alsa.support32Bit = true; pulse.enable = true; }; - xdg.portal = { - enable = true; - wlr.enable = true; - # gtk portal needed to make gtk apps happy - extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - config = { - common = { - default = [ - "gtk" - ]; - "org.freedesktop.impl.portal.ScreenCast" = "wlr"; - "org.freedesktop.impl.portal.Screenshot" = "wlr"; - }; - }; - }; }; } From e446394b832b6534667850d54ed2bef812f05ce6 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 16:24:56 +0200 Subject: [PATCH 06/21] chore(firefox): use regular nixgl wrapper And remove `enableNixGL` configuration in related home configurations --- hosts/rick/home-config.nix | 1 - hosts/work/home-config.nix | 1 - modules/home-manager/web/firefox/default.nix | 27 ++------------------ 3 files changed, 2 insertions(+), 27 deletions(-) diff --git a/hosts/rick/home-config.nix b/hosts/rick/home-config.nix index 5a6295c..1be34e0 100644 --- a/hosts/rick/home-config.nix +++ b/hosts/rick/home-config.nix @@ -26,7 +26,6 @@ }; web.firefox = { enable = true; - enableNixGL = true; }; web.qutebrowser = { enable = true; diff --git a/hosts/work/home-config.nix b/hosts/work/home-config.nix index 0712e15..d089233 100644 --- a/hosts/work/home-config.nix +++ b/hosts/work/home-config.nix @@ -35,7 +35,6 @@ }; web.firefox = { enable = true; - enableNixGL = true; optionalExtensions = with pkgs.nur.repos.rycee.firefox-addons; [ okta-browser-plugin ]; diff --git a/modules/home-manager/web/firefox/default.nix b/modules/home-manager/web/firefox/default.nix index 191bdae..d52f8a9 100644 --- a/modules/home-manager/web/firefox/default.nix +++ b/modules/home-manager/web/firefox/default.nix @@ -29,11 +29,6 @@ in description = "Optional Firefox Plugins to install"; }; - enableNixGL = mkOption { - type = types.bool; - default = false; - description = "Use NixGL to start Firefox"; - }; }; config = mkIf cfg.enable { programs.browserpass = { @@ -47,24 +42,6 @@ in "x-scheme-handler/about" = "firefox.desktop"; "x-scheme-handler/unknown" = "firefox.desktop"; }; - xdg.desktopEntries."firefox" = mkIf cfg.enableNixGL { - name = "Firefox NixGL Powered"; - exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa firefox %U"; - icon = "firefox"; - terminal = false; - type = "Application"; - startupNotify = true; - actions = { - "new-private-window" = { - exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa firefox --private-window %U"; - name = "New Private Window"; - }; - "new-window" = { - exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa firefox --new-window %U"; - name = "New Window"; - }; - }; - }; xdg.configFile."tridactyl/tridactylrc".text = '' sanitize tridactyllocal tridactylsync @@ -93,13 +70,13 @@ in allExtensions = cfg.baseExtensions ++ cfg.optionalExtensions; in { enable = true; - package = pkgs.wrapFirefox pkgs.firefox-unwrapped { + package = config.lib.nixGL.wrap ( pkgs.wrapFirefox pkgs.firefox-unwrapped { nativeMessagingHosts = [ # Tridactyl native connector pkgs.tridactyl-native pkgs.browserpass ]; - }; + }); profiles.ephase = { id = 0; name = "ephase"; From a359d8c06e9ccf5dca59c61016a597eb21a5c8e4 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 16:36:58 +0200 Subject: [PATCH 07/21] chore(qutebrowser): use regular nixgl wrapper --- hosts/rick/home-config.nix | 9 ++----- .../home-manager/web/qutebrowser/default.nix | 24 +------------------ 2 files changed, 3 insertions(+), 30 deletions(-) diff --git a/hosts/rick/home-config.nix b/hosts/rick/home-config.nix index 1be34e0..a72cdf0 100644 --- a/hosts/rick/home-config.nix +++ b/hosts/rick/home-config.nix @@ -24,13 +24,8 @@ kdenlive.enable = false; mpv.enable = false; }; - web.firefox = { - enable = true; - }; - web.qutebrowser = { - enable = true; - enableNixGL = true; - }; + web.firefox.enable = true; + web.qutebrowser.enable = true; web.webcord.enable = false; gaming.lutris.enable = false; desktop.sway = { diff --git a/modules/home-manager/web/qutebrowser/default.nix b/modules/home-manager/web/qutebrowser/default.nix index 81549e1..b626027 100644 --- a/modules/home-manager/web/qutebrowser/default.nix +++ b/modules/home-manager/web/qutebrowser/default.nix @@ -6,35 +6,13 @@ in { options.modules.web.qutebrowser = { enable = mkEnableOption "enable Qutebrowser web browser"; - - enableNixGL = mkOption { - type = types.bool; - default = false; - description = "Use NixGL to start Qutebrowser"; - }; - }; config = mkIf cfg.enable { - xdg.desktopEntries."org.qutebrowser.qutebrowser" = mkIf cfg.enableNixGL { - name = "QuteBrowser NixGL Powered"; - - exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa qutebrowser %u"; - icon = "qutebrowser"; - terminal = false; - type = "Application"; - startupNotify = true; - actions = { - "preference" = { - exec = "${pkgs.nixgl.nixGLMesa}/bin/nixGLMesa qutebrowser \"qute://settings\""; - name = "Preferences"; - }; - }; - }; programs.qutebrowser = { enable = true; + package = config.lib.nixGL.wrap pkgs.qutebrowser; loadAutoconfig = true; settings = { - qt.args = [ "autoplay-policy=user-gesture-required" "ignore-gpu-blocklist" From c1ee8f9d506ea7f1549bbac399ca817480895e9c Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 22:45:13 +0200 Subject: [PATCH 08/21] fix(sway): add possibility to not install swaylock package Useful when using home-manager on third-party distribution. Swaylock from nixpkgs become unable to unlock session because PAM incompatibilities. --- modules/home-manager/desktop/sway/default.nix | 12 +++++++++++- modules/home-manager/desktop/sway/includes/sway.nix | 2 +- .../home-manager/desktop/sway/includes/swayidle.nix | 4 ++-- .../home-manager/desktop/sway/includes/swaylock.nix | 7 ++++--- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 7de3dd6..14ecdbe 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -13,6 +13,16 @@ in description = "configure laptop mode"; }; + swaylock.useNullPackage = mkOption { + type = types.bool; + default = false; + description = '' + Use null package to not install swaylock with Nix + Useful when using Home-Manager on third-party distribution to avoid + problem with PAM + ''; + }; + wallpapers = { lockscreen = mkOption { type = types.str; @@ -114,7 +124,7 @@ in }; iconTheme = { name = "Papirus Dark"; - package = pkgs.papirus-icon-theme; + package = pkgs.papirus-icon-theme; }; font = { name = "Deja Vu Sans"; diff --git a/modules/home-manager/desktop/sway/includes/sway.nix b/modules/home-manager/desktop/sway/includes/sway.nix index d556c05..f93d2c6 100644 --- a/modules/home-manager/desktop/sway/includes/sway.nix +++ b/modules/home-manager/desktop/sway/includes/sway.nix @@ -76,7 +76,7 @@ in "${mod}+Alt+k" = "kill"; "${mod}+Alt+c" = "reload"; "${mod}+Alt+Backspace" = "exec swaynag -t warning -m 'Exit sway?' -B 'Yes' 'swaymsg exit'"; - "${mod}+Alt+l" = "exec ${pkgs.swaylock}/bin/swaylock"; + "${mod}+Alt+l" = if cfg.swaylock.useNullPackage then "exec swaylock" else "exec ${pkgs.swaylock}/bin/swaylock"; # Manage windows placement "${mod}+b" = "splith"; "${mod}+v" = "splitv"; diff --git a/modules/home-manager/desktop/sway/includes/swayidle.nix b/modules/home-manager/desktop/sway/includes/swayidle.nix index 1b22575..5a274da 100644 --- a/modules/home-manager/desktop/sway/includes/swayidle.nix +++ b/modules/home-manager/desktop/sway/includes/swayidle.nix @@ -21,11 +21,11 @@ in events = [ { event = "before-sleep"; - command = "${pkgs.swaylock}/bin/swaylock -f"; + command = if cfg.swaylock.useNullPackage then "swaylock" else "${pkgs.swaylock}/bin/swaylock"; } { event = "lock"; - command = "${pkgs.swaylock}/bin/swaylock -f"; + command = if cfg.swaylock.useNullPackage then "swaylock" else "${pkgs.swaylock}/bin/swaylock"; } ]; }; diff --git a/modules/home-manager/desktop/sway/includes/swaylock.nix b/modules/home-manager/desktop/sway/includes/swaylock.nix index 0bacc89..b0340ef 100644 --- a/modules/home-manager/desktop/sway/includes/swaylock.nix +++ b/modules/home-manager/desktop/sway/includes/swaylock.nix @@ -1,4 +1,4 @@ -{ config, lib, pkgs, ... }: +{ config, lib, pkgs, ... }: with lib; let cfg = config.modules.desktop.sway; @@ -6,9 +6,10 @@ in { config = mkIf config.modules.desktop.sway.enable { programs.swaylock = { + package = if cfg.swaylock.useNullPackage then null else pkgs.swaylock; enable = true; settings = { - image = "${cfg.wallpapers.lockscreen}"; + image = if cfg.wallpapers.lockscreen != "" then "${cfg.wallpapers.lockscreen}" else false; scaling = "center"; color = "000000"; indicator-radius = 70; @@ -22,7 +23,7 @@ in ring-wrong-color = "f268b3"; inside-wrong-color = "f268b3cc"; key-hl-color = "1cd180"; - caps-lock-key-hl-color = "1cd180"; + caps-lock-key-hl-color = "1cd180"; caps-lock-bs-hl-color = "f268b3"; bs-hl-color = "f268b3ff"; separator-color = "00000000"; From 2e22c734de1b32d55718685f929b2a775ac52354 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 22:50:30 +0200 Subject: [PATCH 09/21] feat(work): install sway --- hosts/work/home-config.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hosts/work/home-config.nix b/hosts/work/home-config.nix index d089233..b61215e 100644 --- a/hosts/work/home-config.nix +++ b/hosts/work/home-config.nix @@ -33,6 +33,19 @@ zellij.enable = true; zsh.enable = true; }; + desktop.sway = { + enable = true; + kanshi = true; + swaylock.useNullPackage = true; + waybar = { + laptop = true; + gpuThermal.enable = false; + cpuThermal = { + hwmonPathAbs = "/sys/devices/platform/coretemp.0/hwmon/"; + inputFilename = "temp1_input"; + }; + }; + }; web.firefox = { enable = true; optionalExtensions = with pkgs.nur.repos.rycee.firefox-addons; [ From 89cc43f245af895c715a4e3a45e244e7d3083bb3 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 25 Aug 2025 19:10:23 +0200 Subject: [PATCH 10/21] chore(work): add keyboard configuration --- hosts/work/includes/home-manager.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hosts/work/includes/home-manager.nix b/hosts/work/includes/home-manager.nix index 1d1c542..1bcf8e3 100644 --- a/hosts/work/includes/home-manager.nix +++ b/hosts/work/includes/home-manager.nix @@ -16,4 +16,14 @@ ]; targets.genericLinux.enable = true; xdg.mime.enable = true; + wayland.windowManager.sway.config.input = { + "1:1:AT_Translated_Set_2_keyboard" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + }; + "65261:8800:KBDFans_DZ60" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + }; + }; } From 6a8beb894d7da5d170ca11ab1e408cb3dacd5db2 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 25 Aug 2025 19:11:56 +0200 Subject: [PATCH 11/21] chore(work): add kanshi configuration --- .../desktop/sway/includes/kanshi.nix | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/modules/home-manager/desktop/sway/includes/kanshi.nix b/modules/home-manager/desktop/sway/includes/kanshi.nix index a0453e3..8376511 100644 --- a/modules/home-manager/desktop/sway/includes/kanshi.nix +++ b/modules/home-manager/desktop/sway/includes/kanshi.nix @@ -10,7 +10,7 @@ with lib; profile.name = "standalone"; profile.outputs = [ { - criteria = "eDP-1"; + criteria = "eDP-1"; scale = 1.33; status = "enable"; } @@ -20,13 +20,13 @@ with lib; profile.name = "home"; profile.outputs = [ { - criteria = "Iiyama North America PL2792UH 1166310803122"; + criteria = "Iiyama North America PL2792UH 1166310803122"; mode = "3840x2160"; position = "1235,0"; scale = 1.75; } - { - criteria = "Iiyama North America PL2792UH 1176923201598"; + { + criteria = "Iiyama North America PL2792UH 1176923201598"; mode = "3840x2160"; position = "0,0"; transform = "90"; @@ -42,18 +42,16 @@ with lib; profile.name = "work"; profile.outputs = [ { - criteria = "Iiyama North America PL2480H 11183M2807013"; - mode = "1920x1080"; - position = "0,0"; - } - { - criteria = "Iiyama North America PL2480H 11183M2807016"; - mode = "1920x1080"; - position = "1920,0"; + criteria = "Iiyama North America PL2792QN 1179214201663"; + mode = "2560x1440"; + position = "1450,0"; + scale = 1.15; } { - criteria = "eDP-1"; - status = "disable"; + criteria = "BOE 0x0A95 Unknown"; + mode = "1920x1080"; + position = "0,0"; + scale = 1.325; } ]; } From 94fce63f6f1799be881b99d0d6e737f81f8150a8 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 25 Aug 2025 23:58:13 +0200 Subject: [PATCH 12/21] fix(sway): swaylock unlable to unlock when installed on non-NixOS --- modules/home-manager/desktop/sway/includes/swayidle.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/home-manager/desktop/sway/includes/swayidle.nix b/modules/home-manager/desktop/sway/includes/swayidle.nix index 5a274da..577621c 100644 --- a/modules/home-manager/desktop/sway/includes/swayidle.nix +++ b/modules/home-manager/desktop/sway/includes/swayidle.nix @@ -10,7 +10,7 @@ in timeouts = [ { timeout = 300; - command = "${pkgs.swaylock}/bin/swaylock -f"; + command = if cfg.swaylock.useNullPackage then ''/usr/bin/swaylock -f'' else ''${pkgs.swaylock}/bin/swaylock -f''; } { timeout = 600; @@ -21,11 +21,11 @@ in events = [ { event = "before-sleep"; - command = if cfg.swaylock.useNullPackage then "swaylock" else "${pkgs.swaylock}/bin/swaylock"; + command = if cfg.swaylock.useNullPackage then ''/usr/bin/swaylock -f'' else ''${pkgs.swaylock}/bin/swaylock -f''; } { event = "lock"; - command = if cfg.swaylock.useNullPackage then "swaylock" else "${pkgs.swaylock}/bin/swaylock"; + command = if cfg.swaylock.useNullPackage then ''usr/bin/swaylock -f'' else ''${pkgs.swaylock}/bin/swaylock -f''; } ]; }; From d5ca13547f2b829d9a99ce200d0c8884e3b87262 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 25 Aug 2025 23:59:46 +0200 Subject: [PATCH 13/21] feat(work): install slack and chromium --- hosts/work/includes/home-manager.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hosts/work/includes/home-manager.nix b/hosts/work/includes/home-manager.nix index 1bcf8e3..5316a17 100644 --- a/hosts/work/includes/home-manager.nix +++ b/hosts/work/includes/home-manager.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ pkgs, config, ... }: { home.packages = with pkgs; [ dejavu_fonts @@ -13,6 +13,8 @@ noto-fonts-cjk-sans slurp wl-clipboard + (config.lib.nixGL.wrap ungoogled-chromium) + (config.lib.nixGL.wrap slack) ]; targets.genericLinux.enable = true; xdg.mime.enable = true; From 7c5882f2c53244e82d92c4523ee7ad6086e13114 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 26 Aug 2025 00:01:17 +0200 Subject: [PATCH 14/21] fix(sway): use wayland backend for chromium based crap --- modules/home-manager/desktop/sway/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 14ecdbe..817f5fa 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -143,8 +143,10 @@ in }; }; - # Avoid pixelated effect for QT application with fractionnal scaling home.sessionVariables = { + # Use wayland for chrom{e|ium} based crap + NIXOS_OZONE_WL = "1"; + # Avoid pixelated effect for QT application with fractionnal scaling QT_SCALE_FACTOR_ROUNDING_POLICY = "RoundPreferFloor"; }; From fc30593e0ab98b0ede4228503047a70865457b71 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 26 Aug 2025 22:41:01 +0200 Subject: [PATCH 15/21] chore(work): add gnupg as SSH agent --- hosts/work/home-config.nix | 5 +---- hosts/work/includes/home-manager.nix | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hosts/work/home-config.nix b/hosts/work/home-config.nix index b61215e..d637898 100644 --- a/hosts/work/home-config.nix +++ b/hosts/work/home-config.nix @@ -2,10 +2,7 @@ config.modules = { application = { zathura.enable = true; - foot = { - enable = true; - font-size = "10.5"; - }; + foot.enable = true; }; audio.cmus.enable = true; cli = { diff --git a/hosts/work/includes/home-manager.nix b/hosts/work/includes/home-manager.nix index 5316a17..92fc843 100644 --- a/hosts/work/includes/home-manager.nix +++ b/hosts/work/includes/home-manager.nix @@ -28,4 +28,8 @@ xkb_variant = "altgr-intl"; }; }; + + home.sessionVariables = { + SSH_AUTH_SOCK = ''$XDG_RUNTIME_DIR/gnupg/S.gpg-agent.ssh''; + }; } From 0b053e3db269245caa7b04fb24f611be2d6e666f Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 26 Aug 2025 22:42:18 +0200 Subject: [PATCH 16/21] fix(desktop): make screen sharing work --- modules/home-manager/desktop/sway/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 817f5fa..776b0e9 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -173,6 +173,7 @@ in portal = { enable = true; extraPortals = with pkgs; [ + xdg-desktop-portal xdg-desktop-portal-wlr xdg-desktop-portal-gtk ]; From 308d6fca814ae5ea9c01387eaacb3405ecff47f7 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 26 Aug 2025 22:43:22 +0200 Subject: [PATCH 17/21] chore(waybar): apply icons name upstream change for audio module --- .../home-manager/desktop/sway/includes/waybar.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/home-manager/desktop/sway/includes/waybar.nix b/modules/home-manager/desktop/sway/includes/waybar.nix index df1a1f1..d46baf1 100644 --- a/modules/home-manager/desktop/sway/includes/waybar.nix +++ b/modules/home-manager/desktop/sway/includes/waybar.nix @@ -1,4 +1,4 @@ -{lib, config, ...}: +{lib, config, ...}: with lib; let cfg = config.modules.desktop.sway; @@ -22,7 +22,7 @@ in "sway/mode" ]; modules-right = [ - "network" + "network" "custom/sep" ] ++ ( if cfg.waybar.laptop then [ @@ -38,15 +38,15 @@ in "memory" "cpu" "temperature" - "custom/sep" + "custom/sep" ] ++ ( if cfg.waybar.gpuThermal.enable then [ "temperature#gpu" "custom/sep" - ] + ] else [ ] - ) ++ + ) ++ [ "pulseaudio" "custom/sep" @@ -101,8 +101,8 @@ in "format-icons" = { "car" = ""; "default" = ""; - "handsfree" = "󰋎"; - "headphones" = "󰋋"; + "hands-free" = "󰋎"; + "headphone" = "󰋋"; "headset" = "󰋎"; "phone" = ""; "portable" = ""; From c7e8ec06286287a8f9a45f83815f456156895735 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 27 Aug 2025 21:59:49 +0200 Subject: [PATCH 18/21] feat(desktop): make portals installation configurable --- hosts/work/home-config.nix | 1 + modules/home-manager/desktop/sway/default.nix | 33 +++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/hosts/work/home-config.nix b/hosts/work/home-config.nix index d637898..0155435 100644 --- a/hosts/work/home-config.nix +++ b/hosts/work/home-config.nix @@ -42,6 +42,7 @@ inputFilename = "temp1_input"; }; }; + xdg.useDistributionPortals = true; }; web.firefox = { enable = true; diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 776b0e9..643e192 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -23,6 +23,16 @@ in ''; }; + xdg.useDistributionPortals = mkOption { + type = types.bool; + default = false; + description = '' + This prevent installing xdg-desktop-portal from nixpkgs. These + Useful when using Home-Manager on third-party distribution with old + version of portals (coucou Ubuntu LTS) + ''; + }; + wallpapers = { lockscreen = mkOption { type = types.str; @@ -170,21 +180,32 @@ in desktop = "${config.home.homeDirectory}/documents"; publicShare = "${config.home.homeDirectory}/tmp/public"; }; - portal = { + portal = mkIf (cfg.xdg.useDistributionPortals == false) { enable = true; extraPortals = with pkgs; [ - xdg-desktop-portal xdg-desktop-portal-wlr xdg-desktop-portal-gtk ]; xdgOpenUsePortal = true; config = { - sway.default = [ - "wlr" - "gtk" - ]; + sway = { + default = [ + "wlr" + "gtk" + ]; + }; }; }; }; + + # When using `useDistributionPackage`, create wlr configuration to let user + # choose the right screen. This is a workarount to not have to configure + # it manually. + home.file."${config.xdg.configHome}/xdg-desktop-portal-wlr/config".text = mkIf cfg.xdg.useDistributionPortals '' + [screencast] + max_fps=30 + chooser_type=simple + chooser_cmd=${pkgs.slurp}/bin/slurp -f %o -or + ''; }; } From 35557352cb3144329d53dba89827d2f86b45f2a6 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 21 Aug 2025 00:35:31 +0200 Subject: [PATCH 19/21] chore: upgrade packages repositories --- flake.lock | 76 ++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 40 deletions(-) diff --git a/flake.lock b/flake.lock index a694efb..aec59a7 100644 --- a/flake.lock +++ b/flake.lock @@ -22,12 +22,15 @@ } }, "flake-utils": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -43,11 +46,11 @@ ] }, "locked": { - "lastModified": 1748955489, - "narHash": "sha256-OmZXyW2g5qIuo5Te74McwR0TwauCO2sF3/SjGDVuxyg=", + "lastModified": 1755810213, + "narHash": "sha256-QdenO8f0PTg+tC6HuSvngKcbRZA5oZKmjUT+MXKOLQg=", "owner": "nix-community", "repo": "home-manager", - "rev": "bb846c031be68a96466b683be32704ef6e07b159", + "rev": "6911d3e7f475f7b3558b4f5a6aba90fa86099baa", "type": "github" }, "original": { @@ -61,10 +64,10 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1755552883, - "narHash": "sha256-wdVtGyN8JkpByIiNwSevZMBy02vWwCPNaD/caCQJ6aM=", + "lastModified": 1755761639, + "narHash": "sha256-rEvyLY/3u1RfxsySyqScM3peGUVNJNmGApHVyIY7Cx0=", "ref": "main", - "rev": "1ccd39ac6de09a7a73a9a36ec1c34f70cb5edfe2", + "rev": "d73f46baaff8c9fff2a7b11c97413ea3fb171584", "shallow": true, "type": "git", "url": "ssh://git@git.epha.se:24422/ephase/nix-private.git" @@ -84,11 +87,11 @@ ] }, "locked": { - "lastModified": 1713543440, - "narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=", + "lastModified": 1752054764, + "narHash": "sha256-Ob/HuUhANoDs+nvYqyTKrkcPXf4ZgXoqMTQoCK0RFgQ=", "owner": "nix-community", "repo": "nixGL", - "rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a", + "rev": "a8e1ce7d49a149ed70df676785b07f63288f53c5", "type": "github" }, "original": { @@ -113,11 +116,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1748693115, - "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", + "lastModified": 1755615617, + "narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc", + "rev": "20075955deac2583bb12f07151c2df830ef346b4", "type": "github" }, "original": { @@ -128,11 +131,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1748693115, - "narHash": "sha256-StSrWhklmDuXT93yc3GrTlb0cKSS0agTAxMGjLKAsY8=", + "lastModified": 1755615617, + "narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "910796cabe436259a29a72e8d3f5e180fc6dfacc", + "rev": "20075955deac2583bb12f07151c2df830ef346b4", "type": "github" }, "original": { @@ -145,15 +148,14 @@ "nur": { "inputs": { "flake-parts": "flake-parts", - "nixpkgs": "nixpkgs_3", - "treefmt-nix": "treefmt-nix" + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1748973087, - "narHash": "sha256-ZN0XKKdCBC9eLeog7qYhfGPbajkPtQPdlxp/dhwONw4=", + "lastModified": 1755877557, + "narHash": "sha256-AjUqNCIgjQKfhvH+HUXZQLlSDiRTFQPSPN8Ws/O7mVQ=", "owner": "nix-community", "repo": "NUR", - "rev": "90add46380908ba4395f5f1dfec84224a3b0d4b9", + "rev": "332abf45be8133422a97e134b35782400ffc65bd", "type": "github" }, "original": { @@ -179,11 +181,11 @@ ] }, "locked": { - "lastModified": 1747603214, - "narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=", + "lastModified": 1754988908, + "narHash": "sha256-t+voe2961vCgrzPFtZxha0/kmFSHFobzF00sT8p9h0U=", "owner": "Mic92", "repo": "sops-nix", - "rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd", + "rev": "3223c7a92724b5d804e9988c6b447a0d09017d48", "type": "github" }, "original": { @@ -192,24 +194,18 @@ "type": "github" } }, - "treefmt-nix": { - "inputs": { - "nixpkgs": [ - "nur", - "nixpkgs" - ] - }, + "systems": { "locked": { - "lastModified": 1733222881, - "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", - "owner": "numtide", - "repo": "treefmt-nix", - "rev": "49717b5af6f80172275d47a418c9719a31a78b53", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { - "owner": "numtide", - "repo": "treefmt-nix", + "owner": "nix-systems", + "repo": "default", "type": "github" } } From eeb7f1fe5a3b4b28cc47d82a4329ee2c6a3f69e7 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 21 Aug 2025 00:36:33 +0200 Subject: [PATCH 20/21] chore(zsh): modifications related to upstream changes --- modules/home-manager/cli/zsh/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/home-manager/cli/zsh/default.nix b/modules/home-manager/cli/zsh/default.nix index 108dd36..c9b145a 100644 --- a/modules/home-manager/cli/zsh/default.nix +++ b/modules/home-manager/cli/zsh/default.nix @@ -10,14 +10,14 @@ in config = mkIf cfg.enable { programs.zsh = { enable = true; - dotDir = ".config/zsh"; + dotDir = "${config.xdg.configHome}/zsh"; defaultKeymap = "viins"; enableCompletion = true; history = { ignoreAllDups = true; save = 10000; share = true; - path = "$HOME/.local/share/zsh/history"; + path = "${config.xdg.dataHome }/zsh/history"; }; historySubstringSearch = { enable = true; @@ -108,7 +108,7 @@ in }; }]; localVariables = { - BASE16_THEME = "$HOME/.config/zsh/plugins/base16"; + BASE16_THEME = "${config.xdg.configHome}/zsh/plugins/base16"; # Make ESC key more reactive to go to normal mode KEYTIMEOUT = 1; }; From 3ebb38d6d4d2d15e2312aa780e7c7b0311c1126a Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 22 Aug 2025 19:08:38 +0200 Subject: [PATCH 21/21] fix(overlay): workaround for widevine-cdm nos available on google cdn --- nixos/includes/system/overlay.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/nixos/includes/system/overlay.nix b/nixos/includes/system/overlay.nix index d4c3daa..fe64130 100644 --- a/nixos/includes/system/overlay.nix +++ b/nixos/includes/system/overlay.nix @@ -1,10 +1,21 @@ { inputs, pkgs, ...}: { nixpkgs.overlays = [ - (final: prev: { - qutebrowser = prev.qutebrowser.override { - enableWideVine = if pkgs.system == "x86_64-linux" then true else false; - }; + (final: prev: { + qutebrowser = prev.qutebrowser.override { + enableWideVine = if pkgs.system == "x86_64-linux" then true else false; + # Get Widevine friom slackware as google CDN seems to not working anymore + # TODO: Remove this when resolved upstream + # https://github.com/NixOS/nixpkgs/issues/435671 + widevine-cdm = pkgs.widevine-cdm.overrideAttrs (oldAttrs: { + src = pkgs.fetchzip { + url = "https://alien.slackbook.org/slackbuilds/chromium-widevine-plugin/build/4.10.2891.0-linux-x64.zip" ; + hash = "sha256-ZO6FmqJUnB9VEJ7caJt58ym8eB3/fDATri3iOWCULRI"; + + stripRoot = false; + }; + }); + }; }) inputs.nur.overlays.default ];