{"id":16770704,"url":"https://github.com/gaelreyrol/udev-nix","last_synced_at":"2025-03-28T17:13:43.562Z","repository":{"id":175332624,"uuid":"653734674","full_name":"gaelreyrol/udev-nix","owner":"gaelreyrol","description":"A small utility library to create udev rules with Nix!","archived":false,"fork":false,"pushed_at":"2024-04-07T15:02:13.000Z","size":87,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-07T16:24:07.509Z","etag":null,"topics":["nix","udev","udev-rules"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gaelreyrol.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}},"created_at":"2023-06-14T16:07:35.000Z","updated_at":"2024-04-15T07:59:36.639Z","dependencies_parsed_at":null,"dependency_job_id":"6afc4433-dcbc-4fc2-8014-fba45214cef1","html_url":"https://github.com/gaelreyrol/udev-nix","commit_stats":null,"previous_names":["gaelreyrol/udev-nix"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaelreyrol%2Fudev-nix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaelreyrol%2Fudev-nix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaelreyrol%2Fudev-nix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gaelreyrol%2Fudev-nix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gaelreyrol","download_url":"https://codeload.github.com/gaelreyrol/udev-nix/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246068302,"owners_count":20718503,"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":["nix","udev","udev-rules"],"created_at":"2024-10-13T06:25:13.190Z","updated_at":"2025-03-28T17:13:43.527Z","avatar_url":"https://github.com/gaelreyrol.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# udev-nix\n\n[![CI](https://github.com/gaelreyrol/udev-nix/actions/workflows/ci.yml/badge.svg)](https://github.com/gaelreyrol/udev-nix/actions/workflows/ci.yml)\n\n\u003e A small utility library to create udev rules with Nix!\n\nFor now this is a pet project to improve my Nix knowledge, the API might change in the future.\n\nDon't hesitate to submit changes that will help me to improve the code 🤗.\n\n\u003e **DO NOT USE IN PRODUCTION**\n\n## ToDo\n\n- [x] Make test derivations to compare output files\n- [ ] Assertions on rule keys according to the implementation\n- [ ] Improve API through composition\n  - [ ] Explain API functions\n- [ ] Find a way to test rules on devices (in a VM)\n- [ ] Create and expose a NixOS Module\n- [ ] Inspire from [Disko](https://github.com/nix-community/disko) \u0026 [notnft](https://github.com/chayleaf/notnft)\n- [ ] Publish library on [Links](https://discourse.nixos.org/c/links/12) category of NixOS Discourse\n\n## Usage\n\n### Flakes\n\nImport the flake:\n\n```nix\n{\n  inputs = {\n    udev-nix.url = \"github:gaelreyrol/udev-nix\";\n  };\n}\n```\n\nCreate an udev file:\n\n```nix\n{\n  outputs = inputs@{ nixpkgs, udev-nix, ... }:\n  let\n    udevLib = udev-nix.lib.\"x86_64-linux\";\n  in\n  {\n    packages.x86_64-linux.myUdevFile = udevLib.mkUdevFile \"20-test.rules\" {\n      rules = with udevLib; {\n        \"Description on my udev file\" = {\n          Subsystems = operators.match \"usb\";\n          Tag = operators.add \"uaccess\";\n        };\n      };\n    };\n  };\n}\n```\n\nIt will produce this result:\n\n```bash\n$ cat /nix/store/pn8abdgzvafkywdpwzcn09hi0vw8np27-20-test.rules\n# Description on my udev file\nTAG+=\"uaccess\", SUBSYSTEMS==\"usb\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaelreyrol%2Fudev-nix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaelreyrol%2Fudev-nix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaelreyrol%2Fudev-nix/lists"}