diff options
| author | Andreas Källberg <anka.213@gmail.com> | 2025-08-08 20:02:17 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-08 20:02:17 +0200 |
| commit | 4dba12c0cefbc6dde77c0f4ef63d039f525e26e1 (patch) | |
| tree | 86033bad57c7e18c8084b5c976ac92203f916ff3 /flake.nix | |
| parent | 5ca230dd2a7b5481ce29a2e015771289b4acb776 (diff) | |
Add a nix flake for building with nix (#185)
Also based on #165
---------
Co-authored-by: o1lo01ol1o <tim.pierson@gmail.com>
Co-authored-by: Tim Pierson <o1lo01ol1o@users.noreply.github.com>
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..ccacc15b0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,50 @@ +{ + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; + systems.url = "github:nix-systems/default"; + }; + + nixConfig = { + # extra-trusted-public-keys = + # "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="; + # extra-substituters = "https://devenv.cachix.org"; + }; + + outputs = { self, nixpkgs, systems, ... }@inputs: + let forEachSystem = nixpkgs.lib.genAttrs (import systems); + in { + packages = forEachSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + haskellPackages = pkgs.haskell.packages.ghc925.override { + overrides = self: _super: { + cgi = pkgs.haskell.lib.unmarkBroken (pkgs.haskell.lib.dontCheck + (self.callHackage "cgi" "3001.5.0.1" { })); + }; + }; + + in { + gf = pkgs.haskell.lib.overrideCabal + (haskellPackages.callCabal2nixWithOptions "gf" self "--flag=-server" + { }) (_old: { + # Fix utf8 encoding problems + patches = [ + # Already applied in master + # ( + # pkgs.fetchpatch { + # url = "https://github.com/anka-213/gf-core/commit/6f1ca05fddbcbc860898ddf10a557b513dfafc18.patch"; + # sha256 = "17vn3hncxm1dwbgpfmrl6gk6wljz3r28j191lpv5zx741pmzgbnm"; + # } + # ) + ./nix/expose-all.patch + ./nix/revert-new-cabal-madness.patch + ]; + jailbreak = true; + # executableSystemDepends = [ + # (pkgs.ncurses.override { enableStatic = true; }) + # ]; + # executableHaskellDepends = [ ]; + }); + }); + }; +} |
