add nix flake

This commit is contained in:
Ethan Niser
2024-07-13 17:07:13 -07:00
parent 95f5ddd621
commit a817f9c168
2 changed files with 57 additions and 0 deletions

26
flake.lock generated Normal file
View File

@@ -0,0 +1,26 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1720910238,
"narHash": "sha256-J/IAXi62ICt+K4UTM9l/IGe2HtepKL46rot4NnQBpg8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "76069dafc9c020a9bead5e6858f0fe791e04d068",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

31
flake.nix Normal file
View File

@@ -0,0 +1,31 @@
{
inputs = {
nixpkgs = {
url = "github:nixos/nixpkgs";
};
};
outputs = {nixpkgs, ...}: let
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
forAllSystems = nixpkgs.lib.genAttrs systems;
in {
devShells = forAllSystems (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = with pkgs;
mkShell {
buildInputs = [
clang
libiconv
sqlite
rustup
gnumake
];
shellHook = ''
rustup default stable
'';
};
}
);
};
}