refactor: rename some flake attr directories

This commit is contained in:
matt1432 2024-12-16 15:51:41 -05:00
parent 1ce40f2c1a
commit 6ca0d7248b
329 changed files with 178 additions and 139 deletions
nixFastChecks

View file

@ -0,0 +1,10 @@
{
pkgs,
self,
}: let
inherit (pkgs.lib) mapAttrs' nameValuePair;
in
mapAttrs'
(name: app:
nameValuePair "app_${name}" app)
self.appsPackages.${pkgs.system}

26
nixFastChecks/default.nix Normal file
View file

@ -0,0 +1,26 @@
# Inspired by :
# https://github.com/Mic92/dotfiles/blob/c2f538934d67417941f83d8bb65b8263c43d32ca/flake.nix#L168
{
perSystem,
self,
...
}: let
inherit (self.lib.attrs) recursiveUpdateList;
aptDevices = perSystem (pkgs:
import ./devices {
onlyApt = true;
inherit pkgs self;
});
apps = perSystem (pkgs: import ./apps {inherit pkgs self;});
devices = perSystem (pkgs: import ./devices {inherit pkgs self;});
devShells = perSystem (pkgs: import ./devShells {inherit pkgs self;});
packages = perSystem (pkgs: import ./packages {inherit pkgs self;});
in {
# Allow homie to serve a binary cache for the devices away from servivi
aptDevices = recursiveUpdateList [aptDevices devShells];
all = recursiveUpdateList [apps devices devShells packages];
inherit apps devices devShells packages;
}

View file

@ -0,0 +1,10 @@
{
pkgs,
self,
}: let
inherit (pkgs.lib) mapAttrs' nameValuePair;
in
mapAttrs'
(name: shell:
nameValuePair "devShell_${name}" shell)
self.devShells.${pkgs.system}

View file

@ -0,0 +1,19 @@
{
pkgs,
self,
onlyApt ? false,
}: let
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
mapAttrs'
(name: config:
nameValuePair "device_${name}" config.config.system.build.toplevel)
devices

View file

@ -0,0 +1,18 @@
{
pkgs,
self,
}: let
inherit (pkgs.lib) elem filterAttrs hasAttr mapAttrs' nameValuePair;
packages =
filterAttrs (
_: v:
!(hasAttr "platforms" v.meta)
|| elem pkgs.system v.meta.platforms
)
self.packages.${pkgs.system};
in
mapAttrs'
(name: pkg:
nameValuePair "pkg_${name}" pkg)
packages