2020-12-30 16:46:13 +03:00
|
|
|
# hnix-store-remote
|
2018-07-16 10:12:23 +03:00
|
|
|
|
2020-12-30 16:46:13 +03:00
|
|
|
[Nix] worker protocol implementation for interacting with remote Nix store
|
2018-07-16 10:12:23 +03:00
|
|
|
via `nix-daemon`.
|
|
|
|
|
2020-12-30 16:46:13 +03:00
|
|
|
[Nix]: https://nixos.org/nix
|
|
|
|
|
2018-07-16 10:12:23 +03:00
|
|
|
## API
|
|
|
|
|
|
|
|
[System.Nix.Store.Remote]: ./src/System/Nix/Store/Remote.hs
|
|
|
|
|
|
|
|
## Example
|
|
|
|
|
|
|
|
```haskell
|
2023-11-14 11:42:22 +03:00
|
|
|
{-# LANGUAGE OverloadedStrings #-}
|
2018-07-16 10:12:23 +03:00
|
|
|
|
2023-11-14 11:42:22 +03:00
|
|
|
import Control.Monad (void)
|
2019-03-28 23:32:31 +03:00
|
|
|
import Control.Monad.IO.Class (liftIO)
|
2018-07-16 10:12:23 +03:00
|
|
|
import System.Nix.Store.Remote
|
|
|
|
|
2023-11-14 11:42:22 +03:00
|
|
|
main :: IO ()
|
2018-07-16 10:12:23 +03:00
|
|
|
main = do
|
2023-11-14 11:42:22 +03:00
|
|
|
void $ runStore $ do
|
2018-07-16 10:12:23 +03:00
|
|
|
syncWithGC
|
|
|
|
roots <- findRoots
|
|
|
|
liftIO $ print roots
|
|
|
|
|
2023-11-14 14:32:25 +03:00
|
|
|
res <- addTextToStore "hnix-store" "test" mempty dontRepair
|
2019-03-28 23:32:31 +03:00
|
|
|
liftIO $ print res
|
2018-07-16 10:12:23 +03:00
|
|
|
```
|