2023-05-04 19:09:45 +02:00
|
|
|
{
|
|
|
|
inputs = {
|
2024-06-13 19:19:23 +02:00
|
|
|
nixpkgs.url = "github:donovanglover/nixpkgs/unstable-hyprland-v0.41.1";
|
2023-06-06 01:26:46 +02:00
|
|
|
|
2023-05-17 05:07:14 +02:00
|
|
|
home-manager = {
|
2024-06-13 11:16:45 +02: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-06-02 03:18:08 +02:00
|
|
|
url = "github:bluskript/stylix/6bc871ab352c9f18d1179daab9e392a4d46393af";
|
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-06-15 16:46:45 +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-05-13 04:00:37 +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"
|
2024-06-15 16:46:45 +02:00
|
|
|
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
|
|
|
|
{
|
2024-06-15 16:46:45 +02:00
|
|
|
system = "x86_64-linux";
|
2024-04-17 19:54:28 +02:00
|
|
|
specialArgs = attrs // { nix-config = self; };
|
2024-06-15 16:46:45 +02:00
|
|
|
modules = [
|
|
|
|
./.
|
|
|
|
./${directory}/${file}
|
|
|
|
];
|
2024-04-17 19:54:28 +02:00
|
|
|
}
|
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
|
|
|
}
|