Browse Source

Add godot module

main
parent
commit
f71e9b570b
Signed by: chris GPG Key ID: 3025DCBD46F81C0F
  1. 71
      README.org
  2. 18
      flake.lock
  3. 1
      flake.nix
  4. 1
      modules/emacs.nix
  5. 11
      modules/godot.nix

71
README.org

@ -502,6 +502,7 @@ nixos = nixpkgs.lib.nixosSystem {
<<module-x11>> <<module-x11>>
<<module-ssh>> <<module-ssh>>
<<module-hugo>> <<module-hugo>>
<<module-godot>>
<<module-flakes>> <<module-flakes>>
<<module-cachix>> <<module-cachix>>
<<module-firefox>> <<module-firefox>>
@ -733,6 +734,29 @@ in {
} }
#+END_SRC #+END_SRC
** Godot
#+NAME: module-godot
#+BEGIN_SRC nix
./modules/godot.nix
#+END_SRC
[[https://godotengine.org][Godot]] is a cross-platform, free and open-source game engine released under the MIT license. It provides a huge set of common tools, so you can focus on making your game without reinventing the wheel. It's completely free and open-source, no strings attached, no royalties. The game belongs to the creator down to each line of the engine code.
#+BEGIN_SRC nix :noweb yes :tangle modules/godot.nix
# <<file-warning>>
{ config, pkgs, ... }:
{
environment.systemPackages = [
tiled
godot
godot-server
godot-headless
];
}
#+END_SRC
** Flakes ** Flakes
#+NAME: module-flakes #+NAME: module-flakes
@ -1108,6 +1132,7 @@ let
<<emacs-projectile-package>> <<emacs-projectile-package>>
<<emacs-lsp-package>> <<emacs-lsp-package>>
<<emacs-company-package>> <<emacs-company-package>>
<<emacs-gdscript-package>>
<<emacs-ccls-package>> <<emacs-ccls-package>>
<<emacs-golang-package>> <<emacs-golang-package>>
<<emacs-python-package>> <<emacs-python-package>>
@ -1188,6 +1213,7 @@ When Emacs is started, it normally tries to load a Lisp program from an ititiali
<<emacs-projectile-elisp>> <<emacs-projectile-elisp>>
<<emacs-lsp-elisp>> <<emacs-lsp-elisp>>
<<emacs-company-elisp>> <<emacs-company-elisp>>
<<emacs-gdscript-elisp>>
<<emacs-golang-elisp>> <<emacs-golang-elisp>>
<<emacs-python-elisp>> <<emacs-python-elisp>>
<<emacs-rustic-elisp>> <<emacs-rustic-elisp>>
@ -2353,7 +2379,8 @@ The [[https://microsoft.github.io/language-server-protocol][Language Server Prot
;; Add custom keybindings for `lsp'. ;; Add custom keybindings for `lsp'.
(dotfiles/leader (dotfiles/leader
"tl" '(lsp :which-key "LSP"))
"l" '(:ignore t :which-key "LSP")
"ll" '(lsp :which-key "LSP"))
#+END_SRC #+END_SRC
** CCLS ** CCLS
@ -2398,6 +2425,48 @@ epkgs.company
(global-company-mode +1) (global-company-mode +1)
#+END_SRC #+END_SRC
** GDScript Mode
#+NAME: emacs-gdscript-package
#+BEGIN_SRC nix
epkgs.gdscript-mode
#+END_SRC
https://github.com/godotengine/emacs-gdscript-mode is an Emacs package to get GDScript support and syntax highlighting. Some of its features include:
+ Syntax highlighting
+ Code folding
+ Debugger support
+ Support for scenes and script files
+ Comment wrapping
+ Indentation
+ Automatic parsing
+ Code formatting
#+NAME: emacs-gdscript-elisp
#+BEGIN_SRC emacs-lisp
(require 'gdscript-mode)
;; Silence lsp warnings for gdscript.
(defun lsp--gdscript-ignore-errors (original-function &rest args)
"Ignore the error message resulting from Godot not replying to the `JSONRPC' request."
(if (string-equal major-mode "gdscript-mode")
(let ((json-data (nth 0 args)))
(if (and (string= (gethash "jsonrpc" json-data "") "2.0")
(not (gethash "id" json-data nil))
(not (gethash "method" json-data nil)))
nil; (message "Method not found")
(apply original-function args)))
(apply original-function args)))
;; Run the function around `lsp--get-message-type' to suppress warnings.
(advice-add #'lsp--get-message-type :around #'lsp--gdscript-ignore-errors)
;; Add custom keybinds.
(dotfiles/leader
"lg" '(gdscript-hydra-show :which-key "GDScript"))
#+END_SRC
** Go Mode ** Go Mode
#+NAME: emacs-golang-package #+NAME: emacs-golang-package

18
flake.lock

@ -30,6 +30,21 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_2": {
"locked": {
"lastModified": 1649676176,
"narHash": "sha256-OWKJratjt2RW151VUlJPRALb7OU2S5s+f0vLj4o1bHM=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a4b154ebbdc88c8498a5c7b01589addc9e9cb678",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -73,7 +88,7 @@
}, },
"nix-on-droid": { "nix-on-droid": {
"inputs": { "inputs": {
"flake-utils": "flake-utils",
"flake-utils": "flake-utils_2",
"home-manager": "home-manager_2", "home-manager": "home-manager_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -142,6 +157,7 @@
"root": { "root": {
"inputs": { "inputs": {
"emacs-overlay": "emacs-overlay", "emacs-overlay": "emacs-overlay",
"flake-utils": "flake-utils",
"home-manager": "home-manager", "home-manager": "home-manager",
"nix-on-droid": "nix-on-droid", "nix-on-droid": "nix-on-droid",
"nixos-hardware": "nixos-hardware", "nixos-hardware": "nixos-hardware",

1
flake.nix

@ -24,6 +24,7 @@
./modules/x11.nix ./modules/x11.nix
./modules/ssh.nix ./modules/ssh.nix
./modules/hugo.nix ./modules/hugo.nix
./modules/godot.nix
./modules/flakes.nix ./modules/flakes.nix
./modules/cachix.nix ./modules/cachix.nix
./modules/firefox.nix ./modules/firefox.nix

1
modules/emacs.nix

@ -48,6 +48,7 @@ let
epkgs.lsp-mode epkgs.lsp-mode
epkgs.lsp-ui epkgs.lsp-ui
epkgs.company epkgs.company
epkgs.gdscript-mode
epkgs.ccls epkgs.ccls
epkgs.go-mode epkgs.go-mode
epkgs.pretty-mode epkgs.pretty-mode

11
modules/godot.nix

@ -0,0 +1,11 @@
# This file is controlled by /etc/dotfiles/README.org
{ config, pkgs, ... }:
{
environment.systemPackages = [
tiled
godot
godot-server
godot-headless
];
}
Loading…
Cancel
Save