diff --git a/default.nix b/default.nix index b794601c..3aa7c49d 100644 --- a/default.nix +++ b/default.nix @@ -14,6 +14,6 @@ }; }; - packages = import ./nix/packages; + packages = import ./nix/packages {inherit sources;}; overlays = import ./nix/overlays; } diff --git a/nix/configurations/installer.nix b/nix/configurations/installer.nix index ad57b887..3c731a47 100644 --- a/nix/configurations/installer.nix +++ b/nix/configurations/installer.nix @@ -35,7 +35,7 @@ in ../overlays/nur.nix ../overlays/nix-tree.nix - ../overlays/packages.nix + ../packages/overlay.nix ]; }; diff --git a/nix/configurations/tungsten.nix b/nix/configurations/tungsten.nix index e40d74b1..648f8677 100644 --- a/nix/configurations/tungsten.nix +++ b/nix/configurations/tungsten.nix @@ -36,7 +36,7 @@ in ../overlays/wired-notify.nix ../overlays/nix-tree.nix - ../overlays/packages.nix + ../packages/overlay.nix ]; # Set NIX_PATH and flake registry at the same time diff --git a/nix/configurations/tungsten/home/programs.nix b/nix/configurations/tungsten/home/programs.nix index d0b37625..4b3bb698 100644 --- a/nix/configurations/tungsten/home/programs.nix +++ b/nix/configurations/tungsten/home/programs.nix @@ -1,6 +1,4 @@ -{pkgs, ...}: let - inherit (pkgs) myPkgs; -in { +{pkgs, ...}: { imports = [ # # CLI / TUI @@ -14,23 +12,23 @@ in { pkgs.p7zip pkgs.bc pkgs.dig - myPkgs.hutils + pkgs.hutils # pkgs.miniserve pkgs.agenix # pdf # pkgs.poppler_utils # pdfseparate, pdfunite - # myPkgs.easyscan + # pkgs.easyscan # fun - # myPkgs.prop-solveur - # myPkgs.hbrainfuck + # pkgs.prop-solveur + # pkgs.hbrainfuck # pkgs.lucky-commit # pretty tui tools pkgs.du-dust pkgs.tldr - myPkgs.tokei + pkgs.tokei pkgs.hyperfine pkgs.watchexec pkgs.onefetch @@ -87,7 +85,7 @@ in { # pkgs.aseprite # wm utilities - myPkgs.xbrightness + pkgs.xbrightness pkgs.dmenu pkgs.xclip pkgs.playerctl # talk to playerctld diff --git a/nix/configurations/vanadium.nix b/nix/configurations/vanadium.nix index ff12a241..25423725 100644 --- a/nix/configurations/vanadium.nix +++ b/nix/configurations/vanadium.nix @@ -43,7 +43,9 @@ in ../overlays/nix-tree.nix ../overlays/wallpapers.nix - ../overlays/packages.nix + ../overlays/iosevka.nix + ../packages/overlay.nix + ./vanadium/overlay.nix # removed, but I need it for PLFA! diff --git a/nix/configurations/vanadium/home/programs.nix b/nix/configurations/vanadium/home/programs.nix index ebead13a..a0958426 100644 --- a/nix/configurations/vanadium/home/programs.nix +++ b/nix/configurations/vanadium/home/programs.nix @@ -1,6 +1,8 @@ -{pkgs, config, ...}: let - inherit (pkgs) myPkgs; -in { +{ + pkgs, + config, + ... +}: { home.sessionPath = [ "${config.home.homeDirectory}/.local/bin" ]; @@ -18,26 +20,26 @@ in { pkgs.p7zip pkgs.bc pkgs.dig - myPkgs.hutils + pkgs.hutils pkgs.miniserve pkgs.agenix # pdf pkgs.poppler_utils # pdfseparate, pdfunite - myPkgs.easyscan + pkgs.easyscan # fun - myPkgs.prop-solveur - myPkgs.hbrainfuck + pkgs.prop-solveur + pkgs.hbrainfuck pkgs.lucky-commit # research - myPkgs.necrolib + pkgs.necrolib # pretty tui tools pkgs.du-dust pkgs.tldr - myPkgs.tokei + pkgs.tokei pkgs.hyperfine pkgs.watchexec pkgs.onefetch @@ -100,7 +102,7 @@ in { pkgs.iamb # wm utilities - myPkgs.xbrightness + pkgs.xbrightness pkgs.dmenu pkgs.xclip pkgs.maim diff --git a/nix/homeModules/common/kitty.nix b/nix/homeModules/common/kitty.nix index c27ea1b7..235165c9 100644 --- a/nix/homeModules/common/kitty.nix +++ b/nix/homeModules/common/kitty.nix @@ -5,16 +5,14 @@ ... }: let cfg = config.programs.kitty; - - inherit (pkgs) myPkgs; in { config = lib.mkIf cfg.enable { home.packages = [ - myPkgs.altiosevka-nerd-font-mono + pkgs.nerd-fonts.iosevka ]; programs.kitty = lib.mkIf cfg.enable { - font.name = "family=\"Altiosevka NFM\""; + font.name = "family=\"Iosevka NFM\""; settings = { # Make text thicker diff --git a/nix/nixosModules/extra/typst-bot.nix b/nix/nixosModules/extra/typst-bot.nix index 28081ddb..e10b06fc 100644 --- a/nix/nixosModules/extra/typst-bot.nix +++ b/nix/nixosModules/extra/typst-bot.nix @@ -46,7 +46,7 @@ in { ''; # Don't pollute the global path - path = [pkgs.myPkgs.typst-bot]; + path = [pkgs.typst-bot]; script = "typst-bot"; serviceConfig = { diff --git a/nix/overlays/iosevka.nix b/nix/overlays/iosevka.nix new file mode 100644 index 00000000..3e8404bb --- /dev/null +++ b/nix/overlays/iosevka.nix @@ -0,0 +1,95 @@ +final: prev: rec { + nerd-fonts = let + mkNerdFont = final.callPackage ../lib/mkNerdFont.nix {}; + in + prev.nerd-fonts + // { + iosevka = mkNerdFont { + font = iosevka; + extraArgs = [ + "--name {/.}-NFM" + "--use-single-width-glyphs" + ]; + }; + }; + + iosevka = prev.iosevka.override { + set = "custom"; + /* + Guide: https://github.com/be5invis/Iosevka/blob/main/doc/custom-build.md + + Use `term` spacing to avoid dashed arrow issue + https://github.com/ryanoasis/nerd-fonts/issues/1018 + */ + privateBuildPlan = { + family = "Iosevka"; + noLigation = true; + serifs = "sans"; + spacing = "term"; + + variants = { + design = { + ampersand = "et-tailed"; + capital-q = "crossing"; + capital-z = "straight-serifless-with-crossbar"; + cent = "open"; + dollar = "open"; + lig-double-arrow-bar = "with-notch"; + lig-equal-chain = "with-notch"; + lig-hyphen-chain = "with-notch"; + lig-plus-chain = "with-notch"; + lig-single-arrow-bar = "with-notch"; + lower-lambda = "tailed-turn"; + number-sign = "slanted"; + percent = "rings-continuous-slash-also-connected"; + seven = "straight-serifless-crossbar"; + }; + italic = { + v = "cursive-serifless"; + w = "cursive-serifless"; + }; + }; + + weights = { + Bold = { + shape = 680; + menu = 680; + css = 680; + }; + Regular = { + shape = 480; + menu = 480; + css = 480; + }; + }; + + widths = { + Extended = { + shape = 600; + menu = 7; + css = "expanded"; + }; + Normal = { + shape = 500; + menu = 5; + css = "normal"; + }; + }; + + slopes = { + Upright = { + angle = 0; + css = "normal"; + menu = "upright"; + shape = "upright"; + }; + Italic = { + angle = 9.4; + shape = "italic"; + menu = "italic"; + css = "italic"; + }; + }; + }; + }; +} diff --git a/nix/overlays/packages.nix b/nix/overlays/packages.nix deleted file mode 100644 index 67fcce1d..00000000 --- a/nix/overlays/packages.nix +++ /dev/null @@ -1,3 +0,0 @@ -final: _: { - myPkgs = final.callPackages ../packages {}; -} diff --git a/nix/packages/altiosevka/buildplan.toml b/nix/packages/altiosevka/buildplan.toml deleted file mode 100644 index aecd1c7a..00000000 --- a/nix/packages/altiosevka/buildplan.toml +++ /dev/null @@ -1,26 +0,0 @@ -[buildPlans.altiosevka] -family = "iosevka" -spacing = "term" -serifs = "sans" -noLigation = true - -[buildPlans.altiosevka.variants.design] -capital-z = 'straight-serifless-with-crossbar' -capital-q = 'crossing' -lower-lambda = 'tailed-turn' -seven = 'straight-serifless-crossbar' -number-sign = 'slanted' -ampersand = "et-tailed" -dollar = 'open' -cent = "open" -percent = 'rings-continuous-slash-also-connected' -# explicitly declare with-notch -lig-equal-chain = 'with-notch' -lig-hyphen-chain = 'with-notch' -lig-plus-chain = 'with-notch' -lig-double-arrow-bar = 'with-notch' -lig-single-arrow-bar = 'with-notch' - -[buildPlans.altiosevka.variants.italic] -v = "cursive-serifless" -w = "cursive-serifless" diff --git a/nix/packages/altiosevka/default.nix b/nix/packages/altiosevka/default.nix deleted file mode 100644 index c6e6ebfe..00000000 --- a/nix/packages/altiosevka/default.nix +++ /dev/null @@ -1,17 +0,0 @@ -{iosevka}: let - pname = "altiosevka"; -in - (iosevka.overrideAttrs (_: { - inherit pname; - })) - .override - { - set = pname; - /* - Guide: https://github.com/be5invis/Iosevka/blob/main/doc/custom-build.md - - Use `term` spacing to avoid dashed arrow issue - https://github.com/ryanoasis/nerd-fonts/issues/1018 - */ - privateBuildPlan = builtins.readFile ./buildplan.toml; - } diff --git a/nix/packages/by-name.nix b/nix/packages/by-name.nix deleted file mode 100644 index 04883288..00000000 --- a/nix/packages/by-name.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - sources ? import ../sources.nix, - pkgs ? import sources.nixpkgs {}, -}: let - inherit (pkgs) lib; -in - lib.mapAttrs - (name: _: pkgs.callPackage (./by-name + "/${name}/package.nix") {}) - ( - lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./by-name) - ) diff --git a/nix/packages/default.nix b/nix/packages/default.nix index 49124173..a56b9e65 100644 --- a/nix/packages/default.nix +++ b/nix/packages/default.nix @@ -1,3 +1,11 @@ -args: -import ./top-level.nix args -// import ./by-name.nix args +{sources ? import ../sources.nix}: let + scopeOverlay = overlay: final: prev: {export = prev.export or {} // overlay final prev;}; +in + ( + import sources.nixpkgs { + overlays = map scopeOverlay [ + (import ./overlay.nix) + (import ../overlays/iosevka.nix) + ]; + } + ).export diff --git a/nix/packages/overlay.nix b/nix/packages/overlay.nix new file mode 100644 index 00000000..2b635dc2 --- /dev/null +++ b/nix/packages/overlay.nix @@ -0,0 +1,7 @@ +final: prev: let + inherit (prev) lib; +in + lib.mapAttrs (name: _: final.callPackage (./by-name + "/${name}/package.nix") {}) + ( + lib.filterAttrs (_: type: type == "directory") (builtins.readDir ./by-name) + ) diff --git a/nix/packages/top-level.nix b/nix/packages/top-level.nix deleted file mode 100644 index a7af20ea..00000000 --- a/nix/packages/top-level.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ - sources ? import ../sources.nix, - pkgs ? import sources.nixpkgs {}, - ... -}: let - iosevka-pin = import sources.pin-iosevka {}; - mkNerdFont = iosevka-pin.callPackage ../lib/mkNerdFont.nix {}; -in rec { - # fonts - altiosevka = iosevka-pin.callPackage ./altiosevka {}; - altiosevka-nerd-font-mono = mkNerdFont { - font = altiosevka; - extraArgs = [ - "--name {/.}-NFM" - "--use-single-width-glyphs" - ]; - }; -} diff --git a/shell.nix b/shell.nix index fc27f64c..5cea379e 100644 --- a/shell.nix +++ b/shell.nix @@ -4,7 +4,7 @@ import sources.nixpkgs { overlays = map import [ ./nix/overlays/disko.nix - ./nix/overlays/packages.nix + ./nix/packages/overlay.nix ]; }, }: