diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..71f9b16 --- /dev/null +++ b/flake.nix @@ -0,0 +1,33 @@ +{ + + description = "Deployment for skynet"; + + inputs = { + # gonna start off with a fairly modern base + nixpkgs.url = "nixpkgs/nixos-23.05"; + + # utility stuff + flake-utils.url = "github:numtide/flake-utils"; + agenix.url = "github:ryantm/agenix"; + deploy-rs.url = "github:serokell/deploy-rs"; + + }; + + outputs = { self, nixpkgs, deploy-rs }: { + nixosConfigurations.some-random-system = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + #./some-random-system/configuration.nix + ]; + }; + + deploy.nodes.some-random-system.profiles.system = { + user = "root"; + path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.some-random-system; + }; + + # This is highly advised, and will prevent many possible mistakes + checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; + }; + +}