Hello
I am writing a new NixOS configuration for a new project I got and I decided to move it to flake.
I had a look at this guide (Moving Nixos System Configuration Into A Flake - YouTube) but I am doing a slightly differnet thing and I am not sure about how to build NixOS.
This is how the project looks like:
$ tree -L 1
.
├── br0.xml
├── bridge-qemu.sh
├── configure.nix
├── flake.lock
└── flake.nix
This is the flake.nix file
{
description = "A very basic flake";
inputs =
{
nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.05";
};
outputs = { nixpkgs, home-manager, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
config = { allowUnfree = true; };
};
lib = nixpkgs.lib;
in
{
nixosConfigurations = {
generic = lib.nixosSystem {
inherit system;
modules = [
./configuration.nix
];
};
};
};
}
Previously I was building directly the configuration.nix
file with this command (everything works fine):
nix-build --out-link /tmp/netboot ./configure.nix
I am trying to do the same with nix build
but I get an error:
$ nix build --out-link /tmp/netboot .#generic
warning: Git tree '/home/gianarb/.dotfiles' is dirty
error: flake 'git+file:///home/gianarb/.dotfiles?dir=nixos%2fmachines%2flab-generic-netbooting' does not provide attribute 'packages.x86_64-linux.generic', 'legacyPackages.x86_64-linux.generic' or 'generic'
What am I doing wrong?
Thanks