nixos/modules/scripts.nix
ISnortPennies 6b7ce7d133 fixed refreshrate on desktop
switch to neovim as a pager
added parrot and mining modules
deleted amd module
moved the rest of vfio configuration to vfio.nix
moved git from home-manager to system configuration
2023-01-23 23:32:11 -05:00

41 lines
972 B
Nix

{pkgs, ...}: let
update-system = pkgs.writeShellScriptBin "update-system" ''
if ! [ $(id -u) = 0 ]; then
echo "RUN AS ROOT"
exit 1
fi
nix flake update /etc/nixos/#
'';
clean-store = pkgs.writeShellScriptBin "clean-store" ''
if ! [ $(id -u) = 0 ]; then
echo "RUN AS ROOT"
exit 1
fi
rm /nix/var/nix/gcroots/auto/*
nix-collect-garbage -d
'';
apply-system = pkgs.writeShellScriptBin "apply-system" ''
if ! [ $(id -u) = 0 ]; then
echo "RUN AS ROOT"
exit 1
fi
nixos-rebuild switch --flake /etc/nixos/#
'';
full-upgrade = pkgs.writeShellScriptBin "full-upgrade" ''
if ! [ $(id -u) = 0 ]; then
echo "RUN AS ROOT"
exit 1
fi
update-system
apply-system
'';
pastebin = pkgs.writeShellScriptBin "pastebin" ''
curl -F 'clbin=<-' https://clbin.com
'';
in {
environment.systemPackages = [update-system apply-system full-upgrade clean-store pastebin];
}