diff options
| -rw-r--r-- | modules/home-manager/personal/gui/x/i3/default.nix | 12 | ||||
| -rw-r--r-- | modules/home-manager/personal/gui/x/i3/startup.nix | 17 | ||||
| -rw-r--r-- | modules/home-manager/personal/profiles.nix | 23 | ||||
| -rw-r--r-- | modules/home-manager/personal/programs/thunderbird.nix | 18 |
4 files changed, 41 insertions, 29 deletions
diff --git a/modules/home-manager/personal/gui/x/i3/default.nix b/modules/home-manager/personal/gui/x/i3/default.nix index 715ed44..b802f25 100644 --- a/modules/home-manager/personal/gui/x/i3/default.nix +++ b/modules/home-manager/personal/gui/x/i3/default.nix @@ -25,12 +25,12 @@ in { { class = "MUBI"; } { class = "Deezer"; } ]; - } // lib.optionalAttrs config.personal.profiles.social { - "9: social" = [ - { class = "^Mail$"; } - { class = "^thunderbird$"; } - { class = "^Signal$"; } - ]; + } // lib.optionalAttrs config.personal.profiles.social.enable { + "9: social" = [ { class = "^Mail$"; } { class = "^thunderbird$"; } ] + ++ lib.optional + config.personal.profiles.social.identities.personal { + class = "^signal-desktop$"; + }; } // { "10: passwords" = [{ # matches <some db>.kbdx [Locked] - KeePassXC diff --git a/modules/home-manager/personal/gui/x/i3/startup.nix b/modules/home-manager/personal/gui/x/i3/startup.nix index b40247b..f3b54a2 100644 --- a/modules/home-manager/personal/gui/x/i3/startup.nix +++ b/modules/home-manager/personal/gui/x/i3/startup.nix @@ -11,12 +11,15 @@ (autostart { command = "keepassxc"; }) ] ++ autostartIf config.programs.thunderbird.enable { command = "thunderbird"; } - ++ autostartIf config.personal.profiles.social { command = "signal-desktop"; } - # ++ autostartIf config.services.redshift.enable { - # command = "systemctl --user start redshift"; - # } - # ++ autostartIf config.services.xidlehook.enable { - # command = "systemctl --user start xidlehook.service"; - # } + ++ autostartIf (config.personal.profiles.social.enable + && config.personal.profiles.social.identities.personal) { + command = "signal-desktop"; + } + # ++ autostartIf config.services.redshift.enable { + # command = "systemctl --user start redshift"; + # } + # ++ autostartIf config.services.xidlehook.enable { + # command = "systemctl --user start xidlehook.service"; + # } ; } diff --git a/modules/home-manager/personal/profiles.nix b/modules/home-manager/personal/profiles.nix index 5aad4a4..b15a86c 100644 --- a/modules/home-manager/personal/profiles.nix +++ b/modules/home-manager/personal/profiles.nix @@ -3,10 +3,17 @@ let cfg = config.personal.profiles; mkEnableProfileOption = name: lib.mkEnableOption "${name} profile"; + mkEnableIdentityOption = name: lib.mkEnableOption "${name} identity"; in { options.personal.profiles = { dev = mkEnableProfileOption "development"; - social = mkEnableProfileOption "social"; + social = { + enable = mkEnableProfileOption "social"; + identities = { + personal = mkEnableIdentityOption "personal"; + work = mkEnableIdentityOption "work"; + }; + }; syncing = mkEnableProfileOption "syncing"; multimedia = mkEnableProfileOption "video"; }; @@ -76,9 +83,11 @@ in { }; }) - (lib.mkIf cfg.social { + (lib.mkIf cfg.social.enable { home.packages = with pkgs; - lib.optionals config.personal.gui.enable [ signal-desktop ]; + lib.optionals + (config.personal.gui.enable && cfg.social.identities.personal) + [ signal-desktop ]; programs.thunderbird.enable = lib.mkDefault config.personal.gui.enable; accounts.email.accounts = let gpg = { @@ -89,7 +98,7 @@ in { "mail.identity.id_${id}.fcc_folder_picker_mode" = 0; }; in { - personal = { + personal = lib.mkIf cfg.social.identities.personal { inherit gpg; address = "quentin@aristote.fr"; userName = "quentin@aristote.fr"; @@ -110,11 +119,11 @@ in { }; thunderbird = { enable = true; - profiles = [ "all" "personal" ]; + profiles = [ "default" ]; settings = thunderbirdSettings; }; }; - work = { + work = lib.mkIf cfg.social.identities.work { inherit gpg; address = "quentin.aristote@ens.fr"; userName = "qaristote"; @@ -140,7 +149,7 @@ in { }; thunderbird = { enable = true; - profiles = [ "all" "work" ]; + profiles = [ "default" ]; settings = thunderbirdSettings; }; }; diff --git a/modules/home-manager/personal/programs/thunderbird.nix b/modules/home-manager/personal/programs/thunderbird.nix index b17e1d6..0d6313c 100644 --- a/modules/home-manager/personal/programs/thunderbird.nix +++ b/modules/home-manager/personal/programs/thunderbird.nix @@ -22,18 +22,18 @@ let "mailnews.default_sort_order" = 2; # Descending "mailnews.default_sort_type" = 22; # By thread }; - profiles = { - all = { }; - personal = { }; - work = { }; - }; in { config = lib.mkMerge [ - { programs.thunderbird = { inherit profiles; }; } + { + programs.thunderbird = { + profiles.default = { + isDefault = true; + withExternalGnupg = true; + }; + }; + } (lib.mkIf config.programs.thunderbird.enable { - home.file = lib.concatMapAttrs - (name: _: { ".thunderbird/${name}/user.js".text = configDefault; }) - profiles; + home.file.".thunderbird/default/user.js".text = configDefault; }) ]; } |
