|
1 | 1 | {
|
2 | 2 | inputs = {
|
3 |
| - utils.url = "github:numtide/flake-utils"; |
| 3 | + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # Or your preferred channel |
| 4 | + # flake-utils is no longer an input |
4 | 5 | };
|
5 |
| - outputs = { self, nixpkgs, utils }: utils.lib.eachDefaultSystem (system: |
6 |
| - let |
7 |
| - pkgs = nixpkgs.legacyPackages.${system}; |
8 |
| - in |
9 |
| - { |
10 |
| - devShell = pkgs.mkShell { |
| 6 | + |
| 7 | + outputs = inputs @ { self, nixpkgs, ... }: let |
| 8 | + |
| 9 | + forAllSystems = function: |
| 10 | + nixpkgs.lib.genAttrs [ |
| 11 | + "x86_64-linux" |
| 12 | + "aarch64-linux" |
| 13 | + # Add other systems like "x86_64-darwin", "aarch64-darwin" if you need them |
| 14 | + ] (system: |
| 15 | + function (import nixpkgs { |
| 16 | + inherit system; |
| 17 | + # overlays = [ ... ]; # You can add overlays here if needed |
| 18 | + # config = { ... }; # Or pkgs configuration |
| 19 | + })); |
| 20 | + |
| 21 | + in rec { # 'rec' allows self-reference if needed, e.g., devShells = devShell; |
| 22 | + |
| 23 | + # This will create devShell.x86_64-linux, devShell.aarch64-linux, etc. |
| 24 | + # `nix develop` on a supported system (e.g., x86_64-linux) will pick up |
| 25 | + # devShell.x86_64-linux automatically. |
| 26 | + devShell = forAllSystems (pkgs: # pkgs for the current system is passed by forAllSystems |
| 27 | + pkgs.mkShell { |
| 28 | + name = "my-dev-environment"; # Optional: give your shell a name |
11 | 29 | buildInputs = with pkgs; [
|
12 | 30 | efm-langserver
|
13 | 31 | nil
|
14 |
| - nodePackages_latest.nodejs |
| 32 | + nodePackages_latest.nodejs # Consider pinning like nodejs_20 or nodejs_latest |
15 | 33 | nodePackages_latest.typescript-language-server
|
16 | 34 | nodePackages_latest.prettier
|
17 | 35 | vscode-langservers-extracted
|
18 | 36 | nodePackages_latest.bash-language-server
|
19 | 37 | ];
|
20 |
| - }; |
21 |
| - } |
22 |
| - ); |
| 38 | + # You can add shell hooks or environment variables here too |
| 39 | + # shellHook = '' |
| 40 | + # echo "Welcome to the development shell!" |
| 41 | + # export MY_VAR="hello" |
| 42 | + # ''; |
| 43 | + } |
| 44 | + ); |
| 45 | + |
| 46 | + # Optional: flake-utils often provides `devShells` as well, |
| 47 | + # which is identical to `devShell` in this setup. |
| 48 | + # This can be useful for clarity or if some tools expect `devShells.<system>`. |
| 49 | + devShells = devShell; |
| 50 | + |
| 51 | + # If you had other outputs like packages or apps, they would go here: |
| 52 | + # packages = forAllSystems (pkgs: { |
| 53 | + # default = pkgs.hello; # Example |
| 54 | + # }); |
| 55 | + # |
| 56 | + # apps = forAllSystems (pkgs: { |
| 57 | + # default = { |
| 58 | + # type = "app"; |
| 59 | + # program = "${self.packages.${pkgs.system}.default}/bin/hello"; |
| 60 | + # }; |
| 61 | + # }); |
| 62 | + }; |
23 | 63 | }
|
0 commit comments