From 6bb2b3c8c2fe81a13f95e611089b1d31a473c92f Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 28 Oct 2024 08:18:00 -0400 Subject: [PATCH] refactor: clean up nixFastBuild --- .../media/prowlarr/images/flaresolverr.nix | 4 +-- devices/servivi/modules/binary-cache.nix | 26 ++++++++++++------ flake.lock | Bin 57672 -> 57672 bytes .../generated-firefox-addons.nix | 6 ++-- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/devices/nos/modules/docker/media/prowlarr/images/flaresolverr.nix b/devices/nos/modules/docker/media/prowlarr/images/flaresolverr.nix index ab511702..b1ac9f52 100644 --- a/devices/nos/modules/docker/media/prowlarr/images/flaresolverr.nix +++ b/devices/nos/modules/docker/media/prowlarr/images/flaresolverr.nix @@ -1,8 +1,8 @@ pkgs: pkgs.dockerTools.pullImage rec { imageName = "21hsmw/flaresolverr"; - imageDigest = "sha256:a85e675e7b4e980e142d58e440dd3e1b6fa6bc10aabcc612727f81e34c28db80"; - sha256 = "1wn32jl4za7y4sj5ljz5m87z46maz65c4ckznz84mp15f008c5y4"; + imageDigest = "sha256:506b7f26aaf10e8c07ab22f74a7eea31eca66e263fe52d570b7bc0ef29952db9"; + sha256 = "1ll5f62r69hzizli0irpp1z1r4hmv9ps3pqzb1s8klvjrdgaxd22"; finalImageName = imageName; finalImageTag = "nodriver"; } diff --git a/devices/servivi/modules/binary-cache.nix b/devices/servivi/modules/binary-cache.nix index b829fc1a..187f48d1 100644 --- a/devices/servivi/modules/binary-cache.nix +++ b/devices/servivi/modules/binary-cache.nix @@ -7,7 +7,7 @@ inherit (config.vars) mainUser; inherit (config.sops) secrets; - nix-fast-buildPkg = nix-fast-build.packages.${pkgs.system}.nix-fast-build.override { + nix-fast-build-pkg = nix-fast-build.packages.${pkgs.system}.nix-fast-build.override { nix-eval-jobs = pkgs.nix-eval-jobs.override { nix = config.nix.package; @@ -16,19 +16,23 @@ nix = config.nix.package; }; }; + + nixFastBuild = pkgs.writeShellApplication { + name = "nixFastBuild"; + runtimeInputs = with pkgs; [gnugrep nix-fast-build-pkg]; + text = '' + cd "$FLAKE" || return + + nix-fast-build -f .#nixFastChecks + ''; + }; in { services.nix-serve = { enable = true; secretKeyFile = secrets.binary-cache-key.path; }; - environment.systemPackages = [ - nix-fast-buildPkg - ]; - - home-manager.users.${mainUser}.programs.bash.shellAliases = { - nix-fast-build = "nix-fast-build -f $FLAKE/.#nixFastChecks"; - }; + environment.systemPackages = [nix-fast-build-pkg nixFastBuild]; # Populate cache systemd = { @@ -41,7 +45,7 @@ in { path = [ - nix-fast-buildPkg + nix-fast-build-pkg config.nix.package ] ++ (builtins.attrValues { @@ -55,12 +59,16 @@ in { script = '' cd /tmp + if [[ -d ./nix-clone ]]; then rm -r ./nix-clone fi + git clone https://git.nelim.org/matt1432/nixos-configs.git nix-clone cd nix-clone + nix-fast-build -f .#nixFastChecks + cd .. rm -r nix-clone diff --git a/flake.lock b/flake.lock index 060228fcdb0b73cb6ab36c721b736521ececb461..af1f8ca4c2e29c7a3d1278d7e9c1f0ef458e338d 100644 GIT binary patch delta 367 zcmXw!%}N460Dv(KJ9R1gIaHUxXd!22XLn{UK|e}nid$snA()w+5lt)C#Ol}!M9wMb z(mk;74ea8vyamxCL_I)|m(Cv_A78&0?)Sn^?|hWG6cO{YFlRNrc$p|~uau~&R(U^3 z51S3(1u~N&_GY=+NVGr;CQt#SS|&6*W4?uJj<%yQ=5U~)z(Be}aI64Q$dS}%P)SBO z!b8TeYaS+cx?kdPWfVfdkO|$)FE@(SRQ~cjsMiZwH)x)uD~(!dBcQ1&zshg!S#Wn_ z>)6M%BF)>#v^l$8G_NLNKH8JFztJUzw1b4JrGOMF<^rq%gA{0=`94GpNrzLwZR3rl z|K09K`(-r(AtvVee!;rb7rs^Ixicq-=WxJ^>+62~pcJpsJWmFhs>FP)K(hYHsW*I{ sGMxb$mSac_!tGq@Z71BV}c$^ZZW delta 368 zcmXw!%Sr-K0EQ8hT(ycW8zBgigg7(jHfIwkCOTo3all8F-QHwzC}*Szj|hf|yfxF{v%(6JKcuNumj0h(iYgPN>$5GG8*s zSI{QH9L4vC-{N&A28e^KIdi)%8g8|g@1(ow{9&cJSH@v0e^n}mh3jnE>xKP(P(T^` zy6T#?w`#8LH_fM6Fq5a{$7y^^Va+*12tdRbCDK8H3XB!NKJ>AYnhPbRH3$D+hm)uG z-57v2cFe|0B4yuQ%0k`kxy78vm7{CHf$A69xS2c2hCvmcl|8qtddH1oaTdK|24nki mx|kG{V@5PW6vLSX5L_xEZAu&