about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azahi@teknik.io>2021-10-24 22:57:16 +0300
committerAzat Bahawi <azahi@teknik.io>2021-10-24 22:57:16 +0300
commit463d70153d0704d8f3939a7a4ffb42b9c0464eb2 (patch)
treee597a14d098185e76f42780d3227b94e4178bd89 /flake.nix
parentUpdate submodules (diff)
Nixify and rework package configuration
- Add Nix support
- Remove submodules and vendored code
- Remove stack support
- Various tweaks
Diffstat (limited to '')
-rw-r--r--flake.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..6d8dda1
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,43 @@
+{
+  description = "Personal XMonad configuration.";
+
+  inputs = {
+    haskell-nix.url = "github:input-output-hk/haskell.nix";
+    nixpkgs.follows = "haskell-nix/nixpkgs-unstable";
+    flake-utils.follows = "haskell-nix/flake-utils";
+  };
+
+  outputs = { nixpkgs, flake-utils, haskell-nix, ... }:
+    flake-utils.lib.eachDefaultSystem (system:
+      let
+        pkgs = import nixpkgs {
+          inherit system overlays;
+          inherit (haskell-nix) config;
+        };
+        overlays = [
+          haskell-nix.overlay
+          (final: _: {
+            xmonad-ng = final.haskell-nix.project' {
+              src = ./.;
+
+              compiler-nix-name = "ghc8107";
+
+              shell = {
+                tools = {
+                  brittany = { };
+                  cabal = { };
+                  haskell-language-server = { };
+                  hlint = { };
+                };
+
+                buildInputs = with pkgs; [ nixfmt ];
+              };
+            };
+          })
+        ];
+
+        flake = pkgs.xmonad-ng.flake { };
+      in flake // {
+        defaultPackage = flake.packages."xmonad-ng:exe:xmonad-ng";
+      });
+}

Consider giving Nix/NixOS a try! <3