|
1 | 1 | { |
2 | 2 | lib, |
3 | 3 | stdenv, |
| 4 | + stdenvAdapters, |
4 | 5 | fetchFromGitHub, |
5 | 6 | rustPlatform, |
6 | 7 | cmake, |
|
18 | 19 | cosmic-randr, |
19 | 20 | xkeyboard_config, |
20 | 21 | nix-update-script, |
| 22 | + |
| 23 | + withMoldLinker ? stdenv.targetPlatform.isLinux, |
21 | 24 | }: |
22 | 25 | let |
23 | 26 | libcosmicAppHook' = (libcosmicAppHook.__spliced.buildHost or libcosmicAppHook).override { |
24 | 27 | includeSettings = false; |
25 | 28 | }; |
26 | 29 | in |
27 | | -rustPlatform.buildRustPackage rec { |
28 | | - pname = "cosmic-settings"; |
29 | | - version = "1.0.0-alpha.6"; |
| 30 | +rustPlatform.buildRustPackage.override |
| 31 | + { stdenv = if withMoldLinker then stdenvAdapters.useMoldLinker stdenv else stdenv; } |
| 32 | + rec { |
| 33 | + pname = "cosmic-settings"; |
| 34 | + version = "1.0.0-alpha.6"; |
30 | 35 |
|
31 | | - src = fetchFromGitHub { |
32 | | - owner = "pop-os"; |
33 | | - repo = "cosmic-settings"; |
34 | | - tag = "epoch-${version}"; |
35 | | - hash = "sha256-UKg3TIpyaqtynk6wLFFPpv69F74hmqfMVPra2+iFbvE="; |
36 | | - }; |
| 36 | + src = fetchFromGitHub { |
| 37 | + owner = "pop-os"; |
| 38 | + repo = "cosmic-settings"; |
| 39 | + tag = "epoch-${version}"; |
| 40 | + hash = "sha256-UKg3TIpyaqtynk6wLFFPpv69F74hmqfMVPra2+iFbvE="; |
| 41 | + }; |
37 | 42 |
|
38 | | - useFetchCargoVendor = true; |
39 | | - cargoHash = "sha256-mf/Cw3/RLrCYgsk7JKCU2+oPn1VPbD+4JzkUmbd47m8="; |
| 43 | + useFetchCargoVendor = true; |
| 44 | + cargoHash = "sha256-mf/Cw3/RLrCYgsk7JKCU2+oPn1VPbD+4JzkUmbd47m8="; |
40 | 45 |
|
41 | | - nativeBuildInputs = [ |
42 | | - cmake |
43 | | - just |
44 | | - libcosmicAppHook' |
45 | | - pkg-config |
46 | | - rustPlatform.bindgenHook |
47 | | - util-linux |
48 | | - ]; |
| 46 | + nativeBuildInputs = [ |
| 47 | + cmake |
| 48 | + just |
| 49 | + libcosmicAppHook' |
| 50 | + pkg-config |
| 51 | + rustPlatform.bindgenHook |
| 52 | + util-linux |
| 53 | + ]; |
| 54 | + |
| 55 | + buildInputs = [ |
| 56 | + expat |
| 57 | + fontconfig |
| 58 | + freetype |
| 59 | + libinput |
| 60 | + pipewire |
| 61 | + pulseaudio |
| 62 | + udev |
| 63 | + ]; |
49 | 64 |
|
50 | | - buildInputs = [ |
51 | | - expat |
52 | | - fontconfig |
53 | | - freetype |
54 | | - libinput |
55 | | - pipewire |
56 | | - pulseaudio |
57 | | - udev |
58 | | - ]; |
| 65 | + dontUseJustBuild = true; |
| 66 | + dontUseJustCheck = true; |
59 | 67 |
|
60 | | - dontUseJustBuild = true; |
61 | | - dontUseJustCheck = true; |
| 68 | + justFlags = [ |
| 69 | + "--set" |
| 70 | + "prefix" |
| 71 | + (placeholder "out") |
| 72 | + "--set" |
| 73 | + "bin-src" |
| 74 | + "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-settings" |
| 75 | + ]; |
62 | 76 |
|
63 | | - justFlags = [ |
64 | | - "--set" |
65 | | - "prefix" |
66 | | - (placeholder "out") |
67 | | - "--set" |
68 | | - "bin-src" |
69 | | - "target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/cosmic-settings" |
70 | | - ]; |
| 77 | + env."CARGO_TARGET_${stdenv.hostPlatform.rust.cargoEnvVarTarget}_RUSTFLAGS" = |
| 78 | + lib.optionalString withMoldLinker "-C link-arg=-fuse-ld=mold"; |
71 | 79 |
|
72 | | - preFixup = '' |
73 | | - libcosmicAppWrapperArgs+=( |
74 | | - --prefix PATH : ${lib.makeBinPath [ cosmic-randr ]} |
75 | | - --set-default X11_BASE_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/base.xml |
76 | | - --set-default X11_BASE_EXTRA_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/extra.xml |
77 | | - ) |
78 | | - ''; |
| 80 | + preFixup = '' |
| 81 | + libcosmicAppWrapperArgs+=( |
| 82 | + --prefix PATH : ${lib.makeBinPath [ cosmic-randr ]} |
| 83 | + --set-default X11_BASE_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/base.xml |
| 84 | + --set-default X11_BASE_EXTRA_RULES_XML ${xkeyboard_config}/share/X11/xkb/rules/extra.xml |
| 85 | + ) |
| 86 | + ''; |
79 | 87 |
|
80 | | - passthru.updateScript = nix-update-script { |
81 | | - extraArgs = [ |
82 | | - "--version" |
83 | | - "unstable" |
84 | | - "--version-regex" |
85 | | - "epoch-(.*)" |
86 | | - ]; |
87 | | - }; |
| 88 | + passthru.updateScript = nix-update-script { |
| 89 | + extraArgs = [ |
| 90 | + "--version" |
| 91 | + "unstable" |
| 92 | + "--version-regex" |
| 93 | + "epoch-(.*)" |
| 94 | + ]; |
| 95 | + }; |
88 | 96 |
|
89 | | - meta = { |
90 | | - description = "Settings for the COSMIC Desktop Environment"; |
91 | | - homepage = "https://github.com/pop-os/cosmic-settings"; |
92 | | - license = lib.licenses.gpl3Only; |
93 | | - mainProgram = "cosmic-settings"; |
94 | | - maintainers = with lib.maintainers; [ |
95 | | - nyabinary |
96 | | - HeitorAugustoLN |
97 | | - ]; |
98 | | - platforms = lib.platforms.linux; |
99 | | - }; |
100 | | -} |
| 97 | + meta = { |
| 98 | + description = "Settings for the COSMIC Desktop Environment"; |
| 99 | + homepage = "https://github.com/pop-os/cosmic-settings"; |
| 100 | + license = lib.licenses.gpl3Only; |
| 101 | + mainProgram = "cosmic-settings"; |
| 102 | + maintainers = with lib.maintainers; [ |
| 103 | + nyabinary |
| 104 | + HeitorAugustoLN |
| 105 | + ]; |
| 106 | + platforms = lib.platforms.linux; |
| 107 | + }; |
| 108 | + } |
0 commit comments