Skip to content

error: attribute 'formats' missing #423

@malik-n

Description

@malik-n

Trying to create an lxc image with a flake.nix

{
  description = "Flake to create vs-code-server-container image";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs";
    nixos-generators = {
      url = "github:nix-community/nixos-generators";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    vscode-server.url = "github:nix-community/nixos-vscode-server";
  };

  outputs = { nixpkgs, self, nixos-generators, ... }:
  let
  inputs = self.inputs;
    forAllSystems = nixpkgs.lib.genAttrs [
      "x86_64-linux"
      "aarch64-linux"
    ];
    pkgs = forAllSystems (system: import nixpkgs { inherit system; });
    specialArgs = {
      inherit pkgs inputs;
    };
  in {
    packages = forAllSystems( system: rec {
      default = vs-code-server-container;
      vs-code-server-container = nixos-generators.nixosGenerate {
        inherit system specialArgs;
        format = "lxc";
        modules = [
          {
            nix.registry.nixpkgs.flake = nixpkgs;
            boot.isContainer = true;
            nixpkgs.pkgs = pkgs;
          }
          ./configuration.nix
          inputs.vscode-server.nixosModules.default
        ];
      };
    });
  };
}

And a minimal configuration.nix

{ modulesPath, ... }:

{
  imports = [
    (modulesPath + "/profiles/minimal.nix")
    (modulesPath + "/misc/nixpkgs/read-only.nix")
  ];

  services.vscode-server.enable = true;
  hardware.bluetooth.enable = false;
}

But getting the following error

error:
       … while evaluating the attribute 'config.system.build."${(image).config.formatAttr}"'
         at /nix/store/0vzw30bmdik5zd1mj6cr88z9773a5ra3-source/lib/modules.nix:334:9:
          333|         options = checked options;
          334|         config = checked (removeAttrs config [ "_module" ]);
             |         ^
          335|         _module = checked (config._module);

       … while calling the 'seq' builtin
         at /nix/store/0vzw30bmdik5zd1mj6cr88z9773a5ra3-source/lib/modules.nix:334:18:
          333|         options = checked options;
          334|         config = checked (removeAttrs config [ "_module" ]);
             |                  ^
          335|         _module = checked (config._module);

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

       error: attribute 'formats' missing
       at /nix/store/0vzw30bmdik5zd1mj6cr88z9773a5ra3-source/nixos/modules/services/hardware/bluetooth.nix:29:12:
           28|
           29|   cfgFmt = pkgs.formats.ini { };
             |            ^
           30|

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions