fix(wpcarro/nix): Remove <briefcase> references

Angle-bracketed references are a Nix anti-pattern, and thankfully this
repository enforces this as a standard.

TL;DR:
- Drop angle-bracketed references
- Change `briefcase` -> `users.wpcarro`
- Fix any resulting regressions
- Fix //users/wpcarro/tools/simple_vim
- Mark //users/wpcarro/boilerplate/typescript and related projects
  as broken
- drop .skip-subtree file, enabling depot CI

Change-Id: I7153cbabafa617bfd6b199370cbec65cb75441f6
Reviewed-on: https://cl.tvl.fyi/c/depot/+/4325
Tested-by: BuildkiteCI
Reviewed-by: wpcarro <wpcarro@gmail.com>
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: grfn <grfn@gws.fyi>
Autosubmit: wpcarro <wpcarro@gmail.com>
This commit is contained in:
William Carroll 2021-12-13 19:51:48 -08:00 committed by clbot
parent 38ec27e834
commit b6d143e5d2
53 changed files with 151 additions and 172 deletions

View file

@ -1,2 +0,0 @@
Do not recurse from top-level readTree, while this is being refactored
we have a nested tree.

View file

@ -1,6 +1,6 @@
let
briefcase = import <briefcase> {};
in briefcase.buildHaskell.program {
{ depot, ... }:
depot.users.wpcarro.buildHaskell.program {
name = "transform-keyboard";
srcs = builtins.path {
path = ./.;

View file

@ -1,10 +1,6 @@
let
pkgs = import (builtins.fetchGit {
url = "https://github.com/NixOS/nixpkgs-channels";
ref = "nixos-20.03";
rev = "afa9ca61924f05aacfe495a7ad0fd84709d236cc";
}) {};
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
(haskellPackages.ghcWithPackages (hpkgs: with hpkgs; [
hspec

View file

@ -1,6 +1,6 @@
let
briefcase = import <briefcase> {};
in briefcase.buildHaskell.shell {
{ depot, ... }:
depot.users.wpcarro.buildHaskell.shell {
deps = hpkgs: with hpkgs; [
hspec
unordered-containers

View file

@ -1 +0,0 @@
# stubbed

View file

@ -1,3 +0,0 @@
let
briefcase = import /home/wpcarro/briefcase {};
in briefcase.utils.nixBufferFromShell ./shell.nix

View file

@ -1,6 +1,6 @@
let
pkgs = import <nixpkgs> {};
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
elmPackages.elm

View file

@ -1,5 +1,6 @@
{ pkgs, depot, ... }:
let
pkgs = import <nixpkgs> {};
hailgun-src = builtins.fetchGit {
url = "https://bitbucket.org/echo_rm/hailgun.git";
rev = "9d5da7c902b2399e0fcf3d494ee04cf2bbfe7c9e";

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
leiningen
];

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs.elmPackages; [
elm
elm-format

View file

@ -11,9 +11,13 @@ pkgs.stdenv.mkDerivation {
# parcel.js needs number of CPUs
PARCEL_WORKERS = "1";
buildPhase = ''
export HOME="."
npx parcel build src/index.html --public-url ./
'';
installPhase = ''
mv dist $out
'';
# TODO(wpcarro): This doesn't build at all.
meta.ci = false;
}

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
yarn

View file

@ -1,8 +1,8 @@
{ briefcase, pkgs, ... }:
{ pkgs, depot, ... }:
let
inherit (builtins) fetchGit path toJSON;
inherit (briefcase.emacs) initEl runScript;
inherit (depot.users.wpcarro.emacs) initEl runScript;
elispLintSrc = fetchGit {
url = "https://github.com/gonewest818/elisp-lint";

View file

@ -1,4 +0,0 @@
_: {
# temporarily commented out while briefcase is being integrated in
# depot.
}

View file

@ -2,12 +2,11 @@
# name: shell.nix boilerplate
# key: import
# --
let
briefcase = with import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in stdenv.mkDerivation {
{ pkgs, ... }:
pkgs.stdenv.mkDerivation {
name = "$1";
buildInputs = [
$2
];
}
}

View file

@ -294,10 +294,6 @@
:config
(add-hook 'lsp-mode-hook #'lsp-ui-mode))
(use-package company-lsp
:config
(push 'company-lsp company-backends))
;; Wilfred/suggest.el - Tool for discovering functions basesd on declaring your
;; desired inputs and outputs.
(use-package suggest)

View file

@ -2,7 +2,7 @@
let
inherit (builtins) path;
inherit (depot.third_party) emacsPackagesGen emacs27;
inherit (depot.third_party.nixpkgs) emacsPackagesGen emacs27;
inherit (pkgs) writeShellScript writeShellScriptBin;
inherit (pkgs.lib.strings) concatStringsSep makeBinPath;
@ -49,7 +49,6 @@ let
clipmon # TODO: Prefer an Emacs client for clipmenud.
evil
evil-collection
evil-magit
evil-commentary
evil-surround
key-chord
@ -103,7 +102,6 @@ let
eglot
dap-mode
lsp-ui
company-lsp
suggest
paradox
flymake-shellcheck

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
go
goimports

View file

@ -1,6 +1,6 @@
{ depot, ... }:
depot.buildGo.package {
depot.nix.buildGo.package {
name = "kv";
srcs = [
./kv.go

View file

@ -1,6 +1,6 @@
{ depot, ... }:
depot.buildGo.package {
depot.nix.buildGo.package {
name = "utils";
srcs = [
./utils.go

View file

@ -1,5 +1,5 @@
let
briefcase = import <briefcase> {};
in briefcase.buildHaskell.shell {
{ depot, ... }:
depot.users.wpcarro.buildHaskell.shell {
deps = hpkgs: [];
}

View file

@ -1,8 +1,8 @@
{ depot, briefcase, ... }:
{ depot, ... }:
depot.nix.buildLisp.library {
name = "f";
deps = with briefcase.lisp; [
deps = with depot.users.wpcarro.lisp; [
prelude
];
srcs = [

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in {
{ pkgs, depot, ... }:
{
imports = [ ./hardware.nix ];
# Use the systemd-boot EFI boot loader.
@ -117,7 +116,7 @@ in {
systemd.services.zoo = {
enable = true;
description = "Run my monoserver";
script = "${briefcase.zoo}/zoo";
script = "${depot.users.wpcarro.zoo}/zoo";
environment = {};
serviceConfig = {
Restart = "always";
@ -175,12 +174,12 @@ in {
"wpcarro.dev" = {
addSSL = true;
enableACME = true;
root = briefcase.website;
root = depot.users.wpcarro.website;
};
"learn.wpcarro.dev" = {
addSSL = true;
enableACME = true;
root = briefcase.website.learn;
root = depot.users.wpcarro.website.learn;
};
"git.wpcarro.dev" = {
addSSL = true;
@ -192,17 +191,17 @@ in {
"blog.wpcarro.dev" = {
addSSL = true;
enableACME = true;
root = briefcase.website.blog;
root = depot.users.wpcarro.website.blog;
};
# "sandbox.wpcarro.dev" = {
# addSSL = true;
# enableACME = true;
# root = briefcase.website.sandbox;
# root = depot.users.wpcarro.website.sandbox;
# };
# "learnpianochords.app" = {
# addSSL = true;
# enableACME = true;
# root = briefcase.website.sandbox.learnpianochords;
# root = depot.users.wpcarro.website.sandbox.learnpianochords;
# };
"zoo.wpcarro.dev" = {
addSSL = true;

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
python3

View file

@ -1,5 +1,5 @@
let
briefcase = import <briefcase> {};
in briefcase.buildHaskell.shell {
{ depot, ... }:
depot.users.wpcarro.buildHaskell.shell {
deps = hpkgs: [];
}

View file

@ -1,6 +1,6 @@
let
briefcase = import <briefcase> {};
in briefcase.buildHaskell.shell {
{ depot, ... }:
depot.users.wpcarro.buildHaskell.shell {
deps = hpkgs: with hpkgs; [
quickcheck-simple
checkers

View file

@ -0,0 +1,2 @@
Subdirectories of this folder should not be imported since they are
internal to buildGo.nix and incompatible with readTree.

View file

@ -1,11 +1,13 @@
{ depot, briefcase, ... }:
{ depot, ... }:
depot.buildGo.program {
let
inherit (depot.users.wpcarro) gopkgs;
in depot.nix.buildGo.program {
name = "job";
srcs = [
./main.go
];
deps = with briefcase.gopkgs; [
deps = with gopkgs; [
kv
utils
];

View file

@ -10,7 +10,8 @@
package main
import (
"fmt"
"os"
"monzoSerde"
)
var (
@ -34,7 +35,7 @@ func toYnab(tx monzoSerde.Transaction) ynabSerde.Transaction {
func main() {
txs := monzo.TransactionsLast24Hours()
var ynabTxs []ynabSerde.Transaction{}
var ynabTxs []ynabSerde.Transaction
for tx := range txs {
append(ynabTxs, toYnab(tx))
}

View file

@ -1,10 +1,9 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
buildInputs = [
pkgs.go
pkgs.goimports
pkgs.godef
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
go
goimports
godef
];
}

View file

@ -1,21 +1,23 @@
{ depot, briefcase, ... }:
{ depot, ... }:
let
auth = depot.buildGo.package {
inherit (depot.users.wpcarro) gopkgs;
auth = depot.nix.buildGo.package {
name = "auth";
srcs = [
./auth.go
];
deps = with briefcase.gopkgs; [
deps = with gopkgs; [
utils
];
};
in depot.buildGo.program {
in depot.nix.buildGo.program {
name = "token-server";
srcs = [
./tokens.go
];
deps = with briefcase.gopkgs; [
deps = with gopkgs; [
kv
utils
auth

View file

@ -2,7 +2,7 @@
# TODO: This doesn't depend on `sendgmr` at the moment, but it should. As such,
# it's an imcomplete packaging.
depot.buildGo.program {
depot.nix.buildGo.program {
name = "rfcToKindle";
srcs = [
./main.go

View file

@ -1,11 +1,11 @@
{ pkgs, depot, briefcase, ... }:
{ pkgs, depot, ... }:
depot.buildGo.program {
depot.nix.buildGo.program {
name = "run";
srcs = [
./main.go
];
deps = with briefcase.gopkgs; [
deps = with depot.users.wpcarro.gopkgs; [
utils
];
}

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
go
goimports

View file

@ -6,10 +6,6 @@ let
name = "config.vim";
};
script = pkgs.writeShellScriptBin "simple_vim" ''
${pkgs.vim}/bin/vim -u ${configVim}
'';
in pkgs.stdenv.mkDerivation {
name = "simple_vim";
buildInputs = [ script ];
}
in pkgs.writeShellScriptBin "simple_vim" ''
${pkgs.vim}/bin/vim -u ${configVim}
''

View file

@ -1,11 +1,13 @@
{ depot, briefcase, ... }:
{ depot, ... }:
depot.buildGo.program {
let
inherit (depot.users.wpcarro) gopkgs;
in depot.nix.buildGo.program {
name = "symlink-mgr";
srcs = [
./main.go
];
deps = with briefcase.gopkgs; [
deps = with gopkgs; [
utils
];
}

View file

@ -1,6 +1,6 @@
let
briefcase = import <briefcase> {};
in briefcase.buildHaskell.shell {
{ depot, ... }:
depot.users.wpcarro.buildHaskell.shell {
deps = hpkgs: with hpkgs; [
time
aeson

View file

@ -3,7 +3,7 @@ args@{ pkgs, ... }:
# This top-level module exposes all of my utility functions for Nix. It should
# be used like:
# ```nix
# inherit (briefcase.utils) fs;
# inherit (depot.users.wpcarro.utils) fs;
# ```
let

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
hugo
];

View file

@ -1,4 +1,4 @@
{ pkgs, briefcase, ... }:
{ pkgs, depot, ... }:
pkgs.stdenv.mkDerivation {
name = "wpcarro.dev";
@ -8,6 +8,6 @@ pkgs.stdenv.mkDerivation {
cp $src/index.html $out
mkdir -p $out/habits
cp -r ${briefcase.website.habit-screens} $out/habits/index.html
cp -r ${depot.users.wpcarro.website.habit-screens} $out/habits/index.html
'';
}

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
yarn

View file

@ -1,4 +1,4 @@
{ pkgs ? <nixpkgs> , ... }:
{ pkgs, ... }:
with pkgs;
@ -16,9 +16,9 @@ let
inherit name src;
buildInputs = [ elmPackages.elm ]
++ lib.optional outputJavaScript nodePackages_10_x.uglify-js;
++ lib.optional outputJavaScript nodePackages.uglify-js;
buildPhase = pkgs.elmPackages.fetchElmDeps {
buildPhase = elmPackages.fetchElmDeps {
elmPackages = import srcs;
elmVersion = "0.19.1";
inherit registryDat;
@ -35,7 +35,7 @@ let
${lib.optionalString outputJavaScript ''
echo "minifying ${elmfile module}"
uglifyjs $out/${module}.${extension} --compress 'pure_funcs="F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9",pure_getters,keep_fargs=false,unsafe_comps,unsafe' \
| uglifyjs --mangle --output=$out/${module}.min.${extension}
| uglifyjs --mangle --output $out/${module}.min.${extension}
''}
'') targets)}
'';
@ -58,4 +58,3 @@ in stdenv.mkDerivation {
'';
dontInstall = true;
}

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs.elmPackages; [
elm
elm-format

View file

@ -11,9 +11,14 @@ pkgs.stdenv.mkDerivation {
# parcel.js needs number of CPUs
PARCEL_WORKERS = "1";
buildPhase = ''
export HOME="."
npx parcel build index.html
'';
installPhase = ''
mv dist $out
'';
# TODO(wpcarro): This doesn't build at all.
meta.ci = false;
}

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
nodejs
yarn

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
yarn
nodejs

View file

@ -1,4 +1,4 @@
{ pkgs, briefcase, ... }:
{ pkgs, ... }:
pkgs.stdenv.mkDerivation {
name = "covid-uk";
@ -7,7 +7,7 @@ pkgs.stdenv.mkDerivation {
buildPhase = ''
mkdir -p $out
cp $src/index.html $out
cp -r ${briefcase.website.sandbox.covid-uk} $out/covid-uk
cp -r ${depot.users.wpcarro.website.sandbox.covid-uk} $out/covid-uk
'';
dontInstall = true;
}

View file

@ -1,4 +1,4 @@
{ pkgs ? <nixpkgs>, ... }:
{ pkgs, ... }:
with pkgs;
@ -16,9 +16,9 @@ let
inherit name src;
buildInputs = [ elmPackages.elm ]
++ lib.optional outputJavaScript nodePackages_10_x.uglify-js;
++ lib.optional outputJavaScript nodePackages.uglify-js;
buildPhase = pkgs.elmPackages.fetchElmDeps {
buildPhase = elmPackages.fetchElmDeps {
elmPackages = import srcs;
elmVersion = "0.19.1";
inherit registryDat;
@ -35,7 +35,7 @@ let
${lib.optionalString outputJavaScript ''
echo "minifying ${elmfile module}"
uglifyjs $out/${module}.${extension} --compress 'pure_funcs="F2,F3,F4,F5,F6,F7,F8,F9,A2,A3,A4,A5,A6,A7,A8,A9",pure_getters,keep_fargs=false,unsafe_comps,unsafe' \
| uglifyjs --mangle --output=$out/${module}.min.${extension}
| uglifyjs --mangle --output $out/${module}.min.${extension}
''}
'') targets)}
'';

View file

@ -1,7 +1,6 @@
let
briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell {
{ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs.elmPackages; [
elm
elm-format

View file

@ -1,6 +1,6 @@
let
briefcase = import <briefcase> {};
in briefcase.buildHaskell.program {
{ depot, ... }:
depot.users.wpcarro.buildHaskell.program {
name = "server";
srcs = builtins.path {
path = ./.;

View file

@ -1,6 +1,6 @@
let
briefcase = import <briefcase> {};
in briefcase.buildHaskell.shell {
{ depot, ... }:
depot.users.wpcarro.buildHaskell.shell {
deps = hpkgs: with hpkgs; [
hspec
servant-server

View file

@ -1,6 +1,6 @@
{ briefcase, ... }:
{ depot, ... }:
briefcase.buildHaskell.program {
depot.users.wpcarro.buildHaskell.program {
name = "zoo";
srcs = builtins.path {
path = ./.;

View file

@ -1,6 +1,6 @@
let
briefcase = import <briefcase> {};
in briefcase.buildHaskell.shell {
{ depot, ... }:
depot.users.wpcarro.buildHaskell.shell {
deps = hpkgs: with hpkgs; [
servant-server
aeson