···2929 folder.enable
3030 ) cfg.settings.folders);
31313232- updateConfig = pkgs.writers.writeDash "merge-syncthing-config" ''
3232+ jq = "${pkgs.jq}/bin/jq";
3333+ updateConfig = pkgs.writers.writeBash "merge-syncthing-config" (''
3334 set -efu
34353536 # be careful not to leak secrets in the filesystem or in process listings
3636-3737 umask 0077
38383939 # get the api key by parsing the config.xml
···5151 --retry 1000 --retry-delay 1 --retry-all-errors \
5252 "$@"
5353 }
5454+ '' +
54555555- # query the old config
5656- old_cfg=$(curl ${cfg.guiAddress}/rest/config)
5757-5858- # generate the new config by merging with the NixOS config options
5959- new_cfg=$(printf '%s\n' "$old_cfg" | ${pkgs.jq}/bin/jq -c ${escapeShellArg ''. * ${builtins.toJSON cleanedConfig} * {
6060- "devices": ('${escapeShellArg (builtins.toJSON devices)}'${optionalString (cfg.settings.devices == {} || ! cfg.overrideDevices) " + .devices"}),
6161- "folders": ('${escapeShellArg (builtins.toJSON folders)}'${optionalString (cfg.settings.folders == {} || ! cfg.overrideFolders) " + .folders"})
6262- }''})
6363-6464- # send the new config
6565- curl -X PUT -d "$new_cfg" ${cfg.guiAddress}/rest/config
6666-5656+ /* Syncthing's rest API for the folders and devices is almost identical.
5757+ Hence we iterate them using lib.pipe and generate shell commands for both at
5858+ the sime time. */
5959+ (lib.pipe {
6060+ # The attributes below are the only ones that are different for devices /
6161+ # folders.
6262+ devs = {
6363+ new_conf_IDs = map (v: v.id) devices;
6464+ GET_IdAttrName = "deviceID";
6565+ override = cfg.overrideDevices;
6666+ conf = devices;
6767+ baseAddress = "${cfg.guiAddress}/rest/config/devices";
6868+ };
6969+ dirs = {
7070+ new_conf_IDs = map (v: v.id) folders;
7171+ GET_IdAttrName = "id";
7272+ override = cfg.overrideFolders;
7373+ conf = folders;
7474+ baseAddress = "${cfg.guiAddress}/rest/config/folders";
7575+ };
7676+ } [
7777+ # Now for each of these attributes, write the curl commands that are
7878+ # identical to both folders and devices.
7979+ (mapAttrs (conf_type: s:
8080+ # We iterate the `conf` list now, and run a curl -X POST command for each, that
8181+ # should update that device/folder only.
8282+ lib.pipe s.conf [
8383+ # Quoting https://docs.syncthing.net/rest/config.html:
8484+ #
8585+ # > PUT takes an array and POST a single object. In both cases if a
8686+ # given folder/device already exists, it’s replaced, otherwise a new
8787+ # one is added.
8888+ #
8989+ # What's not documented, is that using PUT will remove objects that
9090+ # don't exist in the array given. That's why we use here `POST`, and
9191+ # only if s.override == true then we DELETE the relevant folders
9292+ # afterwards.
9393+ (map (new_cfg: ''
9494+ curl -d ${lib.escapeShellArg (builtins.toJSON new_cfg)} -X POST ${s.baseAddress}
9595+ ''))
9696+ (lib.concatStringsSep "\n")
9797+ ]
9898+ /* If we need to override devices/folders, we iterate all currently configured
9999+ IDs, via another `curl -X GET`, and we delete all IDs that are not part of
100100+ the Nix configured list of IDs
101101+ */
102102+ + lib.optionalString s.override ''
103103+ old_conf_${conf_type}_ids="$(curl -X GET ${s.baseAddress} | ${jq} --raw-output '.[].${s.GET_IdAttrName}')"
104104+ for id in ''${old_conf_${conf_type}_ids}; do
105105+ if echo ${lib.concatStringsSep " " s.new_conf_IDs} | grep -q $id; then
106106+ continue
107107+ else
108108+ curl -X DELETE ${s.baseAddress}/$id
109109+ fi
110110+ done
111111+ ''
112112+ ))
113113+ builtins.attrValues
114114+ (lib.concatStringsSep "\n")
115115+ ]) +
116116+ /* Now we update the other settings defined in cleanedConfig which are not
117117+ "folders" or "devices". */
118118+ (lib.pipe cleanedConfig [
119119+ builtins.attrNames
120120+ (lib.subtractLists ["folders" "devices"])
121121+ (map (subOption: ''
122122+ curl -X PUT -d ${lib.escapeShellArg (builtins.toJSON cleanedConfig.${subOption})} \
123123+ ${cfg.guiAddress}/rest/config/${subOption}
124124+ ''))
125125+ (lib.concatStringsSep "\n")
126126+ ]) + ''
67127 # restart Syncthing if required
68128 if curl ${cfg.guiAddress}/rest/config/restart-required |
6969- ${pkgs.jq}/bin/jq -e .requiresRestart > /dev/null; then
129129+ ${jq} -e .requiresRestart > /dev/null; then
70130 curl -X POST ${cfg.guiAddress}/rest/system/restart
71131 fi
7272- '';
132132+ '');
73133in {
74134 ###### interface
75135 options = {
+1-1
pkgs/build-support/go/module.nix
···54545555 goModules = if (vendorHash == null) then "" else
5656 (stdenv.mkDerivation {
5757- name = "${name}-goModules";
5757+ name = "${name}-go-modules";
58585959 nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ go git cacert ];
6060
···3636assert lib.asserts.assertOneOf "withPrecision" withPrecision [ "single" "double" ];
37373838let
3939- options = {
4040- # Options from 'godot/SConstruct'
4141- platform = withPlatform;
4242- target = withTarget;
4343- precision = withPrecision; # Floating-point precision level
4444-4545- # Options from 'godot/platform/linuxbsd/detect.py'
4646- pulseaudio = withPulseaudio; # Use PulseAudio
4747- dbus = withDbus; # Use D-Bus to handle screensaver and portal desktop settings
4848- speechd = withSpeechd; # Use Speech Dispatcher for Text-to-Speech support
4949- fontconfig = withFontconfig; # Use fontconfig for system fonts support
5050- udev = withUdev; # Use udev for gamepad connection callbacks
5151- touch = withTouch; # Enable touch events
5252- };
3939+ mkSconsFlagsFromAttrSet = lib.mapAttrsToList (k: v:
4040+ if builtins.isString v
4141+ then "${k}=${v}"
4242+ else "${k}=${builtins.toJSON v}");
5343in
5444stdenv.mkDerivation rec {
5545 pname = "godot";
5646 version = "4.1-stable";
4747+ commitHash = "970459615f6b2b4151742ec6d7ef8559f87fd5c5";
57485849 src = fetchFromGitHub {
5950 owner = "godotengine";
6051 repo = "godot";
6161- rev = version;
5252+ rev = commitHash;
6253 hash = "sha256-v9qKrPYQz4c+xkSu/2ru7ZE5EzKVyXhmrxyHZQkng2U=";
6354 };
6455···96879788 enableParallelBuilding = true;
98899999- # Options from 'godot/SConstruct' and 'godot/platform/linuxbsd/detect.py'
100100- sconsFlags = [ "production=true" ];
9090+ # Set the build name which is part of the version. In official downloads, this
9191+ # is set to 'official'. When not specified explicitly, it is set to
9292+ # 'custom_build'. Other platforms packaging Godot (Gentoo, Arch, Flatpack
9393+ # etc.) usually set this to their name as well.
9494+ #
9595+ # See also 'methods.py' in the Godot repo and 'build' in
9696+ # https://docs.godotengine.org/en/stable/classes/class_engine.html#class-engine-method-get-version-info
9797+ BUILD_NAME = "nixpkgs";
9898+9999+ # Required for the commit hash to be included in the version number.
100100+ #
101101+ # `methods.py` reads the commit hash from `.git/HEAD` and manually follows
102102+ # refs. Since we just write the hash directly, there is no need to emulate any
103103+ # other parts of the .git directory.
104104+ #
105105+ # See also 'hash' in
106106+ # https://docs.godotengine.org/en/stable/classes/class_engine.html#class-engine-method-get-version-info
101107 preConfigure = ''
102102- sconsFlags+=" ${
103103- lib.concatStringsSep " "
104104- (lib.mapAttrsToList (k: v: "${k}=${builtins.toJSON v}") options)
105105- }"
108108+ mkdir -p .git
109109+ echo ${commitHash} > .git/HEAD
106110 '';
111111+112112+ sconsFlags = mkSconsFlagsFromAttrSet {
113113+ # Options from 'SConstruct'
114114+ production = true; # Set defaults to build Godot for use in production
115115+ platform = withPlatform;
116116+ target = withTarget;
117117+ precision = withPrecision; # Floating-point precision level
118118+119119+ # Options from 'platform/linuxbsd/detect.py'
120120+ pulseaudio = withPulseaudio; # Use PulseAudio
121121+ dbus = withDbus; # Use D-Bus to handle screensaver and portal desktop settings
122122+ speechd = withSpeechd; # Use Speech Dispatcher for Text-to-Speech support
123123+ fontconfig = withFontconfig; # Use fontconfig for system fonts support
124124+ udev = withUdev; # Use udev for gamepad connection callbacks
125125+ touch = withTouch; # Enable touch events
126126+ };
107127108128 outputs = [ "out" "man" ];
109129
+2-2
pkgs/os-specific/linux/kernel/linux-5.15.nix
···33with lib;
4455buildLinux (args // rec {
66- version = "5.15.120";
66+ version = "5.15.121";
7788 # modDirVersion needs to be x.y.z, will automatically add .0 if needed
99 modDirVersion = versions.pad 3 version;
···13131414 src = fetchurl {
1515 url = "mirror://kernel/linux/kernel/v5.x/linux-${version}.tar.xz";
1616- sha256 = "1xl3nrykbxdwv5a9rk0xnb7l61dsyjvkm1ryrdii09vbmsg0i6b4";
1616+ sha256 = "07f3a68r1yb4p19z1azjwp2vhjb3ayh31hz9hfb4a98dn2ywxq07";
1717 };
1818} // (args.argsOverride or { }))
+2-2
pkgs/os-specific/linux/kernel/linux-6.1.nix
···33with lib;
4455buildLinux (args // rec {
66- version = "6.1.39";
66+ version = "6.1.40";
7788 # modDirVersion needs to be x.y.z, will automatically add .0 if needed
99 modDirVersion = versions.pad 3 version;
···13131414 src = fetchurl {
1515 url = "mirror://kernel/linux/kernel/v6.x/linux-${version}.tar.xz";
1616- sha256 = "1f45j3ch1ljbacjlg8q45iva9lvwys938rdg0s516mznzlifxpac";
1616+ sha256 = "1w474pia4pxz4qbfai27ary1y1h2fnn7kvx7yz7wszd0jwhzrsj3";
1717 };
1818} // (args.argsOverride or { }))
+2-2
pkgs/os-specific/linux/kernel/linux-6.4.nix
···33with lib;
4455buildLinux (args // rec {
66- version = "6.4.4";
66+ version = "6.4.5";
7788 # modDirVersion needs to be x.y.z, will automatically add .0 if needed
99 modDirVersion = versions.pad 3 version;
···13131414 src = fetchurl {
1515 url = "mirror://kernel/linux/kernel/v6.x/linux-${version}.tar.xz";
1616- sha256 = "0apzfnn04w6jda9yw5cbgj8784frvqrryb1iw5ad390lwwmlmg4w";
1616+ sha256 = "1dz9inr1bf7jx5s9n0dfa0srfzrwnz1zmdq42bbxyl9w8q3jqkip";
1717 };
1818} // (args.argsOverride or { }))
···11+--- a/tests/test_helper.py
22++++ b/tests/test_helper.py
33+@@ -269,9 +269,9 @@
44+ print("subprocess:", " ".join(cmd)) # very useful on failure
55+ env = {
66+ # We may need to find nanoemoji and other pip-installed cli tools
77+- "PATH": str(Path(shutil.which("nanoemoji")).parent),
88++ "PATH": str(Path(shutil.which("nanoemoji")).parent) + ":" + os.environ["PATH"],
99+ # We may need to find test modules
1010+- "PYTHONPATH": os.pathsep.join((str(Path(__file__).parent),)),
1111++ "PYTHONPATH": os.pathsep.join((str(Path(__file__).parent),)) + ":" + os.environ["PYTHONPATH"],
1212+ }
1313+ # Needed for windows CI to function; ref https://github.com/appveyor/ci/issues/1995
1414+ if "SYSTEMROOT" in os.environ: