-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
44 lines (39 loc) · 1.26 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
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
treefmt-nix.url = "github:numtide/treefmt-nix";
};
outputs =
{
self,
systems,
nixpkgs,
treefmt-nix,
...
}:
let
inherit (nixpkgs) lib;
eachSystem = f: lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
treefmtEval = eachSystem (pkgs: treefmt-nix.lib.evalModule pkgs ./treefmt.nix);
in
{
devShells = eachSystem (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
gopls
wails
];
# Fixes a fontsize bug, see https://wails.io/docs/next/guides/nixos-font
shellHook = with pkgs; ''
export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS;
export GIO_MODULE_DIR="${pkgs.glib-networking}/lib/gio/modules/";
'';
};
});
formatter = eachSystem (pkgs: treefmtEval.${pkgs.system}.config.build.wrapper);
checks = eachSystem (pkgs: {
formatting = treefmtEval.${pkgs.system}.config.build.check self;
});
};
}