feat: added reinstall scripts

This commit is contained in:
Nick 2024-10-12 03:30:15 -05:00
parent be599e1ff3
commit b8f37412b2
2 changed files with 9 additions and 54 deletions

View file

@ -1,20 +1,9 @@
#!/usr/bin/env bash
# Define the path to the configuration file
CONFIG_FILE="/etc/nixos/configuration.nix"
cp /etc/nixos/configuration.nix /etc/nixos/configuration.nix.backup
# Backup the original configuration file
cp "$CONFIG_FILE" "$CONFIG_FILE.bak"
sed -i '/services\.printing\.enable = true;/a\ nix.settings.experimental-features = ["nix-command" "flakes"];\n services.openssh.enable = true;' /etc/nixos/configuration.nix
sed -i '/thunderbird/a\ git\n vscode\n tomb' /etc/nixos/configuration.nix
swapoff -a
# Add experimental features
sed -i '/nix.settings.experimental-features/a\ nix.settings.experimental-features = ["nix-command" "flakes"]; # Added by script' "$CONFIG_FILE"
# Enable OpenSSH daemon
sed -i '/services.openssh.enable = true;/i\ services.openssh.enable = true; # Added by script' "$CONFIG_FILE"
# Add user packages
sed -i '/packages = with pkgs; \[/a\ git # Added by script' "$CONFIG_FILE"
sed -i '/git/a\ vscode # Added by script' "$CONFIG_FILE"
sed -i '/vscode/a\ tomb # Added by script' "$CONFIG_FILE"
echo "Configurations have been added to $CONFIG_FILE."
echo "/etc/nixos/configuration.nix updated successfully."