From 7603b347acab8ab74c6c0c974df5c5d82fa77f47 Mon Sep 17 00:00:00 2001 From: DavHau Date: Tue, 18 Jul 2023 19:23:16 +0200 Subject: [PATCH] remove legacy notes + templates --- notes/haskell.md | 20 -------------------- notes/node2nix.md | 11 ----------- templates/default.nix | 29 +++-------------------------- templates/simple/.envrc | 1 - templates/simple/flake.nix | 10 ---------- 5 files changed, 3 insertions(+), 68 deletions(-) delete mode 100644 notes/haskell.md delete mode 100644 notes/node2nix.md delete mode 100644 templates/simple/.envrc delete mode 100644 templates/simple/flake.nix diff --git a/notes/haskell.md b/notes/haskell.md deleted file mode 100644 index 7b3e5c92f7..0000000000 --- a/notes/haskell.md +++ /dev/null @@ -1,20 +0,0 @@ -## Why not just wrap haskell.nix and use it as is? - -Haskell.nix has the following problems which we like to prevent: - -### 1. nix code generation enforced - -haskell.nix always generates nix code as an intermediary step. This forcefully requires IFD or pre-processing (materialization) which negatively impacts performance and/or UX. - -In dream2nix, processing of the input is preferably done in nix, which minimizes IFD layers required and should lead to better overall evaluation performance and less complex UX. For situations where a pure nix translation is not possible, dream2nix also falls back to IFD or pre-processing (impure translation), but this is well integrated in the UI and won't require studying an extra readme for materialization or manually having to check if materialization artifacts are up to date. - -### 2. caching -haskell.nix contains a lot of overlays for nixpkgs and custom patches for ghc. This seems to invalidate artifacts from the nixos.org cache to a degree where using haskell.nix becomes practically impossible without trusting iohk's cache or hosting ones own caching infrastructure. - -One goal of dream2nix is to integrate better with the nixos.org infrastructure: - - by trying to re-use cached compilers from nixpkgs - - by generally being compatible with nixpkgs, so dream2nix made packages can be added to nixpkgs directly and therefore will be cached on nixos.org. - - by finally releasing the whole dream2nix framework into nixpkgs leading to an optimal integration with the official infra. - -### 3. simple operations are too expensive -Simple operations, like listing packages for a project, already requires IFD or pre-processing. Tooling around nix, especially flakes + nix-command expects these kind of operations to be cheap and quick in execution. This is currently not provided by haskell.nix. diff --git a/notes/node2nix.md b/notes/node2nix.md deleted file mode 100644 index f8a1079cc8..0000000000 --- a/notes/node2nix.md +++ /dev/null @@ -1,11 +0,0 @@ -## problems with original node2nix implementation - -### Bad caching -- packages are all unpacked at once inside a build instead of in individual derivations - -### Bad build performance - - unpacking is done sequentially - - pinpointing deps is done sequentially - -### build time dependencies unavailable - - packages are not available during build (could be fixed by setting NODE_PATH and installing in correct order) diff --git a/templates/default.nix b/templates/default.nix index 5ef01e1d5e..ea286a05c1 100644 --- a/templates/default.nix +++ b/templates/default.nix @@ -6,32 +6,9 @@ l = lib // builtins; in { flake = { - templates = { - default = self.templates.simple; - simple = { - description = "Simple dream2nix flake"; - path = ./simple; - welcomeText = '' - You just created a simple dream2nix package! - - start with typing `nix flake show` to discover the projects attributes. - - commands: - - - `nix develop` <-- enters the devShell - - `nix build .#` <-- builds the default package (`.#default`) - - - Start hacking and -_- have some fun! - - > dont forget to add nix `result` folder to your `.gitignore` - - ''; - }; - v1-python = { - description = "Simple dream2nix python project"; - path = ./v1-python; - }; + v1-python = { + description = "Simple dream2nix python project"; + path = ./v1-python; }; }; } diff --git a/templates/simple/.envrc b/templates/simple/.envrc deleted file mode 100644 index 8392d159f2..0000000000 --- a/templates/simple/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake \ No newline at end of file diff --git a/templates/simple/flake.nix b/templates/simple/flake.nix deleted file mode 100644 index 2044e4d19a..0000000000 --- a/templates/simple/flake.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - inputs.dream2nix.url = "github:nix-community/dream2nix"; - outputs = inp: - inp.dream2nix.lib.makeFlakeOutputs { - systemsFromFile = ./nix_systems; - config.projectRoot = ./.; - source = ./.; - projects = ./projects.toml; - }; -}