# Orthanc 1.12.7 on Nix

**URL:** https://discourse.orthanc-server.org/t/orthanc-1-12-7-on-nix/5733
**Category:** General
**Created:** [April 14, 2025, 6:43am UTC](https://discourse.orthanc-server.org/t/orthanc-1-12-7-on-nix/5733 "2025-04-14T06:43:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![drupol](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/drupol/32/2342_2.png) [@drupol](https://discourse.orthanc-server.org/u/drupol)
#### Post date: [April 14, 2025, 6:43am UTC](https://discourse.orthanc-server.org/t/orthanc-1-12-7-on-nix/5733/1 "2025-04-14T06:43:12Z")

</div>

Yesterday I attempted to package **Orthanc 1.12.7**. You can follow the progress here: `github.com/NixOS/nixpkgs/pull/398450` (I don’t have the right to post a link).

Everything seemed to be working fine until I encountered an issue that didn’t appear in version **1.12.6**. The build completes successfully, but the install phase fails with a permissions error. Here’s the relevant part of the log:

```auto
error: builder for '/nix/store/bl4db83r033jzjv2y9hyn7mpf15ngsn2-orthanc-1.12.7.drv' failed with exit code 1;
       last 50 log lines:
       > [95%] Building CXX object CMakeFiles/UnitTests.dir/build/hg-archive/OrthancFramework/UnitTestsSources/SQLiteTests.cpp.o
       > [95%] Building CXX object CMakeFiles/UnitTests.dir/build/hg-archive/OrthancFramework/UnitTestsSources/StreamTests.cpp.o
       > [96%] Building CXX object CMakeFiles/UnitTests.dir/build/hg-archive/OrthancFramework/UnitTestsSources/ToolboxTests.cpp.o
       > [96%] Building CXX object CMakeFiles/UnitTests.dir/build/hg-archive/OrthancFramework/UnitTestsSources/ZipTests.cpp.o
       > [96%] Building CXX object CMakeFiles/UnitTests.dir/UnitTestsSources/DatabaseLookupTests.cpp.o
       > [97%] Building CXX object CMakeFiles/UnitTests.dir/UnitTestsSources/LuaServerTests.cpp.o
       > [97%] Building CXX object CMakeFiles/UnitTests.dir/UnitTestsSources/PluginsTests.cpp.o
       > [97%] Building CXX object CMakeFiles/UnitTests.dir/UnitTestsSources/ServerConfigTests.cpp.o
       > [98%] Building CXX object CMakeFiles/UnitTests.dir/UnitTestsSources/ServerIndexTests.cpp.o
       > [98%] Building CXX object CMakeFiles/UnitTests.dir/UnitTestsSources/ServerJobsTests.cpp.o
       > [98%] Building CXX object CMakeFiles/UnitTests.dir/UnitTestsSources/SizeOfTests.cpp.o
       > [99%] Building CXX object CMakeFiles/UnitTests.dir/UnitTestsSources/UnitTestsMain.cpp.o
       > [99%] Building CXX object CMakeFiles/UnitTests.dir/UnitTestsSources/VersionsTests.cpp.o
       > [100%] Linking CXX executable UnitTests
       > [100%] Built target UnitTests
       > buildPhase completed in 5 minutes 44 seconds
       > Running phase: installPhase
       > install flags: -j8 SHELL=/nix/store/9nw8b61s8lfdn8fkabxhbz0s775gjhbr-bash-5.2p37/bin/bash install
       > [0%] Built target AutogeneratedTarget
       > [0%] Built target ProtobufCompiler
       > [0%] Built target OrthancDatabaseProtobuf
       > [1%] Built target PluginsDependencies
       > [2%] Built target Housekeeper
       > [3%] Built target ServeFolders
       > [4%] Built target ModalityWorklists
       > [5%] Built target DelayedDeletion
       > [9%] Built target MultitenantDicom
       > [59%] Built target CoreLibrary
       > [60%] Built target OrthancRecoverCompressedFile
       > [89%] Built target ServerLibrary
       > [90%] Built target Orthanc
       > [100%] Built target UnitTests
       > Install the project...
       > -- Install configuration: "Release"
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/sbin/Orthanc
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/share/orthanc/plugins/libServeFolders.so.1.12.7
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/share/orthanc/plugins/libServeFolders.so
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/share/orthanc/plugins/libModalityWorklists.so.1.12.7
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/share/orthanc/plugins/libModalityWorklists.so
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/share/orthanc/plugins/libDelayedDeletion.so.1.12.7
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/share/orthanc/plugins/libDelayedDeletion.so
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/share/orthanc/plugins/libHousekeeper.so.1.12.7
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/share/orthanc/plugins/libHousekeeper.so
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/share/orthanc/plugins/libMultitenantDicom.so.1.12.7
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/share/orthanc/plugins/libMultitenantDicom.so
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/bin/OrthancRecoverCompressedFile
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/include/orthanc/OrthancCPlugin.h
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/include/orthanc/OrthancCDatabasePlugin.h
       > -- Installing: /nix/store/yj049078162sypiagy1v8rg3mcdbdpd4-orthanc-1.12.7/include/orthanc/OrthancDatabasePlugin.proto
       > mkdir: cannot create directory '/share': Permission denied
       For full logs, run:
         nix log /nix/store/bl4db83r033jzjv2y9hyn7mpf15ngsn2-orthanc-1.12.7.drv

```

It looks like something in the install phase is trying to write to an absolute `/share` directory instead of respecting the `$DESTDIR` or `CMAKE_INSTALL_PREFIX`. This didn’t happen with 1.12.6, so I suspect a change in upstream install paths or scripts.

Has anyone encountered a similar issue or found a workaround or patch to correct the install path? I suspect this is specific to **Nix** , since it strictly forbids writing anywhere outside of `/nix/store`.

I tried to check the diff between the 2 tags (`Orthanc-1.12.6` and `Orthanc-1.12.7`), but couldn’t find anything relevant so far.

Thanks.

---

<div class="post-metadata">

### Author: ![drupol](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/drupol/32/2342_2.png) [@drupol](https://discourse.orthanc-server.org/u/drupol)
#### Post date: [April 14, 2025, 7:13am UTC](https://discourse.orthanc-server.org/t/orthanc-1-12-7-on-nix/5733/2 "2025-04-14T07:13:39Z")

</div>

Actually, the issue is now also present on 1.12.6, which is very uncommon and odd. Something has changed and I need to find out what’s going on.

---

<div class="post-metadata">

### Author: ![drupol](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/drupol/32/2342_2.png) [@drupol](https://discourse.orthanc-server.org/u/drupol)
#### Post date: [April 14, 2025, 7:22am UTC](https://discourse.orthanc-server.org/t/orthanc-1-12-7-on-nix/5733/3 "2025-04-14T07:22:25Z")

</div>

Apologies for my messages, ignore them, during the update I removed something that was not supposed to be removed.
