diff --git a/provision/arch/TODO.md b/TODO.md similarity index 79% rename from provision/arch/TODO.md rename to TODO.md index 3ad2c2b3..296fb965 100644 --- a/provision/arch/TODO.md +++ b/TODO.md @@ -4,3 +4,5 @@ - Document themeing options in additional-setup (to help and figure out automation) - Make fzf scratch pad for zk notes - Make scratch pad for taskwarrior/timewarrior? +- Make kestrel vpn setup automatically +- convert home server to nix? diff --git a/home/.chezmoiexternal.toml b/home/.chezmoiexternal.toml index f37aa158..6f87dbed 100644 --- a/home/.chezmoiexternal.toml +++ b/home/.chezmoiexternal.toml @@ -5,6 +5,11 @@ stripComponents = 1 refreshPeriod = "168h" +[".config/alacritty/themes"] + type = "git-repo" + url = "https://github.com/alacritty/alacritty-theme" + refreshPeriod = "168h" + [".local/share/nvim/site/pack/packer/start/packer.nvim"] type = "git-repo" url = "https://github.com/wbthomason/packer.nvim.git" @@ -45,7 +50,10 @@ url = "https://codeberg.org/xmobar/xmobar" refreshPeriod = "168h" -[".config/alacritty/themes"] - type = "git-repo" - url = "https://github.com/alacritty/alacritty-theme" +[".config/nnn/plugins"] + type = "archive" + url = "https://github.com/jarun/nnn/archive/master.zip" + exact = true + stripComponents = 2 refreshPeriod = "168h" + include = ["*/plugins/**"] diff --git a/home/bin/executable_linux-mount-engi b/home/bin/executable_linux-mount-engi index e54dc0ed..7adba7b5 100644 --- a/home/bin/executable_linux-mount-engi +++ b/home/bin/executable_linux-mount-engi @@ -1,3 +1,3 @@ #!/usr/bin/env bash -sudo mount -t cifs -o uid=tstarr,gid=tstarr,rw,vers=3.0,credentials=/home/tstarr/.smb //192.168.1.135/engi /home/tstarr/mnt/engi +sudo mount -t cifs -o rw,vers=3.0,credentials=/home/tstarr/.smb //192.168.1.135/engi /home/tstarr/mnt/engi diff --git a/home/dot_config/sway/config.tmpl b/home/dot_config/sway/config.tmpl index 9645c962..82c9632c 100644 --- a/home/dot_config/sway/config.tmpl +++ b/home/dot_config/sway/config.tmpl @@ -7,8 +7,8 @@ set $HOME /home/{{ .user }} -set $DISP_PRI DP-2 -set $DISP_SEC HDMI-A-1 +set $DISP_SEC DP-2 +set $DISP_PRI HDMI-A-1 set $BOR_WIDTH 3 set $GAP_INNER 3 @@ -227,12 +227,12 @@ mode scratch { bindsym Escape mode default } -output HDMI-A-1 { +output $DISP_SEC { resolution 2560x1440@143.912Hz position 0,0 } -output DP-3 { +output $DISP_PRI { resolution 2560x1440@143.973Hz position 2560,0 } diff --git a/home/dot_zshrc b/home/dot_zshrc index 058df9b0..2aa21f58 100644 --- a/home/dot_zshrc +++ b/home/dot_zshrc @@ -14,7 +14,7 @@ export ZSH="$HOME/.oh-my-zsh" DISABLE_AUTO_UPDATE="true" -plugins=(git zsh-syntax-highlighting) +plugins=(git zsh-syntax-highlighting fzf-dir-navigator) ZSH_THEME="dracula/dracula" source $ZSH/oh-my-zsh.sh @@ -31,9 +31,9 @@ export PATH # Create Aliases # Nixos -alias nixos-update='cd ~/.local/share/chezmoi/provision/nixos && \ +alias nixos-update="cd ~/.local/share/chezmoi/provision/nixos/hosts/$(hostname) && \ sudo nixos-rebuild switch --flake .#$(hostname) && \ - cd -' + cd -" # Sway alias s='sway' diff --git a/provision/nixos/additional-setup.md b/provision/nixos/additional-setup.md new file mode 100644 index 00000000..47436310 --- /dev/null +++ b/provision/nixos/additional-setup.md @@ -0,0 +1,72 @@ +# Additional Setup + +The following documents some NixOS setup that wasn't automated. + +## Wireguard Client  + +Wireguard is nice for a home vpn and [pivpn](https://pivpn.io/) makes it easy. +Currently my scripts for controlling (and visualizing the state of the vpn) +assume the connection name for the vpn is the same as the hostname of the system. +This may need to be modified in the future if I end up needing multiple vpn +connections. + +1. Create client on server and copy resulting `.conf` file to local machine +2. Import to networkmanager with: +```bash +nmcli connection import type wireguard file +``` +3. Use `nm-connection-editor` to disable automatic connection +4. Connect to vpn with `nmcli connection up + +## Mount network drives  + +I find fstab messing about more trobule than it is worth. Credentials are +stored in ~/.smb. Mount network drives when needed with the following command: + +```bash +linux-mount- +``` + +## Syncthing + +Syncthing is used to sync folders between various computers and android. The +ansible script should setup and run the service, but shares must be setup +via the web gui. Currently four shares exists: +- `.warrior` - `.task` and `.timewarrior` folders to sync taskwarrior tasks. +These two folders are symlinked to the home folder where taskwarrior/timewarrior +expects them. +- `warrior` - contains text files associated with taskwarrior (mostly from +taskopen). +- `phone photos` - personal photos synched from android. +- `phone screenshots` - personal screenshots synced from android. +- `ssh_keys` - contains ssh keys for git remotes (~/.ssh/keys) +- `vimwiki` - contains text files associate with my personal vimwiki. + +## Git SSH for personal and work + +- ~/.gitconfig - personal github configuration. +- ~/devel/work/.gitconfig - work gitlab configuration. + +Gitconfig files for SSH git push/pull are automaitcally placed. The only +additional configuration required is the transfer of SSH keys (see Syncthing +section). + +## Firefox  + +Transfer the `.mozilla` folder from install-to-install to maintain Firefox +settings and configurations. + +## Yuzu + +Copy over the `~/.config/yuzu` and `~/.local/share/yuzu` from prior install. + +## Themeing (is that a word?) + +### Alacritty +TODO + +### ZSH +TODO + +### Sway +TODO diff --git a/provision/nixos/hosts/kestrel/configuration.nix b/provision/nixos/hosts/kestrel/configuration.nix index 5b9c8f36..08a2a3c5 100644 --- a/provision/nixos/hosts/kestrel/configuration.nix +++ b/provision/nixos/hosts/kestrel/configuration.nix @@ -33,6 +33,7 @@ # Set networking options networking.hostName = "kestrel"; networking.networkmanager.enable = true; + networking.firewall.checkReversePath = "loose"; # Set your time zone. time.timeZone = "America/Los_Angeles"; diff --git a/provision/nixos/flake.lock b/provision/nixos/hosts/kestrel/flake.lock similarity index 100% rename from provision/nixos/flake.lock rename to provision/nixos/hosts/kestrel/flake.lock diff --git a/provision/nixos/flake.nix b/provision/nixos/hosts/kestrel/flake.nix similarity index 83% rename from provision/nixos/flake.nix rename to provision/nixos/hosts/kestrel/flake.nix index 4b2d210a..56180992 100644 --- a/provision/nixos/flake.nix +++ b/provision/nixos/hosts/kestrel/flake.nix @@ -1,5 +1,5 @@ { - description = "A very basic flake"; + description = "Flake for kestrel configuration"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; @@ -24,14 +24,14 @@ inherit system; specialArgs = { inherit user; }; modules = [ - ./hosts/kestrel/configuration.nix - ./hosts/kestrel/hardware.nix + ./configuration.nix + ./hardware.nix home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; home-manager.useUserPackages = true; home-manager.extraSpecialArgs = { inherit user; }; home-manager.users.${user} = { - imports = [ ./hosts/kestrel/home-configuration.nix ]; + imports = [ ./home-configuration.nix ]; }; } ]; diff --git a/provision/nixos/hosts/kestrel/home-configuration.nix b/provision/nixos/hosts/kestrel/home-configuration.nix index c39bde6b..05e3b652 100644 --- a/provision/nixos/hosts/kestrel/home-configuration.nix +++ b/provision/nixos/hosts/kestrel/home-configuration.nix @@ -7,6 +7,7 @@ home.packages = with pkgs; [ chezmoi rbw + zk ]; home.stateVersion = "23.05"; diff --git a/provision/nixos/modules/desktop/sway.nix b/provision/nixos/modules/desktop/sway.nix index 6623a7b2..127c248d 100644 --- a/provision/nixos/modules/desktop/sway.nix +++ b/provision/nixos/modules/desktop/sway.nix @@ -49,6 +49,7 @@ in { fzf # From home config + networkmanagerapplet pcmanfm google-chrome firefox diff --git a/provision/nixos/readme.md b/provision/nixos/readme.md new file mode 100644 index 00000000..4d684b25 --- /dev/null +++ b/provision/nixos/readme.md @@ -0,0 +1,40 @@ +# Provision Nixos +> \*NixOS was a mistake.\* + +Set of configs files to setup NixOS. + +## Usage + +1. Install NixOS with this [guide](https://nixos.wiki/wiki/NixOS_Installation_Guide). + Use the following paritions and btrfs subvolumes: + + | Name | Type | Mount Point | Size | + |---------|-------|-------------|--------------| + | EFI | vfat | /boot | 512MB | + | root | btrfs | / | rest of disk | + | home | btrfs | /home | subvol | + | nix | btrfs | /nix | subvol | + | persist | btrfs | /persist | subvol | + | log | btrfs | /var/log | subvol | + +2. Run the following commands: + + ```bash + nix-shell -p vim git + git clone https://github.com/starr-dusT/dotfiles ~/.local/share/chezmoi + ``` + + Move the installer created hardware.nix to dotfiles. + + Copy `.chezmoidata.yaml.example` to `.chezmoidata.yaml` and edit with desired settings then run the following commands: + + ```bash + nixos-update # Assuming hostname is same as flake name + ``` + +Perform additional setup found in [additional-setup](additional-setup.md) + +## Update + +`nixos-update` command is aliased assuming the flake is named the same at the +hostname of the machine.