Drop support for dir-locals.nix, <nixpkgs>, etc.
In the spirit of Marie Kondo, I'm tidying up! TL;DR: - Prefer .envrc `use_nix` and delete all dir-locals.nix files - Remove ~all references to <nixpkgs>, <unstable>, <depot> and prefer referencing each with briefcase.third_party.{pkgs,unstable,depot} - Delete nixBufferFromShell function since I was only using that in dir-locals.nix files
This commit is contained in:
parent
51ec9e0d88
commit
0c71fc9d1d
55 changed files with 102 additions and 118 deletions
12
.envrc
12
.envrc
|
@ -1,10 +1,8 @@
|
|||
export BRIEFCASE="$(realpath ~/briefcase)"
|
||||
export DEPOT="$(realpath ~/depot)"
|
||||
export NIXPKGS="$(realpath ~/nixpkgs)"
|
||||
# I'm ensuring that $NIX_PATH is unset to avoid the anti-pattern of depending on
|
||||
# <nixpkgs>, <briefcase>, <depot>, <unstable>.
|
||||
# For more information about setting this to "", see:
|
||||
export BRIEFCASE="$(realpath .)"
|
||||
# I'm ensuring that $NIX_PATH is mostly empty, so that I only depend on
|
||||
# <briefcase> for now.
|
||||
# For more information on the NIX_PATH anti-pattern, see here:
|
||||
# https://nix.dev/tutorials/towards-reproducibility-pinning-nixpkgs.html#pinning-nixpkgs
|
||||
export NIX_PATH="";
|
||||
export NIX_PATH="briefcase=$BRIEFCASE";
|
||||
export DESKTOP="zeno.lon.corp.google.com";
|
||||
export LAPTOP="seneca";
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
||||
|
|
2
boilerplate/clojure/.envrc
Normal file
2
boilerplate/clojure/.envrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
|
@ -1,3 +0,0 @@
|
|||
let
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,5 +1,6 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
leiningen
|
||||
|
|
2
boilerplate/elm/.envrc
Normal file
2
boilerplate/elm/.envrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
|
@ -1,3 +0,0 @@
|
|||
let
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,9 +1,10 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
elmPackages.elm
|
||||
elmPackages.elm-format
|
||||
elmPackages.elm-live
|
||||
buildInputs = with pkgs.elmPackages; [
|
||||
elm
|
||||
elm-format
|
||||
elm-live
|
||||
];
|
||||
}
|
||||
|
|
2
boilerplate/typescript/.envrc
Normal file
2
boilerplate/typescript/.envrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
|
@ -1,3 +0,0 @@
|
|||
let
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,5 +1,6 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
nodejs
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
# name: shell.nix boilerplate
|
||||
# key: import
|
||||
# --
|
||||
with import <nixpkgs> {};
|
||||
|
||||
stdenv.mkDerivation {
|
||||
let
|
||||
briefcase = with import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in stdenv.mkDerivation {
|
||||
name = "$1";
|
||||
buildInputs = [
|
||||
$2
|
||||
|
|
|
@ -59,7 +59,7 @@ This function was taken from @tazjin's depot and adapted for my monorepo.
|
|||
(interactive "sAttribute: ")
|
||||
(lexical-let* ((outbuf (get-buffer-create (format "*briefcase-out/%s*" attribute)))
|
||||
(errbuf (get-buffer-create (format "*briefcase-errors/%s*" attribute)))
|
||||
(expression (format "let depot = import <depot> {}; briefcase = import <briefcase> {}; in depot.nix.buildLisp.sbclWith [ briefcase.%s ]" attribute))
|
||||
(expression (format "let briefcase = import <briefcase> {}; in briefcase.third_party.depot.nix.buildLisp.sbclWith [ briefcase.%s ]" attribute))
|
||||
(command (list "nix-build" "-E" expression)))
|
||||
(message "Acquiring Lisp for <briefcase>.%s" attribute)
|
||||
(make-process :name (format "nix-build/%s" attribute)
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
let
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.utils.nixBufferFromShell ./shell.nix
|
11
go/shell.nix
11
go/shell.nix
|
@ -1,9 +1,10 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.go
|
||||
pkgs.goimports
|
||||
pkgs.godef
|
||||
buildInputs = with pkgs; [
|
||||
go
|
||||
goimports
|
||||
godef
|
||||
];
|
||||
}
|
||||
|
|
2
haskell-file/.envrc
Normal file
2
haskell-file/.envrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
|
@ -1,9 +1,5 @@
|
|||
with import <nixpkgs> {};
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "f-hs";
|
||||
buildInputs = [
|
||||
(pkgs.haskellPackages.ghcWithPackages (pkgs: [
|
||||
]))
|
||||
];
|
||||
let
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.buildHaskell.shell {
|
||||
deps = hpkgs: [];
|
||||
}
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
{
|
||||
pkgs ? import <nixpkgs> {},
|
||||
depot ? import <depot> {},
|
||||
...
|
||||
}:
|
||||
{ pkgs, depot, ... }:
|
||||
|
||||
pkgs.dockerTools.buildLayeredImage {
|
||||
name = "gemma";
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
let
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,5 +1,6 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
nodejs
|
||||
|
|
2
scratch/groceries/.envrc
Normal file
2
scratch/groceries/.envrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
|
@ -1,8 +1,5 @@
|
|||
let
|
||||
pkgs = import <unstable> {};
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
(haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
|
||||
]))
|
||||
];
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.buildHaskell.shell {
|
||||
deps = hpkgs: [];
|
||||
}
|
||||
|
|
2
scratch/haskell-programming-from-first-principles/.envrc
Normal file
2
scratch/haskell-programming-from-first-principles/.envrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
|
@ -1,10 +1,8 @@
|
|||
let
|
||||
pkgs = import <unstable> {};
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
(haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
|
||||
hpkgs.quickcheck-simple
|
||||
hpkgs.checkers
|
||||
]))
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.buildHaskell.shell {
|
||||
deps = hpkgs: with hpkgs; [
|
||||
quickcheck-simple
|
||||
checkers
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
source_up
|
||||
use_nix
|
||||
export monzo_client_id="$(pass show finance/monzo/client-id)"
|
||||
export monzo_client_secret="$(pass show finance/monzo/client-secret)"
|
||||
export ynab_personal_access_token="$(pass show finance/youneedabudget.com/personal-access-token)"
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
let
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,5 +1,6 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = [
|
||||
pkgs.go
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
let
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,5 +1,6 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
go
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{ ... }:
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
pkgs = import <unstable> {};
|
||||
|
||||
ghc = pkgs.haskellPackages.ghcWithPackages (hpkgs: [
|
||||
hpkgs.time
|
||||
hpkgs.aeson
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
let
|
||||
pkgs = import <unstable> {};
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
(haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.buildHaskell.shell {
|
||||
deps = hpkgs: with hpkgs; [
|
||||
time
|
||||
aeson
|
||||
either
|
||||
hspec
|
||||
]))
|
||||
];
|
||||
}
|
||||
|
|
|
@ -11,10 +11,4 @@
|
|||
wrapNonNixProgram = { path, as }: pkgs.writeShellScriptBin as ''
|
||||
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 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
in
|
||||
pkgs.mkShell {
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
hugo
|
||||
];
|
||||
|
|
2
website/days-of-week-habits/.envrc
Normal file
2
website/days-of-week-habits/.envrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
|
@ -1,3 +0,0 @@
|
|||
let
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,5 +1,6 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
nodejs
|
||||
|
|
2
website/goals/.envrc
Normal file
2
website/goals/.envrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
|
@ -1,3 +0,0 @@
|
|||
let
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,5 +1,6 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
nodejs
|
||||
|
|
2
website/habitgarden/.envrc
Normal file
2
website/habitgarden/.envrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
|
@ -1,3 +0,0 @@
|
|||
let
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -1,5 +1,6 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
nodejs
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
source_up
|
||||
use_nix
|
||||
export CONTENTFUL_SPACE_ID="$(pass show programming/contentful/space-id)"
|
||||
export CONTENTFUL_ACCESS_TOKEN="$(pass show programming/contentful/access-token)"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
{ pkgs, ... }:
|
||||
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "ideal-website";
|
||||
src = builtins.path { path = ./.; name = "contentful"; };
|
||||
buildInputs = with pkgs; [
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
nodejs
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
yarn
|
||||
|
|
2
website/sandbox/learnpianochords/.envrc
Normal file
2
website/sandbox/learnpianochords/.envrc
Normal file
|
@ -0,0 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
|
@ -1,3 +0,0 @@
|
|||
let
|
||||
briefcase = import <briefcase> {};
|
||||
in briefcase.utils.nixBufferFromShell ./shell.nix
|
|
@ -2,9 +2,9 @@ let
|
|||
briefcase = import <briefcase> {};
|
||||
pkgs = briefcase.third_party.pkgs;
|
||||
in pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
elmPackages.elm
|
||||
elmPackages.elm-format
|
||||
elmPackages.elm-live
|
||||
buildInputs = with pkgs.elmPackages; [
|
||||
elm
|
||||
elm-format
|
||||
elm-live
|
||||
];
|
||||
}
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
source_up
|
||||
use_nix
|
||||
|
|
Loading…
Reference in a new issue