forked from pub-solar/os
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, ... }:
|
outputs = inputs@{ deploy, nixos, nur, self, utils, ... }:
|
||||||
let
|
let
|
||||||
inherit (self) lib;
|
lib = import ./lib { inherit self nixos inputs; };
|
||||||
inherit (lib) os;
|
in
|
||||||
|
lib.mkFlake {
|
||||||
extern = import ./extern { inherit inputs; };
|
inherit self;
|
||||||
overrides = import ./overrides;
|
hosts = ./hosts;
|
||||||
|
packages = import ./pkgs;
|
||||||
multiPkgs = os.mkPkgs {
|
|
||||||
inherit extern overrides;
|
|
||||||
};
|
|
||||||
|
|
||||||
suites = os.mkSuites {
|
|
||||||
suites = import ./suites;
|
suites = import ./suites;
|
||||||
users = os.mkProfileAttrs "${self}/users";
|
extern = import ./extern;
|
||||||
profiles = os.mkProfileAttrs "${self}/profiles";
|
|
||||||
userProfiles = os.mkProfileAttrs "${self}/users/profiles";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = {
|
|
||||||
nixosConfigurations = os.mkHosts {
|
|
||||||
dir = "${self}/hosts";
|
|
||||||
overrides = import ./overrides;
|
overrides = import ./overrides;
|
||||||
inherit multiPkgs suites extern;
|
overlays = ./overlays;
|
||||||
};
|
profiles = ./profiles;
|
||||||
|
userProfiles = ./users/profiles;
|
||||||
homeConfigurations = os.mkHomeConfigurations;
|
modules = import ./modules/module-list.nix;
|
||||||
|
userModules = import ./users/modules/module-list.nix;
|
||||||
nixosModules =
|
} // {
|
||||||
let moduleList = import ./modules/module-list.nix;
|
inherit lib;
|
||||||
in lib.pathsToImportedAttrs moduleList;
|
defaultTemplate = self.templates.flk;
|
||||||
|
|
||||||
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; };
|
|
||||||
|
|
||||||
templates.flk.path = ./.;
|
templates.flk.path = ./.;
|
||||||
templates.flk.description = "flk template";
|
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