Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable agda-language-server #289

Open
github-actions bot opened this issue May 10, 2024 · 0 comments
Open

enable agda-language-server #289

github-actions bot opened this issue May 10, 2024 · 0 comments
Labels
bug Something isn't working todo

Comments

@github-actions
Copy link
Contributor

packages = with pkgs; [

haskellPackages.agda-language-server

];

Nix should ask for permission before using it,

but remove it here if you do not want it to.

# FIXME enable agda-language-server

{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
  inputs.utils.url = "github:ursi/flake-utils";

  outputs = { self, utils, ... }@inputs:
    utils.apply-systems { inherit inputs; }
      ({ pkgs, system, ... }:
        let
          agda = pkgs.agda.withPackages (ps: with ps; [
            # shared dependencies (should mirror ./agd.agd-lib)
            standard-library
            agda-prelude
          ]);
          agd = pkgs.agdaPackages.mkDerivation {
            pname = "agd";
            version = "0.1";
            src = ./src;
            buildInputs = [ agda ];
            postBuild = ''
              agda -c Main.agda
            '';
            postInstall = ''
              mkdir -p $out/bin
              cp Main $out/bin/agd
            '';
            meta = { };
          };
        in
        # Flake definition must follow haskell.cabal
        {
          packages.default = agd;
          devShells.default = pkgs.mkShell {
            # FIXME enable agda-language-server
            #packages = with pkgs; [
            #  haskellPackages.agda-language-server
            #];
            buildInputs = [
              agda
            ];
            shellHook = ''
              alias log_='printf "\033[1;32m%s\033[0m\n" "$@"'
              alias info_='printf "\033[1;34m[INFO] %s\033[0m\n" "$@"'
              alias warn_='printf "\033[1;33m[WARN] %s\033[0m\n" "$@"'
              log_ "Welcome to agd shell."
              info_ "Available commands: agda."
              warn_ "agda needs to be called in src folder"
            '';
          };
          checks.output = pkgs.runCommand "agd-output" { }
            ''
              echo ${agd} > $out
            '';
        });

  # --- Flake Local Nix Configuration ----------------------------
  nixConfig = {
    # This sets the flake to use nix cache.
    # Nix should ask for permission before using it,
    # but remove it here if you do not want it to.
    extra-substituters = [
      "https://cache.tcp4.me?priority=99"
    ];
    extra-trusted-public-keys = [
      "cache.tcp4.me:cmk2Iz81lQuX7FtTUcBgtqgI70E8p6SOamNAIcFDSew="
    ];
  };
}
@github-actions github-actions bot added bug Something isn't working todo labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working todo
Projects
None yet
Development

No branches or pull requests

0 participants