diff options
author | Paweł Dybiec <pawel@dybiec.info> | 2023-10-02 19:13:56 +0100 |
---|---|---|
committer | Paweł Dybiec <pawel@dybiec.info> | 2023-10-02 19:13:56 +0100 |
commit | ba05edc9e66321e28346ddde393956469c76b8d8 (patch) | |
tree | 81029894908ea7080d5d892aceb280b70bfa336f /flake.nix | |
parent | Yearly update (diff) |
Flakeify
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..952ae3f --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +# SPDX-FileCopyrightText: 2021 Serokell <https://serokell.io/> +# +# SPDX-License-Identifier: CC0-1.0 + +{ + description = "My haskell application"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { self, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = nixpkgs.legacyPackages.${system}; + + haskellPackages = pkgs.haskellPackages; + + jailbreakUnbreak = pkg: + pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; })); + + packageName = "dybiec-info"; + in + { + packages.${packageName} = + haskellPackages.callCabal2nix packageName self rec { + + # Dependency overrides go here + }; + + packages.default = self.packages.${system}.${packageName}; + defaultPackage = self.packages.${system}.default; + + devShells.default = pkgs.mkShell { + buildInputs = with pkgs; [ + haskellPackages.haskell-language-server # you must build it with your ghc to work + ghcid + cabal-install + ]; + inputsFrom = map (__getAttr "env") (__attrValues self.packages.${system}); + }; + devShell = self.devShells.${system}.default; + }); +} |