Arguments

This commit is contained in:
Anthony Cicchetti 2023-07-20 22:04:50 -04:00
parent 9eb38eca4d
commit fd17701f00
5 changed files with 50 additions and 30 deletions

6
flake.lock generated
View file

@ -8,11 +8,11 @@
"pre-commit-hooks": "pre-commit-hooks" "pre-commit-hooks": "pre-commit-hooks"
}, },
"locked": { "locked": {
"lastModified": 1689785879, "lastModified": 1689890200,
"narHash": "sha256-ofTzITQUNKiA2RBE7hLChVguua4AoHrr1TSvQyTzQ6Q=", "narHash": "sha256-RhG3twdQjaNFgvUxdIJ+9ynu7oeEs/h65fxDvcmTuSQ=",
"owner": "cachix", "owner": "cachix",
"repo": "devenv", "repo": "devenv",
"rev": "e207a8ef9911eba7f9a5e7761e47dc532931d482", "rev": "f9f4dd3c1a4f767b11abe092b1ecdcf27844a2bd",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -24,16 +24,13 @@
modules = [ modules = [
{ {
# https://devenv.sh/reference/options/ # https://devenv.sh/reference/options/
packages = [pkgs.hello pkgs.delta pkgs.difftastic pkgs.alejandra pkgs.nodePackages.bash-language-server]; packages = [pkgs.hello pkgs.delta pkgs.difftastic pkgs.alejandra pkgs.nodePackages.bash-language-server pkgs.shellcheck pkgs.shfmt];
enterShell = ''
hello
'';
pre-commit.hooks = { pre-commit.hooks = {
shellcheck.enable = true;
black.enable = true;
alejandra.enable = true; alejandra.enable = true;
black.enable = true;
shellcheck.enable = true;
shfmt.enable = true;
taplo.enable = true; taplo.enable = true;
}; };
} }

View file

@ -118,11 +118,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1689875525, "lastModified": 1689891262,
"narHash": "sha256-fgUrFH3bMZ6R7qgBTfuTRGlkZXIkdyjndl6ZbExbjE8=", "narHash": "sha256-Pc4wDczbdgd6QXKJIXprgxe7L9AVDsoAkMnvm5vmpUU=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "1443abd2696ec6bd6fb9701e6c26b277a27b4a3e", "rev": "ee5673246de0254186e469935909e821b8f4ec15",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -1,6 +1,7 @@
#!/bin/bash
if [[ ! -x $(command -v nix) ]]; then if [[ ! -x $(command -v nix) ]]; then
echo "make sure to install nix" echo "make sure to install nix"
exit 1 exit 1
fi fi
nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
@ -10,11 +11,11 @@ nix-shell '<home-manager>' -A install
nix flake update nix flake update
if [[ $(uname) == "Darwin" ]]; then if [[ $(uname) == "Darwin" ]]; then
# we're modern macOS # we're modern macOS
home-manager switch --flake "$PWD/home-manager#aarch64-darwin-acicchetti" home-manager switch --flake "$PWD/home-manager#aarch64-darwin-acicchetti"
else else
# we're linux # we're linux
home-manager switch --flake "$PWD/home-manager#x86_64-linux-acicchetti" home-manager switch --flake "$PWD/home-manager#x86_64-linux-acicchetti"
fi fi
git clone https://github.com/doomemacs/doomemacs ~/.emacs.d git clone https://github.com/doomemacs/doomemacs ~/.emacs.d

View file

@ -1,12 +1,34 @@
#!/bin/bash #!/bin/bash
pushd ~/.dotfiles do_devenv() {
printf "Updating \033[38;5;87mdevenv\033[0m \n" pushd ~/.dotfiles || return
nix flake update printf "Updating \033[38;5;87mdevenv\033[0m \n"
pushd ./nix/home-manager nix flake update
printf "Updating \033[38;5;87mhome-manager\033[0m\n" popd || return
nix flake update }
if [[ $(uname) == "Darwin" ]]; then do_home_manager() {
home-manager switch --flake ".#aarch64-darwin-acicchetti" pushd ./home-manager || return
else printf "Updating \033[38;5;87mhome-manager\033[0m\n"
home-manager switch --flake '.#x86_64-linux-acicchetti' nix flake update
fi if [[ $(uname) == "Darwin" ]]; then
home-manager switch --flake ".#aarch64-darwin-acicchetti"
else
home-manager switch --flake '.#x86_64-linux-acicchetti'
fi
popd || return
}
OPTIND=1
while getopts dh opt; do
case $opt in
d)
do_devenv
;;
h)
do_home_manager
;;
*)
exit 1
;;
esac
done
shift "$((OPTIND - 1))" # Discard the options and sentinel --