mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-24 00:29:43 -04:00
User settings restructured
This commit is contained in:
parent
fce12d274c
commit
2881653ec5
6 changed files with 51 additions and 52 deletions
|
|
@ -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"
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
let cfg = config.modules.git;
|
let cfg = config.modules.git;
|
||||||
isBryan = config.user.name == "bryan";
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{ options.modules.git = { enable = mkEnableOption "git"; };
|
{ options.modules.git = { enable = mkEnableOption "git"; };
|
||||||
|
|
@ -10,7 +9,7 @@ in
|
||||||
programs = {
|
programs = {
|
||||||
git = {
|
git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
} // (lib.optionalAttrs isBryan (import ./config/git.nix));
|
} // config.user.gitConfig;
|
||||||
gh = {
|
gh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.git_protocol = "ssh";
|
settings.git_protocol = "ssh";
|
||||||
|
|
@ -19,6 +18,6 @@ in
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
git-crypt
|
git-crypt
|
||||||
] ++ optional isBryan lazygit;
|
];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,19 +3,13 @@
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
cfg = config.modules.gpg;
|
cfg = config.modules.gpg;
|
||||||
isBryan = config.user.name == "bryan";
|
|
||||||
|
|
||||||
in
|
in
|
||||||
{ options.modules.gpg = { enable = mkEnableOption "gpg"; };
|
{ options.modules.gpg = { enable = mkEnableOption "gpg"; };
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
programs.gpg = {
|
programs.gpg = {
|
||||||
enable = true;
|
enable = true;
|
||||||
publicKeys = if isBryan then [
|
publicKeys = [ config.user.pgpKey ];
|
||||||
{
|
|
||||||
text = import ./config/pubKey.nix;
|
|
||||||
trust = 5;
|
|
||||||
}
|
|
||||||
] else [];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.gpg-agent = {
|
services.gpg-agent = {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,11 @@
|
||||||
|
|
||||||
# Users
|
# Users
|
||||||
users.users = {
|
users.users = {
|
||||||
${config.user.name} = config.user;
|
${config.user.name} = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = config.user.groups;
|
||||||
|
openssh.authorizedKeys.keys = config.user.sshKeys;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Nix
|
# Nix
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,62 @@
|
||||||
{ lib, config, ... }:
|
{ lib, ... }:
|
||||||
let
|
|
||||||
isBryan = config.user.name == "bryan";
|
|
||||||
|
|
||||||
# Replace this with your user configurations
|
# Replace with your user configurations
|
||||||
in
|
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
user = lib.mkOption {
|
user = lib.mkOption {
|
||||||
type = lib.types.attrs;
|
type = lib.types.attrs;
|
||||||
default = {
|
default = {
|
||||||
name = "bryan";
|
name = "bryan";
|
||||||
isNormalUser = true;
|
|
||||||
|
|
||||||
extraGroups = [
|
groups = [
|
||||||
"wheel" "networkmanager" "home-manager"
|
"wheel" "networkmanager" "home-manager"
|
||||||
"input" "video" "audio"
|
"input" "video" "audio"
|
||||||
"kvm" "libvirtd" "docker"
|
"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=="
|
"ssh-rsa AAAAB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ig= {
|
||||||
|
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;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue