{ description = "NixOS server config"; inputs = {}; outputs = {self, ...} @ attrs: let sources = import ./unflake.nix; inherit (sources) nixpkgs; inherit (sources) nixpkgs-unstable; inherit (sources) library; inherit (sources) treefmt-nix; inherit (sources) deploy-rs; # modules inherit (sources) agenix; inherit (sources) turtle; inherit (sources) disko; inherit (sources) impermanence; inherit (sources) simple-nixos-mailserver; inherit (sources) rocie; system = "x86_64-linux"; nixos-lib = import (nixpkgs + "/nixos/lib") {}; pkgs = nixpkgs.legacyPackages.${system}; pkgsUnstable = nixpkgs-unstable.legacyPackages.${system}; specialArgs = attrs // { inherit pkgsUnstable vhackPackages nixpkgs-unstable nixos-lib extraModules nixLib turtle ; }; extraModules = [ agenix.nixosModules.default turtle.nixosModules.nixos disko.nixosModules.default impermanence.nixosModules.impermanence simple-nixos-mailserver.nixosModule rocie.nixosModules.default ]; deployChecks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; tests = pkgs.lib.attrsets.filterAttrs (_: v: !(v ? meta && v.meta.broken)) (import ./tests {inherit pkgs specialArgs nixLib;}); vhackPackages = import ./pkgs {inherit pkgs nixLib pkgsUnstable;}; hosts = import ./hosts {inherit self deploy-rs pkgs nixLib nixpkgs specialArgs extraModules;}; inherit (library) nixLib; treefmtEval = import ./treefmt.nix {inherit treefmt-nix pkgs;}; in { checks."${system}" = nixLib.warnMerge deployChecks."${system}" (nixLib.warnMerge tests { formatting = treefmtEval.config.build.check self; } "the flake checks and formatting") "the flake checks and deploy rs checks"; packages."${system}" = vhackPackages; formatter."${system}" = treefmtEval.config.build.wrapper; devShells."${system}" = { default = pkgs.mkShell { packages = [ pkgs.git-bug pkgs.deploy-rs # Used to update the stalwart-mail spamfilter pkgs.nix-update pkgs.cocogitto (agenix.packages."${system}".default.override { nix = pkgs.lixPackageSets.latest.lix; }) ]; }; }; deploy.nodes = hosts.nodes; inherit (hosts) nixosConfigurations; }; }