Files
firezone/scripts/nix/flake.nix
Reactor Scram 3a67eacfbe refactor(linux-client): replace client-tunnel with headless-client which is the same thing (#4516)
Unfortunately I had to keep `linux-client` to get the compatibility
tests to pass. #4578 aims to remove that package.

Please add to this list if you think of anything:

```[tasklist]
# Things that may break that CI/CD won't catch
- [ ] Github release artifacts
- [ ] Knowledge base 
- [ ] Docker images
- [ ] Docker containers
- [ ] Existing `linux-client` users
- [ ] Anything that downloads ghcr artifacts
- [ ] Nix (Not sure if it's built in CI. It had a merge conflict)
```

Refs #4515, and #3712, #3782

I think this is what Thomas and I agreed on in Slack / Github

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-04-10 22:01:55 +00:00

81 lines
2.5 KiB
Nix

{
inputs = {
nixpkgs.url = "nixpkgs/nixos-23.11";
naersk.url = "github:nix-community/naersk";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nixpkgs, flake-utils, rust-overlay, ... } @ inputs:
flake-utils.lib.eachDefaultSystem
(
system:
let
pkgs = import nixpkgs {
inherit system;
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
gtk3
cairo
gdk-pixbuf
glib
dbus
openssl_3
librsvg
];
packages = with pkgs; [
curl
wget
pkg-config
dbus
openssl_3
glib
gtk3
libsoup
webkitgtk
librsvg
libappindicator-gtk3
];
mkShellWithRustVersion = rustVersion: pkgs.mkShell {
packages = [ pkgs.cargo-tauri pkgs.iptables cargo-udeps ];
buildInputs = rustVersion ++ packages;
name = "rust-env";
src = ../../rust;
shellHook =
''
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath libraries}:$LD_LIBRARY_PATH
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-headless-client = naersk.buildPackage {
name = "foo";
src = ../../rust/headless-client;
};
devShells.default = mkShellWithRustVersion [
(pkgs.rust-bin.fromRustupToolchainFile ../../rust/rust-toolchain.toml)
];
devShells.nightly = mkShellWithRustVersion [
(pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default))
];
}
);
}