refactor(cache): move nix-fast-build-pkg to overlays
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-12-11 11:42:40 -05:00
parent 08e1645697
commit 3cb4315fab
4 changed files with 36 additions and 38 deletions

View file

@ -1,35 +1,24 @@
{
config,
mainUser,
nix-eval-jobs,
nix-fast-build,
pkgs,
...
}: let
# FIXME: move nix-fast-build-pkg to overlays, make #nixFastChecks an attrset of all, packages, devices and aptDevices. add binary cache at apartment
# FIXME: make #nixFastChecks an attrset of all, packages, devices and aptDevices
# add binary cache at apartment
inherit (builtins) attrValues;
inherit (config.sops) secrets;
nix-fast-build-pkg = nix-fast-build.packages.${pkgs.system}.nix-fast-build.override {
nix-eval-jobs =
nix-eval-jobs.packages.${pkgs.system}.default.override {
nix = config.nix.package;
}
// {
nix = config.nix.package;
};
};
nixFastBuild = pkgs.writeShellApplication {
name = "nixFastBuild";
runtimeInputs = builtins.attrValues {
runtimeInputs = attrValues {
inherit
(pkgs)
gnugrep
nix-fast-build
nix-output-monitor
;
inherit nix-fast-build-pkg;
};
text = ''
@ -45,11 +34,10 @@
in {
services.nix-serve = {
enable = true;
package = pkgs.nix-serve-ng;
secretKeyFile = secrets.binary-cache-key.path;
};
environment.systemPackages = [nix-fast-build-pkg nixFastBuild];
environment.systemPackages = [pkgs.nix-fast-build nixFastBuild];
# Populate cache
systemd = {
@ -60,17 +48,16 @@ in {
Group = config.users.users.${mainUser}.group;
};
path = builtins.attrValues {
path = attrValues {
inherit
(pkgs)
bash
git
nix-fast-build
openssh
;
inherit (config.nix) package;
inherit nix-fast-build-pkg;
};
script = ''

View file

@ -134,7 +134,7 @@
perSystem (pkgs:
import ./packages {inherit inputs mkVersion pkgs;});
overlays = import ./overlays {};
overlays = import ./overlays {inherit self;};
apps =
perSystem (pkgs:

View file

@ -1,5 +1,5 @@
{...}: {
{self, ...}: {
build-failures = import ./build-failures;
nix-version = import ./nix-version;
nix-version = import ./nix-version self;
xdg-desktop-portal-kde = import ./xdg-desktop-portal-kde;
}

View file

@ -1,15 +1,26 @@
{nix ? null}: (
final: prev:
builtins.mapAttrs
(n: v:
if nix == null
then prev.${n}
else v)
{
inherit nix;
self: {nix ? null}: final: prev: let
inherit (builtins) mapAttrs;
inherit (self.inputs) nix-eval-jobs nix-fast-build;
nix-serve-ng = prev.nix-serve-ng.override {
inherit nix;
};
}
)
nullCheck = n: v:
if nix == null
then prev.${n}
else v;
in
mapAttrs nullCheck {
inherit nix;
nix-serve = prev.nix-serve-ng.override {
inherit nix;
};
nix-fast-build = nix-fast-build.packages.${final.system}.nix-fast-build.override {
nix-eval-jobs =
nix-eval-jobs.packages.${final.system}.default.override {
inherit nix;
}
// {
inherit nix;
};
};
}