From 117eb61428d2fb324138d74fe95299eb0f0d72c7 Mon Sep 17 00:00:00 2001 From: mtgmonkey Date: Sun, 30 Nov 2025 18:31:17 +0100 Subject: [PATCH] reorganisierung --- .gitmodules | 3 +++ flake.nix | 1 + lib/hs-glsl | 1 + package.nix | 27 ++++++++++++++++++++++----- 4 files changed, 27 insertions(+), 5 deletions(-) create mode 100644 .gitmodules create mode 160000 lib/hs-glsl diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2cc0b85 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "lib/hs-glsl"] + path = lib/hs-glsl + url = https://git.mtgmonkey.net/Andromeda/hs-glsl diff --git a/flake.nix b/flake.nix index 745dfb3..a62047a 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,7 @@ { inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; + self.submodules = true; }; outputs = {nixpkgs, ...}: let system = "x86_64-linux"; diff --git a/lib/hs-glsl b/lib/hs-glsl new file mode 160000 index 0000000..2bc1cab --- /dev/null +++ b/lib/hs-glsl @@ -0,0 +1 @@ +Subproject commit 2bc1cab2af274c3360988d5556718c7ad1edca6a diff --git a/package.nix b/package.nix index 166cde4..9d0a66a 100644 --- a/package.nix +++ b/package.nix @@ -4,10 +4,27 @@ stdenv, ... }: let - ghcExeOptions = "-O -Wall -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N"; + ghcExeOptions = lib.concatStringsSep " " ghcFlags; + ghcFlags = [ + "-O" + "-Wall" + "-Widentities" + "-Widentities" + "-Wincomplete-record-updates" + "-Wincomplete-uni-patterns" + "-Wmissing-export-lists" + "-Wmossing-home-modules" + "-Wpartial-fields" + "-Wredundant-constraints" + "-threaded" + "-rtsopts" + "-with-rtsopts=-N" + # hs-glsl + "-i./lib/hs-glsl/src/Language/GLSL.hs" + # src + "-i./src" + ]; ghcPackages = p: [ - p.bytestring - p.data-default p.GLFW-b p.OpenGL p.relude @@ -16,7 +33,7 @@ in stdenv.mkDerivation { pname = "haskengl"; version = "0.1.0"; - src = ./src; + src = ./.; nativeBuildInputs = [ (haskellPackages.ghcWithPackages ghcPackages) ]; @@ -25,7 +42,7 @@ in configurePhase = '' ''; buildPhase = '' - ghc ${ghcExeOptions} ./Main.hs -o ./Main + ghc ${ghcExeOptions} ./src/Main.hs -o ./Main ''; installPhase = '' mkdir -p $out/bin