Services: git pull submodules in autoupgrade script
This commit is contained in:
parent
de0bc659a8
commit
5f3018804a
|
@ -157,11 +157,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1726592409,
|
"lastModified": 1726818100,
|
||||||
"narHash": "sha256-2Y6CDvD/BD43WLS77PHu6dUHbdUfFhuzkY8oJAecD/U=",
|
"narHash": "sha256-z2V74f5vXqkN5Q+goFlhbFXY/dNaBAyeLpr2bxu4Eic=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "2ab00f89dd3ecf8012f5090e6d7ca1a7ea30f594",
|
"rev": "1bbc1a5a1f4de7401c92db85b2119ed21bb4139d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
@ -67,7 +67,8 @@ in
|
||||||
# If we have changes (git diff returns 1), pull changes and run the update
|
# If we have changes (git diff returns 1), pull changes and run the update
|
||||||
if [ $? -eq 1 ]; then
|
if [ $? -eq 1 ]; then
|
||||||
echo "Updates found, running nixos-rebuild..."
|
echo "Updates found, running nixos-rebuild..."
|
||||||
/run/wrappers/bin/sudo -u ${cfg.user} git pull --recurse-submodules
|
/run/wrappers/bin/sudo -u ${cfg.user} git pull
|
||||||
|
/run/wrappers/bin/sudo -u ${cfg.user} git submodule update --remote
|
||||||
nixos-rebuild switch --flake .
|
nixos-rebuild switch --flake .
|
||||||
else
|
else
|
||||||
echo "No updates found. Exiting."
|
echo "No updates found. Exiting."
|
||||||
|
@ -99,7 +100,8 @@ in
|
||||||
cd ${cfg.configDir}
|
cd ${cfg.configDir}
|
||||||
# Make sure we're up-to-date
|
# Make sure we're up-to-date
|
||||||
echo "Pulling the latest version..."
|
echo "Pulling the latest version..."
|
||||||
/run/wrappers/bin/sudo -u ${cfg.user} git pull --recurse-submodules
|
/run/wrappers/bin/sudo -u ${cfg.user} git pull
|
||||||
|
/run/wrappers/bin/sudo -u ${cfg.user} git submodule update --remote
|
||||||
/run/wrappers/bin/sudo -u ${cfg.user} nix flake update --commit-lock-file
|
/run/wrappers/bin/sudo -u ${cfg.user} nix flake update --commit-lock-file
|
||||||
/run/wrappers/bin/sudo -u ${cfg.user} git push
|
/run/wrappers/bin/sudo -u ${cfg.user} git push
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue