♻️ refactor home-manager / dotfiles to use chezmoi

This commit is contained in:
2024-09-14 18:12:01 -04:00
parent 6321f08230
commit d9173abb79
15 changed files with 76 additions and 211 deletions

View File

@ -1,5 +1,5 @@
{ ... }:
{
imports = [ ./walkah.nix ];
imports = [ ./walkah ];
}

View File

@ -1,18 +1,23 @@
{ pkgs, dotfiles, ... }:
{ lib, pkgs, ... }:
{
users.users.walkah = {
isNormalUser = true;
home = if pkgs.stdenv.isDarwin then "/Users/walkah" else "/home/walkah";
shell = pkgs.zsh;
extraGroups = [ "wheel" "docker" ];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ0mE4MyMnfd1b2nlBJT7kpZ6Vov+ILuGNfzdp5ZBNQe walkah@walkah.net"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIM8YMax7PGIrcPNIHkpuNRFgn3HJK6Wepm+ycZWO6jfR walkah@walkah-ipadpro11"
];
} // lib.optionalAttrs pkgs.stdenv.isLinux {
extraGroups = [ "wheel" "docker" ];
group = "walkah";
isNormalUser = true;
};
users.groups.walkah = { };
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
users.walkah = import "${dotfiles}/home.nix";
users.walkah = import ./home.nix;
};
}

22
nix/users/walkah/home.nix Normal file
View File

@ -0,0 +1,22 @@
{ lib, pkgs, ... }: {
home = {
username = "walkah";
# homeDirectory = if pkgs.stdenv.isDarwin then "/Users/walkah" else "/home/walkah";
packages = with pkgs; [
chezmoi
direnv
eza
fzf
git
starship
tmux
];
activation.chezmoi = lib.hm.dag.entryAfter [ "installPackages" ] ''
$DRY_RUN_CMD ${pkgs.chezmoi}/bin/chezmoi init --apply walkah/dotfiles
'';
stateVersion = "24.05";
};
}