Skip to content

Commit

Permalink
Merge pull request #2 from itepastra/add-nix-support
Browse files Browse the repository at this point in the history
add flake for nix
  • Loading branch information
Bright-Shard authored Nov 20, 2024
2 parents fd2c805 + 4f36945 commit 690ae0b
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
/target

/.direnv
/result
/.envrc
27 changes: 27 additions & 0 deletions flake.lock

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

57 changes: 57 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};

outputs =
{ nixpkgs, ... }:
let
allSystems = [
"x86_64-linux" # 64-bit Intel/AMD Linux
"aarch64-linux" # 64-bit ARM Linux
"x86_64-darwin" # 64-bit Intel macOS
"aarch64-darwin" # 64-bit ARM macOS
];
forAllSystems =
f:
nixpkgs.lib.genAttrs allSystems (
system:
f {
inherit system;
pkgs = import nixpkgs { inherit system; };
}
);
in
{
packages = forAllSystems (
{ pkgs, ... }:
rec {
default = webby;
webby = pkgs.rustPlatform.buildRustPackage {
pname = "webby";
version = "0.1.0";
cargoLock.lockFile = ./Cargo.lock;
src = pkgs.lib.fileset.toSource {
root = ./.;
fileset = pkgs.lib.fileset.unions [
./Cargo.lock
./Cargo.toml
./src
];
};
};
}
);
devShells = forAllSystems (
{ pkgs, system, ... }:
{
default = pkgs.mkShell {
buildInputs = [
pkgs.cargo
pkgs.clippy
];
};
}
);
};
}

0 comments on commit 690ae0b

Please sign in to comment.