Drop support for lorri
Lorri does not cleanly integrate with my corporate device, which cannot run NixOS. To expose dependencies to Emacs buffers, I will use nix-buffer.el, which reads its values from dir-locals.nix. To easily expose dependencies from my existing shell.nix files into dir-locals.nix, I wrote a Nix utility function.
This commit is contained in:
parent
47a0b45f5f
commit
6b224a9e31
20 changed files with 43 additions and 52 deletions
7
.envrc
7
.envrc
|
@ -1 +1,6 @@
|
||||||
eval "$(lorri direnv)"
|
export BRIEFCASE="$(realpath ~/briefcase)"
|
||||||
|
export DEPOT="$(realpath ~/depot)"
|
||||||
|
export NIXPKGS="$(realpath ~/nixpkgs)"
|
||||||
|
export NIX_PATH="nixpkgs=${NIXPKGS}:depot=${DEPOT}:briefcase=${BRIEFCASE}";
|
||||||
|
export DESKTOP="zeno.lon.corp.google.com";
|
||||||
|
export LAPTOP="seneca";
|
||||||
|
|
|
@ -208,8 +208,6 @@ in {
|
||||||
# Support mouseless workflows.
|
# Support mouseless workflows.
|
||||||
services.keynav.enable = true;
|
services.keynav.enable = true;
|
||||||
|
|
||||||
services.lorri.enable = true;
|
|
||||||
|
|
||||||
services.gpg-agent = {
|
services.gpg-agent = {
|
||||||
enable = true;
|
enable = true;
|
||||||
defaultCacheTtl = 8 * 60 * 60; # 8 hours
|
defaultCacheTtl = 8 * 60 * 60; # 8 hours
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
eval "$(lorri direnv)"
|
source_up
|
||||||
|
|
3
go/dir-locals.nix
Normal file
3
go/dir-locals.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
let
|
||||||
|
briefcase = import <briefcase> {};
|
||||||
|
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,6 +1,6 @@
|
||||||
{ pkgs, ... }:
|
let
|
||||||
|
pkgs = import <nixpkgs> {};
|
||||||
pkgs.mkShell {
|
in pkgs.mkShell {
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
pkgs.go
|
pkgs.go
|
||||||
pkgs.goimports
|
pkgs.goimports
|
||||||
|
|
|
@ -1,14 +1,7 @@
|
||||||
# source_up traversing up directories until it finds the nearest .envrc file,
|
|
||||||
# which it uses to extend the environment in this .envrc.
|
|
||||||
#
|
|
||||||
# Since ../.envrc calls `eval "$(lorri direnv)"`, the buildInputs and variables
|
|
||||||
# definitions inside of the attribute set passed to pkgs.mkShell become
|
|
||||||
# available here as well.
|
|
||||||
source_up
|
source_up
|
||||||
export monzo_client_id="$(pass show finance/monzo/client-id)"
|
export monzo_client_id="$(pass show finance/monzo/client-id)"
|
||||||
export monzo_client_secret="$(pass show finance/monzo/client-secret)"
|
export monzo_client_secret="$(pass show finance/monzo/client-secret)"
|
||||||
export store_path="$(pwd)"
|
|
||||||
export ynab_personal_access_token="$(pass show finance/youneedabudget.com/personal-access-token)"
|
export ynab_personal_access_token="$(pass show finance/youneedabudget.com/personal-access-token)"
|
||||||
export ynab_account_id="$(pass show finance/youneedabudget.com/personal-access-token)"
|
export ynab_account_id="$(pass show finance/youneedabudget.com/personal-access-token)"
|
||||||
export ynab_budget_id="$(pass show finance/youneedabudget.com/budget-id)"
|
export ynab_budget_id="$(pass show finance/youneedabudget.com/budget-id)"
|
||||||
eval "$(lorri direnv)"
|
export store_path="$(pwd)"
|
||||||
|
|
3
monzo_ynab/dir-locals.nix
Normal file
3
monzo_ynab/dir-locals.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
let
|
||||||
|
briefcase = import <briefcase> {};
|
||||||
|
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,11 +1,9 @@
|
||||||
{ pkgs, briefcase, ... }:
|
let
|
||||||
|
pkgs = import <nixpkgs> {};
|
||||||
pkgs.mkShell {
|
in pkgs.mkShell {
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
pkgs.go
|
pkgs.go
|
||||||
pkgs.goimports
|
pkgs.goimports
|
||||||
pkgs.godef
|
pkgs.godef
|
||||||
briefcase.monzo_ynab.job
|
|
||||||
briefcase.monzo_ynab.tokens
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,8 +81,6 @@ in {
|
||||||
|
|
||||||
services.openssh.enable = true;
|
services.openssh.enable = true;
|
||||||
|
|
||||||
services.lorri.enable = true;
|
|
||||||
|
|
||||||
systemd.services.gogs = {
|
systemd.services.gogs = {
|
||||||
enable = true;
|
enable = true;
|
||||||
description = "Easy-to-use Git server written in golang";
|
description = "Easy-to-use Git server written in golang";
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
source_up
|
source_up
|
||||||
eval "$(lorri direnv)"
|
|
||||||
|
|
3
scratch/deepmind/part_two/dir-locals.nix
Normal file
3
scratch/deepmind/part_two/dir-locals.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
let
|
||||||
|
briefcase = import <briefcase> {};
|
||||||
|
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,6 +1,6 @@
|
||||||
{ pkgs ? import <nixpkgs> {}, ... }:
|
let
|
||||||
|
pkgs = import <nixpkgs> {};
|
||||||
pkgs.mkShell {
|
in pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
nodejs
|
nodejs
|
||||||
python3
|
python3
|
||||||
|
|
13
shell.nix
13
shell.nix
|
@ -1,13 +0,0 @@
|
||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
pkgs.mkShell rec {
|
|
||||||
buildInputs = [];
|
|
||||||
# TODO(wpcarro): How does pkgs.mkShell handle exported and non-exported
|
|
||||||
# variable definitions?
|
|
||||||
BRIEFCASE = builtins.toPath ~/briefcase;
|
|
||||||
DEPOT = builtins.toPath ~/depot;
|
|
||||||
NIXPKGS = builtins.toPath ~/nixpkgs;
|
|
||||||
NIX_PATH="nixpkgs=${NIXPKGS}:depot=${DEPOT}:briefcase=${BRIEFCASE}";
|
|
||||||
DESKTOP = "zeno.lon.corp.google.com";
|
|
||||||
LAPTOP = "seneca";
|
|
||||||
}
|
|
|
@ -1,2 +1 @@
|
||||||
source_up
|
source_up
|
||||||
eval "$(lorri direnv)"
|
|
||||||
|
|
3
tools/run/dir-locals.nix
Normal file
3
tools/run/dir-locals.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
let
|
||||||
|
briefcase = import <briefcase> {};
|
||||||
|
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,7 +1,9 @@
|
||||||
{ pkgs, ... }:
|
let
|
||||||
|
pkgs = import <nixpkgs> {};
|
||||||
pkgs.mkShell {
|
in pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
go
|
go
|
||||||
|
goimports
|
||||||
|
godef
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,4 +11,10 @@
|
||||||
wrapNonNixProgram = { path, as }: pkgs.writeShellScriptBin as ''
|
wrapNonNixProgram = { path, as }: pkgs.writeShellScriptBin as ''
|
||||||
exec ${path} "$@"
|
exec ${path} "$@"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
# Expose the buildInputs from a Nix shell to an Emacs buffer. Intended to be
|
||||||
|
# called from dir-locals.nix files.
|
||||||
|
nixBufferFromShell = path: let
|
||||||
|
shell = import path;
|
||||||
|
in pkgs.nixBufferBuilders.withPackages shell.buildInputs;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
source_up
|
source_up
|
||||||
eval "$(lorri direnv)"
|
|
||||||
|
|
3
website/goals/dir-locals.nix
Normal file
3
website/goals/dir-locals.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
let
|
||||||
|
briefcase = import <briefcase> {};
|
||||||
|
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,8 +0,0 @@
|
||||||
let
|
|
||||||
pkgs = import <nixpkgs> {};
|
|
||||||
in pkgs.mkShell {
|
|
||||||
name = "nut-score";
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
yarn
|
|
||||||
];
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue