mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
chore(nix): add Rust nightly dev-shell and cargo-udeps (#4474)
This commit is contained in:
@@ -3,3 +3,7 @@
|
||||
To use the dev-shell specified in this repository, simply run `nix develop`.
|
||||
|
||||
There is also an `.envrc` file at the repository root, meaning if you have `direnv` installed and hooked up for your shell, `nix develop` will be run automatically as soon as you enter the repository.
|
||||
|
||||
## Rust nightly
|
||||
|
||||
If you need a nightly version of Rust, you can open a devShell with the latest Rust nightly version installed using: `nix develop .#nightly`
|
||||
|
||||
28
scripts/nix/flake.lock
generated
28
scripts/nix/flake.lock
generated
@@ -5,11 +5,11 @@
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1705309234,
|
||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
||||
"lastModified": 1710146030,
|
||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -56,12 +56,10 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1708847675,
|
||||
"narHash": "sha256-RUZ7KEs/a4EzRELYDGnRB6i7M1Izii3JD/LyzH0c6Tg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2a34566b67bef34c551f204063faeecc444ae9da",
|
||||
"type": "github"
|
||||
"lastModified": 0,
|
||||
"narHash": "sha256-YN/Ciidm+A0fmJPWlHBGvVkcarYWSC+s3NTPk/P+q3c=",
|
||||
"path": "/nix/store/amxd2p02wx78nyaa4bkb0hjvgwhz1dq7-source",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
@@ -70,11 +68,11 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1708831307,
|
||||
"narHash": "sha256-0iL/DuGjiUeck1zEaL+aIe2WvA3/cVhp/SlmTcOZXH4=",
|
||||
"lastModified": 1711668574,
|
||||
"narHash": "sha256-u1dfs0ASQIEr1icTVrsKwg2xToIpn7ZXxW3RHfHxshg=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5bf1cadb72ab4e77cb0b700dab76bcdaf88f706b",
|
||||
"rev": "219951b495fc2eac67b1456824cc1ec1fd2ee659",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -113,11 +111,11 @@
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1708913568,
|
||||
"narHash": "sha256-76PGANC2ADf0h7fe0w2nWpfdGN+bemFs2rvW2EdU/ZY=",
|
||||
"lastModified": 1712110341,
|
||||
"narHash": "sha256-8LU2IM4ctHz043hlzoFUwQS1QIdhiMGEH/oIfPCxoWU=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "cbdf3e5bb205ff2ca165fe661fbd6d885cbd0106",
|
||||
"rev": "74deb67494783168f5b6d2071d73177e6bccab65",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
@@ -16,6 +16,14 @@
|
||||
overlays = [ (import rust-overlay) ];
|
||||
};
|
||||
naersk = pkgs.callPackage inputs.naersk { };
|
||||
rust-nightly = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default);
|
||||
|
||||
# Wrap `cargo-udeps` to ensure it uses a nightly Rust version.
|
||||
cargo-udeps = pkgs.writeShellScriptBin "cargo-udeps" ''
|
||||
export RUSTC="${rust-nightly}/bin/rustc";
|
||||
export CARGO="${rust-nightly}/bin/cargo";
|
||||
exec "${pkgs.cargo-udeps}/bin/cargo-udeps" "$@"
|
||||
'';
|
||||
|
||||
libraries = with pkgs;[
|
||||
webkitgtk
|
||||
@@ -41,20 +49,10 @@
|
||||
librsvg
|
||||
libappindicator-gtk3
|
||||
];
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
packages.firezone-linux-client = naersk.buildPackage {
|
||||
name = "foo";
|
||||
src = ../../rust/linux-client;
|
||||
};
|
||||
|
||||
devShell = pkgs.mkShell {
|
||||
packages = [ pkgs.cargo-tauri pkgs.iptables ];
|
||||
buildInputs = [
|
||||
(pkgs.rust-bin.fromRustupToolchainFile ../../rust/rust-toolchain.toml)
|
||||
] ++ packages;
|
||||
mkShellWithRustVersion = rustVersion: pkgs.mkShell {
|
||||
packages = [ pkgs.cargo-tauri pkgs.iptables cargo-udeps ];
|
||||
buildInputs = rustVersion ++ packages;
|
||||
name = "rust-env";
|
||||
src = ../../rust;
|
||||
shellHook =
|
||||
@@ -63,7 +61,20 @@
|
||||
export XDG_DATA_DIRS=${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS
|
||||
'';
|
||||
};
|
||||
}
|
||||
in
|
||||
{
|
||||
packages.firezone-linux-client = naersk.buildPackage {
|
||||
name = "foo";
|
||||
src = ../../rust/linux-client;
|
||||
};
|
||||
|
||||
devShells.default = mkShellWithRustVersion [
|
||||
(pkgs.rust-bin.fromRustupToolchainFile ../../rust/rust-toolchain.toml)
|
||||
];
|
||||
|
||||
devShells.nightly = mkShellWithRustVersion [
|
||||
(pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default))
|
||||
];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user