nix-config/flake.nix
Donovan Glover 44422516d4
feat(nix): Automatically import module outputs
This drastically simplifies things since we no longer have to worry
about adding and removing files from a default.nix.
2024-03-31 19:23:12 -04:00

48 lines
1.4 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
home-manager = {
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
stylix = {
url = "github:bluskript/stylix";
inputs = {
nixpkgs.follows = "nixpkgs";
home-manager.follows = "home-manager";
};
};
sakaya = {
url = "github:donovanglover/sakaya";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, ... } @ attrs: with nixpkgs.lib; {
nixosConfigurations = {
nixos = nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules = [
./.
{
nixpkgs.overlays = builtins.attrValues self.overlays;
imports = builtins.attrValues self.nixosModules;
home-manager.sharedModules = builtins.attrValues self.homeManagerModules;
}
];
};
};
packages."x86_64-linux" = with nixpkgs.legacyPackages."x86_64-linux";
builtins.mapAttrs (name: value: callPackage ./packages/${name}) (builtins.readDir ./packages);
overlays = builtins.mapAttrs (name: value: import ./overlays/${name}) (builtins.readDir ./overlays);
nixosModules = builtins.mapAttrs (name: value: import ./modules/${name}) (builtins.readDir ./modules);
homeManagerModules = builtins.mapAttrs (name: value: import ./home/${name}) (builtins.readDir ./home);
};
}