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-01 17:15:07 +02:00
|
|
|
outputs = { self, nixpkgs, home-manager, stylix, ... } @ attrs: let
|
|
|
|
inherit (nixpkgs.lib) nixosSystem;
|
|
|
|
inherit (nixpkgs.legacyPackages.x86_64-linux) nixpkgs-fmt callPackage;
|
2024-04-01 17:48:10 +02:00
|
|
|
|
2024-04-02 11:15:15 +02:00
|
|
|
checkArgs = {
|
|
|
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
|
|
|
inherit self;
|
|
|
|
};
|
|
|
|
|
2024-04-01 17:48:10 +02:00
|
|
|
flakeOutputs = [ "overlays" "nixosModules" "homeManagerModules" "packages" ];
|
|
|
|
flakeDirectories = [ "overlays" "modules" "home" "packages" ];
|
|
|
|
packageDirectory = "packages";
|
2024-04-01 17:15:07 +02:00
|
|
|
in {
|
|
|
|
formatter.x86_64-linux = nixpkgs-fmt;
|
|
|
|
|
2024-03-09 03:25:47 +01:00
|
|
|
nixosConfigurations = {
|
|
|
|
nixos = nixosSystem {
|
|
|
|
system = "x86_64-linux";
|
|
|
|
specialArgs = attrs;
|
2024-04-01 00:51:09 +02:00
|
|
|
modules = [
|
2024-04-01 13:12:15 +02:00
|
|
|
home-manager.nixosModules.home-manager
|
|
|
|
stylix.nixosModules.stylix
|
|
|
|
./hardware/laptop.nix
|
2024-04-01 00:51:09 +02:00
|
|
|
{
|
2024-04-01 10:25:10 +02:00
|
|
|
environment.pathsToLink = [
|
|
|
|
"/share/backgrounds"
|
|
|
|
"/share/eww"
|
|
|
|
"/share/thumbnailers"
|
|
|
|
"/share/fonts"
|
|
|
|
];
|
|
|
|
|
2024-04-01 00:51:09 +02:00
|
|
|
nixpkgs.overlays = builtins.attrValues self.overlays;
|
2024-04-01 01:23:01 +02:00
|
|
|
imports = builtins.attrValues self.nixosModules;
|
|
|
|
home-manager.sharedModules = builtins.attrValues self.homeManagerModules;
|
2024-04-01 10:25:10 +02:00
|
|
|
environment.systemPackages = builtins.attrValues self.packages.x86_64-linux;
|
2024-04-04 06:25:01 +02:00
|
|
|
|
|
|
|
modules.hardware = {
|
|
|
|
disableLaptopKeyboard = true;
|
|
|
|
lidIgnore = true;
|
|
|
|
powerIgnore = true;
|
|
|
|
};
|
2024-04-01 00:51:09 +02:00
|
|
|
}
|
|
|
|
];
|
2024-03-09 03:25:47 +01:00
|
|
|
};
|
2023-06-21 08:41:38 +02:00
|
|
|
};
|
2024-04-02 11:15:15 +02:00
|
|
|
|
|
|
|
checks.x86_64-linux = {
|
|
|
|
hyprland = import ./tests/hyprland.nix checkArgs;
|
|
|
|
neovim = import ./tests/neovim.nix checkArgs;
|
|
|
|
};
|
2024-04-01 04:22:22 +02:00
|
|
|
} //
|
|
|
|
(builtins.listToAttrs
|
|
|
|
(builtins.map
|
2024-04-01 17:05:08 +02:00
|
|
|
(attributeName: {
|
|
|
|
name = attributeName;
|
2024-04-01 04:22:22 +02:00
|
|
|
value = let
|
2024-04-01 17:48:10 +02:00
|
|
|
directory = builtins.replaceStrings flakeOutputs flakeDirectories attributeName;
|
2024-04-01 17:05:08 +02:00
|
|
|
attributeValue = (builtins.listToAttrs
|
2024-04-01 10:12:21 +02:00
|
|
|
(builtins.map
|
2024-04-01 17:05:08 +02:00
|
|
|
(file: {
|
2024-04-01 21:29:40 +02:00
|
|
|
name = builtins.replaceStrings [ ".nix" ] [ "" ] file;
|
2024-04-01 17:48:10 +02:00
|
|
|
value = if directory == packageDirectory then callPackage ./${directory}/${file} { } else import ./${directory}/${file}; })
|
2024-04-01 17:05:08 +02:00
|
|
|
(builtins.attrNames (builtins.readDir ./${directory}))));
|
2024-04-01 17:48:10 +02:00
|
|
|
attributeSet = if directory == packageDirectory then { x86_64-linux = attributeValue; } else attributeValue;
|
2024-04-01 17:05:08 +02:00
|
|
|
in (attributeSet); })
|
2024-04-01 21:29:40 +02:00
|
|
|
(flakeOutputs)));
|
2023-05-04 19:09:45 +02:00
|
|
|
}
|