summaryrefslogtreecommitdiff
path: root/modules/home
diff options
context:
space:
mode:
authorLeonardo Santiago <[email protected]>2025-05-05 23:34:15 -0300
committerLeonardo Santiago <[email protected]>2025-05-05 23:34:15 -0300
commit0ec583d64fb7640611f5e2d440c75a1b8b86f8f5 (patch)
treeb8b644b9ca3b7261f698fe1fc6efc9c92775c1f0 /modules/home
parent1bd7f83ce366a3d4addf7487af8c8b019320720f (diff)
chore(home-manager): improve home-manager structuring
Diffstat (limited to 'modules/home')
-rw-r--r--modules/home/default.nix57
-rw-r--r--modules/home/mu.nix66
-rw-r--r--modules/home/zen.nix29
3 files changed, 152 insertions, 0 deletions
diff --git a/modules/home/default.nix b/modules/home/default.nix
new file mode 100644
index 0000000..cfa68c2
--- /dev/null
+++ b/modules/home/default.nix
@@ -0,0 +1,57 @@
+{ config, lib, inputs, pkgs, ...}: with lib; let
+ cfg = config.santi-modules;
+in {
+ imports = [
+ inputs.home-manager.nixosModules.home-manager
+ ./mu.nix
+ ./zen.nix
+ ];
+ config = mkIf cfg.default-user.enable {
+ home-manager = {
+ backupFileExtension = "backup";
+ useGlobalPkgs = true;
+ useUserPackages = true;
+ users.leonardo = {
+ home = {
+ stateVersion = "23.05";
+ homeDirectory = "/home/leonardo";
+ packages = lib.optionals cfg.desktop-environment.enable (with pkgs; [
+ legcord
+ slack
+ whatsapp-for-linux
+ telegram-desktop
+ ]);
+ };
+ programs = {
+ bash = {
+ enable = true;
+ enableCompletion = true;
+ initExtra = ''
+ shopt -s -q autocd
+ shopt -s no_empty_cmd_completion
+ '';
+ };
+ fzf = {
+ enable = true;
+ enableBashIntegration = true;
+ };
+ git = {
+ enable = true;
+ lfs.enable = true;
+ diff-so-fancy.enable = true;
+ extraConfig = {
+ user = {
+ name = "Leonardo Santiago";
+ email = "[email protected]";
+ signingkey = "~/.ssh/id_ed25519";
+ };
+ color.ui = true;
+ gpg.format = "ssh";
+ commit.gpgsign = true;
+ };
+ };
+ };
+ };
+ };
+ };
+}
diff --git a/modules/home/mu.nix b/modules/home/mu.nix
new file mode 100644
index 0000000..1a22963
--- /dev/null
+++ b/modules/home/mu.nix
@@ -0,0 +1,66 @@
+{ config, lib, ...}: with lib; let
+ cfg = config.santi-modules;
+in {
+ options.santi-modules.mu.enable = mkEnableOption "Enables mu, mbsync and msmtp";
+ config = mkIf cfg.mu.enable {
+ home-manager.users.leonardo = {
+ programs = {
+ mu.enable = true;
+ msmtp.enable = true;
+ mbsync.enable = true;
+ };
+ services.mbsync = {
+ enable = true;
+ frequency = "*:0/5";
+ };
+ accounts.email.accounts = {
+ personal = {
+ address = "[email protected]";
+ userName = "[email protected]";
+ imap.host = "imap.gmail.com";
+ smtp.host = "smtp.gmail.com";
+ primary = true;
+ realName = "Leonardo Ribeiro Santiago";
+ mbsync = {
+ enable = true;
+ create = "both";
+ expunge = "both";
+ };
+ msmtp.enable = true;
+ mu.enable = true;
+ passwordCommand = "cat ${config.age.secrets.personal-mail.path}";
+ };
+ university = {
+ address = "[email protected]";
+ userName = "[email protected]";
+ imap.host = "imap.gmail.com";
+ smtp.host = "smtp.gmail.com";
+ realName = "Leonardo Ribeiro Santiago";
+ mbsync = {
+ enable = true;
+ create = "both";
+ expunge = "both";
+ };
+ msmtp.enable = true;
+ mu.enable = true;
+ passwordCommand = "cat ${config.age.secrets.university-mail.path}";
+ };
+ work = {
+ address = "[email protected]";
+ userName = "[email protected]";
+ imap.host = "imap.gmail.com";
+ smtp.host = "smtp.gmail.com";
+ realName = "Leonardo Ribeiro Santiago";
+ mbsync = {
+ enable = true;
+ create = "both";
+ expunge = "both";
+ };
+ msmtp.enable = true;
+ mu.enable = true;
+ passwordCommand = "cat ${config.age.secrets.work-mail.path}";
+ };
+ };
+ };
+ };
+}
diff --git a/modules/home/zen.nix b/modules/home/zen.nix
new file mode 100644
index 0000000..f7535dc
--- /dev/null
+++ b/modules/home/zen.nix
@@ -0,0 +1,29 @@
+{ config, lib, inputs, ...}: with lib; let
+ cfg = config.santi-modules;
+in {
+ options.santi-modules.zen-browser = mkEnableOption "Enable zen browser from flake";
+ config = mkIf cfg.default-user.enable {
+ home-manager = {
+ users.leonardo = {
+ imports = [
+ inputs.zen-browser.homeModules.default
+ ];
+ programs.zen-browser = {
+ enable = true;
+ policies = {
+ AutofillAddressEnabled = true;
+ AutofillCreditCardEnabled = false;
+ DisableAppUpdate = true;
+ DisableFeedbackCommands = true;
+ DisableFirefoxStudies = true;
+ DisablePocket = true; # save webs for later reading
+ DisableTelemetry = true;
+ DontCheckDefaultBrowser = true;
+ NoDefaultBookmarks = true;
+ OfferToSaveLogins = false;
+ };
+ };
+ };
+ };
+ };
+}