{ description = "A very basic flake"; inputs = { nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-21.11"; }; outputs = { self, nixpkgs }: let system = "x86_64-linux"; pkgs = nixpkgs.legacyPackages.${system}; gf-rgl = pkgs.callPackage ./gf-rgl.nix { }; vim-gf = pkgs.vimUtils.buildVimPlugin { name = "vim-gf"; src = pkgs.fetchFromGitHub { owner = "gdetrez"; repo = "vim-gf"; rev = "60924ef93a0ec69dc716982646bc907dfb37de6d"; hash = "sha256-Y1xDsefjusJFJCQu6fX6x/QEECjRuVBC4l6kASJwUgU="; }; }; gf-book-examples = pkgs.fetchzip { url = "https://www.grammaticalframework.org/gf-book/gf-book-examples.tgz"; hash = "sha256-tiOJ2Pep+1WkhD6rSbDfvPIZf1pty9h1lNvGGe3vAX8="; }; gf-book = pkgs.fetchurl { url = "https://listenmaa.fi/b/Aarne_Ranta-GF-book.pdf"; hash = "sha256-GeoyJKYcC8MtPFXBdQhEOwAjwH+tWbG/T66KNZO67Og="; }; neovim-for-gf = pkgs.neovim.override { configure = { packages.myPlugins = { start = [ vim-gf pkgs.vimPlugins.vim-nix ]; }; customRC = '' set nocompatible set expandtab shiftwidth=2 tabstop=2 set number syntax on filetype plugin indent on colorscheme delek set fileformat=unix autocmd BufWritePre * if &ft != 'markdown' | %s/\s\+$//e | endif set fixendofline ''; }; }; in { packages.${system} = { gf = pkgs.haskellPackages.gf; inherit gf-rgl gf-book gf-book-examples neovim-for-gf; }; devShells.${system}.default = pkgs.mkShell { buildInputs = [ pkgs.haskellPackages.gf gf-rgl neovim-for-gf (pkgs.writeShellScriptBin "gf-book" '' ${pkgs.zathura}/bin/zathura ${gf-book} '') ]; shellHook = '' alias vim='nvim' mkdir -p gf-book-examples cp -rn ${gf-book-examples}/. gf-book-examples/ chmod -R u+w gf-book-examples/ ''; }; }; }