diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index c33954f..0264734 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ dist-newstyle/ +.direnv/ diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a88e102 --- /dev/null +++ b/flake.lock @@ -0,0 +1,60 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "haskell-flake-utils": { + "inputs": { + "flake-utils": "flake-utils" + }, + "locked": { + "lastModified": 1672412555, + "narHash": "sha256-Kaa8F7nQFR3KuS6Y9WRUxeJeZlp6CCubyrRfmiEsW4k=", + "owner": "ivanovs-4", + "repo": "haskell-flake-utils", + "rev": "896219e5bde6efac72198550454e9dd9b5ed9ac9", + "type": "github" + }, + "original": { + "owner": "ivanovs-4", + "repo": "haskell-flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1675758091, + "narHash": "sha256-7gFSQbSVAFUHtGCNHPF7mPc5CcqDk9M2+inlVPZSneg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "747927516efcb5e31ba03b7ff32f61f6d47e7d87", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "haskell-flake-utils": "haskell-flake-utils", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..e72a7b1 --- /dev/null +++ b/flake.nix @@ -0,0 +1,55 @@ +{ +description = "suckless-cong: sexp based configs"; + +inputs = { + nixpkgs.url = "github:NixOS/nixpkgs"; + haskell-flake-utils.url = "github:ivanovs-4/haskell-flake-utils"; +}; + +outputs = { self, nixpkgs, haskell-flake-utils, ... }@inputs: + haskell-flake-utils.lib.simpleCabal2flake { + inherit self nixpkgs; + # systems = [ "x86_64-linux" ]; + + name = "suckless-conf"; + + ## Optional parameters follow + + # nixpkgs config + # config = { }; + + # Add another haskell flakes as requirements + # haskellFlakes = [ inputs.another-simple-haskell-flake ]; + + # Use this to load other flakes overlays to supplement nixpkgs + # preOverlays = [ ]; + + # Pass either a function or a file + # preOverlay = ./overlay.nix; + + # Override haskell packages + # hpPreOverrides = { pkgs }: new: old: + # with pkgs.haskell.lib; with haskell-flake-utils.lib; + # tunePackages pkgs old { + # some-haskellPackages-package = [ dontHaddock ]; + # } // { + # some-cabal-pkg = ((jailbreakUnbreak pkgs) (dontCheck (old.callCabal2nix "some-cabal-pkg" inputs.some-cabal-pkg {}))); + # }; + + # Arguments for callCabal2nix + # cabal2nixArgs = {pkgs}: { + # }; + + # Maps to the devShell output. Pass in a shell.nix file or function + # shell = ./shell.nix + + # Additional build intputs of the default shell + # shellExtBuildInputs = {pkgs}: with pkgs; [ + # haskellPackages.haskell-language-server + # ]; + + # Wether to build hoogle in the default shell + # shellWithHoogle = true; + + }; +} diff --git a/lib/Data/Config/Suckless/Parse.hs b/lib/Data/Config/Suckless/Parse.hs new file mode 100644 index 0000000..3666621 --- /dev/null +++ b/lib/Data/Config/Suckless/Parse.hs @@ -0,0 +1,8 @@ +module Data.Config.Suckless.Parse + ( module Data.Config.Suckless.Parse.Megaparsec + ) where + +import Data.Config.Suckless.Parse.Megaparsec + + + diff --git a/suckless-conf.cabal b/suckless-conf.cabal index 3807aea..5895007 100644 --- a/suckless-conf.cabal +++ b/suckless-conf.cabal @@ -60,7 +60,8 @@ library import: shared-properties exposed-modules: - Data.Config.Suckless.Syntax + Data.Config.Suckless.Syntax + , Data.Config.Suckless.Parse other-modules: Data.Config.Suckless.Types