about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
authortzlil <tzlils@protonmail.com>2023-04-14 23:46:53 +0300
committertzlil <tzlils@protonmail.com>2023-04-14 23:46:53 +0300
commitfdf35536b66499884dd5b4e1740ac67e5cebb1a2 (patch)
treeb907edf782ebb58780d7fbfed084560626b94c74 /flake.nix
add homework material
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..b32c2ca
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,33 @@
+{
+  inputs = {
+    nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
+    flake-parts = { url = "github:hercules-ci/flake-parts"; inputs.nixpkgs-lib.follows = "nixpkgs"; };
+    treefmt-nix.url = "github:numtide/treefmt-nix";
+  };
+
+  outputs = inputs:
+    inputs.flake-parts.lib.mkFlake { inherit inputs; } {
+      systems = [ "x86_64-linux" ];
+      imports = [
+        inputs.treefmt-nix.flakeModule
+      ];
+
+      perSystem = { pkgs, ... }: {
+        packages.default = pkgs.haskellPackages.callCabal2nix "example" ./. { };
+
+        devShells.default = pkgs.haskellPackages.shellFor {
+          packages = ps: [ ];
+          buildInputs = with pkgs.haskellPackages; [
+            cabal-install
+            haskell-language-server
+	    megaparsec
+          ];
+        };
+        treefmt = {
+          projectRootFile = "flake.nix";
+          programs.nixpkgs-fmt.enable = true;
+          programs.cabal-fmt.enable = true;
+        };
+      };
+    };
+}