From b106d1cb6e81b3433b8f7c5c65ff1ed71287853f Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 19 Oct 2024 13:33:51 +0100 Subject: [PATCH] add nix-ld for citadel and semita --- hosts/citadel/default.nix | 1 + hosts/common/optional/nix-ld.nix | 21 +++++++++++++++++++++ hosts/semita/default.nix | 18 +----------------- 3 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 hosts/common/optional/nix-ld.nix diff --git a/hosts/citadel/default.nix b/hosts/citadel/default.nix index b5bea31..b8f847b 100644 --- a/hosts/citadel/default.nix +++ b/hosts/citadel/default.nix @@ -53,6 +53,7 @@ in { ../common/optional/printing.nix ../common/optional/backlight.nix ../common/optional/xmodmap-arrow-remaps.nix + ../common/optional/nix-ld.nix ]; boot = { diff --git a/hosts/common/optional/nix-ld.nix b/hosts/common/optional/nix-ld.nix new file mode 100644 index 0000000..abf5250 --- /dev/null +++ b/hosts/common/optional/nix-ld.nix @@ -0,0 +1,21 @@ +{ lib, pkgs, ... }: +{ + # Using non-Nix Python Packages with Binaries on NixOS https://github.com/mcdonc/.nixconfig/blob/e7885ad18b7980f221e59a21c91b8eb02795b541/videos/pydev/script.rst + programs.nix-ld.enable = true; + programs.nix-ld.libraries = with pkgs; [ + zlib # numpy + libgcc # sqlalchemy + expat # pyosmium + # that's where the shared libs go, you can find which one you need using + # nix-locate --top-level libstdc++.so.6 (replace this with your lib) + # ^ this requires `nix-index` pkg + ]; + + environment.variables = { + NIX_LD_LIBRARY_PATH="/run/current-system/sw/share/nix-ld/lib"; + NIX_LD="/run/current-system/sw/share/nix-ld/lib/ld.so"; + LD_LIBRARY_PATH=lib.mkForce "$NIX_LD_LIBRARY_PATH"; + }; + +} + diff --git a/hosts/semita/default.nix b/hosts/semita/default.nix index a3175fc..4060ae4 100644 --- a/hosts/semita/default.nix +++ b/hosts/semita/default.nix @@ -57,6 +57,7 @@ in { ../common/optional/nixos-containers/jellyfin.nix ../common/optional/nixos-containers/baseddata-worker.nix ../common/optional/nixos-containers/mongodb.nix + ../common/optional/nix-ld.nix ]; fileSystems."/media/main-ssd" = { @@ -132,22 +133,5 @@ in { }; }; - # Using non-Nix Python Packages with Binaries on NixOS https://github.com/mcdonc/.nixconfig/blob/e7885ad18b7980f221e59a21c91b8eb02795b541/videos/pydev/script.rst - programs.nix-ld.enable = true; - programs.nix-ld.libraries = with pkgs; [ - zlib # numpy - libgcc # sqlalchemy - expat # pyosmium - # that's where the shared libs go, you can find which one you need using - # nix-locate --top-level libstdc++.so.6 (replace this with your lib) - # ^ this requires `nix-index` pkg - ]; - - environment.variables = { - NIX_LD_LIBRARY_PATH="/run/current-system/sw/share/nix-ld/lib"; - NIX_LD="/run/current-system/sw/share/nix-ld/lib/ld.so"; - LD_LIBRARY_PATH=lib.mkForce "$NIX_LD_LIBRARY_PATH"; - }; - services.libinput.enable = true; }