From 7de683e33b7c2d1c987e5088e92ea4e89c82315d Mon Sep 17 00:00:00 2001 From: Nicolas Mattia Date: Wed, 30 Jan 2019 18:50:09 +0100 Subject: [PATCH] Update deps --- Main.hs | 12 +++++++----- default.nix | 2 +- nix/overlay.nix | 2 +- nix/versions.json | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Main.hs b/Main.hs index 5907495..283c751 100644 --- a/Main.hs +++ b/Main.hs @@ -17,7 +17,7 @@ import Data.Aeson (FromJSON, FromJSONKey, ToJSON, ToJSONKey) import Data.Char (toUpper) import Data.Hashable (Hashable) import Data.Maybe (mapMaybe, fromMaybe) -import Data.Semigroup ((<>)) +import Data.Semigroup import Data.String.QQ (s) import GHC.Exts (toList) import System.Exit (exitFailure) @@ -81,7 +81,7 @@ parsePackageName = PackageName <$> Opts.argument Opts.str (Opts.metavar "PACKAGE") newtype PackageSpec = PackageSpec { unPackageSpec :: Aeson.Object } - deriving newtype (FromJSON, ToJSON, Show) + deriving newtype (FromJSON, ToJSON, Show, Semigroup, Monoid) parsePackageSpec :: Opts.Parser PackageSpec parsePackageSpec = @@ -390,9 +390,11 @@ cmdUpdate = \case packageSpec' <- case HMap.lookup packageName versionsSpec of Just packageSpec' -> do - updatePackageSpec $ PackageSpec $ HMap.union - (unPackageSpec packageSpec) - (unPackageSpec packageSpec') + + -- TODO: something fishy happening here + pkgSpec <- completePackageSpec $ packageSpec <> packageSpec' + updatePackageSpec $ pkgSpec + Nothing -> abortCannotUpdateNoSuchPackage packageName setVersionsSpec $ VersionsSpec $ diff --git a/default.nix b/default.nix index 40abcf6..996da3a 100644 --- a/default.nix +++ b/default.nix @@ -1,2 +1,2 @@ with { pkgs = import ./nix; }; -pkgs.snack-lib.inferHPackBuild ./package.yaml +pkgs.niv diff --git a/nix/overlay.nix b/nix/overlay.nix index 2c55eb1..d53c779 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -8,6 +8,6 @@ ) (self: super: - { niv = super.snack-lib.inferHPackBuild ../package.yaml ; } + { niv = super.snack-lib.executable ../package.yaml ; } ) ] diff --git a/nix/versions.json b/nix/versions.json index 30b562c..9778dc0 100644 --- a/nix/versions.json +++ b/nix/versions.json @@ -1 +1 @@ -{"nixpkgs":{"url":"https://github.com/NixOS/nixpkgs-channels/archive/138f2cc707d7ee13d93c86db3285460e244c402c.tar.gz","owner":"NixOS","branch":"nixos-18.03","url_template":"https://github.com///archive/.tar.gz","repo":"nixpkgs-channels","sha256":"0h49j1cbnccqx996x80z7na9p7slnj9liz646s73s55am8wc9q8q","description":"Nixpkgs/NixOS branches that track the Nixpkgs/NixOS channels","rev":"138f2cc707d7ee13d93c86db3285460e244c402c"},"snack":{"url":"https://github.com/nmattia/snack/archive/88f6a410291b4332d65481fcca593a5555a605e7.tar.gz","owner":"nmattia","branch":"master","url_template":"https://github.com///archive/.tar.gz","repo":"snack","sha256":"1z6dph28372ffwwp2xhrkhg4gjx27h0my3cs5gy3p5qgkh682cb7","description":"Nix-based incremental build tool for Haskell projects","rev":"88f6a410291b4332d65481fcca593a5555a605e7"}} \ No newline at end of file +{"nixpkgs":{"url":"https://github.com/NixOS/nixpkgs-channels/archive/138f2cc707d7ee13d93c86db3285460e244c402c.tar.gz","owner":"NixOS","branch":"nixos-18.03","url_template":"https://github.com///archive/.tar.gz","repo":"nixpkgs-channels","sha256":"0h49j1cbnccqx996x80z7na9p7slnj9liz646s73s55am8wc9q8q","description":"Nixpkgs/NixOS branches that track the Nixpkgs/NixOS channels","rev":"138f2cc707d7ee13d93c86db3285460e244c402c"},"snack":{"url":"https://github.com/nmattia/snack/archive/2f85b336564fb6871609f366e1ab6962bd2969a6.tar.gz","owner":"nmattia","branch":"master","url_template":"https://github.com///archive/.tar.gz","repo":"snack","sha256":"1p26zgkj210qsm7hymx101xv3hnanib4sy9207pj6wl1gwqim6fx","description":"Nix-based incremental build tool for Haskell projects","rev":"2f85b336564fb6871609f366e1ab6962bd2969a6"}} \ No newline at end of file