/ flakeModules / devshell / remote.nix
remote.nix
 1  { config
 2  , ...
 3  }:
 4  
 5  {
 6    perSystem = { pkgs, ... }:
 7      let
 8        inherit (config.lib) mkCmdGroup;
 9        RemoteCmdGroup = mkCmdGroup "Remote" [
10          {
11            name = "anywhere";
12            help = "Use nixos-anywhere to remotely install NixOS to the specified host";
13            command = ''
14              nix run github:nix-community/nixos-anywhere -- --build-on-remote --flake .#$1 ''${@:2}
15            '';
16          }
17          # {
18          #   name = "deploy";
19          #   help = "run deploy-rs";
20          #   command = "nix run github:serokell/deploy-rs -- $@";
21          # }
22        ];
23      in
24      {
25        devshells.default = {
26          commands = RemoteCmdGroup;
27          packages = [ pkgs.deploy-rs ];
28        };
29      };
30  }