add (home options): add themes options & security stuff options
This commit is contained in:
parent
57c8e8d0c9
commit
fbb1bd2530
2 changed files with 174 additions and 0 deletions
86
options/home/security.nix
Normal file
86
options/home/security.nix
Normal file
|
|
@ -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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
88
options/home/theme.nix
Normal file
88
options/home/theme.nix
Normal file
|
|
@ -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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in a new issue