Skip to content

Can't make it work with flake parts #119

Description

@pavukach

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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