1
1
mirror of https://github.com/nmattia/niv.git synced 2024-11-25 20:45:21 +03:00

Merge pull request #81 from nmattia/nm-release

Prepare for release
This commit is contained in:
Nicolas Mattia 2019-06-15 13:57:49 +02:00 committed by GitHub
commit 312300cca8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 3 deletions

7
LICENSE Normal file
View File

@ -0,0 +1,7 @@
Copyright 2019 Nicolas Mattia
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.

View File

@ -13,6 +13,8 @@ with rec
}; };
niv-source = sourceByRegex "niv" ./. niv-source = sourceByRegex "niv" ./.
[ "^package.yaml$" [ "^package.yaml$"
"^README.md$"
"^LICENSE$"
"^app$" "^app$"
"^app.*.hs$" "^app.*.hs$"
"^src$" "^src$"
@ -24,11 +26,25 @@ with rec
"^nix$" "^nix$"
"^nix.sources.nix$" "^nix.sources.nix$"
]; ];
haskellPackages = pkgs.haskellPackages.override haskellPackages = pkgs.haskellPackages.override
{ overrides = _: haskellPackages: { overrides = _: haskellPackages:
{ niv = haskellPackages.callCabal2nix "niv" niv-source {}; }; { niv = haskellPackages.callCabal2nix "niv" niv-source {}; };
}; };
niv = haskellPackages.niv;
niv-sdist = pkgs.haskell.lib.sdistTarball niv;
niv-cabal-upload =
with
{ niv-version = niv.version;
};
pkgs.writeScript "cabal-upload"
''
cabal upload "$@" "${niv-sdist}/niv-${niv-version}.tar.gz"
'';
niv-devshell = haskellPackages.shellFor niv-devshell = haskellPackages.shellFor
{ packages = (ps: [ ps.niv ]); { packages = (ps: [ ps.niv ]);
shellHook = shellHook =
@ -45,8 +61,7 @@ with rec
}; };
rec rec
{ inherit niv-source niv-devshell; { inherit niv niv-sdist niv-source niv-devshell niv-cabal-upload;
inherit (haskellPackages) niv;
tests = pkgs.callPackage ./tests { inherit niv; }; tests = pkgs.callPackage ./tests { inherit niv; };

View File

@ -1,6 +1,13 @@
name: niv name: niv
version: 0.1.0
license: MIT license: MIT
author: Nicolas Mattia <nicolas@nmattia.com>
maintainer: Nicolas Mattia <nicolas@nmattia.com>
copyright: (c) 2019 Nicolas Mattia
category: Development
github: deckgo/wai-lambda
synopsis: Easy dependency management for Nix projects
description: Easy dependency management for Nix projects.
ghc-options: ghc-options:
- -Wall - -Wall
@ -9,6 +16,9 @@ ghc-options:
# For macOS: https://github.com/gibiansky/IHaskell/issues/942 # For macOS: https://github.com/gibiansky/IHaskell/issues/942
- -optP-Wno-nonportable-include-path - -optP-Wno-nonportable-include-path
extra-source-files:
- README.md
dependencies: dependencies:
- aeson - aeson
- aeson-pretty - aeson-pretty

7
script/upload Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./nix
#!nix-shell -i bash -p cabal-install -p nix -p curl --pure
#!nix-shell --keep SSL_CERT_FILE
# vim: filetype=sh
$(nix-build -A niv-cabal-upload) "$@"