diff --git a/homeConfig/modules/git/config/git.nix b/homeConfig/modules/git/config/git.nix deleted file mode 100644 index 38390a6..0000000 --- a/homeConfig/modules/git/config/git.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - userName = "Bryan Ramos"; - userEmail = "bryan@ramos.codes"; - signing = { - key = "F1F3466458452B2DF351F1E864D12BA95ACE1F2D"; - 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" - ]; -} diff --git a/homeConfig/modules/git/default.nix b/homeConfig/modules/git/default.nix index b84beb3..62fb177 100644 --- a/homeConfig/modules/git/default.nix +++ b/homeConfig/modules/git/default.nix @@ -2,7 +2,6 @@ with lib; let cfg = config.modules.git; - isBryan = config.user.name == "bryan"; in { options.modules.git = { enable = mkEnableOption "git"; }; @@ -10,7 +9,7 @@ in programs = { git = { enable = true; - } // (lib.optionalAttrs isBryan (import ./config/git.nix)); + } // config.user.gitConfig; gh = { enable = true; settings.git_protocol = "ssh"; @@ -19,6 +18,6 @@ in home.packages = with pkgs; [ git-crypt - ] ++ optional isBryan lazygit; + ]; }; } diff --git a/homeConfig/modules/gpg/default.nix b/homeConfig/modules/gpg/default.nix index 1318c72..2eecac2 100644 --- a/homeConfig/modules/gpg/default.nix +++ b/homeConfig/modules/gpg/default.nix @@ -3,19 +3,13 @@ with lib; let cfg = config.modules.gpg; - isBryan = config.user.name == "bryan"; in { options.modules.gpg = { enable = mkEnableOption "gpg"; }; config = mkIf cfg.enable { programs.gpg = { enable = true; - publicKeys = if isBryan then [ - { - text = import ./config/pubKey.nix; - trust = 5; - } - ] else []; + publicKeys = [ config.user.pgpKey ]; }; services.gpg-agent = { diff --git a/sysConfig/desktop/system.nix b/sysConfig/desktop/system.nix index 01e4278..3da4fbe 100644 --- a/sysConfig/desktop/system.nix +++ b/sysConfig/desktop/system.nix @@ -4,7 +4,11 @@ # Users users.users = { - ${config.user.name} = config.user; + ${config.user.name} = { + isNormalUser = true; + extraGroups = config.user.groups; + openssh.authorizedKeys.keys = config.user.sshKeys; + }; }; # Nix diff --git a/user/default.nix b/user/default.nix index 25ca1e6..7c9fdfd 100644 --- a/user/default.nix +++ b/user/default.nix @@ -1,27 +1,62 @@ -{ lib, config, ... }: -let - isBryan = config.user.name == "bryan"; +{ lib, ... }: -# Replace this with your user configurations -in +# Replace with your user configurations { options = { user = lib.mkOption { type = lib.types.attrs; default = { name = "bryan"; - isNormalUser = true; - extraGroups = [ + groups = [ "wheel" "networkmanager" "home-manager" "input" "video" "audio" "kvm" "libvirtd" "docker" ]; - openssh.authorizedKeys.keys = lib.mkIf isBryan [ + sshKeys = [ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDl4895aB9P5p/lp8Hq5rHun4clvhyTSHFi3U2d6OOBoW5Fm+VcQnW/xbjmCBsXk5BdiowsBxQhwnzdfz/KJL7J5RobomUEaVRwb9UwT88eJveLp14BG8j2J3SjfyhrCX+4jkPx0bPQk1HGcuYY+tPEXf1q/ps88Dhu0CARBIzYQOTYY6b1qWzxpDoFZGHjKG8g5iY6FIu65yKKvvVy1f8IgZ3l3IpwBWVamxgkTcYY0QYSrmzo1n7TXxwrWbvenAqBsQ0cBPs+gVa3uIr+1TJl0Az5SElBVGu3LvUdlk58trtPUj6TQR3YUkg7Vjll7WHOdqhux5ZQNhjkOsHerf0Tw86e6cEzgeTuIbQHIb0LcsUunwKcuh2+au7RO599cvHn0+xZE5MZBxloDDaJ3JsiliM8kyPP/U3ERj03cWLW7BqbT+sfjAOl21RCzk0iQxk1wt/8VmtCr9Adv7IyrtaYvf/bwRP+g+9ldmzKGt8Mdb605uVzZ70H/LLm17f40Te+QHaex5by/6p6cuwEEZtgIg53Wpglu0rA6UxrBfQEHKl/Jt3FLeE0mnEyYkkR2MnHNtyWRIXtuqYZMAm2Ub1pFHH7jQV1gGiDVTw6a2eIwK21a/hXtRjFUpFd1nB1n+KNfJBE4zT3wm3Ud7mKw/6rWnoRyhYZvGXkFdp+iEs49Q==" "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK2ROz7EVvE+nzF5k9EYZ2v3JhBzk058uh3QJTzcG4t70fkZgh9y56AOx26eXlKQWuuV05e8EkWRuVI8gfA2ROI=" ]; + + gitConfig= { + userName = "Bryan Ramos"; + userEmail = "bryan@ramos.codes"; + signing = { + key = "F1F3466458452B2DF351F1E864D12BA95ACE1F2D"; + 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 = { + text = import ./pgpKey.nix; + trust = 5; + }; }; }; }; diff --git a/homeConfig/modules/gpg/config/pubKey.nix b/user/pgpKey.nix similarity index 100% rename from homeConfig/modules/gpg/config/pubKey.nix rename to user/pgpKey.nix