Configurable path

This commit is contained in:
Mats Rauhala 2022-02-10 21:47:09 +02:00
parent 1ccf953c57
commit 63411532c4
4 changed files with 14 additions and 23 deletions

View File

@ -1,8 +1,9 @@
module Main where module Main where
import qualified MyLib (defaultMain) import qualified MyLib (defaultMain)
import System.Environment (getArgs)
main :: IO () main :: IO ()
main = do main = do
putStrLn "Hello, Haskell!" [path] <- getArgs
MyLib.defaultMain MyLib.defaultMain path

View File

@ -2,7 +2,9 @@
"nodes": { "nodes": {
"easy-hls": { "easy-hls": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1637250802, "lastModified": 1637250802,
@ -34,21 +36,6 @@
} }
}, },
"nixpkgs": { "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": { "locked": {
"lastModified": 1644453163, "lastModified": 1644453163,
"narHash": "sha256-VPlXtIsShceYHUspnJSvuvucrX1OWVFmrqiofn69yCM=", "narHash": "sha256-VPlXtIsShceYHUspnJSvuvucrX1OWVFmrqiofn69yCM=",
@ -66,7 +53,7 @@
"inputs": { "inputs": {
"easy-hls": "easy-hls", "easy-hls": "easy-hls",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs"
} }
} }
}, },

View File

@ -2,7 +2,10 @@
description = "A very basic flake"; description = "A very basic flake";
inputs = { inputs = {
easy-hls = { url = "github:jkachmar/easy-hls-nix"; }; easy-hls = {
url = "github:jkachmar/easy-hls-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils = { flake-utils = {
url = "github:numtide/flake-utils"; url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";

View File

@ -67,9 +67,9 @@ amqpPublisher sqlConn channel exchange = Publish $ \msg -> do
, msgDeliveryMode = Just Persistent , msgDeliveryMode = Just Persistent
} }
defaultMain :: IO () defaultMain :: FilePath -> IO ()
defaultMain = do defaultMain path = do
conf <- readConfig "./config.dhall" conf <- readConfig path
let rabbitConnect = openConnection let rabbitConnect = openConnection
(conf ^. amqp . host . T.unpacked) (conf ^. amqp . host . T.unpacked)
(conf ^. amqp . vhost) (conf ^. amqp . vhost)