diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..0feadf940f8d547ac14a63809d1c0739aa1b0116 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*~ +dist-newstyle +result* diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2e1c0b1bc686cf67255de7ecf05ab732593bb87e --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# quasar diff --git a/default.nix b/default.nix new file mode 100644 index 0000000000000000000000000000000000000000..5fe474adf601052969fa3a9eef8cedc29e1ec158 --- /dev/null +++ b/default.nix @@ -0,0 +1,7 @@ +{ pkgs ? import <nixpkgs> {}, haskellPackages ? pkgs.haskellPackages, args ? {} }: + +let + drv = haskellPackages.callCabal2nix "quasar" ./. args; + +in + if pkgs.lib.inNixShell then drv.env else drv diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000000000000000000000000000000000..1984b437f54221ffc00eaa71153dcf3dba8d9c22 --- /dev/null +++ b/flake.lock @@ -0,0 +1,24 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1623154001, + "narHash": "sha256-KxsIXg5ez5SveGayOKcW+MnofqVuLnwZHE5mZgtRAJo=", + "path": "/nix/store/r35z76cadipjzjrjik06gp1kfbqlhdck-source", + "rev": "3bc8e5cd23b84b2e149e7aaad57117da16a19e6f", + "type": "path" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000000000000000000000000000000000000..e530c0a66758934353c768a7c36b11a6fe0031c1 --- /dev/null +++ b/flake.nix @@ -0,0 +1,25 @@ +{ + outputs = { self, nixpkgs }: + with nixpkgs.lib; + let + forAllSystems = genAttrs ["x86_64-linux" "aarch64-linux"]; + pkgs = forAllSystems (system: import nixpkgs { inherit system; overlays = [ self.overlay ]; }); + in { + + devShell = forAllSystems (system: pkgs.${system}.haskellPackages.quasar.env); + + defaultPackage = forAllSystems (system: pkgs.${system}.haskellPackages.quasar); + + overlay = final: prev: { + haskell = prev.haskell // { + packageOverrides = hfinal: hprev: prev.haskell.packageOverrides hfinal hprev // { + quasar = import ./. { + pkgs = final; + haskellPackages = hfinal; + }; + }; + }; + }; + + }; +} diff --git a/quasar.cabal b/quasar.cabal new file mode 100644 index 0000000000000000000000000000000000000000..5b08e1d44980fece1abaed3560953b4015c8f33a --- /dev/null +++ b/quasar.cabal @@ -0,0 +1,76 @@ +cabal-version: 3.0 + +name: quasar +version: 0.1.0.0 +license: NONE +build-type: Simple +extra-source-files: + README.md + +--source-repository head +-- type: git +-- location: https://git.c3pb.de/jens/quasar.git + +common shared-properties + default-extensions: + AllowAmbiguousTypes + BangPatterns + DataKinds + DefaultSignatures + DeriveAnyClass + DeriveGeneric + DerivingStrategies + DuplicateRecordFields + ExistentialQuantification + FlexibleContexts + FlexibleInstances + FunctionalDependencies + GADTs + GeneralizedNewtypeDeriving + InstanceSigs + LambdaCase + MultiParamTypeClasses + NamedFieldPuns + NoImplicitPrelude + OverloadedStrings + RankNTypes + ScopedTypeVariables + StandaloneDeriving + TemplateHaskell + TupleSections + TypeApplications + TypeFamilies + TypeOperators + build-depends: + base >=4.7 && <5, + binary, + ghc-prim, + hashable, + microlens-platform, + mtl, + template-haskell, + transformers, + unordered-containers, + default-language: Haskell2010 + ghc-options: -fwarn-unused-do-bind -fwarn-tabs -Wall -Wincomplete-uni-patterns -Wpartial-fields + +common shared-executable-properties + import: shared-properties + ghc-options: -fwarn-unused-do-bind -fwarn-tabs -Wall -Wincomplete-uni-patterns -Wpartial-fields -threaded -rtsopts "-with-rtsopts=-N -I0" + +library + import: shared-properties + exposed-modules: + hs-source-dirs: + src + +test-suite quasar-test + import: shared-executable-properties + type: exitcode-stdio-1.0 + build-depends: + quasar, + hspec, + main-is: Spec.hs + other-modules: + hs-source-dirs: + test