remoteenv cleanup

This commit is contained in:
Peder Bergebakken Sundt 2023-06-11 11:24:24 +02:00
parent ac56f68f3a
commit 8ee842d89a
3 changed files with 8 additions and 13 deletions

10
.envrc
View File

@ -15,15 +15,11 @@ if ! test -s .direnv/pull-date || test "$now" != "$(cat .direnv/pull-date)"; the
echo "$now" > .direnv/pull-date echo "$now" > .direnv/pull-date
fi fi
if command -v nixos-rebuild >/dev/null; then use flake .#envrc
use flake .#nixos-rebuild-nom
elif ! command -v nixos-rebuild >/dev/null; then
use flake .#non-nixos
fi
if test -s .remote.toml; then if test -s .remote.toml; then
if ! command -v remote-init >/dev/null; then if ! command -v remote-init >/dev/null || ! command -v tomlq >/dev/null; then
use flake .#remote use flake .#envrc-remote
fi fi
echo echo
echo "Current remote: $(remote-host)" echo "Current remote: $(remote-host)"

View File

@ -1,3 +1,3 @@
#!/usr/bin/env bash #!/usr/bin/env bash
eval "$(nix print-dev-env .#nixos-rebuild-nom)" eval "$(nix print-dev-env .#remoteenv)"
echo Entered $(hostname --fqdn) echo Entered $(hostname --fqdn)

View File

@ -17,10 +17,9 @@
# TODO: somehow make these private repos optional (a lazy fetch would be nice) # TODO: somehow make these private repos optional (a lazy fetch would be nice)
pbsds-papers.url = "git+ssh://git@github.com/pbsds/papers.git"; pbsds-papers.url = "git+ssh://git@github.com/pbsds/papers.git";
#pbsds-papers.flake = false;
# temporary stuff i want to use # temporary stuff i want to use
# TODO: can i fetch a subset of files if these? ^ # TODO: can i fetch a subset of files of these?
pr-polaris14.url = "github:pbsds/nixpkgs/polaris-14"; pr-polaris14.url = "github:pbsds/nixpkgs/polaris-14";
pr-remote-exec.url = "github:pbsds/nixpkgs/remote-exec-init"; pr-remote-exec.url = "github:pbsds/nixpkgs/remote-exec-init";
}; };
@ -118,15 +117,15 @@
''; '';
mkShell = packages: pkgs.mkShell { inherit packages; }; mkShell = packages: pkgs.mkShell { inherit packages; };
in { in {
nixos-rebuild-nom = mkShell [ remoteenv = mkShell [
nixos-rebuild-nom nixos-rebuild-nom
]; ];
non-nixos = mkShell [ envrc = mkShell [
nixos-rebuild-nom nixos-rebuild-nom
pkgs.home-manager pkgs.home-manager
pkgs.nix-output-monitor pkgs.nix-output-monitor
]; ];
remote = mkShell [ encrc-remote = mkShell [
remote-exec remote-exec
pkgs.yq pkgs.yq
]; ];