Less lazy packaging

This commit is contained in:
Nox Sluijtman 2024-03-10 18:55:58 +01:00
parent 72d7493ba6
commit 1280e65031
2 changed files with 14 additions and 30 deletions

View file

@ -1,9 +1,4 @@
# SPDX-FileCopyrightText: 2021 Serokell <https://serokell.io/>
#
# SPDX-License-Identifier: CC0-1.0
{
description = "generate a index of gemtext files";
{ description = "generate a index of gemtext files";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
@ -15,30 +10,8 @@
let
pkgs = nixpkgs.legacyPackages.${system};
haskellPackages = pkgs.haskellPackages;
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
# DON'T FORGET TO PUT YOUR PACKAGE NAME HERE, REMOVING `throw`
packageName = "twin";
compiler = "ghc94";
in {
packages.${packageName} =
haskellPackages.callCabal2nix packageName self rec {
# Dependency overrides go here
};
packages.default = self.packages.${system}.${packageName};
defaultPackage = self.packages.${system}.default;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
haskellPackages.haskell-language-server # you must build it with your ghc to work
ghcid
cabal-install
];
inputsFrom = map (__getAttr "env") (__attrValues self.packages.${system});
};
devShell = self.devShells.${system}.default;
packages.default = pkgs.haskell.packages.${compiler}.callPackage ./package.nix { };
});
}

11
package.nix Normal file
View file

@ -0,0 +1,11 @@
{ mkDerivation, base, directory, lib, optparse-applicative }:
mkDerivation {
pname = "twin";
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [ base directory optparse-applicative ];
license = lib.licenses.agpl3Plus;
mainProgram = "twin";
}