expose nixos-remote tools in devshell

This commit is contained in:
Jörg Thalheim 2023-01-12 15:26:01 +01:00
parent b5230b8640
commit d2f7012d1d
3 changed files with 29 additions and 6 deletions

View File

@ -81,3 +81,17 @@ nixos-remote \
--flake 'your-flake#your-system' \ --flake 'your-flake#your-system' \
root@yourip root@yourip
``` ```
## Developer guide
To run `nixos-remote` from the repo:
```console
nix run . -- --help
```
To format the code
```console
nix fmt
```

View File

@ -6,9 +6,7 @@
, coreutils , coreutils
, curl , curl
}: }:
writeShellApplication { let
name = "nixos-remote";
text = builtins.readFile ./nixos-remote.sh;
runtimeInputs = [ runtimeInputs = [
openssh openssh
gitMinimal # for git flakes gitMinimal # for git flakes
@ -17,4 +15,12 @@ writeShellApplication {
coreutils coreutils
curl # when uploading tarballs curl # when uploading tarballs
]; ];
in
(writeShellApplication {
name = "nixos-remote";
text = builtins.readFile ./nixos-remote.sh;
inherit runtimeInputs;
}) // {
# also expose this attribute to other derivations
inherit runtimeInputs;
} }

View File

@ -1,8 +1,11 @@
{ {
perSystem = { pkgs, ... }: { perSystem = { config, pkgs, ... }: {
packages = rec { packages = {
nixos-remote = pkgs.callPackage ./. { }; nixos-remote = pkgs.callPackage ./. { };
default = nixos-remote; default = config.packages.nixos-remote;
};
devShells.default = pkgs.mkShellNoCC {
packages = config.packages.nixos-remote.runtimeInputs;
}; };
}; };
} }