Kieran's opinionated (and probably slightly dumb) nix config

feat: fix deploy rs

dunkirk.sh 494e595a adb4d72b

verified
+49 -1
+1 -1
.github/workflows/deploy.yaml
··· 38 39 - name: Deploy all configurations 40 run: | 41 - nix run github:serokell/deploy-rs -- \ 42 --skip-checks \ 43 --remote-build \ 44 --ssh-user kierank \
··· 38 39 - name: Deploy all configurations 40 run: | 41 + nix run .#deploy-rs -- \ 42 --skip-checks \ 43 --remote-build \ 44 --ssh-user kierank \
+23
flake.nix
··· 130 }@inputs: 131 let 132 outputs = inputs.self.outputs; 133 unstable-overlays = { 134 nixpkgs.overlays = [ 135 (final: prev: { ··· 267 268 formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree; 269 formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixfmt-tree; 270 271 # Deploy-rs configurations 272 deploy.nodes = {
··· 130 }@inputs: 131 let 132 outputs = inputs.self.outputs; 133 + 134 unstable-overlays = { 135 nixpkgs.overlays = [ 136 (final: prev: { ··· 268 269 formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-tree; 270 formatter.aarch64-darwin = nixpkgs.legacyPackages.aarch64-darwin.nixfmt-tree; 271 + 272 + # Patched deploy-rs for Nix 2.33 compatibility 273 + packages.x86_64-linux.deploy-rs = deploy-rs.packages.x86_64-linux.deploy-rs.overrideAttrs (oldAttrs: { 274 + patches = (oldAttrs.patches or []) ++ [ ./patches/deploy-rs-nix-2.33.patch ]; 275 + }); 276 + packages.aarch64-linux.deploy-rs = deploy-rs.packages.aarch64-linux.deploy-rs.overrideAttrs (oldAttrs: { 277 + patches = (oldAttrs.patches or []) ++ [ ./patches/deploy-rs-nix-2.33.patch ]; 278 + }); 279 + packages.aarch64-darwin.deploy-rs = deploy-rs.packages.aarch64-darwin.deploy-rs.overrideAttrs (oldAttrs: { 280 + patches = (oldAttrs.patches or []) ++ [ ./patches/deploy-rs-nix-2.33.patch ]; 281 + }); 282 + 283 + # Dev shells with patched deploy-rs 284 + devShells.aarch64-darwin.default = nixpkgs.legacyPackages.aarch64-darwin.mkShell { 285 + packages = [ outputs.packages.aarch64-darwin.deploy-rs ]; 286 + }; 287 + devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell { 288 + packages = [ outputs.packages.x86_64-linux.deploy-rs ]; 289 + }; 290 + devShells.aarch64-linux.default = nixpkgs.legacyPackages.aarch64-linux.mkShell { 291 + packages = [ outputs.packages.aarch64-linux.deploy-rs ]; 292 + }; 293 294 # Deploy-rs configurations 295 deploy.nodes = {
+25
patches/deploy-rs-nix-2.33.patch
···
··· 1 + diff --git a/src/push.rs b/src/push.rs 2 + index a206afc..68a421c 100644 3 + --- a/src/push.rs 4 + +++ b/src/push.rs 5 + @@ -221,7 +221,8 @@ pub async fn build_profile(data: PushProfileData<'_>) -> Result<(), PushProfileE 6 + let mut show_derivation_command = Command::new("nix"); 7 + 8 + show_derivation_command 9 + - .arg("show-derivation") 10 + + .arg("derivation") 11 + + .arg("show") 12 + .arg(&data.deploy_data.profile.profile_settings.path); 13 + 14 + let show_derivation_output = show_derivation_command 15 + @@ -241,6 +242,10 @@ pub async fn build_profile(data: PushProfileData<'_>) -> Result<(), PushProfileE 16 + .map_err(PushProfileError::ShowDerivationParse)?; 17 + 18 + let deriver_key = derivation_info 19 + + .get("derivations") 20 + + .ok_or(PushProfileError::ShowDerivationEmpty)? 21 + + .as_object() 22 + + .ok_or(PushProfileError::ShowDerivationEmpty)? 23 + .keys() 24 + .next() 25 + .ok_or(PushProfileError::ShowDerivationEmpty)?;