dwarfmaster / arkenfox-nixos

Utilities to use arkenfox/user.js in NixOS
MIT License
60 stars 11 forks source link

can't build #50

Open iambeingtracked opened 1 month ago

iambeingtracked commented 1 month ago

Here's my flake.nix:

{
  description = "NixOS configuration";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
    nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
    agenix = {
        url = "github:ryantm/agenix";
        inputs.agenix.inputs.nixpkgs.follows = "nixpkgs";
    };
    arkenfox = {
        url = "github:dwarfmaster/arkenfox-nixos";
        inputs.arkenfox.inputs.nixpkgs.follows = "nixpkgs";
    };
    home-manager = {
        url = "github:nix-community/home-manager/release-24.05";
        inputs.nixpkgs.follows = "nixpkgs";
    };
    nixvim = {
    url = "github:nix-community/nixvim/nixos-24.05";
        inputs.nixpkgs.follows = "nixpkgs";
    };
};

  outputs = inputs@{ agenix, arkenfox, home-manager, nixpkgs, nixpkgs-unstable, nixvim, self, ... }: 
  let
    variables = import ./variables.nix;
  in {
    nixosConfigurations = {
      ${variables.hostname} = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        specialArgs = { inherit inputs; };
        modules = [
          ./system/configuration.nix
          agenix.nixosModules.default
          arkenfox.hmModules.default
          home-manager.nixosModules.home-manager
          nixvim.nixosModules.nixvim
          {
            home-manager.useGlobalPkgs = true;
            home-manager.useUserPackages = true;
            home-manager.sharedModules = [ 
                nixvim.homeManagerModules.nixvim
                inputs.arkenfox.hmModules.default 
            ];
            home-manager.users.${variables.username} = import ./home/home.nix;
            nixpkgs.overlays = [
                (final : prev: {
                    unstable = nixpkgs-unstable.legacyPackages.${prev.system};
                })
            ];
          }
        ];
      };
    };
   };
}

Here's firefox.nix which is imported into home-manager:

{ pkgs, ...} : {
    programs.firefox = {
        enable = true;
        package = "${pkgs.firefox-esr}";
        arkenfox = {
            enable = true;
            version = "master";
        };
    };
}

The error:

error:
       … while calling the 'head' builtin

         at /nix/store/2nnisw4pxbifisbkg58hrnis9ycs5ah1-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/2nnisw4pxbifisbkg58hrnis9ycs5ah1-source/lib/modules.nix:809:9:

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

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

       error: value is a string with context while a set was expected
iambeingtracked commented 1 month ago

The issue is caused by firefox-esr. Without specifying the package it installs regular Firefox and that works

dwarfmaster commented 1 month ago

This is surprising. The only place I uses the firefox package is to check its version, and it seems that the firefox-esr package has a version attribute. Would you mind checking if this is the case, by evaluating firefox-esr.version in the repl ? If it works, it might be a bug with home-manager, but I don't have the time to investigate it right now.