diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8a754ae --- /dev/null +++ b/Makefile @@ -0,0 +1,35 @@ +.POSIX: +.PHONY: default build update + +default: build + +/nix: + curl -L https://nixos.org/nix/install | sh + # TODO https://github.com/LnL7/nix-darwin/issues/149 + sudo rm /etc/nix/nix.conf + +/run/current-system/sw/bin/darwin-rebuild: + /nix/var/nix/profiles/default/bin/nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer + yes | ./result/bin/darwin-installer + +/opt/homebrew/bin/brew: + curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -o /tmp/brew-install.sh + NONINTERACTIVE=1 bash /tmp/brew-install.sh + +~/.ssh/id_ed25519: + ssh-keygen -t ed25519 -f "$@" + +~/.git: ~/.ssh/id_ed25519 + cd ~ \ + && git init \ + && git config status.showUntrackedFiles no \ + && git remote add origin https://github.com/romelben/dotfiles \ + && git pull origin master \ + && git remote set-url origin git@github.com:romelben/dotfiles + +build: /nix /run/current-system/sw/bin/darwin-rebuild /opt/homebrew/bin/brew ~/.git + /run/current-system/sw/bin/nix --experimental-features 'nix-command flakes' build ./\#darwinConfigurations.$(shell hostname -s).system + ./result/sw/bin/darwin-rebuild switch --flake . + +update: + nix flake update \ No newline at end of file diff --git a/README.md b/README.md index 93d7251..26b3e10 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,8 @@ This repo encapsulates a range of Nix goodies that I use to declutter and bring - Shell aliases and helper scripts ## Before You Begin -Setup your environment: -Before you move forward, you will receive an error on `--extra-experimental-features` on `nix-command`. What you will need to do the following: -- Add `experimental-features = nix-command flakes` onto `/etc/nix/nix.conf` -- Make sure to change the username from `romelben` to your own in the `flake.nix`. This would be located in the root directory. +You must change the following: +- Change the username and hostname to your specs in `flake.nix` and `./home-manager/*.nix`. Username would be your name you have assigned to your local computer and hostname is already done but to understand what is being pulled, run the following command: `hostname -s` or `scutil --get LocalHostName`. ### Using `nix develop` > [!IMPORTANT] diff --git a/flake.nix b/flake.nix index 7a51e55..2029b5a 100644 --- a/flake.nix +++ b/flake.nix @@ -46,8 +46,9 @@ default = let reload = pkgs.writeScriptBin "reload" '' - FLAKE_OUTPUT=".#darwinConfigurations.romelbenavides-aarch64-darwin.system" - ${pkgs.nixFlakes}/bin/nix build "''${FLAKE_OUTPUT}" --extra-experimental-features nix-command --extra-experimental-features flakes && \ + CONFIG_NAME=$(scutil --get LocalHostName) + FLAKE_OUTPUT=".#darwinConfigurations.''${CONFIG_NAME}.system" + ${pkgs.nixFlakes}/bin/nix build "''${FLAKE_OUTPUT}" && \ ./result/sw/bin/darwin-rebuild activate && \ ${pkgs.zsh}/bin/zsh -c "source ${pkgs.homeDirectory}/.zshrc" ''; diff --git a/home-manager/config/alacritty.yaml b/home-manager/config/alacritty.yaml new file mode 100644 index 0000000..6206982 --- /dev/null +++ b/home-manager/config/alacritty.yaml @@ -0,0 +1,45 @@ +window: + decorations: none + startup_mode: Maximized + option_as_alt: OnlyLeft + +scrolling: + multiplier: 1 + +cursor: + style: + blinking: On + +font: + normal: + family: FiraCode Nerd Font Mono + style: Regular + size: 12.0 + +colors: + normal: + black: '#21252b' + red: '#be5046' + green: '#98c379' + yellow: '#d19a66' + blue: '#61afef' + magenta: '#c678dd' + cyan: '#56b6c2' + white: '#828997' + bright: + black: '#5c6370' + red: '#e06c75' + green: '#98c379' + yellow: '#e5c07b' + blue: '#61afef' + magenta: '#c678dd' + cyan: '#56b6c2' + white: '#abb2bf' + primary: + background: '#282c34' + foreground: '#abb2bf' + +key_bindings: + - { key: F, mods: Command|Shift, action: ToggleSimpleFullscreen } + - { key: C, mods: Control|Shift, action: Copy } + - { key: V, mods: Control|Shift, action: Paste } \ No newline at end of file diff --git a/home-manager/config/kitty.conf b/home-manager/config/kitty.conf new file mode 100644 index 0000000..eccef98 --- /dev/null +++ b/home-manager/config/kitty.conf @@ -0,0 +1,21 @@ +# Fonts + +font_family Monaco +font_size 12 + +# Keymaps + +kitty_mod cmd + +map cmd+c copy_to_clipboard +map cmd+v paste_from_clipboard + +map cmd+equal change_font_size all +1.0 +map cmd+minus change_font_size all -1.0 +map cmd+0 change_font_size all 0 + +# macOS specific tweaks + +hide_window_decorations titlebar-only +macos_option_as_alt yes +macos_quit_when_last_window_closed yes \ No newline at end of file