Skip to content

Commit

Permalink
Revert "flake: switch to flake-parts"
Browse files Browse the repository at this point in the history
This reverts commit 09c128c.
  • Loading branch information
slotThe committed Mar 18, 2024
1 parent de2a3b9 commit 22da9e1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 238 deletions.
225 changes: 12 additions & 213 deletions flake.lock

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

56 changes: 31 additions & 25 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,43 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
nci = {
url = "github:yusdacra/nix-cargo-integration";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};

outputs = inputs @ { flake-parts, flake-utils, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = flake-utils.lib.defaultSystems;
imports = [ inputs.nci.flakeModule ];
perSystem = { config, pkgs, ... }:
let outputs = config.nci.outputs.rq;
in {
nci = {
toolchainConfig = ./rust-toolchain.toml;
projects.rq-project = {
path = ./.;
outputs = { self, nixpkgs, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
overlays = [ rust-overlay.overlays.default ];
pkgs = import nixpkgs { inherit system overlays; };
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
platform = pkgs.makeRustPlatform {
cargo = toolchain;
rustc = toolchain;
};
cargoMeta =
(builtins.fromTOML (builtins.readFile ./Cargo.toml)).package;
in with pkgs; {
packages = {
rq = platform.buildRustPackage {
pname = "rq";
inherit (cargoMeta) version;
src = ./.;
meta = {
license = lib.licenses.gpl3;
description =
"a tiny functional language with which you can manipulate JSON";
};
crates.rq = { };
};

packages = rec {
rq = outputs.packages.release;
default = rq;
cargoLock.lockFile = ./Cargo.lock;
};

devShells.default = outputs.devShell;
default = self.packages."${system}".rq;
};
};

devShells.default =
mkShell { buildInputs = [ toolchain rust-analyzer ]; };
});
}
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#![allow(confusable_idents)]
#![feature(assert_matches)]
#![feature(box_patterns)]
#![feature(extend_one)]
#![feature(iter_intersperse)]
#![feature(lazy_cell)]
#![feature(slice_split_once)]
Expand Down

0 comments on commit 22da9e1

Please sign in to comment.