Skip to content

Commit

Permalink
feat: nixify
Browse files Browse the repository at this point in the history
  • Loading branch information
maan2003 committed Jan 19, 2024
1 parent 57e0cfc commit 55af52d
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
25 changes: 25 additions & 0 deletions flake.lock

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

36 changes: 36 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
outputs = { self, nixpkgs }:
let
nameValuePair = name: value: { inherit name value; };
genAttrs = names: f: builtins.listToAttrs (map (n: nameValuePair n (f n)) names);
allSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];

forAllSystems = f: genAttrs allSystems (system: f rec {
inherit system;
pkgs = import nixpkgs { inherit system; };
lib = pkgs.lib;
});
in
{
devShells = forAllSystems ({ system, pkgs, ... }: {
default = with pkgs;
stdenv.mkDerivation {
name = "riff-shell";
buildInputs = [
bashInteractive
cargo rustc rustfmt
] ++ lib.optionals (stdenv.isDarwin) [
libiconv
];

"RUST_SRC_PATH" = "${rustPlatform.rustLibSrc}";


};
});

# Compatibility with older Nix installations that don't check for `devShells.<arch>.default` first.
devShell = forAllSystems ({ system, ... }: self.devShells.${system}.default);
};
}

0 comments on commit 55af52d

Please sign in to comment.