diff --git a/.gitignore b/.gitignore index 38ce3cc6..f0e774ba 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ # Added by cargo /target +/.direnv diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..cac12ae7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,155 @@ +{ + "nodes": { + "cargo2nix": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1705129117, + "narHash": "sha256-LgdDHibvimzYhxBK3kxCk2gAL7k4Hyigl5KI0X9cijA=", + "owner": "cargo2nix", + "repo": "cargo2nix", + "rev": "ae19a9e1f8f0880c088ea155ab66cee1fa001f59", + "type": "github" + }, + "original": { + "owner": "cargo2nix", + "ref": "release-0.11.0", + "repo": "cargo2nix", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1705099185, + "narHash": "sha256-SxJenKtvcrKJd0TyJQMO3p6VA7PEp+vmMnmlKFzWMNs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2bce5ccff0ad7abda23e8bb56434b6877a446694", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "release-23.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "cargo2nix": "cargo2nix", + "flake-utils": [ + "cargo2nix", + "flake-utils" + ], + "nixpkgs": [ + "cargo2nix", + "nixpkgs" + ], + "rust-overlay": "rust-overlay_2" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": [ + "cargo2nix", + "flake-utils" + ], + "nixpkgs": [ + "cargo2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1705112162, + "narHash": "sha256-IAM0+Uijh/fwlfoeDrOwau9MxcZW3zeDoUHc6Z3xfqM=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "9e0af26ffe52bf955ad5575888f093e41fba0104", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "rust-overlay_2": { + "inputs": { + "flake-utils": [ + "flake-utils" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1710814282, + "narHash": "sha256-nWaKhMQackiO0M8504HSx/E7I76C2r0/g4wqZf4hp24=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "8c72f33c23c8e537dd59088c4560222c43eedaca", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index b283d7ea..2d33c9d3 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,11 @@ { inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-23.05"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-utils.follows = "flake-utils"; + }; cargo2nix.url = "github:cargo2nix/cargo2nix/release-0.11.0"; flake-utils.follows = "cargo2nix/flake-utils"; nixpkgs.follows = "cargo2nix/nixpkgs"; @@ -18,11 +24,27 @@ packageFun = import ./Cargo.nix; }; + # The workspace defines a development shell with all of the dependencies + # and environment settings necessary for a regular `cargo build` + workspaceShell = rustPkgs.workspaceShell { + # This adds cargo2nix to the project shell via the cargo2nix flake + packages = [ cargo2nix.packages."${system}".cargo2nix ]; + }; + in rec { + # this is the output (recursive) set (expressed for each system) + + devShells = { + default = workspaceShell; # nix develop + }; + + # the packages in `nix build .#packages..` packages = { - # replace hello-world with your package name - dsp-meta-cmd = (rustPkgs.workspace.dsp-meta-cmd {}); - default = packages.hello-world; + # nix build .#dsp-meta-cmd + # nix build .#packages.x86_64-linux.dsp-meta-cmd + dsp-meta-cmd = (rustPkgs.workspace.dsp-meta-cmd {}).bin; + # nix build + default = packages.dsp-meta-cmd; }; } ); diff --git a/result-bin b/result-bin new file mode 120000 index 00000000..7afa6152 --- /dev/null +++ b/result-bin @@ -0,0 +1 @@ +/nix/store/wq3q06m18agdvj8q9lzf917mnkgsjd3z-crate-dsp-meta-cmd-0.1.3-bin \ No newline at end of file