flake: use mkFlake
this is where we create devos's template structure
This commit is contained in:
parent
340784df6d
commit
d068d79bfd
83
flake.nix
83
flake.nix
|
@ -30,77 +30,24 @@
|
|||
|
||||
outputs = inputs@{ deploy, nixos, nur, self, utils, ... }:
|
||||
let
|
||||
inherit (self) lib;
|
||||
inherit (lib) os;
|
||||
|
||||
extern = import ./extern { inherit inputs; };
|
||||
overrides = import ./overrides;
|
||||
|
||||
multiPkgs = os.mkPkgs {
|
||||
inherit extern overrides;
|
||||
};
|
||||
|
||||
suites = os.mkSuites {
|
||||
lib = import ./lib { inherit self nixos inputs; };
|
||||
in
|
||||
lib.mkFlake {
|
||||
inherit self;
|
||||
hosts = ./hosts;
|
||||
packages = import ./pkgs;
|
||||
suites = import ./suites;
|
||||
users = os.mkProfileAttrs "${self}/users";
|
||||
profiles = os.mkProfileAttrs "${self}/profiles";
|
||||
userProfiles = os.mkProfileAttrs "${self}/users/profiles";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
nixosConfigurations = os.mkHosts {
|
||||
dir = "${self}/hosts";
|
||||
extern = import ./extern;
|
||||
overrides = import ./overrides;
|
||||
inherit multiPkgs suites extern;
|
||||
};
|
||||
|
||||
homeConfigurations = os.mkHomeConfigurations;
|
||||
|
||||
nixosModules =
|
||||
let moduleList = import ./modules/module-list.nix;
|
||||
in lib.pathsToImportedAttrs moduleList;
|
||||
|
||||
homeModules =
|
||||
let moduleList = import ./users/modules/module-list.nix;
|
||||
in lib.pathsToImportedAttrs moduleList;
|
||||
|
||||
overlay = import ./pkgs;
|
||||
overlays = lib.pathsToImportedAttrs (lib.pathsIn ./overlays);
|
||||
|
||||
lib = import ./lib { inherit nixos self inputs; };
|
||||
|
||||
overlays = ./overlays;
|
||||
profiles = ./profiles;
|
||||
userProfiles = ./users/profiles;
|
||||
modules = import ./modules/module-list.nix;
|
||||
userModules = import ./users/modules/module-list.nix;
|
||||
} // {
|
||||
inherit lib;
|
||||
defaultTemplate = self.templates.flk;
|
||||
templates.flk.path = ./.;
|
||||
templates.flk.description = "flk template";
|
||||
defaultTemplate = self.templates.flk;
|
||||
|
||||
deploy.nodes = os.mkNodes deploy self.nixosConfigurations;
|
||||
};
|
||||
|
||||
systemOutputs = utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = multiPkgs.${system};
|
||||
# all packages that are defined in ./pkgs
|
||||
legacyPackages = os.mkPackages { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
checks =
|
||||
let
|
||||
tests = nixos.lib.optionalAttrs (system == "x86_64-linux")
|
||||
(import ./tests { inherit self pkgs; });
|
||||
deployHosts = nixos.lib.filterAttrs
|
||||
(n: _: self.nixosConfigurations.${n}.config.nixpkgs.system == system) self.deploy.nodes;
|
||||
deployChecks = deploy.lib.${system}.deployChecks { nodes = deployHosts; };
|
||||
in
|
||||
nixos.lib.recursiveUpdate tests deployChecks;
|
||||
|
||||
inherit legacyPackages;
|
||||
packages = lib.filterPackages system legacyPackages;
|
||||
|
||||
devShell = import ./shell {
|
||||
inherit self system extern overrides;
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
nixos.lib.recursiveUpdate outputs systemOutputs;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue