diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..fa4da1a --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1750865895, + "narHash": "sha256-p2dWAQcLVzquy9LxYCZPwyUdugw78Qv3ChvnX755qHA=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "61c0f513911459945e2cb8bf333dc849f1b976ff", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..165d21b --- /dev/null +++ b/flake.nix @@ -0,0 +1,36 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + }; + outputs = { nixpkgs, ... }: let + pkgs = import nixpkgs { + system = "x86_64-linux"; + }; + in { + devShells."x86_64-linux".default = pkgs.mkShell { + nativeBuildInputs = with pkgs; [ + cmake + ]; + hardeningDisable = [ "all" ]; + }; + packages."x86_64-linux".default = pkgs.stdenv.mkDerivation { + pname = "CSerialPort"; + version = "9999"; + + src = ./.; + strictDeps = true; + + nativeBuildInputs = with pkgs; [ + cmake + ]; + + meta = { + homepage = "https://blog.csdn.net/itas109/article/details/84282860"; + description = "CSerialPort - lightweight cross-platform serial port library for C++/C/C#/Java/Python/Node.js/Electron/Rust "; + license = pkgs.lib.licenses.lgpl3; + platforms = pkgs.lib.platforms.unix; + }; + + }; + }; +}