Loading nixos/modules/security/acme/default.nix +6 −8 Original line number Diff line number Diff line Loading @@ -938,13 +938,10 @@ in { and remove the wildcard from the path. ''; } { assertion = lib.length (lib.filter (x: x != null) [ data.dnsProvider data.webroot data.listenHTTP data.s3Bucket ]) != 1; (let exclusiveAttrs = { inherit (data) dnsProvider webroot listenHTTP s3Bucket; }; in { assertion = lib.length (lib.filter (x: x != null) (builtins.attrValues exclusiveAttrs)) == 1; message = '' Exactly one of the options `security.acme.certs.${cert}.dnsProvider`, Loading @@ -952,8 +949,9 @@ in { `security.acme.certs.${cert}.listenHTTP` and `security.acme.certs.${cert}.s3Bucket` is required. Current values: ${(lib.generators.toPretty {} exclusiveAttrs)}. ''; } }) { assertion = all (hasSuffix "_FILE") (attrNames data.credentialFiles); message = '' Loading nixos/modules/system/boot/systemd/tmpfiles.nix +103 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,102 @@ in ''; }; systemd.tmpfiles.settings = mkOption { description = lib.mdDoc '' Declare systemd-tmpfiles rules to create, delete, and clean up volatile and temporary files and directories. Even though the service is called `*tmp*files` you can also create persistent files. ''; example = { "10-mypackage" = { "/var/lib/my-service/statefolder".d = { mode = "0755"; user = "root"; group = "root"; }; }; }; default = {}; type = types.attrsOf (types.attrsOf (types.attrsOf (types.submodule ({ name, config, ... }: { options.type = mkOption { type = types.str; default = name; example = "d"; description = lib.mdDoc '' The type of operation to perform on the file. The type consists of a single letter and optionally one or more modifier characters. Please see the upstream documentation for the available types and more details: <https://www.freedesktop.org/software/systemd/man/tmpfiles.d> ''; }; options.mode = mkOption { type = types.str; default = "-"; example = "0755"; description = lib.mdDoc '' The file access mode to use when creating this file or directory. ''; }; options.user = mkOption { type = types.str; default = "-"; example = "root"; description = lib.mdDoc '' The user of the file. This may either be a numeric ID or a user/group name. If omitted or when set to `"-"`, the user and group of the user who invokes systemd-tmpfiles is used. ''; }; options.group = mkOption { type = types.str; default = "-"; example = "root"; description = lib.mdDoc '' The group of the file. This may either be a numeric ID or a user/group name. If omitted or when set to `"-"`, the user and group of the user who invokes systemd-tmpfiles is used. ''; }; options.age = mkOption { type = types.str; default = "-"; example = "10d"; description = lib.mdDoc '' Delete a file when it reaches a certain age. If a file or directory is older than the current time minus the age field, it is deleted. If set to `"-"` no automatic clean-up is done. ''; }; options.argument = mkOption { type = types.str; default = ""; example = ""; description = lib.mdDoc '' An argument whose meaning depends on the type of operation. Please see the upstream documentation for the meaning of this parameter in different situations: <https://www.freedesktop.org/software/systemd/man/tmpfiles.d> ''; }; })))); }; systemd.tmpfiles.packages = mkOption { type = types.listOf types.package; default = []; Loading Loading @@ -100,7 +196,13 @@ in ${concatStringsSep "\n" cfg.rules} ''; }) ]; ] ++ (mapAttrsToList (name: paths: pkgs.writeTextDir "lib/tmpfiles.d/${name}.conf" (concatStrings (mapAttrsToList (path: types: concatStrings (mapAttrsToList (_type: entry: '' '${entry.type}' '${path}' '${entry.mode}' '${entry.user}' '${entry.group}' '${entry.age}' ${entry.argument} '') types) ) paths )) ) cfg.settings); systemd.tmpfiles.rules = [ "d /nix/var 0755 root root - -" Loading nixos/tests/misc.nix +4 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ in { environment.variables.EDITOR = lib.mkOverride 0 "emacs"; documentation.nixos.enable = lib.mkOverride 0 true; systemd.tmpfiles.rules = [ "d /tmp 1777 root root 10d" ]; systemd.tmpfiles.settings."10-test"."/tmp/somefile".d = {}; virtualisation.fileSystems = { "/tmp2" = { fsType = "tmpfs"; options = [ "mode=1777" "noauto" ]; Loading Loading @@ -117,6 +118,9 @@ in { ) machine.fail("[ -e /tmp/foo ]") with subtest("whether systemd-tmpfiles settings works"): machine.succeed("[ -e /tmp/somefile ]") with subtest("whether automounting works"): machine.fail("grep '/tmp2 tmpfs' /proc/mounts") machine.succeed("touch /tmp2/x") Loading pkgs/applications/emulators/retroarch/cores.nix +2 −0 Original line number Diff line number Diff line Loading @@ -568,6 +568,7 @@ in mame2015 = mkLibretroCore { core = "mame2015"; patches = [ ./patches/mame2015-python311.patch ]; makeFlags = [ "PYTHON=python3" ]; extraNativeBuildInputs = [ python3 ]; extraBuildInputs = [ alsa-lib ]; Loading @@ -581,6 +582,7 @@ in mame2016 = mkLibretroCore { core = "mame2016"; patches = [ ./patches/mame2016-python311.patch ]; extraNativeBuildInputs = [ python3 ]; extraBuildInputs = [ alsa-lib ]; makeFlags = [ "PYTHON_EXECUTABLE=python3" ]; Loading pkgs/applications/emulators/retroarch/patches/mame2015-python311.patch 0 → 100644 +61 −0 Original line number Diff line number Diff line diff --git a/src/emu/cpu/m6502/m6502make.py b/src/emu/cpu/m6502/m6502make.py index da29fc722a..3de641dd69 100755 --- a/src/emu/cpu/m6502/m6502make.py +++ b/src/emu/cpu/m6502/m6502make.py @@ -16,7 +16,7 @@ def load_opcodes(fname): opcodes = [] logging.info("load_opcodes: %s", fname) try: - f = open(fname, "rU") + f = open(fname, "r") except Exception: err = sys.exc_info()[1] logging.error("cannot read opcodes file %s [%s]", fname, err) @@ -39,7 +39,7 @@ def load_disp(fname): logging.info("load_disp: %s", fname) states = [] try: - f = open(fname, "rU") + f = open(fname, "r") except Exception: err = sys.exc_info()[1] logging.error("cannot read display file %s [%s]", fname, err) diff --git a/src/emu/cpu/m6809/m6809make.py b/src/emu/cpu/m6809/m6809make.py index c3d5b0f66e..79f6f90cdd 100644 --- a/src/emu/cpu/m6809/m6809make.py +++ b/src/emu/cpu/m6809/m6809make.py @@ -14,7 +14,7 @@ def load_file(fname, lines): if path != "": path += '/' try: - f = open(fname, "rU") + f = open(fname, "r") except Exception: err = sys.exc_info()[1] sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err)) diff --git a/src/emu/cpu/mcs96/mcs96make.py b/src/emu/cpu/mcs96/mcs96make.py index ec5ec37a78..7ab806a653 100644 --- a/src/emu/cpu/mcs96/mcs96make.py +++ b/src/emu/cpu/mcs96/mcs96make.py @@ -71,7 +71,7 @@ def __init__(self, fname, is_196): self.ea = {} self.macros = {} try: - f = open(fname, "rU") + f = open(fname, "r") except Exception: err = sys.exc_info()[1] sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err)) diff --git a/src/emu/cpu/tms57002/tmsmake.py b/src/emu/cpu/tms57002/tmsmake.py index 62092097d9..78f9fe43cd 100755 --- a/src/emu/cpu/tms57002/tmsmake.py +++ b/src/emu/cpu/tms57002/tmsmake.py @@ -326,7 +326,7 @@ def ins_cmp_dasm(a, b): def LoadLst(filename): instructions = [] ins = None - for n, line in enumerate(open(filename, "rU")): + for n, line in enumerate(open(filename, "r")): line = line.rstrip() if not line and ins: # new lines separate intructions Loading
nixos/modules/security/acme/default.nix +6 −8 Original line number Diff line number Diff line Loading @@ -938,13 +938,10 @@ in { and remove the wildcard from the path. ''; } { assertion = lib.length (lib.filter (x: x != null) [ data.dnsProvider data.webroot data.listenHTTP data.s3Bucket ]) != 1; (let exclusiveAttrs = { inherit (data) dnsProvider webroot listenHTTP s3Bucket; }; in { assertion = lib.length (lib.filter (x: x != null) (builtins.attrValues exclusiveAttrs)) == 1; message = '' Exactly one of the options `security.acme.certs.${cert}.dnsProvider`, Loading @@ -952,8 +949,9 @@ in { `security.acme.certs.${cert}.listenHTTP` and `security.acme.certs.${cert}.s3Bucket` is required. Current values: ${(lib.generators.toPretty {} exclusiveAttrs)}. ''; } }) { assertion = all (hasSuffix "_FILE") (attrNames data.credentialFiles); message = '' Loading
nixos/modules/system/boot/systemd/tmpfiles.nix +103 −1 Original line number Diff line number Diff line Loading @@ -20,6 +20,102 @@ in ''; }; systemd.tmpfiles.settings = mkOption { description = lib.mdDoc '' Declare systemd-tmpfiles rules to create, delete, and clean up volatile and temporary files and directories. Even though the service is called `*tmp*files` you can also create persistent files. ''; example = { "10-mypackage" = { "/var/lib/my-service/statefolder".d = { mode = "0755"; user = "root"; group = "root"; }; }; }; default = {}; type = types.attrsOf (types.attrsOf (types.attrsOf (types.submodule ({ name, config, ... }: { options.type = mkOption { type = types.str; default = name; example = "d"; description = lib.mdDoc '' The type of operation to perform on the file. The type consists of a single letter and optionally one or more modifier characters. Please see the upstream documentation for the available types and more details: <https://www.freedesktop.org/software/systemd/man/tmpfiles.d> ''; }; options.mode = mkOption { type = types.str; default = "-"; example = "0755"; description = lib.mdDoc '' The file access mode to use when creating this file or directory. ''; }; options.user = mkOption { type = types.str; default = "-"; example = "root"; description = lib.mdDoc '' The user of the file. This may either be a numeric ID or a user/group name. If omitted or when set to `"-"`, the user and group of the user who invokes systemd-tmpfiles is used. ''; }; options.group = mkOption { type = types.str; default = "-"; example = "root"; description = lib.mdDoc '' The group of the file. This may either be a numeric ID or a user/group name. If omitted or when set to `"-"`, the user and group of the user who invokes systemd-tmpfiles is used. ''; }; options.age = mkOption { type = types.str; default = "-"; example = "10d"; description = lib.mdDoc '' Delete a file when it reaches a certain age. If a file or directory is older than the current time minus the age field, it is deleted. If set to `"-"` no automatic clean-up is done. ''; }; options.argument = mkOption { type = types.str; default = ""; example = ""; description = lib.mdDoc '' An argument whose meaning depends on the type of operation. Please see the upstream documentation for the meaning of this parameter in different situations: <https://www.freedesktop.org/software/systemd/man/tmpfiles.d> ''; }; })))); }; systemd.tmpfiles.packages = mkOption { type = types.listOf types.package; default = []; Loading Loading @@ -100,7 +196,13 @@ in ${concatStringsSep "\n" cfg.rules} ''; }) ]; ] ++ (mapAttrsToList (name: paths: pkgs.writeTextDir "lib/tmpfiles.d/${name}.conf" (concatStrings (mapAttrsToList (path: types: concatStrings (mapAttrsToList (_type: entry: '' '${entry.type}' '${path}' '${entry.mode}' '${entry.user}' '${entry.group}' '${entry.age}' ${entry.argument} '') types) ) paths )) ) cfg.settings); systemd.tmpfiles.rules = [ "d /nix/var 0755 root root - -" Loading
nixos/tests/misc.nix +4 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ in { environment.variables.EDITOR = lib.mkOverride 0 "emacs"; documentation.nixos.enable = lib.mkOverride 0 true; systemd.tmpfiles.rules = [ "d /tmp 1777 root root 10d" ]; systemd.tmpfiles.settings."10-test"."/tmp/somefile".d = {}; virtualisation.fileSystems = { "/tmp2" = { fsType = "tmpfs"; options = [ "mode=1777" "noauto" ]; Loading Loading @@ -117,6 +118,9 @@ in { ) machine.fail("[ -e /tmp/foo ]") with subtest("whether systemd-tmpfiles settings works"): machine.succeed("[ -e /tmp/somefile ]") with subtest("whether automounting works"): machine.fail("grep '/tmp2 tmpfs' /proc/mounts") machine.succeed("touch /tmp2/x") Loading
pkgs/applications/emulators/retroarch/cores.nix +2 −0 Original line number Diff line number Diff line Loading @@ -568,6 +568,7 @@ in mame2015 = mkLibretroCore { core = "mame2015"; patches = [ ./patches/mame2015-python311.patch ]; makeFlags = [ "PYTHON=python3" ]; extraNativeBuildInputs = [ python3 ]; extraBuildInputs = [ alsa-lib ]; Loading @@ -581,6 +582,7 @@ in mame2016 = mkLibretroCore { core = "mame2016"; patches = [ ./patches/mame2016-python311.patch ]; extraNativeBuildInputs = [ python3 ]; extraBuildInputs = [ alsa-lib ]; makeFlags = [ "PYTHON_EXECUTABLE=python3" ]; Loading
pkgs/applications/emulators/retroarch/patches/mame2015-python311.patch 0 → 100644 +61 −0 Original line number Diff line number Diff line diff --git a/src/emu/cpu/m6502/m6502make.py b/src/emu/cpu/m6502/m6502make.py index da29fc722a..3de641dd69 100755 --- a/src/emu/cpu/m6502/m6502make.py +++ b/src/emu/cpu/m6502/m6502make.py @@ -16,7 +16,7 @@ def load_opcodes(fname): opcodes = [] logging.info("load_opcodes: %s", fname) try: - f = open(fname, "rU") + f = open(fname, "r") except Exception: err = sys.exc_info()[1] logging.error("cannot read opcodes file %s [%s]", fname, err) @@ -39,7 +39,7 @@ def load_disp(fname): logging.info("load_disp: %s", fname) states = [] try: - f = open(fname, "rU") + f = open(fname, "r") except Exception: err = sys.exc_info()[1] logging.error("cannot read display file %s [%s]", fname, err) diff --git a/src/emu/cpu/m6809/m6809make.py b/src/emu/cpu/m6809/m6809make.py index c3d5b0f66e..79f6f90cdd 100644 --- a/src/emu/cpu/m6809/m6809make.py +++ b/src/emu/cpu/m6809/m6809make.py @@ -14,7 +14,7 @@ def load_file(fname, lines): if path != "": path += '/' try: - f = open(fname, "rU") + f = open(fname, "r") except Exception: err = sys.exc_info()[1] sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err)) diff --git a/src/emu/cpu/mcs96/mcs96make.py b/src/emu/cpu/mcs96/mcs96make.py index ec5ec37a78..7ab806a653 100644 --- a/src/emu/cpu/mcs96/mcs96make.py +++ b/src/emu/cpu/mcs96/mcs96make.py @@ -71,7 +71,7 @@ def __init__(self, fname, is_196): self.ea = {} self.macros = {} try: - f = open(fname, "rU") + f = open(fname, "r") except Exception: err = sys.exc_info()[1] sys.stderr.write("Cannot read opcodes file %s [%s]\n" % (fname, err)) diff --git a/src/emu/cpu/tms57002/tmsmake.py b/src/emu/cpu/tms57002/tmsmake.py index 62092097d9..78f9fe43cd 100755 --- a/src/emu/cpu/tms57002/tmsmake.py +++ b/src/emu/cpu/tms57002/tmsmake.py @@ -326,7 +326,7 @@ def ins_cmp_dasm(a, b): def LoadLst(filename): instructions = [] ins = None - for n, line in enumerate(open(filename, "rU")): + for n, line in enumerate(open(filename, "r")): line = line.rstrip() if not line and ins: # new lines separate intructions