From a5b59f63018ce3fba904841f2bc845db84bfef9a Mon Sep 17 00:00:00 2001 From: Malte Brandy Date: Tue, 13 Oct 2020 00:18:12 +0200 Subject: [PATCH] Make update scripts more robust --- home-manager/roles/laptop.nix | 2 +- lib/update-system.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/home-manager/roles/laptop.nix b/home-manager/roles/laptop.nix index 51f4ddfa..960eead3 100644 --- a/home-manager/roles/laptop.nix +++ b/home-manager/roles/laptop.nix @@ -45,7 +45,7 @@ in { main = do say "Building ~/.modes for apollo" nixPath <- myNixPath "${configPath}" - bracket (rm canaryPath) (\() -> git "-C" privatePath "restore" canaryPath) $ \() -> + bracket (rm "-f" canaryPath) (\() -> git "-C" privatePath "restore" canaryPath) $ \() -> nix_build nixPath (params ++ remoteBuildParams) &!> StdOut |> nom nix_build nixPath params activate_mode diff --git a/lib/update-system.nix b/lib/update-system.nix index f374ce32..6accc27a 100644 --- a/lib/update-system.nix +++ b/lib/update-system.nix @@ -11,7 +11,7 @@ in { main = do paths <- myNixPath "${configPath}" args <- getArgs - bracket (rm canaryPath) (\() -> exe "/run/wrappers/bin/sudo" "-u" "maralorn" "git" "-C" privatePath "restore" canaryPath) $ \() -> do + bracket (rm "-f" canaryPath) (\() -> exe "/run/wrappers/bin/sudo" "-u" "maralorn" "git" "-C" privatePath "restore" canaryPath) $ \() -> do nix_build (paths ++ buildSystemParams ++ ["--no-out-link"] ++ remoteBuildParams ++ fmap toString args) &!> StdOut |> nom nixos_rebuild (paths ++ ["switch"] ++ fmap toString args) &!> StdOut |> nom '';