mirror of
https://github.com/thegeneralist01/config.git
synced 2026-01-09 15:10:24 +01:00
48 lines
1.4 KiB
Nix
48 lines
1.4 KiB
Nix
{
|
|
description = "thegeneralist's config flake";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
home-manager = {
|
|
url = "github:nix-community/home-manager";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
nix-darwin = {
|
|
url = "github:nix-darwin/nix-darwin/master";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
agenix = {
|
|
url = "github:ryantm/agenix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
inputs.home-manager.follows = "home-manager";
|
|
inputs.darwin.follows = "nix-darwin";
|
|
};
|
|
ghostty = {
|
|
url = "github:ghostty-org/ghostty";
|
|
};
|
|
fenix = {
|
|
url = "github:nix-community/fenix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
#nix.url = "github:DeterminateSystems/nix-src";
|
|
};
|
|
|
|
outputs = inputs@{ self, nixpkgs, nix-darwin, nix, ... }: let
|
|
inherit (builtins) readDir;
|
|
inherit (nixpkgs.lib) attrsToList const groupBy listToAttrs mapAttrs;
|
|
#nix.enable = false;
|
|
|
|
lib' = nixpkgs.lib.extend (_: _: nix-darwin.lib);
|
|
lib = lib'.extend <| import ./lib inputs;
|
|
|
|
targetHost = readDir ./hosts
|
|
|> mapAttrs (name: const <| import ./hosts/${name} lib inputs self)
|
|
|> attrsToList
|
|
|> groupBy (host:
|
|
if host.name == "thegeneralist" || host.name == "thegeneralist-central" then
|
|
"nixosConfigurations"
|
|
else
|
|
"darwinConfigurations")
|
|
|> mapAttrs (const listToAttrs);
|
|
in targetHost;
|
|
}
|