diff --git a/examples/vala/devenv.nix b/examples/vala/devenv.nix new file mode 100644 index 000000000..7cf0870f9 --- /dev/null +++ b/examples/vala/devenv.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: + +{ + packages = with pkgs; [ + # Check Vala code files for code-style errors + vala-lint + ]; + + languages = { + vala = { + enable = true; + # This is the default package for Vala for the configured channel (see nixpkgs input in devenv.yaml) + # It can be configured to use a specific version + # Take a look [here](https://search.nixos.org/packages?channel=unstable&from=0&size=50&sort=relevance&type=packages&query=vala) to find out which versions are available + package = pkgs.vala; + }; + }; + + enterShell = '' + echo "This development environment uses $(vala --version)." + ''; +} diff --git a/examples/vala/devenv.yaml b/examples/vala/devenv.yaml new file mode 100644 index 000000000..c7cb5ceda --- /dev/null +++ b/examples/vala/devenv.yaml @@ -0,0 +1,3 @@ +inputs: + nixpkgs: + url: github:NixOS/nixpkgs/nixpkgs-unstable diff --git a/src/modules/languages/vala.nix b/src/modules/languages/vala.nix new file mode 100644 index 000000000..17e32d936 --- /dev/null +++ b/src/modules/languages/vala.nix @@ -0,0 +1,24 @@ +{ pkgs, config, lib, ... }: + +let + cfg = config.languages.vala; +in +{ + options.languages.vala = { + enable = lib.mkEnableOption "tools for Vala development"; + + package = lib.mkOption { + type = lib.types.package; + default = pkgs.vala; + defaultText = lib.literalExpression "pkgs.vala"; + description = "The Vala package to use."; + example = lib.literalExpression "pkgs.vala_0_54"; + }; + }; + + config = lib.mkIf cfg.enable { + packages = [ + cfg.package + ]; + }; +}