moving home-manager stuff to one sharable file
This commit is contained in:
1 parent
c1d43499cb
commit
618429e3c0
10 files changed
+212
-104
No files matched your search
File renamed without changes.
@@ -0,0 +1,101 @@
|
||||
{ stateVersion
|
||||
, enableDevelopmentKit
|
||||
, name
|
||||
, fullName
|
||||
, email
|
||||
, extraGitConfigs ? [ ]
|
||||
}:
|
||||
let
|
||||
gitconfigs =
|
||||
(builtins.filterSource (path: type: type != "directory") ./gitconfigs);
|
||||
gitconfigFiles = builtins.attrNames (builtins.readDir gitconfigs);
|
||||
commonGitConfigs = {
|
||||
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";
|
||||
} // commonGitConfigs;
|
||||
} // (commonProgramsConfig { pkgs = pkgs; });
|
||||
};
|
||||
|
||||
makeCommonUser = { pkgs, ... }: {
|
||||
home = {
|
||||
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;
|
||||
} // commonGitConfigs;
|
||||
} // (commonProgramsConfig { pkgs = pkgs; });
|
||||
};
|
||||
}
|
||||
@@ -12,7 +12,6 @@
|
||||
{ pkgs, ... }: {
|
||||
imports = [
|
||||
(import ./core.nix { user = user; })
|
||||
./rootUser.nix
|
||||
(import ./user.nix { user = user; })
|
||||
(import ./containers/default.nix ({
|
||||
user = user;
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
users.users.root.shell = pkgs.zsh;
|
||||
}
|
||||
@@ -16,6 +16,7 @@ in
|
||||
};
|
||||
|
||||
config = {
|
||||
users.users.root.shell = pkgs.zsh;
|
||||
home-manager.users.root.programs.git.userEmail = "root@${cfg.hostName}";
|
||||
networking.hostName = cfg.hostName;
|
||||
};
|
||||
|
||||
+3
-98
@@ -4,10 +4,7 @@ with lib;
|
||||
|
||||
let
|
||||
cfg = config.skyg;
|
||||
gitconfigs =
|
||||
(builtins.filterSource (path: type: type != "directory") ./gitconfigs);
|
||||
gitconfigFiles = builtins.attrNames (builtins.readDir gitconfigs);
|
||||
|
||||
hm = (import ../home-manager.nix cfg.user);
|
||||
in
|
||||
{
|
||||
options = {
|
||||
@@ -41,99 +38,7 @@ in
|
||||
|
||||
config = {
|
||||
programs.zsh.enable = true;
|
||||
home-manager.users.root = {
|
||||
home.stateVersion = cfg.home-manager.version;
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "root";
|
||||
};
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
autosuggestion.enable = true;
|
||||
};
|
||||
programs.zsh.oh-my-zsh.enable = true;
|
||||
};
|
||||
home-manager.users.${cfg.user.name} = {
|
||||
home = {
|
||||
sessionVariables = { };
|
||||
stateVersion = cfg.home-manager.version;
|
||||
shellAliases = {
|
||||
cat = "bat";
|
||||
};
|
||||
packages = with pkgs;
|
||||
[ jq nixfmt-classic devenv ipfetch nixd ]
|
||||
++ (if cfg.user.enableDevelopmentKit then [
|
||||
rye
|
||||
uv
|
||||
devbox
|
||||
terraform
|
||||
kubectl
|
||||
] else
|
||||
[ ]);
|
||||
};
|
||||
programs = {
|
||||
bat.enable = true;
|
||||
neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
};
|
||||
direnv.enable = true;
|
||||
lsd = {
|
||||
enable = true;
|
||||
enableAliases = true;
|
||||
};
|
||||
git = {
|
||||
enable = true;
|
||||
userName = cfg.user.fullName;
|
||||
userEmail = cfg.user.email;
|
||||
delta = { enable = true; };
|
||||
extraConfig = {
|
||||
color = { ui = "auto"; };
|
||||
push = {
|
||||
default = "upstream";
|
||||
autoSetupRemote = true;
|
||||
};
|
||||
init = { defaultBranch = "main"; };
|
||||
};
|
||||
includes =
|
||||
(builtins.map (f: { path = gitconfigs + "/" + f; }) gitconfigFiles)
|
||||
++ cfg.user.extraGitConfigs;
|
||||
};
|
||||
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 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
home-manager.users.root = hm.makeRootUser { pkgs = pkgs; };
|
||||
home-manager.users.${cfg.user.name} = hm.makeCommonUser { pkgs = pkgs; };
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
# user = {
|
||||
# name = "ari";
|
||||
# fullName = "Ari Sosnovsky";
|
||||
# email = "ariel@sosnovsky.ca";
|
||||
# };
|
||||
# sumoUser = rec {
|
||||
# name = "asosnovsky";
|
||||
# fullName = user.fullName;
|
||||
# email = "${name}@sumologic.com";
|
||||
# homepath = "/Users/${name}";
|
||||
# extraGitConfigs = [{ path = "${homepath}/.config/mysumo/gitconfig"; }];
|
||||
# };
|
||||
Reference in new issue
Block a user