This commit is contained in:
2026-02-28 14:31:09 +00:00
parent e5a935ca79
commit 9cd1adf12d
2 changed files with 55 additions and 92 deletions

145
flake.nix
View File

@@ -99,37 +99,37 @@
];
};
systemPackages = with pkgs; [
#bat
#highlight
#btop
#eza
#fzf
#git
#gnumake
#neofetch
#neovim
#ripgrep
#tldr
#unzip
#openssl
#wget
#zip
#zoxide
#jq
#lazygit
#lazysql
#less
#mlocate
#tree
#tmux
#tmuxinator
#wget
#zenity
#gum
#yazi
#rsync
#p7zip
#impala
bat
#highlight
btop
eza
fzf
git
#gnumake
#neofetch
neovim
ripgrep
tldr
unzip
openssl
wget
zip
zoxide
jq
lazygit
#sqlit
less
mlocate
tree
tmux
tmuxinator
wget
zenity
gum
yazi
rsync
p7zip
impala
];
};
networking = {
@@ -152,39 +152,6 @@
};
system.stateVersion = "25.11";
environment.systemPackages = with pkgs; [
bat
#highlight
btop
eza
fzf
git
#gnumake
#neofetch
neovim
ripgrep
tldr
unzip
openssl
wget
zip
zoxide
jq
lazygit
#sqlit
less
mlocate
tree
tmux
tmuxinator
wget
zenity
gum
yazi
rsync
p7zip
impala
];
home-manager = {
users.chris = { pkgs, lib, ... }: {
home = {
@@ -203,45 +170,41 @@
activation.setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] ''
if [[ -v DRY_RUN ]]; then
echo "Dry run: Would bootstrap dotfiles from labs.scarif.space"
exit
fi
DOTFILES_DIR="$HOME/.config/dotfiles"
if [ -d "$DOTFILES_DIR/.git" ]; then
# Restore tracked files from the local metadata
${pkgs.git}/bin/git --git-dir="$DOTFILES_DIR/.git" --work-tree="$HOME" checkout -f
${pkgs.git}/bin/git submodule update --init --recursive
SOURCE="$DOTFILES_DIR/.git"
else
echo "Dotfiles not found. Running bootstrap script..."
# Setup a temporary workspace
TEMP_DIR=$(mktemp -d)
# Clone the repo (using the public URL for the initial pull)
${pkgs.git}/bin/git clone -b main https://labs.scarif.space/chris/dotfiles.git "$TEMP_DIR"
# Copy files to HOME
${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME"
SOURCE="https://labs.scarif.space/chris/dotfiles.git"
# Initialize the separate git directory
${pkgs.coreutils}/bin/mkdir -p "$DOTFILES_DIR"
cd "$HOME"
${pkgs.git}/bin/git init --separate-git-dir "$DOTFILES_DIR/.git" "$HOME"
if [ ! -d "$DOTFILES_DIR" ]; then
${pkgs.coreutils}/bin/mkdir -p "$DOTFILES_DIR"
fi
fi
# Update submodules
${pkgs.git}/bin/git submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git
${pkgs.git}/bin/git submodule update --init
TEMP_DIR=$(mktemp -d)
# Set URLs back to SSH
${pkgs.git}/bin/git submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git
${pkgs.git}/bin/git remote set-url origin git@labs.scarif.space:chris/dotfiles.git
${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR"
# Clean up
${pkgs.coreutils}/bin/rm -rf "$TEMP_DIR"
${pkgs.coreutils}/bin/rm -f "$HOME/.git"
${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME"
cd "$HOME"
${pkgs.git}/bin/git init --separate-git-dir "$DOTFILES_DIR/.git" "$HOME"
echo "Dotfiles bootstrapped successfully."
fi
${pkgs.git}/bin/git submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git
${pkgs.git}/bin/git submodule update --init
${pkgs.git}/bin/git submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git
${pkgs.git}/bin/git remote set-url origin git@labs.scarif.space:chris/dotfiles.git
# Clean up
${pkgs.coreutils}/bin/rm -rf "$TEMP_DIR"
${pkgs.coreutils}/bin/rm -f "$HOME/.git"
echo "Dotfiles bootstrapped successfully."
'';
packages = with pkgs; [
# jetbrains.rider