Unverified Commit cb731c65 authored by Ivan Kovnatsky's avatar Ivan Kovnatsky
Browse files

netdata: use lm_sensors only on Linux in postFixup step

```console
error:
       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       … while evaluating derivation 'darwin-system-25.05.2456ff5'
         whose name attribute is located at /nix/store/ci0w02z7bzdvy889jac8g45xkv3lx9i0-source/pkgs/stdenv/generic/make-derivation.nix:480:13

       … while evaluating attribute 'activationScript' of derivation 'darwin-system-25.05.2456ff5'
         at /nix/store/xjlh0pvwqz7qbhkv7y40a508ps8r0ffv-source/modules/system/default.nix:97:7:
           96|
           97|       activationScript = cfg.activationScripts.script.text;
             |       ^
           98|

       … while evaluating the option `system.activationScripts.script.text':

       … while evaluating definitions from `/nix/store/xjlh0pvwqz7qbhkv7y40a508ps8r0ffv-source/modules/system/activation-scripts.nix':

       … while evaluating the option `system.activationScripts.applications.text':

       … while evaluating definitions from `/nix/store/xjlh0pvwqz7qbhkv7y40a508ps8r0ffv-source/modules/system/applications.nix':

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: Package ‘lm-sensors-3.6.0’ in /nix/store/ci0w02z7bzdvy889jac8g45xkv3lx9i0-source/pkgs/by-name/lm/lm_sensors/package.nix:97 is not available on the requested hostPlatform:
         hostPlatform.config = "arm64-apple-darwin"
         package.meta.platforms = [
           "aarch64-linux"
           "armv5tel-linux"
           "armv6l-linux"
           "armv7a-linux"
           "armv7l-linux"
           "i686-linux"
           "loongarch64-linux"
           "m68k-linux"
           "microblaze-linux"
           "microblazeel-linux"
           "mips-linux"
           "mips64-linux"
           "mips64el-linux"
           "mipsel-linux"
           "powerpc64-linux"
           "powerpc64le-linux"
           "riscv32-linux"
           "riscv64-linux"
           "s390-linux"
           "s390x-linux"
           "x86_64-linux"
         ]
         package.meta.badPlatforms = [ ]
       , refusing to evaluate.

       a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
          for a single invocation of the nix tools.

            $ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1

          Note: When using `nix shell`, `nix build`, `nix develop`, etc with a flake,
                then pass `--impure` in order to allow use of environment variables.

       b) For `nixos-rebuild` you can set
         { nixpkgs.config.allowUnsupportedSystem = true; }
       in configuration.nix to override this.

       c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
         { allowUnsupportedSystem = true; }
       to ~/.config/nixpkgs/config.nix.
```
parent f925522a
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -239,7 +239,9 @@ stdenv.mkDerivation (finalAttrs: {
    wrapProgram $out/bin/netdata-claim.sh --prefix PATH : ${lib.makeBinPath [ openssl ]}
    wrapProgram $out/libexec/netdata/plugins.d/cgroup-network-helper.sh --prefix PATH : ${lib.makeBinPath [ bash ]}
    wrapProgram $out/bin/netdatacli --set NETDATA_PIPENAME /run/netdata/ipc
    ${lib.optionalString (stdenv.hostPlatform.isLinux) ''
      substituteInPlace $out/lib/netdata/conf.d/go.d/sensors.conf --replace-fail '/usr/bin/sensors' '${lm_sensors}/bin/sensors'
    ''}

    # Time to cleanup the output directory.
    unlink $out/sbin