This commit is contained in:
Bryan Ramos 2024-05-12 12:01:13 -04:00
parent ff5a0fe6a3
commit 929dbf8c43
Signed by: bryan
GPG key ID: 6ABDCD144D6643C8
16 changed files with 74 additions and 61 deletions

View file

@ -10,7 +10,7 @@
programs.home-manager.enable = true; programs.home-manager.enable = true;
programs.bash.shellAliases = { programs.bash.shellAliases = {
nixup = "sudo nixos-rebuild switch --flake /etc/nixos/.#desktop"; nixup = "sudo nixos-rebuild switch --flake ${config.user.nixosDir}/.#desktop";
}; };
home.stateVersion = "22.11"; home.stateVersion = "22.11";
@ -22,8 +22,11 @@
user = { user = {
bash.enable = true; bash.enable = true;
git.enable = true; git.enable = true;
security = {
enable = true;
gpg.enable = true; gpg.enable = true;
security.enable = true; };
utils = { utils = {
enable = true; enable = true;

View file

@ -6,8 +6,8 @@
${config.user.name} = { ${config.user.name} = {
isNormalUser = true; isNormalUser = true;
extraGroups = config.user.groups extraGroups = config.user.groups
++ [ "video" "audio" "kvm" "libvirtd" "docker" ]; ++ [ "video" "audio" "kvm" "libvirtd" ];
openssh.authorizedKeys.keys = config.user.sshKeys.key2; openssh.authorizedKeys.keys = [ "${config.user.sshKeys.key2}" ];
}; };
}; };

View file

@ -10,7 +10,7 @@
programs.home-manager.enable = true; programs.home-manager.enable = true;
programs.bash.shellAliases = { programs.bash.shellAliases = {
nixup = "sudo nixos-rebuild switch --flake /etc/nixos/.#server"; nixup = "sudo nixos-rebuild switch --flake ${config.user.nixosDir}/.#server";
}; };
home.stateVersion = "23.11"; home.stateVersion = "23.11";

View file

@ -19,7 +19,7 @@
${config.user.name} = { ${config.user.name} = {
isNormalUser = true; isNormalUser = true;
extraGroups = config.user.groups; extraGroups = config.user.groups;
openssh.authorizedKeys.keys = config.user.sshKeys.key1; openssh.authorizedKeys.keys = [ "${config.user.sshKeys.key1}" ];
}; };
}; };

View file

@ -10,7 +10,7 @@
programs.home-manager.enable = true; programs.home-manager.enable = true;
programs.bash.shellAliases = { programs.bash.shellAliases = {
nixup = "sudo nixos-rebuild switch --flake /etc/nixos/.#wsl"; nixup = "sudo nixos-rebuild switch --flake ${config.user.nixosDir}/.#wsl";
}; };
home.stateVersion = "23.11"; home.stateVersion = "23.11";

View file

@ -1,10 +1,13 @@
{ lib, pkgs, ... }: { lib, pkgs, config, ... }:
let let
userConfigs = rec { gpg = config.modules.user.security.gpg;
userConfigs = rec {
name = "bryan"; name = "bryan";
email = "bryan@ramos.codes"; email = "bryan@ramos.codes";
shell = pkgs.bash; shell = pkgs.bash;
nixosDir = /etc/nixos; # PATH to this repo
# Image name from ~Pictures/wallpapers directory # Image name from ~Pictures/wallpapers directory
wallpaper = "mountains.jpg"; wallpaper = "mountains.jpg";
@ -14,47 +17,23 @@ let
gitConfig = { gitConfig = {
userName = "Bryan Ramos"; userName = "Bryan Ramos";
userEmail = email; userEmail = email;
signing = { signing = lib.optionalAttrs gpg.enable {
key = "F1F3466458452B2DF351F1E864D12BA95ACE1F2D"; key = "F1F3466458452B2DF351F1E864D12BA95ACE1F2D";
signByDefault = true; signByDefault = true;
}; };
extraConfig = {
init = { defaultBranch = "master"; };
mergetool = {
lazygit = {
cmd = "lazygit";
trustExitCode = true;
};
};
merge = { tool = "lazygit"; };
safe = { directory = "/etc/nixos"; };
};
ignores = [
"node_modules"
".direnv"
"dist-newstyle"
".nuxt/"
".output/"
"dist"
];
}; };
pgpKey = { pgpKey = {
text = import ./pgpKey.nix; text = import ./keys/pgpKey.nix;
trust = 5; trust = 5;
}; };
sshKeys = { sshKeys = {
key1 = [ key1 = import ./keys/sshKey1.nix;
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDl4895aB9P5p/lp8Hq5rHun4clvhyTSHFi3U2d6OOBoW5Fm+VcQnW/xbjmCBsXk5BdiowsBxQhwnzdfz/KJL7J5RobomUEaVRwb9UwT88eJveLp14BG8j2J3SjfyhrCX+4jkPx0bPQk1HGcuYY+tPEXf1q/ps88Dhu0CARBIzYQOTYY6b1qWzxpDoFZGHjKG8g5iY6F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7Vjll7WHOdqhux5ZQNhjkOsHerf0Tw86e6cEzgeTuIbQHIb0LcsUunwKcuh2+au7RO599cvHn0+xZE5MZBxloDDaJ3JsiliM8kyPP/U3ERj03cWLW7BqbT+sfjAOl21RCzk0iQxk1wt/8VmtCr9Adv7IyrtaYvf/bwRP+g+9ldmzKGt8Mdb605uVzZ70H/LLm17f40Te+QHaex5by/6p6cuwEEZtgIg53Wpglu0rA6UxrBfQEHKl/Jt3FLeE0mnEyYkkR2MnHNtyWRIXtuqYZMAm2Ub1pFHH7jQV1gGiDVTw6a2eIwK21a/hXtRjFUpFd1nB1n+KNfJBE4zT3wm3Ud7mKw/6rWnoRyhYZvGXkFdp+iEs49Q=="

View file

@ -0,0 +1 @@
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK2ROz7EVvE+nzF5k9EYZ2v3JhBzk058uh3QJTzcG4t70fkZgh9y56AOx26eXlKQWuuV05e8EkWRuVI8gfA2ROI="

View file

@ -2,7 +2,6 @@
imports = [ imports = [
./bash ./bash
./git ./git
./gpg
./gui ./gui
./security ./security
./utils ./utils

View file

@ -5,7 +5,6 @@ function cdg() {
return 0 return 0
fi fi
# Check for invalid command
if [[ -n "$1" ]]; then if [[ -n "$1" ]]; then
echo "Invalid command: $1. Try 'cdg --help'." echo "Invalid command: $1. Try 'cdg --help'."
return 1 return 1

View file

@ -10,6 +10,26 @@ in
programs = { programs = {
git = { git = {
enable = true; enable = true;
extraConfig = {
init = { defaultBranch = "master"; };
mergetool = {
vimdiff = {
trustExitCode = true;
};
};
merge = { tool = "vimdiff"; };
safe = {
directory = "${config.user.nixosDir}";
};
};
ignores = [
"node_modules"
".direnv"
"dist-newstyle"
".nuxt/"
".output/"
"dist"
];
} // config.user.gitConfig; } // config.user.gitConfig;
gh = { gh = {
enable = true; enable = true;

View file

@ -6,6 +6,7 @@ let
in in
{ options.modules.user.security = { enable = mkEnableOption "user.security"; }; { options.modules.user.security = { enable = mkEnableOption "user.security"; };
imports = [ ./modules ];
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
pass pass

View file

@ -0,0 +1,5 @@
{
imports = [
./gpg
];
}

View file

@ -2,10 +2,10 @@
with lib; with lib;
let let
cfg = config.modules.user.gpg; cfg = config.modules.user.security.gpg;
in in
{ options.modules.user.gpg = { enable = mkEnableOption "user.gpg"; }; { options.modules.user.security.gpg = { enable = mkEnableOption "user.security.gpg"; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.gpg = { programs.gpg = {
enable = true; enable = true;
@ -16,6 +16,7 @@ in
enable = true; enable = true;
enableSshSupport = true; enableSshSupport = true;
enableBashIntegration = true; enableBashIntegration = true;
enableScDaemon = true;
pinentryFlavor = "tty"; pinentryFlavor = "tty";
}; };
}; };

View file

@ -29,6 +29,10 @@ in
}; };
}; };
programs.git.ignores = [
".direnv"
];
home.sessionVariables = { home.sessionVariables = {
DIRENV_LOG_FORMAT = " "; DIRENV_LOG_FORMAT = " ";
}; };