Pcloud - Update

Bonjour à tous,

J’ai installé Pcloud avec la commande :
“nix-env -f channel:nixos-22.11 -iA pcloud”.
Et je voudrais mettre à jour Pcloud.
Est ce que :
“nix-env -f channel:nixos-24.05 -iA pcloud”.
Ecrasera l’ancien ? ou j’en aurais 2 ?
Sinon j’accepte toute autre proposition.

➜ nix-env -f channel:nixos-24.05 -iA pcloud
replacing old 'pcloud-1.9.9'
installing 'pcloud-1.14.5'
building '/nix/store/9gn3sf5jnvka32vgqb9d4scn5vp8shq1-user-environment.drv'...

Très explicite.
A priori ça ne marche pas.

➜ pcloud --version
/nix/store/vnwdak3n1w2jjil119j65k8mw1z23p84-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.38' not found (required by /nix/store/zxb1ialf3csjzvv3j6w7dhap235rjrmh-gvfs-1.54.2/lib/gio/modules/libgvfsdbus.so)
Failed to load module: /nix/store/zxb1ialf3csjzvv3j6w7dhap235rjrmh-gvfs-1.54.2/lib/gio/modules/libgvfsdbus.so
osVersion -> NixOS 24.11 (Vicuna) x64
appVersion -> 1.9.9
/nix/store/xj09bp6qdnf5aswgw9wpjcx2n9267ggp-dconf-0.40.0-lib/lib/gio/modules/libdconfsettings.so: undefined symbol: g_assertion_message_cmpint
Failed to load module: /nix/store/xj09bp6qdnf5aswgw9wpjcx2n9267ggp-dconf-0.40.0-lib/lib/gio/modules/libdconfsettings.so
init failed
Error reading OS release info: Error: Cannot find module '../screen'
➜ nix-env -f channel:nixos-unstable -iA pcloud
replacing old 'pcloud-1.9.9'
installing 'pcloud-1.14.6'
building '/nix/store/zdy84p7v5vzrhm0kq3zkad73spi9fxsw-user-environment.drv'...
➜ pcloud --version
fish: Job 1, 'pcloud --version' terminated by signal SIGSEGV (Address boundary error)

Il y a des workarounds dans cette issue là.

1 Like

nicos-rebuild switch in /etc/nixos/configuration.nix >> it’s good
but this

➜ rebuild --flake .
warning: Git tree '/home/gg/.dotfiles' is dirty
error:
       … while calling the 'seq' builtin

         at /nix/store/sfycwi72zfjsspidinx56ajaiffpyh17-source/lib/modules.nix:334:18:

          333|         options = checked options;
          334|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          335|         _module = checked (config._module);

       … while evaluating a branch condition

         at /nix/store/sfycwi72zfjsspidinx56ajaiffpyh17-source/lib/modules.nix:273:9:

          272|       checkUnmatched =
          273|         if config._module.check && config._module.freeformType == null && merged.unmatchedDefns != [] then
             |         ^
          274|           let

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: getting status of '/nix/store/z5y1a9zs3254sg4rrpf7m9s6pk8qdh88-source/pcloud.nix': No such file or directory

Il semble que tu fais “imports = [ pcloud.nix ]” quelque part, alors que ce fichier n’existe pas? Ou le chemin vers le fichier n’est pas bon?

# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      ./pcloud.nix
      ./gnome.nix
      ./hdd.nix
      ./vm.nix
    ];
➜ ls
drwxr-xr-x    - gg 16 Aug 18:57 .git
.rw-r--r-- 3.9k gg 19 Aug 14:37 configuration.nix
.rw-r--r-- 2.1k gg 15 Aug 15:05 flake.lock
.rw-r--r--  738 gg 15 Aug 16:55 flake.nix
.rwxr-xr-x  577 gg 15 Aug 13:03 gnome.nix
.rw-r--r-- 1.6k gg 15 Aug 11:56 hardware-configuration.nix
.rwxr-xr-x  814 gg 15 Aug 13:03 hdd.nix
.rw-r--r--  877 gg 16 Aug 18:32 home.nix
.rw-r--r-- 1.1k gg 19 Aug 13:12 pcloud.nix
.rwxr-xr-x  706 gg 15 Aug 13:03 vm.nix

Tu as fait git add pcloud.nix? Sinon nix ne le prendra pas en compte.

Je suis un débutant avec git, je suis loin de maîtriser.

[14:52:30]  gg  on nixos ~/.dotfiles  main [!?] +1
➜ git add pcloud.nix

[14:52:40]  gg  on nixos ~/.dotfiles  main [!+] +1
➜ rebuild --flake .
warning: Git tree '/home/gg/.dotfiles' is dirty
building the system configuration...
warning: Git tree '/home/gg/.dotfiles' is dirty
error:
       … while calling the 'head' builtin

         at /nix/store/sfycwi72zfjsspidinx56ajaiffpyh17-source/lib/attrsets.nix:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/store/sfycwi72zfjsspidinx56ajaiffpyh17-source/lib/modules.nix:821:9:

          820|     in warnDeprecation opt //
          821|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          822|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'currentSystem' missing

       at /nix/store/xpns0xrmibrkm4gllybl6n7lgyandvrx-source/pkgs/top-level/impure.nix:17:43:

           16|   # (build, in GNU Autotools parlance) platform.
           17|   localSystem ? { system = args.system or builtins.currentSystem; }
             |                                           ^
           18|

pcloud.nix

{ pkgs, lib, ... }:

let
  pkgs_24_11 = import (pkgs.fetchFromGitHub {
    owner = "nixos";
    repo = "nixpkgs";
    rev = "f7c1500e2eefa58f3c80dd046cba256e10440201";
    hash = "sha256-sDd7QIcMbIb37nuqMrJElvuyE5eVgWuKGtIPP8IWwCc=";
  }) {
    config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
      "pcloud"
    ];
  };

  pcloud_24_11 = pkgs_24_11.pcloud.overrideAttrs (prev:
    let
      version = "1.14.6";
      code = "XZecm6VZIz4VKYBrUbzzhcfNW9boSfrfhgaV";
      # Archive link's codes: https://www.pcloud.com/release-notes/linux.html
      src = pkgs.fetchzip {
        url = "https://api.pcloud.com/getpubzip?code=${code}&filename=${prev.pname}-${version}.zip";
        hash = "sha256-eJpwoVCI96Yow7WfVs3rRwC4D1kh7x7HuMFU7YEFHCM=";
      };

      appimageContents = pkgs.appimageTools.extractType2 {
        name = "${prev.pname}-${version}";
        src = "${src}/pcloud";
      };
    in
    {
      inherit version;
      src = appimageContents;
    });
in

{
  config.environment.systemPackages = [
    pcloud_24_11
  ];
}

J’ai fait une nouvelle installation de NixOS.
Installé Pcloud avec home-manager et bien sûr il ne se lançait pas.
J’ai tenté de régler le probème :

fish: Job 1, 'pcloud --version' terminated by signal SIGSEGV (Address boundary error)

et
alias rebuild=‘sudo nixos-rebuild switch’

➜ rebuild --flake .
[sudo] password for gg:
building the system configuration...
updating GRUB 2 menu...
activating the configuration...
setting up /etc...
reloading user units for gg...
restarting sysinit-reactivation.target
the following new units were started: libvirtd.service

ensuite j’ai voulu “nix-env -f channel:nixos-22.11 -iA pcloud”.
et

➜ nix-env -f channel:nixos-22.11 -iA pcloud
installing 'pcloud-1.9.9'
building '/nix/store/zf9102ar77vwm5kcf5yqzd8jnf6paala-user-environment.drv'...
warning: skipping dangling symlink '/nix/store/fxpkx72wh4pfpxc61ia4l5gblaaw7710-user-environment/app/pcloud.png'
error: Unable to build profile. There is a conflict for the following files:

         /nix/store/nji95nv9a2wr1zbcr05jndz6c43f3gwg-pcloud-1.9.9/app/LICENSES.chromium.html
         /nix/store/xwicillqb2ahl26zrl7mcy3yqa5jfvxx-home-manager-path/app/LICENSES.chromium.html
error: builder for '/nix/store/zf9102ar77vwm5kcf5yqzd8jnf6paala-user-environment.drv' failed with exit code 1;
       last 4 log lines:
       > error: Unable to build profile. There is a conflict for the following files:
       >
       >          /nix/store/nji95nv9a2wr1zbcr05jndz6c43f3gwg-pcloud-1.9.9/app/LICENSES.chromium.html
       >          /nix/store/xwicillqb2ahl26zrl7mcy3yqa5jfvxx-home-manager-path/app/LICENSES.chromium.html
       For full logs, run 'nix log /nix/store/zf9102ar77vwm5kcf5yqzd8jnf6paala-user-environment.drv'.

Je suppose que c’est la première installation de Pcloud avec home-manager qui crée un conflit.
Je ne sais pas comment le résoudre.

J’ai ajouté home.nix dans flake.nix et voilà le resultat.
Et pcloud.nix :

{ pkgs, ... }:
let
  patchelfFixes = pkgs.patchelfUnstable.overrideAttrs (_finalAttrs: _previousAttrs: {
    src = pkgs.fetchFromGitHub {
      owner = "Patryk27";
      repo = "patchelf";
      rev = "527926dd9d7f1468aa12f56afe6dcc976941fedb";
      sha256 = "sha256-3I089F2kgGMidR4hntxz5CKzZh5xoiUwUsUwLFUEXqE=";
    };
  });
  pcloudFixes = pkgs.pcloud.overrideAttrs (_finalAttrs:previousAttrs: {
    nativeBuildInputs = previousAttrs.nativeBuildInputs ++ [ patchelfFixes ];
  });
in
{
  nixpkgs.config.allowUnfree = true;
  environment.systemPackages = [
    pcloudFixes
  ];
}

Merci @Patryk27