diff options
author | Zhongheng Liu <z.liu@outlook.com.gr> | 2025-03-30 21:53:25 +0300 |
---|---|---|
committer | Zhongheng Liu <z.liu@outlook.com.gr> | 2025-03-30 21:53:25 +0300 |
commit | 63a5076520e9a7210715db4244e0d0791de97be4 (patch) | |
tree | 5acfd5b4e198958d6a1e0a3b7a20bc095ee58531 | |
parent | 56cbdd91782bcb1fdce68af5acbb557995baba36 (diff) | |
download | nix-templates-63a5076520e9a7210715db4244e0d0791de97be4.tar.gz nix-templates-63a5076520e9a7210715db4244e0d0791de97be4.tar.bz2 nix-templates-63a5076520e9a7210715db4244e0d0791de97be4.zip |
feat: add bevy-devenv flake
-rw-r--r-- | bevy-devenv/flake.nix | 56 | ||||
-rw-r--r-- | flake.nix | 34 |
2 files changed, 77 insertions, 13 deletions
diff --git a/bevy-devenv/flake.nix b/bevy-devenv/flake.nix new file mode 100644 index 0000000..a8df4dc --- /dev/null +++ b/bevy-devenv/flake.nix @@ -0,0 +1,56 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + systems.url = "github:nix-systems/default"; + devenv.url = "github:cachix/devenv"; + devenv.inputs.nixpkgs.follows = "nixpkgs"; + }; + + nixConfig = { + extra-trusted-public-keys = + "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="; + extra-substituters = "https://devenv.cachix.org"; + }; + + outputs = { self, nixpkgs, devenv, systems, ... }@inputs: + let forEachSystem = nixpkgs.lib.genAttrs (import systems); + in { + packages = forEachSystem (system: { + devenv-up = self.devShells.${system}.default.config.procfileScript; + devenv-test = self.devShells.${system}.default.config.test; + }); + + devShells = forEachSystem (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in { + default = devenv.lib.mkShell { + inherit inputs pkgs; + modules = [rec { + # https://devenv.sh/reference/options/ + packages = with pkgs; [ + hello + udev + alsa-lib + vulkan-loader + xorg.libX11 + xorg.libXcursor + xorg.libXi + #xorg.libXrandr # To use the x11 feature + libxkbcommon + wayland # To use the wayland feature + ]; + #env = { + # RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; + #}; + enterShell = '' + hello + cargo init + ''; + env = { LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath packages; }; + languages.rust = { enable = true; }; + processes.hello.exec = "hello"; + }]; + }; + }); + }; +} @@ -1,19 +1,27 @@ { outputs = { self }: { - templates.rust = { - path = ./rust-devenv; - description = "A simple Rust/Cargo project"; - welcomeText = '' - # Simple Rust/Cargo Template - ## Intended usage - The intended usage of this flake is... - - ## More info - - [Rust language](https://www.rust-lang.org/) - - [Rust on the NixOS Wiki](https://wiki.nixos.org/wiki/Rust) - - ... - ''; + templates = { + rust = { + path = ./rust-devenv; + description = "Rust/Cargo project - devenv.sh"; + welcomeText = '' + # Simple Rust/Cargo Template + ## Intended usage + Intended for general rust development on NixOS based systems. + ## More info + - [Rust language](https://www.rust-lang.org/) + - [Rust on the NixOS Wiki](https://wiki.nixos.org/wiki/Rust) + - ... + ''; + }; + bevy = { + path = ./bevy-devenv; + description = "Bevy engine game project - devenv.sh"; + welcomeText = '' + # Simple Bevy engine template + ''; + }; }; templates.default = self.templates.rust; |