forked from tangled.org/core
this repo has no description

nix: update module to work with new ownership model

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li 737b1a7e bc953347

verified
Changed files
+10 -2
nix
modules
+1 -1
flake.nix
···
rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1)
cd "$rootDir"
-
rm api/tangled/*
+
rm -f api/tangled/*
lexgen --build-file lexicon-build-config.json lexicons
sed -i.bak 's/\tutil/\/\/\tutil/' api/tangled/*
${pkgs.gotools}/bin/goimports -w api/tangled/*
+7
nix/modules/knot.nix
···
description = "Internal address for inter-service communication";
};
+
owner = mkOption {
+
type = types.str;
+
example = "did:plc:qfpnj4og54vl56wngdriaxug";
+
description = "DID of owner (required)";
+
};
+
secretFile = mkOption {
type = lib.types.path;
example = "KNOT_SERVER_SECRET=<hash>";
···
"KNOT_SERVER_LISTEN_ADDR=${cfg.server.listenAddr}"
"KNOT_SERVER_DB_PATH=${cfg.server.dbPath}"
"KNOT_SERVER_HOSTNAME=${cfg.server.hostname}"
+
"KNOT_SERVER_OWNER=${cfg.server.owner}"
];
EnvironmentFile = cfg.server.secretFile;
ExecStart = "${cfg.package}/bin/knot server";
+2 -1
nix/vm.nix
···
};
# This is fine because any and all ports that are forwarded to host are explicitly marked above, we don't need a separate guest firewall
networking.firewall.enable = false;
+
time.timeZone = "Europe/London";
services.getty.autologinUser = "root";
environment.systemPackages = with pkgs; [curl vim git sqlite litecli];
services.tangled-knot = {
enable = true;
motd = "Welcome to the development knot!\n";
server = {
-
secretFile = builtins.toFile "knot-secret" ("KNOT_SERVER_SECRET=" + (envVar "TANGLED_VM_KNOT_SECRET"));
+
owner = envVar "TANGLED_VM_KNOT_OWNER";
hostname = "localhost:6000";
listenAddr = "0.0.0.0:6000";
};