mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:
nix-build ci -A fmt.check
This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).
This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).
Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase
).
If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
This commit is contained in:
parent
2140bf39e4
commit
374e6bcc40
1523 changed files with 986047 additions and 513621 deletions
|
@ -1,4 +1,9 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
||||
|
@ -307,7 +312,11 @@ in
|
|||
};
|
||||
|
||||
dbus = mkOption {
|
||||
type = types.enum [ null "session" "system" ];
|
||||
type = types.enum [
|
||||
null
|
||||
"session"
|
||||
"system"
|
||||
];
|
||||
default = null;
|
||||
description = "Enable D-Bus remote control. Set to the bus you want Murmur to connect to.";
|
||||
};
|
||||
|
@ -316,14 +325,14 @@ in
|
|||
|
||||
config = mkIf cfg.enable {
|
||||
users.users.murmur = mkIf (cfg.user == "murmur") {
|
||||
description = "Murmur Service user";
|
||||
home = cfg.stateDir;
|
||||
createHome = true;
|
||||
uid = config.ids.uids.murmur;
|
||||
group = cfg.group;
|
||||
description = "Murmur Service user";
|
||||
home = cfg.stateDir;
|
||||
createHome = true;
|
||||
uid = config.ids.uids.murmur;
|
||||
group = cfg.group;
|
||||
};
|
||||
users.groups.murmur = mkIf (cfg.group == "murmur") {
|
||||
gid = config.ids.gids.murmur;
|
||||
gid = config.ids.gids.murmur;
|
||||
};
|
||||
|
||||
networking.firewall = mkIf cfg.openFirewall {
|
||||
|
@ -333,9 +342,9 @@ in
|
|||
|
||||
systemd.services.murmur = {
|
||||
description = "Murmur Chat Service";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
preStart = ''
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
preStart = ''
|
||||
${pkgs.envsubst}/bin/envsubst \
|
||||
-o /run/murmur/murmurd.ini \
|
||||
-i ${configFile}
|
||||
|
@ -375,63 +384,72 @@ in
|
|||
RestrictRealtime = true;
|
||||
SystemCallArchitectures = "native";
|
||||
SystemCallFilter = "@system-service";
|
||||
UMask = 027;
|
||||
UMask = 27;
|
||||
};
|
||||
};
|
||||
|
||||
# currently not included in upstream package, addition requested at
|
||||
# https://github.com/mumble-voip/mumble/issues/6078
|
||||
services.dbus.packages = mkIf (cfg.dbus == "system") [(pkgs.writeTextFile {
|
||||
name = "murmur-dbus-policy";
|
||||
text = ''
|
||||
<!DOCTYPE busconfig PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
<busconfig>
|
||||
<policy user="${cfg.user}">
|
||||
<allow own="net.sourceforge.mumble.murmur"/>
|
||||
</policy>
|
||||
services.dbus.packages = mkIf (cfg.dbus == "system") [
|
||||
(pkgs.writeTextFile {
|
||||
name = "murmur-dbus-policy";
|
||||
text = ''
|
||||
<!DOCTYPE busconfig PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
<busconfig>
|
||||
<policy user="${cfg.user}">
|
||||
<allow own="net.sourceforge.mumble.murmur"/>
|
||||
</policy>
|
||||
|
||||
<policy context="default">
|
||||
<allow send_destination="net.sourceforge.mumble.murmur"/>
|
||||
<allow receive_sender="net.sourceforge.mumble.murmur"/>
|
||||
</policy>
|
||||
</busconfig>
|
||||
'';
|
||||
destination = "/share/dbus-1/system.d/murmur.conf";
|
||||
})];
|
||||
<policy context="default">
|
||||
<allow send_destination="net.sourceforge.mumble.murmur"/>
|
||||
<allow receive_sender="net.sourceforge.mumble.murmur"/>
|
||||
</policy>
|
||||
</busconfig>
|
||||
'';
|
||||
destination = "/share/dbus-1/system.d/murmur.conf";
|
||||
})
|
||||
];
|
||||
|
||||
security.apparmor.policies."bin.mumble-server".profile = ''
|
||||
include <tunables/global>
|
||||
security.apparmor.policies."bin.mumble-server".profile =
|
||||
''
|
||||
include <tunables/global>
|
||||
|
||||
${cfg.package}/bin/{mumble-server,.mumble-server-wrapped} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice>
|
||||
include <abstractions/ssl_certs>
|
||||
include "${pkgs.apparmorRulesFromClosure { name = "mumble-server"; } cfg.package}"
|
||||
pix ${cfg.package}/bin/.mumble-server-wrapped,
|
||||
${cfg.package}/bin/{mumble-server,.mumble-server-wrapped} {
|
||||
include <abstractions/base>
|
||||
include <abstractions/nameservice>
|
||||
include <abstractions/ssl_certs>
|
||||
include "${pkgs.apparmorRulesFromClosure { name = "mumble-server"; } cfg.package}"
|
||||
pix ${cfg.package}/bin/.mumble-server-wrapped,
|
||||
|
||||
r ${config.environment.etc."os-release".source},
|
||||
r ${config.environment.etc."lsb-release".source},
|
||||
owner rwk ${cfg.stateDir}/murmur.sqlite,
|
||||
owner rw ${cfg.stateDir}/murmur.sqlite-journal,
|
||||
owner r ${cfg.stateDir}/,
|
||||
r /run/murmur/murmurd.pid,
|
||||
r /run/murmur/murmurd.ini,
|
||||
r ${configFile},
|
||||
'' + optionalString (cfg.logFile != null) ''
|
||||
r ${config.environment.etc."os-release".source},
|
||||
r ${config.environment.etc."lsb-release".source},
|
||||
owner rwk ${cfg.stateDir}/murmur.sqlite,
|
||||
owner rw ${cfg.stateDir}/murmur.sqlite-journal,
|
||||
owner r ${cfg.stateDir}/,
|
||||
r /run/murmur/murmurd.pid,
|
||||
r /run/murmur/murmurd.ini,
|
||||
r ${configFile},
|
||||
''
|
||||
+ optionalString (cfg.logFile != null) ''
|
||||
rw ${cfg.logFile},
|
||||
'' + optionalString (cfg.sslCert != "") ''
|
||||
''
|
||||
+ optionalString (cfg.sslCert != "") ''
|
||||
r ${cfg.sslCert},
|
||||
'' + optionalString (cfg.sslKey != "") ''
|
||||
''
|
||||
+ optionalString (cfg.sslKey != "") ''
|
||||
r ${cfg.sslKey},
|
||||
'' + optionalString (cfg.sslCa != "") ''
|
||||
''
|
||||
+ optionalString (cfg.sslCa != "") ''
|
||||
r ${cfg.sslCa},
|
||||
'' + optionalString (cfg.dbus != null) ''
|
||||
''
|
||||
+ optionalString (cfg.dbus != null) ''
|
||||
dbus bus=${cfg.dbus}
|
||||
'' + ''
|
||||
}
|
||||
'';
|
||||
''
|
||||
+ ''
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
meta.maintainers = with lib.maintainers; [ felixsinger ];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue