Skip to content

Commit

Permalink
Update dev setup
Browse files Browse the repository at this point in the history
- script for easily getting solr logs
- log into vm without password
  • Loading branch information
eikek committed Feb 28, 2024
1 parent 715250a commit 824d284
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
solr-delete-core
solr-recreate-core
solr-recreate-dbtests-cores
solr-logs
];
};
vm = pkgs.mkShell {
Expand Down Expand Up @@ -119,6 +120,7 @@
vm-solr-create-core
vm-solr-delete-core
vm-solr-recreate-core
vm-solr-logs
solr-recreate-dbtests-cores
];
};
Expand Down
12 changes: 10 additions & 2 deletions nix/dev-scripts.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
concatTextFile,
writeShellScriptBin,
}: rec {
}: let key = ./dev-vm-key; in rec {
redis-push = concatTextFile {
name = "redis-push";
files = [./scripts/redis-push];
Expand Down Expand Up @@ -37,6 +37,10 @@
${solr-create-core}/bin/solr-create-core "$1"
'';

solr-logs = writeShellScriptBin "solr-logs" ''
sudo nixos-container run ''${RS_CONTAINER:-rsdev} -- journalctl -efu solr.service
'';

vm-build = writeShellScriptBin "vm-build" ''
nix build .#nixosConfigurations.dev-vm.config.system.build.vm
'';
Expand All @@ -46,7 +50,11 @@
'';

vm-ssh = writeShellScriptBin "vm-ssh" ''
ssh -p $VM_SSH_PORT root@localhost "$@"
ssh -i ${key} -p $VM_SSH_PORT root@localhost "$@"
'';

vm-solr-logs = writeShellScriptBin "solr-logs" ''
${vm-ssh}/bin/vm-ssh journalctl -efu solr.service
'';

vm-solr-create-core = writeShellScriptBin "solr-create-core" ''
Expand Down
7 changes: 7 additions & 0 deletions nix/dev-vm-key
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW
QyNTUxOQAAACASODG0t0zVHAKwE/CSlmCpNlR/XiWBcsFXA9gDBMCfHwAAAJDN6ZQezemU
HgAAAAtzc2gtZWQyNTUxOQAAACASODG0t0zVHAKwE/CSlmCpNlR/XiWBcsFXA9gDBMCfHw
AAAEBoaSefL4ulXiGquSLqHHQ9rj+aZZ+YffV49VwEwrduBRI4MbS3TNUcArAT8JKWYKk2
VH9eJYFywVcD2AMEwJ8fAAAACmVpa2VAcG9yb3MBAgM=
-----END OPENSSH PRIVATE KEY-----
1 change: 1 addition & 0 deletions nix/dev-vm-key.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBI4MbS3TNUcArAT8JKWYKk2VH9eJYFywVcD2AMEwJ8f eike@poros
1 change: 1 addition & 0 deletions nix/dev-vm.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

users.users.root = {
password = "root";
openssh.authorizedKeys.keyFiles = [ ./dev-vm-key.pub ];
};
i18n = {defaultLocale = "de_DE.UTF-8";};
console.keyMap = "de";
Expand Down

0 comments on commit 824d284

Please sign in to comment.