forked from TagStudioDev/TagStudio
-
Notifications
You must be signed in to change notification settings - Fork 3
/
flake.nix
135 lines (113 loc) · 3.77 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{
inputs = {
devenv.url = "github:cachix/devenv";
devenv-root = {
url = "file+file:///dev/null";
flake = false;
};
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
inputs.nixpkgs-lib.follows = "nixpkgs";
};
nix2container = {
url = "github:nlewo/nix2container";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default-linux";
};
outputs =
{ flake-parts, nixpkgs, ... }@inputs:
let
inherit (nixpkgs) lib;
in
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ inputs.devenv.flakeModule ];
systems = import inputs.systems;
perSystem =
{ pkgs, ... }:
{
devenv.shells = rec {
default = tagstudio-rusted;
tagstudio-rusted = {
devenv.root =
let
devenvRoot = builtins.readFile inputs.devenv-root.outPath;
in
# If not overriden (/dev/null), --impure is necessary.
lib.mkIf (devenvRoot != "") devenvRoot;
name = "TagStudioRusted";
packages = with pkgs; [
cargo-deny
cargo-edit
cargo-expand
cargo-msrv
cargo-udeps
libsoup_3
openssl
pkg-config
webkitgtk_4_1
(cargo-tauri.overrideAttrs (o: rec {
version = "2.0.0-rc.11";
src = fetchFromGitHub {
owner = "tauri-apps";
repo = "tauri";
rev = "tauri-v${version}";
hash = "sha256-7usmUaAK9HIjrBvq+wquAlI5KuAQA/VFhDp6trxvDAQ=";
};
# tests::run_app fails with permission denied.
doCheck = false;
sourceRoot = null;
cargoDeps = pkgs.rustPlatform.importCargoLock {
lockFile = src + /Cargo.lock;
outputHashes = {
"schemars_derive-0.8.21" = "sha256-AmxBKZXm2Eb+w8/hLQWTol5f22uP8UqaIh+LVLbS20g=";
};
};
/*
cargoDeps = o.cargoDeps.overrideAttrs (_: {
inherit src sourceRoot;
name = "cargo-tauri-${version}-vendor.tar.gz";
outputHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
});
*/
buildInputs = builtins.map (
pkg: if pkg == pkgs.webkitgtk then pkgs.webkitgtk_4_1 else pkg
) o.buildInputs;
}))
];
languages = {
javascript = {
enable = true;
pnpm = {
enable = true;
install.enable = true;
};
};
nix.enable = true;
rust = {
enable = true;
channel = "stable";
};
};
pre-commit = {
hooks = {
clippy.enable = true;
deadnix.enable = true;
flake-checker.enable = true;
nixfmt-rfc-style.enable = true;
rustfmt.enable = true;
statix.enable = true;
};
settings.rust.cargoManifestPath = "src-tauri/Cargo.toml";
};
};
};
formatter = pkgs.nixfmt-rfc-style;
};
};
}