From 443f196032530cbd9eb39606c2daf4294460a44b Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 26 Jan 2017 15:02:04 +0100 Subject: Project skeleton --- .gitignore | 2 ++ LICENSE | 20 ++++++++++++++++++++ Setup.hs | 2 ++ default.nix | 6 ++++++ postdelay.cabal | 25 +++++++++++++++++++++++++ postdelay.nix | 12 ++++++++++++ postdelay.nix.gup | 5 +++++ shell.nix | 9 +++++++++ src/Main.hs | 4 ++++ 9 files changed, 85 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 Setup.hs create mode 100644 default.nix create mode 100644 postdelay.cabal create mode 100644 postdelay.nix create mode 100755 postdelay.nix.gup create mode 100644 shell.nix create mode 100644 src/Main.hs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1acb835 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +**/.gup +**/result/ \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..b5cb249 --- /dev/null +++ b/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2017 Gregor Kleen + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..9a994af --- /dev/null +++ b/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMain diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..0ba6150 --- /dev/null +++ b/default.nix @@ -0,0 +1,6 @@ +argumentPackages@{ ... }: + +let + defaultPackages = with (import {}); haskellPackages; + pkgs = defaultPackages // argumentPackages; +in pkgs.callPackage ./postdelay.nix {} diff --git a/postdelay.cabal b/postdelay.cabal new file mode 100644 index 0000000..9f13336 --- /dev/null +++ b/postdelay.cabal @@ -0,0 +1,25 @@ +-- Initial postdelay.cabal generated by cabal init. For further +-- documentation, see http://haskell.org/cabal/users-guide/ + +name: postdelay +version: 0.0.0 +synopsis: A postfix content filter for delaying delivery of mail +-- description: +homepage: https://git.yggdrasil.li/gkleen/pub/postdelay +license: MIT +license-file: LICENSE +author: Gregor Kleen +maintainer: aethoago@141.li +-- copyright: +category: Network +build-type: Simple +-- extra-source-files: +cabal-version: >=1.10 + +executable postdelay + main-is: Main.hs + -- other-modules: + -- other-extensions: + build-depends: base >=4.9 && <5 + hs-source-dirs: src + default-language: Haskell2010 diff --git a/postdelay.nix b/postdelay.nix new file mode 100644 index 0000000..1ef3413 --- /dev/null +++ b/postdelay.nix @@ -0,0 +1,12 @@ +{ mkDerivation, base, stdenv }: +mkDerivation { + pname = "postdelay"; + version = "0.0.0"; + src = ./.; + isLibrary = false; + isExecutable = true; + executableHaskellDepends = [ base ]; + homepage = "https://git.yggdrasil.li/gkleen/pub/postdelay"; + description = "A postfix content filter for delaying delivery of mail"; + license = stdenv.lib.licenses.mit; +} diff --git a/postdelay.nix.gup b/postdelay.nix.gup new file mode 100755 index 0000000..976221f --- /dev/null +++ b/postdelay.nix.gup @@ -0,0 +1,5 @@ +#!/usr/bin/env zsh + +gup -u ${2:r}.cabal +cd ${2:h} +cabal2nix ./. >! ${1} \ No newline at end of file diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..a4274e7 --- /dev/null +++ b/shell.nix @@ -0,0 +1,9 @@ +{ pkgs ? (import {}) +}: + +pkgs.lib.overrideDerivation (pkgs.haskellPackages.callPackage ./default.nix {}) (oldArgs: { + buildInputs = with pkgs; [ cabal2nix gup ]; + shellHook = '' + export PROMPT_INFO=${oldArgs.name} + ''; +}) diff --git a/src/Main.hs b/src/Main.hs new file mode 100644 index 0000000..65ae4a0 --- /dev/null +++ b/src/Main.hs @@ -0,0 +1,4 @@ +module Main where + +main :: IO () +main = putStrLn "Hello, Haskell!" -- cgit v1.2.3