{ description = "Yadunand's Configuration"; inputs = { agenix.url = "github:ryantm/agenix"; deploy-rs = { url = "github:serokell/deploy-rs"; inputs.nixpkgs.follows = "nixpkgs"; }; disko = { url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; }; home-manager = { url = "github:nix-community/home-manager"; inputs.nixpkgs.follows = "nixpkgs"; }; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixvim = { url = "github:nix-community/nixvim"; inputs.nixpkgs.follows = "nixpkgs"; }; snowfall-lib = { url = "github:snowfallorg/lib"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = inputs: let # Base outputs generated by snowfall-lib flake = inputs.snowfall-lib.mkFlake { inherit inputs; src = ./.; snowfall = { namespace = "snowfall"; }; systems.modules.nixos = with inputs; [ agenix.nixosModules.default ]; homes.modules = with inputs; [ agenix.homeManagerModules.default ]; channels-config = { allowUnfree = true; }; }; inventory = import ./inventory.nix; mkNode = name: let node = inventory.nodes.${name}; system = flake.nixosConfigurations.${name}.pkgs.system; activate = inputs.deploy-rs.lib.${system}.activate; in { hostname = node.zerotierIp or node.hostname; profiles.system = { user = "root"; path = activate.nixos flake.nixosConfigurations.${name}; }; }; deployCfg = { user = "root"; remoteBuild = true; nodes = builtins.listToAttrs ( map (name: { name = name; value = mkNode name; }) (builtins.attrNames inventory.nodes) ); }; in flake // { # deploy-rs configuration generated from inventory.nix deploy = deployCfg; # Helpful check to validate deploy config checks.x86_64-linux.deploy = inputs.deploy-rs.lib.x86_64-linux.deployChecks deployCfg; }; }