Skip to content

Commit 49d5f5c

Browse files
committed
eval-machine-info: removing problematic resources entries better
1 parent 38f27a5 commit 49d5f5c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

nix/eval-machine-info.nix

+5-3
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ in rec {
4848
# for backward compatibility
4949
network = lib.mapAttrs (n: v: [v]) net.config;
5050
networks = [ net.config ];
51-
52-
# skip problematic resources entries
53-
resources = removeAttrs net.config.resources ["deployment" "_name" "_type"];
5451
defaults = [ net.config.defaults ];
5552
nodes = #TODO: take options and other modules outputs for each node
5653
lib.mapAttrs (n: v: {
@@ -59,6 +56,11 @@ in rec {
5956
inherit (v.nixpkgs) pkgs;
6057
}) net.config.nodes;
6158

59+
# ./resource.nix is imported in resource opt but does not define resource types
60+
# we have to remove those entries as they do not otherwise conform to the resource schema
61+
resources = removeAttrs net.config.resources (lib.attrNames (import ./resource.nix {
62+
name = ""; inherit lib; }).options);
63+
6264
importedPluginNixExprs = map import pluginNixExprs;
6365
pluginOptions = lib.lists.concatMap (e: e.options) importedPluginNixExprs;
6466
pluginResources = map (e: e.resources) importedPluginNixExprs;

nix/resource.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ config, lib, name, ... }:
1+
{ lib, name, ... }:
22

33
with lib;
44

0 commit comments

Comments
 (0)