Skip to content

attemp to lock veritco #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bin/dialog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

osascript -e " display dialog \"$*\" "
4 changes: 2 additions & 2 deletions bin/home-manager-flake-switch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
# [[file:../workstation.org::*flake-world equivalent to home-manager 'switch'][flake-world equivalent to home-manager 'switch':1]]
set -u # error in case WORKSTATION_NAME is not set
function home_manager_flake_switch() {
nix build --no-link ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage --show-trace
"$(nix path-info ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage)"/activate --show-trace
nix build --debug -L -v --no-link ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage --show-trace && \
"$(nix path-info ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage)"/activate --show-trace
}
home_manager_flake_switch
# flake-world equivalent to home-manager 'switch':1 ends here
3 changes: 3 additions & 0 deletions bin/notify.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

osascript -e " display notification \"$*\" "
4 changes: 2 additions & 2 deletions bootstrap-workstation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ set -u

# [[[[file:~/workstation/workstation.org::home_manager_flake_switch_function][home_manager_flake_switch_function]]][home_manager_flake_switch_function]]
function home_manager_flake_switch() {
nix build --no-link ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage --show-trace
"$(nix path-info ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage)"/activate --show-trace
nix build --no-link ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage --show-trace && \
"$(nix path-info ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage)"/activate --show-trace
}
# home_manager_flake_switch_function ends here
home_manager_flake_switch
Expand Down
3 changes: 2 additions & 1 deletion dotfiles/doom.d/config.el
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
(setq global-flycheck-mode nil)

(load-theme 'tsdh-light)

(toggle-debug-on-error)
(toggle-debug-on-quit)

;; (add-to-list 'load-path "~/Projects/shen-elisp/")
;; (require 'shen-elisp)
Expand Down
1 change: 0 additions & 1 deletion dotfiles/doom.d/init.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
;; bug that seems to be in the search code for vertico.
;; no idea when it may get resolved
ivy ; a search engine for love and life

;; vertico ; the search engine of the future

:ui
Expand Down
6 changes: 1 addition & 5 deletions dotfiles/zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ export HISTSIZE=10000
# TODO figure out how to make this work in zsh
# shopt -s histappend

do_command_done_alert() {
osascript -e 'display dialog "Command Done!"'
}

alert_when_done() {
if test -n "$1";
then
Expand All @@ -34,7 +30,7 @@ alert_when_done() {
sleep 1
done
fi
do_command_done_alert
notify.sh "command $1 has exited"
}

sourceIfExists ~/etc/machine-settings.sh
Expand Down
87 changes: 43 additions & 44 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 81 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# nixpkgs.url = "git+file:///Users/joel/Projects/nixpkgs";
darwin-nixpkgs = {
url = "github:nixos/nixpkgs/nixpkgs-22.11-darwin";
url = "git+file:///Users/joel/Projects/nixpkgs";
};
darwin.url = "github:lnl7/nix-darwin/master";
darwin.inputs.nixpkgs.follows = "darwin-nixpkgs";
Expand All @@ -17,14 +18,22 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nix-doom-emacs = {
url = "github:nix-community/nix-doom-emacs";
url = "git+file:///Users/joel/Projects/nix-doom-emacs";
inputs = {
nixpkgs.follows = "nixpkgs";


doom-emacs.url = "git+file:///Users/joel/Projects/doomemacs";
nix-straight.url = "git+file:///Users/joel/Projects/nix-straight.el";
};
};
};

outputs = inputs@{ self, darwin, nixpkgs, darwin-nixpkgs, home-manager, darwin-home-manager, nix-doom-emacs, # darwin-nix-doom-emacs,
outputs = inputs@{ self, darwin, nixpkgs, darwin-nixpkgs, home-manager, darwin-home-manager, nix-doom-emacs,
... }:

let

home-manager-config = { user, home }:
{ config, pkgs, lib, ... }:
{
Expand Down Expand Up @@ -71,6 +80,74 @@
extraConfig = ''
(add-to-list 'exec-path "~/.nix-profile/bin/")
'';

# emacsPackagesOverlay = self: super: {
# embark = self.trivialBuild {
# pname = "embark";
# ename = "embark";
# version = "5d0459d27aa7cf738b5af36cf862723a62bef955";
# packageRequires = [ super.compat super.emacs ];
# src = pkgs.fetchFromGitHub {
# owner = "oantolin";
# repo = "embark";
# rev = "5d0459d27aa7cf738b5af36cf862723a62bef955";
# sha256 = "sha256-7U94GRmUA+UdqvwSBSEGSwHSpfqaaiKghqg4P4gn85c=";
# };
# meta = {
# homepage = "https://elpa.gnu.org/packages/embark.html";
# license = lib.licenses.free;
# };

# };
# # https://github.com/doomemacs/doomemacs/blob/07fca786154551f90f36535bfb21f8ca4abd5027/modules/completion/vertico/packages.el#L4C18-L7
# vertico = self.trivialBuild {
# pname = "vertico";
# ename = "vertico";
# version = "2ad46196653b8a873adf11aee949d621af8ff6bc";
# packageRequires = [ super.compat super.emacs ];
# src = pkgs.fetchFromGitHub {
# owner = "minad";
# repo = "vertico";
# rev = "2ad46196653b8a873adf11aee949d621af8ff6bc";
# sha256 = "sha256-8vsNZKSWY6AcLs/a8/b9tjmkF2LEeRSAOvsdiWq+cAc=";
# };
# meta = {
# homepage = "https://elpa.gnu.org/packages/vertico.html";
# license = lib.licenses.free;
# };

# };

# # vertico = self.melpaBuild {
# # pname = "vertico";

# # # inherit (haskellPackages.ghc-mod) version src;
# # version = "2ad46196653b8a873adf11aee949d621af8ff6bc";

# # src = pkgs.fetchFromGitHub {
# # owner = "minad";
# # repo = "vertico";
# # rev = "2ad46196653b8a873adf11aee949d621af8ff6bc";
# # sha256 = "sha256-8vsNZKSWY6AcLs/a8/b9tjmkF2LEeRSAOvsdiWq+cAc=";
# # };

# # packageRequires = [ super.compat super.emacs ];

# # # propagatedUserEnvPkgs = [ haskellPackages.ghc-mod ];

# # recipe = pkgs.writeText "recipe" ''
# # (vertico :repo "minad/vertico" :fetcher github :files ("*.el" "extensions/*.el"))
# # '';

# # fileSpecs = [ "*.el" "extensions/*.el" ];

# # meta = {
# # homepage = "https://elpa.gnu.org/packages/vertico.html";
# # license = lib.licenses.free;
# # };
# # };
# }
# ;
};

# workaround; see https://github.com/nix-community/home-manager/issues/3342#issuecomment-1283158398
Expand Down Expand Up @@ -148,6 +225,7 @@
};
homeConfigurations."ci-ubuntu".runner = linux-home-config{
user = "runner"; home = "/home/runner";

};
};
}
24 changes: 24 additions & 0 deletions run-debugging-process.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env sh

set -xu

LOG_DIR="build-log-$(date | sed 's/ /-/g')"
mkdir -p $LOG_DIR
BUILD_LOG="$LOG_DIR/flake-build.log"
REQUISITES_LOG="$LOG_DIR/requisites.log"
STRAIGHT_LOG="$LOG_DIR/straight-emacs-env.log"

nix build --debug -L -v --no-link ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage --show-trace 2>&1 | tee "$BUILD_LOG"
"$(nix path-info ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage)"/activate --show-trace 2>&1 | tee "$BUILD_LOG"

DERIVATION_PATH=$(nix path-info ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage)

nix-store --query --requisites --include-outputs "$DERIVATION_PATH" > "$REQUISITES_LOG"

STRAIGHT_ENV_PATH=$(grep straight-emacs-env "$REQUISITES_LOG" | tail -n 1)
nix log "$STRAIGHT_ENV_PATH" > "$STRAIGHT_LOG"
echo "============= STRAIGHT_LOG ==========="
cat "$STRAIGHT_LOG"
echo LOGS STORED TO "$LOG_DIR"

dialog.sh "workstation build finished" &
4 changes: 2 additions & 2 deletions workstation.org
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,8 @@ home_manager_flake_switch
#+NAME: home_manager_flake_switch_function
#+begin_src shell
function home_manager_flake_switch() {
nix build --no-link ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage --show-trace
"$(nix path-info ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage)"/activate --show-trace
nix build --no-link ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage --show-trace && \
"$(nix path-info ~/workstation/#homeConfigurations.${WORKSTATION_NAME}.$(whoami).activationPackage)"/activate --show-trace
}
#+end_src
** Nix darwin
Expand Down