moved hm to home/

This commit is contained in:
ari committed 2024-08-10 22:32:57 -04:00
1 parent c56f06bbfb
commit afaacd003d
8 files changed
+127 -107

No files matched your search

+55
View File
@@ -0,0 +1,55 @@
{ stateVersion }:
let
makeCommonGitConfigs = (import ./git).makeCommonGitConfigs;
programsModule = (import ./programs);
servicesModule = (import ./services);
homeModule = {
stateVersion = stateVersion;
shellAliases = {
cat = "bat";
};
};
in
{
makeRootUser = { hostName }: { pkgs, ... }: {
home = homeModule;
programs = (programsModule { pkgs = pkgs; }) // {
git = (makeCommonGitConfigs {
userName = "root";
userEmail = "root@${hostName}";
extraGitConfigs = [ ];
});
};
services = servicesModule { pkgs = pkgs; };
};
makeCommonUser =
{ enableDevelopmentKit
, fullName
, email
, extraGitConfigs ? [ ]
, ...
}: { pkgs, ... }: {
home = homeModule // {
packages = with pkgs;
[ jq nixpkgs-fmt ipfetch nixd ]
++ (if enableDevelopmentKit then [
rye
devenv
uv
devbox
terraform
kubectl
] else
[ ]);
};
programs = (programsModule { pkgs = pkgs; }) // {
git = (makeCommonGitConfigs {
userName = fullName;
userEmail = email;
extraGitConfigs = extraGitConfigs;
});
};
services = servicesModule { pkgs = pkgs; };
};
}
+29
View File
@@ -0,0 +1,29 @@
let
gitconfigs =
(builtins.filterSource (path: type: type != "directory") ./gitconfigs);
gitconfigFiles = builtins.attrNames (builtins.readDir gitconfigs);
makeCommonGitConfigs =
{ userName
, userEmail
, extraGitConfigs ? [ ]
}: {
enable = true;
userName = userName;
userEmail = userEmail;
delta = { enable = true; };
extraConfig = {
color = { ui = "auto"; };
push = {
default = "upstream";
autoSetupRemote = true;
};
init = { defaultBranch = "main"; };
};
includes =
(builtins.map (f: { path = gitconfigs + "/" + f; }) gitconfigFiles)
++ extraGitConfigs;
};
in
{
makeCommonGitConfigs = makeCommonGitConfigs;
}
+32
View File
@@ -0,0 +1,32 @@
[alias]
pp = "!f() { \
echo 'git pull --ff';\
git pull --ff; \
echo 'git push';\
git push; \
}; f";
up = "pull --rebase --autostash";
ca = "commit -a";
ls = "log --oneline";
cap = "!f() { \
echo 'commiting code'; \
git ca ${@}; \
echo 'pushing...'; \
git push ; \
}; f";
undo-commit = "!f() { \
lastcommit=$(git log --oneline -n 1); \
echo '[[switching]] from' $lastcommit; \
git reset --soft HEAD~${1:-1}; \
lastcommit=$(git log --oneline -n 1); \
echo '[[switching]] to' $lastcommit; \
git status; \
}; f";
sync = "!f() { \
target_branch=${1:-main}; \
remote=${2:-origin}; \
git fetch $remote $target_branch:$target_branch; \
}; f";
clean-branches = "!f() { \
git for-each-ref --format '%(refname:short)' refs/heads| grep -v 'master\\|main' | xargs git branch -D ; \
}; f";
+33
View File
@@ -0,0 +1,33 @@
{ pkgs, ... }:
{
bat.enable = true;
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
direnv.enable = true;
lsd = {
enable = true;
enableAliases = true;
};
zsh = {
enable = true;
autosuggestion.enable = true;
initExtra = ''
export PROMPT='%(!.%{%F{yellow}%}.)$USER@%{$fg[white]%}%M %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)'
'';
oh-my-zsh = {
enable = true;
plugins = [ "git" "sudo" ];
theme = "robbyrussell";
};
};
tmux = {
enable = true;
clock24 = true;
mouse = true;
plugins = with pkgs.tmuxPlugins; [ nord cpu battery sidebar ];
};
}
+8
View File
@@ -0,0 +1,8 @@
{ pkgs, ... }:
{
gpg-agent = {
enable = true;
defaultCacheTtl = 1800;
enableSshSupport = true;
};
}