-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #255 from haskell-nix/srk/daemon
cereal remote, server side integration
- Loading branch information
Showing
42 changed files
with
2,807 additions
and
681 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,7 +59,6 @@ jobs: | |
- "macos-latest" | ||
name: Haskell CI | ||
'on': | ||
pull_request: {} | ||
push: {} | ||
schedule: | ||
- cron: "4 20 10 * *" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{-# LANGUAGE LambdaCase #-} | ||
module Main where | ||
|
||
import Data.Default.Class (Default(def)) | ||
import Data.Text (Text) | ||
import System.Nix.Derivation (Derivation) | ||
import System.Nix.StorePath (StorePath) | ||
|
||
import qualified Data.Text | ||
import qualified Data.Text.IO | ||
import qualified Data.Attoparsec.Text | ||
import qualified System.Environment | ||
import qualified System.Nix.Build | ||
import qualified System.Nix.Derivation | ||
import qualified System.Nix.StorePath | ||
import qualified System.Nix.Store.Remote | ||
|
||
parseDerivation :: FilePath -> IO (Derivation StorePath Text) | ||
parseDerivation source = do | ||
contents <- Data.Text.IO.readFile source | ||
case Data.Attoparsec.Text.parseOnly | ||
(System.Nix.Derivation.parseDerivation def) contents of | ||
Left e -> error e | ||
Right drv -> pure drv | ||
|
||
main :: IO () | ||
main = System.Environment.getArgs >>= \case | ||
[filename] -> do | ||
case System.Nix.StorePath.parsePathFromText def (Data.Text.pack filename) of | ||
Left e -> error $ show e | ||
Right p -> do | ||
d <- parseDerivation filename | ||
out <- | ||
System.Nix.Store.Remote.runStore | ||
$ System.Nix.Store.Remote.buildDerivation | ||
p | ||
d | ||
System.Nix.Build.BuildMode_Normal | ||
print out | ||
_ -> error "No input derivation file" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.