Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6797642bc70b
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9086227e58da
Choose a head ref

Commits on Dec 21, 2018

  1. Verified

    This commit was signed with the committer’s verified signature.
    fpletz Franz Pletz
    Copy the full SHA
    8e4651f View commit details

Commits on Dec 25, 2018

  1. libev: 4.24 -> 4.25

    Semi-automatic update generated by
    https://github.com/ryantm/nixpkgs-update tools. This update was made
    based on information from
    https://repology.org/metapackage/libev/versions
    r-ryantm committed Dec 25, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    fpletz Franz Pletz
    Copy the full SHA
    6d87f8d View commit details

Commits on Jan 31, 2019

  1. Verified

    This commit was signed with the committer’s verified signature.
    fpletz Franz Pletz
    Copy the full SHA
    be5181b View commit details
  2. openconnect: 7.08 -> 8.02

    dtzWill committed Jan 31, 2019
    Copy the full SHA
    1610427 View commit details

Commits on Feb 1, 2019

  1. Copy the full SHA
    b64024e View commit details

Commits on Feb 4, 2019

  1. iw: 4.14 -> 5.0

    dtzWill committed Feb 4, 2019
    Copy the full SHA
    a2d07bc View commit details
  2. Copy the full SHA
    b3d8b2d View commit details

Commits on Feb 5, 2019

  1. iw: 5.0 -> 5.0.1

    dtzWill committed Feb 5, 2019
    Copy the full SHA
    17ac907 View commit details

Commits on Feb 7, 2019

  1. buildEnv: allowSubstitutes = false

    trivial derivation
    volth authored Feb 7, 2019
    Copy the full SHA
    09665fe View commit details
  2. substituteAll: allowSubstitutes = false;

    trivial derivation
    volth authored Feb 7, 2019
    Copy the full SHA
    18e5db3 View commit details

Commits on Feb 8, 2019

  1. substituteAllFiles: allowSubstitutes = false

    trivial builder
    volth authored Feb 8, 2019
    Copy the full SHA
    5c28152 View commit details
  2. makeFontsCache: allowSubstitutes = false

    trivial builder
    volth authored Feb 8, 2019
    Copy the full SHA
    98e2820 View commit details
  3. buildFHSEnv: allowSubstitutes = false

    trivial builder
    volth authored Feb 8, 2019
    Copy the full SHA
    c706233 View commit details

Commits on Feb 11, 2019

  1. gnome3.librsvg: 2.44.11 -> 2.44.12 (#54779)

    Semi-automatic update generated by
    https://github.com/ryantm/nixpkgs-update tools. This update was made
    based on information from
    https://repology.org/metapackage/librsvg/versions
    r-ryantm authored and hedning committed Feb 11, 2019
    Copy the full SHA
    015b029 View commit details
  2. Copy the full SHA
    051fcba View commit details
  3. dhcpcd: 7.0.8 -> 7.1.1

    dtzWill committed Feb 11, 2019
    Copy the full SHA
    683dcb8 View commit details
  4. Copy the full SHA
    b3171ef View commit details

Commits on Feb 12, 2019

  1. Merge pull request #55166 from dtzWill/update/bison-3.3.2

    bison: 3.3.1 -> 3.3.2
    dtzWill authored Feb 12, 2019
    Copy the full SHA
    690fb6e View commit details
  2. Copy the full SHA
    3517d9c View commit details
  3. Copy the full SHA
    0f14c9c View commit details
  4. Copy the full SHA
    2973f17 View commit details
  5. Merge pull request #55600 from dtzWill/update/dhcpcd-7.1.1

    dhcpcd: 7.0.8 -> 7.1.1
    edolstra authored Feb 12, 2019
    Copy the full SHA
    a4c9e42 View commit details
  6. Merge pull request #55020 from dtzWill/update/mpfr-4.0.2

    mpfr: 4.0.1 -> 4.0.2
    dtzWill authored Feb 12, 2019
    Copy the full SHA
    6e2da12 View commit details
  7. Merge pull request #54060 from dtzWill/update/openconnect-8.02

    openconnect: 7.08 -> 8.02
    dtzWill authored Feb 12, 2019
    Copy the full SHA
    32a7d27 View commit details
  8. Merge pull request #55619 from dtzWill/update/ninja-1.9.0-fix-musl

    ninja: patch to fix w/musl, see upstream issue
    dtzWill authored Feb 12, 2019
    Copy the full SHA
    173d12a View commit details
  9. Copy the full SHA
    a3db3e5 View commit details
  10. Merge pull request #52854 from r-ryantm/auto-update/libev

    libev: 4.24 -> 4.25
    7c6f434c authored Feb 12, 2019
    Copy the full SHA
    e92d58f View commit details
  11. Merge pull request #55661 from dtzWill/update/gnupg-2.2.13

    gnupg: 2.2.12 -> 2.2.13
    dtzWill authored Feb 12, 2019
    Copy the full SHA
    d495cdc View commit details

Commits on Feb 13, 2019

  1. Merge staging-next into staging

    FRidh committed Feb 13, 2019
    Copy the full SHA
    8b05b82 View commit details
  2. nss: 3.42 -> 3.42.1

    NeQuissimus committed Feb 13, 2019
    Copy the full SHA
    e27fa43 View commit details
  3. groff: Remove indeterminism in manpages

    It was caused by including the modification date
    tilpner committed Feb 13, 2019
    Copy the full SHA
    5888fae View commit details

Commits on Feb 14, 2019

  1. gnome3: stop using aliases

    jtojnar committed Feb 14, 2019
    Copy the full SHA
    606ceda View commit details
  2. Merge pull request #55735 from jtojnar/gnome-no-alias

    gnome3: stop using aliases
    jtojnar authored Feb 14, 2019
    Copy the full SHA
    4a0c2ac View commit details
  3. Copy the full SHA
    53a349d View commit details
  4. python37Packages.cryptography: 2.4.2 -> 2.5

    Changelog:
    https://cryptography.io/en/latest/changelog/#v2-5
    
    Important changes:
    - BACKWARDS INCOMPATIBLE: U-label strings were deprecated in version
      2.1, but this version removes the default idna dependency as well.
    - BACKWARDS INCOMPATIBLE: The minimum supported PyPy version is now 5.4.
    primeos authored and FRidh committed Feb 14, 2019
    Copy the full SHA
    ecfa775 View commit details
  5. Merge master into staging

    FRidh committed Feb 14, 2019
    Copy the full SHA
    a25d48c View commit details
  6. Copy the full SHA
    f044cf2 View commit details
  7. Copy the full SHA
    494c021 View commit details
  8. Copy the full SHA
    8c800a8 View commit details
  9. Copy the full SHA
    5e3df28 View commit details
  10. python: absl-py: 0.6.1 -> 0.7.0

    FRidh committed Feb 14, 2019
    Copy the full SHA
    3550bdb View commit details
  11. python: adal: 1.2.0 -> 1.2.1

    FRidh committed Feb 14, 2019
    Copy the full SHA
    e06990e View commit details
  12. Copy the full SHA
    fa0b52a View commit details
  13. python: aiodns: 1.1.1 -> 1.2.0

    FRidh committed Feb 14, 2019
    Copy the full SHA
    da6c773 View commit details
  14. python: aiohue: 1.7.0 -> 1.9.0

    FRidh committed Feb 14, 2019
    Copy the full SHA
    a837e68 View commit details
  15. python: alembic: 1.0.6 -> 1.0.7

    FRidh committed Feb 14, 2019
    Copy the full SHA
    1fb9b30 View commit details
  16. Copy the full SHA
    2cd6c89 View commit details
  17. python: alerta: 6.3.1 -> 6.5.0

    FRidh committed Feb 14, 2019
    Copy the full SHA
    ffe6ed9 View commit details
  18. python: altair: 2.2.2 -> 2.3.0

    FRidh committed Feb 14, 2019
    Copy the full SHA
    03e6ac7 View commit details
  19. python: amqp: 2.3.2 -> 2.4.1

    FRidh committed Feb 14, 2019
    Copy the full SHA
    338efb0 View commit details
Showing 776 changed files with 4,223 additions and 2,152 deletions.
22 changes: 18 additions & 4 deletions doc/languages-frameworks/python.section.md
Original file line number Diff line number Diff line change
@@ -602,11 +602,10 @@ as the interpreter unless overridden otherwise.
All parameters from `stdenv.mkDerivation` function are still supported. The following are specific to `buildPythonPackage`:

* `catchConflicts ? true`: If `true`, abort package build if a package name appears more than once in dependency tree. Default is `true`.
* `checkInputs ? []`: Dependencies needed for running the `checkPhase`. These are added to `buildInputs` when `doCheck = true`.
* `disabled` ? false: If `true`, package is not build for the particular Python interpreter version.
* `dontWrapPythonPrograms ? false`: Skip wrapping of python programs.
* `installFlags ? []`: A list of strings. Arguments to be passed to `pip install`. To pass options to `python setup.py install`, use `--install-option`. E.g., `installFlags=["--install-option='--cpp_implementation'"].
* `format ? "setuptools"`: Format of the source. Valid options are `"setuptools"`, `"flit"`, `"wheel"`, and `"other"`. `"setuptools"` is for when the source has a `setup.py` and `setuptools` is used to build a wheel, `flit`, in case `flit` should be used to build a wheel, and `wheel` in case a wheel is provided. Use `other` when a custom `buildPhase` and/or `installPhase` is needed.
* `installFlags ? []`: A list of strings. Arguments to be passed to `pip install`. To pass options to `python setup.py install`, use `--install-option`. E.g., `installFlags=["--install-option='--cpp_implementation'"]`.
* `format ? "setuptools"`: Format of the source. Valid options are `"setuptools"`, `"pyproject"`, `"flit"`, `"wheel"`, and `"other"`. `"setuptools"` is for when the source has a `setup.py` and `setuptools` is used to build a wheel, `flit`, in case `flit` should be used to build a wheel, and `wheel` in case a wheel is provided. Use `other` when a custom `buildPhase` and/or `installPhase` is needed.
* `makeWrapperArgs ? []`: A list of strings. Arguments to be passed to `makeWrapper`, which wraps generated binaries. By default, the arguments to `makeWrapper` set `PATH` and `PYTHONPATH` environment variables before calling the binary. Additional arguments here can allow a developer to set environment variables which will be available when the binary is run. For example, `makeWrapperArgs = ["--set FOO BAR" "--set BAZ QUX"]`.
* `namePrefix`: Prepends text to `${name}` parameter. In case of libraries, this defaults to `"python3.5-"` for Python 3.5, etc., and in case of applications to `""`.
* `pythonPath ? []`: List of packages to be added into `$PYTHONPATH`. Packages in `pythonPath` are not propagated (contrary to `propagatedBuildInputs`).
@@ -615,6 +614,14 @@ All parameters from `stdenv.mkDerivation` function are still supported. The foll
* `removeBinByteCode ? true`: Remove bytecode from `/bin`. Bytecode is only created when the filenames end with `.py`.
* `setupPyBuildFlags ? []`: List of flags passed to `setup.py build_ext` command.

The `stdenv.mkDerivation` function accepts various parameters for describing build inputs (see "Specifying dependencies"). The following are of special
interest for Python packages, either because these are primarily used, or because their behaviour is different:

* `nativeBuildInputs ? []`: Build-time only dependencies. Typically executables as well as the items listed in `setup_requires`.
* `buildInputs ? []`: Build and/or run-time dependencies that need to be be compiled for the host machine. Typically non-Python libraries which are being linked.
* `checkInputs ? []`: Dependencies needed for running the `checkPhase`. These are added to `nativeBuildInputs` when `doCheck = true`. Items listed in `tests_require` go here.
* `propagatedBuildInputs ? []`: Aside from propagating dependencies, `buildPythonPackage` also injects code into and wraps executables with the paths included in this list. Items listed in `install_requires` go here.

##### Overriding Python packages

The `buildPythonPackage` function has a `overridePythonAttrs` method that
@@ -874,7 +881,6 @@ example of such a situation is when `py.test` is used.
'';
}
```
- Unicode issues can typically be fixed by including `glibcLocales` in `buildInputs` and exporting `LC_ALL=en_US.utf-8`.
- Tests that attempt to access `$HOME` can be fixed by using the following work-around before running tests (e.g. `preCheck`): `export HOME=$(mktemp -d)`

## FAQ
@@ -1123,6 +1129,14 @@ LLVM implementation. To use that one instead, Intel recommends users set it with
Note that `mkl` is only available on `x86_64-{linux,darwin}` platforms;
moreover, Hydra is not building and distributing pre-compiled binaries using it.

### What inputs do `setup_requires`, `install_requires` and `tests_require` map to?

In a `setup.py` or `setup.cfg` it is common to declare dependencies:

* `setup_requires` corresponds to `nativeBuildInputs`
* `install_requires` corresponds to `propagatedBuildInputs`
* `tests_require` corresponds to `checkInputs`

## Contributing

### Contributing guidelines
5 changes: 5 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
@@ -5286,4 +5286,9 @@
github = "shmish111";
name = "David Smith";
};
minijackson = {
email = "minijackson@riseup.net";
github = "minijackson";
name = "Rémi Nicole";
};
}
28 changes: 14 additions & 14 deletions nixos/doc/manual/release-notes/rl-1903.xml
Original file line number Diff line number Diff line change
@@ -182,6 +182,20 @@
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>
The <varname>buildPythonPackage</varname> function now sets <varname>strictDeps = true</varname>
to help distinguish between native and non-native dependencies in order to
improve cross-compilation compatibility. Note however that this may break
user expressions.
</para>
</listitem>
<listitem>
<para>
The <varname>buildPythonPackage</varname> function now sets <varname>LANG = C.UTF-8</varname>
to enable Unicode support. The <varname>glibcLocales</varname> package is no longer needed as a build input.
</para>
</listitem>
<listitem>
<para>
The Syncthing state and configuration data has been moved from
@@ -566,20 +580,6 @@
use <literal>nixos-rebuild boot; reboot</literal>.
</para>
</listitem>
<listitem>
<para>
Symlinks in <filename>/etc</filename> (except <filename>/etc/static</filename>)
are now relative instead of absolute. This makes possible to examine
NixOS container's <filename>/etc</filename> directory from host system
(previously it pointed to host <filename>/etc</filename> when viewed from host,
and to container <filename>/etc</filename> when viewed from container chroot).
</para>
<para>
This also makes <filename>/etc/os-release</filename> adhere to
<link xlink:href="https://www.freedesktop.org/software/systemd/man/os-release.html">the standard</link>
for NixOS containers.
</para>
</listitem>
<listitem>
<para>
Flat volumes are now disabled by default in <literal>hardware.pulseaudio</literal>.
2 changes: 1 addition & 1 deletion nixos/modules/config/no-x-libs.nix
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ with lib;
networkmanager-openvpn = super.networkmanager-openvpn.override { withGnome = false; };
networkmanager-vpnc = super.networkmanager-vpnc.override { withGnome = false; };
networkmanager-iodine = super.networkmanager-iodine.override { withGnome = false; };
pinentry = super.pinentry_ncurses;
pinentry = super.pinentry.override { gtk2 = null; qt = null; };
gobject-introspection = super.gobject-introspection.override { x11Support = false; };
}));
};
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
@@ -528,6 +528,7 @@
./services/networking/cntlm.nix
./services/networking/connman.nix
./services/networking/consul.nix
./services/networking/coredns.nix
./services/networking/coturn.nix
./services/networking/dante.nix
./services/networking/ddclient.nix
53 changes: 53 additions & 0 deletions nixos/modules/programs/fish.nix
Original file line number Diff line number Diff line change
@@ -169,6 +169,59 @@ in
end
'';

programs.fish.interactiveShellInit = ''
# add completions generated by NixOS to $fish_complete_path
begin
# joins with null byte to acommodate all characters in paths, then respectively gets all paths before (exclusive) / after (inclusive) the first one including "generated_completions",
# splits by null byte, and then removes all empty lines produced by using 'string'
set -l prev (string join0 $fish_complete_path | string match --regex "^.*?(?=\x00[^\x00]*generated_completions.*)" | string split0 | string match -er ".")
set -l post (string join0 $fish_complete_path | string match --regex "[^\x00]*generated_completions.*" | string split0 | string match -er ".")
set fish_complete_path $prev "/etc/fish/generated_completions" $post
end
'';

environment.etc."fish/generated_completions".source =
let
patchedGenerator = pkgs.stdenv.mkDerivation {
name = "fish_patched-completion-generator";
srcs = [
"${pkgs.fish}/share/fish/tools/create_manpage_completions.py"
"${pkgs.fish}/share/fish/tools/deroff.py"
];
unpackCmd = "cp $curSrc $(basename $curSrc)";
sourceRoot = ".";
patches = [ ./fish_completion-generator.patch ]; # to prevent collisions of identical completion files
dontBuild = true;
installPhase = ''
mkdir -p $out
cp * $out/
'';
preferLocalBuild = true;
allowSubstitutes = false;
};
generateCompletions = package: pkgs.runCommand
"${package.name}_fish-completions"
(
{
inherit package;
preferLocalBuild = true;
allowSubstitutes = false;
}
// optionalAttrs (package ? meta.priority) { meta.priority = package.meta.priority; }
)
''
mkdir -p $out
if [ -d $package/share/man ]; then
find $package/share/man -type f | xargs ${pkgs.python3.interpreter} ${patchedGenerator}/create_manpage_completions.py --directory $out >/dev/null
fi
'';
in
pkgs.buildEnv {
name = "system_fish-completions";
ignoreCollisions = true;
paths = map generateCompletions config.environment.systemPackages;
};

# include programs that bring their own completions
environment.pathsToLink = []
++ optional cfg.vendor.config.enable "/share/fish/vendor_conf.d"
11 changes: 11 additions & 0 deletions nixos/modules/programs/fish_completion-generator.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/create_manpage_completions.py
+++ b/create_manpage_completions.py
@@ -776,8 +776,6 @@ def parse_manpage_at_path(manpage_path, output_directory):

built_command_output.insert(0, "# " + CMDNAME)

- # Output the magic word Autogenerated so we can tell if we can overwrite this
- built_command_output.insert(1, "# Autogenerated from man page " + manpage_path)
# built_command_output.insert(2, "# using " + parser.__class__.__name__) # XXX MISATTRIBUTES THE CULPABILE PARSER! Was really using Type2 but reporting TypeDeroffManParser

for line in built_command_output:
4 changes: 2 additions & 2 deletions nixos/modules/services/monitoring/datadog-agent.nix
Original file line number Diff line number Diff line change
@@ -202,7 +202,7 @@ in {
};
};
config = mkIf cfg.enable {
environment.systemPackages = [ datadogPkg pkgs.sysstat pkgs.procps ];
environment.systemPackages = [ datadogPkg pkgs.sysstat pkgs.procps pkgs.iproute ];

users.extraUsers.datadog = {
description = "Datadog Agent User";
@@ -216,7 +216,7 @@ in {

systemd.services = let
makeService = attrs: recursiveUpdate {
path = [ datadogPkg pkgs.python pkgs.sysstat pkgs.procps ];
path = [ datadogPkg pkgs.python pkgs.sysstat pkgs.procps pkgs.iproute ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = "datadog";
50 changes: 50 additions & 0 deletions nixos/modules/services/networking/coredns.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{ config, lib, pkgs, ... }:

with lib;

let
cfg = config.services.coredns;
configFile = pkgs.writeText "Corefile" cfg.config;
in {
options.services.coredns = {
enable = mkEnableOption "Coredns dns server";

config = mkOption {
default = "";
example = ''
. {
whoami
}
'';
type = types.lines;
description = "Verbatim Corefile to use. See <link xlink:href=\"https://coredns.io/manual/toc/#configuration\"/> for details.";
};

package = mkOption {
default = pkgs.coredns;
defaultText = "pkgs.coredns";
type = types.package;
description = "Coredns package to use.";
};
};

config = mkIf cfg.enable {
systemd.services.coredns = {
description = "Coredns dns server";
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
PermissionsStartOnly = true;
LimitNPROC = 512;
LimitNOFILE = 1048576;
CapabilityBoundingSet = "cap_net_bind_service";
AmbientCapabilities = "cap_net_bind_service";
NoNewPrivileges = true;
DynamicUser = true;
ExecStart = "${getBin cfg.package}/bin/coredns -conf=${configFile}";
ExecReload = "${pkgs.coreutils}/bin/kill -SIGUSR1 $MAINPID";
Restart = "on-failure";
};
};
};
}
3 changes: 3 additions & 0 deletions nixos/modules/services/x11/desktop-managers/mate.nix
Original file line number Diff line number Diff line change
@@ -98,10 +98,13 @@ in
];

services.gnome3.gnome-keyring.enable = true;
services.gnome3.gvfs.enable = true;
services.upower.enable = config.powerManagement.enable;

security.pam.services."mate-screensaver".unixAuth = true;

environment.variables.GIO_EXTRA_MODULES = [ "${pkgs.gnome3.gvfs}/lib/gio/modules" ];

environment.pathsToLink = [ "/share" ];
};

2 changes: 1 addition & 1 deletion nixos/modules/services/x11/desktop-managers/xfce.nix
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ in

# Supplies some abstract icons such as:
# utilities-terminal, accessories-text-editor
gnome3.defaultIconTheme
gnome3.adwaita-icon-theme

hicolor-icon-theme
tango-icon-theme
Original file line number Diff line number Diff line change
@@ -96,8 +96,8 @@ in

package = mkOption {
type = types.package;
default = pkgs.gnome3.defaultIconTheme;
defaultText = "pkgs.gnome3.defaultIconTheme";
default = pkgs.gnome3.adwaita-icon-theme;
defaultText = "pkgs.gnome3.adwaita-icon-theme";
description = ''
The package path that contains the icon theme given in the name option.
'';
@@ -116,8 +116,8 @@ in
cursorTheme = {

package = mkOption {
default = pkgs.gnome3.defaultIconTheme;
defaultText = "pkgs.gnome3.defaultIconTheme";
default = pkgs.gnome3.adwaita-icon-theme;
defaultText = "pkgs.gnome3.adwaita-icon-theme";
description = ''
The package path that contains the cursor theme given in the name option.
'';
15 changes: 5 additions & 10 deletions nixos/modules/system/etc/make-etc.sh
Original file line number Diff line number Diff line change
@@ -10,11 +10,6 @@ users_=($users)
groups_=($groups)
set +f

# Create relative symlinks, so that the links can be followed if
# the NixOS installation is not mounted as filesystem root.
# Absolute symlinks violate the os-release format
# at https://www.freedesktop.org/software/systemd/man/os-release.html
# and break e.g. systemd-nspawn and os-prober.
for ((i = 0; i < ${#targets_[@]}; i++)); do
source="${sources_[$i]}"
target="${targets_[$i]}"
@@ -24,28 +19,28 @@ for ((i = 0; i < ${#targets_[@]}; i++)); do
# If the source name contains '*', perform globbing.
mkdir -p $out/etc/$target
for fn in $source; do
ln -s --relative "$fn" $out/etc/$target/
ln -s "$fn" $out/etc/$target/
done

else

mkdir -p $out/etc/$(dirname $target)
if ! [ -e $out/etc/$target ]; then
ln -s --relative $source $out/etc/$target
ln -s $source $out/etc/$target
else
echo "duplicate entry $target -> $source"
if test "$(readlink $out/etc/$target)" != "$source"; then
echo "mismatched duplicate entry $(readlink $out/etc/$target) <-> $source"
exit 1
fi
fi

if test "${modes_[$i]}" != symlink; then
echo "${modes_[$i]}" > $out/etc/$target.mode
echo "${users_[$i]}" > $out/etc/$target.uid
echo "${groups_[$i]}" > $out/etc/$target.gid
fi

fi
done

19 changes: 2 additions & 17 deletions nixos/modules/system/etc/setup-etc.pl
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
use File::Path;
use File::Basename;
use File::Slurp;
use File::Spec;

my $etc = $ARGV[0] or die;
my $static = "/etc/static";
@@ -18,20 +17,6 @@ sub atomicSymlink {
return 1;
}

# Create relative symlinks, so that the links can be followed if
# the NixOS installation is not mounted as filesystem root.
# Absolute symlinks violate the os-release format
# at https://www.freedesktop.org/software/systemd/man/os-release.html
# and break e.g. systemd-nspawn and os-prober.
sub atomicRelativeSymlink {
my ($source, $target) = @_;
my $tmp = "$target.tmp";
unlink $tmp;
my $rel = File::Spec->abs2rel($source, dirname $target);
symlink $rel, $tmp or return 0;
rename $tmp, $target or return 0;
return 1;
}

# Atomically update /etc/static to point at the etc files of the
# current configuration.
@@ -118,7 +103,7 @@ sub link {
if (-e "$_.mode") {
my $mode = read_file("$_.mode"); chomp $mode;
if ($mode eq "direct-symlink") {
atomicRelativeSymlink readlink("$static/$fn"), $target or warn;
atomicSymlink readlink("$static/$fn"), $target or warn;
} else {
my $uid = read_file("$_.uid"); chomp $uid;
my $gid = read_file("$_.gid"); chomp $gid;
@@ -132,7 +117,7 @@ sub link {
push @copied, $fn;
print CLEAN "$fn\n";
} elsif (-l "$_") {
atomicRelativeSymlink "$static/$fn", $target or warn;
atomicSymlink "$static/$fn", $target or warn;
}
}

Loading