diff --git a/FIXES.md b/FIXES.md deleted file mode 100644 index d04cf8ef..00000000 --- a/FIXES.md +++ /dev/null @@ -1,12 +0,0 @@ -# Fix common issues - -## WiFi - -### Access point requires a password or encryption key - Can't connect. - -Edit `/etc/NetworkManager/NetworkManager.conf`. -```diff -+ [device] -+ wifi.scan-rand-mac-address=no -``` - diff --git a/configuration.nix b/configuration.nix deleted file mode 100644 index bf71c176..00000000 --- a/configuration.nix +++ /dev/null @@ -1,101 +0,0 @@ -{ config, pkgs, ... }: - -{ - imports = [ ./hardware-configuration.nix ]; - nixpkgs.config.allowUnfree = true; - - # Bootloader. - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; - - # Enable networking - networking.hostName = "trudepc"; - networking.networkmanager.enable = true; - - # Select internationalisation properties. - time.timeZone = "Europe/Lisbon"; - i18n.defaultLocale = "en_US.UTF-8"; - i18n.extraLocaleSettings = { - LC_ADDRESS = "pt_PT.UTF-8"; - LC_IDENTIFICATION = "pt_PT.UTF-8"; - LC_MEASUREMENT = "pt_PT.UTF-8"; - LC_MONETARY = "pt_PT.UTF-8"; - LC_NAME = "pt_PT.UTF-8"; - LC_NUMERIC = "pt_PT.UTF-8"; - LC_PAPER = "pt_PT.UTF-8"; - LC_TELEPHONE = "pt_PT.UTF-8"; - LC_TIME = "pt_PT.UTF-8"; - }; - - # Enable the GNOME windowing system. - services.xserver.enable = true; - services.xserver.displayManager.gdm.enable = true; - services.xserver.desktopManager.gnome.enable = true; - services.printing.enable = true; # CUPS - services.pulseaudio.enable = false; - security.rtkit.enable = true; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - # If you want to use JACK applications, uncomment this - #jack.enable = true; - }; - # Enable touchpad support (enabled default in most desktopManager). - # services.xserver.libinput.enable = true; - - # Configure keymap in X11 - services.xserver.xkb = { - layout = "us"; - variant = "altgr-intl"; - }; - - # Define a user account. Don't forget to set a password with ‘passwd’. - users.users.trude = { - isNormalUser = true; - description = "TrudeEH"; - extraGroups = [ "networkmanager" "wheel" ]; - packages = with pkgs; [ # GUI and user apps - vscode brave discord prismlauncher obsidian - - # Gnome-Circle Apps - devhelp sysprof gnome-builder gnome-boxes - dialect commit binary authenticator - webfontkitgenerator video-trimmer - textpieces switcheroo pika-backup - resources gnome-obfuscate gnome-podcasts - letterpress impression gnome-graphs - fragments eyedropper raider curtail - collision warp - ]; - }; - - # System packages - environment.systemPackages = with pkgs; [ - git curl wget pass lynis bat - neovim tmux htop fzf - ]; - - programs.gnupg.agent.enable = true; - - programs.steam = { - enable = true; - remotePlay.openFirewall = true; - dedicatedServer.openFirewall = true; - }; - - # Firewall - networking.firewall.allowedTCPPorts = [ 22 ]; - # networking.firewall.allowedUDPPorts = [ ... ]; - - # Allow running executables. - programs.nix-ld = { - enable = true; - libraries = with pkgs; [ - # Add any missing dynamic libraries for unpacked programs here. - ]; - }; - - system.stateVersion = "24.11"; # Don't change this value. -} \ No newline at end of file diff --git a/dconf-settings.ini b/dconf-settings.ini index 177b7568..b1760c42 100644 --- a/dconf-settings.ini +++ b/dconf-settings.ini @@ -19,10 +19,11 @@ enable-hot-corners=false font-name='Adwaita Sans 11' gtk-theme='Adwaita' document-font-name='Adwaita Sans 11' -#icon-theme='Yaru' +icon-theme='Adwaita' monospace-font-name='JetBrainsMono NF 13' clock-format = '12h' accent-color = 'teal' +show-battery-percentage = true [org/gnome/desktop/screensaver] color-shading-type='solid' diff --git a/debian.sh b/debian.sh index 745358fa..0e25af0f 100755 --- a/debian.sh +++ b/debian.sh @@ -1,15 +1,17 @@ #! /bin/bash -source scripts/p.sh -p # Update system +./scripts/update sudo cp /etc/apt/sources.list /etc/apt/sources.list.bckp sudo cp debian-sources.list /etc/apt/sources.list -p +./scripts/update -sudo apt install gnome-core flatpak gnome-software-plugin-flatpak +sudo apt install gnome-core flatpak gnome-software-plugin-flatpak epiphany-browser sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo # Enable Network Manager sudo mv /etc/network/interfaces /etc/network/interfaces.bckp sudo systemctl restart networking sudo service NetworkManager restart + +# Remove Firefox (Epiphany installed instead) +sudo apt purge firefox-esr diff --git a/install.sh b/install.sh index 743522e6..fcb7b1dc 100755 --- a/install.sh +++ b/install.sh @@ -54,9 +54,11 @@ done cd "$HOME/dotfiles" if [ "$(pwd)" != "$HOME/dotfiles" ]; then printf "${YELLOW}Cloning dotfiles repository...${NC}\n" + sudo apt update + sudo apt install -y git git clone https://github.com/TrudeEH/dotfiles --depth 1 if [ $? -ne 0 ]; then - printf "${RED}Error cloning dotfiles repository. Is git installed? Exiting...${NC}\n" + printf "${RED}Error cloning dotfiles repository. Exiting...${NC}\n" exit 2 fi cd dotfiles || exit @@ -71,82 +73,39 @@ else fi fi -source ./scripts/p.sh - -# NixOS -if grep -qi "nixos" /etc/os-release; then - printf "${CYAN}NixOS detected.${NC}\n" - nixos=true - sudo cp -f /etc/nixos/configuration.nix /etc/nixos/configuration.nix.bak - sudo cp -f configuration.nix /etc/nixos/configuration.nix - sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos - p -fi - mkdir -p "$HOME/dotfiles/logs" +source scripts/fetch printf "${CYAN}\n" printf "####################\n" printf "#" printf "${PURPLE} Trude's Dotfiles${CYAN} #\n" printf "####################\n" -printf "${CYAN}Running on: ${PURPLE}%s${NC}\n" "$OSTYPE" -printf "${CYAN}User: ${PURPLE}%s${NC}\n" "$USER" -printf "${CYAN}Desktop: ${PURPLE}%s${NC}\n" "$XDG_CURRENT_DESKTOP" +fetch printf "\n" # Install Programs -if [ "$reload" = false ] && [ -z "$nixos" ]; then - programs=(neovim curl git tmux htop fzf gcc make tldr pass lynis bat) - - if [[ "$OSTYPE" != "darwin"* ]]; then - programs+=(ufw s-tui) - fi - - p i "${programs[@]}" +if [ "$reload" = false ]; then + sudo apt install neovim curl git tmux htop fzf tldr pass lynis bat ufw s-tui build-essential fi # Copy files printf "${YELLOW}Installing Dotfiles...${NC}\n" cp -r "$HOME/dotfiles/home/." "$HOME" -if [ $? -ne 0 ]; then - printf "${RED}Error copying Dotfiles.${NC}\n" -else - printf "${GREEN}Dotfiles installed successfully.${NC}\n" -fi # Copy scripts printf "${YELLOW}Installing Scripts...${NC}\n" mkdir -p "$HOME/.local/bin" cp -r "$HOME/dotfiles/scripts/." "$HOME/.local/bin/" -if [ $? -ne 0 ]; then - printf "${RED}Error copying Scripts.${NC}\n" -else - printf "${GREEN}Scripts installed successfully.${NC}\n" -fi # Install fonts printf "${YELLOW}Installing fonts...${NC}\n" -if [[ "$OSTYPE" == "darwin"* ]]; then - cp -rf "$HOME/dotfiles/fonts/"* "$HOME/Library/Fonts/" - if [ $? -ne 0 ]; then - printf "${RED}Error installing fonts.${NC}\n" - else - printf "${GREEN}Fonts installed successfully.${NC}\n" - fi -else - mkdir -p "$HOME/.local/share/fonts" - cp -rf "$HOME/dotfiles/fonts/"* "$HOME/.local/share/fonts/" - if [ $? -ne 0 ]; then - printf "${RED}Error installing fonts.${NC}\n" - else - fc-cache -fv "$HOME/.local/share/fonts" >"$HOME/dotfiles/logs/font_install.log" - printf "${GREEN}Fonts installed successfully.${NC}\n" - fi -fi +mkdir -p "$HOME/.local/share/fonts" +cp -rf "$HOME/dotfiles/fonts/"* "$HOME/.local/share/fonts/" +fc-cache -fv "$HOME/.local/share/fonts" >"$HOME/dotfiles/logs/font_install.log" # UFW Firewall -if [ "$reload" = false ] && [ -z "$nixos" ] && [[ "$OSTYPE" != "darwin"* ]]; then +if [ "$reload" = false ]; then printf "${YELLOW}Setting up UFW...${NC}\n" sudo ufw default deny incoming sudo ufw default allow outgoing @@ -157,19 +116,6 @@ if [ "$reload" = false ] && [ -z "$nixos" ] && [[ "$OSTYPE" != "darwin"* ]]; the sudo ufw enable sudo ss -tupln | tee "$HOME/dotfiles/logs/open_ports.log" sudo ufw status numbered | tee "$HOME/dotfiles/logs/ufw_status.log" - if [ $? -ne 0 ]; then - printf "${RED}Error setting up UFW.${NC}\n" - else - printf "${GREEN}UFW setup successfully.${NC}\n" - fi -elif [[ "$OSTYPE" == "darwin"* && "$reload" = false ]]; then - printf "${YELLOW}Enabling macOS Firewall...${NC}\n" - sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on - if [ $? -ne 0 ]; then - printf "${RED}Error enabling Firewall.${NC}\n" - else - printf "${GREEN}Firewall enabled successfully.${NC}\n" - fi fi # Trude-only settings diff --git a/scripts/p.sh b/scripts/p.sh index 9889d4bb..f3d50b23 100755 --- a/scripts/p.sh +++ b/scripts/p.sh @@ -18,9 +18,6 @@ ENDCOLOR="\e[0m" pcheck() { local pms=() - if command -v flatpak >/dev/null 2>&1; then - pms+=("flatpak") - fi if command -v nix >/dev/null 2>&1; then pms+=("nix") fi @@ -37,6 +34,9 @@ pcheck() { elif command -v dnf >/dev/null 2>&1; then pms+=("dnf") fi + if command -v flatpak >/dev/null 2>&1; then + pms+=("flatpak") + fi echo "${pms[@]}" } diff --git a/scripts/temp b/scripts/temp new file mode 100755 index 00000000..35db14b9 --- /dev/null +++ b/scripts/temp @@ -0,0 +1,4 @@ +#! /bin/bash + +paste <(cat /sys/class/thermal/thermal_zone*/type) <(cat /sys/class/thermal/thermal_zone*/temp) | column -s $'\t' -t | sed 's/\(.\)..$/.\1°C/' + diff --git a/scripts/update b/scripts/update new file mode 100755 index 00000000..4e94e2fb --- /dev/null +++ b/scripts/update @@ -0,0 +1,18 @@ +#! /bin/bash + +YELLOW="\e[33m" +ENDCOLOR="\e[0m" + +printf "%b\n" "${YELLOW}Updating apt...${ENDCOLOR}" +sudo apt update +sudo apt upgrade +sudo apt dist-upgrade +sudo apt autoremove +sudo apt autoclean + +if command -v flatpak >/dev/null 2>&1; then + printf "%b\n" "${YELLOW}Updating flatpak...${ENDCOLOR}" + flatpak update + flatpak uninstall --unused --delete-data +fi +