From aab05a8135ea55b5bf6326c08e64b49dc1c0b04d Mon Sep 17 00:00:00 2001 From: Leyla Becker Date: Sat, 20 Dec 2025 10:35:21 -0600 Subject: [PATCH 1/3] feat: created entries to install PWA's --- .../home-manager/leyla/packages/default.nix | 3 ++ .../home-manager-modules/programs/default.nix | 3 ++ .../programs/matrix-cyberia-pwa.nix | 33 +++++++++++++++++++ .../programs/proton-calendar-pwa.nix | 32 ++++++++++++++++++ .../programs/proton-mail-pwa.nix | 32 ++++++++++++++++++ 5 files changed, 103 insertions(+) create mode 100644 modules/home-manager-modules/programs/matrix-cyberia-pwa.nix create mode 100644 modules/home-manager-modules/programs/proton-calendar-pwa.nix create mode 100644 modules/home-manager-modules/programs/proton-mail-pwa.nix diff --git a/configurations/home-manager/leyla/packages/default.nix b/configurations/home-manager/leyla/packages/default.nix index 0917d04..a3669af 100644 --- a/configurations/home-manager/leyla/packages/default.nix +++ b/configurations/home-manager/leyla/packages/default.nix @@ -72,6 +72,9 @@ in { noita-entangled-worlds.enable = true; tor-browser.enable = true; gdx-liftoff.enable = true; + proton-mail-pwa.enable = true; + proton-calendar-pwa.enable = true; + matrix-cyberia-pwa.enable = true; }) ]; } diff --git a/modules/home-manager-modules/programs/default.nix b/modules/home-manager-modules/programs/default.nix index 5b3a169..916eb31 100644 --- a/modules/home-manager-modules/programs/default.nix +++ b/modules/home-manager-modules/programs/default.nix @@ -46,5 +46,8 @@ ./gdx-liftoff.nix ./tor-browser.nix ./vmware-workstation.nix + ./proton-mail-pwa.nix + ./proton-calendar-pwa.nix + ./matrix-cyberia-pwa.nix ]; } diff --git a/modules/home-manager-modules/programs/matrix-cyberia-pwa.nix b/modules/home-manager-modules/programs/matrix-cyberia-pwa.nix new file mode 100644 index 0000000..46cb402 --- /dev/null +++ b/modules/home-manager-modules/programs/matrix-cyberia-pwa.nix @@ -0,0 +1,33 @@ +{ + lib, + pkgs, + config, + ... +}: { + options.programs.matrix-cyberia-pwa = { + enable = lib.mkEnableOption "enable Matrix Cyberia PWA"; + }; + + config = lib.mkIf config.programs.matrix-cyberia-pwa.enable (lib.mkMerge [ + { + xdg.desktopEntries.matrix-cyberia-pwa = { + name = "Matrix (Cyberia)"; + type = "Application"; + exec = "${pkgs.chromium}/bin/chromium --app=https://chat.cyberia.club/"; + icon = "matrix"; + terminal = false; + categories = ["Network" "InstantMessaging"]; + }; + } + ( + lib.mkIf config.impermanence.enable { + home.persistence."/persist${config.home.homeDirectory}" = { + directories = [ + "${config.xdg.configHome}/chromium" + ]; + allowOther = true; + }; + } + ) + ]); +} diff --git a/modules/home-manager-modules/programs/proton-calendar-pwa.nix b/modules/home-manager-modules/programs/proton-calendar-pwa.nix new file mode 100644 index 0000000..4a52dd8 --- /dev/null +++ b/modules/home-manager-modules/programs/proton-calendar-pwa.nix @@ -0,0 +1,32 @@ +{ + lib, + pkgs, + config, + ... +}: { + options.programs.proton-calendar-pwa = { + enable = lib.mkEnableOption "enable Proton Calendar PWA"; + }; + + config = lib.mkIf config.programs.proton-calendar-pwa.enable (lib.mkMerge [ + { + xdg.desktopEntries.proton-calendar-pwa = { + name = "Proton Calendar"; + type = "Application"; + exec = "${pkgs.chromium}/bin/chromium --app=https://calendar.proton.me"; + icon = "chrome-ojibjkjikcpjonjjngfkegflhmffeemk-Default"; + terminal = false; + }; + } + ( + lib.mkIf config.impermanence.enable { + home.persistence."/persist${config.home.homeDirectory}" = { + directories = [ + "${config.xdg.configHome}/chromium" + ]; + allowOther = true; + }; + } + ) + ]); +} diff --git a/modules/home-manager-modules/programs/proton-mail-pwa.nix b/modules/home-manager-modules/programs/proton-mail-pwa.nix new file mode 100644 index 0000000..7b302d5 --- /dev/null +++ b/modules/home-manager-modules/programs/proton-mail-pwa.nix @@ -0,0 +1,32 @@ +{ + lib, + pkgs, + config, + ... +}: { + options.programs.proton-mail-pwa = { + enable = lib.mkEnableOption "enable Proton Mail PWA"; + }; + + config = lib.mkIf config.programs.proton-mail-pwa.enable (lib.mkMerge [ + { + xdg.desktopEntries.proton-mail-pwa = { + name = "Proton Mail"; + type = "Application"; + exec = "${pkgs.chromium}/bin/chromium --app=https://mail.proton.me"; + icon = "chrome-jnpecgipniidlgicjocehkhajgdnjekh-Default"; + terminal = false; + }; + } + ( + lib.mkIf config.impermanence.enable { + home.persistence."/persist${config.home.homeDirectory}" = { + directories = [ + "${config.xdg.configHome}/chromium" + ]; + allowOther = true; + }; + } + ) + ]); +} From b75aaca605b32a6e8bf4ba36d48a3743f2890e2f Mon Sep 17 00:00:00 2001 From: Leyla Becker Date: Sun, 21 Dec 2025 01:42:59 -0600 Subject: [PATCH 2/3] feat: added more options to pwa packages --- .../programs/matrix-cyberia-pwa.nix | 28 ++++++++++++++++--- .../programs/proton-calendar-pwa.nix | 28 ++++++++++++++++--- .../programs/proton-mail-pwa.nix | 28 ++++++++++++++++--- 3 files changed, 72 insertions(+), 12 deletions(-) diff --git a/modules/home-manager-modules/programs/matrix-cyberia-pwa.nix b/modules/home-manager-modules/programs/matrix-cyberia-pwa.nix index 46cb402..666836b 100644 --- a/modules/home-manager-modules/programs/matrix-cyberia-pwa.nix +++ b/modules/home-manager-modules/programs/matrix-cyberia-pwa.nix @@ -3,24 +3,44 @@ pkgs, config, ... -}: { +}: let + cfg = config.programs.matrix-cyberia-pwa; + isChromium = cfg.package == pkgs.chromium; + isBrowserImpermanenceSupported = cfg.package == pkgs.chromium; +in { options.programs.matrix-cyberia-pwa = { enable = lib.mkEnableOption "enable Matrix Cyberia PWA"; + package = lib.mkOption { + type = lib.types.package; + default = pkgs.chromium; + description = "Browser package to use for the PWA"; + }; + impermanence = { + enable = lib.mkOption { + type = lib.types.bool; + default = isBrowserImpermanenceSupported; + description = "Enable impermanence configuration for the PWA. Only automatically enabled when using chromium."; + }; + }; }; - config = lib.mkIf config.programs.matrix-cyberia-pwa.enable (lib.mkMerge [ + config = lib.mkIf cfg.enable (lib.mkMerge [ { xdg.desktopEntries.matrix-cyberia-pwa = { name = "Matrix (Cyberia)"; type = "Application"; - exec = "${pkgs.chromium}/bin/chromium --app=https://chat.cyberia.club/"; + exec = "${cfg.package}/bin/${cfg.package.pname} --app=https://chat.cyberia.club/"; icon = "matrix"; terminal = false; categories = ["Network" "InstantMessaging"]; }; + + warnings = + lib.optional (config.impermanence.enable && !isBrowserImpermanenceSupported) + "matrix-cyberia-pwa: Using unsupported package with impermanence enabled. You will need to manually configure impermanence for ${cfg.package.pname}. Supported package(s) ${pkgs.chromium.pname}"; } ( - lib.mkIf config.impermanence.enable { + lib.mkIf (config.impermanence.enable && cfg.impermanence.enable && isChromium) { home.persistence."/persist${config.home.homeDirectory}" = { directories = [ "${config.xdg.configHome}/chromium" diff --git a/modules/home-manager-modules/programs/proton-calendar-pwa.nix b/modules/home-manager-modules/programs/proton-calendar-pwa.nix index 4a52dd8..d927452 100644 --- a/modules/home-manager-modules/programs/proton-calendar-pwa.nix +++ b/modules/home-manager-modules/programs/proton-calendar-pwa.nix @@ -3,23 +3,43 @@ pkgs, config, ... -}: { +}: let + cfg = config.programs.proton-calendar-pwa; + isChromium = cfg.package == pkgs.chromium; + isBrowserImpermanenceSupported = cfg.package == pkgs.chromium; +in { options.programs.proton-calendar-pwa = { enable = lib.mkEnableOption "enable Proton Calendar PWA"; + package = lib.mkOption { + type = lib.types.package; + default = pkgs.chromium; + description = "Browser package to use for the PWA"; + }; + impermanence = { + enable = lib.mkOption { + type = lib.types.bool; + default = isBrowserImpermanenceSupported; + description = "Enable impermanence configuration for the PWA. Only automatically enabled when using chromium."; + }; + }; }; - config = lib.mkIf config.programs.proton-calendar-pwa.enable (lib.mkMerge [ + config = lib.mkIf cfg.enable (lib.mkMerge [ { xdg.desktopEntries.proton-calendar-pwa = { name = "Proton Calendar"; type = "Application"; - exec = "${pkgs.chromium}/bin/chromium --app=https://calendar.proton.me"; + exec = "${cfg.package}/bin/${cfg.package.pname} --app=https://calendar.proton.me"; icon = "chrome-ojibjkjikcpjonjjngfkegflhmffeemk-Default"; terminal = false; }; + + warnings = + lib.optional (config.impermanence.enable && !isBrowserImpermanenceSupported) + "proton-calendar-pwa: Using unsupported package with impermanence enabled. You will need to manually configure impermanence for ${cfg.package.pname}. Supported package(s) ${pkgs.chromium.pname}"; } ( - lib.mkIf config.impermanence.enable { + lib.mkIf (config.impermanence.enable && cfg.impermanence.enable && isChromium) { home.persistence."/persist${config.home.homeDirectory}" = { directories = [ "${config.xdg.configHome}/chromium" diff --git a/modules/home-manager-modules/programs/proton-mail-pwa.nix b/modules/home-manager-modules/programs/proton-mail-pwa.nix index 7b302d5..bbbf3b2 100644 --- a/modules/home-manager-modules/programs/proton-mail-pwa.nix +++ b/modules/home-manager-modules/programs/proton-mail-pwa.nix @@ -3,23 +3,43 @@ pkgs, config, ... -}: { +}: let + cfg = config.programs.proton-mail-pwa; + isChromium = cfg.package == pkgs.chromium; + isBrowserImpermanenceSupported = cfg.package == pkgs.chromium; +in { options.programs.proton-mail-pwa = { enable = lib.mkEnableOption "enable Proton Mail PWA"; + package = lib.mkOption { + type = lib.types.package; + default = pkgs.chromium; + description = "Browser package to use for the PWA"; + }; + impermanence = { + enable = lib.mkOption { + type = lib.types.bool; + default = isBrowserImpermanenceSupported; + description = "Enable impermanence configuration for the PWA. Only automatically enabled when using chromium."; + }; + }; }; - config = lib.mkIf config.programs.proton-mail-pwa.enable (lib.mkMerge [ + config = lib.mkIf cfg.enable (lib.mkMerge [ { xdg.desktopEntries.proton-mail-pwa = { name = "Proton Mail"; type = "Application"; - exec = "${pkgs.chromium}/bin/chromium --app=https://mail.proton.me"; + exec = "${cfg.package}/bin/${cfg.package.pname} --app=https://mail.proton.me"; icon = "chrome-jnpecgipniidlgicjocehkhajgdnjekh-Default"; terminal = false; }; + + warnings = + lib.optional (config.impermanence.enable && !isBrowserImpermanenceSupported) + "proton-mail-pwa: Using unsupported package with impermanence enabled. You will need to manually configure impermanence for ${cfg.package.pname}. Supported package(s) ${pkgs.chromium.pname}"; } ( - lib.mkIf config.impermanence.enable { + lib.mkIf (config.impermanence.enable && cfg.impermanence.enable && isChromium) { home.persistence."/persist${config.home.homeDirectory}" = { directories = [ "${config.xdg.configHome}/chromium" From cb19c771f50199b47e5bd6171773a57dca3dfa34 Mon Sep 17 00:00:00 2001 From: Leyla Becker Date: Sun, 21 Dec 2025 13:19:49 -0600 Subject: [PATCH 3/3] fix: fixed generation when we manually set the package --- .../programs/matrix-cyberia-pwa.nix | 23 +++++++++++-------- .../programs/proton-calendar-pwa.nix | 21 +++++++++-------- .../programs/proton-mail-pwa.nix | 21 +++++++++-------- 3 files changed, 37 insertions(+), 28 deletions(-) diff --git a/modules/home-manager-modules/programs/matrix-cyberia-pwa.nix b/modules/home-manager-modules/programs/matrix-cyberia-pwa.nix index 666836b..644df92 100644 --- a/modules/home-manager-modules/programs/matrix-cyberia-pwa.nix +++ b/modules/home-manager-modules/programs/matrix-cyberia-pwa.nix @@ -26,19 +26,22 @@ in { config = lib.mkIf cfg.enable (lib.mkMerge [ { - xdg.desktopEntries.matrix-cyberia-pwa = { - name = "Matrix (Cyberia)"; - type = "Application"; - exec = "${cfg.package}/bin/${cfg.package.pname} --app=https://chat.cyberia.club/"; - icon = "matrix"; - terminal = false; - categories = ["Network" "InstantMessaging"]; - }; - warnings = lib.optional (config.impermanence.enable && !isBrowserImpermanenceSupported) - "matrix-cyberia-pwa: Using unsupported package with impermanence enabled. You will need to manually configure impermanence for ${cfg.package.pname}. Supported package(s) ${pkgs.chromium.pname}"; + "matrix-cyberia-pwa: Using unsupported package. You will need to manually configure pwa for ${cfg.package.pname}. Supported package(s) ${pkgs.chromium.pname}"; } + ( + lib.mkIf isChromium { + xdg.desktopEntries.matrix-cyberia-pwa = { + name = "Matrix (Cyberia)"; + type = "Application"; + exec = "${cfg.package}/bin/${cfg.package.pname} --app=https://chat.cyberia.club/"; + icon = "matrix"; + terminal = false; + categories = ["Network" "InstantMessaging"]; + }; + } + ) ( lib.mkIf (config.impermanence.enable && cfg.impermanence.enable && isChromium) { home.persistence."/persist${config.home.homeDirectory}" = { diff --git a/modules/home-manager-modules/programs/proton-calendar-pwa.nix b/modules/home-manager-modules/programs/proton-calendar-pwa.nix index d927452..33796e2 100644 --- a/modules/home-manager-modules/programs/proton-calendar-pwa.nix +++ b/modules/home-manager-modules/programs/proton-calendar-pwa.nix @@ -26,18 +26,21 @@ in { config = lib.mkIf cfg.enable (lib.mkMerge [ { - xdg.desktopEntries.proton-calendar-pwa = { - name = "Proton Calendar"; - type = "Application"; - exec = "${cfg.package}/bin/${cfg.package.pname} --app=https://calendar.proton.me"; - icon = "chrome-ojibjkjikcpjonjjngfkegflhmffeemk-Default"; - terminal = false; - }; - warnings = lib.optional (config.impermanence.enable && !isBrowserImpermanenceSupported) - "proton-calendar-pwa: Using unsupported package with impermanence enabled. You will need to manually configure impermanence for ${cfg.package.pname}. Supported package(s) ${pkgs.chromium.pname}"; + "proton-calendar-pwa: Using unsupported package. You will need to manually configure pwa for ${cfg.package.pname}. Supported package(s) ${pkgs.chromium.pname}"; } + ( + lib.mkIf isChromium { + xdg.desktopEntries.proton-calendar-pwa = { + name = "Proton Calendar"; + type = "Application"; + exec = "${cfg.package}/bin/${cfg.package.pname} --app=https://calendar.proton.me"; + icon = "chrome-ojibjkjikcpjonjjngfkegflhmffeemk-Default"; + terminal = false; + }; + } + ) ( lib.mkIf (config.impermanence.enable && cfg.impermanence.enable && isChromium) { home.persistence."/persist${config.home.homeDirectory}" = { diff --git a/modules/home-manager-modules/programs/proton-mail-pwa.nix b/modules/home-manager-modules/programs/proton-mail-pwa.nix index bbbf3b2..3a3fe89 100644 --- a/modules/home-manager-modules/programs/proton-mail-pwa.nix +++ b/modules/home-manager-modules/programs/proton-mail-pwa.nix @@ -26,18 +26,21 @@ in { config = lib.mkIf cfg.enable (lib.mkMerge [ { - xdg.desktopEntries.proton-mail-pwa = { - name = "Proton Mail"; - type = "Application"; - exec = "${cfg.package}/bin/${cfg.package.pname} --app=https://mail.proton.me"; - icon = "chrome-jnpecgipniidlgicjocehkhajgdnjekh-Default"; - terminal = false; - }; - warnings = lib.optional (config.impermanence.enable && !isBrowserImpermanenceSupported) - "proton-mail-pwa: Using unsupported package with impermanence enabled. You will need to manually configure impermanence for ${cfg.package.pname}. Supported package(s) ${pkgs.chromium.pname}"; + "proton-mail-pwa: Using unsupported package. You will need to manually configure pwa for ${cfg.package.pname}. Supported package(s) ${pkgs.chromium.pname}"; } + ( + lib.mkIf isChromium { + xdg.desktopEntries.proton-mail-pwa = { + name = "Proton Mail"; + type = "Application"; + exec = "${cfg.package}/bin/${cfg.package.pname} --app=https://mail.proton.me"; + icon = "chrome-jnpecgipniidlgicjocehkhajgdnjekh-Default"; + terminal = false; + }; + } + ) ( lib.mkIf (config.impermanence.enable && cfg.impermanence.enable && isChromium) { home.persistence."/persist${config.home.homeDirectory}" = {