From 2a91cb597a0de5c1539356e72b1760c171367f57 Mon Sep 17 00:00:00 2001 From: nek0 Date: Fri, 16 Sep 2022 16:09:48 +0200 Subject: [PATCH] flakify --- flake.nix | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 flake.nix diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..77d3069 --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "A game stub written in Haskell"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + affection-src.url = "git+https://gitea.nek0.eu/nek0/affection"; + }; + + outputs = { self, nixpkgs, flake-utils, affection-src }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + haskellPackages = pkgs.haskellPackages; + + jailbreakUnbreak = pkg: + pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; })); + + packageName = "tracer-game"; + in { + packages.${packageName} = # (ref:haskell-package-def) + haskellPackages.callCabal2nix packageName self rec { + affection = affection-src.defaultPackage.${system}; + }; + + defaultPackage = self.packages.${system}.${packageName}; + + devShell = pkgs.mkShell { + buildInputs = with haskellPackages; [ + haskell-language-server + ghcid + cabal-install + ]; + inputsFrom = builtins.attrValues self.packages.${system}; + }; + }); +} +