Add ERIS CoAP server to nncp

eris
Emery 3 months ago
parent 23f12b0e97
commit 678313627a
  1. 127
      flake.lock
  2. 31
      flake.nix
  3. 4
      hosts/nncp/default.nix
  4. 30
      hosts/nncp/eris.nix

@ -1,5 +1,26 @@
{
"nodes": {
"eris": {
"inputs": {
"nimble": "nimble",
"nixpkgs": [
"nixos"
]
},
"locked": {
"lastModified": 1662480366,
"narHash": "sha256-TvVZy/iE5jcWWyVFV+9NUrptkepn5V8ttN91EMYueZ0=",
"ref": "refs/heads/trunk",
"rev": "39efd5f8333cdff03bd12766ce3943c1e91f27fc",
"revCount": 18,
"type": "git",
"url": "https://codeberg.org/eris/nix-eris"
},
"original": {
"type": "git",
"url": "https://codeberg.org/eris/nix-eris"
}
},
"fenix": {
"inputs": {
"nixpkgs": [
@ -36,6 +57,21 @@
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1637014545,
"narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"heliwatch": {
"inputs": {
"fenix": [
@ -189,6 +225,28 @@
"type": "github"
}
},
"naersk_2": {
"inputs": {
"nixpkgs": [
"ticker",
"nixpkgs"
]
},
"locked": {
"lastModified": 1659610603,
"narHash": "sha256-LYgASYSPYo7O71WfeUOaEUzYfzuXm8c8eavJcel+pfI=",
"owner": "nix-community",
"repo": "naersk",
"rev": "c6a45e4277fa58abd524681466d3450f896dc094",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "naersk",
"rev": "c6a45e4277fa58abd524681466d3450f896dc094",
"type": "github"
}
},
"newNixpkgs": {
"locked": {
"lastModified": 1647380550,
@ -221,6 +279,26 @@
"type": "github"
}
},
"nimble": {
"inputs": {
"nixpkgs": [
"eris",
"nixpkgs"
]
},
"locked": {
"lastModified": 1662431150,
"narHash": "sha256-0TD9T6aMxUGe9FVvTI6np8V5HnnOgl4aoeSJ7XJgKZM=",
"owner": "nix-community",
"repo": "flake-nimble",
"rev": "961c2ab20939f0aaae17f97ab5a72e2c6589e600",
"type": "github"
},
"original": {
"id": "nimble",
"type": "indirect"
}
},
"nix": {
"inputs": {
"lowdown-src": "lowdown-src",
@ -462,6 +540,7 @@
},
"root": {
"inputs": {
"eris": "eris",
"fenix": "fenix",
"flake-utils": "flake-utils",
"heliwatch": "heliwatch",
@ -481,12 +560,35 @@
"secrets": "secrets",
"sops-nix": "sops-nix",
"spacemsg": "spacemsg",
"syndicate": "syndicate",
"ticker": "ticker",
"tigger": "tigger",
"yammat": "yammat",
"zentralwerk": "zentralwerk"
}
},
"rust": {
"inputs": {
"flake-utils": "flake-utils_2",
"nixpkgs": [
"syndicate",
"nixpkgs"
]
},
"locked": {
"lastModified": 1656384549,
"narHash": "sha256-hUe2t7//B9U9SSODAplfzdKkwxwO4kHsPX2k0y95SUU=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "61df523b5c22665d89710d9985cf5afe751d703f",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
@ -579,14 +681,33 @@
"type": "github"
}
},
"syndicate": {
"inputs": {
"nixpkgs": [
"nixos"
],
"rust": "rust"
},
"locked": {
"lastModified": 1662481109,
"narHash": "sha256-h1PqGefF5mptkQmvXY7hSlBApK4t854QWsLEW0plq14=",
"ref": "refs/heads/trunk",
"rev": "3f4c5ae37e5e26b2a9167eb0503927b41e678871",
"revCount": 53,
"type": "git",
"url": "https://git.syndicate-lang.org/ehmry/syndicate-flake"
},
"original": {
"type": "git",
"url": "https://git.syndicate-lang.org/ehmry/syndicate-flake"
}
},
"ticker": {
"inputs": {
"fenix": [
"fenix"
],
"naersk": [
"naersk"
],
"naersk": "naersk_2",
"nixpkgs": [
"nixos"
],

@ -6,6 +6,10 @@
nixpkgs-mobilizon.url = "github:minijackson/nixpkgs/init-mobilizon";
nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
nixos-hardware.url = "github:nixos/nixos-hardware";
eris = {
url = "git+https://codeberg.org/eris/nix-eris";
inputs.nixpkgs.follows = "nixos";
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixos";
@ -86,6 +90,10 @@
url = "github:astro/tigger";
flake = false;
};
syndicate = {
url = "git+https://git.syndicate-lang.org/ehmry/syndicate-flake";
inputs.nixpkgs.follows = "nixos";
};
yammat = {
url = "git+https://gitea.c3d2.de/C3D2/yammat.git?ref=nix";
inputs.nixpkgs.follows = "nixos";
@ -100,7 +108,7 @@
};
};
outputs = inputs@{ self, nixos-unstable, nixos, secrets, nixos-hardware, zentralwerk, yammat, scrapers, spacemsg, tigger, ticker, heliwatch, sops-nix, naersk, fenix, microvm, riscv64, oparl-scraper, ... }:
outputs = inputs@{ self, eris, fenix, heliwatch, microvm, naersk, nixos, nixos-hardware, nixos-unstable, oparl-scraper, riscv64, scrapers, secrets, sops-nix, spacemsg, syndicate, ticker, tigger, yammat, zentralwerk, ... }:
let
inherit (nixos) lib;
forAllSystems = lib.genAttrs [ "aarch64-linux" "x86_64-linux" ];
@ -148,10 +156,15 @@
inherit nixos-unstable;
};
legacyPackages = lib.attrsets.mapAttrs
(system: pkgs: pkgs.appendOverlays
[ fenix.overlay naersk.overlay self.overlay ])
nixos.legacyPackages;
legacyPackages = lib.attrsets.mapAttrs (system: pkgs:
pkgs.appendOverlays [
fenix.overlay
naersk.overlay
syndicate.overlays.default
eris.inputs.nimble.overlay
eris.overlays.default
self.overlay
]) nixos.legacyPackages;
packages = lib.attrsets.mapAttrs (system: pkgs:
let overlayPkgs = builtins.intersectAttrs (self.overlay {} {}) pkgs;
@ -531,7 +544,15 @@
modules = [
self.nixosModules.microvm
self.nixosModules.nncp
syndicate.nixosModules.default
./hosts/nncp
{
nixpkgs.overlays = [
syndicate.overlays.default
eris.inputs.nimble.overlay
eris.overlays.default
];
}
];
};

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
{
imports = [ ./neighbours.nix ];
imports = [ ./eris.nix ./neighbours.nix ];
microvm.interfaces = [ {
type = "tap";
@ -33,7 +33,7 @@
neigh = # use c3d2.nncp.neigh but remove this node
let
hourlyCall = {
cron = "0 42 * * * * *"; # 4:00
cron = "0 42 * * * * *";
xx = "tx"; # transmit only
when-tx-exists = true;
};

@ -0,0 +1,30 @@
{ pkgs, ... }:
let home = "/var/spool/eris";
in {
services.syndicate.eris = {
enable = true;
user = "eris";
config = [
(pkgs.writeText "eris.pr" ''
<require-service <daemon eris-resolver>>
<daemon eris-resolver {
argv: [ "${pkgs.nimPackages.eris_utils}/bin/eriscmd" "resolver" ]
protocol: text/syndicate
}>
? <service-object <daemon eris-resolver> ?cap> $cap [
<coap-server "::" 5683 #{Get Put}>
<tkrzw "${home}/eris.tkh" #{Get Put} >
]
'')
];
};
users.groups.eris = { };
users.users.eris = {
isSystemUser = true;
group = "eris";
inherit home;
};
}
Loading…
Cancel
Save