Compare commits

...

5 Commits

Author SHA1 Message Date
Emery Hemingway 20ef1f4a82 Update repos 2023-07-21 10:34:29 +01:00
Emery Hemingway 51a5f06b6e Commit current config 2023-07-21 10:34:29 +01:00
Emery Hemingway 32d9d60335 More submodules 2023-06-20 09:19:47 +01:00
Emery Hemingway 793132a7d8 Add xapian_actor submodule 2023-06-10 14:48:22 +01:00
Emery Hemingway 2c68238382 Update nix_actor 2023-06-10 11:55:42 +01:00
56 changed files with 393 additions and 73 deletions

1
.envrc
View File

@ -1,3 +1,2 @@
export NIX_PATH=$PWD/nixexprs
# use nix
PATH_add bin

1
.gitignore vendored
View File

@ -4,4 +4,3 @@
##### Do not edit.
.tup
/.gitignore
/bin

23
.gitmodules vendored
View File

@ -56,7 +56,7 @@
path = syndicate-protocols
url = https://git.syndicate-lang.org/syndicate-lang/syndicate-protocols.git
[submodule "xdg_open_ng"]
path = xdg_open_ng
path = syn-open
url = https://git.syndicate-lang.org/ehmry/xdg_open_ng.git
[submodule "syndicate_utils"]
path = syndicate_utils
@ -145,3 +145,24 @@
[submodule "new_terminal"]
path = new_terminal
url = https://git.sr.ht/~ehmry/new_terminal
[submodule "xapian"]
path = xapian_actor
url = https://git.sr.ht/~ehmry/xapian-nim
[submodule "dhall-nim"]
path = dhall-nim
url = https://git.sr.ht/~ehmry/dhall-nim
[submodule "syndicate-flake"]
path = syndicate-flake
url = https://git.syndicate-lang.org/ehmry/syndicate-flake.git
[submodule "nimble/bigints"]
path = nimble/bigints
url = https://github.com/nim-lang/bigints.git
[submodule "nimble/nimAES"]
path = nimble/nimAES
url = https://github.com/jangko/nimAES.git
[submodule "eristekt"]
path = eristekt
url = https://codeberg.org/eris/eristekt
[submodule "nimble/websock"]
path = nimble/websock
url = https://github.com/status-im/nim-websock.git

@ -1 +1 @@
Subproject commit e8ebc723702e64958f1bae1f80c434db5f5a69cf
Subproject commit 104c822cd0c848eed5b99bb1518d5c2379341eee

2
cbor

@ -1 +1 @@
Subproject commit ad810889aa3e7c7dbd93d9a1abe68701f7ea4f45
Subproject commit a4a1affd45ba90bea24e08733ae2bd02fe058166

View File

@ -1,12 +1,19 @@
? <mpv ?mpv> $mpv [
$config ? <socketspace ?beepSpace> [
$beepSpace ?? <beep 0> [
$mpv ! <play-file "/home/emery/lib/syndicate/lcars-0.mp3">
]
$mpv ! <play-file "/home/emery/lib/syndicate/lcars-0.mp3"> ]
$beepSpace ?? <beep 1> [
$mpv ! <play-file "/home/emery/star-trek-audio/www.trekcore.com/audio/computer/consolewarning.mp3">
]
$mpv ! <play-file "/home/emery/star-trek-audio/www.trekcore.com/audio/computer/consolewarning.mp3"> ]
$beepSpace ?? <beep private-message> [
$mpv ! <play-file "/home/emery/star-trek-audio/www.trekcore.com/audio/computer/computerbeep_19.mp3"> ]
$beepSpace ?? <beep highlight> [
$mpv ! <play-file "/home/emery/star-trek-audio/www.trekcore.com/audio/computer/computerbeep_9.mp3"> ]
]
$config ? <machine-dataspace ?ds> $ds [
@ -14,10 +21,11 @@
$mpv ! <play-file "/home/emery/star-trek-audio/www.trekcore.com/audio/toscomputer/tos_computerthinking1_ep.mp3">
]
?? <acpi_event "ac_adapter" _ _ 256> [
$mpv ! <play-file "/home/emery/star-trek-audio/www.trekcore.com/audio/computer/computerbeep_6.mp3">
?? <event "power_supply" _ change {POWER_SUPPLY_ONLINE: 1} _> [
$mpv ! <play-file "/home/emery/star-trek-audio/www.trekcore.com/audio/computer/computerbeep_1.mp3">
]
?? <acpi_event "ac_adapter" _ _ 0> [
?? <event "power_supply" _ change {POWER_SUPPLY_ONLINE: 0} _> [
$mpv ! <play-file "/home/emery/star-trek-audio/www.trekcore.com/audio/computer/alert24.mp3">
]
]

1
config/configdirs.pr Normal file
View File

@ -0,0 +1 @@
<require-service <config-watcher "/run/user/emery/syndicate" $.>>

View File

@ -5,8 +5,9 @@
; <depends-on <daemon acme> <service-state <daemon plumber> ready>>
; <require-service <daemon plumber>>
; "-f" "/mnt/font/FiraSans-Regular/12a/font" "-F" "/mnt/font/FiraCode-Light/10a/font"
<gui acme {
argv: ["/etc/profiles/per-user/emery/bin/9" "acme" "-f" "/mnt/font/FiraSans-Regular/12a/font" "-F" "/mnt/font/FiraCode-Light/10a/font"]
argv: ["/etc/profiles/per-user/emery/bin/9" "acme" "-f" "/mnt/font/FiraSans-Regular/12a/font" "-F" "/mnt/font/FiraCode-Light/10a/font" ]
protocol: none}>
<daemon fontsrv {

View File

@ -1,6 +1,6 @@
? <machine-dataspace ?machine> [
<require-service <daemon acpi_actor>>
; <require-service <daemon acpi_actor>>
? <built acpi_actor ?path ?sum> [
<daemon acpi_actor {

6
config/daemons/foot.pr Normal file
View File

@ -0,0 +1,6 @@
<require-service <gui foot>>
<gui foot {
argv: ["/run/current-system/sw/bin/foot" "--server" "--log-no-syslog" ]
protocol: none
}>

View File

@ -50,6 +50,7 @@ $mpvSpace [
"--idle=yes"
"--no-audio-display"
"--input-ipc-server=/run/user/1000/mpv.sock"
"--volume=75"
]
protocol: none
}>

View File

@ -0,0 +1,16 @@
? <machine-dataspace ?machine> [
; <require-service <daemon net_mapper>>
? <built net_mapper ?path ?sum> [
<daemon net_mapper {
argv: [$path]
protocol: application/syndicate
env: {
BUILD_SUM: $sum
}
}>
]
? <service-object <daemon net_mapper> ?cap> [
$cap { dataspace: $machine }
]
]

View File

@ -7,3 +7,7 @@
}
}>
]
? <nixspace ?nixspace> [
<require-service <daemon nix_actor>>
]

4
config/daemons/nncp.pr Normal file
View File

@ -0,0 +1,4 @@
<require-service <daemon nncp-caller>>
<require-service <daemon nncp-daemon>>
<daemon nncp-caller "nncp-caller -noprogress">
<daemon nncp-daemon "nncp-daemon -noprogress">

View File

@ -1,21 +0,0 @@
? <chat-history ?history> [
; <require-service <daemon simplex_history_actor>>
? <built simplex_history_actor ?path ?sum> [
<daemon simplex_history_actor {
argv: [ $path ]
protocol: application/syndicate
env: {
BUILD_HASH: $sum
}
}>
]
? <service-object <daemon simplex_history_actor> ?cap> [
$cap {
dataspace: $history
database: "/home/emery/.simplex/simplex_v1_chat.db"
}
]
]

View File

@ -0,0 +1,9 @@
? <built sqlite_actor ?path ?sum> [
<daemon sqlite_actor {
argv: [ $path ]
protocol: application/syndicate
env: {
BUILD_HASH: $sum
}
}>
]

View File

@ -1,6 +1,4 @@
; <require-service <daemon squeak>>
<daemon squeak {
<_gui squeak {
argv: [ "/home/emery/.nix-profile/bin/squeak" "/home/emery/squeak/Squeak6.0alpha-21540-64bit.image" ]
dir: "/home/emery/squeak"
protocol: application/syndicate

View File

@ -3,5 +3,5 @@
; TODO: configure Sway over JSON IPC?
<daemon sway {
argv: ["/run/current-system/sw/bin/sway" "--config" "/home/emery/.config/sway/config"]
argv: "/run/current-system/sw/bin/sway --config /home/emery/.config/sway/config 2>/tmp/sway.log"
protocol: none}>

View File

@ -0,0 +1,6 @@
<require-service <gui swayidle>>
<gui swayidle {
argv: [ "/home/emery/src/config/daemons/swayidle.sh" ]
protocol: none
}>

20
config/daemons/swayidle.sh Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/env -S execlineb -P
redirfd -w 2 /dev/null
swayidle
"-w"
"timeout"
"120"
"swaymsg 'output * dpms off'"
"resume"
"swaymsg 'output * dpms on'"
"after-resume"
"/home/emery/lib/bin/camshot"
"after-resume"
"swaymsg 'output * dpms on'"
"before-sleep"
"mpd --kill"
"before-sleep"
"swaylock --daemonize --image /home/emery/tiles/background.png --scaling=tile"
"timeout"
"600"
"swaylock --daemonize --image /home/emery/tiles/background.png --scaling=tile"

23
config/daemons/syndev.pr Normal file
View File

@ -0,0 +1,23 @@
? <machine-dataspace ?machine> [
<require-service <daemon syndev>>
? <built syndev ?path ?sum> [
<daemon syndev {
argv: [$path]
protocol: application/syndicate
env: {
BUILD_SUM: $sum
}
}>
]
? <service-object <daemon syndev> ?cap> [
$cap { machine: $machine }
]
$machine ?? ?x [
$log ! <log "-" { machine-message: $x }>
]
]

View File

@ -1 +1 @@
../../xdg_open_ng/uri_runner.pr
../../syn-open/uri_runner.pr

View File

@ -1,4 +1,6 @@
<require-service <daemon waybar>>
<gui waybar {
argv: "/run/current-system/sw/bin/waybar"
}>
; <require-service <daemon waybar>>
;<gui waybar {
; argv: "/run/current-system/sw/bin/waybar"
;}>
[]

View File

@ -0,0 +1,9 @@
? <built xapian_actor ?path ?sum> [
<daemon xapian_actor {
argv: [ $path ]
protocol: application/syndicate
env: {
BUILD_HASH: $sum
}
}>
]

View File

@ -1,2 +1,7 @@
let ?machine = dataspace
<machine-dataspace $machine>
let ?ds = dataspace
<machine-dataspace $ds>
$ds ? ?r [
$log ! <log "-" { line: "machine" |+++|: $r }>
?- $log ! <log "-" { line: "machine" |---|: $r }>
]

View File

@ -1,2 +1,2 @@
let ?ds = dataspace
<chat-history $ds>
<mail $ds>

View File

@ -1,2 +1,2 @@
let ?nixspace = dataspace
<nixspace $nixspace>
; <nixspace $nixspace>

View File

@ -0,0 +1,3 @@
let ?ds = dataspace
<simplex $ds>
? <socketspace ?socketspace> [ $socketspace <simplex $ds> ]

View File

@ -0,0 +1,4 @@
let ?swaybarspace = dataspace
<swaybarspace $swaybarspace>
<bind <ref { oid: "syndicate" key: #x"" }> $swaybarspace #f>
<require-service <relay-listener <unix "/run/user/emery/swaybarspace"> $gatekeeper>>

2
config/dataspaces/tox.pr Normal file
View File

@ -0,0 +1,2 @@
let ?ds = dataspace
<tox $ds>

View File

@ -1,9 +1,8 @@
let ?socketspace = dataspace
<require-service <relay-listener <tcp "127.0.0.1" 9001> $gatekeeper>>
<require-service <relay-listener <unix "/run/user/1000/dataspace"> $gatekeeper>>
<require-service <relay-listener <tcp "0.0.0.0" 666> $gatekeeper>>
<require-service <relay-listener <unix "/run/user/emery/dataspace"> $gatekeeper>>
<bind <ref { oid: "syndicate" key: #x"" }> $socketspace #f>
<socketspace $socketspace>
; $socketspace <foo "bar">

View File

@ -1 +0,0 @@
../xdg_open_ng/handlers-example.pr

View File

@ -0,0 +1,40 @@
; the <exec-space #!> dataspace starts programs when it receives exec messages
? <exec-space ?execspace> [
<action-handler "file://(.*.pdf)" $execspace
<exec ["/run/current-system/sw/bin/mupdf" "$1"]>>
<action-handler "file://(.*.png|.*.jpg|.*.jpeg|.*.qoi)" $execspace
<exec ["/run/current-system/sw/bin/imv" "$1"]>>
<action-handler "(magnet:?.*xt=urn:btih.*)" $execspace
<exec ["/run/current-system/sw/bin/transmission-gtk" "$1"]>>
<action-handler "(tg://.*)" $execspace
<exec ["/run/current-system/sw/bin/telegram-desktop" "$1"]>>
<action-handler "https://twitter.com/(.*)" $execspace
<exec ["/run/current-system/sw/bin/firefox" "--new-tab" "https://nitter.net/$1"]>>
<action-handler "(http://.*|https://.*)" $execspace
<exec ["/run/current-system/sw/bin/firefox" "$#"]>>
<action-handler "(file:///.*.html)" $execspace
<exec ["/home/emery/.nix-profile/bin/netsurf-gtk3" "$#"]>>
<action-handler "mailto:(.*)" $execspace
<exec ["/run/current-system/sw/bin/astroid" "--mailto" "mailto:$#"]>>
<action-handler "file://(.*\\.odt)" $execspace
<exec ["/home/emery/.nix-profile/bin/libreoffice" "$#"]>>
<action-handler "file://(.*\\.eris)" $execspace
<exec ["/home/emery/src/bin/erisopen" "$#"]>>
]
; when mpv is available send it commands directly
? <mpv ?mpv> [
<action-handler "(.*mp4)" $mpv <play-file "$1">>
<action-handler "(.*mp3)" $mpv <play-file "$1">>
<action-handler "(.*wav)" $mpv <play-file "$1">>
]

24
config/mail.pr Normal file
View File

@ -0,0 +1,24 @@
? <mail ?mail> $mail [
? <xapian ?uuid ?path> [
$log ! <log "-" { xapian: <xapian $uuid $path> }>
]
<query spam "spam" english>
? <match spam ?id ?weight ?rank > [
? <document $id ?data> [
$log ! <log "-" { spam: { docid: $id data: $data } }>
]
]
$config [
; <require-service <daemon xapian_actor>>
? <service-object <daemon xapian_actor> ?cap> [
$cap {
database: "/home/emery/mail/.notmuch/xapian"
dataspace: $mail
}
]
]
]

5
config/net.pr Normal file
View File

@ -0,0 +1,5 @@
? <machine-dataspace ?machine> $machine [
? <rtt "10.0.33.136" ?min ?avg ?max> [
$log ! <log "-" { ping: { min: $min avg: $avg max: $max } }>
]
]

65
config/nix.pr Normal file
View File

@ -0,0 +1,65 @@
? <nixspace ?nixspace> $nixspace [
; ? <instantiate "let pkgs = import <nixpkgs> {}; in pkgs.hello" { } ?drv> [
; ? <realise $drv ?outputs> [
; $log ! <log "-" { "hello": $outputs }>
; ]
; ]
? <eval_ "let pkgs = import /nix/var/nix/profiles/per-user/root/channels/nixos/pkgs/top-level/impure.nix {}; in pkgs.hello.meta" {} ?result> [
$log ! <log "-" { hello-meta: $result }>
]
? <eval "<nixpkgs>" {} ?result> [
$log ! <log "-" { nixpkgs: $result }>
]
? <eval "__currentSystem" {} ?result> [
$log ! <log "-" { __currentSystem: $result }>
]
? <eval "__currentTime" {} ?result> [
$log ! <log "-" { __currentTime: $result }>
]
? <eval "__langVersion" {} ?result> [
$log ! <log "-" { __langVersion: $result }>
]
? <eval "__nixPath" {} ?result> [
$log ! <log "-" { __nixPath: $result }>
]
? <nixVersion ?version> [
$log ! <log "-" { nixVersion: $version }>
]
; ? <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 [
? <service-object <daemon nix_actor> ?cap> [
$cap {
listen-socket: "/tmp/worker.socket"
daemon-socket: "/nix/var/nix/daemon-socket/socket"
dataspace: $nixspace
}
]
]
]

28
config/simplex.pr Normal file
View File

@ -0,0 +1,28 @@
? <simplex ?simplex> $simplex [
<query user-row "SELECT user_id, local_display_name FROM users">
<query contact-row "SELECT contact_id, user_id, local_display_name, is_user FROM contacts">
? <user-row ?user_id ?name> [
let ?user = dataspace
$user <user-id $user_id>
$user <local-display-name $name>
$simplex ? <contact-row ?contact_id $user_id ?local_display_name 0> [
let ?contact = dataspace
$contact <contact-id $contact_id>
$contact <local-display-name $local_display_name>
$user <contact $contact>
]
$simplex <user $user>
]
? ?any [$log ! <log "-" { simplex: $any }> ]
$config <require-service <daemon sqlite_actor>>
$config ? <service-object <daemon sqlite_actor> ?cap> [
$cap {
dataspace: $simplex
database: "/home/emery/.simplex/simplex_v1_chat.db"
}
]
]

38
config/status.pr Normal file
View File

@ -0,0 +1,38 @@
? <swaybarspace ?swaybarspace> [
? <machine-dataspace ?machine> [
$machine ?? <uevent "power_supply" _ change {POWER_SUPPLY_STATUS: ?STATUS POWER_SUPPLY_TECHNOLOGY: ?TECHNOLOGY} _> [
$swaybarspace <swaybar-status { "full_text": $STATUS }>
$swaybarspace <swaybar-status { "full_text": $TECHNOLOGY }>
]
]
$swaybarspace <swaybar-status { "full_text": "hello world" }>
$config ? { argv: ["sway-env-magic-cookie"]
env: {
"DESKTOP_STARTUP_ID": ?DESKTOP_STARTUP_ID
"XDG_ACTIVATION_TOKEN": ?XDG_ACTIVATION_TOKEN
} } [
$swaybarspace <swaybar-status {
"full_text": "Thu 30 May 2019 02:09:15",
"short_text": "02:09",
"color": "#ccccccff",
"background": "#111111ff",
"border": "#222222ff",
"border_top": 1,
"border_bottom": 1,
"border_left": 1,
"border_right": 1,
"min_width": 100,
"align": "center",
"name": "clock",
"instance": "edt",
"urgent": false,
"separator": true,
"separator_block_width": 5,
"markup": "none"
}>
]
]
]

1
dhall-nim Submodule

@ -0,0 +1 @@
Subproject commit 42bc57446d3d336e9910ce22b7ba06784876a8fd

@ -1 +1 @@
Subproject commit 0e271609fde50433bb57a707a89ef69e8b90f802
Subproject commit b6c1586deb205c4caa24d70d2b2bb1857d170b1d

@ -1 +1 @@
Subproject commit 1633a5b24759b2bd03db1863d475ea0e04a99fa9
Subproject commit 9f5c62a5827aa3f9e3a9c8c2c5a2bd4dc8c90167

1
eristekt Submodule

@ -0,0 +1 @@
Subproject commit 52c654f5b7a09e4fcec9f0813cde081f5ab425d5

2
nim

@ -1 +1 @@
Subproject commit d61dc77f2e6718a2d0a62e0a37f4ffd8acef3d76
Subproject commit 527d780c663d680e65a1245ac9906611860b4a9c

View File

@ -1,7 +1,7 @@
!nix_build = |> ^o nix build %o^ nix build --out-link %o |>
: |> !nix_build nixpkgs#nimPackages.illwill |> illwill ./<illwill>
: |> !nix_build nixpkgs#nimPackages.base32 |> base32 ./<base32>
: |> !nix_build nixpkgs#nimPackages.nimSHA2 |> nimsha2 ./<nimsha2>
: |> !nix_build nixpkgs#nimPackages.npeg |> npeg ./<npeg>
: |> !nix_build nixpkgs#nimPackages.flatty |> flatty ./<flatty>
: |> !nix_build nixpkgs#nimPackages.sdl2 |> sdl2 ./<sdl2>
!nix_build = |> ^o^ nix build -f ../nixexprs/nixpkgs --out-link %o |>
: |> !nix_build nimPackages.illwill |> illwill ./<illwill>
: |> !nix_build nimPackages.base32 |> base32 ./<base32>
: |> !nix_build nimPackages.nimSHA2 |> nimsha2 ./<nimsha2>
: |> !nix_build nimPackages.npeg |> npeg ./<npeg>
: |> !nix_build nimPackages.flatty |> flatty ./<flatty>
: |> !nix_build nimPackages.sdl2 |> sdl2 ./<sdl2>

1
nimble/bigints Submodule

@ -0,0 +1 @@
Subproject commit 6d77ea78e8da1d870017303bc0cbd798f85bb506

1
nimble/nimAES Submodule

@ -0,0 +1 @@
Subproject commit b9d6d29cb44d4b6965ad4db04770bef2a35dd4b7

1
nimble/websock Submodule

@ -0,0 +1 @@
Subproject commit 2c3ae3137f3c9cb48134285bd4a47186fa51f0e8

@ -1 +1 @@
Subproject commit 4e3e77171c12b1509b79975965d279fe9aca1dbc
Subproject commit d51d9b3c34a887587d17985add18a109001f5d16

@ -1 +1 @@
Subproject commit 117aa19ef3dd2b862a70060b981ae543a6fec715
Subproject commit 6008b0ba2509dc2e92f914d78b3f54f24040f641

View File

@ -1,5 +0,0 @@
let
pkgs = import <nixpkgs> { };
tup' = pkgs.tup.overrideAttrs
({ patches ? [ ], ... }: { patches = patches ++ [ ./tup.patch ]; });
in pkgs.mkShell { packages = [ pkgs.ccacheWrapper pkgs.tup ]; }

2
sigil

@ -1 +1 @@
Subproject commit eedfff3c27e21976296fc5c6177a3a5f6f0d018f
Subproject commit f170f48b6084274f6bc80619778878d1d0cd6a1f

1
syn-open Submodule

@ -0,0 +1 @@
Subproject commit 509970a2d2517de4f11468aa977a47a9c3cda623

1
syndicate-flake Submodule

@ -0,0 +1 @@
Subproject commit 4d2691722c7cf0b9c053bb73c1b6165784968030

@ -1 +1 @@
Subproject commit ee3fc7adea15badbfee0e8b5615e67d0e0bcc020
Subproject commit 38b6935ea02e8ce94532b0e12d75cd871439d475

@ -1 +1 @@
Subproject commit e244524bc91f228cab0228c7bc425690af115028
Subproject commit 818c23f0259c82e2649735c200f0741218722674

1
xapian_actor Submodule

@ -0,0 +1 @@
Subproject commit bf722fa5b8bcbd50be5214647969b7314da5bed8

@ -1 +0,0 @@
Subproject commit 4db9037153d123bb1f12feafba7a4d2210c53578