1 Commits

Author SHA1 Message Date
b0b9827a2e try to configure using nixosModules
doesn't seem like there's that much benefit?
2023-07-10 17:56:15 -06:00
192 changed files with 1410 additions and 6653 deletions

View File

@ -1,125 +0,0 @@
name: Arrow
env:
TERRAFORM_DIRECTORY: hosts/arrow
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_ENDPOINT_URL_S3: "https://${{ secrets.CLOUDFLARE_ACCOUNT_ID }}.r2.cloudflarestorage.com"
TF_VAR_vultr_api_key: ${{ secrets.VULTR_API_KEY }}
on:
workflow_dispatch:
inputs:
rebuild:
type: boolean
default: false
action:
type: choice
required: true
default: create
options:
- create
- destroy
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 .#image.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 }}"
# # 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
# 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 }}
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 host_ip
- name: Wait on SSH
uses: iFaxity/wait-on-action@v1.1.0
with:
resource: tcp ${{ steps.host.outputs.stdout }}:22
interval: 5000
- name: Write Identity Keys to Files
if: inputs.action == 'create'
run: |
echo "${{ env.DEPLOY_IDENTITY_BASE64 }}" | base64 -d > deploy_ed25519
echo "${{ env.ARROW_IDENTITY_BASE64 }}" | base64 -d > arrow_ed25519
- name: Copy Identity File to Host
if: inputs.action == 'create'
run: scp -i deploy_ed25519 arrow_ed25519 noah@${{ steps.host.outputs.stdout }}:~/.ssh/id_ed25519

View File

@ -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

View File

@ -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
View File

@ -1,7 +1,6 @@
.DS_Store .DS_Store
*.bak *.bak
*.db *.db
*.qcow2
**/.direnv/** **/.direnv/**
result result
private/** private/**

View File

@ -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,30 +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
![Diagram](https://github.com/nmasur/dotfiles/assets/7386960/ed3e7202-09c4-4a9c-9b14-0272c01647f6)
- [flake.nix](./flake.nix)
- [hosts](./hosts/)
- [modules](./modules/)
---
# 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

View File

@ -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
```

View File

@ -11,7 +11,7 @@
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 builtins.toString ../public-keys
} $tmpfile } $tmpfile
rm $tmpfile rm $tmpfile
''); '');

View File

@ -17,8 +17,8 @@
--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

View File

@ -5,7 +5,6 @@
program = builtins.toString (pkgs.writeShellScript "loadkey" '' program = builtins.toString (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"
mkdir -p ~/.ssh/
${pkgs.melt}/bin/melt restore ~/.ssh/id_ed25519 ${pkgs.melt}/bin/melt restore ~/.ssh/id_ed25519
printf "\n\nContinuing activation.\n\n" printf "\n\nContinuing activation.\n\n"
''); '');

View File

@ -17,7 +17,7 @@
--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 builtins.toString ../public-keys
} $tmpfile > $encryptedfile } $tmpfile > $encryptedfile
rm $tmpfile rm $tmpfile
done done

View File

@ -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.

View File

@ -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.

View File

@ -4,34 +4,38 @@
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" ];
};
};
}; };
}
];
}; };
}; };
}; };

View File

@ -1,4 +0,0 @@
# Documentation
Reference documents for some of the more complicated services and maintenance
tasks.

View File

@ -49,24 +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
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
``` ```

View File

@ -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
View 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
```

View File

@ -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
```

637
flake.lock generated
View File

@ -1,87 +1,6 @@
{ {
"nodes": { "nodes": {
"baleia-nvim-src": { "Comment-nvim-src": {
"flake": false,
"locked": {
"lastModified": 1704551058,
"narHash": "sha256-0NmiGzMFvL1awYOVtiaSd+O4sAR524x68xwWLgArlqs=",
"owner": "m00qek",
"repo": "baleia.nvim",
"rev": "6d9cbdaca3a428bc7296f838fdfce3ad01ee7495",
"type": "github"
},
"original": {
"owner": "m00qek",
"repo": "baleia.nvim",
"type": "github"
}
},
"base16-nvim-src": {
"flake": false,
"locked": {
"lastModified": 1708139024,
"narHash": "sha256-l0BO2boIy6mwK8ISWS3D68f8egqHYwsGSAnzjbB5aOE=",
"owner": "RRethy",
"repo": "base16-nvim",
"rev": "b3e9ec6a82c05b562cd71f40fe8964438a9ba64a",
"type": "github"
},
"original": {
"owner": "RRethy",
"repo": "base16-nvim",
"type": "github"
}
},
"bufferline-nvim-src": {
"flake": false,
"locked": {
"lastModified": 1706180994,
"narHash": "sha256-/iGzUDJaodkUyWpwim8UtwaRuarfu/Nk6wxVApk+QxY=",
"owner": "akinsho",
"repo": "bufferline.nvim",
"rev": "d6cb9b7cac52887bcac65f8698e67479553c0748",
"type": "github"
},
"original": {
"owner": "akinsho",
"ref": "v4.5.0",
"repo": "bufferline.nvim",
"type": "github"
}
},
"bypass-paywalls-clean": {
"flake": false,
"locked": {
"lastModified": 1709556839,
"narHash": "sha256-LbsaYISpsjCI8DXPu2toBI3uMK+Xau1sWuzA2xsQ6Pg=",
"owner": "magnolia1234",
"repo": "bpc-uploads",
"rev": "0ca7c6a857e4e6c3e508228168e8de70e21cee3a",
"type": "gitlab"
},
"original": {
"owner": "magnolia1234",
"repo": "bpc-uploads",
"type": "gitlab"
}
},
"cmp-nvim-lsp-src": {
"flake": false,
"locked": {
"lastModified": 1702205473,
"narHash": "sha256-/0sh9vJBD9pUuD7q3tNSQ1YLvxFMNykdg5eG+LjZAA8=",
"owner": "hrsh7th",
"repo": "cmp-nvim-lsp",
"rev": "5af77f54de1b16c34b23cba810150689a3a90312",
"type": "github"
},
"original": {
"owner": "hrsh7th",
"repo": "cmp-nvim-lsp",
"type": "github"
}
},
"comment-nvim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1681214440, "lastModified": 1681214440,
@ -98,6 +17,39 @@
"type": "github" "type": "github"
} }
}, },
"bufferline-nvim-src": {
"flake": false,
"locked": {
"lastModified": 1687763763,
"narHash": "sha256-wbOeylzjjScQXkrDbBU2HtrOZrp2YUK+wQ2aOkgxmRQ=",
"owner": "akinsho",
"repo": "bufferline.nvim",
"rev": "bf2f6b7edd0abf6b0732f5e5c0a8f30e51611c75",
"type": "github"
},
"original": {
"owner": "akinsho",
"ref": "v4.2.0",
"repo": "bufferline.nvim",
"type": "github"
}
},
"cmp-nvim-lsp-src": {
"flake": false,
"locked": {
"lastModified": 1687494203,
"narHash": "sha256-mU0soCz79erJXMMqD/FyrJZ0mu2n6fE0deymPzQlxts=",
"owner": "hrsh7th",
"repo": "cmp-nvim-lsp",
"rev": "44b16d11215dce86f253ce0c30949813c0a90765",
"type": "github"
},
"original": {
"owner": "hrsh7th",
"repo": "cmp-nvim-lsp",
"type": "github"
}
},
"darwin": { "darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -105,11 +57,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1709771483, "lastModified": 1687517837,
"narHash": "sha256-Hjzu9nCknHLQvhdaRFfCEprH0o15KcaNu1QDr3J88DI=", "narHash": "sha256-Ea+JTy6NSf+wWIFrgC8gnOnyt01xwmtDEn2KecvaBkg=",
"owner": "lnl7", "owner": "lnl7",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "550340062c16d7ef8c2cc20a3d2b97bcd3c6b6f6", "rev": "6460468e7a3e1290f132fee4170ebeaa127f6f32",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -126,11 +78,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1709967935, "lastModified": 1687598357,
"narHash": "sha256-ZLLdGWs9njivxZsfSzfQN05g6WIyIe24bPb61y7FVqo=", "narHash": "sha256-70ciIe8415oQnQypawaqocEaLJcI1XtkqRNmle8vsrg=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "72818e54ec29427f8d9f9cfa6fc859d01ca6dc66", "rev": "1e7098ee0448dc5d33df394d040f454cd42a809c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -139,23 +91,6 @@
"type": "github" "type": "github"
} }
}, },
"fidget-nvim-src": {
"flake": false,
"locked": {
"lastModified": 1704696337,
"narHash": "sha256-uAX/RGfOmsUIUaDepNwUpK8MBaTMBJ4rLZ69y0MwpNE=",
"owner": "j-hui",
"repo": "fidget.nvim",
"rev": "3a93300c076109d86c7ce35ec67a8034ae6ba9db",
"type": "github"
},
"original": {
"owner": "j-hui",
"ref": "v1.2.0",
"repo": "fidget.nvim",
"type": "github"
}
},
"firefox-darwin": { "firefox-darwin": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -163,11 +98,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1710031437, "lastModified": 1688605308,
"narHash": "sha256-XauWQSnMUwJOHgW/ByZP1kOrJyNSJxV4aNoBlo8lnoc=", "narHash": "sha256-B9suu7dcdX4a18loO5ul237gqIJ5/+TRuheLj8fJjwM=",
"owner": "bandithedoge", "owner": "bandithedoge",
"repo": "nixpkgs-firefox-darwin", "repo": "nixpkgs-firefox-darwin",
"rev": "e9883b75736b2d33787c9326d27d719a644b1c35", "rev": "78d28acf685e19d353b2ecb6c38eeb3fc624fc68",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -179,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": {
@ -193,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": {
@ -212,14 +144,14 @@
}, },
"flake-utils_2": { "flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems_2" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1705309234, "lastModified": 1685518550,
"narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -228,19 +160,21 @@
"type": "github" "type": "github"
} }
}, },
"hmts-nvim-src": { "flake-utils_3": {
"flake": false, "inputs": {
"systems": "systems_2"
},
"locked": { "locked": {
"lastModified": 1706900289, "lastModified": 1685518550,
"narHash": "sha256-kw3YJ21nhs/x9Jp7kvnL+9FuiSgLB1hO/ON3QeeZx9g=", "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "calops", "owner": "numtide",
"repo": "hmts.nvim", "repo": "flake-utils",
"rev": "ba1239972a1f56b94252d4f85a43e777ac419662", "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "calops", "owner": "numtide",
"repo": "hmts.nvim", "repo": "flake-utils",
"type": "github" "type": "github"
} }
}, },
@ -251,11 +185,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1709988192, "lastModified": 1687627695,
"narHash": "sha256-qxwIkl85P0I1/EyTT+NJwzbXdOv86vgZxcv4UKicjK8=", "narHash": "sha256-6Pu7nWb52PRtUmihwuDNShDmsZiXgtXR0OARtH4DSik=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "b0b0c3d94345050a7f86d1ebc6c56eea4389d030", "rev": "172d46d4b2677b32277d903bdf4cff77c2cc6477",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -265,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": 1710038457, "lastModified": 1680544266,
"narHash": "sha256-/6uDN3wE6uO4yxj7tNtLXjaMse2DCQsehpTnoEyBA/U=", "narHash": "sha256-d/TusDXmIo8IT5DNRA21lN+nOVSER8atIx9TJteR6LQ=",
"owner": "mikesmithgh", "owner": "oxalica",
"repo": "kitty-scrollback.nvim", "repo": "nil",
"rev": "c3014974e4cd498a534ff814761ef794ebb85d01", "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": 1710042081,
"narHash": "sha256-UeZXoZFEPJj7zEVNTXJ3IYNt/wI7VFq3Pjh1ubMHCBo=",
"type": "tarball",
"url": "https://snappymail.eu/repository/nextcloud/snappymail-2.32.0-nextcloud.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://snappymail.eu/repository/nextcloud/snappymail-2.32.0-nextcloud.tar.gz"
}
},
"nix2vim": { "nix2vim": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1707832982, "lastModified": 1685980282,
"narHash": "sha256-Jsrj8HJyo+PmjrHIDhq4gjZCE0eYCVmmTrx24cG8eOQ=", "narHash": "sha256-uQyVaoqkiocA8bXKMfrgizuKmz0hUzHye5owFoUd2AQ=",
"owner": "gytis-ivaskevicius", "owner": "gytis-ivaskevicius",
"repo": "nix2vim", "repo": "nix2vim",
"rev": "2fb1328cf058fc967b02f9a5330a99253b4c247e", "rev": "3836a348503ae27340c7f83f0bc7bcb907f3781d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -356,11 +245,11 @@
}, },
"nixlib": { "nixlib": {
"locked": { "locked": {
"lastModified": 1709426687, "lastModified": 1687049841,
"narHash": "sha256-jLBZmwXf0WYHzLkmEMq33bqhX55YtT5edvluFr0RcSA=", "narHash": "sha256-FBNZQfWtA7bb/rwk92mfiWc85x4hXta2OAouDqO5W8w=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixpkgs.lib", "repo": "nixpkgs.lib",
"rev": "7873d84a89ae6e4841528ff7f5697ddcb5bdfe6c", "rev": "908af6d1fa3643c5818ea45aa92b21d6385fbbe5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -377,11 +266,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1709887845, "lastModified": 1687398392,
"narHash": "sha256-803UIoB8+vGkm/VK/g55aBAAOf/ncTGvxXyjTF4ydm0=", "narHash": "sha256-T6kc3NMTpGJk1/dve8PGupeVcxboEb78xtTKhe3LL/A=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nixos-generators", "repo": "nixos-generators",
"rev": "bef32a05496d9480b02be586fa7827748b9e597b", "rev": "649171f56a45af13ba693c156207eafbbbf7edfe",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -392,11 +281,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1709703039, "lastModified": 1687502512,
"narHash": "sha256-6hqgQ8OK6gsMu1VtcGKBxKQInRLHtzulDo9Z5jxHEFY=", "narHash": "sha256-dBL/01TayOSZYxtY4cMXuNCBk8UMLoqRZA+94xiFpJA=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9df3e30ce24fd28c7b3e2de0d986769db5d6225d", "rev": "3ae20aa58a6c0d1ca95c9b11f59a2d12eebc511f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -406,50 +295,66 @@
"type": "github" "type": "github"
} }
}, },
"nur": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1710037658, "lastModified": 1686929285,
"narHash": "sha256-6i7th4IX+2E1KX7FEJ4XgYtvQAooLa6YRsUIVRDu0PU=", "narHash": "sha256-WGtVzn+vGMPTXDO0DMNKVFtf+zUSqeW+KKk4Y/Ae99I=",
"owner": "nix-community", "owner": "NixOS",
"repo": "nur", "repo": "nixpkgs",
"rev": "ff870a7e359c3f34fc1144c6c35f76003d6c17e7", "rev": "93fddcf640ceca0be331210ba3101cee9d91c13d",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nix-community", "owner": "NixOS",
"repo": "nur", "ref": "nixos-22.11",
"repo": "nixpkgs",
"type": "github" "type": "github"
} }
}, },
"nvim-lint-src": { "null-ls-nvim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1709238483, "lastModified": 1686871437,
"narHash": "sha256-fYaiUFNaaSPejKBecKB7ifp/soREWYIh3avemU5qJJE=", "narHash": "sha256-MxIZqyRW8jStiDNXt7Bsw8peDLKpqxKEaUuIJsXkGMI=",
"owner": "mfussenegger", "owner": "jose-elias-alvarez",
"repo": "nvim-lint", "repo": "null-ls.nvim",
"rev": "e824adb9bc01647f71e55457353a68f0f37f9931", "rev": "bbaf5a96913aa92281f154b08732be2f57021c45",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "mfussenegger", "owner": "jose-elias-alvarez",
"repo": "nvim-lint", "repo": "null-ls.nvim",
"type": "github"
}
},
"nur": {
"locked": {
"lastModified": 1687625402,
"narHash": "sha256-V+vSWypmm/tGbwNXGhqzmiV7vTjV2gNCEh9N7OhNnyA=",
"owner": "nix-community",
"repo": "nur",
"rev": "aeaf37c7538965e45700d39e6b5dc9c9a0e0749c",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nur",
"type": "github" "type": "github"
} }
}, },
"nvim-lspconfig-src": { "nvim-lspconfig-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1701687137, "lastModified": 1675639052,
"narHash": "sha256-qFjFofA2LoD4yRfx4KGfSCpR3mDkpFaagcm+TVNPqco=", "narHash": "sha256-B8IgpypxzCACZ5VcqM6KiWyClaN+KrmemtkwMznmj5Y=",
"owner": "neovim", "owner": "neovim",
"repo": "nvim-lspconfig", "repo": "nvim-lspconfig",
"rev": "cf3dd4a290084a868fac0e2e876039321d57111c", "rev": "255e07ce2a05627d482d2de77308bba51b90470c",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "neovim", "owner": "neovim",
"ref": "v0.1.7", "ref": "v0.1.6",
"repo": "nvim-lspconfig", "repo": "nvim-lspconfig",
"type": "github" "type": "github"
} }
@ -457,11 +362,11 @@
"nvim-tree-lua-src": { "nvim-tree-lua-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1709951243, "lastModified": 1687132855,
"narHash": "sha256-1lWdTSZt/J4geoQKLkZLQ5Yh992XpZ4cFHw4AGEJFPY=", "narHash": "sha256-ZRUoCDBv8rO8ZUBUMLgo33EBbqD9+ZOSET9rkFsA++E=",
"owner": "kyazdani42", "owner": "kyazdani42",
"repo": "nvim-tree.lua", "repo": "nvim-tree.lua",
"rev": "041dbd18f440207ad161503a384e7c82d575db66", "rev": "c3c6544ee00333b0f1d6a13735d0dd302dba4f70",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -473,108 +378,69 @@
"nvim-treesitter-src": { "nvim-treesitter-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1709968077, "lastModified": 1681121236,
"narHash": "sha256-5cHJMqbiBAbkis9exMAH5Y2ALynaSVmQT8NQTR4VztM=", "narHash": "sha256-iPsPDLhVKJ14iP1/2cCgcY9SCKK/DQz9Y0mQB1DqNiM=",
"owner": "nvim-treesitter", "owner": "nvim-treesitter",
"repo": "nvim-treesitter", "repo": "nvim-treesitter",
"rev": "7ff51f53b0efb6228df2e8539b51bb2e737b77f3", "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"
} }
}, },
"proton-ge": {
"flake": false,
"locked": {
"lastModified": 1710987994,
"narHash": "sha256-NqBzKonCYH+hNpVZzDhrVf+r2i6EwLG/IFBXjE2mC7s=",
"type": "tarball",
"url": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton9-2/GE-Proton9-2.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton9-2/GE-Proton9-2.tar.gz"
}
},
"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",
"bypass-paywalls-clean": "bypass-paywalls-clean",
"cmp-nvim-lsp-src": "cmp-nvim-lsp-src", "cmp-nvim-lsp-src": "cmp-nvim-lsp-src",
"comment-nvim-src": "comment-nvim-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",
"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",
"proton-ge": "proton-ge",
"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": {
@ -610,16 +476,16 @@
"telescope-nvim-src": { "telescope-nvim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1701167040, "lastModified": 1686302912,
"narHash": "sha256-H5RpyWMluE+Yxg7xFX43AZTVW+Yg70DF3FmEGXBUSNg=", "narHash": "sha256-fV3LLRwAPykVGc4ImOnUSP+WTrPp9Ad9OTfBJ6wqTMk=",
"owner": "nvim-telescope", "owner": "nvim-telescope",
"repo": "telescope.nvim", "repo": "telescope.nvim",
"rev": "d90956833d7c27e73c621a61f20b29fdb7122709", "rev": "776b509f80dd49d8205b9b0d94485568236d1192",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "nvim-telescope", "owner": "nvim-telescope",
"ref": "0.1.5", "ref": "0.1.2",
"repo": "telescope.nvim", "repo": "telescope.nvim",
"type": "github" "type": "github"
} }
@ -627,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": {
@ -643,132 +509,33 @@
"toggleterm-nvim-src": { "toggleterm-nvim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1701858874, "lastModified": 1685434104,
"narHash": "sha256-vJApw7XY2wOX9InfWcah+hkNxBfS1+kQUWr4ITxRmgA=", "narHash": "sha256-oiCnBrvft6XxiQtQH8E4F842xhh348SaTpHzaeb+iDY=",
"owner": "akinsho", "owner": "akinsho",
"repo": "toggleterm.nvim", "repo": "toggleterm.nvim",
"rev": "cbd041d91b90cd3c02df03fe6133208888f8e008", "rev": "95204ece0f2a54c89c4395295432f9aeedca7b5f",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "akinsho", "owner": "akinsho",
"ref": "v2.9.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": 1707951703, "lastModified": 1614849738,
"narHash": "sha256-SU5wBy81aANd7oUZvYR14Vd53Ml/cBSwDtO6uG34CaE=", "narHash": "sha256-v392tyzXV+zyBNt5OCB2NBCK7JcByrTa5Ne/nFtSCJI=",
"owner": "tree-sitter", "owner": "run-at-scale",
"repo": "tree-sitter-bash", "repo": "vscode-terraform-doc-snippets",
"rev": "975bc70ad95dbbf2733872bc2e0a059c055db983", "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": 1699877527,
"narHash": "sha256-dYPeVTNWO4apY5dsjsKViavU7YtLeGTp6BzEemXhsEU=",
"owner": "justinmk",
"repo": "tree-sitter-ini",
"rev": "bcb84a2d4bcd6f55b911c42deade75c8f90cb0c5",
"type": "github"
},
"original": {
"owner": "justinmk",
"repo": "tree-sitter-ini",
"type": "github"
}
},
"tree-sitter-lua": {
"flake": false,
"locked": {
"lastModified": 1708499929,
"narHash": "sha256-kzyn6XF4/PN8civ/0UV+ancCMkh7DF2B7WUYxix6aaM=",
"owner": "MunifTanjim",
"repo": "tree-sitter-lua",
"rev": "04c9579dcb917255b2e5f8199df4ae7f587d472f",
"type": "github"
},
"original": {
"owner": "MunifTanjim",
"ref": "main",
"repo": "tree-sitter-lua",
"type": "github"
}
},
"tree-sitter-puppet": {
"flake": false,
"locked": {
"lastModified": 1709480423,
"narHash": "sha256-Lwfiby7amjTIOz8QRoC4RdZyFPfFikmQ2sqta4akyH8=",
"owner": "amaanq",
"repo": "tree-sitter-puppet",
"rev": "5849f9694197a6e822872945b415429c285fdd54",
"type": "github"
},
"original": {
"owner": "amaanq",
"repo": "tree-sitter-puppet",
"type": "github"
}
},
"tree-sitter-python": {
"flake": false,
"locked": {
"lastModified": 1709753184,
"narHash": "sha256-SqPd9O1OqBEOA+WPLfP3J2vuHWt53G5gI/9FWKQx2/Y=",
"owner": "tree-sitter",
"repo": "tree-sitter-python",
"rev": "03e88c170cb23142559a406b6e7621c4af3128f5",
"type": "github"
},
"original": {
"owner": "tree-sitter",
"ref": "master",
"repo": "tree-sitter-python",
"type": "github"
}
},
"tree-sitter-rasi": {
"flake": false,
"locked": {
"lastModified": 1707776004,
"narHash": "sha256-7zhQ5wGm0FFyuTiBVN2KgvUTw8G6fwUGR8HKJ69kR+c=",
"owner": "Fymyte",
"repo": "tree-sitter-rasi",
"rev": "43196d934a9a6ab3c7093a8683efd0111bb03db1",
"type": "github"
},
"original": {
"owner": "Fymyte",
"repo": "tree-sitter-rasi",
"type": "github"
}
},
"tree-sitter-vimdoc": {
"flake": false,
"locked": {
"lastModified": 1709370081,
"narHash": "sha256-v+hSI/6ocC2KxH8ogCexNcxxhcZsl7OvV9197zBCKr4=",
"owner": "neovim",
"repo": "tree-sitter-vimdoc",
"rev": "016ad75faa854e4e13bc40c517015183b795eed9",
"type": "github"
},
"original": {
"owner": "neovim",
"repo": "tree-sitter-vimdoc",
"type": "github" "type": "github"
} }
}, },
@ -791,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": 1709980437, "lastModified": 1687279045,
"narHash": "sha256-rp1MwfRaZl7TPM4E5i1HxQGJCCfMcIa7dOzTX3SW7ro=", "narHash": "sha256-LR0dsXd/A07M61jclyBUW0wRojEQteWReKM35zoJXp0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NixOS-WSL", "repo": "NixOS-WSL",
"rev": "e0b9e6c8ff35c7a28cb6baa02d85a9737a2ee4e9", "rev": "a8486b5d191f11d571f15d80b6e265d1712d01cf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -809,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",

241
flake.nix
View File

@ -9,15 +9,12 @@
# 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 = {
@ -59,38 +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.7";
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; flake = false;
}; };
comment-nvim-src = { Comment-nvim-src = {
# https://github.com/numToStr/Comment.nvim/releases
url = "github:numToStr/Comment.nvim/v0.8.0"; 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.5";
flake = false; flake = false;
}; };
telescope-project-nvim-src = { telescope-project-nvim-src = {
@ -98,131 +92,38 @@
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.9.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.5.0";
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.2.0";
flake = false;
};
kitty-scrollback-nvim-src = {
url = "github:mikesmithgh/kitty-scrollback.nvim";
flake = false;
};
nvim-lint-src = {
url = "github:mfussenegger/nvim-lint";
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;
};
# GE version of Proton for game compatibility
# Alternatively, could consider using https://github.com/fufexan/nix-gaming
proton-ge = {
# https://github.com/GloriousEggroll/proton-ge-custom/releases
url =
"https://github.com/GloriousEggroll/proton-ge-custom/releases/download/GE-Proton9-2/GE-Proton9-2.tar.gz";
flake = false;
};
# Firefox addon from outside the extension store
bypass-paywalls-clean = {
# https://gitlab.com/magnolia1234/bpc-uploads/-/commits/master/?ref_type=HEADS
url = "gitlab:magnolia1234/bpc-uploads";
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
url =
"https://snappymail.eu/repository/nextcloud/snappymail-2.32.0-nextcloud.tar.gz";
flake = false; flake = false;
}; };
}; };
outputs = { nixpkgs, ... }@inputs: outputs = { self, nixpkgs, ... }@inputs:
let let
# Common overlays to always use
overlays = [
inputs.nur.overlay
inputs.nix2vim.overlay
(import ./overlays/neovim-plugins.nix inputs)
(import ./overlays/calibre-web.nix)
(import ./overlays/disko.nix inputs)
(import ./overlays/tree-sitter.nix inputs)
];
# Global configuration for my systems # Global configuration for my systems
globals = let baseName = "masu.rs"; globals = let baseName = "masu.rs";
in rec { in rec {
@ -233,41 +134,20 @@
mail.server = "noahmasur.com"; mail.server = "noahmasur.com";
mail.imapHost = "imap.purelymail.com"; mail.imapHost = "imap.purelymail.com";
mail.smtpHost = "smtp.purelymail.com"; mail.smtpHost = "smtp.purelymail.com";
dotfilesRepo = "https://github.com/nmasur/dotfiles"; dotfilesRepo = "git@github.com:nmasur/dotfiles";
nixpkgs.overlays = overlays;
hostnames = { hostnames = {
git = "git.${baseName}"; git = "git.${baseName}";
influxdb = "influxdb.${baseName}";
irc = "irc.${baseName}";
metrics = "metrics.${baseName}"; metrics = "metrics.${baseName}";
prometheus = "prom.${baseName}"; prometheus = "prom.${baseName}";
paperless = "paper.${baseName}";
secrets = "vault.${baseName}"; secrets = "vault.${baseName}";
stream = "stream.${baseName}"; stream = "stream.${baseName}";
content = "cloud.${baseName}"; content = "cloud.${baseName}";
books = "books.${baseName}"; books = "books.${baseName}";
download = "download.${baseName}"; download = "download.${baseName}";
transmission = "transmission.${baseName}";
}; };
}; };
# Common overlays to always use
overlays = [
inputs.nur.overlay
inputs.nix2vim.overlay
(import ./overlays/neovim-plugins.nix inputs)
(import ./overlays/calibre-web.nix)
(import ./overlays/disko.nix inputs)
(import ./overlays/tree-sitter.nix inputs)
(import ./overlays/caddy.nix inputs)
(import ./overlays/mpv-scripts.nix inputs)
(import ./overlays/nextcloud-apps.nix inputs)
(import ./overlays/betterlockscreen.nix)
(import ./overlays/proton-ge.nix inputs)
(import ./overlays/gh-collaborators.nix)
(import ./overlays/bypass-paywalls-clean.nix inputs)
(import ./overlays/ren-rep.nix inputs)
];
# System types to support. # System types to support.
supportedSystems = supportedSystems =
[ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
@ -277,21 +157,26 @@
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 = lookingglass = import ./hosts/lookingglass { inherit self; };
import ./hosts/lookingglass { inherit inputs globals overlays; };
}; };
# For quickly applying home-manager settings with: # For quickly applying home-manager settings with:
@ -307,12 +192,8 @@
diskoConfigurations = { root = import ./disks/root.nix; }; diskoConfigurations = { root = import ./disks/root.nix; };
packages = let packages = let
arrow = system: aws = system: import ./hosts/aws { inherit self system; };
import ./hosts/arrow { inherit inputs globals overlays system; }; staff = system: import ./hosts/staff { inherit self system; };
aws = system:
import ./hosts/aws { inherit inputs globals overlays system; };
staff = system:
import ./hosts/staff { inherit inputs globals overlays system; };
neovim = system: neovim = system:
let pkgs = import nixpkgs { inherit system overlays; }; let pkgs = import nixpkgs { inherit system overlays; };
in import ./modules/common/neovim/package { in import ./modules/common/neovim/package {
@ -320,18 +201,8 @@
colors = (import ./colorscheme/gruvbox-dark).dark; colors = (import ./colorscheme/gruvbox-dark).dark;
}; };
in { in {
x86_64-linux.arrow = arrow "x86_64-linux";
x86_64-linux.aws = aws "x86_64-linux"; x86_64-linux.aws = aws "x86_64-linux";
x86_64-linux.staff = staff "x86_64-linux"; x86_64-linux.staff = staff "x86_64-linux";
x86_64-linux.image = {
arrow = inputs.nixos-generators.nixosGenerate {
system = "x86_64-linux";
format = "iso";
modules = import ./hosts/arrow/modules.nix {
inherit inputs globals overlays;
};
};
};
# Package Neovim config into standalone package # Package Neovim config into standalone package
x86_64-linux.neovim = neovim "x86_64-linux"; x86_64-linux.neovim = neovim "x86_64-linux";
@ -357,24 +228,6 @@
}); });
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
'';
});
# Templates for starting other projects quickly # Templates for starting other projects quickly
templates = rec { templates = rec {
default = basic; default = basic;
@ -394,10 +247,6 @@
path = ./templates/haskell; path = ./templates/haskell;
description = "Haskell template"; description = "Haskell template";
}; };
rust = {
path = ./templates/rust;
description = "Rust template";
};
}; };
}; };

View File

@ -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.

View File

@ -1,8 +0,0 @@
{ inputs, globals, overlays, ... }:
inputs.nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = { };
modules = import ./modules.nix { inherit inputs globals overlays; };
}

View File

@ -1,92 +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"
}
}
}
# locals {
# image_file = one(fileset(path.root, "result/iso/nixos.iso"))
# }
# variable "cloudflare_r2_endpoint" {
# type = string
# description = "Domain for the Cloudflare R2 endpoint"
# }
variable "vultr_api_key" {
type = string
description = "API key for Vultr management"
sensitive = true
}
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
}
# data "aws_s3_bucket" "images" {
# bucket = "noahmasur-arrow-images"
# }
#
# resource "aws_s3_object" "image" {
# bucket = data.aws_s3_bucket.images.id
# key = "arrow.iso"
# source = local.image_file
# etag = filemd5(local.image_file)
# acl = "public-read"
# }
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 = "vc2-1c-2gb"
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
}

View File

@ -1,34 +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.transmission.enable = true;
virtualisation.vmVariant = {
virtualisation.forwardPorts = [{
from = "host";
host.port = 2222;
guest.port = 22;
}];
};
}
../../modules/common
../../modules/nixos
]

View File

@ -1,26 +1,23 @@
{ inputs, system, globals, overlays, ... }: { self, system, ... }:
inputs.nixos-generators.nixosGenerate { self.inputs.nixos-generators.nixosGenerate {
inherit system; inherit system;
format = "amazon"; format = "amazon";
modules = [ modules = [
globals self.inputs.home-manager.nixosModules.home-manager
inputs.home-manager.nixosModules.home-manager self.nixosModules.globals
self.nixosModules.common
self.nixosModules.nixos
{ {
nixpkgs.overlays = overlays;
networking.hostName = "sheep"; networking.hostName = "sheep";
gui.enable = false; gui.enable = false;
theme.colors = (import ../../colorscheme/gruvbox).dark; theme.colors = (import ../../colorscheme/gruvbox).dark;
passwordHash = null; passwordHash = null;
publicKeys = [ publicKey =
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal" "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
];
# AWS settings require this # AWS settings require this
permitRootLogin = "prohibit-password"; permitRootLogin = "prohibit-password";
} }
../../modules/common
../../modules/nixos
../../modules/nixos/services/sshd.nix
] ++ [ ] ++ [
# Required to fix diskSize errors during build # Required to fix diskSize errors during build
({ ... }: { amazonImage.sizeMB = 16 * 1024; }) ({ ... }: { amazonImage.sizeMB = 16 * 1024; })

View File

@ -1,73 +1,58 @@
# 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.
{ inputs, globals, overlays, ... }: { self, ... }:
inputs.nixpkgs.lib.nixosSystem { self.inputs.nixpkgs.lib.nixosSystem {
system = "aarch64-linux"; system = "aarch64-linux";
specialArgs = { }; specialArgs = { };
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 = [ "xhci_pci" "virtio_pci" "usbhid" ]; boot.initrd.availableKernelModules = [ "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;
# Still require colors for programs like Neovim, K9S
theme = { colors = (import ../../colorscheme/gruvbox).dark; }; theme = { colors = (import ../../colorscheme/gruvbox).dark; };
# Disable passwords, only use SSH key
publicKey =
"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";
@ -76,6 +61,8 @@ inputs.nixpkgs.lib.nixosSystem {
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK/6oyVqjFGX3Uvrc3VS8J9sphxzAnRzKC85xgkHfYgR3TK6qBGXzHrknEj21xeZrr3G2y1UsGzphWJd9ZfIcdA= open-ssh-ca@cloudflareaccess.org"; "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";
@ -83,11 +70,6 @@ inputs.nixpkgs.lib.nixosSystem {
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 = {
@ -117,6 +99,9 @@ inputs.nixpkgs.lib.nixosSystem {
# # 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" ];
} }
]; ];
} }

View File

@ -1,30 +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, ... }:
{ inputs, globals, overlays, ... }: self.inputs.nixpkgs.lib.nixosSystem {
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";

View File

@ -1,31 +1,29 @@
# The Looking Glass # The Looking Glass
# System configuration for my work Macbook # System configuration for my work Macbook
{ inputs, globals, overlays, ... }: { self, ... }:
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
(globals // rec { self.nixosModules.darwin
user = "Noah.Masur"; ({ config, lib, ... }: {
gitName = "Noah-Masur_1701"; config = rec {
gitEmail = "${user}@take2games.com"; user = lib.mkForce "Noah.Masur";
}) gitName = lib.mkForce "Noah-Masur_1701";
inputs.home-manager.darwinModules.home-manager gitEmail = lib.mkForce "${user}@take2games.com";
{ nixpkgs.overlays = [ self.inputs.firefox-darwin.overlay ];
nixpkgs.overlays = [ inputs.firefox-darwin.overlay ] ++ overlays;
networking.hostName = "lookingglass"; networking.hostName = "lookingglass";
identityFile = "/Users/Noah.Masur/.ssh/id_ed25519"; identityFile = "/Users/${user}/.ssh/id_ed25519";
gui.enable = true; gui.enable = true;
theme = { theme = {
colors = (import ../../colorscheme/gruvbox-dark).dark; colors = (import ../../colorscheme/gruvbox-dark).dark;
dark = true; dark = true;
}; };
mail.user = globals.user; mail.user = globals.user;
atuin.enable = true;
charm.enable = true; charm.enable = true;
neovim.enable = true; neovim.enable = true;
mail.enable = true; mail.enable = true;
@ -38,12 +36,11 @@ inputs.darwin.lib.darwinSystem {
nixlang.enable = true; nixlang.enable = true;
terraform.enable = true; terraform.enable = true;
python.enable = true; python.enable = true;
rust.enable = true;
lua.enable = true; lua.enable = true;
obsidian.enable = true;
kubernetes.enable = true; kubernetes.enable = true;
_1password.enable = true; _1password.enable = true;
slack.enable = true; slack.enable = true;
} };
})
]; ];
} }

View File

@ -1,13 +1,16 @@
# The Staff # The Staff
# ISO configuration for my USB drive # ISO configuration for my USB drive
{ inputs, system, overlays, ... }: { self, system, ... }:
inputs.nixos-generators.nixosGenerate { self.inputs.nixos-generators.nixosGenerate {
inherit system; inherit system;
format = "install-iso"; format = "install-iso";
modules = [{ modules = [
nixpkgs.overlays = overlays; self.nixosModules.global
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"
@ -23,9 +26,7 @@ inputs.nixos-generators.nixosGenerate {
PermitRootLogin = "yes"; PermitRootLogin = "yes";
}; };
}; };
environment.systemPackages = environment.systemPackages = with pkgs; [
let pkgs = import inputs.nixpkgs { inherit system overlays; };
in with pkgs; [
git git
vim vim
wget wget
@ -39,5 +40,6 @@ inputs.nixos-generators.nixosGenerate {
experimental-features = nix-command flakes experimental-features = nix-command flakes
warn-dirty = false warn-dirty = false
''; '';
}]; })
];
} }

View File

@ -1,28 +1,22 @@
# The Swan # The Swan
# System configuration for my home NAS server # System configuration for my home NAS server
# See [readme](../README.md) to explain how this file works. { self, ... }:
{ inputs, globals, overlays, ... }: self.inputs.nixpkgs.lib.nixosSystem {
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" ];
@ -35,64 +29,35 @@ 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" ];
# If password is requested and fails, continue to boot eventually
passwordTimeout = 300;
};
# Theming
# Server doesn't require GUI
gui.enable = false; gui.enable = false;
# Still require colors for programs like Neovim, K9S
theme = { colors = (import ../../colorscheme/gruvbox).dark; }; theme = { colors = (import ../../colorscheme/gruvbox).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";
@ -101,7 +66,6 @@ inputs.nixpkgs.lib.nixosSystem {
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCHF/UMtJqPFrf6f6GRY0ZFnkCW7b6sYgUTjTtNfRj1RdmNic1NoJZql7y6BrqQinZvy7nsr1UFDNWoHn6ah3tg= open-ssh-ca@cloudflareaccess.org"; "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";
@ -109,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";
];
} }
]; ];
} }

View File

@ -1,43 +1,28 @@
# The Tempest # The Tempest
# System configuration for my desktop # System configuration for my desktop
# See [readme](../README.md) to explain how this file works. { self, ... }:
{ inputs, globals, overlays, ... }: self.inputs.nixpkgs.lib.nixosSystem {
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
@ -54,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;
@ -102,8 +79,6 @@ inputs.nixpkgs.lib.nixosSystem {
keybase.enable = true; keybase.enable = true;
mullvad.enable = false; mullvad.enable = false;
nixlang.enable = true; nixlang.enable = true;
rust.enable = true;
terraform.enable = true;
yt-dlp.enable = true; yt-dlp.enable = true;
gaming = { gaming = {
dwarf-fortress.enable = true; dwarf-fortress.enable = true;
@ -114,11 +89,7 @@ inputs.nixpkgs.lib.nixosSystem {
leagueoflegends.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";
@ -127,11 +98,6 @@ inputs.nixpkgs.lib.nixosSystem {
"ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPY6C0HmdFCaxYtJxFr3qV4/1X4Q8KrYQ1hlme3u1hJXK+xW+lc9Y9glWHrhiTKilB7carYTB80US0O47gI5yU4= open-ssh-ca@cloudflareaccess.org"; "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;
} }
]; ];
} }

View File

@ -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>
```

View File

@ -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

View File

@ -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 |

View File

@ -9,22 +9,12 @@
}; };
}; };
config = lib.mkIf (config.gui.enable && config._1password.enable) { config = lib.mkIf
unfreePackages = [ "1password" "_1password-gui" "1password-cli" ]; (config.gui.enable && config._1password.enable && pkgs.stdenv.isLinux) {
unfreePackages = [ "1password" "_1password-gui" ];
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
home.packages = with pkgs; [ _1password-gui _1password ]; home.packages = with pkgs; [ _1password-gui ];
}; };
# 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
'';
}; };
} }

View File

@ -11,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",

View File

@ -16,7 +16,6 @@
unfreePackages = [ unfreePackages = [
(lib.mkIf config._1password.enable "onepassword-password-manager") (lib.mkIf config._1password.enable "onepassword-password-manager")
"okta-browser-plugin" "okta-browser-plugin"
"wappalyzer"
]; ];
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
@ -29,22 +28,22 @@
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
pkgs.bypass-paywalls-clean vimium
darkreader
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;
@ -74,9 +73,6 @@
"media.ffmpeg.vaapi.enabled" = "media.ffmpeg.vaapi.enabled" =
true; # Enable hardware video acceleration 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 {
@ -117,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;
@ -164,11 +160,6 @@
}; };
xdg.mimeApps = {
associations.added = { "text.html" = [ "firefox.desktop" ]; };
defaultApplications = { "text.html" = [ "firefox.desktop" ]; };
};
xsession.windowManager.i3.config.keybindings = xsession.windowManager.i3.config.keybindings =
lib.mkIf pkgs.stdenv.isLinux { lib.mkIf pkgs.stdenv.isLinux {
"${ "${

View File

@ -28,37 +28,17 @@
programs.rofi.terminal = programs.rofi.terminal =
lib.mkIf pkgs.stdenv.isLinux "${pkgs.kitty}/bin/kitty"; 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;
environment = { }; environment = { };
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;
@ -103,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;
@ -112,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;
}; };
}; };

View File

@ -22,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 = [
@ -31,16 +31,29 @@
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 = {
@ -49,7 +62,6 @@
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" ];
}; };
}; };

View File

@ -15,9 +15,8 @@
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" ];
}; };

View File

@ -59,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;
@ -75,18 +75,10 @@
type = lib.types.str; type = lib.types.str;
description = "Hostname for metrics server."; description = "Hostname for metrics 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).";
@ -107,20 +99,44 @@
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.";
};
transmission = lib.mkOption {
type = lib.types.str;
description = "Hostname for peer2peer downloads (Transmission).";
};
}; };
}; };
config = let stateVersion = "23.05"; config = let stateVersion = "23.05";
in { in {
nix = {
# Enable features in Nix commands
extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
'';
gc = {
automatic = true;
options = "--delete-older-than 7d";
};
settings = {
# 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;
};
};
# Basic common system packages for all devices # Basic common system packages for all devices
environment.systemPackages = with pkgs; [ git vim wget curl ]; environment.systemPackages = with pkgs; [ git vim wget curl ];

View File

@ -68,7 +68,7 @@
"!" = ":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>";

View File

@ -1,6 +1,6 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
imports = [ ./himalaya.nix ./aerc.nix ./system.nix ]; imports = [ ./himalaya.nix ./aerc.nix ];
options = { options = {
mail.enable = lib.mkEnableOption "Mail service."; mail.enable = lib.mkEnableOption "Mail service.";
@ -27,32 +27,15 @@
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
programs.mbsync = { enable = true; }; programs.mbsync = { 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 = let address = "${config.mail.user}@${config.mail.server}"; home = let address = "${config.mail.user}@${config.mail.server}";
in { in {
@ -65,17 +48,13 @@
"hey" "hey"
"admin" "admin"
]; ];
# Options for contact completion
alot = { }; alot = { };
flavor = "plain";
imap = { imap = {
host = config.mail.imapHost; host = config.mail.imapHost;
port = 993; port = 993;
tls.enable = true; tls.enable = true;
}; };
# Watch for mail and run notifications or sync
imapnotify = { imapnotify = {
enable = true; enable = true;
boxes = [ "Inbox" ]; boxes = [ "Inbox" ];
@ -84,11 +63,7 @@
config.home-manager.users.${config.user}.services.dunst.enable config.home-manager.users.${config.user}.services.dunst.enable
"${pkgs.libnotify}/bin/notify-send 'New mail arrived'"; "${pkgs.libnotify}/bin/notify-send 'New mail arrived'";
}; };
# Name of the directory in maildir for this account
maildir = { path = "main"; }; maildir = { path = "main"; };
# Bi-directional syncing options for local files
mbsync = { mbsync = {
enable = true; enable = true;
create = "both"; create = "both";
@ -99,17 +74,12 @@
CopyArrivalDate = "yes"; # Sync time of original message CopyArrivalDate = "yes"; # Sync time of original message
}; };
}; };
# Enable indexing
notmuch.enable = true; notmuch.enable = true;
# Used to login and send and receive emails
passwordCommand = passwordCommand =
"${pkgs.age}/bin/age --decrypt --identity ~/.ssh/id_ed25519 ${ "${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${
pkgs.writeText "mailpass.age" pkgs.writeText "mailpass.age"
(builtins.readFile ../../../private/mailpass.age) (builtins.readFile ../../../private/mailpass.age)
}"; }";
smtp = { smtp = {
host = config.mail.smtpHost; host = config.mail.smtpHost;
port = 465; port = 465;

View File

@ -9,6 +9,8 @@
programs.himalaya = { enable = true; }; programs.himalaya = { 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;

View File

@ -1,34 +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;
};
};
};
};
}

View File

@ -1,7 +1,4 @@
{ pkgs, ... }: { { pkgs, ... }: {
# Plugin for aligning text programmatically
plugins = [ pkgs.vimPlugins.tabular ]; plugins = [ pkgs.vimPlugins.tabular ];
lua = '' lua = ''
-- Align -- Align

View File

@ -1,7 +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

View File

@ -1,14 +1,12 @@
{ 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;
description = "Attrset of base16 colorscheme key value pairs."; description = "Attrset of base16 colorscheme key value pairs.";
}; };
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

View File

@ -9,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 {
@ -23,7 +24,12 @@
end end
''; '';
# Basic completion keybinds snippet.expand = dsl.rawLua ''
function(args)
require("luasnip").lsp_expand(args.body)
end
'';
mapping = { mapping = {
"['<C-n>']" = dsl.rawLua "['<C-n>']" = dsl.rawLua
"require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })"; "require('cmp').mapping.select_next_item({ behavior = require('cmp').SelectBehavior.Insert })";
@ -58,25 +64,24 @@
''; '';
}; };
# 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 = { additional_arguments = "--ignore-case"; }; option = { additional_arguments = "--ignore-case"; };
} }
]; ];
# Styling of the completion menu
formatting = { formatting = {
fields = [ "kind" "abbr" "menu" ]; fields = [ "kind" "abbr" "menu" ];
format = dsl.rawLua '' format = dsl.rawLua ''
@ -110,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]",
@ -129,6 +135,13 @@
}; };
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 = {

View File

@ -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)

View File

@ -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)

View File

@ -1,112 +1,76 @@
{ pkgs, lib, config, dsl, ... }: { { pkgs, dsl, ... }: {
# Terraform optional because non-free
options.terraform = lib.mkEnableOption "Whether to enable Terraform LSP";
options.github = lib.mkEnableOption "Whether to enable GitHub features";
options.kubernetes =
lib.mkEnableOption "Whether to enable Kubernetes features";
config = {
plugins = [ plugins = [
pkgs.vimPlugins.nvim-lspconfig pkgs.vimPlugins.nvim-lspconfig
pkgs.vimPlugins.conform-nvim pkgs.vimPlugins.lsp-colors-nvim
pkgs.vimPlugins.fidget-nvim pkgs.vimPlugins.null-ls-nvim
pkgs.vimPlugins.nvim-lint
]; ];
setup.fidget = { };
use.lspconfig.lua_ls.setup = dsl.callWith { use.lspconfig.lua_ls.setup = dsl.callWith {
settings = { Lua = { diagnostics = { globals = [ "vim" "hs" ]; }; }; }; settings = { Lua = { diagnostics = { globals = [ "vim" "hs" ]; }; }; };
capabilities = capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
cmd = [ "${pkgs.lua-language-server}/bin/lua-language-server" ]; cmd = [ "${pkgs.lua-language-server}/bin/lua-language-server" ];
}; };
use.lspconfig.nil_ls.setup = dsl.callWith { use.lspconfig.nil_ls.setup = dsl.callWith {
cmd = [ "${pkgs.nil}/bin/nil" ]; cmd = [ "${pkgs.nil}/bin/nil" ];
capabilities = capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
}; };
use.lspconfig.pyright.setup = dsl.callWith { use.lspconfig.pyright.setup = dsl.callWith {
cmd = [ "${pkgs.pyright}/bin/pyright-langserver" "--stdio" ]; cmd = [ "${pkgs.pyright}/bin/pyright-langserver" "--stdio" ];
}; };
use.lspconfig.terraformls.setup = dsl.callWith { use.lspconfig.terraformls.setup =
cmd = if config.terraform then [ dsl.callWith { cmd = [ "${pkgs.terraform-ls}/bin/terraform-ls" "serve" ]; };
"${pkgs.terraform-ls}/bin/terraform-ls"
"serve"
] else
[ "echo" ];
};
use.lspconfig.rust_analyzer.setup = dsl.callWith { vim.api.nvim_create_augroup = dsl.callWith [ "LspFormatting" { } ];
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}/bin/nixfmt";
rustfmt = {
command = "${pkgs.rustfmt}/bin/rustfmt";
prepend_args = [ "--edition" "2021" ];
};
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 = '' lua = ''
${builtins.readFile ./lsp.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) -- Prevent infinite log size (change this when debugging)
vim.lsp.set_log_level("off") 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,
})
''; '';
};
} }

View File

@ -7,16 +7,11 @@
pkgs.vimPlugins.comment-nvim # Smart comment commands 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.Comment = { };
setup.colorizer = { user_default_options = { names = false; }; }; setup.colorizer = { };
setup.glow = { }; setup.glow = { };
setup.which-key = { };
setup.kitty-scrollback = { };
vim.o = { vim.o = {
termguicolors = true; # Set to truecolor termguicolors = true; # Set to truecolor
@ -46,17 +41,11 @@
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 = vim.o.backupdir = dsl.rawLua ''vim.fn.stdpath("cache") .. "/backup"'';
dsl.rawLua ''vim.fn.expand("~/.local/state/nvim/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 = [ "menu" "menuone" "noselect" ]; vim.opt.completeopt = [ "menu" "menuone" "noselect" ];
@ -71,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 }
''; '';

View File

@ -4,7 +4,6 @@
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins: (pkgs.vimPlugins.nvim-treesitter.withPlugins (_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
@ -17,16 +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;

View File

@ -1,7 +1,5 @@
{ 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
pkgs.vimPlugins.project-nvim pkgs.vimPlugins.project-nvim

View File

@ -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)

View File

@ -1,6 +1,4 @@
{ pkgs, dsl, config, ... }: { { pkgs, dsl, ... }: {
# Toggleterm provides a floating terminal inside the editor for quick access
plugins = [ pkgs.vimPlugins.toggleterm-nvim ]; plugins = [ pkgs.vimPlugins.toggleterm-nvim ];
@ -10,10 +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 ""}
'';
} }

View File

@ -1,7 +1,5 @@
{ 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
@ -12,16 +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 = { # Change project based on the focused buffer update_focused_file = {
enable = true; enable = true;
update_root = true; update_root = true;
ignore_list = { }; ignore_list = { };
}; };
diagnostics = { # Enable LSP and linter integration diagnostics = {
enable = true; enable = true;
icons = { icons = {
hint = ""; hint = "";
@ -30,7 +28,7 @@
error = ""; error = "";
}; };
}; };
renderer = { # Show files with changes vs. current commit renderer = {
icons = { icons = {
glyphs = { glyphs = {
git = { git = {
@ -45,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')
@ -61,15 +58,15 @@
vim.keymap.set('n', 'v', api.node.open.vertical, opts('Open: Vertical Split')) vim.keymap.set('n', 'v', api.node.open.vertical, opts('Open: Vertical Split'))
end end
''; '';
view = { # Set look and feel view = {
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 })
''; '';

View File

@ -5,9 +5,6 @@ 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 {
@ -21,17 +18,11 @@ 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 = { vim = "nvim"; }; shellAliases = { vim = "nvim"; };
shellAbbrs = { shellAbbrs = {
@ -40,20 +31,12 @@ in {
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" ];
@ -62,6 +45,9 @@ in {
}; };
# # Used for icons in Vim
# fonts.fonts = with pkgs; [ nerdfonts ];
}; };
} }

View File

@ -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

View File

@ -26,13 +26,13 @@
# ] ++ extraConfig; # ] ++ extraConfig;
# } # }
{ pkgs, colors, terraform ? false, github ? false, kubernetes ? false, ... }: { pkgs, colors, ... }:
# 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 colors terraform github kubernetes; inherit colors;
imports = [ imports = [
../config/align.nix ../config/align.nix
../config/bufferline.nix ../config/bufferline.nix

View File

@ -6,7 +6,6 @@
./lua.nix ./lua.nix
./nix.nix ./nix.nix
./python.nix ./python.nix
./rust.nix
./terraform.nix ./terraform.nix
]; ];

View File

@ -24,29 +24,18 @@
# Terminal Kubernetes UI # Terminal Kubernetes UI
programs.k9s = { programs.k9s = {
enable = true; enable = true;
settings = { # settings = { k9s = { headless = true; }; };
k9s = { skin = {
ui = {
enableMouse = true;
headless = true;
logoless = true;
crumbsless = false;
skin = "main";
};
};
};
skins = {
main = {
k9s = { k9s = {
body = { body = {
fgColor = config.theme.colors.base06; fgColor = config.theme.colors.base06;
bgColor = "default"; bgColor = config.theme.colors.base00;
logoColor = config.theme.colors.base02; # *blue ? logoColor = config.theme.colors.base02; # *blue ?
}; };
# Search bar # Search bar
prompt = { prompt = {
fgColor = config.theme.colors.base06; fgColor = config.theme.colors.base06;
bgColor = "default"; bgColor = config.theme.colors.base00;
suggestColor = config.theme.colors.base03; suggestColor = config.theme.colors.base03;
}; };
# Header left side # Header left side
@ -56,7 +45,7 @@
}; };
dialog = { dialog = {
fgColor = config.theme.colors.base06; fgColor = config.theme.colors.base06;
bgColor = "default"; bgColor = config.theme.colors.base00;
buttonFgColor = config.theme.colors.base06; buttonFgColor = config.theme.colors.base06;
buttonBgColor = config.theme.colors.base0E; buttonBgColor = config.theme.colors.base0E;
buttonFocusFgColor = config.theme.colors.base07; buttonFocusFgColor = config.theme.colors.base07;
@ -90,7 +79,7 @@
}; };
title = { title = {
fgColor = config.theme.colors.base06; fgColor = config.theme.colors.base06;
bgColor = "default"; bgColor = config.theme.colors.base00;
highlightColor = config.theme.colors.base09; # *orange highlightColor = config.theme.colors.base09; # *orange
counterColor = config.theme.colors.base0D; # *blue counterColor = config.theme.colors.base0D; # *blue
filterColor = config.theme.colors.base0E; # *magenta filterColor = config.theme.colors.base0E; # *magenta
@ -98,7 +87,7 @@
}; };
views = { views = {
charts = { charts = {
bgColor = "default"; bgColor = config.theme.colors.base00;
defaultDialColors = defaultDialColors =
[ config.theme.colors.base0D config.theme.colors.base08 ]; [ config.theme.colors.base0D config.theme.colors.base08 ];
# - *blue # - *blue
@ -111,7 +100,7 @@
table = { table = {
# List of resources # List of resources
fgColor = config.theme.colors.base06; fgColor = config.theme.colors.base06;
bgColor = "default"; bgColor = config.theme.colors.base00;
# Row selection # Row selection
cursorFgColor = config.theme.colors.base07; cursorFgColor = config.theme.colors.base07;
@ -120,13 +109,13 @@
# 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; fgColor = config.theme.colors.base06;
bgColor = "default"; bgColor = config.theme.colors.base00;
cursorColor = config.theme.colors.base06; cursorColor = config.theme.colors.base06;
graphicColor = config.theme.colors.base0D; graphicColor = config.theme.colors.base0D;
showIcons = false; showIcons = false;
@ -138,11 +127,10 @@
}; };
logs = { logs = {
fgColor = config.theme.colors.base06; fgColor = config.theme.colors.base06;
bgColor = "default"; bgColor = config.theme.colors.base00;
indicator = { indicator = {
fgColor = config.theme.colors.base06; fgColor = config.theme.colors.base06;
bgColor = "default"; bgColor = config.theme.colors.base00;
};
}; };
}; };
}; };

View File

@ -1,17 +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 ];
};
};
}

View File

@ -3,7 +3,6 @@
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 = {

View File

@ -1,7 +1,5 @@
{ 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.";
config = lib.mkIf config.dotfiles.enable { config = lib.mkIf config.dotfiles.enable {
@ -16,8 +14,13 @@
[ "writeBoundary" ] '' [ "writeBoundary" ] ''
if [ ! -d "${config.dotfilesPath}" ]; then if [ ! -d "${config.dotfilesPath}" ]; then
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}") $DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
$DRY_RUN_CMD ${pkgs.git}/bin/git \
clone ${config.dotfilesRepo} "${config.dotfilesPath}" # 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 fi
''; '';

View File

@ -1,8 +1,5 @@
{ config, ... }: { { config, ... }: {
# 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} = {
home.sessionVariables = { home.sessionVariables = {

View File

@ -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;
};
}

View File

@ -1,26 +0,0 @@
#!/bin/sh
# Stop all containers
if [ "$(docker ps -a -q)" ]; then
echo "Stopping docker containers..."
docker stop "$(docker ps -a -q)"
else
echo "No running docker containers."
fi
# Remove all stopped containers
if [ "$(docker ps -a -q)" ]; then
echo "Removing docker containers..."
docker rm "$(docker ps -a -q)"
else
echo "No stopped docker containers."
fi
# Remove all untagged images
if docker images | grep -q "^<none>"; then
docker rmi "$(docker images | grep "^<none>" | awk '{print $3}')"
else
echo "No untagged docker images."
fi
echo "Cleaned up docker."

View File

@ -1,7 +1,5 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
# Convenience utilities from charm.sh
options.charm.enable = lib.mkEnableOption "Charm utilities."; options.charm.enable = lib.mkEnableOption "Charm utilities.";
config.home-manager.users.${config.user} = lib.mkIf config.charm.enable { config.home-manager.users.${config.user} = lib.mkIf config.charm.enable {
@ -10,7 +8,6 @@
glow # Markdown previews glow # Markdown previews
skate # Key-value store skate # Key-value store
charm # Manage account and filesystem charm # Manage account and filesystem
pop # Send emails from a TUI
]; ];
}; };

View File

@ -1,6 +1,5 @@
{ ... }: { { ... }: {
imports = [ imports = [
./atuin.nix
./bash ./bash
./charm.nix ./charm.nix
./direnv.nix ./direnv.nix
@ -8,10 +7,8 @@
./fzf.nix ./fzf.nix
./git.nix ./git.nix
./github.nix ./github.nix
./jujutsu.nix
./nixpkgs.nix ./nixpkgs.nix
./starship.nix ./starship.nix
./utilities.nix ./utilities.nix
./work.nix
]; ];
} }

View File

@ -1,28 +1,11 @@
{ config, ... }: { { config, ... }: {
# Enables quickly entering Nix shells when changing directories
home-manager.users.${config.user}.programs.direnv = { home-manager.users.${config.user}.programs.direnv = {
enable = true; enable = true;
nix-direnv.enable = true; nix-direnv.enable = true;
config = { whitelist = { prefix = [ config.dotfilesPath ]; }; }; config = { whitelist = { prefix = [ config.dotfilesPath ]; }; };
}; };
# programs.direnv.direnvrcExtra = ''
# layout_postgres() {
# export PGDATA="$(direnv_layout_dir)/postgres"
# export PGHOST="$PGDATA"
#
# if [[ ! -d "PGDATA" ]]; then
# initdb
# cat >> "$PGDATA/postgres.conf" <<- EOF
# listen_addresses = '''
# unix_socket_directories = '$PGHOST'
# EOF
# echo "CREATE DATABASE $USER;" | postgres --single -E postgres
# fi
# }
# '';
# Prevent garbage collection # Prevent garbage collection
nix.extraOptions = '' nix.extraOptions = ''
keep-outputs = true keep-outputs = true

View File

@ -1,24 +1,19 @@
{ config, pkgs, lib, ... }: { { config, pkgs, lib, ... }: {
users.users.${config.user}.shell = pkgs.fish; users.users.${config.user}.shell = pkgs.fish;
programs.fish.enable = true; # Needed for LightDM to remember username programs.fish.enable =
true; # Needed for LightDM to remember username (TODO: fix)
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
# Packages used in abbreviations and aliases # Packages used in abbreviations and aliases
home.packages = with pkgs; [ curl ]; home.packages = with pkgs; [ curl exa ];
programs.fish = { programs.fish = {
enable = true; enable = true;
shellAliases = { shellAliases = {
# Version of bash which works much better on the terminal
bash = "${pkgs.bashInteractive}/bin/bash"; bash = "${pkgs.bashInteractive}/bin/bash";
ls = "exa";
# Use eza (exa) instead of ls for fancier output
ls = "${pkgs.eza}/bin/eza --group";
# Move files to XDG trash on the commandline
trash = lib.mkIf pkgs.stdenv.isLinux "${pkgs.trash-cli}/bin/trash-put"; trash = lib.mkIf pkgs.stdenv.isLinux "${pkgs.trash-cli}/bin/trash-put";
}; };
functions = { functions = {
@ -123,6 +118,9 @@
dr = "docker run --rm -it"; dr = "docker run --rm -it";
db = "docker build . -t"; db = "docker build . -t";
# Rust
ca = "cargo";
}; };
shellInit = ""; shellInit = "";
}; };

View File

@ -18,5 +18,3 @@ bind -M insert \cn 'commandline -r "nix shell nixpkgs#"'
bind -M default \cn 'commandline -r "nix shell nixpkgs#"' bind -M default \cn 'commandline -r "nix shell nixpkgs#"'
bind -M insert \x11F nix-fzf bind -M insert \x11F nix-fzf
bind -M default \x11F nix-fzf bind -M default \x11F nix-fzf
bind -M insert \ch '_atuin_search --filter-mode global'
bind -M default \ch '_atuin_search --filter-mode global'

View File

@ -1,6 +1,4 @@
{ config, pkgs, ... }: { { config, ... }: {
# FZF is a fuzzy-finder for the terminal
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
@ -16,9 +14,10 @@
--search-path $HOME/dev \ --search-path $HOME/dev \
--type directory \ --type directory \
--exact-depth 2 \ --exact-depth 2 \
| ${pkgs.proximity-sort}/bin/proximity-sort $PWD \
| sed 's/\\/$//' \ | sed 's/\\/$//' \
| fzf --tiebreak=index \ | fzf \
--delimiter '/' \
--with-nth 6.. \
) )
and cd $projdir and cd $projdir
and commandline -f execute and commandline -f execute

View File

@ -28,32 +28,15 @@ in {
userName = config.gitName; userName = config.gitName;
userEmail = config.gitEmail; userEmail = config.gitEmail;
extraConfig = { extraConfig = {
core.pager =
"${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight | less -F";
interactive.difffilter =
"${pkgs.git}/share/git/contrib/diff-highlight/diff-highlight";
pager = { branch = "false"; }; pager = { branch = "false"; };
safe = { directory = config.dotfilesPath; }; safe = { directory = config.dotfilesPath; };
pull = { ff = "only"; }; pull = { ff = "only"; };
push = { autoSetupRemote = "true"; }; push = { autoSetupRemote = "true"; };
init = { defaultBranch = "master"; }; init = { defaultBranch = "master"; };
rebase = { autosquash = "true"; };
}; };
ignores = [ ".direnv/**" "result" ]; ignores = [ ".direnv/**" "result" ];
includes = [{
path = "~/.config/git/personal";
condition = "gitdir:~/dev/personal/";
}];
}; };
# Personal git config
# TODO: fix with variables
xdg.configFile."git/personal".text = ''
[user]
name = "${config.fullName}"
email = "7386960+nmasur@users.noreply.github.com"
'';
programs.fish.shellAbbrs = { programs.fish.shellAbbrs = {
g = "git"; g = "git";
gs = "git status"; gs = "git status";
@ -75,7 +58,6 @@ in {
git switch (git symbolic-ref refs/remotes/origin/HEAD | cut -d"/" -f4)''; git switch (git symbolic-ref refs/remotes/origin/HEAD | cut -d"/" -f4)'';
gcob = "git switch -c"; gcob = "git switch -c";
gb = "git branch"; gb = "git branch";
gpd = "git push origin -d";
gbd = "git branch -d"; gbd = "git branch -d";
gbD = "git branch -D"; gbD = "git branch -D";
gr = "git reset"; gr = "git reset";

View File

@ -5,9 +5,8 @@
programs.gh = programs.gh =
lib.mkIf config.home-manager.users.${config.user}.programs.git.enable { lib.mkIf config.home-manager.users.${config.user}.programs.git.enable {
enable = true; enable = true;
gitCredentialHelper.enable = true; enableGitCredentialHelper = true;
settings.git_protocol = "https"; settings.git_protocol = "https";
extensions = [ pkgs.gh-collaborators ];
}; };
programs.fish = programs.fish =
@ -15,7 +14,7 @@
shellAbbrs = { shellAbbrs = {
ghr = "gh repo view -w"; ghr = "gh repo view -w";
gha = gha =
"gh run list | head -1 | awk '{ print \\$\\(NF-2\\) }' | xargs gh run view"; "gh run list | head -1 | awk '{ print $(NF-2) }' | xargs gh run view";
grw = "gh run watch"; grw = "gh run watch";
grf = "gh run view --log-failed"; grf = "gh run view --log-failed";
grl = "gh run view --log"; grl = "gh run view --log";
@ -48,7 +47,7 @@
esac esac
selected=$(gh repo list "$organization" \ selected=$(gh repo list "$organization" \
--limit 100 \ --limit 50 \
--no-archived \ --no-archived \
--json=name,description,isPrivate,updatedAt,primaryLanguage \ --json=name,description,isPrivate,updatedAt,primaryLanguage \
| jq -r '.[] | .name + "," + if .description == "" then "-" else .description |= gsub(","; " ") | .description end + "," + .updatedAt + "," + .primaryLanguage.name' \ | jq -r '.[] | .name + "," + if .description == "" then "-" else .description |= gsub(","; " ") | .description end + "," + .updatedAt + "," + .primaryLanguage.name' \
@ -57,7 +56,6 @@
| fzf \ | fzf \
--header-lines=1 \ --header-lines=1 \
--layout=reverse \ --layout=reverse \
--height=100% \
--bind "ctrl-o:execute:gh repo view -w ''${organization}/{1}" \ --bind "ctrl-o:execute:gh repo view -w ''${organization}/{1}" \
--bind "shift-up:preview-half-page-up" \ --bind "shift-up:preview-half-page-up" \
--bind "shift-down:preview-half-page-down" \ --bind "shift-down:preview-half-page-down" \

View File

@ -1,20 +0,0 @@
{ config, ... }: {
config = {
home-manager.users.${config.user}.programs.jujutsu = {
enable = true;
# https://github.com/martinvonz/jj/blob/main/docs/config.md
settings = {
user = {
name = config.home-manager.users.${config.user}.programs.git.userName;
email =
config.home-manager.users.${config.user}.programs.git.userEmail;
};
};
};
};
}

View File

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { { config, pkgs, ... }: {
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
programs.fish = { programs.fish = {
@ -60,24 +60,6 @@
enableFishIntegration = true; enableFishIntegration = true;
}; };
# Create nix-index if doesn't exist
home.activation.createNixIndex =
let cacheDir = "${config.homePath}/.cache/nix-index";
in lib.mkIf
config.home-manager.users.${config.user}.programs.nix-index.enable
(config.home-manager.users.${config.user}.lib.dag.entryAfter
[ "writeBoundary" ] ''
if [ ! -d ${cacheDir} ]; then
$DRY_RUN_CMD ${pkgs.nix-index}/bin/nix-index -f ${pkgs.path}
fi
'');
# Set automatic generation cleanup for home-manager
nix.gc = {
automatic = config.nix.gc.automatic;
options = config.nix.gc.options;
};
}; };
nix = { nix = {
@ -91,37 +73,6 @@
path = builtins.toString pkgs.path; path = builtins.toString pkgs.path;
}; };
# For security, only allow specific users
settings.allowed-users = [ "@wheel" config.user ];
# Enable features in Nix commands
extraOptions = ''
experimental-features = nix-command flakes
warn-dirty = false
'';
gc = {
automatic = true;
options = "--delete-older-than 10d";
};
settings = {
# 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;
};
}; };
} }

View File

@ -20,41 +20,30 @@ in {
home.packages = with pkgs; [ home.packages = with pkgs; [
age # Encryption age # Encryption
bc # Calculator bc # Calculator
delta # Fancy diffs
difftastic # Other fancy diffs
dig # DNS lookup dig # DNS lookup
fd # find fd # find
htop # Show system processes htop # Show system processes
killall # Force quit
inetutils # Includes telnet, whois inetutils # Includes telnet, whois
jless # JSON viewer
jo # JSON output
jq # JSON manipulation jq # JSON manipulation
lf # File viewer lf # File viewer
qrencode # Generate qr codes qrencode # Generate qr codes
rsync # Copy folders rsync # Copy folders
ren # Rename files
# rep # Replace text in files
ripgrep # grep ripgrep # grep
sd # sed sd # sed
tealdeer # Cheatsheets tealdeer # Cheatsheets
tree # View directory hierarchy tree # View directory hierarchy
vimv-rs # Batch rename files vimv-rs # Batch rename files
unzip # Extract zips unzip # Extract zips
dua # File sizes (du)
du-dust # Disk usage tree (ncdu)
duf # Basic disk information (df)
]; ];
programs.zoxide.enable = true; # Shortcut jump command programs.zoxide.enable = true; # Shortcut jump command
home.file = { home.file = {
".rgignore".text = ignorePatterns; ".rgignore".text = ignorePatterns;
".fdignore".text = ignorePatterns;
".digrc".text = "+noall +answer"; # Cleaner dig commands ".digrc".text = "+noall +answer"; # Cleaner dig commands
}; };
xdg.configFile."fd/ignore".text = ignorePatterns;
programs.bat = { programs.bat = {
enable = true; # cat replacement enable = true; # cat replacement
config = { config = {
@ -63,6 +52,10 @@ in {
}; };
}; };
programs.fish.shellAbbrs = {
cat = "bat"; # Swap cat with bat
};
programs.fish.functions = { programs.fish.functions = {
ping = { ping = {
description = "Improved ping"; description = "Improved ping";

View File

@ -1,42 +0,0 @@
{ config, pkgs, lib, ... }:
{
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
home.packages = let
ldap_scheme = "ldaps";
magic_number = "2";
magic_end_seq = "corp";
magic_prefix = "take";
ldap_host =
"${magic_prefix}${magic_number}.t${magic_number}.${magic_end_seq}";
ldap_port = 636;
ldap_dc_1 = "${magic_prefix}${magic_number}";
ldap_dc_2 = "t${magic_number}";
ldap_dc_3 = magic_end_seq;
ldap_script = pkgs.writeShellScriptBin "ldap" ''
SEARCH_FILTER="$@"
ldapsearch -LLL \
-B -o ldif-wrap=no \
-H "${ldap_scheme}://${ldap_host}:${builtins.toString ldap_port}" \
-D "${pkgs.lib.toUpper magic_prefix}${magic_number}\\${
pkgs.lib.toLower config.user
}" \
-w "$(${pkgs._1password}/bin/op item get T${magic_number} --fields label=password)" \
-b "DC=${ldap_dc_1},DC=${ldap_dc_2},DC=${ldap_dc_3}" \
-s "sub" -x "(cn=$SEARCH_FILTER)" \
| jq --slurp \
--raw-input 'split("\n\n")|map(split("\n")|map(select(.[0:1]!="#" and length>0)) |select(length > 0)|map(capture("^(?<key>[^:]*:?): *(?<value>.*)") |if .key[-1:.key|length] == ":" then .key=.key[0:-1]|.value=(.value|@base64d) else . end)| group_by(.key) | map({key:.[0].key,value:(if .|length > 1 then [.[].value] else .[].value end)}) | from_entries)' | jq -r 'del(.[].thumbnailPhoto)'
'';
ldapm_script = pkgs.writeShellScriptBin "ldapm" ''
${ldap_script}/bin/ldap "$@" | jq '[ .[].memberOf] | add'
'';
ldapg_script = pkgs.writeShellScriptBin "ldapg" ''
${ldap_script}/bin/ldap "$@" | jq '[ .[].member] | add'
'';
in [ ldap_script ldapm_script ldapg_script ];
};
}

View File

@ -16,27 +16,16 @@
firefox = "${pkgs.firefox-bin}/Applications/Firefox.app"; firefox = "${pkgs.firefox-bin}/Applications/Firefox.app";
discord = "${pkgs.discord}/Applications/Discord.app"; discord = "${pkgs.discord}/Applications/Discord.app";
kitty = "${pkgs.kitty}/Applications/kitty.app"; kitty = "${pkgs.kitty}/Applications/kitty.app";
obsidian = "${pkgs.obsidian}/Applications/Obsidian.app";
slack = "${pkgs.slack}/Applications/Slack.app"; slack = "${pkgs.slack}/Applications/Slack.app";
}; };
xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source = xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source =
./hammerspoon/Spoons/MoveWindow.spoon; ./hammerspoon/Spoons/MoveWindow.spoon;
home.activation.reloadHammerspoon =
config.home-manager.users.${config.user}.lib.dag.entryAfter
[ "writeBoundary" ] ''
$DRY_RUN_CMD /Applications/Hammerspoon.app/Contents/Frameworks/hs/hs -c "hs.reload()"
$DRY_RUN_CMD sleep 1
$DRY_RUN_CMD /Applications/Hammerspoon.app/Contents/Frameworks/hs/hs -c "hs.console.clearConsole()"
'';
}; };
homebrew.casks = [ "hammerspoon" ]; homebrew.casks = [ "hammerspoon" ];
system.activationScripts.postUserActivation.text = '' system.activationScripts.postUserActivation.text = ''
defaults write org.hammerspoon.Hammerspoon MJConfigFile "~/.config/hammerspoon/init.lua" defaults write org.hammerspoon.Hammerspoon MJConfigFile "~/.config/hammerspoon/init.lua"
sudo killall Dock
''; '';
}; };

View File

@ -8,10 +8,10 @@ obj.name = "Launcher"
obj.version = "0.1" obj.version = "0.1"
obj.license = "MIT - https://opensource.org/licenses/MIT" obj.license = "MIT - https://opensource.org/licenses/MIT"
local screen = hs.screen.primaryScreen() local width = hs.screen.mainScreen():fullFrame().w
local switcherWidth = 500 local switcherWidth = 500
obj.canvas = hs.canvas.new({ obj.canvas = hs.canvas.new({
x = (screen:fullFrame().x + screen:fullFrame().w) / 2 - switcherWidth / 2, x = width / 2 - switcherWidth / 2,
y = 1, y = 1,
h = 3, h = 3,
w = switcherWidth, w = switcherWidth,
@ -54,19 +54,14 @@ function obj:init()
end) end)
-- Launcher shortcuts -- Launcher shortcuts
self.launcher:bind("ctrl", "space", function() end) self.launcher:bind("ctrl", "space", function()
end)
self.launcher:bind("", "return", function() self.launcher:bind("", "return", function()
self:switch("@kitty@") self:switch("@kitty@")
end) end)
self.launcher:bind("", "C", function() self.launcher:bind("", "C", function()
self:switch("Calendar.app") self:switch("Calendar.app")
end) end)
self.launcher:bind("shift", "D", function()
hs.execute("launchctl remove com.paloaltonetworks.gp.pangps")
hs.execute("launchctl remove com.paloaltonetworks.gp.pangpa")
hs.alert.show("Disconnected from GlobalProtect", nil, nil, 4)
self.launcher:exit()
end)
self.launcher:bind("", "E", function() self.launcher:bind("", "E", function()
self:switch("Mail.app") self:switch("Mail.app")
end) end)
@ -80,17 +75,11 @@ function obj:init()
self:switch("Messages.app") self:switch("Messages.app")
end) end)
self.launcher:bind("", "O", function() self.launcher:bind("", "O", function()
self:switch("@obsidian@") self:switch("Obsidian.app")
end) end)
self.launcher:bind("", "P", function() self.launcher:bind("", "P", function()
self:switch("System Preferences.app") self:switch("System Preferences.app")
end) end)
self.launcher:bind("shift", "P", function()
hs.execute("launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangps.plist")
hs.execute("launchctl load /Library/LaunchAgents/com.paloaltonetworks.gp.pangpa.plist")
hs.alert.show("Reconnecting to GlobalProtect", nil, nil, 4)
self.launcher:exit()
end)
self.launcher:bind("", "R", function() self.launcher:bind("", "R", function()
hs.console.clearConsole() hs.console.clearConsole()
hs.reload() hs.reload()

View File

@ -9,7 +9,7 @@ obj.version = "0.1"
obj.license = "MIT - https://opensource.org/licenses/MIT" obj.license = "MIT - https://opensource.org/licenses/MIT"
function obj:init() function obj:init()
hs.window.animationDuration = 0.1 hs.window.animationDuration = 0
dofile(hs.spoons.resourcePath("worklayout.lua"))() dofile(hs.spoons.resourcePath("worklayout.lua"))()
-- bind hotkey -- bind hotkey
hs.hotkey.bind({ "alt", "ctrl", "cmd" }, "n", function() hs.hotkey.bind({ "alt", "ctrl", "cmd" }, "n", function()
@ -56,7 +56,7 @@ function obj:init()
local frame = win:frame() local frame = win:frame()
-- maximize if possible -- maximize if possible
local max = win:screen():fullFrame() local max = win:screen():fullFrame()
frame.x = (max.x * 2 + max.w) / 2 frame.x = max.w / 2
frame.y = max.y frame.y = max.y
frame.w = max.w / 2 frame.w = max.w / 2
frame.h = max.h frame.h = max.h

View File

@ -51,20 +51,10 @@ local function worklayout()
local laptop = { local laptop = {
{ "Firefox", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true }, { "Firefox", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true },
{ "Obsidian", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true }, { "Obsidian", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true },
{ "Calendar", nil, LAPTOP_MONITOR, u(0, 0, 1, 1), nil, nil, visible = true },
} }
local layout = concat(left, right, laptop) local layout = concat(left, right, laptop)
hs.layout.apply(layout) hs.layout.apply(layout)
end) end)
-- Reload Hammerspoon whenever layout changes
hs.screen.watcher.new(function()
-- Pause for 5 seconds to give time for layout to change
hs.timer.doAfter(5, function()
-- Perform the actual reload
hs.reload()
end)
end)
end end
return worklayout return worklayout

View File

@ -1,4 +1,3 @@
hs.ipc.cliInstall() -- Install Hammerspoon CLI program
hs.loadSpoon("ControlEscape"):start() -- Load Hammerspoon bits from https://github.com/jasonrudolph/ControlEscape.spoon hs.loadSpoon("ControlEscape"):start() -- Load Hammerspoon bits from https://github.com/jasonrudolph/ControlEscape.spoon
hs.loadSpoon("Launcher"):init() hs.loadSpoon("Launcher"):init()
hs.loadSpoon("DismissAlerts"):init() hs.loadSpoon("DismissAlerts"):init()

View File

@ -8,15 +8,11 @@
if ! xcode-select --version 2>/dev/null; then if ! xcode-select --version 2>/dev/null; then
$DRY_RUN_CMD xcode-select --install $DRY_RUN_CMD xcode-select --install
fi fi
if ! /opt/homebrew/bin/brew --version 2>/dev/null; then if ! /usr/local/bin/brew --version 2>/dev/null; then
$DRY_RUN_CMD /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" $DRY_RUN_CMD /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi fi
''; '';
# Add homebrew paths to CLI path
home-manager.users.${config.user}.home.sessionPath =
[ "/opt/homebrew/bin/" ];
homebrew = { homebrew = {
enable = true; enable = true;
onActivation = { onActivation = {
@ -28,19 +24,24 @@
brewfile = true; # Run brew bundle from anywhere brewfile = true; # Run brew bundle from anywhere
lockfiles = false; # Don't save lockfile (since running from anywhere) lockfiles = false; # Don't save lockfile (since running from anywhere)
}; };
taps = [
"homebrew/cask" # Required for casks
"homebrew/cask-drivers" # Used for Logitech G-Hub
];
brews = [ brews = [
"trash" # Delete files and folders to trash instead of rm "trash" # Delete files and folders to trash instead of rm
"openjdk" # Required by Apache Directory Studio
]; ];
casks = [ casks = [
"1password" # 1Password will not launch from Nix on macOS "1password" # 1Password packaging on Nix is broken for macOS
# "gitify" # Git notifications in menu bar (downgrade manually from 4.6.1) "apache-directory-studio" # Packaging on Nix is not available for macOS
"gitify" # Git notifications in menu bar
"keybase" # GUI on Nix not available for macOS "keybase" # GUI on Nix not available for macOS
# "logitech-g-hub" # Mouse and keyboard management "logitech-g-hub" # Mouse and keyboard management
"logitune" # Logitech webcam firmware
"meetingbar" # Show meetings in menu bar "meetingbar" # Show meetings in menu bar
"obsidian" # Obsidian packaging on Nix is not available for macOS
"scroll-reverser" # Different scroll style for mouse vs. trackpad "scroll-reverser" # Different scroll style for mouse vs. trackpad
# "steam" # Not packaged for Nix "steam" # Not packaged for Nix
# "epic-games" # Not packaged for Nix
]; ];
}; };

View File

@ -3,6 +3,7 @@
# MacOS-specific settings for Kitty # MacOS-specific settings for Kitty
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin { home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
programs.kitty = { programs.kitty = {
darwinLaunchOptions = [ "--start-as=fullscreen" ];
font.size = lib.mkForce 20; font.size = lib.mkForce 20;
settings = { settings = {
shell = "/run/current-system/sw/bin/fish"; shell = "/run/current-system/sw/bin/fish";

View File

@ -2,7 +2,7 @@
config = lib.mkIf pkgs.stdenv.isDarwin { config = lib.mkIf pkgs.stdenv.isDarwin {
networking = { networking = {
computerName = config.networking.hostName; computerName = "${config.fullName}'\\''s Mac";
# Adjust if necessary # Adjust if necessary
# hostName = ""; # hostName = "";
}; };

View File

@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }: { { pkgs, lib, ... }: {
config = lib.mkIf pkgs.stdenv.isDarwin { config = lib.mkIf pkgs.stdenv.isDarwin {
@ -34,8 +34,8 @@
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) # Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
AppleKeyboardUIMode = 3; AppleKeyboardUIMode = 3;
# Only hide menu bar in fullscreen # Automatically show and hide the menu bar
_HIHideMenuBar = false; _HIHideMenuBar = true;
# Expand save panel by default # Expand save panel by default
NSNavPanelExpandedStateForSaveMode = true; NSNavPanelExpandedStateForSaveMode = true;
@ -112,99 +112,77 @@
# Disable trackpad tap to click # Disable trackpad tap to click
trackpad.Clicking = false; trackpad.Clicking = false;
# universalaccess = {
# # Zoom in with Control + Scroll Wheel
# closeViewScrollWheelToggle = true;
# closeViewZoomFollowsFocus = true;
# };
# Where to save screenshots # Where to save screenshots
screencapture.location = "~/Downloads"; screencapture.location = "~/Downloads";
CustomUserPreferences = {
# Disable disk image verification
"com.apple.frameworks.diskimages" = {
skip-verify = true;
skip-verify-locked = true;
skip-verify-remote = true;
};
# Avoid creating .DS_Store files on network or USB volumes
"com.apple.desktopservices" = {
DSDontWriteNetworkStores = true;
DSDontWriteUSBStores = true;
};
"com.apple.dock" = {
magnification = true;
largesize = 48;
persistent-apps = let
dockText = app:
"<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>${app}</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>";
in map dockText [
"/Applications/1Password.app"
"${pkgs.slack}/Applications/Slack.app"
"/System/Applications/Calendar.app"
"${pkgs.firefox-bin}/Applications/Firefox.app"
"/System/Applications/Messages.app"
"/System/Applications/Mail.app"
"/Applications/zoom.us.app"
"${pkgs.discord}/Applications/Discord.app"
"${pkgs.obsidian}/Applications/Obsidian.app"
"${pkgs.kitty}/Applications/kitty.app"
"/System/Applications/System Settings.app"
];
};
# Require password immediately after screen saver begins
"com.apple.screensaver" = {
askForPassword = 1;
askForPasswordDelay = 0;
};
"com.apple.finder" = {
# Disable the warning before emptying the Trash
WarnOnEmptyTrash = false;
# Finder search in current folder by default
FXDefaultSearchScope = "SCcf";
# Default Finder window set to column view
FXPreferredViewStyle = "clmv";
};
"leits.MeetingBar" = {
eventTimeFormat = ''"show"'';
eventTitleFormat = ''"none"'';
eventTitleIconFormat = ''"iconCalendar"'';
slackBrowser =
''{"deletable":true,"arguments":"","name":"Slack","path":""}'';
zoomBrowser =
''{"deletable":true,"arguments":"","name":"Zoom","path":""}'';
KeyboardShortcuts_joinEventShortcut =
''{"carbonModifiers":6400,"carbonKeyCode":38}'';
timeFormat = ''"12-hour"'';
};
};
CustomSystemPreferences = {
};
}; };
# Settings that don't have an option in nix-darwin # Settings that don't have an option in nix-darwin
activationScripts.postActivation.text = '' activationScripts.postActivation.text = ''
echo "Disable disk image verification"
defaults write com.apple.frameworks.diskimages skip-verify -bool true
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
echo "Avoid creating .DS_Store files on network volumes"
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
echo "Disable the warning before emptying the Trash"
defaults write com.apple.finder WarnOnEmptyTrash -bool false
echo "Require password immediately after sleep or screen saver begins"
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0
echo "Allow apps from anywhere" echo "Allow apps from anywhere"
SPCTL=$(spctl --status) SPCTL=$(spctl --status)
if ! [ "$SPCTL" = "assessments disabled" ]; then if ! [ "$SPCTL" = "assessments disabled" ]; then
sudo spctl --master-disable sudo spctl --master-disable
fi fi
''; '';
# User-level settings # User-level settings
activationScripts.postUserActivation.text = let activationScripts.postUserActivation.text = ''
persistentApps = lib.concatMapStrings (x: ''"'' + x + ''" '')
config.system.defaults.CustomUserPreferences."com.apple.dock".persistent-apps;
in ''
echo "Show the ~/Library folder" echo "Show the ~/Library folder"
chflags nohidden ~/Library chflags nohidden ~/Library
echo "Choose and order dock icons" echo "Enable dock magnification"
defaults write com.apple.dock persistent-apps -array ${persistentApps} defaults write com.apple.dock magnification -bool true
echo "Reduce Menu Bar padding" echo "Set dock magnification size"
defaults write -globalDomain NSStatusItemSelectionPadding -int 6 defaults write com.apple.dock largesize -int 48
defaults write -globalDomain NSStatusItemSpacing -int 6
echo "Define dock icon function"
__dock_item() {
printf "%s%s%s%s%s" \
"<dict><key>tile-data</key><dict><key>file-data</key><dict>" \
"<key>_CFURLString</key><string>" \
"$1" \
"</string><key>_CFURLStringType</key><integer>0</integer>" \
"</dict></dict></dict>"
}
echo "Choose and order dock icons"
defaults write com.apple.dock persistent-apps -array \
"$(__dock_item /Applications/1Password.app)" \
"$(__dock_item ${pkgs.slack}/Applications/Slack.app)" \
"$(__dock_item /System/Applications/Calendar.app)" \
"$(__dock_item ${pkgs.firefox-bin}/Applications/Firefox.app)" \
"$(__dock_item /System/Applications/Messages.app)" \
"$(__dock_item /System/Applications/Mail.app)" \
"$(__dock_item /Applications/zoom.us.app)" \
"$(__dock_item ${pkgs.discord}/Applications/Discord.app)" \
"$(__dock_item /Applications/Obsidian.app)" \
"$(__dock_item ${pkgs.kitty}/Applications/kitty.app)" \
"$(__dock_item /System/Applications/System\ Settings.app)"
''; '';
}; };

View File

@ -9,18 +9,12 @@
}; };
home-manager.users.${config.user} = {
# Default shell setting doesn't work
home.sessionVariables = { SHELL = "${pkgs.fish}/bin/fish"; };
# Used for aerc # Used for aerc
xdg.enable = true; home-manager.users.${config.user} = {
home.sessionVariables = {
XDG_CONFIG_HOME = "${config.homePath}/.config";
};
}; };
# Fix for: 'Error: HOME is set to "/var/root" but we expect "/var/empty"'
home-manager.users.root.home.homeDirectory = lib.mkForce "/var/root";
}; };

View File

@ -2,23 +2,20 @@
{ {
unfreePackages = [ "consul" "vault-bin" ];
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin { home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
home.packages = with pkgs; [ home.packages = with pkgs; [
visidata # CSV inspector # visidata # CSV inspector
dos2unix # Convert Windows text files dos2unix # Convert Windows text files
inetutils # Includes telnet inetutils # Includes telnet
youtube-dl # Convert web videos youtube-dl # Convert web videos
pandoc # Convert text documents pandoc # Convert text documents
mpd # TUI slideshows mpd # TUI slideshows
mpv # Video player
gnupg # Encryption
awscli2 awscli2
awslogs awslogs
google-cloud-sdk google-cloud-sdk
vault-bin ansible
vault
consul consul
noti # Create notifications programmatically noti # Create notifications programmatically
ipcalc # Make IP network calculations ipcalc # Make IP network calculations

View File

@ -14,8 +14,6 @@
home.packages = with pkgs; [ calibre ]; home.packages = with pkgs; [ calibre ];
# home.sessionVariables = { CALIBRE_USE_DARK_PALETTE = 1; }; # home.sessionVariables = { CALIBRE_USE_DARK_PALETTE = 1; };
}; };
# Forces Calibre to use dark mode
environment.sessionVariables = { CALIBRE_USE_DARK_PALETTE = "1"; }; environment.sessionVariables = { CALIBRE_USE_DARK_PALETTE = "1"; };
}; };
} }

View File

@ -18,14 +18,12 @@
home-manager.users.${config.user} = { home-manager.users.${config.user} = {
# Quick button for launching nautilus
xsession.windowManager.i3.config.keybindings = { xsession.windowManager.i3.config.keybindings = {
"${ "${
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
}+n" = "exec --no-startup-id ${pkgs.gnome.nautilus}/bin/nautilus"; }+n" = "exec --no-startup-id ${pkgs.gnome.nautilus}/bin/nautilus";
}; };
# Generates a QR code and previews it with sushi
programs.fish.functions = { programs.fish.functions = {
qr = { qr = {
body = body =
@ -33,21 +31,24 @@
}; };
}; };
# Set Nautilus as default for opening directories # Set default for opening directories
xdg.mimeApps = { xdg.mimeApps = {
associations.added."inode/directory" = [ "org.gnome.Nautilus.desktop" ]; associations.added."inode/directory" = [ "org.gnome.Nautilus.desktop" ];
# associations.removed = {
# "inode/directory" = [ "kitty-open.desktop" ];
# };
defaultApplications."inode/directory" = defaultApplications."inode/directory" =
lib.mkBefore [ "org.gnome.Nautilus.desktop" ]; lib.mkBefore [ "org.gnome.Nautilus.desktop" ];
}; };
}; };
# Delete Trash files older than 1 week # # Set default for opening directories
systemd.user.services.empty-trash = { # xdg.mime = {
description = "Empty Trash on a regular basis"; # addedAssociations."inode/directory" = [ "org.gnome.Nautilus.desktop" ];
wantedBy = [ "default.target" ]; # removedAssociations = { "inode/directory" = [ "kitty-open.desktop" ]; };
script = "${pkgs.trash-cli}/bin/trash-empty 7"; # defaultApplications."inode/directory" =
}; # lib.mkForce [ "org.gnome.Nautilus.desktop" ];
# };
}; };

View File

@ -9,14 +9,6 @@
programs.steam = { programs.steam = {
enable = true; enable = true;
remotePlay.openFirewall = true; remotePlay.openFirewall = true;
package = pkgs.steam.override {
# Adapted in part from: https://github.com/Shawn8901/nix-configuration/blob/1c48be94238a9f463cf0bbd1e1842a4454286514/modules/nixos/steam-compat-tools/default.nix
# Based on: https://github.com/NixOS/nixpkgs/issues/73323
extraEnv = {
STEAM_EXTRA_COMPAT_TOOLS_PATHS =
lib.makeBinPath [ pkgs.proton-ge-custom ];
};
};
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
@ -30,10 +22,6 @@
]; ];
# Seems like NetworkManager can help speed up Steam launch
# https://www.reddit.com/r/archlinux/comments/qguhco/steam_startup_time_arch_1451_seconds_fedora_34/hi8opet/
networking.networkmanager.enable = true;
}; };
} }

View File

@ -3,7 +3,6 @@
imports = [ imports = [
./dunst.nix ./dunst.nix
./fonts.nix ./fonts.nix
./gtk.nix
./i3.nix ./i3.nix
./picom.nix ./picom.nix
./polybar.nix ./polybar.nix

View File

@ -6,7 +6,7 @@ in {
config = lib.mkIf (config.gui.enable && pkgs.stdenv.isLinux) { config = lib.mkIf (config.gui.enable && pkgs.stdenv.isLinux) {
fonts.packages = with pkgs; [ fonts.fonts = with pkgs; [
victor-mono # Used for Vim and Terminal victor-mono # Used for Vim and Terminal
(nerdfonts.override { fonts = [ "Hack" ]; }) # For Polybar, Rofi (nerdfonts.override { fonts = [ "Hack" ]; }) # For Polybar, Rofi
]; ];

View File

@ -1,51 +0,0 @@
{ config, pkgs, lib, ... }: {
options = {
gtk.theme = {
name = lib.mkOption {
type = lib.types.str;
description = "Theme name for GTK applications";
};
package = lib.mkOption {
type = lib.types.package;
description = "Theme package for GTK applications";
default = pkgs.gnome-themes-extra;
};
};
};
config = lib.mkIf config.gui.enable {
home-manager.users.${config.user} = {
gtk = let
gtkExtraConfig = {
gtk-application-prefer-dark-theme = config.theme.dark;
};
in {
enable = true;
theme = {
name = config.gtk.theme.name;
package = config.gtk.theme.package;
};
gtk3.extraConfig = gtkExtraConfig;
gtk4.extraConfig = gtkExtraConfig;
};
};
# Required for setting GTK theme (for preferred-color-scheme in browser)
services.dbus.packages = [ pkgs.dconf ];
programs.dconf.enable = true;
# Make the login screen dark
services.xserver.displayManager.lightdm.greeters.gtk.theme = {
name = config.gtk.theme.name;
package = config.gtk.theme.package;
};
environment.sessionVariables = { GTK_THEME = config.gtk.theme.name; };
};
}

View File

@ -45,7 +45,7 @@ in {
{ class = "obsidian"; } { class = "obsidian"; }
]; ];
"${ws3}" = [{ class = "discord"; }]; "${ws3}" = [{ class = "discord"; }];
"${ws4}" = [ { class = "steam"; } { class = "Steam"; } ]; "${ws4}" = [{ class = "Steam"; }];
}; };
bars = [{ command = "echo"; }]; # Disable i3bar bars = [{ command = "echo"; }]; # Disable i3bar
colors = let colors = let
@ -95,15 +95,13 @@ in {
# Adjust screen brightness # Adjust screen brightness
"Shift+F12" = "Shift+F12" =
# Disable dynamic sleep "exec ${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 + 30 && sleep 1; exec ${pkgs.ddcutil}/bin/ddcutil --display 2 setvcp 10 + 30";
# https://github.com/rockowitz/ddcutil/issues/323
"exec ${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 + 30 && sleep 1; exec ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 + 30";
"Shift+F11" = "Shift+F11" =
"exec ${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 - 30 && sleep 1; exec ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 - 30"; "exec ${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 - 30 && sleep 1; exec ${pkgs.ddcutil}/bin/ddcutil --display 2 setvcp 10 - 30";
"XF86MonBrightnessUp" = "XF86MonBrightnessUp" =
"exec ${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 + 30 && sleep 1; exec ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 + 30"; "exec ${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 + 30 && sleep 1; exec ${pkgs.ddcutil}/bin/ddcutil --display 2 setvcp 10 + 30";
"XF86MonBrightnessDown" = "XF86MonBrightnessDown" =
"exec ${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 - 30 && sleep 1; exec ${pkgs.ddcutil}/bin/ddcutil --disable-dynamic-sleep --display 2 setvcp 10 - 30"; "exec ${pkgs.ddcutil}/bin/ddcutil --display 1 setvcp 10 - 30 && sleep 1; exec ${pkgs.ddcutil}/bin/ddcutil --display 2 setvcp 10 - 30";
# Media player controls # Media player controls
"XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause"; "XF86AudioPlay" = "exec ${pkgs.playerctl}/bin/playerctl play-pause";

View File

@ -36,7 +36,7 @@
module-margin = 1; module-margin = 1;
modules-left = "i3"; modules-left = "i3";
modules-center = "xwindow"; modules-center = "xwindow";
modules-right = "mailcount network pulseaudio date keyboard power"; modules-right = "mailcount pulseaudio date power";
cursor-click = "pointer"; cursor-click = "pointer";
cursor-scroll = "ns-resize"; cursor-scroll = "ns-resize";
enable-ipc = true; enable-ipc = true;
@ -106,14 +106,8 @@
interval = 10; interval = 10;
format = "<label>"; format = "<label>";
exec = builtins.toString (pkgs.writeShellScript "mailcount.sh" '' exec = builtins.toString (pkgs.writeShellScript "mailcount.sh" ''
${pkgs.notmuch}/bin/notmuch new --quiet 2>&1>/dev/null ${pkgs.notmuch}/bin/notmuch new > /dev/null
UNREAD=$( UNREAD=$(${pkgs.notmuch}/bin/notmuch count is:inbox and is:unread and folder:main/Inbox)
${pkgs.notmuch}/bin/notmuch count \
is:inbox and \
is:unread and \
folder:main/Inbox \
2>/dev/null
)
if [ $UNREAD = "0" ]; then if [ $UNREAD = "0" ]; then
echo "" echo ""
else else
@ -124,16 +118,6 @@
"i3-msg 'exec --no-startup-id kitty --class aerc aerc'; sleep 0.15; i3-msg '[class=aerc] focus'"; "i3-msg 'exec --no-startup-id kitty --class aerc aerc'; sleep 0.15; i3-msg '[class=aerc] focus'";
}; };
"module/network" = {
type = "internal/network";
interface-type = "wired";
interval = 3;
accumulate-stats = true;
format-connected = "<label-connected>";
format-disconnected = "<label-disconnected>";
label-connected = "";
label-disconnected = "";
};
"module/pulseaudio" = { "module/pulseaudio" = {
type = "internal/pulseaudio"; type = "internal/pulseaudio";
# format-volume-prefix = "VOL "; # format-volume-prefix = "VOL ";
@ -141,12 +125,12 @@
format-volume = "<ramp-volume> <label-volume>"; format-volume = "<ramp-volume> <label-volume>";
# format-volume-background = colors.background; # format-volume-background = colors.background;
# label-volume-background = colors.background; # label-volume-background = colors.background;
format-volume-foreground = config.theme.colors.base04; format-volume-foreground = config.theme.colors.base0B;
label-volume = "%percentage%%"; label-volume = "%percentage%%";
label-muted = "󰝟 ---"; label-muted = " ---";
label-muted-foreground = config.theme.colors.base03; label-muted-foreground = config.theme.colors.base03;
ramp-volume-0 = ""; ramp-volume-0 = "";
ramp-volume-1 = "󰕾"; ramp-volume-1 = "";
ramp-volume-2 = ""; ramp-volume-2 = "";
click-right = config.audioSwitchCommand; click-right = config.audioSwitchCommand;
}; };
@ -197,20 +181,13 @@
date = "%d %b %l:%M %p"; date = "%d %b %l:%M %p";
date-alt = "%Y-%m-%d %H:%M:%S"; date-alt = "%Y-%m-%d %H:%M:%S";
label = "%date%"; label = "%date%";
label-foreground = config.theme.colors.base06; label-foreground = config.theme.colors.base0A;
# format-background = colors.background; # format-background = colors.background;
}; };
"module/keyboard" = {
type = "custom/text";
content = "󰌌";
click-left = "doas systemctl restart keyd";
content-foreground = config.theme.colors.base04;
};
"module/power" = { "module/power" = {
type = "custom/text"; type = "custom/text";
content = " "; content = " ";
click-left = config.powerCommand; click-left = config.powerCommand;
click-right = "polybar-msg cmd restart";
content-foreground = config.theme.colors.base04; content-foreground = config.theme.colors.base04;
}; };
"settings" = { "settings" = {

Some files were not shown because too many files have changed in this diff Show More