diff --git a/bootstrap/bootstrap.nix b/bootstrap/bootstrap.nix index 1335efd..02d555e 100644 --- a/bootstrap/bootstrap.nix +++ b/bootstrap/bootstrap.nix @@ -1,4 +1,4 @@ -{ pkgs, callPackage, lib, ... }: let +{ pkgs, callPackage, lib, extraPackages ? [], withFonts ? false, ... }: let aarch64-pkgs = pkgs.pkgsCross.aarch64-multiplatform; in @@ -6,7 +6,7 @@ with builtins; with lib; let - env = callPackage ./environment {}; + env = callPackage ./environment { inherit extraPackages withFonts; }; info = readFile "${pkgs.closureInfo { rootPaths = [ env ]; }}/store-paths"; bootstrap = pkgs.runCommand "bootstrap" {} '' diff --git a/bootstrap/environment/default.nix b/bootstrap/environment/default.nix index 7d1b525..e6b6cf7 100644 --- a/bootstrap/environment/default.nix +++ b/bootstrap/environment/default.nix @@ -1,4 +1,4 @@ -{ pkgs, buildEnv, callPackage, lib, inputs }: +{ pkgs, buildEnv, callPackage, lib, inputs, extraPackages ? [], withFonts ? false }: with builtins; with lib; @@ -16,7 +16,7 @@ in buildEnv { login env certs busybox zip - chromium fonts nodejs - ]; + ] ++ (optional withFonts fonts) + ++ extraPackages; } diff --git a/bootstrap/environment/fonts.nix b/bootstrap/environment/fonts.nix index 1e1f462..e458437 100644 --- a/bootstrap/environment/fonts.nix +++ b/bootstrap/environment/fonts.nix @@ -1,11 +1,8 @@ -{ runCommand, makeFontsConf, noto-fonts, noto-fonts-cjk-sans }: let +{ runCommand, makeFontsConf, source-han-sans }: let fonts = makeFontsConf { - fontDirectories = [ - noto-fonts - noto-fonts-cjk-sans - ]; + fontDirectories = [ source-han-sans ]; }; in runCommand "etc-fonts" {} '' mkdir -p $out/etc/fonts ln -s ${fonts} $out/etc/fonts/fonts.conf -'' \ No newline at end of file +'' diff --git a/bootstrap/flake.nix b/bootstrap/flake.nix index 2e8b28a..bd3cd7a 100644 --- a/bootstrap/flake.nix +++ b/bootstrap/flake.nix @@ -20,14 +20,28 @@ }) ]; }; + aarch64-pkgs = import nixpkgs { + system = "aarch64-linux"; + }; in { - packages.bootstrap = pkgs.callPackage ./bootstrap.nix {}; - apps.copy = mkApp { - drv = pkgs.writeScriptBin "copy" '' - FOLDER=../app/src/main/assets/bootstrap - mkdir -p $FOLDER - cp -f ${self.packages.${system}.bootstrap}/* $FOLDER - ''; + packages = { + bootstrap = pkgs.callPackage ./bootstrap.nix {}; + bootstrap-extra = pkgs.callPackage ./bootstrap.nix { + extraPackages = with aarch64-pkgs; [ chromium ]; + withFonts = true; + }; + }; + apps = let + app = bootstrap: mkApp { + drv = pkgs.writeScriptBin "copy" '' + FOLDER=../app/src/main/assets/bootstrap + mkdir -p $FOLDER + cp -f ${bootstrap}/* $FOLDER + ''; + }; + in { + copy = app self.packages.${system}.bootstrap; + copy-extra = app self.packages.${system}.bootstrap-extra; }; }); }