mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-06 22:30:13 +00:00
Compare commits
1 Commits
204621a0ba
...
nixosmodul
Author | SHA1 | Date | |
---|---|---|---|
b0b9827a2e |
166
.github/workflows/arrow-aws.yml
vendored
166
.github/workflows/arrow-aws.yml
vendored
@ -1,166 +0,0 @@
|
|||||||
name: Arrow (AWS)
|
|
||||||
|
|
||||||
run-name: Arrow (AWS) - ${{ inputs.rebuild && 'Rebuild and ' || '' }}${{ inputs.action == 'create' && 'Create' || ( inputs.action == 'destroy' && 'Destroy' || 'No Action' ) }}
|
|
||||||
|
|
||||||
env:
|
|
||||||
TERRAFORM_DIRECTORY: hosts/arrow/aws
|
|
||||||
DEPLOY_IDENTITY_BASE64: ${{ secrets.DEPLOY_IDENTITY_BASE64 }}
|
|
||||||
ARROW_IDENTITY_BASE64: ${{ secrets.ARROW_IDENTITY_BASE64 }}
|
|
||||||
ZONE_NAME: masu.rs
|
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
||||||
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
rebuild:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
action:
|
|
||||||
type: choice
|
|
||||||
required: true
|
|
||||||
default: create
|
|
||||||
options:
|
|
||||||
- create
|
|
||||||
- destroy
|
|
||||||
- nothing
|
|
||||||
size:
|
|
||||||
type: choice
|
|
||||||
required: false
|
|
||||||
options:
|
|
||||||
- t3a.small # 2 GB RAM / $10
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
id-token: write
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-deploy:
|
|
||||||
name: Build and Deploy
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repo Code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Free Disk Space (Ubuntu)
|
|
||||||
if: inputs.rebuild && inputs.action != 'destroy'
|
|
||||||
uses: jlumbroso/free-disk-space@main
|
|
||||||
with:
|
|
||||||
tool-cache: true
|
|
||||||
|
|
||||||
# Enable access to KVM, required to build an image
|
|
||||||
- name: Enable KVM group perms
|
|
||||||
if: inputs.rebuild && inputs.action != 'destroy'
|
|
||||||
run: |
|
|
||||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
|
||||||
sudo udevadm control --reload-rules
|
|
||||||
sudo udevadm trigger --name-match=kvm
|
|
||||||
|
|
||||||
# Login to AWS
|
|
||||||
- name: AWS Assume Role
|
|
||||||
uses: aws-actions/configure-aws-credentials@v4
|
|
||||||
with:
|
|
||||||
role-to-assume: arn:aws:iam::286370965832:role/github_actions_admin
|
|
||||||
aws-region: us-east-1
|
|
||||||
|
|
||||||
# Install Nix
|
|
||||||
- name: Install Nix
|
|
||||||
if: inputs.rebuild && inputs.action != 'destroy'
|
|
||||||
uses: cachix/install-nix-action@v20
|
|
||||||
|
|
||||||
# Build the image
|
|
||||||
- name: Build Image
|
|
||||||
if: inputs.rebuild && inputs.action != 'destroy'
|
|
||||||
run: nix build .#arrow-aws
|
|
||||||
|
|
||||||
- name: Upload Image to S3
|
|
||||||
if: inputs.rebuild && inputs.action != 'destroy'
|
|
||||||
run: |
|
|
||||||
aws s3 cp \
|
|
||||||
result/nixos-amazon-image-*.vhd \
|
|
||||||
s3://${{ secrets.IMAGES_BUCKET }}/arrow.vhd \
|
|
||||||
|
|
||||||
# Installs the Terraform binary and some other accessory functions.
|
|
||||||
- name: Setup Terraform
|
|
||||||
uses: hashicorp/setup-terraform@v2
|
|
||||||
|
|
||||||
# Checks whether Terraform is formatted properly. If this fails, you
|
|
||||||
# should install the pre-commit hook.
|
|
||||||
- name: Check Formatting
|
|
||||||
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
|
||||||
run: |
|
|
||||||
terraform fmt -no-color -check -diff -recursive
|
|
||||||
|
|
||||||
# Connects to remote state backend and download providers.
|
|
||||||
- name: Terraform Init
|
|
||||||
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
|
||||||
run: |
|
|
||||||
terraform init \
|
|
||||||
-backend-config="bucket=${{ secrets.TERRAFORM_STATE_BUCKET }}" \
|
|
||||||
-backend-config="key=arrow.tfstate"
|
|
||||||
|
|
||||||
# Deploys infrastructure or changes to infrastructure.
|
|
||||||
- name: Terraform Apply
|
|
||||||
if: inputs.action == 'create'
|
|
||||||
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
|
||||||
env:
|
|
||||||
TF_VAR_ec2_size: ${{ inputs.size }}
|
|
||||||
TF_VAR_images_bucket: ${{ secrets.IMAGES_BUCKET }}
|
|
||||||
run: |
|
|
||||||
terraform apply \
|
|
||||||
-auto-approve \
|
|
||||||
-input=false
|
|
||||||
|
|
||||||
# Removes infrastructure.
|
|
||||||
- name: Terraform Destroy
|
|
||||||
if: inputs.action == 'destroy'
|
|
||||||
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
|
||||||
env:
|
|
||||||
TF_VAR_ec2_size: ${{ inputs.size }}
|
|
||||||
TF_VAR_images_bucket: ${{ secrets.IMAGES_BUCKET }}
|
|
||||||
run: |
|
|
||||||
terraform destroy \
|
|
||||||
-auto-approve \
|
|
||||||
-input=false
|
|
||||||
|
|
||||||
- name: Get Host IP
|
|
||||||
if: inputs.action == 'create'
|
|
||||||
id: host
|
|
||||||
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
|
||||||
run: terraform output -raw host_ip
|
|
||||||
|
|
||||||
- name: Wait on SSH
|
|
||||||
if: inputs.action == 'create'
|
|
||||||
run: |
|
|
||||||
for i in $(seq 1 15); do
|
|
||||||
if $(nc -z -w 3 ${{ steps.host.outputs.stdout }} 22); then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
sleep 10
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Write Identity Keys to Files
|
|
||||||
if: inputs.action == 'create'
|
|
||||||
run: |
|
|
||||||
echo "${{ env.DEPLOY_IDENTITY_BASE64 }}" | base64 -d > deploy_ed25519
|
|
||||||
chmod 0600 deploy_ed25519
|
|
||||||
echo "${{ env.ARROW_IDENTITY_BASE64 }}" | base64 -d > arrow_ed25519
|
|
||||||
chmod 0600 arrow_ed25519
|
|
||||||
|
|
||||||
- name: Copy Identity File to Host
|
|
||||||
if: inputs.action == 'create'
|
|
||||||
run: |
|
|
||||||
ssh -i deploy_ed25519 -o StrictHostKeyChecking=accept-new noah@${{ steps.host.outputs.stdout }} 'mkdir -pv .ssh'
|
|
||||||
scp -i deploy_ed25519 arrow_ed25519 noah@${{ steps.host.outputs.stdout }}:~/.ssh/id_ed25519
|
|
||||||
|
|
||||||
- name: Wipe Records
|
|
||||||
if: ${{ inputs.action == 'destroy' }}
|
|
||||||
run: |
|
|
||||||
RECORD_ID=$(curl --request GET \
|
|
||||||
--url https://api.cloudflare.com/client/v4/zones/${{ env.CLOUDFLARE_ZONE_ID }}/dns_records \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--header "Authorization: Bearer ${{ env.CLOUDFLARE_API_TOKEN }}" | jq -r '.result[] | select(.name == "n8n2.${{ env.ZONE_NAME }}") | .id')
|
|
||||||
curl --request DELETE \
|
|
||||||
--url https://api.cloudflare.com/client/v4/zones/${{ env.CLOUDFLARE_ZONE_ID }}/dns_records/${RECORD_ID} \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--header "Authorization: Bearer ${{ env.CLOUDFLARE_API_TOKEN }}"
|
|
154
.github/workflows/arrow.yml
vendored
154
.github/workflows/arrow.yml
vendored
@ -1,154 +0,0 @@
|
|||||||
name: Arrow
|
|
||||||
|
|
||||||
run-name: Arrow - ${{ inputs.rebuild && 'Rebuild and ' || '' }}${{ inputs.action == 'create' && 'Create' || ( inputs.action == 'destroy' && 'Destroy' || 'No Action' ) }}
|
|
||||||
|
|
||||||
env:
|
|
||||||
TERRAFORM_DIRECTORY: hosts/arrow/vultr
|
|
||||||
DEPLOY_IDENTITY_BASE64: ${{ secrets.DEPLOY_IDENTITY_BASE64 }}
|
|
||||||
ARROW_IDENTITY_BASE64: ${{ secrets.ARROW_IDENTITY_BASE64 }}
|
|
||||||
CLOUDFLARE_R2_ENDPOINT: "${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com"
|
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_R2_ACCESS_KEY }}
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_R2_SECRET_KEY }}
|
|
||||||
AWS_DEFAULT_REGION: auto
|
|
||||||
AWS_ENDPOINT_URL_S3: "https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com"
|
|
||||||
TF_VAR_vultr_api_key: ${{ secrets.VULTR_API_KEY }}
|
|
||||||
ZONE_NAME: masu.rs
|
|
||||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
||||||
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
rebuild:
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
action:
|
|
||||||
type: choice
|
|
||||||
required: true
|
|
||||||
default: create
|
|
||||||
options:
|
|
||||||
- create
|
|
||||||
- destroy
|
|
||||||
- nothing
|
|
||||||
plan:
|
|
||||||
type: choice
|
|
||||||
required: false
|
|
||||||
options:
|
|
||||||
- vc2-1c-1gb # 25 GB / $5
|
|
||||||
- vc2-1c-2gb # 55 GB / $10 (default)
|
|
||||||
- vc2-2c-2gb # 65 GB / $15
|
|
||||||
- vc2-2c-4gb # 80 GB / $20
|
|
||||||
- vc2-4c-8gb # 160 GB / $40
|
|
||||||
- vc2-6c-16gb # 320 GB / $80
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-deploy:
|
|
||||||
name: Build and Deploy
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repo Code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# Enable access to KVM, required to build an image
|
|
||||||
- name: Enable KVM group perms
|
|
||||||
if: inputs.rebuild && inputs.action != 'destroy'
|
|
||||||
run: |
|
|
||||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
|
||||||
sudo udevadm control --reload-rules
|
|
||||||
sudo udevadm trigger --name-match=kvm
|
|
||||||
|
|
||||||
# Install Nix
|
|
||||||
- name: Install Nix
|
|
||||||
if: inputs.rebuild && inputs.action != 'destroy'
|
|
||||||
uses: cachix/install-nix-action@v17
|
|
||||||
|
|
||||||
# Build the image
|
|
||||||
- name: Build Image
|
|
||||||
if: inputs.rebuild && inputs.action != 'destroy'
|
|
||||||
run: nix build .#arrow
|
|
||||||
|
|
||||||
- name: Upload Image to S3
|
|
||||||
if: inputs.rebuild && inputs.action != 'destroy'
|
|
||||||
run: |
|
|
||||||
aws s3 cp \
|
|
||||||
result/iso/nixos.iso \
|
|
||||||
s3://noahmasur-arrow-images/arrow.iso \
|
|
||||||
--endpoint-url "https://${{ env.CLOUDFLARE_R2_ENDPOINT }}"
|
|
||||||
|
|
||||||
# Installs the Terraform binary and some other accessory functions.
|
|
||||||
- name: Setup Terraform
|
|
||||||
uses: hashicorp/setup-terraform@v2
|
|
||||||
|
|
||||||
# Checks whether Terraform is formatted properly. If this fails, you
|
|
||||||
# should install the pre-commit hook.
|
|
||||||
- name: Check Formatting
|
|
||||||
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
|
||||||
run: |
|
|
||||||
terraform fmt -no-color -check -diff -recursive
|
|
||||||
|
|
||||||
# Connects to remote state backend and download providers.
|
|
||||||
- name: Terraform Init
|
|
||||||
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
|
||||||
run: terraform init
|
|
||||||
|
|
||||||
# Deploys infrastructure or changes to infrastructure.
|
|
||||||
- name: Terraform Apply
|
|
||||||
if: inputs.action == 'create'
|
|
||||||
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
|
||||||
env:
|
|
||||||
TF_VAR_vultr_plan: ${{ inputs.plan }}
|
|
||||||
run: |
|
|
||||||
terraform apply \
|
|
||||||
-auto-approve \
|
|
||||||
-input=false
|
|
||||||
|
|
||||||
# Removes infrastructure.
|
|
||||||
- name: Terraform Destroy
|
|
||||||
if: inputs.action == 'destroy'
|
|
||||||
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
|
||||||
run: |
|
|
||||||
terraform destroy \
|
|
||||||
-auto-approve \
|
|
||||||
-input=false
|
|
||||||
|
|
||||||
- name: Get Host IP
|
|
||||||
if: inputs.action == 'create'
|
|
||||||
id: host
|
|
||||||
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
|
||||||
run: terraform output -raw host_ip
|
|
||||||
|
|
||||||
- name: Wait on SSH
|
|
||||||
if: inputs.action == 'create'
|
|
||||||
run: |
|
|
||||||
for i in $(seq 1 15); do
|
|
||||||
if $(nc -z -w 3 ${{ steps.host.outputs.stdout }} 22); then
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
sleep 10
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Write Identity Keys to Files
|
|
||||||
if: inputs.action == 'create'
|
|
||||||
run: |
|
|
||||||
echo "${{ env.DEPLOY_IDENTITY_BASE64 }}" | base64 -d > deploy_ed25519
|
|
||||||
chmod 0600 deploy_ed25519
|
|
||||||
echo "${{ env.ARROW_IDENTITY_BASE64 }}" | base64 -d > arrow_ed25519
|
|
||||||
chmod 0600 arrow_ed25519
|
|
||||||
|
|
||||||
- name: Copy Identity File to Host
|
|
||||||
if: inputs.action == 'create'
|
|
||||||
run: |
|
|
||||||
ssh -i deploy_ed25519 -o StrictHostKeyChecking=accept-new noah@${{ steps.host.outputs.stdout }} 'mkdir -pv .ssh'
|
|
||||||
scp -i deploy_ed25519 arrow_ed25519 noah@${{ steps.host.outputs.stdout }}:~/.ssh/id_ed25519
|
|
||||||
|
|
||||||
- name: Wipe Records
|
|
||||||
if: ${{ inputs.action == 'destroy' }}
|
|
||||||
run: |
|
|
||||||
RECORD_ID=$(curl --request GET \
|
|
||||||
--url https://api.cloudflare.com/client/v4/zones/${{ env.CLOUDFLARE_ZONE_ID }}/dns_records \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--header "Authorization: Bearer ${{ env.CLOUDFLARE_API_TOKEN }}" | jq -r '.result[] | select(.name == "n8n2.${{ env.ZONE_NAME }}") | .id')
|
|
||||||
curl --request DELETE \
|
|
||||||
--url https://api.cloudflare.com/client/v4/zones/${{ env.CLOUDFLARE_ZONE_ID }}/dns_records/${RECORD_ID} \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--header "Authorization: Bearer ${{ env.CLOUDFLARE_API_TOKEN }}"
|
|
20
.github/workflows/check.yml
vendored
20
.github/workflows/check.yml
vendored
@ -1,20 +0,0 @@
|
|||||||
name: Check Build
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # allows manual triggering
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check:
|
|
||||||
name: Check
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Install Nix
|
|
||||||
uses: DeterminateSystems/nix-installer-action@v4
|
|
||||||
- name: Check Nixpkgs Inputs
|
|
||||||
uses: DeterminateSystems/flake-checker-action@v5
|
|
||||||
- name: Add Nix Cache
|
|
||||||
uses: DeterminateSystems/magic-nix-cache-action@v2
|
|
||||||
- name: Check the Flake
|
|
||||||
run: nix flake check
|
|
69
.github/workflows/update.yml
vendored
69
.github/workflows/update.yml
vendored
@ -1,69 +0,0 @@
|
|||||||
name: Update Flake
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # allows manual triggering
|
|
||||||
schedule:
|
|
||||||
- cron: '33 3 * * 0' # runs weekly on Sunday at 03:33
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
checks: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lockfile:
|
|
||||||
name: Lockfile
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
- name: Install Nix
|
|
||||||
uses: DeterminateSystems/nix-installer-action@v4
|
|
||||||
- name: Check Nixpkgs Inputs
|
|
||||||
uses: DeterminateSystems/flake-checker-action@v5
|
|
||||||
- name: Add Nix Cache
|
|
||||||
uses: DeterminateSystems/magic-nix-cache-action@v2
|
|
||||||
- name: Update flake.lock
|
|
||||||
uses: DeterminateSystems/update-flake-lock@v19
|
|
||||||
id: update
|
|
||||||
with:
|
|
||||||
pr-title: "Update flake.lock" # Title of PR to be created
|
|
||||||
pr-labels: | # Labels to be set on the PR
|
|
||||||
dependencies
|
|
||||||
automated
|
|
||||||
pr-body: |
|
|
||||||
Automated changes by the [update-flake-lock](https://github.com/DeterminateSystems/update-flake-lock) GitHub Action.
|
|
||||||
|
|
||||||
```
|
|
||||||
{{ env.GIT_COMMIT_MESSAGE }}
|
|
||||||
```
|
|
||||||
- name: Check the Flake
|
|
||||||
id: check
|
|
||||||
run: nix flake check
|
|
||||||
- name: Update Check Status
|
|
||||||
uses: LouisBrunner/checks-action@v1.6.1
|
|
||||||
if: always()
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
name: Update Flake
|
|
||||||
conclusion: ${{ job.status }}
|
|
||||||
output: |
|
|
||||||
{"summary":"${{ steps.check.outputs.stdout }}"}
|
|
||||||
- name: Enable Pull Request Automerge
|
|
||||||
if: success()
|
|
||||||
run: |
|
|
||||||
gh pr merge \
|
|
||||||
--rebase \
|
|
||||||
--auto \
|
|
||||||
${{ steps.update.outputs.pull-request-number }}
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
- name: Close Pull Request If Failed
|
|
||||||
if: failure()
|
|
||||||
run: |
|
|
||||||
gh pr close \
|
|
||||||
--comment "Auto-closing pull request" \
|
|
||||||
--delete-branch \
|
|
||||||
${{ steps.update.outputs.pull-request-number }}
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,7 +1,6 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
*.bak
|
*.bak
|
||||||
*.db
|
*.db
|
||||||
*.qcow2
|
|
||||||
**/.direnv/**
|
**/.direnv/**
|
||||||
result
|
result
|
||||||
private/**
|
private/**
|
||||||
|
22
README.md
22
README.md
@ -25,7 +25,7 @@ configuration may be difficult to translate to a non-Nix system.
|
|||||||
| Dotfiles | [Home-Manager](https://github.com/nix-community/home-manager) | [Link](./modules/common) |
|
| Dotfiles | [Home-Manager](https://github.com/nix-community/home-manager) | [Link](./modules/common) |
|
||||||
| Terminal | [Kitty](https://sw.kovidgoyal.net/kitty/) | [Link](./modules/common/applications/kitty.nix) |
|
| Terminal | [Kitty](https://sw.kovidgoyal.net/kitty/) | [Link](./modules/common/applications/kitty.nix) |
|
||||||
| Shell | [Fish](https://fishshell.com/) | [Link](./modules/common/shell/fish) |
|
| Shell | [Fish](https://fishshell.com/) | [Link](./modules/common/shell/fish) |
|
||||||
| Shell Prompt | [Starship](https://starship.rs/) | [Link](./modules/common/shell/starship.nix) |
|
| Shell Prompt | [Starship](https://starship.rs/) | [Link](./modules/common/shell/starhip.nix) |
|
||||||
| Colorscheme | [Gruvbox](https://github.com/morhetz/gruvbox) | [Link](./colorscheme/gruvbox/default.nix) |
|
| Colorscheme | [Gruvbox](https://github.com/morhetz/gruvbox) | [Link](./colorscheme/gruvbox/default.nix) |
|
||||||
| Wallpaper | [Road](https://gitlab.com/exorcist365/wallpapers/-/blob/master/gruvbox/road.jpg) | [Link](./hosts/tempest/default.nix) |
|
| Wallpaper | [Road](https://gitlab.com/exorcist365/wallpapers/-/blob/master/gruvbox/road.jpg) | [Link](./hosts/tempest/default.nix) |
|
||||||
| Text Editor | [Neovim](https://neovim.io/) | [Link](./modules/common/neovim/config) |
|
| Text Editor | [Neovim](https://neovim.io/) | [Link](./modules/common/neovim/config) |
|
||||||
@ -41,26 +41,6 @@ configuration may be difficult to translate to a non-Nix system.
|
|||||||
| --- | --- | --- |
|
| --- | --- | --- |
|
||||||
| Keybinds | [Hammerspoon](https://www.hammerspoon.org/) | [Link](./modules/darwin/hammerspoon) |
|
| Keybinds | [Hammerspoon](https://www.hammerspoon.org/) | [Link](./modules/darwin/hammerspoon) |
|
||||||
|
|
||||||
# Diagram
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Unique Configurations
|
|
||||||
|
|
||||||
This repo contains a few more elaborate elements of configuration.
|
|
||||||
|
|
||||||
- [Neovim config](./modules/common/neovim/default.nix) generated with Nix2Vim
|
|
||||||
and source-controlled plugins, differing based on installed LSPs, for example.
|
|
||||||
- [Caddy JSON](./modules/nixos/services/caddy.nix) file (routes, etc.) based
|
|
||||||
dynamically on enabled services rendered with Nix.
|
|
||||||
- [Grafana config](./modules/nixos/services/grafana.nix) rendered with Nix.
|
|
||||||
- Custom [secrets deployment](./modules/nixos/services/secrets.nix) similar to
|
|
||||||
agenix.
|
|
||||||
- Base16 [colorschemes](./colorscheme/) applied to multiple applications,
|
|
||||||
including Firefox userChrome.
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Installation
|
# Installation
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
# Apps
|
|
||||||
|
|
||||||
These are all my miscellaneous utilies and scripts to accompany this project.
|
|
||||||
|
|
||||||
They can be run with:
|
|
||||||
|
|
||||||
```
|
|
||||||
nix run github:nmasur/dotfiles#appname
|
|
||||||
```
|
|
@ -1,5 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: rec {
|
||||||
rec {
|
|
||||||
|
|
||||||
# Show quick helper
|
# Show quick helper
|
||||||
default = import ./help.nix { inherit pkgs; };
|
default = import ./help.nix { inherit pkgs; };
|
||||||
@ -31,4 +30,5 @@ rec {
|
|||||||
# Run neovim as an app
|
# Run neovim as an app
|
||||||
neovim = import ./neovim.nix { inherit pkgs; };
|
neovim = import ./neovim.nix { inherit pkgs; };
|
||||||
nvim = neovim;
|
nvim = neovim;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
# nix run github:nmasur/dotfiles#encrypt-secret > private/mysecret.age
|
# nix run github:nmasur/dotfiles#encrypt-secret > private/mysecret.age
|
||||||
|
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = builtins.toString (
|
program = builtins.toString (pkgs.writeShellScript "encrypt-secret" ''
|
||||||
pkgs.writeShellScript "encrypt-secret" ''
|
printf "\nEnter the secret data to encrypt for all hosts...\n\n" 1>&2
|
||||||
printf "\nEnter the secret data to encrypt for all hosts...\n\n" 1>&2
|
read -p "Secret: " secret
|
||||||
read -p "Secret: " secret
|
printf "\nEncrypting...\n\n" 1>&2
|
||||||
printf "\nEncrypting...\n\n" 1>&2
|
tmpfile=$(mktemp)
|
||||||
tmpfile=$(mktemp)
|
echo "''${secret}" > ''${tmpfile}
|
||||||
echo "''${secret}" > ''${tmpfile}
|
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
|
||||||
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${builtins.toString ../misc/public-keys} $tmpfile
|
builtins.toString ../public-keys
|
||||||
rm $tmpfile
|
} $tmpfile
|
||||||
''
|
rm $tmpfile
|
||||||
);
|
'');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,41 +1,39 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
# This script will partition and format drives; use at your own risk!
|
# This script will partition and format drives; use at your own risk!
|
||||||
|
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = builtins.toString (
|
program = builtins.toString (pkgs.writeShellScript "format-root" ''
|
||||||
pkgs.writeShellScript "format-root" ''
|
set -e
|
||||||
set -e
|
|
||||||
|
|
||||||
DISK=$1
|
DISK=$1
|
||||||
|
|
||||||
if [ -z "''${DISK}" ]; then
|
if [ -z "''${DISK}" ]; then
|
||||||
${pkgs.gum}/bin/gum style --width 50 --margin "1 2" --padding "2 4" \
|
${pkgs.gum}/bin/gum style --width 50 --margin "1 2" --padding "2 4" \
|
||||||
--foreground "#fb4934" \
|
--foreground "#fb4934" \
|
||||||
"Missing required parameter." \
|
"Missing required parameter." \
|
||||||
"Usage: format-root -- <disk>" \
|
"Usage: format-root -- <disk>" \
|
||||||
"Flake example: nix run github:nmasur/dotfiles#format-root -- nvme0n1"
|
"Flake example: nix run github:nmasur/dotfiles#format-root -- nvme0n1"
|
||||||
echo "(exiting)"
|
echo "(exiting)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${pkgs.disko-packaged}/bin/disko \
|
${pkgs.disko-packaged}/bin/disko \
|
||||||
--mode create \
|
--mode create \
|
||||||
--dry-run \
|
--dry-run \
|
||||||
--flake "path:$(pwd)#root" \
|
--flake "path:$(pwd)#root" \
|
||||||
--arg disk \""/dev/''${DISK}"\"
|
--arg disk \""/dev/''${DISK}"\"
|
||||||
|
|
||||||
${pkgs.gum}/bin/gum confirm \
|
${pkgs.gum}/bin/gum confirm \
|
||||||
"This will ERASE ALL DATA on the disk /dev/''${DISK}. Are you sure you want to continue?" \
|
"This will ERASE ALL DATA on the disk /dev/''${DISK}. Are you sure you want to continue?" \
|
||||||
--default=false
|
--default=false
|
||||||
|
|
||||||
${pkgs.disko-packaged}/bin/disko \
|
${pkgs.disko-packaged}/bin/disko \
|
||||||
--mode create \
|
--mode create \
|
||||||
--flake "path:$(pwd)#root" \
|
--flake "path:$(pwd)#root" \
|
||||||
--arg disk "/dev/''${DISK}"
|
--arg disk "/dev/''${DISK}"
|
||||||
|
|
||||||
|
'');
|
||||||
|
|
||||||
''
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,23 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = builtins.toString (
|
program = builtins.toString (pkgs.writeShellScript "default" ''
|
||||||
pkgs.writeShellScript "default" ''
|
${pkgs.gum}/bin/gum style --margin "1 2" --padding "0 2" --foreground "15" --background "55" "Options"
|
||||||
${pkgs.gum}/bin/gum style --margin "1 2" --padding "0 2" --foreground "15" --background "55" "Options"
|
${pkgs.gum}/bin/gum format --type=template -- ' {{ Italic "Run with" }} {{ Color "15" "69" " nix run github:nmasur/dotfiles#" }}{{ Color "15" "62" "someoption" }}{{ Color "15" "69" " " }}.'
|
||||||
${pkgs.gum}/bin/gum format --type=template -- ' {{ Italic "Run with" }} {{ Color "15" "69" " nix run github:nmasur/dotfiles#" }}{{ Color "15" "62" "someoption" }}{{ Color "15" "69" " " }}.'
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
${pkgs.gum}/bin/gum format --type=template -- \
|
||||||
${pkgs.gum}/bin/gum format --type=template -- \
|
' • {{ Color "15" "57" " readme " }} {{ Italic "Documentation for this repository." }}' \
|
||||||
' • {{ Color "15" "57" " readme " }} {{ Italic "Documentation for this repository." }}' \
|
' • {{ Color "15" "57" " rebuild " }} {{ Italic "Switch to this configuration." }}' \
|
||||||
' • {{ Color "15" "57" " rebuild " }} {{ Italic "Switch to this configuration." }}' \
|
' • {{ Color "15" "57" " installer " }} {{ Italic "Format and install from nothing." }}' \
|
||||||
' • {{ Color "15" "57" " installer " }} {{ Italic "Format and install from nothing." }}' \
|
' • {{ Color "15" "57" " neovim " }} {{ Italic "Test out the Neovim package." }}' \
|
||||||
' • {{ Color "15" "57" " neovim " }} {{ Italic "Test out the Neovim package." }}' \
|
' • {{ Color "15" "57" " loadkey " }} {{ Italic "Load an ssh key for this machine using melt." }}' \
|
||||||
' • {{ Color "15" "57" " loadkey " }} {{ Italic "Load an ssh key for this machine using melt." }}' \
|
' • {{ Color "15" "57" " encrypt-secret " }} {{ Italic "Encrypt a secret for all machines." }}' \
|
||||||
' • {{ Color "15" "57" " encrypt-secret " }} {{ Italic "Encrypt a secret for all machines." }}' \
|
' • {{ Color "15" "57" " reencrypt-secrets " }} {{ Italic "Reencrypt all secrets when new machine is added." }}' \
|
||||||
' • {{ Color "15" "57" " reencrypt-secrets " }} {{ Italic "Reencrypt all secrets when new machine is added." }}' \
|
' • {{ Color "15" "57" " netdata " }} {{ Italic "Connect a machine to Netdata cloud." }}'
|
||||||
' • {{ Color "15" "57" " netdata " }} {{ Italic "Connect a machine to Netdata cloud." }}'
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
'');
|
||||||
''
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -1,50 +1,48 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
# Inspired by https://github.com/cleverca22/nix-tests/blob/master/kexec/justdoit.nix
|
# Inspired by https://github.com/cleverca22/nix-tests/blob/master/kexec/justdoit.nix
|
||||||
# This script will partition and format drives; use at your own risk!
|
# This script will partition and format drives; use at your own risk!
|
||||||
|
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = builtins.toString (
|
program = builtins.toString (pkgs.writeShellScript "installer" ''
|
||||||
pkgs.writeShellScript "installer" ''
|
set -e
|
||||||
set -e
|
|
||||||
|
|
||||||
DISK=$1
|
DISK=$1
|
||||||
FLAKE=$2
|
FLAKE=$2
|
||||||
PARTITION_PREFIX=""
|
PARTITION_PREFIX=""
|
||||||
|
|
||||||
if [ -z "$DISK" ] || [ -z "$FLAKE" ]; then
|
if [ -z "$DISK" ] || [ -z "$FLAKE" ]; then
|
||||||
${pkgs.gum}/bin/gum style --width 50 --margin "1 2" --padding "2 4" \
|
${pkgs.gum}/bin/gum style --width 50 --margin "1 2" --padding "2 4" \
|
||||||
--foreground "#fb4934" \
|
--foreground "#fb4934" \
|
||||||
"Missing required parameter." \
|
"Missing required parameter." \
|
||||||
"Usage: installer -- <disk> <host>" \
|
"Usage: installer -- <disk> <host>" \
|
||||||
"Example: installer -- nvme0n1 tempest" \
|
"Example: installer -- nvme0n1 desktop" \
|
||||||
"Flake example: nix run github:nmasur/dotfiles#installer -- nvme0n1 tempest"
|
"Flake example: nix run github:nmasur/dotfiles#installer -- nvme0n1 desktop"
|
||||||
echo "(exiting)"
|
echo "(exiting)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$DISK" in nvme*)
|
case "$DISK" in nvme*)
|
||||||
PARTITION_PREFIX="p"
|
PARTITION_PREFIX="p"
|
||||||
esac
|
esac
|
||||||
|
|
||||||
${pkgs.gum}/bin/gum confirm \
|
${pkgs.gum}/bin/gum confirm \
|
||||||
"This will ERASE ALL DATA on the disk /dev/''${DISK}. Are you sure you want to continue?" \
|
"This will ERASE ALL DATA on the disk /dev/''${DISK}. Are you sure you want to continue?" \
|
||||||
--default=false
|
--default=false
|
||||||
|
|
||||||
${pkgs.parted}/bin/parted /dev/''${DISK} -- mklabel gpt
|
${pkgs.parted}/bin/parted /dev/''${DISK} -- mklabel gpt
|
||||||
${pkgs.parted}/bin/parted /dev/''${DISK} -- mkpart primary 512MiB 100%
|
${pkgs.parted}/bin/parted /dev/''${DISK} -- mkpart primary 512MiB 100%
|
||||||
${pkgs.parted}/bin/parted /dev/''${DISK} -- mkpart ESP fat32 1MiB 512MiB
|
${pkgs.parted}/bin/parted /dev/''${DISK} -- mkpart ESP fat32 1MiB 512MiB
|
||||||
${pkgs.parted}/bin/parted /dev/''${DISK} -- set 3 esp on
|
${pkgs.parted}/bin/parted /dev/''${DISK} -- set 3 esp on
|
||||||
mkfs.ext4 -L nixos /dev/''${DISK}''${PARTITION_PREFIX}1
|
mkfs.ext4 -L nixos /dev/''${DISK}''${PARTITION_PREFIX}1
|
||||||
mkfs.fat -F 32 -n boot /dev/''${DISK}''${PARTITION_PREFIX}2
|
mkfs.fat -F 32 -n boot /dev/''${DISK}''${PARTITION_PREFIX}2
|
||||||
|
|
||||||
mount /dev/disk/by-label/nixos /mnt
|
mount /dev/disk/by-label/nixos /mnt
|
||||||
mkdir --parents /mnt/boot
|
mkdir --parents /mnt/boot
|
||||||
mount /dev/disk/by-label/boot /mnt/boot
|
mount /dev/disk/by-label/boot /mnt/boot
|
||||||
|
|
||||||
|
${pkgs.nixos-install-tools}/bin/nixos-install --flake github:nmasur/dotfiles#''${FLAKE}
|
||||||
|
'');
|
||||||
|
|
||||||
${pkgs.nixos-install-tools}/bin/nixos-install --flake github:nmasur/dotfiles#''${FLAKE}
|
|
||||||
''
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,12 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = builtins.toString (
|
program = builtins.toString (pkgs.writeShellScript "loadkey" ''
|
||||||
pkgs.writeShellScript "loadkey" ''
|
printf "\nEnter the seed phrase for your SSH key...\n"
|
||||||
printf "\nEnter the seed phrase for your SSH key...\n"
|
printf "\nThen press ^D when complete.\n\n"
|
||||||
printf "\nThen press ^D when complete.\n\n"
|
${pkgs.melt}/bin/melt restore ~/.ssh/id_ed25519
|
||||||
mkdir -p ~/.ssh/
|
printf "\n\nContinuing activation.\n\n"
|
||||||
${pkgs.melt}/bin/melt restore ~/.ssh/id_ed25519
|
'');
|
||||||
printf "\n\nContinuing activation.\n\n"
|
|
||||||
''
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = "${
|
program = "${
|
||||||
(import ../modules/common/neovim/package {
|
(import ../modules/common/neovim/package {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
colors = (import ../colorscheme/nord).dark;
|
colors = (import ../colorscheme/nord).dark;
|
||||||
})
|
})
|
||||||
}/bin/nvim";
|
}/bin/nvim";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,19 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = builtins.toString (
|
program = builtins.toString (pkgs.writeShellScript "netdata-cloud" ''
|
||||||
pkgs.writeShellScript "netdata-cloud" ''
|
if [ "$EUID" -ne 0 ]; then
|
||||||
if [ "$EUID" -ne 0 ]; then
|
echo "Please run as root"
|
||||||
echo "Please run as root"
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
mkdir --parents --mode 0750 /var/lib/netdata/cloud.d
|
||||||
mkdir --parents --mode 0750 /var/lib/netdata/cloud.d
|
printf "\nEnter the claim token for netdata cloud...\n\n"
|
||||||
printf "\nEnter the claim token for netdata cloud...\n\n"
|
read -p "Token: " token
|
||||||
read -p "Token: " token
|
echo "''${token}" > /var/lib/netdata/cloud.d/token
|
||||||
echo "''${token}" > /var/lib/netdata/cloud.d/token
|
chown -R netdata:netdata /var/lib/netdata
|
||||||
chown -R netdata:netdata /var/lib/netdata
|
${pkgs.netdata}/bin/netdata-claim.sh -id=$(uuidgen)
|
||||||
${pkgs.netdata}/bin/netdata-claim.sh -id=$(uuidgen)
|
printf "\n\nNow restart netdata service.\n\n"
|
||||||
printf "\n\nNow restart netdata service.\n\n"
|
'');
|
||||||
''
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = builtins.toString (
|
program = builtins.toString (pkgs.writeShellScript "readme" ''
|
||||||
pkgs.writeShellScript "readme" ''
|
${pkgs.glow}/bin/glow --pager ${builtins.toString ../README.md}
|
||||||
${pkgs.glow}/bin/glow --pager ${builtins.toString ../README.md}
|
'');
|
||||||
''
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,15 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = builtins.toString (
|
program = builtins.toString (pkgs.writeShellScript "rebuild" ''
|
||||||
pkgs.writeShellScript "rebuild" ''
|
echo ${pkgs.system}
|
||||||
echo ${pkgs.system}
|
SYSTEM=${if pkgs.stdenv.isDarwin then "darwin" else "linux"}
|
||||||
SYSTEM=${if pkgs.stdenv.isDarwin then "darwin" else "linux"}
|
if [ "$SYSTEM" == "darwin" ]; then
|
||||||
if [ "$SYSTEM" == "darwin" ]; then
|
sudo darwin-rebuild switch --flake ${builtins.toString ../.}
|
||||||
sudo darwin-rebuild switch --flake ${builtins.toString ../.}
|
else
|
||||||
else
|
doas nixos-rebuild switch --flake ${builtins.toString ../.}
|
||||||
doas nixos-rebuild switch --flake ${builtins.toString ../.}
|
fi
|
||||||
fi
|
'');
|
||||||
''
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
# nix run github:nmasur/dotfiles#reencrypt-secrets ./private
|
# nix run github:nmasur/dotfiles#reencrypt-secrets ./private
|
||||||
|
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = builtins.toString (
|
program = builtins.toString (pkgs.writeShellScript "reencrypt-secrets" ''
|
||||||
pkgs.writeShellScript "reencrypt-secrets" ''
|
if [ $# -eq 0 ]; then
|
||||||
if [ $# -eq 0 ]; then
|
echo "Must provide directory to reencrypt."
|
||||||
echo "Must provide directory to reencrypt."
|
exit 1
|
||||||
exit 1
|
fi
|
||||||
fi
|
encrypted=$1
|
||||||
encrypted=$1
|
for encryptedfile in ''${1}/*; do
|
||||||
for encryptedfile in ''${1}/*; do
|
tmpfile=$(mktemp)
|
||||||
tmpfile=$(mktemp)
|
echo "Decrypting ''${encryptedfile}..."
|
||||||
echo "Decrypting ''${encryptedfile}..."
|
${pkgs.age}/bin/age --decrypt \
|
||||||
${pkgs.age}/bin/age --decrypt \
|
--identity ~/.ssh/id_ed25519 $encryptedfile > $tmpfile
|
||||||
--identity ~/.ssh/id_ed25519 $encryptedfile > $tmpfile
|
echo "Encrypting ''${encryptedfile}..."
|
||||||
echo "Encrypting ''${encryptedfile}..."
|
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
|
||||||
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${builtins.toString ../misc/public-keys} $tmpfile > $encryptedfile
|
builtins.toString ../public-keys
|
||||||
rm $tmpfile
|
} $tmpfile > $encryptedfile
|
||||||
done
|
rm $tmpfile
|
||||||
echo "Finished."
|
done
|
||||||
''
|
echo "Finished."
|
||||||
);
|
'');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
# Colorschemes
|
|
||||||
|
|
||||||
Color information for different themes is found here. The colors are sourced
|
|
||||||
and used with [base16](https://github.com/chriskempson/base16) format
|
|
||||||
consistently across the system.
|
|
@ -16,7 +16,9 @@
|
|||||||
base0B = "#dbbc7f"; # Strings, Inherited Class, Markup Code, Diff Inserted
|
base0B = "#dbbc7f"; # Strings, Inherited Class, Markup Code, Diff Inserted
|
||||||
base0C = "#e69875"; # Support, Regular Expressions, Escape Characters, ...
|
base0C = "#e69875"; # Support, Regular Expressions, Escape Characters, ...
|
||||||
base0D = "#a7c080"; # Functions, Methods, Attribute IDs, Headings
|
base0D = "#a7c080"; # Functions, Methods, Attribute IDs, Headings
|
||||||
base0E = "#e67e80"; # Keywords, Storage, Selector, Markup Italic, Diff Changed
|
base0E =
|
||||||
base0F = "#d699b6"; # Deprecated, Opening/Closing Embedded Language Tags, ...
|
"#e67e80"; # Keywords, Storage, Selector, Markup Italic, Diff Changed
|
||||||
|
base0F =
|
||||||
|
"#d699b6"; # Deprecated, Opening/Closing Embedded Language Tags, ...
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,8 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
name = "gruvbox-dark"; # Dark, Medium
|
name = "gruvbox-dark"; # Dark, Medium
|
||||||
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox), ElRastaOk (https://www.reddit.com/user/ElRastaOk)";
|
author =
|
||||||
|
"Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox), ElRastaOk (https://www.reddit.com/user/ElRastaOk)";
|
||||||
dark = {
|
dark = {
|
||||||
base00 = "#1D2122"; # ---- This is the change from normal gruvbox
|
base00 = "#1D2122"; # ---- This is the change from normal gruvbox
|
||||||
base01 = "#3c3836"; # ---
|
base01 = "#3c3836"; # ---
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
name = "gruvbox"; # Dark, Medium
|
name = "gruvbox"; # Dark, Medium
|
||||||
author = "Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
|
author =
|
||||||
|
"Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)";
|
||||||
dark = {
|
dark = {
|
||||||
base00 = "#282828"; # ----
|
base00 = "#282828"; # ----
|
||||||
base01 = "#3c3836"; # ---
|
base01 = "#3c3836"; # ---
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
# Disks
|
|
||||||
|
|
||||||
These are my [disko](https://github.com/nix-community/disko) configurations,
|
|
||||||
which allow me to save desired disk formatting layouts as a declarative file so
|
|
||||||
I don't have to remember how to format my disks later on.
|
|
@ -1,38 +1,41 @@
|
|||||||
{ disk, ... }:
|
{ disk, ... }: {
|
||||||
{
|
|
||||||
disk = {
|
disk = {
|
||||||
boot = {
|
boot = {
|
||||||
type = "disk";
|
type = "disk";
|
||||||
device = disk;
|
device = disk;
|
||||||
content = {
|
content = {
|
||||||
type = "gpt";
|
type = "table";
|
||||||
partitions = {
|
format = "gpt";
|
||||||
|
partitions = [
|
||||||
# Boot partition
|
# Boot partition
|
||||||
ESP = rec {
|
{
|
||||||
size = "512MiB";
|
name = "ESP";
|
||||||
type = "EF00";
|
start = "0";
|
||||||
label = "boot";
|
end = "512MiB";
|
||||||
device = "/dev/disk/by-label/${label}";
|
fs-type = "fat32";
|
||||||
|
bootable = true;
|
||||||
content = {
|
content = {
|
||||||
type = "filesystem";
|
type = "filesystem";
|
||||||
format = "vfat";
|
format = "vfat";
|
||||||
mountpoint = "/boot";
|
mountpoint = "/boot";
|
||||||
extraArgs = [ "-n ${label}" ];
|
extraArgs = [ "-n boot" ];
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
# Root partition ext4
|
# Root partition ext4
|
||||||
root = rec {
|
{
|
||||||
size = "100%";
|
name = "root";
|
||||||
label = "nixos";
|
start = "512MiB";
|
||||||
device = "/dev/disk/by-label/${label}";
|
end = "100%";
|
||||||
|
part-type = "primary";
|
||||||
|
bootable = true;
|
||||||
content = {
|
content = {
|
||||||
type = "filesystem";
|
type = "filesystem";
|
||||||
format = "ext4";
|
format = "ext4";
|
||||||
mountpoint = "/";
|
mountpoint = "/";
|
||||||
extraArgs = [ "-L ${label}" ];
|
extraArgs = [ "-L nixos" ];
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
};
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{ pool, disks, ... }:
|
{ pool, disks, ... }: {
|
||||||
{
|
|
||||||
disk = lib.genAttrs disks (disk: {
|
disk = lib.genAttrs disks (disk: {
|
||||||
"${disk}" = {
|
"${disk}" = {
|
||||||
type = "disk";
|
type = "disk";
|
||||||
@ -7,18 +6,16 @@
|
|||||||
content = {
|
content = {
|
||||||
type = "table";
|
type = "table";
|
||||||
format = "gpt";
|
format = "gpt";
|
||||||
partitions = [
|
partitions = [{
|
||||||
{
|
type = "partition";
|
||||||
type = "partition";
|
name = "zfs";
|
||||||
name = "zfs";
|
start = "128MiB";
|
||||||
start = "128MiB";
|
end = "100%";
|
||||||
end = "100%";
|
content = {
|
||||||
content = {
|
type = "zfs";
|
||||||
type = "zfs";
|
pool = pool;
|
||||||
pool = pool;
|
};
|
||||||
};
|
}];
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
# Documentation
|
|
||||||
|
|
||||||
Reference documents for some of the more complicated services and maintenance
|
|
||||||
tasks.
|
|
@ -49,25 +49,19 @@ move the `windows/alacritty.yml` file to
|
|||||||
To get started on a bare macOS installation, first install Nix:
|
To get started on a bare macOS installation, first install Nix:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
|
sh -c "$(curl -L https://nixos.org/nix/install)"
|
||||||
```
|
```
|
||||||
|
|
||||||
Launch a new shell. Then use Nix to switch to the macOS configuration:
|
Then use Nix to build nix-darwin:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
sudo rm /etc/bashrc
|
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
|
||||||
sudo rm /etc/nix/nix.conf
|
./result/bin/darwin-installer
|
||||||
export NIX_SSL_CERT_FILE="$HOME/Documents/t2-ca-bundle.pem"
|
|
||||||
nix \
|
|
||||||
--extra-experimental-features flakes \
|
|
||||||
--extra-experimental-features nix-command \
|
|
||||||
run nix-darwin -- switch \
|
|
||||||
--flake github:nmasur/dotfiles#lookingglass
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Once installed, you can continue to update the macOS configuration:
|
Then switch to the macOS configuration:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
darwin-rebuild switch --flake ~/dev/personal/dotfiles
|
darwin-rebuild switch --flake github:nmasur/dotfiles#lookingglass
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -1,82 +0,0 @@
|
|||||||
# Repairing Nextcloud
|
|
||||||
|
|
||||||
You can run the maintenance commands like this:
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo -u nextcloud nextcloud-occ maintenance:mode --on
|
|
||||||
sudo -u nextcloud nextcloud-occ maintenance:repair
|
|
||||||
sudo -u nextcloud nextcloud-occ maintenance:mode --off
|
|
||||||
```
|
|
||||||
|
|
||||||
## Rescan Files
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo -u nextcloud nextcloud-occ files:scan --all
|
|
||||||
```
|
|
||||||
|
|
||||||
## Converting from SQLite to MySQL (mariadb)
|
|
||||||
|
|
||||||
First: keep Nextcloud set to SQLite as its dbtype, and separately launch MySQL
|
|
||||||
as a service by copying the configuration found
|
|
||||||
[here](https://github.com/NixOS/nixpkgs/blob/nixos-unstable/nixos/modules/services/web-apps/nextcloud.nix).
|
|
||||||
|
|
||||||
No password is necessary, since the user-based auth works with UNIX sockets.
|
|
||||||
|
|
||||||
You can connect to the MySQL instance like this:
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo -u nextcloud mysql -S /run/mysqld/mysqld.sock
|
|
||||||
```
|
|
||||||
|
|
||||||
Create a blank database for Nextcloud:
|
|
||||||
|
|
||||||
```sql
|
|
||||||
create database nextcloud;
|
|
||||||
```
|
|
||||||
|
|
||||||
Now setup the [conversion](https://docs.nextcloud.com/server/17/admin_manual/configuration_database/db_conversion.html):
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo -u nextcloud nextcloud-occ db:convert-type mysql nextcloud localhost nextcloud
|
|
||||||
```
|
|
||||||
|
|
||||||
Ignore the password prompt. Proceed with the conversion.
|
|
||||||
|
|
||||||
Now `config.php` will be updated but the override config from NixOS will not
|
|
||||||
be. Now update your NixOS configuration:
|
|
||||||
|
|
||||||
- Remove the `mysql` service you created.
|
|
||||||
- Set `dbtype` to `mysql`.
|
|
||||||
- Set `database.createLocally` to `true`.
|
|
||||||
|
|
||||||
Rebuild your configuration.
|
|
||||||
|
|
||||||
Now, make sure to enable [4-byte
|
|
||||||
support](https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/mysql_4byte_support.html)
|
|
||||||
in the database.
|
|
||||||
|
|
||||||
## Backing Up MySQL Database
|
|
||||||
|
|
||||||
Use this mysqldump command:
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo -u nextcloud mysqldump -S /run/mysqld/mysqld.sock --default-character-set=utf8mb4 nextcloud > backup.sql
|
|
||||||
```
|
|
||||||
|
|
||||||
## Converting to Postgres
|
|
||||||
|
|
||||||
Same as MySQL, but run this command instead:
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo -u nextcloud nextcloud-occ db:convert-type pgsql nextcloud /run/postgresql/ nextcloud
|
|
||||||
```
|
|
||||||
|
|
||||||
Then set the `dbtype` to `pgsql`.
|
|
||||||
|
|
||||||
## Backing Up Postgres Database
|
|
||||||
|
|
||||||
Use this pg_dump command:
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo -u nextcloud pg_dump nextcloud > backup.sql
|
|
||||||
```
|
|
43
docs/restore-nextcloud.md
Normal file
43
docs/restore-nextcloud.md
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# Restoring Nextcloud From Backup
|
||||||
|
|
||||||
|
Install the `litestream` package.
|
||||||
|
|
||||||
|
```
|
||||||
|
nix-shell --run fish -p litestream
|
||||||
|
```
|
||||||
|
|
||||||
|
Set the S3 credentials:
|
||||||
|
|
||||||
|
```
|
||||||
|
set -x AWS_ACCESS_KEY_ID (read)
|
||||||
|
set -x AWS_SECRET_ACCESS_KEY (read)
|
||||||
|
```
|
||||||
|
|
||||||
|
Restore from S3:
|
||||||
|
|
||||||
|
```
|
||||||
|
litestream restore -o nextcloud.db s3://noahmasur-backup.s3.us-west-002.backblazeb2.com/nextcloud
|
||||||
|
```
|
||||||
|
|
||||||
|
Install Nextcloud. Then copy DB:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo rm /data/nextcloud/data/nextcloud.db*
|
||||||
|
sudo mv nextcloud.db /data/nextcloud/data/
|
||||||
|
sudo chown nextcloud:nextcloud /data/nextcloud/data/nextcloud.db
|
||||||
|
sudo chmod 770 /data/nextcloud/data/nextcloud.db
|
||||||
|
```
|
||||||
|
|
||||||
|
Restart Nextcloud:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo systemctl restart phpfpm-nextcloud.service
|
||||||
|
```
|
||||||
|
|
||||||
|
Adjust Permissions and Directories:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo mkdir /data/nextcloud/data/noah/files
|
||||||
|
sudo chown nextcloud:nextcloud /data/nextcloud/data/noah/files
|
||||||
|
```
|
||||||
|
|
45
docs/zfs.md
45
docs/zfs.md
@ -1,45 +0,0 @@
|
|||||||
# ZFS
|
|
||||||
|
|
||||||
Swan runs its root on ext4. The ZFS drives are managed imperatively (this
|
|
||||||
[disko configuration](../disks/zfs.nix) is an unused work-in-progress).
|
|
||||||
|
|
||||||
The basic ZFS settings are managed [here](../modules/nixos/hardware/zfs.nix).
|
|
||||||
|
|
||||||
## Creating a New Dataset
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo zfs create tank/mydataset
|
|
||||||
sudo zfs set compression=zstd tank/myzstddataset
|
|
||||||
sudo zfs set mountpoint=/data/mydataset tank/mydataset
|
|
||||||
```
|
|
||||||
|
|
||||||
## Maintenance
|
|
||||||
|
|
||||||
### Get Status
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo zpool status
|
|
||||||
```
|
|
||||||
|
|
||||||
### Replace Disk
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo zdb
|
|
||||||
sudo zpool status -g # Show by GUID
|
|
||||||
sudo zpool offline tank <GUID>
|
|
||||||
sudo zpool status
|
|
||||||
# Remove old disk, insert new disk
|
|
||||||
sudo zdb
|
|
||||||
sudo zpool replace tank <OLD GUID> /dev/disk/by-id/<NEW PATH>
|
|
||||||
sudo zpool status
|
|
||||||
```
|
|
||||||
|
|
||||||
## Initial Setup
|
|
||||||
|
|
||||||
```
|
|
||||||
sudo zpool create tank raidz1 sda sdb sdc
|
|
||||||
sudo zpool set ashift=12 tank
|
|
||||||
sudo zpool set autoexpand=on tank
|
|
||||||
sudo zpool set compression=on tank
|
|
||||||
```
|
|
||||||
|
|
557
flake.lock
generated
557
flake.lock
generated
@ -1,50 +1,35 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"baleia-nvim-src": {
|
"Comment-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1704551058,
|
"lastModified": 1681214440,
|
||||||
"narHash": "sha256-0NmiGzMFvL1awYOVtiaSd+O4sAR524x68xwWLgArlqs=",
|
"narHash": "sha256-48hy+hiaDJLlgWqC7IeZI3dT+VwWkRo4atQbyPxu/ys=",
|
||||||
"owner": "m00qek",
|
"owner": "numToStr",
|
||||||
"repo": "baleia.nvim",
|
"repo": "Comment.nvim",
|
||||||
"rev": "6d9cbdaca3a428bc7296f838fdfce3ad01ee7495",
|
"rev": "e51f2b142d88bb666dcaa77d93a07f4b419aca70",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "m00qek",
|
"owner": "numToStr",
|
||||||
"repo": "baleia.nvim",
|
"ref": "v0.8.0",
|
||||||
"type": "github"
|
"repo": "Comment.nvim",
|
||||||
}
|
|
||||||
},
|
|
||||||
"base16-nvim-src": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1716483968,
|
|
||||||
"narHash": "sha256-GRF/6AobXHamw8TZ3FjL7SI6ulcpwpcohsIuZeCSh2A=",
|
|
||||||
"owner": "RRethy",
|
|
||||||
"repo": "base16-nvim",
|
|
||||||
"rev": "6ac181b5733518040a33017dde654059cd771b7c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "RRethy",
|
|
||||||
"repo": "base16-nvim",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"bufferline-nvim-src": {
|
"bufferline-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716555412,
|
"lastModified": 1687763763,
|
||||||
"narHash": "sha256-8PCkY1zrlMrPGnQOb7MjqDXNlkeX46jrT4ScIL+MOwM=",
|
"narHash": "sha256-wbOeylzjjScQXkrDbBU2HtrOZrp2YUK+wQ2aOkgxmRQ=",
|
||||||
"owner": "akinsho",
|
"owner": "akinsho",
|
||||||
"repo": "bufferline.nvim",
|
"repo": "bufferline.nvim",
|
||||||
"rev": "99337f63f0a3c3ab9519f3d1da7618ca4f91cffe",
|
"rev": "bf2f6b7edd0abf6b0732f5e5c0a8f30e51611c75",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "akinsho",
|
"owner": "akinsho",
|
||||||
"ref": "v4.6.1",
|
"ref": "v4.2.0",
|
||||||
"repo": "bufferline.nvim",
|
"repo": "bufferline.nvim",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@ -52,11 +37,11 @@
|
|||||||
"cmp-nvim-lsp-src": {
|
"cmp-nvim-lsp-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715931395,
|
"lastModified": 1687494203,
|
||||||
"narHash": "sha256-CT1+Z4XJBVsl/RqvJeGmyitD6x7So0ylXvvef5jh7I8=",
|
"narHash": "sha256-mU0soCz79erJXMMqD/FyrJZ0mu2n6fE0deymPzQlxts=",
|
||||||
"owner": "hrsh7th",
|
"owner": "hrsh7th",
|
||||||
"repo": "cmp-nvim-lsp",
|
"repo": "cmp-nvim-lsp",
|
||||||
"rev": "39e2eda76828d88b773cc27a3f61d2ad782c922d",
|
"rev": "44b16d11215dce86f253ce0c30949813c0a90765",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -72,11 +57,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716511055,
|
"lastModified": 1687517837,
|
||||||
"narHash": "sha256-5Fe/DGgvMhPEMl9VdVxv3zvwRcwNDmW5eRJ0gk72w7U=",
|
"narHash": "sha256-Ea+JTy6NSf+wWIFrgC8gnOnyt01xwmtDEn2KecvaBkg=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "0bea8222f6e83247dd13b055d83e64bce02ee532",
|
"rev": "6460468e7a3e1290f132fee4170ebeaa127f6f32",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -93,11 +78,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716773194,
|
"lastModified": 1687598357,
|
||||||
"narHash": "sha256-rskkGmWlvYFb+CXedBiL8eWEuED0Es0XR4CkJ11RQKY=",
|
"narHash": "sha256-70ciIe8415oQnQypawaqocEaLJcI1XtkqRNmle8vsrg=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "10986091e47fb1180620b78438512b294b7e8f67",
|
"rev": "1e7098ee0448dc5d33df394d040f454cd42a809c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -106,23 +91,6 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"fidget-nvim-src": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1716093309,
|
|
||||||
"narHash": "sha256-Gpk/G0ByOAIE8uX4Xr94CvAjJBSJMEOwBuvrhmYYGsg=",
|
|
||||||
"owner": "j-hui",
|
|
||||||
"repo": "fidget.nvim",
|
|
||||||
"rev": "ef99df04a1c53a453602421bc0f756997edc8289",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "j-hui",
|
|
||||||
"ref": "v1.4.5",
|
|
||||||
"repo": "fidget.nvim",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"firefox-darwin": {
|
"firefox-darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
@ -130,11 +98,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716857077,
|
"lastModified": 1688605308,
|
||||||
"narHash": "sha256-IvdZLdbPqJFkIbcDjMCMbdhrHjhS6k0SZk9IvJAI/fI=",
|
"narHash": "sha256-B9suu7dcdX4a18loO5ul237gqIJ5/+TRuheLj8fJjwM=",
|
||||||
"owner": "bandithedoge",
|
"owner": "bandithedoge",
|
||||||
"repo": "nixpkgs-firefox-darwin",
|
"repo": "nixpkgs-firefox-darwin",
|
||||||
"rev": "539f092808e92ffbab69d8dc307f7db88d721a9c",
|
"rev": "78d28acf685e19d353b2ecb6c38eeb3fc624fc68",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -146,11 +114,11 @@
|
|||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1696426674,
|
"lastModified": 1673956053,
|
||||||
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
|
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
|
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -160,15 +128,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
"inputs": {
|
|
||||||
"systems": "systems"
|
|
||||||
},
|
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1705309234,
|
"lastModified": 1678901627,
|
||||||
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=",
|
"narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26",
|
"rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -179,14 +144,14 @@
|
|||||||
},
|
},
|
||||||
"flake-utils_2": {
|
"flake-utils_2": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"systems": "systems_2"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1710146030,
|
"lastModified": 1685518550,
|
||||||
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -195,19 +160,21 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hmts-nvim-src": {
|
"flake-utils_3": {
|
||||||
"flake": false,
|
"inputs": {
|
||||||
|
"systems": "systems_2"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715076655,
|
"lastModified": 1685518550,
|
||||||
"narHash": "sha256-vDTqJQzLyg0nmlC+CrLnPkYti1rPxmvRW8eQq/9Zg+M=",
|
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
|
||||||
"owner": "calops",
|
"owner": "numtide",
|
||||||
"repo": "hmts.nvim",
|
"repo": "flake-utils",
|
||||||
"rev": "19a91816c123173a4551a6a04f2882338f20db1d",
|
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "calops",
|
"owner": "numtide",
|
||||||
"repo": "hmts.nvim",
|
"repo": "flake-utils",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -218,11 +185,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716847642,
|
"lastModified": 1687627695,
|
||||||
"narHash": "sha256-rjEswRV0o23eBBils8lJXyIGha+l/VjV73IPg+ztxgk=",
|
"narHash": "sha256-6Pu7nWb52PRtUmihwuDNShDmsZiXgtXR0OARtH4DSik=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "10c7c219b7dae5795fb67f465a0d86cbe29f25fa",
|
"rev": "172d46d4b2677b32277d903bdf4cff77c2cc6477",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -232,87 +199,42 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"kitty-scrollback-nvim-src": {
|
"nil": {
|
||||||
"flake": false,
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-overlay": "rust-overlay"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716487246,
|
"lastModified": 1680544266,
|
||||||
"narHash": "sha256-yHyco+ftcpJAVWhwA8ItKa0IZgNJZjCQQjuyVG93xUs=",
|
"narHash": "sha256-d/TusDXmIo8IT5DNRA21lN+nOVSER8atIx9TJteR6LQ=",
|
||||||
"owner": "mikesmithgh",
|
"owner": "oxalica",
|
||||||
"repo": "kitty-scrollback.nvim",
|
"repo": "nil",
|
||||||
"rev": "08960ad9a96ff6ea6269157dbd4a8a499f7a4311",
|
"rev": "56a1fa87b98a9508920f4b0ab8fe36d5b54b2362",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "mikesmithgh",
|
"owner": "oxalica",
|
||||||
"repo": "kitty-scrollback.nvim",
|
"ref": "2023-04-03",
|
||||||
|
"repo": "nil",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nextcloud-cookbook": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1702545935,
|
|
||||||
"narHash": "sha256-19LN1nYJJ0RMWj6DrYPvHzocTyhMfYdpdhBFch3fpHE=",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/christianlupus-nextcloud/cookbook-releases/releases/download/v0.11.0/cookbook-0.11.0.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/christianlupus-nextcloud/cookbook-releases/releases/download/v0.11.0/cookbook-0.11.0.tar.gz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nextcloud-external": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1699624334,
|
|
||||||
"narHash": "sha256-RCL2RP5twRDLxI/KfAX6QLYQOzqZmSWsfrC5ZQIwTD4=",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nextcloud-releases/external/releases/download/v5.3.1/external-v5.3.1.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nextcloud-releases/external/releases/download/v5.3.1/external-v5.3.1.tar.gz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nextcloud-news": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1703426420,
|
|
||||||
"narHash": "sha256-AENBJH/bEob5JQvw4WEi864mdLYJ5Mqe78HJH6ceCpI=",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nextcloud/news/releases/download/25.0.0-alpha3/news.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nextcloud/news/releases/download/25.0.0-alpha3/news.tar.gz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nextcloud-snappymail": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1714909152,
|
|
||||||
"narHash": "sha256-CsAUnbA/9XiVuk96pOK+E++lp8BlJITtfExWcb9rqPk=",
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nmasur/snappymail-nextcloud/releases/download/v2.36.1/snappymail-2.36.1-nextcloud.tar.gz"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"type": "tarball",
|
|
||||||
"url": "https://github.com/nmasur/snappymail-nextcloud/releases/download/v2.36.1/snappymail-2.36.1-nextcloud.tar.gz"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nix2vim": {
|
"nix2vim": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils_2",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715598267,
|
"lastModified": 1685980282,
|
||||||
"narHash": "sha256-xriYT6Tu6THN0n3ZOVLy3C0x61OVQOe9U1XvLhg463M=",
|
"narHash": "sha256-uQyVaoqkiocA8bXKMfrgizuKmz0hUzHye5owFoUd2AQ=",
|
||||||
"owner": "gytis-ivaskevicius",
|
"owner": "gytis-ivaskevicius",
|
||||||
"repo": "nix2vim",
|
"repo": "nix2vim",
|
||||||
"rev": "fa1b1cbf6c17883143fcbbc840e5ecf6557af072",
|
"rev": "3836a348503ae27340c7f83f0bc7bcb907f3781d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -323,11 +245,11 @@
|
|||||||
},
|
},
|
||||||
"nixlib": {
|
"nixlib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1712450863,
|
"lastModified": 1687049841,
|
||||||
"narHash": "sha256-K6IkdtMtq9xktmYPj0uaYc8NsIqHuaAoRBaMgu9Fvrw=",
|
"narHash": "sha256-FBNZQfWtA7bb/rwk92mfiWc85x4hXta2OAouDqO5W8w=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs.lib",
|
"repo": "nixpkgs.lib",
|
||||||
"rev": "3c62b6a12571c9a7f65ab037173ee153d539905f",
|
"rev": "908af6d1fa3643c5818ea45aa92b21d6385fbbe5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -344,11 +266,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716210724,
|
"lastModified": 1687398392,
|
||||||
"narHash": "sha256-iqQa3omRcHGpWb1ds75jS9ruA5R39FTmAkeR3J+ve1w=",
|
"narHash": "sha256-T6kc3NMTpGJk1/dve8PGupeVcxboEb78xtTKhe3LL/A=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixos-generators",
|
"repo": "nixos-generators",
|
||||||
"rev": "d14b286322c7f4f897ca4b1726ce38cb68596c94",
|
"rev": "649171f56a45af13ba693c156207eafbbbf7edfe",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -359,11 +281,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716509168,
|
"lastModified": 1687502512,
|
||||||
"narHash": "sha256-4zSIhSRRIoEBwjbPm3YiGtbd8HDWzFxJjw5DYSDy1n8=",
|
"narHash": "sha256-dBL/01TayOSZYxtY4cMXuNCBk8UMLoqRZA+94xiFpJA=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "bfb7a882678e518398ce9a31a881538679f6f092",
|
"rev": "3ae20aa58a6c0d1ca95c9b11f59a2d12eebc511f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -373,29 +295,45 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nixpkgs-caddy": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1699107987,
|
"lastModified": 1686929285,
|
||||||
"narHash": "sha256-nWXETr4Oqy/vOfzgWyMY04qzEN2iREFJc5ycQ3XNu0A=",
|
"narHash": "sha256-WGtVzn+vGMPTXDO0DMNKVFtf+zUSqeW+KKk4Y/Ae99I=",
|
||||||
"owner": "jpds",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a33b02fa9d664f31dadc8a874eb1a5dbaa9f4ecf",
|
"rev": "93fddcf640ceca0be331210ba3101cee9d91c13d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "jpds",
|
"owner": "NixOS",
|
||||||
"ref": "caddy-external-plugins",
|
"ref": "nixos-22.11",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"null-ls-nvim-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1686871437,
|
||||||
|
"narHash": "sha256-MxIZqyRW8jStiDNXt7Bsw8peDLKpqxKEaUuIJsXkGMI=",
|
||||||
|
"owner": "jose-elias-alvarez",
|
||||||
|
"repo": "null-ls.nvim",
|
||||||
|
"rev": "bbaf5a96913aa92281f154b08732be2f57021c45",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "jose-elias-alvarez",
|
||||||
|
"repo": "null-ls.nvim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716892974,
|
"lastModified": 1687625402,
|
||||||
"narHash": "sha256-THmLi8tNElts9aPkHV68tyON6LgaMvfrmu8j4h4v6Aw=",
|
"narHash": "sha256-V+vSWypmm/tGbwNXGhqzmiV7vTjV2gNCEh9N7OhNnyA=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nur",
|
"repo": "nur",
|
||||||
"rev": "f45a1ca97c3e7b5ec5d970977b5ec44b5f466857",
|
"rev": "aeaf37c7538965e45700d39e6b5dc9c9a0e0749c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -404,35 +342,19 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nvim-lint-src": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1716409152,
|
|
||||||
"narHash": "sha256-L5G634dM8kFWH+WxLCaMx+XY6Pzd++m0O4qRH1dS5PA=",
|
|
||||||
"owner": "mfussenegger",
|
|
||||||
"repo": "nvim-lint",
|
|
||||||
"rev": "e19842a05aae484957ad20710444757bc0a61d63",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "mfussenegger",
|
|
||||||
"repo": "nvim-lint",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nvim-lspconfig-src": {
|
"nvim-lspconfig-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716281382,
|
"lastModified": 1675639052,
|
||||||
"narHash": "sha256-foJ7a59N0a3QaBW24PtwbyYDQVlIsFxiatADLO/hQvc=",
|
"narHash": "sha256-B8IgpypxzCACZ5VcqM6KiWyClaN+KrmemtkwMznmj5Y=",
|
||||||
"owner": "neovim",
|
"owner": "neovim",
|
||||||
"repo": "nvim-lspconfig",
|
"repo": "nvim-lspconfig",
|
||||||
"rev": "0b8165cf95806bc4bb8f745bb0c92021b2ed4b98",
|
"rev": "255e07ce2a05627d482d2de77308bba51b90470c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "neovim",
|
"owner": "neovim",
|
||||||
"ref": "v0.1.8",
|
"ref": "v0.1.6",
|
||||||
"repo": "nvim-lspconfig",
|
"repo": "nvim-lspconfig",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@ -440,11 +362,11 @@
|
|||||||
"nvim-tree-lua-src": {
|
"nvim-tree-lua-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716876666,
|
"lastModified": 1687132855,
|
||||||
"narHash": "sha256-rj/LdWQUSBcbxsUKfZp7N/qVC9/sWc/5PYwHVpBRm2U=",
|
"narHash": "sha256-ZRUoCDBv8rO8ZUBUMLgo33EBbqD9+ZOSET9rkFsA++E=",
|
||||||
"owner": "kyazdani42",
|
"owner": "kyazdani42",
|
||||||
"repo": "nvim-tree.lua",
|
"repo": "nvim-tree.lua",
|
||||||
"rev": "5a87ffe35c4739ffb6b62052572583ad277a20ae",
|
"rev": "c3c6544ee00333b0f1d6a13735d0dd302dba4f70",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -456,93 +378,69 @@
|
|||||||
"nvim-treesitter-src": {
|
"nvim-treesitter-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716878762,
|
"lastModified": 1681121236,
|
||||||
"narHash": "sha256-gXlbgvF9dtHof8xDSxGsACGCInMucjT3jiKB1T+VOm8=",
|
"narHash": "sha256-iPsPDLhVKJ14iP1/2cCgcY9SCKK/DQz9Y0mQB1DqNiM=",
|
||||||
"owner": "nvim-treesitter",
|
"owner": "nvim-treesitter",
|
||||||
"repo": "nvim-treesitter",
|
"repo": "nvim-treesitter",
|
||||||
"rev": "ea2b137f35fb1e87a6471ec311805920fdf45745",
|
"rev": "cc360a9beb1b30d172438f640e2c3450358c4086",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nvim-treesitter",
|
"owner": "nvim-treesitter",
|
||||||
"ref": "master",
|
"ref": "v0.9.0",
|
||||||
"repo": "nvim-treesitter",
|
"repo": "nvim-treesitter",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ren": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1704996573,
|
|
||||||
"narHash": "sha256-zVIt6Xp+Mvym6gySvHIZJt1QgzKVP/wbTGTubWk6kzI=",
|
|
||||||
"owner": "robenkleene",
|
|
||||||
"repo": "ren-find",
|
|
||||||
"rev": "50c40172e354caffee48932266edd7c7a76a20fd",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "robenkleene",
|
|
||||||
"repo": "ren-find",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rep": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1707216692,
|
|
||||||
"narHash": "sha256-/dH+mNtNHaYFndVhoqmz4Sc3HeemoQt1HGD98mb9Qhw=",
|
|
||||||
"owner": "robenkleene",
|
|
||||||
"repo": "rep-grep",
|
|
||||||
"rev": "10510d47e392cb9d30a861c69f702fd194b3fa88",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "robenkleene",
|
|
||||||
"repo": "rep-grep",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"baleia-nvim-src": "baleia-nvim-src",
|
"Comment-nvim-src": "Comment-nvim-src",
|
||||||
"base16-nvim-src": "base16-nvim-src",
|
|
||||||
"bufferline-nvim-src": "bufferline-nvim-src",
|
"bufferline-nvim-src": "bufferline-nvim-src",
|
||||||
"cmp-nvim-lsp-src": "cmp-nvim-lsp-src",
|
"cmp-nvim-lsp-src": "cmp-nvim-lsp-src",
|
||||||
"darwin": "darwin",
|
"darwin": "darwin",
|
||||||
"disko": "disko",
|
"disko": "disko",
|
||||||
"fidget-nvim-src": "fidget-nvim-src",
|
|
||||||
"firefox-darwin": "firefox-darwin",
|
"firefox-darwin": "firefox-darwin",
|
||||||
"hmts-nvim-src": "hmts-nvim-src",
|
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"kitty-scrollback-nvim-src": "kitty-scrollback-nvim-src",
|
"nil": "nil",
|
||||||
"nextcloud-cookbook": "nextcloud-cookbook",
|
|
||||||
"nextcloud-external": "nextcloud-external",
|
|
||||||
"nextcloud-news": "nextcloud-news",
|
|
||||||
"nextcloud-snappymail": "nextcloud-snappymail",
|
|
||||||
"nix2vim": "nix2vim",
|
"nix2vim": "nix2vim",
|
||||||
"nixos-generators": "nixos-generators",
|
"nixos-generators": "nixos-generators",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-caddy": "nixpkgs-caddy",
|
"null-ls-nvim-src": "null-ls-nvim-src",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
"nvim-lint-src": "nvim-lint-src",
|
|
||||||
"nvim-lspconfig-src": "nvim-lspconfig-src",
|
"nvim-lspconfig-src": "nvim-lspconfig-src",
|
||||||
"nvim-tree-lua-src": "nvim-tree-lua-src",
|
"nvim-tree-lua-src": "nvim-tree-lua-src",
|
||||||
"nvim-treesitter-src": "nvim-treesitter-src",
|
"nvim-treesitter-src": "nvim-treesitter-src",
|
||||||
"ren": "ren",
|
|
||||||
"rep": "rep",
|
|
||||||
"telescope-nvim-src": "telescope-nvim-src",
|
"telescope-nvim-src": "telescope-nvim-src",
|
||||||
"telescope-project-nvim-src": "telescope-project-nvim-src",
|
"telescope-project-nvim-src": "telescope-project-nvim-src",
|
||||||
"toggleterm-nvim-src": "toggleterm-nvim-src",
|
"toggleterm-nvim-src": "toggleterm-nvim-src",
|
||||||
"tree-sitter-bash": "tree-sitter-bash",
|
"vscode-terraform-snippets": "vscode-terraform-snippets",
|
||||||
"tree-sitter-ini": "tree-sitter-ini",
|
|
||||||
"tree-sitter-lua": "tree-sitter-lua",
|
|
||||||
"tree-sitter-puppet": "tree-sitter-puppet",
|
|
||||||
"tree-sitter-python": "tree-sitter-python",
|
|
||||||
"tree-sitter-rasi": "tree-sitter-rasi",
|
|
||||||
"tree-sitter-vimdoc": "tree-sitter-vimdoc",
|
|
||||||
"wallpapers": "wallpapers",
|
"wallpapers": "wallpapers",
|
||||||
"wsl": "wsl",
|
"wsl": "wsl"
|
||||||
"zenyd-mpv-scripts": "zenyd-mpv-scripts"
|
}
|
||||||
|
},
|
||||||
|
"rust-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": [
|
||||||
|
"nil",
|
||||||
|
"flake-utils"
|
||||||
|
],
|
||||||
|
"nixpkgs": [
|
||||||
|
"nil",
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1680488274,
|
||||||
|
"narHash": "sha256-0vYMrZDdokVmPQQXtFpnqA2wEgCCUXf5a3dDuDVshn0=",
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"rev": "7ec2ff598a172c6e8584457167575b3a1a5d80d8",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "oxalica",
|
||||||
|
"repo": "rust-overlay",
|
||||||
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"systems": {
|
"systems": {
|
||||||
@ -578,16 +476,16 @@
|
|||||||
"telescope-nvim-src": {
|
"telescope-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716532947,
|
"lastModified": 1686302912,
|
||||||
"narHash": "sha256-e1ulhc4IIvUgpjKQrSqPY4WpXuez6wlxL6Min9U0o5Q=",
|
"narHash": "sha256-fV3LLRwAPykVGc4ImOnUSP+WTrPp9Ad9OTfBJ6wqTMk=",
|
||||||
"owner": "nvim-telescope",
|
"owner": "nvim-telescope",
|
||||||
"repo": "telescope.nvim",
|
"repo": "telescope.nvim",
|
||||||
"rev": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026",
|
"rev": "776b509f80dd49d8205b9b0d94485568236d1192",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "nvim-telescope",
|
"owner": "nvim-telescope",
|
||||||
"ref": "0.1.8",
|
"ref": "0.1.2",
|
||||||
"repo": "telescope.nvim",
|
"repo": "telescope.nvim",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
@ -595,11 +493,11 @@
|
|||||||
"telescope-project-nvim-src": {
|
"telescope-project-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1701464478,
|
"lastModified": 1682606566,
|
||||||
"narHash": "sha256-touMCltcnqkrQYV1NtNeWLQeFVGt+WM3aIWIdKilA7w=",
|
"narHash": "sha256-H6lrPjpOUVleKHB0ziI+6dthg9ymitHhEWtcgYJTrKo=",
|
||||||
"owner": "nvim-telescope",
|
"owner": "nvim-telescope",
|
||||||
"repo": "telescope-project.nvim",
|
"repo": "telescope-project.nvim",
|
||||||
"rev": "1aaf16580a614601a7f7077d9639aeb457dc5559",
|
"rev": "7c64b181dd4e72deddcf6f319e3bf1e95b2a2f30",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -611,132 +509,33 @@
|
|||||||
"toggleterm-nvim-src": {
|
"toggleterm-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1713792255,
|
"lastModified": 1685434104,
|
||||||
"narHash": "sha256-mM5bGgAemsRJD9U6U5K6ia5qb8NaTusM99x6xrtEBfw=",
|
"narHash": "sha256-oiCnBrvft6XxiQtQH8E4F842xhh348SaTpHzaeb+iDY=",
|
||||||
"owner": "akinsho",
|
"owner": "akinsho",
|
||||||
"repo": "toggleterm.nvim",
|
"repo": "toggleterm.nvim",
|
||||||
"rev": "066cccf48a43553a80a210eb3be89a15d789d6e6",
|
"rev": "95204ece0f2a54c89c4395295432f9aeedca7b5f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "akinsho",
|
"owner": "akinsho",
|
||||||
"ref": "v2.11.0",
|
"ref": "v2.7.0",
|
||||||
"repo": "toggleterm.nvim",
|
"repo": "toggleterm.nvim",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tree-sitter-bash": {
|
"vscode-terraform-snippets": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1715005250,
|
"lastModified": 1614849738,
|
||||||
"narHash": "sha256-rCuQbnQAOnQWKYreNH80nlL+0A1qbWbjMvtczcoWPrY=",
|
"narHash": "sha256-v392tyzXV+zyBNt5OCB2NBCK7JcByrTa5Ne/nFtSCJI=",
|
||||||
"owner": "tree-sitter",
|
"owner": "run-at-scale",
|
||||||
"repo": "tree-sitter-bash",
|
"repo": "vscode-terraform-doc-snippets",
|
||||||
"rev": "2fbd860f802802ca76a6661ce025b3a3bca2d3ed",
|
"rev": "6ab3e44b566e660f38922cf908e6e547eaa5d4b4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "tree-sitter",
|
"owner": "run-at-scale",
|
||||||
"ref": "master",
|
"repo": "vscode-terraform-doc-snippets",
|
||||||
"repo": "tree-sitter-bash",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tree-sitter-ini": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1716889525,
|
|
||||||
"narHash": "sha256-IyHrIxcmuzs60zUiJv4E3nSkhSkgbcaLDUdeDx5mlHk=",
|
|
||||||
"owner": "justinmk",
|
|
||||||
"repo": "tree-sitter-ini",
|
|
||||||
"rev": "87176e524f0a98f5be75fa44f4f0ff5c6eac069c",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "justinmk",
|
|
||||||
"repo": "tree-sitter-ini",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tree-sitter-lua": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1710150044,
|
|
||||||
"narHash": "sha256-uFaEptW4wPrqgHfB1mYmVltf+4no61L2cPgpsr5qBIU=",
|
|
||||||
"owner": "MunifTanjim",
|
|
||||||
"repo": "tree-sitter-lua",
|
|
||||||
"rev": "a24dab177e58c9c6832f96b9a73102a0cfbced4a",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "MunifTanjim",
|
|
||||||
"ref": "main",
|
|
||||||
"repo": "tree-sitter-lua",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tree-sitter-puppet": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1713617121,
|
|
||||||
"narHash": "sha256-+zMgzyuGerJ8l+i5ZtWnmGr3i4fFiSLD5FssyKESsmI=",
|
|
||||||
"owner": "amaanq",
|
|
||||||
"repo": "tree-sitter-puppet",
|
|
||||||
"rev": "584522f32495d648b18a53ccb52d988e60de127d",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "amaanq",
|
|
||||||
"repo": "tree-sitter-puppet",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tree-sitter-python": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1714528221,
|
|
||||||
"narHash": "sha256-hHQ5gK4dTRSdp0fLKarytU9vFhsBeQp7Ka61vFoIr7Y=",
|
|
||||||
"owner": "tree-sitter",
|
|
||||||
"repo": "tree-sitter-python",
|
|
||||||
"rev": "71778c2a472ed00a64abf4219544edbf8e4b86d7",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "tree-sitter",
|
|
||||||
"ref": "master",
|
|
||||||
"repo": "tree-sitter-python",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tree-sitter-rasi": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1716296585,
|
|
||||||
"narHash": "sha256-sPrIVgGGaBaXeqHNxjcdJ/S2FvxyV6rD9UPKU/tpspw=",
|
|
||||||
"owner": "Fymyte",
|
|
||||||
"repo": "tree-sitter-rasi",
|
|
||||||
"rev": "6c9bbcfdf5f0f553d9ebc01750a3aa247a37b8aa",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "Fymyte",
|
|
||||||
"repo": "tree-sitter-rasi",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tree-sitter-vimdoc": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1713806200,
|
|
||||||
"narHash": "sha256-+QbLL5EC3oNiwd7h7MW/mutHhGPUHhbYTQcu6x6atcI=",
|
|
||||||
"owner": "neovim",
|
|
||||||
"repo": "tree-sitter-vimdoc",
|
|
||||||
"rev": "b711df784dd43d0a8ed8ddbfca0ddcc3239d94b4",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "neovim",
|
|
||||||
"repo": "tree-sitter-vimdoc",
|
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -759,17 +558,15 @@
|
|||||||
"wsl": {
|
"wsl": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-utils": "flake-utils_2",
|
"flake-utils": "flake-utils_3",
|
||||||
"nixpkgs": [
|
"nixpkgs": "nixpkgs_2"
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1716640344,
|
"lastModified": 1687279045,
|
||||||
"narHash": "sha256-AZKQs+KrL70le0RZH8XqZJMc2SahU4LpfEJ2Vd5SWzM=",
|
"narHash": "sha256-LR0dsXd/A07M61jclyBUW0wRojEQteWReKM35zoJXp0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NixOS-WSL",
|
"repo": "NixOS-WSL",
|
||||||
"rev": "020cd466170204e448b24b246045599fce69ad91",
|
"rev": "a8486b5d191f11d571f15d80b6e265d1712d01cf",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -777,22 +574,6 @@
|
|||||||
"repo": "NixOS-WSL",
|
"repo": "NixOS-WSL",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"zenyd-mpv-scripts": {
|
|
||||||
"flake": false,
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1707704915,
|
|
||||||
"narHash": "sha256-9P/8q/OZXfaJMS08acQP4h3/zUA5mKRQee0JmkXcz1w=",
|
|
||||||
"owner": "zenyd",
|
|
||||||
"repo": "mpv-scripts",
|
|
||||||
"rev": "9bdce0050144cb24f92475f7bdd77180e0e4c26b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "zenyd",
|
|
||||||
"repo": "mpv-scripts",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
379
flake.nix
379
flake.nix
@ -7,25 +7,20 @@
|
|||||||
# Used for system packages
|
# Used for system packages
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
# Used for caddy plugins
|
|
||||||
nixpkgs-caddy.url = "github:jpds/nixpkgs/caddy-external-plugins";
|
|
||||||
|
|
||||||
# Used for MacOS system config
|
# Used for MacOS system config
|
||||||
darwin = {
|
darwin = {
|
||||||
url = "github:lnl7/nix-darwin/master";
|
url = "github:/lnl7/nix-darwin/master";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Used for Windows Subsystem for Linux compatibility
|
# Used for Windows Subsystem for Linux compatibility
|
||||||
wsl = {
|
wsl.url = "github:nix-community/NixOS-WSL";
|
||||||
url = "github:nix-community/NixOS-WSL";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Used for user packages and dotfiles
|
# Used for user packages and dotfiles
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager/master";
|
url = "github:nix-community/home-manager/master";
|
||||||
inputs.nixpkgs.follows = "nixpkgs"; # Use system packages list for their inputs
|
inputs.nixpkgs.follows =
|
||||||
|
"nixpkgs"; # Use system packages list for their inputs
|
||||||
};
|
};
|
||||||
|
|
||||||
# Community packages; used for Firefox extensions
|
# Community packages; used for Firefox extensions
|
||||||
@ -61,33 +56,35 @@
|
|||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Neovim plugins
|
# Nix language server
|
||||||
base16-nvim-src = {
|
nil = {
|
||||||
url = "github:RRethy/base16-nvim";
|
url = "github:oxalica/nil/2023-04-03";
|
||||||
flake = false;
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Neovim plugins
|
||||||
nvim-lspconfig-src = {
|
nvim-lspconfig-src = {
|
||||||
# https://github.com/neovim/nvim-lspconfig/tags
|
url = "github:neovim/nvim-lspconfig/v0.1.6";
|
||||||
url = "github:neovim/nvim-lspconfig/v0.1.8";
|
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
cmp-nvim-lsp-src = {
|
cmp-nvim-lsp-src = {
|
||||||
url = "github:hrsh7th/cmp-nvim-lsp";
|
url = "github:hrsh7th/cmp-nvim-lsp";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
baleia-nvim-src = {
|
null-ls-nvim-src = {
|
||||||
# https://github.com/m00qek/baleia.nvim/tags
|
url = "github:jose-elias-alvarez/null-ls.nvim";
|
||||||
url = "github:m00qek/baleia.nvim";
|
flake = false;
|
||||||
|
};
|
||||||
|
Comment-nvim-src = {
|
||||||
|
url = "github:numToStr/Comment.nvim/v0.8.0";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
nvim-treesitter-src = {
|
nvim-treesitter-src = {
|
||||||
# https://github.com/nvim-treesitter/nvim-treesitter/tags
|
url = "github:nvim-treesitter/nvim-treesitter/v0.9.0";
|
||||||
url = "github:nvim-treesitter/nvim-treesitter/master";
|
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
telescope-nvim-src = {
|
telescope-nvim-src = {
|
||||||
# https://github.com/nvim-telescope/telescope.nvim/releases
|
url = "github:nvim-telescope/telescope.nvim/0.1.2";
|
||||||
url = "github:nvim-telescope/telescope.nvim/0.1.8";
|
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
telescope-project-nvim-src = {
|
telescope-project-nvim-src = {
|
||||||
@ -95,144 +92,28 @@
|
|||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
toggleterm-nvim-src = {
|
toggleterm-nvim-src = {
|
||||||
# https://github.com/akinsho/toggleterm.nvim/tags
|
url = "github:akinsho/toggleterm.nvim/v2.7.0";
|
||||||
url = "github:akinsho/toggleterm.nvim/v2.11.0";
|
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
bufferline-nvim-src = {
|
bufferline-nvim-src = {
|
||||||
# https://github.com/akinsho/bufferline.nvim/releases
|
url = "github:akinsho/bufferline.nvim/v4.2.0";
|
||||||
url = "github:akinsho/bufferline.nvim/v4.6.1";
|
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
nvim-tree-lua-src = {
|
nvim-tree-lua-src = {
|
||||||
url = "github:kyazdani42/nvim-tree.lua";
|
url = "github:kyazdani42/nvim-tree.lua";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
hmts-nvim-src = {
|
vscode-terraform-snippets = {
|
||||||
url = "github:calops/hmts.nvim";
|
url = "github:run-at-scale/vscode-terraform-doc-snippets";
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
fidget-nvim-src = {
|
|
||||||
# https://github.com/j-hui/fidget.nvim/tags
|
|
||||||
url = "github:j-hui/fidget.nvim/v1.4.5";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
kitty-scrollback-nvim-src = {
|
|
||||||
url = "github:mikesmithgh/kitty-scrollback.nvim";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
nvim-lint-src = {
|
|
||||||
url = "github:mfussenegger/nvim-lint";
|
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Tree-Sitter Grammars
|
|
||||||
tree-sitter-bash = {
|
|
||||||
url = "github:tree-sitter/tree-sitter-bash/master";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
tree-sitter-python = {
|
|
||||||
url = "github:tree-sitter/tree-sitter-python/master";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
tree-sitter-lua = {
|
|
||||||
url = "github:MunifTanjim/tree-sitter-lua/main";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
tree-sitter-ini = {
|
|
||||||
url = "github:justinmk/tree-sitter-ini";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
tree-sitter-puppet = {
|
|
||||||
url = "github:amaanq/tree-sitter-puppet";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
tree-sitter-rasi = {
|
|
||||||
url = "github:Fymyte/tree-sitter-rasi";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
tree-sitter-vimdoc = {
|
|
||||||
url = "github:neovim/tree-sitter-vimdoc";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# MPV Scripts
|
|
||||||
zenyd-mpv-scripts = {
|
|
||||||
url = "github:zenyd/mpv-scripts";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Ren and rep - CLI find and replace
|
|
||||||
rep = {
|
|
||||||
url = "github:robenkleene/rep-grep";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
ren = {
|
|
||||||
url = "github:robenkleene/ren-find";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Nextcloud Apps
|
|
||||||
nextcloud-news = {
|
|
||||||
# https://github.com/nextcloud/news/releases
|
|
||||||
url = "https://github.com/nextcloud/news/releases/download/25.0.0-alpha3/news.tar.gz";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
nextcloud-external = {
|
|
||||||
# https://github.com/nextcloud-releases/external/releases
|
|
||||||
url = "https://github.com/nextcloud-releases/external/releases/download/v5.3.1/external-v5.3.1.tar.gz";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
nextcloud-cookbook = {
|
|
||||||
# https://github.com/christianlupus-nextcloud/cookbook-releases/releases/
|
|
||||||
url = "https://github.com/christianlupus-nextcloud/cookbook-releases/releases/download/v0.11.0/cookbook-0.11.0.tar.gz";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
nextcloud-snappymail = {
|
|
||||||
# https://github.com/the-djmaze/snappymail/releases
|
|
||||||
# https://snappymail.eu/repository/nextcloud
|
|
||||||
url = "https://github.com/nmasur/snappymail-nextcloud/releases/download/v2.36.1/snappymail-2.36.1-nextcloud.tar.gz";
|
|
||||||
flake = false;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs = { self, nixpkgs, ... }@inputs:
|
||||||
{ nixpkgs, ... }@inputs:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
# Global configuration for my systems
|
|
||||||
globals =
|
|
||||||
let
|
|
||||||
baseName = "masu.rs";
|
|
||||||
in
|
|
||||||
rec {
|
|
||||||
user = "noah";
|
|
||||||
fullName = "Noah Masur";
|
|
||||||
gitName = fullName;
|
|
||||||
gitEmail = "7386960+nmasur@users.noreply.github.com";
|
|
||||||
mail.server = "noahmasur.com";
|
|
||||||
mail.imapHost = "imap.purelymail.com";
|
|
||||||
mail.smtpHost = "smtp.purelymail.com";
|
|
||||||
dotfilesRepo = "https://github.com/nmasur/dotfiles";
|
|
||||||
hostnames = {
|
|
||||||
git = "git.${baseName}";
|
|
||||||
influxdb = "influxdb.${baseName}";
|
|
||||||
irc = "irc.${baseName}";
|
|
||||||
metrics = "metrics.${baseName}";
|
|
||||||
minecraft = "minecraft.${baseName}";
|
|
||||||
n8n = "n8n2.${baseName}";
|
|
||||||
prometheus = "prom.${baseName}";
|
|
||||||
paperless = "paper.${baseName}";
|
|
||||||
secrets = "vault.${baseName}";
|
|
||||||
stream = "stream.${baseName}";
|
|
||||||
content = "cloud.${baseName}";
|
|
||||||
books = "books.${baseName}";
|
|
||||||
download = "download.${baseName}";
|
|
||||||
transmission = "transmission.${baseName}";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Common overlays to always use
|
# Common overlays to always use
|
||||||
overlays = [
|
overlays = [
|
||||||
inputs.nur.overlay
|
inputs.nur.overlay
|
||||||
@ -241,174 +122,111 @@
|
|||||||
(import ./overlays/calibre-web.nix)
|
(import ./overlays/calibre-web.nix)
|
||||||
(import ./overlays/disko.nix inputs)
|
(import ./overlays/disko.nix inputs)
|
||||||
(import ./overlays/tree-sitter.nix inputs)
|
(import ./overlays/tree-sitter.nix inputs)
|
||||||
(import ./overlays/mpv-scripts.nix inputs)
|
|
||||||
(import ./overlays/nextcloud-apps.nix inputs)
|
|
||||||
(import ./overlays/betterlockscreen.nix)
|
|
||||||
(import ./overlays/gh-collaborators.nix)
|
|
||||||
(import ./overlays/ren-rep.nix inputs)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Global configuration for my systems
|
||||||
|
globals = let baseName = "masu.rs";
|
||||||
|
in rec {
|
||||||
|
user = "noah";
|
||||||
|
fullName = "Noah Masur";
|
||||||
|
gitName = fullName;
|
||||||
|
gitEmail = "7386960+nmasur@users.noreply.github.com";
|
||||||
|
mail.server = "noahmasur.com";
|
||||||
|
mail.imapHost = "imap.purelymail.com";
|
||||||
|
mail.smtpHost = "smtp.purelymail.com";
|
||||||
|
dotfilesRepo = "git@github.com:nmasur/dotfiles";
|
||||||
|
nixpkgs.overlays = overlays;
|
||||||
|
hostnames = {
|
||||||
|
git = "git.${baseName}";
|
||||||
|
metrics = "metrics.${baseName}";
|
||||||
|
prometheus = "prom.${baseName}";
|
||||||
|
secrets = "vault.${baseName}";
|
||||||
|
stream = "stream.${baseName}";
|
||||||
|
content = "cloud.${baseName}";
|
||||||
|
books = "books.${baseName}";
|
||||||
|
download = "download.${baseName}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# System types to support.
|
# System types to support.
|
||||||
supportedSystems = [
|
supportedSystems =
|
||||||
"x86_64-linux"
|
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
|
||||||
"x86_64-darwin"
|
|
||||||
"aarch64-linux"
|
|
||||||
"aarch64-darwin"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
||||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||||
in
|
|
||||||
rec {
|
in rec {
|
||||||
|
|
||||||
|
nixosModules = {
|
||||||
|
globals = { config }: { config = globals; };
|
||||||
|
common = import ./modules/common;
|
||||||
|
nixos = import ./modules/nixos;
|
||||||
|
darwin = import ./modules/darwin;
|
||||||
|
};
|
||||||
|
|
||||||
# Contains my full system builds, including home-manager
|
# Contains my full system builds, including home-manager
|
||||||
# nixos-rebuild switch --flake .#tempest
|
# nixos-rebuild switch --flake .#tempest
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
arrow = import ./hosts/arrow { inherit inputs globals overlays; };
|
tempest = import ./hosts/tempest { inherit self; };
|
||||||
tempest = import ./hosts/tempest { inherit inputs globals overlays; };
|
hydra = import ./hosts/hydra { inherit self; };
|
||||||
hydra = import ./hosts/hydra { inherit inputs globals overlays; };
|
flame = import ./hosts/flame { inherit self; };
|
||||||
flame = import ./hosts/flame { inherit inputs globals overlays; };
|
swan = import ./hosts/swan { inherit self; };
|
||||||
swan = import ./hosts/swan { inherit inputs globals overlays; };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Contains my full Mac system builds, including home-manager
|
# Contains my full Mac system builds, including home-manager
|
||||||
# darwin-rebuild switch --flake .#lookingglass
|
# darwin-rebuild switch --flake .#lookingglass
|
||||||
darwinConfigurations = {
|
darwinConfigurations = {
|
||||||
lookingglass = import ./hosts/lookingglass { inherit inputs globals overlays; };
|
lookingglass = import ./hosts/lookingglass { inherit self; };
|
||||||
};
|
};
|
||||||
|
|
||||||
# For quickly applying home-manager settings with:
|
# For quickly applying home-manager settings with:
|
||||||
# home-manager switch --flake .#tempest
|
# home-manager switch --flake .#tempest
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
tempest = nixosConfigurations.tempest.config.home-manager.users.${globals.user}.home;
|
tempest =
|
||||||
lookingglass = darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home;
|
nixosConfigurations.tempest.config.home-manager.users.${globals.user}.home;
|
||||||
|
lookingglass =
|
||||||
|
darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Disk formatting, only used once
|
# Disk formatting, only used once
|
||||||
diskoConfigurations = {
|
diskoConfigurations = { root = import ./disks/root.nix; };
|
||||||
root = import ./disks/root.nix;
|
|
||||||
|
packages = let
|
||||||
|
aws = system: import ./hosts/aws { inherit self system; };
|
||||||
|
staff = system: import ./hosts/staff { inherit self system; };
|
||||||
|
neovim = system:
|
||||||
|
let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
|
in import ./modules/common/neovim/package {
|
||||||
|
inherit pkgs;
|
||||||
|
colors = (import ./colorscheme/gruvbox-dark).dark;
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
x86_64-linux.aws = aws "x86_64-linux";
|
||||||
|
x86_64-linux.staff = staff "x86_64-linux";
|
||||||
|
|
||||||
|
# Package Neovim config into standalone package
|
||||||
|
x86_64-linux.neovim = neovim "x86_64-linux";
|
||||||
|
x86_64-darwin.neovim = neovim "x86_64-darwin";
|
||||||
|
aarch64-linux.neovim = neovim "aarch64-linux";
|
||||||
|
aarch64-darwin.neovim = neovim "aarch64-darwin";
|
||||||
};
|
};
|
||||||
|
|
||||||
packages =
|
|
||||||
let
|
|
||||||
staff =
|
|
||||||
system:
|
|
||||||
import ./hosts/staff {
|
|
||||||
inherit
|
|
||||||
inputs
|
|
||||||
globals
|
|
||||||
overlays
|
|
||||||
system
|
|
||||||
;
|
|
||||||
};
|
|
||||||
neovim =
|
|
||||||
system:
|
|
||||||
let
|
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
|
||||||
in
|
|
||||||
import ./modules/common/neovim/package {
|
|
||||||
inherit pkgs;
|
|
||||||
colors = (import ./colorscheme/gruvbox-dark).dark;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
{
|
|
||||||
x86_64-linux.staff = staff "x86_64-linux";
|
|
||||||
x86_64-linux.arrow = inputs.nixos-generators.nixosGenerate rec {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
format = "iso";
|
|
||||||
specialArgs = {
|
|
||||||
pkgs-caddy = import inputs.nixpkgs-caddy { inherit system; };
|
|
||||||
};
|
|
||||||
modules = import ./hosts/arrow/modules.nix { inherit inputs globals overlays; };
|
|
||||||
};
|
|
||||||
x86_64-linux.arrow-aws = inputs.nixos-generators.nixosGenerate rec {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
format = "amazon";
|
|
||||||
specialArgs = {
|
|
||||||
pkgs-caddy = import inputs.nixpkgs-caddy { inherit system; };
|
|
||||||
};
|
|
||||||
modules = import ./hosts/arrow/modules.nix { inherit inputs globals overlays; } ++ [
|
|
||||||
(
|
|
||||||
{ ... }:
|
|
||||||
{
|
|
||||||
boot.kernelPackages = inputs.nixpkgs.legacyPackages.x86_64-linux.linuxKernel.packages.linux_6_6;
|
|
||||||
amazonImage.sizeMB = 16 * 1024;
|
|
||||||
permitRootLogin = "prohibit-password";
|
|
||||||
boot.loader.systemd-boot.enable = inputs.nixpkgs.lib.mkForce false;
|
|
||||||
boot.loader.efi.canTouchEfiVariables = inputs.nixpkgs.lib.mkForce false;
|
|
||||||
services.amazon-ssm-agent.enable = true;
|
|
||||||
users.users.ssm-user.extraGroups = [ "wheel" ];
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Package Neovim config into standalone package
|
|
||||||
x86_64-linux.neovim = neovim "x86_64-linux";
|
|
||||||
x86_64-darwin.neovim = neovim "x86_64-darwin";
|
|
||||||
aarch64-linux.neovim = neovim "aarch64-linux";
|
|
||||||
aarch64-darwin.neovim = neovim "aarch64-darwin";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Programs that can be run by calling this flake
|
# Programs that can be run by calling this flake
|
||||||
apps = forAllSystems (
|
apps = forAllSystems (system:
|
||||||
system:
|
let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
let
|
in import ./apps { inherit pkgs; });
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
|
||||||
in
|
|
||||||
import ./apps { inherit pkgs; }
|
|
||||||
);
|
|
||||||
|
|
||||||
# Development environments
|
# Development environments
|
||||||
devShells = forAllSystems (
|
devShells = forAllSystems (system:
|
||||||
system:
|
let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
let
|
in {
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
|
||||||
in
|
|
||||||
{
|
|
||||||
|
|
||||||
# Used to run commands and edit files in this repo
|
# Used to run commands and edit files in this repo
|
||||||
default = pkgs.mkShell {
|
default = pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [ git stylua nixfmt shfmt shellcheck ];
|
||||||
git
|
|
||||||
stylua
|
|
||||||
nixfmt-rfc-style
|
|
||||||
shfmt
|
|
||||||
shellcheck
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
checks = forAllSystems (
|
});
|
||||||
system:
|
|
||||||
let
|
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
|
||||||
in
|
|
||||||
{
|
|
||||||
neovim =
|
|
||||||
pkgs.runCommand "neovim-check-health" { buildInputs = [ inputs.self.packages.${system}.neovim ]; }
|
|
||||||
''
|
|
||||||
mkdir -p $out
|
|
||||||
export HOME=$TMPDIR
|
|
||||||
nvim -c "checkhealth" -c "write $out/health.log" -c "quitall"
|
|
||||||
|
|
||||||
# Check for errors inside the health log
|
|
||||||
if $(grep "ERROR" $out/health.log); then
|
|
||||||
cat $out/health.log
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
formatter = forAllSystems (
|
|
||||||
system:
|
|
||||||
let
|
|
||||||
pkgs = import nixpkgs { inherit system overlays; };
|
|
||||||
in
|
|
||||||
pkgs.nixfmt-rfc-style
|
|
||||||
);
|
|
||||||
|
|
||||||
# Templates for starting other projects quickly
|
# Templates for starting other projects quickly
|
||||||
templates = rec {
|
templates = rec {
|
||||||
@ -429,10 +247,7 @@
|
|||||||
path = ./templates/haskell;
|
path = ./templates/haskell;
|
||||||
description = "Haskell template";
|
description = "Haskell template";
|
||||||
};
|
};
|
||||||
rust = {
|
|
||||||
path = ./templates/rust;
|
|
||||||
description = "Rust template";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
# Hosts
|
# Hosts
|
||||||
|
|
||||||
These are the individual machines managed by this flake.
|
|
||||||
|
|
||||||
| Host | Purpose |
|
| Host | Purpose |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| [aws](./aws/default.nix) | AWS AMI |
|
| [aws](./aws/default.nix) | AWS AMI |
|
||||||
@ -12,15 +10,3 @@ These are the individual machines managed by this flake.
|
|||||||
| [swan](./swan/default.nix) | Home server |
|
| [swan](./swan/default.nix) | Home server |
|
||||||
| [tempest](./tempest/default.nix) | Linux desktop |
|
| [tempest](./tempest/default.nix) | Linux desktop |
|
||||||
|
|
||||||
## NixOS Workflow
|
|
||||||
|
|
||||||
Each hosts file is imported into [nixosConfigurations](../flake.nix) and passed
|
|
||||||
the arguments from the flake (inputs, globals, overlays). The `nixosSystem`
|
|
||||||
function in that hosts file will be called by the NixOS module system during a
|
|
||||||
nixos-rebuild.
|
|
||||||
|
|
||||||
Each module in the each host's `modules` list is either a function or an
|
|
||||||
attrset. The attrsets will simply apply values to options that have been
|
|
||||||
declared in the config by other modules. Meanwhile, the functions will be
|
|
||||||
passed various arguments, several of which you will see listed at the top of
|
|
||||||
each of their files.
|
|
||||||
|
@ -1,98 +0,0 @@
|
|||||||
resource "aws_instance" "instance" {
|
|
||||||
ami = aws_ami.image.id
|
|
||||||
iam_instance_profile = aws_iam_instance_profile.instance.name
|
|
||||||
instance_type = var.ec2_size
|
|
||||||
vpc_security_group_ids = [aws_security_group.instance.id]
|
|
||||||
|
|
||||||
tags = {
|
|
||||||
Name = "aws-nixos"
|
|
||||||
}
|
|
||||||
|
|
||||||
lifecycle {
|
|
||||||
create_before_destroy = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "aws_ec2_instance_state" "instance" {
|
|
||||||
instance_id = aws_instance.instance.id
|
|
||||||
state = "running"
|
|
||||||
}
|
|
||||||
|
|
||||||
data "aws_vpc" "vpc" {
|
|
||||||
default = true
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "aws_security_group" "instance" {
|
|
||||||
name = "aws-nixos"
|
|
||||||
description = "Allow SSH and HTTPS"
|
|
||||||
vpc_id = data.aws_vpc.vpc.id
|
|
||||||
|
|
||||||
ingress {
|
|
||||||
description = "Ping"
|
|
||||||
from_port = -1
|
|
||||||
to_port = -1
|
|
||||||
protocol = "icmp"
|
|
||||||
cidr_blocks = ["0.0.0.0/0"]
|
|
||||||
}
|
|
||||||
|
|
||||||
ingress {
|
|
||||||
description = "SSH"
|
|
||||||
from_port = 22
|
|
||||||
to_port = 22
|
|
||||||
protocol = "tcp"
|
|
||||||
cidr_blocks = ["0.0.0.0/0"]
|
|
||||||
}
|
|
||||||
|
|
||||||
ingress {
|
|
||||||
description = "HTTPS"
|
|
||||||
from_port = 443
|
|
||||||
to_port = 443
|
|
||||||
protocol = "tcp"
|
|
||||||
cidr_blocks = ["0.0.0.0/0"]
|
|
||||||
}
|
|
||||||
|
|
||||||
egress {
|
|
||||||
from_port = 0
|
|
||||||
to_port = 0
|
|
||||||
protocol = "-1"
|
|
||||||
cidr_blocks = ["0.0.0.0/0"]
|
|
||||||
ipv6_cidr_blocks = ["::/0"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Setup IAM for the instance to use SSM
|
|
||||||
data "aws_iam_policy_document" "ec2_assume_role" {
|
|
||||||
statement {
|
|
||||||
actions = ["sts:AssumeRole"]
|
|
||||||
principals {
|
|
||||||
type = "Service"
|
|
||||||
identifiers = ["ec2.amazonaws.com"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
data "aws_iam_policy_document" "instance_profile" {
|
|
||||||
statement {
|
|
||||||
actions = [
|
|
||||||
"s3:ListAllMyBuckets",
|
|
||||||
]
|
|
||||||
resources = ["*"]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "aws_iam_role" "instance_profile" {
|
|
||||||
name = "nixos"
|
|
||||||
assume_role_policy = data.aws_iam_policy_document.ec2_assume_role.json
|
|
||||||
inline_policy {
|
|
||||||
name = "instance-profile"
|
|
||||||
policy = data.aws_iam_policy_document.instance_profile.json
|
|
||||||
}
|
|
||||||
}
|
|
||||||
resource "aws_iam_role_policy_attachment" "instance_ssm" {
|
|
||||||
role = aws_iam_role.instance_profile.name
|
|
||||||
policy_arn = "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
|
|
||||||
}
|
|
||||||
resource "aws_iam_instance_profile" "instance" {
|
|
||||||
name = "nixos"
|
|
||||||
role = aws_iam_role.instance_profile.name
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
terraform {
|
|
||||||
backend "s3" {
|
|
||||||
region = "us-east-1"
|
|
||||||
dynamodb_table = "terraform-state-lock"
|
|
||||||
}
|
|
||||||
required_version = ">= 1.0.0"
|
|
||||||
required_providers {
|
|
||||||
aws = {
|
|
||||||
source = "hashicorp/aws"
|
|
||||||
version = "5.42.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,3 +0,0 @@
|
|||||||
output "host_ip" {
|
|
||||||
value = aws_instance.instance.public_ip
|
|
||||||
}
|
|
@ -1,10 +0,0 @@
|
|||||||
variable "ec2_size" {
|
|
||||||
type = string
|
|
||||||
description = "Size of instance to launch"
|
|
||||||
default = "t3a.small" # 2 GB RAM ($14/mo)
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "images_bucket" {
|
|
||||||
description = "Name of the bucket in which to store the NixOS VM images."
|
|
||||||
type = string
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
# The Arrow
|
|
||||||
# System configuration for temporary VM
|
|
||||||
|
|
||||||
{
|
|
||||||
inputs,
|
|
||||||
globals,
|
|
||||||
overlays,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
inputs.nixpkgs.lib.nixosSystem rec {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
specialArgs = {
|
|
||||||
pkgs-caddy = import inputs.nixpkgs-caddy { inherit system; };
|
|
||||||
};
|
|
||||||
modules = import ./modules.nix { inherit inputs globals overlays; } ++ [
|
|
||||||
{
|
|
||||||
# This is the root filesystem containing NixOS
|
|
||||||
fileSystems."/" = {
|
|
||||||
device = "/dev/disk/by-label/nixos";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
# This is the boot filesystem for Grub
|
|
||||||
fileSystems."/boot" = {
|
|
||||||
device = "/dev/disk/by-label/boot";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
virtualisation.vmVariant = {
|
|
||||||
virtualisation.forwardPorts = [
|
|
||||||
{
|
|
||||||
from = "host";
|
|
||||||
host.port = 2222;
|
|
||||||
guest.port = 22;
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
globals,
|
|
||||||
overlays,
|
|
||||||
}:
|
|
||||||
|
|
||||||
[
|
|
||||||
globals
|
|
||||||
inputs.home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
nixpkgs.overlays = overlays;
|
|
||||||
networking.hostName = "arrow";
|
|
||||||
physical = false;
|
|
||||||
server = true;
|
|
||||||
gui.enable = false;
|
|
||||||
theme.colors = (import ../../colorscheme/gruvbox).dark;
|
|
||||||
publicKeys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal"
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKpPU2G9rSF8Q6waH62IJexDCQ6lY+8ZyVufGE3xMDGw deploy"
|
|
||||||
];
|
|
||||||
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
|
||||||
cloudflare.enable = true;
|
|
||||||
services.openssh.enable = true;
|
|
||||||
services.caddy.enable = true;
|
|
||||||
services.n8n.enable = true;
|
|
||||||
|
|
||||||
# nix-index seems to eat up too much memory for Vultr
|
|
||||||
home-manager.users.${globals.user}.programs.nix-index.enable = inputs.nixpkgs.lib.mkForce false;
|
|
||||||
}
|
|
||||||
../../modules/common
|
|
||||||
../../modules/nixos
|
|
||||||
]
|
|
@ -1,78 +0,0 @@
|
|||||||
terraform {
|
|
||||||
backend "s3" {
|
|
||||||
bucket = "noahmasur-terraform"
|
|
||||||
key = "arrow.tfstate"
|
|
||||||
region = "auto"
|
|
||||||
skip_credentials_validation = true
|
|
||||||
skip_metadata_api_check = true
|
|
||||||
skip_region_validation = true
|
|
||||||
skip_requesting_account_id = true
|
|
||||||
skip_s3_checksum = true
|
|
||||||
use_path_style = true
|
|
||||||
/*
|
|
||||||
ENVIRONMENT VARIABLES
|
|
||||||
---------------------
|
|
||||||
AWS_ACCESS_KEY_ID - R2 token
|
|
||||||
AWS_SECRET_ACCESS_KEY - R2 secret
|
|
||||||
AWS_ENDPOINT_URL_S3 - R2 location: https://ACCOUNT_ID.r2.cloudflarestorage.com
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
required_version = ">= 1.0.0"
|
|
||||||
required_providers {
|
|
||||||
aws = {
|
|
||||||
source = "hashicorp/aws"
|
|
||||||
version = "5.42.0"
|
|
||||||
}
|
|
||||||
vultr = {
|
|
||||||
source = "vultr/vultr"
|
|
||||||
version = "2.19.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "vultr_api_key" {
|
|
||||||
type = string
|
|
||||||
description = "API key for Vultr management"
|
|
||||||
sensitive = true
|
|
||||||
}
|
|
||||||
|
|
||||||
# https://api.vultr.com/v2/plans
|
|
||||||
variable "vultr_plan" {
|
|
||||||
type = string
|
|
||||||
description = "Size of instance to launch"
|
|
||||||
default = "vc2-1c-2gb" # 55 GB SSD ($10/mo)
|
|
||||||
}
|
|
||||||
|
|
||||||
provider "aws" {
|
|
||||||
region = "auto"
|
|
||||||
skip_credentials_validation = true
|
|
||||||
skip_metadata_api_check = true
|
|
||||||
skip_region_validation = true
|
|
||||||
skip_requesting_account_id = true
|
|
||||||
}
|
|
||||||
|
|
||||||
provider "vultr" {
|
|
||||||
api_key = var.vultr_api_key
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "vultr_iso_private" "image" {
|
|
||||||
# url = "https://${var.cloudflare_account_id}.r2.cloudflarestorage.com/${data.aws_s3_bucket.images.id}/${aws_s3_object.image.key}"
|
|
||||||
url = "https://arrow-images.masu.rs/arrow.iso"
|
|
||||||
}
|
|
||||||
|
|
||||||
resource "vultr_instance" "arrow" {
|
|
||||||
plan = var.vultr_plan
|
|
||||||
region = "ewr"
|
|
||||||
iso_id = vultr_iso_private.image.id
|
|
||||||
label = "arrow"
|
|
||||||
tags = ["arrow"]
|
|
||||||
enable_ipv6 = false
|
|
||||||
disable_public_ipv4 = false
|
|
||||||
backups = "disabled"
|
|
||||||
ddos_protection = false
|
|
||||||
activation_email = false
|
|
||||||
}
|
|
||||||
|
|
||||||
output "host_ip" {
|
|
||||||
value = vultr_instance.arrow.main_ip
|
|
||||||
}
|
|
25
hosts/aws/default.nix
Normal file
25
hosts/aws/default.nix
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{ self, system, ... }:
|
||||||
|
|
||||||
|
self.inputs.nixos-generators.nixosGenerate {
|
||||||
|
inherit system;
|
||||||
|
format = "amazon";
|
||||||
|
modules = [
|
||||||
|
self.inputs.home-manager.nixosModules.home-manager
|
||||||
|
self.nixosModules.globals
|
||||||
|
self.nixosModules.common
|
||||||
|
self.nixosModules.nixos
|
||||||
|
{
|
||||||
|
networking.hostName = "sheep";
|
||||||
|
gui.enable = false;
|
||||||
|
theme.colors = (import ../../colorscheme/gruvbox).dark;
|
||||||
|
passwordHash = null;
|
||||||
|
publicKey =
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
||||||
|
# AWS settings require this
|
||||||
|
permitRootLogin = "prohibit-password";
|
||||||
|
}
|
||||||
|
] ++ [
|
||||||
|
# Required to fix diskSize errors during build
|
||||||
|
({ ... }: { amazonImage.sizeMB = 16 * 1024; })
|
||||||
|
];
|
||||||
|
}
|
@ -1,23 +1,13 @@
|
|||||||
# locals {
|
locals {
|
||||||
# image_file = one(fileset(path.root, "../../../result/nixos-amazon-image-*.vhd"))
|
image_file = one(fileset(path.root, "result/nixos-amazon-image-*.vhd"))
|
||||||
# }
|
|
||||||
#
|
|
||||||
# # Upload image to S3
|
|
||||||
# resource "aws_s3_object" "image" {
|
|
||||||
# bucket = var.images_bucket
|
|
||||||
# key = basename(local.image_file)
|
|
||||||
# source = local.image_file
|
|
||||||
# etag = filemd5(local.image_file)
|
|
||||||
# }
|
|
||||||
|
|
||||||
# Use existing image in S3
|
|
||||||
data "aws_s3_object" "image" {
|
|
||||||
bucket = var.images_bucket
|
|
||||||
key = "arrow.vhd"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "terraform_data" "image_replacement" {
|
# Upload to S3
|
||||||
input = data.aws_s3_object.image.etag
|
resource "aws_s3_object" "image" {
|
||||||
|
bucket = "your_bucket_name"
|
||||||
|
key = basename(local.image_file)
|
||||||
|
source = local.image_file
|
||||||
|
etag = filemd5(local.image_file)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Setup IAM access for the VM Importer
|
# Setup IAM access for the VM Importer
|
||||||
@ -39,8 +29,8 @@ data "aws_iam_policy_document" "vmimport" {
|
|||||||
"s3:ListBucket",
|
"s3:ListBucket",
|
||||||
]
|
]
|
||||||
resources = [
|
resources = [
|
||||||
"arn:aws:s3:::${data.aws_s3_object.image.bucket}",
|
"arn:aws:s3:::${aws_s3_object.image.bucket}",
|
||||||
"arn:aws:s3:::${data.aws_s3_object.image.bucket}/*",
|
"arn:aws:s3:::${aws_s3_object.image.bucket}/*",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
statement {
|
statement {
|
||||||
@ -68,28 +58,23 @@ resource "aws_ebs_snapshot_import" "image" {
|
|||||||
disk_container {
|
disk_container {
|
||||||
format = "VHD"
|
format = "VHD"
|
||||||
user_bucket {
|
user_bucket {
|
||||||
s3_bucket = data.aws_s3_object.image.bucket
|
s3_bucket = aws_s3_object.image.bucket
|
||||||
s3_key = data.aws_s3_object.image.key
|
s3_key = aws_s3_object.image.key
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
role_name = aws_iam_role.vmimport.name
|
role_name = aws_iam_role.vmimport.name
|
||||||
lifecycle {
|
|
||||||
replace_triggered_by = [terraform_data.image_replacement]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Convert to AMI
|
# Convert to AMI
|
||||||
resource "aws_ami" "image" {
|
resource "aws_ami" "image" {
|
||||||
description = "Created with NixOS."
|
description = "Created with NixOS."
|
||||||
name = replace(basename(data.aws_s3_object.image.key), "/\\.vhd$/", "")
|
name = replace(basename(local.image_file), "/\\.vhd$/", "")
|
||||||
virtualization_type = "hvm"
|
virtualization_type = "hvm"
|
||||||
root_device_name = "/dev/xvda"
|
|
||||||
ena_support = true
|
|
||||||
|
|
||||||
ebs_block_device {
|
ebs_block_device {
|
||||||
device_name = "/dev/xvda"
|
device_name = "/dev/xvda"
|
||||||
snapshot_id = aws_ebs_snapshot_import.image.id
|
snapshot_id = aws_ebs_snapshot_import.image.id
|
||||||
volume_size = 17
|
volume_size = 8
|
||||||
}
|
}
|
||||||
}
|
}
|
280
hosts/aws/workflow.yml
Normal file
280
hosts/aws/workflow.yml
Normal file
@ -0,0 +1,280 @@
|
|||||||
|
name: 'Terraform'
|
||||||
|
env:
|
||||||
|
|
||||||
|
AWS_ACCOUNT_NUMBER: ''
|
||||||
|
AWS_PLAN_ROLE_NAME: github_actions_plan
|
||||||
|
AWS_APPLY_ROLE_NAME: github_actions_admin
|
||||||
|
|
||||||
|
# Always required. Used for authenticating to AWS, but can also act as your
|
||||||
|
# default region if you don't want to specify in the provider configuration.
|
||||||
|
AWS_REGION: us-east-1
|
||||||
|
|
||||||
|
# You must change these to fit your project.
|
||||||
|
TF_VAR_project: change-me
|
||||||
|
TF_VAR_label: change-me
|
||||||
|
TF_VAR_owner: Your Name Here
|
||||||
|
|
||||||
|
# If storing Terraform in a subdirectory, specify it here.
|
||||||
|
TERRAFORM_DIRECTORY: .
|
||||||
|
|
||||||
|
# Pinned versions of tools to use.
|
||||||
|
# Check for new releases:
|
||||||
|
# - https://github.com/hashicorp/terraform/releases
|
||||||
|
# - https://github.com/fugue/regula/releases
|
||||||
|
# - https://github.com/terraform-linters/tflint/releases
|
||||||
|
TERRAFORM_VERSION: 1.2.6
|
||||||
|
REGULA_VERSION: 2.9.0
|
||||||
|
TFLINT_VERSION: 0.39.1
|
||||||
|
|
||||||
|
# Terraform configuration options
|
||||||
|
TERRAFORM_PARALLELISM: 10
|
||||||
|
|
||||||
|
# These variables are passed to Terraform based on GitHub information.
|
||||||
|
TF_VAR_repo: ${{ github.repository }}
|
||||||
|
|
||||||
|
# This workflow is triggered in the following ways.
|
||||||
|
on:
|
||||||
|
|
||||||
|
# Any push or merge to these branches.
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
- prod
|
||||||
|
|
||||||
|
# Any pull request targeting these branches (plan only).
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
- prod
|
||||||
|
|
||||||
|
|
||||||
|
# Any manual trigger on these branches.
|
||||||
|
workflow_dispatch:
|
||||||
|
branches:
|
||||||
|
- dev
|
||||||
|
- prod
|
||||||
|
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
# The rest of this workflow can operate without adjustments. Edit the
|
||||||
|
# below content at your own risk!
|
||||||
|
# -------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Used to connect to AWS IAM
|
||||||
|
permissions:
|
||||||
|
id-token: write
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
# Only run one workflow at a time for each Terraform state. This prevents
|
||||||
|
# lockfile conflicts, especially during PR vs push.
|
||||||
|
concurrency: terraform-${{ github.base_ref || github.ref }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
terraform:
|
||||||
|
|
||||||
|
name: 'Terraform'
|
||||||
|
|
||||||
|
# Change this if you need to run your deployment on-prem.
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
# Downloads the current repo code to the runner.
|
||||||
|
- name: Checkout Repo Code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
# Enable access to KVM, required to build an image
|
||||||
|
- name: Enable KVM group perms
|
||||||
|
run: |
|
||||||
|
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||||
|
sudo udevadm control --reload-rules
|
||||||
|
sudo udevadm trigger --name-match=kvm
|
||||||
|
|
||||||
|
# Login to AWS
|
||||||
|
- name: AWS Assume Role
|
||||||
|
uses: aws-actions/configure-aws-credentials@v1.6.1
|
||||||
|
with:
|
||||||
|
role-to-assume: ${{ env.AWS_ROLE_ARN }}
|
||||||
|
aws-region: ${{ env.AWS_REGION }}
|
||||||
|
|
||||||
|
# Install Nix
|
||||||
|
- name: Install Nix
|
||||||
|
uses: cachix/install-nix-action@v17
|
||||||
|
with:
|
||||||
|
extra_nix_config: |
|
||||||
|
substituters = s3://insert-cache-bucket https://cache.nixos.org/
|
||||||
|
trusted-public-keys = insert-cache-bucket:M6PsZjHXcLvbQyPUBLICKEYGVoNwI84g1FBQzouRU= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
|
||||||
|
|
||||||
|
# Build the image
|
||||||
|
- name: Build Image
|
||||||
|
run: nix build .#aws
|
||||||
|
|
||||||
|
# Copy the image to S3
|
||||||
|
- name: Upload Image to Cache
|
||||||
|
env:
|
||||||
|
NIX_CACHE_PRIVATE_KEY: ${{ secrets.NIX_CACHE_PRIVATE_KEY }}
|
||||||
|
run: |
|
||||||
|
echo "$NIX_CACHE_PRIVATE_KEY" > cache.key
|
||||||
|
nix store sign --key-file cache.key $(readlink result)
|
||||||
|
nix copy --to s3://t2-aws-nixos-test $(readlink result)
|
||||||
|
rm cache.key
|
||||||
|
|
||||||
|
# Exports all GitHub Secrets as environment variables prefixed by
|
||||||
|
# "TF_VAR_", which exposes them to Terraform. The name of each GitHub
|
||||||
|
# Secret must match its Terraform variable name exactly.
|
||||||
|
- name: Export Secrets to Terraform Variables
|
||||||
|
env:
|
||||||
|
ALL_SECRETS: ${{ toJson(secrets) }}
|
||||||
|
run: |
|
||||||
|
echo "$ALL_SECRETS" \
|
||||||
|
| jq "to_entries | .[] | \"TF_VAR_\" + ( .key | ascii_downcase ) + \"=\" + .value" \
|
||||||
|
| tr -d \" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# Installs the Terraform binary and some other accessory functions.
|
||||||
|
- name: Setup Terraform
|
||||||
|
uses: hashicorp/setup-terraform@v2
|
||||||
|
with:
|
||||||
|
terraform_version: ${{ env.TERRAFORM_VERSION }}
|
||||||
|
|
||||||
|
# Checks whether Terraform is formatted properly. If this fails, you
|
||||||
|
# should install the pre-commit hook.
|
||||||
|
- name: Check Formatting
|
||||||
|
run: |
|
||||||
|
terraform fmt -no-color -check -diff -recursive
|
||||||
|
|
||||||
|
# Downloads a Terraform code lint test.
|
||||||
|
- uses: terraform-linters/setup-tflint@v1
|
||||||
|
name: Setup TFLint
|
||||||
|
with:
|
||||||
|
tflint_version: v${{ env.TFLINT_VERSION }}
|
||||||
|
|
||||||
|
# Sets up linting with this codebase.
|
||||||
|
- name: Init TFLint
|
||||||
|
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
||||||
|
run: tflint --init
|
||||||
|
|
||||||
|
# Lints the current code.
|
||||||
|
- name: Run TFLint
|
||||||
|
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
||||||
|
run: |
|
||||||
|
tflint -f compact
|
||||||
|
find ./modules/* -type d -maxdepth 0 | xargs -I __ tflint -f compact --disable-rule=terraform_required_providers --disable-rule=terraform_required_version __
|
||||||
|
|
||||||
|
# Connects to remote state backend and download providers.
|
||||||
|
- name: Terraform Init
|
||||||
|
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
||||||
|
run: |
|
||||||
|
terraform init \
|
||||||
|
-backend-config="role_arn=${{ env.AWS_STATE_ROLE_ARN }}" \
|
||||||
|
-backend-config="region=us-east-1" \
|
||||||
|
-backend-config="workspace_key_prefix=accounts/${{ env.AWS_ACCOUNT_NUMBER }}/${{ github.repository }}" \
|
||||||
|
-backend-config="key=state.tfstate" \
|
||||||
|
-backend-config="dynamodb_table=global-tf-state-lock"
|
||||||
|
|
||||||
|
# Set the Terraform Workspace to the current branch name.
|
||||||
|
- name: Set Terraform Workspace
|
||||||
|
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
export WORKSPACE=${{ github.base_ref || github.ref_name }}
|
||||||
|
terraform workspace select ${WORKSPACE} || terraform workspace new $WORKSPACE
|
||||||
|
echo "TF_WORKSPACE=$(echo ${WORKSPACE} | sed 's/\//_/g')" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
# Checks differences between current code and infrastructure state.
|
||||||
|
- name: Terraform Plan
|
||||||
|
id: plan
|
||||||
|
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
||||||
|
run: |
|
||||||
|
terraform plan \
|
||||||
|
-input=false \
|
||||||
|
-no-color \
|
||||||
|
-out=tfplan \
|
||||||
|
-parallelism=${TERRAFORM_PARALLELISM} \
|
||||||
|
-var-file=variables-${TF_WORKSPACE}.tfvars
|
||||||
|
|
||||||
|
# Gets the results of the plan for pull requests.
|
||||||
|
- name: Terraform Show Plan
|
||||||
|
id: show
|
||||||
|
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
||||||
|
run: terraform show -no-color tfplan
|
||||||
|
|
||||||
|
# Adds the results of the plan to the pull request.
|
||||||
|
- name: Comment Plan
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
if: github.event_name == 'pull_request'
|
||||||
|
env:
|
||||||
|
STDOUT: "```terraform\n${{ steps.show.outputs.stdout }}```"
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
script: |
|
||||||
|
// 1. Retrieve existing bot comments for the PR
|
||||||
|
const { data: comments } = await github.rest.issues.listComments({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
})
|
||||||
|
const botComment = comments.find(comment => {
|
||||||
|
return comment.user.type === 'Bot' && comment.body.includes('Terraform Format and Style')
|
||||||
|
})
|
||||||
|
|
||||||
|
// 2. Prepare format of the comment
|
||||||
|
const output = `#### Terraform Format and Style 🖌\`${{ steps.fmt.outcome }}\`
|
||||||
|
#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
|
||||||
|
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`
|
||||||
|
<details><summary>Validation Output</summary>
|
||||||
|
|
||||||
|
\`\`\`\n
|
||||||
|
${{ steps.validate.outputs.stdout }}
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
|
||||||
|
|
||||||
|
<details><summary>Show Plan</summary>
|
||||||
|
|
||||||
|
\`\`\`\n
|
||||||
|
${process.env.PLAN}
|
||||||
|
\`\`\`
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
*Pusher: @${{ github.actor }}, Action: \`${{ github.event_name }}\`, Working Directory: \`${{ env.tf_actions_working_dir }}\`, Workflow: \`${{ github.workflow }}\`*`;
|
||||||
|
|
||||||
|
// 3. If we have a comment, update it, otherwise create a new one
|
||||||
|
if (botComment) {
|
||||||
|
github.rest.issues.updateComment({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
comment_id: botComment.id,
|
||||||
|
body: output
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
github.rest.issues.createComment({
|
||||||
|
issue_number: context.issue.number,
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
body: output
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
# Downloads Regula and checks whether the plan meets compliance requirements.
|
||||||
|
- name: Regula Compliance Check
|
||||||
|
shell: bash
|
||||||
|
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
||||||
|
run: |
|
||||||
|
REGULA_URL="https://github.com/fugue/regula/releases/download/v${REGULA_VERSION}/regula_${REGULA_VERSION}_Linux_x86_64.tar.gz"
|
||||||
|
curl -sL "$REGULA_URL" -o regula.tar.gz
|
||||||
|
tar xzf regula.tar.gz
|
||||||
|
terraform show -json tfplan | ./regula run
|
||||||
|
|
||||||
|
# Deploys infrastructure or changes to infrastructure.
|
||||||
|
- name: Terraform Apply
|
||||||
|
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
|
||||||
|
working-directory: ${{ env.TERRAFORM_DIRECTORY }}
|
||||||
|
run: |
|
||||||
|
terraform apply \
|
||||||
|
-auto-approve \
|
||||||
|
-input=false \
|
||||||
|
-parallelism=${TERRAFORM_PARALLELISM} \
|
||||||
|
tfplan
|
@ -1,93 +1,68 @@
|
|||||||
# The Flame
|
# The Flame
|
||||||
# System configuration for an Oracle free server
|
# System configuration for an Oracle free server
|
||||||
|
|
||||||
# See [readme](../README.md) to explain how this file works.
|
|
||||||
|
|
||||||
# How to install:
|
# How to install:
|
||||||
# https://blog.korfuri.fr/posts/2022/08/nixos-on-an-oracle-free-tier-ampere-machine/
|
# https://blog.korfuri.fr/posts/2022/08/nixos-on-an-oracle-free-tier-ampere-machine/
|
||||||
# These days, probably use nixos-anywhere instead.
|
|
||||||
|
|
||||||
{
|
{ self, ... }:
|
||||||
inputs,
|
|
||||||
globals,
|
|
||||||
overlays,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
inputs.nixpkgs.lib.nixosSystem rec {
|
self.inputs.nixpkgs.lib.nixosSystem {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
specialArgs = {
|
specialArgs = { };
|
||||||
pkgs-caddy = import inputs.nixpkgs-caddy { inherit system; };
|
|
||||||
};
|
|
||||||
modules = [
|
modules = [
|
||||||
globals
|
self.inputs.home-manager.nixosModules.home-manager
|
||||||
inputs.home-manager.nixosModules.home-manager
|
self.nixosModules.globals
|
||||||
../../modules/common
|
self.nixosModules.common
|
||||||
../../modules/nixos
|
self.nixosModules.nixos
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = overlays;
|
|
||||||
|
|
||||||
# Hardware
|
# Hardware
|
||||||
server = true;
|
server = true;
|
||||||
networking.hostName = "flame";
|
networking.hostName = "flame";
|
||||||
|
|
||||||
# Not sure what's necessary but too afraid to remove anything
|
imports =
|
||||||
imports = [ (inputs.nixpkgs + "/nixos/modules/profiles/qemu-guest.nix") ];
|
[ (self.inputs.nixpkgs + "/nixos/modules/profiles/qemu-guest.nix") ];
|
||||||
boot.initrd.availableKernelModules = [
|
boot.initrd.availableKernelModules = [ "xhci_pci" "virtio_pci" "usbhid" ];
|
||||||
"xhci_pci"
|
|
||||||
"virtio_pci"
|
|
||||||
"usbhid"
|
|
||||||
];
|
|
||||||
|
|
||||||
# File systems must be declared in order to boot
|
|
||||||
|
|
||||||
# This is the root filesystem containing NixOS
|
|
||||||
# I forgot to set a clean label for it
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-uuid/e1b6bd50-306d-429a-9f45-78f57bc597c3";
|
device = "/dev/disk/by-uuid/e1b6bd50-306d-429a-9f45-78f57bc597c3";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
# This is the boot filesystem for systemd-boot
|
|
||||||
fileSystems."/boot" = {
|
fileSystems."/boot" = {
|
||||||
device = "/dev/disk/by-uuid/D5CA-237A";
|
device = "/dev/disk/by-uuid/D5CA-237A";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Theming
|
# Theming
|
||||||
|
|
||||||
# Server doesn't require GUI
|
|
||||||
gui.enable = false;
|
gui.enable = false;
|
||||||
|
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
|
||||||
|
|
||||||
# Still require colors for programs like Neovim, K9S
|
# Disable passwords, only use SSH key
|
||||||
theme = {
|
publicKey =
|
||||||
colors = (import ../../colorscheme/gruvbox).dark;
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
||||||
};
|
|
||||||
|
|
||||||
# Programs and services
|
# Programs and services
|
||||||
atuin.enable = true;
|
|
||||||
cloudflare.enable = true; # Proxy traffic with Cloudflare
|
cloudflare.enable = true; # Proxy traffic with Cloudflare
|
||||||
dotfiles.enable = true; # Clone dotfiles
|
dotfiles.enable = true; # Clone dotfiles
|
||||||
neovim.enable = true;
|
neovim.enable = true;
|
||||||
giteaRunner.enable = true;
|
|
||||||
services.caddy.enable = true;
|
services.caddy.enable = true;
|
||||||
services.grafana.enable = true;
|
services.grafana.enable = true;
|
||||||
services.thelounge.enable = true;
|
services.prometheus.enable = true;
|
||||||
services.openssh.enable = true;
|
|
||||||
services.victoriametrics.enable = true;
|
|
||||||
services.influxdb2.enable = true;
|
|
||||||
services.gitea.enable = true;
|
services.gitea.enable = true;
|
||||||
services.vaultwarden.enable = true;
|
services.vaultwarden.enable = true;
|
||||||
services.minecraft-server.enable = true; # Setup Minecraft server
|
services.minecraft-server.enable = true; # Setup Minecraft server
|
||||||
|
|
||||||
# Allows private remote access over the internet
|
|
||||||
cloudflareTunnel = {
|
cloudflareTunnel = {
|
||||||
enable = true;
|
enable = true;
|
||||||
id = "bd250ee1-ed2e-42d2-b627-039f1eb5a4d2";
|
id = "bd250ee1-ed2e-42d2-b627-039f1eb5a4d2";
|
||||||
credentialsFile = ../../private/cloudflared-flame.age;
|
credentialsFile = ../../private/cloudflared-flame.age;
|
||||||
ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK/6oyVqjFGX3Uvrc3VS8J9sphxzAnRzKC85xgkHfYgR3TK6qBGXzHrknEj21xeZrr3G2y1UsGzphWJd9ZfIcdA= open-ssh-ca@cloudflareaccess.org";
|
ca =
|
||||||
|
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK/6oyVqjFGX3Uvrc3VS8J9sphxzAnRzKC85xgkHfYgR3TK6qBGXzHrknEj21xeZrr3G2y1UsGzphWJd9ZfIcdA= open-ssh-ca@cloudflareaccess.org";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
giteaRunner.enable = true;
|
||||||
|
|
||||||
# Nextcloud backup config
|
# Nextcloud backup config
|
||||||
backup.s3 = {
|
backup.s3 = {
|
||||||
endpoint = "s3.us-west-002.backblazeb2.com";
|
endpoint = "s3.us-west-002.backblazeb2.com";
|
||||||
@ -95,11 +70,6 @@ inputs.nixpkgs.lib.nixosSystem rec {
|
|||||||
accessKeyId = "0026b0e73b2e2c80000000005";
|
accessKeyId = "0026b0e73b2e2c80000000005";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Disable passwords, only use SSH key
|
|
||||||
publicKeys = [
|
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal"
|
|
||||||
];
|
|
||||||
|
|
||||||
# # Wireguard config for Transmission
|
# # Wireguard config for Transmission
|
||||||
# wireguard.enable = true;
|
# wireguard.enable = true;
|
||||||
# networking.wireguard.interfaces.wg0 = {
|
# networking.wireguard.interfaces.wg0 = {
|
||||||
@ -128,6 +98,10 @@ inputs.nixpkgs.lib.nixosSystem rec {
|
|||||||
|
|
||||||
# # VPN port forwarding
|
# # VPN port forwarding
|
||||||
# services.transmission.settings.peer-port = 57599;
|
# services.transmission.settings.peer-port = 57599;
|
||||||
|
|
||||||
|
# # Grant access to Transmission directories from Jellyfin
|
||||||
|
# users.users.jellyfin.extraGroups = [ "transmission" ];
|
||||||
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,35 +1,27 @@
|
|||||||
# The Hydra
|
# The Hydra
|
||||||
# System configuration for WSL
|
# System configuration for WSL
|
||||||
|
|
||||||
# See [readme](../README.md) to explain how this file works.
|
{ self, ... }:
|
||||||
|
|
||||||
{
|
self.inputs.nixpkgs.lib.nixosSystem {
|
||||||
inputs,
|
|
||||||
globals,
|
|
||||||
overlays,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { };
|
specialArgs = { };
|
||||||
modules = [
|
modules = [
|
||||||
../../modules/common
|
self.inputs.wsl.nixosModules.wsl
|
||||||
../../modules/nixos
|
self.inputs.home-manager.nixosModules.home-manager
|
||||||
../../modules/wsl
|
self.nixosModules.globals
|
||||||
globals
|
self.nixosModules.common
|
||||||
inputs.wsl.nixosModules.wsl
|
self.nixosModules.nixos
|
||||||
inputs.home-manager.nixosModules.home-manager
|
self.nixosModules.wsl
|
||||||
{
|
{
|
||||||
networking.hostName = "hydra";
|
networking.hostName = "hydra";
|
||||||
nixpkgs.overlays = overlays;
|
|
||||||
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
||||||
gui.enable = false;
|
gui.enable = false;
|
||||||
theme = {
|
theme = {
|
||||||
colors = (import ../../colorscheme/gruvbox).dark;
|
colors = (import ../../colorscheme/gruvbox).dark;
|
||||||
dark = true;
|
dark = true;
|
||||||
};
|
};
|
||||||
passwordHash = inputs.nixpkgs.lib.fileContents ../../misc/password.sha512;
|
passwordHash = inputs.nixpkgs.lib.fileContents ../../password.sha512;
|
||||||
wsl = {
|
wsl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wslConf.automount.root = "/mnt";
|
wslConf.automount.root = "/mnt";
|
||||||
@ -37,7 +29,8 @@ inputs.nixpkgs.lib.nixosSystem {
|
|||||||
startMenuLaunchers = true;
|
startMenuLaunchers = true;
|
||||||
nativeSystemd = true;
|
nativeSystemd = true;
|
||||||
wslConf.network.generateResolvConf = true; # Turn off if it breaks VPN
|
wslConf.network.generateResolvConf = true; # Turn off if it breaks VPN
|
||||||
interop.includePath = false; # Including Windows PATH will slow down Neovim command mode
|
interop.includePath =
|
||||||
|
false; # Including Windows PATH will slow down Neovim command mode
|
||||||
};
|
};
|
||||||
|
|
||||||
neovim.enable = true;
|
neovim.enable = true;
|
||||||
@ -45,6 +38,7 @@ inputs.nixpkgs.lib.nixosSystem {
|
|||||||
mail.aerc.enable = true;
|
mail.aerc.enable = true;
|
||||||
mail.himalaya.enable = true;
|
mail.himalaya.enable = true;
|
||||||
dotfiles.enable = true;
|
dotfiles.enable = true;
|
||||||
|
nixlang.enable = true;
|
||||||
lua.enable = true;
|
lua.enable = true;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
@ -1,56 +1,46 @@
|
|||||||
# The Looking Glass
|
# The Looking Glass
|
||||||
# System configuration for my work Macbook
|
# System configuration for my work Macbook
|
||||||
|
|
||||||
{
|
{ self, ... }:
|
||||||
inputs,
|
|
||||||
globals,
|
|
||||||
overlays,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
inputs.darwin.lib.darwinSystem {
|
self.inputs.darwin.lib.darwinSystem {
|
||||||
system = "aarch64-darwin";
|
system = "x86_64-darwin";
|
||||||
specialArgs = { };
|
specialArgs = { };
|
||||||
modules = [
|
modules = [
|
||||||
../../modules/common
|
self.inputs.home-manager.darwinModules.home-manager
|
||||||
../../modules/darwin
|
self.nixosModules.common
|
||||||
(
|
self.nixosModules.darwin
|
||||||
globals
|
({ config, lib, ... }: {
|
||||||
// rec {
|
config = rec {
|
||||||
user = "Noah.Masur";
|
user = lib.mkForce "Noah.Masur";
|
||||||
gitName = "Noah-Masur_1701";
|
gitName = lib.mkForce "Noah-Masur_1701";
|
||||||
gitEmail = "${user}@take2games.com";
|
gitEmail = lib.mkForce "${user}@take2games.com";
|
||||||
}
|
nixpkgs.overlays = [ self.inputs.firefox-darwin.overlay ];
|
||||||
)
|
networking.hostName = "lookingglass";
|
||||||
inputs.home-manager.darwinModules.home-manager
|
identityFile = "/Users/${user}/.ssh/id_ed25519";
|
||||||
{
|
gui.enable = true;
|
||||||
nixpkgs.overlays = [ inputs.firefox-darwin.overlay ] ++ overlays;
|
theme = {
|
||||||
networking.hostName = "lookingglass";
|
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
||||||
identityFile = "/Users/Noah.Masur/.ssh/id_ed25519";
|
dark = true;
|
||||||
gui.enable = true;
|
};
|
||||||
theme = {
|
mail.user = globals.user;
|
||||||
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
charm.enable = true;
|
||||||
dark = true;
|
neovim.enable = true;
|
||||||
|
mail.enable = true;
|
||||||
|
mail.aerc.enable = true;
|
||||||
|
mail.himalaya.enable = false;
|
||||||
|
kitty.enable = true;
|
||||||
|
discord.enable = true;
|
||||||
|
firefox.enable = true;
|
||||||
|
dotfiles.enable = true;
|
||||||
|
nixlang.enable = true;
|
||||||
|
terraform.enable = true;
|
||||||
|
python.enable = true;
|
||||||
|
lua.enable = true;
|
||||||
|
kubernetes.enable = true;
|
||||||
|
_1password.enable = true;
|
||||||
|
slack.enable = true;
|
||||||
};
|
};
|
||||||
mail.user = globals.user;
|
})
|
||||||
atuin.enable = true;
|
|
||||||
charm.enable = true;
|
|
||||||
neovim.enable = true;
|
|
||||||
mail.enable = true;
|
|
||||||
mail.aerc.enable = true;
|
|
||||||
mail.himalaya.enable = false;
|
|
||||||
kitty.enable = true;
|
|
||||||
discord.enable = true;
|
|
||||||
firefox.enable = true;
|
|
||||||
dotfiles.enable = true;
|
|
||||||
terraform.enable = true;
|
|
||||||
python.enable = true;
|
|
||||||
rust.enable = true;
|
|
||||||
lua.enable = true;
|
|
||||||
obsidian.enable = true;
|
|
||||||
kubernetes.enable = true;
|
|
||||||
_1password.enable = true;
|
|
||||||
slack.enable = true;
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,16 @@
|
|||||||
# The Staff
|
# The Staff
|
||||||
# ISO configuration for my USB drive
|
# ISO configuration for my USB drive
|
||||||
|
|
||||||
{
|
{ self, system, ... }:
|
||||||
inputs,
|
|
||||||
system,
|
|
||||||
overlays,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
inputs.nixos-generators.nixosGenerate {
|
self.inputs.nixos-generators.nixosGenerate {
|
||||||
inherit system;
|
inherit system;
|
||||||
format = "install-iso";
|
format = "install-iso";
|
||||||
modules = [
|
modules = [
|
||||||
{
|
self.nixosModules.global
|
||||||
nixpkgs.overlays = overlays;
|
self.nixosModules.common
|
||||||
|
self.nixosModules.nixos
|
||||||
|
({ config, pkgs, ... }: {
|
||||||
networking.hostName = "staff";
|
networking.hostName = "staff";
|
||||||
users.extraUsers.root.openssh.authorizedKeys.keys = [
|
users.extraUsers.root.openssh.authorizedKeys.keys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"
|
||||||
@ -29,25 +26,20 @@ inputs.nixos-generators.nixosGenerate {
|
|||||||
PermitRootLogin = "yes";
|
PermitRootLogin = "yes";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
environment.systemPackages =
|
environment.systemPackages = with pkgs; [
|
||||||
let
|
git
|
||||||
pkgs = import inputs.nixpkgs { inherit system overlays; };
|
vim
|
||||||
in
|
wget
|
||||||
with pkgs;
|
curl
|
||||||
[
|
(import ../../modules/common/neovim/package {
|
||||||
git
|
inherit pkgs;
|
||||||
vim
|
colors = (import ../../colorscheme/gruvbox).dark;
|
||||||
wget
|
})
|
||||||
curl
|
];
|
||||||
(import ../../modules/common/neovim/package {
|
|
||||||
inherit pkgs;
|
|
||||||
colors = (import ../../colorscheme/gruvbox).dark;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
nix.extraOptions = ''
|
nix.extraOptions = ''
|
||||||
experimental-features = nix-command flakes
|
experimental-features = nix-command flakes
|
||||||
warn-dirty = false
|
warn-dirty = false
|
||||||
'';
|
'';
|
||||||
}
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,38 +1,24 @@
|
|||||||
# The Swan
|
# The Swan
|
||||||
# System configuration for my home NAS server
|
# System configuration for my home NAS server
|
||||||
|
|
||||||
{
|
{ self, ... }:
|
||||||
inputs,
|
|
||||||
globals,
|
|
||||||
overlays,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
self.inputs.nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { };
|
specialArgs = { };
|
||||||
modules = [
|
modules = [
|
||||||
globals
|
self.inputs.home-manager.nixosModules.home-manager
|
||||||
inputs.home-manager.nixosModules.home-manager
|
self.inputs.disko.nixosModules.disko
|
||||||
inputs.disko.nixosModules.disko
|
self.nixosModules.globals
|
||||||
../../modules/common
|
self.nixosModules.common
|
||||||
../../modules/nixos
|
self.nixosModules.nixos
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = overlays;
|
|
||||||
|
|
||||||
# Hardware
|
# Hardware
|
||||||
server = true;
|
server = true;
|
||||||
physical = true;
|
|
||||||
networking.hostName = "swan";
|
networking.hostName = "swan";
|
||||||
|
|
||||||
# Not sure what's necessary but too afraid to remove anything
|
boot.initrd.availableKernelModules =
|
||||||
boot.initrd.availableKernelModules = [
|
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
|
||||||
"xhci_pci"
|
|
||||||
"ahci"
|
|
||||||
"nvme"
|
|
||||||
"usb_storage"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Required for transcoding
|
# Required for transcoding
|
||||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
@ -43,78 +29,43 @@ inputs.nixpkgs.lib.nixosSystem {
|
|||||||
"amdgpu.cik_support=1"
|
"amdgpu.cik_support=1"
|
||||||
"amdgpu.dc=1"
|
"amdgpu.dc=1"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Required binary blobs to boot on this machine
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
|
||||||
# Prioritize efficiency over performance
|
|
||||||
powerManagement.cpuFreqGovernor = "powersave";
|
powerManagement.cpuFreqGovernor = "powersave";
|
||||||
|
|
||||||
# Allow firmware updates
|
|
||||||
hardware.cpu.intel.updateMicrocode = true;
|
hardware.cpu.intel.updateMicrocode = true;
|
||||||
|
|
||||||
# ZFS
|
# ZFS
|
||||||
zfs.enable = true;
|
zfs.enable = true;
|
||||||
# Generated with: head -c 8 /etc/machine-id
|
# Generated with: head -c 8 /etc/machine-id
|
||||||
networking.hostId = "600279f4"; # Random ID required for ZFS
|
networking.hostId = "600279f4"; # Random ID required for ZFS
|
||||||
|
|
||||||
# Sets root ext4 filesystem instead of declaring it manually
|
|
||||||
disko = {
|
disko = {
|
||||||
enableConfig = true;
|
enableConfig = true;
|
||||||
devices = (import ../../disks/root.nix { disk = "/dev/nvme0n1"; });
|
devices = (import ../../disks/root.nix { disk = "/dev/nvme0n1"; });
|
||||||
};
|
};
|
||||||
|
boot.zfs.extraPools = [ "tank" ];
|
||||||
|
|
||||||
boot.zfs = {
|
|
||||||
# Automatically load the ZFS pool on boot
|
|
||||||
extraPools = [ "tank" ];
|
|
||||||
# Only try to decrypt datasets with keyfiles
|
|
||||||
requestEncryptionCredentials = [
|
|
||||||
"tank/archive"
|
|
||||||
"tank/generic"
|
|
||||||
"tank/nextcloud"
|
|
||||||
"tank/generic/git"
|
|
||||||
];
|
|
||||||
# If password is requested and fails, continue to boot eventually
|
|
||||||
passwordTimeout = 300;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Theming
|
|
||||||
|
|
||||||
# Server doesn't require GUI
|
|
||||||
gui.enable = false;
|
gui.enable = false;
|
||||||
|
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
|
||||||
# Still require colors for programs like Neovim, K9S
|
|
||||||
theme = {
|
|
||||||
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Programs and services
|
|
||||||
atuin.enable = true;
|
|
||||||
neovim.enable = true;
|
neovim.enable = true;
|
||||||
cloudflare.enable = true;
|
cloudflare.enable = true;
|
||||||
dotfiles.enable = true;
|
dotfiles.enable = true;
|
||||||
arrs.enable = true;
|
arrs.enable = true;
|
||||||
services.bind.enable = true;
|
|
||||||
services.caddy.enable = true;
|
services.caddy.enable = true;
|
||||||
services.jellyfin.enable = true;
|
services.jellyfin.enable = true;
|
||||||
services.nextcloud.enable = true;
|
services.nextcloud.enable = true;
|
||||||
services.calibre-web.enable = true;
|
services.calibre-web.enable = true;
|
||||||
services.openssh.enable = true;
|
services.prometheus.enable = true;
|
||||||
services.prometheus.enable = false;
|
|
||||||
services.vmagent.enable = true;
|
|
||||||
services.samba.enable = true;
|
services.samba.enable = true;
|
||||||
services.paperless.enable = true;
|
|
||||||
services.postgresql.enable = true;
|
|
||||||
|
|
||||||
# Allows private remote access over the internet
|
|
||||||
cloudflareTunnel = {
|
cloudflareTunnel = {
|
||||||
enable = true;
|
enable = true;
|
||||||
id = "646754ac-2149-4a58-b51a-e1d0a1f3ade2";
|
id = "646754ac-2149-4a58-b51a-e1d0a1f3ade2";
|
||||||
credentialsFile = ../../private/cloudflared-swan.age;
|
credentialsFile = ../../private/cloudflared-swan.age;
|
||||||
ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCHF/UMtJqPFrf6f6GRY0ZFnkCW7b6sYgUTjTtNfRj1RdmNic1NoJZql7y6BrqQinZvy7nsr1UFDNWoHn6ah3tg= open-ssh-ca@cloudflareaccess.org";
|
ca =
|
||||||
|
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCHF/UMtJqPFrf6f6GRY0ZFnkCW7b6sYgUTjTtNfRj1RdmNic1NoJZql7y6BrqQinZvy7nsr1UFDNWoHn6ah3tg= open-ssh-ca@cloudflareaccess.org";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Send regular backups and litestream for DBs to an S3-like bucket
|
|
||||||
backup.s3 = {
|
backup.s3 = {
|
||||||
endpoint = "s3.us-west-002.backblazeb2.com";
|
endpoint = "s3.us-west-002.backblazeb2.com";
|
||||||
bucket = "noahmasur-backup";
|
bucket = "noahmasur-backup";
|
||||||
@ -122,9 +73,8 @@ inputs.nixpkgs.lib.nixosSystem {
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Disable passwords, only use SSH key
|
# Disable passwords, only use SSH key
|
||||||
publicKeys = [
|
publicKey =
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
||||||
];
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,52 +1,28 @@
|
|||||||
# The Tempest
|
# The Tempest
|
||||||
# System configuration for my desktop
|
# System configuration for my desktop
|
||||||
|
|
||||||
{
|
{ self, ... }:
|
||||||
inputs,
|
|
||||||
globals,
|
|
||||||
overlays,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
inputs.nixpkgs.lib.nixosSystem {
|
self.inputs.nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
modules = [
|
modules = [
|
||||||
globals
|
self.inputs.home-manager.nixosModules.home-manager
|
||||||
inputs.home-manager.nixosModules.home-manager
|
self.nixosModules.globals
|
||||||
../../modules/common
|
self.nixosModules.common
|
||||||
../../modules/nixos
|
self.nixosModules.nixos
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = overlays;
|
|
||||||
|
|
||||||
# Hardware
|
# Hardware
|
||||||
physical = true;
|
physical = true;
|
||||||
networking.hostName = "tempest";
|
networking.hostName = "tempest";
|
||||||
|
|
||||||
# Not sure what's necessary but too afraid to remove anything
|
boot.initrd.availableKernelModules =
|
||||||
boot.initrd.availableKernelModules = [
|
[ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
"nvme"
|
|
||||||
"xhci_pci"
|
|
||||||
"ahci"
|
|
||||||
"usb_storage"
|
|
||||||
"usbhid"
|
|
||||||
"sd_mod"
|
|
||||||
];
|
|
||||||
|
|
||||||
# Graphics and VMs
|
|
||||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
boot.kernelModules = [ "kvm-amd" ];
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||||
|
|
||||||
# Required binary blobs to boot on this machine
|
|
||||||
hardware.enableRedistributableFirmware = true;
|
hardware.enableRedistributableFirmware = true;
|
||||||
|
|
||||||
# Prioritize performance over efficiency
|
|
||||||
powerManagement.cpuFreqGovernor = "performance";
|
powerManagement.cpuFreqGovernor = "performance";
|
||||||
|
|
||||||
# Allow firmware updates
|
|
||||||
hardware.cpu.amd.updateMicrocode = true;
|
hardware.cpu.amd.updateMicrocode = true;
|
||||||
|
|
||||||
# Helps reduce GPU fan noise under idle loads
|
|
||||||
hardware.fancontrol.enable = true;
|
hardware.fancontrol.enable = true;
|
||||||
hardware.fancontrol.config = ''
|
hardware.fancontrol.config = ''
|
||||||
# Configuration file generated by pwmconfig, changes will be lost
|
# Configuration file generated by pwmconfig, changes will be lost
|
||||||
@ -63,38 +39,30 @@ inputs.nixpkgs.lib.nixosSystem {
|
|||||||
MAXPWM=hwmon0/pwm1=240
|
MAXPWM=hwmon0/pwm1=240
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# File systems must be declared in order to boot
|
|
||||||
|
|
||||||
# This is the root filesystem containing NixOS
|
|
||||||
fileSystems."/" = {
|
fileSystems."/" = {
|
||||||
device = "/dev/disk/by-label/nixos";
|
device = "/dev/disk/by-label/nixos";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
# This is the boot filesystem for Grub
|
|
||||||
fileSystems."/boot" = {
|
fileSystems."/boot" = {
|
||||||
device = "/dev/disk/by-label/boot";
|
device = "/dev/disk/by-label/boot";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Secrets must be prepared ahead before deploying
|
# Must be prepared ahead
|
||||||
passwordHash = inputs.nixpkgs.lib.fileContents ../../misc/password.sha512;
|
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
||||||
|
passwordHash = self.inputs.nixpkgs.lib.fileContents ../../password.sha512;
|
||||||
|
|
||||||
# Theming
|
# Theming
|
||||||
|
|
||||||
# Turn on all features related to desktop and graphical applications
|
|
||||||
gui.enable = true;
|
gui.enable = true;
|
||||||
|
|
||||||
# Set the system-wide theme, also used for non-graphical programs
|
|
||||||
theme = {
|
theme = {
|
||||||
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
||||||
dark = true;
|
dark = true;
|
||||||
};
|
};
|
||||||
wallpaper = "${inputs.wallpapers}/gruvbox/road.jpg";
|
wallpaper = "${self.inputs.wallpapers}/gruvbox/road.jpg";
|
||||||
gtk.theme.name = inputs.nixpkgs.lib.mkDefault "Adwaita-dark";
|
gtk.theme.name = self.inputs.nixpkgs.lib.mkDefault "Adwaita-dark";
|
||||||
|
|
||||||
# Programs and services
|
# Programs and services
|
||||||
atuin.enable = true;
|
|
||||||
charm.enable = true;
|
charm.enable = true;
|
||||||
neovim.enable = true;
|
neovim.enable = true;
|
||||||
media.enable = true;
|
media.enable = true;
|
||||||
@ -110,8 +78,7 @@ inputs.nixpkgs.lib.nixosSystem {
|
|||||||
mail.himalaya.enable = true;
|
mail.himalaya.enable = true;
|
||||||
keybase.enable = true;
|
keybase.enable = true;
|
||||||
mullvad.enable = false;
|
mullvad.enable = false;
|
||||||
rust.enable = true;
|
nixlang.enable = true;
|
||||||
terraform.enable = true;
|
|
||||||
yt-dlp.enable = true;
|
yt-dlp.enable = true;
|
||||||
gaming = {
|
gaming = {
|
||||||
dwarf-fortress.enable = true;
|
dwarf-fortress.enable = true;
|
||||||
@ -119,23 +86,18 @@ inputs.nixpkgs.lib.nixosSystem {
|
|||||||
steam.enable = true;
|
steam.enable = true;
|
||||||
legendary.enable = true;
|
legendary.enable = true;
|
||||||
lutris.enable = true;
|
lutris.enable = true;
|
||||||
|
leagueoflegends.enable = true;
|
||||||
ryujinx.enable = true;
|
ryujinx.enable = true;
|
||||||
};
|
};
|
||||||
services.vmagent.enable = true; # Enables Prometheus metrics
|
|
||||||
services.openssh.enable = true; # Required for Cloudflare tunnel and identity file
|
|
||||||
|
|
||||||
# Allows private remote access over the internet
|
|
||||||
cloudflareTunnel = {
|
cloudflareTunnel = {
|
||||||
enable = true;
|
enable = true;
|
||||||
id = "ac133a82-31fb-480c-942a-cdbcd4c58173";
|
id = "ac133a82-31fb-480c-942a-cdbcd4c58173";
|
||||||
credentialsFile = ../../private/cloudflared-tempest.age;
|
credentialsFile = ../../private/cloudflared-tempest.age;
|
||||||
ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPY6C0HmdFCaxYtJxFr3qV4/1X4Q8KrYQ1hlme3u1hJXK+xW+lc9Y9glWHrhiTKilB7carYTB80US0O47gI5yU4= open-ssh-ca@cloudflareaccess.org";
|
ca =
|
||||||
|
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPY6C0HmdFCaxYtJxFr3qV4/1X4Q8KrYQ1hlme3u1hJXK+xW+lc9Y9glWHrhiTKilB7carYTB80US0O47gI5yU4= open-ssh-ca@cloudflareaccess.org";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Allows requests to force machine to wake up
|
|
||||||
# This network interface might change, needs to be set specifically for each machine.
|
|
||||||
# Or set usePredictableInterfaceNames = false
|
|
||||||
networking.interfaces.enp5s0.wakeOnLan.enable = true;
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
# Miscellaneous
|
|
||||||
|
|
||||||
These files contain important data sourced by the configuration, or simply
|
|
||||||
information to store for safekeeping later.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Creating hashed password for [password.sha512](./password.sha512):
|
|
||||||
|
|
||||||
```
|
|
||||||
mkpasswd -m sha-512
|
|
||||||
```
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Getting key for [public-keys](./public-keys):
|
|
||||||
|
|
||||||
```
|
|
||||||
ssh-keyscan -t ed25519 <hostname>
|
|
||||||
```
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
|||||||
Profile 1: (active)
|
|
||||||
Name: n/a
|
|
||||||
Report Rate: 1000Hz
|
|
||||||
Resolutions:
|
|
||||||
0: 400dpi (active) (default)
|
|
||||||
1: 800dpi
|
|
||||||
2: 1600dpi
|
|
||||||
3: 2400dpi
|
|
||||||
4: 0dpi
|
|
||||||
Button: 0 is mapped to 'button 1'
|
|
||||||
Button: 1 is mapped to 'button 2'
|
|
||||||
Button: 2 is mapped to 'button 3'
|
|
||||||
Button: 3 is mapped to 'button 4'
|
|
||||||
Button: 4 is mapped to 'button 5'
|
|
||||||
Button: 5 is mapped to macro '↕F11'
|
|
||||||
Button: 6 is mapped to macro '↕VOLUMEDOWN'
|
|
||||||
Button: 7 is mapped to macro '↕VOLUMEUP'
|
|
||||||
Button: 8 is mapped to 'unknown'
|
|
||||||
Button: 9 is mapped to 'wheel-right'
|
|
||||||
Button: 10 is mapped to 'wheel-left'
|
|
||||||
LED: 0, depth: monochrome, mode: on, color: 000000
|
|
||||||
LED: 1, depth: monochrome, mode: on, color: 000000
|
|
||||||
LED: 2, depth: monochrome, mode: on, color: 000000
|
|
@ -5,5 +5,4 @@
|
|||||||
| [common](./common/default.nix) | User programs and OS-agnostic configuration |
|
| [common](./common/default.nix) | User programs and OS-agnostic configuration |
|
||||||
| [darwin](./darwin/default.nix) | macOS-specific configuration |
|
| [darwin](./darwin/default.nix) | macOS-specific configuration |
|
||||||
| [nixos](./nixos/default.nix) | NixOS-specific configuration |
|
| [nixos](./nixos/default.nix) | NixOS-specific configuration |
|
||||||
| [wsl](./wsl/default.nix) | WSL-specific configuration |
|
|
||||||
|
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
{ ... }:
|
|
||||||
{
|
|
||||||
# AWS settings require this
|
|
||||||
permitRootLogin = "prohibit-password";
|
|
||||||
|
|
||||||
# Make sure disk size is large enough
|
|
||||||
# https://github.com/nix-community/nixos-generators/issues/150
|
|
||||||
amazonImage.sizeMB = 16 * 1024;
|
|
||||||
}
|
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
_1password = {
|
_1password = {
|
||||||
@ -15,28 +9,12 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf (config.gui.enable && config._1password.enable) {
|
config = lib.mkIf
|
||||||
unfreePackages = [
|
(config.gui.enable && config._1password.enable && pkgs.stdenv.isLinux) {
|
||||||
"1password"
|
unfreePackages = [ "1password" "_1password-gui" ];
|
||||||
"_1password-gui"
|
home-manager.users.${config.user} = {
|
||||||
"1password-cli"
|
home.packages = with pkgs; [ _1password-gui ];
|
||||||
];
|
};
|
||||||
home-manager.users.${config.user} = {
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
_1password-gui
|
|
||||||
_1password
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# https://1password.community/discussion/135462/firefox-extension-does-not-connect-to-linux-app
|
|
||||||
# On Mac, does not apply: https://1password.community/discussion/142794/app-and-browser-integration
|
|
||||||
# However, the button doesn't work either:
|
|
||||||
# https://1password.community/discussion/140735/extending-support-for-trusted-web-browsers
|
|
||||||
environment.etc."1password/custom_allowed_browsers".text = ''
|
|
||||||
${
|
|
||||||
config.home-manager.users.${config.user}.programs.firefox.package
|
|
||||||
}/Applications/Firefox.app/Contents/MacOS/firefox
|
|
||||||
firefox
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
alacritty = {
|
alacritty = {
|
||||||
@ -34,9 +28,7 @@
|
|||||||
opacity = 1.0;
|
opacity = 1.0;
|
||||||
};
|
};
|
||||||
scrolling.history = 10000;
|
scrolling.history = 10000;
|
||||||
font = {
|
font = { size = 14.0; };
|
||||||
size = 14.0;
|
|
||||||
};
|
|
||||||
key_bindings = [
|
key_bindings = [
|
||||||
# Used for word completion in fish_user_key_bindings
|
# Used for word completion in fish_user_key_bindings
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{ ... }:
|
{ ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./1password.nix
|
./1password.nix
|
||||||
@ -13,4 +12,5 @@
|
|||||||
./slack.nix
|
./slack.nix
|
||||||
./yt-dlp.nix
|
./yt-dlp.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
discord = {
|
discord = {
|
||||||
@ -17,8 +11,8 @@
|
|||||||
|
|
||||||
config = lib.mkIf (config.gui.enable && config.discord.enable) {
|
config = lib.mkIf (config.gui.enable && config.discord.enable) {
|
||||||
unfreePackages = [ "discord" ];
|
unfreePackages = [ "discord" ];
|
||||||
environment.systemPackages = [ pkgs.discord ];
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
home.packages = with pkgs; [ discord ];
|
||||||
xdg.configFile."discord/settings.json".text = ''
|
xdg.configFile."discord/settings.json".text = ''
|
||||||
{
|
{
|
||||||
"BACKGROUND_COLOR": "#202225",
|
"BACKGROUND_COLOR": "#202225",
|
||||||
|
@ -1,9 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -27,50 +22,57 @@
|
|||||||
|
|
||||||
programs.firefox = {
|
programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = if pkgs.stdenv.isDarwin then pkgs.firefox-bin else pkgs.firefox;
|
package =
|
||||||
|
if pkgs.stdenv.isDarwin then pkgs.firefox-bin else pkgs.firefox;
|
||||||
profiles.default = {
|
profiles.default = {
|
||||||
id = 0;
|
id = 0;
|
||||||
name = "default";
|
name = "default";
|
||||||
isDefault = true;
|
isDefault = true;
|
||||||
# https://nur.nix-community.org/repos/rycee/
|
|
||||||
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||||
(lib.mkIf config._1password.enable onepassword-password-manager)
|
ublock-origin
|
||||||
darkreader
|
vimium
|
||||||
don-t-fuck-with-paste
|
|
||||||
facebook-container
|
|
||||||
markdownload
|
|
||||||
multi-account-containers
|
multi-account-containers
|
||||||
|
facebook-container
|
||||||
|
(lib.mkIf config._1password.enable onepassword-password-manager)
|
||||||
okta-browser-plugin
|
okta-browser-plugin
|
||||||
|
sponsorblock
|
||||||
reddit-enhancement-suite
|
reddit-enhancement-suite
|
||||||
return-youtube-dislikes
|
return-youtube-dislikes
|
||||||
sponsorblock
|
markdownload
|
||||||
ublock-origin
|
darkreader
|
||||||
ublacklist
|
snowflake
|
||||||
vimium
|
don-t-fuck-with-paste
|
||||||
|
i-dont-care-about-cookies
|
||||||
|
wappalyzer
|
||||||
];
|
];
|
||||||
settings = {
|
settings = {
|
||||||
"app.update.auto" = false;
|
"app.update.auto" = false;
|
||||||
"browser.aboutConfig.showWarning" = false;
|
"browser.aboutConfig.showWarning" = false;
|
||||||
"browser.warnOnQuit" = false;
|
"browser.warnOnQuit" = false;
|
||||||
"browser.quitShortcut.disabled" = if pkgs.stdenv.isLinux then true else false;
|
"browser.quitShortcut.disabled" =
|
||||||
|
if pkgs.stdenv.isLinux then true else false;
|
||||||
"browser.theme.dark-private-windows" = true;
|
"browser.theme.dark-private-windows" = true;
|
||||||
"browser.toolbars.bookmarks.visibility" = false;
|
"browser.toolbars.bookmarks.visibility" = false;
|
||||||
"browser.startup.page" = 3; # Restore previous session
|
"browser.startup.page" = 3; # Restore previous session
|
||||||
"browser.newtabpage.enabled" = false; # Make new tabs blank
|
"browser.newtabpage.enabled" = false; # Make new tabs blank
|
||||||
"trailhead.firstrun.didSeeAboutWelcome" = true; # Disable welcome splash
|
"trailhead.firstrun.didSeeAboutWelcome" =
|
||||||
|
true; # Disable welcome splash
|
||||||
"dom.forms.autocomplete.formautofill" = false; # Disable autofill
|
"dom.forms.autocomplete.formautofill" = false; # Disable autofill
|
||||||
"extensions.formautofill.creditCards.enabled" = false; # Disable credit cards
|
"extensions.formautofill.creditCards.enabled" =
|
||||||
|
false; # Disable credit cards
|
||||||
"dom.payments.defaults.saveAddress" = false; # Disable address save
|
"dom.payments.defaults.saveAddress" = false; # Disable address save
|
||||||
"general.autoScroll" = true; # Drag middle-mouse to scroll
|
"general.autoScroll" = true; # Drag middle-mouse to scroll
|
||||||
"services.sync.prefs.sync.general.autoScroll" = false; # Prevent disabling autoscroll
|
"services.sync.prefs.sync.general.autoScroll" =
|
||||||
|
false; # Prevent disabling autoscroll
|
||||||
"extensions.pocket.enabled" = false;
|
"extensions.pocket.enabled" = false;
|
||||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Allow userChrome.css
|
"toolkit.legacyUserProfileCustomizations.stylesheets" =
|
||||||
|
true; # Allow userChrome.css
|
||||||
"layout.css.color-mix.enabled" = true;
|
"layout.css.color-mix.enabled" = true;
|
||||||
"ui.systemUsesDarkTheme" = if config.theme.dark == true then 1 else 0;
|
"ui.systemUsesDarkTheme" =
|
||||||
"media.ffmpeg.vaapi.enabled" = true; # Enable hardware video acceleration
|
if config.theme.dark == true then 1 else 0;
|
||||||
|
"media.ffmpeg.vaapi.enabled" =
|
||||||
|
true; # Enable hardware video acceleration
|
||||||
"cookiebanners.ui.desktop.enabled" = true; # Reject cookie popups
|
"cookiebanners.ui.desktop.enabled" = true; # Reject cookie popups
|
||||||
"devtools.command-button-screenshot.enabled" = true; # Scrolling screenshot of entire page
|
|
||||||
"svg.context-properties.content.enabled" = true; # Sidebery styling
|
|
||||||
};
|
};
|
||||||
userChrome = ''
|
userChrome = ''
|
||||||
:root {
|
:root {
|
||||||
@ -111,7 +113,7 @@
|
|||||||
background-color: ${config.theme.colors.base00};
|
background-color: ${config.theme.colors.base00};
|
||||||
color: ${config.theme.colors.base06} !important;
|
color: ${config.theme.colors.base06} !important;
|
||||||
}
|
}
|
||||||
.tab-content[selected] {
|
.tab-content[selected=true] {
|
||||||
border-bottom: 2px solid color-mix(in srgb, var(--identity-tab-color) 25%, transparent);
|
border-bottom: 2px solid color-mix(in srgb, var(--identity-tab-color) 25%, transparent);
|
||||||
background-color: ${config.theme.colors.base01} !important;
|
background-color: ${config.theme.colors.base01} !important;
|
||||||
color: ${config.theme.colors.base07} !important;
|
color: ${config.theme.colors.base07} !important;
|
||||||
@ -155,34 +157,28 @@
|
|||||||
|
|
||||||
extraConfig = "";
|
extraConfig = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.mimeApps = {
|
xsession.windowManager.i3.config.keybindings =
|
||||||
associations.added = {
|
lib.mkIf pkgs.stdenv.isLinux {
|
||||||
"text.html" = [ "firefox.desktop" ];
|
"${
|
||||||
|
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
||||||
|
}+Shift+b" = "exec ${
|
||||||
|
# Don't name the script `firefox` or it will affect grep
|
||||||
|
builtins.toString (pkgs.writeShellScript "focus-ff.sh" ''
|
||||||
|
count=$(ps aux | grep -c firefox)
|
||||||
|
if [ "$count" -eq 1 ]; then
|
||||||
|
i3-msg "exec --no-startup-id firefox"
|
||||||
|
sleep 0.5
|
||||||
|
fi
|
||||||
|
i3-msg "[class=firefox] focus"
|
||||||
|
'')
|
||||||
|
}";
|
||||||
};
|
};
|
||||||
defaultApplications = {
|
|
||||||
"text.html" = [ "firefox.desktop" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux {
|
|
||||||
"${
|
|
||||||
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
|
||||||
}+Shift+b" = "exec ${
|
|
||||||
# Don't name the script `firefox` or it will affect grep
|
|
||||||
builtins.toString (
|
|
||||||
pkgs.writeShellScript "focus-ff.sh" ''
|
|
||||||
count=$(ps aux | grep -c firefox)
|
|
||||||
if [ "$count" -eq 1 ]; then
|
|
||||||
i3-msg "exec --no-startup-id firefox"
|
|
||||||
sleep 0.5
|
|
||||||
fi
|
|
||||||
i3-msg "[class=firefox] focus"
|
|
||||||
''
|
|
||||||
)
|
|
||||||
}";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
kitty = {
|
kitty = {
|
||||||
@ -19,25 +13,20 @@
|
|||||||
|
|
||||||
# Set the Rofi-Systemd terminal for viewing logs
|
# Set the Rofi-Systemd terminal for viewing logs
|
||||||
# Using optionalAttrs because only available in NixOS
|
# Using optionalAttrs because only available in NixOS
|
||||||
environment =
|
environment = { } // lib.attrsets.optionalAttrs
|
||||||
{ }
|
(builtins.hasAttr "sessionVariables" config.environment) {
|
||||||
// lib.attrsets.optionalAttrs (builtins.hasAttr "sessionVariables" config.environment) {
|
|
||||||
sessionVariables.ROFI_SYSTEMD_TERM = "${pkgs.kitty}/bin/kitty";
|
sessionVariables.ROFI_SYSTEMD_TERM = "${pkgs.kitty}/bin/kitty";
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
# Set the i3 terminal
|
# Set the i3 terminal
|
||||||
xsession.windowManager.i3.config.terminal = lib.mkIf pkgs.stdenv.isLinux "kitty";
|
xsession.windowManager.i3.config.terminal =
|
||||||
|
lib.mkIf pkgs.stdenv.isLinux "kitty";
|
||||||
|
|
||||||
# Set the Rofi terminal for running programs
|
# Set the Rofi terminal for running programs
|
||||||
programs.rofi.terminal = lib.mkIf pkgs.stdenv.isLinux "${pkgs.kitty}/bin/kitty";
|
programs.rofi.terminal =
|
||||||
|
lib.mkIf pkgs.stdenv.isLinux "${pkgs.kitty}/bin/kitty";
|
||||||
# Display images in the terminal
|
|
||||||
programs.fish.shellAliases = {
|
|
||||||
icat = "kitty +kitten icat";
|
|
||||||
ssh = "kitty +kitten ssh";
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.kitty = {
|
programs.kitty = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@ -45,23 +34,11 @@
|
|||||||
extraConfig = "";
|
extraConfig = "";
|
||||||
font.size = 14;
|
font.size = 14;
|
||||||
keybindings = {
|
keybindings = {
|
||||||
# Use shift+enter to complete text suggestions in fish
|
|
||||||
"shift+enter" = "send_text all \\x1F";
|
"shift+enter" = "send_text all \\x1F";
|
||||||
|
|
||||||
# Easy fullscreen toggle (for macOS)
|
|
||||||
"super+f" = "toggle_fullscreen";
|
"super+f" = "toggle_fullscreen";
|
||||||
|
|
||||||
# Kitty scrollback nvim
|
|
||||||
"kitty_mod+h" = "kitty_scrollback_nvim";
|
|
||||||
"kitty_mod+g" = "kitty_scrollback_nvim --config ksb_builtin_last_cmd_output";
|
|
||||||
};
|
};
|
||||||
settings = {
|
settings = {
|
||||||
|
|
||||||
# Required for kitty-scrollback.nvim
|
|
||||||
allow_remote_control = "socket-only";
|
|
||||||
listen_on = "unix:/tmp/kitty";
|
|
||||||
action_alias = "kitty_scrollback_nvim kitten ${pkgs.vimPlugins.kitty-scrollback-nvim}/python/kitty_scrollback_nvim.py";
|
|
||||||
|
|
||||||
# Colors (adapted from: https://github.com/kdrag0n/base16-kitty/blob/master/templates/default-256.mustache)
|
# Colors (adapted from: https://github.com/kdrag0n/base16-kitty/blob/master/templates/default-256.mustache)
|
||||||
background = config.theme.colors.base00;
|
background = config.theme.colors.base00;
|
||||||
foreground = config.theme.colors.base05;
|
foreground = config.theme.colors.base05;
|
||||||
@ -106,8 +83,9 @@
|
|||||||
color21 = config.theme.colors.base06;
|
color21 = config.theme.colors.base06;
|
||||||
|
|
||||||
# Scrollback
|
# Scrollback
|
||||||
scrollback_lines = 10000;
|
scrolling_lines = 10000;
|
||||||
scrollback_pager_history_size = 300; # MB
|
scrollback_pager_history_size = 10; # MB
|
||||||
|
scrollback_pager = "${pkgs.neovim}/bin/nvim -c 'normal G'";
|
||||||
|
|
||||||
# Window
|
# Window
|
||||||
window_padding_width = 6;
|
window_padding_width = 6;
|
||||||
@ -115,7 +93,7 @@
|
|||||||
tab_bar_edge = "top";
|
tab_bar_edge = "top";
|
||||||
tab_bar_style = "slant";
|
tab_bar_style = "slant";
|
||||||
|
|
||||||
# Disable audio
|
# Audio
|
||||||
enable_audio_bell = false;
|
enable_audio_bell = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
media = {
|
media = {
|
||||||
@ -28,8 +22,8 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
bindings = { };
|
bindings = { };
|
||||||
config = {
|
config = {
|
||||||
image-display-duration = 2; # For cycling through images
|
image-display-duration = 2;
|
||||||
hwdec = "auto-safe"; # Attempt to use GPU decoding for video
|
hwdec = "auto-safe";
|
||||||
};
|
};
|
||||||
scripts = [
|
scripts = [
|
||||||
|
|
||||||
@ -37,31 +31,43 @@
|
|||||||
pkgs.mpvScripts.autoload
|
pkgs.mpvScripts.autoload
|
||||||
|
|
||||||
# Delete current file after quitting
|
# Delete current file after quitting
|
||||||
pkgs.mpvScripts.mpv-delete-file
|
(pkgs.stdenv.mkDerivation rec {
|
||||||
|
pname = "mpv-delete-file";
|
||||||
|
version = "0.1"; # made-up
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "zenyd";
|
||||||
|
repo = "mpv-scripts";
|
||||||
|
rev = "19ea069abcb794d1bf8fac2f59b50d71ab992130";
|
||||||
|
sha256 = "sha256-OBCuzCtgfSwj0i/rBNranuu4LRc47jObwQIJgQQoerg=";
|
||||||
|
} + "/delete_file.lua";
|
||||||
|
dontBuild = true;
|
||||||
|
dontUnpack = true;
|
||||||
|
installPhase =
|
||||||
|
"install -Dm644 ${src} $out/share/mpv/scripts/delete_file.lua";
|
||||||
|
passthru.scriptName = "delete_file.lua";
|
||||||
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Set default programs for opening PDFs and other media
|
# Set default for opening PDFs
|
||||||
xdg.mimeApps = {
|
xdg.mimeApps = {
|
||||||
associations.added = {
|
associations.added = {
|
||||||
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||||
"image/jpeg" = [ "nsxiv.desktop" ];
|
"image/jpeg" = [ "nsxiv.desktop" ];
|
||||||
"image/png" = [ "nsxiv.desktop" ];
|
|
||||||
"image/*" = [ "nsxiv.desktop" ];
|
"image/*" = [ "nsxiv.desktop" ];
|
||||||
};
|
};
|
||||||
associations.removed = {
|
associations.removed = {
|
||||||
"application/pdf" = [
|
"application/pdf" = [ "mupdf.desktop" "wine-extension-pdf.desktop" ];
|
||||||
"mupdf.desktop"
|
|
||||||
"wine-extension-pdf.desktop"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
defaultApplications = {
|
defaultApplications = {
|
||||||
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||||
"image/jpeg" = [ "nsxiv.desktop" ];
|
"image/jpeg" = [ "nsxiv.desktop" ];
|
||||||
"image/png" = [ "nsxiv.desktop" ];
|
|
||||||
"image/*" = [ "nsxiv.desktop" ];
|
"image/*" = [ "nsxiv.desktop" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
obsidian = {
|
obsidian = {
|
||||||
@ -21,8 +15,9 @@
|
|||||||
home.packages = with pkgs; [ obsidian ];
|
home.packages = with pkgs; [ obsidian ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Broken on 2023-12-11
|
# Broken on 2023-04-16
|
||||||
# https://forum.obsidian.md/t/electron-25-is-now-eol-please-upgrade-to-a-newer-version/72878/8
|
nixpkgs.config.permittedInsecurePackages = [ "electron-21.4.0" ];
|
||||||
nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" ];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
qbittorrent = {
|
qbittorrent = {
|
||||||
@ -20,6 +14,8 @@
|
|||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
home.packages = with pkgs; [ qbittorrent ];
|
home.packages = with pkgs; [ qbittorrent ];
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
slack = {
|
slack = {
|
||||||
@ -21,4 +15,5 @@
|
|||||||
home.packages = with pkgs; [ slack ];
|
home.packages = with pkgs; [ slack ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
yt-dlp = {
|
yt-dlp = {
|
||||||
@ -33,6 +27,9 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
programs.fish.shellAbbrs.yt = "yt-dlp";
|
programs.fish.shellAbbrs.yt = "yt-dlp";
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,7 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }: {
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
imports = [
|
imports =
|
||||||
./applications
|
[ ./applications ./mail ./neovim ./programming ./repositories ./shell ];
|
||||||
./mail
|
|
||||||
./neovim
|
|
||||||
./programming
|
|
||||||
./repositories
|
|
||||||
./shell
|
|
||||||
];
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
user = lib.mkOption {
|
user = lib.mkOption {
|
||||||
@ -29,7 +17,8 @@
|
|||||||
download = lib.mkOption {
|
download = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "XDG directory for downloads";
|
description = "XDG directory for downloads";
|
||||||
default = if pkgs.stdenv.isDarwin then "$HOME/Downloads" else "$HOME/downloads";
|
default =
|
||||||
|
if pkgs.stdenv.isDarwin then "$HOME/Downloads" else "$HOME/downloads";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
identityFile = lib.mkOption {
|
identityFile = lib.mkOption {
|
||||||
@ -58,9 +47,10 @@
|
|||||||
homePath = lib.mkOption {
|
homePath = lib.mkOption {
|
||||||
type = lib.types.path;
|
type = lib.types.path;
|
||||||
description = "Path of user's home directory.";
|
description = "Path of user's home directory.";
|
||||||
default = builtins.toPath (
|
default = builtins.toPath (if pkgs.stdenv.isDarwin then
|
||||||
if pkgs.stdenv.isDarwin then "/Users/${config.user}" else "/home/${config.user}"
|
"/Users/${config.user}"
|
||||||
);
|
else
|
||||||
|
"/home/${config.user}");
|
||||||
};
|
};
|
||||||
dotfilesPath = lib.mkOption {
|
dotfilesPath = lib.mkOption {
|
||||||
type = lib.types.path;
|
type = lib.types.path;
|
||||||
@ -69,7 +59,7 @@
|
|||||||
};
|
};
|
||||||
dotfilesRepo = lib.mkOption {
|
dotfilesRepo = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Link to dotfiles repository HTTPS URL.";
|
description = "Link to dotfiles repository.";
|
||||||
};
|
};
|
||||||
unfreePackages = lib.mkOption {
|
unfreePackages = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
@ -85,22 +75,10 @@
|
|||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Hostname for metrics server.";
|
description = "Hostname for metrics server.";
|
||||||
};
|
};
|
||||||
minecraft = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Hostname for Minecraft server.";
|
|
||||||
};
|
|
||||||
paperless = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Hostname for document server (paperless-ngx).";
|
|
||||||
};
|
|
||||||
prometheus = lib.mkOption {
|
prometheus = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Hostname for Prometheus server.";
|
description = "Hostname for Prometheus server.";
|
||||||
};
|
};
|
||||||
influxdb = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Hostname for InfluxDB2 server.";
|
|
||||||
};
|
|
||||||
secrets = lib.mkOption {
|
secrets = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Hostname for passwords and secrets (Vaultwarden).";
|
description = "Hostname for passwords and secrets (Vaultwarden).";
|
||||||
@ -121,48 +99,63 @@
|
|||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Hostname for download services.";
|
description = "Hostname for download services.";
|
||||||
};
|
};
|
||||||
irc = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Hostname for IRC services.";
|
|
||||||
};
|
|
||||||
n8n = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Hostname for n8n automation.";
|
|
||||||
};
|
|
||||||
transmission = lib.mkOption {
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Hostname for peer2peer downloads (Transmission).";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config = let stateVersion = "23.05";
|
||||||
let
|
in {
|
||||||
stateVersion = "23.05";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
|
|
||||||
# Basic common system packages for all devices
|
nix = {
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
git
|
|
||||||
vim
|
|
||||||
wget
|
|
||||||
curl
|
|
||||||
];
|
|
||||||
|
|
||||||
# Use the system-level nixpkgs instead of Home Manager's
|
# Enable features in Nix commands
|
||||||
home-manager.useGlobalPkgs = true;
|
extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
warn-dirty = false
|
||||||
|
'';
|
||||||
|
|
||||||
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
|
gc = {
|
||||||
# using multiple profiles for one user
|
automatic = true;
|
||||||
home-manager.useUserPackages = true;
|
options = "--delete-older-than 7d";
|
||||||
|
};
|
||||||
|
|
||||||
# Allow specified unfree packages (identified elsewhere)
|
settings = {
|
||||||
# Retrieves package object based on string name
|
|
||||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.unfreePackages;
|
# Add community Cachix to binary cache
|
||||||
|
# Don't use with macOS because blocked by corporate firewall
|
||||||
|
builders-use-substitutes = true;
|
||||||
|
substituters = lib.mkIf (!pkgs.stdenv.isDarwin)
|
||||||
|
[ "https://nix-community.cachix.org" ];
|
||||||
|
trusted-public-keys = lib.mkIf (!pkgs.stdenv.isDarwin) [
|
||||||
|
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||||
|
];
|
||||||
|
|
||||||
|
# Scans and hard links identical files in the store
|
||||||
|
# Not working with macOS: https://github.com/NixOS/nix/issues/7273
|
||||||
|
auto-optimise-store = lib.mkIf (!pkgs.stdenv.isDarwin) true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
# Pin a state version to prevent warnings
|
|
||||||
home-manager.users.${config.user}.home.stateVersion = stateVersion;
|
|
||||||
home-manager.users.root.home.stateVersion = stateVersion;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Basic common system packages for all devices
|
||||||
|
environment.systemPackages = with pkgs; [ git vim wget curl ];
|
||||||
|
|
||||||
|
# Use the system-level nixpkgs instead of Home Manager's
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
|
||||||
|
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
|
||||||
|
# using multiple profiles for one user
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
|
||||||
|
# Allow specified unfree packages (identified elsewhere)
|
||||||
|
# Retrieves package object based on string name
|
||||||
|
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||||
|
builtins.elem (lib.getName pkg) config.unfreePackages;
|
||||||
|
|
||||||
|
# Pin a state version to prevent warnings
|
||||||
|
home-manager.users.${config.user}.home.stateVersion = stateVersion;
|
||||||
|
home-manager.users.root.home.stateVersion = stateVersion;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.mail.aerc.enable = lib.mkEnableOption "Aerc email.";
|
options.mail.aerc.enable = lib.mkEnableOption "Aerc email.";
|
||||||
|
|
||||||
@ -74,16 +68,14 @@
|
|||||||
"!" = ":term<space>";
|
"!" = ":term<space>";
|
||||||
"|" = ":pipe<space>";
|
"|" = ":pipe<space>";
|
||||||
|
|
||||||
"/" = ":search<space>-a<space>";
|
"/" = ":search<space>";
|
||||||
"\\" = ":filter <space>";
|
"\\" = ":filter <space>";
|
||||||
n = ":next-result<Enter>";
|
n = ":next-result<Enter>";
|
||||||
N = ":prev-result<Enter>";
|
N = ":prev-result<Enter>";
|
||||||
"<Esc>" = ":clear<Enter>";
|
"<Esc>" = ":clear<Enter>";
|
||||||
};
|
};
|
||||||
|
|
||||||
"messages:folder=Drafts" = {
|
"messages:folder=Drafts" = { "<Enter>" = ":recall<Enter>"; };
|
||||||
"<Enter>" = ":recall<Enter>";
|
|
||||||
};
|
|
||||||
|
|
||||||
view = {
|
view = {
|
||||||
"/" = ":toggle-key-passthrough <Enter> /";
|
"/" = ":toggle-key-passthrough <Enter> /";
|
||||||
@ -156,19 +148,21 @@
|
|||||||
"<C-p>" = ":prev-tab<Enter>";
|
"<C-p>" = ":prev-tab<Enter>";
|
||||||
"<C-n>" = ":next-tab<Enter>";
|
"<C-n>" = ":next-tab<Enter>";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
general.unsafe-accounts-conf = true;
|
general.unsafe-accounts-conf = true;
|
||||||
viewer = {
|
viewer = { pager = "${pkgs.less}/bin/less -R"; };
|
||||||
pager = "${pkgs.less}/bin/less -R";
|
|
||||||
};
|
|
||||||
filters = {
|
filters = {
|
||||||
"text/plain" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
"text/plain" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
||||||
"text/calendar" = "${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/libexec/aerc/filters/calendar";
|
"text/calendar" =
|
||||||
"text/html" = "${pkgs.aerc}/libexec/aerc/filters/html | ${pkgs.aerc}/libexec/aerc/filters/colorize"; # Requires w3m, dante
|
"${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/libexec/aerc/filters/calendar";
|
||||||
|
"text/html" =
|
||||||
|
"${pkgs.aerc}/libexec/aerc/filters/html | ${pkgs.aerc}/libexec/aerc/filters/colorize"; # Requires w3m, dante
|
||||||
# "text/*" =
|
# "text/*" =
|
||||||
# ''${pkgs.bat}/bin/bat -fP --file-name="$AERC_FILENAME "'';
|
# ''${pkgs.bat}/bin/bat -fP --file-name="$AERC_FILENAME "'';
|
||||||
"message/delivery-status" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
"message/delivery-status" =
|
||||||
|
"${pkgs.aerc}/libexec/aerc/filters/colorize";
|
||||||
"message/rfc822" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
"message/rfc822" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
||||||
"application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh";
|
"application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh";
|
||||||
"application/pdf" = "${pkgs.zathura}/bin/zathura -";
|
"application/pdf" = "${pkgs.zathura}/bin/zathura -";
|
||||||
@ -182,7 +176,6 @@
|
|||||||
extraAccounts = {
|
extraAccounts = {
|
||||||
check-mail = "5m";
|
check-mail = "5m";
|
||||||
check-mail-cmd = "${pkgs.isync}/bin/mbsync -a";
|
check-mail-cmd = "${pkgs.isync}/bin/mbsync -a";
|
||||||
check-mail-timeout = "15s";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -190,27 +183,26 @@
|
|||||||
name = "aerc";
|
name = "aerc";
|
||||||
exec = "kitty aerc %u";
|
exec = "kitty aerc %u";
|
||||||
};
|
};
|
||||||
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux {
|
xsession.windowManager.i3.config.keybindings =
|
||||||
"${
|
lib.mkIf pkgs.stdenv.isLinux {
|
||||||
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
"${
|
||||||
}+Shift+e" = "exec ${
|
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
||||||
# Don't name the script `aerc` or it will affect grep
|
}+Shift+e" = "exec ${
|
||||||
builtins.toString (
|
# Don't name the script `aerc` or it will affect grep
|
||||||
pkgs.writeShellScript "focus-mail.sh" ''
|
builtins.toString (pkgs.writeShellScript "focus-mail.sh" ''
|
||||||
count=$(ps aux | grep -c aerc)
|
count=$(ps aux | grep -c aerc)
|
||||||
if [ "$count" -eq 1 ]; then
|
if [ "$count" -eq 1 ]; then
|
||||||
i3-msg "exec --no-startup-id kitty --class aerc aerc"
|
i3-msg "exec --no-startup-id kitty --class aerc aerc"
|
||||||
sleep 0.25
|
sleep 0.25
|
||||||
fi
|
fi
|
||||||
i3-msg "[class=aerc] focus"
|
i3-msg "[class=aerc] focus"
|
||||||
''
|
'')
|
||||||
)
|
}";
|
||||||
}";
|
};
|
||||||
};
|
|
||||||
|
programs.fish.shellAbbrs = { ae = "aerc"; };
|
||||||
|
|
||||||
programs.fish.shellAbbrs = {
|
|
||||||
ae = "aerc";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,6 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
imports = [
|
imports = [ ./himalaya.nix ./aerc.nix ];
|
||||||
./himalaya.nix
|
|
||||||
./aerc.nix
|
|
||||||
./system.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
mail.enable = lib.mkEnableOption "Mail service.";
|
mail.enable = lib.mkEnableOption "Mail service.";
|
||||||
@ -36,104 +26,70 @@
|
|||||||
config = lib.mkIf config.mail.enable {
|
config = lib.mkIf config.mail.enable {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
programs.mbsync = {
|
programs.mbsync = { enable = true; };
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Automatically check for mail and keep files synced locally
|
|
||||||
services.mbsync = lib.mkIf pkgs.stdenv.isLinux {
|
services.mbsync = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
enable = true;
|
enable = true;
|
||||||
frequency = "*:0/5";
|
frequency = "*:0/5";
|
||||||
postExec = "${pkgs.notmuch}/bin/notmuch new";
|
postExec = "${pkgs.notmuch}/bin/notmuch new";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Used to watch for new mail and trigger sync
|
|
||||||
services.imapnotify.enable = pkgs.stdenv.isLinux;
|
services.imapnotify.enable = pkgs.stdenv.isLinux;
|
||||||
|
programs.notmuch.enable = true;
|
||||||
# Allows sending email from CLI/sendmail
|
|
||||||
programs.msmtp.enable = true;
|
|
||||||
|
|
||||||
# Better local mail search
|
|
||||||
programs.notmuch = {
|
|
||||||
enable = true;
|
|
||||||
new.ignore = [
|
|
||||||
".mbsyncstate.lock"
|
|
||||||
".mbsyncstate.journal"
|
|
||||||
".mbsyncstate.new"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
accounts.email = {
|
accounts.email = {
|
||||||
|
|
||||||
# Where email files are stored
|
|
||||||
maildirBasePath = "${config.homePath}/mail";
|
maildirBasePath = "${config.homePath}/mail";
|
||||||
|
|
||||||
accounts = {
|
accounts = {
|
||||||
home =
|
home = let address = "${config.mail.user}@${config.mail.server}";
|
||||||
let
|
in {
|
||||||
address = "${config.mail.user}@${config.mail.server}";
|
userName = address;
|
||||||
in
|
realName = config.fullName;
|
||||||
{
|
primary = true;
|
||||||
userName = address;
|
inherit address;
|
||||||
realName = config.fullName;
|
aliases = map (user: "${user}@${config.mail.server}") [
|
||||||
primary = true;
|
"me"
|
||||||
inherit address;
|
"hey"
|
||||||
aliases = map (user: "${user}@${config.mail.server}") [
|
"admin"
|
||||||
"me"
|
];
|
||||||
"hey"
|
alot = { };
|
||||||
"admin"
|
flavor = "plain";
|
||||||
];
|
imap = {
|
||||||
|
host = config.mail.imapHost;
|
||||||
# Options for contact completion
|
port = 993;
|
||||||
alot = { };
|
tls.enable = true;
|
||||||
|
};
|
||||||
imap = {
|
imapnotify = {
|
||||||
host = config.mail.imapHost;
|
enable = true;
|
||||||
port = 993;
|
boxes = [ "Inbox" ];
|
||||||
tls.enable = true;
|
onNotify = "${pkgs.isync}/bin/mbsync -a";
|
||||||
};
|
onNotifyPost = lib.mkIf
|
||||||
|
config.home-manager.users.${config.user}.services.dunst.enable
|
||||||
# Watch for mail and run notifications or sync
|
"${pkgs.libnotify}/bin/notify-send 'New mail arrived'";
|
||||||
imapnotify = {
|
};
|
||||||
enable = true;
|
maildir = { path = "main"; };
|
||||||
boxes = [ "Inbox" ];
|
mbsync = {
|
||||||
onNotify = "${pkgs.isync}/bin/mbsync -a";
|
enable = true;
|
||||||
onNotifyPost =
|
create = "both";
|
||||||
lib.mkIf config.home-manager.users.${config.user}.services.dunst.enable
|
expunge = "both";
|
||||||
"${pkgs.libnotify}/bin/notify-send 'New mail arrived'";
|
remove = "both";
|
||||||
};
|
patterns = [ "*" ];
|
||||||
|
extraConfig.channel = {
|
||||||
# Name of the directory in maildir for this account
|
CopyArrivalDate = "yes"; # Sync time of original message
|
||||||
maildir = {
|
|
||||||
path = "main";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Bi-directional syncing options for local files
|
|
||||||
mbsync = {
|
|
||||||
enable = true;
|
|
||||||
create = "both";
|
|
||||||
expunge = "both";
|
|
||||||
remove = "both";
|
|
||||||
patterns = [ "*" ];
|
|
||||||
extraConfig.channel = {
|
|
||||||
CopyArrivalDate = "yes"; # Sync time of original message
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Enable indexing
|
|
||||||
notmuch.enable = true;
|
|
||||||
|
|
||||||
# Used to login and send and receive emails
|
|
||||||
passwordCommand = "${pkgs.age}/bin/age --decrypt --identity ~/.ssh/id_ed25519 ${pkgs.writeText "mailpass.age" (builtins.readFile ../../../private/mailpass.age)}";
|
|
||||||
|
|
||||||
smtp = {
|
|
||||||
host = config.mail.smtpHost;
|
|
||||||
port = 465;
|
|
||||||
tls.enable = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
notmuch.enable = true;
|
||||||
|
passwordCommand =
|
||||||
|
"${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${
|
||||||
|
pkgs.writeText "mailpass.age"
|
||||||
|
(builtins.readFile ../../../private/mailpass.age)
|
||||||
|
}";
|
||||||
|
smtp = {
|
||||||
|
host = config.mail.smtpHost;
|
||||||
|
port = 465;
|
||||||
|
tls.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
options.mail.himalaya.enable = lib.mkEnableOption "Himalaya email.";
|
options.mail.himalaya.enable = lib.mkEnableOption "Himalaya email.";
|
||||||
|
|
||||||
@ -7,20 +6,20 @@
|
|||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
programs.himalaya = {
|
programs.himalaya = { enable = true; };
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
accounts.email.accounts.home.himalaya = {
|
accounts.email.accounts.home.himalaya = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
backend = "imap";
|
||||||
|
sender = "smtp";
|
||||||
settings = {
|
settings = {
|
||||||
downloads-dir = config.userDirs.download;
|
downloads-dir = config.userDirs.download;
|
||||||
smtp-insecure = true;
|
smtp-insecure = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.fish.shellAbbrs = {
|
programs.fish.shellAbbrs = { hi = "himalaya"; };
|
||||||
hi = "himalaya";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
config = lib.mkIf (config.mail.enable || config.server) {
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
|
||||||
|
|
||||||
programs.msmtp.enable = true;
|
|
||||||
|
|
||||||
# The system user for sending automatic notifications
|
|
||||||
accounts.email.accounts.system =
|
|
||||||
let
|
|
||||||
address = "system@${config.mail.server}";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
userName = address;
|
|
||||||
realName = "NixOS System";
|
|
||||||
primary = !config.mail.enable; # Only primary if mail not enabled
|
|
||||||
inherit address;
|
|
||||||
passwordCommand = "${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${pkgs.writeText "mailpass-system.age" (builtins.readFile ../../../private/mailpass-system.age)}";
|
|
||||||
msmtp.enable = true;
|
|
||||||
smtp = {
|
|
||||||
host = config.mail.smtpHost;
|
|
||||||
port = 465;
|
|
||||||
tls.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,8 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
# Plugin for aligning text programmatically
|
|
||||||
|
|
||||||
plugins = [ pkgs.vimPlugins.tabular ];
|
plugins = [ pkgs.vimPlugins.tabular ];
|
||||||
lua = ''
|
lua = ''
|
||||||
-- Align
|
-- Align
|
||||||
|
@ -1,8 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
# Shows buffers in a VSCode-style tab layout
|
|
||||||
|
|
||||||
plugins = [
|
plugins = [
|
||||||
pkgs.vimPlugins.bufferline-nvim
|
pkgs.vimPlugins.bufferline-nvim
|
||||||
pkgs.vimPlugins.vim-bbye # Better closing of buffers
|
pkgs.vimPlugins.vim-bbye # Better closing of buffers
|
||||||
@ -12,7 +8,7 @@
|
|||||||
diagnostics = "nvim_lsp";
|
diagnostics = "nvim_lsp";
|
||||||
always_show_bufferline = false;
|
always_show_bufferline = false;
|
||||||
separator_style = "slant";
|
separator_style = "slant";
|
||||||
offsets = [ { filetype = "NvimTree"; } ];
|
offsets = [{ filetype = "NvimTree"; }];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
lua = ''
|
lua = ''
|
||||||
|
@ -1,12 +1,4 @@
|
|||||||
{
|
{ pkgs, lib, config, ... }: {
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
# Sets Neovim colors based on Nix colorscheme
|
|
||||||
|
|
||||||
options.colors = lib.mkOption {
|
options.colors = lib.mkOption {
|
||||||
type = lib.types.attrsOf lib.types.str;
|
type = lib.types.attrsOf lib.types.str;
|
||||||
@ -14,7 +6,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
plugins = [ pkgs.vimPlugins.base16-nvim ];
|
plugins = [ pkgs.vimPlugins.nvim-base16 ];
|
||||||
setup.base16-colorscheme = config.colors;
|
setup.base16-colorscheme = config.colors;
|
||||||
|
|
||||||
# Telescope isn't working, shut off for now
|
# Telescope isn't working, shut off for now
|
||||||
@ -24,4 +16,5 @@
|
|||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{ pkgs, dsl, ... }:
|
{ pkgs, dsl, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
plugins = [
|
plugins = [
|
||||||
pkgs.vimPlugins.cmp-nvim-lsp
|
pkgs.vimPlugins.cmp-nvim-lsp
|
||||||
@ -10,6 +9,7 @@
|
|||||||
pkgs.vimPlugins.luasnip
|
pkgs.vimPlugins.luasnip
|
||||||
pkgs.vimPlugins.cmp_luasnip
|
pkgs.vimPlugins.cmp_luasnip
|
||||||
pkgs.vimPlugins.cmp-rg
|
pkgs.vimPlugins.cmp-rg
|
||||||
|
pkgs.vimPlugins.friendly-snippets
|
||||||
];
|
];
|
||||||
|
|
||||||
use.cmp.setup = dsl.callWith {
|
use.cmp.setup = dsl.callWith {
|
||||||
@ -24,17 +24,28 @@
|
|||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Basic completion keybinds
|
snippet.expand = dsl.rawLua ''
|
||||||
|
function(args)
|
||||||
|
require("luasnip").lsp_expand(args.body)
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
|
||||||
mapping = {
|
mapping = {
|
||||||
"['<C-n>']" = dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })";
|
"['<C-n>']" = dsl.rawLua
|
||||||
"['<C-p>']" = dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert })";
|
"require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })";
|
||||||
"['<Down>']" = dsl.rawLua "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Select })";
|
"['<C-p>']" = dsl.rawLua
|
||||||
"['<Up>']" = dsl.rawLua "require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Select })";
|
"require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Insert })";
|
||||||
|
"['<Down>']" = dsl.rawLua
|
||||||
|
"require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Select })";
|
||||||
|
"['<Up>']" = dsl.rawLua
|
||||||
|
"require('cmp').mapping.select_prev_item({ behavior = require('cmp').SelectBehavior.Select })";
|
||||||
"['<C-d>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(-4)";
|
"['<C-d>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(-4)";
|
||||||
"['<C-f>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(4)";
|
"['<C-f>']" = dsl.rawLua "require('cmp').mapping.scroll_docs(4)";
|
||||||
"['<C-e>']" = dsl.rawLua "require('cmp').mapping.abort()";
|
"['<C-e>']" = dsl.rawLua "require('cmp').mapping.abort()";
|
||||||
"['<CR>']" = dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
|
"['<CR>']" = dsl.rawLua
|
||||||
"['<C-r>']" = dsl.rawLua "require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
|
"require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
|
||||||
|
"['<C-r>']" = dsl.rawLua
|
||||||
|
"require('cmp').mapping.confirm({ behavior = require('cmp').ConfirmBehavior.Replace, select = true, })";
|
||||||
"['<Esc>']" = dsl.rawLua ''
|
"['<Esc>']" = dsl.rawLua ''
|
||||||
function(_)
|
function(_)
|
||||||
cmp.mapping({
|
cmp.mapping({
|
||||||
@ -53,33 +64,26 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
# These are where the completion engine gets its suggestions
|
|
||||||
sources = [
|
sources = [
|
||||||
{ name = "nvim_lua"; } # Fills in common Neovim lua functions
|
{ name = "nvim_lua"; }
|
||||||
{ name = "nvim_lsp"; } # LSP results
|
{ name = "nvim_lsp"; }
|
||||||
{ name = "path"; } # Shell completion from current PATH
|
{ name = "luasnip"; }
|
||||||
|
{ name = "path"; }
|
||||||
{
|
{
|
||||||
name = "buffer"; # Grep for text from the current text buffer
|
name = "buffer";
|
||||||
keyword_length = 3;
|
keyword_length = 3;
|
||||||
max_item_count = 10;
|
max_item_count = 10;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "rg"; # Grep for text from the current directory
|
name = "rg";
|
||||||
keyword_length = 6;
|
keyword_length = 6;
|
||||||
max_item_count = 10;
|
max_item_count = 10;
|
||||||
option = {
|
option = { additional_arguments = "--ignore-case"; };
|
||||||
additional_arguments = "--ignore-case";
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
# Styling of the completion menu
|
|
||||||
formatting = {
|
formatting = {
|
||||||
fields = [
|
fields = [ "kind" "abbr" "menu" ];
|
||||||
"kind"
|
|
||||||
"abbr"
|
|
||||||
"menu"
|
|
||||||
];
|
|
||||||
format = dsl.rawLua ''
|
format = dsl.rawLua ''
|
||||||
function(entry, vim_item)
|
function(entry, vim_item)
|
||||||
local kind_icons = {
|
local kind_icons = {
|
||||||
@ -111,6 +115,7 @@
|
|||||||
}
|
}
|
||||||
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
|
||||||
vim_item.menu = ({
|
vim_item.menu = ({
|
||||||
|
luasnip = "[Snippet]",
|
||||||
buffer = "[Buffer]",
|
buffer = "[Buffer]",
|
||||||
path = "[Path]",
|
path = "[Path]",
|
||||||
rg = "[Grep]",
|
rg = "[Grep]",
|
||||||
@ -126,9 +131,17 @@
|
|||||||
native_menu = false; # Use cmp menu instead of Vim menu
|
native_menu = false; # Use cmp menu instead of Vim menu
|
||||||
ghost_text = true; # Show preview auto-completion
|
ghost_text = true; # Show preview auto-completion
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
lua = ''
|
lua = ''
|
||||||
|
-- Load snippets
|
||||||
|
-- Check status: :lua require("luasnip").log.open()
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
require("luasnip.loaders.from_vscode").lazy_load({ paths = { "${
|
||||||
|
builtins.toString pkgs.vscode-terraform-snippets
|
||||||
|
}" } })
|
||||||
|
|
||||||
-- Use buffer source for `/`
|
-- Use buffer source for `/`
|
||||||
require('cmp').setup.cmdline("/", {
|
require('cmp').setup.cmdline("/", {
|
||||||
sources = {
|
sources = {
|
||||||
@ -145,4 +158,5 @@
|
|||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
'';
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
-- Keymap to open file in GitHub web
|
|
||||||
vim.keymap.set("n", "<Leader>gr", ":!gh browse %<CR><CR>", { silent = true })
|
|
||||||
|
|
||||||
-- Pop a terminal to watch the current run
|
|
||||||
local gitwatch =
|
|
||||||
require("toggleterm.terminal").Terminal:new({ cmd = "fish --interactive --init-command 'gh run watch'" })
|
|
||||||
|
|
||||||
-- Set a toggle for this terminal
|
|
||||||
function GITWATCH_TOGGLE()
|
|
||||||
gitwatch:toggle()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Keymap to toggle the run
|
|
||||||
vim.keymap.set("n", "<Leader>gw", GITWATCH_TOGGLE)
|
|
@ -1,5 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
plugins = [ pkgs.vimPlugins.gitsigns-nvim ];
|
plugins = [ pkgs.vimPlugins.gitsigns-nvim ];
|
||||||
setup.gitsigns = { };
|
setup.gitsigns = { };
|
||||||
lua = builtins.readFile ./gitsigns.lua;
|
lua = builtins.readFile ./gitsigns.lua;
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
local k9s = require("toggleterm.terminal").Terminal:new({ cmd = "k9s" })
|
|
||||||
function K9S_TOGGLE()
|
|
||||||
k9s:toggle()
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<Leader>9", K9S_TOGGLE)
|
|
@ -1,136 +1,76 @@
|
|||||||
{
|
{ pkgs, dsl, ... }: {
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
dsl,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
# Terraform optional because non-free
|
plugins = [
|
||||||
options.terraform = lib.mkEnableOption "Whether to enable Terraform LSP";
|
pkgs.vimPlugins.nvim-lspconfig
|
||||||
options.github = lib.mkEnableOption "Whether to enable GitHub features";
|
pkgs.vimPlugins.lsp-colors-nvim
|
||||||
options.kubernetes = lib.mkEnableOption "Whether to enable Kubernetes features";
|
pkgs.vimPlugins.null-ls-nvim
|
||||||
|
];
|
||||||
|
|
||||||
config = {
|
use.lspconfig.lua_ls.setup = dsl.callWith {
|
||||||
plugins = [
|
settings = { Lua = { diagnostics = { globals = [ "vim" "hs" ]; }; }; };
|
||||||
pkgs.vimPlugins.nvim-lspconfig
|
capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
|
||||||
pkgs.vimPlugins.conform-nvim
|
cmd = [ "${pkgs.lua-language-server}/bin/lua-language-server" ];
|
||||||
pkgs.vimPlugins.fidget-nvim
|
|
||||||
pkgs.vimPlugins.nvim-lint
|
|
||||||
];
|
|
||||||
|
|
||||||
setup.fidget = { };
|
|
||||||
|
|
||||||
use.lspconfig.lua_ls.setup = dsl.callWith {
|
|
||||||
settings = {
|
|
||||||
Lua = {
|
|
||||||
diagnostics = {
|
|
||||||
globals = [
|
|
||||||
"vim"
|
|
||||||
"hs"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
|
|
||||||
cmd = [ "${pkgs.lua-language-server}/bin/lua-language-server" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
use.lspconfig.nixd.setup = dsl.callWith {
|
|
||||||
cmd = [ "${pkgs.nixd}/bin/nixd" ];
|
|
||||||
capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
|
|
||||||
};
|
|
||||||
|
|
||||||
use.lspconfig.pyright.setup = dsl.callWith {
|
|
||||||
cmd = [
|
|
||||||
"${pkgs.pyright}/bin/pyright-langserver"
|
|
||||||
"--stdio"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
use.lspconfig.terraformls.setup = dsl.callWith {
|
|
||||||
cmd =
|
|
||||||
if config.terraform then
|
|
||||||
[
|
|
||||||
"${pkgs.terraform-ls}/bin/terraform-ls"
|
|
||||||
"serve"
|
|
||||||
]
|
|
||||||
else
|
|
||||||
[ "echo" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
use.lspconfig.rust_analyzer.setup = dsl.callWith {
|
|
||||||
cmd = [ "${pkgs.rust-analyzer}/bin/rust-analyzer" ];
|
|
||||||
settings = {
|
|
||||||
"['rust-analyzer']" = {
|
|
||||||
check = {
|
|
||||||
command = "clippy";
|
|
||||||
};
|
|
||||||
files = {
|
|
||||||
excludeDirs = [ ".direnv" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
setup.conform = {
|
|
||||||
format_on_save = {
|
|
||||||
# These options will be passed to conform.format()
|
|
||||||
timeout_ms = 1500;
|
|
||||||
lsp_fallback = true;
|
|
||||||
};
|
|
||||||
formatters_by_ft = {
|
|
||||||
lua = [ "stylua" ];
|
|
||||||
python = [ "black" ];
|
|
||||||
fish = [ "fish_indent" ];
|
|
||||||
nix = [ "nixfmt" ];
|
|
||||||
rust = [ "rustfmt" ];
|
|
||||||
sh = [ "shfmt" ];
|
|
||||||
terraform = if config.terraform then [ "terraform_fmt" ] else [ ];
|
|
||||||
hcl = if config.terraform then [ "terraform_fmt" ] else [ ];
|
|
||||||
};
|
|
||||||
formatters = {
|
|
||||||
lua.command = "${pkgs.stylua}/bin/stylua";
|
|
||||||
black.command = "${pkgs.black}/bin/black";
|
|
||||||
fish_indent.command = "${pkgs.fish}/bin/fish_indent";
|
|
||||||
nixfmt.command = "${pkgs.nixfmt-rfc-style}/bin/nixfmt";
|
|
||||||
rustfmt.command = "${pkgs.rustfmt}/bin/rustfmt";
|
|
||||||
shfmt = {
|
|
||||||
command = "${pkgs.shfmt}/bin/shfmt";
|
|
||||||
prepend_args = [
|
|
||||||
"-i"
|
|
||||||
"4"
|
|
||||||
"-ci"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
terraform_fmt.command = if config.terraform then "${pkgs.terraform}/bin/terraform" else "";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
use.lint = {
|
|
||||||
linters_by_ft = dsl.toTable {
|
|
||||||
python = [ "ruff" ];
|
|
||||||
sh = [ "shellcheck" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd = dsl.callWith [
|
|
||||||
(dsl.toTable [
|
|
||||||
"BufEnter"
|
|
||||||
"BufWritePost"
|
|
||||||
])
|
|
||||||
(dsl.rawLua "{ callback = function() require('lint').try_lint() end }")
|
|
||||||
];
|
|
||||||
|
|
||||||
lua = ''
|
|
||||||
${builtins.readFile ./lsp.lua}
|
|
||||||
|
|
||||||
local ruff = require('lint').linters.ruff; ruff.cmd = "${pkgs.ruff}/bin/ruff"
|
|
||||||
local shellcheck = require('lint').linters.shellcheck; shellcheck.cmd = "${pkgs.shellcheck}/bin/shellcheck"
|
|
||||||
|
|
||||||
-- Prevent infinite log size (change this when debugging)
|
|
||||||
vim.lsp.set_log_level("off")
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use.lspconfig.nil_ls.setup = dsl.callWith {
|
||||||
|
cmd = [ "${pkgs.nil}/bin/nil" ];
|
||||||
|
capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
|
||||||
|
};
|
||||||
|
|
||||||
|
use.lspconfig.pyright.setup = dsl.callWith {
|
||||||
|
cmd = [ "${pkgs.pyright}/bin/pyright-langserver" "--stdio" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
use.lspconfig.terraformls.setup =
|
||||||
|
dsl.callWith { cmd = [ "${pkgs.terraform-ls}/bin/terraform-ls" "serve" ]; };
|
||||||
|
|
||||||
|
vim.api.nvim_create_augroup = dsl.callWith [ "LspFormatting" { } ];
|
||||||
|
|
||||||
|
lua = ''
|
||||||
|
${builtins.readFile ./lsp.lua}
|
||||||
|
|
||||||
|
-- Prevent infinite log size (change this when debugging)
|
||||||
|
vim.lsp.set_log_level("off")
|
||||||
|
|
||||||
|
require("null-ls").setup({
|
||||||
|
sources = {
|
||||||
|
require("null-ls").builtins.formatting.stylua.with({ command = "${pkgs.stylua}/bin/stylua" }),
|
||||||
|
require("null-ls").builtins.formatting.black.with({ command = "${pkgs.black}/bin/black" }),
|
||||||
|
require("null-ls").builtins.diagnostics.ruff.with({ command = "${pkgs.ruff}/bin/ruff" }),
|
||||||
|
require("null-ls").builtins.formatting.fish_indent.with({ command = "${pkgs.fish}/bin/fish_indent" }),
|
||||||
|
require("null-ls").builtins.formatting.nixfmt.with({ command = "${pkgs.nixfmt}/bin/nixfmt" }),
|
||||||
|
require("null-ls").builtins.formatting.rustfmt.with({ command = "${pkgs.rustfmt}/bin/rustfmt" }),
|
||||||
|
require("null-ls").builtins.diagnostics.shellcheck.with({ command = "${pkgs.shellcheck}/bin/shellcheck" }),
|
||||||
|
require("null-ls").builtins.formatting.shfmt.with({
|
||||||
|
command = "${pkgs.shfmt}/bin/shfmt",
|
||||||
|
extra_args = { "-i", "4", "-ci" },
|
||||||
|
}),
|
||||||
|
require("null-ls").builtins.formatting.terraform_fmt.with({
|
||||||
|
command = "${pkgs.terraform}/bin/terraform",
|
||||||
|
extra_filetypes = { "hcl" },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
|
||||||
|
on_attach = function(client, bufnr)
|
||||||
|
if client.supports_method("textDocument/formatting") then
|
||||||
|
-- Auto-format on save
|
||||||
|
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||||
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
|
group = augroup,
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = function()
|
||||||
|
vim.lsp.buf.format({ bufnr = bufnr })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
-- Use internal formatting for bindings like gq.
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
|
callback = function(args)
|
||||||
|
vim.bo[args.buf].formatexpr = nil
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,30 +1,17 @@
|
|||||||
{
|
{ pkgs, dsl, lib, ... }: {
|
||||||
pkgs,
|
|
||||||
dsl,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
plugins = [
|
plugins = [
|
||||||
pkgs.vimPlugins.vim-surround # Keybinds for surround characters
|
pkgs.vimPlugins.vim-surround # Keybinds for surround characters
|
||||||
pkgs.vimPlugins.vim-eunuch # File manipulation commands
|
pkgs.vimPlugins.vim-eunuch # File manipulation commands
|
||||||
pkgs.vimPlugins.vim-fugitive # Git commands
|
pkgs.vimPlugins.vim-fugitive # Git commands
|
||||||
pkgs.vimPlugins.vim-repeat # Better repeat using .
|
pkgs.vimPlugins.vim-repeat # Better repeat using .
|
||||||
|
pkgs.vimPlugins.comment-nvim # Smart comment commands
|
||||||
pkgs.vimPlugins.glow-nvim # Markdown preview popup
|
pkgs.vimPlugins.glow-nvim # Markdown preview popup
|
||||||
pkgs.vimPlugins.nvim-colorizer-lua # Hex color previews
|
pkgs.vimPlugins.nvim-colorizer-lua # Hex color previews
|
||||||
pkgs.vimPlugins.which-key-nvim # Keybind helper
|
|
||||||
pkgs.vimPlugins.kitty-scrollback-nvim # Scrollback pager for kitty
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Initialize some plugins
|
setup.Comment = { };
|
||||||
setup.colorizer = {
|
setup.colorizer = { };
|
||||||
user_default_options = {
|
|
||||||
names = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
setup.glow = { };
|
setup.glow = { };
|
||||||
setup.which-key = { };
|
|
||||||
setup.kitty-scrollback = { };
|
|
||||||
|
|
||||||
vim.o = {
|
vim.o = {
|
||||||
termguicolors = true; # Set to truecolor
|
termguicolors = true; # Set to truecolor
|
||||||
@ -42,6 +29,7 @@
|
|||||||
scrolloff = 3; # Margin of lines to see while scrolling
|
scrolloff = 3; # Margin of lines to see while scrolling
|
||||||
splitright = true; # Vertical splits on the right side
|
splitright = true; # Vertical splits on the right side
|
||||||
splitbelow = true; # Horizontal splits on the bottom side
|
splitbelow = true; # Horizontal splits on the bottom side
|
||||||
|
pastetoggle = "<F3>"; # Use F3 to enter raw paste mode
|
||||||
clipboard = "unnamedplus"; # Uses system clipboard for yanking
|
clipboard = "unnamedplus"; # Uses system clipboard for yanking
|
||||||
updatetime = 300; # Faster diagnostics
|
updatetime = 300; # Faster diagnostics
|
||||||
mouse = "nv"; # Mouse interaction / scrolling
|
mouse = "nv"; # Mouse interaction / scrolling
|
||||||
@ -53,23 +41,14 @@
|
|||||||
relativenumber = true; # Relative numbers instead of absolute
|
relativenumber = true; # Relative numbers instead of absolute
|
||||||
};
|
};
|
||||||
|
|
||||||
# For which-key-nvim
|
|
||||||
vim.o.timeout = true;
|
|
||||||
vim.o.timeoutlen = 300;
|
|
||||||
|
|
||||||
# Better backup, swap and undo storage
|
# Better backup, swap and undo storage
|
||||||
vim.o.backup = true; # Easier to recover and more secure
|
vim.o.backup = true; # Easier to recover and more secure
|
||||||
vim.bo.swapfile = false; # Instead of swaps, create backups
|
vim.bo.swapfile = false; # Instead of swaps, create backups
|
||||||
vim.bo.undofile = true; # Keeps undos after quit
|
vim.bo.undofile = true; # Keeps undos after quit
|
||||||
vim.o.backupdir = dsl.rawLua ''vim.fn.expand("~/.local/state/nvim/backup//")'';
|
vim.o.backupdir = dsl.rawLua ''vim.fn.stdpath("cache") .. "/backup"'';
|
||||||
vim.o.undodir = dsl.rawLua ''vim.fn.expand("~/.local/state/nvim/undo//")'';
|
|
||||||
|
|
||||||
# Required for nvim-cmp completion
|
# Required for nvim-cmp completion
|
||||||
vim.opt.completeopt = [
|
vim.opt.completeopt = [ "menu" "menuone" "noselect" ];
|
||||||
"menu"
|
|
||||||
"menuone"
|
|
||||||
"noselect"
|
|
||||||
];
|
|
||||||
|
|
||||||
lua = lib.mkBefore ''
|
lua = lib.mkBefore ''
|
||||||
vim.loader.enable()
|
vim.loader.enable()
|
||||||
@ -81,6 +60,10 @@
|
|||||||
" Remember last position when reopening file
|
" Remember last position when reopening file
|
||||||
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
|
||||||
|
|
||||||
|
" LaTeX options
|
||||||
|
au FileType tex inoremap ;bf \textbf{}<Esc>i
|
||||||
|
au BufWritePost *.tex silent! execute "!pdflatex -output-directory=%:p:h % >/dev/null 2>&1" | redraw!
|
||||||
|
|
||||||
" Flash highlight when yanking
|
" Flash highlight when yanking
|
||||||
au TextYankPost * silent! lua vim.highlight.on_yank { timeout = 250 }
|
au TextYankPost * silent! lua vim.highlight.on_yank { timeout = 250 }
|
||||||
'';
|
'';
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }: {
|
||||||
{
|
|
||||||
plugins = [ pkgs.vimPlugins.lualine-nvim ];
|
plugins = [ pkgs.vimPlugins.lualine-nvim ];
|
||||||
setup.lualine = {
|
setup.lualine = {
|
||||||
options = {
|
options = {
|
||||||
|
@ -1,11 +1,9 @@
|
|||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
plugins = [
|
plugins = [
|
||||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (
|
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins:
|
||||||
_plugins: with pkgs.tree-sitter-grammars; [
|
with pkgs.tree-sitter-grammars; [
|
||||||
tree-sitter-bash
|
tree-sitter-bash
|
||||||
tree-sitter-c
|
|
||||||
tree-sitter-fish
|
tree-sitter-fish
|
||||||
tree-sitter-hcl
|
tree-sitter-hcl
|
||||||
tree-sitter-ini
|
tree-sitter-ini
|
||||||
@ -18,17 +16,13 @@
|
|||||||
tree-sitter-python
|
tree-sitter-python
|
||||||
tree-sitter-rasi
|
tree-sitter-rasi
|
||||||
tree-sitter-toml
|
tree-sitter-toml
|
||||||
tree-sitter-vimdoc
|
|
||||||
tree-sitter-yaml
|
tree-sitter-yaml
|
||||||
]
|
]))
|
||||||
))
|
|
||||||
pkgs.vimPlugins.vim-matchup # Better % jumping in languages
|
pkgs.vimPlugins.vim-matchup # Better % jumping in languages
|
||||||
pkgs.vimPlugins.playground # Tree-sitter experimenting
|
pkgs.vimPlugins.playground # Tree-sitter experimenting
|
||||||
pkgs.vimPlugins.nginx-vim
|
pkgs.vimPlugins.nginx-vim
|
||||||
pkgs.vimPlugins.vim-helm
|
pkgs.vimPlugins.vim-helm
|
||||||
pkgs.vimPlugins.baleia-nvim # Clean ANSI from kitty scrollback
|
(pkgs.vimUtils.buildVimPluginFrom2Nix {
|
||||||
# pkgs.vimPlugins.hmts-nvim # Tree-sitter injections for home-manager
|
|
||||||
(pkgs.vimUtils.buildVimPlugin {
|
|
||||||
pname = "nmasur";
|
pname = "nmasur";
|
||||||
version = "0.1";
|
version = "0.1";
|
||||||
src = ../plugin;
|
src = ../plugin;
|
||||||
@ -36,15 +30,9 @@
|
|||||||
];
|
];
|
||||||
|
|
||||||
setup."nvim-treesitter.configs" = {
|
setup."nvim-treesitter.configs" = {
|
||||||
highlight = {
|
highlight = { enable = true; };
|
||||||
enable = true;
|
indent = { enable = true; };
|
||||||
};
|
matchup = { enable = true; }; # Uses vim-matchup
|
||||||
indent = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
matchup = {
|
|
||||||
enable = true;
|
|
||||||
}; # Uses vim-matchup
|
|
||||||
|
|
||||||
textobjects = {
|
textobjects = {
|
||||||
select = {
|
select = {
|
||||||
@ -78,4 +66,5 @@
|
|||||||
-- Use HCL parser with .tf files
|
-- Use HCL parser with .tf files
|
||||||
vim.treesitter.language.register('hcl', 'terraform')
|
vim.treesitter.language.register('hcl', 'terraform')
|
||||||
'';
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
{ pkgs, dsl, ... }:
|
{ pkgs, dsl, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
# Telescope is a fuzzy finder that can work with different sub-plugins
|
|
||||||
|
|
||||||
plugins = [
|
plugins = [
|
||||||
pkgs.vimPlugins.telescope-nvim
|
pkgs.vimPlugins.telescope-nvim
|
||||||
@ -21,15 +18,9 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
pickers = {
|
pickers = {
|
||||||
find_files = {
|
find_files = { theme = "ivy"; };
|
||||||
theme = "ivy";
|
oldfiles = { theme = "ivy"; };
|
||||||
};
|
buffers = { theme = "dropdown"; };
|
||||||
oldfiles = {
|
|
||||||
theme = "ivy";
|
|
||||||
};
|
|
||||||
buffers = {
|
|
||||||
theme = "dropdown";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
extensions = {
|
extensions = {
|
||||||
fzy_native = { };
|
fzy_native = { };
|
||||||
@ -40,4 +31,5 @@
|
|||||||
setup.project_nvim = { };
|
setup.project_nvim = { };
|
||||||
|
|
||||||
lua = builtins.readFile ./telescope.lua;
|
lua = builtins.readFile ./telescope.lua;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,8 +12,6 @@ vim.api.nvim_create_autocmd("TermOpen", {
|
|||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
-- These are all the different types of terminals we can trigger
|
|
||||||
|
|
||||||
local terminal = require("toggleterm.terminal").Terminal
|
local terminal = require("toggleterm.terminal").Terminal
|
||||||
|
|
||||||
local basicterminal = terminal:new()
|
local basicterminal = terminal:new()
|
||||||
@ -26,5 +24,17 @@ function NIXPKGS_TOGGLE()
|
|||||||
nixpkgs:toggle()
|
nixpkgs:toggle()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local gitwatch = terminal:new({ cmd = "fish --interactive --init-command 'gh run watch'" })
|
||||||
|
function GITWATCH_TOGGLE()
|
||||||
|
gitwatch:toggle()
|
||||||
|
end
|
||||||
|
|
||||||
|
local k9s = terminal:new({ cmd = "k9s" })
|
||||||
|
function K9S_TOGGLE()
|
||||||
|
k9s:toggle()
|
||||||
|
end
|
||||||
|
|
||||||
vim.keymap.set("n", "<Leader>t", TERM_TOGGLE)
|
vim.keymap.set("n", "<Leader>t", TERM_TOGGLE)
|
||||||
vim.keymap.set("n", "<Leader>P", NIXPKGS_TOGGLE)
|
vim.keymap.set("n", "<Leader>P", NIXPKGS_TOGGLE)
|
||||||
|
vim.keymap.set("n", "<Leader>gw", GITWATCH_TOGGLE)
|
||||||
|
vim.keymap.set("n", "<Leader>9", K9S_TOGGLE)
|
||||||
|
@ -1,12 +1,4 @@
|
|||||||
{
|
{ pkgs, dsl, ... }: {
|
||||||
pkgs,
|
|
||||||
dsl,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
# Toggleterm provides a floating terminal inside the editor for quick access
|
|
||||||
|
|
||||||
plugins = [ pkgs.vimPlugins.toggleterm-nvim ];
|
plugins = [ pkgs.vimPlugins.toggleterm-nvim ];
|
||||||
|
|
||||||
@ -16,9 +8,6 @@
|
|||||||
direction = "float";
|
direction = "float";
|
||||||
};
|
};
|
||||||
|
|
||||||
lua = ''
|
lua = builtins.readFile ./toggleterm.lua;
|
||||||
${builtins.readFile ./toggleterm.lua}
|
|
||||||
${if config.github then (builtins.readFile ./github.lua) else ""}
|
|
||||||
${if config.kubernetes then (builtins.readFile ./kubernetes.lua) else ""}
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,6 @@
|
|||||||
{ pkgs, dsl, ... }:
|
{ pkgs, dsl, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
# This plugin creates a side drawer for navigating the current project
|
plugins = [ pkgs.vimPlugins.nvim-tree-lua pkgs.vimPlugins.nvim-web-devicons ];
|
||||||
|
|
||||||
plugins = [
|
|
||||||
pkgs.vimPlugins.nvim-tree-lua
|
|
||||||
pkgs.vimPlugins.nvim-web-devicons
|
|
||||||
];
|
|
||||||
|
|
||||||
# Disable netrw eagerly
|
# Disable netrw eagerly
|
||||||
# https://github.com/kyazdani42/nvim-tree.lua/commit/fb8735e96cecf004fbefb086ce85371d003c5129
|
# https://github.com/kyazdani42/nvim-tree.lua/commit/fb8735e96cecf004fbefb086ce85371d003c5129
|
||||||
@ -16,18 +10,16 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
setup.nvim-tree = {
|
setup.nvim-tree = {
|
||||||
disable_netrw = true; # Disable the built-in file manager
|
disable_netrw = true;
|
||||||
hijack_netrw = true; # Works as the file manager
|
hijack_netrw = true;
|
||||||
sync_root_with_cwd = true; # Change project whenever currend dir changes
|
sync_root_with_cwd = true;
|
||||||
respect_buf_cwd = true; # Change to exact location of focused buffer
|
respect_buf_cwd = true;
|
||||||
update_focused_file = {
|
update_focused_file = {
|
||||||
# Change project based on the focused buffer
|
|
||||||
enable = true;
|
enable = true;
|
||||||
update_root = true;
|
update_root = true;
|
||||||
ignore_list = { };
|
ignore_list = { };
|
||||||
};
|
};
|
||||||
diagnostics = {
|
diagnostics = {
|
||||||
# Enable LSP and linter integration
|
|
||||||
enable = true;
|
enable = true;
|
||||||
icons = {
|
icons = {
|
||||||
hint = "";
|
hint = "";
|
||||||
@ -37,7 +29,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
renderer = {
|
renderer = {
|
||||||
# Show files with changes vs. current commit
|
|
||||||
icons = {
|
icons = {
|
||||||
glyphs = {
|
glyphs = {
|
||||||
git = {
|
git = {
|
||||||
@ -52,7 +43,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# Set keybinds and initialize program
|
|
||||||
on_attach = dsl.rawLua ''
|
on_attach = dsl.rawLua ''
|
||||||
function (bufnr)
|
function (bufnr)
|
||||||
local api = require('nvim-tree.api')
|
local api = require('nvim-tree.api')
|
||||||
@ -69,16 +59,16 @@
|
|||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
view = {
|
view = {
|
||||||
# Set look and feel
|
|
||||||
width = 30;
|
width = 30;
|
||||||
|
hide_root_folder = false;
|
||||||
side = "left";
|
side = "left";
|
||||||
number = false;
|
number = false;
|
||||||
relativenumber = false;
|
relativenumber = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Toggle the sidebar
|
|
||||||
lua = ''
|
lua = ''
|
||||||
vim.keymap.set("n", "<Leader>e", ":NvimTreeFindFileToggle<CR>", { silent = true })
|
vim.keymap.set("n", "<Leader>e", ":NvimTreeFindFileToggle<CR>", { silent = true })
|
||||||
'';
|
'';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,21 +1,13 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }:
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
neovim = import ./package {
|
neovim = import ./package {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
colors = config.theme.colors;
|
colors = config.theme.colors;
|
||||||
terraform = config.terraform.enable;
|
|
||||||
github = true;
|
|
||||||
kubernetes = config.kubernetes.enable;
|
|
||||||
};
|
};
|
||||||
in
|
|
||||||
{
|
in {
|
||||||
|
|
||||||
options.neovim.enable = lib.mkEnableOption "Neovim.";
|
options.neovim.enable = lib.mkEnableOption "Neovim.";
|
||||||
|
|
||||||
@ -26,48 +18,36 @@ in
|
|||||||
|
|
||||||
home.packages = [ neovim ];
|
home.packages = [ neovim ];
|
||||||
|
|
||||||
# Use Neovim as the editor for git commit messages
|
|
||||||
programs.git.extraConfig.core.editor = "nvim";
|
programs.git.extraConfig.core.editor = "nvim";
|
||||||
programs.jujutsu.settings.ui.editor = "nvim";
|
|
||||||
|
|
||||||
# Set Neovim as the default app for text editing and manual pages
|
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
EDITOR = "nvim";
|
EDITOR = "nvim";
|
||||||
MANPAGER = "nvim +Man!";
|
MANPAGER = "nvim +Man!";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Create quick aliases for launching Neovim
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
shellAliases = {
|
shellAliases = { vim = "nvim"; };
|
||||||
vim = "nvim";
|
|
||||||
};
|
|
||||||
shellAbbrs = {
|
shellAbbrs = {
|
||||||
v = lib.mkForce "nvim";
|
v = lib.mkForce "nvim";
|
||||||
vl = lib.mkForce "nvim -c 'normal! `0' -c 'bdelete 1'";
|
vl = lib.mkForce "nvim -c 'normal! `0' -c 'bdelete 1'";
|
||||||
vll = "nvim -c 'Telescope oldfiles'";
|
vll = "nvim -c 'Telescope oldfiles'";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
programs.kitty.settings.scrollback_pager = lib.mkForce ''
|
||||||
|
${neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
|
||||||
|
|
||||||
# Set Neovim as the kitty terminal "scrollback" (vi mode) option.
|
|
||||||
# Requires removing some of the ANSI escape codes that are sent to the
|
|
||||||
# scrollback using sed and baleia, as well as removing several
|
|
||||||
# unnecessary features.
|
|
||||||
programs.kitty.settings.scrollback_pager = "${neovim}/bin/nvim --headless +'KittyScrollbackGenerateKittens' +'set nonumber' +'set norelativenumber' +'%print' +'quit!' 2>&1";
|
|
||||||
|
|
||||||
# Create a desktop option for launching Neovim from a file manager
|
|
||||||
# (Requires launching the terminal and then executing Neovim)
|
|
||||||
xdg.desktopEntries.nvim = lib.mkIf pkgs.stdenv.isLinux {
|
xdg.desktopEntries.nvim = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
name = "Neovim wrapper";
|
name = "Neovim wrapper";
|
||||||
exec = "kitty nvim %F";
|
exec = "kitty nvim %F";
|
||||||
mimeType = [
|
|
||||||
"text/plain"
|
|
||||||
"text/markdown"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
xdg.mimeApps.defaultApplications = lib.mkIf pkgs.stdenv.isLinux {
|
xdg.mimeApps.defaultApplications = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
"text/plain" = [ "nvim.desktop" ];
|
"text/plain" = [ "nvim.desktop" ];
|
||||||
"text/markdown" = [ "nvim.desktop" ];
|
"text/markdown" = [ "nvim.desktop" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# # Used for icons in Vim
|
||||||
|
# fonts.fonts = with pkgs; [ nerdfonts ];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ key("n", "<Leader>fs", ":write<CR>")
|
|||||||
key("n", "<Leader>fd", ":lcd %:p:h<CR>", { silent = true })
|
key("n", "<Leader>fd", ":lcd %:p:h<CR>", { silent = true })
|
||||||
key("n", "<Leader>fu", ":lcd ..<CR>", { silent = true })
|
key("n", "<Leader>fu", ":lcd ..<CR>", { silent = true })
|
||||||
key("n", "<Leader><Tab>", ":b#<CR>", { silent = true })
|
key("n", "<Leader><Tab>", ":b#<CR>", { silent = true })
|
||||||
|
key("n", "<Leader>gr", ":!gh repo view -w<CR><CR>", { silent = true })
|
||||||
key("n", "<Leader>tt", [[<Cmd>exe 'edit $NOTES_PATH/journal/'.strftime("%Y-%m-%d_%a").'.md'<CR>]])
|
key("n", "<Leader>tt", [[<Cmd>exe 'edit $NOTES_PATH/journal/'.strftime("%Y-%m-%d_%a").'.md'<CR>]])
|
||||||
key("n", "<Leader>jj", ":!journal<CR>:e<CR>")
|
key("n", "<Leader>jj", ":!journal<CR>:e<CR>")
|
||||||
|
|
||||||
@ -64,12 +65,6 @@ key("n", "<C-Down>", ":resize -2<CR>", { silent = true })
|
|||||||
key("n", "<C-Left>", ":vertical resize -2<CR>", { silent = true })
|
key("n", "<C-Left>", ":vertical resize -2<CR>", { silent = true })
|
||||||
key("n", "<C-Right>", ":vertical resize +2<CR>", { silent = true })
|
key("n", "<C-Right>", ":vertical resize +2<CR>", { silent = true })
|
||||||
|
|
||||||
-- Quickfix
|
|
||||||
key("n", "]q", ":cnext<CR>")
|
|
||||||
key("n", "[q", ":cprevious<CR>")
|
|
||||||
key("n", "co", ":copen<CR>")
|
|
||||||
key("n", "cq", ":cclose<CR>")
|
|
||||||
|
|
||||||
-- Other
|
-- Other
|
||||||
key("n", "<A-CR>", ":noh<CR>", { silent = true }) --- Clear search in VimWiki
|
key("n", "<A-CR>", ":noh<CR>", { silent = true }) --- Clear search in VimWiki
|
||||||
key("n", "Y", "y$") --- Copy to end of line
|
key("n", "Y", "y$") --- Copy to end of line
|
||||||
|
@ -11,22 +11,8 @@ vim.filetype.add({
|
|||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
vim.api.nvim_create_autocmd("FileType", {
|
||||||
pattern = "mail",
|
pattern = "*.eml",
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.o.wrapmargin = 79 -- Wrap text automatically
|
vim.o.wrapmargin = 79 -- Wrap text automatically
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
|
||||||
pattern = "markdown",
|
|
||||||
callback = function()
|
|
||||||
vim.o.formatoptions = vim.o.formatopions + "a"
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd("FileType", {
|
|
||||||
pattern = "terraform",
|
|
||||||
callback = function()
|
|
||||||
vim.bo.commentstring = "# %s"
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
@ -26,25 +26,13 @@
|
|||||||
# ] ++ extraConfig;
|
# ] ++ extraConfig;
|
||||||
# }
|
# }
|
||||||
|
|
||||||
{
|
{ pkgs, colors, ... }:
|
||||||
pkgs,
|
|
||||||
colors,
|
|
||||||
terraform ? false,
|
|
||||||
github ? false,
|
|
||||||
kubernetes ? false,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
|
|
||||||
# Comes from nix2vim overlay:
|
# Comes from nix2vim overlay:
|
||||||
# https://github.com/gytis-ivaskevicius/nix2vim/blob/master/lib/neovim-builder.nix
|
# https://github.com/gytis-ivaskevicius/nix2vim/blob/master/lib/neovim-builder.nix
|
||||||
pkgs.neovimBuilder {
|
pkgs.neovimBuilder {
|
||||||
package = pkgs.neovim-unwrapped;
|
package = pkgs.neovim-unwrapped;
|
||||||
inherit
|
inherit colors;
|
||||||
colors
|
|
||||||
terraform
|
|
||||||
github
|
|
||||||
kubernetes
|
|
||||||
;
|
|
||||||
imports = [
|
imports = [
|
||||||
../config/align.nix
|
../config/align.nix
|
||||||
../config/bufferline.nix
|
../config/bufferline.nix
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
{ ... }:
|
{ ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./haskell.nix
|
./haskell.nix
|
||||||
./kubernetes.nix
|
./kubernetes.nix
|
||||||
./lua.nix
|
./lua.nix
|
||||||
|
./nix.nix
|
||||||
./python.nix
|
./python.nix
|
||||||
./rust.nix
|
|
||||||
./terraform.nix
|
./terraform.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,14 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }: {
|
||||||
{
|
|
||||||
|
|
||||||
options.haskell.enable = lib.mkEnableOption "Haskell programming language.";
|
options.haskell.enable = lib.mkEnableOption "Haskell programming language.";
|
||||||
|
|
||||||
config = lib.mkIf config.haskell.enable {
|
config = lib.mkIf config.haskell.enable {
|
||||||
|
|
||||||
# Binary Cache for Haskell.nix
|
# Binary Cache for Haskell.nix
|
||||||
nix.settings.trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
|
nix.settings.trusted-public-keys =
|
||||||
|
[ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
|
||||||
nix.settings.substituters = [ "https://cache.iog.io" ];
|
nix.settings.substituters = [ "https://cache.iog.io" ];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.kubernetes.enable = lib.mkEnableOption "Kubernetes tools.";
|
options.kubernetes.enable = lib.mkEnableOption "Kubernetes tools.";
|
||||||
|
|
||||||
@ -30,135 +24,122 @@
|
|||||||
# Terminal Kubernetes UI
|
# Terminal Kubernetes UI
|
||||||
programs.k9s = {
|
programs.k9s = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
# settings = { k9s = { headless = true; }; };
|
||||||
|
skin = {
|
||||||
k9s = {
|
k9s = {
|
||||||
ui = {
|
body = {
|
||||||
enableMouse = true;
|
fgColor = config.theme.colors.base06;
|
||||||
headless = true;
|
bgColor = config.theme.colors.base00;
|
||||||
logoless = true;
|
logoColor = config.theme.colors.base02; # *blue ?
|
||||||
crumbsless = false;
|
|
||||||
skin = "main";
|
|
||||||
};
|
};
|
||||||
};
|
# Search bar
|
||||||
};
|
prompt = {
|
||||||
skins = {
|
fgColor = config.theme.colors.base06;
|
||||||
main = {
|
bgColor = config.theme.colors.base00;
|
||||||
k9s = {
|
suggestColor = config.theme.colors.base03;
|
||||||
body = {
|
};
|
||||||
|
# Header left side
|
||||||
|
info = {
|
||||||
|
fgColor = config.theme.colors.base04;
|
||||||
|
sectionColor = config.theme.colors.base05;
|
||||||
|
};
|
||||||
|
dialog = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
buttonFgColor = config.theme.colors.base06;
|
||||||
|
buttonBgColor = config.theme.colors.base0E;
|
||||||
|
buttonFocusFgColor = config.theme.colors.base07;
|
||||||
|
buttonFocusBgColor = config.theme.colors.base02; # *cyan
|
||||||
|
labelFgColor = config.theme.colors.base09;
|
||||||
|
fieldFgColor = config.theme.colors.base06;
|
||||||
|
};
|
||||||
|
frame = {
|
||||||
|
border = {
|
||||||
|
fgColor = config.theme.colors.base01;
|
||||||
|
focusColor = config.theme.colors.base06;
|
||||||
|
};
|
||||||
|
menu = {
|
||||||
fgColor = config.theme.colors.base06;
|
fgColor = config.theme.colors.base06;
|
||||||
bgColor = "default";
|
keyColor = config.theme.colors.base0E; # *magenta
|
||||||
logoColor = config.theme.colors.base02; # *blue ?
|
numKeyColor = config.theme.colors.base0E; # *magenta
|
||||||
};
|
};
|
||||||
# Search bar
|
crumbs = {
|
||||||
prompt = {
|
|
||||||
fgColor = config.theme.colors.base06;
|
fgColor = config.theme.colors.base06;
|
||||||
bgColor = "default";
|
bgColor = config.theme.colors.base01;
|
||||||
suggestColor = config.theme.colors.base03;
|
activeColor = config.theme.colors.base03;
|
||||||
};
|
};
|
||||||
# Header left side
|
status = {
|
||||||
info = {
|
newColor = config.theme.colors.base04; # *cyan
|
||||||
fgColor = config.theme.colors.base04;
|
modifyColor = config.theme.colors.base0D; # *blue
|
||||||
sectionColor = config.theme.colors.base05;
|
addColor = config.theme.colors.base0B; # *green
|
||||||
|
errorColor = config.theme.colors.base08; # *red
|
||||||
|
highlightColor = config.theme.colors.base09; # *orange
|
||||||
|
killColor = config.theme.colors.base03; # *comment
|
||||||
|
completedColor = config.theme.colors.base03; # *comment
|
||||||
};
|
};
|
||||||
dialog = {
|
title = {
|
||||||
fgColor = config.theme.colors.base06;
|
fgColor = config.theme.colors.base06;
|
||||||
bgColor = "default";
|
bgColor = config.theme.colors.base00;
|
||||||
buttonFgColor = config.theme.colors.base06;
|
highlightColor = config.theme.colors.base09; # *orange
|
||||||
buttonBgColor = config.theme.colors.base0E;
|
counterColor = config.theme.colors.base0D; # *blue
|
||||||
buttonFocusFgColor = config.theme.colors.base07;
|
filterColor = config.theme.colors.base0E; # *magenta
|
||||||
buttonFocusBgColor = config.theme.colors.base02; # *cyan
|
|
||||||
labelFgColor = config.theme.colors.base09;
|
|
||||||
fieldFgColor = config.theme.colors.base06;
|
|
||||||
};
|
};
|
||||||
frame = {
|
};
|
||||||
border = {
|
views = {
|
||||||
fgColor = config.theme.colors.base01;
|
charts = {
|
||||||
focusColor = config.theme.colors.base06;
|
bgColor = config.theme.colors.base00;
|
||||||
};
|
defaultDialColors =
|
||||||
menu = {
|
[ config.theme.colors.base0D config.theme.colors.base08 ];
|
||||||
fgColor = config.theme.colors.base06;
|
# - *blue
|
||||||
keyColor = config.theme.colors.base0E; # *magenta
|
# - *red
|
||||||
numKeyColor = config.theme.colors.base0E; # *magenta
|
defaultChartColors =
|
||||||
};
|
[ config.theme.colors.base0D config.theme.colors.base08 ];
|
||||||
crumbs = {
|
# - *blue
|
||||||
fgColor = config.theme.colors.base06;
|
# - *red
|
||||||
bgColor = config.theme.colors.base01;
|
|
||||||
activeColor = config.theme.colors.base03;
|
|
||||||
};
|
|
||||||
status = {
|
|
||||||
newColor = config.theme.colors.base04; # *cyan
|
|
||||||
modifyColor = config.theme.colors.base0D; # *blue
|
|
||||||
addColor = config.theme.colors.base0B; # *green
|
|
||||||
errorColor = config.theme.colors.base08; # *red
|
|
||||||
highlightColor = config.theme.colors.base09; # *orange
|
|
||||||
killColor = config.theme.colors.base03; # *comment
|
|
||||||
completedColor = config.theme.colors.base03; # *comment
|
|
||||||
};
|
|
||||||
title = {
|
|
||||||
fgColor = config.theme.colors.base06;
|
|
||||||
bgColor = "default";
|
|
||||||
highlightColor = config.theme.colors.base09; # *orange
|
|
||||||
counterColor = config.theme.colors.base0D; # *blue
|
|
||||||
filterColor = config.theme.colors.base0E; # *magenta
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
views = {
|
table = {
|
||||||
charts = {
|
# List of resources
|
||||||
bgColor = "default";
|
fgColor = config.theme.colors.base06;
|
||||||
defaultDialColors = [
|
bgColor = config.theme.colors.base00;
|
||||||
config.theme.colors.base0D
|
|
||||||
config.theme.colors.base08
|
|
||||||
];
|
|
||||||
# - *blue
|
|
||||||
# - *red
|
|
||||||
defaultChartColors = [
|
|
||||||
config.theme.colors.base0D
|
|
||||||
config.theme.colors.base08
|
|
||||||
];
|
|
||||||
# - *blue
|
|
||||||
# - *red
|
|
||||||
};
|
|
||||||
table = {
|
|
||||||
# List of resources
|
|
||||||
fgColor = config.theme.colors.base06;
|
|
||||||
bgColor = "default";
|
|
||||||
|
|
||||||
# Row selection
|
# Row selection
|
||||||
cursorFgColor = config.theme.colors.base07;
|
cursorFgColor = config.theme.colors.base07;
|
||||||
cursorBgColor = config.theme.colors.base01;
|
cursorBgColor = config.theme.colors.base01;
|
||||||
|
|
||||||
# Header row
|
# Header row
|
||||||
header = {
|
header = {
|
||||||
fgColor = config.theme.colors.base0D;
|
fgColor = config.theme.colors.base0D;
|
||||||
bgColor = "default";
|
bgColor = config.theme.colors.base00;
|
||||||
sorterColor = config.theme.colors.base0A; # *selection
|
sorterColor = config.theme.colors.base0A; # *selection
|
||||||
};
|
|
||||||
};
|
};
|
||||||
xray = {
|
};
|
||||||
|
xray = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
cursorColor = config.theme.colors.base06;
|
||||||
|
graphicColor = config.theme.colors.base0D;
|
||||||
|
showIcons = false;
|
||||||
|
};
|
||||||
|
yaml = {
|
||||||
|
keyColor = config.theme.colors.base0D;
|
||||||
|
colonColor = config.theme.colors.base04;
|
||||||
|
fgColor = config.theme.colors.base03;
|
||||||
|
};
|
||||||
|
logs = {
|
||||||
|
fgColor = config.theme.colors.base06;
|
||||||
|
bgColor = config.theme.colors.base00;
|
||||||
|
indicator = {
|
||||||
fgColor = config.theme.colors.base06;
|
fgColor = config.theme.colors.base06;
|
||||||
bgColor = "default";
|
bgColor = config.theme.colors.base00;
|
||||||
cursorColor = config.theme.colors.base06;
|
|
||||||
graphicColor = config.theme.colors.base0D;
|
|
||||||
showIcons = false;
|
|
||||||
};
|
|
||||||
yaml = {
|
|
||||||
keyColor = config.theme.colors.base0D;
|
|
||||||
colonColor = config.theme.colors.base04;
|
|
||||||
fgColor = config.theme.colors.base03;
|
|
||||||
};
|
|
||||||
logs = {
|
|
||||||
fgColor = config.theme.colors.base06;
|
|
||||||
bgColor = "default";
|
|
||||||
indicator = {
|
|
||||||
fgColor = config.theme.colors.base06;
|
|
||||||
bgColor = "default";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.lua.enable = lib.mkEnableOption "Lua programming language.";
|
options.lua.enable = lib.mkEnableOption "Lua programming language.";
|
||||||
|
|
||||||
@ -14,4 +8,5 @@
|
|||||||
sumneko-lua-language-server # Lua LSP
|
sumneko-lua-language-server # Lua LSP
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
18
modules/common/programming/nix.nix
Normal file
18
modules/common/programming/nix.nix
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
|
options.nixlang.enable = lib.mkEnableOption "Nix programming language.";
|
||||||
|
|
||||||
|
config = lib.mkIf config.nixlang.enable {
|
||||||
|
|
||||||
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
nixfmt # Nix file formatter
|
||||||
|
nil # Nix language server
|
||||||
|
];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -1,10 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.python.enable = lib.mkEnableOption "Python programming language.";
|
options.python.enable = lib.mkEnableOption "Python programming language.";
|
||||||
|
|
||||||
@ -19,9 +13,10 @@
|
|||||||
python310Packages.flake8 # Python linter
|
python310Packages.flake8 # Python linter
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.fish.shellAbbrs = {
|
programs.fish.shellAbbrs = { py = "python3"; };
|
||||||
py = "python3";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.rust.enable = lib.mkEnableOption "Rust programming language.";
|
|
||||||
|
|
||||||
config = lib.mkIf config.rust.enable {
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
|
||||||
|
|
||||||
programs.fish.shellAbbrs = {
|
|
||||||
ca = "cargo";
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
cargo
|
|
||||||
rustc
|
|
||||||
clippy
|
|
||||||
gcc
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
@ -1,15 +1,8 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
options.terraform.enable = lib.mkEnableOption "Terraform tools.";
|
options.terraform.enable = lib.mkEnableOption "Terraform tools.";
|
||||||
|
|
||||||
config = lib.mkIf config.terraform.enable {
|
config = lib.mkIf config.terraform.enable {
|
||||||
unfreePackages = [ "terraform" ];
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
programs.fish.shellAbbrs = {
|
programs.fish.shellAbbrs = {
|
||||||
@ -21,6 +14,9 @@
|
|||||||
terraform-ls # Language server
|
terraform-ls # Language server
|
||||||
tflint # Linter
|
tflint # Linter
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
{ ... }:
|
{ ... }: {
|
||||||
{
|
|
||||||
|
imports = [ ./dotfiles.nix ./notes.nix ];
|
||||||
|
|
||||||
imports = [
|
|
||||||
./dotfiles.nix
|
|
||||||
./notes.nix
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,4 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
# Allows me to make sure I can work on my dotfiles locally
|
|
||||||
|
|
||||||
options.dotfiles.enable = lib.mkEnableOption "Clone dotfiles.";
|
options.dotfiles.enable = lib.mkEnableOption "Clone dotfiles.";
|
||||||
|
|
||||||
@ -17,17 +9,28 @@
|
|||||||
home.activation = {
|
home.activation = {
|
||||||
|
|
||||||
# Always clone dotfiles repository if it doesn't exist
|
# Always clone dotfiles repository if it doesn't exist
|
||||||
cloneDotfiles = config.home-manager.users.${config.user}.lib.dag.entryAfter [ "writeBoundary" ] ''
|
cloneDotfiles =
|
||||||
if [ ! -d "${config.dotfilesPath}" ]; then
|
config.home-manager.users.${config.user}.lib.dag.entryAfter
|
||||||
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
|
[ "writeBoundary" ] ''
|
||||||
$DRY_RUN_CMD ${pkgs.git}/bin/git \
|
if [ ! -d "${config.dotfilesPath}" ]; then
|
||||||
clone ${config.dotfilesRepo} "${config.dotfilesPath}"
|
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
|
||||||
fi
|
|
||||||
'';
|
# Force HTTPS because anonymous SSH doesn't work
|
||||||
|
GIT_CONFIG_COUNT=1 \
|
||||||
|
GIT_CONFIG_KEY_0="url.https://github.com/.insteadOf" \
|
||||||
|
GIT_CONFIG_VALUE_0="git@github.com:" \
|
||||||
|
$DRY_RUN_CMD \
|
||||||
|
${pkgs.git}/bin/git clone ${config.dotfilesRepo} "${config.dotfilesPath}"
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Set a variable for dotfiles repo, not necessary but convenient
|
# Set a variable for dotfiles repo, not necessary but convenient
|
||||||
home.sessionVariables.DOTS = config.dotfilesPath;
|
home.sessionVariables.DOTS = config.dotfilesPath;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,4 @@
|
|||||||
{
|
{ config, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
{
|
|
||||||
|
|
||||||
# This is just a placeholder as I expect to interact with my notes in a
|
|
||||||
# certain location
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
@ -15,22 +6,6 @@
|
|||||||
NOTES_PATH = "${config.homePath}/dev/personal/notes/content";
|
NOTES_PATH = "${config.homePath}/dev/personal/notes/content";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Sync notes for Nextcloud automatically
|
|
||||||
systemd.user.timers.refresh-notes = lib.mkIf config.services.nextcloud.enable {
|
|
||||||
Timer = {
|
|
||||||
OnCalendar = "*-*-* *:0/10:50"; # Every 10 minutes
|
|
||||||
Unit = "refresh-notes.service";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
systemd.user.services.refresh-notes = {
|
|
||||||
Unit.Description = "Get latest notes.";
|
|
||||||
Service = {
|
|
||||||
Type = "oneshot";
|
|
||||||
ExecStartPre = "${pkgs.git}/bin/git -C /data/git/notes reset --hard master";
|
|
||||||
ExecStart = "${pkgs.git}/bin/git -C /data/git/notes pull";
|
|
||||||
WorkingDirectory = config.homePath;
|
|
||||||
Environment = "PATH=${pkgs.openssh}/bin";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
{ config, lib, ... }:
|
|
||||||
{
|
|
||||||
|
|
||||||
# Shell history sync
|
|
||||||
|
|
||||||
options.atuin.enable = lib.mkEnableOption "Atuin";
|
|
||||||
|
|
||||||
config = {
|
|
||||||
|
|
||||||
home-manager.users.${config.user} = lib.mkIf config.atuin.enable {
|
|
||||||
|
|
||||||
programs.atuin = {
|
|
||||||
enable = true;
|
|
||||||
flags = [
|
|
||||||
"--disable-up-arrow"
|
|
||||||
"--disable-ctrl-r"
|
|
||||||
];
|
|
||||||
settings = {
|
|
||||||
auto_sync = true;
|
|
||||||
update_check = false;
|
|
||||||
sync_address = "https://api.atuin.sh";
|
|
||||||
search_mode = "fuzzy";
|
|
||||||
filter_mode = "host"; # global, host, session, directory
|
|
||||||
search_mode_shell_up_key_binding = "fuzzy";
|
|
||||||
filter_mode_shell_up_key_binding = "session";
|
|
||||||
style = "compact"; # or auto,full
|
|
||||||
show_help = true;
|
|
||||||
history_filter = [ ];
|
|
||||||
secrets_filter = true;
|
|
||||||
enter_accept = false;
|
|
||||||
keymap_mode = "vim-normal";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# Give root user the same setup
|
|
||||||
home-manager.users.root.programs.atuin = config.home-manager.users.${config.user}.programs.atuin;
|
|
||||||
};
|
|
||||||
}
|
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user