Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): use only extra substituters #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 81 additions & 85 deletions tools/nix/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
description = "fuzon";

nixConfig = {
substituters = [
# Add here some other mirror if needed.
"https://cache.nixos.org/"
];
extra-substituters = [
# Nix community's cache server
"https://nix-community.cachix.org"
Expand Down Expand Up @@ -35,93 +31,93 @@
};
};

outputs = {
self,
nixpkgs,
flake-utils,
rust-overlay,
...
}:
outputs =
{
self,
nixpkgs,
flake-utils,
rust-overlay,
...
}:
flake-utils.lib.eachDefaultSystem
# Creates an attribute map `{ devShells.<system>.default = ...}`
# by calling this function:
(
system: let
rootSrc = ./../..;

overlays = [(import rust-overlay)];

# Import nixpkgs and load it into pkgs.
# Overlay the rust toolchain
pkgs = import nixpkgs {
inherit system overlays;
};

# Set the rust toolchain from the `rust-toolchain.toml`.
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ../../rust-toolchain.toml;

# Things needed only at compile-time.
basic-deps = with pkgs; [
maturin
findutils
coreutils
bash
zsh
curl
git
jq
];

# Things needed only at compile-time.
general-deps = [
rustToolchain
pkgs.cargo-watch
pkgs.just

pkgs.skopeo
pkgs.dasel
pkgs.python313
];

benchmark-deps = with pkgs; [
hyperfine
heaptrack
];

# The package of this CLI tool.
# The global version for fuzon.
# This is gonna get tooled later.
fuzon = pkgs.callPackage ./pkgs/fuzon {
inherit rootSrc;
inherit rustToolchain;
};
in rec {
devShells = {
default = pkgs.mkShell {
packages = basic-deps ++ general-deps;
# Creates an attribute map `{ devShells.<system>.default = ...}`
# by calling this function:
(
system:
let
rootSrc = ./../..;

overlays = [ (import rust-overlay) ];

# Import nixpkgs and load it into pkgs.
# Overlay the rust toolchain
pkgs = import nixpkgs {
inherit system overlays;
};

# Set the rust toolchain from the `rust-toolchain.toml`.
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ../../rust-toolchain.toml;

# Things needed only at compile-time.
basic-deps = with pkgs; [
maturin
findutils
coreutils
bash
zsh
curl
git
jq
];

# Things needed only at compile-time.
general-deps = [
rustToolchain
pkgs.cargo-watch
pkgs.just

pkgs.skopeo
pkgs.dasel
pkgs.python313
];

benchmark-deps = with pkgs; [
hyperfine
heaptrack
];

# The package of this CLI tool.
# The global version for fuzon.
# This is gonna get tooled later.
fuzon = pkgs.callPackage ./pkgs/fuzon {
inherit rootSrc;
inherit rustToolchain;
};
bench = pkgs.mkShell {
packages =
basic-deps
++ general-deps
++ benchmark-deps;
in
rec {
devShells = {
default = pkgs.mkShell {
packages = basic-deps ++ general-deps;
};
bench = pkgs.mkShell {
packages = basic-deps ++ general-deps ++ benchmark-deps;
};
};
};

packages = {
fuzon = fuzon;
packages = {
fuzon = fuzon;

images = {
dev = (import ./images/dev.nix) {
inherit pkgs;
devShellDrv = devShells.default;
};
images = {
dev = (import ./images/dev.nix) {
inherit pkgs;
devShellDrv = devShells.default;
};

fuzon = (import ./images/fuzon.nix) {
inherit pkgs fuzon;
fuzon = (import ./images/fuzon.nix) {
inherit pkgs fuzon;
};
};
};
};
}
);
}
);
}
Loading