flake-file icon indicating copy to clipboard operation
flake-file copied to clipboard

Can't make it work with flake parts

Open pavukach opened this issue 5 months ago • 0 comments

I try to redo setup using flake-parts, as wiki does not mention how to enable lock flattening with default flakes and in general favors this way of installation. i have something like that:

inputs:
let
  system = "x86_64-linux";
  username = "maksym";
  nixDir = "/home/${username}/nixos";
  pkgsConfig = {
    allowUnfree = true;
  };
in
{
  imports = [ ./inputs.nix ];
  systems = [ system ];
  flake = {
    nixosConfigurations.nixos = inputs.nixpkgs.lib.nixosSystem {
      inherit system;
      specialArgs = {
        inherit
          inputs
          username
          pkgsConfig
          nixDir
          ;
        inherit (inputs) self;
      };
      modules = [
        (inputs.import-tree ./host)
        (inputs.import-tree ./modules)
        (inputs.import-tree ./secrets)
      ];
    };
  };
}

And, when i try to run this i get error: attribute 'nixpkgs' missing for nixosConfigurations.nixos = inputs.nixpkgs.lib.nixosSystem.

part of inputs.nix:

{

  flake-file.inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  };
}

Maybe I am not smart enough, but in general documentation omits too much as an exercise to the reader. For example, no templates actually show usage of inputs you added

pavukach avatar Jun 07 '26 13:06 pavukach