From fee1ddd9a9b5c5e3ab5907b53a599c9cbb9bc4d7 Mon Sep 17 00:00:00 2001 From: SebastianStork Date: Tue, 3 Feb 2026 19:04:48 +0100 Subject: [PATCH] Replace `deploy-rs` with `nh` for remote push deployments --- flake-parts/dev-shell.nix | 3 +- flake-parts/hosts.nix | 22 ++---------- flake.lock | 72 --------------------------------------- flake.nix | 5 --- justfile | 4 ++- 5 files changed, 6 insertions(+), 100 deletions(-) diff --git a/flake-parts/dev-shell.nix b/flake-parts/dev-shell.nix index a138228..5318e8c 100644 --- a/flake-parts/dev-shell.nix +++ b/flake-parts/dev-shell.nix @@ -1,12 +1,11 @@ _: { perSystem = - { inputs', pkgs, ... }: + { pkgs, ... }: { devShells.default = pkgs.mkShellNoCC { packages = [ pkgs.just pkgs.nh - inputs'.deploy-rs.packages.default ]; }; }; diff --git a/flake-parts/hosts.nix b/flake-parts/hosts.nix index e104cea..399a6e5 100644 --- a/flake-parts/hosts.nix +++ b/flake-parts/hosts.nix @@ -17,26 +17,8 @@ let ] ++ lib.optional (lib.pathExists "${self}/users/seb/@${hostName}") "${self}/users/seb/@${hostName}"; }; - - mkDeployNode = hostName: { - hostname = "${hostName}.${ - self.nixosConfigurations.${hostName}.config.custom.networking.overlay.domain - }"; - user = "root"; - interactiveSudo = true; - profiles.system.path = - inputs.deploy-rs.lib.x86_64-linux.activate.nixos - self.nixosConfigurations.${hostName}; - }; - - hostNames = "${self}/hosts" |> self.lib.listDirectoryNames; in { - flake = { - nixosConfigurations = hostNames |> self.lib.genAttrs mkHost; - - deploy.nodes = hostNames |> self.lib.genAttrs mkDeployNode; - - checks = inputs.deploy-rs.lib |> lib.mapAttrs (_: deployLib: deployLib.deployChecks self.deploy); - }; + flake.nixosConfigurations = + "${self}/hosts" |> self.lib.listDirectoryNames |> self.lib.genAttrs mkHost; } diff --git a/flake.lock b/flake.lock index 3c23363..4aa9abf 100644 --- a/flake.lock +++ b/flake.lock @@ -58,28 +58,6 @@ "url": "https://codeberg.org/kampka/nix-flake-crowdsec.git" } }, - "deploy-rs": { - "inputs": { - "flake-compat": "flake-compat_2", - "nixpkgs": [ - "nixpkgs" - ], - "utils": "utils" - }, - "locked": { - "lastModified": 1766051518, - "narHash": "sha256-znKOwPXQnt3o7lDb3hdf19oDo0BLP4MfBOYiWkEHoik=", - "owner": "serokell", - "repo": "deploy-rs", - "rev": "d5eff7f948535b9c723d60cd8239f8f11ddc90fa", - "type": "github" - }, - "original": { - "owner": "serokell", - "repo": "deploy-rs", - "type": "github" - } - }, "disko": { "inputs": { "nixpkgs": [ @@ -139,22 +117,6 @@ "type": "github" } }, - "flake-compat_2": { - "flake": false, - "locked": { - "lastModified": 1733328505, - "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -351,7 +313,6 @@ "betterfox": "betterfox", "comin": "comin", "crowdsec": "crowdsec", - "deploy-rs": "deploy-rs", "disko": "disko", "firefox-addons": "firefox-addons", "flake-parts": "flake-parts", @@ -401,21 +362,6 @@ "type": "github" } }, - "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "treefmt": { "inputs": { "nixpkgs": [ @@ -436,24 +382,6 @@ "type": "github" } }, - "utils": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "vscode-extensions": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index a2f5d4d..67951df 100644 --- a/flake.nix +++ b/flake.nix @@ -30,11 +30,6 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - deploy-rs = { - url = "github:serokell/deploy-rs"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - treefmt = { url = "github:numtide/treefmt-nix"; inputs.nixpkgs.follows = "nixpkgs"; diff --git a/justfile b/justfile index 04f6c4e..74dca9a 100644 --- a/justfile +++ b/justfile @@ -40,7 +40,9 @@ reboot: [group('remote')] deploy +hosts: - deploy --skip-checks --targets $(echo {{ hosts }} | sed 's/[^ ]*/\.#&/g') + for host in {{ hosts }}; do \ + nh os switch . --hostname=$host --target-host=$host; \ + done [group('remote')] install host destination='root@installer':