diff --git a/pkgs/development/tools/haskell/ghc-settings-edit/Setup.hs b/pkgs/development/tools/haskell/ghc-settings-edit/Setup.hs new file mode 100644 index 000000000000..9a994af677b0 --- /dev/null +++ b/pkgs/development/tools/haskell/ghc-settings-edit/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/pkgs/development/tools/haskell/ghc-settings-edit/default.nix b/pkgs/development/tools/haskell/ghc-settings-edit/default.nix index f1f08b620588..fa5146a128bb 100644 --- a/pkgs/development/tools/haskell/ghc-settings-edit/default.nix +++ b/pkgs/development/tools/haskell/ghc-settings-edit/default.nix @@ -1,33 +1,31 @@ { - stdenv, - ghc, + mkDerivation, + base, + containers, lib, }: -stdenv.mkDerivation { +mkDerivation { pname = "ghc-settings-edit"; version = "0.1.0"; - # See the source code for an explanation - src = ./ghc-settings-edit.lhs; - dontUnpack = true; - dontBuild = true; - - nativeBuildInputs = [ ghc ]; - installPhase = '' - runHook preInstall - - mkdir -p "$out/bin" - ${ghc.targetPrefix}ghc --make "$src" -o "$out/bin/ghc-settings-edit" - - runHook postInstall - ''; - - meta = { - license = [ - lib.licenses.mit - lib.licenses.bsd3 + src = lib.fileset.toSource { + root = ./.; + fileset = lib.fileset.unions [ + ./Setup.hs + ./ghc-settings-edit.lhs + ./ghc-settings-edit.cabal ]; - platforms = lib.platforms.all; - description = "Tool for editing GHC's settings file"; }; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ + base + containers + ]; + license = [ + lib.licenses.mit + lib.licenses.bsd3 + ]; + description = "Tool for editing GHC's settings file"; + mainProgram = "ghc-settings-edit"; } diff --git a/pkgs/development/tools/haskell/ghc-settings-edit/ghc-settings-edit.cabal b/pkgs/development/tools/haskell/ghc-settings-edit/ghc-settings-edit.cabal new file mode 100644 index 000000000000..e31515c6391f --- /dev/null +++ b/pkgs/development/tools/haskell/ghc-settings-edit/ghc-settings-edit.cabal @@ -0,0 +1,22 @@ +cabal-version: 2.2 +name: ghc-settings-edit +version: 0.1.0 +synopsis: Tool for editing GHC's settings file +-- TODO: description for hackage +-- TODO: category for hackage +license: MIT AND BSD-3-Clause +author: sternenseemann +-- FIXME: must be email for potential Hackage upload +maintainer: @NixOS/haskell +copyright: © 2024 The Nixpkgs/NixOS contributors +stability: experimental +build-type: Simple +bug-reports: https://github.com/NixOS/nixpkgs/issues + +executable ghc-settings-edit + default-language: Haskell2010 + -- TODO: bounds for hackage + build-depends: base + , containers + main-is: ghc-settings-edit.lhs + hs-source-dirs: .