feat(nix): simplify flake.nix, remove devenv
This commit is contained in:
@@ -4,8 +4,6 @@ if ! has nix_direnv_version || ! nix_direnv_version 3.1.0; then
|
|||||||
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.1.0/direnvrc" "sha256-yMJ2OVMzrFaDPn7q8nCBZFRYpL/f0RcHzhmw/i6btJM="
|
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.1.0/direnvrc" "sha256-yMJ2OVMzrFaDPn7q8nCBZFRYpL/f0RcHzhmw/i6btJM="
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export DEVENV_IN_DIRENV_SHELL=true
|
|
||||||
|
|
||||||
# Load .env file if present
|
# Load .env file if present
|
||||||
dotenv_if_exists
|
dotenv_if_exists
|
||||||
|
|
||||||
@@ -20,5 +18,5 @@ if [[ -f .envrc.local ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if ! use flake . --no-pure-eval; then
|
if ! use flake . --no-pure-eval; then
|
||||||
echo "Devenv could not be built. The devenv environment was not loaded. Make the necessary changes to flake.nix and hit enter to try again." >&2
|
echo "Development shell could not be built. The environment was not loaded. Make the necessary changes to flake.nix and hit enter to try again." >&2
|
||||||
fi
|
fi
|
||||||
|
|||||||
Generated
+11
-260
@@ -23,65 +23,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cachix": {
|
|
||||||
"inputs": {
|
|
||||||
"devenv": [
|
|
||||||
"devenv"
|
|
||||||
],
|
|
||||||
"flake-compat": [
|
|
||||||
"devenv",
|
|
||||||
"flake-compat"
|
|
||||||
],
|
|
||||||
"git-hooks": [
|
|
||||||
"devenv",
|
|
||||||
"git-hooks"
|
|
||||||
],
|
|
||||||
"nixpkgs": [
|
|
||||||
"devenv",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1760971495,
|
|
||||||
"narHash": "sha256-IwnNtbNVrlZIHh7h4Wz6VP0Furxg9Hh0ycighvL5cZc=",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "cachix",
|
|
||||||
"rev": "c5bfd933d1033672f51a863c47303fc0e093c2d2",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"ref": "latest",
|
|
||||||
"repo": "cachix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"devenv": {
|
|
||||||
"inputs": {
|
|
||||||
"cachix": "cachix",
|
|
||||||
"flake-compat": "flake-compat",
|
|
||||||
"flake-parts": "flake-parts",
|
|
||||||
"git-hooks": "git-hooks",
|
|
||||||
"nix": "nix",
|
|
||||||
"nixd": "nixd",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1770304289,
|
|
||||||
"narHash": "sha256-+g+XMyB1zi50h2N38GE32l7ZONX4oW7Nw6QSXzfNiwk=",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "devenv",
|
|
||||||
"rev": "fd777e39027d393346e4df672d51ad2bf44b2a12",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "devenv",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"fenix": {
|
"fenix": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@@ -104,58 +45,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-compat": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1761588595,
|
|
||||||
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "edolstra",
|
|
||||||
"repo": "flake-compat",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-parts": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs-lib": [
|
|
||||||
"devenv",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1760948891,
|
|
||||||
"narHash": "sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"rev": "864599284fc7c0ba6357ed89ed5e2cd5040f0c04",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "flake-parts",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-root": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1723604017,
|
|
||||||
"narHash": "sha256-rBtQ8gg+Dn4Sx/s+pvjdq3CB2wQNzx9XGFq/JVGCB6k=",
|
|
||||||
"owner": "srid",
|
|
||||||
"repo": "flake-root",
|
|
||||||
"rev": "b759a56851e10cb13f6b8e5698af7b59c44be26e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "srid",
|
|
||||||
"repo": "flake-root",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
@@ -190,141 +79,25 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"git-hooks": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": [
|
|
||||||
"devenv",
|
|
||||||
"flake-compat"
|
|
||||||
],
|
|
||||||
"gitignore": "gitignore",
|
|
||||||
"nixpkgs": [
|
|
||||||
"devenv",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1760663237,
|
|
||||||
"narHash": "sha256-BflA6U4AM1bzuRMR8QqzPXqh8sWVCNDzOdsxXEguJIc=",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "git-hooks.nix",
|
|
||||||
"rev": "ca5b894d3e3e151ffc1db040b6ce4dcc75d31c37",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "git-hooks.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"gitignore": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"devenv",
|
|
||||||
"git-hooks",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1709087332,
|
|
||||||
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "hercules-ci",
|
|
||||||
"repo": "gitignore.nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nix": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-compat": [
|
|
||||||
"devenv",
|
|
||||||
"flake-compat"
|
|
||||||
],
|
|
||||||
"flake-parts": [
|
|
||||||
"devenv",
|
|
||||||
"flake-parts"
|
|
||||||
],
|
|
||||||
"git-hooks-nix": [
|
|
||||||
"devenv",
|
|
||||||
"git-hooks"
|
|
||||||
],
|
|
||||||
"nixpkgs": [
|
|
||||||
"devenv",
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"nixpkgs-23-11": [
|
|
||||||
"devenv"
|
|
||||||
],
|
|
||||||
"nixpkgs-regression": [
|
|
||||||
"devenv"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1769708679,
|
|
||||||
"narHash": "sha256-uFKkp2/SjIqbu5HtINg/hwHN6qaqcxLIbL/om7dT3kI=",
|
|
||||||
"owner": "cachix",
|
|
||||||
"repo": "nix",
|
|
||||||
"rev": "72bec37fabbfe378d677868ec42eeb83acf07a4c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "cachix",
|
|
||||||
"ref": "devenv-2.32",
|
|
||||||
"repo": "nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixd": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-parts": [
|
|
||||||
"devenv",
|
|
||||||
"flake-parts"
|
|
||||||
],
|
|
||||||
"flake-root": "flake-root",
|
|
||||||
"nixpkgs": [
|
|
||||||
"devenv",
|
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"treefmt-nix": "treefmt-nix"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1763964548,
|
|
||||||
"narHash": "sha256-JTRoaEWvPsVIMFJWeS4G2isPo15wqXY/otsiHPN0zww=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixd",
|
|
||||||
"rev": "d4bf15e56540422e2acc7bc26b20b0a0934e3f5e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "nixd",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1767052823,
|
"lastModified": 1779877693,
|
||||||
"narHash": "sha256-Fhuljcy7pJ8HacYYATRcm5rdKXx8P6D/0g19ppzDRNY=",
|
"narHash": "sha256-NOF9NAREhxr50bbBfVcVOq+ArCMSoe8dP79Pk2uyARk=",
|
||||||
"owner": "cachix",
|
"owner": "NixOS",
|
||||||
"repo": "devenv-nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "538a5124359f0b3d466e1160378c87887e3b51a4",
|
"rev": "4100e830e085863741bc69b156ec4ccd53ab5be0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "cachix",
|
"owner": "NixOS",
|
||||||
"ref": "rolling",
|
"ref": "nixpkgs-unstable",
|
||||||
"repo": "devenv-nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"alejandra": "alejandra",
|
"alejandra": "alejandra",
|
||||||
"devenv": "devenv",
|
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
@@ -354,11 +127,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1770260791,
|
"lastModified": 1779992051,
|
||||||
"narHash": "sha256-ADTBfENFjRVDQMcCycyX/pAy6NFI/Ct6Mrar3gsmXI0=",
|
"narHash": "sha256-4YWGv/0NkAdtTW1MXfaLYpfC9BhpCy9k1pWkR0xI9uw=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "42ec85352e419e601775c57256a52f6d48a39906",
|
"rev": "e93ad0df1073b2c969a8f0c1f10b84e870469d40",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -381,28 +154,6 @@
|
|||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"treefmt-nix": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"devenv",
|
|
||||||
"nixd",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1734704479,
|
|
||||||
"narHash": "sha256-MMi74+WckoyEWBRcg/oaGRvXC9BVVxDZNRMpL+72wBI=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"rev": "65712f5af67234dad91a5a4baee986a8b62dbf8f",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "treefmt-nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|||||||
@@ -2,16 +2,12 @@
|
|||||||
description = "Conventional commits for Jujutsu";
|
description = "Conventional commits for Jujutsu";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:cachix/devenv-nixpkgs/rolling";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
alejandra = {
|
alejandra = {
|
||||||
url = "github:kamadorueda/alejandra/4.0.0";
|
url = "github:kamadorueda/alejandra/4.0.0";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
devenv = {
|
|
||||||
url = "github:cachix/devenv";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
rust-overlay = {
|
rust-overlay = {
|
||||||
url = "github:oxalica/rust-overlay";
|
url = "github:oxalica/rust-overlay";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
@@ -19,8 +15,16 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
nixConfig = {
|
nixConfig = {
|
||||||
extra-trusted-public-keys = ["devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" "phundrak.cachix.org-1:osJAkYO0ioTOPqaQCIXMfIRz1/+YYlVFkup3R2KSexk="];
|
extra-trusted-public-keys = [
|
||||||
extra-substituters = ["https://devenv.cachix.org" "https://phundrak.cachix.org"];
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
|
"devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
|
||||||
|
"phundrak.cachix.org-1:osJAkYO0ioTOPqaQCIXMfIRz1/+YYlVFkup3R2KSexk="
|
||||||
|
];
|
||||||
|
extra-substituters = [
|
||||||
|
"https://nix-community.cachix.org"
|
||||||
|
"https://devenv.cachix.org"
|
||||||
|
"https://phundrak.cachix.org"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
@@ -29,37 +33,65 @@
|
|||||||
rust-overlay,
|
rust-overlay,
|
||||||
alejandra,
|
alejandra,
|
||||||
...
|
...
|
||||||
} @ inputs:
|
}:
|
||||||
flake-utils.lib.eachDefaultSystem (
|
flake-utils.lib.eachDefaultSystem (
|
||||||
system: let
|
system: let
|
||||||
overlays = [(import rust-overlay)];
|
overlays = [(import rust-overlay)];
|
||||||
pkgs = import nixpkgs {inherit system overlays;};
|
pkgs = import nixpkgs {inherit system overlays;};
|
||||||
rustVersion = pkgs.rust-bin.stable.latest.default;
|
rustVersion = pkgs.rust-bin.stable.latest.default;
|
||||||
rustPlatform = pkgs.makeRustPlatform {
|
targets = {
|
||||||
cargo = rustVersion;
|
linux-x86_64 = {
|
||||||
rustc = rustVersion;
|
crossPkgs = pkgs;
|
||||||
|
triple = "x86_64-unknown-linux-gnu";
|
||||||
|
exeSuffix = "";
|
||||||
|
};
|
||||||
|
linux-aarch64 = {
|
||||||
|
crossPkgs = pkgs.pkgsCross.aarch64-multiplatform;
|
||||||
|
triple = "aarch64-unknown-linux-gnu";
|
||||||
|
exeSuffix = "";
|
||||||
|
};
|
||||||
|
windows-x86_64 = {
|
||||||
|
crossPkgs = pkgs.pkgsCross.mingwW64;
|
||||||
|
triple = "x86_64-pc-windows-gnu";
|
||||||
|
exeSuffix = ".exe";
|
||||||
|
};
|
||||||
|
windows-aarch64 = {
|
||||||
|
crossPkgs = pkgs.pkgsCross.aarch64-windows;
|
||||||
|
triple = "aarch64-pc-windows-gnu";
|
||||||
|
exeSuffix = ".exe";
|
||||||
|
};
|
||||||
|
macos-x86_64 = {
|
||||||
|
crossPkgs = pkgs.pkgsCross.x86_64-darwin;
|
||||||
|
triple = "x86_64-apple-darwin";
|
||||||
|
exeSuffix = "";
|
||||||
|
};
|
||||||
|
macos-aarch64 = {
|
||||||
|
crossPkgs = pkgs.pkgsCross.aarch64-darwin;
|
||||||
|
triple = "aarch64-apple-darwin";
|
||||||
|
exeSuffix = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
mkRustBuild = import ./nix/package.nix;
|
||||||
|
packages = {
|
||||||
|
linux-x86_64 = mkRustBuild {inherit pkgs; target = targets.linux-x86_64; };
|
||||||
|
linux-aarch64 = mkRustBuild { inherit pkgs; target = targets.linux-aarch64; };
|
||||||
|
windows-x86_64 = mkRustBuild { inherit pkgs; target = targets.windows-x86_64; };
|
||||||
|
macos-aarch64 = mkRustBuild { inherit pkgs; target = targets.macos-aarch64; };
|
||||||
|
};
|
||||||
|
defaultBySystem = {
|
||||||
|
"x86_64-linux" = packages.linux-x86_64;
|
||||||
|
"aarch64-linux" = packages.linux-aarch64;
|
||||||
|
"x86_64-windows" = packages.windows-x86_64;
|
||||||
|
"aarch64-macos" = packages.macos-aarch64;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
formatter = alejandra.defaultPackage.${system};
|
formatter = alejandra.defaultPackage.${system};
|
||||||
packages = let
|
packages =
|
||||||
nativeRustVersion = pkgs.rust-bin.stable.latest.default;
|
packages
|
||||||
nativeRustPlatform = pkgs.makeRustPlatform {
|
// {
|
||||||
cargo = nativeRustVersion;
|
default = defaultBySystem.${system} or packages.linux-x86_64;
|
||||||
rustc = nativeRustVersion;
|
|
||||||
};
|
|
||||||
mingwPkgs = pkgs.pkgsCross.mingwW64;
|
|
||||||
windowsRustVersion = pkgs.rust-bin.stable.latest.default.override {
|
|
||||||
targets = ["x86_64-pc-windows-gnu"];
|
|
||||||
};
|
|
||||||
windowsRustPlatform = mingwPkgs.makeRustPlatform {
|
|
||||||
cargo = windowsRustVersion;
|
|
||||||
rustc = windowsRustVersion;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
import ./nix/package.nix {inherit pkgs nativeRustPlatform windowsRustPlatform;};
|
|
||||||
devShell = import ./nix/shell.nix {
|
|
||||||
inherit inputs pkgs rustVersion;
|
|
||||||
};
|
};
|
||||||
|
devShell = import ./nix/shell.nix {inherit pkgs rustVersion;};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-15
@@ -1,8 +1,6 @@
|
|||||||
{
|
{
|
||||||
|
target,
|
||||||
pkgs,
|
pkgs,
|
||||||
nativeRustPlatform,
|
|
||||||
windowsRustPlatform,
|
|
||||||
...
|
|
||||||
}: let
|
}: let
|
||||||
cargoToml = fromTOML (builtins.readFile ../Cargo.toml);
|
cargoToml = fromTOML (builtins.readFile ../Cargo.toml);
|
||||||
name = cargoToml.package.name;
|
name = cargoToml.package.name;
|
||||||
@@ -16,18 +14,14 @@
|
|||||||
meta = {
|
meta = {
|
||||||
inherit (cargoToml.package) description homepage;
|
inherit (cargoToml.package) description homepage;
|
||||||
};
|
};
|
||||||
|
postBuild = "${pkgs.upx}/bin/upx target/*/release/${name}${target.exeSuffix}";
|
||||||
};
|
};
|
||||||
nativeBuild =
|
rustVersion = pkgs.rust-bin.stable.latest.default.override {
|
||||||
nativeRustPlatform.buildRustPackage buildArgs
|
targets = [target.triple];
|
||||||
// {
|
|
||||||
postBuild = "${pkgs.upx}/bin/upx target/*/release/${name}";
|
|
||||||
};
|
};
|
||||||
windowsBuild =
|
rustPlatform = target.crossPkgs.makeRustPlatform {
|
||||||
windowsRustPlatform.buildRustPackage buildArgs
|
cargo = rustVersion;
|
||||||
// {
|
rustc = rustVersion;
|
||||||
postBuild = "${pkgs.upx}/bin/upx target/*/release/${name}.exe";
|
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
default = nativeBuild;
|
rustPlatform.buildRustPackage buildArgs
|
||||||
windows = windowsBuild;
|
|
||||||
}
|
|
||||||
|
|||||||
+1
-8
@@ -1,13 +1,8 @@
|
|||||||
{
|
{
|
||||||
inputs,
|
|
||||||
pkgs,
|
pkgs,
|
||||||
rustVersion,
|
rustVersion,
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
inputs.devenv.lib.mkShell {
|
pkgs.mkShell {
|
||||||
inherit inputs pkgs;
|
|
||||||
modules = [
|
|
||||||
{
|
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
(rustVersion.override {
|
(rustVersion.override {
|
||||||
extensions = [
|
extensions = [
|
||||||
@@ -27,5 +22,3 @@ inputs.devenv.lib.mkShell {
|
|||||||
typos
|
typos
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user