From 8687f07feaf6734a828a75b6a41737f4fd883764 Mon Sep 17 00:00:00 2001 From: Vito Canadi Date: Sat, 11 Aug 2018 00:40:01 +0200 Subject: [PATCH] NXG-28 Remove stack.yaml generation in nix ^NXG-28 Done --- nix/default.nix | 3 --- nix/interop/stack/toStack.nix | 45 ----------------------------------- 2 files changed, 48 deletions(-) delete mode 100644 nix/interop/stack/toStack.nix diff --git a/nix/default.nix b/nix/default.nix index 28ea8b9..5060d28 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -15,8 +15,6 @@ let inherit pkgs system config overrides haskellOverrides; }; - toStack = import ./interop/stack/toStack.nix { inherit pkgs; }; - makeNixageProj = proj': root: let # Set defaults and root @@ -27,7 +25,6 @@ let pkgs = nixageProj.projPkgs; haskellPackages = nixageProj.haskellPackages; target = nixageProj.target; - stack-yaml = toStack proj; prefetch-incomplete = prefetchAllIncomplete proj; }; in diff --git a/nix/interop/stack/toStack.nix b/nix/interop/stack/toStack.nix deleted file mode 100644 index acd0a54..0000000 --- a/nix/interop/stack/toStack.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ pkgs }: proj: - -let - inherit (builtins) concatLists concatStringsSep; - inherit (pkgs.lib) attrValues flatten mapAttrsToList optional; - inherit (import ../../extraDeps { inherit pkgs; }) caseDep; - inherit (import ../../yaml.nix { inherit pkgs; }) format; - - - formatPackage = _: path: [ path ]; - - formatHackageDep = name: version: - [ "${name}-${version}" ]; - formatGitDep = name: repo: [ - "git: ${repo.git}" - "commit: ${repo.rev}" - ] ++ optional (repo ? subdir) ''subdirs: [ "${repo.subdir}" ]''; - - formatExtraDep = name: spec: caseDep spec { - hackage = formatHackageDep; - git = formatGitDep; - } name spec; - - snapshot-name = "nixage-stack-snapshot"; - snapshot = pkgs.writeText snapshot-name (concatStringsSep "\n" (flatten [ - "name: ${snapshot-name}" - "" - "resolver: ${proj.resolver}" - "" - (format.list "packages" (mapAttrsToList formatExtraDep proj.extra-deps)) - "" - ])); - -in - -pkgs.writeText "stack.yaml" (concatStringsSep "\n" (flatten [ - "resolver: ${snapshot}" - "" - (format.list "packages" (mapAttrsToList formatPackage proj.packages)) - "" - "nix:" - " enable: true" - " shell-file: stack-shell.nix" - "" -]))