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 =
|
|
|
|
{
|
2021-01-11 19:26:25 +00:00
|
|
|
# Once desired, bump master's locked revision:
|
2021-01-11 19:14:48 +00:00
|
|
|
# nix flake update --update-input master
|
2020-08-02 04:08:41 +00:00
|
|
|
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";
|
2021-01-03 07:05:39 +00:00
|
|
|
flake-utils.url = "github:numtide/flake-utils/flatten-tree-system";
|
2020-12-29 06:12:27 +00:00
|
|
|
devshell.url = "github:numtide/devshell";
|
2021-01-18 07:37:11 +00:00
|
|
|
nixos-hardware.url = "github:nixos/nixos-hardware";
|
2020-08-02 04:08:41 +00:00
|
|
|
};
|
2019-12-14 04:39:25 +00:00
|
|
|
|
2021-01-18 07:37:11 +00:00
|
|
|
outputs = inputs@{ self, home, nixos, master, flake-utils, nur, devshell, nixos-hardware }:
|
2020-01-04 05:06:31 +00:00
|
|
|
let
|
2021-01-19 07:51:23 +00:00
|
|
|
inherit (builtins) attrValues;
|
|
|
|
inherit (flake-utils.lib) eachDefaultSystem flattenTreeSystem;
|
|
|
|
inherit (nixos.lib) recursiveUpdate;
|
|
|
|
inherit (self.lib) overlays nixosModules genPackages pkgImport;
|
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
|
|
|
|
2021-01-03 07:05:39 +00:00
|
|
|
outputs =
|
|
|
|
let
|
2021-01-19 07:51:23 +00:00
|
|
|
system = "x86_64-linux";
|
|
|
|
pkgs = self.legacyPackages.${system};
|
2021-01-03 07:05:39 +00:00
|
|
|
in
|
|
|
|
{
|
2021-01-19 07:51:23 +00:00
|
|
|
inherit nixosModules overlays;
|
|
|
|
|
2021-01-03 07:05:39 +00:00
|
|
|
nixosConfigurations =
|
2021-01-19 07:51:23 +00:00
|
|
|
import ./hosts
|
|
|
|
(recursiveUpdate inputs {
|
|
|
|
inherit pkgs externModules system;
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
});
|
2020-07-14 02:00:47 +00:00
|
|
|
|
2021-01-03 07:05:39 +00:00
|
|
|
overlay = import ./pkgs;
|
2020-01-02 02:24:09 +00:00
|
|
|
|
2021-01-19 07:51:23 +00:00
|
|
|
lib = import ./lib {
|
|
|
|
inherit (nixos) lib;
|
|
|
|
};
|
2020-01-11 05:39:42 +00:00
|
|
|
|
2021-01-03 07:05:39 +00:00
|
|
|
templates.flk.path = ./.;
|
2020-08-02 04:29:42 +00:00
|
|
|
|
2021-01-03 07:05:39 +00:00
|
|
|
templates.flk.description = "flk template";
|
2020-08-02 04:29:42 +00:00
|
|
|
|
2021-01-03 07:05:39 +00:00
|
|
|
defaultTemplate = self.templates.flk;
|
|
|
|
};
|
2020-12-28 04:19:45 +00:00
|
|
|
in
|
2021-01-12 01:10:48 +00:00
|
|
|
recursiveUpdate
|
|
|
|
(eachDefaultSystem
|
|
|
|
(system:
|
|
|
|
let
|
2021-01-19 07:51:23 +00:00
|
|
|
unstable = pkgImport master [ ] system;
|
|
|
|
|
|
|
|
pkgs =
|
|
|
|
let
|
|
|
|
override = import ./pkgs/override.nix;
|
2021-01-24 18:05:37 +00:00
|
|
|
overlays = [
|
2021-01-19 07:51:23 +00:00
|
|
|
(override unstable)
|
2021-01-24 18:05:37 +00:00
|
|
|
self.overlay
|
2021-01-19 07:51:23 +00:00
|
|
|
(final: prev: {
|
|
|
|
lib = (prev.lib or { }) // {
|
|
|
|
inherit (nixos.lib) nixosSystem;
|
|
|
|
flk = self.lib;
|
|
|
|
utils = flake-utils.lib;
|
|
|
|
};
|
|
|
|
})
|
2021-01-24 18:05:37 +00:00
|
|
|
]
|
|
|
|
++ (attrValues self.overlays)
|
|
|
|
++ externOverlays;
|
2021-01-19 07:51:23 +00:00
|
|
|
in
|
|
|
|
pkgImport nixos overlays system;
|
2020-12-29 03:33:26 +00:00
|
|
|
|
2021-01-12 01:10:48 +00:00
|
|
|
packages = flattenTreeSystem system
|
2021-01-03 07:05:39 +00:00
|
|
|
(genPackages {
|
|
|
|
inherit self pkgs;
|
2021-01-12 01:10:48 +00:00
|
|
|
});
|
|
|
|
in
|
|
|
|
{
|
|
|
|
inherit packages;
|
2020-12-29 03:33:26 +00:00
|
|
|
|
2021-01-19 07:51:23 +00:00
|
|
|
devShell = import ./shell {
|
|
|
|
inherit pkgs nixos;
|
2021-01-12 01:10:48 +00:00
|
|
|
};
|
2021-01-19 07:51:23 +00:00
|
|
|
|
|
|
|
legacyPackages = pkgs;
|
2021-01-12 01:10:48 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
|
outputs;
|
2019-12-03 05:18:30 +00:00
|
|
|
}
|