-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
74 lines (73 loc) · 2.49 KB
/
Copy pathflake.nix
File metadata and controls
74 lines (73 loc) · 2.49 KB
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
{
inputs = {
flakeCompat = {
url = "github:edolstra/flake-compat";
flake = false;
};
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixCargoIntegration = {
url = "github:yusdacra/nix-cargo-integration";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = inputs:
let
outputs = inputs.nixCargoIntegration.lib.makeOutputs {
root = ./.;
overrides = {
shell = common: prev: {
packages = prev.packages ++ [ common.pkgs.mold ];
env = prev.env ++ [
{
name = "XDG_DATA_DIRS";
eval = with common.pkgs; "$GSETTINGS_SCHEMAS_PATH:$XDG_DATA_DIRS:${hicolor-icon-theme}/share:${gnome3.adwaita-icon-theme}/share";
}
{
name = "RUSTFLAGS";
value = "-Clink-arg=-fuse-ld=${common.pkgs.mold}/bin/mold";
}
];
commands = prev.commands ++ [
{
name = "local-dev";
command = "SSL_CERT_FILE=~/.local/share/mkcert/rootCA.pem cargo r";
}
];
};
mainBuild = common: prev: {
nativeBuildInputs = prev.nativeBuildInputs ++ (with common.pkgs; [ makeWrapper wrapGAppsHook ]);
postInstall = with common.pkgs; ''
if [ -f $out/bin/loqui ]; then
wrapProgram $out/bin/loqui\
--set LD_LIBRARY_PATH ${lib.makeLibraryPath common.runtimeLibs}\
--set XDG_DATA_DIRS ${hicolor-icon-theme}/share:${gnome3.adwaita-icon-theme}/share
fi
'';
};
};
};
in
outputs // {
apps = outputs.apps // {
x86_64-linux = outputs.apps.x86_64-linux // {
run-latest =
let
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; config = { allowUnfree = true; }; };
cmd =
pkgs.writeScriptBin "run-loqui-latest" ''
#!${pkgs.stdenv.shell}
mkdir -p /tmp/loqui-binary
cd /tmp/loqui-binary
${pkgs.curl}/bin/curl -L https://github.com/harmony-development/Loqui/releases/download/continuous/loqui-linux > loqui
chmod +x loqui
${pkgs.steam-run}/bin/steam-run ./loqui
'';
in
{
type = "app";
program = "${cmd}/bin/run-loqui-latest";
};
};
};
};
}