From 8f897ffb4a1575252c536c63db8be72f22b6a494 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Mon, 4 Nov 2024 01:38:45 -0800 Subject: [PATCH] initial commit --- LICENSE | 5 +++++ README.md | 12 ++++++++++++ flake.lock | 26 ++++++++++++++++++++++++++ flake.nix | 16 ++++++++++++++++ qml-ts-mode.nix | 10 ++++++++++ tree-sitter-qmljs.nix | 10 ++++++++++ 6 files changed, 79 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 qml-ts-mode.nix create mode 100644 tree-sitter-qmljs.nix diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0e77b64 --- /dev/null +++ b/LICENSE @@ -0,0 +1,5 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..cf23933 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# nix-qml-support +Extra nix packages for QML development. + +### tree-sitter-qmljs +Package of [yuja/tree-sitter-qmljs](https://github.com/yuja/tree-sitter-qmljs). + +Available as `packages..tree-sitter-qmljs`. + +### qml-ts-mode +Package of [xhcoding/qml-ts-mode](https://github.com/xhcoding/qml-ts-mode). + +Available as `packages..qml-ts-mode`. diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..7de6f8e --- /dev/null +++ b/flake.lock @@ -0,0 +1,26 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1730531603, + "narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d70a3d4 --- /dev/null +++ b/flake.nix @@ -0,0 +1,16 @@ +{ + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + }; + + outputs = { nixpkgs, ... }: let + forEachSystem = fn: nixpkgs.lib.genAttrs + [ "x86_64-linux" "aarch64-linux" ] + (system: fn system nixpkgs.legacyPackages.${system}); + in { + packages = forEachSystem (system: pkgs: rec { + tree-sitter-qmljs = pkgs.callPackage ./tree-sitter-qmljs.nix {}; + qml-ts-mode = pkgs.emacsPackages.callPackage ./qml-ts-mode.nix {}; + }); + }; +} diff --git a/qml-ts-mode.nix b/qml-ts-mode.nix new file mode 100644 index 0000000..89b391f --- /dev/null +++ b/qml-ts-mode.nix @@ -0,0 +1,10 @@ +{ fetchFromGitHub, trivialBuild }: trivialBuild { + pname = "qml-ts-mode"; + version = "master"; + src = fetchFromGitHub { + owner = "xhcoding"; + repo = "qml-ts-mode"; + rev = "22e5b4ee2036d01878e463b5e4cce80957c96619"; + sha256 = "Mx3kwDx7sVwF9uQ5vOIXnfPkuOkuq3VN2KhkC/dod+4="; + }; +} diff --git a/tree-sitter-qmljs.nix b/tree-sitter-qmljs.nix new file mode 100644 index 0000000..9ac7b89 --- /dev/null +++ b/tree-sitter-qmljs.nix @@ -0,0 +1,10 @@ +{ fetchFromGitHub, tree-sitter }: tree-sitter.buildGrammar { + language = "tree-sitter-qmljs"; + version = "master"; + src = fetchFromGitHub { + owner = "yuja"; + repo = "tree-sitter-qmljs"; + rev = "6d4db242185721e1f5ef21fde613ca90c743ec47"; + sha256 = "S6rBQRecJvPgyWq1iydFZgDyXbm9CZBw8kxzNI0cqdw="; + }; +}