-
Notifications
You must be signed in to change notification settings - Fork 0
Added a module and a VM for testing #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
overlay = import ./.; | ||
nixpkgs = import sources.nixpkgs { overlays = [ overlay ]; }; | ||
in with nixpkgs; | ||
lib.filterAttrs (n: _: lib.hasAttr n (overlay {} {})) nixpkgs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a comment clarifying what this does and why
# to make sure people update the hash | ||
sha256 = if version == "ceaed40" then | ||
"1znikk7l2pv5mdl9rh59dljdrqkbwnazlpdjr4yfc87bcynb1rbz" else | ||
"0000000000000000000000000000000000000000000000000000"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib.fakeSha256
in { | ||
options.services.ton = with lib; { | ||
enable = mkEnableOption "ton"; | ||
ports.main = mkOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description and/or default
example = 29108; | ||
type = types.port; | ||
}; | ||
ports.console = mkOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description and/or default
example = 29109; | ||
type = types.port; | ||
}; | ||
ports.lite = mkOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description and/or default
fi | ||
IP=$(curl https://ifconfig.me) | ||
rm -f db/config.json | ||
validator-engine -C $HOME/etc/ton-global.config.json --db $HOME/db --ip $IP:${ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote those variables
base64 server.pub | ||
if [ ! -e lite_id ]; then | ||
generate-random-id -m keys -n lite | tee lite_id | ||
mv lite db/keyring/$(awk '{print $1}' lite_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote the subshell
base64 lite.pub | ||
LITE_B64=$(awk '{print $2}' lite_id) | ||
cp server.pub lite.pub /run/ton | ||
sed -e "s/@SERVER_B64@/$SERVER_B64/g" -e "s/@LITE_B64@/$LITE_B64/g" < ${config_merge_template} > config_merge.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break up into multiple lines for better readability
|
||
}).config.system.build.vm.overrideAttrs (old: | ||
let | ||
# add switch-running-vm, ssh scripts |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this commend should be on the next attribute.
# add switch-running-vm, ssh scripts | ||
ssh = writeShellScriptBin "ssh" '' | ||
set -e | ||
ssh -o StrictHostKeyChecking=no -i ${ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You probably also want -o UserKnownHostsFile=/dev/null
(vm instructions:
nix-build ci.nix -A ton-vm && ./result/bin/run-nixos-vm
)to figure out: