Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<<<<<<< Updated upstream
# Official Nix templates

Templates are there to help you start your Nix project.
Expand Down Expand Up @@ -64,3 +65,22 @@ Each template needs:

Note: contributing implies licensing those contributions
under the terms of [COPYING](COPYING), which is the MIT license.
=======
# NixOS/templates

A repository for generating Nix Flake for projects in different languages.

## Examples

Create a flake based on the Rust template

```
nix flake init -t github:NixOS/templates#rust
```

Create a flake based on the Python template

```
nix flake init -t github:NixOS/templates#python
```
>>>>>>> Stashed changes
1 change: 1 addition & 0 deletions bevy/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
13 changes: 13 additions & 0 deletions bevy/.github/workflows/build_nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Build legacy Nix package on Ubuntu"

on:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v12
- name: Building package
run: nix-build . -A defaultPackage.x86_64-linux
7 changes: 7 additions & 0 deletions bevy/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(import (
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; }
) {
src = ./.;
}).defaultNix
46 changes: 46 additions & 0 deletions bevy/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
name = "bevy";
description = "A flake for setting up a dev environment for Bevy game engine";
inputs = {
naersk.url = "github:nmattia/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, utils, naersk }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
in {

defaultPackage = naersk-lib.buildPackage ./.;

defaultApp = utils.lib.mkApp { drv = self.defaultPackage."${system}"; };

#REF https://github.com/bevyengine/bevy/blob/main/docs/linux_dependencies.md#nixos
devShell = with pkgs;
mkShell {
nativeBuildInputs = [ pkgconfig clang lld ];
buildInputs = [
cargo
rustc
rustfmt
rustPackages.clippy
alsa-lib
udev
vulkan-loader
xorg.libX11
x11
xorg.libXrandr
xorg.libXcursor
xorg.libXi
];
shellHook = ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${
pkgs.lib.makeLibraryPath [ udev alsaLib vulkan-loader ]
}"'';
RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
});
}
7 changes: 7 additions & 0 deletions bevy/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
(import (
fetchTarball {
url = "https://github.com/edolstra/flake-compat/archive/99f1c2157fba4bfe6211a321fd0ee43199025dbf.tar.gz";
sha256 = "0x2jn3vrawwv9xp15674wjz9pixwjyj3j771izayl962zziivbx2"; }
) {
src = ./.;
}).shellNix