From 6bc00fe38da1e875c5e9a3d93f611d9efd2edaa8 Mon Sep 17 00:00:00 2001 From: Dmitry Voronin Date: Wed, 21 Feb 2024 04:43:35 +0300 Subject: [PATCH] Dotfiles : Prevent deadlock on install. --- .config/linux/system/module/Flatpak.nix | 2 +- .config/linux/system/module/common/Dotfiles.nix | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.config/linux/system/module/Flatpak.nix b/.config/linux/system/module/Flatpak.nix index 1eccdc5..b6bf2f9 100644 --- a/.config/linux/system/module/Flatpak.nix +++ b/.config/linux/system/module/Flatpak.nix @@ -7,7 +7,7 @@ in { # Bootstrap apps on boot. systemd.services.flatpakinstall = { description = "Install Flatpak apps."; - wantedBy = [ "graphical-session-pre.target" ]; + wantedBy = [ "multi-user.target" ]; wants = [ "dotfiles.service" ]; after = [ "dotfiles.service" ]; serviceConfig.Type = "oneshot"; diff --git a/.config/linux/system/module/common/Dotfiles.nix b/.config/linux/system/module/common/Dotfiles.nix index 5644a83..2af575e 100644 --- a/.config/linux/system/module/common/Dotfiles.nix +++ b/.config/linux/system/module/common/Dotfiles.nix @@ -13,7 +13,10 @@ chmod -77 -R . ${pkgs.git}/bin/git init ${pkgs.git}/bin/git remote add origin https://git.voronind.com/voronind/linux.git - ${pkgs.git}/bin/git fetch + ${pkgs.git}/bin/git fetch || { + rm -rf .git + exit 1 + }; ${pkgs.git}/bin/git reset origin/main ${pkgs.git}/bin/git reset --hard HEAD ${pkgs.git}/bin/git checkout main