Rewrite for Debian only
This commit is contained in:
12
FIXES.md
12
FIXES.md
@@ -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
|
|
||||||
```
|
|
||||||
|
|
||||||
@@ -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.
|
|
||||||
}
|
|
||||||
@@ -19,10 +19,11 @@ enable-hot-corners=false
|
|||||||
font-name='Adwaita Sans 11'
|
font-name='Adwaita Sans 11'
|
||||||
gtk-theme='Adwaita'
|
gtk-theme='Adwaita'
|
||||||
document-font-name='Adwaita Sans 11'
|
document-font-name='Adwaita Sans 11'
|
||||||
#icon-theme='Yaru'
|
icon-theme='Adwaita'
|
||||||
monospace-font-name='JetBrainsMono NF 13'
|
monospace-font-name='JetBrainsMono NF 13'
|
||||||
clock-format = '12h'
|
clock-format = '12h'
|
||||||
accent-color = 'teal'
|
accent-color = 'teal'
|
||||||
|
show-battery-percentage = true
|
||||||
|
|
||||||
[org/gnome/desktop/screensaver]
|
[org/gnome/desktop/screensaver]
|
||||||
color-shading-type='solid'
|
color-shading-type='solid'
|
||||||
|
|||||||
10
debian.sh
10
debian.sh
@@ -1,15 +1,17 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
source scripts/p.sh
|
./scripts/update
|
||||||
p # Update system
|
|
||||||
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bckp
|
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bckp
|
||||||
sudo cp debian-sources.list /etc/apt/sources.list
|
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
|
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||||
|
|
||||||
# Enable Network Manager
|
# Enable Network Manager
|
||||||
sudo mv /etc/network/interfaces /etc/network/interfaces.bckp
|
sudo mv /etc/network/interfaces /etc/network/interfaces.bckp
|
||||||
sudo systemctl restart networking
|
sudo systemctl restart networking
|
||||||
sudo service NetworkManager restart
|
sudo service NetworkManager restart
|
||||||
|
|
||||||
|
# Remove Firefox (Epiphany installed instead)
|
||||||
|
sudo apt purge firefox-esr
|
||||||
|
|||||||
70
install.sh
70
install.sh
@@ -54,9 +54,11 @@ done
|
|||||||
cd "$HOME/dotfiles"
|
cd "$HOME/dotfiles"
|
||||||
if [ "$(pwd)" != "$HOME/dotfiles" ]; then
|
if [ "$(pwd)" != "$HOME/dotfiles" ]; then
|
||||||
printf "${YELLOW}Cloning dotfiles repository...${NC}\n"
|
printf "${YELLOW}Cloning dotfiles repository...${NC}\n"
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y git
|
||||||
git clone https://github.com/TrudeEH/dotfiles --depth 1
|
git clone https://github.com/TrudeEH/dotfiles --depth 1
|
||||||
if [ $? -ne 0 ]; then
|
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
|
exit 2
|
||||||
fi
|
fi
|
||||||
cd dotfiles || exit
|
cd dotfiles || exit
|
||||||
@@ -71,82 +73,39 @@ else
|
|||||||
fi
|
fi
|
||||||
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"
|
mkdir -p "$HOME/dotfiles/logs"
|
||||||
|
source scripts/fetch
|
||||||
|
|
||||||
printf "${CYAN}\n"
|
printf "${CYAN}\n"
|
||||||
printf "####################\n"
|
printf "####################\n"
|
||||||
printf "#"
|
printf "#"
|
||||||
printf "${PURPLE} Trude's Dotfiles${CYAN} #\n"
|
printf "${PURPLE} Trude's Dotfiles${CYAN} #\n"
|
||||||
printf "####################\n"
|
printf "####################\n"
|
||||||
printf "${CYAN}Running on: ${PURPLE}%s${NC}\n" "$OSTYPE"
|
fetch
|
||||||
printf "${CYAN}User: ${PURPLE}%s${NC}\n" "$USER"
|
|
||||||
printf "${CYAN}Desktop: ${PURPLE}%s${NC}\n" "$XDG_CURRENT_DESKTOP"
|
|
||||||
printf "\n"
|
printf "\n"
|
||||||
|
|
||||||
# Install Programs
|
# Install Programs
|
||||||
if [ "$reload" = false ] && [ -z "$nixos" ]; then
|
if [ "$reload" = false ]; then
|
||||||
programs=(neovim curl git tmux htop fzf gcc make tldr pass lynis bat)
|
sudo apt install neovim curl git tmux htop fzf tldr pass lynis bat ufw s-tui build-essential
|
||||||
|
|
||||||
if [[ "$OSTYPE" != "darwin"* ]]; then
|
|
||||||
programs+=(ufw s-tui)
|
|
||||||
fi
|
|
||||||
|
|
||||||
p i "${programs[@]}"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Copy files
|
# Copy files
|
||||||
printf "${YELLOW}Installing Dotfiles...${NC}\n"
|
printf "${YELLOW}Installing Dotfiles...${NC}\n"
|
||||||
cp -r "$HOME/dotfiles/home/." "$HOME"
|
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
|
# Copy scripts
|
||||||
printf "${YELLOW}Installing Scripts...${NC}\n"
|
printf "${YELLOW}Installing Scripts...${NC}\n"
|
||||||
mkdir -p "$HOME/.local/bin"
|
mkdir -p "$HOME/.local/bin"
|
||||||
cp -r "$HOME/dotfiles/scripts/." "$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
|
# Install fonts
|
||||||
printf "${YELLOW}Installing fonts...${NC}\n"
|
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"
|
mkdir -p "$HOME/.local/share/fonts"
|
||||||
cp -rf "$HOME/dotfiles/fonts/"* "$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"
|
fc-cache -fv "$HOME/.local/share/fonts" >"$HOME/dotfiles/logs/font_install.log"
|
||||||
printf "${GREEN}Fonts installed successfully.${NC}\n"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# UFW Firewall
|
# UFW Firewall
|
||||||
if [ "$reload" = false ] && [ -z "$nixos" ] && [[ "$OSTYPE" != "darwin"* ]]; then
|
if [ "$reload" = false ]; then
|
||||||
printf "${YELLOW}Setting up UFW...${NC}\n"
|
printf "${YELLOW}Setting up UFW...${NC}\n"
|
||||||
sudo ufw default deny incoming
|
sudo ufw default deny incoming
|
||||||
sudo ufw default allow outgoing
|
sudo ufw default allow outgoing
|
||||||
@@ -157,19 +116,6 @@ if [ "$reload" = false ] && [ -z "$nixos" ] && [[ "$OSTYPE" != "darwin"* ]]; the
|
|||||||
sudo ufw enable
|
sudo ufw enable
|
||||||
sudo ss -tupln | tee "$HOME/dotfiles/logs/open_ports.log"
|
sudo ss -tupln | tee "$HOME/dotfiles/logs/open_ports.log"
|
||||||
sudo ufw status numbered | tee "$HOME/dotfiles/logs/ufw_status.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
|
fi
|
||||||
|
|
||||||
# Trude-only settings
|
# Trude-only settings
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ ENDCOLOR="\e[0m"
|
|||||||
|
|
||||||
pcheck() {
|
pcheck() {
|
||||||
local pms=()
|
local pms=()
|
||||||
if command -v flatpak >/dev/null 2>&1; then
|
|
||||||
pms+=("flatpak")
|
|
||||||
fi
|
|
||||||
if command -v nix >/dev/null 2>&1; then
|
if command -v nix >/dev/null 2>&1; then
|
||||||
pms+=("nix")
|
pms+=("nix")
|
||||||
fi
|
fi
|
||||||
@@ -37,6 +34,9 @@ pcheck() {
|
|||||||
elif command -v dnf >/dev/null 2>&1; then
|
elif command -v dnf >/dev/null 2>&1; then
|
||||||
pms+=("dnf")
|
pms+=("dnf")
|
||||||
fi
|
fi
|
||||||
|
if command -v flatpak >/dev/null 2>&1; then
|
||||||
|
pms+=("flatpak")
|
||||||
|
fi
|
||||||
echo "${pms[@]}"
|
echo "${pms[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
4
scripts/temp
Executable file
4
scripts/temp
Executable file
@@ -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/'
|
||||||
|
|
||||||
18
scripts/update
Executable file
18
scripts/update
Executable file
@@ -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
|
||||||
|
|
||||||
Reference in New Issue
Block a user