Improve config structure and update script
This commit is contained in:
404
home.nix
404
home.nix
@@ -31,8 +31,6 @@
|
|||||||
gnome.geary # Email Client [GNOME Online Accounts]
|
gnome.geary # Email Client [GNOME Online Accounts]
|
||||||
bottles # Windows Compatibility Layer
|
bottles # Windows Compatibility Layer
|
||||||
|
|
||||||
# Note: Game packages like Steam and Prism should be installed through flatpak, or at system level.
|
|
||||||
|
|
||||||
# CLI Apps
|
# CLI Apps
|
||||||
nextcloud-client # 'ncs' Dependency [Nextcloud]
|
nextcloud-client # 'ncs' Dependency [Nextcloud]
|
||||||
neofetch # System Info
|
neofetch # System Info
|
||||||
@@ -41,8 +39,7 @@
|
|||||||
dconf2nix # Dconf to Nix format.
|
dconf2nix # Dconf to Nix format.
|
||||||
adw-gtk3 # 'gtk2/3' Dependency
|
adw-gtk3 # 'gtk2/3' Dependency
|
||||||
|
|
||||||
# Note to self: This config does not include games/benchmarks. I'm using flatpak for those.
|
# GNOME Extensions
|
||||||
|
|
||||||
gnomeExtensions.vitals
|
gnomeExtensions.vitals
|
||||||
gnomeExtensions.clipboard-indicator
|
gnomeExtensions.clipboard-indicator
|
||||||
|
|
||||||
@@ -91,59 +88,58 @@
|
|||||||
|
|
||||||
(writeShellScriptBin "update" ''
|
(writeShellScriptBin "update" ''
|
||||||
set -x
|
set -x
|
||||||
if [ "$(uname -s)" = "Darwin" ]; then
|
|
||||||
sudo softwareupdate -iaR
|
|
||||||
else
|
|
||||||
if [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then
|
|
||||||
sudo timeshift --create
|
|
||||||
sudo apt update
|
|
||||||
sudo apt upgrade
|
|
||||||
sudo apt dist-upgrade
|
|
||||||
sudo apt autoremove
|
|
||||||
sudo apt autoclean
|
|
||||||
sudo journalctl --vacuum-time=7d
|
|
||||||
elif [ "$(grep -Ei 'arch|manjaro|artix' /etc/*release)" ]; then
|
|
||||||
sudo timeshift --create
|
|
||||||
sudo sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf
|
|
||||||
sudo pacman -Syu
|
|
||||||
sudo pacman -Rsn $(pacman -Qdtq)
|
|
||||||
echo "Selecting the fastest mirrors..."
|
|
||||||
if [ ! "$(command -v reflector)" ]; then
|
|
||||||
sudo pacman -Syu --noconfirm reflector rsync curl
|
|
||||||
fi
|
|
||||||
iso=$(curl -4 ifconfig.co/country-iso)
|
|
||||||
extra="FR"
|
|
||||||
sudo reflector -a 48 -c $iso -c $extra -f 5 -l 30 --verbose --sort rate --save /etc/pacman.d/mirrorlist
|
|
||||||
echo "Cleaning pacman cache..."
|
|
||||||
if [ ! "$(command -v paccache)" ]; then
|
|
||||||
sudo pacman -Syu --noconfirm pacman-contrib
|
|
||||||
fi
|
|
||||||
paccache -rk1
|
|
||||||
echo "Cleaning old logs..."
|
|
||||||
sudo journalctl --vacuum-time=7d
|
|
||||||
elif [ "$(grep -Ei 'fedora' /etc/*release)" ]; then
|
|
||||||
sudo timeshift --create
|
|
||||||
sudo dnf upgrade --refresh
|
|
||||||
sudo dnf autoremove
|
|
||||||
sudo journalctl --vacuum-time=7d
|
|
||||||
else
|
|
||||||
echo "Unknown distro, skipping system update."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if Flatpak is installed
|
|
||||||
if [ "$(command -v flatpak)" ]; then
|
|
||||||
flatpak update
|
|
||||||
flatpak uninstall --unused --delete-data
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
# Update dotfiles
|
||||||
cd ~/dotfiles
|
cd ~/dotfiles
|
||||||
git pull
|
git pull
|
||||||
|
|
||||||
|
# macOS
|
||||||
|
if [ "$(uname -s)" = "Darwin" ]; then
|
||||||
|
sudo softwareupdate -iaR
|
||||||
|
else
|
||||||
|
sudo timeshift --create
|
||||||
|
sudo journalctl --vacuum-time=7d
|
||||||
|
# Flatpak
|
||||||
|
if [ "$(command -v flatpak)" ]; then
|
||||||
|
flatpak update
|
||||||
|
flatpak uninstall --unused --delete-data
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Linux
|
||||||
|
if [ "$(grep -Ei 'debian|buntu|mint' /etc/*release)" ]; then
|
||||||
|
sudo apt update
|
||||||
|
sudo apt upgrade
|
||||||
|
sudo apt dist-upgrade
|
||||||
|
sudo apt autoremove
|
||||||
|
sudo apt autoclean
|
||||||
|
elif [ "$(grep -Ei 'arch|manjaro|artix' /etc/*release)" ]; then
|
||||||
|
sudo sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf
|
||||||
|
sudo pacman -Syu
|
||||||
|
sudo pacman -Rsn $(pacman -Qdtq)
|
||||||
|
if [ ! "$(command -v reflector)" ]; then
|
||||||
|
sudo pacman -Sy --noconfirm reflector rsync curl
|
||||||
|
fi
|
||||||
|
iso=$(curl -4 ifconfig.co/country-iso)
|
||||||
|
extra="FR"
|
||||||
|
sudo reflector -a 48 -c $iso -c $extra -f 5 -l 30 --verbose --sort rate --save /etc/pacman.d/mirrorlist
|
||||||
|
if [ ! "$(command -v paccache)" ]; then
|
||||||
|
sudo pacman -Sy --noconfirm pacman-contrib
|
||||||
|
fi
|
||||||
|
paccache -rk1
|
||||||
|
elif [ "$(grep -Ei 'fedora' /etc/*release)" ]; then
|
||||||
|
sudo dnf upgrade --refresh
|
||||||
|
sudo dnf autoremove
|
||||||
|
else
|
||||||
|
echo "Unknown distro, skipping system update."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Nix
|
||||||
nix-channel --update
|
nix-channel --update
|
||||||
sudo nix-channel --update
|
sudo nix-channel --update
|
||||||
nix-collect-garbage --delete-older-than 7d
|
nix-collect-garbage --delete-older-than 7d
|
||||||
home-manager switch
|
home-manager switch
|
||||||
|
|
||||||
{ set +x; } 2>/dev/null
|
{ set +x; } 2>/dev/null
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
@@ -168,6 +164,163 @@
|
|||||||
PS1 = ''\n[\[\e[37m\]\u\[\e[0m\]@\[\e[37;2m\]\h\[\e[0m\]] \[\e[1m\]\w \[\e[0;2m\]J:\[\e[0m\]\j\n\$ '';
|
PS1 = ''\n[\[\e[37m\]\u\[\e[0m\]@\[\e[37;2m\]\h\[\e[0m\]] \[\e[1m\]\w \[\e[0;2m\]J:\[\e[0m\]\j\n\$ '';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# =======================================================================
|
||||||
|
# -------------------- DESKTOP (GNOME - DCONF) --------------------------
|
||||||
|
# =======================================================================
|
||||||
|
|
||||||
|
gtk = {
|
||||||
|
enable = true;
|
||||||
|
cursorTheme = {
|
||||||
|
name = "Bibata-Modern-Classic";
|
||||||
|
package = pkgs.bibata-cursors;
|
||||||
|
size = 22;
|
||||||
|
};
|
||||||
|
|
||||||
|
iconTheme = {
|
||||||
|
name = "Papirus";
|
||||||
|
package = pkgs.papirus-icon-theme;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
dconf.settings = {
|
||||||
|
# GNOME settings
|
||||||
|
# Use `dconf watch /` to track stateful changes you are doing, then set them here.
|
||||||
|
"org/gnome/shell" = {
|
||||||
|
disable-user-extensions = false;
|
||||||
|
disable-extension-version-validation = false;
|
||||||
|
|
||||||
|
# `gnome-extensions list` for a list
|
||||||
|
enabled-extensions = [
|
||||||
|
"Vitals@CoreCoding.com"
|
||||||
|
"clipboard-indicator@tudmotu.com"
|
||||||
|
# Add new extensions to the packages too! This section only enables extensions, not install them.
|
||||||
|
];
|
||||||
|
|
||||||
|
favorite-apps = [
|
||||||
|
"org.gnome.Epiphany.desktop"
|
||||||
|
"firefox.desktop"
|
||||||
|
"org.gnome.Nautilus.desktop"
|
||||||
|
"obsidian.desktop"
|
||||||
|
"codium.desktop"
|
||||||
|
"org.gnome.Console.desktop"
|
||||||
|
"io.gitlab.news_flash.NewsFlash.desktop"
|
||||||
|
"org.gnome.Podcasts.desktop"
|
||||||
|
"org.gnome.World.Secrets.desktop"
|
||||||
|
"org.gnome.Geary.desktop"
|
||||||
|
"signal-desktop.desktop"
|
||||||
|
"element-desktop.desktop"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
"org/gnome/mutter" = {
|
||||||
|
draggable-border-width = 20;
|
||||||
|
};
|
||||||
|
|
||||||
|
"org/gnome/settings-daemon/plugins/color" = {
|
||||||
|
night-light-enabled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
"org/gnome/nautilus" = {
|
||||||
|
"icon-view/default-zoom-level" = "small";
|
||||||
|
};
|
||||||
|
|
||||||
|
"org/gnome/Console" = {
|
||||||
|
theme = "auto";
|
||||||
|
audible-bell = false;
|
||||||
|
use-system-font = false;
|
||||||
|
custom-font = "JetBrainsMono Nerd Font 10";
|
||||||
|
};
|
||||||
|
|
||||||
|
"org/gnome/desktop/background" = {
|
||||||
|
picture-uri = "file:///${config.home.homeDirectory}/dotfiles/wallpapers/blobs-l.svg";
|
||||||
|
picture-uri-dark = "file:///${config.home.homeDirectory}/dotfiles/wallpapers/blobs-d.svg";
|
||||||
|
};
|
||||||
|
|
||||||
|
"org/gnome/desktop/wm/preferences" = {
|
||||||
|
button-layout = ":minimize,maximize,close";
|
||||||
|
};
|
||||||
|
|
||||||
|
"org/gnome/desktop/interface" = {
|
||||||
|
show-battery-percentage = true;
|
||||||
|
#font-name = "";
|
||||||
|
monospace-font-name = "JetBrainsMono Nerd Font Mono 10";
|
||||||
|
#document-font-name = "";
|
||||||
|
color-scheme = "prefer-dark";
|
||||||
|
enable-hot-corners = false;
|
||||||
|
cursor-theme = "Bibata-Modern-Classic";
|
||||||
|
icon-theme = "Papirus";
|
||||||
|
gtk-theme = "adw-gtk3-dark";
|
||||||
|
};
|
||||||
|
|
||||||
|
"org/gnome/epiphany/web" = {
|
||||||
|
enable-adblock = true;
|
||||||
|
enable-popups = false;
|
||||||
|
ask-on-download = true;
|
||||||
|
enable-spell-checking = true;
|
||||||
|
show-developer-actions = true;
|
||||||
|
enable-itp = true;
|
||||||
|
enable-website-data-storage = true;
|
||||||
|
remember-passwords = false;
|
||||||
|
use-gnome-fonts = false;
|
||||||
|
monospace-font = "JetBrainsMono Nerd Font Mono 12";
|
||||||
|
};
|
||||||
|
|
||||||
|
"org/gnome/epiphany" = { # GNOME Web
|
||||||
|
homepage-url = "about:newtab";
|
||||||
|
start-in-incognito-mode = false;
|
||||||
|
restore-session-policy = "always";
|
||||||
|
use-google-search-suggestions = false;
|
||||||
|
default-search-engine = "StartPage";
|
||||||
|
|
||||||
|
search-engine-providers = with lib.hm.gvariant; [
|
||||||
|
[
|
||||||
|
(mkDictionaryEntry["url" (mkVariant "https://duckduckgo.com/?q=%s&t=epiphany")])
|
||||||
|
(mkDictionaryEntry["bang" (mkVariant "!d")])
|
||||||
|
(mkDictionaryEntry["name" (mkVariant "DuckDuckGo")])
|
||||||
|
]
|
||||||
|
[
|
||||||
|
(mkDictionaryEntry["url" (mkVariant "https://www.google.com/search?q=%s")])
|
||||||
|
(mkDictionaryEntry["bang" (mkVariant "!g")])
|
||||||
|
(mkDictionaryEntry["name" (mkVariant "Google")])
|
||||||
|
]
|
||||||
|
[
|
||||||
|
(mkDictionaryEntry["url" (mkVariant "https://search.nixos.org/packages?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=%s")])
|
||||||
|
(mkDictionaryEntry["bang" (mkVariant "!np")])
|
||||||
|
(mkDictionaryEntry["name" (mkVariant "Nix Packages")])
|
||||||
|
]
|
||||||
|
[
|
||||||
|
(mkDictionaryEntry["url" (mkVariant "https://www.startpage.com/search?q=%s")])
|
||||||
|
(mkDictionaryEntry["bang" (mkVariant "!s")])
|
||||||
|
(mkDictionaryEntry["name" (mkVariant "StartPage")])
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
content-filters = [
|
||||||
|
"https://easylist-downloads.adblockplus.org/easylist_min_content_blocker.json"
|
||||||
|
"https://better.fyi/blockerList.json"
|
||||||
|
"https://github.com/AdguardTeam/BlockYouTubeAdsShortcut/blob/master/index.js"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
"org/gnome/Geary" = {
|
||||||
|
compose-as-html = true;
|
||||||
|
formatting-toolbar-visible = true;
|
||||||
|
migrated-config = true;
|
||||||
|
optional-plugins = [];
|
||||||
|
run-in-background = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
"org/gnome/shell/extensions/vitals" = {
|
||||||
|
hot-sensors = [
|
||||||
|
"_memory_usage_"
|
||||||
|
"__temperature_max__"
|
||||||
|
"_processor_usage_"
|
||||||
|
];
|
||||||
|
fixed-widths = false;
|
||||||
|
update-time = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# =======================================================================
|
# =======================================================================
|
||||||
# ----------------------- PROGRAM CONFIGURATION -------------------------
|
# ----------------------- PROGRAM CONFIGURATION -------------------------
|
||||||
# =======================================================================
|
# =======================================================================
|
||||||
@@ -321,159 +474,6 @@
|
|||||||
extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep ];
|
extraPackages = with pkgs.bat-extras; [ batdiff batman batgrep ];
|
||||||
};
|
};
|
||||||
|
|
||||||
gtk = {
|
|
||||||
enable = true;
|
|
||||||
cursorTheme = {
|
|
||||||
name = "Bibata-Modern-Classic";
|
|
||||||
package = pkgs.bibata-cursors;
|
|
||||||
size = 22;
|
|
||||||
};
|
|
||||||
|
|
||||||
iconTheme = {
|
|
||||||
name = "Papirus";
|
|
||||||
package = pkgs.papirus-icon-theme;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
dconf.settings = {
|
|
||||||
# GNOME settings
|
|
||||||
# Use `dconf watch /` to track stateful changes you are doing, then set them here.
|
|
||||||
"org/gnome/shell" = {
|
|
||||||
disable-user-extensions = false;
|
|
||||||
disable-extension-version-validation = false;
|
|
||||||
|
|
||||||
# `gnome-extensions list` for a list
|
|
||||||
enabled-extensions = [
|
|
||||||
"Vitals@CoreCoding.com"
|
|
||||||
"clipboard-indicator@tudmotu.com"
|
|
||||||
# Add new extensions to the packages too! This section only enables extensions, not install them.
|
|
||||||
];
|
|
||||||
|
|
||||||
favorite-apps = [
|
|
||||||
"org.gnome.Epiphany.desktop"
|
|
||||||
"firefox.desktop"
|
|
||||||
"org.gnome.Nautilus.desktop"
|
|
||||||
"obsidian.desktop"
|
|
||||||
"codium.desktop"
|
|
||||||
"org.gnome.Console.desktop"
|
|
||||||
"io.gitlab.news_flash.NewsFlash.desktop"
|
|
||||||
"org.gnome.Podcasts.desktop"
|
|
||||||
"org.gnome.World.Secrets.desktop"
|
|
||||||
"org.gnome.Geary.desktop"
|
|
||||||
"signal-desktop.desktop"
|
|
||||||
"element-desktop.desktop"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
"org/gnome/mutter" = {
|
|
||||||
draggable-border-width = 20;
|
|
||||||
};
|
|
||||||
|
|
||||||
"org/gnome/settings-daemon/plugins/color" = {
|
|
||||||
night-light-enabled = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
"org/gnome/nautilus" = {
|
|
||||||
"icon-view/default-zoom-level" = "small";
|
|
||||||
};
|
|
||||||
|
|
||||||
"org/gnome/Console" = {
|
|
||||||
theme = "auto";
|
|
||||||
audible-bell = false;
|
|
||||||
use-system-font = false;
|
|
||||||
custom-font = "JetBrainsMono Nerd Font 10";
|
|
||||||
};
|
|
||||||
|
|
||||||
"org/gnome/desktop/background" = {
|
|
||||||
picture-uri = "file:///${config.home.homeDirectory}/dotfiles/wallpapers/blobs-l.svg";
|
|
||||||
picture-uri-dark = "file:///${config.home.homeDirectory}/dotfiles/wallpapers/blobs-d.svg";
|
|
||||||
};
|
|
||||||
|
|
||||||
"org/gnome/desktop/wm/preferences" = {
|
|
||||||
button-layout = ":minimize,maximize,close";
|
|
||||||
};
|
|
||||||
|
|
||||||
"org/gnome/desktop/interface" = {
|
|
||||||
show-battery-percentage = true;
|
|
||||||
#font-name = "";
|
|
||||||
monospace-font-name = "JetBrainsMono Nerd Font Mono 10";
|
|
||||||
#document-font-name = "";
|
|
||||||
color-scheme = "prefer-dark";
|
|
||||||
enable-hot-corners = false;
|
|
||||||
cursor-theme = "Bibata-Modern-Classic";
|
|
||||||
icon-theme = "Papirus";
|
|
||||||
gtk-theme = "adw-gtk3-dark";
|
|
||||||
};
|
|
||||||
|
|
||||||
"org/gnome/epiphany/web" = {
|
|
||||||
enable-adblock = true;
|
|
||||||
enable-popups = false;
|
|
||||||
ask-on-download = true;
|
|
||||||
enable-spell-checking = true;
|
|
||||||
show-developer-actions = true;
|
|
||||||
enable-itp = true;
|
|
||||||
enable-website-data-storage = true;
|
|
||||||
remember-passwords = false;
|
|
||||||
use-gnome-fonts = false;
|
|
||||||
monospace-font = "JetBrainsMono Nerd Font Mono 12";
|
|
||||||
};
|
|
||||||
|
|
||||||
"org/gnome/epiphany" = { # GNOME Web
|
|
||||||
homepage-url = "about:newtab";
|
|
||||||
start-in-incognito-mode = false;
|
|
||||||
restore-session-policy = "always";
|
|
||||||
use-google-search-suggestions = false;
|
|
||||||
default-search-engine = "StartPage";
|
|
||||||
|
|
||||||
search-engine-providers = with lib.hm.gvariant; [
|
|
||||||
[
|
|
||||||
(mkDictionaryEntry["url" (mkVariant "https://duckduckgo.com/?q=%s&t=epiphany")])
|
|
||||||
(mkDictionaryEntry["bang" (mkVariant "!d")])
|
|
||||||
(mkDictionaryEntry["name" (mkVariant "DuckDuckGo")])
|
|
||||||
]
|
|
||||||
[
|
|
||||||
(mkDictionaryEntry["url" (mkVariant "https://www.google.com/search?q=%s")])
|
|
||||||
(mkDictionaryEntry["bang" (mkVariant "!g")])
|
|
||||||
(mkDictionaryEntry["name" (mkVariant "Google")])
|
|
||||||
]
|
|
||||||
[
|
|
||||||
(mkDictionaryEntry["url" (mkVariant "https://search.nixos.org/packages?channel=23.11&from=0&size=50&sort=relevance&type=packages&query=%s")])
|
|
||||||
(mkDictionaryEntry["bang" (mkVariant "!np")])
|
|
||||||
(mkDictionaryEntry["name" (mkVariant "Nix Packages")])
|
|
||||||
]
|
|
||||||
[
|
|
||||||
(mkDictionaryEntry["url" (mkVariant "https://www.startpage.com/search?q=%s")])
|
|
||||||
(mkDictionaryEntry["bang" (mkVariant "!s")])
|
|
||||||
(mkDictionaryEntry["name" (mkVariant "StartPage")])
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
content-filters = [
|
|
||||||
"https://easylist-downloads.adblockplus.org/easylist_min_content_blocker.json"
|
|
||||||
"https://better.fyi/blockerList.json"
|
|
||||||
"https://github.com/AdguardTeam/BlockYouTubeAdsShortcut/blob/master/index.js"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
"org/gnome/Geary" = {
|
|
||||||
compose-as-html = true;
|
|
||||||
formatting-toolbar-visible = true;
|
|
||||||
migrated-config = true;
|
|
||||||
optional-plugins = [];
|
|
||||||
run-in-background = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
"org/gnome/shell/extensions/vitals" = {
|
|
||||||
hot-sensors = [
|
|
||||||
"_memory_usage_"
|
|
||||||
"__temperature_max__"
|
|
||||||
"_processor_usage_"
|
|
||||||
];
|
|
||||||
fixed-widths = false;
|
|
||||||
update-time = 1;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
userName = "TrudeEH";
|
userName = "TrudeEH";
|
||||||
|
|||||||
Reference in New Issue
Block a user