From 8ee842d89ab3029cd2b35b0839579e2b5a9a957c Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Sun, 11 Jun 2023 11:24:24 +0200 Subject: [PATCH] remoteenv cleanup --- .envrc | 10 +++------- .remoteenv | 2 +- flake.nix | 9 ++++----- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.envrc b/.envrc index 17cddaa..ce40950 100644 --- a/.envrc +++ b/.envrc @@ -15,15 +15,11 @@ if ! test -s .direnv/pull-date || test "$now" != "$(cat .direnv/pull-date)"; the echo "$now" > .direnv/pull-date fi -if command -v nixos-rebuild >/dev/null; then - use flake .#nixos-rebuild-nom -elif ! command -v nixos-rebuild >/dev/null; then - use flake .#non-nixos -fi +use flake .#envrc if test -s .remote.toml; then - if ! command -v remote-init >/dev/null; then - use flake .#remote + if ! command -v remote-init >/dev/null || ! command -v tomlq >/dev/null; then + use flake .#envrc-remote fi echo echo "Current remote: $(remote-host)" diff --git a/.remoteenv b/.remoteenv index 94f895e..de5456b 100644 --- a/.remoteenv +++ b/.remoteenv @@ -1,3 +1,3 @@ #!/usr/bin/env bash -eval "$(nix print-dev-env .#nixos-rebuild-nom)" +eval "$(nix print-dev-env .#remoteenv)" echo Entered $(hostname --fqdn) diff --git a/flake.nix b/flake.nix index e1f245d..f9ed403 100644 --- a/flake.nix +++ b/flake.nix @@ -17,10 +17,9 @@ # 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.flake = false; # 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-remote-exec.url = "github:pbsds/nixpkgs/remote-exec-init"; }; @@ -118,15 +117,15 @@ ''; mkShell = packages: pkgs.mkShell { inherit packages; }; in { - nixos-rebuild-nom = mkShell [ + remoteenv = mkShell [ nixos-rebuild-nom ]; - non-nixos = mkShell [ + envrc = mkShell [ nixos-rebuild-nom pkgs.home-manager pkgs.nix-output-monitor ]; - remote = mkShell [ + encrc-remote = mkShell [ remote-exec pkgs.yq ];