feat(guz-lite,guz,browser): use/try qutebrowser again

This commit is contained in:
Guz
2026-03-12 15:34:08 -03:00
parent 352e776b1e
commit d2e37a0e36
24 changed files with 809 additions and 472 deletions

View File

@@ -72,11 +72,19 @@
# Networking
networking = {
networkmanager.enable = true;
nameservers = ["192.168.0.1" "9.9.9.9"];
nameservers = [
/*
"192.168.0.1"
*/
"8.8.8.8"
# "1.1.1.1"
# "9.9.9.9"
];
};
# Firewall
networking.firewall.enable = true;
networking.firewall.allowedUDPPorts = [53];
networking.firewall.allowedTCPPorts = [80 433];
# SSH

View File

@@ -13,6 +13,12 @@
inputs.nixpkgs.follows = "nixpkgs";
};
impermanence = {
url = "github:nix-community/impermanence";
inputs.nixpkgs.follows = "";
inputs.home-manager.follows = "";
};
stylix = {
url = "github:danth/stylix/release-25.11";
inputs.nixpkgs.follows = "nixpkgs";
@@ -47,7 +53,8 @@
};
neovim = {
url = "git+https://forge.capytal.company/dot013/nvim";
# url = "git+https://code.capytal.cc/dot013/nvim";
url = "git+file:///home/guz/.projects/dot013-nvim";
};
rec-sh = {
@@ -55,17 +62,34 @@
inputs.nixpkgs.follows = "nixpkgs";
};
inputs.nixpkgs.follows = "nixpkgs";
};
# affinity = {
# url = "github:mrshmllow/affinity-nix";
# inputs.nixpkgs.follows = "nixpkgs";
# };
zen-browser = {
url = "github:0xc000022070/zen-browser-flake?tag=1.16t-1759964276";
url = "github:0xc000022070/zen-browser-flake";
# url = "git+file:///home/guz/.projects/dot013-zen-browser-flake";
inputs.nixpkgs.follows = "nixpkgs-unstable";
inputs.home-manager.follows = "home-manager";
};
# hyprland.url = "github:hyprwm/Hyprland";
nixpkgs-2505.url = "github:nixos/nixpkgs/nixos-25.05";
disko-2505 = {
url = "github:nix-community/disko/v1.12.0";
inputs.nixpkgs.follows = "nixpkgs-2505";
};
home-manager-2505 = {
url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs-2505";
};
stylix-2505 = {
url = "github:danth/stylix/release-25.05";
inputs.nixpkgs.follows = "nixpkgs-2505";
inputs.home-manager.follows = "home-manager-2505";
};
};
outputs = {
@@ -140,7 +164,27 @@
./home/guz-lite/configuration.nix
];
};
"rusty" = nixpkgs.lib.nixosSystem rec {
"rusty" = inputs.nixpkgs-2505.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = {
pkgs-unstable = import nixpkgs-unstable {
inherit system;
config.allowUnfreePredicate = _: true;
};
inherit inputs self;
};
modules =
[
inputs.home-manager-2505.nixosModules.home-manager
./style.nix
]
++ [
inputs.stylix-2505.nixosModules.stylix
./modules/nixos/context.nix
./hosts/rusty/configuration.nix
];
};
"virus" = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = {
pkgs-unstable = import nixpkgs-unstable {
@@ -150,8 +194,7 @@
inherit inputs self;
};
modules = [
./modules/nixos/context.nix
./hosts/rusty/configuration.nix
./hosts/virus/configuration.nix
];
};
};
@@ -195,6 +238,7 @@
devkit = {
lib,
pkgs,
stdenv,
...
}: let
devkitPkgs = self.packages.${pkgs.system}.devkit;
@@ -235,6 +279,7 @@
...
}: {
davincify = pkgs.callPackage ./packages/davincify {};
dotstate = pkgs.callPackage ./packages/dotstate {};
untrack = pkgs.callPackage ./packages/untrack {};
audacity4 = pkgs.callPackage ./packages/audacity4 {};

View File

@@ -7,7 +7,6 @@
imports = [
inputs.nix-flatpak.homeManagerModules.nix-flatpak
inputs.rec-sh.homeManagerModules.rec-sh
./browser.nix
];
programs.rec-sh.enable = true;

View File

@@ -1,347 +0,0 @@
{
config,
lib,
osConfig,
pkgs,
self,
...
}: {
imports = [
self.homeManagerModules.zen-browser
];
xdg.mimeApps.defaultApplications = with lib;
listToAttrs (map (name: {
inherit name;
value = config.programs.zen-browser.package.meta.desktopFileName;
}) [
"application/x-extension-shtml"
"application/x-extension-xhtml"
"application/x-extension-html"
"application/x-extension-xht"
"application/x-extension-htm"
"x-scheme-handler/unknown"
"x-scheme-handler/mailto"
"x-scheme-handler/chrome"
"x-scheme-handler/about"
"x-scheme-handler/https"
"x-scheme-handler/http"
"application/xhtml+xml"
"application/json"
"text/plain"
"text/html"
]);
programs.zen-browser = let
locked = v: {
Value = v;
Status = "locked";
};
settings = {
"beacon.enabled" = locked false;
"browser.startup.page" = locked 3;
"device.sensors.enabled" = locked false;
"dom.battery.enabled" = locked false;
"dom.event.clipboardevents.enabled" = locked false;
"geo.enabled" = locked false;
"media.peerconnection.enabled" = locked false;
"privacy.clearHistory.cookiesAndStorage" = locked false;
"privacy.clearHistory.siteSettings" = locked false;
"privacy.firstparty.isolate" = locked true;
"privacy.resistFingerprinting" = locked true;
"privacy.trackingprotection.enabled" = locked true;
"privacy.trackingprotection.socialtracking.enabled" = locked true;
"webgl.disabled" = true;
"zen.view.use-single-toolbar" = false;
};
in {
enable = true;
profiles."default" = {
containersForce = true;
containers = {
Personal = {
color = "purple";
icon = "fingerprint";
id = 1;
};
Work = {
color = "blue";
icon = "briefcase";
id = 2;
};
Shopping = {
color = "yellow";
icon = "cart";
id = 4;
};
Goverment = {
color = "orange";
icon = "dollar";
id = 5;
};
};
extensions.force = true;
extensions.settings = {
"tridactyl.vim@cmcaine.co.uk".settings = {
userconfig = {
configVersion = "2.0";
nmaps = {
"K" = "tabprev";
"J" = "tabnext";
};
theme = "midnight";
searchurls = with lib;
mapAttrs' (n: v:
nameValuePair
(
if v?definedAliases
then elemAt v.definedAliases 0
else n
)
(replaceString "{searchTerms}" "" (elemAt v.urls 0).template))
config.programs.zen-browser.profiles."default".search.engines;
};
};
"uBlock0@raymondhill.net".settings = {
selectedFilterLists = [
"user-filters"
"ublock-filters"
"ublock-badware"
"ublock-privacy"
"ublock-unbreak"
"ublock-quick-fixes"
"easylist"
"easyprivacy"
"urlhaus-1"
"plowe-0"
];
dynamicFilteringString = ''
behind-the-scene * * noop
behind-the-scene * inline-script noop
behind-the-scene * 1p-script noop
behind-the-scene * 3p-script noop
behind-the-scene * 3p-frame noop
behind-the-scene * image noop
behind-the-scene * 3p noop
* * 3p-script block
* * 3p-frame block
capytal.cc * * noop
capytal.company * * noop
guz.one * * noop
keikos.work * * noop
lored.dev * * noop
home-manager-options.extranix.com extranix.com * noop
home-manager-options.extranix.com home-manager-options.extranix.com * noop
'';
};
"{ef87d84c-2127-493f-b952-5b4e744245bc}".settings = {
baseUrl = "http://127.0.0.1:5600";
consentRequired = true;
consent = true;
hostname = osConfig.networking.hostName;
enabled = true;
browserName = "zen";
};
"7esoorv3@alefvanoon.anonaddy.me".settings = with builtins; fromJSON (readFile ./libredirect.json);
};
search.default = "brave";
search.force = true;
search.engines = {
brave = {
name = "Brave";
urls = [{template = "https://search.brave.com/search?q={searchTerms}";}];
};
go = {
name = "Go Packages";
urls = [{template = "https://pkg.go.dev/search?q={searchTerms}";}];
icon = pkgs.fetchurl {
url = "https://pkg.go.dev/static/shared/logo/go-white.svg";
hash = "sha256-oqFYZnPAxESEpY0Qcz5OPiCMTWXyI1nqOEYmsdbGqy4=";
};
definedAliases = ["@go"];
};
mdn = {
name = "MDN";
urls = [{template = "https://developer.mozilla.org/en-US/search?q={searchTerms}";}];
icon = pkgs.fetchurl {
url = "https://developer.mozilla.org/static/client/mdn-m.70aac857e4a908d0.svg";
hash = "sha256-sTAKxjk5b8lUaa9057LOH0H3N54LeXkPF/mOe4gpHDI=";
};
definedAliases = ["@mdn"];
};
nix-home-manager = {
name = "Home Manager";
urls = [{template = "https://home-manager-options.extranix.com/?query={searchTerms}";}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@hm"];
};
nix-noodle = {
name = "Noodle";
urls = [{template = "https://noogle.dev/q?term={searchTerms}";}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@lib"];
};
nix-options = {
name = "Nix Options";
urls = [{template = "https://search.nixos.org/options?query={searchTerms}";}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@opt"];
};
nix-packages = {
name = "Nix Packages";
urls = [{template = "https://search.nixos.org/packages?query={searchTerms}";}];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@pkg"];
};
nix-wiki = {
name = "Nix Wiki";
urls = [
{template = "https://wiki.nixos.org/w/index.php?search={searchTerms}";}
{template = "https://nixos.wiki/index.php?search={searchTerms}";}
];
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
definedAliases = ["@wiki"];
};
};
settings = with builtins;
mapAttrs (n: v:
if isAttrs v
then v.Value
else v)
settings;
shortcuts = {
"key_search" = {key = "";};
"key_search2" = {key = "";};
"zen-workspace-forward" = {
key = "j";
modifiers = {
control = true;
};
action = "cmd_zenWorkspaceForward";
};
"zen-workspace-backward" = {
key = "k";
modifiers = {
control = true;
};
action = "cmd_zenWorkspaceBackward";
};
};
spacesForce = true;
spaces = let
containers = config.programs.zen-browser.profiles."default".containers;
in {
"Space" = {
id = "c6de089c-410d-4206-961d-ab11f988d40a";
position = 1000;
};
"Work" = {
id = "cdd10fab-4fc5-494b-9041-325e5759195b";
icon = "chrome://browser/skin/zen-icons/selectable/star-1.svg";
container = containers."Work".id;
position = 2000;
};
"Shopping" = {
id = "78aabdad-8aae-4fe0-8ff0-2a0c6c4ccc24";
icon = "chrome://browser/skin/zen-icons/selectable/basket.svg";
container = containers."Shopping".id;
position = 5000;
};
"Goverment" = {
id = "7e83e835-caef-4b94-be0c-b6b3959d0830";
icon = "chrome://browser/skin/zen-icons/selectable/folder.svg";
container = containers."Goverment".id;
position = 6000;
};
};
};
policies = {
AutofillAdressEnabled = true;
AutofillCreditCardEnabled = false;
EnableTrackingProtection = {
Value = true;
Locked = true;
Cryptomining = true;
Fingerprinting = true;
};
ExtensionSettings = {
"@contain-facebook" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/facebook-container/latest.xpi";
installation_mode = "force_installed";
};
"7esoorv3@alefvanoon.anonaddy.me" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/libredirect/latest.xpi";
installation_mode = "force_installed";
};
"addon@darkreader.org" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/darkreader/latest.xpi";
installation_mode = "force_installed";
};
"addon@simplelogin" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/simplelogin/latest.xpi";
installation_mode = "force_installed";
};
"deArrow@ajay.app" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/dearrow/latest.xpi";
installation_mode = "force_installed";
};
"extraneous@sysrqmagician.github.io" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/extraneous/latest.xpi";
installation_mode = "force_installed";
};
"idcac-pub@guus.ninja" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/istilldontcareaboutcookies/latest.xpi";
installation_mode = "force_installed";
};
"tridactyl.vim@cmcaine.co.uk" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/tridactyl-vim/latest.xpi";
installation_mode = "force_installed";
};
"sponsorBlocker@ajay.app" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/sponsorblock/latest.xpi";
installation_mode = "force_installed";
};
"uBlock0@raymondhill.net" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
installation_mode = "force_installed";
};
"{74145f27-f039-47ce-a470-a662b129930a}" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/clearurls/latest.xpi";
installation_mode = "force_installed";
};
"{aecec67f-0d10-4fa7-b7c7-609a2db280cf}" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/violentmonkey/latest.xpi";
installation_mode = "force_installed";
};
"{ef87d84c-2127-493f-b952-5b4e744245bc}" = {
install_url = "https://addons.mozilla.org/firefox/downloads/latest/aw-watcher-web/latest.xpi";
installation_mode = "force_installed";
};
};
DisableAppUpdate = true;
DisableFeedbackCommands = true;
DisableFirefoxStudies = true;
DisablePocket = true;
DisableTelemetry = true;
DontCheckDefaultBrowser = true;
NoDefaultBookmarks = true;
OfferToSaveLogins = false;
Preferences = with builtins;
mapAttrs (
n: v:
if isAttrs v
then v
else {Value = v;}
)
settings;
ShowHomeButton = false;
WindowsSSO = false;
};
};
programs.mpv.enable = true;
programs.mpv.scripts = with pkgs.mpvScripts; [
quality-menu
sponsorblock
];
}

View File

@@ -0,0 +1,126 @@
{
config,
self,
pkgs,
lib,
...
}:
with lib; {
imports = [
self.homeManagerModules.qutebrowser-profiles
./scripts.nix
./profiles.nix
];
xdg.mimeApps.defaultApplications = with lib;
listToAttrs (map (name: {
inherit name;
value = config.programs.qutebrowser.package.meta.desktopFileName;
}) [
"application/x-extension-shtml"
"application/x-extension-xhtml"
"application/x-extension-html"
"application/x-extension-xhtm"
"application/x-extension-htm"
"x-scheme-handler/unknown"
"x-scheme-handler/mailto"
"x-scheme-handler/chrome"
"x-scheme-handler/about"
"x-scheme-handler/https"
"x-scheme-handler/http"
"application/xhtml+xml"
"application/json"
"text/plain"
"text/html"
]);
programs.qutebrowser.enable = true;
programs.qutebrowser.keyBindings = {
normal = {
",m" = "spawn umpv {url}";
",M" = "hint links spawn umpv {hint-url}";
";M" = "hint --rapid links spawn umpv {hint-url}";
"tD" = "config-cycle -t -u {url} colors.webpage.darkmode.enabled false true ;; reload";
};
};
programs.qutebrowser.settings = {
auto_save.session = true;
confirm_quit = ["downloads"];
tabs.width = builtins.floor (1920 * 0.1);
tabs.position = "left";
# Colors
colors.tabs.pinned.even.bg = mkForce "#181818";
colors.tabs.pinned.odd.bg = mkForce "#181818";
colors.tabs.selected.even.bg = mkForce "#CDD6F4"; # Catppuccin's Text
colors.tabs.selected.odd.bg = mkForce "#CDD6F4"; # Catppuccin's Text
colors.tabs.selected.even.fg = mkForce "#111111";
colors.tabs.selected.odd.fg = mkForce "#111111";
colors.tabs.pinned.selected.even.bg = mkForce "#CDD6F4"; # Catppuccin's Text
colors.tabs.pinned.selected.odd.bg = mkForce "#CDD6F4"; # Catppuccin's Text
## Darkmode
colors.webpage.darkmode.enabled = true;
colors.webpage.darkmode.algorithm = "lightness-cielab";
colors.webpage.darkmode.policy.images = "never";
# Prevent fingerprinting
content.canvas_reading = false;
content.cookies.accept = "all";
content.cookies.store = true;
content.geolocation = false;
content.webgl = false;
content.webrtc_ip_handling_policy = "default-public-interface-only";
};
programs.qutebrowser.extraConfig = ''
config.set('colors.webpage.darkmode.enabled', False, 'file://*')
config.set('colors.webpage.darkmode.enabled', False, 'http://*:*/*')
config.set('colors.webpage.darkmode.enabled', False, 'capytal.company')
config.set('colors.webpage.darkmode.enabled', False, '*.capytal.company')
config.set('colors.webpage.darkmode.enabled', False, 'capytal.cc')
config.set('colors.webpage.darkmode.enabled', False, '*.capytal.cc')
config.set('colors.webpage.darkmode.enabled', False, 'lored.dev')
config.set('colors.webpage.darkmode.enabled', False, '*.lored.dev')
config.set('colors.webpage.darkmode.enabled', False, 'guz.one')
config.set('colors.webpage.darkmode.enabled', False, '*.guz.one')
# Thanks to @hseg on GitHub (https://github.com/qutebrowser/qutebrowser/issues/6880#issuecomment-1815248845)
config.bind('o', 'cmd-set-text -s :open -s')
config.bind('go', 'cmd-set-text :open -s {url:pretty}')
config.bind('O', 'cmd-set-text -s :open -s -t')
config.bind('gO', 'cmd-set-text :open -s -t -r {url:pretty}')
config.bind('xo', 'cmd-set-text -s :open -s -b')
config.bind('xO', 'cmd-set-text :open -s -b -r {url:pretty}')
config.bind('wo', 'cmd-set-text -s :open -s -w')
config.bind('wO', 'cmd-set-text :open -s -w {url:pretty}')
config.bind('pp', 'open -s -- {clipboard}')
config.bind('pP', 'open -s -- {primary}')
config.bind('Pp', 'open -s -t -- {clipboard}')
config.bind('PP', 'open -s -t -- {primary}')
config.bind('wp', 'open -s -w -- {clipboard}')
config.bind('wP', 'open -s -w -- {primary}')
'';
programs.qutebrowser.searchEngines = {
DEFAULT = "https://search.brave.com/search?q={}";
# Nix
pkg = "https://search.nixos.org/packages?query={}";
opt = "https://search.nixos.org/options?query={}";
lib = "https://noogle.dev/q?term={}";
hm = "https://home-manager-options.extranix.com/?query={}";
wiki = "https://wiki.nixos.org/w/index.php?search={}";
# Wikipedia
w = "https://en.wikipedia.org/wiki/Special:Search?search={}&go=Go&ns0=1";
wpt = "https://pt.wikipedia.org/wiki/Special:Search?search={}&go=Go&ns0=1";
};
programs.mpv.enable = true;
programs.mpv.scripts = with pkgs.mpvScripts; [
quality-menu
sponsorblock
];
}

View File

@@ -0,0 +1,59 @@
{config, ...}: {
programs.qutebrowser.profiles = let
programmingSearchEngines = {
# Languages
go = "https://pkg.go.dev/search?q={}";
};
setColor = c: {
colors.tabs.selected.even.bg = c;
colors.tabs.selected.odd.bg = c;
colors.tabs.pinned.selected.even.bg = c;
colors.tabs.pinned.selected.odd.bg = c;
};
in {
"art" = {
settings = setColor "#CBA6F7"; # Catppuccin's Mauve;
};
"personal" = {
settings = setColor "#F5E0DC"; # Catppuccin's Rosewater
};
"work" = {
settings = setColor "#74C7EC"; # Catppuccin's Sapphire
searchEngines = programmingSearchEngines;
};
"job" = {
settings =
(config.programs.qutebrowser.profiles."work".settings)
// {
confirm_quit = ["always"];
content.webgl = true;
}
// (setColor "#A6E2A1"); # Catppuccin's Green
searchEngines = programmingSearchEngines;
};
"shopping" = {
settings = setColor "#F9E2AF"; # Catppuccin's Yellow
};
"goverment" = {
settings = setColor "#A6ADC8"; # Catppuccin's Subtext 1
};
"academic" = {
settings =
{
confirm_quit = ["always"];
content.webgl = true;
}
// setColor "#19236F";
};
"facebook" = {
settings = setColor "#1877F2"; # Facebook's Blue
};
"yt-music" = {
settings =
{
tabs.width = 10;
}
// (setColor "#FF0000"); # Youtube's Red
};
};
}

View File

@@ -0,0 +1,80 @@
{pkgs, ...}: {
programs.qutebrowser.greasemonkey = [
# Youtube Adblocking
(pkgs.fetchurl {
url = "https://raw.githubusercontent.com/afreakk/greasemonkeyscripts/refs/heads/master/youtube_adblock.js";
hash = "sha256-AyD9VoLJbKPfqmDEwFIEBMl//EIV/FYnZ1+ona+VU9c=";
})
# Youtube Sponsorblock
(pkgs.fetchurl {
url = "https://raw.githubusercontent.com/afreakk/greasemonkeyscripts/refs/heads/master/youtube_sponsorblock.js";
hash = "sha256-nwNade1oHP+w5LGUPJSgAX1+nQZli4Rhe8FFUoF5mLE=";
})
# Reddit adblock
(pkgs.fetchurl {
url = "https://github.com/afreakk/greasemonkeyscripts/raw/refs/heads/master/reddit_adblock.js";
hash = "sha256-KmCXL4GrZtwPLRyAvAxADpyjbdY5UFnS/XKZFKtg7tk=";
})
# Pinterest adblock
(pkgs.writeText "pinterest_adblock.js" ''
// ==UserScript==
// @name remove ads from pinterest
// @version 1.0.0
// @author guz
// @match *://*.pinterest.com/*
// ==/UserScript==
const removeShit = () => {
document.querySelectorAll('[data-grid-item]:has([title="Promoted by"])').forEach((e) => e.remove());
document.querySelectorAll('[data-grid-item]:has([data-test-id="oneTapPromotedPin"])').forEach((e) => e.remove());
document.querySelectorAll('[data-grid-item]:has([aria-label="Product Pin"])').forEach((e) => e.remove());
// document.querySelectorAll('[data-grid-item]:has-text(ideas you might love)').forEach((e) => e.remove());
// document.querySelectorAll('[data-grid-item]:has-text(Seaches to try)').forEach((e) => e.remove());
};
(trySetInterval = () => {
window.setInterval(removeShit, 1000);
})();
'')
# Privacy Redirector
(pkgs.substitute {
src = pkgs.fetchurl {
url = "https://github.com/dybdeskarphet/privacy-redirector/raw/refs/heads/main/privacy-redirector.user.js";
hash = "sha256-xj36+/3coiStIxftWCJUWHokSEmr+YRLOTktbmn5TkU=";
};
substitutions = [
# ON-OFF (Redirection / Farside)
"--replace"
"pinterest = [true, true]"
"pinterest = [false, false]"
"--replace"
"tumblr = [true, false]"
"tumblr = [false, false]"
"--replace"
"wikipedia = [true, false]"
"wikipedia = [false, false]"
"--replace"
"youtube = [true, false]"
"youtube = [false, false]"
"--replace"
"instagram = [true, true]"
"instagram = [false, false]"
];
})
# # Aternos Anti-Anti-Adblock
# (pkgs.fetchurl {
# url = "https://gist.github.com/DvilMuck/f2b14f3f65e8f22974d781277158f82a/raw/66a0d8d9dd598fc516c3c9d9bbf6ef3f0f6a7a1e/aternosAntiAntiadblock.user.js";
# hash = "sha256-PBFCt9o22D7WAN8S6C2BnLKgG3J5zZ/mWbWspCKcm6k=";
# })
#
# # Aternos block tracking
# (pkgs.fetchurl {
# url = "https://gist.github.com/DvilMuck/f2b14f3f65e8f22974d781277158f82a/raw/66a0d8d9dd598fc516c3c9d9bbf6ef3f0f6a7a1e/aternosBlockTracking.user.js";
# hash = "sha256-GDDx3gbvh28qiB3Gi61k/pdM11wJhcV7dwCRGNvq30c=";
# })
];
}

View File

@@ -6,6 +6,7 @@
../worm/default.nix
./desktop
./browser
./apps.nix
./style.nix

View File

@@ -1,68 +1,13 @@
{
config,
lib,
osConfig,
...
}: {
programs.zen-browser = {
profiles."default" = {
containers = {
Job = {
color = "green";
icon = "briefcase";
id = 3;
};
};
extensions.settings = {
"tridactyl.vim@cmcaine.co.uk".settings = {
userconfig = {
autocontain = let
containers = config.programs.zen-browser.profiles."default".containers;
in
lib.concatMapAttrs (n: v: {
"^https?://[^/]*\"${n}\"/" = v;
"^https?://[^/]*\"www.${n}\"/" = v;
"^https?://([^/]*\\.|)${n}\\.com/" = v;
}) {
"linkedin.com" = containers."Job".name;
};
autocontainmode = "relaxed";
};
};
};
# modsForce = true;
# mods = let
# store = inputs.zen-theme-store;
# in {
# "0c3d77bf-44fc-47a6-a183-39205dfa5f7e" = "${store}/themes/0c3d77bf-44fc-47a6-a183-39205dfa5f7e/theme.json";
# "c8d9e6e6-e702-4e15-8972-3596e57cf398" = pkgs.fetchurl {
# url = "https://raw.githubusercontent.com/zen-browser/theme-store/refs/heads/main/themes/c8d9e6e6-e702-4e15-8972-3596e57cf398/theme.json";
# hash = "sha256-v6VfUwdz01it0anDwwPcCSVufWCybue8CsPBd8X9KT0=";
# };
# };
spaces = let
containers = config.programs.zen-browser.profiles."default".containers;
in {
"Work2" = {
id = "1ea280f4-e428-4273-ace1-ad4f64a00cf5";
icon = "chrome://browser/skin/zen-icons/selectable/star.svg";
container = containers."Work".id;
position = 3000;
};
"Work3" = {
id = "2a5a1ca3-66df-4194-8ff9-63d0abb8eaae";
icon = "chrome://browser/skin/zen-icons/selectable/sun.svg";
container = containers."Work".id;
position = 4000;
};
"Job" = lib.mkIf (osConfig.context.job) {
id = "d7a663aa-3818-4ae7-b4b1-3d12a76d9c60";
icon = "chrome://browser/skin/zen-icons/selectable/planet.svg";
container = containers."Job".id;
position = 4500;
};
};
};
{config, ...}: {
programs.qutebrowser.profiles = let
art = config.programs.qutebrowser.profiles."art";
work = config.programs.qutebrowser.profiles."work";
in {
# HACK: `inherit` is being used to prevent infinite recursion
"art-2" = {inherit (art) settings searchEngines;};
"art-3" = {inherit (art) settings searchEngines;};
"work-2" = {inherit (work) settings searchEngines;};
"work-3" = {inherit (work) settings searchEngines;};
};
# The *state version* indicates which default

View File

@@ -48,4 +48,28 @@
};
};
};
services.gitea = {
enable = false;
settings = {
server = rec {
HTTP_PORT = 3617;
DOMAIN = "localhost:${toString HTTP_PORT}";
ROOT_URL = "http://${DOMAIN}";
};
service = {
ENABLE_USER_HEATMAP = true;
};
ui = {
DEFAULT_THEME = "capytal-dark";
THEMES = lib.concatStringsSep "," [
"lored-dark"
"lored-light"
"forgejo-dark"
];
FILE_ICON_THEME = "material";
};
};
};
}

146
hosts/rusty/base.nix Normal file
View File

@@ -0,0 +1,146 @@
{
lib,
pkgs,
...
}: {
imports = [
../../secrets.nix
];
context = {
job = false;
};
# GnuPG keyring
programs.gnupg.agent = {
enable = true;
pinentryPackage = pkgs.pinentry-gtk2;
settings = {default-cache-ttl = 3600 * 24;};
};
services.pcscd.enable = true;
# Yet another nix cli helper
programs.nh = {
enable = true;
clean.enable = true;
clean.extraArgs = "--keep-since 7d --keep 3";
flake = "/home/guz/.projects/dot013-nix";
};
# QMK keyboard
hardware.keyboard.qmk.enable = true;
services.udev.packages = with pkgs; [via vial];
# Enable Nix-LD for standalone binaries (useful for development)
programs.nix-ld.enable = true;
# Bluetooth
hardware.bluetooth.enable = true;
hardware.bluetooth.powerOnBoot = true;
services.blueman.enable = true;
# Audio
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber.enable = true;
extraConfig = {
pipewire-pulse."switch-on-connect.conf" = {
"pulse.cmd" = [
{
cmd = "load-module";
args = "module-switch-on-connect";
}
];
};
};
};
security.rtkit.enable = true;
services.pulseaudio.enable = lib.mkForce false;
environment.systemPackages = with pkgs; [
pwvucontrol
via
vial
];
# Networking
networking = {
networkmanager.enable = true;
nameservers = [
/*
"192.168.0.1"
*/
"8.8.8.8"
# "1.1.1.1"
# "9.9.9.9"
];
};
# Firewall
networking.firewall.enable = true;
networking.firewall.allowedUDPPorts = [53];
networking.firewall.allowedTCPPorts = [80 433];
# SSH
services.openssh.enable = true;
services.openssh.settings = {
PasswordAuthentication = false;
PermitRootLogin = "forced-commands-only";
};
# Mosh
programs.mosh.enable = true;
programs.mosh.openFirewall = true;
# Tailscale
services.tailscale.enable = true;
# Locale
time.timeZone = "America/Sao_Paulo";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = let
locale = "pt_BR.UTF-8";
in {
LC_ADDRESS = locale;
LC_IDENTIFICATION = locale;
LC_MEASUREMENT = locale;
LC_MONETARY = locale;
LC_NAME = locale;
LC_NUMERIC = locale;
LC_PAPER = locale;
LC_TELEPHONE = locale;
LC_TIME = locale;
};
# Keyboard
services.xserver.xkb = {
layout = "br";
};
console.keyMap = "br-abnt2";
security.polkit.enable = true;
# Bootloader
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.kernel.sysctl."kernel.yama.ptrace_scope" = lib.mkForce 0;
# Nix
nix.settings = {
experimental-features = ["nix-command" "flakes"];
};
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
# on your system were taken. It's perfectly fine and recommended to leave
# this value at the release version of the first install of this system.
# Before changing this value read the documentation for this option
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
system.stateVersion = "24.11"; # Did you read the comment?
}

View File

@@ -4,11 +4,14 @@
...
}: {
imports = [
../../configuration.nix
./base.nix
../../home/worm/configuration.nix
inputs.disko.nixosModules.disko
inputs.disko-2505.nixosModules.disko
./disks.nix
# ./impermanence.nix
./hardware-configuration.nix
];
@@ -33,12 +36,6 @@
services.logind.lidSwitch = "suspend";
services.logind.lidSwitchExternalPower = "lock";
boot.supportedFilesystems = {
btrfs = true;
};
boot.kernelParams = ["resume_offset=533760"];
boot.resumeDevice = "/dev/disk/by-label/nixos";
# HACK: Acer Aspire is a Bitch
boot.loader.systemd-boot.enable = lib.mkForce true;
boot.loader.efi.canTouchEfiVariables = lib.mkForce false;

View File

@@ -0,0 +1,47 @@
{
disko.devices = {
disk.main = {
device = "/dev/sda"; # This will be overwritten by disko-install
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
label = "boot";
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["defaults"];
};
};
luks = {
end = "-4G";
label = "luks";
content = {
type = "luks";
name = "cryptroot";
settings = {crypttabExtraOpts = ["fido2-device=auto" "token-timeout=10"];};
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
swap = {
size = "100%";
content = {
type = "swap";
randomEncryption = true;
priority = 100;
resumeDevice = true;
};
};
};
};
};
};
}

View File

@@ -17,50 +17,83 @@
mountOptions = ["defaults"];
};
};
luks = {
root = {
size = "100%";
label = "luks";
content = {
type = "luks";
name = "cryptroot";
extraOpenArgs = [
"--allow-discards"
"--perf-no_read_workqueue"
"--perf-no_write_workqueue"
];
settings = {crypttabExtraOpts = ["fido2-device=auto" "token-timeout=10"];};
content = {
type = "btrfs";
extraArgs = ["-L" "nixos" "-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = ["subvol=root" "compress=zstd" "noatime"];
};
"/home" = {
mountpoint = "/home";
mountOptions = ["subvol=home" "compress=zstd" "noatime"];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = ["subvol=nix" "compress=zstd" "noatime"];
};
"/persist" = {
mountpoint = "/persist";
mountOptions = ["subvol=persist" "compress=zstd" "noatime"];
};
"/log" = {
mountpoint = "/var/log";
mountOptions = ["subvol=log" "compress=zstd" "noatime"];
};
"/swap" = {
mountpoint = "/swap";
swap.swapfile.size = "4G";
};
type = "btrfs";
extraArgs = ["-L" "nixos" "-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = ["subvol=root" "compress=zstd" "noatime"];
};
"/home" = {
mountpoint = "/home";
mountOptions = ["subvol=home" "compress=zstd" "noatime"];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = ["subvol=nix" "compress=zstd" "noatime"];
};
"/persist" = {
mountpoint = "/persist";
mountOptions = ["subvol=persist" "compress=zstd" "noatime"];
};
"/log" = {
mountpoint = "/var/log";
mountOptions = ["subvol=log" "compress=zstd" "noatime"];
};
"/swap" = {
mountpoint = "/swap";
swap.swapfile.size = "4G";
};
};
};
};
# luks = {
# size = "100%";
# label = "luks";
# content = {
# type = "luks";
# name = "cryptroot";
# extraOpenArgs = [
# "--allow-discards"
# "--perf-no_read_workqueue"
# "--perf-no_write_workqueue"
# ];
# settings = {crypttabExtraOpts = ["fido2-device=auto" "token-timeout=10"];};
# content = {
# type = "btrfs";
# extraArgs = ["-L" "nixos" "-f"];
# subvolumes = {
# "/root" = {
# mountpoint = "/";
# mountOptions = ["subvol=root" "compress=zstd" "noatime"];
# };
# "/home" = {
# mountpoint = "/home";
# mountOptions = ["subvol=home" "compress=zstd" "noatime"];
# };
# "/nix" = {
# mountpoint = "/nix";
# mountOptions = ["subvol=nix" "compress=zstd" "noatime"];
# };
# "/persist" = {
# mountpoint = "/persist";
# mountOptions = ["subvol=persist" "compress=zstd" "noatime"];
# };
# "/log" = {
# mountpoint = "/var/log";
# mountOptions = ["subvol=log" "compress=zstd" "noatime"];
# };
# "/swap" = {
# mountpoint = "/swap";
# swap.swapfile.size = "4G";
# };
# };
# };
# };
# };
};
};
};

View File

@@ -12,11 +12,11 @@
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "sd_mod"];
boot.initrd.availableKernelModules = ["ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" "rtsx_usb_sdmmc"];
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -0,0 +1,76 @@
{
inputs,
self,
config,
modulesPath,
pkgs,
...
}: {
imports = [
"${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
];
# Users
users.users."guz" = {
useDefaultShell = true;
isNormalUser = true;
password = null;
extraGroups = ["wheel" "guz"];
};
users.groups."guz" = {};
environment.systemPackages =
[
inputs.disko.packages.${pkgs.stdenv.hostPlatform.system}.default
]
++ (with self.packages.${pkgs.stdenv.hostPlatform.system}.devkit; [
git
lazygit
neovim
starship
tmux
yazi
zellij
zsh
]);
# Locale
time.timeZone = "America/Sao_Paulo";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = let
locale = "pt_BR.UTF-8";
in {
LC_ADDRESS = locale;
LC_IDENTIFICATION = locale;
LC_MEASUREMENT = locale;
LC_MONETARY = locale;
LC_NAME = locale;
LC_NUMERIC = locale;
LC_PAPER = locale;
LC_TELEPHONE = locale;
LC_TIME = locale;
};
# Keyboard
services.xserver.xkb = {
layout = "br";
};
console.keyMap = "br-abnt2";
swapDevices = [
{
device = "/var/lib/swapfile";
size = 16 * 1024;
}
];
# Nix
nix.settings = {
experimental-features = ["nix-command" "flakes"];
};
nixpkgs.config.allowBroken = true;
# boot.kernelPackages = pkgs.linuxPackages_latest;
}

View File

@@ -174,7 +174,7 @@ in
in
mkIf (cfg.enable && cfg.profiles != {}) {
programs.qutebrowser.package = pkgs.stdenv.mkDerivation {
inherit (pkgs.qutebrowser) name pname meta;
inherit (pkgs.qutebrowser) name pname;
buildCommand = let
desktopEntry = pkgs.makeDesktopItem {
name = "qutebrowser";
@@ -208,6 +208,11 @@ in
}
'';
dontBuild = true;
meta =
meta
// {
desktopFileName = "qutebrowser.desktop";
};
};
xdg.desktopEntries = mergeAttrsList (mapAttrsToList (n: v: let

View File

@@ -0,0 +1,13 @@
{pkgs, ...}:
with pkgs;
writers.writeBashBin "dotstate" {
makeWrapperArgs = [
"--prefix"
"PATH"
":"
"${lib.makeBinPath [
socat
jq
]}"
];
} (builtins.readFile ./dotstate.sh)

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
dotstate() {
local SOCKET="/tmp/dotstate.sock"
local cmd="$1"
shift 1
case "$cmd" in
"get")
if [ ! -f "$SOCKET" ]; then
echo '{}' | socat - UNIX-LISTEN:"$SOCKET" &
socat -u UNIX-CONNECT:"$SOCKET" -
else
socat -u UNIX-CONNECT:"$SOCKET" -
fi
;;
"set")
echo "$@" | socat - UNIX-LISTEN:"$SOCKET"
;;
*)
echo "Incorrect command"
;;
esac
}
dotstate "$@"

View File

@@ -22,4 +22,8 @@
sops.secrets."guz/git-envs" = {
owner = config.users.users.guz.name;
};
# sops.secrets."services/minio/credentialsFile" = {
# owner = config.users.users.minio.name;
# };
}

View File

@@ -1,3 +1,6 @@
services:
minio:
credentialsFile: ENC[AES256_GCM,data:b3ZS3dJOjUMTFNY0vnCr+u5SZaUtf2DR4zCIGH/OpZWWjJIxjRPKp6aPM5ok/XnYu8cv/4FHwMM=,iv:ZnzLCTI0cEVHGy7mMUNGiQlseOXxvNgWrD1mkthwkNE=,tag:8Ii6fNg2syJcyxNAww+6SQ==,type:str]
guz:
password: ENC[AES256_GCM,data:0D9a5w==,iv:+ahN7Y5rsJGCB6/sLgA11yt6YjPDIs1Q7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7BmSoV/hMNgqdaeGGhBFEZwKjun6pfjBfd/UFjuB7kWo6NnQ=,iv:SPu6Gr4BItzeVMV3zc5/mNhuzD3BGjbITVEBaHodQhA=,tag:HOX+L3GSXJfxR5/N2SusLA==,type:str]
lastmodified: "2025-08-30T20:35:23Z"
mac: ENC[AES256_GCM,data:/FHbARTFlkCBBMlAVw9NOEZVbGlNzUZ46sxlec0IDnilGmsvE3gw7Bn5BxvppFGlOiyMaegTDrMGySu03osqy8ih1X9ZhDEGtsSHHqEMYjdu7oEzs2doBmst93exKfsYGYL8tgXNeFrv2BPSi3sv3loH1xCL/Az4XH4QVfWAt4A=,iv:sv87Za6o5YcNeF9uAdjAem21UgN7m2sYPJNgd+WOmV8=,tag:7lie8wlUqo71DQlVSt6AfQ==,type:str]
unencrypted_suffix: _unencrypted
version: 3.10.2

View File

@@ -0,0 +1,5 @@
{...}: {
imports = [
./vm.nix
];
}

View File

@@ -0,0 +1,37 @@
{
config,
lib,
pkgs,
...
}: {
virtualisation.virtualbox.host.enable = true;
virtualisation.virtualbox.host.enableExtensionPack = true;
users.extraGroups.vboxusers.members = ["guz"];
boot.kernelParams = ["kvm.enable_virt_at_load=0"];
programs.dconf.enable = true;
users.users."guz".extraGroups = ["libvirtd"];
users.users."guz".packages = with pkgs; [
virt-manager
virt-viewer
spice
spice-gtk
spice-protocol
win-virtio
win-spice
adwaita-icon-theme
quickemu
];
# virtualisation.libvirtd = {
# enable = true;
# qemu = {
# swtpm.enable = true;
# ovmf.enable = true;
# ovmf.packages = [pkgs.OVMFFull.fd];
# };
# };
# virtualisation.spiceUSBRedirection.enable = true;
}

3
state.json Normal file
View File

@@ -0,0 +1,3 @@
{
"hello": 2
}