Browse Source

Add cabal-related files

Ioannis Koutras 6 months ago
parent
commit
a8ab824f67
7 changed files with 72 additions and 0 deletions
  1. 5 0
      CHANGELOG.md
  2. 16 0
      ListsToIpTables.cabal
  3. 4 0
      Main.hs
  4. 2 0
      Setup.hs
  5. 11 0
      liststoiptables.nix
  6. 5 0
      release.nix
  7. 29 0
      shell.nix

+ 5 - 0
CHANGELOG.md

@@ -0,0 +1,5 @@
+# Revision history for ListsToIpTables
+
+## 0.1.0.0 -- YYYY-mm-dd
+
+* First version. Released on an unsuspecting world.

+ 16 - 0
ListsToIpTables.cabal

@@ -0,0 +1,16 @@
+cabal-version:       >=1.10
+name:                ListsToIpTables
+version:             0.1.0.0
+synopsis:            Download IP lists and transform them to IP sets
+license:             GPL-3
+license-file:        LICENSE
+author:              Stefanos Nikolaou,
+                     Ioannis Koutras
+maintainer:          ioannis.koutras@gmail.com
+build-type:          Simple
+extra-source-files:  CHANGELOG.md, README.md
+
+executable ListsToIpTables
+  main-is:             Main.hs
+  build-depends:       base >=4.12 && <4.13
+  default-language:    Haskell2010

+ 4 - 0
Main.hs

@@ -0,0 +1,4 @@
+module Main where
+
+main :: IO ()
+main = putStrLn "Hello, Haskell!"

+ 2 - 0
Setup.hs

@@ -0,0 +1,2 @@
+import Distribution.Simple
+main = defaultMain

+ 11 - 0
liststoiptables.nix

@@ -0,0 +1,11 @@
+{ mkDerivation, base, stdenv }:
+mkDerivation {
+  pname = "ListsToIpTables";
+  version = "0.1.0.0";
+  src = ./.;
+  isLibrary = false;
+  isExecutable = true;
+  executableHaskellDepends = [ base ];
+  description = "Download IP lists and transform them to IP sets";
+  license = stdenv.lib.licenses.gpl3;
+}

+ 5 - 0
release.nix

@@ -0,0 +1,5 @@
+let
+  pkgs = import <nixpkgs> { };
+
+in
+  pkgs.haskellPackages.callPackage ./liststoiptables.nix { }

+ 29 - 0
shell.nix

@@ -0,0 +1,29 @@
+{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
+
+let
+
+  inherit (nixpkgs) pkgs;
+
+  f = { mkDerivation, base, stdenv }:
+      mkDerivation {
+        pname = "ListsToIpTables";
+        version = "0.1.0.0";
+        src = ./.;
+        isLibrary = false;
+        isExecutable = true;
+        executableHaskellDepends = [ base ];
+        description = "Download IP lists and transform them to IP sets";
+        license = stdenv.lib.licenses.gpl3;
+      };
+
+  haskellPackages = if compiler == "default"
+                       then pkgs.haskellPackages
+                       else pkgs.haskell.packages.${compiler};
+
+  variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
+
+  drv = variant (haskellPackages.callPackage f {});
+
+in
+
+  if pkgs.lib.inNixShell then drv.env else drv