From fbb1bd25305df628cc5471da5c983e4006b65f74 Mon Sep 17 00:00:00 2001 From: geekiot Date: Tue, 30 Sep 2025 00:29:21 +0500 Subject: [PATCH] add (home options): add themes options & security stuff options --- options/home/security.nix | 86 ++++++++++++++++++++++++++++++++++++++ options/home/theme.nix | 88 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 options/home/security.nix create mode 100644 options/home/theme.nix diff --git a/options/home/security.nix b/options/home/security.nix new file mode 100644 index 0000000..151c0ac --- /dev/null +++ b/options/home/security.nix @@ -0,0 +1,86 @@ +{ + lib, + pkgs, + config, + ... +}: +let + cfg = config.home.security; +in +{ + options = { + home.security = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Security stuff."; + }; + gpg = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "GPG configurations."; + }; + homeDir = lib.mkOption { + type = lib.types.str; + default = "${config.home.homeDirectory}/.gpg"; + description = "GPG config directory."; + }; + }; + ssh = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "SSH base configurations."; + }; + homeDir = lib.mkOption { + type = lib.types.str; + default = "${config.home.homeDirectory}/.ssh"; + description = "SSH config directory."; + }; + }; + }; + }; + + config = lib.mkIf cfg.enable { + programs.gpg = lib.mkIf cfg.gpg.enable { + enable = true; + package = pkgs.gnupg; + mutableKeys = true; + mutableTrust = true; + homedir = cfg.gpg.homeDir; + settings = { + no-comments = true; + throw-keyids = true; + no-emit-version = true; + keyid-format = "0xlong"; + }; + }; + services.gpg-agent = lib.mkIf cfg.gpg.enable { + enable = true; + pinentry.package = pkgs.pinentry-qt; + }; + + programs.ssh = lib.mkIf cfg.ssh.enable { + enable = true; + enableDefaultConfig = false; + package = pkgs.openssh; + matchBlocks = { + "*" = { + hashKnownHosts = true; + userKnownHostsFile = "${cfg.ssh.homeDir}/known_hosts"; + + forwardAgent = false; + addKeysToAgent = "no"; + + serverAliveInterval = 0; + serverAliveCountMax = 3; + + controlMaster = "no"; + controlPath = "${cfg.ssh.homeDir}/master-%r@%n:%p"; + controlPersist = "no"; + }; + }; + }; + }; +} diff --git a/options/home/theme.nix b/options/home/theme.nix new file mode 100644 index 0000000..a1650f6 --- /dev/null +++ b/options/home/theme.nix @@ -0,0 +1,88 @@ +{ + lib, + pkgs, + inputs, + config, + ... +}: +let + cfg = config.home.theme; +in +{ + imports = [ inputs.catppuccin.homeModules.catppuccin ]; + + options = { + home.theme = { + catppuccin = { + enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Catppuccin Theme."; + }; + kitty.enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Kitty catppuccin Theme."; + }; + helix.enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Helix catppuccin Theme."; + }; + vscodium.enable = lib.mkOption { + type = lib.types.bool; + default = false; + description = "VSCodium catppuccin Theme."; + }; + }; + }; + }; + + config = lib.mkIf cfg.catppuccin.enable { + fonts.fontconfig.enable = true; + home.packages = with pkgs; [ + noto-fonts + noto-fonts-emoji + noto-fonts-cjk-sans + nerd-fonts.jetbrains-mono + ]; + + programs.kitty = lib.mkIf cfg.catppuccin.kitty.enable { + themeFile = "Catppuccin-Macchiato"; + settings = { + cursor_trail = 3; + }; + font = { + name = "JetBrainsMono Nerd Font"; + size = 14; + }; + }; + + catppuccin.helix = lib.mkIf cfg.catppuccin.helix.enable { + enable = true; + flavor = "macchiato"; + }; + + programs.vscode.profiles.default = lib.mkIf cfg.catppuccin.vscodium.enable { + extensions = with pkgs.vscode-marketplace; [ + catppuccin.catppuccin-vsc + catppuccin.catppuccin-vsc-icons + ]; + userSettings = { + "workbench.colorTheme" = "Catppuccin Macchiato"; + "workbench.iconTheme" = "catppuccin-macchiato"; + + "editor.fontFamily" = "'JetBrainsMono Nerd Font'"; + "editor.fontLigatures" = true; + "editor.fontSize" = 16; + + "terminal.integrated.fontFamily" = "'JetBrainsMono Nerd Font'"; + "terminal.integrated.fontLigatures.enabled" = true; + "terminal.integrated.fontSize" = 14; + + "editor.minimap.sectionHeaderFontSize" = 16; + "editor.suggestFontSize" = 16; + }; + }; + }; +}