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
60 changes: 60 additions & 0 deletions flake.lock

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

52 changes: 52 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
description = "Basic flake for Codename Engine, primarily useful for development";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixpkgs-unstable";
systems.url = "github:nix-systems/default";
flake-compat = {
url = "github:NixOS/flake-compat";
flake = false;
};
};

outputs =
{ nixpkgs, systems, ... }:
let
forEachSystem = nixpkgs.lib.genAttrs (import systems);
in
{
devShells = forEachSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
default = pkgs.mkShell rec {
name = "cne";
buildInputs = with pkgs; [
kdePackages.qttools
openal
libpulseaudio
libvlc
libGL
libx11
libxext
libxinerama
libxi
libxrandr
SDL2
];
nativeBuildInputs = with pkgs; [
haxe
neko
];
shellHook = ''
./building/setup-unix.sh
'';
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
};
}
);
};
}
54 changes: 12 additions & 42 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,42 +1,12 @@
{ }:
let
pkgs = import (builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/c407032be28ca2236f45c49cfb2b8b3885294f7f.tar.gz";
}) { };

libs =
with pkgs;
[
SDL2
pkg-config
openal
alsa-lib
libvlc
libpulseaudio
libGL
]
++ (with xorg; [
libX11
libXext
libXinerama
libXi
libXrandr
]);
in
pkgs.mkShell {
name = "CodenameEngine";

packages = with pkgs; [
haxe
neko
libsForQt5.qttools
];

buildInputs = libs;

LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath libs;

shellHook = ''
source update.sh
'';
}
(import (
let
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
nodeName = lock.nodes.root.inputs.flake-compat;
in
fetchTarball {
url =
lock.nodes.${nodeName}.locked.url
or "https://github.com/NixOS/flake-compat/archive/${lock.nodes.${nodeName}.locked.rev}.tar.gz";
sha256 = lock.nodes.${nodeName}.locked.narHash;
}
) { src = ./.; }).shellNix