feat(checks): make #nixFastChecks an attrset
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-12-11 12:05:16 -05:00
parent 3cb4315fab
commit 1fd44269a2
5 changed files with 29 additions and 11 deletions

View file

@ -6,5 +6,5 @@
in in
mapAttrs' mapAttrs'
(name: app: (name: app:
nameValuePair "app-${name}" app) nameValuePair "app_${name}" app)
self.appsPackages.${pkgs.system} self.appsPackages.${pkgs.system}

View file

@ -5,5 +5,13 @@
apps = import ./apps {inherit pkgs self;}; apps = import ./apps {inherit pkgs self;};
devices = import ./devices {inherit pkgs self;}; devices = import ./devices {inherit pkgs self;};
packages = import ./packages {inherit pkgs self;}; packages = import ./packages {inherit pkgs self;};
in in {
apps // devices // packages # Allow homie to serve a binary cache for the devices away from servivi
aptDevices = import ./devices {
onlyApt = true;
inherit pkgs self;
};
all = apps // devices // packages;
inherit apps packages devices;
}

View file

@ -2,9 +2,18 @@
{ {
pkgs, pkgs,
self, self,
onlyApt ? false,
}: let }: let
inherit (pkgs.lib) filterAttrs mapAttrs' nameValuePair; inherit (pkgs.lib) elem filterAttrs mapAttrs' nameValuePair;
devices = filterAttrs (n: config: let
isSameSystem = config.pkgs.system == pkgs.system;
in
if onlyApt
then isSameSystem && elem n ["bbsteamie" "binto" "homie" "wim"]
else isSameSystem)
self.nixosConfigurations;
in in
mapAttrs' mapAttrs'
(name: config: nameValuePair "nixos-${name}" config.config.system.build.toplevel) (name: config: nameValuePair "device_${name}" config.config.system.build.toplevel)
((filterAttrs (_: config: config.pkgs.system == pkgs.system)) self.nixosConfigurations) devices

View file

@ -2,7 +2,7 @@
pkgs, pkgs,
self, self,
}: let }: let
inherit (pkgs.lib) elem filterAttrs hasAttr; inherit (pkgs.lib) elem filterAttrs hasAttr mapAttrs' nameValuePair;
packages = packages =
filterAttrs ( filterAttrs (
@ -12,4 +12,6 @@
) )
self.packages.${pkgs.system}; self.packages.${pkgs.system};
in in
mapAttrs'
(name: pkg: nameValuePair "pkg_${name}" pkg)
packages packages

View file

@ -4,8 +4,7 @@
pkgs, pkgs,
... ...
}: let }: let
# FIXME: make #nixFastChecks an attrset of all, packages, devices and aptDevices # FIXME: add binary cache at apartment
# add binary cache at apartment
inherit (builtins) attrValues; inherit (builtins) attrValues;
inherit (config.sops) secrets; inherit (config.sops) secrets;
@ -28,7 +27,7 @@
nom build --no-link \ nom build --no-link \
..#nixosConfigurations.homie.config.services.home-assistant.package ..#nixosConfigurations.homie.config.services.home-assistant.package
nix-fast-build -f ..#nixFastChecks "$@" nix-fast-build -f ..#nixFastChecks.${pkgs.system}.all "$@"
''; '';
}; };
in { in {
@ -70,7 +69,7 @@ in {
git clone https://git.nelim.org/matt1432/nixos-configs.git nix-clone git clone https://git.nelim.org/matt1432/nixos-configs.git nix-clone
cd nix-clone cd nix-clone
nix-fast-build -f .#nixFastChecks nix-fast-build -f .#nixFastChecks.${pkgs.system}.all
cd .. cd ..
rm -r nix-clone rm -r nix-clone