Skip to content

ihp-new fails on Mac OS due to Unix-domain socket path being too long #2104

@adueck

Description

@adueck

I was just trying to spin up a new project using ihp-new as per the Creating Your First Project guide:

On Mac OS Sequoia 15.5 with Nix and direnv installed and setup, using zsh.

% nix --version
nix (Determinate Nix 3.8.5) 2.30.2
% nix-env --install ihp-new
error: selector 'ihp-new' matches no derivations
# NOT WORKING, TRYING THE FLAKES WAY MENTIONED
% nix profile install nixpkgs#ihp-new
# THIS WORKED
... installing ...
% ihp-new blog
... working ...

We will now create your new IHP project. This may take up to 30 seconds.
Initialized empty Git repository in /Users/adam/Code/blog/.git/
error: Cannot build '/nix/store/zyhq4b019kxczkcvvbc9sf90w2f6v7m7-postgresql-simple-0.7.0.0.drv'.
       Reason: builder failed with exit code 1.
       Output paths:
         /nix/store/db6sbv6hggacxxzaid6sdp2apl5lkiri-postgresql-simple-0.7.0.0-doc
         /nix/store/v36dygv79hs3h4ak6xycn59n5w9ld6zm-postgresql-simple-0.7.0.0
       Last 25 log lines:
       > selecting default time zone ... UTC
       > creating configuration files ... ok
       > running bootstrap script ... ok
       > performing post-bootstrap initialization ... ok
       > syncing data to disk ... ok
       >
       > initdb: warning: enabling "trust" authentication for local connections
       > initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.
       >
       > Success. You can now start the database server using:
       >
       >     pg_ctl -D /nix/var/nix/builds/nix-build-postgresql-simple-0.7.0.0.drv-8423-1219884388/postgresql -l logfile start
       >
       > starting postgresql
       > waiting for server to start....2025-08-18 21:54:44.026 UTC [29877] LOG:  starting PostgreSQL 15.6 on aarch64-apple-darwin23.4.0, compiled by clang version 16.0.6, 64-bit
       > 2025-08-18 21:54:44.026 UTC [29877] LOG:  Unix-domain socket path "/nix/var/nix/builds/nix-build-postgresql-simple-0.7.0.0.drv-8423-1219884388/run/postgresql/.s.PGSQL.5432" is too long (maximum 103 bytes)
       > 2025-08-18 21:54:44.026 UTC [29877] WARNING:  could not create Unix-domain socket in directory "/nix/var/nix/builds/nix-build-postgresql-simple-0.7.0.0.drv-8423-1219884388/run/postgresql"
       > 2025-08-18 21:54:44.026 UTC [29877] FATAL:  could not create any Unix-domain sockets
       > 2025-08-18 21:54:44.027 UTC [29877] LOG:  database system is shut down
       >  stopped waiting
       > pg_ctl: could not start server
       > Examine the log output.
       > /nix/store/g3ikambclkcz7z9sxy1ijy8pxwbybvac-stdenv-darwin/setup: line 138: pop_var_context: head of shell_variables not a function context
       > /nix/store/g3ikambclkcz7z9sxy1ijy8pxwbybvac-stdenv-darwin/setup: line 83: pop_var_context: head of shell_variables not a function context
       > /nix/store/g3ikambclkcz7z9sxy1ijy8pxwbybvac-stdenv-darwin/setup: line 1588: pop_var_context: head of shell_variables not a function context
       For full logs, run:
         nix log /nix/store/zyhq4b019kxczkcvvbc9sf90w2f6v7m7-postgresql-simple-0.7.0.0.drv
error: Cannot build '/nix/store/gzmkmpsb1hagbfymglz02xx4lv6j9hvp-ghc-9.8.2-with-packages.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/8hdc3yymwsd2hyhyv86png0q0w2gvpds-ghc-9.8.2-with-packages
error: Cannot build '/nix/store/i33vn9nw1xwmib3mksfvlfkfhid7mir1-ihp-v1.3.0.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/09y58lxs01nx3qc16c94cmvyd4p8cmvx-ihp-v1.3.0
         /nix/store/894za6rv3mcklp0yav0aqln1c7l93iid-ihp-v1.3.0-doc
error: Cannot build '/nix/store/w5vb38cd8zl1nz4fd9q50yb2j8w6qja9-devenv-shell-env.drv'.
       Reason: 1 dependency failed.
       Output paths:
         /nix/store/8bdf0a07p1icb1cyrs96bkrd2zypdffz-devenv-shell-env

I tried to follow the Getting Started Guide exactly. Am I missing something? Or is this a bug on MacOs? I saw this earlier issue mentioning a similar error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions