flake: update configuration, add proper outputs and arm64 target

This commit is contained in:
Asmir A 2023-10-27 01:38:31 +02:00
parent a81f0a2041
commit 3c95acb92e
2 changed files with 36 additions and 21 deletions

5
flake.lock generated
View File

@ -10,10 +10,9 @@
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "id": "nixpkgs",
"ref": "nixpkgs-unstable", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "type": "indirect"
"type": "github"
} }
}, },
"root": { "root": {

View File

@ -2,19 +2,32 @@
description = "A very basic flake"; description = "A very basic flake";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; nixpkgs.url = "nixpkgs/nixpkgs-unstable";
}; };
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
}: let }: 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; pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs;
in { in {
nvim = pkgs.mkShell { 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 = [ nativeBuildInputs = [
pkgs.alejandra pkgs.alejandra
pkgs.ccls pkgs.ccls
pkgs.gopls
pkgs.luaformatter pkgs.luaformatter
pkgs.nixd pkgs.nixd
pkgs.pyright pkgs.pyright
@ -28,5 +41,8 @@
(import ./nvim-lsp.nix {inherit pkgs;}) (import ./nvim-lsp.nix {inherit pkgs;})
]; ];
}; };
});
defaultPackage = forAllSystems (system: self.packages.${system}.nvim);
}; };
} }