1
0
Fork 0

Make update scripts more robust

This commit is contained in:
Malte Brandy 2020-10-13 00:18:12 +02:00
parent e3369d03e3
commit a5b59f6301
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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
'';