aeson: 1 -> 2
This commit is contained in:
parent
7987c7ec0d
commit
b9525cef7c
4 changed files with 8 additions and 7 deletions
|
@ -31,7 +31,7 @@ source-repository head
|
||||||
|
|
||||||
common common
|
common common
|
||||||
build-depends: base >=4.12.0.0 && <4.17
|
build-depends: base >=4.12.0.0 && <4.17
|
||||||
, aeson
|
, aeson >=2
|
||||||
, aeson-pretty
|
, aeson-pretty
|
||||||
, async
|
, async
|
||||||
, bytestring
|
, bytestring
|
||||||
|
|
|
@ -38,16 +38,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1669791787,
|
"lastModified": 1669980218,
|
||||||
"narHash": "sha256-KBfoA2fOI5+wCrm7PR+j7jHqXeTkVRPQ0m5fcKchyuU=",
|
"narHash": "sha256-HBK1tIqarj7ZsSwQEKGlyvbAIFnglytG7FxuS4K3nY8=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "e76c78d20685a043d23f5f9e0ccd2203997f1fb1",
|
"rev": "da7988fe440ef5b8779d4f76340ad7dc79ff3b33",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"ref": "nixos-unstable",
|
"ref": "haskell-updates",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
description = "Arion - use Docker Compose via Nix";
|
description = "Arion - use Docker Compose via Nix";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/haskell-updates";
|
||||||
haskell-flake.url = "github:srid/haskell-flake";
|
haskell-flake.url = "github:srid/haskell-flake";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts/easyOverlay"; # TODO merge
|
flake-parts.url = "github:hercules-ci/flake-parts/easyOverlay"; # TODO merge
|
||||||
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
|
|
|
@ -9,6 +9,7 @@ import Prelude()
|
||||||
import Protolude hiding (to)
|
import Protolude hiding (to)
|
||||||
|
|
||||||
import qualified Data.Aeson as Aeson
|
import qualified Data.Aeson as Aeson
|
||||||
|
import qualified Data.Aeson.Key as AK
|
||||||
import Arion.Aeson (decodeFile)
|
import Arion.Aeson (decodeFile)
|
||||||
|
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
|
@ -20,4 +21,4 @@ getDefaultExec fp service = do
|
||||||
|
|
||||||
v <- decodeFile fp
|
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)
|
||||||
|
|
Loading…
Reference in a new issue