···161161162162`buildNpmPackage` allows you to package npm-based projects in Nixpkgs without the use of an auto-generated dependencies file (as used in [node2nix](#javascript-node2nix)). It works by utilizing npm's cache functionality -- creating a reproducible cache that contains the dependencies of a project, and pointing npm to it.
163163164164+Here's an example:
165165+164166```nix
165167{ lib, buildNpmPackage, fetchFromGitHub }:
166168···190192 };
191193}
192194```
195195+196196+In the default `installPhase` set by `buildNpmPackage`, it uses `npm pack --json --dry-run` to decide what files to install in `$out/lib/node_modules/$name/`, where `$name` is the `name` string defined in the package's `package.json`. Additionally, the `bin` and `man` keys in the source's `package.json` are used to decide what binaries and manpages are supposed to be installed. If these are not defined, `npm pack` may miss some files, and no binaries will be produced.
193197194198#### Arguments {#javascript-buildNpmPackage-arguments}
195199···204208* `npmBuildFlags`: Flags to pass to `npm run ${npmBuildScript}`.
205209* `npmPackFlags`: Flags to pass to `npm pack`.
206210* `npmPruneFlags`: Flags to pass to `npm prune`. Defaults to the value of `npmInstallFlags`.
211211+* `makeWrapperArgs`: Flags to pass to `makeWrapper`, added to executable calling the generated `.js` with `node` as an interpreter. These scripts are defined in `package.json`.
207212208213#### prefetch-npm-deps {#javascript-buildNpmPackage-prefetch-npm-deps}
209214210210-`prefetch-npm-deps` can calculate the hash of the dependencies of an npm project ahead of time.
215215+`prefetch-npm-deps` is a Nixpkgs package that calculates the hash of the dependencies of an npm project ahead of time.
211216212217```console
213218$ ls
···216221...
217222sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
218223```
224224+225225+#### fetchNpmDeps {#javascript-buildNpmPackage-fetchNpmDeps}
226226+227227+`fetchNpmDeps` is a Nix function that requires the following mandatory arguments:
228228+229229+- `src`: A directory / tarball with `package-lock.json` file
230230+- `hash`: The output hash of the node dependencies defined in `package-lock.json`.
231231+232232+It returns a derivation with all `package-lock.json` dependencies downloaded into `$out/`, usable as an npm cache.
219233220234### corepack {#javascript-corepack}
221235
···118118119119- `pass` now does not contain `password-store.el`. Users should get `password-store.el` from Emacs lisp package set `emacs.pkgs.password-store`.
120120121121-- `services.knot` now supports `.settings` from RFC42. The change is not 100% compatible with the previous `.extraConfig`.
121121+- `services.knot` now supports `.settings` from RFC42. The previous `.extraConfig` still works the same, but it displays a warning now.
122122123123- `mu` now does not install `mu4e` files by default. Users should get `mu4e` from Emacs lisp package set `emacs.pkgs.mu4e`.
124124
+10-6
nixos/modules/services/networking/knot.nix
···103103 in result;
104104105105 configFile = if cfg.settingsFile != null then
106106- assert cfg.settings == {} && cfg.keyFiles == [];
106106+ # Note: with extraConfig, the 23.05 compat code did include keyFiles from settingsFile.
107107+ assert cfg.settings == {} && (cfg.keyFiles == [] || cfg.extraConfig != null);
107108 cfg.settingsFile
108108- else pkgs.writeTextFile {
109109+ else
110110+ mkConfigFile yamlConfig;
111111+112112+ mkConfigFile = configString: pkgs.writeTextFile {
109113 name = "knot.conf";
110110- text = (concatMapStringsSep "\n" (file: "include: ${file}") cfg.keyFiles) + "\n" + yamlConfig;
114114+ text = (concatMapStringsSep "\n" (file: "include: ${file}") cfg.keyFiles) + "\n" + configString;
111115 # TODO: maybe we could do some checks even when private keys complicate this?
112116 checkPhase = lib.optionalString (cfg.keyFiles == []) ''
113117 ${cfg.package}/bin/knotc --config=$out conf-check
···174178 description = lib.mdDoc ''
175179 As alternative to ``settings``, you can provide whole configuration
176180 directly in the almost-YAML format of Knot DNS.
177177- You might want to utilize ``writeTextFile`` for this.
181181+ You might want to utilize ``pkgs.writeText "knot.conf" "longConfigString"`` for this.
178182 '';
179183 };
180184···189193 };
190194 };
191195 imports = [
192192- # Compatibility with NixOS 23.05. At least partial, as it fails assert if used with keyFiles.
196196+ # Compatibility with NixOS 23.05.
193197 (mkChangedOptionModule [ "services" "knot" "extraConfig" ] [ "services" "knot" "settingsFile" ]
194194- (config: pkgs.writeText "knot.conf" config.services.knot.extraConfig)
198198+ (config: mkConfigFile config.services.knot.extraConfig)
195199 )
196200 ];
197201
+7-7
nixos/modules/services/networking/syncthing.nix
···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
103103+ stale_${conf_type}_ids="$(curl -X GET ${s.baseAddress} | ${jq} \
104104+ --argjson new_ids ${lib.escapeShellArg (builtins.toJSON s.new_conf_IDs)} \
105105+ --raw-output \
106106+ '[.[].${s.GET_IdAttrName}] - $new_ids | .[]'
107107+ )"
108108+ for id in ''${stale_${conf_type}_ids}; do
109109+ curl -X DELETE ${s.baseAddress}/$id
110110 done
111111 ''
112112 ))
···11-{ lib
22-, stdenv
33-, fetchurl
44-, fetchFromGitHub
55-, cmake
66-, pkg-config
77-# See https://files.ettus.com/manual_archive/v3.15.0.0/html/page_build_guide.html for dependencies explanations
88-, boost
99-, enableLibuhd_C_api ? true
1010-# requires numpy
1111-, enableLibuhd_Python_api ? false
1212-, python3
1313-, enableExamples ? false
1414-, enableUtils ? false
1515-, enableLiberio ? false
1616-, liberio
1717-, libusb1
1818-, enableDpdk ? false
1919-, dpdk
2020-# Devices
2121-, enableOctoClock ? true
2222-, enableMpmd ? true
2323-, enableB100 ? true
2424-, enableB200 ? true
2525-, enableUsrp1 ? true
2626-, enableUsrp2 ? true
2727-, enableX300 ? true
2828-, enableN230 ? true
2929-, enableN300 ? true
3030-, enableN320 ? true
3131-, enableE300 ? true
3232-, enableE320 ? true
3333-}:
3434-3535-let
3636- onOffBool = b: if b then "ON" else "OFF";
3737- inherit (lib) optionals;
3838-in
3939-4040-stdenv.mkDerivation rec {
4141- pname = "uhd";
4242- # UHD seems to use three different version number styles: x.y.z, xxx_yyy_zzz
4343- # and xxx.yyy.zzz. Hrmpf... style keeps changing
4444- version = "3.15.0.0";
4545-4646- src = fetchFromGitHub {
4747- owner = "EttusResearch";
4848- repo = "uhd";
4949- rev = "v${version}";
5050- sha256 = "0jknln88a69fh244670nb7qrflbyv0vvdxfddb5g8ncpb6hcg8qf";
5151- };
5252- # Firmware images are downloaded (pre-built) from the respective release on Github
5353- uhdImagesSrc = fetchurl {
5454- url = "https://github.com/EttusResearch/uhd/releases/download/v${version}/uhd-images_${version}.tar.xz";
5555- sha256 = "1fir1a13ac07mqhm4sr34cixiqj2difxq0870qv1wr7a7cbfw6vp";
5656- };
5757-5858- cmakeFlags = [
5959- "-DENABLE_LIBUHD=ON"
6060- "-DENABLE_USB=ON"
6161- "-DENABLE_TESTS=ON" # This installs tests as well so we delete them via postPhases
6262- "-DENABLE_EXAMPLES=${onOffBool enableExamples}"
6363- "-DENABLE_UTILS=${onOffBool enableUtils}"
6464- "-DENABLE_LIBUHD_C_API=${onOffBool enableLibuhd_C_api}"
6565- "-DENABLE_LIBUHD_PYTHON_API=${onOffBool enableLibuhd_Python_api}"
6666- "-DENABLE_LIBERIO=${onOffBool enableLiberio}"
6767- "-DENABLE_DPDK=${onOffBool enableDpdk}"
6868- # Devices
6969- "-DENABLE_OCTOCLOCK=${onOffBool enableOctoClock}"
7070- "-DENABLE_MPMD=${onOffBool enableMpmd}"
7171- "-DENABLE_B100=${onOffBool enableB100}"
7272- "-DENABLE_B200=${onOffBool enableB200}"
7373- "-DENABLE_USRP1=${onOffBool enableUsrp1}"
7474- "-DENABLE_USRP2=${onOffBool enableUsrp2}"
7575- "-DENABLE_X300=${onOffBool enableX300}"
7676- "-DENABLE_N230=${onOffBool enableN230}"
7777- "-DENABLE_N300=${onOffBool enableN300}"
7878- "-DENABLE_N320=${onOffBool enableN320}"
7979- "-DENABLE_E300=${onOffBool enableE300}"
8080- "-DENABLE_E320=${onOffBool enableE320}"
8181- ]
8282- # TODO: Check if this still needed
8383- # ABI differences GCC 7.1
8484- # /nix/store/wd6r25miqbk9ia53pp669gn4wrg9n9cj-gcc-7.3.0/include/c++/7.3.0/bits/vector.tcc:394:7: note: parameter passing for argument of type 'std::vector<uhd::range_t>::iterator {aka __gnu_cxx::__normal_iterator<uhd::range_t*, std::vector<uhd::range_t> >}' changed in GCC 7.1
8585- ++ [ (lib.optionalString stdenv.isAarch32 "-DCMAKE_CXX_FLAGS=-Wno-psabi") ]
8686- ;
8787-8888- # Python + mako are always required for the build itself but not necessary for runtime.
8989- pythonEnv = python3.withPackages (ps: with ps; [ mako ]
9090- ++ optionals (enableLibuhd_Python_api) [ numpy setuptools ]
9191- ++ optionals (enableUtils) [ requests six ]
9292- );
9393-9494- nativeBuildInputs = [
9595- cmake
9696- pkg-config
9797- ]
9898- # If both enableLibuhd_Python_api and enableUtils are off, we don't need
9999- # pythonEnv in buildInputs as it's a 'build' dependency and not a runtime
100100- # dependency
101101- ++ optionals (!enableLibuhd_Python_api && !enableUtils) [ pythonEnv ]
102102- ;
103103- buildInputs = [
104104- boost
105105- libusb1
106106- ]
107107- # However, if enableLibuhd_Python_api *or* enableUtils is on, we need
108108- # pythonEnv for runtime as well. The utilities' runtime dependencies are
109109- # handled at the environment
110110- ++ optionals (enableLibuhd_Python_api || enableUtils) [ pythonEnv ]
111111- ++ optionals (enableLiberio) [ liberio ]
112112- ++ optionals (enableDpdk) [ dpdk ]
113113- ;
114114-115115- doCheck = true;
116116-117117- # Build only the host software
118118- preConfigure = "cd host";
119119- # TODO: Check if this still needed, perhaps relevant:
120120- # https://files.ettus.com/manual_archive/v3.15.0.0/html/page_build_guide.html#build_instructions_unix_arm
121121- patches = if stdenv.isAarch32 then ./neon.patch else null;
122122-123123- postPhases = [ "installFirmware" "removeInstalledTests" ]
124124- ++ optionals (enableUtils) [ "moveUdevRules" ]
125125- ;
126126-127127- # UHD expects images in `$CMAKE_INSTALL_PREFIX/share/uhd/images`
128128- installFirmware = ''
129129- mkdir -p "$out/share/uhd/images"
130130- tar --strip-components=1 -xvf "${uhdImagesSrc}" -C "$out/share/uhd/images"
131131- '';
132132-133133- # -DENABLE_TESTS=ON installs the tests, we don't need them in the output
134134- removeInstalledTests = ''
135135- rm -r $out/lib/uhd/tests
136136- '';
137137-138138- # Moves the udev rules to the standard location, needed only if utils are
139139- # enabled
140140- moveUdevRules = ''
141141- mkdir -p $out/lib/udev/rules.d
142142- mv $out/lib/uhd/utils/uhd-usrp.rules $out/lib/udev/rules.d/
143143- '';
144144-145145- meta = with lib; {
146146- broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
147147- description = "USRP Hardware Driver (for Software Defined Radio)";
148148- longDescription = ''
149149- The USRP Hardware Driver (UHD) software is the hardware driver for all
150150- USRP (Universal Software Radio Peripheral) devices.
151151-152152- USRP devices are designed and sold by Ettus Research, LLC and its parent
153153- company, National Instruments.
154154- '';
155155- homepage = "https://uhd.ettus.com/";
156156- license = licenses.gpl3Plus;
157157- platforms = platforms.linux ++ platforms.darwin;
158158- maintainers = with maintainers; [ bjornfor fpletz tomberek ];
159159- };
160160-}
+12-2
pkgs/applications/radio/uhd/default.nix
···88, boost
99, ncurses
1010, enableCApi ? true
1111-# requires numpy
1111+# Although we handle the Python API's dependencies in pythonEnvArg, this
1212+# feature is currently disabled as upstream attempts to run `python setup.py
1313+# install` by itself, and it fails because the Python's environment's prefix is
1414+# not a writable directly. Adding support for this feature would require using
1515+# python's pypa/build nad pypa/install hooks directly, and currently it is hard
1616+# to do that because it all happens after a long buildPhase of the C API.
1217, enablePythonApi ? false
1318, python3
1419, buildPackages
1520, enableExamples ? false
1616-, enableUtils ? false
2121+, enableUtils ? true
1722, libusb1
2323+# Disable dpdk for now due to compilation issues.
1824, enableDpdk ? false
1925, dpdk
2026# Devices
···143149 mkdir -p $out/lib/udev/rules.d
144150 mv $out/lib/uhd/utils/uhd-usrp.rules $out/lib/udev/rules.d/
145151 '';
152152+153153+ disallowedReferences = optionals (!enablePythonApi && !enableUtils) [
154154+ python3
155155+ ];
146156147157 meta = with lib; {
148158 description = "USRP Hardware Driver (for Software Defined Radio)";
···2222 # The websites yt-dlp deals with are a very moving target. That means that
2323 # downloads break constantly. Because of that, updates should always be backported
2424 # to the latest stable release.
2525- version = "2023.9.24";
2525+ version = "2023.10.7";
26262727 src = fetchPypi {
2828 inherit pname version;
2929- sha256 = "sha256-z8+1/8EgE7auS4x6KDp+RimI8bSSg94pHei/vgU7gHM=";
2929+ hash = "sha256-/IZlepskDPZf7z/2J+Sg3jNeclk2/nDUQCxx3ZdFLzY=";
3030 };
31313232 propagatedBuildInputs = [
+6-4
pkgs/tools/networking/termscp/default.nix
···99, Cocoa
1010, Foundation
1111, Security
1212+, samba
1213}:
13141415rustPlatform.buildRustPackage rec {
1516 pname = "termscp";
1616- version = "0.11.2";
1717+ version = "0.12.2";
17181819 src = fetchFromGitHub {
1920 owner = "veeso";
2021 repo = pname;
2122 rev = "refs/tags/v${version}";
2222- hash = "sha256-bQvoTy48eYK369Ei6B8l6F5/pfQGYiHdz3KsQV7Bi9Y=";
2323+ hash = "sha256-2EoCBz98RKynrYdcxiHySy7e07XU+loRLPaRCoVxySY=";
2324 };
24252525- cargoHash = "sha256-/nadstDHzLOrimL+xK7/ldOozz7ZS1nRQmkIhGHK8p8=";
2626+ cargoHash = "sha256-tXTVb5ogrBrK9aMC8LZLLZazMx8pO4Xa+hociUS9mRI=";
26272728 nativeBuildInputs = [
2829 pkg-config
···3132 buildInputs = [
3233 dbus
3334 openssl
3535+ samba
3436 ] ++ lib.optionals stdenv.isDarwin [
3537 AppKit
3638 Cocoa
···4951 doCheck = false;
50525153 meta = with lib; {
5252- description = "Terminal tool for file transfer and explorer";
5454+ description = "A feature rich terminal UI file transfer and explorer with support for SCP/SFTP/FTP/S3/SMB";
5355 homepage = "https://github.com/veeso/termscp";
5456 changelog = "https://github.com/veeso/termscp/blob/v${version}/CHANGELOG.md";
5557 license = with licenses; [ mit ];