Skip to content

user-units conflict with packages #33233

Closed

Description

@jtojnar

When a package contains a directory in one of the systemd directories (like flatpak does), it is symlinked into the *-units derivation:

Then later, the derivation will try to create the directory:

which will fail:

$ nixos-rebuild build-vm -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/afac8c61e9542ad04cd9da0cd53f2e2aaaf1aeab.tar.gz -I nixos-config=dbus-collision.nix
building Nix...
building the system configuration...
these derivations will be built:
  /nix/store/q7iwii64xvgalffh5hc6ri61zr5q04yl-user-units.drv
  /nix/store/jz8761r0akvbja2sqgjxhla2cb5yjdkj-etc.drv
  /nix/store/xq3ldd72j8678icjxc1ja01h1bidkic0-nixos-system-nixos-18.03pre-git.drv
  /nix/store/gl6w1408n7bm37h01hwz85qq4c17a8hh-closure-info.drv
  /nix/store/5pskg6ybx5pflm23ih8x8vbkpvc0jd5p-run-nixos-vm.drv
  /nix/store/d8jiyxbay3v1g8vvmacvvzkv3cq2gmxc-nixos-vm.drv
building '/nix/store/q7iwii64xvgalffh5hc6ri61zr5q04yl-user-units.drv'...
mkdir: cannot create directory '/nix/store/pf3vkdl7nwhh1fvd7cy420jjinqvan5n-user-units/dbus.service.d': File exists
builder for '/nix/store/q7iwii64xvgalffh5hc6ri61zr5q04yl-user-units.drv' failed with exit code 1
cannot build derivation '/nix/store/jz8761r0akvbja2sqgjxhla2cb5yjdkj-etc.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/xq3ldd72j8678icjxc1ja01h1bidkic0-nixos-system-nixos-18.03pre-git.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/gl6w1408n7bm37h01hwz85qq4c17a8hh-closure-info.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/5pskg6ybx5pflm23ih8x8vbkpvc0jd5p-run-nixos-vm.drv': 2 dependencies couldn't be built
cannot build derivation '/nix/store/d8jiyxbay3v1g8vvmacvvzkv3cq2gmxc-nixos-vm.drv': 2 dependencies couldn't be built
error: build of '/nix/store/d8jiyxbay3v1g8vvmacvvzkv3cq2gmxc-nixos-vm.drv' failed

You can reproduce it with the following configuration:

{ pkgs, ... }:
let
  conflictingDerivation = pkgs.stdenv.mkDerivation {
    name = "conflicting-derivation";
    phases = [ "installPhase" ];
    installPhase = ''
      mkdir -p "$out/lib/systemd/user/dbus.service.d"
    '';
  };
in {
  systemd.packages = [ conflictingDerivation ];
}

Activity

  1. added
    0.kind: bug
    6.topic: nixos
    on Dec 31, 2017
  2. added a commit that references this issue on Jan 24, 2018
    2cf50b7
  3. moved this to Done in GNOMEon Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bug6.topic: nixos

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions