Skip to content

NixOS flake build fails: openssl missing from buildInputs #38

Description

@morettimarco

Summary

Following the documented NixOS install path from the README, nix run github:sovren-software/visage -- discover fails to build because the package derivation in packaging/nix/default.nix does not declare openssl as a build input. The openssl-sys crate (pulled in transitively, likely via reqwest) then cannot find OpenSSL headers/libraries.

On Ubuntu this works silently because libssl-dev is present system-wide, but Nix builds in a sandbox where only declared buildInputs are visible.

Reproduction

nix run --no-write-lock-file github:sovren-software/visage -- discover

Error

error: Cannot build '/nix/store/...-visage-0.3.3.drv'.
       Reason: builder failed with exit code 101.
       ...
       >   cargo:warning=Could not find directory of OpenSSL installation, and this `-sys` crate cannot proceed without this knowledge.
       ...
       >   Could not find directory of OpenSSL installation, and this `-sys` crate cannot
       >   proceed without this knowledge. If OpenSSL is installed and this crate had
       >   trouble finding it,  you can set the `OPENSSL_DIR` environment variable for the
       >   compilation process.
       ...
       >   openssl-sys = 0.9.111

Environment

  • NixOS unstable (channel nixos-unstable, nixpkgs commit 64c08a7ca051951c8eae34e3e3cb1e202fe36786, 2026-05-23)
  • visage 0.3.3 (commit ddaeb20174c00d334f71a4fa0b99a8a86ee678da)

Fix

One-line change to packaging/nix/default.nix:

-{ lib, rustPlatform, pkg-config, pam, dbus, substituteAll ? null }:
+{ lib, rustPlatform, pkg-config, pam, dbus, openssl, substituteAll ? null }:
 ...
-  buildInputs = [ pam dbus ];
+  buildInputs = [ pam dbus openssl ];

pkg-config is already in nativeBuildInputs, so openssl-sys will discover it via PKG_CONFIG_PATH once openssl is present.

Happy to send a PR if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions