2019-12-03 05:18:30 +00:00
|
|
|
{
|
2019-12-05 08:36:15 +00:00
|
|
|
description = "A highly structured configuration database.";
|
2019-12-05 05:36:36 +00:00
|
|
|
|
2020-08-02 04:08:41 +00:00
|
|
|
inputs =
|
|
|
|
{
|
|
|
|
master.url = "nixpkgs/master";
|
2020-12-02 03:16:04 +00:00
|
|
|
nixos.url = "nixpkgs/release-20.09";
|
|
|
|
home.url = "github:nix-community/home-manager/release-20.09";
|
2020-12-28 04:19:45 +00:00
|
|
|
flake-utils.url = "github:numtide/flake-utils";
|
2020-12-29 06:12:27 +00:00
|
|
|
devshell.url = "github:numtide/devshell";
|
2020-08-02 04:08:41 +00:00
|
|
|
};
|
2019-12-14 04:39:25 +00:00
|
|
|
|
2020-12-29 06:12:27 +00:00
|
|
|
outputs = inputs@{ self, home, nixos, master, flake-utils, nur, devshell }:
|
2020-01-04 05:06:31 +00:00
|
|
|
let
|
2020-12-29 03:33:26 +00:00
|
|
|
inherit (builtins) attrNames attrValues readDir elem pathExists filter;
|
|
|
|
inherit (flake-utils.lib) eachDefaultSystem mkApp;
|
2020-08-02 04:08:41 +00:00
|
|
|
inherit (nixos) lib;
|
2020-12-29 03:33:26 +00:00
|
|
|
inherit (lib) all removeSuffix recursiveUpdate genAttrs filterAttrs
|
|
|
|
mapAttrs;
|
2020-12-25 19:53:57 +00:00
|
|
|
inherit (utils) pathsToImportedAttrs genPkgset overlayPaths modules
|
2020-12-28 04:19:45 +00:00
|
|
|
genPackages pkgImport;
|
2020-01-04 23:08:49 +00:00
|
|
|
|
2020-07-30 21:29:58 +00:00
|
|
|
utils = import ./lib/utils.nix { inherit lib; };
|
2020-06-01 23:14:33 +00:00
|
|
|
|
2020-07-30 21:29:58 +00:00
|
|
|
system = "x86_64-linux";
|
2020-06-01 23:14:33 +00:00
|
|
|
|
2020-12-29 06:12:27 +00:00
|
|
|
externOverlays = [ nur.overlay devshell.overlay ];
|
2020-12-28 22:07:15 +00:00
|
|
|
externModules = [ home.nixosModules.home-manager ];
|
2020-01-05 22:39:59 +00:00
|
|
|
|
2020-12-25 19:53:57 +00:00
|
|
|
pkgset =
|
2020-12-31 20:44:57 +00:00
|
|
|
let overlays =
|
|
|
|
(attrValues self.overlays)
|
|
|
|
++ externOverlays
|
|
|
|
++ [ self.overlay ];
|
|
|
|
in
|
2020-12-25 19:53:57 +00:00
|
|
|
genPkgset {
|
|
|
|
inherit master nixos overlays system;
|
|
|
|
};
|
2020-01-02 02:24:09 +00:00
|
|
|
|
2020-12-28 04:19:45 +00:00
|
|
|
outputs = {
|
|
|
|
nixosConfigurations =
|
|
|
|
import ./hosts (recursiveUpdate inputs {
|
2020-12-28 22:07:15 +00:00
|
|
|
inherit lib pkgset system utils externModules;
|
2020-12-28 04:19:45 +00:00
|
|
|
});
|
2020-07-14 02:00:47 +00:00
|
|
|
|
2020-12-28 04:19:45 +00:00
|
|
|
overlay = import ./pkgs;
|
2020-01-02 02:24:09 +00:00
|
|
|
|
2020-12-28 04:19:45 +00:00
|
|
|
overlays = pathsToImportedAttrs overlayPaths;
|
2020-01-02 02:24:09 +00:00
|
|
|
|
2020-12-28 04:19:45 +00:00
|
|
|
nixosModules = modules;
|
2020-01-11 05:39:42 +00:00
|
|
|
|
2020-12-28 04:19:45 +00:00
|
|
|
templates.flk.path = ./.;
|
2020-08-02 04:29:42 +00:00
|
|
|
|
2020-12-28 04:19:45 +00:00
|
|
|
templates.flk.description = "flk template";
|
2020-08-02 04:29:42 +00:00
|
|
|
|
2020-12-28 04:19:45 +00:00
|
|
|
defaultTemplate = self.templates.flk;
|
|
|
|
};
|
|
|
|
in
|
2020-12-29 03:33:26 +00:00
|
|
|
(eachDefaultSystem
|
|
|
|
(system':
|
|
|
|
let
|
|
|
|
pkgs' = pkgImport {
|
|
|
|
pkgs = master;
|
|
|
|
system = system';
|
2020-12-29 06:12:27 +00:00
|
|
|
overlays = [ devshell.overlay ];
|
2020-12-29 03:33:26 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
packages' = genPackages {
|
|
|
|
overlay = self.overlay;
|
|
|
|
overlays = self.overlays;
|
|
|
|
pkgs = pkgs';
|
|
|
|
};
|
|
|
|
|
|
|
|
filtered = filterAttrs
|
|
|
|
(_: v:
|
|
|
|
(v.meta ? platforms)
|
|
|
|
&& (elem system' v.meta.platforms)
|
|
|
|
&& (
|
|
|
|
(all (dev: dev.meta ? platforms) v.buildInputs)
|
|
|
|
&& (all (dev: elem system' dev.meta.platforms) v.buildInputs)
|
|
|
|
))
|
|
|
|
packages';
|
|
|
|
in
|
|
|
|
{
|
|
|
|
devShell = import ./shell.nix {
|
|
|
|
pkgs = pkgs';
|
|
|
|
};
|
|
|
|
|
|
|
|
apps =
|
|
|
|
let
|
|
|
|
validApps = attrNames (filterAttrs (_: drv: pathExists "${drv}/bin")
|
|
|
|
self.packages."${system}");
|
|
|
|
|
|
|
|
validSystems = attrNames filtered;
|
|
|
|
|
|
|
|
filterBins = filterAttrs
|
|
|
|
(n: _: elem n validSystems && elem n validApps)
|
|
|
|
filtered;
|
|
|
|
in
|
|
|
|
mapAttrs (_: drv: mkApp { inherit drv; }) filterBins;
|
2020-12-28 04:19:45 +00:00
|
|
|
|
2020-12-29 03:33:26 +00:00
|
|
|
packages =
|
|
|
|
filtered;
|
|
|
|
})) // outputs;
|
2019-12-03 05:18:30 +00:00
|
|
|
}
|