From bb64b6d859a0fa7a31057cb9edaa4e798e5c14d3 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 16 Mar 2023 08:34:24 +0100 Subject: [PATCH] Streamline push etckeeper and os update The os update and backup now include etckeeper as its part of the workflow. The os updates now have the same name on all systems. That should reduce friction, same command for same workflow, just different implementation. --- home/packages.nix | 1 - home/packages/custom/backup/default.nix | 11 +++++++---- .../packages/custom/update-nixos-system/default.nix | 2 +- .../custom/update-ubuntu-system/default.nix | 13 +++++++++++-- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/home/packages.nix b/home/packages.nix index e24039b..05d3b96 100644 --- a/home/packages.nix +++ b/home/packages.nix @@ -98,5 +98,4 @@ with pkgs; [ # hikari 2 (callPackage ./packages/custom/update-ubuntu-system { }) - (callPackage ./packages/custom/push-etckeeper { }) ]) diff --git a/home/packages/custom/backup/default.nix b/home/packages/custom/backup/default.nix index 316e40b..8cf576c 100644 --- a/home/packages/custom/backup/default.nix +++ b/home/packages/custom/backup/default.nix @@ -1,8 +1,9 @@ { - writeShellApplication, - borgbackup, - git, - rsync + writeShellApplication + , borgbackup + , git + , rsync + , callPackage }: writeShellApplication { @@ -12,6 +13,7 @@ writeShellApplication { borgbackup rsync git + (callPackage ../push-etckeeper { }) ]; text = '' @@ -29,5 +31,6 @@ writeShellApplication { sudo chown daniels:daniels -R /media/daniels/Backup/etc/ cd /media/daniels/Backup/etc/ git reset --hard master + custom-push-etckeeper ''; } diff --git a/home/packages/custom/update-nixos-system/default.nix b/home/packages/custom/update-nixos-system/default.nix index 153e66d..073adea 100644 --- a/home/packages/custom/update-nixos-system/default.nix +++ b/home/packages/custom/update-nixos-system/default.nix @@ -1,7 +1,7 @@ { writeShellApplication }: writeShellApplication { - name = "custom-update-nixos-system"; + name = "custom-update-operating-system"; text = '' sudo nixos-rebuild switch --upgrade-all diff --git a/home/packages/custom/update-ubuntu-system/default.nix b/home/packages/custom/update-ubuntu-system/default.nix index 609d59f..dfc2ba1 100644 --- a/home/packages/custom/update-ubuntu-system/default.nix +++ b/home/packages/custom/update-ubuntu-system/default.nix @@ -1,7 +1,14 @@ -{ writeShellApplication }: +{ + writeShellApplication + , callPackage +}: writeShellApplication { - name = "custom-update-ubuntu-system"; + name = "custom-update-operating-system"; + + runtimeInputs = [ + (callPackage ../push-etckeeper { }) + ]; text = '' sudo apt update @@ -9,6 +16,8 @@ writeShellApplication { sudo apt upgrade -V -y sudo apt autoremove -y + custom-push-etckeeper + sudo fwupdmgr refresh sudo fwupdmgr get-updates fwupdmgr update -y