Skip to content

Commit

Permalink
eval-machine-info: removing problematic resources entries better
Browse files Browse the repository at this point in the history
  • Loading branch information
pasqui23 committed Feb 4, 2023
1 parent 38f27a5 commit fecbbf0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions nix/eval-machine-info.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ in rec {
# for backward compatibility
network = lib.mapAttrs (n: v: [v]) net.config;
networks = [ net.config ];

# skip problematic resources entries
resources = removeAttrs net.config.resources ["deployment" "_name" "_type"];
defaults = [ net.config.defaults ];
nodes = #TODO: take options and other modules outputs for each node
lib.mapAttrs (n: v: {
Expand All @@ -59,6 +56,11 @@ in rec {
inherit (v.nixpkgs) pkgs;
}) net.config.nodes;

# ./resources.nix is imported in resource opt but does not define resource types
# we have to remove those entries as they do not otherwise conform to the resource schema
resources = removeAttrs net.config.resources (lib.attrNames (import ./resource.nix {
name = ""; inherit lib; }).options);

importedPluginNixExprs = map import pluginNixExprs;
pluginOptions = lib.lists.concatMap (e: e.options) importedPluginNixExprs;
pluginResources = map (e: e.resources) importedPluginNixExprs;
Expand Down
2 changes: 1 addition & 1 deletion nix/resource.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, lib, name, ... }:
{ lib, name, ... }:

with lib;

Expand Down

0 comments on commit fecbbf0

Please sign in to comment.