Tried to setup a hp laser 107w printer but it went horribly

Today i had that great idea to setup my HP laser 107w printer on my pc with NixOS. config:

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
    ];

  # Bootloader.
  boot.loader.systemd-boot.enable = true;
  boot.loader.efi.canTouchEfiVariables = true;
  programs.steam.enable = true;
  programs.partition-manager.enable = true;
  programs.kdeconnect.enable = true;
  hardware.bluetooth.enable = true; # enables support for Bluetooth
  hardware.bluetooth.powerOnBoot = true; # powers up the default Bluetooth controller on boot
  networking.hostName = "nixos"; # Define your hostname.
  # networking.wireless.enable = true;  # Enables wireless support via wpa_supplicant.

  # Configure network proxy if necessary
  # networking.proxy.default = "http://user:password@proxy:port/";
  # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain";

  # Enable networking
  networking.networkmanager.enable = true;

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

  # Select internationalisation properties.
  i18n.defaultLocale = "hu_HU.UTF-8";
  boot.binfmt.registrations.appimage = {
    wrapInterpreterInShell = false;
    interpreter = "${pkgs.appimage-run}/bin/appimage-run";
    recognitionType = "magic";
    offset = 0;
    mask = ''\xff\xff\xff\xff\x00\x00\x00\x00\xff\xff\xff'';
    magicOrExtension = ''\x7fELF....AI\x02'';
  };
  i18n.extraLocaleSettings = {
    LC_ADDRESS = "hu_HU.UTF-8";
    LC_IDENTIFICATION = "hu_HU.UTF-8";
    LC_MEASUREMENT = "hu_HU.UTF-8";
    LC_MONETARY = "hu_HU.UTF-8";
    LC_NAME = "hu_HU.UTF-8";
    LC_NUMERIC = "hu_HU.UTF-8";
    LC_PAPER = "hu_HU.UTF-8";
    LC_TELEPHONE = "hu_HU.UTF-8";
    LC_TIME = "hu_HU.UTF-8";
  };

  # Enable the X11 windowing system.
  services.xserver.enable = true;

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

  # Configure keymap in X11
  services.xserver = {
    layout = "hu";
    xkbVariant = "";
  };

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

  # Enable CUPS to print documents.
  services.printing.enable = true;

  # Enable sound with pipewire.
  sound.enable = true;
  hardware.pulseaudio.enable = false;
  security.rtkit.enable = true;
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    alsa.support32Bit = true;
    pulse.enable = true;
    # If you want to use JACK applications, uncomment this
    #jack.enable = true;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  };

  # Enable touchpad support (enabled default in most desktopManager).
  # services.xserver.libinput.enable = true;

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

  # Enable automatic login for the user.
  services.xserver.displayManager.autoLogin.enable = true;
  services.xserver.displayManager.autoLogin.user = "heim";

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

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
  #  vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
  #  wget
  ];

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;
  networking.firewall = {
      enable = true;
      allowedTCPPortRanges = [
        { from = 1714; to = 1764; } # KDE Connect
    ];
    allowedUDPPortRanges = [
        { from = 1714; to = 1764; } # KDE Connect
    ];
  };
  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "23.11"; # Did you read the comment?

} 

First i tried the general printer driver but it just failed but i expected it so i went to my backup which was a driver that worked on Feren OS [ubuntu fork] . It installed normaly and the printer showed up in settings as a normal printer but i could not get it to print even just the test page. So I removed it and… well bad things happened. The hp-setup just said that it could not find it and the printer isnt connected (it was) and now it not even show up in the settings when i try to set it up from there. Oh and my config file broke too for some reason with the errors in this file [https://os5.mycloud.com/action/share/e3ed1e65-e52c-43ea-8932-d6b53610ee9e]. I hope someone can help how to get the printer working or just point out what i messed up

Lucky me that I already have my old wifi HP printer setup correctly. I had real fun with the hp-setup utility if I remember correctly.

How did you connect the printer? Network, USB?

Instead of posting links to mycloud, maybe you could tell us what the relevant parts of your nixos configuration are? Meaning the ones relating to your printer setup. If you don’t know that already, you can add codeblocks to your markdown text by using ``` for the start and end of the codeblock.

paste your config in such a code block
1 Like

I used USB to connect it and i fixed the error with my config that i got when tried nixos-rebuild.

So one problem less already. :smile:

my config doesn’t look much different then yours tbh. I have this piece in it:

  services = {
    printing = {
      enable = true;
      drivers = with pkgs; [ hplipWithPlugin ];
    };
  };

I am not really sure you even need the hplip addition. But you could try it.

Some more questions I would have are these:

my backup which was a driver that worked on Feren OS

Which driver are you referring to here?

not even show up in the settings when i try to set it up from there

I assume settings refers to KDE? But you could try and see from lsusb in the terminal if the printer is properly connected and visible as an USB device to Linux.

Thanks for the response, i meant kde settings as “settings” and will try what you sent. Sorry for not respondong earlier i am not at home this weekend but hope it will fix my problem :slight_smile:

No worries, respond when you feel like it. It might just be that I am missing the response if this thread gets a little older.


I got the printer installed with the ppd from hplip. I could not find its driver from the kde settings so i used the PPD file but now it says this and it wont print. ok think it needs rastertospl package that comes with samsung or hp installer. hmmmm…

edit: found a file named rastertospl in the folder of the hp installer under aarch64. how i could get that installed?

edit2: copied the rastertospl to the cups folder and now i got a different error message :smiley: when i go to printer status it says: “Hp laser 103 107 108 cups insecure filter”. how i could fix this?


NICE. i think it the final error. will fix it tomorrow myself if no one have any clue how to do it.

edit: I fixed it now the printer does not give any error till i send anything to be printed. The printjob just get stuck in the queve with the status: Filter failed :smiley:

Hello, I have the same difficulties, but with setting up a wired printer. Model HP Laser 107a.

Have you found any working method? I tried the declarative driver replacement, because unfortunately, HPLIP doesn’t have a driver for this printer.

Hp-setup can’t access the printer through USB. I wanted your help first, before creating yet another topic.

1 Like

Hey! It appears that you need the HP unified Linux driver for that printer. I found some info on how to get it running on other Linux distros:

Arch Linux AUR has the driver: AUR (en) - hpuld

Sadly nixpkgs only has the Samsung Unified Linux Driver. Now supposedly the HP printer is a rebranded Samsung one. I am not sure if this is true or how similar these two are.

Thank you so much for your reply! I’ll try to install the samsung UD and see how it goes.

Hopefully it works.

It seems that this printer supports apple Airprint: https://support.hp.com/us-en/document/c06271567
This means that you should be able to use the printer:

  • via wifi with services.avahi.enable = true
  • via usb with services.ipp-usb.enable = true;

Thats good to know, thanks for the information. How i could use airprint to use the printer while its connected wia usb? Due to the main problem being that this printer dont have a normal driver for linux (its a rebranded samsung printer but samsung drivers dont want to work but hp dont provide one cuz its a samsung printer…)

New printers often use the IPP protocol for driverless scanning. Yes, driverless. Apple Airprint mandates use of IPP over wifi. So when you see a printer supporting Airprint, you know that the printer supports IPP at least over wifi. When such a printer also supports USB, you can most often expect IPP to be also supported on USB, and not only the weird protocols that proprietary drivers use. When this is the case, you can use ipp-usb to make the printer available to cups.

2 Likes

Thank you!!! I installed ipp-usb then setup curl to detect it AND IT WORKED!!! with no driver needed! (maybe a bit too well, it started printing out a 7 page document i needed yesterday and already printed out.) It have its own issues, like not working 100% of the time only like 60-80% but still better than nothing!