From a6b5e522b9692b2556d73b6ff1c002ed0e96ddb7 Mon Sep 17 00:00:00 2001 From: Atridad Lahiji Date: Mon, 23 Dec 2024 11:03:34 -0700 Subject: [PATCH] Added boatswain and copy script --- apps.nix | 1 + nixcp.sh | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100755 nixcp.sh diff --git a/apps.nix b/apps.nix index 68a7a38..fe3ea96 100644 --- a/apps.nix +++ b/apps.nix @@ -15,6 +15,7 @@ libreoffice-qt hunspell hunspellDicts.en_US + pkgs.boatswain ]; programs.steam = { diff --git a/nixcp.sh b/nixcp.sh new file mode 100755 index 0000000..503856d --- /dev/null +++ b/nixcp.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +# Get the directory where the script is located +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" + +# Define the target directory +TARGET_DIR="/etc/nixos" + +# Check if the script is being run with sudo privileges (since /etc/nixos requires elevated permissions) +if [ "$(id -u)" -ne 0 ]; then + echo "This script must be run with sudo or as root." + exit 1 +fi + +# Copy all .nix files from the script's directory to the /etc/nixos directory +for file in "$SCRIPT_DIR"/*.nix; do + if [ -f "$file" ]; then + # Copy the file, replacing the existing one + cp -f "$file" "$TARGET_DIR/" + echo "Copied $file to $TARGET_DIR/" + fi +done + +echo "All .nix files have been copied to $TARGET_DIR."