Skip to content

Commit 9dc02e9

Browse files
committed
Add empty template and make various updates
1 parent 7e19222 commit 9dc02e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+323
-292
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Once your preferred template has been initialized, you can use the provided shel
3535
| [Dhall] | [`dhall`](./dhall/) |
3636
| [Elixir] | [`elixir`](./elixir/) |
3737
| [Elm] | [`elm`](./elm/) |
38+
| Empty (change at will) | [`empty`](./empty) |
3839
| [Gleam] | [`gleam`](./gleam/) |
3940
| [Go] | [`go`](./go/) |
4041
| [Hashicorp] tools | [`hashi`](./hashi/) |
@@ -103,6 +104,10 @@ The sections below list what each template includes. In all cases, you're free t
103104
- [Elm] 0.19.1
104105
- [elm2nix]
105106

107+
### [Empty](./empty/)
108+
109+
A dev template that's fully customizable.
110+
106111
### [`gleam`](./gleam/)
107112

108113
- [Gleam] 0.30.0

clojure/flake.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

csharp/flake.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cue/flake.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dhall/flake.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

elixir/flake.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

elixir/flake.nix

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@
1515
default = pkgs.mkShell {
1616
packages = (with pkgs; [ elixir ]) ++
1717
# Linux only
18-
pkgs.lib.optionals (pkgs.stdenv.isLinux) (with pkgs; [ gigalixir inotify-tools libnotify ]) ++
18+
(pkgs.lib.optionals (pkgs.stdenv.isLinux)
19+
(with pkgs; [ gigalixir inotify-tools libnotify ])) ++
1920
# macOS only
20-
pkgs.lib.optionals (pkgs.stdenv.isDarwin) (with pkgs; [ terminal-notifier ]) ++
21-
(with pkgs.darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices ]);
21+
pkgs.lib.optionals (pkgs.stdenv.isDarwin)
22+
((with pkgs; [ terminal-notifier ]) ++
23+
(with pkgs.darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices ]));
2224
};
2325
});
2426
};

elm/flake.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

empty/flake.lock

+25
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

empty/flake.nix

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
description = "An empty flake template that you can adapt to your own environment";
3+
4+
# Flake inputs
5+
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
6+
7+
# Flake outputs
8+
outputs = { self, nixpkgs }:
9+
let
10+
# The systems supported for this flake
11+
supportedSystems = [
12+
"x86_64-linux" # 64-bit Intel/AMD Linux
13+
"aarch64-linux" # 64-bit ARM Linux
14+
"x86_64-darwin" # 64-bit Intel macOS
15+
"aarch64-darwin" # 64-bit ARM macOS
16+
];
17+
18+
# Helper to provide system-specific attributes
19+
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
20+
pkgs = import nixpkgs { inherit system; };
21+
});
22+
in
23+
{
24+
devShells = forEachSupportedSystem ({ pkgs }: {
25+
default = pkgs.mkShell {
26+
# The Nix packages provided in the environment
27+
# Add any you need here
28+
packages = with pkgs; [ ];
29+
30+
# Set any environment variables for your dev shell
31+
env = { };
32+
33+
# Add any shell logic you want executed any time the environment is activated
34+
shellHook = ''
35+
'';
36+
};
37+
});
38+
};
39+
}

flake.nix

+19-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
format = prev.writeScriptBin "format" ''
1515
${exec "nixpkgs-fmt"} **/*.nix
1616
'';
17+
1718
dvt = prev.writeScriptBin "dvt" ''
1819
if [ -z $1 ]; then
1920
echo "no template specified"
@@ -28,14 +29,25 @@
2829
--template \
2930
"github:the-nix-way/dev-templates#''${TEMPLATE}"
3031
'';
32+
3133
update = prev.writeScriptBin "update" ''
3234
for dir in `ls -d */`; do # Iterate through all the templates
3335
(
3436
cd $dir
35-
${exec "nix"} flake update # Update flake.lock
36-
${exec "nix"} flake check # Make sure things work after the update
37+
38+
echo "updating ''${dir}"
39+
40+
# Update flake.lock
41+
nix flake update
42+
43+
echo "checking ''${dir}"
44+
45+
# Make sure things work after the update
46+
nix flake check --all-systems --no-build
3747
)
3848
done
49+
50+
3951
'';
4052
})
4153
];
@@ -91,6 +103,11 @@
91103
description = "Elm development environment";
92104
};
93105

106+
empty = {
107+
path = ./empty;
108+
description = "Empty dev template that you can customize at will";
109+
};
110+
94111
gleam = {
95112
path = ./gleam;
96113
description = "Gleam development environment";

gleam/flake.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/flake.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

go/flake.nix

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
description = "A Nix-flake-based Go 1.17 development environment";
2+
description = "A Nix-flake-based Go 1.22 development environment";
33

44
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
55

66
outputs = { self, nixpkgs }:
77
let
8-
goVersion = 20; # Change this to update the whole stack
8+
goVersion = 22; # Change this to update the whole stack
99
overlays = [ (final: prev: { go = prev."go_1_${toString goVersion}"; }) ];
1010
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
1111
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
@@ -16,8 +16,8 @@
1616
devShells = forEachSupportedSystem ({ pkgs }: {
1717
default = pkgs.mkShell {
1818
packages = with pkgs; [
19-
# go 1.20 (specified by overlay)
20-
go
19+
# go 1.22 (specified by overlay)
20+
go_1_22
2121

2222
# goimports, godoc, etc.
2323
gotools

hashi/flake.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

haskell/flake.lock

+5-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

haxe/flake.lock

+8-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

haxe/flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
description = "A Nix-flake-based Haxe development environment";
33

4-
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4+
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
55

66
outputs =
77
{ self

0 commit comments

Comments
 (0)