Skip to content
This repository was archived by the owner on Sep 23, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
4 changes: 2 additions & 2 deletions hs/cli/Main.hs → cli/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ stackAction args = do
withSystemTempFile "nixage-stack-snapshot.yaml" $ \snapshotPath snapshotH ->
withTempFile "." "nixage-stack.yaml" $ \stackPath stackH -> do
withTempFile "." "nixage-stack-shell.nix" $ \stackShellPath stackShellH -> do
stackShellSourcePath <- liftIO $ getDataFileName "stack-shell.nix"
stackShellSourcePath <- liftIO $ getDataFileName "data/stack-shell.nix"
let stackFilesInfo = StackFilesInfo snapshotPath stackShellPath stackShellSourcePath "./."
liftIO $ hClose stackShellH >> hClose stackH >> hClose snapshotH
encodeToStack stackPath stackFilesInfo projectNative
Expand All @@ -51,7 +51,7 @@ convertAction (ConvertArgs convertIn convertOut) = do
YamlConvertIn yamlPath -> decodeFromYaml (toString yamlPath)
case convertOut of
StackConvertOut stackPath snapshotPath stackShellPath -> do
stackShellSourcePath <- liftIO $ getDataFileName "stack-shell.nix"
stackShellSourcePath <- liftIO $ getDataFileName "data/stack-shell.nix"
let stackFilesInfo = StackFilesInfo snapshotPath stackShellPath stackShellSourcePath "./."
encodeToStack (toString stackPath) stackFilesInfo projectNative
NixConvertOut -> do
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 6 additions & 1 deletion hs/data/stack-shell.nix → data/stack-shell.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
root:
let
x = import (root + "/default.nix") { exposeNixage = true; };
defaultNixage = let nixage = import ../nix { exposeNixage = true; };
in nixage.buildYamlProject root;
projDefaultNix = root + "/default.nix";
x = if builtins.pathExists projDefaultNix
then import projDefaultNix { exposeNixage = true; }
else defaultNixage;
pkgs = x._nixage.pkgs;
stackCmd = ''stack --internal-re-exec-version="${pkgs.stack.version}"'';
in x._nixage.haskellPackages.shellFor {
Expand Down
7 changes: 6 additions & 1 deletion default.nix
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
import ./nix
{ exposeNixage ? false }:

let
nixage = import ./nix { inherit exposeNixage; };

in nixage.buildNixProject ./.
6 changes: 0 additions & 6 deletions hs/default.nix

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion nix/yaml.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
let
inherit (builtins) genList head tail;
inherit (pkgs.lib) concatMap concatStrings singleton;
inherit (import ../hs {}) nixage;
inherit (import ../default.nix {}) nixage;

in {
importYaml = path:
Expand Down
15 changes: 13 additions & 2 deletions hs/package.yaml → package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,16 @@ executables:
ghc-options:
- -threaded

data-dir: data
data-files: stack-shell.nix
data-dir: .
data-files:
- default.nix
- project.nix
- package.yaml
- cli/*.hs
- lib/Nixage/*.hs
- lib/Nixage/Convert/*.hs
- lib/Nixage/Project/*.hs
- nix/*.nix
- nix/extraDeps/*.nix
- nix/tools/nix-prefetch-git
- data/stack-shell.nix
File renamed without changes.
File renamed without changes.