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