refactored dev flake to rust overlay, added deno to flake
This commit is contained in:
80
flake.nix
80
flake.nix
@ -1,49 +1,71 @@
|
||||
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.10)
|
||||
{
|
||||
description = "My personal website version 2.0";
|
||||
# A helpful description of your flake
|
||||
description = "A Gitea command line application";
|
||||
|
||||
# Flake inputs
|
||||
inputs = {
|
||||
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
|
||||
|
||||
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
|
||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
# Flake outputs that other flakes can use
|
||||
outputs =
|
||||
{ self
|
||||
, flake-schemas
|
||||
, nixpkgs
|
||||
, nixpkgs-unstable
|
||||
, flake-utils
|
||||
, rust-overlay
|
||||
,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
(final: prev: {
|
||||
deno = nixpkgs-unstable.legacyPackages.${system}.deno;
|
||||
})
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
devShells.default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
deno
|
||||
rustc
|
||||
cargo
|
||||
cargo-edit
|
||||
cargo-watch
|
||||
cargo-vet
|
||||
sqlx-cli
|
||||
let
|
||||
# Nixpkgs overlays
|
||||
overlays = [
|
||||
rust-overlay.overlays.default
|
||||
(final: prev: {
|
||||
rustToolchain = final.rust-bin.stable.latest.default.override { extensions = [ "rust-src" ]; };
|
||||
})
|
||||
];
|
||||
|
||||
# Helpers for producing system-specific outputs
|
||||
supportedSystems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" "aarch64-linux" ];
|
||||
forEachSupportedSystem = f:
|
||||
nixpkgs.lib.genAttrs supportedSystems (system:
|
||||
f {
|
||||
pkgs = import nixpkgs { inherit overlays system; };
|
||||
});
|
||||
in
|
||||
{
|
||||
# Schemas tell Nix about the structure of your flake's outputs
|
||||
schemas = flake-schemas.schemas;
|
||||
|
||||
# Development environments
|
||||
devShells = forEachSupportedSystem ({ pkgs }: {
|
||||
default = pkgs.mkShell {
|
||||
# Pinned packages available in the environment
|
||||
packages = with pkgs; [
|
||||
rustToolchain
|
||||
rust-analyzer
|
||||
curl
|
||||
git
|
||||
jq
|
||||
wget
|
||||
nixpkgs-fmt
|
||||
openssl
|
||||
deno
|
||||
];
|
||||
|
||||
# Environment variables
|
||||
env = {
|
||||
RUST_BACKTRACE = "1";
|
||||
RUST_SRC_PATH = "${pkgs.rustToolchain}/lib/rustlib/src/rust/library";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user