···428428 # Rewrite dates for everything in the FS
429429 find . -exec touch --date=2000-01-01 {} +
430430431431- usage_size=$(du -sb --apparent-size . | tr -cd '[:digit:]')
431431+ # Round up to the nearest multiple of 1MB, for more deterministic du output
432432+ usage_size=$(( $(du -s --block-size=1M --apparent-size . | tr -cd '[:digit:]') * 1024 * 1024 ))
432433 # Make the image 110% as big as the files need to make up for FAT overhead
433434 image_size=$(( ($usage_size * 110) / 100 ))
434435 # Make the image fit blocks of 1M
···438439 echo "Image size: $image_size"
439440 truncate --size=$image_size "$out"
440441 faketime "2000-01-01 00:00:00" mkfs.vfat -i 12345678 -n EFIBOOT "$out"
441441- mcopy -psvm -i "$out" ./EFI ./boot ::
442442+443443+ # Force a fixed order in mcopy for better determinism, and avoid file globbing
444444+ for d in $(find EFI boot -type d | sort); do
445445+ faketime "2000-01-01 00:00:00" mmd -i "$out" "::/$d"
446446+ done
447447+448448+ for f in $(find EFI boot -type f | sort); do
449449+ mcopy -pvm -i "$out" "$f" "::/$f"
450450+ done
451451+442452 # Verify the FAT partition.
443453 fsck.vfat -vn "$out"
444454 ''; # */
···11+{ config, pkgs, lib, ... }:
22+with lib;
33+{
44+ options.programs.kdeconnect = {
55+ enable = mkEnableOption ''
66+ kdeconnect.
77+88+ Note that it will open the TCP and UDP port from
99+ 1714 to 1764 as they are needed for it to function properly.
1010+ You can use the <option>package</option> to use
1111+ <code>gnomeExtensions.gsconnect</code> as an alternative
1212+ implementation if you use Gnome.
1313+ '';
1414+ package = mkOption {
1515+ default = pkgs.kdeconnect;
1616+ defaultText = "pkgs.kdeconnect";
1717+ type = types.package;
1818+ example = literalExample "pkgs.gnomeExtensions.gsconnect";
1919+ description = ''
2020+ The package providing the implementation for kdeconnect.
2121+ '';
2222+ };
2323+ };
2424+ config =
2525+ let
2626+ cfg = config.programs.kdeconnect;
2727+ in
2828+ mkIf cfg.enable {
2929+ environment.systemPackages = [ cfg.package ];
3030+ networking.firewall = rec {
3131+ allowedTCPPortRanges = [ { from = 1714; to = 1764; } ];
3232+ allowedUDPPortRanges = allowedTCPPortRanges;
3333+ };
3434+ };
3535+}
···11+--- a/run.sh 2021-06-24 22:30:20.764897745 +0900
22++++ b/run.sh 2021-06-24 22:29:47.211210142 +0900
33+@@ -1,12 +1,6 @@
44+ #!/usr/bin/env bash
55+66+-SOURCE="${BASH_SOURCE[0]}"
77+-while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
88+- DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
99+- SOURCE="$(readlink "$SOURCE")"
1010+- [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
1111+-done
1212+-cd "$( cd -P "$( dirname "$SOURCE" )" && pwd )"
1313++cd @out@/protege
1414+1515+ java -Xmx500M -Xms200M \
1616+ -Xss16M \