Boilerplate reduction (I understand strings in nix now!)

This commit is contained in:
Emmet 2023-06-22 14:53:10 -05:00
parent c7f3327147
commit b4a0d72a92
17 changed files with 136 additions and 144 deletions

View file

@ -1,4 +1,4 @@
{ config, lib, pkgs, myName, myDotfilesDir, ... }:
{ config, lib, pkgs, username, dotfilesDir, ... }:
let
# This sets up my "phoenix" script with my configuration paths
@ -6,12 +6,12 @@ let
myPhoenixScript = ''
if [ "$1" = "sync" ]; then
if [ "$2" != "user" ]; then
pushd ''+myDotfilesDir+'';
pushd ''+dotfilesDir+'';
sudo nixos-rebuild switch --flake .#;
popd;
elif [ "2" != "system" ]; then
pushd ''+myDotfilesDir+'';
home-manager switch --flake .#''+myName+'';
pushd ''+dotfilesDir+'';
home-manager switch --flake .#''+username+'';
popd;
which xmobar &> /dev/null && killall xmobar;
which xmonad &> /dev/null && xmonad --recompile && xmonad --restart;
@ -19,7 +19,7 @@ let
[ -f ~/.fehbg-stylix ] &> /dev/null && ~/.fehbg-stylix;
fi
elif [ "$1" = "update" ]; then
pushd ''+myDotfilesDir+'';
pushd ''+dotfilesDir+'';
nix flake update;
popd;
if [ -d ~/.emacs.d/eaf/app/browser ]