Signal-desktop -- how to upgrade to latest?

I have installed signal-desktop using home.nix, and it recently stopped working saying that there is a newer release that I must use. The installed version is 5.25.0.

The latest nixos package is version 5.31.1. I am on the stable nixos channel. How can I upgrade to the latest version. Running nix-channel --update and home-manager switch didn’t do it.

Is there a way to upgrade just that package. If I do, will I need to manually keep it up to date from now on?

Will switchting to the unstable channel solve my problem? If so, is that something that is easy to do?

What is the best approach?

You can switch to unstable, but that would switch your entire system to unstable. If you simply want a package from unstable, you can “pin nixpkgs”. Here’s an example:

let nixpkgsUnstable = import (builtins.fetchTarball {
  # Descriptive name to make the store path easier to identify
  name = "nixos-unstable-2018-09-12";
  # Commit hash for nixos-unstable as of 2018-09-12
  url = "https://github.com/nixos/nixpkgs/archive/ca2ba44cab47767c8127d1c8633e2b581644eb8f.tar.gz";
  # Hash obtained using `nix-prefetch-url --unpack <url>`
  sha256 = "1jg7g6cfpw8qvma0y19kwyp549k1qyf11a5sg6hvn6awvmkny47v";
}) {};
in ...

environment.systemPackages with pkgs; = [
...
nixpkgsUnstable.signal-desktop
...
];

Here’s some more information: FAQ/Pinning Nixpkgs - NixOS Wiki

1 Like

Thanks for the reply. Ah, pinning is what I was looking for.

I read that link you supplied, and found something similar here. This is what I did:

sudo nix-channel --add https://nixos.org/channels/nixpkgs-unstable unstable
sudo nix-channel --update

I was then going to make these changes in configuration.nix:

# Allow unstable packages.
nixpkgs.config = {
  allowUnfree = true;
  packageOverrides = pkgs: {
    unstable = import <unstable> {
      config = config.nixpkgs.config;
    };
  };
};

and:

  environment.systemPackages = with pkgs; [
        unstable.signal-desktop
  ];

But before editing configuration.nix as shown above, I ran sudo nixos-rebuild switch, and it appeared to upgrade every package to unstable.

This is what I get when I run sudo nix-channel --list:

nixos https://nixos.org/channels/nixos-21.11
unstable https://nixos.org/channels/nixpkgs-unstable

Did I just upgrade my whole system to unstable? What did I do wrong?

1 Like

No, you didn’t switch everything to unstable. That would have required replacing your existing nixos channel with the unstable one. You simply updated your stable channel.

Ah. So performing the occasional sudo nixos-rebuild switch and home-manager switch doesn’t update my installed packages? If not, then what did I do to accomplish that?

Is it when I do a sudo nix-channel --update that triggers updating of my packages?

It’s a little bit more nuanced.

Updating your channels allows nixos-rebuild to “see” the package updates. But it’s nixos-rebuild that actually performs the updates.

In other words, nixos-rebuild builds off the current snapshot of your channels, and updating the channels updates the snapshot.

1 Like

It just occurred to me that you shouldn’t have to use unstable in order to use signal. If upstream demands a version that is on unstable, then that version needs to be cherry-picked unto the stable branch. That can be done with a pull request.

I’m not on my PC at the moment, so I’ll create the PR tomorrow.

1 Like

Yeah, thanks. I did understand that.

And because I didn’t know how to upgrade packages, I assumed I needed to get the latest signal-desktop from unstable. Turned out it was on stable.

Which leads to my next question: How do I know when there are updated packages? Is there a command to check for updates?

1 Like

I don’t know of a command to check for updates, but if one doesn’t exist it should be trivial to make since the info comes from the repo on Github.

Hi, need somes help here.

I use unstable (with HM and Flake) and try to perform and update, but my package stay on 7.70.0

nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs.config.allowUnfree = true;

How are you updating?

Hello @NobbZ :slight_smile:

There is my way :

nix flake update
sudo nixos-rebuild switch --flake "$REPO_PATH#$(hostname)" --upgrade

If you are using flakes, --upgrade is ignored. You can omit it.

and are you actually using that input to build your system from? Do you have installed signal by another means that might shadow your system installation (which -a signal-desktop)?

Yes. This is my output :

which -a signal-desktop
/etc/profiles/per-user/heuzef/bin/signal-desktop

So it seems to be installed via users.users.heuzef.packages or home-manager.users.heuzef.home.packages with home-manager.useUserPackages enabled.

So my other quetions become relevant.

If you are unsure how to answer to those questions, can you share your configuration as a whole?

Thanks :slight_smile: There is my HM configuration :

{ config, pkgs, lib, ... }:

{
  home.username = "heuzef";
  home.homeDirectory = "/home/heuzef";
  home.stateVersion = "25.05"; # Please read the comment before changing.


  home.packages = with pkgs; [
...
    signal-desktop
...
  ];

  # VSCodium
  programs.vscode = {
    enable = true;
    package = pkgs.vscodium;
    profiles.default.extensions = with pkgs.vscode-extensions; [
...
    ];
  };

  # Git
  programs.git = {
    enable = true;
    lfs.enable = true;
    userName = "Heuzef";
    userEmail = "******";
  };
  

  home.file.".ssh/config".text = lib.concatStringsSep "\n" (
    let
      sshDefaults = {
        user = "root";
        identityFile = "~/.ssh/id_ed25519";
      };

      sshHosts = [
        # {
        #   name = "host";
        #   hostName = "192.168.0.000";
        #   extraConfig = ''
        #     Port 2222
        #   '';
        # }
...
      ];

      sshHostToConfig = host: ''
        Host ${host.name}
          HostName ${host.hostName}
          User ${host.user or sshDefaults.user}
          IdentityFile ${host.identityFile or sshDefaults.identityFile}
          IdentitiesOnly yes
          PreferredAuthentications publickey
          ${host.extraConfig or ""}
      '';
    in
      map sshHostToConfig sshHosts
  );

  home.file.".bashrc".text = ''
    if [ -f "/etc/profiles/per-user/heuzef/etc/profile.d/hm-session-vars.sh" ]; then
      source "/etc/profiles/per-user/heuzef/etc/profile.d/hm-session-vars.sh"
    fi
  '';

  home.sessionVariables = {
...
  };

  # Let Home Manager install and manage itself.
  programs.home-manager.enable = true;

  # Enable Flakes
  nix.settings.experimental-features = [ "nix-command" "flakes" ];
}

This doesn’t tell anything about how it gets its nixpkgs. There is more to that.

Ha of course, my flake config !

{
  description = "Heuzef NixOS-Config";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    nix-search-cli = {
      url = "github:peterldowns/nix-search-cli";
      inputs.nixpkgs.follows = "nixpkgs";
    };

  };

There is still a lot between that nixpkgs input and the pkgs used in your HM configuration. Can you please share the full configuration?

Unforunally not :frowning: I don’t manage (yet) my secrets.

But for signal-desktop, there is not more config than that.

There is my configuration file :

{ config, pkgs, ... }:

{
  # Enable experimental-features
  nix.settings.experimental-features = "nix-command flakes";
  # Increasing the 'download-buffer-size' setting
  nix.settings.download-buffer-size = 524288000;

  # Bootloader
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;

  # Enable ZRAM Swap
  zramSwap.enable = true;

  # Enables wireless support via wpa_supplicant.
  # networking.wireless.enable = true;

  # Enable networking
  networking.networkmanager.enable = true;

  # Set your time zone.
  time.timeZone = "Europe/Paris";

  # Select internationalisation properties.
  i18n.defaultLocale = "fr_FR.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "fr_FR.UTF-8";
    LC_IDENTIFICATION = "fr_FR.UTF-8";
    LC_MEASUREMENT = "fr_FR.UTF-8";
    LC_MONETARY = "fr_FR.UTF-8";
    LC_NAME = "fr_FR.UTF-8";
    LC_NUMERIC = "fr_FR.UTF-8";
    LC_PAPER = "fr_FR.UTF-8";
    LC_TELEPHONE = "fr_FR.UTF-8";
    LC_TIME = "fr_FR.UTF-8";
  };

  # Enable the X11 windowing system.
  # You can disable this if you're only using the Wayland session.
  services.xserver.enable = true;

  # Enable the KDE Plasma Desktop Environment.
  services.displayManager.sddm.enable = true;
  services.displayManager.sddm.autoNumlock = true;
  services.desktopManager.plasma6.enable = true;

  # Configure keymap in X11
  services.xserver.xkb = {
    layout = "fr";
    variant = "";
  };

  # Configure console keymap
  console.keyMap = "fr";

  # KWallet
  security.pam.services.login.kwallet.enable = true;

  # Enable sound with pipewire.
  services.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
  };

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users.heuzef = {
    isNormalUser = true;
    description = "heuzef";
    extraGroups = [ "networkmanager" "wheel" "kvm" "libvirtd" "docker"];
    packages = with pkgs; [
      kdePackages.kate
    ];
  };

  # Enable firefox.
  programs.firefox.enable = true;

  # Allow unfree packages
  nixpkgs.config.allowUnfree = true;

  environment.systemPackages = with pkgs; [
    git
    vim
    # Python
    (python3.withPackages (ps: with ps; [
      jupyter
      ipykernel
      notebook
    ]))
  ];

  # List of default packages to exclude from the configuration
  environment.plasma6.excludePackages = with pkgs; [
     kdePackages.elisa
  ];

  # List services that you want to enable:

  # Docker
  virtualisation.docker = {
    enable = false;
    # Allow USB devices
    extraOptions = [
      "--default-ulimit=nofile=1024:524288"
    ];
    # Customize Docker daemon settings using the daemon.settings option
    daemon.settings = {
      experimental = true;
    };
    # Use the rootless mode - run Docker daemon as non-root user
    rootless = {
      enable = true;
      setSocketVariable = true;
    };
  };

  # udev rule to allow USB devices
  services.udev.packages = with pkgs; [ eudev ];
  services.udev.extraRules = ''
    SUBSYSTEM=="usb", GROUP="docker", MODE="0666"
  '';

  # OBS Studio
  # https://nixos.wiki/wiki/OBS_Studio
  boot.extraModulePackages = with config.boot.kernelPackages; [
    v4l2loopback
  ];
  boot.kernelModules = [ "v4l2loopback" ];
  boot.extraModprobeConfig = ''
    options v4l2loopback devices=1 video_nr=1 card_label="OBS Cam" exclusive_caps=1
  '';
  security.polkit.enable = true;

  programs.obs-studio = {
    enable = true;
    enableVirtualCamera = true;
    plugins = with pkgs.obs-studio-plugins; [
      droidcam-obs
    ];
  };
}