diff --git a/nixos/ringtail/configuration.nix b/nixos/ringtail/configuration.nix index aa9c49b..163b8ce 100644 --- a/nixos/ringtail/configuration.nix +++ b/nixos/ringtail/configuration.nix @@ -1,5 +1,9 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, ... }: +let + # Libraries needed by mise-compiled runtimes (python-build, etc.) + buildDeps = with pkgs; [ zlib readline bzip2 xz libffi ncurses sqlite openssl ]; +in { # Allow unfree packages (NVIDIA drivers, Steam) nixpkgs.config.allowUnfree = true; @@ -138,17 +142,14 @@ # Allow running dynamically linked binaries (mise-installed runtimes, etc.) programs.nix-ld.enable = true; - programs.nix-ld.libraries = with pkgs; [ - icu - openssl - zlib - readline - bzip2 - xz - libffi - ncurses - sqlite - ]; + programs.nix-ld.libraries = buildDeps ++ [ pkgs.icu ]; + + # Compile-time flags for mise python-build and similar source builds + environment.sessionVariables = { + PKG_CONFIG_PATH = lib.makeSearchPath "lib/pkgconfig" (map lib.getDev buildDeps); + CFLAGS = lib.concatMapStringsSep " " (p: "-I${lib.getDev p}/include") buildDeps; + LDFLAGS = lib.concatMapStringsSep " " (p: "-L${lib.getLib p}/lib") buildDeps; + }; # Fonts fonts.packages = with pkgs; [