{"id":15063829,"url":"https://github.com/sempruijs/json2nix","last_synced_at":"2025-04-10T11:26:17.202Z","repository":{"id":246944418,"uuid":"823343562","full_name":"sempruijs/json2nix","owner":"sempruijs","description":"A json to nix converterwritten in Haskell","archived":false,"fork":false,"pushed_at":"2025-01-04T21:56:30.000Z","size":60,"stargazers_count":14,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-04T13:14:03.045Z","etag":null,"topics":["converter","flake","haskell","json","nix"],"latest_commit_sha":null,"homepage":"","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/sempruijs.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2024-07-02T21:27:14.000Z","updated_at":"2025-02-25T09:40:35.000Z","dependencies_parsed_at":"2024-09-25T00:07:54.692Z","dependency_job_id":"cc7957b5-db08-4f13-b269-1293058e498b","html_url":"https://github.com/sempruijs/json2nix","commit_stats":null,"previous_names":["sempruijs/json2nix"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sempruijs%2Fjson2nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sempruijs%2Fjson2nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sempruijs%2Fjson2nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sempruijs%2Fjson2nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sempruijs","download_url":"https://codeload.github.com/sempruijs/json2nix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208621,"owners_count":21065203,"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":["converter","flake","haskell","json","nix"],"created_at":"2024-09-25T00:07:44.984Z","updated_at":"2025-04-10T11:26:17.173Z","avatar_url":"https://github.com/sempruijs.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json2nix\n\nA json to nix converter written in Haskell.\nYou can use this easily with a flake.\nUnformatted json is also supported.\n\n## Usage\n\nIf you have something like this:\n\n```\n{\n    \"name\": \"Alice\",\n    \"age\": 21,\n    \"length_in_meters\": 1.8,\n    \"best_friends\": [\n        {\n            \"name\": \"bob\",\n            \"age\": 19,\n        },\n        {\n            \"name\": \"Sem\",\n            \"age\": 19,\n        }\n    ],\n    \"favorite_movie\": null,\n    \"(some)%wild;key\": 5,\n    \"1\": [],\n    \"2\": []\n}\n```\n\nAnd you want something like this:\n\n```nix\n{\n  name = \"Alice\";\n  age = 21;\n  length_in_meters = 1.8;\n  best_friends = [\n    {\n      name = \"bob\";\n      age = 19;\n    }\n    {\n      name = \"Sem\";\n      age = 19;\n    }\n  ];\n  favorite_movie = null;\n  \"(some)%wild;key\" = 5;\n  \"1\" = [];\n  \"2\" = [];\n}\n```\n\nYou can do so by enabling nix flakes and run the following command in your shell:\n\n```shell\nnix run github:sempruijs/json2nix\n```\n\nThis will install the required tools.\njson2nix will ask two questions:\n\n1. Choose a file path.\nThis could be something like: ```config.json```.\n\n2. Choose a file name for the new nix file.\nYou can type something or hit enter for the suggestion.\nThis would be something like: ```config.nix```\n\n## Contributing\n\nIf you find a bug please submit [an issue](https://github.com/sempruijs/json2nix/issues) or [pull request](https://github.com/sempruijs/json2nix/pulls).\n\nMIT license\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsempruijs%2Fjson2nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsempruijs%2Fjson2nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsempruijs%2Fjson2nix/lists"}