aboutsummaryrefslogtreecommitdiff
path: root/nix/scripts/linux.nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2025-07-07 16:03:51 -0700
committerFranck Cuny <franck@fcuny.net>2025-07-07 16:03:51 -0700
commitc214a560f0500e4be077086e557c3e6d336c7c27 (patch)
tree760d484ecdf1c242075394fbcd97927f95f1048c /nix/scripts/linux.nix
parentadd a few tags to org-mode (diff)
downloadinfra-c214a560f0500e4be077086e557c3e6d336c7c27.tar.gz
move scripts managed by nix out of the flake
In order to keep the flake readable, the various scripts managed by nix are now moved to their own files under `nix/scripts`.
Diffstat (limited to 'nix/scripts/linux.nix')
-rw-r--r--nix/scripts/linux.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/nix/scripts/linux.nix b/nix/scripts/linux.nix
new file mode 100644
index 0000000..b44c86f
--- /dev/null
+++ b/nix/scripts/linux.nix
@@ -0,0 +1,19 @@
+{
+ pkgs,
+}:
+[
+ (pkgs.writeScriptBin "nbuild" ''
+ set -e
+ echo "> Running nixos-rebuild build..."
+ sudo nixos-rebuild build --flake .
+ echo "> nixos-rebuild build was successful ✅"
+ '')
+
+ (pkgs.writeScriptBin "nswitch" ''
+ set -e
+ echo "> Running nixos-rebuild switch..."
+ sudo nixos-rebuild switch --flake .
+ echo "> nixos-rebuild switch was successful ✅"
+ echo "> NixOS config was successfully applied 🚀"
+ '')
+]