2023-05-04 19:09:45 +02:00
|
|
|
{
|
|
|
|
inputs = {
|
2024-03-06 01:17:14 +01:00
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
2023-06-06 01:26:46 +02:00
|
|
|
|
2023-05-17 05:07:14 +02:00
|
|
|
home-manager = {
|
2023-12-13 00:29:55 +01:00
|
|
|
url = "github:nix-community/home-manager";
|
2023-05-17 05:07:14 +02:00
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-06-06 01:26:46 +02:00
|
|
|
|
2023-05-17 05:07:14 +02:00
|
|
|
stylix = {
|
2024-04-01 11:22:26 +02:00
|
|
|
url = "github:danth/stylix";
|
2023-05-17 05:35:52 +02:00
|
|
|
inputs = {
|
|
|
|
nixpkgs.follows = "nixpkgs";
|
|
|
|
home-manager.follows = "home-manager";
|
|
|
|
};
|
2023-05-17 05:07:14 +02:00
|
|
|
};
|
2023-08-08 20:08:41 +02:00
|
|
|
|
|
|
|
sakaya = {
|
|
|
|
url = "github:donovanglover/sakaya";
|
|
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
|
|
};
|
2023-06-21 08:41:38 +02:00
|
|
|
};
|
2023-06-06 01:26:46 +02:00
|
|
|
|
2024-04-06 01:20:27 +02:00
|
|
|
outputs = { self, nixpkgs, ... } @ attrs:
|
2024-04-05 17:26:22 +02:00
|
|
|
let
|
|
|
|
inherit (nixpkgs.lib) nixosSystem;
|
|
|
|
inherit (nixpkgs.legacyPackages.x86_64-linux) nixpkgs-fmt callPackage;
|
2024-04-06 01:20:27 +02:00
|
|
|
inherit (builtins) attrNames listToAttrs map replaceStrings readDir;
|
2024-04-01 17:48:10 +02:00
|
|
|
|
2024-04-08 16:58:32 +02:00
|
|
|
flakeOutputs = [ "overlays" "nixosModules" "nixosConfigurations" "homeManagerModules" "packages" "checks" ];
|
|
|
|
flakeDirectories = [ "overlays" "modules" "hardware" "home" "packages" "tests" ];
|
2024-04-05 17:26:22 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
formatter.x86_64-linux = nixpkgs-fmt;
|
|
|
|
} //
|
2024-04-04 23:55:46 +02:00
|
|
|
(listToAttrs
|
|
|
|
(map
|
2024-04-01 17:05:08 +02:00
|
|
|
(attributeName: {
|
|
|
|
name = attributeName;
|
2024-04-05 17:26:22 +02:00
|
|
|
value =
|
|
|
|
let
|
|
|
|
directory = replaceStrings flakeOutputs flakeDirectories attributeName;
|
2024-04-06 04:51:24 +02:00
|
|
|
|
2024-04-05 17:26:22 +02:00
|
|
|
attributeValue = (listToAttrs
|
|
|
|
(map
|
|
|
|
(file: {
|
2024-04-08 16:58:32 +02:00
|
|
|
name =
|
|
|
|
if file == "laptop.nix"
|
|
|
|
then "nixos"
|
|
|
|
else replaceStrings [ ".nix" ] [ "" ] file;
|
2024-04-06 04:51:24 +02:00
|
|
|
value =
|
2024-04-08 16:33:06 +02:00
|
|
|
if directory == "packages"
|
2024-04-06 04:51:24 +02:00
|
|
|
then callPackage ./${directory}/${file} { }
|
2024-04-08 16:33:06 +02:00
|
|
|
else
|
|
|
|
if directory == "tests"
|
2024-04-17 19:54:28 +02:00
|
|
|
then
|
|
|
|
import ./${directory}/${file}
|
|
|
|
{
|
|
|
|
inherit self;
|
|
|
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
|
|
|
}
|
2024-04-08 16:58:32 +02:00
|
|
|
else
|
|
|
|
if directory == "hardware"
|
2024-04-17 19:54:28 +02:00
|
|
|
then
|
|
|
|
nixosSystem
|
|
|
|
{
|
|
|
|
system = "x86_64-linux";
|
|
|
|
specialArgs = attrs // { nix-config = self; };
|
|
|
|
modules = [
|
|
|
|
./.
|
|
|
|
./${directory}/${file}
|
|
|
|
];
|
|
|
|
}
|
2024-04-08 16:58:32 +02:00
|
|
|
else import ./${directory}/${file};
|
2024-04-05 17:26:22 +02:00
|
|
|
})
|
|
|
|
(attrNames (readDir ./${directory}))));
|
2024-04-06 04:51:24 +02:00
|
|
|
|
|
|
|
attributeSet =
|
2024-04-08 16:33:06 +02:00
|
|
|
if directory == "packages" || directory == "tests"
|
2024-04-06 04:51:24 +02:00
|
|
|
then { x86_64-linux = attributeValue; }
|
|
|
|
else attributeValue;
|
2024-04-05 17:26:22 +02:00
|
|
|
in
|
|
|
|
(attributeSet);
|
|
|
|
})
|
2024-04-01 21:29:40 +02:00
|
|
|
(flakeOutputs)));
|
2023-05-04 19:09:45 +02:00
|
|
|
}
|