{"id":20548374,"url":"https://github.com/jeslie0/mkelmderivation","last_synced_at":"2025-04-14T10:52:59.180Z","repository":{"id":111536134,"uuid":"581315295","full_name":"jeslie0/mkElmDerivation","owner":"jeslie0","description":"A nix flake for simplifiying the packaging of elm projects, inspired by elm2nix.","archived":false,"fork":false,"pushed_at":"2025-04-13T02:56:39.000Z","size":3900,"stargazers_count":31,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-13T03:42:49.535Z","etag":null,"topics":["elm","flake","haskell","nix"],"latest_commit_sha":null,"homepage":"https://github.com/jeslie0/mkElmDerivation/","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeslie0.png","metadata":{"files":{"readme":"README.org","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-12-22T21:05:14.000Z","updated_at":"2025-04-13T02:56:43.000Z","dependencies_parsed_at":"2023-10-15T21:58:44.167Z","dependency_job_id":"246b217f-3e29-46fc-a9e0-e2d51fe4d0b3","html_url":"https://github.com/jeslie0/mkElmDerivation","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeslie0%2FmkElmDerivation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeslie0%2FmkElmDerivation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeslie0%2FmkElmDerivation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeslie0%2FmkElmDerivation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeslie0","download_url":"https://codeload.github.com/jeslie0/mkElmDerivation/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248868807,"owners_count":21174755,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elm","flake","haskell","nix"],"created_at":"2024-11-16T02:13:13.177Z","updated_at":"2025-04-14T10:52:59.156Z","avatar_url":"https://github.com/jeslie0.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"#+title: mkElmDerivation\n[[https://img.shields.io/badge/built%20with-Haskell-8f4e8b.svg]] [[https://img.shields.io/badge/built%20for-Elm-60b6cd.svg]] [[https://img.shields.io/github/license/jeslie0/mkelmderivation.svg]] [[https://img.shields.io/github/actions/workflow/status/jeslie0/mkElmDerivation/CI.yml.svg]]\n\nThis repository provides an unopinionated, general approach to packaging Elm projects. An overlay is provided, giving a function =mkElmDerivation= which is an overloaded version of nixpkgs's =mkDerivation=, but with all of your elm dependencies downloaded and stored in the right place. This allows you to package normal Elm projects, but also things like elm-spa and elm-watch apps. All of this is done by using your project's =elm.json= file, and requires no updating of nix files when you update your dependencies.\n\n* Examples\nThe following is the content of a =flake.nix= file, which can be used to build a normal elm project.\n#+begin_src nix\n{\n  description = \"An example flake for building elm projects.\";\n\n  inputs = {\n    nixpkgs.url = \"github:nixos/nixpkgs/nixos-unstable\";\n    mkElmDerivation.url = \"github:jeslie0/mkElmDerivation\";\n  };\n\n  outputs = { self, nixpkgs, mkElmDerivation }:\n    let\n      system =\n        \"x86_64-linux\";\n\n      pkgs = import nixpkgs {\n        overlays = [ mkElmDerivation.overlay ];\n        inherit system;\n      };\n      in\n        {\n          packages = {\n            default = pkgs.mkElmDerivation {\n              name = \"elm-example\";\n              src = ./.;\n              elmJson = ./elm.json; # This defaults to ${src}/elm.json\n              nativeBuildInputs =\n                [ pkgs.elmPackages.elm ];\n              buildPhase =\n                ''\n                elm make src/Main.elm --output Main.js --optimize\n                '';\n              installPhase =\n                ''\n                mkdir $out\n                cp Main.js $out\n                '';\n            };\n          };\n        };\n}\n#+end_src\n\nWe aren't restricted to just using Elm, however. Since this is just wrapper around =mkDerivation=, you can use whatever build inputs and build commands you want. See the [[./tests][tests]] directory for some more examples.\n\n* Versions\nThis project currently supports version 0.19.1 of Elm.\n\n* Deprecations\nThis project currently provides the functions =mkElmSpaDerivation= and =mkElmWatchDerivation=. The existence of these functions made sense when =mkElmDerivation= was more opinionated and less customizable; however, now that =mkElmDerivation= is more generic they aren't as useful. They will be kept in this project until the next major release, but I recommend not using them and instead using =mkElmDerivation= with a custom ~buildPhase~ and ~installPhase~.\n\n* Updates\nCurrently, a GitHub action is set to run at 0000 every Sunday. This will update the three JSON files stored in the [[file:mkElmDerivation/][mkElmDerivation directory]].\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeslie0%2Fmkelmderivation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeslie0%2Fmkelmderivation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeslie0%2Fmkelmderivation/lists"}