diff --git a/nixos/shared/packages/default.nix b/nixos/shared/packages/default.nix index 5c6c5c2..1182fbb 100644 --- a/nixos/shared/packages/default.nix +++ b/nixos/shared/packages/default.nix @@ -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 diff --git a/pkgs/default.nix b/pkgs/default.nix index 998cdfa..7569bfa 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -4,4 +4,5 @@ pkgs: { dvd = pkgs.callPackage ./dvd {}; dvt = pkgs.callPackage ./dvt {}; servo = pkgs.callPackage ./servo {}; + rebuild = pkgs.callPackage ./rebuild {}; } diff --git a/pkgs/rebuild/default.nix b/pkgs/rebuild/default.nix new file mode 100644 index 0000000..50a57fc --- /dev/null +++ b/pkgs/rebuild/default.nix @@ -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 + ''; +}