diff --git a/flake.lock b/flake.lock index 4f70922..ae3e5ac 100644 --- a/flake.lock +++ b/flake.lock @@ -10,10 +10,9 @@ "type": "github" }, "original": { - "owner": "NixOS", + "id": "nixpkgs", "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "indirect" } }, "root": { diff --git a/flake.nix b/flake.nix index db27f22..2a6952c 100644 --- a/flake.nix +++ b/flake.nix @@ -2,31 +2,47 @@ description = "A very basic flake"; inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + nixpkgs.url = "nixpkgs/nixpkgs-unstable"; }; outputs = { self, nixpkgs, }: let + supportedSystems = ["x86_64-linux" "aarch64-linux"]; + forAllSystems = nixpkgs.lib.genAttrs supportedSystems; + nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;}); pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs; in { - nvim = pkgs.mkShell { - nativeBuildInputs = [ - pkgs.alejandra - pkgs.ccls - pkgs.luaformatter - pkgs.nixd - pkgs.pyright - pkgs.rust-analyzer - pkgs.sumneko-lua-language-server - pkgs.svls - pkgs.texlab - pkgs.tree-sitter - pkgs.verible - pkgs.zls - (import ./nvim-lsp.nix {inherit pkgs;}) - ]; - }; + packages = forAllSystems (system: let + pkgs = nixpkgsFor.${system}; + in { + nvim = import ./nvim-lsp.nix {inherit pkgs;}; + }); + + devShells = forAllSystems (system: let + pkgs = nixpkgsFor.${system}; + in { + default = pkgs.mkShell { + nativeBuildInputs = [ + pkgs.alejandra + pkgs.ccls + pkgs.gopls + pkgs.luaformatter + pkgs.nixd + pkgs.pyright + pkgs.rust-analyzer + pkgs.sumneko-lua-language-server + pkgs.svls + pkgs.texlab + pkgs.tree-sitter + pkgs.verible + pkgs.zls + (import ./nvim-lsp.nix {inherit pkgs;}) + ]; + }; + }); + + defaultPackage = forAllSystems (system: self.packages.${system}.nvim); }; }