commit f012a7f7ef92e9f37a194081b06ec5b7e242815f from: witcher date: Thu Mar 23 15:47:55 2023 UTC add nix flake support commit - dad3cdd881b67cab596acc99c7bf3c4f6db127d5 commit + f012a7f7ef92e9f37a194081b06ec5b7e242815f blob - ea8c4bf7f35f6f77f75d92ad8ce8349f6e81ddba blob + 07c12f25c6b44123c21e25124158e6580c459d2e --- .gitignore +++ .gitignore @@ -1 +1,2 @@ /target +result blob - /dev/null blob + fcdadfac27c38fd06cc994015ba03ac40ddeed8c (mode 644) --- /dev/null +++ flake.lock @@ -0,0 +1,147 @@ +{ + "nodes": { + "crane": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": [ + "nixpkgs" + ], + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1679461034, + "narHash": "sha256-pX4jF5hfEfBGlKw2yDJj9FjvVxmMdGgqKe1I+Vbail8=", + "owner": "ipetkov", + "repo": "crane", + "rev": "ec69da697357cfe7d9e8653b0cfbe73eaecca34b", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1676283394, + "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1679437018, + "narHash": "sha256-vOuiDPLHSEo/7NkiWtxpHpHgoXoNmrm+wkXZ6a072Fc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "19cf008bb18e47b6e3b4e16e32a9a4bdd4b45f7e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "crane": "crane", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay_2" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "crane", + "flake-utils" + ], + "nixpkgs": [ + "crane", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1677812689, + "narHash": "sha256-EakqhgRnjVeYJv5+BJx/NZ7/eFTMBxc4AhICUNquhUg=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "e53e8853aa7b0688bc270e9e6a681d22e01cf299", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_2": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1679537973, + "narHash": "sha256-R6borgcKeyMIjjPeeYsfo+mT8UdS+OwwbhhStdCfEjg=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "fbc7ae3f14d32e78c0e8d7865f865cc28a46b232", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} blob - /dev/null blob + 6a2ebbc4d8f14be894828417b37dca729a4e0bdc (mode 644) --- /dev/null +++ flake.nix @@ -0,0 +1,37 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + crane = { + url = "github:ipetkov/crane"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + flake-utils.url = "github:numtide/flake-utils"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs = { + nixpkgs.follows = "nixpkgs"; + flake-utils.follows = "flake-utils"; + }; + }; + }; + + outputs = { self, nixpkgs, crane, flake-utils, rust-overlay }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + system = system; + overlays = [ (import rust-overlay) ]; + }; + + rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile + ./rust-toolchain.toml; + lib = crane.lib.${system}.overrideToolchain rustToolchain; + + ble-throughput-client = lib.buildPackage { + src = ./.; + nativeBuildInputs = with pkgs; [ pkg-config dbus ]; + installCargoArtifactsMode = "use-symlink"; + }; + + in { packages.default = ble-throughput-client; }); +} blob - /dev/null blob + 588ffd57885e050bc0ce06e209806849a3025b25 (mode 644) --- /dev/null +++ rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "1.67.1"