forked from AaronErhardt/tuxedo-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
108 lines (97 loc) · 2.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
description = "Rust libraries for interacting with hardware from TUXEDO Computers";
nixConfig = {
extra-substituters = "https://tuxedo-rs.cachix.org";
extra-trusted-public-keys = "tuxedo-rs.cachix.org-1:blECq3BtB0X84VUHZAxvSJx3esqsuRdm59j2PCaOZ4I=";
};
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = {
self,
nixpkgs,
pre-commit-hooks,
flake-utils,
...
}: let
supportedSystems = [
"x86_64-linux"
];
overlay = import ./nix/overlay.nix {inherit self nixpkgs;};
in
flake-utils.lib.eachSystem supportedSystems (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [
overlay
];
};
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
alejandra.enable = true;
rustfmt.enable = true;
};
};
devShell = pkgs.mkShell {
name = "tuxedo-rs-devShell";
buildInputs =
(with pkgs;
with pkgs.rustPlatform; [
cargo
rustc
meson
ninja
libadwaita
gtk4
pkg-config
desktop-file-utils
appstream-glib
])
++ (with pre-commit-hooks.packages.${system}; [
alejandra
rustfmt
]);
shellHook = ''
${self.checks.${system}.formatting.shellHook}
'';
};
in {
devShells = {
default = devShell;
inherit devShell;
};
packages = rec {
default = tuxedo-rs;
inherit
(pkgs)
tuxedo-rs
tailor-gui
;
};
checks = {
formatting = pre-commit-check;
inherit
(pkgs)
tuxedo-rs
tailor-gui
;
};
})
// {
overlays.default = overlay;
nixosModules.default = {...}: {
imports = [
./nix/module.nix
];
nixpkgs.overlays = [
overlay
];
};
};
}