Skip to content

Commit 35a1d10

Browse files
committedNov 20, 2024·
Setup flake.nix using gomod2nix
1 parent c70e4ec commit 35a1d10

7 files changed

+297
-43
lines changed
 

‎.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,6 @@ devenv.local.nix
3131

3232
# pre-commit
3333
.pre-commit-config.yaml
34+
35+
# Nix
36+
result

‎devenv.lock

+66-38
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,6 @@
1616
"type": "github"
1717
}
1818
},
19-
"fenix": {
20-
"inputs": {
21-
"nixpkgs": [
22-
"nixpkgs"
23-
],
24-
"rust-analyzer-src": "rust-analyzer-src"
25-
},
26-
"locked": {
27-
"lastModified": 1730270567,
28-
"owner": "nix-community",
29-
"repo": "fenix",
30-
"rev": "6535bb2a77a3bec73cc5b2d2ff63da8a479e32bd",
31-
"type": "github"
32-
},
33-
"original": {
34-
"owner": "nix-community",
35-
"repo": "fenix",
36-
"type": "github"
37-
}
38-
},
3919
"flake-compat": {
4020
"flake": false,
4121
"locked": {
@@ -51,6 +31,23 @@
5131
"type": "github"
5232
}
5333
},
34+
"flake-utils": {
35+
"inputs": {
36+
"systems": "systems"
37+
},
38+
"locked": {
39+
"lastModified": 1731533236,
40+
"owner": "numtide",
41+
"repo": "flake-utils",
42+
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
43+
"type": "github"
44+
},
45+
"original": {
46+
"owner": "numtide",
47+
"repo": "flake-utils",
48+
"type": "github"
49+
}
50+
},
5451
"gitignore": {
5552
"inputs": {
5653
"nixpkgs": [
@@ -71,18 +68,36 @@
7168
"type": "github"
7269
}
7370
},
71+
"gomod2nix": {
72+
"inputs": {
73+
"flake-utils": "flake-utils",
74+
"nixpkgs": "nixpkgs"
75+
},
76+
"locked": {
77+
"lastModified": 1729448365,
78+
"owner": "nix-community",
79+
"repo": "gomod2nix",
80+
"rev": "5d387097aa716f35dd99d848dc26d8d5b62a104c",
81+
"type": "github"
82+
},
83+
"original": {
84+
"owner": "nix-community",
85+
"repo": "gomod2nix",
86+
"type": "github"
87+
}
88+
},
7489
"nixpkgs": {
7590
"locked": {
76-
"lastModified": 1716977621,
77-
"owner": "cachix",
78-
"repo": "devenv-nixpkgs",
79-
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
91+
"lastModified": 1732082877,
92+
"owner": "NixOS",
93+
"repo": "nixpkgs",
94+
"rev": "d0df7756dfb54b29f32ba622c28e6528242e8e6d",
8095
"type": "github"
8196
},
8297
"original": {
83-
"owner": "cachix",
84-
"ref": "rolling",
85-
"repo": "devenv-nixpkgs",
98+
"owner": "NixOS",
99+
"ref": "master",
100+
"repo": "nixpkgs",
86101
"type": "github"
87102
}
88103
},
@@ -101,6 +116,21 @@
101116
"type": "github"
102117
}
103118
},
119+
"nixpkgs_2": {
120+
"locked": {
121+
"lastModified": 1716977621,
122+
"owner": "cachix",
123+
"repo": "devenv-nixpkgs",
124+
"rev": "4267e705586473d3e5c8d50299e71503f16a6fb6",
125+
"type": "github"
126+
},
127+
"original": {
128+
"owner": "cachix",
129+
"ref": "rolling",
130+
"repo": "devenv-nixpkgs",
131+
"type": "github"
132+
}
133+
},
104134
"pre-commit-hooks": {
105135
"inputs": {
106136
"flake-compat": "flake-compat",
@@ -126,24 +156,22 @@
126156
"root": {
127157
"inputs": {
128158
"devenv": "devenv",
129-
"fenix": "fenix",
130-
"nixpkgs": "nixpkgs",
159+
"gomod2nix": "gomod2nix",
160+
"nixpkgs": "nixpkgs_2",
131161
"pre-commit-hooks": "pre-commit-hooks"
132162
}
133163
},
134-
"rust-analyzer-src": {
135-
"flake": false,
164+
"systems": {
136165
"locked": {
137-
"lastModified": 1730315096,
138-
"owner": "rust-lang",
139-
"repo": "rust-analyzer",
140-
"rev": "8244f30eff828355f5ec92b2307c216d10caa25b",
166+
"lastModified": 1681028828,
167+
"owner": "nix-systems",
168+
"repo": "default",
169+
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
141170
"type": "github"
142171
},
143172
"original": {
144-
"owner": "rust-lang",
145-
"ref": "nightly",
146-
"repo": "rust-analyzer",
173+
"owner": "nix-systems",
174+
"repo": "default",
147175
"type": "github"
148176
}
149177
}

‎devenv.nix

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
pkgs.aws-vault
66
pkgs.awscli2
77
pkgs.cobra-cli
8+
pkgs.gomod2nix
89
pkgs.ssm-session-manager-plugin
910
];
1011

‎devenv.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
2+
13
inputs:
24
nixpkgs:
35
url: github:cachix/devenv-nixpkgs/rolling
4-
fenix:
5-
url: github:nix-community/fenix
6-
inputs:
7-
nixpkgs:
8-
follows: nixpkgs
6+
gomod2nix:
7+
url: github:nix-community/gomod2nix
8+
overlays:
9+
- default

‎flake.lock

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

‎flake.nix

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
description = "Interactive CLI for ECS";
3+
4+
inputs = {
5+
flake-utils.url = "github:numtide/flake-utils";
6+
gomod2nix.url = "github:nix-community/gomod2nix";
7+
gomod2nix.inputs.flake-utils.follows = "flake-utils";
8+
gomod2nix.inputs.nixpkgs.follows = "nixpkgs";
9+
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
10+
};
11+
12+
outputs = { flake-utils, gomod2nix, nixpkgs, ... }:
13+
flake-utils.lib.eachDefaultSystem (system:
14+
let
15+
pkgs = import nixpkgs {
16+
inherit system;
17+
overlays = [
18+
gomod2nix.overlays.default
19+
];
20+
};
21+
in
22+
{
23+
packages.default = pkgs.buildGoApplication {
24+
pname = "iecs";
25+
version = "0.1.0";
26+
src = ./.;
27+
modules = ./gomod2nix.toml;
28+
};
29+
}
30+
);
31+
}

‎gomod2nix.toml

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
schema = 3
2+
3+
[mod]
4+
[mod."atomicgo.dev/cursor"]
5+
version = "v0.2.0"
6+
hash = "sha256-ukCb15fSgbkkYdzYY7dIq+HQqZvlpR5MytK20bwtSDc="
7+
[mod."atomicgo.dev/keyboard"]
8+
version = "v0.2.9"
9+
hash = "sha256-TqZY8yzAs9vEVR9dSi8yxBUIKPB875B2jl8fFGXQsCs="
10+
[mod."atomicgo.dev/schedule"]
11+
version = "v0.1.0"
12+
hash = "sha256-dBu76Ez+1S+koYL8KITrT/iEUN4U+8mk3BI/JZOr+Y8="
13+
[mod."github.com/aws/aws-sdk-go-v2"]
14+
version = "v1.32.4"
15+
hash = "sha256-mGONd4wmBmM69NFuxAINHcHzb8M9dRo49Zv2iJFZGhw="
16+
[mod."github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream"]
17+
version = "v1.6.6"
18+
hash = "sha256-MS6ptFmzCteXGCSWI3rxiLOgSVxwzJHw/jGAaU1L0tw="
19+
[mod."github.com/aws/aws-sdk-go-v2/config"]
20+
version = "v1.28.1"
21+
hash = "sha256-ofYaPOpi1CbEJBLa7OL5AIZP9Tebddet4BwvozMDGqE="
22+
[mod."github.com/aws/aws-sdk-go-v2/credentials"]
23+
version = "v1.17.42"
24+
hash = "sha256-5/SBK/2cW3Nsg1lwLtQFIIoVpZXkR2WKq7fDgvaMTNc="
25+
[mod."github.com/aws/aws-sdk-go-v2/feature/ec2/imds"]
26+
version = "v1.16.18"
27+
hash = "sha256-YYEQzgcnxSP5pmRvfbdQ6Jio2EvFSkxeYsq8YeCGgeE="
28+
[mod."github.com/aws/aws-sdk-go-v2/internal/configsources"]
29+
version = "v1.3.23"
30+
hash = "sha256-OCOH5LeaRyzLo/0n1pILGix/QKzj8vM7U1A/oU/0gj8="
31+
[mod."github.com/aws/aws-sdk-go-v2/internal/endpoints/v2"]
32+
version = "v2.6.23"
33+
hash = "sha256-ndWnFojsHWtZhaAT1Wy18+0z80MSuL3Pil9HWWKPpMM="
34+
[mod."github.com/aws/aws-sdk-go-v2/internal/ini"]
35+
version = "v1.8.1"
36+
hash = "sha256-xinXoaSTaE4p/Li9h3nE8t7Y0uM6OFX/qkS+sCHQtp4="
37+
[mod."github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs"]
38+
version = "v1.43.0"
39+
hash = "sha256-AY8cCOgJ7D2IxuuLbo6uNKYhWeFvML2dG9NCAI6SJ2g="
40+
[mod."github.com/aws/aws-sdk-go-v2/service/ecs"]
41+
version = "v1.49.0"
42+
hash = "sha256-nUUkFdeUpJ0N2Ehyb8yexyDoWACyRxHpsWFxeQwWQZk="
43+
[mod."github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding"]
44+
version = "v1.12.0"
45+
hash = "sha256-ARkJfcecbLOyQhdQHsp8NA408L5/wLxEyVtC+Mh676Y="
46+
[mod."github.com/aws/aws-sdk-go-v2/service/internal/presigned-url"]
47+
version = "v1.12.3"
48+
hash = "sha256-Xk++VAqIhxr2PQYqcM+rhLpeXB8Q7UAo7CZVV7Zcwsg="
49+
[mod."github.com/aws/aws-sdk-go-v2/service/ssm"]
50+
version = "v1.55.5"
51+
hash = "sha256-zYUbAC91wDeQ8yOwTGcv2Ac41QXrlk+J0+brB0SVQuw="
52+
[mod."github.com/aws/aws-sdk-go-v2/service/sso"]
53+
version = "v1.24.3"
54+
hash = "sha256-LAhY2PktkFFYYiPwaec/q5BWTv1UUWpQVRyHxBfK1z4="
55+
[mod."github.com/aws/aws-sdk-go-v2/service/ssooidc"]
56+
version = "v1.28.3"
57+
hash = "sha256-NbSGL9Zb8RFYloUXCfRIf0JKiTchTZclW+pFkSotJP4="
58+
[mod."github.com/aws/aws-sdk-go-v2/service/sts"]
59+
version = "v1.32.3"
60+
hash = "sha256-H4Ew6RuU/6Sb56BlWGBr1mOaTK7FO6jWMqvbwjO+yww="
61+
[mod."github.com/aws/smithy-go"]
62+
version = "v1.22.0"
63+
hash = "sha256-dowFXJpYD5fpUNDJMZvIQzjN8qc9ppqw7j8wrQdfK/U="
64+
[mod."github.com/containerd/console"]
65+
version = "v1.0.3"
66+
hash = "sha256-4p4u/rS7G4KKbIcZaVMqE1OtSoNlOpmcYFwO0ZEH/V0="
67+
[mod."github.com/gookit/color"]
68+
version = "v1.5.4"
69+
hash = "sha256-6Xydefyslup+qohzatAdezGWrS065X5mx18wvRef3Rk="
70+
[mod."github.com/inconshreveable/mousetrap"]
71+
version = "v1.1.0"
72+
hash = "sha256-XWlYH0c8IcxAwQTnIi6WYqq44nOKUylSWxWO/vi+8pE="
73+
[mod."github.com/jmespath/go-jmespath"]
74+
version = "v0.4.0"
75+
hash = "sha256-xpT9g2qIXmPq7eeHUXHiDqJeQoHCudh44G/KCSFbcuo="
76+
[mod."github.com/lithammer/fuzzysearch"]
77+
version = "v1.1.8"
78+
hash = "sha256-aMMRcrlUc9CBiiNkcnWWn4hfNMNyVhrAt67kvP4D4Do="
79+
[mod."github.com/mattn/go-runewidth"]
80+
version = "v0.0.15"
81+
hash = "sha256-WP39EU2UrQbByYfnwrkBDoKN7xzXsBssDq3pNryBGm0="
82+
[mod."github.com/pterm/pterm"]
83+
version = "v0.12.79"
84+
hash = "sha256-c+cuXa9qS4bQ7lsvYHA6bBLwE7n3j6g3yiglwbgnbHc="
85+
[mod."github.com/rivo/uniseg"]
86+
version = "v0.4.4"
87+
hash = "sha256-B8tbL9K6ICLdm0lEhs9+h4cpjAfvFtNiFMGvQZmw0bM="
88+
[mod."github.com/spf13/cobra"]
89+
version = "v1.8.1"
90+
hash = "sha256-yDF6yAHycV1IZOrt3/hofR+QINe+B2yqkcIaVov3Ky8="
91+
[mod."github.com/spf13/pflag"]
92+
version = "v1.0.5"
93+
hash = "sha256-w9LLYzxxP74WHT4ouBspH/iQZXjuAh2WQCHsuvyEjAw="
94+
[mod."github.com/xo/terminfo"]
95+
version = "v0.0.0-20220910002029-abceb7e1c41e"
96+
hash = "sha256-GyCDxxMQhXA3Pi/TsWXpA8cX5akEoZV7CFx4RO3rARU="
97+
[mod."golang.org/x/sys"]
98+
version = "v0.16.0"
99+
hash = "sha256-ZkGclbp2S7NQYhbuGji6XokCn2Qi1BJy8dwyAOTV8sY="
100+
[mod."golang.org/x/term"]
101+
version = "v0.16.0"
102+
hash = "sha256-9qlHcsCI1sa7ZI4Q+fJbOp3mG5Y+uV16e+pGmG+MQe0="
103+
[mod."golang.org/x/text"]
104+
version = "v0.14.0"
105+
hash = "sha256-yh3B0tom1RfzQBf1RNmfdNWF1PtiqxV41jW1GVS6JAg="

0 commit comments

Comments
 (0)
Please sign in to comment.