diff --git a/.dircolors b/.dircolors index 3d3c56f..65b7cec 100644 --- a/.dircolors +++ b/.dircolors @@ -544,4 +544,4 @@ TERM xterm-256color TERM xterm-88color TERM xterm-color TERM xterm-debian -TERM xterm-kitty \ No newline at end of file +TERM xterm-kitty diff --git a/.github/workflows/dotfiles-ci.yml b/.github/workflows/dotfiles-ci.yml index 970041e..96c3a18 100644 --- a/.github/workflows/dotfiles-ci.yml +++ b/.github/workflows/dotfiles-ci.yml @@ -1,4 +1,4 @@ -name: Dotfiles CI +name: CI on: push: @@ -8,70 +8,65 @@ on: workflow_dispatch: jobs: - lint: - name: Lint Dotfiles + pre-commit: + name: Pre-commit Checks runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Lint shell scripts - run: | - sudo apt-get update - sudo apt-get install -y shellcheck - find . -name '*.sh' -type f -print0 | xargs -0 shellcheck || true + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' - - name: Check YAML syntax + - name: Install pre-commit run: | - sudo apt-get install -y yamllint - find . -name '*.yml' -o -name '*.yaml' | xargs yamllint || true + python -m pip install --upgrade pip + pip install pre-commit + + - name: Run pre-commit hooks + run: pre-commit run --all-files - nix-build: - name: Nix Build + setup-and-build: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v26 + uses: cachix/install-nix-action@v25 with: - nix_path: nixpkgs=channel:nixos-unstable + extra_nix_config: | + experimental-features = nix-command flakes - - name: Build Nix configuration + - name: Build and apply Home Manager config + env: + NIXPKGS_ALLOW_UNFREE: "1" run: | - if [ -f "flake.nix" ]; then - nix build .#homeConfigurations.$(whoami).activationPackage --show-trace || echo "Nix build attempted" - else - echo "No flake.nix found, skipping Nix build" - fi - - home-manager-check: - name: Home Manager Configuration Check - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install Nix - uses: cachix/install-nix-action@v26 - with: - nix_path: nixpkgs=channel:nixos-unstable + echo "Checking Nix installation and flake support" + nix --version + grep -qxF 'experimental-features = nix-command flakes' ~/.config/nix/nix.conf || \ + echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf + echo "Running flake build (home-manager switch)" + nix run home-manager -- switch --flake ./home-manager#mynixos --impure -b backup - - name: Check Home Manager configuration + - name: Validate dotfile presence run: | - if [ -f "home.nix" ] || [ -f "flake.nix" ]; then - nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager - nix-channel --update - echo "Home Manager configuration found" - else - echo "No Home Manager configuration found, skipping" - fi + test -f ~/.config/nvim/init.lua || echo "Missing Neovim config" + test -f ~/.config/aerospace/aerospace.toml || echo "Missing aerospace config" + test -f ~/.config/wezterm/config.lua || echo "Missing Wezterm config" + test -f ~/.zshrc || echo "Missing Zsh config" + test -f ~/.gitconfig || echo "Missing Git config" + test -f ~/.tmux.conf || echo "Missing Tmux config" + + - name: Show Home Manager generations + run: home-manager generations || true validation: name: Validation Summary runs-on: ubuntu-latest - needs: [lint, nix-build, home-manager-check] + needs: [pre-commit, setup-and-build] steps: - name: All checks passed run: echo "All validation checks completed successfully!" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..f43e66e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: check-yaml + - id: check-toml + - id: end-of-file-fixer + - id: check-json + - id: trailing-whitespace + - id: mixed-line-ending diff --git a/.zshrc b/.zshrc index 0b62fd3..82fbcc7 100644 --- a/.zshrc +++ b/.zshrc @@ -107,7 +107,7 @@ for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do done ####################################################### -# Nix +# Nix ####################################################### export NIX_CONF_DIR=$HOME/.config/nix diff --git a/Makefile b/Makefile index 2da5c6a..79d84bc 100644 --- a/Makefile +++ b/Makefile @@ -23,4 +23,3 @@ build: exit 1; \ } NIXPKGS_ALLOW_UNFREE=1 nix run home-manager -- switch --flake ./home-manager#mynixos --impure -b backup - diff --git a/README.md b/README.md index 370925c..207ac97 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,18 @@ dotfiles -My Dotfiles for git, vim/nvim, zsh and more. +My Dotfiles for git, vim/nvim, zsh and more. ### Steps to setup these dotfiles on your machine 1. Clone this repo in $HOME/dotfiles (~/dotfiles) directory ``` # if SSH has been added for the machine - git clone git@github.com:aightmunam/dotfiles.git - + git clone git@github.com:aightmunam/dotfiles.git + git clone https://github.com/aightmunam/dotfiles.git ``` #### Using Nix home-manager: 2. Navigate into dotfiles/nix directory ``` make setup -make build +make build ``` - diff --git a/git/.gitconfig b/git/.gitconfig index 1aab206..dc20293 100644 --- a/git/.gitconfig +++ b/git/.gitconfig @@ -2,7 +2,7 @@ path = ~/.gitconfig.local [user] name = Munam Mubashir - email = 38868658+aightmunam@users.noreply.github.com + email = 38868658+aightmunam@users.noreply.github.com [status] relativePaths = true [pull] @@ -70,4 +70,3 @@ current = yellow reverse local = yellow remote = green - diff --git a/git/.gitignore_global b/git/.gitignore_global index 8a6369f..5e0f4ad 100644 --- a/git/.gitignore_global +++ b/git/.gitignore_global @@ -36,4 +36,3 @@ pyrightconfig.json # zed ide specific (allows adding venv/python path) Icon? ehthumbs.db Thumbs.db - diff --git a/home-manager/flake.nix b/home-manager/flake.nix index b93c2f8..7852e34 100644 --- a/home-manager/flake.nix +++ b/home-manager/flake.nix @@ -9,7 +9,7 @@ }; outputs = inputs: let - username = builtins.getEnv "USER"; + username = builtins.getEnv "USER"; flakeContext = { inherit inputs username; }; diff --git a/nvim/.stylua.toml b/nvim/.stylua.toml index 9796293..533dda7 100644 --- a/nvim/.stylua.toml +++ b/nvim/.stylua.toml @@ -4,4 +4,3 @@ indent_type = "Spaces" indent_width = 2 quote_style = "ForceSingle" call_parentheses = "None" - diff --git a/tmux/.tmux.conf b/tmux/.tmux.conf index 44cc3c6..9b75344 100644 --- a/tmux/.tmux.conf +++ b/tmux/.tmux.conf @@ -92,4 +92,3 @@ set -g @plugin 'christoomey/vim-tmux-navigator' set -g @plugin 'vaaleyard/tmux-dotbar' set -g @tmux-dotbar-position bottom run '~/.tmux/plugins/tpm/tpm' - diff --git a/vim/autoload/.gitignore b/vim/autoload/.gitignore index 5e9d0c4..0d675bb 100644 --- a/vim/autoload/.gitignore +++ b/vim/autoload/.gitignore @@ -2,4 +2,4 @@ * # except this file -!.gitignore \ No newline at end of file +!.gitignore diff --git a/vim/colors/silverwind.vim b/vim/colors/silverwind.vim index 6cf8dd6..e6d002f 100644 --- a/vim/colors/silverwind.vim +++ b/vim/colors/silverwind.vim @@ -55,4 +55,4 @@ highlight mailEmail ctermfg=107 cterm=underline highlight SpellBad ctermfg=160 ctermbg=NONE cterm=underline highlight SpellRare ctermfg=168 ctermbg=NONE cterm=underline highlight SpellCap ctermfg=189 ctermbg=NONE cterm=underline -highlight MatchParen ctermfg=15 ctermbg=23 \ No newline at end of file +highlight MatchParen ctermfg=15 ctermbg=23 diff --git a/vim/plugged/.gitignore b/vim/plugged/.gitignore index 5e9d0c4..0d675bb 100644 --- a/vim/plugged/.gitignore +++ b/vim/plugged/.gitignore @@ -2,4 +2,4 @@ * # except this file -!.gitignore \ No newline at end of file +!.gitignore