1
1
mirror of https://github.com/divnix/digga.git synced 2024-12-17 21:21:54 +03:00
digga/flake.nix
2020-04-23 12:03:55 -06:00

54 lines
1.4 KiB
Nix

{
description = "A highly structured configuration database.";
epoch = 201909;
inputs.nixpkgs.url = "nixpkgs/release-20.03";
inputs.home.url = "github:nrdxp/home-manager/flakes";
outputs = inputs@{ self, home, nixpkgs }:
let
inherit (builtins) listToAttrs baseNameOf attrNames readDir;
inherit (nixpkgs.lib) removeSuffix;
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = self.overlays;
config = { allowUnfree = true; };
};
in {
nixosConfigurations =
let configs = import ./hosts (inputs // { inherit system pkgs; });
in configs;
overlay = import ./pkgs;
overlays = let
overlays = map (name: import (./overlays + "/${name}"))
(attrNames (readDir ./overlays));
in overlays;
packages.x86_64-linux = {
inherit (pkgs) sddm-chili dejavu_nerdfont purs pure;
};
nixosModules = let
prep = map (path: {
name = removeSuffix ".nix" (baseNameOf path);
value = import path;
});
# modules
moduleList = import ./modules/list.nix;
modulesAttrs = listToAttrs (prep moduleList);
# profiles
profilesList = import ./profiles/list.nix;
profilesAttrs = { profiles = listToAttrs (prep profilesList); };
in modulesAttrs // profilesAttrs;
};
}