summaryrefslogtreecommitdiff
path: root/systems
diff options
context:
space:
mode:
authorseth <[email protected]>2023-12-29 07:03:10 -0500
committerseth <[email protected]>2023-12-29 07:10:37 -0500
commit550b9057a215eb46943fcae51b27632639ae46d5 (patch)
treefe72c2ae5dbeb65f85308035546a2130d68c0698 /systems
parent3eb380133c19b3a50213d6ec416a1fa9c3eab52a (diff)
Revert "systems: nixinate works again"
This reverts commit 874a58f74dea0ee6aa775f43f688e8397bc8cfb5.
Diffstat (limited to 'systems')
-rw-r--r--systems/atlas/default.nix8
-rw-r--r--systems/default.nix6
-rw-r--r--systems/deploy.nix44
3 files changed, 46 insertions, 12 deletions
diff --git a/systems/atlas/default.nix b/systems/atlas/default.nix
index 9e8f926..836aef7 100644
--- a/systems/atlas/default.nix
+++ b/systems/atlas/default.nix
@@ -10,14 +10,6 @@
./teawiebot.nix
];
- _module.args.nixinate = {
- host = config.networking.hostName;
- sshUser = "root";
- buildOn = "remote";
- substituteOnTarget = true;
- hermetic = false;
- };
-
boot = {
loader.systemd-boot.enable = true;
loader.efi.canTouchEfiVariables = true;
diff --git a/systems/default.nix b/systems/default.nix
index bdfaee0..47f6bf6 100644
--- a/systems/default.nix
+++ b/systems/default.nix
@@ -28,6 +28,8 @@
mapNixOS = mapSystems inputs.nixpkgs.lib.nixosSystem;
inherit (import ./common.nix {inherit inputs self;}) darwin nixos server;
in {
+ imports = [./deploy.nix];
+
flake = {
darwinConfigurations = mapDarwin {
caroline = {
@@ -76,8 +78,4 @@ in {
inherit (inputs) openwrt-imagebuilder;
});
};
-
- perSystem = {system, ...}: {
- apps = (inputs.nixinate.nixinate.${system} self).nixinate;
- };
}
diff --git a/systems/deploy.nix b/systems/deploy.nix
new file mode 100644
index 0000000..fbf20d3
--- /dev/null
+++ b/systems/deploy.nix
@@ -0,0 +1,44 @@
+{
+ lib,
+ inputs,
+ self,
+ ...
+}: let
+ targets = ["atlas"];
+ configurations = self.nixosConfigurations // self.darwinConfigurations;
+
+ getDeploy = pkgs:
+ (pkgs.appendOverlays [
+ inputs.deploy.overlay
+ (_: prev: {
+ deploy-rs = {
+ inherit (pkgs) deploy-rs;
+ inherit (prev.deploy-rs) lib;
+ };
+ })
+ ])
+ .deploy-rs;
+
+ toType = system:
+ {
+ "Linux" = "nixos";
+ "Darwin" = "darwin";
+ }
+ .${system};
+
+ toDeployNode = hostname: system: {
+ sshUser = "root";
+ inherit hostname;
+ profiles.system.path = let
+ deploy = getDeploy system.pkgs;
+ type = toType system.pkgs.stdenv.hostPlatform.uname.system;
+ in
+ deploy.lib.activate.${type} system;
+ };
+in {
+ flake.deploy = {
+ remoteBuild = true;
+ fastConnection = false;
+ nodes = lib.mapAttrs toDeployNode (lib.getAttrs targets configurations);
+ };
+}