Create new systemd-rebuild script to do the updating
This commit is contained in:
parent
d98ca182e3
commit
8e3c5c5340
|
@ -104,8 +104,9 @@
|
|||
pkgs.rebuild
|
||||
pkgs.nix
|
||||
pkgs.bash
|
||||
pkgs.git
|
||||
];
|
||||
script = "bash /run/current-system/sw/bin/rebuild";
|
||||
script = "bash /run/current-system/sw/bin/systemd-rebuild";
|
||||
startAt = "daily";
|
||||
};
|
||||
};
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
# Custom tools
|
||||
rebuild
|
||||
install-nix
|
||||
systemd-rebuild
|
||||
|
||||
# System tools
|
||||
age
|
||||
|
|
|
@ -5,5 +5,6 @@ pkgs: {
|
|||
dvt = pkgs.callPackage ./dvt {};
|
||||
servo = pkgs.callPackage ./servo {};
|
||||
rebuild = pkgs.callPackage ./rebuild {};
|
||||
systemd-rebuild = pkgs.callPackage ./systemd-rebuild {};
|
||||
install-nix = pkgs.callPackage ./install-nix {};
|
||||
}
|
||||
|
|
25
pkgs/systemd-rebuild/default.nix
Normal file
25
pkgs/systemd-rebuild/default.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
writeShellApplication,
|
||||
}:
|
||||
writeShellApplication
|
||||
{
|
||||
name = "systemd-rebuild";
|
||||
|
||||
runtimeInputs = [];
|
||||
|
||||
text = ''
|
||||
# A rebuild script for NixOS for use of the systemd service
|
||||
cd /tmp
|
||||
rm -rf ./rebuild
|
||||
systemd-inhibit git clone https://git.lillianviolet.dev/Lillian-Violet/NixOS-Config.git ./rebuild
|
||||
cd ./rebuild
|
||||
echo "NixOS Rebuilding..."
|
||||
systemd-inhibit sudo nixos-rebuild switch --flake .#
|
||||
cd ..
|
||||
echo "Cleaning up repository in '/tmp/rebuild'..."
|
||||
systemd-inhibit rm -rf ./rebuild
|
||||
echo "NixOS Rebuilt OK!"
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue