Refactoring

This commit is contained in:
2026-02-28 16:20:16 +00:00
parent dfa89dced4
commit 5cb966904f

View File

@@ -164,10 +164,12 @@
"Tower" "Tower"
".config/dotfiles" ".config/dotfiles"
".config/nvim" ".config/nvim"
".config/nixos"
".local/share/direnv" ".local/share/direnv"
".ssh" ".ssh"
]; ];
}; };
wayland.windowManager.hyprland.enable = true;
activation.setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] '' activation.setupDotfiles = lib.hm.dag.entryAfter ["writeBoundary"] ''
if [[ -v DRY_RUN ]]; then if [[ -v DRY_RUN ]]; then
echo "Dry run: Would bootstrap dotfiles from labs.scarif.space" echo "Dry run: Would bootstrap dotfiles from labs.scarif.space"
@@ -177,28 +179,27 @@
TEMP_DIR=$(mktemp -d) TEMP_DIR=$(mktemp -d)
DOTFILES_DIR="$HOME/.config/dotfiles" DOTFILES_DIR="$HOME/.config/dotfiles"
DOTFILES_GIT_DIR="$DOTFILES_DIR/.git"
if [ ! -d "$DOTFILES_DIR/.git" ]; then if [ ! -d "$DOTFILES_GIT_DIR" ]; then
echo "No local repository so cloning from remote" echo "No local repository so cloning from remote"
SOURCE="https://labs.scarif.space/chris/dotfiles.git" SOURCE="https://labs.scarif.space/chris/dotfiles.git"
${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR" ${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR"
mv "$TEMP_DIR/.git" "$DOTFILES_DIR/.git" mv "$TEMP_DIR/.git" "$DOTFILES_GIT_DIR"
else else
echo "Local repository found so cloning from there" echo "Local repository found so cloning from there"
SOURCE="$DOTFILES_DIR/.git" ${pkgs.git}/bin/git clone -b main "$DOTFILES_GIT_DIR" "$TEMP_DIR"
${pkgs.git}/bin/git clone -b main "$SOURCE" "$TEMP_DIR" ${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$TEMP_DIR" pull --rebase
fi fi
echo "Copying dot files to home" echo "Copying dot files to home"
${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME" ${pkgs.coreutils}/bin/cp -rfT "$TEMP_DIR" "$HOME"
NVIM_DIR="$HOME/.config/nvim" NVIM_DIR="$HOME/.config/nvim"
if [ ! -d "$NVIM_DIR/.git" ]; then
echo "Neovim config not initialised so initialising from remote" echo "Neovim config not initialised so initialising from remote"
${pkgs.git}/bin/git --git-dir="$DOTFILES_DIR/.git" --work-tree="$HOME" submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git ${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule set-url ".config/nvim" https://labs.scarif.space/chris/nvim.git
${pkgs.git}/bin/git --git-dir="$DOTFILES_DIR/.git" --work-tree="$HOME" submodule update --init ${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule update --init
${pkgs.git}/bin/git --git-dir="$DOTFILES_DIR/.git" --work-tree="$HOME" submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git ${pkgs.git}/bin/git --git-dir="$DOTFILES_GIT_DIR" --work-tree="$HOME" submodule set-url ".config/nvim" git@labs.scarif.space:chris/nvim.git
fi
cd "$HOME" cd "$HOME"
@@ -249,8 +250,8 @@
# antigravity # antigravity
# gimp # gimp
# kdePackages.dolphin # kdePackages.dolphin
# enpass enpass
# enpass-cli enpass-cli
# expressvpn # expressvpn
# jellyfin-ffmpeg # jellyfin-ffmpeg
# inkscape # inkscape
@@ -262,8 +263,10 @@
# sxiv # sxiv
# tenacity # tenacity
# unzip # unzip
# zathura zathura
# ghostty ghostty
yarn
uwsm
# wally-cli # wally-cli
# kdePackages.wacomtablet # kdePackages.wacomtablet
# kdePackages.print-manager # kdePackages.print-manager
@@ -282,8 +285,8 @@
Status = "locked"; Status = "locked";
}; };
in { in {
# firefox = { firefox = {
# enable = true; enable = true;
# package = pkgs.wrapFirefox pkgs.firefox-unwrapped { # package = pkgs.wrapFirefox pkgs.firefox-unwrapped {
# extraPolicies = { # extraPolicies = {
# DisableTelemetry = true; # DisableTelemetry = true;
@@ -339,7 +342,7 @@
# }; # };
# }; # };
# }; # };
# }; };
}; };
nixpkgs = { nixpkgs = {
config = { config = {