From c6f08ef074c6eacea05dc53c2bb1229156d2434a Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 15:19:17 +0200 Subject: [PATCH 01/70] 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 a26f773f011b9cef6cf3d619d76c881fbad90cf1 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 15:28:12 +0200 Subject: [PATCH 02/70] 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 cb47a9aedaf814a28f688616ed50bd824594a4ee Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 15:37:21 +0200 Subject: [PATCH 03/70] 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 28ea3fd3e8ae36d093f479d8f60a9a49a84fa6ee Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 16:24:56 +0200 Subject: [PATCH 04/70] 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 85520706655be6ab0be73245646d8299afb9cd91 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 16:36:58 +0200 Subject: [PATCH 05/70] 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 bfd8d8193d0acdf2c9f57f26b9a36a81f01b7201 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 22:45:13 +0200 Subject: [PATCH 06/70] 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 65fd07bbec766e089da94c8d91643d9e4fdf7f3b Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sun, 24 Aug 2025 22:50:30 +0200 Subject: [PATCH 07/70] 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 7d4f0b3eb6b34ffaf94aa10ff1c6a97e64155c84 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 25 Aug 2025 19:10:23 +0200 Subject: [PATCH 08/70] 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 ea62c7207eff707470782c2d5457fb6f239b651f Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 25 Aug 2025 19:11:56 +0200 Subject: [PATCH 09/70] 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 fbd0aa4f76c1127ae7dadb426ff8ee23b2d3f3b0 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 25 Aug 2025 23:58:13 +0200 Subject: [PATCH 10/70] 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 75905415763390c4cfa6ecb10a93eec592171924 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 25 Aug 2025 23:59:46 +0200 Subject: [PATCH 11/70] 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 58b256850c268705f1b82793c58a3193d78e4d83 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 26 Aug 2025 00:01:17 +0200 Subject: [PATCH 12/70] 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 9e4fbf121632857812e941a8b5805d3cc1ad5bec Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 26 Aug 2025 22:41:01 +0200 Subject: [PATCH 13/70] 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 13b1b72ab3e217fd1fd43820a40f9c3d518ffa49 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 26 Aug 2025 22:42:18 +0200 Subject: [PATCH 14/70] 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 f12c757732a2810e5f4bacbb1619847f212148fa Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 26 Aug 2025 22:43:22 +0200 Subject: [PATCH 15/70] 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 03f2102630f418d6b398bc37bcfdfb6bae917127 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 27 Aug 2025 21:59:49 +0200 Subject: [PATCH 16/70] 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 0b49ad2e921297da812dd0b7c49493f9452be44a Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 20 Aug 2025 23:52:45 +0200 Subject: [PATCH 17/70] 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 18/70] 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 19/70] 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 20/70] 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 21/70] 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 22/70] 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 23/70] 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 24/70] 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 25/70] 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 26/70] 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 27/70] 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 28/70] 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 29/70] 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 30/70] 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 31/70] 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 32/70] 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 33/70] 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 34/70] 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 35/70] 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 36/70] 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 ]; From 720bd2f391f2221132c15e4a76b6a40175c2da02 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 27 Aug 2025 22:50:07 +0200 Subject: [PATCH 37/70] fix(desktop): fix xdg-wlr file creation --- modules/home-manager/desktop/sway/default.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 643e192..4f53efa 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -197,15 +197,17 @@ in }; }; }; - + # 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 - ''; + home.file = mkIf cfg.xdg.useDistributionPortals { + "${config.xdg.configHome}/xdg-desktop-portal-wlr/config".text = '' + [screencast] + max_fps=30 + chooser_type=simple + chooser_cmd=${pkgs.slurp}/bin/slurp -f %o -or + ''; + }; }; } From 0a4a477c2522358d2dc1d6cef6a67d3b5cfa724b Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 27 Aug 2025 23:04:52 +0200 Subject: [PATCH 38/70] chore(nvim): update nvim-k8s-lsp plugins --- 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 a86a177..993cb90 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -31,7 +31,7 @@ let version = "main"; src = builtins.fetchGit { url = "https://github.com/tonychg/nvim-k8s-lsp.git"; - rev = "930aa20bcd54f2d6f16040e98ff4068b292c6c7f"; + rev = "1dffda65f4fe117f67514ed5d93b18f62be1ef24"; ref = "main"; }; }; From ef733f10a35d8d17c34705999de30b6b1958598e Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Wed, 27 Aug 2025 23:07:14 +0200 Subject: [PATCH 39/70] chore(nvim): add go treesitter plugin --- modules/home-manager/cli/neovim/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index 993cb90..ee3302e 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -167,6 +167,7 @@ in p.cpp p.cmake p.dockerfile + p.go p.hcl p.helm p.javascript From c66ff4d68b3a9f53b20aff1bd1b0afa6e2d06e23 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 28 Aug 2025 21:22:12 +0200 Subject: [PATCH 40/70] chore(mrmeeseeks): update home configuration regarding new options --- hosts/mrmeeseeks/home-config.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hosts/mrmeeseeks/home-config.nix b/hosts/mrmeeseeks/home-config.nix index e180376..d00ab09 100644 --- a/hosts/mrmeeseeks/home-config.nix +++ b/hosts/mrmeeseeks/home-config.nix @@ -1,7 +1,10 @@ -{ ... }: { +{ inputs, ... }: { config.modules = { application = { - gnupg.enable = true; + gnupg = { + enable = true; + enableSshSupport = true; + }; zathura.enable = true; foot.enable = true; }; @@ -11,7 +14,10 @@ git.enable = true; neovim.enable = true; starship.enable = true; - tmux.enable = true; + tmux = { + enable = true; + extraConfig = inputs.nix-private.tmux.personal; + }; utils.enable = true; vifm.enable = true; zsh.enable = true; From cc2a15873253895e6d7e53965c8d44884fe80685 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 29 Aug 2025 12:53:26 +0200 Subject: [PATCH 41/70] feat(sway): add screenshot functionality --- .../desktop/sway/includes/sway.nix | 82 ++++++++++++++++++- 1 file changed, 80 insertions(+), 2 deletions(-) diff --git a/modules/home-manager/desktop/sway/includes/sway.nix b/modules/home-manager/desktop/sway/includes/sway.nix index f93d2c6..ef2ebbc 100644 --- a/modules/home-manager/desktop/sway/includes/sway.nix +++ b/modules/home-manager/desktop/sway/includes/sway.nix @@ -87,8 +87,11 @@ in "${mod}+Shift+space" = "floating toggle"; "${mod}+space" = "focus mode_toggle"; "${mod}+a" = "focus parent"; - "${mod}+Shift+p" = "move scratchpad"; - "${mod}+p" = "scratchpad show"; + "${mod}+Shift+minus" = "move scratchpad"; + "${mod}+minus" = "scratchpad show"; + "${mod}+p" = "exec screenshot window"; + "${mod}+Shift+p" = "exec screenshot screen"; + "${mod}+Alt+p" = "mode screenshot"; # Media stuff "${mod}+F1" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 1%-"; "${mod}+F2" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +1%"; @@ -118,6 +121,17 @@ in "r" = "exec ${pkgs.mako}/bin/makoctl restore"; "Escape" = "mode default"; }; + "screenshot" = { + "s" = "exec screenshot screen; mode default"; + "Shift+s" = "exec screenshot screen -f; mode default"; + "r" = "exec screenshot region; mode default"; + "Shift+r" = "exec screenshot region -f; mode default"; + "w" = "exec screenshot window; mode default"; + "Shift+w" = "exec screenshot window -f; mode default"; + "Return" = "mode default"; + "Escape" = "mode default"; + }; + }; colors = { focused = { @@ -214,5 +228,69 @@ in title_align right ''; }; + home.file.".local/bin/screenshot" = { + executable = true; + text = '' + #!/usr/bin/env bash + set -eu -o pipefail + + SWAYMSG="${pkgs.sway}/bin/swaymsg" + JQ="${pkgs.jq}/bin/jq" + WLCOPY="${pkgs.wl-clipboard}/bin/wl-copy" + GRIM="${pkgs.grim}/bin/grim" + SLURP="${pkgs.slurp}/bin/slurp" + + # What we want to screenshot + case ''${1:-} in + region) + RECT=$(''$SLURP) + APPNAME="-region" + OUTPUT=$(''${SWAYMSG} -t get_outputs | ''${JQ} -r '.[] | select(.focused) | "\(.name)"') + COMMAND=( + "''${GRIM}" + -g + "''$RECT" + ) + ;; + screen) + OUTPUT=$(''${SWAYMSG} -t get_outputs | ''${JQ} -r '.[] | select(.focused) | "\(.name)"') + COMMAND=( + "''${GRIM}" + -o + "''${OUTPUT}" + ) + ;; + window) + RECT=$(''${SWAYMSG} -t get_tree | ''${JQ} -r '.. | ((.nodes? // empty) + (.floating_nodes? // empty))[] | select(.visible and .pid and .focused) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' ) + APPNAME=$(''${SWAYMSG} -t get_tree | ''${JQ} -r '.. | ((.nodes? // empty) + (.floating_nodes? // empty))[] | select(.visible and .pid and .focused) | "\(.app_id)"') + COMMAND=( + "''${GRIM}" + -g + "''${RECT}" + ) + ;; + *) + >&2 printf "Can't understand what you need\n" + exit 1 + esac + + # Where we want to put it + case ''${2:-"-c"} in + -c|--clipboard) + COMMAND+=(-) + "''${COMMAND[@]}" | ''${WLCOPY} + ;; + -f|--file) + PICTURES_DIR="''${XDG_PICTURES_DIR}/screenshots" + mkdir -p "''${PICTURES_DIR}" + printf -v DATE '%(%F_%H.%M.%S)T' + printf -v FILE "%s/%s-%s%s.png" "''${PICTURES_DIR}" "''${DATE}" "''${OUTPUT:-""}" "''${APPNAME:-""}" + "''${COMMAND[@]}" "''${FILE//\"/}" + ;; + esac + exit 0 + ''; + }; + }; } From 8e5ac13e944311d363a425cdfbffe16f5eb3c445 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 29 Aug 2025 22:57:27 +0200 Subject: [PATCH 42/70] feat(waybar): rework theme and configuration --- .../sway/includes/files/waybar-style.css | 119 +++++++++++++++ .../desktop/sway/includes/waybar.nix | 141 ++---------------- 2 files changed, 135 insertions(+), 125 deletions(-) create mode 100644 modules/home-manager/desktop/sway/includes/files/waybar-style.css diff --git a/modules/home-manager/desktop/sway/includes/files/waybar-style.css b/modules/home-manager/desktop/sway/includes/files/waybar-style.css new file mode 100644 index 0000000..ffc4be3 --- /dev/null +++ b/modules/home-manager/desktop/sway/includes/files/waybar-style.css @@ -0,0 +1,119 @@ +@define-color color-base-bg #323232; +@define-color color-base-fg #ddd; + +@define-color color-hover #f268b3; +@define-color color-selected #1cd180; + +@define-color color-ok #1cd180; +@define-color color-warning #f2b768; +@define-color color-critical #f268b3; + +* { + border: none; + border-radius: 0; + min-height:0; +} + +window#waybar { + background: @color-base-bg ; + color: @color-base-fg; + font-family: "Fira Code Nerd Font"; + font-size: 12px; +} + +button, +button:disabled,label:disabled{ + color:inherit; +} + +button:hover{ + background:none; + box-shadow:inherit; + box-shadow:inherit; + text-shadow:inherit; + text-shadow:inherit; + border-top:none; +} +#workspaces { + color:#fff; +} +#workspaces button { + margin:0 3px; + padding:4px 4px; + color:#9c9c9c; + border-bottom: 1px solid transparent; +} + +#workspaces button:hover { + box-shadow:inherit; + text-shadow:inherit; + color: @color-hover; + border-bottom: 1px solid @color-hover; +} + +#workspaces button.focused { + background: @color-selected; + color: @color-base-bg; +} +#workspaces button.visible:not(.focused) { + color: @color-selected; + border-color: @color-selected; +} + +#clock, +#cpu, +#memory, +#backlight, +#network, +#tray, +#mode, +#battery, +#idle_inhibitor { + padding: 2px 4px; + margin: 0; + background-color: transparent; +} + +#mode{ + background:@color-warning; + color: @color-base-bg; + font-weight:200; + font-variant: small-caps; + font-size: 16px; +} +#pulseaudio {} +#pulseaudio.output.muted { + color:@color-critical; +} +#pulseaudio.input.source-muted { + color:@color-critical; +} + +#battery.discharging { + color: @color-base-fg; + border-bottom: none; +} + +#battery.charging, #battery.plugged { + border-bottom: 1px solid @color-ok; + color: @color-selected; +} + +#battery.critical:not(.charging), +#cpu.critical, +#memory.critical{ + border-color: @color-critical; + color: @color-critical; +} + +#battery.warning:not(.charging), +#cpu.warning, +#memory.warning{ + border-color: @color-warning; + color: @color-warning; +} + +#tray { + font-family: "DejaVu sans"; + font-size: 12px; +} diff --git a/modules/home-manager/desktop/sway/includes/waybar.nix b/modules/home-manager/desktop/sway/includes/waybar.nix index d46baf1..f9c2e6a 100644 --- a/modules/home-manager/desktop/sway/includes/waybar.nix +++ b/modules/home-manager/desktop/sway/includes/waybar.nix @@ -48,7 +48,8 @@ in ] ) ++ [ - "pulseaudio" + "pulseaudio#input" + "pulseaudio#output" "custom/sep" "clock" "custom/sep" @@ -88,27 +89,31 @@ in }; }; "network" = { - "format-alt" = "{ifname}: {ipaddr}/{cidr}"; + "format-alt" = "{ifname}: {ipaddr}/{cidr} 󰈀"; "format-disconnected" = "Disconnected ⚠ "; - "format-ethernet" = "{ifname}: {ipaddr}/{cidr} 󰈀 "; - "format-linked" = "{ifname} (No IP) 󰈀 "; - "format-wifi" = "{essid} ({signalStrength}%)  "; + "format-ethernet" = "{ifname} 󰈀"; + "format-linked" = "{ifname} (No IP) 󰈀"; + "format-wifi" = "{essid} ({signalStrength}%) "; "tooltip" = false; }; - "pulseaudio" = { - "format" = "{format_source} {volume}% {icon} "; + "pulseaudio#output" = { + "format" = "{volume}% {icon} "; "format-bluetooth" = "{volume}% {icon}"; "format-icons" = { "car" = ""; - "default" = ""; + "default" = "󰕾"; "hands-free" = "󰋎"; "headphone" = "󰋋"; "headset" = "󰋎"; "phone" = ""; "portable" = ""; }; - "format-muted" = "{format_source} 󰝟 "; - "format-source" = "{volume}%  "; + "format-muted" = "󰖁 "; + "tooltip" = false; + }; + "pulseaudio#input" = { + "format" = "{format_source} "; + "format-source" = "{volume}% "; "format-source-muted" = " "; "tooltip" = false; }; @@ -170,121 +175,7 @@ in }; }; }; - style = '' - @define-color color-base-bg #323232; - @define-color color-base-fg #ddd; - - @define-color color-hover #f268b3; - @define-color color-selected #1cd180; - - @define-color color-ok #1cd180; - @define-color color-warning #f2b768; - @define-color color-critical #f268b3; - - * { - border: none; - border-radius: 0; - min-height:0; - } - - window#waybar { - background: @color-base-bg ; - color: @color-base-fg; - font-family: "Fira Code Nerd Font"; - font-size: 12px; - } - - button, - button:disabled,label:disabled{ - color:inherit; - } - - button:hover{ - background:none; - box-shadow:inherit; - box-shadow:inherit; - text-shadow:inherit; - text-shadow:inherit; - border-top:none; - } - #workspaces { - color:#fff; - } - #workspaces button { - margin:0 3px; - padding:4px 4px; - color:#9c9c9c; - border-bottom: 1px solid transparent; - } - - #workspaces button:hover { - box-shadow:inherit; - text-shadow:inherit; - color: @color-hover; - border-bottom: 1px solid @color-hover; - } - - #workspaces button.focused { - background: @color-selected; - color: @color-base-bg; - } - #workspaces button.visible:not(.focused) { - color: @color-selected; - border-color: @color-selected; - } - - #clock, - #cpu, - #memory, - #backlight, - #network, - #tray, - #mode, - #battery, - #idle_inhibitor { - padding: 2px 4px; - margin: 0; - background-color: transparent; - } - - #mode{ - background:@color-warning; - font-weight:bold; - } - #pulseaudio {} - #pulseaudio.muted { - color:@color-critical; - } - - #battery.discharging { - color: @color-base-fg; - border-bottom: none; - } - - #battery.charging, #battery.plugged { - border-bottom: 1px solid @color-ok; - color: @color-selected; - } - - #battery.critical:not(.charging), - #cpu.critical, - #memory.critical{ - border-color: @color-critical; - color: @color-critical; - } - - #battery.warning:not(.charging), - #cpu.warning, - #memory.warning{ - border-color: @color-warning; - color: @color-warning; - } - - #tray { - font-family: "DejaVu sans"; - font-size: 12px; - } - ''; + style = builtins.readFile ./files/waybar-style.css; }; }; } From 38267e65307cf589427e92a254332f903e257a50 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 29 Aug 2025 22:58:34 +0200 Subject: [PATCH 43/70] fix(desktop): avoid using gnome-software to open stuff with xdg --- modules/home-manager/desktop/sway/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 4f53efa..2b2dc67 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -186,7 +186,7 @@ in xdg-desktop-portal-wlr xdg-desktop-portal-gtk ]; - xdgOpenUsePortal = true; + xdgOpenUsePortal = false; config = { sway = { default = [ From 2dca1fb2544f69bdb4bb4df29f0b1e7c66953eca Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 29 Aug 2025 23:24:46 +0200 Subject: [PATCH 44/70] chore(gnupg): remove duplicate code --- modules/home-manager/application/gnupg/default.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/modules/home-manager/application/gnupg/default.nix b/modules/home-manager/application/gnupg/default.nix index 53a24f1..62a2aab 100644 --- a/modules/home-manager/application/gnupg/default.nix +++ b/modules/home-manager/application/gnupg/default.nix @@ -46,12 +46,6 @@ in noAllowExternalCache = true; }; - home.sessionVariablesExtra = lib.mkIf cfg.enableSshSupport '' - if [[ -z "''${SSH_AUTH_SOCK}" ]]; then - export SSH_AUTH_SOCK="$(${config.programs.gpg.package}/bin/gpgconf --list-dirs agent-ssh-socket)" - fi - ''; - services.ssh-agent.enable = if cfg.enableSshSupport then false else true; programs.password-store = { enable = cfg.pass; From 0fc804a42d3f39821f41144edad066954d3a4814 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 1 Sep 2025 00:58:03 +0200 Subject: [PATCH 45/70] refactor(sway): rework the whole screen capture part --- modules/home-manager/desktop/sway/default.nix | 3 + .../desktop/sway/includes/files/screencapt.sh | 160 ++++++++++++++++++ .../desktop/sway/includes/sway.nix | 91 +++------- 3 files changed, 184 insertions(+), 70 deletions(-) create mode 100755 modules/home-manager/desktop/sway/includes/files/screencapt.sh diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 2b2dc67..024cb23 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -107,6 +107,8 @@ in # emojione font-awesome grim + hicolor-icon-theme + jq lato liberation_ttf libertine @@ -117,6 +119,7 @@ in noto-fonts-cjk-sans slurp wl-clipboard + wl-screenrec xdg-utils ]; diff --git a/modules/home-manager/desktop/sway/includes/files/screencapt.sh b/modules/home-manager/desktop/sway/includes/files/screencapt.sh new file mode 100755 index 0000000..16b8375 --- /dev/null +++ b/modules/home-manager/desktop/sway/includes/files/screencapt.sh @@ -0,0 +1,160 @@ +#!/usr/bin/env bash +set -eu -o pipefail + +APP_NAME="ScreenCapt" + +declare -A COMMAND +COMMAND=( + [screenshot]="grim" + [video]="wl-screenrec" +) +declare -A ICONS +ICONS=( + ["screenshot"]="accessories-screenshot" + ["video"]="record-desktop" +) + +declare -A OUTPUT_DIR +OUTPUT_DIR=( + ["screenshot"]="${XDG_PICTURES_DIR:-"~/pictures"}/screenshots" + ["video"]="${XDG_VIDEOS_DIR:="~/videos"}/screenrecords" +) + +declare -A OUTPUT_FILE_EXT +OUTPUT_FILE_EXT=( + ["screenshot"]="png" + ["video"]="mp4" +) + +TO_FILE=0 +RECORD_AUDIO=0 +ACTION="screenshot" +REGION_TYPE="window" + +notify() { + local summary message command + filename="${1:-""}" + summary="New ${ACTION}!" + if [[ $TO_FILE -eq 1 ]]; then + message+="Available in ${filename##*/}" + else + message+="Available in the clipboard" + fi + command=(notify-send "${summary}" --app-name="$APP_NAME") + if [[ -n "$filename" && "$ACTION" == "screenshots" ]]; then + command+=(--icon="${filename}") + else + command+=("--icon=${ICONS[$ACTION]}") + fi + command+=("$message") + "${command[@]}" +} + +process_args() { + while :; do + case ''${1:-""} in + screenshot) + ACTION="$1" + ;; + + video) + # If a video record is in progress Stop it + if pgrep "wl-screenrec"; then + kill -s SIGINT $(pgrep "wl-screenrec") + exit 0 + fi + TO_FILE=1 + ACTION="$1" + ;; + -r | --region) + if [[ "${2:-""}" =~ ^(r|region|s|screen|w|window)$ ]]; then + REGION_TYPE="$2" + else + exit 1 + fi + ;; + -f | --file) + TO_FILE=1 + ;; + -a | --with-audio) + RECORD_AUDIO=1 + ;; + *) + break + ;; + esac + shift + done +} + +get_app_name() { + local appname + case "$REGION_TYPE" in + r | region) + appname="region" + ;; + s | screen) + appname="screen" + ;; + w | window) + appname=$(swaymsg -t get_tree | jq -r '.. | ((.nodes? // empty) + (.floating_nodes? // empty))[] | select(.visible and .pid and .focused) | "\(.app_id)"') + ;; + esac + printf "%s" "${appname:-}" +} + +get_region() { + local region switch + case "$REGION_TYPE" in + r | region) + region=$(slurp) + switch="-g" + ;; + s | screen) + region=$(swaymsg -t get_outputs | jq -r '.[] | select(.focused) | "\(.name)"') + switch="-o" + ;; + w | window) + region=$(swaymsg -t get_tree | jq -r '.. | ((.nodes? // empty) + (.floating_nodes? // empty))[] | select(.visible and .pid and .focused) | .rect | "\(.x),\(.y) \(.width)x\(.height)"') + switch="-g" + ;; + esac + printf "%s%s" "${switch:-}" "${region:-}" +} + +get_output_filename() { + local date + printf -v date '%(%F_%H.%M.%S)T' + printf "%s/%s-%s.%s" "${OUTPUT_DIR[$ACTION]}" "$date" "$(get_app_name)" "${OUTPUT_FILE_EXT[$ACTION]}" +} + +ensure_directories_exist() { + for dir in "${!OUTPUT_DIR[@]}"; do + mkdir -p "${OUTPUT_DIR[$dir]}" + done +} + +main() { + process_args "$@" + ensure_directories_exist + local command + command=("${COMMAND[$ACTION]}" "$(get_region)") + if [[ "$TO_FILE" -eq 1 ]]; then + local filename + filename=$(get_output_filename) + if [[ "$ACTION" = "video" ]]; then + if [[ "$RECORD_AUDIO" -eq 1 ]]; then + command+=(--audio) + fi + command+=(-f) + fi + command+=("$filename") + "${command[@]}" + else + "${command[@]}" - | wl-copy + fi + notify "${filename:-""}" + exit 0 +} + +main "$@" diff --git a/modules/home-manager/desktop/sway/includes/sway.nix b/modules/home-manager/desktop/sway/includes/sway.nix index ef2ebbc..4f0874c 100644 --- a/modules/home-manager/desktop/sway/includes/sway.nix +++ b/modules/home-manager/desktop/sway/includes/sway.nix @@ -89,9 +89,10 @@ in "${mod}+a" = "focus parent"; "${mod}+Shift+minus" = "move scratchpad"; "${mod}+minus" = "scratchpad show"; - "${mod}+p" = "exec screenshot window"; - "${mod}+Shift+p" = "exec screenshot screen"; + "${mod}+p" = "exec screencapt --region window"; + "${mod}+Shift+p" = "exec screencapt --region screen"; "${mod}+Alt+p" = "mode screenshot"; + "${mod}+Alt+r" = "mode screenrecord"; # Media stuff "${mod}+F1" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 1%-"; "${mod}+F2" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +1%"; @@ -122,12 +123,22 @@ in "Escape" = "mode default"; }; "screenshot" = { - "s" = "exec screenshot screen; mode default"; - "Shift+s" = "exec screenshot screen -f; mode default"; - "r" = "exec screenshot region; mode default"; - "Shift+r" = "exec screenshot region -f; mode default"; - "w" = "exec screenshot window; mode default"; - "Shift+w" = "exec screenshot window -f; mode default"; + "s" = "exec screencapt --region screen; mode default"; + "Shift+s" = "exec screencapt --region screen -f; mode default"; + "r" = "exec screencapt --region region; mode default"; + "Shift+r" = "exec screencapt --region region -f; mode default"; + "w" = "exec screencapt --region window; mode default"; + "Shift+w" = "exec screencapt --region window -f; mode default"; + "Return" = "mode default"; + "Escape" = "mode default"; + }; + "screenrecord" = { + "s" = "exec screencapt video --region screen; mode default"; + "Shift+s" = "exec screencapt --region video screen -a; mde default"; + "r" = "exec screencapt video --region region; mode default"; + "Shift+r" = "exec screencapt video --region region -a; mode default"; + "w" = "exec screencapt video --region window -f ; mode default"; + "Shift+w" = "exec screencapt --region video window -a; mode default"; "Return" = "mode default"; "Escape" = "mode default"; }; @@ -228,69 +239,9 @@ in title_align right ''; }; - home.file.".local/bin/screenshot" = { + home.file.".local/bin/screencapt" = { executable = true; - text = '' - #!/usr/bin/env bash - set -eu -o pipefail - - SWAYMSG="${pkgs.sway}/bin/swaymsg" - JQ="${pkgs.jq}/bin/jq" - WLCOPY="${pkgs.wl-clipboard}/bin/wl-copy" - GRIM="${pkgs.grim}/bin/grim" - SLURP="${pkgs.slurp}/bin/slurp" - - # What we want to screenshot - case ''${1:-} in - region) - RECT=$(''$SLURP) - APPNAME="-region" - OUTPUT=$(''${SWAYMSG} -t get_outputs | ''${JQ} -r '.[] | select(.focused) | "\(.name)"') - COMMAND=( - "''${GRIM}" - -g - "''$RECT" - ) - ;; - screen) - OUTPUT=$(''${SWAYMSG} -t get_outputs | ''${JQ} -r '.[] | select(.focused) | "\(.name)"') - COMMAND=( - "''${GRIM}" - -o - "''${OUTPUT}" - ) - ;; - window) - RECT=$(''${SWAYMSG} -t get_tree | ''${JQ} -r '.. | ((.nodes? // empty) + (.floating_nodes? // empty))[] | select(.visible and .pid and .focused) | .rect | "\(.x),\(.y) \(.width)x\(.height)"' ) - APPNAME=$(''${SWAYMSG} -t get_tree | ''${JQ} -r '.. | ((.nodes? // empty) + (.floating_nodes? // empty))[] | select(.visible and .pid and .focused) | "\(.app_id)"') - COMMAND=( - "''${GRIM}" - -g - "''${RECT}" - ) - ;; - *) - >&2 printf "Can't understand what you need\n" - exit 1 - esac - - # Where we want to put it - case ''${2:-"-c"} in - -c|--clipboard) - COMMAND+=(-) - "''${COMMAND[@]}" | ''${WLCOPY} - ;; - -f|--file) - PICTURES_DIR="''${XDG_PICTURES_DIR}/screenshots" - mkdir -p "''${PICTURES_DIR}" - printf -v DATE '%(%F_%H.%M.%S)T' - printf -v FILE "%s/%s-%s%s.png" "''${PICTURES_DIR}" "''${DATE}" "''${OUTPUT:-""}" "''${APPNAME:-""}" - "''${COMMAND[@]}" "''${FILE//\"/}" - ;; - esac - exit 0 - ''; + source = ./files/screencapt.sh; }; - }; } From ed79106342732a9fd6f9eb5cd8da2c774a043899 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 1 Sep 2025 01:18:27 +0200 Subject: [PATCH 46/70] feat(desktop): make icon theme configurable --- modules/home-manager/desktop/sway/default.nix | 22 +++++++++++++++++-- .../desktop/sway/includes/mako.nix | 8 ++++--- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 024cb23..b3950e7 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -46,6 +46,24 @@ in }; }; + iconTheme = mkOption { + type = types.package; + default = pkgs.papirus-icon-theme; + description = ''Icon theme package to use''; + }; + + iconThemeName = mkOption { + type = types.str; + default = "Papirus Dark"; + description = ''Icon theme variant to use''; + }; + + iconThemePathname = mkOption { + type = types.str; + default = "Papirus-Dark"; + description = ''Icon theme variant to use''; + }; + waybar = { laptop = mkOption { type = types.bool; @@ -136,8 +154,8 @@ in package = pkgs.arc-theme; }; iconTheme = { - name = "Papirus Dark"; - package = pkgs.papirus-icon-theme; + name = cfg.iconThemeName; + package = cfg.iconTheme; }; font = { name = "Deja Vu Sans"; diff --git a/modules/home-manager/desktop/sway/includes/mako.nix b/modules/home-manager/desktop/sway/includes/mako.nix index 3b8d3df..b098010 100644 --- a/modules/home-manager/desktop/sway/includes/mako.nix +++ b/modules/home-manager/desktop/sway/includes/mako.nix @@ -1,5 +1,8 @@ { config, pkgs, lib, ... }: with lib; +let + cfg = config.modules.desktop.sway; +in { config = mkIf config.modules.desktop.sway.enable { systemd.user.services.mako = { @@ -24,12 +27,11 @@ with lib; border-radius = 0; border-size = 2; icons = true; + icon-path = "${cfg.iconTheme}/share/icons/${cfg.iconThemePathname}"; max-icon-size = 64; layer = "overlay"; anchor = "top-right"; - format = '' - %a\n%s\n%b - ''; + format = ''%a\n%s\n%b''; "urgency=high" = { border-color = "#F268b3"; }; From 79d55b304c7e44e0de5adfe8989edcd9a0b4f126 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 1 Sep 2025 01:20:43 +0200 Subject: [PATCH 47/70] feat(waybar): add a record module to track screen recording --- .../sway/includes/files/waybar-style.css | 14 +++++++ .../desktop/sway/includes/waybar.nix | 38 ++++++++++++++++++- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/modules/home-manager/desktop/sway/includes/files/waybar-style.css b/modules/home-manager/desktop/sway/includes/files/waybar-style.css index ffc4be3..f7cc59f 100644 --- a/modules/home-manager/desktop/sway/includes/files/waybar-style.css +++ b/modules/home-manager/desktop/sway/includes/files/waybar-style.css @@ -117,3 +117,17 @@ button:hover{ font-family: "DejaVu sans"; font-size: 12px; } +#custom-screenrecord { + color: @color-critical; + border-bottom: 1px solid @color-critical; + animation-name: critical-animation; + animation-duration: 2s; + animation-timing-function: ease-in-out; + animation-direction: alternate; + animation-iteration-count: infinite; +} + +@keyframes critical-animation { + from {color: @color-critical;} + to {color: white;} +} diff --git a/modules/home-manager/desktop/sway/includes/waybar.nix b/modules/home-manager/desktop/sway/includes/waybar.nix index f9c2e6a..85641fa 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, pkgs, ...}: with lib; let cfg = config.modules.desktop.sway; @@ -16,7 +16,9 @@ in layer = "top"; spacing = 6; disable-toolptips = true; - modules-center = []; + modules-center = [ + "custom/screenrecord" + ]; modules-left = [ "sway/workspaces" "sway/mode" @@ -53,6 +55,7 @@ in "custom/sep" "clock" "custom/sep" + "privacy" "tray" ]; "clock" = { @@ -73,6 +76,14 @@ in "format" = "|"; "tooltip" = false; }; + "custom/screenrecord" = { + "format" = "  [rec.] "; + "interval" = 1; + "exec" = "echo '{\"class\": \"recording\"}'"; + "exec-if" = "${pkgs.procps}/bin/pgrep wl-screenrec"; + "on-click" = "exec ${pkgs.coreutils}/bin/kill -s SIGINT $(${pkgs.procps}/bin/pgrep wl-screenrec)"; + "tooltype" = false; + }; "idle_inhibitor" = { "format" = "{icon}"; "format-icons" = { @@ -96,6 +107,29 @@ in "format-wifi" = "{essid} ({signalStrength}%) "; "tooltip" = false; }; + "privacy"= { + "icon-spacing" = 4; + "icon-size" = 10; + "transition-duration" = 250; + "modules"= [ + { + "type" = "screenshare"; + "tooltip" = true; + "tooltip-icon-size" = 16; + } + { + "type" = "audio-out"; + "tooltip" = true; + "tooltip-icon-size" = 24; + } + { + "type" = "audio-in"; + "tooltip" = true; + "tooltip-icon-size" = 24; + } + ]; + "ignore-monitor" = true; + }; "pulseaudio#output" = { "format" = "{volume}% {icon} "; "format-bluetooth" = "{volume}% {icon}"; From d732e1bda2142b76b0f0e4b920fb0b36e00882bd Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 1 Sep 2025 21:09:48 +0200 Subject: [PATCH 48/70] fix(waybar): wifi icon cut --- modules/home-manager/desktop/sway/includes/waybar.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home-manager/desktop/sway/includes/waybar.nix b/modules/home-manager/desktop/sway/includes/waybar.nix index 85641fa..034c6b7 100644 --- a/modules/home-manager/desktop/sway/includes/waybar.nix +++ b/modules/home-manager/desktop/sway/includes/waybar.nix @@ -104,7 +104,7 @@ in "format-disconnected" = "Disconnected ⚠ "; "format-ethernet" = "{ifname} 󰈀"; "format-linked" = "{ifname} (No IP) 󰈀"; - "format-wifi" = "{essid} ({signalStrength}%) "; + "format-wifi" = "{essid} ({signalStrength}%)  "; "tooltip" = false; }; "privacy"= { From a3b08d0a4089b79c0be80d1205e990e121d5ae37 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 1 Sep 2025 22:35:31 +0200 Subject: [PATCH 49/70] chore(waybar): rework modules --- .../home-manager/desktop/sway/includes/waybar.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/home-manager/desktop/sway/includes/waybar.nix b/modules/home-manager/desktop/sway/includes/waybar.nix index 034c6b7..8eb2646 100644 --- a/modules/home-manager/desktop/sway/includes/waybar.nix +++ b/modules/home-manager/desktop/sway/includes/waybar.nix @@ -92,7 +92,7 @@ in }; }; "memory" = { - "format" = "{used:0.1f}G/{total:0.1f}G "; + "format" = "{used:0.0f}/{total:0.0f}G "; "interval" = 30; "states" = { "critical" = 90; @@ -100,11 +100,11 @@ in }; }; "network" = { - "format-alt" = "{ifname}: {ipaddr}/{cidr} 󰈀"; + "format-alt" = "{ifname}: {essid} {ipaddr}/{cidr} 󰈀 "; "format-disconnected" = "Disconnected ⚠ "; - "format-ethernet" = "{ifname} 󰈀"; - "format-linked" = "{ifname} (No IP) 󰈀"; - "format-wifi" = "{essid} ({signalStrength}%)  "; + "format-ethernet" = "{ifname} 󰈀 "; + "format-linked" = "{ifname} (No IP) 󰈀 "; + "format-wifi" = "{signalStrength}%  "; "tooltip" = false; }; "privacy"= { @@ -159,7 +159,7 @@ in }; "temperature" = { "critical-threshold" = 80; - "format" = "{temperatureC}°C  "; + "format" = " {temperatureC}°C  "; "thermal-zone" = mkIf ( cfg.waybar.cpuThermal.thermalZone != "" ) "${cfg.waybar.cpuThermal.thermalZone}"; "hwmon-path-abs" = mkIf ( cfg.waybar.cpuThermal.hwmonPathAbs != "" ) From d556ad85e40ec1172682c46a4ccaef08275c56c3 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 2 Sep 2025 17:23:27 +0200 Subject: [PATCH 50/70] fix(screencapt): parameters after --region was not processed --- modules/home-manager/desktop/sway/includes/files/screencapt.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/home-manager/desktop/sway/includes/files/screencapt.sh b/modules/home-manager/desktop/sway/includes/files/screencapt.sh index 16b8375..2b15b35 100755 --- a/modules/home-manager/desktop/sway/includes/files/screencapt.sh +++ b/modules/home-manager/desktop/sway/includes/files/screencapt.sh @@ -72,6 +72,7 @@ process_args() { else exit 1 fi + shift ;; -f | --file) TO_FILE=1 From 0116c861bdb950483d4a7c69d2b5b3f13fa1bb32 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 2 Sep 2025 17:24:28 +0200 Subject: [PATCH 51/70] fix(screencapt): screenshot preview was not displayed in notification --- modules/home-manager/desktop/sway/includes/files/screencapt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home-manager/desktop/sway/includes/files/screencapt.sh b/modules/home-manager/desktop/sway/includes/files/screencapt.sh index 2b15b35..353218d 100755 --- a/modules/home-manager/desktop/sway/includes/files/screencapt.sh +++ b/modules/home-manager/desktop/sway/includes/files/screencapt.sh @@ -41,7 +41,7 @@ notify() { message+="Available in the clipboard" fi command=(notify-send "${summary}" --app-name="$APP_NAME") - if [[ -n "$filename" && "$ACTION" == "screenshots" ]]; then + if [[ -n "$filename" && "$ACTION" == "screenshot" ]]; then command+=(--icon="${filename}") else command+=("--icon=${ICONS[$ACTION]}") From 2570f25e11d9e7fa4edce311c2c583f629db7605 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 2 Sep 2025 17:38:14 +0200 Subject: [PATCH 52/70] chore(waybar): rework privacy module icons and tooltypes --- .../home-manager/desktop/sway/includes/waybar.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/modules/home-manager/desktop/sway/includes/waybar.nix b/modules/home-manager/desktop/sway/includes/waybar.nix index 8eb2646..3f74082 100644 --- a/modules/home-manager/desktop/sway/includes/waybar.nix +++ b/modules/home-manager/desktop/sway/includes/waybar.nix @@ -108,24 +108,21 @@ in "tooltip" = false; }; "privacy"= { - "icon-spacing" = 4; - "icon-size" = 10; + "icon-spacing" = 6; + "icon-size" = 11; "transition-duration" = 250; "modules"= [ { "type" = "screenshare"; - "tooltip" = true; - "tooltip-icon-size" = 16; + "tooltip" = false; } { "type" = "audio-out"; - "tooltip" = true; - "tooltip-icon-size" = 24; + "tooltip" = false; } { "type" = "audio-in"; - "tooltip" = true; - "tooltip-icon-size" = 24; + "tooltip" = false; } ]; "ignore-monitor" = true; From 6000d5951b304e7bbe6fb0553c5a7e328c1c72cc Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 9 Sep 2025 17:19:13 +0200 Subject: [PATCH 53/70] chore(waybar): rework temperature handling --- modules/home-manager/desktop/sway/default.nix | 4 ++-- .../home-manager/desktop/sway/includes/files/waybar-style.css | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index b3950e7..d8fa2ff 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -74,8 +74,8 @@ in cpuThermal = { thermalZone = mkOption { - type = types.str; - default = ""; + type = types.int or null; + default = null; description = "CPU thermal hwmon thermal Zone"; }; diff --git a/modules/home-manager/desktop/sway/includes/files/waybar-style.css b/modules/home-manager/desktop/sway/includes/files/waybar-style.css index f7cc59f..d1dd1a2 100644 --- a/modules/home-manager/desktop/sway/includes/files/waybar-style.css +++ b/modules/home-manager/desktop/sway/includes/files/waybar-style.css @@ -101,7 +101,8 @@ button:hover{ #battery.critical:not(.charging), #cpu.critical, -#memory.critical{ +#memory.critical, +#temperature.critical{ border-color: @color-critical; color: @color-critical; } From c155aa783d663954b40674c64570f82b817d7474 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 9 Sep 2025 17:21:54 +0200 Subject: [PATCH 54/70] chore(work): update CPU temperature thermal zone identifier --- hosts/work/home-config.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hosts/work/home-config.nix b/hosts/work/home-config.nix index 0155435..733c542 100644 --- a/hosts/work/home-config.nix +++ b/hosts/work/home-config.nix @@ -38,8 +38,7 @@ laptop = true; gpuThermal.enable = false; cpuThermal = { - hwmonPathAbs = "/sys/devices/platform/coretemp.0/hwmon/"; - inputFilename = "temp1_input"; + thermalZone = 9; }; }; xdg.useDistributionPortals = true; From 7994ecd86c22103f85527e6e123332e99884d417 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 9 Sep 2025 17:25:28 +0200 Subject: [PATCH 55/70] chore(neovim): replace vim-helm plugin with helm-ls-nvim --- modules/home-manager/cli/neovim/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index ee3302e..c62c384 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -205,7 +205,10 @@ in type = "lua"; config = ( builtins.readFile ./files/plugins/nvim-k8s-lsp.lua ); } - vim-helm + { + plugin = helm-ls-nvim; + type = "lua"; + } ]; }; }; From 7c8685e7da0c09383af9d4a31d4c560f5fda6887 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 9 Sep 2025 17:28:28 +0200 Subject: [PATCH 56/70] chore(neovim): update helm-ls LSP configuration --- modules/home-manager/cli/neovim/files/lsp/helm.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modules/home-manager/cli/neovim/files/lsp/helm.lua b/modules/home-manager/cli/neovim/files/lsp/helm.lua index 8086a4a..29e9e11 100644 --- a/modules/home-manager/cli/neovim/files/lsp/helm.lua +++ b/modules/home-manager/cli/neovim/files/lsp/helm.lua @@ -1,7 +1,8 @@ return { cmd = { 'helm_ls', 'serve' }, - filetypes = { 'helm' }, - root_markers = { 'Chart.yaml' }, + filetypes = { 'helm', 'yaml.helm-values' }, + single_file_support = true, + root_markers = { 'values.yaml', 'Chart.yaml' }, capabilities = { workspace = { didChangeWatchedFiles = { @@ -18,9 +19,7 @@ return { showdiagnosticsdirectly = false, path = "yaml-language-server", config = { - schemas = { - kubernetes = "template/**", - }, + schemas = {}, completion = true, hover = true, } From 64c6149fdec66071d311a960b8edbf32bf80abc5 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 9 Sep 2025 17:29:41 +0200 Subject: [PATCH 57/70] chore(neovim): update nvim-k8s-lsp configuration --- .../home-manager/cli/neovim/files/plugins/nvim-k8s-lsp.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/home-manager/cli/neovim/files/plugins/nvim-k8s-lsp.lua b/modules/home-manager/cli/neovim/files/plugins/nvim-k8s-lsp.lua index a2176c6..400c8a1 100644 --- a/modules/home-manager/cli/neovim/files/plugins/nvim-k8s-lsp.lua +++ b/modules/home-manager/cli/neovim/files/plugins/nvim-k8s-lsp.lua @@ -1,6 +1,6 @@ require("nvim-k8s-lsp").setup({ - kubernetes_version = "v1.32.2", + kubernetes_version = "v1.32.8", integrations = { - lualine = false, + lualine = true, } }) From 710e8f6395094439be9054539027304d7950df56 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 11 Sep 2025 00:53:20 +0200 Subject: [PATCH 58/70] refactor(nvim): rework whole configuration --- modules/home-manager/cli/neovim/default.nix | 4 +- .../cli/neovim/files/keybindings.lua | 37 ++------ .../files/lsp/{terraformls.lua => tofuls.lua} | 2 +- .../home-manager/cli/neovim/files/options.lua | 87 ++++++++++++++++--- .../plugins/{luasnip.lua => gitsign.lua} | 0 .../cli/neovim/files/plugins/neotree.lua | 5 ++ 6 files changed, 90 insertions(+), 45 deletions(-) rename modules/home-manager/cli/neovim/files/lsp/{terraformls.lua => tofuls.lua} (73%) rename modules/home-manager/cli/neovim/files/plugins/{luasnip.lua => gitsign.lua} (100%) diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index c62c384..9d928b1 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -65,7 +65,7 @@ in python3Packages.python-lsp-server shellcheck - terraform-lsp + tofu-ls tflint vscode-langservers-extracted yaml-language-server @@ -120,7 +120,7 @@ in { plugin = gitsigns-nvim; type = "lua"; - config = (builtins.readFile ./files/plugins/luasnip.lua); + config = (builtins.readFile ./files/plugins/gitsign.lua); } { plugin = indent-blankline-nvim; diff --git a/modules/home-manager/cli/neovim/files/keybindings.lua b/modules/home-manager/cli/neovim/files/keybindings.lua index aeaabe3..b0d8b13 100644 --- a/modules/home-manager/cli/neovim/files/keybindings.lua +++ b/modules/home-manager/cli/neovim/files/keybindings.lua @@ -1,6 +1,15 @@ +local opts = { noremap = true, silent = true} + +vim.api.nvim_set_keymap('n', '/', ':nohlsearch', opts) +vim.api.nvim_set_keymap('n', 'l', ':set list!', {silent = true}) + -- clear search vim.keymap.set('n', 'l', ':nohlsearch', { desc = 'Clear search', remap = true, silent = true }) +-- Move tabs with \[ and \] +vim.api.nvim_set_keymap('n', ']', ':tabnext', opts) +vim.api.nvim_set_keymap('n', '[', ':tabprev', opts) + -- Switch between windows. vim.keymap.set('n', '', 'h', { desc = 'Move to the left window', remap = true }) vim.keymap.set('n', '', 'j', { desc = 'Move to the bottom window', remap = true }) @@ -19,31 +28,3 @@ vim.keymap.set('n', 'tn', ':tabnew', { desc = "Tab [n]ew", remap = t -- Show all caracters vim.keymap.set('n', 'l', ':set list!', { desc = "Show a[l]l caraters", remap = true, silent = true}) - --- neotree --- ------- -vim.keymap.set('n', 'nc', ':Neotree close', {desc='Neotree [c]lose'}) -vim.keymap.set('n', 'nf', ':Neotree focus filesystem', {desc='Neotree [f]ocus'}) -vim.keymap.set('n', 'nb', ':Neotree focus buffers', {desc='Neotree Nvim [b]uffers'}) -vim.keymap.set('n', 'ng', ':Neotree focus git_status', {desc='Neotree [g]it status'}) - --- fzf-lua --- ------ -vim.keymap.set('n', 'fb', function() require('fzf-lua').buffers() end, {desc='open [b]uffers'}) -vim.keymap.set('n', 'ff', function() require('fzf-lua').files() end, {desc='[r]esume last command'}) -vim.keymap.set('n', 'fr', function() require('fzf-lua').files() end, {desc='[f]iles'}) - --- git related keymaps -vim.keymap.set('n', 'fgb', function() require('fzf-lua').git_branches() end, {desc='Git [b]ranches'}) -vim.keymap.set('n', 'fgc', function() require('fzf-lua').git_commits() end, {desc='Git [c]ommits'}) -vim.keymap.set('n', 'fgC', function() require('fzf-lua').git_bcommits() end, {desc='Git current buffer [C]ommits'}) -vim.keymap.set('n', 'fgf', function() require('fzf-lua').git_files() end, {desc='Git [f]iles'}) -vim.keymap.set('n', 'fgs', function() require('fzf-lua').git_stash() end, {desc='Git [s]tash'}) -vim.keymap.set('n', 'fgS', function() require('fzf-lua').git_status() end, {desc='Git [S]tash'}) - --- grep related keymaps -vim.keymap.set('n', 'fGb', function() require('fzf-lua').grep_curbuf() end, {desc='grep in current [b]uffer'}) -vim.keymap.set('n', 'fGc', function() require('fzf-lua').grep_cword() end, {desc='grep word under the [c]ursor'}) -vim.keymap.set('n', 'fGg', function() require('fzf-lua').grep() end, {desc='[g]rep'}) -vim.keymap.set('n', 'fGl', function() require('fzf-lua').live_grep() end, {desc='[l]ive grep'}) -vim.keymap.set('n', 'fGr', function() require('fzf-lua').grep_last() end, {desc='[r]erun last grep'}) diff --git a/modules/home-manager/cli/neovim/files/lsp/terraformls.lua b/modules/home-manager/cli/neovim/files/lsp/tofuls.lua similarity index 73% rename from modules/home-manager/cli/neovim/files/lsp/terraformls.lua rename to modules/home-manager/cli/neovim/files/lsp/tofuls.lua index 4a875c3..8eba7d0 100644 --- a/modules/home-manager/cli/neovim/files/lsp/terraformls.lua +++ b/modules/home-manager/cli/neovim/files/lsp/tofuls.lua @@ -1,5 +1,5 @@ return { - cmd = { 'terraform-ls', 'serve' }, + cmd = { 'tofu-ls', 'serve' }, filetypes = { 'terraform', 'terraform-vars' }, root_markers = { '.terraform', '.git' }, } diff --git a/modules/home-manager/cli/neovim/files/options.lua b/modules/home-manager/cli/neovim/files/options.lua index b683e0a..37fcdcb 100644 --- a/modules/home-manager/cli/neovim/files/options.lua +++ b/modules/home-manager/cli/neovim/files/options.lua @@ -52,7 +52,7 @@ vim.opt.wildmode = 'lastused:full,list' -- enhance menu vim.opt.pumheight = 10 vim.opt.pumwidth = 50 vim.opt.pumblend = 10 - +vim.o.winborder = 'none' -- manage line break smartly vim.opt.wrap = true vim.opt.breakindent = true @@ -103,24 +103,13 @@ vim.opt.wildignore = { '*.sw?' } --- Key biding --- " ---------- -local opts = { noremap = true, silent = true} - -vim.api.nvim_set_keymap('n', '/', ':nohlsearch', opts) - --- Move tabs with \[ and \] -vim.api.nvim_set_keymap('n', ']', ':tabnext', opts) -vim.api.nvim_set_keymap('n', '[', ':tabprev', opts) -vim.api.nvim_set_keymap('n', 'l', ':set list!', {silent = true}) - -- disable lsplog -- This is not usefull on a daily basis and should positively impact performance vim.lsp.set_log_level("off") -- define a timeout for match parens -vim.g.matchparen_timeout = 2 -vim.g.matchparen_insert_timeout = 2 +vim.g.matchparen_timeout = 10 +vim.g.matchparen_insert_timeout = 10 -- activate virtual lines for diagnistics -- no more plugins needed @@ -134,3 +123,73 @@ vim.diagnostic.config({ -- }, signs = { text = { [x.ERROR] = "󰅙", [x.WARN] = "", [x.INFO] = "󰋼", [x.HINT] = "󰌵" } }, }) + +-- LSP +vim.api.nvim_create_autocmd("LspAttach", { + group = vim.api.nvim_create_augroup("UserLspConfig", {}), + callback = function(ev) + vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc" + + local opts = { buffer = ev.buf } + local client = vim.lsp.get_client_by_id(ev.data.client_id) + local bufnr = ev.buf + local function desc(description) + return { noremap = true, silent = true, buffer = bufnr, desc = description } + end + + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { buffer = ev.buf, desc = "Go to [D]eclaration" }) + vim.keymap.set("n", "gd", vim.lsp.buf.definition, { buffer = ev.buf, desc = "Go to [d]efinition" }) + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { buffer = ev.buf, desc = "Go to [i]mplementation" }) + vim.keymap.set("n", "gr", vim.lsp.buf.references, { buffer = ev.buf, desc = "Go to [r]eferences" }) + + vim.keymap.set( + "n", + "K", + function() + vim.lsp.buf.hover + { border = "rounded", max_width = 250 } + end, + opts) + + vim.keymap.set( + "n", + "", + function() + vim.lsp.buf.signature_help + { border = "rounded", max_width = 250 } + end, + {buffer = ev.buf, desc = "Signature help"} + ) + + vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, opts) + vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, opts) + + vim.keymap.set( + "n", + "wl", + function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, + opts + ) + + vim.keymap.set("n", "D", vim.lsp.buf.type_definition, { buffer = ev.buf, desc = "Type [D]efinition" }) + vim.keymap.set("n", "rn", vim.lsp.buf.rename, { buffer = ev.buf, desc = "LSP [r]e[n]ame" }) + vim.keymap.set("n", "ca", vim.lsp.buf.code_action, { buffer = ev.buf, desc = "Show [c]ode [a]ction"}) + + vim.keymap.set( + "n", + "F", + function() + require("conform").format({ bufnr = bufnr }) + end, + { buffer = ev.buf, desc = "[F]ormat file" } + ) + + if client.server_capabilities.inlayHintProvider then + vim.keymap.set("n", "h", function() + vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled()) + end, desc("LSP toggle inlay [h]ints")) + end + end, +}) diff --git a/modules/home-manager/cli/neovim/files/plugins/luasnip.lua b/modules/home-manager/cli/neovim/files/plugins/gitsign.lua similarity index 100% rename from modules/home-manager/cli/neovim/files/plugins/luasnip.lua rename to modules/home-manager/cli/neovim/files/plugins/gitsign.lua diff --git a/modules/home-manager/cli/neovim/files/plugins/neotree.lua b/modules/home-manager/cli/neovim/files/plugins/neotree.lua index d1fd640..27d8aff 100644 --- a/modules/home-manager/cli/neovim/files/plugins/neotree.lua +++ b/modules/home-manager/cli/neovim/files/plugins/neotree.lua @@ -18,3 +18,8 @@ neotree.setup({ }, } }) + +vim.keymap.set('n', 'nc', ':Neotree close', {desc='Neotree [c]lose'}) +vim.keymap.set('n', 'nf', ':Neotree focus filesystem', {desc='Neotree [f]ocus'}) +vim.keymap.set('n', 'nb', ':Neotree focus buffers', {desc='Neotree Nvim [b]uffers'}) +vim.keymap.set('n', 'ng', ':Neotree focus git_status', {desc='Neotree [g]it status'}) From 01119f632aad7fedeef0eb2d10b0cfc64763c18a Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 19 Sep 2025 20:52:53 +0200 Subject: [PATCH 59/70] fix(waybar): bad thermalZone variable type --- modules/home-manager/desktop/sway/default.nix | 2 +- modules/home-manager/desktop/sway/includes/waybar.nix | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index d8fa2ff..84a6a88 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -74,7 +74,7 @@ in cpuThermal = { thermalZone = mkOption { - type = types.int or null; + type = types.nullOr types.int; default = null; description = "CPU thermal hwmon thermal Zone"; }; diff --git a/modules/home-manager/desktop/sway/includes/waybar.nix b/modules/home-manager/desktop/sway/includes/waybar.nix index 3f74082..0c9bc96 100644 --- a/modules/home-manager/desktop/sway/includes/waybar.nix +++ b/modules/home-manager/desktop/sway/includes/waybar.nix @@ -157,8 +157,8 @@ in "temperature" = { "critical-threshold" = 80; "format" = " {temperatureC}°C  "; - "thermal-zone" = mkIf ( cfg.waybar.cpuThermal.thermalZone != "" ) - "${cfg.waybar.cpuThermal.thermalZone}"; + "thermal-zone" = mkIf ( cfg.waybar.cpuThermal.thermalZone != null ) + cfg.waybar.cpuThermal.thermalZone; "hwmon-path-abs" = mkIf ( cfg.waybar.cpuThermal.hwmonPathAbs != "" ) "${cfg.waybar.cpuThermal.hwmonPathAbs}"; "input-filename" = mkIf ( cfg.waybar.cpuThermal.inputFilename != "" ) From a030271f48340ad633f39508d3329345e4f029db Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 23 Sep 2025 10:41:21 +0200 Subject: [PATCH 60/70] fix(tmux-session): screen was not split in horizontal mode --- modules/home-manager/cli/tmux/files/create-tmux-session.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/home-manager/cli/tmux/files/create-tmux-session.sh b/modules/home-manager/cli/tmux/files/create-tmux-session.sh index 331742c..91d72ca 100755 --- a/modules/home-manager/cli/tmux/files/create-tmux-session.sh +++ b/modules/home-manager/cli/tmux/files/create-tmux-session.sh @@ -162,7 +162,7 @@ tmux_vsplit() { tmux_hsplit() { local size="${1:-20}" debug "execute hsplit with size '${size}'" - tmux split-window "${SESSION_NAME}" -c "$CURRENT_PATH" -h -p "$size" + tmux split-window -t "${SESSION_NAME}" -c "$CURRENT_PATH" -h -p "$size" } tmux_neww() { From a97da40ffe346e4ab94acae8d534fbf8b5966e4b Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 23 Sep 2025 15:00:40 +0200 Subject: [PATCH 61/70] chore: upgrade nix-private repo --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index aec59a7..2b87d6a 100644 --- a/flake.lock +++ b/flake.lock @@ -64,10 +64,10 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1755761639, - "narHash": "sha256-rEvyLY/3u1RfxsySyqScM3peGUVNJNmGApHVyIY7Cx0=", + "lastModified": 1758616692, + "narHash": "sha256-Q/7qOK6Vgjc6pBPCmnbIq2JF4XFlLYTvekS4v2OypAE=", "ref": "main", - "rev": "d73f46baaff8c9fff2a7b11c97413ea3fb171584", + "rev": "d59b492f9bfdb522280f1344ae25c821ba7b11b4", "shallow": true, "type": "git", "url": "ssh://git@git.epha.se:24422/ephase/nix-private.git" From b19cd403284800ddb36e805947c699ca7573455b Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 25 Sep 2025 20:50:43 +0200 Subject: [PATCH 62/70] feat(rick): install desktop using nix --- hosts/rick/home-config.nix | 19 ++++++++++------- hosts/rick/includes/home-manager.nix | 31 +++++++++++++++------------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/hosts/rick/home-config.nix b/hosts/rick/home-config.nix index a72cdf0..ee3013b 100644 --- a/hosts/rick/home-config.nix +++ b/hosts/rick/home-config.nix @@ -1,10 +1,10 @@ -{ pkgs, ... }: { +{ pkgs, inputs, ... }: { config.modules = { application = { - gnupg.enable = false; + gnupg.enable = true; zathura.enable = true; - foot.enable = false; - imv.enable = false; + foot.enable = true; + imv.enable = true; }; audio = { cmus.enable = true; @@ -12,7 +12,11 @@ cli = { direnv.enable = true; ghq.enable = true; - git.enable = true; + git = { + enable = true; + userEmail = inputs.nix-private.git.personal.userEmail; + signingKey = inputs.nix-private.git.personal.signingKey; + }; neovim.enable = true; starship.enable = true; tmux.enable = true; @@ -29,8 +33,9 @@ web.webcord.enable = false; gaming.lutris.enable = false; desktop.sway = { - enable = false; + enable = true; kanshi = false; + swaylock.useNullPackage = true; wallpapers.lockscreen = "${./files/lockscreen.png}"; wallpapers.desktop = "${./files/background.png} fill #000000"; waybar = { @@ -39,7 +44,7 @@ enable = false; }; cpuThermal = { - thermalZone = "2"; + thermalZone = 2; # hwmonPathAbs = ""; # inputFilename = ""; }; diff --git a/hosts/rick/includes/home-manager.nix b/hosts/rick/includes/home-manager.nix index a98c311..8fd595c 100644 --- a/hosts/rick/includes/home-manager.nix +++ b/hosts/rick/includes/home-manager.nix @@ -1,21 +1,24 @@ _: { + wayland.windowManager.sway.config.output = { + "eDP-1" = { + scale = "1.4"; + }; + "HDMI-A-1" = { + disable = ""; + }; + }; + wayland.windowManager.sway.config.input = { + "4617:27904:MNT_Research_MNT_Reform_Keyboard_2.0_US/LT" = { + xkb_layout = "us"; + xkb_variant = "altgr-intl"; + }; + }; programs.zsh.loginExtra = '' #notmutch export NOTMUCH_CONFIG="$HOME/.config/notmuch/config" - export PATH=~/.local/bin:$PATH + # export PATH=~/.local/bin:$PATH # export XDG_DATA_HOME=$HOME/.local/share unset DEBUGINFOD_URLS - if [[ ! $DISPLAY && $XDG_VTNR -eq 1 ]]; then - export QT_QPA_PLATFORM="wayland-egl" - export QT_WAYLAND_DISABLE_WINDOWDECORATION=1 - export MOZ_ENABLE_WAYLAND=1 - export QT_QPA_PLATFORMTHEME=qt5ct - export NO_AT_BRIDGE=1 - export XDG_SESSION_TYPE=wayland - export XDG_CURRENT_DESKTOP=sway - export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.socket - exec ~/.local/bin/sway.sh - fi - ''; - } + ''; +} From 1a70f9c2d79514c7e52350485d677cb5b7922749 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 25 Sep 2025 22:29:13 +0200 Subject: [PATCH 63/70] chore: upgrade packages repositories --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 2b87d6a..6ed56d8 100644 --- a/flake.lock +++ b/flake.lock @@ -46,11 +46,11 @@ ] }, "locked": { - "lastModified": 1755810213, - "narHash": "sha256-QdenO8f0PTg+tC6HuSvngKcbRZA5oZKmjUT+MXKOLQg=", + "lastModified": 1758810399, + "narHash": "sha256-bpWoE1tiFX5T1tr5EudkpW9Kk02XR+6olkoSkf3nHZU=", "owner": "nix-community", "repo": "home-manager", - "rev": "6911d3e7f475f7b3558b4f5a6aba90fa86099baa", + "rev": "39d26c16866260eee6d0487fe9c102ba1c1bf7b2", "type": "github" }, "original": { @@ -116,11 +116,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1755615617, - "narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=", + "lastModified": 1758690382, + "narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "20075955deac2583bb12f07151c2df830ef346b4", + "rev": "e643668fd71b949c53f8626614b21ff71a07379d", "type": "github" }, "original": { @@ -131,11 +131,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1755615617, - "narHash": "sha256-HMwfAJBdrr8wXAkbGhtcby1zGFvs+StOp19xNsbqdOg=", + "lastModified": 1758690382, + "narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "20075955deac2583bb12f07151c2df830ef346b4", + "rev": "e643668fd71b949c53f8626614b21ff71a07379d", "type": "github" }, "original": { @@ -151,11 +151,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1755877557, - "narHash": "sha256-AjUqNCIgjQKfhvH+HUXZQLlSDiRTFQPSPN8Ws/O7mVQ=", + "lastModified": 1758828503, + "narHash": "sha256-IgOibVOqWSZqWsHKK6TuALfuItRymW2YpsdZBjU2yrk=", "owner": "nix-community", "repo": "NUR", - "rev": "332abf45be8133422a97e134b35782400ffc65bd", + "rev": "544f12f6987ceb94fe2052696da65623c238da4c", "type": "github" }, "original": { @@ -181,11 +181,11 @@ ] }, "locked": { - "lastModified": 1754988908, - "narHash": "sha256-t+voe2961vCgrzPFtZxha0/kmFSHFobzF00sT8p9h0U=", + "lastModified": 1758425756, + "narHash": "sha256-L3N8zV6wsViXiD8i3WFyrvjDdz76g3tXKEdZ4FkgQ+Y=", "owner": "Mic92", "repo": "sops-nix", - "rev": "3223c7a92724b5d804e9988c6b447a0d09017d48", + "rev": "e0fdaea3c31646e252a60b42d0ed8eafdb289762", "type": "github" }, "original": { From 97de9851edd806022c23ff44b92078b165ea9d49 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 25 Sep 2025 22:35:39 +0200 Subject: [PATCH 64/70] chore(overlay): remove custom widevine-cdm build --- nixos/includes/system/overlay.nix | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/nixos/includes/system/overlay.nix b/nixos/includes/system/overlay.nix index fe64130..cd103fb 100644 --- a/nixos/includes/system/overlay.nix +++ b/nixos/includes/system/overlay.nix @@ -4,17 +4,6 @@ (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 From d56380590975f4738029777fc0fa45cd59fb306a Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 25 Sep 2025 23:23:02 +0200 Subject: [PATCH 65/70] chore(neovim): update formatter configurations --- modules/home-manager/cli/neovim/default.nix | 2 +- .../cli/neovim/files/plugins/conform.lua | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index 9d928b1..aa5bb6e 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -71,7 +71,7 @@ in yaml-language-server # Formatters - nixfmt-rfc-style + alejandra shfmt yamlfmt ]; diff --git a/modules/home-manager/cli/neovim/files/plugins/conform.lua b/modules/home-manager/cli/neovim/files/plugins/conform.lua index 5e3c884..1a45416 100644 --- a/modules/home-manager/cli/neovim/files/plugins/conform.lua +++ b/modules/home-manager/cli/neovim/files/plugins/conform.lua @@ -4,10 +4,20 @@ require("conform").setup({ timeout_ms = 500, lsp_format = "never", }, + formatters = { + terraform = { + inherit = false, + command = "tofu", + args = { "fmt", "-" }, + stdin = true, + }, + }, formatters_by_ft = { - yaml = {"yamlfmt"}, - sh = { "shfmt" }, go = { "gofmt" }, + nix = { "alejandra" }, + sh = { "shfmt" }, + terraform = { "terraform" }, + yaml = {"yamlfmt"}, ["_"] = { "trim_whitespace" }, } }) From 0d8a394dcf24b36274d09be2f8ee18f8c6bfff24 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Thu, 25 Sep 2025 23:33:01 +0200 Subject: [PATCH 66/70] style: use alejandra formatter on all nix files --- flake.nix | 89 +++-- home-manager/default.nix | 28 +- hosts/luci/hardware-configuration.nix | 66 ++-- hosts/luci/home-config.nix | 2 +- hosts/luci/includes/home-manager.nix | 3 +- hosts/luci/nixos-config.nix | 2 +- hosts/morty/hardware-configuration.nix | 64 ++-- hosts/morty/home-config.nix | 2 +- hosts/morty/includes/home-manager.nix | 6 +- hosts/morty/nixos-config.nix | 2 +- hosts/mrmeeseeks/hardware-configuration.nix | 70 ++-- hosts/mrmeeseeks/home-config.nix | 2 +- hosts/mrmeeseeks/includes/home-manager.nix | 4 +- hosts/mrmeeseeks/nixos-config.nix | 2 +- hosts/rick/home-config.nix | 6 +- hosts/rick/includes/home-manager.nix | 7 +- hosts/work/home-config.nix | 6 +- hosts/work/includes/home-manager.nix | 43 +-- modules/home-manager/accounts/dav/default.nix | 61 ++-- .../home-manager/accounts/email/default.nix | 321 +++++++++++++----- .../home-manager/application/foot/default.nix | 14 +- .../application/gnupg/default.nix | 19 +- .../home-manager/application/imv/default.nix | 16 +- .../application/zathura/default.nix | 14 +- modules/home-manager/audio/cmus/default.nix | 15 +- modules/home-manager/cli/direnv/default.nix | 14 +- modules/home-manager/cli/ghq/default.nix | 15 +- modules/home-manager/cli/git/default.nix | 15 +- modules/home-manager/cli/k8s/default.nix | 23 +- modules/home-manager/cli/neovim/default.nix | 82 ++--- modules/home-manager/cli/starship/default.nix | 12 +- modules/home-manager/cli/tmux/default.nix | 114 ++++--- modules/home-manager/cli/utils/default.nix | 15 +- modules/home-manager/cli/vifm/default.nix | 15 +- modules/home-manager/cli/zellij/default.nix | 12 +- modules/home-manager/cli/zsh/default.nix | 34 +- modules/home-manager/default.nix | 3 +- modules/home-manager/desktop/sway/default.nix | 27 +- .../desktop/sway/includes/fuzzel.nix | 9 +- .../desktop/sway/includes/kanshi.nix | 78 ++--- .../desktop/sway/includes/mako.nix | 21 +- .../desktop/sway/includes/sway.nix | 147 ++++---- .../desktop/sway/includes/swayidle.nix | 32 +- .../desktop/sway/includes/swaylock.nix | 23 +- .../desktop/sway/includes/waybar.nix | 102 +++--- .../home-manager/gaming/lutris/default.nix | 15 +- .../home-manager/video/kdenlive/default.nix | 13 +- modules/home-manager/video/mpv/default.nix | 12 +- modules/home-manager/web/firefox/conf/doh.nix | 8 +- modules/home-manager/web/firefox/conf/drm.nix | 14 +- .../web/firefox/conf/experiments.nix | 15 +- .../web/firefox/conf/extensions.nix | 20 +- .../web/firefox/conf/preferences.nix | 53 ++- .../home-manager/web/firefox/conf/privacy.nix | 131 ++++--- .../web/firefox/conf/safebrowsing.nix | 8 +- .../home-manager/web/firefox/conf/suggest.nix | 23 +- .../web/firefox/conf/telemetry.nix | 22 +- .../home-manager/web/firefox/conf/theme.nix | 14 +- .../web/firefox/conf/tracking.nix | 3 +- modules/home-manager/web/firefox/default.nix | 68 ++-- .../home-manager/web/qutebrowser/default.nix | 15 +- modules/home-manager/web/webcord/default.nix | 17 +- modules/nixos/default.nix | 3 +- modules/nixos/desktop/sway/default.nix | 13 +- modules/nixos/gaming/steam/default.nix | 16 +- modules/nixos/hardware/lact/default.nix | 15 +- modules/nixos/hardware/laptop/default.nix | 13 +- nixos/default.nix | 11 +- nixos/includes/hardware/nitrokey.nix | 2 +- nixos/includes/system/doas.nix | 3 +- nixos/includes/system/flakes.nix | 4 +- nixos/includes/system/locales.nix | 3 +- nixos/includes/system/lvm.nix | 7 +- nixos/includes/system/neovim.nix | 7 +- nixos/includes/system/overlay.nix | 10 +- nixos/includes/system/user.nix | 7 +- 76 files changed, 1287 insertions(+), 935 deletions(-) diff --git a/flake.nix b/flake.nix index 21b1c7b..2a35f7d 100644 --- a/flake.nix +++ b/flake.nix @@ -9,7 +9,7 @@ }; home-manager = { url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; + inputs.nixpkgs.follows = "nixpkgs"; }; sops-nix = { url = "github:Mic92/sops-nix"; @@ -19,36 +19,52 @@ url = "git+ssh://git@git.epha.se:24422/ephase/nix-private.git?shallow=1&ref=main"; }; }; - outputs = { self, nixpkgs, home-manager, nur, nixgl, sops-nix, ... }@inputs: - let + outputs = { + self, + nixpkgs, + home-manager, + nur, + nixgl, + sops-nix, + ... + } @ inputs: let stateVersion = "23.11"; allSystems = [ - "x86_64-linux" # 64bit AMD/Intel x86 + "x86_64-linux" # 64bit AMD/Intel x86 "aarch64-linux" # 64bit ARM Linux ]; forAllSystems = fn: nixpkgs.lib.genAttrs allSystems - (system: fn { pkgs = import nixpkgs { inherit system; }; }); + (system: fn {pkgs = import nixpkgs {inherit system;};}); - createNixosSystem = { system, hostname, username ? "ephase" }: nixpkgs.lib.nixosSystem { - system = system; - specialArgs = { - inherit stateVersion inputs; - hostname = hostname; - username = username; + createNixosSystem = { + system, + hostname, + username ? "ephase", + }: + nixpkgs.lib.nixosSystem { + system = system; + specialArgs = { + inherit stateVersion inputs; + hostname = hostname; + username = username; + }; + modules = [ + ./nixos/default.nix + ]; }; - modules = [ - ./nixos/default.nix - ]; - }; - createHomeConfiguration = { system ? "x86_64-linux", hostname, username ? "ephase" }: + createHomeConfiguration = { + system ? "x86_64-linux", + hostname, + username ? "ephase", + }: home-manager.lib.homeManagerConfiguration { pkgs = import nixpkgs { system = system; - overlays = [ nixgl.overlay ]; + overlays = [nixgl.overlay]; }; extraSpecialArgs = { inherit stateVersion inputs nixgl; @@ -56,12 +72,12 @@ username = username; }; modules = [ - { nixpkgs.overlays = [ nixgl.overlay ];} + {nixpkgs.overlays = [nixgl.overlay];} ./home-manager/default.nix ]; }; in { - devShells = forAllSystems ({ pkgs }: { + devShells = forAllSystems ({pkgs}: { default = pkgs.mkShell { name = "nixfiles"; buildInputs = [ @@ -78,15 +94,36 @@ }; }); nixosConfigurations = { - morty = createNixosSystem { system = "x86_64-linux"; hostname = "morty"; }; - mrmeeseeks = createNixosSystem { system = "x86_64-linux"; hostname = "mrmeeseeks";}; - luci = createNixosSystem { system = "x86_64-linux"; hostname = "luci"; }; + morty = createNixosSystem { + system = "x86_64-linux"; + hostname = "morty"; + }; + mrmeeseeks = createNixosSystem { + system = "x86_64-linux"; + hostname = "mrmeeseeks"; + }; + luci = createNixosSystem { + system = "x86_64-linux"; + hostname = "luci"; + }; }; homeConfigurations = { - "rick" = createHomeConfiguration { system = "aarch64-linux"; hostname = "rick";}; - "luci" = createHomeConfiguration { system = "x86_64-linux"; hostname = "luci";}; - "morty" = createHomeConfiguration { system = "x86_64-linux"; hostname = "morty";}; - "mrmeeseeks" = createHomeConfiguration { system = "x86_64-linux"; hostname = "mrmeeseeks";}; + "rick" = createHomeConfiguration { + system = "aarch64-linux"; + hostname = "rick"; + }; + "luci" = createHomeConfiguration { + system = "x86_64-linux"; + hostname = "luci"; + }; + "morty" = createHomeConfiguration { + system = "x86_64-linux"; + hostname = "morty"; + }; + "mrmeeseeks" = createHomeConfiguration { + system = "x86_64-linux"; + hostname = "mrmeeseeks"; + }; "work" = createHomeConfiguration { system = "x86_64-linux"; hostname = "work"; diff --git a/home-manager/default.nix b/home-manager/default.nix index f70cd47..cc38aac 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -1,13 +1,23 @@ -{ inputs, lib, stateVersion, username, hostname, nixgl, ... }: { - imports = [ - inputs.sops-nix.homeManagerModules.sops - ../hosts/${hostname}/home-config.nix - ../nixos/includes/system/overlay.nix - ../modules/home-manager/default.nix - ] ++ lib.optional ( - builtins.pathExists ../hosts/${hostname}/includes/home-manager.nix - ) ../hosts/${hostname}/includes/home-manager.nix; + inputs, + lib, + stateVersion, + username, + hostname, + nixgl, + ... +}: { + imports = + [ + inputs.sops-nix.homeManagerModules.sops + ../hosts/${hostname}/home-config.nix + ../nixos/includes/system/overlay.nix + ../modules/home-manager/default.nix + ] + ++ lib.optional ( + builtins.pathExists ../hosts/${hostname}/includes/home-manager.nix + ) + ../hosts/${hostname}/includes/home-manager.nix; nixpkgs.config.allowUnfree = true; programs.home-manager.enable = true; diff --git a/hosts/luci/hardware-configuration.nix b/hosts/luci/hardware-configuration.nix index 3a5d77e..70e4cf3 100644 --- a/hosts/luci/hardware-configuration.nix +++ b/hosts/luci/hardware-configuration.nix @@ -1,45 +1,49 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" "i915" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelParams = [ "intel_pstate=disable" ]; - boot.kernelModules = [ "kvm-intel" "i915" ]; - boot.extraModulePackages = [ ]; + boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" "i915"]; + boot.initrd.kernelModules = []; + boot.kernelParams = ["intel_pstate=disable"]; + boot.kernelModules = ["kvm-intel" "i915"]; + boot.extraModulePackages = []; boot.initrd.luks.devices."nixos".device = "/dev/disk/by-uuid/ee06e049-e738-4f1f-84ab-e8066e0f1640"; - fileSystems."/" = - { device = "/dev/disk/by-uuid/97c3403a-fdad-4dc8-a103-a666d5fd8d6c"; - fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd" ]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/97c3403a-fdad-4dc8-a103-a666d5fd8d6c"; + fsType = "btrfs"; + options = ["subvol=root" "compress=zstd"]; + }; - fileSystems."/home" = - { device = "/dev/disk/by-uuid/97c3403a-fdad-4dc8-a103-a666d5fd8d6c"; - fsType = "btrfs"; - options = [ "subvol=home" "compress=zstd"]; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/97c3403a-fdad-4dc8-a103-a666d5fd8d6c"; + fsType = "btrfs"; + options = ["subvol=home" "compress=zstd"]; + }; - fileSystems."/nix" = - { device = "/dev/disk/by-uuid/97c3403a-fdad-4dc8-a103-a666d5fd8d6c"; - fsType = "btrfs"; - options = [ "subvol=nix" "compress=zstd"]; - }; + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/97c3403a-fdad-4dc8-a103-a666d5fd8d6c"; + fsType = "btrfs"; + options = ["subvol=nix" "compress=zstd"]; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/B77A-53B1"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/B77A-53B1"; + fsType = "vfat"; + }; - swapDevices = [ ]; + swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's @@ -60,5 +64,5 @@ ]; }; virtualisation.docker.enable = true; - users.extraGroups.docker.members = [ "ephase" ]; + users.extraGroups.docker.members = ["ephase"]; } diff --git a/hosts/luci/home-config.nix b/hosts/luci/home-config.nix index 7b9558f..2d28771 100644 --- a/hosts/luci/home-config.nix +++ b/hosts/luci/home-config.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { config.modules = { application = { gnupg.enable = true; diff --git a/hosts/luci/includes/home-manager.nix b/hosts/luci/includes/home-manager.nix index 78957fc..c42afbd 100644 --- a/hosts/luci/includes/home-manager.nix +++ b/hosts/luci/includes/home-manager.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +{...}: { ## Specific host home manager configuration wayland.windowManager.sway.config = { input = { diff --git a/hosts/luci/nixos-config.nix b/hosts/luci/nixos-config.nix index 159340a..37eb6c9 100644 --- a/hosts/luci/nixos-config.nix +++ b/hosts/luci/nixos-config.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { config.modules.desktop.sway.enable = true; config.modules.gaming.steam.enable = false; config.modules.hardware.laptop.enable = true; diff --git a/hosts/morty/hardware-configuration.nix b/hosts/morty/hardware-configuration.nix index d2ccc01..57e6c39 100644 --- a/hosts/morty/hardware-configuration.nix +++ b/hosts/morty/hardware-configuration.nix @@ -1,45 +1,49 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "i915" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" "i915" ]; - boot.extraModulePackages = [ ]; - boot.kernelParams = ["fbcon=rotate:1" "video=eDP-1:panel_orientation=right_side_up" "intel_pstate=disable" ]; + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "i915"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel" "i915"]; + boot.extraModulePackages = []; + boot.kernelParams = ["fbcon=rotate:1" "video=eDP-1:panel_orientation=right_side_up" "intel_pstate=disable"]; boot.loader.systemd-boot.consoleMode = "max"; - fileSystems."/" = - { device = "/dev/disk/by-uuid/d28d59b0-a44d-4b17-9338-2ca69a1efca7"; - fsType = "btrfs"; - options = [ "subvol=root" "compress=zstd"]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/d28d59b0-a44d-4b17-9338-2ca69a1efca7"; + fsType = "btrfs"; + options = ["subvol=root" "compress=zstd"]; + }; boot.initrd.luks.devices."nixos".device = "/dev/disk/by-uuid/ad4fa799-214c-4e5e-996a-8776e010fb2f"; - fileSystems."/nix" = - { device = "/dev/disk/by-uuid/d28d59b0-a44d-4b17-9338-2ca69a1efca7"; - fsType = "btrfs"; - options = [ "subvol=nix" "compress=zstd" ]; - }; + fileSystems."/nix" = { + device = "/dev/disk/by-uuid/d28d59b0-a44d-4b17-9338-2ca69a1efca7"; + fsType = "btrfs"; + options = ["subvol=nix" "compress=zstd"]; + }; - fileSystems."/home" = - { device = "/dev/disk/by-uuid/d28d59b0-a44d-4b17-9338-2ca69a1efca7"; - fsType = "btrfs"; - options = [ "subvol=home" "compress=zstd" ]; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/d28d59b0-a44d-4b17-9338-2ca69a1efca7"; + fsType = "btrfs"; + options = ["subvol=home" "compress=zstd"]; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/E83D-CDFE"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/E83D-CDFE"; + fsType = "vfat"; + }; - swapDevices = [ ]; + swapDevices = []; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; diff --git a/hosts/morty/home-config.nix b/hosts/morty/home-config.nix index 690d3ad..5fff91e 100644 --- a/hosts/morty/home-config.nix +++ b/hosts/morty/home-config.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: { +{inputs, ...}: { config.modules = { email = { enable = true; diff --git a/hosts/morty/includes/home-manager.nix b/hosts/morty/includes/home-manager.nix index 9643c77..aedd064 100644 --- a/hosts/morty/includes/home-manager.nix +++ b/hosts/morty/includes/home-manager.nix @@ -1,7 +1,5 @@ -{ ... }: -{ - home.file.".config/xkb/symbols/gpdwinmax".text = - '' +{...}: { + home.file.".config/xkb/symbols/gpdwinmax".text = '' default partial alphanumeric_keys xkb_symbols "us-intl-winmax" { name[group1] = "GPD Win Max us-inlt"; diff --git a/hosts/morty/nixos-config.nix b/hosts/morty/nixos-config.nix index e824f72..b6d69ab 100644 --- a/hosts/morty/nixos-config.nix +++ b/hosts/morty/nixos-config.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { config.modules.desktop.sway.enable = true; config.modules.gaming.steam.enable = true; config.modules.hardware.laptop = { diff --git a/hosts/mrmeeseeks/hardware-configuration.nix b/hosts/mrmeeseeks/hardware-configuration.nix index 72fd750..a85045d 100644 --- a/hosts/mrmeeseeks/hardware-configuration.nix +++ b/hosts/mrmeeseeks/hardware-configuration.nix @@ -1,61 +1,65 @@ # Do not modify this file! It was generated by ‘nixos-generate-config’ # and may be overwritten by future invocations. Please make changes # to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" - "usb_storage" - "sd_mod" + "usb_storage" + "sd_mod" "amdgpu" ]; - boot.initrd.kernelModules = [ + boot.initrd.kernelModules = [ "dm-cache-default" ]; - boot.kernelModules = [ - "kvm-amd" - "amdgpu" - ]; + boot.kernelModules = [ + "kvm-amd" + "amdgpu" + ]; boot.kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" ]; - - boot.extraModulePackages = [ ]; + + boot.extraModulePackages = []; boot.initrd.luks.devices."nixos".device = "/dev/disk/by-uuid/ea7fa60d-35e5-48b8-95d7-142f37b262cd"; boot.initrd.luks.devices."nixos".preLVM = true; - fileSystems."/" = - { device = "/dev/disk/by-uuid/9d1e5022-0265-4ce7-824e-282ee550d52d"; - fsType = "btrfs"; - options = [ "subvol=@root" "compress=zstd"]; - }; + fileSystems."/" = { + device = "/dev/disk/by-uuid/9d1e5022-0265-4ce7-824e-282ee550d52d"; + fsType = "btrfs"; + options = ["subvol=@root" "compress=zstd"]; + }; - fileSystems."/home" = - { device = "/dev/disk/by-uuid/9d1e5022-0265-4ce7-824e-282ee550d52d"; - fsType = "btrfs"; - options = [ "subvol=@home" "compress=zstd"]; - }; + fileSystems."/home" = { + device = "/dev/disk/by-uuid/9d1e5022-0265-4ce7-824e-282ee550d52d"; + fsType = "btrfs"; + options = ["subvol=@home" "compress=zstd"]; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/F027-F53F"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/F027-F53F"; + fsType = "vfat"; + }; - fileSystems."/mnt/gamelib" = - { device = "/dev/mapper/tank-gamelib"; + fileSystems."/mnt/gamelib" = { + device = "/dev/mapper/tank-gamelib"; fsType = "ext4"; }; - swapDevices = [ ]; + swapDevices = []; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's @@ -66,7 +70,7 @@ # networking.interfaces.wlp37s0.useDHCP = lib.mkDefault true; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - + hardware.cpu.amd.updateMicrocode = true; hardware.graphics = { enable32Bit = true; diff --git a/hosts/mrmeeseeks/home-config.nix b/hosts/mrmeeseeks/home-config.nix index d00ab09..78d763b 100644 --- a/hosts/mrmeeseeks/home-config.nix +++ b/hosts/mrmeeseeks/home-config.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: { +{inputs, ...}: { config.modules = { application = { gnupg = { diff --git a/hosts/mrmeeseeks/includes/home-manager.nix b/hosts/mrmeeseeks/includes/home-manager.nix index e911320..0e4213a 100644 --- a/hosts/mrmeeseeks/includes/home-manager.nix +++ b/hosts/mrmeeseeks/includes/home-manager.nix @@ -3,14 +3,14 @@ _: { wayland.windowManager.sway.config.output = { "Iiyama North America PL2792UH 1166310803122" = { max_render_time = "5"; - mode = "3840x2160@60Hz"; + mode = "3840x2160@60Hz"; position = "1235,0"; scale = "1.75"; bg = "~/medias/images/wallpapers/desktop.jpg center #000000"; }; "Iiyama North America PL2792UH 1176923201598" = { max_render_time = "5"; - mode = "3840x2160@60Hz"; + mode = "3840x2160@60Hz"; position = "0,0"; scale = "1.75"; transform = "270"; diff --git a/hosts/mrmeeseeks/nixos-config.nix b/hosts/mrmeeseeks/nixos-config.nix index 2ed041a..5019604 100644 --- a/hosts/mrmeeseeks/nixos-config.nix +++ b/hosts/mrmeeseeks/nixos-config.nix @@ -1,4 +1,4 @@ -{ ... }: { +{...}: { config.modules.desktop.sway.enable = true; config.modules.gaming.steam = { enable = true; diff --git a/hosts/rick/home-config.nix b/hosts/rick/home-config.nix index ee3013b..6fc8d29 100644 --- a/hosts/rick/home-config.nix +++ b/hosts/rick/home-config.nix @@ -1,4 +1,8 @@ -{ pkgs, inputs, ... }: { +{ + pkgs, + inputs, + ... +}: { config.modules = { application = { gnupg.enable = true; diff --git a/hosts/rick/includes/home-manager.nix b/hosts/rick/includes/home-manager.nix index 8fd595c..68c8483 100644 --- a/hosts/rick/includes/home-manager.nix +++ b/hosts/rick/includes/home-manager.nix @@ -1,11 +1,10 @@ -_: -{ +_: { wayland.windowManager.sway.config.output = { "eDP-1" = { scale = "1.4"; }; "HDMI-A-1" = { - disable = ""; + disable = ""; }; }; wayland.windowManager.sway.config.input = { @@ -15,7 +14,7 @@ _: }; }; programs.zsh.loginExtra = '' - #notmutch + # notmuch export NOTMUCH_CONFIG="$HOME/.config/notmuch/config" # export PATH=~/.local/bin:$PATH # export XDG_DATA_HOME=$HOME/.local/share diff --git a/hosts/work/home-config.nix b/hosts/work/home-config.nix index 733c542..262c650 100644 --- a/hosts/work/home-config.nix +++ b/hosts/work/home-config.nix @@ -1,4 +1,8 @@ -{ pkgs, inputs, ... }: { +{ + pkgs, + inputs, + ... +}: { config.modules = { application = { zathura.enable = true; diff --git a/hosts/work/includes/home-manager.nix b/hosts/work/includes/home-manager.nix index 92fc843..93a8cee 100644 --- a/hosts/work/includes/home-manager.nix +++ b/hosts/work/includes/home-manager.nix @@ -1,24 +1,27 @@ -{ pkgs, config, ... }: { - home.packages = with pkgs; [ - dejavu_fonts - font-awesome - lato - liberation_ttf - libertine - libnotify - nerd-fonts.fira-code - nerd-fonts.fira-mono - noto-fonts-emoji - 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; - wayland.windowManager.sway.config.input = { + pkgs, + config, + ... +}: { + home.packages = with pkgs; [ + dejavu_fonts + font-awesome + lato + liberation_ttf + libertine + libnotify + nerd-fonts.fira-code + nerd-fonts.fira-mono + noto-fonts-emoji + 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; + wayland.windowManager.sway.config.input = { "1:1:AT_Translated_Set_2_keyboard" = { xkb_layout = "us"; xkb_variant = "altgr-intl"; diff --git a/modules/home-manager/accounts/dav/default.nix b/modules/home-manager/accounts/dav/default.nix index ddb3f4a..93de47e 100644 --- a/modules/home-manager/accounts/dav/default.nix +++ b/modules/home-manager/accounts/dav/default.nix @@ -1,23 +1,26 @@ -{ lib, config, inputs, pkgs, ... }: -with lib; -let +{ + lib, + config, + inputs, + pkgs, + ... +}: +with lib; let cfg = config.modules.dav; secretsDirectory = "${(builtins.toString inputs.nix-private)}/secrets"; vdirsyncerConf = { enable = true; auth = "basic"; }; -in -{ +in { options.modules.dav = { enable = mkEnableOption "enable personal Caldav / CardDav"; }; config = mkIf cfg.enable { - sops = { secrets = { "${inputs.nix-private.dav.personal.secret.key}" = { - sopsFile = "${secretsDirectory}/${inputs.nix-private.dav.personal.secret.file}"; + sopsFile = "${secretsDirectory}/${inputs.nix-private.dav.personal.secret.file}"; }; }; }; @@ -34,20 +37,22 @@ in "${config.sops.secrets."${inputs.nix-private.dav.personal.secret.key}".path}" ]; }; - vdirsyncer = vdirsyncerConf // { - metadata = [ - "color" - "displayname" - ]; - itemTypes = [ - "VTODO" - "VEVENT" - ]; - collections = [ - "from a" - "from b" - ]; - }; + vdirsyncer = + vdirsyncerConf + // { + metadata = [ + "color" + "displayname" + ]; + itemTypes = [ + "VTODO" + "VEVENT" + ]; + collections = [ + "from a" + "from b" + ]; + }; khal = { enable = true; type = "discover"; @@ -70,11 +75,13 @@ in type = "filesystem"; fileExt = ".vcf"; }; - vdirsyncer = vdirsyncerConf // { - metadata = [ - "displayname" - ]; - }; + vdirsyncer = + vdirsyncerConf + // { + metadata = [ + "displayname" + ]; + }; khal = { enable = true; color = "#26A269"; @@ -113,7 +120,7 @@ in general = { default_action = "list"; editor = ["nvim" "-i" "NONE"]; - merge_editor = [ "nvim" "-d" ]; + merge_editor = ["nvim" "-d"]; }; }; }; diff --git a/modules/home-manager/accounts/email/default.nix b/modules/home-manager/accounts/email/default.nix index e746ad8..e86498b 100644 --- a/modules/home-manager/accounts/email/default.nix +++ b/modules/home-manager/accounts/email/default.nix @@ -1,10 +1,14 @@ -{ lib, config, pkgs, inputs, ... }: -with lib; -let +{ + lib, + config, + pkgs, + inputs, + ... +}: +with lib; let cfg = config.modules.email; secretsDirectory = "${(builtins.toString inputs.nix-private)}/secrets"; -in -{ +in { options.modules.email = { enable = mkEnableOption "Enable email accounts configuration"; @@ -23,11 +27,14 @@ in config = mkIf cfg.enable { sops = let - secretList = lib.mapAttrs' ( name: value: - nameValuePair ( value.secret.key ) ({ - sopsFile = "${secretsDirectory}/${value.secret.file}"; - }) - ) cfg.accountConfigs; + secretList = + lib.mapAttrs' ( + name: value: + nameValuePair (value.secret.key) { + sopsFile = "${secretsDirectory}/${value.secret.file}"; + } + ) + cfg.accountConfigs; in { secrets = secretList; }; @@ -55,28 +62,32 @@ in showDefaultMailbox = false; }; }; - accountsList = lib.mapAttrs ( name: value: lib.recursiveUpdate defaultSetting value.config ) cfg.accountConfigs; + accountsList = lib.mapAttrs (name: value: lib.recursiveUpdate defaultSetting value.config) cfg.accountConfigs; in { maildirBasePath = "mail"; - accounts = lib.recursiveUpdate accountsList { "${cfg.primary}".primary = true; }; + accounts = lib.recursiveUpdate accountsList {"${cfg.primary}".primary = true;}; }; programs.afew = let mailMoverRules = lib.mergeAttrsList ( lib.attrsets.mapAttrsToList ( n: v: - if lib.hasAttrByPath ["afew" "mailMover"] v then - v.afew.mailMover - else {} - ) cfg.accountConfigs); + if lib.hasAttrByPath ["afew" "mailMover"] v + then v.afew.mailMover + else {} + ) + cfg.accountConfigs + ); mailFilterRules = lib.flatten ( lib.attrsets.mapAttrsToList ( n: v: - if lib.hasAttrByPath ["afew" "filters"] v then - v.afew.filters - else [] - ) cfg.accountConfigs); - in { + if lib.hasAttrByPath ["afew" "filters"] v + then v.afew.filters + else [] + ) + cfg.accountConfigs + ); + in { enable = true; extraConfig = '' [FolderNameFilter] @@ -96,16 +107,20 @@ in ''; }; programs.neomutt = let - accountMacros = lib.imap1 ( - i: - elem: elem // { - map = ["index" "pager"]; - key = ""; - }) ( + accountMacros = + lib.imap1 ( + i: elem: + elem + // { + map = ["index" "pager"]; + key = ""; + } + ) ( lib.attrsets.mapAttrsToList ( - n: c: - { "action" = "source ~/.config/neomutt/${n}Unread:${c.config.address}";} - ) cfg.accountConfigs); + n: c: {"action" = "source ~/.config/neomutt/${n}Unread:${c.config.address}";} + ) + cfg.accountConfigs + ); in { enable = true; unmailboxes = true; @@ -136,94 +151,224 @@ in envelope_from = "yes"; use_envelope_from = "no"; my_status = "' %o/%m  | %l 󰉉 | %f %* Sort: %s-%S Pos: %P '"; - my_pager = "'  %F |  %s %* Pos: %P '"; + my_pager = "'  %F |  %s %* Pos: %P '"; compose_format = "' COMPOSE  %a | 󰉉 %l'"; query_command = "'${pkgs.khard}/bin/khard email --parsable --search-in-source-files %s'"; virtual_spoolfile = "yes"; mail_check_stats = "yes"; mh_purge = "yes"; - mailcap_path= "${config.xdg.configHome}/neomutt/mailcap"; + mailcap_path = "${config.xdg.configHome}/neomutt/mailcap"; }; extraConfig = '' - ${(builtins.readFile ./files/theme.muttrc)} - set reverse_name - charset-hook ^iso-8859-1$ cp1252 - ignore * + ${(builtins.readFile ./files/theme.muttrc)} + set reverse_name + charset-hook ^iso-8859-1$ cp1252 + ignore * - unignore from date subject to cc bcc tags user-agent x-mailer + unignore from date subject to cc bcc tags user-agent x-mailer - # Attachment - auto_view text/x-vcard text/html text/enriched text/calendar - alternative_order text/html text/enriched text/plain text/* + # Attachment + auto_view text/x-vcard text/html text/enriched text/calendar + alternative_order text/html text/enriched text/plain text/* - tag-transforms "attachment" "󰁦" \ - "encrypted" "󱧈" \ - "signed" "󱅞" \ - "unread" "" \ - "replied" "" - tag-formats "attachment" "GA" \ - "encrypted" "GE" \ - "signed" "GS" \ - "unread" "GU" \ - "replied" "GR" + tag-transforms "attachment" "󰁦" \ + "encrypted" "󱧈" \ + "signed" "󱅞" \ + "unread" "" \ + "replied" "" + tag-formats "attachment" "GA" \ + "encrypted" "GE" \ + "signed" "GS" \ + "unread" "GU" \ + "replied" "GR" - ${lib.concatStrings (lib.attrsets.mapAttrsToList ( _: v: if lib.hasAttrByPath [ "neomuttHooks" ] v then v.neomuttHooks else "" ) cfg.accountConfigs)} - # manually source first account instead of use home-manager parameter because - # of $my_pager expansion does not work as this variable is not already set - source ${config.xdg.configHome}/neomutt/${cfg.primary} + ${lib.concatStrings (lib.attrsets.mapAttrsToList (_: v: + if lib.hasAttrByPath ["neomuttHooks"] v + then v.neomuttHooks + else "") + cfg.accountConfigs)} + # manually source first account instead of use home-manager parameter because + # of $my_pager expansion does not work as this variable is not already set + source ${config.xdg.configHome}/neomutt/${cfg.primary} ''; binds = [ - { map = [ "attach" "browser" "index" "pager" ]; key = "g"; action = "noop"; } - { map = [ "attach" "browser" "index" "pager" ]; key = "G"; action = "noop"; } - { map = [ "index" ]; key = "q"; action = "noop";} - { map = [ "pager" ]; key = "Q"; action = "noop";} - { map = [ "attach" "browser" "index" ]; key = "gg"; action = "first-entry";} - { map = [ "attach" "browser" "index" ]; key = "G"; action = "last-entry";} - { map = [ "pager" ]; key = "gg"; action = "top"; } - { map = [ "pager" ]; key = "G"; action = "bottom"; } - { map = [ "pager" ]; key = "k"; action = "previous-line"; } - { map = [ "pager" ]; key = "j"; action = "next-line"; } + { + map = ["attach" "browser" "index" "pager"]; + key = "g"; + action = "noop"; + } + { + map = ["attach" "browser" "index" "pager"]; + key = "G"; + action = "noop"; + } + { + map = ["index"]; + key = "q"; + action = "noop"; + } + { + map = ["pager"]; + key = "Q"; + action = "noop"; + } + { + map = ["attach" "browser" "index"]; + key = "gg"; + action = "first-entry"; + } + { + map = ["attach" "browser" "index"]; + key = "G"; + action = "last-entry"; + } + { + map = ["pager"]; + key = "gg"; + action = "top"; + } + { + map = ["pager"]; + key = "G"; + action = "bottom"; + } + { + map = ["pager"]; + key = "k"; + action = "previous-line"; + } + { + map = ["pager"]; + key = "j"; + action = "next-line"; + } # Scrolling - { map = [ "attach" "browser" "pager" "index" ]; key = "\\CF"; action = "next-page";} - { map = [ "attach" "browser" "pager" "index" ]; key = "\\CB"; action = "previous-page";} - { map = [ "attach" "browser" "pager" "index" ]; key = "\\Cu"; action = "half-up";} - { map = [ "attach" "browser" "pager" "index" ]; key = "\\Cd"; action = "half-down";} - { map = [ "browser" "pager" ]; key = "\\Ce"; action = "next-line";} - { map = [ "browser" "pager" ]; key = "\\Cy"; action = "previous-line";} - { map = [ "index" ]; key = "\\Ce"; action = "next-line";} - { map = [ "index" ]; key = "\\Cy"; action = "previous-line";} + { + map = ["attach" "browser" "pager" "index"]; + key = "\\CF"; + action = "next-page"; + } + { + map = ["attach" "browser" "pager" "index"]; + key = "\\CB"; + action = "previous-page"; + } + { + map = ["attach" "browser" "pager" "index"]; + key = "\\Cu"; + action = "half-up"; + } + { + map = ["attach" "browser" "pager" "index"]; + key = "\\Cd"; + action = "half-down"; + } + { + map = ["browser" "pager"]; + key = "\\Ce"; + action = "next-line"; + } + { + map = ["browser" "pager"]; + key = "\\Cy"; + action = "previous-line"; + } + { + map = ["index"]; + key = "\\Ce"; + action = "next-line"; + } + { + map = ["index"]; + key = "\\Cy"; + action = "previous-line"; + } # Reply - { map =[ "pager" "index" ]; key = "R"; action = "group-reply";} + { + map = ["pager" "index"]; + key = "R"; + action = "group-reply"; + } # sidebar - { map = [ "index" "pager" ]; key = ""; action = "sidebar-toggle-visible";} - { map = [ "index" "pager" ]; key = "{"; action = "sidebar-prev";} - { map = [ "index" "pager" ]; key = "}"; action = "sidebar-next";} - { map = [ "index" "pager" ]; key = "|"; action = "sidebar-open";} + { + map = ["index" "pager"]; + key = ""; + action = "sidebar-toggle-visible"; + } + { + map = ["index" "pager"]; + key = "{"; + action = "sidebar-prev"; + } + { + map = ["index" "pager"]; + key = "}"; + action = "sidebar-next"; + } + { + map = ["index" "pager"]; + key = "|"; + action = "sidebar-open"; + } # open virtual folder - { map = [ "index" "pager" ]; key = "X"; action = "noop";} - { map = [ "index" "pager" ]; key = "X"; action = "change-vfolder";} + { + map = ["index" "pager"]; + key = "X"; + action = "noop"; + } + { + map = ["index" "pager"]; + key = "X"; + action = "change-vfolder"; + } # read entire thread of the current message - { map = [ "index" "pager" ]; key = "+"; action = "entire-thread";} + { + map = ["index" "pager"]; + key = "+"; + action = "entire-thread"; + } # generate virtual folder from query - { map = [ "index" "pager" ]; key = "\\eX"; action = "vfolder-from-query";} + { + map = ["index" "pager"]; + key = "\\eX"; + action = "vfolder-from-query"; + } # generate virtual folder from query with time window - { map = [ "index" "pager" ]; key = "\\CD"; action = "modify-tags";} + { + map = ["index" "pager"]; + key = "\\CD"; + action = "modify-tags"; + } # Editor - { map = [ "editor" ]; key = ""; action = "complete-query";} - { map = [ "editor" ]; key = "^T"; action = "complete";} + { + map = ["editor"]; + key = ""; + action = "complete-query"; + } + { + map = ["editor"]; + key = "^T"; + action = "complete"; + } ]; - macros = [ - { map = [ "pager" ]; key = "\\CB"; action = "${pkgs.urlscan}/bin/urlscan -d -c --color true"; } - ] ++ accountMacros; + macros = + [ + { + map = ["pager"]; + key = "\\CB"; + action = "${pkgs.urlscan}/bin/urlscan -d -c --color true"; + } + ] + ++ accountMacros; }; programs.mbsync = { enable = true; @@ -234,7 +379,7 @@ in }; programs.notmuch = { enable = true; - new.tags = [ "new" ]; + new.tags = ["new"]; hooks.postNew = '' ${pkgs.afew}/bin/afew --tag --new ${pkgs.afew}/bin/afew --move --all diff --git a/modules/home-manager/application/foot/default.nix b/modules/home-manager/application/foot/default.nix index 5807274..0ffe094 100644 --- a/modules/home-manager/application/foot/default.nix +++ b/modules/home-manager/application/foot/default.nix @@ -1,9 +1,11 @@ -{ lib, config, ... }: -with lib; -let - cfg = config.modules.application.foot; -in { + lib, + config, + ... +}: +with lib; let + cfg = config.modules.application.foot; +in { options.modules.application.foot = { enable = mkEnableOption "enable Foot terminal emulator"; @@ -65,7 +67,7 @@ in selection-foreground = "181818"; urls = "b8b8b8"; jump-labels = "181818 f7ca88"; - scrollback-indicator= "181818 b8b8b8"; + scrollback-indicator = "181818 b8b8b8"; }; scrollback = { lines = cfg.scrollback-lines; diff --git a/modules/home-manager/application/gnupg/default.nix b/modules/home-manager/application/gnupg/default.nix index 62a2aab..28c01d6 100644 --- a/modules/home-manager/application/gnupg/default.nix +++ b/modules/home-manager/application/gnupg/default.nix @@ -1,9 +1,12 @@ -{ lib, config, pkgs, ... }: -with lib; -let - cfg = config.modules.application.gnupg; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.modules.application.gnupg; +in { options.modules.application.gnupg = { enable = mkEnableOption "enable GnuPG and related utils"; @@ -20,7 +23,6 @@ in }; }; config = mkIf cfg.enable { - home.packages = with pkgs; [ # pinentry-gnome gcr @@ -46,7 +48,10 @@ in noAllowExternalCache = true; }; - services.ssh-agent.enable = if cfg.enableSshSupport then false else true; + services.ssh-agent.enable = + if cfg.enableSshSupport + then false + else true; programs.password-store = { enable = cfg.pass; }; diff --git a/modules/home-manager/application/imv/default.nix b/modules/home-manager/application/imv/default.nix index 3d791ab..b8ab6e6 100644 --- a/modules/home-manager/application/imv/default.nix +++ b/modules/home-manager/application/imv/default.nix @@ -1,9 +1,12 @@ -{ lib, config, pkgs, ... }: -with lib; -let - cfg = config.modules.application.imv; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.modules.application.imv; +in { options.modules.application.imv = { enable = mkEnableOption "enable IMV image viewer"; @@ -12,14 +15,13 @@ in default = true; description = "install Package, if false relies on distribution packages"; }; - }; config = mkIf cfg.enable { programs.imv = { enable = true; }; xdg.mimeApps.defaultApplications = { - "image/*" = "imv-dir.desktop"; + "image/*" = "imv-dir.desktop"; }; }; } diff --git a/modules/home-manager/application/zathura/default.nix b/modules/home-manager/application/zathura/default.nix index d710830..56922a7 100644 --- a/modules/home-manager/application/zathura/default.nix +++ b/modules/home-manager/application/zathura/default.nix @@ -1,9 +1,11 @@ -{ lib, config, ... }: -with lib; -let - cfg = config.modules.application.zathura; -in { + lib, + config, + ... +}: +with lib; let + cfg = config.modules.application.zathura; +in { options.modules.application.zathura = { enable = mkEnableOption "enable Zathura PDF viewer"; }; @@ -17,7 +19,7 @@ in }; }; xdg.mimeApps.defaultApplications = { - "application/pdf" = "org.pwmt.zathura.desktop"; + "application/pdf" = "org.pwmt.zathura.desktop"; }; }; } diff --git a/modules/home-manager/audio/cmus/default.nix b/modules/home-manager/audio/cmus/default.nix index acec36f..34163ce 100644 --- a/modules/home-manager/audio/cmus/default.nix +++ b/modules/home-manager/audio/cmus/default.nix @@ -1,10 +1,13 @@ -{ lib, config, pkgs, ... }: -with lib; -let - cfg = config.modules.audio.cmus; -in { - options.modules.audio.cmus= { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.modules.audio.cmus; +in { + options.modules.audio.cmus = { enable = mkEnableOption "enable cmus audio player"; }; config = mkIf cfg.enable { diff --git a/modules/home-manager/cli/direnv/default.nix b/modules/home-manager/cli/direnv/default.nix index 7397289..4356ecb 100644 --- a/modules/home-manager/cli/direnv/default.nix +++ b/modules/home-manager/cli/direnv/default.nix @@ -1,9 +1,11 @@ -{ lib, config, ... }: -with lib; -let - cfg = config.modules.cli.direnv; -in { + lib, + config, + ... +}: +with lib; let + cfg = config.modules.cli.direnv; +in { options.modules.cli.direnv = { enable = mkEnableOption "enable direnv"; }; @@ -12,7 +14,7 @@ in programs.direnv = { enable = true; enableZshIntegration = true; - nix-direnv.enable = true; + nix-direnv.enable = true; }; }; } diff --git a/modules/home-manager/cli/ghq/default.nix b/modules/home-manager/cli/ghq/default.nix index d9066b3..31d44da 100644 --- a/modules/home-manager/cli/ghq/default.nix +++ b/modules/home-manager/cli/ghq/default.nix @@ -1,9 +1,12 @@ -{ lib, config, pkgs, ... }: -with lib; -let - cfg = config.modules.cli.ghq; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.modules.cli.ghq; +in { options.modules.cli.ghq = { enable = mkEnableOption "enable ghq"; }; @@ -18,7 +21,7 @@ in root = "~/code"; }; }; - + home.shellAliases = { # thanks jdauliac for the tip g = "cd $(${pkgs.ghq}/bin/ghq root)/$(${pkgs.ghq}/bin/ghq list | ${pkgs.fzf}/bin/fzf)"; diff --git a/modules/home-manager/cli/git/default.nix b/modules/home-manager/cli/git/default.nix index fc1236b..4e9d71e 100644 --- a/modules/home-manager/cli/git/default.nix +++ b/modules/home-manager/cli/git/default.nix @@ -1,9 +1,13 @@ -{ lib, config, pkgs, inputs, ... }: -with lib; -let - cfg = config.modules.cli.git; -in { + lib, + config, + pkgs, + inputs, + ... +}: +with lib; let + cfg = config.modules.cli.git; +in { options.modules.cli.git = { enable = mkEnableOption "enable git"; @@ -40,7 +44,6 @@ in dark = true; line-numbers = true; syntax-theme = "base16-256"; - }; }; package = pkgs.gitFull; diff --git a/modules/home-manager/cli/k8s/default.nix b/modules/home-manager/cli/k8s/default.nix index 7afaf2c..ef40022 100644 --- a/modules/home-manager/cli/k8s/default.nix +++ b/modules/home-manager/cli/k8s/default.nix @@ -1,9 +1,12 @@ -{ lib, config, pkgs, ... }: -with lib; -let - cfg = config.modules.cli.k8s; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.modules.cli.k8s; +in { options.modules.cli.k8s = { enable = mkEnableOption "Install k8s utils"; @@ -15,10 +18,12 @@ in }; config = mkIf cfg.enable { - home.packages = with pkgs; [ - kubectl - kubecm - ] ++ cfg.kubectlPlugins; + home.packages = with pkgs; + [ + kubectl + kubecm + ] + ++ cfg.kubectlPlugins; programs.k9s = { enable = true; }; diff --git a/modules/home-manager/cli/neovim/default.nix b/modules/home-manager/cli/neovim/default.nix index aa5bb6e..71766a2 100644 --- a/modules/home-manager/cli/neovim/default.nix +++ b/modules/home-manager/cli/neovim/default.nix @@ -1,6 +1,10 @@ -{ lib, pkgs, config, ... }: -with lib; -let +{ + lib, + pkgs, + config, + ... +}: +with lib; let cfg = config.modules.cli.neovim; nvim-spell-fr-utf8-dictionary = builtins.fetchurl { url = "https://ftp.nluug.nl/vim/runtime/spell/fr.utf-8.spl"; @@ -14,15 +18,15 @@ let ## 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); + 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}')" + k: v: "vim.lsp.enable('${lib.removeSuffix ".lua" k}')" ) (builtins.readDir ./files/lsp); ## Tony plugins to have a proper helm linting. @@ -35,16 +39,17 @@ let ref = "main"; }; }; -in -{ +in { options.modules.cli.neovim = { enable = mkEnableOption "enable Neovim text editor"; }; config = mkIf cfg.enable { - 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; - }; + 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; @@ -79,9 +84,8 @@ in (builtins.readFile ./files/options.lua) + (builtins.readFile ./files/keybindings.lua) + '' - ${ lib.concatStringsSep "\n" lspLuaConfig} - '' - ; + ${lib.concatStringsSep "\n" lspLuaConfig} + ''; plugins = with pkgs.vimPlugins; [ { plugin = nvim-autopairs; @@ -93,39 +97,39 @@ in { plugin = catppuccin-nvim; type = "lua"; - config = (builtins.readFile ./files/plugins/theme.lua); + config = builtins.readFile ./files/plugins/theme.lua; } { plugin = blink-cmp; type = "lua"; - config = (builtins.readFile ./files/plugins/blink-cmp.lua); + config = builtins.readFile ./files/plugins/blink-cmp.lua; } blink-emoji-nvim blink-cmp-dictionary { plugin = conform-nvim; type = "lua"; - config = (builtins.readFile ./files/plugins/conform.lua); + config = builtins.readFile ./files/plugins/conform.lua; } { plugin = dropbar-nvim; type = "lua"; - config = (builtins.readFile ./files/plugins/dropbar.lua); + config = builtins.readFile ./files/plugins/dropbar.lua; } { plugin = fzf-lua; type = "lua"; - config = (builtins.readFile ./files/plugins/fzf-lua.lua); + config = builtins.readFile ./files/plugins/fzf-lua.lua; } { plugin = gitsigns-nvim; type = "lua"; - config = (builtins.readFile ./files/plugins/gitsign.lua); + config = builtins.readFile ./files/plugins/gitsign.lua; } { plugin = indent-blankline-nvim; type = "lua"; - config ='' + config = '' require("ibl").setup{ indent = { char = "│"}, } @@ -134,34 +138,35 @@ in { plugin = lualine-nvim; type = "lua"; - config = (builtins.readFile ./files/plugins/lualine.lua); + config = builtins.readFile ./files/plugins/lualine.lua; } { - plugin = neo-tree-nvim; - type = "lua"; - config = (builtins.readFile ./files/plugins/neotree.lua); + plugin = neo-tree-nvim; + type = "lua"; + config = builtins.readFile ./files/plugins/neotree.lua; } nui-nvim { plugin = nvim-web-devicons; type = "lua"; - config='' + config = '' require('nvim-web-devicons').setup {} ''; } { plugin = nvim-lint; type = "lua"; - config = ( builtins.readFile ./files/plugins/nvim-lint.lua); + config = (builtins.readFile ./files/plugins/nvim-lint.lua); } { plugin = nvim-sops; type = "lua"; - config = (builtins.readFile ./files/plugins/nvim-sops.lua); + config = builtins.readFile ./files/plugins/nvim-sops.lua; } plenary-nvim { - plugin = (nvim-treesitter.withPlugins (p: [ + plugin = ( + nvim-treesitter.withPlugins (p: [ p.bash p.c p.cpp @@ -187,23 +192,22 @@ in ]) ); type = "lua"; - config = ( builtins.readFile ./files/plugins/treesitter.lua); + config = (builtins.readFile ./files/plugins/treesitter.lua); } { plugin = nvim-treesitter-context; type = "lua"; - config = ( builtins.readFile ./files/plugins/treesitter_context.lua); - + config = (builtins.readFile ./files/plugins/treesitter_context.lua); } { plugin = which-key-nvim; type = "lua"; - config = ( builtins.readFile ./files/plugins/whichkey.lua ); + config = (builtins.readFile ./files/plugins/whichkey.lua); } { - plugin = nvim-k8s-lsp ; + plugin = nvim-k8s-lsp; type = "lua"; - config = ( builtins.readFile ./files/plugins/nvim-k8s-lsp.lua ); + config = (builtins.readFile ./files/plugins/nvim-k8s-lsp.lua); } { plugin = helm-ls-nvim; diff --git a/modules/home-manager/cli/starship/default.nix b/modules/home-manager/cli/starship/default.nix index cc8ff84..d75087f 100644 --- a/modules/home-manager/cli/starship/default.nix +++ b/modules/home-manager/cli/starship/default.nix @@ -1,9 +1,11 @@ -{ lib, config, ... }: -with lib; -let - cfg = config.modules.cli.starship; -in { + lib, + config, + ... +}: +with lib; let + cfg = config.modules.cli.starship; +in { options.modules.cli.starship = { enable = mkEnableOption "enable starship prompt"; }; diff --git a/modules/home-manager/cli/tmux/default.nix b/modules/home-manager/cli/tmux/default.nix index 1ff3293..28b4bd5 100644 --- a/modules/home-manager/cli/tmux/default.nix +++ b/modules/home-manager/cli/tmux/default.nix @@ -1,10 +1,13 @@ - -{ lib, config, pkgs, inputs, ... }: -with lib; -let - cfg = config.modules.cli.tmux; -in { + lib, + config, + pkgs, + inputs, + ... +}: +with lib; let + cfg = config.modules.cli.tmux; +in { options.modules.cli.tmux = { enable = mkEnableOption "enable Tmux"; extraConfig = mkOption { @@ -29,63 +32,64 @@ in mouse = true; prefix = "C-a"; terminal = "tmux-256color"; - extraConfig = '' - set -g detach-on-destroy off - set -g display-time 1500 + extraConfig = + '' + set -g detach-on-destroy off + set -g display-time 1500 - bind -n -N "Select pane to the left of the active pane" M-h select-pane -L - bind -n -N "Select pane below the active pane" M-j select-pane -D - bind -n -N "Select pane above the active pane" M-k select-pane -U - bind -n -N "Select pane to the right of the active pane" M-l select-pane -R + bind -n -N "Select pane to the left of the active pane" M-h select-pane -L + bind -n -N "Select pane below the active pane" M-j select-pane -D + bind -n -N "Select pane above the active pane" M-k select-pane -U + bind -n -N "Select pane to the right of the active pane" M-l select-pane -R - bind -n -r -N "Resize the pane left by 5" M-H resize-pane -L 5 - bind -n -r -N "Resize the pane down by 5" M-J resize-pane -D 5 - bind -n -r -N "Resize the pane up by 5" M-K resize-pane -U 5 - bind -n -r -N "Resize the pane right by 5" M-L resize-pane -R 5 - bind -n M-n split-window -h -c "#{pane_current_path}" - bind -n M-N split-window -v -c "#{pane_current_path}" + bind -n -r -N "Resize the pane left by 5" M-H resize-pane -L 5 + bind -n -r -N "Resize the pane down by 5" M-J resize-pane -D 5 + bind -n -r -N "Resize the pane up by 5" M-K resize-pane -U 5 + bind -n -r -N "Resize the pane right by 5" M-L resize-pane -R 5 + bind -n M-n split-window -h -c "#{pane_current_path}" + bind -n M-N split-window -v -c "#{pane_current_path}" - # define sessions with Alt+F{1..4} for general purpose sessions - bind -n M-F1 if 'tmux has-session -t 1' {switch-client -t 1} {display-popup -E -E 'create-tmux-session -i 1'} - bind -n M-F2 if 'tmux has-session -t 2' {switch-client -t 2} {display-popup -E -E 'create-tmux-session -i 2'} - bind -n M-F3 if 'tmux has-session -t 3' {switch-client -t 3} {display-popup -E -E 'create-tmux-session -i 3'} - bind -n M-F4 if 'tmux has-session -t 4' {switch-client -t 4} {display-popup -E -E 'create-tmux-session -i 4'} + # define sessions with Alt+F{1..4} for general purpose sessions + bind -n M-F1 if 'tmux has-session -t 1' {switch-client -t 1} {display-popup -E -E 'create-tmux-session -i 1'} + bind -n M-F2 if 'tmux has-session -t 2' {switch-client -t 2} {display-popup -E -E 'create-tmux-session -i 2'} + bind -n M-F3 if 'tmux has-session -t 3' {switch-client -t 3} {display-popup -E -E 'create-tmux-session -i 3'} + bind -n M-F4 if 'tmux has-session -t 4' {switch-client -t 4} {display-popup -E -E 'create-tmux-session -i 4'} - # change window with Alt+{1..5} - bind -n -N "Goto window 1" M-1 select-window -T -t 1 - bind -n -N "Goto window 2" M-2 select-window -T -t 2 - bind -n -N "Goto window 3" M-3 select-window -T -t 3 - bind -n -N "Goto window 4" M-4 select-window -T -t 4 - bind -n -N "Goto window 5" M-5 select-window -T -t 5 + # change window with Alt+{1..5} + bind -n -N "Goto window 1" M-1 select-window -T -t 1 + bind -n -N "Goto window 2" M-2 select-window -T -t 2 + bind -n -N "Goto window 3" M-3 select-window -T -t 3 + bind -n -N "Goto window 4" M-4 select-window -T -t 4 + bind -n -N "Goto window 5" M-5 select-window -T -t 5 - # Theme - set -g status-interval 2 - setw -g automatic-rename on # rename window to reflect current program - set -g renumber-windows on # renumber windows when a window is closed - set -g set-titles on - set -g mode-style bg=colour18,fg=colour7 - set -g set-titles-string "#T" - set -g status-bg colour0 - set -g status-fg colour7 - set -g message-style bg=colour19,fg=colour7 + # Theme + set -g status-interval 2 + setw -g automatic-rename on # rename window to reflect current program + set -g renumber-windows on # renumber windows when a window is closed + set -g set-titles on + set -g mode-style bg=colour18,fg=colour7 + set -g set-titles-string "#T" + set -g status-bg colour0 + set -g status-fg colour7 + set -g message-style bg=colour19,fg=colour7 - setw -g window-status-current-format '#[fg=colour18,bg=colour11] #I\ - #[bg=colour19,fg=colour7,bold] #W\ - #{?window_active,󰎂 ,}#{?window_marked_flag,󰃃 ,}#{?window_activity_flag, ,}#{?window_silence_flag,󰝟 ,}#{?window_zoomed_flag,󱀅 ,}' + setw -g window-status-current-format '#[fg=colour18,bg=colour11] #I\ + #[bg=colour19,fg=colour7,bold] #W\ + #{?window_active,󰎂 ,}#{?window_marked_flag,󰃃 ,}#{?window_activity_flag, ,}#{?window_silence_flag,󰝟 ,}#{?window_zoomed_flag,󱀅 ,}' - set -g pane-border-style fg=colour19 - set -g pane-active-border-style fg=colour4 + set -g pane-border-style fg=colour19 + set -g pane-active-border-style fg=colour4 - setw -g window-status-format '#[bg=color12,fg=colour19] #I\ - #[bg=colour18,fg=colour7,dim] #W\ - #{?window_last_flag, ,}#{?window_marked_flag,󰃃 ,}#{?window_activity_flag, ,}#{?window_silence_flag,󰝟 ,}#{?window_zoomed_flag,󱀅 ,}#{?window_bell_flag,#[bg=colour1]#[fg=colour15]#[none] ,}' - setw -g window-status-bell-style bg=colour18,fg=colour7 - set -g status-left-length 100 - set -g status-left '#[bg=colour0, fg=colour6]  #S ' - set -g status-right ' ' - '' - + inputs.nix-private.tmux.nix - + cfg.extraConfig; + setw -g window-status-format '#[bg=color12,fg=colour19] #I\ + #[bg=colour18,fg=colour7,dim] #W\ + #{?window_last_flag, ,}#{?window_marked_flag,󰃃 ,}#{?window_activity_flag, ,}#{?window_silence_flag,󰝟 ,}#{?window_zoomed_flag,󱀅 ,}#{?window_bell_flag,#[bg=colour1]#[fg=colour15]#[none] ,}' + setw -g window-status-bell-style bg=colour18,fg=colour7 + set -g status-left-length 100 + set -g status-left '#[bg=colour0, fg=colour6]  #S ' + set -g status-right ' ' + '' + + inputs.nix-private.tmux.nix + + cfg.extraConfig; plugins = with pkgs; [ tmuxPlugins.tmux-fzf ]; diff --git a/modules/home-manager/cli/utils/default.nix b/modules/home-manager/cli/utils/default.nix index 3532416..8783d4f 100644 --- a/modules/home-manager/cli/utils/default.nix +++ b/modules/home-manager/cli/utils/default.nix @@ -1,14 +1,16 @@ -{ lib, config, pkgs, ... }: -with lib; -let - cfg = config.modules.cli.utils; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.modules.cli.utils; +in { options.modules.cli.utils = { enable = mkEnableOption "Install cli utils"; }; config = mkIf cfg.enable { - programs.bat = { enable = true; config = { @@ -21,7 +23,6 @@ in }; programs.fd = { enable = true; - }; programs.fzf = { enable = true; diff --git a/modules/home-manager/cli/vifm/default.nix b/modules/home-manager/cli/vifm/default.nix index c499ca6..73d5708 100644 --- a/modules/home-manager/cli/vifm/default.nix +++ b/modules/home-manager/cli/vifm/default.nix @@ -1,16 +1,19 @@ -{ lib, config, pkgs, ... }: -with lib; -let - cfg = config.modules.cli.vifm; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.modules.cli.vifm; +in { options.modules.cli.vifm = { enable = mkEnableOption "enable Vifm file browser"; }; config = mkIf cfg.enable { home.packages = with pkgs; [ vifm - chafa # Preview images + chafa # Preview images poppler_utils # Preview PDF file ]; programs.zsh = { diff --git a/modules/home-manager/cli/zellij/default.nix b/modules/home-manager/cli/zellij/default.nix index 944ede7..a742c2d 100644 --- a/modules/home-manager/cli/zellij/default.nix +++ b/modules/home-manager/cli/zellij/default.nix @@ -1,9 +1,11 @@ -{ lib, config, ... }: -with lib; -let - cfg = config.modules.cli.zellij; -in { + lib, + config, + ... +}: +with lib; let + cfg = config.modules.cli.zellij; +in { options.modules.cli.zellij = { enable = mkEnableOption "enable Zellij"; }; diff --git a/modules/home-manager/cli/zsh/default.nix b/modules/home-manager/cli/zsh/default.nix index c9b145a..086e298 100644 --- a/modules/home-manager/cli/zsh/default.nix +++ b/modules/home-manager/cli/zsh/default.nix @@ -1,9 +1,12 @@ -{ lib, config, pkgs, ... }: -with lib; -let - cfg = config.modules.cli.zsh; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.modules.cli.zsh; +in { options.modules.cli.zsh = { enable = mkEnableOption "enable Zsh configuration"; }; @@ -17,7 +20,7 @@ in ignoreAllDups = true; save = 10000; share = true; - path = "${config.xdg.dataHome }/zsh/history"; + path = "${config.xdg.dataHome}/zsh/history"; }; historySubstringSearch = { enable = true; @@ -26,7 +29,7 @@ in }; syntaxHighlighting = { enable = true; - highlighters = [ "brackets" "main" "pattern" ]; + highlighters = ["brackets" "main" "pattern"]; styles = { arithmetic-expansion = "fg=#ba8baf"; assign = "fg=#7cafc2"; @@ -98,15 +101,16 @@ in compinit -C ''; plugins = [ - { - name = "base16-shell"; - src = pkgs.fetchFromGitHub { - owner = "chriskempson"; - repo = "base16-shell"; - rev = "588691ba71b47e75793ed9edfcfaa058326a6f41"; - hash = "sha256-X89FsG9QICDw3jZvOCB/KsPBVOLUeE7xN3VCtf0DD3E="; + { + name = "base16-shell"; + src = pkgs.fetchFromGitHub { + owner = "chriskempson"; + repo = "base16-shell"; + rev = "588691ba71b47e75793ed9edfcfaa058326a6f41"; + hash = "sha256-X89FsG9QICDw3jZvOCB/KsPBVOLUeE7xN3VCtf0DD3E="; }; - }]; + } + ]; localVariables = { BASE16_THEME = "${config.xdg.configHome}/zsh/plugins/base16"; # Make ESC key more reactive to go to normal mode diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index ff73a9f..9959026 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -1,5 +1,4 @@ -{ ... }: -{ +{...}: { imports = [ ./application/foot ./application/gnupg diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 84a6a88..25d030b 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -1,9 +1,12 @@ -{ lib, config, pkgs, ... }: -with lib; -let - cfg = config.modules.desktop.sway; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.modules.desktop.sway; +in { options.modules.desktop.sway = { enable = mkEnableOption "enable Sway Windows Manager"; @@ -72,7 +75,6 @@ in }; cpuThermal = { - thermalZone = mkOption { type = types.nullOr types.int; default = null; @@ -117,7 +119,6 @@ in ./includes/waybar.nix ]; config = mkIf cfg.enable { - programs.fuzzel.enable = true; home.packages = with pkgs; [ @@ -181,11 +182,11 @@ in QT_SCALE_FACTOR_ROUNDING_POLICY = "RoundPreferFloor"; }; - qt = { - enable = true; + qt = { + enable = true; platformTheme.name = "adwaita"; style.name = "adwaita-dark"; - }; + }; xdg = { enable = true; mimeApps.enable = true; @@ -211,8 +212,8 @@ in config = { sway = { default = [ - "wlr" - "gtk" + "wlr" + "gtk" ]; }; }; @@ -223,7 +224,7 @@ in # choose the right screen. This is a workarount to not have to configure # it manually. home.file = mkIf cfg.xdg.useDistributionPortals { - "${config.xdg.configHome}/xdg-desktop-portal-wlr/config".text = '' + "${config.xdg.configHome}/xdg-desktop-portal-wlr/config".text = '' [screencast] max_fps=30 chooser_type=simple diff --git a/modules/home-manager/desktop/sway/includes/fuzzel.nix b/modules/home-manager/desktop/sway/includes/fuzzel.nix index 3f1f6d7..28011c5 100644 --- a/modules/home-manager/desktop/sway/includes/fuzzel.nix +++ b/modules/home-manager/desktop/sway/includes/fuzzel.nix @@ -1,6 +1,9 @@ -{ config, lib, ... }: -with lib; { + config, + lib, + ... +}: +with lib; { config = mkIf config.modules.desktop.sway.enable { programs.fuzzel = { settings = { @@ -25,5 +28,5 @@ with lib; }; }; }; - }; + }; } diff --git a/modules/home-manager/desktop/sway/includes/kanshi.nix b/modules/home-manager/desktop/sway/includes/kanshi.nix index 8376511..61cc764 100644 --- a/modules/home-manager/desktop/sway/includes/kanshi.nix +++ b/modules/home-manager/desktop/sway/includes/kanshi.nix @@ -1,58 +1,60 @@ -{ config, lib, ... }: -with lib; { + config, + lib, + ... +}: +with lib; { config = mkIf config.modules.desktop.sway.enable { services.kanshi = { - enable = config.modules.desktop.sway.kanshi ; + enable = config.modules.desktop.sway.kanshi; settings = [ { - profile.name = "standalone"; profile.outputs = [ - { - criteria = "eDP-1"; - scale = 1.33; - status = "enable"; - } + { + criteria = "eDP-1"; + scale = 1.33; + status = "enable"; + } ]; } { profile.name = "home"; profile.outputs = [ - { - criteria = "Iiyama North America PL2792UH 1166310803122"; - mode = "3840x2160"; - position = "1235,0"; - scale = 1.75; - } - { - criteria = "Iiyama North America PL2792UH 1176923201598"; - mode = "3840x2160"; - position = "0,0"; - transform = "90"; - scale = 1.75; - } - { - criteria = "eDP-1"; - status = "disable"; - } + { + criteria = "Iiyama North America PL2792UH 1166310803122"; + mode = "3840x2160"; + position = "1235,0"; + scale = 1.75; + } + { + criteria = "Iiyama North America PL2792UH 1176923201598"; + mode = "3840x2160"; + position = "0,0"; + transform = "90"; + scale = 1.75; + } + { + criteria = "eDP-1"; + status = "disable"; + } ]; } { profile.name = "work"; profile.outputs = [ - { - criteria = "Iiyama North America PL2792QN 1179214201663"; - mode = "2560x1440"; - position = "1450,0"; - scale = 1.15; - } - { - criteria = "BOE 0x0A95 Unknown"; - mode = "1920x1080"; - position = "0,0"; - scale = 1.325; - } + { + criteria = "Iiyama North America PL2792QN 1179214201663"; + mode = "2560x1440"; + position = "1450,0"; + scale = 1.15; + } + { + criteria = "BOE 0x0A95 Unknown"; + mode = "1920x1080"; + position = "0,0"; + scale = 1.325; + } ]; } ]; diff --git a/modules/home-manager/desktop/sway/includes/mako.nix b/modules/home-manager/desktop/sway/includes/mako.nix index b098010..0f47323 100644 --- a/modules/home-manager/desktop/sway/includes/mako.nix +++ b/modules/home-manager/desktop/sway/includes/mako.nix @@ -1,17 +1,20 @@ -{ config, pkgs, lib, ... }: -with lib; -let - cfg = config.modules.desktop.sway; -in { + config, + pkgs, + lib, + ... +}: +with lib; let + cfg = config.modules.desktop.sway; +in { config = mkIf config.modules.desktop.sway.enable { systemd.user.services.mako = { Service = { ExecStart = "${pkgs.mako}/bin/mako"; }; Install = { - After = [ "sway-session.target" ]; - WantedBy = [ "sway-session.target" ]; + After = ["sway-session.target"]; + WantedBy = ["sway-session.target"]; }; }; services.mako = { @@ -39,10 +42,10 @@ in border-size = 1; default-timeout = 7000; group-by = "app-name"; - format= "%b"; + format = "%b"; }; "app-name=cmus grouped" = { - format = "%b"; + format = "%b"; }; }; }; diff --git a/modules/home-manager/desktop/sway/includes/sway.nix b/modules/home-manager/desktop/sway/includes/sway.nix index 4f0874c..5bc17a3 100644 --- a/modules/home-manager/desktop/sway/includes/sway.nix +++ b/modules/home-manager/desktop/sway/includes/sway.nix @@ -1,13 +1,16 @@ -{ config, pkgs, lib, ... }: -with lib; -let - cfg = config.modules.desktop.sway; -in { + config, + pkgs, + lib, + ... +}: +with lib; let + cfg = config.modules.desktop.sway; +in { config = mkIf config.modules.desktop.sway.enable { wayland.windowManager.sway = { package = config.lib.nixGL.wrap pkgs.sway; - enable = true; + enable = true; wrapperFeatures.gtk = true; systemd.enable = true; config = { @@ -17,7 +20,7 @@ in down = "j"; up = "k"; right = "l"; - bars= []; + bars = []; input = { "4617:27904:MNT_Research_MNT_Reform_Keyboard_2.0_US/ST" = { xkb_layout = "us"; @@ -34,11 +37,16 @@ in }; keybindings = let mod = config.wayland.windowManager.sway.config.modifier; - inherit (config.wayland.windowManager.sway.config) - left down up right terminal; - in - { - # navigate only with direction or workspace + inherit + (config.wayland.windowManager.sway.config) + left + down + up + right + terminal + ; + in { + # navigate only with direction or workspace "${mod}+${left}" = "focus left"; "${mod}+${down}" = "focus down"; "${mod}+${up}" = "focus up"; @@ -53,7 +61,7 @@ in "${mod}+8" = "workspace $ws8"; "${mod}+9" = "workspace $ws9"; "${mod}+0" = "workspace $ws0"; - # move with Shift and direction + # move with Shift and direction "${mod}+Shift+${left}" = "move left"; "${mod}+Shift+${down}" = "move down"; "${mod}+Shift+${up}" = "move up"; @@ -72,12 +80,15 @@ in "${mod}+Ctrl+${left}" = "move workspace to output left"; "${mod}+Return" = "exec ${terminal}"; "${mod}+d" = "exec ${pkgs.fuzzel}/bin/fuzzel"; - # manage windows manager actions with Alt + # manage windows manager actions with Alt "${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" = if cfg.swaylock.useNullPackage then "exec swaylock" else "exec ${pkgs.swaylock}/bin/swaylock"; - # Manage windows placement + "${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"; "${mod}+s" = "layout stacking"; @@ -93,7 +104,7 @@ in "${mod}+Shift+p" = "exec screencapt --region screen"; "${mod}+Alt+p" = "mode screenshot"; "${mod}+Alt+r" = "mode screenrecord"; - # Media stuff + # Media stuff "${mod}+F1" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 1%-"; "${mod}+F2" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +1%"; "${mod}+F3" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_SINK@ 5%-"; @@ -105,44 +116,47 @@ in "${mod}+shift+n" = "exec makoctl dismiss -a"; "${mod}+alt+n" = "mode notification"; }; - modes = - let - inherit (config.wayland.windowManager.sway.config) - left down up right; + modes = let + inherit + (config.wayland.windowManager.sway.config) + left + down + up + right + ; in { "resize" = { - "${left}" = "resize shrink width 10 px or 10 ppt"; - "${down}" = "resize grow height 10 px or 10 ppt"; - "${up}" = "resize shrink height 10 px or 10 ppt"; - "${right}" = "resize grow width 10 px or 10 ppt"; - "Return" = "mode default"; - "Escape" = "mode default"; + "${left}" = "resize shrink width 10 px or 10 ppt"; + "${down}" = "resize grow height 10 px or 10 ppt"; + "${up}" = "resize shrink height 10 px or 10 ppt"; + "${right}" = "resize grow width 10 px or 10 ppt"; + "Return" = "mode default"; + "Escape" = "mode default"; }; "notification" = { "r" = "exec ${pkgs.mako}/bin/makoctl restore"; "Escape" = "mode default"; }; "screenshot" = { - "s" = "exec screencapt --region screen; mode default"; - "Shift+s" = "exec screencapt --region screen -f; mode default"; - "r" = "exec screencapt --region region; mode default"; - "Shift+r" = "exec screencapt --region region -f; mode default"; - "w" = "exec screencapt --region window; mode default"; - "Shift+w" = "exec screencapt --region window -f; mode default"; - "Return" = "mode default"; - "Escape" = "mode default"; + "s" = "exec screencapt --region screen; mode default"; + "Shift+s" = "exec screencapt --region screen -f; mode default"; + "r" = "exec screencapt --region region; mode default"; + "Shift+r" = "exec screencapt --region region -f; mode default"; + "w" = "exec screencapt --region window; mode default"; + "Shift+w" = "exec screencapt --region window -f; mode default"; + "Return" = "mode default"; + "Escape" = "mode default"; }; "screenrecord" = { - "s" = "exec screencapt video --region screen; mode default"; - "Shift+s" = "exec screencapt --region video screen -a; mde default"; - "r" = "exec screencapt video --region region; mode default"; - "Shift+r" = "exec screencapt video --region region -a; mode default"; - "w" = "exec screencapt video --region window -f ; mode default"; - "Shift+w" = "exec screencapt --region video window -a; mode default"; - "Return" = "mode default"; - "Escape" = "mode default"; + "s" = "exec screencapt video --region screen; mode default"; + "Shift+s" = "exec screencapt --region video screen -a; mde default"; + "r" = "exec screencapt video --region region; mode default"; + "Shift+r" = "exec screencapt video --region region -a; mode default"; + "w" = "exec screencapt video --region window -f ; mode default"; + "Shift+w" = "exec screencapt --region video window -a; mode default"; + "Return" = "mode default"; + "Escape" = "mode default"; }; - }; colors = { focused = { @@ -171,7 +185,7 @@ in background = "#900000"; text = "#cccccc"; indicator = "#900000"; - childBorder = "#900000" ; + childBorder = "#900000"; }; #focused_tab_title = { # boder = "#2f343a"; @@ -183,32 +197,33 @@ in border = 1; titlebar = false; commands = [ - { - command = "inhibit_idle fullscreen"; - criteria = { - title = "^.*"; - }; - } - { - command = "inhibit_idle fullscreen"; - criteria = { - app_id = "^.*"; - }; - } - { - command = "resize set 70ppt 70ppt, border pixel 2"; - criteria = { - title = "^Open .*$"; - }; - }]; + { + command = "inhibit_idle fullscreen"; + criteria = { + title = "^.*"; + }; + } + { + command = "inhibit_idle fullscreen"; + criteria = { + app_id = "^.*"; + }; + } + { + command = "resize set 70ppt 70ppt, border pixel 2"; + criteria = { + title = "^Open .*$"; + }; + } + ]; }; floating = { border = 2; titlebar = false; criteria = [ - { - title = "^Open .*$"; - } + { + title = "^Open .*$"; + } ]; }; gaps = { diff --git a/modules/home-manager/desktop/sway/includes/swayidle.nix b/modules/home-manager/desktop/sway/includes/swayidle.nix index 577621c..483bab0 100644 --- a/modules/home-manager/desktop/sway/includes/swayidle.nix +++ b/modules/home-manager/desktop/sway/includes/swayidle.nix @@ -1,31 +1,43 @@ -{ config, lib, pkgs, ... }: -with lib; -let +{ + config, + lib, + pkgs, + ... +}: +with lib; let cfg = config.modules.desktop.sway; -in - { - config = mkIf config.modules.desktop.sway.enable { +in { + config = mkIf config.modules.desktop.sway.enable { services.swayidle = { enable = true; timeouts = [ { timeout = 300; - command = if cfg.swaylock.useNullPackage then ''/usr/bin/swaylock -f'' else ''${pkgs.swaylock}/bin/swaylock -f''; + command = + if cfg.swaylock.useNullPackage + then ''/usr/bin/swaylock -f'' + else ''${pkgs.swaylock}/bin/swaylock -f''; } { timeout = 600; command = ''${pkgs.sway}/bin/swaymsg "output * power off"''; - resumeCommand =''${pkgs.sway}/bin/swaymsg "output * power on"''; + resumeCommand = ''${pkgs.sway}/bin/swaymsg "output * power on"''; } ]; events = [ { event = "before-sleep"; - command = if cfg.swaylock.useNullPackage then ''/usr/bin/swaylock -f'' else ''${pkgs.swaylock}/bin/swaylock -f''; + command = + if cfg.swaylock.useNullPackage + then ''/usr/bin/swaylock -f'' + else ''${pkgs.swaylock}/bin/swaylock -f''; } { event = "lock"; - command = if cfg.swaylock.useNullPackage then ''usr/bin/swaylock -f'' else ''${pkgs.swaylock}/bin/swaylock -f''; + command = + if cfg.swaylock.useNullPackage + then ''usr/bin/swaylock -f'' + else ''${pkgs.swaylock}/bin/swaylock -f''; } ]; }; diff --git a/modules/home-manager/desktop/sway/includes/swaylock.nix b/modules/home-manager/desktop/sway/includes/swaylock.nix index b0340ef..d2d9abe 100644 --- a/modules/home-manager/desktop/sway/includes/swaylock.nix +++ b/modules/home-manager/desktop/sway/includes/swaylock.nix @@ -1,15 +1,24 @@ -{ config, lib, pkgs, ... }: -with lib; -let - cfg = config.modules.desktop.sway; -in { + config, + lib, + pkgs, + ... +}: +with lib; let + cfg = config.modules.desktop.sway; +in { config = mkIf config.modules.desktop.sway.enable { programs.swaylock = { - package = if cfg.swaylock.useNullPackage then null else pkgs.swaylock; + package = + if cfg.swaylock.useNullPackage + then null + else pkgs.swaylock; enable = true; settings = { - image = if cfg.wallpapers.lockscreen != "" then "${cfg.wallpapers.lockscreen}" else false; + image = + if cfg.wallpapers.lockscreen != "" + then "${cfg.wallpapers.lockscreen}" + else false; scaling = "center"; color = "000000"; indicator-radius = 70; diff --git a/modules/home-manager/desktop/sway/includes/waybar.nix b/modules/home-manager/desktop/sway/includes/waybar.nix index 0c9bc96..159dc50 100644 --- a/modules/home-manager/desktop/sway/includes/waybar.nix +++ b/modules/home-manager/desktop/sway/includes/waybar.nix @@ -1,9 +1,12 @@ -{lib, config, pkgs, ...}: -with lib; -let - cfg = config.modules.desktop.sway; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.modules.desktop.sway; +in { config = mkIf cfg.enable { programs.waybar = { enable = true; @@ -23,41 +26,45 @@ in "sway/workspaces" "sway/mode" ]; - modules-right = [ - "network" - "custom/sep" - ] ++ ( - if cfg.waybar.laptop then [ + modules-right = + [ + "network" + "custom/sep" + ] + ++ ( + if cfg.waybar.laptop + then [ "backlight" "battery" "custom/sep" ] else [ ] - ) ++ - [ - - "memory" - "cpu" - "temperature" - "custom/sep" - ] ++ ( - if cfg.waybar.gpuThermal.enable then [ + ) + ++ [ + "memory" + "cpu" + "temperature" + "custom/sep" + ] + ++ ( + if cfg.waybar.gpuThermal.enable + then [ "temperature#gpu" "custom/sep" ] else [ ] - ) ++ - [ - "pulseaudio#input" - "pulseaudio#output" - "custom/sep" - "clock" - "custom/sep" - "privacy" - "tray" - ]; + ) + ++ [ + "pulseaudio#input" + "pulseaudio#output" + "custom/sep" + "clock" + "custom/sep" + "privacy" + "tray" + ]; "clock" = { "format-alt" = "{:%Y-%m-%d}"; "timezone" = "Europe/Paris"; @@ -65,7 +72,7 @@ in }; "cpu" = { "format" = "{usage}% {icon}"; - "format-icons" = [ "" ]; + "format-icons" = [""]; "states" = { "critical" = 90; "warning" = 70; @@ -77,19 +84,19 @@ in "tooltip" = false; }; "custom/screenrecord" = { - "format" = "  [rec.] "; - "interval" = 1; - "exec" = "echo '{\"class\": \"recording\"}'"; - "exec-if" = "${pkgs.procps}/bin/pgrep wl-screenrec"; + "format" = "  [rec.] "; + "interval" = 1; + "exec" = "echo '{\"class\": \"recording\"}'"; + "exec-if" = "${pkgs.procps}/bin/pgrep wl-screenrec"; "on-click" = "exec ${pkgs.coreutils}/bin/kill -s SIGINT $(${pkgs.procps}/bin/pgrep wl-screenrec)"; "tooltype" = false; }; "idle_inhibitor" = { - "format" = "{icon}"; - "format-icons" = { - "activated" = ""; - "deactivated" = ""; - }; + "format" = "{icon}"; + "format-icons" = { + "activated" = ""; + "deactivated" = ""; + }; }; "memory" = { "format" = "{used:0.0f}/{total:0.0f}G "; @@ -107,11 +114,11 @@ in "format-wifi" = "{signalStrength}%  "; "tooltip" = false; }; - "privacy"= { + "privacy" = { "icon-spacing" = 6; "icon-size" = 11; "transition-duration" = 250; - "modules"= [ + "modules" = [ { "type" = "screenshare"; "tooltip" = false; @@ -149,19 +156,22 @@ in "tooltip" = false; }; "sway/mode" = { - "format" = "{}"; + "format" = "{}"; }; "sway/workspace" = { - "disable-scroll" = true; + "disable-scroll" = true; }; "temperature" = { "critical-threshold" = 80; "format" = " {temperatureC}°C  "; - "thermal-zone" = mkIf ( cfg.waybar.cpuThermal.thermalZone != null ) + "thermal-zone" = + mkIf (cfg.waybar.cpuThermal.thermalZone != null) cfg.waybar.cpuThermal.thermalZone; - "hwmon-path-abs" = mkIf ( cfg.waybar.cpuThermal.hwmonPathAbs != "" ) + "hwmon-path-abs" = + mkIf (cfg.waybar.cpuThermal.hwmonPathAbs != "") "${cfg.waybar.cpuThermal.hwmonPathAbs}"; - "input-filename" = mkIf ( cfg.waybar.cpuThermal.inputFilename != "" ) + "input-filename" = + mkIf (cfg.waybar.cpuThermal.inputFilename != "") "${cfg.waybar.cpuThermal.inputFilename}"; }; "temperature#gpu" = { diff --git a/modules/home-manager/gaming/lutris/default.nix b/modules/home-manager/gaming/lutris/default.nix index 3718e71..09c539c 100644 --- a/modules/home-manager/gaming/lutris/default.nix +++ b/modules/home-manager/gaming/lutris/default.nix @@ -1,15 +1,18 @@ -{ lib, config, pkgs, ... }: -with lib; -let - cfg = config.modules.gaming.lutris; -in { + lib, + config, + pkgs, + ... +}: +with lib; let + cfg = config.modules.gaming.lutris; +in { options.modules.gaming.lutris = { enable = mkEnableOption "enable Lutris Gaming preservation platform"; }; config = mkIf cfg.enable { home.packages = with pkgs; [ - ( lutris.override { + (lutris.override { extraLibraries = pkgs: [ wine xorg.libXcursor diff --git a/modules/home-manager/video/kdenlive/default.nix b/modules/home-manager/video/kdenlive/default.nix index d84021a..fd80c48 100644 --- a/modules/home-manager/video/kdenlive/default.nix +++ b/modules/home-manager/video/kdenlive/default.nix @@ -1,9 +1,12 @@ -{ pkgs, lib, config, ... }: -with lib; -let - cfg = config.modules.video.kdenlive; -in { + pkgs, + lib, + config, + ... +}: +with lib; let + cfg = config.modules.video.kdenlive; +in { options.modules.video.kdenlive = { enable = mkEnableOption "enable Kdenlive video editor"; }; diff --git a/modules/home-manager/video/mpv/default.nix b/modules/home-manager/video/mpv/default.nix index f208476..263645b 100644 --- a/modules/home-manager/video/mpv/default.nix +++ b/modules/home-manager/video/mpv/default.nix @@ -1,9 +1,11 @@ -{ lib, config, ... }: -with lib; -let - cfg = config.modules.video.mpv; -in { + lib, + config, + ... +}: +with lib; let + cfg = config.modules.video.mpv; +in { options.modules.video.mpv = { enable = mkEnableOption "enable MPV video player"; }; diff --git a/modules/home-manager/web/firefox/conf/doh.nix b/modules/home-manager/web/firefox/conf/doh.nix index 73f526a..9634029 100644 --- a/modules/home-manager/web/firefox/conf/doh.nix +++ b/modules/home-manager/web/firefox/conf/doh.nix @@ -1,7 +1,7 @@ { -# DNS over HTTP (DoH), aka. Trusted Recursive Resolver (TRR) -# (https://wiki.mozilla.org/Trusted_Recursive_Resolver), uses a server run by -# Cloudflare to resolve hostnames, even when the system uses another (normal) DNS -# server. This setting disables it and sets the mode to explicit opt-out (5). + # DNS over HTTP (DoH), aka. Trusted Recursive Resolver (TRR) + # (https://wiki.mozilla.org/Trusted_Recursive_Resolver), uses a server run by + # Cloudflare to resolve hostnames, even when the system uses another (normal) DNS + # server. This setting disables it and sets the mode to explicit opt-out (5). "network.trr.mode" = 5; } diff --git a/modules/home-manager/web/firefox/conf/drm.nix b/modules/home-manager/web/firefox/conf/drm.nix index 94b210c..03e7078 100644 --- a/modules/home-manager/web/firefox/conf/drm.nix +++ b/modules/home-manager/web/firefox/conf/drm.nix @@ -1,12 +1,12 @@ { -# Disables playback of DRM-controlled HTML5 content -# if enabled, automatically downloads the Widevine Content Decryption Module -# provided by Google Inc. Details -# (https://support.mozilla.org/en-US/kb/enable-drm#w_opt-out-of-cdm-playback-uninstall-cdms-and-stop-all-cdm-downloads) + # Disables playback of DRM-controlled HTML5 content + # if enabled, automatically downloads the Widevine Content Decryption Module + # provided by Google Inc. Details + # (https://support.mozilla.org/en-US/kb/enable-drm#w_opt-out-of-cdm-playback-uninstall-cdms-and-stop-all-cdm-downloads) "media.eme.enabled" = false; -# Disables the Widevine Content Decryption Module provided by Google Inc. -# Used for the playback of DRM-controlled HTML5 content Details -# (https://support.mozilla.org/en-US/kb/enable-drm#w_disable-the-google-widevine-cdm-without-uninstalling) + # Disables the Widevine Content Decryption Module provided by Google Inc. + # Used for the playback of DRM-controlled HTML5 content Details + # (https://support.mozilla.org/en-US/kb/enable-drm#w_disable-the-google-widevine-cdm-without-uninstalling) "media.gmp-widevinecdm.enabled" = false; } diff --git a/modules/home-manager/web/firefox/conf/experiments.nix b/modules/home-manager/web/firefox/conf/experiments.nix index 27d435a..4f06710 100644 --- a/modules/home-manager/web/firefox/conf/experiments.nix +++ b/modules/home-manager/web/firefox/conf/experiments.nix @@ -1,18 +1,17 @@ { - -# Disable shield studies -# Mozilla shield studies (https://wiki.mozilla.org/Firefox/Shield) is a feature -# which allows mozilla to remotely install experimental addons. + # Disable shield studies + # Mozilla shield studies (https://wiki.mozilla.org/Firefox/Shield) is a feature + # which allows mozilla to remotely install experimental addons. "app.normandy.enabled" = false; "app.normandy.api_url" = ""; "app.shield.optoutstudies.enabled" = false; "extensions.shield-recipe-client.enabled" = false; "extensions.shield-recipe-client.api_url" = ""; -# Disable experiments -# Telemetry Experiments (https://wiki.mozilla.org/Telemetry/Experiments) is a -# feature that allows Firefox to automatically download and run specially-designed -# restartless addons based on certain conditions. + # Disable experiments + # Telemetry Experiments (https://wiki.mozilla.org/Telemetry/Experiments) is a + # feature that allows Firefox to automatically download and run specially-designed + # restartless addons based on certain conditions. "experiments.enabled" = false; "experiments.manifest.uri" = ""; "experiments.supported" = false; diff --git a/modules/home-manager/web/firefox/conf/extensions.nix b/modules/home-manager/web/firefox/conf/extensions.nix index 94957a0..03d8b2d 100644 --- a/modules/home-manager/web/firefox/conf/extensions.nix +++ b/modules/home-manager/web/firefox/conf/extensions.nix @@ -1,24 +1,24 @@ { -# Firefox sends data about installed addons as metadata updates -# (https://blog.mozilla.org/addons/how-to-opt-out-of-add-on-metadata-updates/), so -# Mozilla is able to recommend you other addons. + # Firefox sends data about installed addons as metadata updates + # (https://blog.mozilla.org/addons/how-to-opt-out-of-add-on-metadata-updates/), so + # Mozilla is able to recommend you other addons. "extensions.getAddons.cache.enabled" = false; -# Disable about:addons' Get Add-ons panel -# The start page with recommended addons uses google analytics. + # Disable about:addons' Get Add-ons panel + # The start page with recommended addons uses google analytics. "extensions.getAddons.showPane" = false; "extensions.webservice.discoverURL" = ""; -# disable pocket extension - "extensions.pocket.enabled" = false; + # disable pocket extension + "extensions.pocket.enabled" = false; -# disable extensions recommendations + # disable extensions recommendations "extensions.htmlaboutaddons.recommendations.enabled" = false; -# Automatically activate extensions + # Automatically activate extensions "extensions.autoDisableScopes" = 0; -# Deacticate extensions auto-update + # Deacticate extensions auto-update "extensions.update.enabled" = false; "extensions.update.autoUpdateDefault" = false; } diff --git a/modules/home-manager/web/firefox/conf/preferences.nix b/modules/home-manager/web/firefox/conf/preferences.nix index 5c58f7d..0c40f07 100644 --- a/modules/home-manager/web/firefox/conf/preferences.nix +++ b/modules/home-manager/web/firefox/conf/preferences.nix @@ -1,53 +1,50 @@ { - "browser.sessionstore.enabled" = true; "browser.sessionstore.restore_hidden_tabs" = true; "browser.sessionstore.restore_pinned_tabs_on_demand" = true; "browser.sessionstore.resume_after_os_start" = true; -# use blank page for new tabs + # use blank page for new tabs "browser.newtabpage.enabled" = false; -# Disable preloading of the new tab page. -# By default Firefox preloads the new tab page (with website thumbnails) in the -# background before it is even opened. + # Disable preloading of the new tab page. + # By default Firefox preloads the new tab page (with website thumbnails) in the + # background before it is even opened. "browser.newtab.preload" = false; - -# Disable check for captive portal. -# By default, Firefox checks for the presence of a captive portal on every -# startup. This involves traffic to Akamai -# (https://support.mozilla.org/questions/1169302). + # Disable check for captive portal. + # By default, Firefox checks for the presence of a captive portal on every + # startup. This involves traffic to Akamai + # (https://support.mozilla.org/questions/1169302). "network.captive-portal-service.enabled" = false; - -# Disable Javascript in PDF viewer -# Disables executing of JavaScript in the PDF form viewer. It is possible that -# some PDFs are not rendered correctly due to missing functions. + # Disable Javascript in PDF viewer + # Disables executing of JavaScript in the PDF form viewer. It is possible that + # some PDFs are not rendered correctly due to missing functions. "pdfjs.enableScripting" = true; -# Allow fullscreen in Firefox windows + # Allow fullscreen in Firefox windows "full-screen-api.ignore-widgets" = true; -# About:config show warning - "browser.aboutConfig.showWarning" = false; + # About:config show warning + "browser.aboutConfig.showWarning" = false; -# avoid some useless recommendations - "extensions.htmlaboutaddons.recommendations.enabled" = false; - "extensions.recommendations.themeRecommendationUrl" = ""; + # avoid some useless recommendations + "extensions.htmlaboutaddons.recommendations.enabled" = false; + "extensions.recommendations.themeRecommendationUrl" = ""; -# Do not send FF build ID for site in startup page - "browser.startup.homepage_override.mstone" = "ignore"; + # Do not send FF build ID for site in startup page + "browser.startup.homepage_override.mstone" = "ignore"; - "browser.aboutHomeSnippets.updateUrl" = ""; + "browser.aboutHomeSnippets.updateUrl" = ""; -# Restore session when restart - "browser.sessionstore.resume_session_once" = true; + # Restore session when restart + "browser.sessionstore.resume_session_once" = true; -# Disable translation - "browser.translations.enabled" = false; + # Disable translation + "browser.translations.enabled" = false; -# disable AI shit + # disable AI shit "browser.ml.chat.enabled" = false; "browser.ml.chat.shortcuts" = false; "browser.ml.chat.sidebar" = false; diff --git a/modules/home-manager/web/firefox/conf/privacy.nix b/modules/home-manager/web/firefox/conf/privacy.nix index 3b4d987..0c8c28c 100644 --- a/modules/home-manager/web/firefox/conf/privacy.nix +++ b/modules/home-manager/web/firefox/conf/privacy.nix @@ -1,108 +1,107 @@ { -# Disable access to device sensor data -# Disallow websites to access sensor data (ambient light, motion, device -# orientation and proximity data). + # Disable access to device sensor data + # Disallow websites to access sensor data (ambient light, motion, device + # orientation and proximity data). "device.sensors.ambientLight.enabled" = false; "device.sensors.enabled" = false; "device.sensors.motion.enabled" = false; "device.sensors.orientation.enabled" = false; "device.sensors.proximity.enabled" = false; -# Using a popular useragent string -# (https://techblog.willshouse.com/2012/01/03/most-common-user-agents/) avoids -# attracting attention i.e. with an Iceweasel UA. (keep blank to use the default) + # Using a popular useragent string + # (https://techblog.willshouse.com/2012/01/03/most-common-user-agents/) avoids + # attracting attention i.e. with an Iceweasel UA. (keep blank to use the default) -# Block Cookies -# Block 3rd-Party cookies or even all cookies. + # Block Cookies + # Block 3rd-Party cookies or even all cookies. "network.cookie.cookieBehavior" = 5; -# Block Referer -# Firefox tells a website, from which site you're coming (the so called RefControl -# (http://kb.mozillazine.org/Network.http.sendRefererHeader">referer). You can -# find more detailed settings in this ghacks -# article or install the referer). You can + # find more detailed settings in this ghacks + # article or install the IndexedDB is a way, -# websites can store structured data. This can be IndexedDB is a way, + # websites can store structured data. This can be fingerprinting with WebGL. Another -# issue is, that websites can fingerprinting with WebGL. Another + # issue is, that websites can Date: Fri, 26 Sep 2025 22:18:20 +0200 Subject: [PATCH 67/70] refactor(desktop): rework kanshi configurations --- hosts/luci/home-config.nix | 2 +- hosts/morty/home-config.nix | 15 ++++- hosts/morty/includes/home-manager.nix | 6 -- hosts/rick/home-config.nix | 2 +- hosts/work/home-config.nix | 23 ++++++- modules/home-manager/desktop/sway/default.nix | 56 +++++++++++++++- .../desktop/sway/includes/kanshi.nix | 65 ++++--------------- 7 files changed, 104 insertions(+), 65 deletions(-) diff --git a/hosts/luci/home-config.nix b/hosts/luci/home-config.nix index 2d28771..601195e 100644 --- a/hosts/luci/home-config.nix +++ b/hosts/luci/home-config.nix @@ -29,7 +29,7 @@ accounts.dav.enable = true; desktop.sway = { enable = true; - kanshi = true; + kanshi.enable = true; wallpapers.lockscreen = "${./files/lockscreen.png}"; wallpapers.desktop = "${./files/wallpaper.png} center #000000"; waybar = { diff --git a/hosts/morty/home-config.nix b/hosts/morty/home-config.nix index 5fff91e..435106c 100644 --- a/hosts/morty/home-config.nix +++ b/hosts/morty/home-config.nix @@ -46,7 +46,20 @@ desktop.sway = { enable = true; wallpapers.lockscreen = "${./files/lockscreen.png}"; - kanshi = true; + kanshi = { + enable = true; + standalone = { + profile.name = "standalone"; + profile.outputs = [ + { + criteria = "eDP-1"; + scale = 1.325; + transform = "90"; + status = "enable"; + } + ]; + }; + }; waybar = { laptop = true; gpuThermal.enable = false; diff --git a/hosts/morty/includes/home-manager.nix b/hosts/morty/includes/home-manager.nix index aedd064..3ef0de6 100644 --- a/hosts/morty/includes/home-manager.nix +++ b/hosts/morty/includes/home-manager.nix @@ -22,11 +22,5 @@ "pointer_accel" = "0.3"; }; }; - wayland.windowManager.sway.config.output = { - "eDP-1" = { - transform = "90"; - scale = "1.3"; - }; - }; sops.age.keyFile = "/home/ephase/.config/sops/age/keys.txt"; } diff --git a/hosts/rick/home-config.nix b/hosts/rick/home-config.nix index 6fc8d29..fe5a66f 100644 --- a/hosts/rick/home-config.nix +++ b/hosts/rick/home-config.nix @@ -38,7 +38,7 @@ gaming.lutris.enable = false; desktop.sway = { enable = true; - kanshi = false; + kanshi.enable = false; swaylock.useNullPackage = true; wallpapers.lockscreen = "${./files/lockscreen.png}"; wallpapers.desktop = "${./files/background.png} fill #000000"; diff --git a/hosts/work/home-config.nix b/hosts/work/home-config.nix index 262c650..8bfb54b 100644 --- a/hosts/work/home-config.nix +++ b/hosts/work/home-config.nix @@ -36,7 +36,28 @@ }; desktop.sway = { enable = true; - kanshi = true; + kanshi = { + enable = true; + profiles = [ + + { + profile.name = "work"; + profile.outputs = [ + { + criteria = "Iiyama North America PL2792QN 1179214201663"; + mode = "2560x1440"; + position = "1450,0"; + scale = 1.15; + } + { + criteria = "BOE 0x0A95 Unknown"; + mode = "1920x1080"; + position = "0,0"; + scale = 1.325; + } + ]; + } + ]; swaylock.useNullPackage = true; waybar = { laptop = true; diff --git a/modules/home-manager/desktop/sway/default.nix b/modules/home-manager/desktop/sway/default.nix index 25d030b..efdc0c8 100644 --- a/modules/home-manager/desktop/sway/default.nix +++ b/modules/home-manager/desktop/sway/default.nix @@ -10,12 +10,66 @@ in { options.modules.desktop.sway = { enable = mkEnableOption "enable Sway Windows Manager"; - kanshi = mkOption { + kanshi.enable = mkOption { type = types.bool; default = false; description = "configure laptop mode"; }; + kanshi.standalone = mkOption { + type = types.attrs; + default = { + profile.name = "standalone"; + profile.outputs = [ + { + criteria = "eDP-1"; + scale = 1.325; + status = "enable"; + } + ]; + }; + description = '' + Default configuration for laptop internal screen when no others screen + are connected. + ''; + }; + kanshi.home = mkOption { + type = types.attrs; + default = { + profile.name = "home"; + profile.outputs = [ + { + criteria = "Iiyama North America PL2792UH 1166310803122"; + mode = "3840x2160"; + position = "1235,0"; + scale = 1.75; + } + { + criteria = "Iiyama North America PL2792UH 1176923201598"; + mode = "3840x2160"; + position = "0,0"; + transform = "90"; + scale = 1.75; + } + { + criteria = "eDP-1"; + status = "disable"; + } + ]; + }; + description = '' + Default home configuration use on most of my laptops + ''; + }; + + kanshi.others = mkOption { + type = types.listOf types.attrs; + default = []; + description = '' + Kanshi profile to use specifically for host + ''; + }; + swaylock.useNullPackage = mkOption { type = types.bool; default = false; diff --git a/modules/home-manager/desktop/sway/includes/kanshi.nix b/modules/home-manager/desktop/sway/includes/kanshi.nix index 61cc764..b3cd36d 100644 --- a/modules/home-manager/desktop/sway/includes/kanshi.nix +++ b/modules/home-manager/desktop/sway/includes/kanshi.nix @@ -3,61 +3,18 @@ lib, ... }: -with lib; { - config = mkIf config.modules.desktop.sway.enable { +with lib; let + cfg = config.modules.desktop.sway; +in { + config = mkIf cfg.enable { services.kanshi = { - enable = config.modules.desktop.sway.kanshi; - settings = [ - { - profile.name = "standalone"; - profile.outputs = [ - { - criteria = "eDP-1"; - scale = 1.33; - status = "enable"; - } - ]; - } - { - profile.name = "home"; - profile.outputs = [ - { - criteria = "Iiyama North America PL2792UH 1166310803122"; - mode = "3840x2160"; - position = "1235,0"; - scale = 1.75; - } - { - criteria = "Iiyama North America PL2792UH 1176923201598"; - mode = "3840x2160"; - position = "0,0"; - transform = "90"; - scale = 1.75; - } - { - criteria = "eDP-1"; - status = "disable"; - } - ]; - } - { - profile.name = "work"; - profile.outputs = [ - { - criteria = "Iiyama North America PL2792QN 1179214201663"; - mode = "2560x1440"; - position = "1450,0"; - scale = 1.15; - } - { - criteria = "BOE 0x0A95 Unknown"; - mode = "1920x1080"; - position = "0,0"; - scale = 1.325; - } - ]; - } - ]; + enable = cfg.kanshi.enable; + settings = + [ + cfg.kanshi.standalone + cfg.kanshi.home + ] + ++ cfg.kanshi.others; }; }; } From 02994d825e7fc169dd123250418358065e0d431e Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Mon, 6 Oct 2025 21:35:18 +0200 Subject: [PATCH 68/70] fix(morty): error in internal screen rotation with sway --- hosts/morty/home-config.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hosts/morty/home-config.nix b/hosts/morty/home-config.nix index 435106c..866d69a 100644 --- a/hosts/morty/home-config.nix +++ b/hosts/morty/home-config.nix @@ -54,7 +54,7 @@ { criteria = "eDP-1"; scale = 1.325; - transform = "90"; + transform = "270"; status = "enable"; } ]; From 0694e831dc4d3a17c6e16150d20ea5c6394f4223 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 7 Oct 2025 00:43:23 +0200 Subject: [PATCH 69/70] chore: update private repo --- flake.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flake.lock b/flake.lock index 6ed56d8..648c9dd 100644 --- a/flake.lock +++ b/flake.lock @@ -64,10 +64,10 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1758616692, - "narHash": "sha256-Q/7qOK6Vgjc6pBPCmnbIq2JF4XFlLYTvekS4v2OypAE=", + "lastModified": 1759789371, + "narHash": "sha256-diiyS8Bj/M9UdmiIEos0QBHIIpj/AdO9+dsb2Oc9qws=", "ref": "main", - "rev": "d59b492f9bfdb522280f1344ae25c821ba7b11b4", + "rev": "e6e9d0c0a7cc152ec48ce07cccf56f57a2580d3a", "shallow": true, "type": "git", "url": "ssh://git@git.epha.se:24422/ephase/nix-private.git" From ee7eae2fa8be849ec20856fe06461c87b8b9a4e5 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Tue, 7 Oct 2025 00:44:43 +0200 Subject: [PATCH 70/70] chore(morty): change mail account name --- hosts/morty/home-config.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hosts/morty/home-config.nix b/hosts/morty/home-config.nix index 866d69a..5d49f03 100644 --- a/hosts/morty/home-config.nix +++ b/hosts/morty/home-config.nix @@ -3,11 +3,11 @@ email = { enable = true; accountConfigs = { - a = inputs.nix-private.mail.xiemeart; - b = inputs.nix-private.mail.ephase; - c = inputs.nix-private.mail.ubordeaux; + "1" = inputs.nix-private.mail.xiemeart; + "2" = inputs.nix-private.mail.ephase; + "3" = inputs.nix-private.mail.ubordeaux; }; - primary = "a"; + primary = "1"; }; dav.enable = true; application = {