64 lines
1.6 KiB
Nix
64 lines
1.6 KiB
Nix
{
|
|
description = "Main Flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
nixpkgs-stable.url = "github:NixOS/nixpkgs/release-24.05";
|
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
sops-nix = {
|
|
url = "github:Mic92/sops-nix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
impermanence.url = "github:nix-community/impermanence";
|
|
|
|
stylix = {
|
|
url = "github:danth/stylix";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
flake-utils.follows = "flake-utils";
|
|
home-manager.follows = "home-manager";
|
|
};
|
|
};
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
...
|
|
} @ inputs: let
|
|
inherit (nixpkgs) lib;
|
|
|
|
defaultConfig = {
|
|
};
|
|
|
|
makeHost = host: let
|
|
config = defaultConfig // import ./hosts/${host}/config.nix;
|
|
in
|
|
lib.nixosSystem {
|
|
system = config.system;
|
|
pkgs = import nixpkgs {system = config.system;};
|
|
specialArgs = inputs;
|
|
modules = [
|
|
./hosts/${host}/default.nix
|
|
./hosts/${host}/hardware-configuration.nix
|
|
./system
|
|
{networking.hostName = host;}
|
|
];
|
|
};
|
|
in {
|
|
nixosConfigurations = lib.pipe ./hosts [
|
|
builtins.readDir
|
|
(lib.filterAttrs (_: type: type == "directory"))
|
|
(lib.filterAttrs (name: _: builtins.pathExists ./hosts/${name}/default.nix && builtins.pathExists ./hosts/${name}/hardware.nix && builtins.pathExists ./hosts/${name}/config.nix))
|
|
(lib.mapAttrs (name: _: makeHost name))
|
|
];
|
|
};
|
|
}
|