Haskell implementation of the nix store API
Go to file
2023-12-06 16:25:38 +01:00
.github/workflows ci: disable haddock step 2023-12-02 10:25:46 +01:00
docs docs/contributors: add ryantrinkle 2023-12-06 16:25:38 +01:00
hnix-store-core core: fix parseDerivedPath breaking when StoreDir contains exclamation mark 2023-12-06 16:25:38 +01:00
hnix-store-db bump core version to 0.8, add lower bound to db & test 2023-11-20 09:22:05 +01:00
hnix-store-nar Set executable permissions once instead of multiple times 2023-11-26 15:42:52 +11:00
hnix-store-readonly switch to crypton 2023-11-23 10:22:19 -08:00
hnix-store-remote remote: no more hacks for StoreRequest prop 2023-12-06 16:25:38 +01:00
hnix-store-tests tests: add custom Arbitrary (Maybe Text) that doesn't generate Just mempty 2023-12-06 16:25:38 +01:00
.envrc Lorri + direnv. 2019-03-19 20:52:25 -04:00
.gitignore gitignore .ghci(_history), .envrc 2023-11-20 09:22:05 +01:00
cabal.project temp: add source-repository-package override for dependent-sum-template 2023-12-06 16:25:38 +01:00
cabal.project.local.ci cabal.project: test: true benchmarks: true 2023-11-29 18:19:03 +01:00
core-simple.png treewide: use lift 2021-08-06 19:29:02 +03:00
default.nix init hnix-store-nar 2023-11-22 11:16:17 +01:00
hie.yaml core: rename format-tests testsuite to core 2023-11-22 11:16:17 +01:00
LICENSE Copyright 2018-04-24 09:34:16 -04:00
matrix.nix add matrix.nix for matrix build using all packages and compilers 2023-11-19 11:55:18 +01:00
overlay.nix init hnix-store-nar 2023-11-22 11:16:17 +01:00
README.md README: Add badges 2023-11-13 08:25:26 +01:00
shell.nix init hnix-store-nar 2023-11-22 11:16:17 +01:00

hnix-store

A Haskell interface to the Nix store.

Rationale

Nix can conceptually be broken up into two layers, both (perhaps unfortunately) named "Nix": The expression language and the store. The semantics of the expression language fundamentally depend on the store, but the store is independent of the language. The store semantics provide the basic building blocks of Nix: content-addressed files and directories, the drv file format and the semantics for building drvs, tracking references of store paths, copying files between stores (or to/from caches), distributed builds, etc.

The goal of hnix-store is to provide a Haskell interface to the Nix store semantics, as well as various implementations of that interface. Though the current primary client is hnix, an effort to reimplement the Nix expression language in Haskell, this project is meant to be generic and could be used for a number of other cases of interaction with the Nix store (e.g. a shake backend that emitted each build action as a store derivation). Currently, there are three implementations planned:

  • A mock store which performs no IO whatsoever, for unit testing.
  • A readonly store, which defers to another implementation for readonly effects (such as querying whether some path is valid in the store, or reading a file) but performs mutating effects in-memory only (for example, computing the store path a given directory would live at if added to the store, without actually modifying anything).
  • A remote store, which implements the client side of the Nix daemon Unix domain socket protocol, allowing full interaction with the store on a system with the C++ daemon installed.

Packages

In the interest of separating concerns, this project is split into several Haskell packages.

hnix-store-core

GitHub Workflow Status Hackage version Dependencies

Contains the core effect types and fundamental operations combining them, agnostic to any particular effectful implementation (e.g. in-memory, talking to the Nix daemon in IO, etc.), with the actual implementations in a different package.

The intent is that core business logic for a project that needs to interact with the Nix store can simply depend on hnix-store-core, and only at the very edges of the system would it be necessary to bring in a specific implementation.

hnix-store-remote

GitHub Workflow Status Hackage version Dependencies

Nix worker protocol implementation for interacting with remote Nix store via nix-daemon.