Syndicated Nix Actor
Go to file
Emery Hemingway 576157b901 Use the (un)stable Nix C bindings 2023-12-08 08:35:33 +02:00
src Use the (un)stable Nix C bindings 2023-12-08 08:35:33 +02:00
.envrc Better build-system 2023-06-10 10:57:29 +01:00
.gitignore Add lockfile 2023-10-09 19:57:31 +01:00
README.md Break up sockets module, don't link libnix, wopAddToStore 2023-06-11 22:49:12 +01:00
Tupfile Use the (un)stable Nix C bindings 2023-12-08 08:35:33 +02:00
Tuprules.tup Add lockfile 2023-10-09 19:57:31 +01:00
lock.json Use the (un)stable Nix C bindings 2023-12-08 08:35:33 +02:00
nix_actor.nimble Use the (un)stable Nix C bindings 2023-12-08 08:35:33 +02:00
protocol.prs Use the (un)stable Nix C bindings 2023-12-08 08:35:33 +02:00
shell.nix Use the (un)stable Nix C bindings 2023-12-08 08:35:33 +02:00

README.md

Syndicated Nix Actor

An actor for interacting with the Nix daemon via the Syndicated Actor Model.

See protocol.prs for the Syndicate protocol schema.

This is only a proof-of-concept and is not yet useful.

Example configuration

A demo script for the Syndicate server, see https://synit.org/book/operation/scripting.html

? <nixspace ?nixspace> $nixspace [

  ? <instantiate "let pkgs = import <nixpkgs> {}; in pkgs.hello" { } ?drv> [
    ? <realise $drv ?outputs> [
      $log ! <log "-" { "hello": $outputs }>
    ]
  ]

  ? <eval "3 * 4" {} ?result> [
    $log ! <log "-" { "nix eval 3 * 4": $result }>
  ]

  ? <eval "builtins.getEnv \"PATH\"" {impure: ""} ?result> [
    $log ! <log "-" { "nix impure path": $result }>
  ]

  ? <missing ["/nix/store/p7fnjrbvmpwl192ir8p2ixfym68j7sgv-invidious-unstable-2023-05-08"] _ ?subs _ ?dlSize ?narSize> [
    $log ! <log "-" { invidious-unstable-2023-05-08: {
      substitutes: $subs
      downloadSize: $dlSize
      narSize: $narSize
    } }>
  ]

  ? <path-info "/nix/store/jhgh02lyizd1kyl71brvc01ygsmgi40a-tzdata-2023c" ?deriver ?narHash _ _ ?narSize _ ?sigs _> [
    $log ! <log "-" { tzdata-2023c: {
      deriver: $deriver
      narHash: $narHash
      narSize: $narSize
      sigs: $sigs
    } }>

  ]

  $config [
    <require-service <daemon nix_actor>>
    ? <service-object <daemon nix_actor> ?cap> [
      $cap {
        dataspace: $nixspace
        daemon-socket: "/nix/var/nix/daemon-socket/socket"
        listen-socket: "/tmp/translator.worker.nix.socket"
      }
    ]
    <daemon nix_actor {
      argv: "/bin/nix_actor"
      protocol: application/syndicate
    }>
  ]
]