Revise previous opinions about absolute paths GT <bracket-notation>

Unforeseen problem: `buildkite-agent` runs its builds in a separate directory,
so if I want the `nix-build` command to build the newly checked out code, I need
to set <briefcase> to the CWD.
This commit is contained in:
William Carroll 2020-08-17 10:08:32 +01:00
parent 7833632a79
commit 59f7481411
11 changed files with 12 additions and 21 deletions

View file

@ -1,5 +1,5 @@
let let
briefcase = import /home/wpcarro/briefcase {}; briefcase = import <briefcase> {};
in briefcase.buildHaskell.shell { in briefcase.buildHaskell.shell {
deps = hpkgs: with hpkgs; [ deps = hpkgs: with hpkgs; [
hspec hspec

View file

@ -1,6 +1,7 @@
set -euo pipefail set -euo pipefail
nix-build /home/wpcarro/nixpkgs/nixos \ nix-build /home/wpcarro/nixpkgs/nixos \
-I nixos-config=/home/wpcarro/briefcase/nixos/socrates/default.nix \ -I briefcase="$(pwd)" \
-I nixos-config=nixos/socrates/default.nix \
-A system \ -A system \
--show-trace --show-trace

View file

@ -8,7 +8,7 @@
# I believe these calls depend on nixpkgs being set in NIX_PATH, which is a # I believe these calls depend on nixpkgs being set in NIX_PATH, which is a
# dependency that I'm trying to prune... # dependency that I'm trying to prune...
let let
briefcase = import /home/wpcarro/briefcase {}; briefcase = import <briefcase> {};
in { in {
home = { home = {
packages = with pkgs; [ packages = with pkgs; [

View file

@ -1,5 +1,5 @@
let let
briefcase = import /home/wpcarro/briefcase {}; briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs; pkgs = briefcase.third_party.pkgs;
trimNewline = x: pkgs.lib.removeSuffix "\n" x; trimNewline = x: pkgs.lib.removeSuffix "\n" x;
readSecret = x: trimNewline (builtins.readFile ("/etc/secrets/" + x)); readSecret = x: trimNewline (builtins.readFile ("/etc/secrets/" + x));

View file

@ -5,7 +5,7 @@
{ {
imports = imports =
[ /home/wpcarro/nixpkgs/nixos/modules/installer/scan/not-detected.nix [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix>
]; ];
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "usbhid" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];

View file

@ -1,11 +0,0 @@
{ pkgs, ... }:
pkgs.writeShellScriptBin "rebuild" ''
set -ue
sudo nixos-rebuild \
-I nixos-config=/home/wpcarro/briefcase/nixos/socrates/configuration.nix \
-I nixpkgs=/home/wpcarro/nixpkgs \
-I depot=/home/wpcarro/depot \
-I briefcase=/home/wpcarro/briefcase \
switch
''

View file

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

View file

@ -1,5 +1,6 @@
let let
pkgs = import /home/wpcarro/nixpkgs {}; briefcase = import <briefcase> {};
pkgs = briefcase.third_party.pkgs;
in pkgs.mkShell { in pkgs.mkShell {
buildInputs = with pkgs; [ buildInputs = with pkgs; [
elmPackages.elm elmPackages.elm

View file

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

View file

@ -1,5 +1,5 @@
let let
briefcase = import /home/wpcarro/briefcase {}; briefcase = import <briefcase> {};
in briefcase.buildHaskell.shell { in briefcase.buildHaskell.shell {
deps = hpkgs: with hpkgs; [ deps = hpkgs: with hpkgs; [
hspec hspec

View file

@ -1,5 +1,5 @@
let let
briefcase = import /home/wpcarro/briefcase {}; briefcase = import <briefcase> {};
in briefcase.buildHaskell.shell { in briefcase.buildHaskell.shell {
deps = hpkgs: with hpkgs; [ deps = hpkgs: with hpkgs; [
servant-server servant-server