implemented basic data extraction

This commit is contained in:
specCon18 2024-05-29 19:14:26 -04:00
parent fe3787fd7a
commit 46fc01b803
13 changed files with 578 additions and 0 deletions

11
nix/default.nix Normal file
View file

@ -0,0 +1,11 @@
{ pkgs ? import <nixpkgs> { }, lib }:
pkgs.rustPlatform.buildRustPackage rec {
pname = "algos-in-rust";
version = "1.0.0";
cargoLock.lockFile = ../Cargo.lock;
src = pkgs.lib.cleanSource ../.;
buildInputs = [ ];
nativeBuildInputs = [ pkgs.pkg-config ];
doCheck = false;
}

16
nix/devshell.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs ? import <nixpkgs> { } }:
pkgs.mkShell {
# Get dependencies from the main package
inputsFrom = [ (pkgs.callPackage ./default.nix { }) ];
# Additional tooling
buildInputs = with pkgs; [
cargo
cargo-watch
rustc
rustup
clippy
bacon
rust-analyzer
pkg-config
];
}

32
nix/flake.nix Normal file
View file

@ -0,0 +1,32 @@
{
description = "SunServer";
inputs={
nixpkgs.url = "nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs }@inputs:
let
supportedSystems = [ "x86_64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
#v I improved how you call in packages
pkgs = forAllSystems (system:
import nixpkgs {
inherit system;
#v this can be adjusted to read args passed without impure later
config = { allowUnfreePredicate = pkg: builtins.elem (nixpkgs.lib.getName pkg) [
"unrar"
];
};
}
);
in {
packages = forAllSystems (system: {
default = pkgs.${system}.callPackage ./nix/default.nix { };
});
devShells = forAllSystems (system: {
default = pkgs.${system}.callPackage ./nix/devshell.nix { };
});
nixConfig = {
};
};
}