{ description = "A NixOS Configuration"; inputs = {}; outputs = {self, ...}: let sources = import ./unflake.nix; system = "x86_64-linux"; packageSets = rec { stable = sources.nixpkgs-stable.legacyPackages.${system}; unstable = sources.nixpkgs-unstable.legacyPackages.${system}; in_tree = import ./pkgs { unstable_pkgs = unstable; stable_pkgs = stable; inherit extra_lib; }; }; lib = packageSets.unstable.lib; extra_lib = sources.library.extraLib {inherit lib;}; extra_modules = { nixos = { agenix = sources.agenix.nixosModules.default; turtle = sources.turtle.nixosModules.nixos; disko = sources.disko.nixosModules.default; impermanence = sources.impermanence.nixosModules.impermanence; simple-nixos-mailserver = sources.simple-nixos-mailserver.nixosModule; rocie = sources.rocie.nixosModules.default; home-manager = sources.home-manager.nixosModules.home-manager; lanzaboote = sources.lanzaboote.nixosModules.lanzaboote; }; home = { nix-index-database = sources.nix-index-database.homeModules.nix-index; nixvim = sources.nixvim.homeModules.nixvim; turtle = sources.turtle.nixosModules.home-manager; }; }; module_args = { inherit sources # extra package sources openPRsNixpkgs packageSets # extra information system ; }; special_args = { inherit self # Needs to be a special argument, because it is used for determining the `imports` # value (via `mkByName`). extra_lib extra_modules ; }; openPRsNixpkgs = {}; treefmtEval = import ./treefmt.nix { inherit (sources) treefmt-nix; pkgs = packageSets.unstable; }; hosts = import ./hosts { inherit self extra_lib module_args special_args system ; inherit (sources) nixpkgs-unstable nixpkgs-stable deploy-rs ; }; deployChecks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) sources.deploy-rs.lib; tests = lib.attrsets.filterAttrs (_: v: !(v ? meta && v.meta.broken)) (import ./tests { inherit sources packageSets module_args special_args extra_lib; }); # myPkgsFlat = # builtins.listToAttrs # # Filter out the `override` and `overrideDerivation` functions # (builtins.filter # ({ name, value, }: lib.attrsets.isDerivation value) # (lib.lists.flatten # (lib.attrsets.mapAttrsToList # (name: value: # if lib.attrsets.isDerivation value then # [ { inherit name value; } ] # else # lib.attrsets.mapAttrsToList # (name: value: { inherit name value; }) # value # ) # packageSets.in_tree # ) # ) # ); in { checks."${system}" = extra_lib.warnMerge deployChecks."${system}" (extra_lib.warnMerge tests {formatting = treefmtEval.config.build.check self;} "the flake checks and formatting") "the flake checks and deploy rs checks"; legacyPackages."${system}" = packageSets.unstable; packages."${system}" = packageSets.in_tree; formatter."${system}" = treefmtEval.config.build.wrapper; devShells."${system}".default = packageSets.unstable.mkShell { packages = [ packageSets.unstable.deploy-rs # Used to update the stalwart-mail spamfilter packageSets.unstable.nix-update packageSets.unstable.nvd (sources.agenix.packages."${system}".default.override { nix = packageSets.unstable.lixPackageSets.latest.lix; }) ]; }; deploy.nodes = hosts.nodes; inherit (hosts) nixosConfigurations; }; }