Use pre-cached nixpkgs

This commit is contained in:
Manuel Thalmann 2024-06-23 12:19:59 +02:00
parent 55c0513459
commit 311e4cf92a
2 changed files with 4 additions and 1 deletions

View file

@ -1,9 +1,12 @@
#!/bin/bash
contextRoot="$(mktemp -d)";
rootHome="$contextRoot/airootfs/root";
nixDir="$contextRoot/nix/var/nix/profiles/per-user/root/channels/nixpkgs";
profileDir="/mnt/archiso-valhalla";
mkdir -p "$rootHome";
git clone .. "$rootHome/PortValhalla";
git clone https://github.com/NixOS/nixpkgs.git --depth=1 -b nixos-24.05 "$nixDir";
rm -rf "$nixDir/.git";
sudo mount --mkdir -t overlay overlay -o lowerdir=.:"$contextRoot" "$profileDir";
sudo mkarchiso "$@" "$profileDir";
sudo umount "$profileDir";

View file

@ -2,7 +2,7 @@
function evalModule() {
local modulePath="$1";
local property="$2";
local nixPkgs='import (fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.05") { config = {}; overlays = []; }';
local nixPkgs='import <nixpkgs> { config = {}; overlays = []; }';
nix eval --file "$modulePath" "${@:3}" --apply "_: (($nixPkgs).lib.evalModules { modules = [ _ ]; }).config.$property";
}