-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
105 lines (94 loc) · 3.16 KB
/
flake.nix
File metadata and controls
105 lines (94 loc) · 3.16 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
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
{
description = "Flake for FallGuys-CMSTool";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, ... }:
let
# For future purposes
systems = [ "x86_64-linux" ];
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
pkgsFor = system: import nixpkgs { inherit system; };
in
{
packages = forAllSystems (system:
let
pkgs = pkgsFor system;
in
{
default = pkgs.buildDotnetModule rec {
name = "FallGuys-CMSTool";
version =
let
# Someone help me to figure out the way to get the version normally or make dotnet see .git directory
projectVersion = (builtins.elemAt (builtins.match ".*<Version>([a-zA-Z0-9._-]+)</Version>.*" (builtins.readFile "${self}/${projectFile}")) 0);
in
"${projectVersion}+${self.rev or self.dirtyRev or "unknown"}";
nativeBuildInputs = with pkgs; [
copyDesktopItems
];
src = ./.;
projectFile = "CMSTool/FallGuys-CMSTool.csproj";
dotnet-sdk = pkgs.dotnetCorePackages.sdk_8_0;
dotnet-runtime = pkgs.dotnetCorePackages.runtime_8_0;
nugetDeps = ./deps.json;
executables = [ "CMSTool" ];
buildType = "Release-Linux-x64";
selfContainedBuild = true;
dotnetFlags = [ "-p:PublishSingleFile=true" "-p:PublishTrimmed=true" ];
desktopItems = [
(pkgs.makeDesktopItem {
name = "CMSTool";
desktopName = "CMSTool";
comment = "An easy to use tool to decrypt and encrypt Fall Guys content files.";
exec = "CMSTool";
icon = "cmstool";
categories = [ "Utility" ];
terminal = false;
})
];
fixupPhase = ''
runHook preFixup
for size in 16x16 32x32 48x48 64x64 128x128 256x256 512x512; do
install -D "$src/CMSTool/Assets/icons/avalonia-logo-$size.png" "$out/share/icons/hicolor/$size/apps/cmstool.png"
done
runHook postFixup
'';
};
});
apps = forAllSystems (system: {
default = {
type = "app";
program = "${self.packages.${system}.default}/bin/CMSTool";
};
});
devShells = forAllSystems (system:
let
pkgs = pkgsFor system;
in
{
default = pkgs.mkShell {
packages = with pkgs; [
dotnetCorePackages.sdk_8_0
nuget-to-json
xorg.libX11
xorg.libICE
xorg.libSM
fontconfig
];
shellHook = ''
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [
pkgs.fontconfig
pkgs.xorg.libX11
pkgs.xorg.libICE
pkgs.xorg.libSM
]}:$LD_LIBRARY_PATH
'';
};
});
};
}