nix flake from @nil.ptr #2

closed
opened by nekomimi.pet targeting main

easier cross compile

-1
.gitignore
···
# production
/build
-
/result
# misc
.DS_Store
+2 -9
cli/Cargo.lock
···
[[package]]
name = "jacquard"
version = "0.9.0"
-
source = "git+https://tangled.org/@nonbinary.computer/jacquard#b5cc9b35e38e24e1890ae55e700dcfad0d6d433a"
dependencies = [
"bytes",
"getrandom 0.2.16",
···
[[package]]
name = "jacquard-api"
version = "0.9.0"
-
source = "git+https://tangled.org/@nonbinary.computer/jacquard#b5cc9b35e38e24e1890ae55e700dcfad0d6d433a"
dependencies = [
"bon",
"bytes",
···
[[package]]
name = "jacquard-common"
version = "0.9.0"
-
source = "git+https://tangled.org/@nonbinary.computer/jacquard#b5cc9b35e38e24e1890ae55e700dcfad0d6d433a"
dependencies = [
"base64 0.22.1",
"bon",
···
[[package]]
name = "jacquard-derive"
version = "0.9.0"
-
source = "git+https://tangled.org/@nonbinary.computer/jacquard#b5cc9b35e38e24e1890ae55e700dcfad0d6d433a"
dependencies = [
"heck 0.5.0",
"jacquard-lexicon",
···
[[package]]
name = "jacquard-identity"
-
version = "0.9.1"
-
source = "git+https://tangled.org/@nonbinary.computer/jacquard#b5cc9b35e38e24e1890ae55e700dcfad0d6d433a"
+
version = "0.9.0"
dependencies = [
"bon",
"bytes",
···
[[package]]
name = "jacquard-lexicon"
-
version = "0.9.1"
-
source = "git+https://tangled.org/@nonbinary.computer/jacquard#b5cc9b35e38e24e1890ae55e700dcfad0d6d433a"
+
version = "0.9.0"
dependencies = [
"cid",
"dashmap",
···
[[package]]
name = "jacquard-oauth"
version = "0.9.0"
-
source = "git+https://tangled.org/@nonbinary.computer/jacquard#b5cc9b35e38e24e1890ae55e700dcfad0d6d433a"
dependencies = [
"base64 0.22.1",
"bytes",
+7 -7
cli/Cargo.toml
···
place_wisp = []
[dependencies]
-
jacquard = { git = "https://tangled.org/@nonbinary.computer/jacquard", features = ["loopback"] }
-
jacquard-oauth = { git = "https://tangled.org/@nonbinary.computer/jacquard" }
-
jacquard-api = { git = "https://tangled.org/@nonbinary.computer/jacquard" }
-
jacquard-common = { git = "https://tangled.org/@nonbinary.computer/jacquard" }
-
jacquard-identity = { git = "https://tangled.org/@nonbinary.computer/jacquard", features = ["dns"] }
-
jacquard-derive = { git = "https://tangled.org/@nonbinary.computer/jacquard" }
-
jacquard-lexicon = { git = "https://tangled.org/@nonbinary.computer/jacquard" }
+
jacquard = { path = "jacquard/crates/jacquard", features = ["loopback"] }
+
jacquard-oauth = { path = "jacquard/crates/jacquard-oauth" }
+
jacquard-api = { path = "jacquard/crates/jacquard-api" }
+
jacquard-common = { path = "jacquard/crates/jacquard-common" }
+
jacquard-identity = { path = "jacquard/crates/jacquard-identity", features = ["dns"] }
+
jacquard-derive = { path = "jacquard/crates/jacquard-derive" }
+
jacquard-lexicon = { path = "jacquard/crates/jacquard-lexicon" }
clap = { version = "4.5.51", features = ["derive"] }
tokio = { version = "1.48", features = ["full"] }
miette = { version = "7.6.0", features = ["fancy"] }
-63
crates.nix
···
-
{...}: {
-
perSystem = {
-
pkgs,
-
config,
-
lib,
-
inputs',
-
...
-
}: {
-
# declare projects
-
nci.projects."wisp-place-cli" = {
-
path = ./cli;
-
export = false;
-
};
-
nci.toolchains.mkBuild = _:
-
with inputs'.fenix.packages;
-
combine [
-
minimal.rustc
-
minimal.cargo
-
targets.x86_64-pc-windows-gnu.latest.rust-std
-
targets.x86_64-unknown-linux-gnu.latest.rust-std
-
targets.aarch64-apple-darwin.latest.rust-std
-
];
-
# configure crates
-
nci.crates."wisp-cli" = {
-
profiles = {
-
dev.runTests = false;
-
release.runTests = false;
-
};
-
targets."x86_64-unknown-linux-gnu" = {
-
default = true;
-
};
-
targets."x86_64-pc-windows-gnu" = let
-
targetPkgs = pkgs.pkgsCross.mingwW64;
-
targetCC = targetPkgs.stdenv.cc;
-
targetCargoEnvVarTarget = targetPkgs.stdenv.hostPlatform.rust.cargoEnvVarTarget;
-
in rec {
-
depsDrvConfig.mkDerivation = {
-
nativeBuildInputs = [targetCC];
-
buildInputs = with targetPkgs; [windows.pthreads];
-
};
-
depsDrvConfig.env = rec {
-
TARGET_CC = "${targetCC.targetPrefix}cc";
-
"CARGO_TARGET_${targetCargoEnvVarTarget}_LINKER" = TARGET_CC;
-
};
-
drvConfig = depsDrvConfig;
-
};
-
targets."aarch64-apple-darwin" = let
-
targetPkgs = pkgs.pkgsCross.aarch64-darwin;
-
targetCC = targetPkgs.stdenv.cc;
-
targetCargoEnvVarTarget = targetPkgs.stdenv.hostPlatform.rust.cargoEnvVarTarget;
-
in rec {
-
depsDrvConfig.mkDerivation = {
-
nativeBuildInputs = [targetCC];
-
};
-
depsDrvConfig.env = rec {
-
TARGET_CC = "${targetCC.targetPrefix}cc";
-
"CARGO_TARGET_${targetCargoEnvVarTarget}_LINKER" = TARGET_CC;
-
};
-
drvConfig = depsDrvConfig;
-
};
-
};
-
};
-
}
-318
flake.lock
···
-
{
-
"nodes": {
-
"crane": {
-
"flake": false,
-
"locked": {
-
"lastModified": 1758758545,
-
"narHash": "sha256-NU5WaEdfwF6i8faJ2Yh+jcK9vVFrofLcwlD/mP65JrI=",
-
"owner": "ipetkov",
-
"repo": "crane",
-
"rev": "95d528a5f54eaba0d12102249ce42f4d01f4e364",
-
"type": "github"
-
},
-
"original": {
-
"owner": "ipetkov",
-
"ref": "v0.21.1",
-
"repo": "crane",
-
"type": "github"
-
}
-
},
-
"dream2nix": {
-
"inputs": {
-
"nixpkgs": [
-
"nci",
-
"nixpkgs"
-
],
-
"purescript-overlay": "purescript-overlay",
-
"pyproject-nix": "pyproject-nix"
-
},
-
"locked": {
-
"lastModified": 1754978539,
-
"narHash": "sha256-nrDovydywSKRbWim9Ynmgj8SBm8LK3DI2WuhIqzOHYI=",
-
"owner": "nix-community",
-
"repo": "dream2nix",
-
"rev": "fbec3263cb4895ac86ee9506cdc4e6919a1a2214",
-
"type": "github"
-
},
-
"original": {
-
"owner": "nix-community",
-
"repo": "dream2nix",
-
"type": "github"
-
}
-
},
-
"fenix": {
-
"inputs": {
-
"nixpkgs": [
-
"nixpkgs"
-
],
-
"rust-analyzer-src": "rust-analyzer-src"
-
},
-
"locked": {
-
"lastModified": 1762584108,
-
"narHash": "sha256-wZUW7dlXMXaRdvNbaADqhF8gg9bAfFiMV+iyFQiDv+Y=",
-
"owner": "nix-community",
-
"repo": "fenix",
-
"rev": "32f3ad3b6c690061173e1ac16708874975ec6056",
-
"type": "github"
-
},
-
"original": {
-
"owner": "nix-community",
-
"repo": "fenix",
-
"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"
-
}
-
},
-
"mk-naked-shell": {
-
"flake": false,
-
"locked": {
-
"lastModified": 1681286841,
-
"narHash": "sha256-3XlJrwlR0nBiREnuogoa5i1b4+w/XPe0z8bbrJASw0g=",
-
"owner": "90-008",
-
"repo": "mk-naked-shell",
-
"rev": "7612f828dd6f22b7fb332cc69440e839d7ffe6bd",
-
"type": "github"
-
},
-
"original": {
-
"owner": "90-008",
-
"repo": "mk-naked-shell",
-
"type": "github"
-
}
-
},
-
"nci": {
-
"inputs": {
-
"crane": "crane",
-
"dream2nix": "dream2nix",
-
"mk-naked-shell": "mk-naked-shell",
-
"nixpkgs": [
-
"nixpkgs"
-
],
-
"parts": "parts",
-
"rust-overlay": "rust-overlay",
-
"treefmt": "treefmt"
-
},
-
"locked": {
-
"lastModified": 1762582646,
-
"narHash": "sha256-MMzE4xccG+8qbLhdaZoeFDUKWUOn3B4lhp5dZmgukmM=",
-
"owner": "90-008",
-
"repo": "nix-cargo-integration",
-
"rev": "0993c449377049fa8868a664e8290ac6658e0b9a",
-
"type": "github"
-
},
-
"original": {
-
"owner": "90-008",
-
"repo": "nix-cargo-integration",
-
"type": "github"
-
}
-
},
-
"nixpkgs": {
-
"locked": {
-
"lastModified": 1762361079,
-
"narHash": "sha256-lz718rr1BDpZBYk7+G8cE6wee3PiBUpn8aomG/vLLiY=",
-
"owner": "nixos",
-
"repo": "nixpkgs",
-
"rev": "ffcdcf99d65c61956d882df249a9be53e5902ea5",
-
"type": "github"
-
},
-
"original": {
-
"owner": "nixos",
-
"ref": "nixpkgs-unstable",
-
"repo": "nixpkgs",
-
"type": "github"
-
}
-
},
-
"parts": {
-
"inputs": {
-
"nixpkgs-lib": [
-
"nci",
-
"nixpkgs"
-
]
-
},
-
"locked": {
-
"lastModified": 1762440070,
-
"narHash": "sha256-xxdepIcb39UJ94+YydGP221rjnpkDZUlykKuF54PsqI=",
-
"owner": "hercules-ci",
-
"repo": "flake-parts",
-
"rev": "26d05891e14c88eb4a5d5bee659c0db5afb609d8",
-
"type": "github"
-
},
-
"original": {
-
"owner": "hercules-ci",
-
"repo": "flake-parts",
-
"type": "github"
-
}
-
},
-
"parts_2": {
-
"inputs": {
-
"nixpkgs-lib": [
-
"nixpkgs"
-
]
-
},
-
"locked": {
-
"lastModified": 1762440070,
-
"narHash": "sha256-xxdepIcb39UJ94+YydGP221rjnpkDZUlykKuF54PsqI=",
-
"owner": "hercules-ci",
-
"repo": "flake-parts",
-
"rev": "26d05891e14c88eb4a5d5bee659c0db5afb609d8",
-
"type": "github"
-
},
-
"original": {
-
"owner": "hercules-ci",
-
"repo": "flake-parts",
-
"type": "github"
-
}
-
},
-
"purescript-overlay": {
-
"inputs": {
-
"flake-compat": "flake-compat",
-
"nixpkgs": [
-
"nci",
-
"dream2nix",
-
"nixpkgs"
-
],
-
"slimlock": "slimlock"
-
},
-
"locked": {
-
"lastModified": 1728546539,
-
"narHash": "sha256-Sws7w0tlnjD+Bjck1nv29NjC5DbL6nH5auL9Ex9Iz2A=",
-
"owner": "thomashoneyman",
-
"repo": "purescript-overlay",
-
"rev": "4ad4c15d07bd899d7346b331f377606631eb0ee4",
-
"type": "github"
-
},
-
"original": {
-
"owner": "thomashoneyman",
-
"repo": "purescript-overlay",
-
"type": "github"
-
}
-
},
-
"pyproject-nix": {
-
"inputs": {
-
"nixpkgs": [
-
"nci",
-
"dream2nix",
-
"nixpkgs"
-
]
-
},
-
"locked": {
-
"lastModified": 1752481895,
-
"narHash": "sha256-luVj97hIMpCbwhx3hWiRwjP2YvljWy8FM+4W9njDhLA=",
-
"owner": "pyproject-nix",
-
"repo": "pyproject.nix",
-
"rev": "16ee295c25107a94e59a7fc7f2e5322851781162",
-
"type": "github"
-
},
-
"original": {
-
"owner": "pyproject-nix",
-
"repo": "pyproject.nix",
-
"type": "github"
-
}
-
},
-
"root": {
-
"inputs": {
-
"fenix": "fenix",
-
"nci": "nci",
-
"nixpkgs": "nixpkgs",
-
"parts": "parts_2"
-
}
-
},
-
"rust-analyzer-src": {
-
"flake": false,
-
"locked": {
-
"lastModified": 1762438844,
-
"narHash": "sha256-ApIKJf6CcMsV2nYBXhGF95BmZMO/QXPhgfSnkA/rVUo=",
-
"owner": "rust-lang",
-
"repo": "rust-analyzer",
-
"rev": "4bf516ee5a960c1e2eee9fedd9b1c9e976a19c86",
-
"type": "github"
-
},
-
"original": {
-
"owner": "rust-lang",
-
"ref": "nightly",
-
"repo": "rust-analyzer",
-
"type": "github"
-
}
-
},
-
"rust-overlay": {
-
"inputs": {
-
"nixpkgs": [
-
"nci",
-
"nixpkgs"
-
]
-
},
-
"locked": {
-
"lastModified": 1762569282,
-
"narHash": "sha256-vINZAJpXQTZd5cfh06Rcw7hesH7sGSvi+Tn+HUieJn8=",
-
"owner": "oxalica",
-
"repo": "rust-overlay",
-
"rev": "a35a6144b976f70827c2fe2f5c89d16d8f9179d8",
-
"type": "github"
-
},
-
"original": {
-
"owner": "oxalica",
-
"repo": "rust-overlay",
-
"type": "github"
-
}
-
},
-
"slimlock": {
-
"inputs": {
-
"nixpkgs": [
-
"nci",
-
"dream2nix",
-
"purescript-overlay",
-
"nixpkgs"
-
]
-
},
-
"locked": {
-
"lastModified": 1688756706,
-
"narHash": "sha256-xzkkMv3neJJJ89zo3o2ojp7nFeaZc2G0fYwNXNJRFlo=",
-
"owner": "thomashoneyman",
-
"repo": "slimlock",
-
"rev": "cf72723f59e2340d24881fd7bf61cb113b4c407c",
-
"type": "github"
-
},
-
"original": {
-
"owner": "thomashoneyman",
-
"repo": "slimlock",
-
"type": "github"
-
}
-
},
-
"treefmt": {
-
"inputs": {
-
"nixpkgs": [
-
"nci",
-
"nixpkgs"
-
]
-
},
-
"locked": {
-
"lastModified": 1762410071,
-
"narHash": "sha256-aF5fvoZeoXNPxT0bejFUBXeUjXfHLSL7g+mjR/p5TEg=",
-
"owner": "numtide",
-
"repo": "treefmt-nix",
-
"rev": "97a30861b13c3731a84e09405414398fbf3e109f",
-
"type": "github"
-
},
-
"original": {
-
"owner": "numtide",
-
"repo": "treefmt-nix",
-
"type": "github"
-
}
-
}
-
},
-
"root": "root",
-
"version": 7
-
}
-36
flake.nix
···
-
{
-
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
-
inputs.nci.url = "github:90-008/nix-cargo-integration";
-
inputs.nci.inputs.nixpkgs.follows = "nixpkgs";
-
inputs.parts.url = "github:hercules-ci/flake-parts";
-
inputs.parts.inputs.nixpkgs-lib.follows = "nixpkgs";
-
inputs.fenix = {
-
url = "github:nix-community/fenix";
-
inputs.nixpkgs.follows = "nixpkgs";
-
};
-
-
outputs = inputs @ {
-
parts,
-
nci,
-
...
-
}:
-
parts.lib.mkFlake {inherit inputs;} {
-
systems = ["x86_64-linux" "aarch64-darwin"];
-
imports = [
-
nci.flakeModule
-
./crates.nix
-
];
-
perSystem = {
-
pkgs,
-
config,
-
...
-
}: let
-
crateOutputs = config.nci.outputs."wisp-cli";
-
in {
-
devShells.default = crateOutputs.devShell;
-
packages.default = crateOutputs.packages.release;
-
packages.wisp-cli-windows = crateOutputs.allTargets."x86_64-pc-windows-gnu".packages.release;
-
packages.wisp-cli-darwin = crateOutputs.allTargets."aarch64-apple-darwin".packages.release;
-
};
-
};
-
}