flake: parameterise nixos config on hostname

This commit is contained in:
Jez Cope 2021-05-24 12:31:06 +01:00
parent b8603b26f2
commit ef952b2e24
1 changed files with 19 additions and 20 deletions

View File

@ -1,5 +1,5 @@
{
description = "A very basic flake";
description = "My NixOS configuration";
inputs = {
nixos.url = "nixpkgs/nixos-unstable";
@ -12,25 +12,24 @@
outputs = { self, nixos, home-manager, nur }: {
nixosConfigurations = {
arianrhod = nixos.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
./hosts/arianrhod
./hosts/arianrhod/hardware.nix
./secrets/arianrhod.nix
home-manager.nixosModules.home-manager
{ nixpkgs.overlays = [ nur.overlay ]; }
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = false;
home-manager.users.jez = import ./home/jez/home.nix;
}
];
};
};
nixosConfigurations = nixos.lib.attrsets.genAttrs [ "arianrhod" "gwydion" ]
(hostname:
nixos.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
(./hosts + "/${hostname}")
(./hosts + "/${hostname}/hardware.nix")
(./secrets + "/${hostname}.nix")
home-manager.nixosModules.home-manager
{ nixpkgs.overlays = [ nur.overlay ]; }
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = false;
home-manager.users.jez = import ./home/jez/home.nix;
}
];
});
};
}