Skip to content

Commit 9efdb97

Browse files
committed
feat: nixify
1 parent fedcfaf commit 9efdb97

File tree

3 files changed

+106
-0
lines changed

3 files changed

+106
-0
lines changed

flake.lock

Lines changed: 59 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
description = "TinyGo";
3+
4+
inputs.flake-compat.flake = false;
5+
inputs.flake-compat.url = github:edolstra/flake-compat;
6+
inputs.flake-utils.url = github:numtide/flake-utils;
7+
inputs.nixpkgs.url = github:NixOS/nixpkgs;
8+
9+
outputs = {
10+
self,
11+
flake-utils,
12+
nixpkgs,
13+
...
14+
}:
15+
flake-utils.lib.eachDefaultSystem (
16+
system: let
17+
pkgs = import nixpkgs {
18+
inherit system;
19+
};
20+
in {
21+
formatter = pkgs.alejandra;
22+
23+
devShells.default = pkgs.mkShell {
24+
buildInputs = with pkgs; [
25+
go_1_18
26+
llvm_14
27+
llvmPackages_14.libclang
28+
python3
29+
];
30+
};
31+
}
32+
);
33+
}

shell.nix

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
let
2+
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
3+
4+
fetchInputFromGithub = name:
5+
with lock.nodes.${name}.locked;
6+
builtins.fetchTarball {
7+
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz";
8+
sha256 = narHash;
9+
};
10+
flakeCompat = fetchInputFromGithub "flake-compat";
11+
12+
flake = import flakeCompat {src = ./.;};
13+
in
14+
flake.shellNix

0 commit comments

Comments
 (0)