···83 release based on GTK+3 and Python 3.
84 </para>
85 </listitem>
0000000000086 </itemizedlist>
87 </section>
88 <section xml:id="sec-release-22.05-notable-changes">
89 <title>Other Notable Changes</title>
90- <itemizedlist spacing="compact">
91 <listitem>
92 <para>
93 The option
···111 are only accessible by default to the members of the Unix
112 group <literal>redis-${serverName}</literal> through the Unix
113 socket <literal>/run/redis-${serverName}/redis.sock</literal>.
0000000000114 </para>
115 </listitem>
116 </itemizedlist>
···83 release based on GTK+3 and Python 3.
84 </para>
85 </listitem>
86+ <listitem>
87+ <para>
88+ The <literal>writers.writePython2</literal> and corresponding
89+ <literal>writers.writePython2Bin</literal> convenience
90+ functions to create executable Python 2 scripts in the store
91+ were removed in preparation of removal of the Python 2
92+ interpreter. Scripts have to be converted to Python 3 for use
93+ with <literal>writers.writePython3</literal> or
94+ <literal>writers.writePyPy2</literal> needs to be used.
95+ </para>
96+ </listitem>
97 </itemizedlist>
98 </section>
99 <section xml:id="sec-release-22.05-notable-changes">
100 <title>Other Notable Changes</title>
101+ <itemizedlist>
102 <listitem>
103 <para>
104 The option
···122 are only accessible by default to the members of the Unix
123 group <literal>redis-${serverName}</literal> through the Unix
124 socket <literal>/run/redis-${serverName}/redis.sock</literal>.
125+ </para>
126+ </listitem>
127+ <listitem>
128+ <para>
129+ The
130+ <literal>writers.writePyPy2</literal>/<literal>writers.writePyPy3</literal>
131+ and corresponding
132+ <literal>writers.writePyPy2Bin</literal>/<literal>writers.writePyPy3Bin</literal>
133+ convenience functions to create executable Python 2/3 scripts
134+ using the PyPy interpreter were added.
135 </para>
136 </listitem>
137 </itemizedlist>
+5
nixos/doc/manual/release-notes/rl-2205.section.md
···34- `pkgs.claws-mail-gtk2`, representing Claws Mail's older release version three, was removed in order to get rid of Python 2.
35 Please switch to `claws-mail`, which is Claws Mail's latest release based on GTK+3 and Python 3.
3600037## Other Notable Changes {#sec-release-22.05-notable-changes}
3839- The option [services.redis.servers](#opt-services.redis.servers) was added
···51 are only accessible by default
52 to the members of the Unix group `redis-${serverName}`
53 through the Unix socket `/run/redis-${serverName}/redis.sock`.
00
···34- `pkgs.claws-mail-gtk2`, representing Claws Mail's older release version three, was removed in order to get rid of Python 2.
35 Please switch to `claws-mail`, which is Claws Mail's latest release based on GTK+3 and Python 3.
3637+- The `writers.writePython2` and corresponding `writers.writePython2Bin` convenience functions to create executable Python 2 scripts in the store were removed in preparation of removal of the Python 2 interpreter.
38+ Scripts have to be converted to Python 3 for use with `writers.writePython3` or `writers.writePyPy2` needs to be used.
39+40## Other Notable Changes {#sec-release-22.05-notable-changes}
4142- The option [services.redis.servers](#opt-services.redis.servers) was added
···54 are only accessible by default
55 to the members of the Unix group `redis-${serverName}`
56 through the Unix socket `/run/redis-${serverName}/redis.sock`.
57+58+- The `writers.writePyPy2`/`writers.writePyPy3` and corresponding `writers.writePyPy2Bin`/`writers.writePyPy3Bin` convenience functions to create executable Python 2/3 scripts using the PyPy interpreter were added.
+35
pkgs/build-support/writers/aliases.nix
···00000000000000000000000000000000000
···1+lib: prev:
2+3+let
4+ # Removing recurseForDerivation prevents derivations of aliased attribute
5+ # set to appear while listing all the packages available.
6+ removeRecurseForDerivations = alias: with lib;
7+ if alias.recurseForDerivations or false then
8+ removeAttrs alias ["recurseForDerivations"]
9+ else alias;
10+11+ # Disabling distribution prevents top-level aliases for non-recursed package
12+ # sets from building on Hydra.
13+ removeDistribute = alias: with lib;
14+ if isDerivation alias then
15+ dontDistribute alias
16+ else alias;
17+18+ # Make sure that we are not shadowing something from
19+ # writers.
20+ checkInPkgs = n: alias: if builtins.hasAttr n prev
21+ then throw "Alias ${n} is still in writers"
22+ else alias;
23+24+ mapAliases = aliases:
25+ lib.mapAttrs (n: alias: removeDistribute
26+ (removeRecurseForDerivations
27+ (checkInPkgs n alias)))
28+ aliases;
29+30+in
31+mapAliases ({
32+ /* Cleanup before 22.05, Added 2021-12-11 */
33+ writePython2 = "Python 2 is EOL and the use of writers.writePython2 is deprecated.";
34+ writePython2Bin = "Python 2 is EOL and the use of writers.writePython2Bin is deprecated.";
35+})
+33-10
pkgs/build-support/writers/default.nix
···1-{ pkgs, buildPackages, lib, stdenv, libiconv, gawk, gnused, gixy }:
23-with lib;
4-rec {
005 # Base implementation for non-compiled executables.
6 # Takes an interpreter, for example `${pkgs.bash}/bin/bash`
7 #
···245 '');
246 } name;
247248- # writePython2 takes a name an attributeset with libraries and some python2 sourcecode and
249 # returns an executable
250 #
251 # Example:
252- # writePython2 "test_python2" { libraries = [ pkgs.python2Packages.enum ]; } ''
253 # from enum import Enum
254 #
255 # class Test(Enum):
···257 #
258 # print Test.a
259 # ''
260- writePython2 = makePythonWriter pkgs.python2 pkgs.python2Packages;
261262- # writePython2Bin takes the same arguments as writePython2 but outputs a directory (like writeScriptBin)
263- writePython2Bin = name:
264- writePython2 "/bin/${name}";
265266 # writePython3 takes a name an attributeset with libraries and some python3 sourcecode and
267 # returns an executable
···280 # writePython3Bin takes the same arguments as writePython3 but outputs a directory (like writeScriptBin)
281 writePython3Bin = name:
282 writePython3 "/bin/${name}";
283-}
000000000000000000000
···1+{ pkgs, config, buildPackages, lib, stdenv, libiconv, gawk, gnused, gixy }:
23+let
4+ aliases = if (config.allowAliases or true) then (import ./aliases.nix lib) else prev: {};
5+6+ writers = with lib; rec {
7 # Base implementation for non-compiled executables.
8 # Takes an interpreter, for example `${pkgs.bash}/bin/bash`
9 #
···247 '');
248 } name;
249250+ # writePyPy2 takes a name an attributeset with libraries and some pypy2 sourcecode and
251 # returns an executable
252 #
253 # Example:
254+ # writePyPy2 "test_pypy2" { libraries = [ pkgs.pypy2Packages.enum ]; } ''
255 # from enum import Enum
256 #
257 # class Test(Enum):
···259 #
260 # print Test.a
261 # ''
262+ writePyPy2 = makePythonWriter pkgs.pypy2 pkgs.pypy2Packages;
263264+ # writePyPy2Bin takes the same arguments as writePyPy2 but outputs a directory (like writeScriptBin)
265+ writePyPy2Bin = name:
266+ writePyPy2 "/bin/${name}";
267268 # writePython3 takes a name an attributeset with libraries and some python3 sourcecode and
269 # returns an executable
···282 # writePython3Bin takes the same arguments as writePython3 but outputs a directory (like writeScriptBin)
283 writePython3Bin = name:
284 writePython3 "/bin/${name}";
285+286+ # writePyPy3 takes a name an attributeset with libraries and some pypy3 sourcecode and
287+ # returns an executable
288+ #
289+ # Example:
290+ # writePyPy3 "test_pypy3" { libraries = [ pkgs.pypy3Packages.pyyaml ]; } ''
291+ # import yaml
292+ #
293+ # y = yaml.load("""
294+ # - test: success
295+ # """)
296+ # print(y[0]['test'])
297+ # ''
298+ writePyPy3 = makePythonWriter pkgs.pypy3 pkgs.pypy3Packages;
299+300+ # writePyPy3Bin takes the same arguments as writePyPy3 but outputs a directory (like writeScriptBin)
301+ writePyPy3Bin = name:
302+ writePyPy3 "/bin/${name}";
303+304+};
305+in
306+writers // (aliases writers)