2019-12-02 22:18:30 -07:00
|
|
|
{
|
2019-12-05 01:36:15 -07:00
|
|
|
description = "A highly structured configuration database.";
|
2019-12-04 22:36:36 -07:00
|
|
|
|
2020-08-01 22:08:41 -06:00
|
|
|
inputs =
|
|
|
|
{
|
|
|
|
master.url = "nixpkgs/master";
|
2020-12-01 21:16:04 -06:00
|
|
|
nixos.url = "nixpkgs/release-20.09";
|
|
|
|
home.url = "github:nix-community/home-manager/release-20.09";
|
2020-08-01 22:08:41 -06:00
|
|
|
};
|
2019-12-13 21:39:25 -07:00
|
|
|
|
2020-08-01 22:08:41 -06:00
|
|
|
outputs = inputs@{ self, home, nixos, master }:
|
2020-01-03 22:06:31 -07:00
|
|
|
let
|
2020-07-30 15:29:58 -06:00
|
|
|
inherit (builtins) attrNames attrValues readDir;
|
2020-08-01 22:08:41 -06:00
|
|
|
inherit (nixos) lib;
|
2020-08-02 21:26:00 -06:00
|
|
|
inherit (lib) removeSuffix recursiveUpdate genAttrs filterAttrs;
|
2020-07-30 15:29:58 -06:00
|
|
|
inherit (utils) pathsToImportedAttrs;
|
2020-01-04 16:08:49 -07:00
|
|
|
|
2020-07-30 15:29:58 -06:00
|
|
|
utils = import ./lib/utils.nix { inherit lib; };
|
2020-06-02 01:14:33 +02:00
|
|
|
|
2020-07-30 15:29:58 -06:00
|
|
|
system = "x86_64-linux";
|
2020-06-02 01:14:33 +02:00
|
|
|
|
2020-06-12 19:18:27 -06:00
|
|
|
pkgImport = pkgs:
|
|
|
|
import pkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = attrValues self.overlays;
|
|
|
|
config = { allowUnfree = true; };
|
|
|
|
};
|
|
|
|
|
2020-08-01 22:08:41 -06:00
|
|
|
pkgset = {
|
|
|
|
osPkgs = pkgImport nixos;
|
|
|
|
pkgs = pkgImport master;
|
|
|
|
};
|
2020-01-05 15:39:59 -07:00
|
|
|
|
2020-07-30 22:17:28 -06:00
|
|
|
in
|
2020-08-01 22:08:41 -06:00
|
|
|
with pkgset;
|
2020-07-30 22:17:28 -06:00
|
|
|
{
|
2020-07-30 15:29:58 -06:00
|
|
|
nixosConfigurations =
|
2020-07-30 23:32:53 -06:00
|
|
|
import ./hosts (recursiveUpdate inputs {
|
2020-08-01 22:08:41 -06:00
|
|
|
inherit lib pkgset system utils;
|
2020-07-30 23:32:53 -06:00
|
|
|
}
|
|
|
|
);
|
2020-01-01 19:24:09 -07:00
|
|
|
|
2020-08-01 22:08:41 -06:00
|
|
|
devShell."${system}" = import ./shell.nix {
|
|
|
|
inherit pkgs;
|
|
|
|
};
|
2020-07-13 20:00:47 -06:00
|
|
|
|
2020-01-01 19:24:09 -07:00
|
|
|
overlay = import ./pkgs;
|
|
|
|
|
2020-07-30 22:17:28 -06:00
|
|
|
overlays =
|
|
|
|
let
|
|
|
|
overlayDir = ./overlays;
|
|
|
|
fullPath = name: overlayDir + "/${name}";
|
|
|
|
overlayPaths = map fullPath (attrNames (readDir overlayDir));
|
|
|
|
in
|
|
|
|
pathsToImportedAttrs overlayPaths;
|
2020-01-01 19:24:09 -07:00
|
|
|
|
2020-08-02 21:26:00 -06:00
|
|
|
packages."${system}" =
|
|
|
|
let
|
|
|
|
packages = self.overlay osPkgs osPkgs;
|
|
|
|
overlays = lib.filterAttrs (n: v: n != "pkgs") self.overlays;
|
|
|
|
overlayPkgs =
|
|
|
|
genAttrs
|
|
|
|
(attrNames overlays)
|
|
|
|
(name: (overlays."${name}" osPkgs osPkgs)."${name}");
|
|
|
|
in
|
|
|
|
recursiveUpdate packages overlayPkgs;
|
2019-12-04 22:36:36 -07:00
|
|
|
|
2020-07-30 22:17:28 -06:00
|
|
|
nixosModules =
|
|
|
|
let
|
|
|
|
# binary cache
|
|
|
|
cachix = import ./cachix.nix;
|
|
|
|
cachixAttrs = { inherit cachix; };
|
2020-07-26 16:03:51 -06:00
|
|
|
|
2020-07-30 22:17:28 -06:00
|
|
|
# modules
|
|
|
|
moduleList = import ./modules/list.nix;
|
|
|
|
modulesAttrs = pathsToImportedAttrs moduleList;
|
2020-01-04 16:23:15 -07:00
|
|
|
|
2020-07-30 22:17:28 -06:00
|
|
|
# profiles
|
|
|
|
profilesList = import ./profiles/list.nix;
|
|
|
|
profilesAttrs = { profiles = pathsToImportedAttrs profilesList; };
|
2020-01-10 22:39:42 -07:00
|
|
|
|
2020-07-30 22:17:28 -06:00
|
|
|
in
|
2020-07-30 23:32:53 -06:00
|
|
|
recursiveUpdate
|
|
|
|
(recursiveUpdate cachixAttrs modulesAttrs)
|
|
|
|
profilesAttrs;
|
2020-08-01 22:29:42 -06:00
|
|
|
|
|
|
|
templates.flk.path = ./.;
|
|
|
|
templates.flk.description = "flk template";
|
|
|
|
|
|
|
|
defaultTemplate = self.templates.flk;
|
2020-01-01 19:24:09 -07:00
|
|
|
};
|
2019-12-02 22:18:30 -07:00
|
|
|
}
|