Skip to content

Commit

Permalink
feat: use sparseCheckout feature of nvfetcher
Browse files Browse the repository at this point in the history
  • Loading branch information
wrvsrx committed May 6, 2024
1 parent f52e325 commit fc24fa0
Show file tree
Hide file tree
Showing 8 changed files with 237 additions and 25 deletions.
31 changes: 31 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
};
nixpkgs.follows = "flake-lock/nixpkgs";
flake-parts.follows = "flake-lock/flake-parts";
nvfetcher = {
url = "github:wrvsrx/nvfetcher/sparseCheckout";
inputs.nixpkgs.follows = "flake-lock/nixpkgs";
inputs.flake-utils.follows = "flake-lock/flake-utils";
inputs.flake-compat.follows = "flake-lock/flake-compat";
};
};
outputs =
inputs':
Expand Down Expand Up @@ -102,7 +108,7 @@
packages = pkgs-to-packages pkgs;
checks = builtins.removeAttrs packages [ "yuzu" ];
formatter = pkgs.nixfmt-rfc-style;
devShells.default = pkgs.mkShell { nativeBuildInputs = [ pkgs.nvfetcher ]; };
devShells.default = pkgs.mkShell { nativeBuildInputs = [ inputs.nvfetcher.packages."${system}".default ]; };
};
}
);
Expand Down
13 changes: 3 additions & 10 deletions pkgs/to-normal-packages/cuda-samples/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,11 @@
pkg-config,
haskellPackages,
stdenv,
fetchFromGitHub,
source,
}:
stdenv.mkDerivation rec {
pname = "cuda-samples";
stdenv.mkDerivation {
inherit (source) pname src;
version = "12.2";
src = fetchFromGitHub {
owner = "NVIDIA";
repo = "cuda-samples";
rev = "03309a2d4275a9186b748e033ee5f90a11492a2f";
sha256 = "sha256-lt6HpU1hmRf6pISpDnlJ38ovWuVOIFGR9DCC8rDYaiQ=";
sparseCheckout = [ "Common" ];
};
patches = [
./meson.patch
./cpp20.patch
Expand Down
9 changes: 7 additions & 2 deletions pkgs/to-normal-packages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ in
rec {
auth-thu = callPackage ./auth-thu { source = sources.auth-thu; };
autodiff = callPackage ./autodiff { source = sources.autodiff; };
inherit (callPackage ./noto-fonts-cjk { })
inherit
(callPackage ./noto-fonts-cjk {
sources = {
inherit (sources) noto-fonts-cjk-sans-fix-weight noto-fonts-cjk-serif-fix-weight;
};
})
noto-fonts-cjk-sans-fix-weight
noto-fonts-cjk-serif-fix-weight
;
Expand All @@ -19,7 +24,7 @@ rec {
happly = callPackage ./happly { source = sources.happly; };
cnpy = callPackage ./cnpy { source = sources.cnpy; };
amgcl = callPackage ./amgcl { source = sources.amgcl; };
cuda-samples = callPackage ./cuda-samples { };
cuda-samples = callPackage ./cuda-samples { source = sources.cuda-samples; };
structopt = callPackage ./structopt { source = sources.structopt; };
utfcpp = callPackage ./utfcpp { source = sources.utfcpp; };
seal_lake = callPackage ./seal_lake { source = sources.seal_lake; };
Expand Down
17 changes: 5 additions & 12 deletions pkgs/to-normal-packages/noto-fonts-cjk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,18 @@
imagemagick,
zopfli,
buildPackages,
sources,
}:
let
mkNotoCJK =
{
typeface,
version,
sha256,
src,
}:
stdenvNoCC.mkDerivation {
pname = "noto-fonts-cjk-${lib.toLower typeface}";
inherit version;

src = fetchFromGitHub {
owner = "googlefonts";
repo = "noto-cjk";
rev = "${typeface}${version}";
inherit sha256;
sparseCheckout = [ "${typeface}/OTC" ];
};
inherit version src;

installPhase = ''
install -m444 -Dt $out/share/fonts/opentype/noto-cjk ${typeface}/OTC/*.ttc
Expand Down Expand Up @@ -66,12 +59,12 @@ in
noto-fonts-cjk-sans-fix-weight = mkNotoCJK {
typeface = "Sans";
version = "2.004";
sha256 = "sha256-GXULnRPsIJRdiL3LdFtHbqTqSvegY2zodBxFm4P55to=";
inherit (sources.noto-fonts-cjk-sans-fix-weight) src;
};

noto-fonts-cjk-serif-fix-weight = mkNotoCJK {
typeface = "Serif";
version = "2.001";
sha256 = "sha256-QZGnFXQlwfsOchKipimLczb8xV9BODMxpoxIXckoSYw=";
inherit (sources.noto-fonts-cjk-serif-fix-weight) src;
};
}
Loading

0 comments on commit fc24fa0

Please sign in to comment.