From 84d1af5ccfd95d5ea2a9ded4dcd5419e565aca1c Mon Sep 17 00:00:00 2001 From: nek0 Date: Sat, 24 Dec 2022 18:24:53 +0100 Subject: [PATCH] finished flakes --- flake.lock | 89 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 58 +++++++++++++++++++++++++++++++++++ 2 files changed, 147 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1bbcba2 --- /dev/null +++ b/flake.lock @@ -0,0 +1,89 @@ +{ + "nodes": { + "affection-local": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1, + "narHash": "sha256-jml+z0oNeFXjYreNdEMVmYPuFlDmxuYyXBZQ573Tido=", + "path": "./extern/affection", + "type": "path" + }, + "original": { + "path": "./extern/affection", + "type": "path" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1669901374, + "narHash": "sha256-lObvfluyiZ9cgCMgKSrUOjzbx9Oap9949jlnNRPPYqg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "1c5443f6cdce419174f198141bd76a3fd9502950", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1671901901, + "narHash": "sha256-dTeqgnX1HfTeQ3+VtCXB3/t/ilE5iWmjYucwgSvpwnQ=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b1a9ae8dfd85d144ff1b268d6c7b47934358c9a1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "affection-local": "affection-local", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..8489e68 --- /dev/null +++ b/flake.nix @@ -0,0 +1,58 @@ +{ + description = "A game stub written in Haskell"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + affection-local.url = "path:./extern/affection"; + }; + + outputs = { self, nixpkgs, flake-utils, affection-local }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + haskellPackages = pkgs.haskellPackages; + + jailbreakUnbreak = pkg: + pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; })); + + packageName = "pituicat"; + in rec { + packages.${packageName} = # (ref:haskell-package-def) + haskellPackages.callCabal2nix packageName self rec { + # Dependency overrides go here + affection = affection-local.defaultPackage.${system}; + }; + + defaultPackage = self.packages.${system}.${packageName}; + + devShell = haskellPackages.shellFor { + packages = p: [ defaultPackage ]; + withHoogle = true; + buildInputs = (with haskellPackages; [ + haskell-language-server + ghcid + cabal-install + ]) ++ (with pkgs; [ + glib.dev + ]); + }; + #devShell = pkgs.mkShell { + # buildInputs = with haskellPackages; [ + # haskell-language-server + # ghcid + # cabal-install + # ]; + # nativeBuildInputs = with pkgs; [ + # pkg-config + # SDL2 + # vulkan-validation-layers + # vulkan-headers + # vulkan-loader + # ]; + # inputsFrom = builtins.attrValues self.packages.${system}; + #}; + }); +} +