···182 # Menu configuration
183 #
184000185 insmod gfxterm
186 insmod png
187 set gfxpayload=keep
0000000000000188189 # Fonts can be loaded?
190 # (This font is assumed to always be provided as a fallback by NixOS)
191- if loadfont /EFI/boot/unicode.pf2; then
192 set with_fonts=true
193 fi
194 if [ "\$textmode" != "true" -a "\$with_fonts" == "true" ]; then
···212 ${ # When there is a theme configured, use it, otherwise use the background image.
213 if config.isoImage.grubTheme != null then ''
214 # Sets theme.
215- set theme=/EFI/boot/grub-theme/theme.txt
216 # Load theme fonts
217- $(find ${config.isoImage.grubTheme} -iname '*.pf2' -printf "loadfont /EFI/boot/grub-theme/%P\n")
218 '' else ''
219- if background_image /EFI/boot/efi-background.png; then
220 # Black background means transparent background when there
221 # is a background image set... This seems undocumented :(
222 set color_normal=black/black
···238 strictDeps = true;
239 } ''
240 mkdir -p $out/EFI/boot/
000241242 # ALWAYS required modules.
243 MODULES="fat iso9660 part_gpt part_msdos \
···294 ${grubMenuCfg}
295296 hiddenentry 'Text mode' --hotkey 't' {
297- loadfont /EFI/boot/unicode.pf2
298 set textmode=true
299 terminal_output gfxterm console
300 }
301 hiddenentry 'GUI mode' --hotkey 'g' {
302- $(find ${config.isoImage.grubTheme} -iname '*.pf2' -printf "loadfont /EFI/boot/grub-theme/%P\n")
303 set textmode=false
304 terminal_output gfxterm
305 }
···370 ${lib.optionalString (refindBinary != null) ''
371 # GRUB apparently cannot do "chainloader" operations on "CD".
372 if [ "\$root" != "cd0" ]; then
000373 menuentry 'rEFInd' --class refind {
374- # \$root defaults to the drive the EFI is found on.
375 chainloader (\$root)/EFI/boot/${refindBinary}
376 }
377 fi
···403 mkdir ./boot
404 cp -p "${config.boot.kernelPackages.kernel}/${config.system.boot.loader.kernelFile}" \
405 "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}" ./boot/
406- touch --date=@0 ./EFI ./boot
00407408 usage_size=$(du -sb --apparent-size . | tr -cd '[:digit:]')
409 # Make the image 110% as big as the files need to make up for FAT overhead
···182 # Menu configuration
183 #
184185+ # Search using a "marker file"
186+ search --set=root --file /EFI/nixos-installer-image
187+188 insmod gfxterm
189 insmod png
190 set gfxpayload=keep
191+ set gfxmode=${concatStringsSep "," [
192+ # GRUB will use the first valid mode listed here.
193+ # `auto` will sometimes choose the smallest valid mode it detects.
194+ # So instead we'll list a lot of possibly valid modes :/
195+ #"3840x2160"
196+ #"2560x1440"
197+ "1920x1080"
198+ "1366x768"
199+ "1280x720"
200+ "1024x768"
201+ "800x600"
202+ "auto"
203+ ]}
204205 # Fonts can be loaded?
206 # (This font is assumed to always be provided as a fallback by NixOS)
207+ if loadfont (\$root)/EFI/boot/unicode.pf2; then
208 set with_fonts=true
209 fi
210 if [ "\$textmode" != "true" -a "\$with_fonts" == "true" ]; then
···228 ${ # When there is a theme configured, use it, otherwise use the background image.
229 if config.isoImage.grubTheme != null then ''
230 # Sets theme.
231+ set theme=(\$root)/EFI/boot/grub-theme/theme.txt
232 # Load theme fonts
233+ $(find ${config.isoImage.grubTheme} -iname '*.pf2' -printf "loadfont (\$root)/EFI/boot/grub-theme/%P\n")
234 '' else ''
235+ if background_image (\$root)/EFI/boot/efi-background.png; then
236 # Black background means transparent background when there
237 # is a background image set... This seems undocumented :(
238 set color_normal=black/black
···254 strictDeps = true;
255 } ''
256 mkdir -p $out/EFI/boot/
257+258+ # Add a marker so GRUB can find the filesystem.
259+ touch $out/EFI/nixos-installer-image
260261 # ALWAYS required modules.
262 MODULES="fat iso9660 part_gpt part_msdos \
···313 ${grubMenuCfg}
314315 hiddenentry 'Text mode' --hotkey 't' {
316+ loadfont (\$root)/EFI/boot/unicode.pf2
317 set textmode=true
318 terminal_output gfxterm console
319 }
320 hiddenentry 'GUI mode' --hotkey 'g' {
321+ $(find ${config.isoImage.grubTheme} -iname '*.pf2' -printf "loadfont (\$root)/EFI/boot/grub-theme/%P\n")
322 set textmode=false
323 terminal_output gfxterm
324 }
···389 ${lib.optionalString (refindBinary != null) ''
390 # GRUB apparently cannot do "chainloader" operations on "CD".
391 if [ "\$root" != "cd0" ]; then
392+ # Force root to be the FAT partition
393+ # Otherwise it breaks rEFInd's boot
394+ search --set=root --no-floppy --fs-uuid 1234-5678
395 menuentry 'rEFInd' --class refind {
0396 chainloader (\$root)/EFI/boot/${refindBinary}
397 }
398 fi
···424 mkdir ./boot
425 cp -p "${config.boot.kernelPackages.kernel}/${config.system.boot.loader.kernelFile}" \
426 "${config.system.build.initialRamdisk}/${config.system.boot.loader.initrdFile}" ./boot/
427+428+ # Rewrite dates for everything in the FS
429+ find . -exec touch --date=2000-01-01 {} +
430431 usage_size=$(du -sb --apparent-size . | tr -cd '[:digit:]')
432 # Make the image 110% as big as the files need to make up for FAT overhead
-21
pkgs/applications/editors/sublime/3/common.nix
···23{ fetchurl, lib, stdenv, xorg, glib, glibcLocales, gtk3, cairo, pango, libredirect, makeWrapper, wrapGAppsHook
4, pkexecPath ? "/run/wrappers/bin/pkexec"
5-, writeScript, common-updater-scripts, curl, gnugrep
6, openssl, bzip2, bash, unzip, zip
7}:
8···125 size=$(basename $directory)
126 mkdir -p "$out/share/icons/hicolor/$size/apps"
127 ln -s ''$${primaryBinary}/Icon/$size/* $out/share/icons/hicolor/$size/apps
128- done
129- '';
130-131- passthru.updateScript = writeScript "${pname}-update-script" ''
132- #!${stdenv.shell}
133- set -o errexit
134- PATH=${lib.makeBinPath [ common-updater-scripts curl gnugrep ]}
135-136- latestVersion=$(curl -s ${versionUrl})
137-138- if [[ "${buildVersion}" = "$latestVersion" ]]; then
139- echo "The new version same as the old version."
140- exit 0
141- fi
142-143- for platform in ${lib.concatStringsSep " " meta.platforms}; do
144- # The script will not perform an update when the version attribute is up to date from previous platform run
145- # We need to clear it before each run
146- update-source-version ${packageAttribute}.${primaryBinary} 0 0000000000000000000000000000000000000000000000000000000000000000 --file=${versionFile} --version-key=buildVersion --system=$platform
147- update-source-version ${packageAttribute}.${primaryBinary} $latestVersion --file=${versionFile} --version-key=buildVersion --system=$platform
148 done
149 '';
150