From d87221ed373723049f47b4dfc1c1d1672a6c9159 Mon Sep 17 00:00:00 2001 From: James Walker Date: Fri, 26 Jan 2024 17:00:00 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20use=20deploy-rs=20from=20n?= =?UTF-8?q?ixpkgs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- flake.lock | 48 ++++++++++++++++++++++++------------------------ flake.nix | 3 +-- nix/checks.nix | 4 ++-- nix/deploy.nix | 16 ++++++++++++++-- nix/shells.nix | 2 +- 5 files changed, 42 insertions(+), 31 deletions(-) diff --git a/flake.lock b/flake.lock index 88b9aae..2ba2fed 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1705452289, - "narHash": "sha256-i/WodLabBcmRr9hdSv5jzDigL1hRYuI8vNh+xTbGt+g=", + "lastModified": 1705915768, + "narHash": "sha256-+Jlz8OAqkOwJlioac9wtpsCnjgGYUhvLpgJR/5tP9po=", "owner": "lnl7", "repo": "nix-darwin", - "rev": "74ab0227ee495e526f2dd57ea684b34f6396445a", + "rev": "1e706ef323de76236eb183d7784f3bd57255ec0b", "type": "github" }, "original": { @@ -216,11 +216,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1705660020, - "narHash": "sha256-1tOuNh+UbiZlaC8RrpQzzypgnLBC67eRlBunfkE4sbQ=", + "lastModified": 1706221476, + "narHash": "sha256-T4b8YafVjHXvtDY8ARec1WrXO8uyyNZOpNgv9yoQy2M=", "owner": "nix-community", "repo": "home-manager", - "rev": "2064348e555b6aa963da6372a8f14e6acb80a176", + "rev": "c7ce343d9bf1a329056a4dd5b32ea8cc43b55e15", "type": "github" }, "original": { @@ -252,11 +252,11 @@ ] }, "locked": { - "lastModified": 1705400161, - "narHash": "sha256-0MFaNIwwpVWB1N9m7cfHAM2pSVtYESQ7tlHxnDTOhM4=", + "lastModified": 1706085261, + "narHash": "sha256-7PgpHRHyShINcqgevPP1fJ6N8kM5ZSOJnk3QZBrOCQ0=", "owner": "nix-community", "repo": "nixos-generators", - "rev": "521fb4cdd8a2e1a00d1adf0fea7135d1faf04234", + "rev": "896f6589db5b25023b812bbb6c1f5d3a499b1132", "type": "github" }, "original": { @@ -267,11 +267,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1705312285, - "narHash": "sha256-rd+dY+v61Y8w3u9bukO/hB55Xl4wXv4/yC8rCGVnK5U=", + "lastModified": 1706182238, + "narHash": "sha256-Ti7CerGydU7xyrP/ow85lHsOpf+XMx98kQnPoQCSi1g=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "bee2202bec57e521e3bd8acd526884b9767d7fa0", + "rev": "f84eaffc35d1a655e84749228cde19922fcf55f1", "type": "github" }, "original": { @@ -283,11 +283,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1705316053, - "narHash": "sha256-J2Ey5mPFT8gdfL2XC0JTZvKaBw/b2pnyudEXFvl+dQM=", + "lastModified": 1705856552, + "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c3e128f3c0ecc1fb04aef9f72b3dcc2f6cecf370", + "rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", "type": "github" }, "original": { @@ -331,11 +331,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1705635624, - "narHash": "sha256-DU0schxQOtBNO1c9hUsgYl+QMOXQMfRT7Qw/mg+ayno=", + "lastModified": 1706173671, + "narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4471857c0a4a8a0ffc7bdbeaf1b998746ce12a82", + "rev": "4fddc9be4eaf195d631333908f2a454b03628ee5", "type": "github" }, "original": { @@ -356,11 +356,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1705229514, - "narHash": "sha256-itILy0zimR/iyUGq5Dgg0fiW8plRDyxF153LWGsg3Cw=", + "lastModified": 1705757126, + "narHash": "sha256-Eksr+n4Q8EYZKAN0Scef5JK4H6FcHc+TKNHb95CWm+c=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "ffa9a5b90b0acfaa03b1533b83eaf5dead819a05", + "rev": "f56597d53fd174f796b5a7d3ee0b494f9e2285cc", "type": "github" }, "original": { @@ -393,11 +393,11 @@ "nixpkgs-stable": "nixpkgs-stable_2" }, "locked": { - "lastModified": 1705356877, - "narHash": "sha256-274jL1cH64DcXUXebVMZBRUsTs3FvFlPIPkCN/yhSnI=", + "lastModified": 1706130372, + "narHash": "sha256-fHZxKH1DhsXPP36a2vJ91Zy6S+q6+QRIFlpLr9fZHU8=", "owner": "Mic92", "repo": "sops-nix", - "rev": "87755331580fdf23df7e39b46d63ac88236bf42c", + "rev": "4606d9b1595e42ffd9b75b9e69667708c70b1d68", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index ca5ee17..743f3d0 100644 --- a/flake.nix +++ b/flake.nix @@ -64,14 +64,13 @@ }; in { - checks = import ./nix/checks.nix { inherit self pkgs system pre-commit-hooks; }; + checks = import ./nix/checks.nix { inherit self pkgs deploy-rs system pre-commit-hooks; }; devShells = import ./nix/shells.nix { inherit self pkgs system; }; formatter = pkgs.nixpkgs-fmt; }) // { hosts = import ./nix/hosts.nix; overlays.default = nixpkgs.lib.composeManyExtensions [ - deploy-rs.overlay workon.overlays.default ]; diff --git a/nix/checks.nix b/nix/checks.nix index 9bafeed..e39b0cf 100644 --- a/nix/checks.nix +++ b/nix/checks.nix @@ -1,4 +1,4 @@ -{ self, pkgs, system, pre-commit-hooks, ... }: +{ self, system, deploy-rs, pre-commit-hooks, ... }: { pre-commit-check = pre-commit-hooks.lib.${system}.run { src = ./.; @@ -8,4 +8,4 @@ statix.enable = true; }; }; -} // (pkgs.deploy-rs.lib.deployChecks self.deploy) +} // (deploy-rs.lib.${system}.deployChecks self.deploy) diff --git a/nix/deploy.nix b/nix/deploy.nix index 124104d..4d12158 100644 --- a/nix/deploy.nix +++ b/nix/deploy.nix @@ -1,9 +1,21 @@ -{ self, deploy-rs, ... }: +{ self, nixpkgs, deploy-rs, ... }: let mkDeploy = hostName: let inherit (self.hosts.${hostName}) type address system sshUser; - inherit (deploy-rs.lib.${system}) activate; + pkgs = import nixpkgs { inherit system; }; + deployPkgs = import nixpkgs { + inherit system; + overlays = [ + deploy-rs.overlay + (_self: super: { + deploy-rs = { + inherit (pkgs) deploy-rs; inherit (super.deploy-rs) lib; + }; + }) + ]; + }; + inherit (deployPkgs.deploy-rs.lib) activate; in { hostname = address; diff --git a/nix/shells.nix b/nix/shells.nix index 6cfb839..4a1b6ac 100644 --- a/nix/shells.nix +++ b/nix/shells.nix @@ -2,7 +2,7 @@ default = pkgs.mkShell { name = "athens"; buildInputs = with pkgs; [ - deploy-rs.deploy-rs + deploy-rs deadnix doctl nil