moved hm to home/
This commit is contained in:
1 parent
c56f06bbfb
commit
afaacd003d
8 files changed
+127
-107
No files matched your search
@@ -1,105 +0,0 @@
|
||||
{ stateVersion }:
|
||||
let
|
||||
gitconfigs =
|
||||
(builtins.filterSource (path: type: type != "directory") ./gitconfigs);
|
||||
gitconfigFiles = builtins.attrNames (builtins.readDir gitconfigs);
|
||||
makeCommonGitConfigs = { extraGitConfigs ? [ ] }: {
|
||||
delta = { enable = true; };
|
||||
extraConfig = {
|
||||
color = { ui = "auto"; };
|
||||
push = {
|
||||
default = "upstream";
|
||||
autoSetupRemote = true;
|
||||
};
|
||||
init = { defaultBranch = "main"; };
|
||||
};
|
||||
includes =
|
||||
(builtins.map (f: { path = gitconfigs + "/" + f; }) gitconfigFiles)
|
||||
++ extraGitConfigs;
|
||||
};
|
||||
commonProgramsConfig = { 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)'
|
||||
'';
|
||||
};
|
||||
zsh.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 ];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
makeRootUser = { pkgs, ... }: {
|
||||
home = {
|
||||
stateVersion = stateVersion;
|
||||
shellAliases = {
|
||||
cat = "bat";
|
||||
};
|
||||
};
|
||||
programs = {
|
||||
git = {
|
||||
enable = true;
|
||||
userName = "root";
|
||||
} // (makeCommonGitConfigs { extraGitConfigs = [ ]; });
|
||||
} // (commonProgramsConfig { pkgs = pkgs; });
|
||||
};
|
||||
|
||||
makeCommonUser =
|
||||
{ enableDevelopmentKit ? false
|
||||
, fullName
|
||||
, email
|
||||
, extraGitConfigs ? [ ]
|
||||
, name
|
||||
, homeDirectory ? null
|
||||
, ...
|
||||
}: { pkgs, ... }: {
|
||||
home = {
|
||||
username = name;
|
||||
homeDirectory = if (builtins.isNull homeDirectory) then "/home/${name}" else homeDirectory;
|
||||
stateVersion = stateVersion;
|
||||
shellAliases = {
|
||||
cat = "bat";
|
||||
};
|
||||
packages = with pkgs;
|
||||
[ jq nixpkgs-fmt ipfetch nixd ]
|
||||
++ (if enableDevelopmentKit then [
|
||||
rye
|
||||
devenv
|
||||
uv
|
||||
devbox
|
||||
terraform
|
||||
kubectl
|
||||
] else
|
||||
[ ]);
|
||||
};
|
||||
programs = {
|
||||
git = {
|
||||
enable = true;
|
||||
userName = fullName;
|
||||
userEmail = email;
|
||||
} // (makeCommonGitConfigs { extraGitConfigs = extraGitConfigs; });
|
||||
} // (commonProgramsConfig { pkgs = pkgs; });
|
||||
};
|
||||
}
|
||||
@@ -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; };
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
File renamed without changes.
@@ -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 ];
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
gpg-agent = {
|
||||
enable = true;
|
||||
defaultCacheTtl = 1800;
|
||||
enableSshSupport = true;
|
||||
};
|
||||
}
|
||||
+1
-1
@@ -66,7 +66,7 @@ let
|
||||
, system ? "x86_64-linux"
|
||||
}:
|
||||
let
|
||||
hm = (import ./home-manager.nix {
|
||||
hm = (import ./home {
|
||||
stateVersion = homeManagerVersion;
|
||||
});
|
||||
pkgs = allPkgs."${system}";
|
||||
|
||||
@@ -38,7 +38,7 @@ in
|
||||
|
||||
config =
|
||||
let
|
||||
hm = (import ../home-manager.nix {
|
||||
hm = (import ../home {
|
||||
stateVersion = cfg.home-manager.version;
|
||||
});
|
||||
in
|
||||
|
||||
Reference in new issue
Block a user