Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gsconnect module install nautilus-python at the same time and make Firefox ready to work with its gsconnect extension #4

Open
Thatoo opened this issue Feb 15, 2024 · 8 comments

Comments

@Thatoo
Copy link

Thatoo commented Feb 15, 2024

It would be nice if nautilus-python package was install at the same time than gsconnect to be able to send file directly from Nautilus.

@Thatoo
Copy link
Author

Thatoo commented Feb 15, 2024

Actually, just installing nautilus-python throw the nixSoftware Center isn't enough...
Maybe it needs to look at this PR : NixOS/nixpkgs#240780

@Thatoo
Copy link
Author

Thatoo commented Feb 16, 2024

No, it's enough but it should be install system wise and not only as a user.

@Thatoo
Copy link
Author

Thatoo commented Feb 16, 2024

I'm very new to nixOS world so I don't dare to make a PR to https://github.com/snowfallorg/snowflakeos-modules/blob/main/modules/nixos/gnome/default.nix

Would it be something like adding environment.systemPackages = with pkgs; [ gnome.nautilus-python ]; ?
like :

    programs.kdeconnect = mkIf cfg.gsconnect.enable {
      package = pkgs.gnomeExtensions.gsconnect;
      enable = true;
      environment.systemPackages = with pkgs; [ gnome.nautilus-python ];
    };

@Thatoo Thatoo changed the title gsconnect install nautilus-python at the same time gsconnect module install nautilus-python at the same time and make Firefox ready to work with its gsconnect extension Feb 16, 2024
@Thatoo
Copy link
Author

Thatoo commented Feb 16, 2024

GSconnect firefox extension doesn't work.
I wonder if it's not related to NixOS/nixpkgs#47340

@Thatoo
Copy link
Author

Thatoo commented Feb 16, 2024

I find a way to make GSconnect work with nautilus and Firefox (through the firefox extension). Below is the content of my default.nix file. I had to change the way Firefox is installed so it is really out of my scope to help to change the GSconnect module in order for it to offer the best integration to the user (in Gnome Shell, nautilus and Firefox) :

I had to comment firefox in the List packages installed in system profile but add gnome.nautilus-python to it.
And then I had to add the following lines :

  programs.firefox.enable = true;
  programs.firefox.nativeMessagingHosts.packages = with pkgs; [ browserpass gnomeExtensions.gsconnect ];

The full file is :

# 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.nix
      ./modules.nix
    ];

    # Define your hostname.
  networking.hostName = "snowflakeos";



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

  # Set the keyboard layout.
  services.xserver.layout = "fr";
  console.useXkbConfig = true;

  # Define a user account. Don't forget to set a password with ‘passwd’.
  users.users."username" = {
    isNormalUser = true;
    description = "Username";
    extraGroups = [ "wheel" "networkmanager" "dialout" ];
  };
  

  # Allow unfree packages
  environment.sessionVariables.NIXPKGS_ALLOW_UNFREE = "1";

    # List packages installed in system profile.
  environment.systemPackages = with pkgs; [
    # firefox
    gnome.nautilus-python
  ];

  
  # 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?


  programs.nix-data = {
    enable = true;
    systemconfig = "/etc/nixos/systems/x86_64-linux/snowflakeos/default.nix";
    flake = "/etc/nixos/flake.nix";
    flakearg = "snowflakeos";
  };
  programs.firefox.enable = true;
  programs.firefox.nativeMessagingHosts.packages = with pkgs; [ browserpass gnomeExtensions.gsconnect ];
}

@Thatoo
Copy link
Author

Thatoo commented Apr 1, 2024

To make that easier, I opened an issue upstream on Gnome ISO : NixOS/nixpkgs#300577

@Thatoo
Copy link
Author

Thatoo commented Apr 1, 2024

If upstream Gnome ISO decide to install firefox the proper way, I mean like

programs.firefox = {
   enable = true;
   package = pkgs.firefox;
   nativeMessagingHosts.packages = with pkgs; [
     browserpass
   ];
 };

instead of

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

then the gsconnect module would only have to add (on top of what it already does) gnomeExtensions.gsconnect to nativeMessagingHosts.packages like

programs.firefox = {
   enable = true;
   package = pkgs.firefox;
   nativeMessagingHosts.packages = with pkgs; [
     browserpass
     gnomeExtensions.gsconnect
   ];
 };

and gnome.nautilus-python to either environment.systemPackages or to users.users.username.packages.

@Thatoo
Copy link
Author

Thatoo commented Apr 1, 2024

Actually I might be wrong. The problem might not need to be change upstream but in icicle : https://github.com/snowfallorg/icicle/blob/8e3776886fa391473d9c5421a7334d04638cb75f/src/utils/install.rs#L559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant