set stabilizer IP address within M-Labs network

This commit is contained in:
Sebastien Bourdeauducq 2020-03-17 19:43:22 +08:00
parent b72369d457
commit dec885c896
2 changed files with 8 additions and 1 deletions

View File

@ -142,6 +142,7 @@ in
address=/sayma/192.168.1.60
address=/kasli/192.168.1.70
address=/kasli-customer/192.168.1.75
address=/stabilizer-customer/192.168.1.76
# uTCA MCH from NAT
address=/tschernobyl/192.168.1.80
'';

View File

@ -8,7 +8,7 @@ let
rustPlatform = pkgs.recurseIntoAttrs (pkgs.callPackage ./rustPlatform.nix {
inherit rustManifest;
});
buildStm32Firmware = { name, src }:
buildStm32Firmware = { name, src, patchPhase ? "" }:
let
cargoSha256Drv = pkgs.runCommand "${name}-cargosha256" { } ''cp "${src}/cargosha256.nix" $out'';
in
@ -19,6 +19,7 @@ let
inherit src;
cargoSha256 = (import cargoSha256Drv);
inherit patchPhase;
buildPhase = ''
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
cargo build --release
@ -36,6 +37,11 @@ in
stabilizer = buildStm32Firmware {
name = "stabilizer";
src = <stabilizerSrc>;
patchPhase = ''
substituteInPlace src/main.rs \
--replace "let local_addr = net::wire::IpAddress::v4(10, 0, 16, 99);" \
"let local_addr = net::wire::IpAddress::v4(192, 168, 1, 76);"
'';
};
thermostat = buildStm32Firmware {
name = "thermostat";