This commit is contained in:
Reid 2024-03-28 01:38:40 -07:00
commit 132a109da8
15 changed files with 436 additions and 0 deletions

48
flake.nix Executable file
View file

@ -0,0 +1,48 @@
{
description = "a collection of personal nix configurations";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = inputs @ { self, nixpkgs, ... }:
let
inherit (lib.my) mapModules mapModulesRec mapHosts;
system = "x86_64-linux";
mkPkgs = pkgs: extraOverlays:
import pkgs {
inherit system;
config.allowUnfree = true;
config.allowAliases = false;
overlays = extraOverlays ++ (lib.attrValues self.overlays);
};
pkgs = mkPkgs nixpkgs [ self.overlays.default ];
lib = nixpkgs.lib.extend (final: prev: {
my = import ./lib {
inherit pkgs inputs;
lib = final;
};
});
in {
lib = lib.my;
overlays =
(mapModules ./overlays import)
// {
default = final: prev: {
my = self.packages.${system};
};
};
packages."${system}" = mapModules ./packages (p: pkgs.callPackage p {});
nixosModules = mapModulesRec ./modules import;
nixosConfigurations = mapHosts ./hosts {};
};
}