Configurable path
This commit is contained in:
parent
1ccf953c57
commit
63411532c4
@ -1,8 +1,9 @@
|
||||
module Main where
|
||||
|
||||
import qualified MyLib (defaultMain)
|
||||
import System.Environment (getArgs)
|
||||
|
||||
main :: IO ()
|
||||
main = do
|
||||
putStrLn "Hello, Haskell!"
|
||||
MyLib.defaultMain
|
||||
[path] <- getArgs
|
||||
MyLib.defaultMain path
|
||||
|
21
flake.lock
21
flake.lock
@ -2,7 +2,9 @@
|
||||
"nodes": {
|
||||
"easy-hls": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1637250802,
|
||||
@ -34,21 +36,6 @@
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1615055905,
|
||||
"narHash": "sha256-Ig7CXgE5C3mwtTVBl8nSTessa1oMAm6Pm/p+T6iAJD8=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "f3fc074642a25ef5a1423412f09946149237e338",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1644453163,
|
||||
"narHash": "sha256-VPlXtIsShceYHUspnJSvuvucrX1OWVFmrqiofn69yCM=",
|
||||
@ -66,7 +53,7 @@
|
||||
"inputs": {
|
||||
"easy-hls": "easy-hls",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -2,7 +2,10 @@
|
||||
description = "A very basic flake";
|
||||
|
||||
inputs = {
|
||||
easy-hls = { url = "github:jkachmar/easy-hls-nix"; };
|
||||
easy-hls = {
|
||||
url = "github:jkachmar/easy-hls-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
flake-utils = {
|
||||
url = "github:numtide/flake-utils";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
|
@ -67,9 +67,9 @@ amqpPublisher sqlConn channel exchange = Publish $ \msg -> do
|
||||
, msgDeliveryMode = Just Persistent
|
||||
}
|
||||
|
||||
defaultMain :: IO ()
|
||||
defaultMain = do
|
||||
conf <- readConfig "./config.dhall"
|
||||
defaultMain :: FilePath -> IO ()
|
||||
defaultMain path = do
|
||||
conf <- readConfig path
|
||||
let rabbitConnect = openConnection
|
||||
(conf ^. amqp . host . T.unpacked)
|
||||
(conf ^. amqp . vhost)
|
||||
|
Loading…
Reference in New Issue
Block a user