nixGL icon indicating copy to clipboard operation
nixGL copied to clipboard

Making nixGL works with Home Manager

Open thanhnguyen2187 opened this issue 1 year ago • 28 comments

Hi.

Thanks for the awesome work!

I am using Home Manager within Pop OS 22.04 and have got stuck trying to make nixGL works. My configuration basically looks like this:

{ config, pkgs, ... }:
let
  # TODO: find a way to make the config more declarative
  #   nix-channel --add https://nixos.org/channels/nixpkgs-unstable nixpkgs-unstable
  #   nix-channel --add https://github.com/guibou/nixGL/archive/main.tar.gz nixgl && nix-channel --update
  pkgsUnstable = import <nixpkgs-unstable> {};
  nixGL = import <nixgl> {};
in
{
  programs.alacritty = {
    enable = true;
    settings = {
      font = {
        size = 12;
        normal = {
          family = "JetBrains Mono Nerd Font";
          style = "Regular";
        };
      };
    };
    package = pkgs.writeShellScriptBin "alacritty" ''
      #!/bin/sh

      ${nixGL.auto.nixGLNvidia}/bin/nixGLNvidia ${pkgs.alacritty}/bin/alacritty "$@"
    '';
  };
}

Try running home-manager switch gives me this:

building '/nix/store/38na3sdwf8j5gfhh4mm5x337q0ph384f-impure-nvidia-version-file.drv'...
error: 'submoduleWith' at /nix/store/z2w2v2hv8y3pacq2bjjk5sxmsrnlq188-nixpkgs/nixpkgs/lib/types.nix:570:7 called with unexpected argument 'description'

       at /home/thanh/.nix-defexpr/channels/home-manager/nixos/common.nix:14:14:

           13|
           14|   hmModule = types.submoduleWith {
             |              ^
           15|     description = "Home Manager module";
(use '--show-trace' to show detailed location information)

While nix-env -iA nixgl.auto.nixGLDefault, and then nixGL alacritty works as expected.

I found a few issues on nixGL is not a proper package of nixpkgs, and guess that it probably is the issue. I wonder if there is a workaround? Using nix and Home Manager feels so good that I do not want to come back to good old apt...

Thanks!

thanhnguyen2187 avatar Aug 31 '22 14:08 thanhnguyen2187