Skip to content

Commit 703ffa2

Browse files
committed
Merge remote-tracking branch 'nixpkgs/staging-next' into staging
2 parents 8f5da90 + a24ac87 commit 703ffa2

146 files changed

Lines changed: 4625 additions & 1836 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</p>
99

1010
[Nixpkgs](https://github.com/nixos/nixpkgs) is a collection of over
11-
60,000 software packages that can be installed with the
11+
80,000 software packages that can be installed with the
1212
[Nix](https://nixos.org/nix/) package manager. It also implements
1313
[NixOS](https://nixos.org/nixos/), a purely-functional Linux distribution.
1414

lib/strings.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ rec {
369369
370370
Example:
371371
escapeXML ''"test" 'test' < & >''
372-
=> "\\[\\^a-z]\\*"
372+
=> "&quot;test&quot; &apos;test&apos; &lt; &amp; &gt;"
373373
*/
374374
escapeXML = builtins.replaceStrings
375375
["\"" "'" "<" ">" "&"]

maintainers/maintainer-list.nix

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4104,6 +4104,12 @@
41044104
githubId = 20208;
41054105
name = "Rok Garbas";
41064106
};
4107+
gardspirito = {
4108+
name = "gardspirito";
4109+
email = "nyxoroso@gmail.com";
4110+
github = "gardspirito";
4111+
githubId = 29687558;
4112+
};
41074113
garrison = {
41084114
email = "jim@garrison.cc";
41094115
github = "garrison";
@@ -10923,13 +10929,6 @@
1092310929
githubId = 2666479;
1092410930
name = "Y Nguyen";
1092510931
};
10926-
superherointj = {
10927-
name = "Sérgio G.";
10928-
email = "5861043+superherointj@users.noreply.github.com";
10929-
matrix = "@superherointj:matrix.org";
10930-
github = "superherointj";
10931-
githubId = 5861043;
10932-
};
1093310932
SuperSandro2000 = {
1093410933
email = "sandro.jaeckel@gmail.com";
1093510934
matrix = "@sandro:supersandro.de";

maintainers/team-list.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ with lib.maintainers; {
200200
openstack = {
201201
members = [
202202
angustrau
203-
superherointj
204203
SuperSandro2000
205204
];
206205
scope = "Maintain the ecosystem around OpenStack";

nixos/doc/manual/from_md/release-notes/rl-2111.section.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1223,6 +1223,13 @@ Superuser created successfully.
12231223
<link xlink:href="options.html#opt-virtualisation.additionalPaths"><literal>virtualisation.additionalPaths</literal></link>.
12241224
</para>
12251225
</listitem>
1226+
<listitem>
1227+
<para>
1228+
The <literal>services.ddclient.password</literal> option was
1229+
removed, and replaced with
1230+
<literal>services.ddclient.passwordFile</literal>.
1231+
</para>
1232+
</listitem>
12261233
</itemizedlist>
12271234
</section>
12281235
<section xml:id="sec-release-21.11-notable-changes">

nixos/doc/manual/release-notes/rl-2111.section.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ In addition to numerous new and upgraded packages, this release has the followin
375375
- The `virtualisation.pathsInNixDB` option was renamed
376376
[`virtualisation.additionalPaths`](options.html#opt-virtualisation.additionalPaths).
377377

378+
- The `services.ddclient.password` option was removed, and replaced with `services.ddclient.passwordFile`.
379+
378380
## Other Notable Changes {#sec-release-21.11-notable-changes}
379381

380382

nixos/modules/hardware/flirc.nix

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{ config, lib, pkgs, ... }:
2+
let
3+
cfg = config.hardware.flirc;
4+
in
5+
{
6+
options.hardware.flirc.enable = lib.mkEnableOption "software to configure a Flirc USB device";
7+
8+
config = lib.mkIf cfg.enable {
9+
environment.systemPackages = [ pkgs.flirc ];
10+
services.udev.packages = [ pkgs.flirc ];
11+
};
12+
}

nixos/modules/module-list.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
./hardware/digitalbitbox.nix
5050
./hardware/device-tree.nix
5151
./hardware/gkraken.nix
52+
./hardware/flirc.nix
5253
./hardware/i2c.nix
5354
./hardware/sensor/hddtemp.nix
5455
./hardware/sensor/iio.nix
@@ -390,6 +391,7 @@
390391
./services/display-managers/greetd.nix
391392
./services/editors/emacs.nix
392393
./services/editors/infinoted.nix
394+
./services/finance/odoo.nix
393395
./services/games/crossfire-server.nix
394396
./services/games/deliantra-server.nix
395397
./services/games/factorio.nix
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{ config, pkgs, lib, ... }:
2+
3+
with lib;
4+
5+
let
6+
cfg = config.services.odoo;
7+
format = pkgs.formats.ini {};
8+
in
9+
{
10+
options = {
11+
services.odoo = {
12+
enable = mkEnableOption "odoo";
13+
14+
package = mkOption {
15+
type = types.package;
16+
default = pkgs.odoo;
17+
defaultText = literalExpression "pkgs.odoo";
18+
description = "Odoo package to use.";
19+
};
20+
21+
addons = mkOption {
22+
type = with types; listOf package;
23+
default = [];
24+
example = literalExpression "[ pkgs.odoo_enterprise ]";
25+
description = "Odoo addons";
26+
};
27+
28+
settings = mkOption {
29+
type = format.type;
30+
default = {};
31+
description = ''
32+
Odoo configuration settings. For more details see https://www.odoo.com/documentation/15.0/administration/install/deploy.html
33+
'';
34+
};
35+
36+
domain = mkOption {
37+
type = with types; nullOr str;
38+
description = "Domain to host Odoo with nginx";
39+
default = null;
40+
};
41+
};
42+
};
43+
44+
config = mkIf (cfg.enable) (let
45+
cfgFile = format.generate "odoo.cfg" cfg.settings;
46+
in {
47+
services.nginx = mkIf (cfg.domain != null) {
48+
upstreams = {
49+
odoo.servers = {
50+
"127.0.0.1:8069" = {};
51+
};
52+
53+
odoochat.servers = {
54+
"127.0.0.1:8072" = {};
55+
};
56+
};
57+
58+
virtualHosts."${cfg.domain}" = {
59+
extraConfig = ''
60+
proxy_read_timeout 720s;
61+
proxy_connect_timeout 720s;
62+
proxy_send_timeout 720s;
63+
64+
proxy_set_header X-Forwarded-Host $host;
65+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
66+
proxy_set_header X-Forwarded-Proto $scheme;
67+
proxy_set_header X-Real-IP $remote_addr;
68+
'';
69+
70+
locations = {
71+
"/longpolling" = {
72+
proxyPass = "http://odoochat";
73+
};
74+
75+
"/" = {
76+
proxyPass = "http://odoo";
77+
extraConfig = ''
78+
proxy_redirect off;
79+
'';
80+
};
81+
};
82+
};
83+
};
84+
85+
services.odoo.settings.options = {
86+
proxy_mode = cfg.domain != null;
87+
};
88+
89+
users.users.odoo = {
90+
isSystemUser = true;
91+
group = "odoo";
92+
};
93+
users.groups.odoo = {};
94+
95+
systemd.services.odoo = {
96+
wantedBy = [ "multi-user.target" ];
97+
after = [ "network.target" "postgresql.service" ];
98+
99+
# pg_dump
100+
path = [ config.services.postgresql.package ];
101+
102+
requires = [ "postgresql.service" ];
103+
script = "HOME=$STATE_DIRECTORY ${cfg.package}/bin/odoo ${optionalString (cfg.addons != []) "--addons-path=${concatMapStringsSep "," escapeShellArg cfg.addons}"} -c ${cfgFile}";
104+
105+
serviceConfig = {
106+
DynamicUser = true;
107+
User = "odoo";
108+
StateDirectory = "odoo";
109+
};
110+
};
111+
112+
services.postgresql = {
113+
enable = true;
114+
115+
ensureUsers = [{
116+
name = "odoo";
117+
ensurePermissions = { "DATABASE odoo" = "ALL PRIVILEGES"; };
118+
}];
119+
ensureDatabases = [ "odoo" ];
120+
};
121+
});
122+
}

nixos/modules/services/networking/ddclient.nix

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ let
44
cfg = config.services.ddclient;
55
boolToStr = bool: if bool then "yes" else "no";
66
dataDir = "/var/lib/ddclient";
7+
StateDirectory = builtins.baseNameOf dataDir;
8+
RuntimeDirectory = StateDirectory;
79

8-
configText = ''
10+
configFile' = pkgs.writeText "ddclient.conf" ''
911
# This file can be used as a template for configFile or is automatically generated by Nix options.
1012
cache=${dataDir}/ddclient.cache
1113
foreground=YES
1214
use=${cfg.use}
1315
login=${cfg.username}
14-
password=${cfg.password}
16+
password=
1517
protocol=${cfg.protocol}
1618
${lib.optionalString (cfg.script != "") "script=${cfg.script}"}
1719
${lib.optionalString (cfg.server != "") "server=${cfg.server}"}
@@ -24,6 +26,7 @@ let
2426
${cfg.extraConfig}
2527
${lib.concatStringsSep "," cfg.domains}
2628
'';
29+
configFile = if (cfg.configFile != null) then cfg.configFile else configFile';
2730

2831
in
2932

@@ -37,6 +40,7 @@ with lib;
3740
let value = getAttrFromPath [ "services" "ddclient" "domain" ] config;
3841
in if value != "" then [ value ] else []))
3942
(mkRemovedOptionModule [ "services" "ddclient" "homeDir" ] "")
43+
(mkRemovedOptionModule [ "services" "ddclient" "password" ] "Use services.ddclient.passwordFile instead.")
4044
];
4145

4246
###### interface
@@ -69,11 +73,11 @@ with lib;
6973
'';
7074
};
7175

72-
password = mkOption {
73-
default = "";
74-
type = str;
76+
passwordFile = mkOption {
77+
default = null;
78+
type = nullOr str;
7579
description = ''
76-
Password. WARNING: The password becomes world readable in the Nix store.
80+
A file containing the password.
7781
'';
7882
};
7983

@@ -87,12 +91,11 @@ with lib;
8791
};
8892

8993
configFile = mkOption {
90-
default = "/etc/ddclient.conf";
91-
type = path;
94+
default = null;
95+
type = nullOr path;
9296
description = ''
9397
Path to configuration file.
94-
When set to the default '/etc/ddclient.conf' it will be populated with the various other options in this module. When it is changed (for example: '/root/nixos/secrets/ddclient.conf') the file read directly to configure ddclient. This is a source of impurity.
95-
The purpose of this is to avoid placing secrets into the store.
98+
When set this overrides the generated configuration from module options.
9699
'';
97100
example = "/root/nixos/secrets/ddclient.conf";
98101
};
@@ -184,26 +187,28 @@ with lib;
184187
###### implementation
185188

186189
config = mkIf config.services.ddclient.enable {
187-
environment.etc."ddclient.conf" = {
188-
enable = cfg.configFile == "/etc/ddclient.conf";
189-
mode = "0600";
190-
text = configText;
191-
};
192-
193190
systemd.services.ddclient = {
194191
description = "Dynamic DNS Client";
195192
wantedBy = [ "multi-user.target" ];
196193
after = [ "network.target" ];
197-
restartTriggers = [ config.environment.etc."ddclient.conf".source ];
194+
restartTriggers = optional (cfg.configFile != null) cfg.configFile;
198195

199-
serviceConfig = rec {
196+
serviceConfig = {
200197
DynamicUser = true;
201-
RuntimeDirectory = StateDirectory;
202-
StateDirectory = builtins.baseNameOf dataDir;
198+
inherit RuntimeDirectory;
199+
inherit StateDirectory;
203200
Type = "oneshot";
204-
ExecStartPre = "!${lib.getBin pkgs.coreutils}/bin/install -m666 ${cfg.configFile} /run/${RuntimeDirectory}/ddclient.conf";
205201
ExecStart = "${lib.getBin pkgs.ddclient}/bin/ddclient -file /run/${RuntimeDirectory}/ddclient.conf";
206202
};
203+
preStart = ''
204+
install -m 600 ${configFile} /run/${RuntimeDirectory}/ddclient.conf
205+
${optionalString (cfg.configFile == null) (if (cfg.passwordFile != null) then ''
206+
password=$(head -n 1 ${cfg.passwordFile})
207+
sed -i "s/^password=$/password=$password/" /run/${RuntimeDirectory}/ddclient.conf
208+
'' else ''
209+
sed -i '/^password=$/d' /run/${RuntimeDirectory}/ddclient.conf
210+
'')}
211+
'';
207212
};
208213

209214
systemd.timers.ddclient = {

0 commit comments

Comments
 (0)