-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
41 lines (39 loc) · 1.19 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
{
description = "A toml editor that preserves formatting.";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
inputs.nix-github-actions.url = "github:nix-community/nix-github-actions";
inputs.nix-github-actions.inputs.nixpkgs.follows = "nixpkgs";
outputs = {
self,
nixpkgs,
nix-github-actions,
}: let
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
eachSystem = nixpkgs.lib.genAttrs systems;
rev =
if self ? rev
then "0.0.0-${builtins.substring 0 7 self.rev}"
else "0.0.0-dirty";
in {
packages = eachSystem (system: let
pkgs = nixpkgs.legacyPackages.${system};
in rec {
default = toml-editor;
toml-editor = pkgs.callPackage ./toml-editor.nix {
inherit rev;
};
devShell = pkgs.callPackage ./nix/devshell {};
fmt = pkgs.callPackage ./nix/fmt {};
});
formatter = eachSystem (system: self.packages.${system}.fmt);
checks.x86_64-linux.default = self.packages.x86_64-linux.toml-editor;
githubActions = nix-github-actions.lib.mkGithubMatrix {
checks = nixpkgs.lib.getAttrs [ "x86_64-linux" ] self.checks;
};
};
}