From 6b6ef3c4a2d6a4fb83ac107b03753cf37265ce62 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Thu, 12 Jan 2023 21:10:17 +0000 Subject: [PATCH] feat: base flake --- flake.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 flake.nix 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; + }; + +}