Skip to content

Commit 71471d9

Browse files
committed
stop using flake-utils
1 parent e0e5826 commit 71471d9

File tree

1 file changed

+61
-52
lines changed

1 file changed

+61
-52
lines changed

flake.nix

Lines changed: 61 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,72 @@
11
{
22
inputs = {
33
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; # Or your preferred channel
4-
# flake-utils is no longer an input
54
};
65

7-
outputs = inputs @ { self, nixpkgs, ... }: let
6+
outputs =
7+
inputs@{ self, nixpkgs, ... }:
8+
let
89

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-
}));
10+
forAllSystems =
11+
function:
12+
nixpkgs.lib.genAttrs
13+
[
14+
"x86_64-linux"
15+
"aarch64-linux"
16+
"x86_64-darwin"
17+
"aarch64-darwin"
18+
]
19+
(
20+
system:
21+
function (
22+
import nixpkgs {
23+
inherit system;
24+
# overlays = [ ... ]; # You can add overlays here if needed
25+
# config = { ... }; # Or pkgs configuration
26+
}
27+
)
28+
);
2029

21-
in rec { # 'rec' allows self-reference if needed, e.g., devShells = devShell;
30+
in
31+
rec {
32+
# 'rec' allows self-reference if needed, e.g., devShells = devShell;
2233

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
29-
buildInputs = with pkgs; [
30-
efm-langserver
31-
nil
32-
nodePackages_latest.nodejs # Consider pinning like nodejs_20 or nodejs_latest
33-
nodePackages_latest.typescript-language-server
34-
nodePackages_latest.prettier
35-
vscode-langservers-extracted
36-
nodePackages_latest.bash-language-server
37-
];
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-
);
34+
# This will create devShell.x86_64-linux, devShell.aarch64-linux, etc.
35+
# `nix develop` on a supported system (e.g., x86_64-linux) will pick up
36+
# devShell.x86_64-linux automatically.
37+
devShell = forAllSystems (
38+
pkgs:
39+
pkgs.mkShell {
40+
name = "my-dev-environment";
41+
buildInputs = with pkgs; [
42+
efm-langserver
43+
nil
44+
nodejs_latest
45+
nodePackages_latest.typescript-language-server
46+
nodePackages_latest.prettier
47+
vscode-langservers-extracted
48+
nodePackages_latest.bash-language-server
49+
];
50+
# You can add shell hooks or environment variables here too
51+
# shellHook = ''
52+
# echo "Welcome to the development shell!"
53+
# export MY_VAR="hello"
54+
# '';
55+
}
56+
);
4557

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;
58+
devShells = devShell;
5059

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-
};
60+
# If you had other outputs like packages or apps, they would go here:
61+
# packages = forAllSystems (pkgs: {
62+
# default = pkgs.hello; # Example
63+
# });
64+
#
65+
# apps = forAllSystems (pkgs: {
66+
# default = {
67+
# type = "app";
68+
# program = "${self.packages.${pkgs.system}.default}/bin/hello";
69+
# };
70+
# });
71+
};
6372
}

0 commit comments

Comments
 (0)