A whole lot of changes to packages when overriding which nixpkgs instance i am using

Hey!

I’m trying to wrap my head around this and it’s probably a non-issue, but i am interested in installing 1password from nixpkgs-stable, while my “main” nixpkgs input is nixpkgs-unstable. I got this working by doing this:

      nixosConfigurations.knut = nixpkgs.lib.nixosSystem rec {
        system = "x86_64-linux";
        specialArgs = {
          pkgs-stable = import nixpkgs-stable {
            inherit system;
            config = {
              allowUnfree = true;
            };
          };
          inherit inputs outputs;
        };

And then in my apps.nix file:

  programs = {
    _1password = {
      enable = true;
      package = pkgs-stable._1password-cli;
    };
    _1password-gui = {
      enable = true;
      package = pkgs-stable._1password-gui;
      polkitPolicyOwners = [ "vicnil" ];
    };
  };

However when i run a rebuild of my system it changes a lot:

Version changes:
[D*]  #001  1password                         8.10.70 -> 8.10.48
[C.]  #002  alsa-lib                          1.2.13 x2 -> 1.2.12, 1.2.13 x2
[C.]  #003  alsa-topology-conf                1.2.5.1 x2 -> 1.2.5.1 x3
[C.]  #004  alsa-ucm-conf                     1.2.12 x2 -> 1.2.12 x3
[C.]  #005  at-spi2-core                      2.54.1 -> 2.54.1 x2
[C.]  #006  audit                             4.0.3-bin, 4.0.3-lib x2 -> 4.0, 4.0.3-bin, 4.0.3-lib x2
[C.]  #007  avahi                             0.8 x2 -> 0.8 x3
[C*]  #008  bash-interactive                  5.2p37 x3, 5.2p37-doc, 5.2p37-info, 5.2p37-man x2 -> 5.2p37 x4, 5.2p37-doc, 5.2p37-info, 5.2p37-man x2
[C*]  #009  bzip2                             1.0.8 x3, 1.0.8-bin x2, 1.0.8-man -> 1.0.8 x3, 1.0.8-bin x3, 1.0.8-man
[C.]  #010  cairo                             1.18.2 x2 -> 1.18.2 x3
[C.]  #011  cracklib                          2.10.0 x2 -> 2.10.0 x3
[C*]  #012  cryptsetup                        2.7.5 x2, 2.7.5-bin, 2.7.5-man -> 2.7.5 x3, 2.7.5-bin, 2.7.5-man
[C*]  #013  cups                              2.4.11, 2.4.11-lib, 2.4.11-man -> 2.4.11, 2.4.11-lib x2, 2.4.11-man
[C*]  #014  curl                              8.12.1 x4, 8.12.1-bin x2, 8.12.1-man x2 -> 8.12.1 x5, 8.12.1-bin x2, 8.12.1-man x2
[C.]  #015  db                                4.8.30 x2, 5.3.28 -> 4.8.30 x3, 5.3.28
[C*]  #016  dbus                              1, 1.14.10, 1.14.10-dev, 1.14.10-doc, 1.14.10-lib x2, 1.14.10-man -> 1, 1.14.10 x2, 1.14.10-dev, 1.14.10-doc, 1.14.10-lib x3, 1.14.10-man
[C*]  #017  dconf                             0.40.0, 0.40.0-lib x2 -> 0.40.0, 0.40.0-lib x3
[C.]  #018  dejavu-fonts-minimal              2.37 x2 -> 2.37 x3
[C.]  #019  dns-root-data                     2024-06-20 x2 -> 2024-06-20 x3
[C.]  #020  elfutils                          0.192 x2 -> 0.191, 0.192 x2
[C.]  #021  file                              5.46 x2, 5.46-man -> 5.45, 5.46 x2, 5.46-man
[C*]  #022  fontconfig                        2.16.0 x2, 2.16.0-bin, 2.16.0-lib x2 -> 2.15.0, 2.15.0-lib, 2.16.0 x2, 2.16.0-bin, 2.16.0-lib x2
[C.]  #023  freetype                          2.13.3 x2 -> 2.13.3 x3
[C.]  #024  fribidi                           1.0.16 x2 -> 1.0.16 x3
[C*]  #025  gawk                              5.3.1, 5.3.1-info, 5.3.1-man -> 5.3.1 x2, 5.3.1-info, 5.3.1-man
[C.]  #026  gdk-pixbuf                        2.42.12 -> 2.42.12 x2
[C*]  #027  getent-glibc                      2.40-66 x2 -> 2.40-66 x3
[C.]  #028  giflib                            5.2.2 x2 -> 5.2.2 x3
[C.]  #029  glib                              2.82.5 x2, 2.82.5-bin, 2.82.5-dev -> 2.82.1, 2.82.1-bin, 2.82.5 x2, 2.82.5-bin, 2.82.5-dev
[C*]  #030  glibc                             2.40-66 x3, 2.40-66-bin, 2.40-66-dev, 2.40-66-getent x2 -> 2.40-66 x3, 2.40-66-bin, 2.40-66-dev, 2.40-66-getent x3
[C.]  #031  gmp-with-cxx                      6.3.0 x5 -> 6.3.0 x6
[C*]  #032  gnugrep                           3.11 x2, 3.11-info -> 3.11 x3, 3.11-info
[C*]  #033  gnupg                             2.4.7 x3 -> 2.4.5, 2.4.7 x3
[C*]  #034  gnused                            4.9, 4.9-info -> 4.9 x2, 4.9-info
[C*]  #035  gnutar                            1.35 x2, 1.35-info -> 1.35 x3, 1.35-info
[C.]  #036  gnutls                            3.8.9 x2 -> 3.8.6, 3.8.9 x2
[C.]  #037  gobject-introspection             1.82.0 -> 1.82.0 x2
[C.]  #038  graphite2                         1.3.14 x2 -> 1.3.14 x3
[C.]  #039  gsettings-desktop-schemas         47.1 -> 47.1 x2
[C.]  #040  gtk+3                             3.24.48 -> 3.24.43, 3.24.48
[C*]  #041  gzip                              1.13 x2, 1.13-info, 1.13-man -> 1.13 x3, 1.13-info, 1.13-man
[C.]  #042  harfbuzz                          10.2.0 x2 -> 10.0.1, 10.2.0 x2
[C.]  #043  hwdata                            0.393 x2 -> 0.390, 0.393 x2
[C.]  #044  icu4c                             75.1, 76.1 x2, 76.1-dev -> 74.2, 75.1, 76.1 x2, 76.1-dev
[C*]  #045  iptables                          1.8.11 x2, 1.8.11-man -> 1.8.10, 1.8.11 x2, 1.8.11-man
[C.]  #046  iso-codes                         4.17.0 x2 -> 4.17.0 x3
[C.]  #047  jq                                1.7.1, 1.7.1-bin, 1.7.1-man -> 1.7.1 x2, 1.7.1-bin x2, 1.7.1-man
[C.]  #048  json-c                            0.18 x2 -> 0.17, 0.18 x2
[C.]  #049  json-glib                         1.10.6 -> 1.10.0, 1.10.6
[C*]  #050  kbd                               2.7.1 x2 -> 2.6.4, 2.7.1 x2
[C*]  #051  kexec-tools                       2.0.29 x2 -> 2.0.29 x3
[C*]  #052  kmod                              31 x2, 31-lib x2 -> 31 x3, 31-lib x3
[C.]  #053  lerc                              4.0.0 x2 -> 4.0.0 x3
[C.]  #054  libX11                            1.8.12 x2 -> 1.8.10, 1.8.12 x2
[C.]  #055  libXau                            1.0.12 x2 -> 1.0.11, 1.0.12 x2
[C.]  #056  libXcomposite                     0.4.6 -> 0.4.6 x2
[C.]  #057  libXcursor                        1.2.3 -> 1.2.2, 1.2.3
[C.]  #058  libXdamage                        1.1.6 -> 1.1.6 x2
[C.]  #059  libXdmcp                          1.1.5 x2 -> 1.1.5 x3
[C.]  #060  libXext                           1.3.6 x2 -> 1.3.6 x3
[C.]  #061  libXfixes                         6.0.1 x2 -> 6.0.1 x3
[C.]  #062  libXft                            2.3.8 x2 -> 2.3.8 x3
[C.]  #063  libXi                             1.8.2 x2 -> 1.8.2 x3
[C.]  #064  libXinerama                       1.1.5 -> 1.1.5 x2
[C.]  #065  libXrandr                         1.5.4 -> 1.5.4 x2
[C.]  #066  libXrender                        0.9.12 x2 -> 0.9.11, 0.9.12 x2
[C.]  #067  libXtst                           1.2.5 -> 1.2.5 x2
[C.]  #068  libapparmor                       4.0.3 x2 -> 4.0.3 x3
[C.]  #069  libappindicator-gtk3              12.10.1+20.10.20200706.1 -> 12.10.1+20.10.20200706.1 x2
[C.]  #070  libarchive                        3.7.7-lib x2 -> 3.7.7-lib x3
[C.]  #071  libassuan                         3.0.2 x2 -> 2.5.7, 3.0.2 x2
[C.]  #072  libbpf                            1.5.0 x2 -> 1.4.7, 1.5.0 x2
[C*]  #073  libcap                            2.74, 2.74-doc, 2.74-lib x2, 2.74-man -> 2.70-lib, 2.74, 2.74-doc, 2.74-lib x2, 2.74-man
[C.]  #074  libcbor                           0.11.0 x2 -> 0.11.0 x3
[C.]  #075  libdaemon                         0.14 x2 -> 0.14 x3
[C.]  #076  libdatrie                         2019-12-20-lib x2 -> 2019-12-20-lib x3
[C.]  #077  libdbusmenu-gtk3                  16.04.0 -> 16.04.0 x2
[C.]  #078  libdeflate                        1.23 x2 -> 1.22, 1.23 x2
[C.]  #079  libdrm                            2.4.124 x2, 2.4.124-bin, 2.4.124-dev -> 2.4.123, 2.4.124 x2, 2.4.124-bin, 2.4.124-dev
[C.]  #080  libepoxy                          1.5.10 -> 1.5.10 x2
[C.]  #081  libevent                          2.1.12 x2 -> 2.1.12 x3
[C.]  #082  libfido2                          1.15.0 x2 -> 1.15.0 x3
[C.]  #083  libgcrypt                         1.10.3-lib x2 -> 1.10.3-lib x3
[C.]  #084  libglvnd                          1.7.0 x2 -> 1.7.0 x3
[C.]  #085  libgpg-error                      1.51 x2 -> 1.50, 1.51 x2
[C.]  #086  libjpeg-turbo                     3.0.4 x2 -> 3.0.4 x3
[C.]  #087  libmicrohttpd                     1.0.1 x2 -> 1.0.1 x3
[C.]  #088  libmnl                            1.0.5 x2 -> 1.0.5 x3
[C.]  #089  libnetfilter_conntrack            1.1.0 x2 -> 1.1.0 x3
[C.]  #090  libnfnetlink                      1.0.2 x2 -> 1.0.2 x3
[C.]  #091  libnftnl                          1.2.8 x2 -> 1.2.8 x3
[C.]  #092  libnl                             3.11.0 x2 -> 3.10.0, 3.11.0 x2
[C.]  #093  libpcap                           1.10.5 x2 -> 1.10.5 x3
[C.]  #094  libpciaccess                      0.18.1 x2 -> 0.18.1 x3
[C.]  #095  libpng-apng                       1.6.46 x2 -> 1.6.43, 1.6.46 x2
[C.]  #096  libpsl                            0.21.5 x2 -> 0.21.5 x3
[C.]  #097  libpwquality                      1.4.5-lib x2 -> 1.4.5-lib x3
[C.]  #098  librsvg                           2.59.2 -> 2.58.3, 2.59.2
[C.]  #099  libseccomp                        2.6.0-lib x2 -> 2.5.5-lib, 2.6.0-lib x2
[C.]  #100  libselinux                        3.8 x2 -> 3.7, 3.8 x2
[C.]  #101  libsoup                           2.74.3, 3.6.4 -> 2.74.3, 3.6.1, 3.6.4
[C.]  #102  libssh2                           1.11.1 x2 -> 1.11.1 x3
[C.]  #103  libtasn1                          4.20.0 x2 -> 4.20.0 x3
[C.]  #104  libthai                           0.1.29 x2 -> 0.1.29 x3
[C.]  #105  libtiff                           4.7.0 x2 -> 4.7.0 x3
[C.]  #106  libwebp                           1.5.0 x4 -> 1.4.0, 1.5.0 x4
[C.]  #107  libxcb                            1.17.0 x2 -> 1.17.0 x3
[C.]  #108  libxkbcommon                      1.7.0 -> 1.7.0 x2
[C.]  #109  libxshmfence                      1.3.3 -> 1.3.2, 1.3.3
[C*]  #110  linux-pam                         1.6.1 x2, 1.6.1-doc, 1.6.1-man -> 1.6.1 x3, 1.6.1-doc, 1.6.1-man
[C.]  #111  llvm                              19.1.7-lib -> 18.1.8-lib, 19.1.7-lib
[C*]  #112  lm-sensors                        3.6.0, 3.6.0-bin, 3.6.0-doc, 3.6.0-man -> 3.6.0 x2, 3.6.0-bin, 3.6.0-doc, 3.6.0-man
[C*]  #113  lvm2                              2.03.31, 2.03.31-bin, 2.03.31-lib x2, 2.03.31-man -> 2.03.31, 2.03.31-bin, 2.03.31-lib x3, 2.03.31-man
[C.]  #114  lz4                               1.10.0-lib x2 -> 1.10.0-lib x3
[C.]  #115  mesa                              25.0.3 -> 24.2.8, 25.0.3
[C*]  #116  net-tools                         2.10 -> 2.10 x2
[C.]  #117  nettle                            3.10.1 x2 -> 3.10, 3.10.1 x2
[C.]  #118  nghttp2                           1.64.0-lib x2 -> 1.64.0-lib x3
[C.]  #119  npth                              1.8 x2 -> 1.7, 1.8 x2
[C.]  #120  nspr                              4.36 -> 4.36 x2
[C.]  #121  nss                               3.101.2, 3.110 -> 3.101.2 x2, 3.110
[C.]  #122  oniguruma                         6.9.10-lib -> 6.9.9-lib, 6.9.10-lib
[C.]  #123  p11-kit                           0.25.5 x2, 0.25.5-bin -> 0.25.5 x3, 0.25.5-bin
[C.]  #124  pango                             1.56.1 x2, 1.56.1-bin -> 1.54.0, 1.56.1 x2, 1.56.1-bin
[C.]  #125  pcre2                             10.44 x2 -> 10.44 x3
[C.]  #126  pcsclite                          2.3.0, 2.3.0-lib x2 -> 2.3.0, 2.3.0-lib x3
[C*]  #127  perl                              5.40.0, 5.40.0-env x4, 5.40.0-man -> 5.40.0 x2, 5.40.0-env x4, 5.40.0-man
[C.]  #128  perl5.40.0-Clone                  0.46 -> 0.46 x2
[C.]  #129  perl5.40.0-Encode-Locale          1.05 -> 1.05 x2
[C.]  #130  perl5.40.0-File-BaseDir           0.09 -> 0.09 x2
[C.]  #131  perl5.40.0-File-DesktopEntry      0.22 -> 0.22 x2
[C.]  #132  perl5.40.0-File-Listing           6.16 -> 6.16 x2
[C.]  #133  perl5.40.0-File-MimeInfo          0.33 -> 0.33 x2
[C.]  #134  perl5.40.0-HTML-Parser            3.81 -> 3.81 x2
[C.]  #135  perl5.40.0-HTML-Tagset            3.20 -> 3.20 x2
[C.]  #136  perl5.40.0-HTTP-CookieJar         0.014 -> 0.014 x2
[C.]  #137  perl5.40.0-HTTP-Cookies           6.10 -> 6.10 x2
[C.]  #138  perl5.40.0-HTTP-Daemon            6.16 -> 6.16 x2
[C.]  #139  perl5.40.0-HTTP-Date              6.06 -> 6.06 x2
[C.]  #140  perl5.40.0-HTTP-Message           6.45 -> 6.45 x2
[C.]  #141  perl5.40.0-HTTP-Negotiate         6.01 -> 6.01 x2
[C.]  #142  perl5.40.0-IO-HTML                1.004 -> 1.004 x2
[C.]  #143  perl5.40.0-IPC-System-Simple      1.30 -> 1.30 x2
[C.]  #144  perl5.40.0-LWP-MediaTypes         6.04 -> 6.04 x2
[C.]  #145  perl5.40.0-Net-DBus               1.2.0 -> 1.2.0 x2
[C.]  #146  perl5.40.0-Net-HTTP               6.23 -> 6.23 x2
[C.]  #147  perl5.40.0-Test-Fatal             0.017 -> 0.017 x2
[C.]  #148  perl5.40.0-Test-Needs             0.002010 -> 0.002010 x2
[C.]  #149  perl5.40.0-Test-RequiresInternet  0.05 -> 0.05 x2
[C.]  #150  perl5.40.0-TimeDate               2.33 -> 2.33 x2
[C.]  #151  perl5.40.0-Try-Tiny               0.31 -> 0.31 x2
[C.]  #152  perl5.40.0-URI                    5.21 -> 5.21 x2
[C.]  #153  perl5.40.0-WWW-RobotRules         6.02 -> 6.02 x2
[C.]  #154  perl5.40.0-X11-Protocol           0.56 -> 0.56 x2
[C.]  #155  perl5.40.0-XML-Parser             2.46 -> 2.46 x2
[C.]  #156  perl5.40.0-XML-Twig               3.52 -> 3.52 x2
[C.]  #157  perl5.40.0-libwww-perl            6.72 -> 6.72 x2
[C.]  #158  pixman                            0.44.2 x2 -> 0.43.4, 0.44.2 x2
[C.]  #159  procmail                          3.24 -> 3.24 x2
[C*]  #160  procps                            4.0.4 -> 4.0.4 x2
[C.]  #161  publicsuffix-list                 0-unstable-2025-02-12 x2 -> 0-unstable-2024-10-25, 0-unstable-2025-02-12 x2
[C*]  #162  python3                           3.11.11, 3.12.9 x3, 3.12.9-env x3 -> 3.11.11, 3.12.8, 3.12.9 x3, 3.12.9-env x3
[C.]  #163  qrencode                          4.1.1 x2 -> 4.1.1 x3
[C*]  #164  shared-mime-info                  2.4 -> 2.4 x2
[C*]  #165  systemd                           <none>, 2.3.0-doc, 257.3 x2, 257.3-man -> <none>, 2.3.0-doc, 256.10, 257.3 x2, 257.3-man
[C.]  #166  systemd-minimal                   257.3 x2 -> 256.10, 257.3 x2
[C.]  #167  systemd-minimal-libs              257.3 x2 -> 256.10, 257.3 x2
[C.]  #168  tinysparql                        3.8.2 -> 3.8.1, 3.8.2
[C.]  #169  tpm2-tss                          4.1.3 x2 -> 4.1.3 x3
[C.]  #170  unbound                           1.22.0-lib x2 -> 1.22.0-lib x3
[C.]  #171  util-linux-minimal                2.40.4, 2.40.4-bin, 2.40.4-lib x2, 2.40.4-login x2, 2.40.4-man, 2.40.4-mount x2, 2.40.4-swap x2 -> 2.39.4-lib, 2.39.4-login, 2.39.4-mount, 2.39.4-swap, 2.40.4, 2.40.4-bin, 2.40.4-lib x2, 2.40.4-login x2, 2.40.4-man, 2.40.4-mount x2, 2.40.4-swap x2
[C.]  #172  vulkan-loader                     1.4.304.0 x2 -> 1.3.296.0, 1.4.304.0 x2
[C.]  #173  wayland                           1.23.1 x2 -> 1.23.1 x3
[C*]  #174  which                             2.23 -> 2.21, 2.23
[C.]  #175  xdg-user-dirs                     0.18 -> 0.18 x2
[C*]  #176  xdg-utils                         1.2.1 -> 1.2.1 x2
[C.]  #177  xkeyboard-config                  2.44 -> 2.43, 2.44
[C*]  #178  xz                                5.6.3, 5.6.4 x2, 5.6.4-bin x2, 5.6.4-doc, 5.6.4-man -> 5.6.3, 5.6.3-bin, 5.6.4 x2, 5.6.4-bin x2, 5.6.4-doc, 5.6.4-man
[C*]  #179  zstd                              0.1.3.0-doc, 1.5.6 x2, 1.5.6-bin x2, 1.5.6-man -> 0.1.3.0-doc, 1.5.6 x3, 1.5.6-bin x3, 1.5.6-man
Closure size: 2534 -> 2721 (205 paths added, 18 paths removed, delta +187, disk usage +1.0GiB).

Is this “normal” and are all the packages related to 1password? Or have i done an unintentional change that alters which nixpkgs instance that my nixos machine is using?

This is my flake.nix

{
  description = "Vinylen nixos config";

  inputs = {
    nixpkgs = {
      url = "github:nixos/nixpkgs/nixos-unstable";
    };
    nixpkgs-stable = {
      url = "github:nixos/nixpkgs/nixos-24.11";
    };
    home-manager = {
      url = "github:nix-community/home-manager/master";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    agenix = {
      url = "github:ryantm/agenix";
      inputs.nixpkgs.follows = "nixpkgs-stable";
    };
    nvf = {
      url = "github:notashelf/nvf";
    };
    niri = {
      url = "github:sodiboo/niri-flake";
    };
    lix-module = {
      url = "https://git.lix.systems/lix-project/nixos-module/archive/2.92.0-3.tar.gz";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs =
    {
      self,
      nixpkgs,
      nixpkgs-stable,
      agenix,
      niri,
      home-manager,
      lix-module,
      ...
    }@inputs:
    let
      inherit (self) outputs;
    in
    {
      formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree;
      nixosConfigurations.knut = nixpkgs.lib.nixosSystem rec {
        system = "x86_64-linux";
        specialArgs = {
          pkgs-stable = import nixpkgs-stable {
            inherit system;
            config = {
              allowUnfree = true;
            };
          };
          inherit inputs outputs;
        };
        modules = [
          ./hosts/knut/configuration.nix
          agenix.nixosModules.default
          niri.nixosModules.niri
          lix-module.nixosModules.default

          home-manager.nixosModules.home-manager
          {
            home-manager.useGlobalPkgs = true;
            home-manager.useUserPackages = true;
            home-manager.extraSpecialArgs = {
              inherit inputs outputs;
            };

            home-manager.users.vicnil = import ./hosts/knut/home.nix;
          }
          (import ./overlays)
        ];
      };

      nixosConfigurations.datamaskin = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = { inherit inputs nixpkgs-stable; };
        modules = [
          ./hosts/datamaskin/configuration.nix
          agenix.nixosModules.default
          niri.nixosModules.niri

          home-manager.nixosModules.home-manager
          {
            home-manager.useGlobalPkgs = true;
            home-manager.useUserPackages = true;
            home-manager.extraSpecialArgs = { inherit inputs; };

            home-manager.users.vicnil = import ./hosts/datamaskin/home.nix;
          }
          (import ./overlays)
        ];
      };
    };
}

Yes. In the nix world, a package doesn’t just consist of the outputs of its derivation, but also all dependency libraries that show up in the resulting binaries. We refer to this as the “closure”.

If you pay close attention, what’s happening is that you get an additional version of all those packages. Nix solves the diamond dependency problem by simply allowing packages to depend on different versions of the same library - that’s what the hashes n stuff in the nix store are for.

1password from stable will be linked against older versions of the libraries, or versions of the libraries which are built with older gccs or in turn link against older libraries. So nix needs to add another copy of all these libraries to your system just for 1password.

This is the most immediate downside of mixed-channel setups, too, you end up having duplicate versions of most packages, especially when you do this for GUI applications.

3 Likes

Thank you for the detailed answer! I marked it as the solution :slight_smile:

2 Likes