-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
56 lines (51 loc) · 1.83 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{
description = "Utilities to setup an elixir project with nix";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
inputs.flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
inputs.systems.url = "github:nix-systems/default";
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
systems = inputs.self.lib.defaultSystems;
flake.lib =
let
allSystems = inputs.nixpkgs.lib.platforms.unix;
defaultGlobalSystems = import inputs.systems;
defaultSystems = inputs.nixpkgs.lib.lists.intersectLists allSystems defaultGlobalSystems;
in
import ./lib.nix inputs.nixpkgs.lib allSystems defaultSystems;
flake.templates = {
default = inputs.self.templates.simple;
simple = {
path = examples/simple;
description = "Simple elixir shell with default elixir version";
};
custom = {
path = examples/custom;
description = "Elixir shell with custom elixir version";
};
asdf = {
path = examples/asdf;
description = "Elixir shell with elixir version from .tool-versions";
};
overlay = {
path = examples/overlay;
description = "Elixir overlay and shell with custom elixir version";
};
};
flake.overlays.default = {
};
perSystem =
{ self', pkgs, ... }:
{
formatter = pkgs.nixfmt-rfc-style;
packages.updateRefs = pkgs.callPackage ./util/update_sha/default.nix { };
devShells.default = pkgs.callPackage inputs.self.lib.devShell { };
devShells.latest = pkgs.callPackage inputs.self.lib.devShell {
erlang = "27";
elixir = "1.18";
};
};
};
}