refactor: reduce amount of IFDs
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-06-10 22:57:20 -04:00
parent f08e17f51b
commit cab5bfa648
22 changed files with 351 additions and 123 deletions

7
ci.nix
View file

@ -10,10 +10,5 @@
mapAttrs'
(name: config: nameValuePair "nixos-${name}" config.config.system.build.toplevel)
((filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations);
devShells =
mapAttrs'
(n: nameValuePair "devShell-${n}")
self.devShells;
in
nixosMachines // devShells
nixosMachines

View file

@ -48,6 +48,7 @@
http-connections = 0; # unlimited for local cache
warn-dirty = false;
show-trace = true;
allow-import-from-derivation = true;
# remote building
trusted-users = ["matt" "nixremote"];

View file

@ -44,7 +44,7 @@
enable = true;
config.theme = "dracula-bat";
themes.dracula-bat.src = self.packages.${pkgs.system}.dracula.bat;
themes.dracula-bat.src = self.legacyPackages.${pkgs.system}.dracula.bat;
extraPackages = with pkgs.bat-extras; [
batman

View file

@ -9,7 +9,7 @@
lfs.enable = true;
includes = [
{path = toString self.packages.${pkgs.system}.dracula.git;}
{path = toString self.legacyPackages.${pkgs.system}.dracula.git;}
{
# FIXME: add https config

View file

@ -3,10 +3,13 @@
pkgs,
lib,
nixd,
self,
...
}: let
inherit (config.vars) hostName mainUser neovimIde;
inherit (lib) hasPrefix removePrefix;
inherit (lib) getExe hasPrefix removePrefix;
defaultFormat = self.formatter.${pkgs.system};
nixdPkg = nixd.packages.${pkgs.system}.default;
@ -27,8 +30,8 @@ in
}
];
home.packages = with pkgs; [
alejandra
home.packages = [
defaultFormat
];
xdg.dataFile."${flakeDir}/.nixd.json".text = builtins.toJSON {
@ -55,7 +58,7 @@ in
nixd = {
formatting = {
-- TODO: Try to find <flake>.formatter
command = { '${lib.getExe pkgs.alejandra}' },
command = { '${getExe defaultFormat}' },
},
},
},

View file

@ -99,6 +99,12 @@
nixOnDroidConfigurations.default = mkNixOnDroid [./devices/android];
legacyPackages = perSystem (system: pkgs: {
dracula =
pkgs.lib.recurseIntoAttrs
(pkgs.callPackage ./pkgs/dracula ({} // inputs));
});
packages =
perSystem (system: pkgs:
import ./pkgs ({inherit self system pkgs;} // inputs));

View file

@ -1886,8 +1886,7 @@
"trash-d-src": "trash-d-src",
"vimplugin-easytables-src": "vimplugin-easytables-src",
"vimplugin-ts-error-translator-src": "vimplugin-ts-error-translator-src",
"wpaperd": "wpaperd",
"xresources-src": "xresources-src"
"wpaperd": "wpaperd"
}
},
"scss-reset": {
@ -2298,22 +2297,6 @@
"repo": "xdg-desktop-portal-hyprland",
"type": "github"
}
},
"xresources-src": {
"flake": false,
"locked": {
"lastModified": 1647833631,
"narHash": "sha256-6fltsAluqOqYIh2NX0I/LC3WCWkb9Fn8PH6LNLBQbrY=",
"owner": "dracula",
"repo": "xresources",
"rev": "539ef24e9b0c5498a82d59bfa2bad9b618d832a3",
"type": "github"
},
"original": {
"owner": "dracula",
"repo": "xresources",
"type": "github"
}
}
},
"root": "root",

View file

@ -333,12 +333,6 @@
repo = "wpaperd";
type = "github";
};
xresources-src = {
flake = false;
owner = "dracula";
repo = "xresources";
type = "github";
};
};
outputs = inputs: inputs.flakegen ./flake.in.nix inputs;
}

View file

@ -1,20 +1,54 @@
[
{
"pname": "sound-volume",
"slug": "600-sound-volume"
},
{
"slug": "google-container"
"pname": "bitwarden",
"slug": "bitwarden-password-manager"
},
{
"slug": "checkmarks-web-ext"
},
{
"slug": "ttv-lol-pro"
"slug": "darkreader"
},
{
"slug": "floccus"
},
{
"slug": "google-container"
},
{
"slug": "istilldontcareaboutcookies"
},
{
"slug": "image-search-options",
"license": {
"tag": "predefined",
"shortName": "mpl11"
}
},
{
"slug": "opera-gx-witchcraft-purple"
},
{
"slug": "return-youtube-dislikes"
},
{
"slug": "sponsorblock"
},
{
"pname": "stylus",
"slug": "styl-us"
},
{
"slug": "ttv-lol-pro"
},
{
"slug": "ublock-origin"
},
{
"slug": "undoclosetabbutton"
}
]

View file

@ -4,23 +4,31 @@
lib,
stdenv,
}: {
"600-sound-volume" = buildFirefoxXpiAddon {
pname = "600-sound-volume";
version = "1.5.5";
addonId = "{c4b582ec-4343-438c-bda2-2f691c16c262}";
url = "https://addons.mozilla.org/firefox/downloads/file/4219765/600_sound_volume-1.5.5.xpi";
sha256 = "efc686d54727f29b5c796f4037f19a5d5f31f77354c9c5f8f47d8768ba24fe98";
"bitwarden" = buildFirefoxXpiAddon {
pname = "bitwarden";
version = "2024.4.2";
addonId = "{446900e4-71c2-419f-a6a7-df9c091e268b}";
url = "https://addons.mozilla.org/firefox/downloads/file/4282854/bitwarden_password_manager-2024.4.2.xpi";
sha256 = "19caac7131a37e558204c1f61cf1459502cc624b0284dc5837112c4742917da0";
meta = with lib; {
homepage = "http://resourcefulman.net/";
description = "Up to 600% volume boost";
license = licenses.mpl20;
homepage = "https://bitwarden.com";
description = "At home, at work, or on the go, Bitwarden easily secures all your passwords, passkeys, and sensitive information.";
license = licenses.gpl3;
mozPermissions = [
"<all_urls>"
"*://*/*"
"tabs"
"activeTab"
"contextMenus"
"storage"
"unlimitedStorage"
"clipboardRead"
"clipboardWrite"
"idle"
"webRequest"
"webRequestBlocking"
"webNavigation"
"file:///*"
"https://lastpass.com/export.php"
];
platforms = platforms.all;
};
@ -48,6 +56,27 @@
platforms = platforms.all;
};
};
"darkreader" = buildFirefoxXpiAddon {
pname = "darkreader";
version = "4.9.86";
addonId = "addon@darkreader.org";
url = "https://addons.mozilla.org/firefox/downloads/file/4295557/darkreader-4.9.86.xpi";
sha256 = "dde9896751858d0179f3d724a59f2bd4a0d61e599cb8822dc8ed2de320510714";
meta = with lib; {
homepage = "https://darkreader.org/";
description = "Dark mode for every website. Take care of your eyes, use dark theme for night and daily browsing.";
license = licenses.mit;
mozPermissions = [
"alarms"
"contextMenus"
"storage"
"tabs"
"theme"
"<all_urls>"
];
platforms = platforms.all;
};
};
"floccus" = buildFirefoxXpiAddon {
pname = "floccus";
version = "5.1.4.2";
@ -93,6 +122,49 @@
platforms = platforms.all;
};
};
"image-search-options" = buildFirefoxXpiAddon {
pname = "image-search-options";
version = "3.0.12";
addonId = "{4a313247-8330-4a81-948e-b79936516f78}";
url = "https://addons.mozilla.org/firefox/downloads/file/3059971/image_search_options-3.0.12.xpi";
sha256 = "1fbdd8597fc32b1be11302a958ea3ba2b010edcfeb432c299637b2c58c6fd068";
meta = with lib; {
homepage = "http://saucenao.com/";
description = "A customizable reverse image search tool that conveniently presents a variety of top image search engines.";
license = licenses.mpl11;
mozPermissions = [
"storage"
"contextMenus"
"activeTab"
"tabs"
"<all_urls>"
];
platforms = platforms.all;
};
};
"istilldontcareaboutcookies" = buildFirefoxXpiAddon {
pname = "istilldontcareaboutcookies";
version = "1.1.4";
addonId = "idcac-pub@guus.ninja";
url = "https://addons.mozilla.org/firefox/downloads/file/4216095/istilldontcareaboutcookies-1.1.4.xpi";
sha256 = "cadeb24622d3b9a2b82bf4308242fd802546b126bb9dd14e1ea66f2aa2066795";
meta = with lib; {
homepage = "https://github.com/OhMyGuus/I-Dont-Care-About-Cookies";
description = "Community version of the popular extension \"I don't care about cookies\" \n\n<a href=\"https://prod.outgoing.prod.webservices.mozgcp.net/v1/d899243c3222e303a4ac90833f850da61cdf8f7779e2685f60f657254302216d/https%3A//github.com/OhMyGuus/I-Dont-Care-About-Cookies\" rel=\"nofollow\">https://github.com/OhMyGuus/I-Dont-Care-About-Cookies</a>";
license = licenses.gpl3;
mozPermissions = [
"tabs"
"storage"
"http://*/*"
"https://*/*"
"notifications"
"webRequest"
"webRequestBlocking"
"webNavigation"
];
platforms = platforms.all;
};
};
"opera-gx-witchcraft-purple" = buildFirefoxXpiAddon {
pname = "opera-gx-witchcraft-purple";
version = "2.0";
@ -106,6 +178,91 @@
platforms = platforms.all;
};
};
"return-youtube-dislikes" = buildFirefoxXpiAddon {
pname = "return-youtube-dislikes";
version = "3.0.0.14";
addonId = "{762f9885-5a13-4abd-9c77-433dcd38b8fd}";
url = "https://addons.mozilla.org/firefox/downloads/file/4208483/return_youtube_dislikes-3.0.0.14.xpi";
sha256 = "a31ab23549846b7eab92a094e92df8349047b48bbd807f069d128083c3b27f61";
meta = with lib; {
description = "Returns ability to see dislike statistics on youtube";
license = licenses.gpl3;
mozPermissions = [
"activeTab"
"*://*.youtube.com/*"
"storage"
"*://returnyoutubedislikeapi.com/*"
];
platforms = platforms.all;
};
};
"sound-volume" = buildFirefoxXpiAddon {
pname = "sound-volume";
version = "1.5.5";
addonId = "{c4b582ec-4343-438c-bda2-2f691c16c262}";
url = "https://addons.mozilla.org/firefox/downloads/file/4219765/600_sound_volume-1.5.5.xpi";
sha256 = "efc686d54727f29b5c796f4037f19a5d5f31f77354c9c5f8f47d8768ba24fe98";
meta = with lib; {
homepage = "http://resourcefulman.net/";
description = "Up to 600% volume boost";
license = licenses.mpl20;
mozPermissions = [
"<all_urls>"
"tabs"
"activeTab"
"storage"
"webRequest"
"webRequestBlocking"
];
platforms = platforms.all;
};
};
"sponsorblock" = buildFirefoxXpiAddon {
pname = "sponsorblock";
version = "5.6";
addonId = "sponsorBlocker@ajay.app";
url = "https://addons.mozilla.org/firefox/downloads/file/4292214/sponsorblock-5.6.xpi";
sha256 = "ec2343ee8db27666177e0b59510ddcd8b0f1072c88b5df05ba789d72a3af32e6";
meta = with lib; {
homepage = "https://sponsor.ajay.app";
description = "Easily skip YouTube video sponsors. When you visit a YouTube video, the extension will check the database for reported sponsors and automatically skip known sponsors. You can also report sponsors in videos. Other browsers: https://sponsor.ajay.app";
license = licenses.lgpl3;
mozPermissions = [
"storage"
"https://sponsor.ajay.app/*"
"scripting"
"https://*.youtube.com/*"
"https://www.youtube-nocookie.com/embed/*"
];
platforms = platforms.all;
};
};
"stylus" = buildFirefoxXpiAddon {
pname = "stylus";
version = "1.5.46";
addonId = "{7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}";
url = "https://addons.mozilla.org/firefox/downloads/file/4232144/styl_us-1.5.46.xpi";
sha256 = "9a75bf1bdde7263a5502d78009b5f19117ea09e6237afc852e7ba4e52b565364";
meta = with lib; {
homepage = "https://add0n.com/stylus.html";
description = "Redesign your favorite websites with Stylus, an actively developed and community driven userstyles manager. Easily install custom themes from popular online repositories, or create, edit, and manage your own personalized CSS stylesheets.";
license = licenses.gpl3;
mozPermissions = [
"tabs"
"webNavigation"
"webRequest"
"webRequestBlocking"
"contextMenus"
"storage"
"unlimitedStorage"
"alarms"
"<all_urls>"
"http://userstyles.org/*"
"https://userstyles.org/*"
];
platforms = platforms.all;
};
};
"ttv-lol-pro" = buildFirefoxXpiAddon {
pname = "ttv-lol-pro";
version = "2.3.7";
@ -131,4 +288,56 @@
platforms = platforms.all;
};
};
"ublock-origin" = buildFirefoxXpiAddon {
pname = "ublock-origin";
version = "1.58.0";
addonId = "uBlock0@raymondhill.net";
url = "https://addons.mozilla.org/firefox/downloads/file/4290466/ublock_origin-1.58.0.xpi";
sha256 = "470c56994a7174db21578adce598b158a5dc0970c87c5cfe889ac632bd3085ea";
meta = with lib; {
homepage = "https://github.com/gorhill/uBlock#ublock-origin";
description = "Finally, an efficient wide-spectrum content blocker. Easy on CPU and memory.";
license = licenses.gpl3;
mozPermissions = [
"alarms"
"dns"
"menus"
"privacy"
"storage"
"tabs"
"unlimitedStorage"
"webNavigation"
"webRequest"
"webRequestBlocking"
"<all_urls>"
"http://*/*"
"https://*/*"
"file://*/*"
"https://easylist.to/*"
"https://*.fanboy.co.nz/*"
"https://filterlists.com/*"
"https://forums.lanik.us/*"
"https://github.com/*"
"https://*.github.io/*"
"https://github.com/uBlockOrigin/*"
"https://ublockorigin.github.io/*"
"https://*.reddit.com/r/uBlockOrigin/*"
];
platforms = platforms.all;
};
};
"undoclosetabbutton" = buildFirefoxXpiAddon {
pname = "undoclosetabbutton";
version = "8.0.0";
addonId = "{4853d046-c5a3-436b-bc36-220fd935ee1d}";
url = "https://addons.mozilla.org/firefox/downloads/file/4212173/undoclosetabbutton-8.0.0.xpi";
sha256 = "c83a058c417f98d75e62ab310e2995971bf79c99cd83cf1dcbd8a44797aa60c4";
meta = with lib; {
homepage = "https://github.com/M-Reimer/undoclosetab";
description = "Allows you to restore the tab you just closed with a single clickplus it can offer a list of recently closed tabs within a convenient context menu.";
license = licenses.gpl3;
mozPermissions = ["menus" "tabs" "sessions" "storage" "theme"];
platforms = platforms.all;
};
};
}

View file

@ -1,22 +1,19 @@
{
config,
pkgs,
firefox-gx-src,
...
}: let
inherit (builtins) readFile;
firefox-addons = pkgs.recurseIntoAttrs (pkgs.callPackage ./addons {});
sound-volume = firefox-addons."600-sound-volume";
firefox-gx = pkgs.callPackage ./firefox-gx {
inherit firefox-gx-src;
};
in {
home.file = {
".mozilla/firefox/matt/chrome/components".source = "${firefox-gx}/chrome/components";
".mozilla/firefox/matt/chrome/icons".source = "${firefox-gx}/chrome/icons";
".mozilla/firefox/matt/chrome/images".source = "${firefox-gx}/chrome/images";
".mozilla/firefox/matt/chrome/userContent.css".source = "${firefox-gx}/chrome/userContent.css";
".mozilla/firefox/matt/chrome/components".source = "${firefox-gx}/chrome/components";
".mozilla/firefox/matt/chrome/images".source = "${firefox-gx}/chrome/images";
".mozilla/firefox/matt/chrome/icons".source = "${firefox-gx}/chrome/icons";
};
programs.firefox = {
@ -26,10 +23,9 @@ in {
id = 0;
userChrome = ''
${readFile "${firefox-gx}/chrome/userChrome.css"}
${readFile ./custom.css}
@import url("file://${firefox-gx}/chrome/userChrome.css");
@import url("file://${./custom.css}");
'';
extraConfig = readFile "${firefox-gx}/user.js";
settings = {
# Theme
@ -40,6 +36,24 @@ in {
"userChrome.tab.bottom_rounded_corner.australis" = true;
"widget.use-xdg-desktop-portal.file-picker" = 1;
# Firefox-gx user.js
/*
Default rules
*/
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"svg.context-properties.content.enabled" = true;
"layout.css.color-mix.enabled" = true;
"browser.tabs.delayHidingAudioPlayingIconMS" = 0;
"layout.css.backdrop-filter.enabled" = true;
"browser.newtabpage.activity-stream.improvesearch.handoffToAwesomebar" = false;
/*
To active container tabs without any extension
*/
"privacy.userContext.enabled" = true;
"privacy.userContext.ui.enabled" = true;
"privacy.userContext.longPressBehavior" = 2;
# Open previous windows and tabs
"browser.startup.page" = 3;
@ -176,30 +190,24 @@ in {
];
};
extensions =
(with config.nur.repos.bandithedoge.firefoxAddons; [
sponsorblock
stylus
#tridactyl
ublock-origin
])
++ (with config.nur.repos.rycee.firefox-addons; [
extensions = with firefox-addons; [
bitwarden
checkmarks-web-ext
darkreader
istilldontcareaboutcookies
image-search-options
return-youtube-dislikes
undoclosetabbutton
])
++ (with firefox-addons; [
floccus
google-container
checkmarks-web-ext
ttv-lol-pro
seventv
image-search-options
istilldontcareaboutcookies
opera-gx-witchcraft-purple
])
++ [sound-volume];
return-youtube-dislikes
seventv
sponsorblock
sound-volume
stylus
ttv-lol-pro
ublock-origin
undoclosetabbutton
];
};
};
}

View file

@ -3,7 +3,7 @@
self,
...
}: let
inherit (self.packages.${pkgs.system}) dracula;
inherit (self.legacyPackages.${pkgs.system}) dracula;
in {
imports = [
./gtk.nix
@ -23,7 +23,25 @@ in {
};
};
xresources.extraConfig =
builtins.readFile
"${dracula.xresources}";
xresources.extraConfig = ''
! Dracula Xresources palette
*.foreground: #F8F8F2
*.background: #282A36
*.color0: #000000
*.color8: #4D4D4D
*.color1: #FF5555
*.color9: #FF6E67
*.color2: #50FA7B
*.color10: #5AF78E
*.color3: #F1FA8C
*.color11: #F4F99D
*.color4: #BD93F9
*.color12: #CAA9FA
*.color5: #FF79C6
*.color13: #FF92D0
*.color6: #8BE9FD
*.color14: #9AEDFE
*.color7: #BFBFBF
*.color15: #E6E6E6
'';
}

View file

@ -38,16 +38,14 @@
build = pkgs.stdenv.mkDerivation {
name = "gradience-build";
preset = lib.fileContents "${presets}/curated/dracula-dark.json";
passAsFile = ["preset"];
phases = ["buildPhase" "installPhase"];
nativeBuildInputs = [gnomeShellStub];
buildPhase = ''
export HOME=$TMPDIR
export XDG_CURRENT_DESKTOP=GNOME
mkdir -p $HOME/.config/presets
${package}/bin/gradience-cli apply -p $presetPath --gtk both
${package}/bin/gradience-cli gnome-shell -p $presetPath -v dark
${package}/bin/gradience-cli apply -p "${presets}/curated/dracula-dark.json" --gtk both
${package}/bin/gradience-cli gnome-shell -p "${presets}/curated/dracula-dark.json" -v dark
'';
installPhase = ''
mkdir -p $out

View file

@ -34,14 +34,14 @@ in {
extraConfig = {
"gtk-application-prefer-dark-theme" = 1;
};
extraCss = builtins.readFile "${gradience.build}/gtk-3.0/gtk.css";
extraCss = "@import url(\"file://${gradience.build}/gtk-3.0/gtk.css\");";
};
gtk4 = {
extraConfig = {
"gtk-application-prefer-dark-theme" = 1;
};
extraCss = builtins.readFile "${gradience.build}/gtk-4.0/gtk.css";
extraCss = "@import url(\"file://${gradience.build}/gtk-4.0/gtk.css\");";
};
};

View file

@ -6,7 +6,7 @@
...
}: let
inherit (config.vars) fontSize;
inherit (self.packages.${pkgs.system}) dracula;
inherit (self.legacyPackages.${pkgs.system}) dracula;
in {
home.packages = with pkgs; [
libsForQt5.qtstyleplugin-kvantum

View file

@ -11,7 +11,7 @@ in {
xdg.configFile."wpaperd/config.toml".source = writeTOML "config.toml" {
default = {
path = toString self.packages.${pkgs.system}.dracula.wallpaper;
path = toString self.legacyPackages.${pkgs.system}.dracula.wallpaper;
mode = "stretch";
};
};

View file

@ -277,10 +277,6 @@ let
owner = "matt1432";
repo = "dracula-plymouth";
}
{
owner = "dracula";
repo = "xresources";
}
{
name = "sioyek-theme-src";
owner = "dracula";

View file

@ -56,7 +56,7 @@ in {
startup_commands = "toggle_custom_color";
ui_font = "JetBrainsMono Nerd Font Mono Regular";
font_size = "24";
source = toString self.packages.${pkgs.system}.dracula.sioyek;
source = toString self.legacyPackages.${pkgs.system}.dracula.sioyek;
};
};

View file

@ -24,7 +24,7 @@
plymouth = {
enable = true;
themePackages = [self.packages.${pkgs.system}.dracula.plymouth];
themePackages = [self.legacyPackages.${pkgs.system}.dracula.plymouth];
theme = "dracula";
};
};

View file

@ -11,8 +11,6 @@
inherit curseforge-server-downloader-src;
};
dracula = import ./dracula inputs;
pam-fprint-grosshack = pkgs.callPackage ./pam-fprint-grosshack {
inherit pam-fprint-grosshack-src;
};

View file

@ -1,9 +1,9 @@
{pkgs, ...} @ inputs: {
bat = pkgs.callPackage ./bat.nix {inherit (inputs) bat-theme-src;};
git = pkgs.callPackage ./git.nix {inherit (inputs) git-theme-src;};
{pkgs, ...} @ inputs:
pkgs.lib.makeScope pkgs.newScope (drac: {
bat = drac.callPackage ./bat.nix {inherit (inputs) bat-theme-src;};
git = drac.callPackage ./git.nix {inherit (inputs) git-theme-src;};
gtk = import ./gtk.nix {inherit (inputs) gtk-theme-src pkgs;};
plymouth = pkgs.callPackage ./plymouth.nix {inherit (inputs) dracula-plymouth-src;};
sioyek = pkgs.callPackage ./sioyek.nix {inherit (inputs) sioyek-theme-src;};
plymouth = drac.callPackage ./plymouth.nix {inherit (inputs) dracula-plymouth-src;};
sioyek = drac.callPackage ./sioyek.nix {inherit (inputs) sioyek-theme-src;};
wallpaper = pkgs.fetchurl (import ./wallpaper.nix);
xresources = pkgs.callPackage ./xresources.nix {inherit (inputs) xresources-src;};
}
})

View file

@ -1,15 +0,0 @@
{
xresources-src,
stdenv,
...
}:
stdenv.mkDerivation {
pname = "dracula-xresources";
version = xresources-src.shortRev;
src = xresources-src;
installPhase = ''
cat ./Xresources > $out
'';
}