aboutsummaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
authorAargh Rai <aargh.rai+git@gmail.com>2025-10-18 10:33:00 +0530
committerAargh Rai <aargh.rai+git@gmail.com>2025-10-18 10:33:00 +0530
commit357e96e6603406d539d89f0c6ed12b1bf0287dca (patch)
tree8b8a3c998c62d65a03e77ef1654fc48bc86d0de0 /install.sh
parent85809c17dd2afde7005aecbcec59b4474aa54d1e (diff)
fuck cuda + added cloc + fixed the install script
now i have to make the username generic
Diffstat (limited to 'install.sh')
-rwxr-xr-x[-rw-r--r--]install.sh39
1 files changed, 38 insertions, 1 deletions
diff --git a/install.sh b/install.sh
index 857406a..1e1baf3 100644..100755
--- a/install.sh
+++ b/install.sh
@@ -1,6 +1,43 @@
+#!/usr/bin/env bash
+
+echo "Inserting files..."
+mkdir -p ~/.config
sudo cp -r hypr foot nvim tmux waybar wofi yazi home-manager starship.toml ~/.config
-sudo cp -r nixos /etc
sudo cp -r Wallpapers ~/Pictures
+sudo cp -r nixos /etc
+sudo nixos-generate-config
+
+CHANNEL_FILE="nixos/nix-channel.txt"
+if [[ ! -f "$CHANNEL_FILE" ]]; then
+ echo "Error: Channel file not found at $CHANNEL_FILE"
+ exit 1
+fi
+current_channels=$(sudo nix-channel --list)
+
+# Read and process each channel from file
+while IFS= read -r line || [[ -n "$line" ]]; do
+ # Skip empty lines and comments
+ [[ -z "$line" ]] || [[ "$line" =~ ^[[:space:]]*# ]] && continue
+
+ # Parse channel name and URL (format: "name url")
+ channel_name=$(echo "$line" | awk '{print $1}')
+ channel_url=$(echo "$line" | awk '{print $2}')
+
+ # Check if channel already exists
+ if echo "$current_channels" | grep -q "^$channel_name "; then
+ echo "✓ Channel '$channel_name' already exists"
+ else
+ echo "Adding channel '$channel_name' from $channel_url"
+ sudo nix-channel --add "$channel_url" "$channel_name"
+ fi
+done < "$CHANNEL_FILE"
+
+# Update channels after adding new ones
+echo "Updating channels..."
+sudo nix-channel --update
+
+echo "Switching..."
sudo nixos-rebuild switch
home-manager switch
+