From 6d13ae4c2273a31e4546659ebde0bf4d5d1d8c83 Mon Sep 17 00:00:00 2001 From: Julien Malka Date: Sat, 7 Jan 2023 18:22:48 +0100 Subject: [PATCH] Init deploy-rs --- flake.lock | 86 ++++++++++++++++++++++++++++++++++++++++++++++++------ flake.nix | 18 +++++++++++- 2 files changed, 94 insertions(+), 10 deletions(-) diff --git a/flake.lock b/flake.lock index 556bc90..b0c3604 100644 --- a/flake.lock +++ b/flake.lock @@ -16,6 +16,42 @@ "type": "gitlab" } }, + "deploy-rs": { + "inputs": { + "flake-compat": "flake-compat", + "nixpkgs": "nixpkgs", + "utils": "utils" + }, + "locked": { + "lastModified": 1672327199, + "narHash": "sha256-pFlngSHXKBhAmbaKZ4FYtu57LLunG+vWdL7a5vw1RvQ=", + "owner": "serokell", + "repo": "deploy-rs", + "rev": "a5619f5660a00f58c2b7c16d89058e92327ac9b8", + "type": "github" + }, + "original": { + "owner": "serokell", + "repo": "deploy-rs", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1668681692, + "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "009399224d5e398d03b22badca40a37ac85412a1", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1659877975, @@ -36,7 +72,7 @@ "nixpkgs": [ "nixpkgs" ], - "utils": "utils" + "utils": "utils_2" }, "locked": { "lastModified": 1672244468, @@ -72,7 +108,7 @@ "linkal": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": "nixpkgs_2" }, "locked": { "lastModified": 1669844376, @@ -91,16 +127,18 @@ }, "nixpkgs": { "locked": { - "lastModified": 1663669617, - "narHash": "sha256-yUrzkRDc6P3hsI5TdQ5+q8gnyjadNvaM3MMEsEVS8qk=", + "lastModified": 1671417167, + "narHash": "sha256-JkHam6WQOwZN1t2C2sbp1TqMv3TVRjzrdoejqfefwrM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "41ac0bd371618db6dd67fd952cc5b3d6a9955a15", + "rev": "bb31220cca6d044baa6dc2715b07497a2a7c4bc7", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs-22_11": { @@ -135,6 +173,20 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1663669617, + "narHash": "sha256-yUrzkRDc6P3hsI5TdQ5+q8gnyjadNvaM3MMEsEVS8qk=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "41ac0bd371618db6dd67fd952cc5b3d6a9955a15", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1672844754, "narHash": "sha256-o26WabuHABQsaHxxmIrR3AQRqDFUEdLckLXkVCpIjSU=", @@ -166,10 +218,11 @@ }, "root": { "inputs": { + "deploy-rs": "deploy-rs", "home-manager": "home-manager", "homepage": "homepage", "linkal": "linkal", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "nur": "nur", "simple-nixos-mailserver": "simple-nixos-mailserver", "sops-nix": "sops-nix", @@ -183,7 +236,7 @@ "nixpkgs" ], "nixpkgs-22_11": "nixpkgs-22_11", - "utils": "utils_2" + "utils": "utils_3" }, "locked": { "lastModified": 1671659164, @@ -253,6 +306,21 @@ } }, "utils_2": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "utils_3": { "locked": { "lastModified": 1605370193, "narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=", diff --git a/flake.nix b/flake.nix index 9c2da87..8446d99 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,10 @@ url = "github:NixOS/nixpkgs/nixos-unstable"; }; + deploy-rs = { + url = "github:serokell/deploy-rs"; + }; + sops-nix = { url = "github:Mic92/sops-nix"; inputs.nixpkgs.follows = "nixpkgs"; @@ -35,7 +39,7 @@ }; - outputs = { self, home-manager, nixpkgs, unstable, sops-nix, nur, ... }@inputs: + outputs = { self, home-manager, nixpkgs, unstable, deploy-rs, sops-nix, nur, ... }@inputs: let pkgs = import nixpkgs { system = "x86_64-linux"; }; pkgsrpi = import nixpkgs { system = "aarch64-linux"; }; @@ -51,6 +55,18 @@ (builtins.attrNames (builtins.readDir ./modules))); nixosConfigurations = builtins.mapAttrs (name: value: (mkMachine { host = name; host-config = value; modules = self.nixosModules; system = luj.machines.${name}.arch; })) (importConfig ./machines); + + deploy.nodes.newton = { + hostname = "newton.julienmalka.me"; + profiles.system = { + sshUser = "root"; + sshOpts = [ "-p" "45" ]; + fastConnection = true; + path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.newton; + }; + }; + + packages."x86_64-linux" = { tinystatus = import ./packages/tinystatus { inherit pkgs; }; flaresolverr = pkgs.callPackage ./packages/flaresolverr { };