diff --git a/README.md b/README.md index eb9a86e3..f488a4fe 100644 --- a/README.md +++ b/README.md @@ -44,12 +44,15 @@ sudo ln -sf /home/matt/.nix /etc/nixos | ---------------------------------- | ----------- | | `nixosConfigurations` | [devices](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/devices)' + ISO's configurations | | `nixOnDroidConfigurations.default` | [Nix-On-Droid](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/devices/android)'s configuration | -| `formatter` | I have yet to know if this has any uses but I format with [alejandra](https://github.com/kamadorueda/alejandra) | +| `packages` | Some custom [packages](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/pkgs) not available in nixpkgs or modified from it | +| `legacyPackages` | Some custom [package scopes](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/pkgs) not available in nixpkgs or modified from it | +| `formatter` | I format nix code with [alejandra](https://github.com/kamadorueda/alejandra) | | `devShells.default` | A dev shell to build an ISO from the live-image nixosConfiguration | +| `devShells.ags` | A dev shell to have a NodeJS env when I enter my AGS's config directory | ### Flake Inputs -To allow use of the nix language for my inputs, I use [genflake](https://github.com/jorsn/flakegen). +To allow use of the full nix language for my inputs, I use [genflake](https://github.com/jorsn/flakegen). Therefore, the flake I edit is located at `./flake.in.nix`. I also prefer using a more descriptive format for my inputs like so: diff --git a/flake.in.nix b/flake.in.nix index 54a4995c..48647f6d 100644 --- a/flake.in.nix +++ b/flake.in.nix @@ -95,10 +95,14 @@ nixOnDroidConfigurations.default = mkNixOnDroid [./devices/android]; - legacyPackages = perSystem (system: pkgs: { - dracula = + legacyPackages = perSystem (system: pkgs: let + mkScope = file: pkgs.lib.recurseIntoAttrs - (pkgs.callPackage ./pkgs/dracula ({inherit mkVersion;} // inputs)); + (pkgs.callPackage file ({inherit mkVersion;} // inputs)); + in { + dracula = mkScope ./pkgs/dracula; + firefoxAddons = mkScope ./pkgs/firefox-addons; + mpvScripts = mkScope ./pkgs/mpv-scripts; }); packages = diff --git a/home/firefox/default.nix b/home/firefox/default.nix index f971fb3e..8639f4f7 100644 --- a/home/firefox/default.nix +++ b/home/firefox/default.nix @@ -1,16 +1,16 @@ { config, - pkgs, firefox-gx-src, + pkgs, + self, ... }: let inherit (config.vars) hostName; - inherit (import ../../lib.nix {}) mkVersion; - firefox-addons = pkgs.recurseIntoAttrs (pkgs.callPackage ./addons {}); + inherit (self.legacyPackages.${pkgs.system}) firefoxAddons; - firefox-gx = pkgs.callPackage ./firefox-gx { - inherit firefox-gx-src mkVersion; + firefox-gx = pkgs.callPackage ./gx-theme.nix { + inherit firefox-gx-src; }; in { home.file = { @@ -195,7 +195,7 @@ in { ]; }; - extensions = with firefox-addons; [ + extensions = with firefoxAddons; [ bitwarden checkmarks-web-ext darkreader diff --git a/home/firefox/firefox-gx/default.nix b/home/firefox/firefox-gx/default.nix deleted file mode 100644 index caa9b863..00000000 --- a/home/firefox/firefox-gx/default.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - lib, - firefox-gx-src, - mkVersion, - stdenvNoCC, -}: -stdenvNoCC.mkDerivation { - pname = "firefox-gx"; - version = mkVersion firefox-gx-src; - - src = firefox-gx-src; - - installPhase = '' - # Personal changes - sed -i 's/var(--fuchsia))/var(--purple))/' ./chrome/components/ogx_root-personal.css - sed -i 's#../newtab/wallpaper-dark1.png#../newtab/wallpaper-dark2.png#' ./chrome/components/ogx_root-personal.css - - mkdir -p $out - cp -r ./* $out - ''; - - meta = { - description = "Firefox Theme CSS to Opera GX Lovers"; - homepage = "https://github.com/Godiesc/firefox-gx"; - license = lib.licenses.mspl; - }; -} diff --git a/home/firefox/gx-theme.nix b/home/firefox/gx-theme.nix new file mode 100644 index 00000000..947bb6cf --- /dev/null +++ b/home/firefox/gx-theme.nix @@ -0,0 +1,28 @@ +{ + lib, + firefox-gx-src, + stdenvNoCC, +}: let + inherit (import ../../lib.nix {}) mkVersion; +in + stdenvNoCC.mkDerivation { + pname = "firefox-gx"; + version = mkVersion firefox-gx-src; + + src = firefox-gx-src; + + installPhase = '' + # Personal changes + sed -i 's/var(--fuchsia))/var(--purple))/' ./chrome/components/ogx_root-personal.css + sed -i 's#../newtab/wallpaper-dark1.png#../newtab/wallpaper-dark2.png#' ./chrome/components/ogx_root-personal.css + + mkdir -p $out + cp -r ./* $out + ''; + + meta = { + description = "Firefox Theme CSS to Opera GX Lovers"; + homepage = "https://github.com/Godiesc/firefox-gx"; + license = lib.licenses.mspl; + }; + } diff --git a/home/firefox/addons/ffz-settings (2023-12-13).json b/home/firefox/non-declarative-conf/ffz-settings (2023-12-13).json similarity index 100% rename from home/firefox/addons/ffz-settings (2023-12-13).json rename to home/firefox/non-declarative-conf/ffz-settings (2023-12-13).json diff --git a/home/mpv/default.nix b/home/mpv.nix similarity index 91% rename from home/mpv/default.nix rename to home/mpv.nix index df8b314c..ffea2f89 100644 --- a/home/mpv/default.nix +++ b/home/mpv.nix @@ -1,6 +1,9 @@ -{pkgs, ...} @ inputs: let - inherit (import ../../lib.nix {}) mkVersion; - mpvScripts = import ./scripts (inputs // {inherit mkVersion;}); +{ + pkgs, + self, + ... +}: let + inherit (self.legacyPackages.${pkgs.system}) mpvScripts; in { # For kdialog-open-files home.packages = with pkgs; [ diff --git a/home/mpv/scripts/default.nix b/home/mpv/scripts/default.nix deleted file mode 100644 index b4cb5751..00000000 --- a/home/mpv/scripts/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{pkgs, ...} @ inputs: let - buildLua = - pkgs.callPackage - "${pkgs.path}/pkgs/applications/video/mpv/scripts/buildLua.nix" {}; - - buildLuaScript = file: - pkgs.callPackage file (inputs // {inherit buildLua;}); -in - pkgs.recurseIntoAttrs { - modernx = buildLuaScript ./modernx.nix; - pointer-event = buildLuaScript ./pointer-event.nix; - touch-gestures = buildLuaScript ./touch-gestures.nix; - kdialog-open-files = buildLuaScript ./kdialog-open-files.nix; - persist-properties = buildLuaScript ./persist-properties.nix; - undo-redo = buildLuaScript ./undo-redo.nix; - } diff --git a/modules/hyprland/packages.nix b/modules/hyprland/packages.nix index cec91bf2..d8c6646e 100644 --- a/modules/hyprland/packages.nix +++ b/modules/hyprland/packages.nix @@ -19,7 +19,7 @@ in { home-manager.users.${mainUser} = { imports = [ ../../home/foot.nix - ../../home/mpv + ../../home/mpv.nix ../../home/obs.nix ({config, ...}: let diff --git a/pkgs/README.md b/pkgs/README.md new file mode 100644 index 00000000..d1d29aa7 --- /dev/null +++ b/pkgs/README.md @@ -0,0 +1,24 @@ +# Packages + +This directory encompasses every derivations for packages exposed by my flake. + +## List of my packages found in `self.packages` + +| Name | Source / Description | +| ------------------------------ | -------------------- | +| `coloryou` | A custom package to get the main colors from a picture I forked from [here](https://github.com/dharmx/vile/blob/7d486c128c7e553912673755f97b118aaab0193d/src/shell/playerctl.py#L2) | +| `curseforge-server-downloader` | [Github](https://github.com/Malpiszonekx4/curseforge-server-downloader) | +| `gpu-screen-recorder` | [Git](https://git.dec05eba.com/gpu-screen-recorder/about) | +| `pam-fprint-grosshack` | [GitLab](https://gitlab.com/mishakmak/pam-fprint-grosshack) | +| `pokemon-colorscripts` | [GitLab](https://gitlab.com/phoneybadger/pokemon-colorscripts) | +| `repl` | nix repl forked from [here](https://github.com/fufexan/dotfiles/blob/main/pkgs/repl/default.nix)noint are | +| `trash-d` | [Github](https://github.com/rushsteve1/trash-d) | + + +## List of package scopes found in `self.legacyPackages` + +| Name | Description | +| --------------- | ----------- | +| `dracula` | Themes for many apps from the [Dracula GitHub Org](https://github.com/dracula) | +| `firefoxAddons` | Firefox extensions updated with [mozilla-addons-to-nix](https://git.sr.ht/~rycee/mozilla-addons-to-nix) | +| `mpvScripts` | MPV scripts that I use that are not in nixpkgs | diff --git a/home/firefox/addons/addons.json b/pkgs/firefox-addons/addons.json similarity index 100% rename from home/firefox/addons/addons.json rename to pkgs/firefox-addons/addons.json diff --git a/home/firefox/addons/default.nix b/pkgs/firefox-addons/default.nix similarity index 52% rename from home/firefox/addons/default.nix rename to pkgs/firefox-addons/default.nix index 4adfd5b7..96fdebd0 100644 --- a/home/firefox/addons/default.nix +++ b/pkgs/firefox-addons/default.nix @@ -1,7 +1,9 @@ { fetchurl, lib, + pkgs, stdenv, + ... } @ args: let buildFirefoxXpiAddon = lib.makeOverridable ({ stdenv ? args.stdenv, @@ -37,21 +39,23 @@ inherit buildFirefoxXpiAddon fetchurl lib stdenv; }; in - packages - // { - inherit buildFirefoxXpiAddon; + lib.makeScope pkgs.newScope (_: + packages + // { + inherit buildFirefoxXpiAddon; - seventv = buildFirefoxXpiAddon { - pname = "frankerfacez"; - version = "4.0"; - addonId = "frankerfacez@frankerfacez.com"; - url = "https://cdn.frankerfacez.com/script/frankerfacez-4.0-an+fx.xpi"; - sha256 = "sha256-U/yAra2c+RlGSaQtHfBz9XYsoDaJ67gmPJBsFrpqoE8="; - meta = with lib; { - homepage = "https://www.frankerfacez.com/"; - description = "The Twitch Enhancement Suite. Get custom emotes and tons of new features you'll never want to go without."; - license = licenses.asl20; - platforms = platforms.all; + seventv = buildFirefoxXpiAddon { + pname = "frankerfacez"; + version = "4.0"; + addonId = "frankerfacez@frankerfacez.com"; + url = "https://cdn.frankerfacez.com/script/frankerfacez-4.0-an+fx.xpi"; + sha256 = "sha256-U/yAra2c+RlGSaQtHfBz9XYsoDaJ67gmPJBsFrpqoE8="; + meta = with lib; { + homepage = "https://www.frankerfacez.com/"; + description = "The Twitch Enhancement Suite. Get custom emotes and tons of new features you'll never want to go without."; + license = licenses.asl20; + platforms = platforms.all; + }; }; - }; - } + } + ) diff --git a/home/firefox/addons/generated-firefox-addons.nix b/pkgs/firefox-addons/generated-firefox-addons.nix similarity index 100% rename from home/firefox/addons/generated-firefox-addons.nix rename to pkgs/firefox-addons/generated-firefox-addons.nix diff --git a/pkgs/mpv-scripts/default.nix b/pkgs/mpv-scripts/default.nix new file mode 100644 index 00000000..f166bc35 --- /dev/null +++ b/pkgs/mpv-scripts/default.nix @@ -0,0 +1,16 @@ +{pkgs, ...} @ inputs: +pkgs.lib.makeScope pkgs.newScope (mpv: let + buildLua = + mpv.callPackage + "${pkgs.path}/pkgs/applications/video/mpv/scripts/buildLua.nix" {}; + + buildLuaScript = file: + mpv.callPackage file (inputs // {inherit buildLua;}); +in { + modernx = buildLuaScript ./modernx.nix; + pointer-event = buildLuaScript ./pointer-event.nix; + touch-gestures = buildLuaScript ./touch-gestures.nix; + kdialog-open-files = buildLuaScript ./kdialog-open-files.nix; + persist-properties = buildLuaScript ./persist-properties.nix; + undo-redo = buildLuaScript ./undo-redo.nix; +}) diff --git a/home/mpv/scripts/kdialog-open-files.nix b/pkgs/mpv-scripts/kdialog-open-files.nix similarity index 100% rename from home/mpv/scripts/kdialog-open-files.nix rename to pkgs/mpv-scripts/kdialog-open-files.nix diff --git a/home/mpv/scripts/modernx.nix b/pkgs/mpv-scripts/modernx.nix similarity index 100% rename from home/mpv/scripts/modernx.nix rename to pkgs/mpv-scripts/modernx.nix diff --git a/home/mpv/scripts/persist-properties.nix b/pkgs/mpv-scripts/persist-properties.nix similarity index 100% rename from home/mpv/scripts/persist-properties.nix rename to pkgs/mpv-scripts/persist-properties.nix diff --git a/home/mpv/scripts/pointer-event.nix b/pkgs/mpv-scripts/pointer-event.nix similarity index 100% rename from home/mpv/scripts/pointer-event.nix rename to pkgs/mpv-scripts/pointer-event.nix diff --git a/home/mpv/scripts/touch-gestures.nix b/pkgs/mpv-scripts/touch-gestures.nix similarity index 100% rename from home/mpv/scripts/touch-gestures.nix rename to pkgs/mpv-scripts/touch-gestures.nix diff --git a/home/mpv/scripts/undo-redo.nix b/pkgs/mpv-scripts/undo-redo.nix similarity index 100% rename from home/mpv/scripts/undo-redo.nix rename to pkgs/mpv-scripts/undo-redo.nix diff --git a/pkgs/repl/default.nix b/pkgs/repl/default.nix index d9a46679..1110e9c9 100644 --- a/pkgs/repl/default.nix +++ b/pkgs/repl/default.nix @@ -1,4 +1,4 @@ -# modified from https://github.com/gytis-ivaskevicius/flake-utils/plus +# modified from https://github.com/fufexan/dotfiles/blob/main/pkgs/repl/default.nix { coreutils, gnused,