Skip to content

Commit

Permalink
Basic Flake (#41)
Browse files Browse the repository at this point in the history
Here is a basic flake for the project.

Features:
- Multi architecture builds (aarch64, x86_64, risc, etc)
- Reproducible development environments. Run `nix develop` and you have
the locked version of Rust and rust-analyzer
- Reproducable builds.

Let me know any other changes that need to be made
  • Loading branch information
IogaMaster committed Sep 27, 2023
1 parent 74dedb4 commit 78db005
Show file tree
Hide file tree
Showing 3 changed files with 176 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Rust
/target

# Nix
result
130 changes: 130 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
description = "The Nushell Formatter";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";

rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
in
{
devShells.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
rust-bin.stable.latest.default
rust-analyzer

nushell
];

buildInputs = with pkgs; [ ];
};

packages.default = pkgs.rustPlatform.buildRustPackage rec {
name = "nufmt";

src = ./.;

cargoLock = {
lockFile = ./Cargo.lock;
};
};
}
);
}

0 comments on commit 78db005

Please sign in to comment.