aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-03-09 11:05:25 +0100
committerAlex Auvolat <alex@adnab.me>2023-03-09 11:05:25 +0100
commit7328fc3929b182c2087a539ffb11b492a2201af0 (patch)
treefaddd4f59deb9462f2ac526370b726a064ee8c57 /flake.nix
parent84381b5096db7af4a5b30cab72a0c5dad9699065 (diff)
downloadwgautomesh-7328fc3929b182c2087a539ffb11b492a2201af0.tar.gz
wgautomesh-7328fc3929b182c2087a539ffb11b492a2201af0.zip
add nixfiles
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..9c402bc
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,36 @@
+{
+ description = "wgautomesh";
+
+ inputs.nixpkgs.url = "github:NixOS/nixpkgs/a3073c49bc0163fea6a121c276f526837672b555";
+ inputs.cargo2nix = {
+ # As of 2022-10-18: two small patches over unstable branch, one for clippy and one to fix feature detection
+ url = "github:Alexis211/cargo2nix/a7a61179b66054904ef6a195d8da736eaaa06c36";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+
+ outputs = { self, nixpkgs, cargo2nix }:
+ let
+ pkgs = import nixpkgs {
+ system = "x86_64-linux";
+ overlays = [ cargo2nix.overlays.default ];
+ };
+ packageFun = import ./Cargo.nix;
+ rustVersion = "1.63.0";
+
+ compile = args: compileMode:
+ let
+ packageSet = pkgs.rustBuilder.makePackageSet ({
+ inherit packageFun rustVersion;
+ } // args);
+ in
+ packageSet.workspace.wgautomesh {
+ inherit compileMode;
+ };
+ in
+ {
+ test.x86_64-linux.wgautomesh = compile { release = false; } "test";
+ debug.x86_64-linux.wgautomesh = compile { release = false; } "build";
+ packages.x86_64-linux.wgautomesh = compile { release = true; } "build";
+ packages.x86_64-linux.default = self.packages.x86_64-linux.wgautomesh;
+ };
+}