From 0ec583d64fb7640611f5e2d440c75a1b8b86f8f5 Mon Sep 17 00:00:00 2001 From: Leonardo Santiago Date: Mon, 5 May 2025 23:34:15 -0300 Subject: chore(home-manager): improve home-manager structuring --- modules/home/default.nix | 57 +++++++++++++++++++++++++++++++++++++++++ modules/home/mu.nix | 66 ++++++++++++++++++++++++++++++++++++++++++++++++ modules/home/zen.nix | 29 +++++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 modules/home/default.nix create mode 100644 modules/home/mu.nix create mode 100644 modules/home/zen.nix (limited to 'modules/home') 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 = "leonardo.ribeiro.santiago@gmail.com"; + 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 = "leonardo.ribeiro.santiago@gmail.com"; + userName = "leonardo.ribeiro.santiago@gmail.com"; + 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 = "leonardors@dcc.ufrj.br"; + userName = "leonardors@dcc.ufrj.br"; + 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 = "leonardo@mixrank.com"; + userName = "leonardo@mixrank.com"; + 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; + }; + }; + }; + }; + }; +} -- cgit v1.2.3