Hey, how can I make this flake as concise as possible? I have quite a few duplications in there. I thought of using a function to generate the nixosConfiguration blocks, so I only have to write it once. How would you make it as good as possible? If you see anything that is not best practice in there, please let me know as well:
{
description = "NixOS configuration";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { nixpkgs, home-manager, ... }: {
nixosConfigurations = {
pc = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./nixos-configurations/pc
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
}
];
};
laptop = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./nixos-configurations/laptop
home-manager.nixosModules.home-manager
{
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
};
}
];
};
};
};
}