Loading .github/workflows/check-nix-format.yml +1 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ jobs: echo "Some new/changed Nix files are not properly formatted" echo "Please go to the Nixpkgs root directory, run \`nix-shell\`, then:" echo "nixfmt ${unformattedFiles[*]@Q}" echo "Make sure your branch is up to date with master, rebase if not." echo "If you're having trouble, please ping @NixOS/nix-formatting" exit 1 fi lib/filesystem.nix +27 −46 Original line number Diff line number Diff line Loading @@ -18,7 +18,10 @@ let ; inherit (lib.filesystem) pathIsDirectory pathIsRegularFile pathType packagesFromDirectoryRecursive ; inherit (lib.strings) Loading Loading @@ -360,52 +363,30 @@ in directory, ... }: assert pathIsDirectory directory; let # Determine if a directory entry from `readDir` indicates a package or # directory of packages. directoryEntryIsPackage = basename: type: type == "directory" || hasSuffix ".nix" basename; # List directory entries that indicate packages in the given `path`. packageDirectoryEntries = path: filterAttrs directoryEntryIsPackage (readDir path); # Transform a directory entry (a `basename` and `type` pair) into a # package. directoryEntryToAttrPair = subdirectory: basename: type: let path = subdirectory + "/${basename}"; inherit (lib.path) append; defaultPath = append directory "package.nix"; in if type == "regular" then { name = removeSuffix ".nix" basename; value = callPackage path { }; } else if type == "directory" then { name = basename; value = packagesFromDirectory path; } else throw if pathIsRegularFile defaultPath then # if `${directory}/package.nix` exists, call it directly callPackage defaultPath {} else lib.concatMapAttrs (name: type: # otherwise, for each directory entry let path = append directory name; in if type == "directory" then { # recurse into directories "${name}" = packagesFromDirectoryRecursive { inherit callPackage; directory = path; }; } else if type == "regular" && hasSuffix ".nix" name then { # call .nix files "${lib.removeSuffix ".nix" name}" = callPackage path {}; } else if type == "regular" then { # ignore non-nix files } else throw '' lib.filesystem.packagesFromDirectoryRecursive: Unsupported file type ${type} at path ${toString path} '' lib.filesystem.packagesFromDirectoryRecursive: Unsupported file type ${type} at path ${toString subdirectory} ''; # Transform a directory into a package (if there's a `package.nix`) or # set of packages (otherwise). packagesFromDirectory = path: let defaultPackagePath = path + "/package.nix"; in if pathExists defaultPackagePath then callPackage defaultPackagePath { } else mapAttrs' (directoryEntryToAttrPair path) (packageDirectoryEntries path); in packagesFromDirectory directory; ) (builtins.readDir directory); } maintainers/maintainer-list.nix +7 −0 Original line number Diff line number Diff line Loading @@ -19460,6 +19460,13 @@ name = "Maxwell Beck"; keys = [ { fingerprint = "D260 79E3 C2BC 2E43 905B D057 BB3E FA30 3760 A0DB"; } ]; }; rytswd = { email = "rytswd@gmail.com"; github = "rytswd"; githubId = 23435099; name = "Ryota"; keys = [ { fingerprint = "537E 712F 0EC3 91C2 B47F 56E2 EB5D 1A84 5333 43BB"; } ]; }; ryze = { name = "Ryze"; github = "ryze312"; Loading nixos/modules/misc/documentation.nix +7 −1 Original line number Diff line number Diff line Loading @@ -367,7 +367,13 @@ in }) (mkIf cfg.doc.enable { environment.pathsToLink = [ "/share/doc" ]; environment.pathsToLink = [ "/share/doc" # Legacy paths used by gtk-doc & adjacent tools. "/share/gtk-doc" "/share/devhelp" ]; environment.extraOutputsToInstall = [ "doc" ] ++ optional cfg.dev.enable "devdoc"; }) Loading nixos/modules/services/networking/aria2.nix +30 −1 Original line number Diff line number Diff line Loading @@ -64,6 +64,34 @@ in Read https://aria2.github.io/manual/en/html/aria2c.html#rpc-auth to know how this option value is used. ''; }; downloadDirPermission = lib.mkOption { type = lib.types.str; default = "0770"; description = '' The permission for `settings.dir`. The default is 0770, which denies access for users not in the `aria2` group. You may want to adjust `serviceUMask` as well, which further restricts the file permission for newly created files (i.e. the downloads). ''; }; serviceUMask = lib.mkOption { type = lib.types.str; default = "0022"; example = "0002"; description = '' The file mode creation mask for Aria2 service. The default is 0022 for compatibility reason, as this is the default used by systemd. However, this results in file permission 0644 for new files, and denies `aria2` group member from modifying the file. You may want to set this value to `0002` so you can manage the file more easily. ''; }; settings = lib.mkOption { description = '' Generates the `aria2.conf` file. Refer to [the documentation][0] for Loading Loading @@ -141,7 +169,7 @@ in systemd.tmpfiles.rules = [ "d '${homeDir}' 0770 aria2 aria2 - -" "d '${config.services.aria2.settings.dir}' 0770 aria2 aria2 - -" "d '${config.services.aria2.settings.dir}' ${config.services.aria2.downloadDirPermission} aria2 aria2 - -" ]; systemd.services.aria2 = { Loading @@ -165,6 +193,7 @@ in User = "aria2"; Group = "aria2"; LoadCredential = "rpcSecretFile:${cfg.rpcSecretFile}"; UMask = cfg.serviceUMask; }; }; }; Loading Loading
.github/workflows/check-nix-format.yml +1 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,7 @@ jobs: echo "Some new/changed Nix files are not properly formatted" echo "Please go to the Nixpkgs root directory, run \`nix-shell\`, then:" echo "nixfmt ${unformattedFiles[*]@Q}" echo "Make sure your branch is up to date with master, rebase if not." echo "If you're having trouble, please ping @NixOS/nix-formatting" exit 1 fi
lib/filesystem.nix +27 −46 Original line number Diff line number Diff line Loading @@ -18,7 +18,10 @@ let ; inherit (lib.filesystem) pathIsDirectory pathIsRegularFile pathType packagesFromDirectoryRecursive ; inherit (lib.strings) Loading Loading @@ -360,52 +363,30 @@ in directory, ... }: assert pathIsDirectory directory; let # Determine if a directory entry from `readDir` indicates a package or # directory of packages. directoryEntryIsPackage = basename: type: type == "directory" || hasSuffix ".nix" basename; # List directory entries that indicate packages in the given `path`. packageDirectoryEntries = path: filterAttrs directoryEntryIsPackage (readDir path); # Transform a directory entry (a `basename` and `type` pair) into a # package. directoryEntryToAttrPair = subdirectory: basename: type: let path = subdirectory + "/${basename}"; inherit (lib.path) append; defaultPath = append directory "package.nix"; in if type == "regular" then { name = removeSuffix ".nix" basename; value = callPackage path { }; } else if type == "directory" then { name = basename; value = packagesFromDirectory path; } else throw if pathIsRegularFile defaultPath then # if `${directory}/package.nix` exists, call it directly callPackage defaultPath {} else lib.concatMapAttrs (name: type: # otherwise, for each directory entry let path = append directory name; in if type == "directory" then { # recurse into directories "${name}" = packagesFromDirectoryRecursive { inherit callPackage; directory = path; }; } else if type == "regular" && hasSuffix ".nix" name then { # call .nix files "${lib.removeSuffix ".nix" name}" = callPackage path {}; } else if type == "regular" then { # ignore non-nix files } else throw '' lib.filesystem.packagesFromDirectoryRecursive: Unsupported file type ${type} at path ${toString path} '' lib.filesystem.packagesFromDirectoryRecursive: Unsupported file type ${type} at path ${toString subdirectory} ''; # Transform a directory into a package (if there's a `package.nix`) or # set of packages (otherwise). packagesFromDirectory = path: let defaultPackagePath = path + "/package.nix"; in if pathExists defaultPackagePath then callPackage defaultPackagePath { } else mapAttrs' (directoryEntryToAttrPair path) (packageDirectoryEntries path); in packagesFromDirectory directory; ) (builtins.readDir directory); }
maintainers/maintainer-list.nix +7 −0 Original line number Diff line number Diff line Loading @@ -19460,6 +19460,13 @@ name = "Maxwell Beck"; keys = [ { fingerprint = "D260 79E3 C2BC 2E43 905B D057 BB3E FA30 3760 A0DB"; } ]; }; rytswd = { email = "rytswd@gmail.com"; github = "rytswd"; githubId = 23435099; name = "Ryota"; keys = [ { fingerprint = "537E 712F 0EC3 91C2 B47F 56E2 EB5D 1A84 5333 43BB"; } ]; }; ryze = { name = "Ryze"; github = "ryze312"; Loading
nixos/modules/misc/documentation.nix +7 −1 Original line number Diff line number Diff line Loading @@ -367,7 +367,13 @@ in }) (mkIf cfg.doc.enable { environment.pathsToLink = [ "/share/doc" ]; environment.pathsToLink = [ "/share/doc" # Legacy paths used by gtk-doc & adjacent tools. "/share/gtk-doc" "/share/devhelp" ]; environment.extraOutputsToInstall = [ "doc" ] ++ optional cfg.dev.enable "devdoc"; }) Loading
nixos/modules/services/networking/aria2.nix +30 −1 Original line number Diff line number Diff line Loading @@ -64,6 +64,34 @@ in Read https://aria2.github.io/manual/en/html/aria2c.html#rpc-auth to know how this option value is used. ''; }; downloadDirPermission = lib.mkOption { type = lib.types.str; default = "0770"; description = '' The permission for `settings.dir`. The default is 0770, which denies access for users not in the `aria2` group. You may want to adjust `serviceUMask` as well, which further restricts the file permission for newly created files (i.e. the downloads). ''; }; serviceUMask = lib.mkOption { type = lib.types.str; default = "0022"; example = "0002"; description = '' The file mode creation mask for Aria2 service. The default is 0022 for compatibility reason, as this is the default used by systemd. However, this results in file permission 0644 for new files, and denies `aria2` group member from modifying the file. You may want to set this value to `0002` so you can manage the file more easily. ''; }; settings = lib.mkOption { description = '' Generates the `aria2.conf` file. Refer to [the documentation][0] for Loading Loading @@ -141,7 +169,7 @@ in systemd.tmpfiles.rules = [ "d '${homeDir}' 0770 aria2 aria2 - -" "d '${config.services.aria2.settings.dir}' 0770 aria2 aria2 - -" "d '${config.services.aria2.settings.dir}' ${config.services.aria2.downloadDirPermission} aria2 aria2 - -" ]; systemd.services.aria2 = { Loading @@ -165,6 +193,7 @@ in User = "aria2"; Group = "aria2"; LoadCredential = "rpcSecretFile:${cfg.rpcSecretFile}"; UMask = cfg.serviceUMask; }; }; }; Loading