add rebuild command (untested)
This commit is contained in:
parent
983e994930
commit
52a5010891
|
@ -6,7 +6,19 @@
|
|||
pkgs,
|
||||
...
|
||||
}: {
|
||||
nixpkgs = {
|
||||
# You can add overlays here
|
||||
overlays = [
|
||||
# Add overlays your own flake exports (from overlays and pkgs dir):
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.modifications
|
||||
];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
# Custom tools
|
||||
rebuild
|
||||
|
||||
# System tools
|
||||
age
|
||||
alejandra
|
||||
|
|
|
@ -4,4 +4,5 @@ pkgs: {
|
|||
dvd = pkgs.callPackage ./dvd {};
|
||||
dvt = pkgs.callPackage ./dvt {};
|
||||
servo = pkgs.callPackage ./servo {};
|
||||
rebuild = pkgs.callPackage ./rebuild {};
|
||||
}
|
||||
|
|
27
pkgs/rebuild/default.nix
Normal file
27
pkgs/rebuild/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
lib,
|
||||
stdenv,
|
||||
writeShellApplication,
|
||||
}:
|
||||
writeShellApplication
|
||||
{
|
||||
name = "rebuild";
|
||||
|
||||
runtimeInputs = [];
|
||||
|
||||
text = ''
|
||||
# A rebuild script for NixOS
|
||||
set -e
|
||||
pushd /tmp
|
||||
git clone forgejo@git.lillianviolet.dev:Lillian-Violet/NixOS-Config.git ./rebuild
|
||||
$hostname=$(hostname)
|
||||
pushd ./rebuild
|
||||
echo "NixOS Rebuilding..."
|
||||
sudo nixos-rebuild switch --flake #$hostname &>nixos-switch.log || (cat nixos-switch.log | grep --color error && false)
|
||||
popd
|
||||
echo "Cleaning up repository in tmp..."
|
||||
rm -rf ./rebuild
|
||||
popd
|
||||
notify-send -e "NixOS Rebuilt OK!" --icon=software-update-available
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue