84 lines
2.1 KiB
Nix
84 lines
2.1 KiB
Nix
{
|
|
description = "Top level flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
|
nixos-wsl.url = "github:nix-community/NixOS-WSL/main";
|
|
home-manager.url = "github:nix-community/home-manager";
|
|
home-manager.inputs.nixpkgs.follows = "nixpkgs";
|
|
pesde.url = "github:rocketcamel/pesde-nix";
|
|
pesde.inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
outputs =
|
|
inputs@{
|
|
nixpkgs,
|
|
home-manager,
|
|
nixos-wsl,
|
|
...
|
|
}:
|
|
let
|
|
hosts = [
|
|
{
|
|
name = "wsl-kumatani";
|
|
architecture = "x86_64-linux";
|
|
isWSL = true;
|
|
}
|
|
{
|
|
name = "wsl-usahara";
|
|
architecture = "x86_64-linux";
|
|
isWSL = true;
|
|
}
|
|
{
|
|
name = "tux";
|
|
architecture = "x86_64-linux";
|
|
}
|
|
{
|
|
name = "tux-wsl";
|
|
architecture = "x86_64-linux";
|
|
isWSL = true;
|
|
}
|
|
];
|
|
in
|
|
{
|
|
nixosConfigurations = builtins.listToAttrs (
|
|
map (host: {
|
|
name = host.name;
|
|
value = nixpkgs.lib.nixosSystem {
|
|
specialArgs = {
|
|
inherit inputs;
|
|
meta = {
|
|
hostname = host.name;
|
|
};
|
|
};
|
|
system = host.architecture;
|
|
modules =
|
|
[
|
|
./hosts/${host.name}/configuration.nix
|
|
./modules/default.nix
|
|
home-manager.nixosModules.home-manager
|
|
{
|
|
nix.settings.experimental-features = [
|
|
"nix-command"
|
|
"flakes"
|
|
];
|
|
environment.systemPackages = [
|
|
inputs.pesde.packages.${host.architecture}.default
|
|
];
|
|
}
|
|
]
|
|
++ (
|
|
if builtins.hasAttr "isWSL" host then
|
|
[
|
|
nixos-wsl.nixosModules.default
|
|
./hosts/wsl/configuration.nix
|
|
]
|
|
else
|
|
[ ]
|
|
);
|
|
};
|
|
}) hosts
|
|
);
|
|
};
|
|
}
|