From 45f6086c69235877c0a024450d34f99b51647681 Mon Sep 17 00:00:00 2001 From: pingu Date: Thu, 12 Oct 2023 16:37:54 +0200 Subject: [PATCH] I have no idea what I am doing --- .envrc | 1 + app/Main.hs | 12 +++++++++++- flake.nix | 4 ++-- hcdu.cabal | 4 +++- hie.yaml | 4 ++++ 5 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 hie.yaml diff --git a/.envrc b/.envrc index 3550a30..cc94b51 100644 --- a/.envrc +++ b/.envrc @@ -1 +1,2 @@ +nix_direnv_watch_file *.cabal use flake diff --git a/app/Main.hs b/app/Main.hs index 65ae4a0..ecce4b0 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,4 +1,14 @@ module Main where +import System.PosixCompat.Types +import System.PosixCompat.Files + +getFileSize :: FilePath -> IO FileOffset +getFileSize = (fileSize <$>) . getFileStatus + +getFolderSize :: FilePath -> IO FileOffset +getFolderSize path = undefined + main :: IO () -main = putStrLn "Hello, Haskell!" +main = do + putStrLn "Hello, Haskell!" diff --git a/flake.nix b/flake.nix index 85407e1..58b7aa8 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ outputs = { self, nixpkgs, flake-utils }: let - ghcVer = "ghc962"; + ghcVer = "ghc945"; makeHaskellOverlay = overlay: final: prev: { haskell = prev.haskell // { packages = prev.haskell.packages // { @@ -52,10 +52,10 @@ packages = p: [ self.packages.${system}.hcdu ]; withHoogle = true; buildInputs = - [ pkgs.docker ] ++ (with haskellPackages; [ haskell-language-server cabal-install + implicit-hie ]); # Change the prompt to show that you are in a devShell # shellHook = "export PS1='\\e[1;34mdev > \\e[0m'"; diff --git a/hcdu.cabal b/hcdu.cabal index 7b6b8ee..18a1bc6 100644 --- a/hcdu.cabal +++ b/hcdu.cabal @@ -69,7 +69,9 @@ executable hcdu LambdaCase -- Other library packages from which modules are imported. - build-depends: base ^>=4.18.1.0 + build-depends: base ^>=4.17.1.0 + , brick >= 1.9 + , unix-compat >= 0.7 -- Directories containing source files. hs-source-dirs: app diff --git a/hie.yaml b/hie.yaml new file mode 100644 index 0000000..eec6298 --- /dev/null +++ b/hie.yaml @@ -0,0 +1,4 @@ +cradle: + cabal: + - path: "app/Main.hs" + component: "hcdu:exe:hcdu"