From 65e10302cc26b4611258e92bd38391552512bc62 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Wed, 14 Jul 2021 14:27:18 +0200 Subject: [PATCH 1/7] Update hosts --- root/etc/hosts | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/root/etc/hosts b/root/etc/hosts index 4f63414..b1fa88a 100644 --- a/root/etc/hosts +++ b/root/etc/hosts @@ -1,7 +1,7 @@ # /etc/hosts: Local Host Database # See hosts(5) for details # -# This file describes a number of aliases-to-address mappings for the for +# This file describes a number of aliases-to-address mappings for the for # local hosts that share this file. # # The format of lines in this file is: @@ -10,34 +10,36 @@ # # The fields can be separated by any number of spaces or tabs. # -# In the presence of the domain name service or NIS, this file may not be +# In the presence of the domain name service or NIS, this file may not be # consulted at all; see /etc/host.conf for the resolution order. # -# According to RFC 1918, you can use the following IP networks for private +# According to RFC 1918, you can use the following IP networks for private # nets which will never be connected to the Internet: # # 10.0.0.0 - 10.255.255.255 # 172.16.0.0 - 172.31.255.255 # 192.168.0.0 - 192.168.255.255 # -# In case you want to be able to connect directly to the Internet (i.e. not -# behind a NAT, ADSL router, etc...), you need real official assigned -# numbers. Do not try to invent your own network numbers but instead get one -# from your network provider (if any) or from your regional registry (ARIN, +# In case you want to be able to connect directly to the Internet (i.e. not +# behind a NAT, ADSL router, etc...), you need real official assigned +# numbers. Do not try to invent your own network numbers but instead get one +# from your network provider (if any) or from your regional registry (ARIN, # APNIC, LACNIC, RIPE NCC, or AfriNIC.) # # IPv4 and IPv6 localhost aliases -127.0.0.1 localhost -::1 localhost +127.0.0.1 localhost +::1 localhost # Current system definition -127.0.1.1 your_hostname.localdomain your_hostname +127.0.1.1 primary.localdomain primary + # Extra systems on the network -#192.168.0.102 device2.localdomain device2 +192.168.0.107 localserver.localdomain localserver +192.168.0.10 pihole.localdomain pihole + # DNS servers 45.90.30.0 nextcloud-dns 1.1.1.1 couldflare-dns 1.0.0.1 cloudflare-dns2 8.8.8.8 google-dns -# Custom aliases From 21ed7524ee288291eb2aa3ea62a89792810d7082 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Wed, 14 Jul 2021 14:27:27 +0200 Subject: [PATCH 2/7] Update profile --- root/etc/profile | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/root/etc/profile b/root/etc/profile index 0716d51..be86919 100644 --- a/root/etc/profile +++ b/root/etc/profile @@ -3,7 +3,7 @@ # Set umask, 027 might be too strict for some people. if that's the case # you can fall back to 022 (allowing others to read everything by default) # or even to 002 (allowing groups to write into files just like owners) -umask 027 +umask 022 # Append "$1" to $PATH when not already in. # This function API is accessible to scripts in /etc/profile.d @@ -17,9 +17,12 @@ append_path () { } # Append our default paths +append_path '/sbin' +append_path '/usr/sbin' +append_path '/bin' +append_path '/usr/bin' append_path '/usr/local/sbin' append_path '/usr/local/bin' -append_path '/usr/bin' # Force PATH to be environment export PATH @@ -35,16 +38,6 @@ fi # Unload our profile API functions unset -f append_path -# Source global bash config, when interactive but not posix or sh mode -if test "$BASH" &&\ - test "$PS1" &&\ - test -z "$POSIXLY_CORRECT" &&\ - test "${0#-}" != sh &&\ - test -r /etc/bash.bashrc -then - . /etc/bash.bashrc -fi - # Termcap is outdated, old, and crusty, kill it. unset TERMCAP From c24780f2649acf0b8b0ef384eb4a1e95a4db61bf Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Wed, 14 Jul 2021 14:27:41 +0200 Subject: [PATCH 3/7] Handle existing TMOUT --- root/etc/profile.d/shell-timeout.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/root/etc/profile.d/shell-timeout.sh b/root/etc/profile.d/shell-timeout.sh index aa99b77..8e8688c 100644 --- a/root/etc/profile.d/shell-timeout.sh +++ b/root/etc/profile.d/shell-timeout.sh @@ -4,13 +4,20 @@ # This will only be applied for non-graphical sessions, # or whenever root account is logged in -TMOUT=600 -readonly TMOUT +# If TMOUT was already set, unset it +unset TMOUT -[ -z "$DISPLAY" ] && export TMOUT; +# Define the timeout delay (seconds) +TIMEOUT=600 +# Set TMOUT when display is not set +[ -z "$DISPLAY" ] && export TMOUT=$TIMEOUT; + +# Set TMOUT when in TTY case $(/usr/bin/tty) in - /dev/tty[0-9]*) export TMOUT;; + /dev/tty[0-9]*) export TMOUT=$TIMEOUT;; esac -[ $UID -eq 0 ] && export TMOUT; +# Set TMOUT when user is root +[ $UID -eq 0 ] && export TMOUT=$TIMEOUT; + From ce1ca58438b53f504024934c2037a6b5bf7b9f0c Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Wed, 14 Jul 2021 14:28:21 +0200 Subject: [PATCH 4/7] Use better name for mac randomization --- .../NetworkManager/conf.d/{wifi_rand_mac.conf => random_mac.conf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename root/etc/NetworkManager/conf.d/{wifi_rand_mac.conf => random_mac.conf} (100%) diff --git a/root/etc/NetworkManager/conf.d/wifi_rand_mac.conf b/root/etc/NetworkManager/conf.d/random_mac.conf similarity index 100% rename from root/etc/NetworkManager/conf.d/wifi_rand_mac.conf rename to root/etc/NetworkManager/conf.d/random_mac.conf From dde573064735a94298105d359af921f4741d911f Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Wed, 14 Jul 2021 14:28:31 +0200 Subject: [PATCH 5/7] Update resolv file --- root/etc/resolv.conf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/root/etc/resolv.conf b/root/etc/resolv.conf index d27efc2..c2791fa 100644 --- a/root/etc/resolv.conf +++ b/root/etc/resolv.conf @@ -2,9 +2,11 @@ # but setting immutable flag to this file fixes that. # This can be done by running chattr +i /etc/resolv.conf -# This configuration will prefer NextDNS, with fallback -# to CloudFlare DNS and its fallback, and finally -# last fallback to the ISP default +# Prefer local pihole server, if aviable +nameserver 192.168.0.10 + +# Fallback on common DNS servers, in this order: +# NextDNS -> CloudFlare DNS -> ISP default DNS nameserver 45.90.30.0 nameserver 1.1.1.1 nameserver 1.0.0.1 From dce8e40e6504eefc25dd8dea2d81f807391fbefc Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Wed, 14 Jul 2021 14:30:35 +0200 Subject: [PATCH 6/7] Use zsh when chrooting --- root/usr/local/bin/arch-chroot | 6 +++--- root/usr/local/bin/gentoo-chroot | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/root/usr/local/bin/arch-chroot b/root/usr/local/bin/arch-chroot index 77accbf..403592d 100755 --- a/root/usr/local/bin/arch-chroot +++ b/root/usr/local/bin/arch-chroot @@ -6,7 +6,7 @@ if [ "$EUID" -ne 0 ]; then fi # Make sure the partition is mounted according to fstab -mount /mnt/arch +mount /mnt/arch 2> /dev/null # Mount necessary directories for chroot to be possible mount --types proc /proc /mnt/arch/proc @@ -15,8 +15,8 @@ mount --make-rslave /mnt/arch/sys mount --rbind /dev /mnt/arch/dev mount --make-rslave /mnt/arch/dev -# Chroot with bash shell -chroot /mnt/arch /bin/bash +# Chroot with zsh shell +chroot /mnt/arch /bin/zsh --login # Unmount recursively mounted directories umount -l /mnt/arch/dev{/shm,/pts,} diff --git a/root/usr/local/bin/gentoo-chroot b/root/usr/local/bin/gentoo-chroot index fa903f6..3d301f9 100755 --- a/root/usr/local/bin/gentoo-chroot +++ b/root/usr/local/bin/gentoo-chroot @@ -10,8 +10,8 @@ mount --make-rslave /mnt/gentoo/sys mount --rbind /dev /mnt/gentoo/dev mount --make-rslave /mnt/gentoo/dev -# Chroot with bash shell -chroot /mnt/gentoo /bin/bash +# Chroot with zsh shell +chroot /mnt/gentoo /bin/zsh --login # Unmount recursively mounted directories umount -l /mnt/gentoo/dev{/shm,/pts,} From c4f7f8744a848ca7869833c2b3bfb19e48e10373 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Wed, 14 Jul 2021 14:32:09 +0200 Subject: [PATCH 7/7] Add xmonad xsession file --- root/usr/share/xsessions/xmonad.desktop | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 root/usr/share/xsessions/xmonad.desktop diff --git a/root/usr/share/xsessions/xmonad.desktop b/root/usr/share/xsessions/xmonad.desktop new file mode 100644 index 0000000..0198fb1 --- /dev/null +++ b/root/usr/share/xsessions/xmonad.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Application +Encoding=UTF-8 +Name=xmonad +Comment=A lightweight window manager +Exec=/etc/X11/Sessions/xmonad +TryExec=xmonad +Icon= +X-GNOME-WMName=Xmonad +X-GNOME-Autostart-Phase=WindowManager +X-GNOME-Provides=windowmanager +X-GNOME-Autostart-Notify=false