refactor: update dotfiles paths and remove obsolete configurations
Some checks failed
Nix Format Check / check-format (push) Failing after 40s

This commit is contained in:
2025-03-05 17:26:48 +01:00
parent 498b28fac0
commit 2ce4cfb608
51 changed files with 255 additions and 1406 deletions

View File

@ -23,11 +23,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1740932899,
"narHash": "sha256-F0qDu2egq18M3edJwEOAE+D+VQ+yESK6YWPRQBfOqq8=",
"lastModified": 1741048562,
"narHash": "sha256-W4YZ3fvWZiFYYyd900kh8P8wU6DHSiwaH0j4+fai1Sk=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "1546c45c538633ae40b93e2d14e0bb6fd8f13347",
"rev": "6af28b834daca767a7ef99f8a7defa957d0ade6f",
"type": "github"
},
"original": {

View File

@ -1,6 +1,10 @@
{ config, pkgs, ... }:
let
dotfilesPath = builtins.getEnv "DOTFILES_PATH";
in
{
home.file.".bashrc.extra".source = "${config.home.homeDirectory}/dotfiles/.bashrc";
home.file.".bashrc.extra".source = "${dotfilesPath}/.bashrc";
programs.bash = {
enable = true;

View File

@ -1,108 +0,0 @@
#!/usr/bin/env bash
BRAVE_DIR="$HOME/.config/BraveSoftware/Brave-Browser/Default"
MAX_ATTEMPTS=30 # Maximum number of seconds to wait
# Function to check if database is locked
is_db_locked() {
local db_file="$1"
if lsof "$db_file" >/dev/null 2>&1; then
return 0 # true, db is locked
else
return 1 # false, db is not locked
fi
}
# Check if profile exists
if [ ! -d "$BRAVE_DIR" ]; then
echo "Brave profile directory doesn't exist. Please run Brave at least once."
exit 1
fi
# Check if Web Data exists
if [ ! -f "$BRAVE_DIR/Web Data" ]; then
echo "Web Data file doesn't exist. Please run Brave at least once."
exit 1
fi
# Wait for database to be unlocked
attempts=0
while is_db_locked "$BRAVE_DIR/Web Data" && [ $attempts -lt $MAX_ATTEMPTS ]; do
echo "Database is locked. Waiting... ($attempts/$MAX_ATTEMPTS)"
sleep 1
attempts=$((attempts + 1))
done
if is_db_locked "$BRAVE_DIR/Web Data"; then
echo "Database is still locked after $MAX_ATTEMPTS seconds. Please ensure Brave is completely closed and try again."
exit 1
fi
echo "Setting up search engines..."
# Create temporary file for SQL commands
SQLCOMMANDS=$(mktemp)
cat > $SQLCOMMANDS << 'ENDSQL'
DELETE FROM keywords WHERE keyword NOT IN ('@bookmarks', '@history');
INSERT INTO keywords (
short_name, keyword, favicon_url, url, safe_for_autoreplace,
date_created, usage_count, input_encodings, suggest_url, prepopulate_id,
sync_guid, alternate_urls, last_visited, is_active
) VALUES
(
'Brave', ':br',
'https://cdn.search.brave.com/serp/v2/_app/immutable/assets/favicon.acxxetWH.ico',
'https://search.brave.com/search?q={searchTerms}&source=desktop',
1, 0, 0, 'UTF-8',
'https://search.brave.com/api/suggest?q={searchTerms}&rich=true&source=desktop',
550, '485bf7d3-0215-45af-87dc-538868000550', '[]', 0, 0
),
(
'Google', ':gg',
'https://www.google.com/images/branding/product/ico/googleg_alldp.ico',
'{google:baseURL}search?q={searchTerms}&{google:RLZ}{google:originalQueryForSuggestion}{google:assistedQueryStats}{google:searchFieldtrialParameter}{google:language}{google:prefetchSource}{google:searchClient}{google:sourceId}{google:contextualSearchVersion}ie={inputEncoding}',
1, 0, 0, 'UTF-8',
'{google:baseSuggestURL}search?{google:searchFieldtrialParameter}client={google:suggestClient}&gs_ri={google:suggestRid}&xssi=t&q={searchTerms}&{google:inputType}{google:omniboxFocusType}{google:cursorPosition}{google:currentPageUrl}{google:pageClassification}{google:clientCacheTimeToLive}{google:searchVersion}{google:sessionToken}{google:prefetchQuery}sugkey={google:suggestAPIKeyParameter}',
1, '485bf7d3-0215-45af-87dc-538868000001', '[]', 0, 0
),
(
'DuckDuckGo', ':dd',
'https://duckduckgo.com/favicon.ico',
'https://duckduckgo.com/?q={searchTerms}&t=brave',
1, 0, 0, 'UTF-8',
'https://ac.duckduckgo.com/ac/?q={searchTerms}&type=list',
501, '485bf7d3-0215-45af-87dc-538868000501', '[]', 0, 0
),
(
'NixOS', ':nix',
'https://search.nixos.org/favicon.png',
'https://search.nixos.org/packages?query={searchTerms}',
1, 0, 0, '',
'',
0, '485bf7d3-0215-45af-87dc-538868000552', '[]', 0, 1
),
(
'GoLink', ':go',
'http://go/favicon.ico',
'http://go/{searchTerms}',
1, 0, 0, '',
'',
0, '485bf7d3-0215-45af-87dc-538868000551', '[]', 0, 1
);
ENDSQL
# Execute SQL commands
sqlite3 "$BRAVE_DIR/Web Data" < $SQLCOMMANDS
# Cleanup
rm $SQLCOMMANDS
echo "Search engines setup completed successfully!"
# Restart Brave if it was running before
if [ "$BRAVE_WAS_RUNNING" = "1" ]; then
echo "Restarting Brave..."
brave &> /dev/null &
fi

View File

@ -1,20 +0,0 @@
{
lib,
config,
pkgs,
...
}:
{
# Copy search engine configuration script
home.file.".local/bin/brave-search-engines.sh" = {
source = ./brave-search-engines.sh;
executable = true;
};
# Run search engine configuration script
home.activation = {
setBraveSearchEngines = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
PATH="${pkgs.procps}/bin:${pkgs.sqlite}/bin:$PATH" $HOME/.local/bin/brave-search-engines.sh
'';
};
}

View File

@ -3,7 +3,6 @@
let
files = builtins.removeAttrs (builtins.readDir ./.) [
"default.nix"
"brave-search-engines.sh"
"ulauncher.nix" # Disabled, since we switched to ansible for this
];

View File

@ -23,7 +23,6 @@
gpredict # Satellite tracking
## Chat Apps
betterdiscordctl
vesktop
## Multimedia

View File

@ -5,15 +5,15 @@
enable = true;
iconTheme = {
name = "Adwaita";
name = "Yaru";
};
theme = {
name = "Adwaita";
name = "Yaru";
};
cursorTheme = {
name = "Adwaita";
name = "Yaru";
};
gtk3.extraConfig = {
@ -51,7 +51,7 @@
# add more by listing them with `dconf read /org/gnome/shell/favorite-apps | sed "s/,//g; s/'/\"/g"` then copy pasting the output here
"org/gnome/shell" = {
favorite-apps = [
"ZenBrowser.desktop"
"zen.desktop"
"org.gnome.Nautilus.desktop"
"com.spotify.Client.desktop"
"vesktop.desktop"

View File

@ -4,11 +4,11 @@
xdg.mimeApps = {
enable = true;
defaultApplications = {
# Brave Browser
"application/xhtml+xml" = [ "ZenBrowser.desktop" ];
"text/html" = [ "ZenBrowser.desktop" ];
"x-scheme-handler/http" = [ "ZenBrowser.desktop" ];
"x-scheme-handler/https" = [ "ZenBrowser.desktop" ];
# default browser
"application/xhtml+xml" = [ "zen.desktop" ];
"text/html" = [ "zen.desktop" ];
"x-scheme-handler/http" = [ "zen.desktop" ];
"x-scheme-handler/https" = [ "zen.desktop" ];
# Geary
"x-scheme-handler/mailto" = [ "org.gnome.Geary.desktop" ];