2019-12-03 08:18:30 +03:00
|
|
|
{
|
2019-12-05 11:36:15 +03:00
|
|
|
description = "A highly structured configuration database.";
|
2019-12-05 08:36:36 +03:00
|
|
|
|
2020-08-02 07:08:41 +03:00
|
|
|
inputs =
|
|
|
|
{
|
2021-02-15 05:43:11 +03:00
|
|
|
override.url = "nixpkgs";
|
2020-12-02 06:16:04 +03:00
|
|
|
nixos.url = "nixpkgs/release-20.09";
|
|
|
|
home.url = "github:nix-community/home-manager/release-20.09";
|
2021-02-08 00:24:41 +03:00
|
|
|
home.inputs.nixpkgs.follows = "nixos";
|
2021-02-15 08:11:49 +03:00
|
|
|
utils.url = "github:numtide/flake-utils/flatten-tree-system";
|
2020-12-29 09:12:27 +03:00
|
|
|
devshell.url = "github:numtide/devshell";
|
2021-01-18 10:37:11 +03:00
|
|
|
nixos-hardware.url = "github:nixos/nixos-hardware";
|
2021-01-25 19:20:40 +03:00
|
|
|
ci-agent.url = "github:hercules-ci/hercules-ci-agent";
|
2021-02-08 00:24:41 +03:00
|
|
|
ci-agent.inputs.nixos-20_09.follows = "nixos";
|
2021-02-14 05:38:20 +03:00
|
|
|
ci-agent.inputs.nixos-unstable.follows = "override";
|
2021-02-15 08:08:24 +03:00
|
|
|
ci-agent.inputs.flake-compat.follows = "flake-compat";
|
2021-02-15 08:17:24 +03:00
|
|
|
deploy.url = "github:serokell/deploy-rs";
|
|
|
|
deploy.inputs.utils.follows = "utils";
|
|
|
|
deploy.inputs.naersk.follows = "naersk";
|
|
|
|
deploy.inputs.nixpkgs.follows = "override";
|
|
|
|
deploy.inputs.flake-compat.follows = "flake-compat";
|
|
|
|
naersk.url = "github:nmattia/naersk";
|
|
|
|
naersk.inputs.nixpkgs.follows = "override";
|
2021-02-26 09:43:03 +03:00
|
|
|
flake-compat.url = "github:BBBSnowball/flake-compat/pr-1";
|
2021-02-15 08:08:24 +03:00
|
|
|
flake-compat.flake = false;
|
2021-02-23 05:49:31 +03:00
|
|
|
srcs.url = "path:./pkgs";
|
2020-08-02 07:08:41 +03:00
|
|
|
};
|
2019-12-14 07:39:25 +03:00
|
|
|
|
2021-01-25 19:20:40 +03:00
|
|
|
outputs =
|
2021-02-15 08:17:24 +03:00
|
|
|
inputs@{ ci-agent
|
|
|
|
, deploy
|
|
|
|
, devshell
|
2021-01-25 19:20:40 +03:00
|
|
|
, home
|
|
|
|
, nixos
|
2021-02-15 08:17:24 +03:00
|
|
|
, nixos-hardware
|
|
|
|
, nur
|
2021-02-14 05:38:20 +03:00
|
|
|
, override
|
2021-02-15 08:17:24 +03:00
|
|
|
, self
|
2021-02-15 08:11:49 +03:00
|
|
|
, utils
|
2021-02-15 08:08:24 +03:00
|
|
|
, ...
|
2021-01-25 19:20:40 +03:00
|
|
|
}:
|
2020-01-04 08:06:31 +03:00
|
|
|
let
|
2021-02-15 08:11:49 +03:00
|
|
|
inherit (utils.lib) eachDefaultSystem flattenTreeSystem;
|
2021-02-15 21:24:43 +03:00
|
|
|
inherit (nixos.lib) recursiveUpdate;
|
2021-02-04 09:44:58 +03:00
|
|
|
inherit (self.lib) overlays nixosModules genPackages genPkgs
|
2021-02-15 21:24:43 +03:00
|
|
|
genHomeActivationPackages mkNodes;
|
2020-06-02 02:14:33 +03:00
|
|
|
|
2021-02-04 09:44:58 +03:00
|
|
|
extern = import ./extern { inherit inputs; };
|
|
|
|
|
|
|
|
pkgs' = genPkgs { inherit self; };
|
2020-01-06 01:39:59 +03:00
|
|
|
|
2021-01-03 10:05:39 +03:00
|
|
|
outputs =
|
|
|
|
let
|
2021-01-19 10:51:23 +03:00
|
|
|
system = "x86_64-linux";
|
2021-02-04 09:44:58 +03:00
|
|
|
pkgs = pkgs'.${system};
|
2021-01-03 10:05:39 +03:00
|
|
|
in
|
|
|
|
{
|
2021-01-19 10:51:23 +03:00
|
|
|
inherit nixosModules overlays;
|
|
|
|
|
2021-01-03 10:05:39 +03:00
|
|
|
nixosConfigurations =
|
2021-02-04 09:44:58 +03:00
|
|
|
import ./hosts (recursiveUpdate inputs {
|
|
|
|
inherit pkgs system extern;
|
|
|
|
inherit (pkgs) lib;
|
|
|
|
});
|
2021-01-14 10:20:00 +03:00
|
|
|
|
2021-01-03 10:05:39 +03:00
|
|
|
overlay = import ./pkgs;
|
2020-01-02 05:24:09 +03:00
|
|
|
|
2021-02-02 04:57:19 +03:00
|
|
|
lib = import ./lib { inherit nixos; };
|
2020-01-11 08:39:42 +03:00
|
|
|
|
2021-01-03 10:05:39 +03:00
|
|
|
templates.flk.path = ./.;
|
2020-08-02 07:29:42 +03:00
|
|
|
|
2021-01-03 10:05:39 +03:00
|
|
|
templates.flk.description = "flk template";
|
2020-08-02 07:29:42 +03:00
|
|
|
|
2021-01-03 10:05:39 +03:00
|
|
|
defaultTemplate = self.templates.flk;
|
2021-02-15 08:17:24 +03:00
|
|
|
|
2021-02-15 21:24:43 +03:00
|
|
|
deploy.nodes = mkNodes deploy self.nixosConfigurations;
|
2021-02-15 08:17:24 +03:00
|
|
|
|
|
|
|
checks = builtins.mapAttrs
|
|
|
|
(system: deployLib: deployLib.deployChecks self.deploy)
|
|
|
|
deploy.lib;
|
2021-01-03 10:05:39 +03:00
|
|
|
};
|
2021-01-19 10:51:23 +03:00
|
|
|
|
2021-02-04 09:44:58 +03:00
|
|
|
systemOutputs = eachDefaultSystem (system:
|
|
|
|
let pkgs = pkgs'.${system}; in
|
2021-01-25 19:21:27 +03:00
|
|
|
{
|
2021-02-04 09:44:58 +03:00
|
|
|
packages = flattenTreeSystem system
|
|
|
|
(genPackages {
|
|
|
|
inherit self pkgs;
|
|
|
|
});
|
2020-12-29 06:33:26 +03:00
|
|
|
|
2021-01-25 19:21:27 +03:00
|
|
|
devShell = import ./shell {
|
2021-02-14 12:29:17 +03:00
|
|
|
inherit self system;
|
2021-01-25 19:21:27 +03:00
|
|
|
};
|
2021-01-19 10:51:23 +03:00
|
|
|
|
2021-02-04 09:44:58 +03:00
|
|
|
legacyPackages.hmActivationPackages =
|
|
|
|
genHomeActivationPackages { inherit self; };
|
|
|
|
}
|
|
|
|
);
|
|
|
|
in
|
|
|
|
recursiveUpdate outputs systemOutputs;
|
2019-12-03 08:18:30 +03:00
|
|
|
}
|