diff options
| author | Aargh Rai <aargh.rai+git@gmail.com> | 2025-10-18 13:12:33 +0530 |
|---|---|---|
| committer | Aargh Rai <aargh.rai+git@gmail.com> | 2025-10-18 13:12:33 +0530 |
| commit | 9ec569a1b34f17d32894d51614cff84d8952d868 (patch) | |
| tree | d5f3c27bd4654d90a69f77a569ef1d67b76861dc /install.sh | |
| parent | 1638c8711b4a56347d0c1a4da4d949d71978915c (diff) | |
setup flake!!
now editing username is easier than ever! and no longer nix-channels.txt
with the long script installation
Diffstat (limited to 'install.sh')
| -rwxr-xr-x | install.sh | 40 |
1 files changed, 6 insertions, 34 deletions
@@ -2,42 +2,14 @@ echo "Inserting files..." mkdir -p ~/.config -sudo cp -r hypr foot nvim tmux waybar wofi yazi home-manager starship.toml ~/.config +sudo cp -r hypr foot nvim tmux waybar wofi yazi starship.toml ~/.config sudo cp -r Wallpapers ~/Pictures +# Although we are sending the configs to /etc/nixos, we aren't actually using them with the flake setup +# Consider the operation purely for vanity sudo cp -r nixos /etc -sudo nixos-generate-config +sudo cp -r hardware-configuration.nix /etc/nixos -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 +sudo nixos-generate-config --show-hardware-config > hardware-configuration.nix +sudo nixos-rebuild switch --flake .#pegasus |
