aeson: 1 -> 2

This commit is contained in:
Robert Hensing 2022-12-02 11:34:29 +00:00
parent 7987c7ec0d
commit b9525cef7c
4 changed files with 8 additions and 7 deletions

View file

@ -31,7 +31,7 @@ source-repository head
common common
build-depends: base >=4.12.0.0 && <4.17
, aeson
, aeson >=2
, aeson-pretty
, async
, bytestring

View file

@ -38,16 +38,16 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1669791787,
"narHash": "sha256-KBfoA2fOI5+wCrm7PR+j7jHqXeTkVRPQ0m5fcKchyuU=",
"lastModified": 1669980218,
"narHash": "sha256-HBK1tIqarj7ZsSwQEKGlyvbAIFnglytG7FxuS4K3nY8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e76c78d20685a043d23f5f9e0ccd2203997f1fb1",
"rev": "da7988fe440ef5b8779d4f76340ad7dc79ff3b33",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"ref": "haskell-updates",
"repo": "nixpkgs",
"type": "github"
}

View file

@ -2,7 +2,7 @@
description = "Arion - use Docker Compose via Nix";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.url = "github:NixOS/nixpkgs/haskell-updates";
haskell-flake.url = "github:srid/haskell-flake";
flake-parts.url = "github:hercules-ci/flake-parts/easyOverlay"; # TODO merge
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";

View file

@ -9,6 +9,7 @@ import Prelude()
import Protolude hiding (to)
import qualified Data.Aeson as Aeson
import qualified Data.Aeson.Key as AK
import Arion.Aeson (decodeFile)
import Control.Lens
@ -20,4 +21,4 @@ getDefaultExec fp service = do
v <- decodeFile fp
pure ((v :: Aeson.Value) ^.. key "x-arion" . key "serviceInfo" . key service . key "defaultExec" . _Array . traverse . _String)
pure ((v :: Aeson.Value) ^.. key "x-arion" . key "serviceInfo" . key (AK.fromText service) . key "defaultExec" . _Array . traverse . _String)