-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b799894
commit f791ce7
Showing
2 changed files
with
89 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
description = "An app which reads data from a serial port and serves it on a TCP port."; | ||
|
||
inputs = { | ||
nixpkgs.url = github:NixOS/nixpkgs/nixos-23.05; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { inherit system; }; | ||
main-package = (with pkgs; stdenv.mkDerivation { | ||
pname = "serial-to-tcp"; | ||
version = "1.0.1"; | ||
src = self; | ||
nativeBuildInputs = [ | ||
rustc | ||
cargo | ||
]; | ||
buildPhase = "cargo build"; | ||
installPhase = "mkdir -p $out/bin; install -t $out/bin target/debug/serial-to-tcp"; | ||
}); | ||
in rec { | ||
defaultApp = flake-utils.lib.mkApp { drv = defaultPackage; }; | ||
defaultPackage = main-package; | ||
} | ||
); | ||
} |