From f2145637395eaf04ce316b8caa7870a88e60b2c0 Mon Sep 17 00:00:00 2001 From: iFargle Date: Sat, 9 Dec 2023 22:10:15 +0900 Subject: [PATCH] breaking everything --- flake.nix | 13 +++++++++++++ lib/default.nix | 10 ++++++++++ 2 files changed, 23 insertions(+) diff --git a/flake.nix b/flake.nix index 781da898..7f8885ee 100644 --- a/flake.nix +++ b/flake.nix @@ -67,6 +67,19 @@ nixos-iso-console = libx.mkImage { hostname = "nixos-iso-console"; format = "iso"; }; nixos-iso-desktop = libx.mkImage { hostname = "nixos-iso-desktop"; format = "iso"; desktop = "gnome"; }; }; + deploy.nodes = { + # Virtual + osaka-linode-01 = libx.deploy { hostname = "osaka-linode-01"; }; + nixos-vm-01 = libx.deploy { hostname = "nixos-vm-01"; }; + # Physical + framework-server = libx.deploy { hostname = "framework-server"; }; + nixos-desktop = libx.deploy { hostname = "nixos-desktop"; }; + nixos-framework = libx.deploy { hostname = "nixos-framework "; }; + nixos-rpi4-01 = libx.deploy { hostname = "nixos-rpi4-01"; }; + nixos-rpi4-02 = libx.deploy { hostname = "nixos-rpi4-02"; }; + nixos-rpi4-03 = libx.deploy { hostname = "nixos-rpi4-03"; }; + }; + checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib; # Devshell for bootstrapping; acessible via 'nix develop' devShells = libx.forAllSystems (system: diff --git a/lib/default.nix b/lib/default.nix index f89d770a..fadeff73 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -1,5 +1,15 @@ { inputs, outputs, stateVersion, hmStateVersion, ... }: { + deploy = { + hostname, + platform ? "x86_64-linux", + username ? "albert" + }: { + user = "${username}"; + profiles.system.path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.${hostname}; + profiles.system.sshUser = "${username}"; + }; + # Helper function for generating home-manager configs mkHome = { hostname,