From aa75df67e2a48c14f0bf9f2276a0d8f8c774db16 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Mon, 14 Jun 2021 23:00:45 +0300 Subject: [PATCH] Add deployable profiles --- flake.lock | 24 ++++++++++++------------ flake.nix | 19 ++++++++++++++----- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/flake.lock b/flake.lock index be211a6..0a2b988 100644 --- a/flake.lock +++ b/flake.lock @@ -90,11 +90,11 @@ "utils": "utils" }, "locked": { - "lastModified": 1614654775, - "narHash": "sha256-3mLxoxIXSWUuKE8YgIuqM5AZzXFd1aWxkTlplEDeXIA=", + "lastModified": 1623011836, + "narHash": "sha256-02M4P3eqUdV+ouZb8n1KDR1CXeZQm17cKpjKZKi0c10=", "owner": "serokell", "repo": "deploy-rs", - "rev": "6278b9bef5ad624676a565980417cbbef42d5227", + "rev": "70d71b3027b1793b780f1e2435bdbbe1b0cb9ac6", "type": "github" }, "original": { @@ -310,11 +310,11 @@ ] }, "locked": { - "lastModified": 1610392286, - "narHash": "sha256-3wFl5y+4YZO4SgRYK8WE7JIS3p0sxbgrGaQ6RMw+d98=", + "lastModified": 1622810282, + "narHash": "sha256-4wmvM3/xfD0hCdNDIXVzRMfL4yB1J+DjH6Zte2xbAxk=", "owner": "nmattia", "repo": "naersk", - "rev": "d7bfbad3304fd768c0f93a4c3b50976275e6d4be", + "rev": "e8061169e1495871b56be97c5c51d310fae01374", "type": "github" }, "original": { @@ -359,11 +359,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1610942247, - "narHash": "sha256-PKo1ATAlC6BmfYSRmX0TVmNoFbrec+A5OKcabGEu2yU=", + "lastModified": 1622972307, + "narHash": "sha256-ENOu0FPCf95iLLoq2txhJtnA2ZpOFhIVBqQVbKM8ra0=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7d71001b796340b219d1bfa8552c81995017544a", + "rev": "d8eb97e3801bde96491535f40483d550b57605b9", "type": "github" }, "original": { @@ -641,11 +641,11 @@ }, "utils": { "locked": { - "lastModified": 1610051610, - "narHash": "sha256-U9rPz/usA1/Aohhk7Cmc2gBrEEKRzcW4nwPWMPwja4Y=", + "lastModified": 1622445595, + "narHash": "sha256-m+JRe6Wc5OZ/mKw2bB3+Tl0ZbtyxxxfnAWln8Q5qs+Y=", "owner": "numtide", "repo": "flake-utils", - "rev": "3982c9903e93927c2164caa727cd3f6a0e6d14cc", + "rev": "7d706970d94bc5559077eb1a6600afddcd25a7c8", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 77d8c6a..60157dd 100644 --- a/flake.nix +++ b/flake.nix @@ -92,11 +92,20 @@ deploy = { user = "root"; - nodes.T420-Laptop = { - hostname = - self.nixosConfigurations.T420-Laptop.config.networking.hostName; - profiles.system.path = deploy-rs.lib.x86_64-linux.activate.nixos - self.nixosConfigurations.T420-Laptop; + nodes = (builtins.mapAttrs (_: machine: { + hostname = machine.config.networking.hostName; + profiles.system = { + user = "balsoft"; + path = deploy-rs.lib.x86_64-linux.activate.noop + machine.config.system.build.toplevel; + }; + }) self.nixosConfigurations) // { + T420-Laptop = { + hostname = + self.nixosConfigurations.T420-Laptop.config.networking.hostName; + profiles.system.path = deploy-rs.lib.x86_64-linux.activate.nixos + self.nixosConfigurations.T420-Laptop; + }; }; }; };