{"id":26186935,"url":"https://github.com/ivarref/datomic-transactor-nix-shell","last_synced_at":"2025-07-11T12:36:47.783Z","repository":{"id":270692563,"uuid":"911124633","full_name":"ivarref/datomic-transactor-nix-shell","owner":"ivarref","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-02T12:24:47.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-02T13:23:03.399Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ivarref.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-01-02T09:52:06.000Z","updated_at":"2025-01-02T12:24:50.000Z","dependencies_parsed_at":"2025-01-02T13:33:44.395Z","dependency_job_id":null,"html_url":"https://github.com/ivarref/datomic-transactor-nix-shell","commit_stats":null,"previous_names":["ivarref/datomic-transactor-nix-shell"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivarref%2Fdatomic-transactor-nix-shell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivarref%2Fdatomic-transactor-nix-shell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivarref%2Fdatomic-transactor-nix-shell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivarref%2Fdatomic-transactor-nix-shell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivarref","download_url":"https://codeload.github.com/ivarref/datomic-transactor-nix-shell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243130980,"owners_count":20241174,"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":[],"created_at":"2025-03-11T23:35:40.705Z","updated_at":"2025-03-11T23:35:41.234Z","avatar_url":"https://github.com/ivarref.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Datomic transactor, Java and Clojure nix flake\n\nEver wanted to `cd` into a directory and have the Datomic transactor, Java and Clojure installed?\n\nIf so, this repo is for you.\n\n## Installation\n\nInstall [Nix and Direnv](https://determinate.systems/posts/nix-direnv/),\nenable [Nix with flakes](https://nixos.wiki/wiki/Flakes#Enable_flakes_permanently_in_NixOS)\nand [hook direnv into your shell](https://direnv.net/docs/hook.html).\n\nI am not an expert on these matters, so you may have to google it yourself if you do not already\nhave installed these things. [](https://mitchellh.com/writing/nix-with-dockerfiles)\n\n## Usage\n\n```bash\ncd \u003cfolder-of-this-repo\u003e\n\n$ which java\n/nix/store/62vbkdvd43x2a9gv0sgsl9fskkhvl00z-zulu-ca-jdk-21.0.4/bin/java\n\n$ java -version\nopenjdk version \"21.0.4\" 2024-07-16 LTS\nOpenJDK Runtime Environment Zulu21.36+17-CA (build 21.0.4+7-LTS)\nOpenJDK 64-Bit Server VM Zulu21.36+17-CA (build 21.0.4+7-LTS, mixed mode, sharing)\n\n# Launch the transactor:\n$ transactor.sh # notice the absence of ./\nLaunching with Java options -server -Xms1g -Xmx1g -XX:+UseG1GC -XX:MaxGCPauseMillis=50\nSystem started\n(transactor.sh does not exit)\n\n# In a separate terminal:\n$ clojure -X:run\nStarting\n[{:db/id 17592186045418,\n  :movie/title \"The Goonies\",\n  :movie/genre \"action/adventure\",\n  :movie/release-year 1985}\n {:db/id 17592186045419,\n  :movie/title \"Commando\",\n  :movie/genre \"action/adventure\",\n  :movie/release-year 1985}\n {:db/id 17592186045420,\n  :movie/title \"Repo Man\",\n  :movie/genre \"punk dystopia\",\n  :movie/release-year 1984}]\nExiting\n\n# Stop the transactor, do whatever, start the transactor again. And then:\n$ clojure -X:read-only\n#            ^^^^^^^^^ Reading only this time \nStarting\n[{:db/id 17592186045418,\n  :movie/title \"The Goonies\",\n  :movie/genre \"action/adventure\",\n  :movie/release-year 1985}\n {:db/id 17592186045419,\n  :movie/title \"Commando\",\n  :movie/genre \"action/adventure\",\n  :movie/release-year 1985}\n {:db/id 17592186045420,\n  :movie/title \"Repo Man\",\n  :movie/genre \"punk dystopia\",\n  :movie/release-year 1984}]\nExiting\n# ^^ The data is still there\n```\n\nYes, that's some Datomic entities transacted into and read from a \"proper\" Datomic transactor (using the dev protocol and H2 as storage).\n\n## And ... ?\n\nWell, at least it works, right*? *At least on my machine. 😄\n\nThe point is that all the versions of Java, the transactor and Clojure\nare locked and pinned. And thus you do not *need* a system wide Java installation (or anything else besides\nwhat is mentioned in the Installation section). In some future case where the JVM breaks backwards compatibility,\nthis repo should still work (as it bundles its own JVM). With this setup you can also of course tweak\nthe versions per repo (instead of system wide) and also share an easily reproducible environment for others\nto use. Just `cd` into the repo, and you should be good to go.\n\nHope this is useful for someone! 😊\n\n## Further reading\n\n* Mitchell Hashimoto is a [big fan of Nix](https://mitchellh.com/writing/nix-with-dockerfiles).\n\n* [Fasterthanlime aka Amos on nix](https://fasterthanli.me/search?q=nix).\n\n* [NixOS \u0026 Nix Flakes - A Guide for Beginners](https://thiscute.world/en/posts/nixos-and-flake-basics/)\n\nHow much do you need to know about `nix` to use it? I do not know much, and yet somehow I'm getting by \njust fine. ¯\\\\_(ツ)_/¯","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivarref%2Fdatomic-transactor-nix-shell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivarref%2Fdatomic-transactor-nix-shell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivarref%2Fdatomic-transactor-nix-shell/lists"}