about summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix57
1 files changed, 24 insertions, 33 deletions
diff --git a/flake.nix b/flake.nix
index 6d8dda1..1fb71dc 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,43 +1,34 @@
 {
   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";
+  inputs.nixpkgs = {
+    type = "github";
+    owner = "NixOS";
+    repo = "nixpkgs";
+    ref = "nixpkgs-unstable";
   };
 
-  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";
+  outputs = { nixpkgs, ... }:
+    let
+      system = "x86_64-linux";
 
-              shell = {
-                tools = {
-                  brittany = { };
-                  cabal = { };
-                  haskell-language-server = { };
-                  hlint = { };
-                };
+      pkgs = import nixpkgs { inherit system; };
 
-                buildInputs = with pkgs; [ nixfmt ];
-              };
+      project = returnShellEnv:
+        pkgs.haskellPackages.developPackage {
+          inherit returnShellEnv;
+          name = "xmonad-ng";
+          root = ./.;
+          withHoogle = false;
+          overrides = self: super:
+            with pkgs.haskell.lib;
+            {
+              # TODO Override xmobar.
             };
-          })
-        ];
+        };
+    in {
+      defaultPackage.${system} = project false;
 
-        flake = pkgs.xmonad-ng.flake { };
-      in flake // {
-        defaultPackage = flake.packages."xmonad-ng:exe:xmonad-ng";
-      });
+      devShell.${system} = project true;
+    };
 }

Consider giving Nix/NixOS a try! <3