Compare commits

...

3 commits

Author SHA1 Message Date
Fabian Montero 541f80ff91 update baseline to configure git 2024-11-29 01:01:35 -06:00
Fabian Montero a7827e619c modularize gpg 2024-11-29 00:56:20 -06:00
Fabian Montero 4ec61784ed modularize zsh 2024-11-29 00:44:04 -06:00
7 changed files with 84 additions and 37 deletions

View file

@ -17,7 +17,6 @@ in {
packages = with pkgs; [
calc
file
git
htop
killall
man-pages
@ -36,5 +35,11 @@ in {
"EDITOR" = mkDefault "vim";
};
};
programs.git = {
enable = true;
userEmail = "fabian@posixlycorrect.com";
userName = "Fabian Montero";
};
};
}

View file

@ -12,5 +12,7 @@
./yubikey.nix
./browsers.nix
./gui
./zsh
./gpg.nix
];
}

49
home/modules/gpg.nix Normal file
View file

@ -0,0 +1,49 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.services.gpg;
in {
options.local.services.gpg = {
enable = mkEnableOption "gpg settings";
defaultKey = mkOption {
type = types.str;
description = "fingerprint of default public key to be used in gpg, git, email, etc.";
example = "7AA277E604A4173916BBB4E91FFAC35E1798174F";
};
};
config = mkIf cfg.enable {
programs.gpg = {
enable = true;
settings = {
default-key = config.local.services.gpg.defaultKey;
};
};
services.gpg-agent = {
enable = true;
enableZshIntegration = true;
pinentryPackage = pkgs.pinentry-emacs;
};
accounts.email.accounts = {
"fabian@posixlycorrect.com" = {
gpg = {
encryptByDefault = true;
signByDefault = true;
key = config.local.services.gpg.defaultKey;
};
};
};
programs.git = {
signing = {
key = config.local.services.gpg.defaultKey;
signByDefault = true;
};
};
};
}

View file

@ -34,35 +34,6 @@ in {
};
};
programs.zsh = {
enable = true;
syntaxHighlighting.enable = true;
initExtra = import ./zshrc.nix pkgs;
};
programs.git = {
enable = true;
userEmail = "fabian@posixlycorrect.com";
userName = "Fabian Montero";
#signing = {
# key = "7AA277E604A4173916BBB4E91FFAC35E1798174F";
# signByDefault = true;
#};
};
programs.gpg = {
enable = true;
#settings = {
# default-key = "7AA277E604A4173916BBB4E91FFAC35E1798174F";
#};
};
services.gpg-agent = {
enable = true;
enableZshIntegration = true;
pinentryPackage = pkgs.pinentry-emacs;
};
accounts.email.accounts = {
"fabian@posixlycorrect.com" = {
address = "fabian@posixlycorrect.com";
@ -70,12 +41,6 @@ in {
realName = "fabian";
primary = true;
flavor = "fastmail.com";
gpg = {
encryptByDefault = true;
signByDefault = true;
key = "7AA277E604A4173916BBB4E91FFAC35E1798174F";
};
};
};
};

View file

@ -0,0 +1,18 @@
{
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.local.services.zsh;
in {
options.local.services.zsh.enable = mkEnableOption "zsh settings";
config = mkIf cfg.enable {
programs.zsh = {
enable = true;
syntaxHighlighting.enable = true;
initExtra = import ./zshrc.nix pkgs;
};
};
}

View file

@ -83,7 +83,7 @@
alias tree='tree -CF'
alias lock="betterlockscreen -l"
alias nightmode="${redshift}/bin/redshift -P -O 1000"
alias lightmode="${redshift}/bin/redshift -P -O 6500"
alias lightmode="${redshift}/bin/redshift -x="
alias inbox="echo >> $HOME/gtd/inbox"
alias nixoide="nix repl '<nixpkgs>'"
alias vps="ssh -A vps"

View file

@ -43,6 +43,14 @@
};
};
local.services = {
zsh.enable = true;
gpg = {
enalbe = true;
defaultKey = "7AA277E604A4173916BBB4E91FFAC35E1798174F";
};
};
home = {
stateVersion = "21.11"; # No tocar esto
username = "fabian";