41: expose nixos-remote tools in devshell + envrc r=Mic92 a=Mic92



Co-authored-by: Jörg Thalheim <joerg@thalheim.io>
This commit is contained in:
bors[bot] 2023-01-17 22:05:11 +00:00 committed by GitHub
commit f1052a76be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 6 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

View File

@ -81,3 +81,17 @@ nixos-remote \
--flake 'your-flake#your-system' \
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
, curl
}:
writeShellApplication {
name = "nixos-remote";
text = builtins.readFile ./nixos-remote.sh;
let
runtimeInputs = [
openssh
gitMinimal # for git flakes
@ -17,4 +15,12 @@ writeShellApplication {
coreutils
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, ... }: {
packages = rec {
perSystem = { config, pkgs, ... }: {
packages = {
nixos-remote = pkgs.callPackage ./. { };
default = nixos-remote;
default = config.packages.nixos-remote;
};
devShells.default = pkgs.mkShellNoCC {
packages = config.packages.nixos-remote.runtimeInputs;
};
};
}