mirror of
https://github.com/nmasur/dotfiles
synced 2025-04-04 20:21:11 +00:00
Merge branch 'platform'
This is a large refactor to the dotfiles setup.
This commit is contained in:
commit
5397e4e23f
67
README.md
67
README.md
@ -8,38 +8,38 @@ configuration may be difficult to translate to a non-Nix system.
|
||||
|
||||
## System Features
|
||||
|
||||
| Feature | Program | Configuration |
|
||||
|----------------|-----------------------------------------------------|-----------------------------------------------|
|
||||
| OS | [NixOS](https://nixos.org) | [Link](./modules/nixos) |
|
||||
| Display Server | [X11](https://www.x.org/wiki/) | [Link](./modules/nixos/graphical/xorg.nix) |
|
||||
| Compositor | [Picom](https://github.com/yshui/picom) | [Link](./modules/nixos/graphical/picom.nix) |
|
||||
| Window Manager | [i3](https://i3wm.org/) | [Link](./modules/nixos/graphical/i3.nix) |
|
||||
| Panel | [Polybar](https://polybar.github.io/) | [Link](./modules/nixos/graphical/polybar.nix) |
|
||||
| Font | [Victor Mono](https://rubjo.github.io/victor-mono/) | [Link](./modules/nixos/graphical/fonts.nix) |
|
||||
| Launcher | [Rofi](https://github.com/davatorium/rofi) | [Link](./modules/nixos/graphical/rofi.nix) |
|
||||
| Feature | Program | Configuration |
|
||||
|----------------|-----------------------------------------------------|-----------------------------------------------------------------------------------|
|
||||
| OS | [NixOS](https://nixos.org) | [Link](./platforms/nixos) |
|
||||
| Display Server | [X11](https://www.x.org/wiki/) | [Link](./platforms/nixos/modules/nmasur/profiles/gui.nix) |
|
||||
| Compositor | [Picom](https://github.com/yshui/picom) | [Link](./platforms/home-manager/modules/nmasur/presets/services/picom.nix) |
|
||||
| Window Manager | [i3](https://i3wm.org/) | [Link](./platforms/home-manager/modules/nmasur/presets/services/i3.nix) |
|
||||
| Panel | [Polybar](https://polybar.github.io/) | [Link](./platforms/home-manager/modules/nmasur/presets/services/polybar.nix) |
|
||||
| Font | [Victor Mono](https://rubjo.github.io/victor-mono/) | [Link](./platforms/home-manager/modules/nmasur/presets/fonts.nix) |
|
||||
| Launcher | [Rofi](https://github.com/davatorium/rofi) | [Link](./platforms/home-manager/modules/nmasur/presets/programs/rofi/default.nix) |
|
||||
|
||||
## User Features
|
||||
|
||||
| Feature | Program | Configuration |
|
||||
|--------------|----------------------------------------------------------------------------------|----------------------------------------------------|
|
||||
| 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) |
|
||||
| Shell | [Fish](https://fishshell.com/) | [Link](./modules/common/shell/fish) |
|
||||
| Shell Prompt | [Starship](https://starship.rs/) | [Link](./modules/common/shell/starship.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) |
|
||||
| Text Editor | [Neovim](https://neovim.io/) | [Link](./modules/common/neovim/config) |
|
||||
| Browser | [Firefox](https://www.mozilla.org/en-US/firefox/new/) | [Link](./modules/common/applications/firefox.nix) |
|
||||
| E-Mail | [Aerc](https://aerc-mail.org/) | [Link](./modules/common/mail/aerc.nix) |
|
||||
| File Manager | [Nautilus](https://wiki.gnome.org/action/show/Apps/Files) | [Link](./modules/common/applications/nautilus.nix) |
|
||||
| PDF Reader | [Zathura](https://pwmt.org/projects/zathura/) | [Link](./modules/common/applications/media.nix) |
|
||||
| Video Player | [mpv](https://mpv.io/) | [Link](./modules/common/applications/media.nix) |
|
||||
| Feature | Program | Configuration |
|
||||
|--------------|----------------------------------------------------------------------------------|-------------------------------------------------------------------------------|
|
||||
| Dotfiles | [Home-Manager](https://github.com/nix-community/home-manager) | [Link](./platforms/home-manager) |
|
||||
| Terminal | [Ghostty](https://sw.kovidgoyal.net/kitty/) | [Link](./platforms/home-manager/modules/nmasur/presets/programs/ghostty.nix) |
|
||||
| Shell | [Fish](https://fishshell.com/) | [Link](./platforms/home-manager/modules/nmasur/presets/programs/fish.nix) |
|
||||
| Shell Prompt | [Starship](https://starship.rs/) | [Link](./platforms/home-manager/modules/nmasur/presets/programs/starship.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/x86_64-linux/tempest/default.nix) |
|
||||
| Text Editor | [Neovim](https://neovim.io/) | [Link](./pkgs/applications/editors/neovim/nmasur/neovim/package.nix) |
|
||||
| Browser | [Firefox](https://www.mozilla.org/en-US/firefox/new/) | [Link](./platforms/home-manager/modules/nmasur/presets/programs/firefox.nix) |
|
||||
| E-Mail | [Aerc](https://aerc-mail.org/) | [Link](./platforms/home-manager/modules/nmasur/presets/programs/aerc.nix) |
|
||||
| File Manager | [Nautilus](https://wiki.gnome.org/action/show/Apps/Files) | [Link](./platforms/home-manager/modules/nmasur/presets/programs/nautilus.nix) |
|
||||
| PDF Reader | [Zathura](https://pwmt.org/projects/zathura/) | [Link](./platforms/home-manager/modules/nmasur/presets/programs/zathura.nix) |
|
||||
| Video Player | [mpv](https://mpv.io/) | [Link](./platforms/home-manager/modules/nmasur/presets/programs/mpv.nix) |
|
||||
|
||||
## macOS Features
|
||||
|
||||
| Feature | Program | Configuration |
|
||||
|----------|---------------------------------------------|--------------------------------------|
|
||||
| Keybinds | [Hammerspoon](https://www.hammerspoon.org/) | [Link](./modules/darwin/hammerspoon) |
|
||||
| Keybinds | [Hammerspoon](https://www.hammerspoon.org/) | [Link](./platforms/home-manager/modules/nmasur/presets/services/hammerspoon/) |
|
||||
|
||||
# Diagram
|
||||
|
||||
@ -51,15 +51,16 @@ configuration may be difficult to translate to a non-Nix system.
|
||||
|
||||
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.
|
||||
- [Neovim config](./pkgs/applications/editors/neovim/nmasur/neovim/package.nix)
|
||||
generated with Nix2Vim and source-controlled plugins,
|
||||
differing based on installed LSPs, for example. - [Caddy
|
||||
JSON](./platforms/nixos/modules/nmasur/presets/services/caddy.nix) file (routes,
|
||||
etc.) based dynamically on enabled services rendered with Nix. - [Grafana
|
||||
config](./platforms/nixos/modules/nmasur/presets/services/grafana/grafana.nix)
|
||||
rendered with Nix. - Custom [secrets
|
||||
deployment](./platforms/nixos/modules/secrets.nix) similar to agenix. - Base16
|
||||
[colorschemes](./colorscheme/) applied to multiple applications, including
|
||||
Firefox userChrome.
|
||||
|
||||
---
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
# Apps
|
||||
|
||||
These are all my miscellaneous utilies and scripts to accompany this project.
|
||||
|
||||
They can be run with:
|
||||
|
||||
```
|
||||
nix run github:nmasur/dotfiles#appname
|
||||
```
|
@ -1,34 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
rec {
|
||||
|
||||
# Show quick helper
|
||||
default = import ./help.nix { inherit pkgs; };
|
||||
|
||||
# Format primary disk
|
||||
format-root = import ./format-root.nix { inherit pkgs; };
|
||||
|
||||
# Format and install from nothing (deprecated)
|
||||
installer = import ./installer.nix { inherit pkgs; };
|
||||
|
||||
# Display the readme for this repository
|
||||
readme = import ./readme.nix { inherit pkgs; };
|
||||
|
||||
# Rebuild
|
||||
rebuild = import ./rebuild.nix { inherit pkgs; };
|
||||
|
||||
# Load the SSH key for this machine
|
||||
loadkey = import ./loadkey.nix { inherit pkgs; };
|
||||
|
||||
# Encrypt secret for all machines
|
||||
encrypt-secret = import ./encrypt-secret.nix { inherit pkgs; };
|
||||
|
||||
# Re-encrypt secrets for all machines
|
||||
reencrypt-secrets = import ./reencrypt-secrets.nix { inherit pkgs; };
|
||||
|
||||
# Connect machine metrics to Netdata Cloud
|
||||
netdata = import ./netdata-cloud.nix { inherit pkgs; };
|
||||
|
||||
# Run neovim as an app
|
||||
neovim = import ./neovim.nix { inherit pkgs; };
|
||||
nvim = neovim;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
# nix run github:nmasur/dotfiles#encrypt-secret > private/mysecret.age
|
||||
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (
|
||||
pkgs.writeShellScript "encrypt-secret" ''
|
||||
printf "\nEnter the secret data to encrypt for all hosts...\n\n" 1>&2
|
||||
read -p "Secret: " secret
|
||||
printf "\nEncrypting...\n\n" 1>&2
|
||||
tmpfile=$(mktemp)
|
||||
echo "''${secret}" > ''${tmpfile}
|
||||
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${builtins.toString ../misc/public-keys} $tmpfile
|
||||
rm $tmpfile
|
||||
''
|
||||
);
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
# This script will partition and format drives; use at your own risk!
|
||||
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (
|
||||
pkgs.writeShellScript "format-root" ''
|
||||
set -e
|
||||
|
||||
DISK=$1
|
||||
|
||||
if [ -z "''${DISK}" ]; then
|
||||
${pkgs.gum}/bin/gum style --width 50 --margin "1 2" --padding "2 4" \
|
||||
--foreground "#fb4934" \
|
||||
"Missing required parameter." \
|
||||
"Usage: format-root -- <disk>" \
|
||||
"Flake example: nix run github:nmasur/dotfiles#format-root -- nvme0n1"
|
||||
echo "(exiting)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
${pkgs.disko}/bin/disko \
|
||||
--mode create \
|
||||
--dry-run \
|
||||
--flake "path:$(pwd)#root" \
|
||||
--arg disk \""/dev/''${DISK}"\"
|
||||
|
||||
${pkgs.gum}/bin/gum confirm \
|
||||
"This will ERASE ALL DATA on the disk /dev/''${DISK}. Are you sure you want to continue?" \
|
||||
--default=false
|
||||
|
||||
${pkgs.disko}/bin/disko \
|
||||
--mode create \
|
||||
--flake "path:$(pwd)#root" \
|
||||
--arg disk "/dev/''${DISK}"
|
||||
|
||||
''
|
||||
);
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (
|
||||
pkgs.writeShellScript "default" ''
|
||||
${pkgs.gum}/bin/gum style --margin "1 2" --padding "0 2" --foreground "15" --background "55" "Options"
|
||||
${pkgs.gum}/bin/gum format --type=template -- ' {{ Italic "Run with" }} {{ Color "15" "69" " nix run github:nmasur/dotfiles#" }}{{ Color "15" "62" "someoption" }}{{ Color "15" "69" " " }}.'
|
||||
echo ""
|
||||
echo ""
|
||||
${pkgs.gum}/bin/gum format --type=template -- \
|
||||
' • {{ Color "15" "57" " readme " }} {{ Italic "Documentation for this repository." }}' \
|
||||
' • {{ Color "15" "57" " rebuild " }} {{ Italic "Switch to this configuration." }}' \
|
||||
' • {{ Color "15" "57" " installer " }} {{ Italic "Format and install from nothing." }}' \
|
||||
' • {{ Color "15" "57" " neovim " }} {{ Italic "Test out the Neovim package." }}' \
|
||||
' • {{ Color "15" "57" " loadkey " }} {{ Italic "Load an ssh key for this machine using melt." }}' \
|
||||
' • {{ Color "15" "57" " encrypt-secret " }} {{ Italic "Encrypt a secret for all machines." }}' \
|
||||
' • {{ Color "15" "57" " reencrypt-secrets " }} {{ Italic "Reencrypt all secrets when new machine is added." }}' \
|
||||
' • {{ Color "15" "57" " netdata " }} {{ Italic "Connect a machine to Netdata cloud." }}'
|
||||
echo ""
|
||||
echo ""
|
||||
''
|
||||
);
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
# Inspired by https://github.com/cleverca22/nix-tests/blob/master/kexec/justdoit.nix
|
||||
# This script will partition and format drives; use at your own risk!
|
||||
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (
|
||||
pkgs.writeShellScript "installer" ''
|
||||
set -e
|
||||
|
||||
DISK=$1
|
||||
FLAKE=$2
|
||||
PARTITION_PREFIX=""
|
||||
|
||||
if [ -z "$DISK" ] || [ -z "$FLAKE" ]; then
|
||||
${pkgs.gum}/bin/gum style --width 50 --margin "1 2" --padding "2 4" \
|
||||
--foreground "#fb4934" \
|
||||
"Missing required parameter." \
|
||||
"Usage: installer -- <disk> <host>" \
|
||||
"Example: installer -- nvme0n1 tempest" \
|
||||
"Flake example: nix run github:nmasur/dotfiles#installer -- nvme0n1 tempest"
|
||||
echo "(exiting)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$DISK" in nvme*)
|
||||
PARTITION_PREFIX="p"
|
||||
esac
|
||||
|
||||
${pkgs.gum}/bin/gum confirm \
|
||||
"This will ERASE ALL DATA on the disk /dev/''${DISK}. Are you sure you want to continue?" \
|
||||
--default=false
|
||||
|
||||
${pkgs.parted}/bin/parted /dev/''${DISK} -- mklabel gpt
|
||||
${pkgs.parted}/bin/parted /dev/''${DISK} -- mkpart primary 512MiB 100%
|
||||
${pkgs.parted}/bin/parted /dev/''${DISK} -- mkpart ESP fat32 1MiB 512MiB
|
||||
${pkgs.parted}/bin/parted /dev/''${DISK} -- set 3 esp on
|
||||
mkfs.ext4 -L nixos /dev/''${DISK}''${PARTITION_PREFIX}1
|
||||
mkfs.fat -F 32 -n boot /dev/''${DISK}''${PARTITION_PREFIX}2
|
||||
|
||||
mount /dev/disk/by-label/nixos /mnt
|
||||
mkdir --parents /mnt/boot
|
||||
mount /dev/disk/by-label/boot /mnt/boot
|
||||
|
||||
${pkgs.nixos-install-tools}/bin/nixos-install --flake github:nmasur/dotfiles#''${FLAKE}
|
||||
''
|
||||
);
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (
|
||||
pkgs.writeShellScript "loadkey" ''
|
||||
printf "\nEnter the seed phrase for your SSH key...\n"
|
||||
printf "\nThen press ^D when complete.\n\n"
|
||||
mkdir -p ~/.ssh/
|
||||
${pkgs.melt}/bin/melt restore ~/.ssh/id_ed25519
|
||||
printf "\n\nContinuing activation.\n\n"
|
||||
''
|
||||
);
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
type = "app";
|
||||
|
||||
program = "${
|
||||
(import ../modules/common/neovim/package {
|
||||
inherit pkgs;
|
||||
colors = (import ../colorscheme/nord).dark;
|
||||
})
|
||||
}/bin/nvim";
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (
|
||||
pkgs.writeShellScript "netdata-cloud" ''
|
||||
if [ "$EUID" -ne 0 ]; then
|
||||
echo "Please run as root"
|
||||
exit 1
|
||||
fi
|
||||
mkdir --parents --mode 0750 /var/lib/netdata/cloud.d
|
||||
printf "\nEnter the claim token for netdata cloud...\n\n"
|
||||
read -p "Token: " token
|
||||
echo "''${token}" > /var/lib/netdata/cloud.d/token
|
||||
chown -R netdata:netdata /var/lib/netdata
|
||||
${pkgs.netdata}/bin/netdata-claim.sh -id=$(uuidgen)
|
||||
printf "\n\nNow restart netdata service.\n\n"
|
||||
''
|
||||
);
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (
|
||||
pkgs.writeShellScript "readme" ''
|
||||
${pkgs.glow}/bin/glow --pager ${builtins.toString ../README.md}
|
||||
''
|
||||
);
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (
|
||||
pkgs.writeShellScript "rebuild" ''
|
||||
echo ${pkgs.system}
|
||||
SYSTEM=${if pkgs.stdenv.isDarwin then "darwin" else "linux"}
|
||||
if [ "$SYSTEM" == "darwin" ]; then
|
||||
sudo darwin-rebuild switch --flake ${builtins.toString ../.}
|
||||
else
|
||||
doas nixos-rebuild switch --flake ${builtins.toString ../.}
|
||||
fi
|
||||
''
|
||||
);
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
# nix run github:nmasur/dotfiles#reencrypt-secrets ./private
|
||||
|
||||
type = "app";
|
||||
|
||||
program = builtins.toString (
|
||||
pkgs.writeShellScript "reencrypt-secrets" ''
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "Must provide directory to reencrypt."
|
||||
exit 1
|
||||
fi
|
||||
encrypted=$1
|
||||
for encryptedfile in ''${1}/*; do
|
||||
tmpfile=$(mktemp)
|
||||
echo "Decrypting ''${encryptedfile}..."
|
||||
${pkgs.age}/bin/age --decrypt \
|
||||
--identity ~/.ssh/id_ed25519 $encryptedfile > $tmpfile
|
||||
echo "Encrypting ''${encryptedfile}..."
|
||||
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${builtins.toString ../misc/public-keys} $tmpfile > $encryptedfile
|
||||
rm $tmpfile
|
||||
done
|
||||
echo "Finished."
|
||||
''
|
||||
);
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
# Disks
|
||||
|
||||
These are my [disko](https://github.com/nix-community/disko) configurations,
|
||||
which allow me to save desired disk formatting layouts as a declarative file so
|
||||
I don't have to remember how to format my disks later on.
|
@ -1,98 +0,0 @@
|
||||
{ pool, disks, ... }:
|
||||
{
|
||||
disk = lib.genAttrs disks (disk: {
|
||||
"${disk}" = {
|
||||
type = "disk";
|
||||
device = "/dev/${disk}";
|
||||
content = {
|
||||
type = "table";
|
||||
format = "gpt";
|
||||
partitions = [
|
||||
{
|
||||
type = "partition";
|
||||
name = "zfs";
|
||||
start = "128MiB";
|
||||
end = "100%";
|
||||
content = {
|
||||
type = "zfs";
|
||||
pool = pool;
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
});
|
||||
zpool = {
|
||||
"${pool}" = {
|
||||
type = "zpool";
|
||||
mode = "raidz1";
|
||||
rootFsOptions = {
|
||||
compression = "on"; # lz4 by default
|
||||
"com.sun:auto-snapshot" = "false";
|
||||
ashift = "12";
|
||||
};
|
||||
# mountpoint = "/";
|
||||
|
||||
datasets = {
|
||||
root = {
|
||||
zfs_type = "filesystem";
|
||||
mountpoint = null;
|
||||
options."com.sun:auto-snapshot" = "false";
|
||||
};
|
||||
# "media/movies" = {
|
||||
# zfs_type = "filesystem";
|
||||
# mountpoint = "/media/movies";
|
||||
# options.recordsize = "1M";
|
||||
# };
|
||||
# "media/tv" = {
|
||||
# zfs_type = "filesystem";
|
||||
# mountpoint = "/media/tv";
|
||||
# options.recordsize = "1M";
|
||||
# };
|
||||
# "media/books" = {
|
||||
# zfs_type = "filesystem";
|
||||
# mountpoint = "/media/books";
|
||||
# };
|
||||
# archive = {
|
||||
# zfs_type = "filesystem";
|
||||
# mountpoint = "/archive";
|
||||
# options.compression = "zstd";
|
||||
# options."com.sun:auto-snapshot" = "true";
|
||||
# };
|
||||
# zfs_unmounted_fs = {
|
||||
# zfs_type = "filesystem";
|
||||
# options.mountpoint = "none";
|
||||
# };
|
||||
# zfs_legacy_fs = {
|
||||
# zfs_type = "filesystem";
|
||||
# options.mountpoint = "legacy";
|
||||
# mountpoint = "/zfs_legacy_fs";
|
||||
# };
|
||||
# zfs_testvolume = {
|
||||
# zfs_type = "volume";
|
||||
# size = "10M";
|
||||
# content = {
|
||||
# type = "filesystem";
|
||||
# format = "ext4";
|
||||
# mountpoint = "/ext4onzfs";
|
||||
# };
|
||||
# };
|
||||
# encrypted = {
|
||||
# zfs_type = "filesystem";
|
||||
# size = "20M";
|
||||
# options = {
|
||||
# mountpoint = "none";
|
||||
# encryption = "aes-256-gcm";
|
||||
# keyformat = "passphrase";
|
||||
# keylocation = "file:///tmp/secret.key";
|
||||
# };
|
||||
# };
|
||||
# "encrypted/test" = {
|
||||
# zfs_type = "filesystem";
|
||||
# size = "2M";
|
||||
# mountpoint = "/zfs_crypted";
|
||||
# };
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
698
flake.lock
generated
698
flake.lock
generated
@ -1,54 +1,5 @@
|
||||
{
|
||||
"nodes": {
|
||||
"baleia-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1721805312,
|
||||
"narHash": "sha256-qA1x5kplP2I8bURO0I4R0gt/zeznu9hQQ+XHptLGuwc=",
|
||||
"owner": "m00qek",
|
||||
"repo": "baleia.nvim",
|
||||
"rev": "1b25eac3ac03659c3d3af75c7455e179e5f197f7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "m00qek",
|
||||
"repo": "baleia.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"base16-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1739162639,
|
||||
"narHash": "sha256-Hs272gEgYj29XJ4FnMRXExtnbYqRGXIGaRZXo9I2P58=",
|
||||
"owner": "RRethy",
|
||||
"repo": "base16-nvim",
|
||||
"rev": "2fdd4e53286dbb8978699b5e1cd09835362a70f3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "RRethy",
|
||||
"repo": "base16-nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"bufferline-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1716555412,
|
||||
"narHash": "sha256-8PCkY1zrlMrPGnQOb7MjqDXNlkeX46jrT4ScIL+MOwM=",
|
||||
"owner": "akinsho",
|
||||
"repo": "bufferline.nvim",
|
||||
"rev": "99337f63f0a3c3ab9519f3d1da7618ca4f91cffe",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "akinsho",
|
||||
"ref": "v4.6.1",
|
||||
"repo": "bufferline.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"cl-nix-lite": {
|
||||
"locked": {
|
||||
"lastModified": 1728174978,
|
||||
@ -64,22 +15,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"cmp-nvim-lsp-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1733823748,
|
||||
"narHash": "sha256-iaihXNCF5bB5MdeoosD/kc3QtpA/QaIDZVLiLIurBSM=",
|
||||
"owner": "hrsh7th",
|
||||
"repo": "cmp-nvim-lsp",
|
||||
"rev": "99290b3ec1322070bcfb9e846450a46f6efa50f0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hrsh7th",
|
||||
"repo": "cmp-nvim-lsp",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@ -87,11 +22,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739548217,
|
||||
"narHash": "sha256-rlv64erpr36xdmMDPgf9rhRXBYZ0BZb5nrw2ZPSk1sQ=",
|
||||
"lastModified": 1742013980,
|
||||
"narHash": "sha256-34YbfwABU5nb0F5eaaJE3ujldaNDhmyxw7CWqhXJV08=",
|
||||
"owner": "lnl7",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "678b22642abde2ee77ae2218ab41d802f010e5b0",
|
||||
"rev": "9175b4bb5f127fb7b5784b14f7e01abff24c378f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -108,11 +43,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739582867,
|
||||
"narHash": "sha256-rO528HmsiPi3RO9kZdYt0NnzN3pxpXz33m6H/sIFgzI=",
|
||||
"lastModified": 1741786315,
|
||||
"narHash": "sha256-VT65AE2syHVj6v/DGB496bqBnu1PXrrzwlw07/Zpllc=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "4edb87a2ac9010da6fea50fc56d67e123fca85f4",
|
||||
"rev": "0d8c6ad4a43906d14abd5c60e0ffe7b587b213de",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -121,43 +56,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"fidget-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1716093309,
|
||||
"narHash": "sha256-Gpk/G0ByOAIE8uX4Xr94CvAjJBSJMEOwBuvrhmYYGsg=",
|
||||
"owner": "j-hui",
|
||||
"repo": "fidget.nvim",
|
||||
"rev": "ef99df04a1c53a453602421bc0f756997edc8289",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "j-hui",
|
||||
"ref": "v1.4.5",
|
||||
"repo": "fidget.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"firefox-darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739580952,
|
||||
"narHash": "sha256-nw4dHhyxbKZVPKiBho4StznHNxlFKnY/lIJbRssXPPQ=",
|
||||
"owner": "bandithedoge",
|
||||
"repo": "nixpkgs-firefox-darwin",
|
||||
"rev": "99a56b8763d3f5485c89e1e05ea8133f75821fbd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "bandithedoge",
|
||||
"repo": "nixpkgs-firefox-darwin",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@ -213,24 +111,6 @@
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"inputs": {
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1731533236,
|
||||
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": [
|
||||
"mac-app-util",
|
||||
@ -250,9 +130,9 @@
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"flake-utils_3": {
|
||||
"flake-utils_2": {
|
||||
"inputs": {
|
||||
"systems": "systems_3"
|
||||
"systems": "systems_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1705309234,
|
||||
@ -268,38 +148,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gh-collaborators": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1736185279,
|
||||
"narHash": "sha256-SGmP/8Fvf2rcYkwscMOFG01Y0VJGb/TXrNZtLacurxA=",
|
||||
"owner": "katiem0",
|
||||
"repo": "gh-collaborators",
|
||||
"rev": "bf412dde50605e48af86f291c2ac8714f2c1b228",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "katiem0",
|
||||
"repo": "gh-collaborators",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hmts-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1729786258,
|
||||
"narHash": "sha256-V5dwIJdxBulFVKk1iSlf4H5NRz1UH7uYQeMvwtgkpIs=",
|
||||
"owner": "calops",
|
||||
"repo": "hmts.nvim",
|
||||
"rev": "c7ff4c3ad96cd05664b18fb5bbbe2abbd7682dd2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "calops",
|
||||
"repo": "hmts.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@ -307,11 +155,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739571712,
|
||||
"narHash": "sha256-0UdSDV/TBY+GuxXLbrLq3l2Fq02ciyKCIMy4qmnfJXQ=",
|
||||
"lastModified": 1741955947,
|
||||
"narHash": "sha256-2lbURKclgKqBNm7hVRtWh0A7NrdsibD0EaWhahUVhhY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "6d3163aea47fdb1fe19744e91306a2ea4f602292",
|
||||
"rev": "4e12151c9e014e2449e0beca2c0e9534b96a26b4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -321,44 +169,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"jujutsu": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739586878,
|
||||
"narHash": "sha256-WgBHMXYhWIpRhhIESolbmd1fnsjyMTOadSAB7xe+WS0=",
|
||||
"owner": "martinvonz",
|
||||
"repo": "jj",
|
||||
"rev": "3bc111e60efdea774b6d979c0809256218b2549b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "martinvonz",
|
||||
"repo": "jj",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"mac-app-util": {
|
||||
"inputs": {
|
||||
"cl-nix-lite": "cl-nix-lite",
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils_2",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems_2"
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1732920695,
|
||||
"narHash": "sha256-1fxvJZUznwrmEtYqpPuWi2tPcL9kj6v7p1J7ZZncAPE=",
|
||||
"lastModified": 1739821351,
|
||||
"narHash": "sha256-QlVtMzAhECs9Esq3txqVW7/vM78ipB5IcI8uyCbTP7A=",
|
||||
"owner": "hraban",
|
||||
"repo": "mac-app-util",
|
||||
"rev": "548672d0cb661ce11d08ee8bde92b87d2a75c872",
|
||||
"rev": "c00d5b21ca1fdab8acef65e696795f0f15ec1158",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -383,7 +209,7 @@
|
||||
"nextcloud-external": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1729501349,
|
||||
"lastModified": 1729501365,
|
||||
"narHash": "sha256-OV6HhFBzmnQBO5btGEnqmKlaUMY7/t2Qm3XebclpBlM=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/nextcloud-releases/external/releases/download/v5.5.2/external-v5.5.2.tar.gz"
|
||||
@ -396,7 +222,7 @@
|
||||
"nextcloud-news": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1729667621,
|
||||
"lastModified": 1729667622,
|
||||
"narHash": "sha256-pnvyMZQ+NYMgH0Unfh5S19HdZSjnghgoUDAoi2KIXNI=",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/nextcloud/news/releases/download/25.0.0-alpha12/news.tar.gz"
|
||||
@ -409,7 +235,7 @@
|
||||
"nextcloud-snappymail": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1739590975,
|
||||
"lastModified": 1728502660,
|
||||
"narHash": "sha256-oCw6Brs85rINBHvz3UJXheyLVqvA3RgPXG03b30Fx7E=",
|
||||
"type": "tarball",
|
||||
"url": "https://snappymail.eu/repository/nextcloud/snappymail-2.38.2-nextcloud.tar.gz"
|
||||
@ -421,17 +247,17 @@
|
||||
},
|
||||
"nix2vim": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils_3",
|
||||
"flake-utils": "flake-utils_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1732820845,
|
||||
"narHash": "sha256-YPXk41l4PzKb5rtcxkYhymwjHJG95fxl4iXIzXnftr8=",
|
||||
"lastModified": 1740943170,
|
||||
"narHash": "sha256-A0F7T/euSMen004cVQN/ZkMpLkgLXDs+mq/merhd+0Y=",
|
||||
"owner": "gytis-ivaskevicius",
|
||||
"repo": "nix2vim",
|
||||
"rev": "e2c511ea553418dd432005875c649b09d56b7e58",
|
||||
"rev": "a562f32ff2393d0ed198103c65a3035bcdf83d4d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -463,11 +289,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737057290,
|
||||
"narHash": "sha256-3Pe0yKlCc7EOeq1X/aJVDH0CtNL+tIBm49vpepwL1MQ=",
|
||||
"lastModified": 1740947705,
|
||||
"narHash": "sha256-Co2kAD2SZalOm+5zoxmzEVZNvZ17TyafuFsD46BwSdY=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-generators",
|
||||
"rev": "d002ce9b6e7eb467cd1c6bb9aef9c35d191b5453",
|
||||
"rev": "507911df8c35939050ae324caccc7cf4ffb76565",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -478,11 +304,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1739446958,
|
||||
"narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=",
|
||||
"lastModified": 1742069588,
|
||||
"narHash": "sha256-C7jVfohcGzdZRF6DO+ybyG/sqpo1h6bZi9T56sxLy+k=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2ff53fe64443980e139eaa286017f53f88336dd0",
|
||||
"rev": "c80f6a7e10b39afcc1894e02ef785b1ad0b0d7e5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -492,22 +318,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-caddy": {
|
||||
"locked": {
|
||||
"lastModified": 1699107987,
|
||||
"narHash": "sha256-nWXETr4Oqy/vOfzgWyMY04qzEN2iREFJc5ycQ3XNu0A=",
|
||||
"owner": "jpds",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "a33b02fa9d664f31dadc8a874eb1a5dbaa9f4ecf",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "jpds",
|
||||
"ref": "caddy-external-plugins",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1735563628,
|
||||
@ -526,16 +336,16 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1739446958,
|
||||
"narHash": "sha256-+/bYK3DbPxMIvSL4zArkMX0LQvS7rzBKXnDXLfKyRVc=",
|
||||
"owner": "nixos",
|
||||
"lastModified": 1728538411,
|
||||
"narHash": "sha256-f0SBJz1eZ2yOuKUr5CA9BHULGXVSn6miBuUWdTyhUhU=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "2ff53fe64443980e139eaa286017f53f88336dd0",
|
||||
"rev": "b69de56fac8c2b6f8fd27f2eca01dcda8e0a4221",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
@ -543,15 +353,17 @@
|
||||
"nur": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739589581,
|
||||
"narHash": "sha256-8/3jzauKwx4xZQf2yol/E1YDRfHTt5/tYEK3n5+Py4A=",
|
||||
"lastModified": 1742145955,
|
||||
"narHash": "sha256-ju1J45e22ebpLH3eSm0ZZYg7WHkN01ryTFv+4UNwCOA=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nur",
|
||||
"rev": "e353ac4b999db166ad92074ca66f2394d65aeb1d",
|
||||
"rev": "d6ba59dd58ebe6c184f955e1d3a4bbca9484c018",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -560,135 +372,11 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvim-lint-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1738838825,
|
||||
"narHash": "sha256-E/KcQr4RM4gz+ItENI9e7hMicyBKyzoIaDO5D1VDYSw=",
|
||||
"owner": "mfussenegger",
|
||||
"repo": "nvim-lint",
|
||||
"rev": "6e9dd545a1af204c4022a8fcd99727ea41ffdcc8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "mfussenegger",
|
||||
"repo": "nvim-lint",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvim-lspconfig-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1716281382,
|
||||
"narHash": "sha256-foJ7a59N0a3QaBW24PtwbyYDQVlIsFxiatADLO/hQvc=",
|
||||
"owner": "neovim",
|
||||
"repo": "nvim-lspconfig",
|
||||
"rev": "0b8165cf95806bc4bb8f745bb0c92021b2ed4b98",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "neovim",
|
||||
"ref": "v0.1.8",
|
||||
"repo": "nvim-lspconfig",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvim-tree-lua-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1739135162,
|
||||
"narHash": "sha256-EprjYnY3cr2l+hEeVrf58yUl0mC60HQUmngHxoJo+KA=",
|
||||
"owner": "kyazdani42",
|
||||
"repo": "nvim-tree.lua",
|
||||
"rev": "80523101f0ae48b7f1990e907b685a3d79776c01",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "kyazdani42",
|
||||
"repo": "nvim-tree.lua",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nvim-treesitter-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1705679158,
|
||||
"narHash": "sha256-zAyiitJIgOCZTB0CmgNt0MHENM70SOHLIoWrVwOJKFg=",
|
||||
"owner": "nvim-treesitter",
|
||||
"repo": "nvim-treesitter",
|
||||
"rev": "f197a15b0d1e8d555263af20add51450e5aaa1f0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nvim-treesitter",
|
||||
"ref": "v0.9.2",
|
||||
"repo": "nvim-treesitter",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"osc": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1732197203,
|
||||
"narHash": "sha256-xL9mqwb+C6WbuJ/qk0lNbi9xd24PbKi5G0FlwaH5XPk=",
|
||||
"owner": "theimpostor",
|
||||
"repo": "osc",
|
||||
"rev": "87b316b3f96a22fd85654cd7bd091f2cac1c6691",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "theimpostor",
|
||||
"ref": "v0.4.6",
|
||||
"repo": "osc",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"ren": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1704996573,
|
||||
"narHash": "sha256-zVIt6Xp+Mvym6gySvHIZJt1QgzKVP/wbTGTubWk6kzI=",
|
||||
"owner": "robenkleene",
|
||||
"repo": "ren-find",
|
||||
"rev": "50c40172e354caffee48932266edd7c7a76a20fd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "robenkleene",
|
||||
"repo": "ren-find",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"rep": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1738376193,
|
||||
"narHash": "sha256-gBxrbGCy6JEHnmgJmcm8sgtEvCAqra8/gPGsfCEfLqg=",
|
||||
"owner": "robenkleene",
|
||||
"repo": "rep-grep",
|
||||
"rev": "2a24f95170aa14b5182b2287125664a62f8688ef",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "robenkleene",
|
||||
"repo": "rep-grep",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"baleia-nvim-src": "baleia-nvim-src",
|
||||
"base16-nvim-src": "base16-nvim-src",
|
||||
"bufferline-nvim-src": "bufferline-nvim-src",
|
||||
"cmp-nvim-lsp-src": "cmp-nvim-lsp-src",
|
||||
"darwin": "darwin",
|
||||
"disko": "disko",
|
||||
"fidget-nvim-src": "fidget-nvim-src",
|
||||
"firefox-darwin": "firefox-darwin",
|
||||
"gh-collaborators": "gh-collaborators",
|
||||
"hmts-nvim-src": "hmts-nvim-src",
|
||||
"home-manager": "home-manager",
|
||||
"jujutsu": "jujutsu",
|
||||
"mac-app-util": "mac-app-util",
|
||||
"nextcloud-cookbook": "nextcloud-cookbook",
|
||||
"nextcloud-external": "nextcloud-external",
|
||||
@ -697,46 +385,23 @@
|
||||
"nix2vim": "nix2vim",
|
||||
"nixos-generators": "nixos-generators",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-caddy": "nixpkgs-caddy",
|
||||
"nixpkgs-stable": "nixpkgs-stable",
|
||||
"nur": "nur",
|
||||
"nvim-lint-src": "nvim-lint-src",
|
||||
"nvim-lspconfig-src": "nvim-lspconfig-src",
|
||||
"nvim-tree-lua-src": "nvim-tree-lua-src",
|
||||
"nvim-treesitter-src": "nvim-treesitter-src",
|
||||
"osc": "osc",
|
||||
"ren": "ren",
|
||||
"rep": "rep",
|
||||
"snipe-nvim-src": "snipe-nvim-src",
|
||||
"telescope-nvim-src": "telescope-nvim-src",
|
||||
"telescope-project-nvim-src": "telescope-project-nvim-src",
|
||||
"tiny-inline-diagnostic-nvim-src": "tiny-inline-diagnostic-nvim-src",
|
||||
"toggleterm-nvim-src": "toggleterm-nvim-src",
|
||||
"tree-sitter-bash": "tree-sitter-bash",
|
||||
"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",
|
||||
"wsl": "wsl",
|
||||
"zellij-switch": "zellij-switch",
|
||||
"zenyd-mpv-scripts": "zenyd-mpv-scripts"
|
||||
}
|
||||
},
|
||||
"rust-overlay": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"jujutsu",
|
||||
"nixpkgs"
|
||||
]
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737685583,
|
||||
"narHash": "sha256-p+NVABRpGi+pT+xxf9HcLcFVxG6L+vEEy+NwzB9T0f8=",
|
||||
"lastModified": 1736476219,
|
||||
"narHash": "sha256-+qyv3QqdZCdZ3cSO/cbpEY6tntyYjfe1bB12mdpNFaY=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "eb64cbcc8eee0fa87ebded92805280d2ec97415a",
|
||||
"rev": "de30cc5963da22e9742bbbbb9a3344570ed237b9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -745,38 +410,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"snipe-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1736108869,
|
||||
"narHash": "sha256-sJ71eiE0XmMJkhNCkbY82R4eHzBOOKFrPa+nxLc1f8s=",
|
||||
"owner": "leath-dub",
|
||||
"repo": "snipe.nvim",
|
||||
"rev": "0d0a482ac713370196e4fc0025d5aaac5030104d",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "leath-dub",
|
||||
"repo": "snipe.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1689347925,
|
||||
"narHash": "sha256-ozenz5bFe1UUqOn7f60HRmgc01BgTGIKZ4Xl+HbocGQ=",
|
||||
@ -791,6 +425,21 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_2": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"systems_3": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
@ -806,187 +455,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"telescope-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1716532947,
|
||||
"narHash": "sha256-e1ulhc4IIvUgpjKQrSqPY4WpXuez6wlxL6Min9U0o5Q=",
|
||||
"owner": "nvim-telescope",
|
||||
"repo": "telescope.nvim",
|
||||
"rev": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nvim-telescope",
|
||||
"ref": "0.1.8",
|
||||
"repo": "telescope.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"telescope-project-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1733083023,
|
||||
"narHash": "sha256-qEORRWYKBpK7fn7se8g+5uuVBJNu0T4JHSc0C2QzNDY=",
|
||||
"owner": "nvim-telescope",
|
||||
"repo": "telescope-project.nvim",
|
||||
"rev": "1d7920e799fc5001dffc7bd10909a86e0358eaf4",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nvim-telescope",
|
||||
"repo": "telescope-project.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tiny-inline-diagnostic-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1738756980,
|
||||
"narHash": "sha256-M4CD2usIp6IR4EKdYvHxuf6kitE60/8RTS8F/5GRWT0=",
|
||||
"owner": "rachartier",
|
||||
"repo": "tiny-inline-diagnostic.nvim",
|
||||
"rev": "576351d53c1f6bda70252c3aaa710b01472024aa",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "rachartier",
|
||||
"repo": "tiny-inline-diagnostic.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"toggleterm-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1721232722,
|
||||
"narHash": "sha256-hJ6nBCgSyYF1pY4lX+b8WZd49i5F6BwOmrl7xVSIwRw=",
|
||||
"owner": "akinsho",
|
||||
"repo": "toggleterm.nvim",
|
||||
"rev": "48be57eaba817f038d61bbf64d2c597f578c0827",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "akinsho",
|
||||
"ref": "v2.12.0",
|
||||
"repo": "toggleterm.nvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-bash": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1738310128,
|
||||
"narHash": "sha256-ODWgFpCLLPgzNYXFhfAVvDXPr5bW8/49ezsaS9MOWMk=",
|
||||
"owner": "tree-sitter",
|
||||
"repo": "tree-sitter-bash",
|
||||
"rev": "0c46d792d54c536be5ff7eb18eb95c70fccdb232",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "tree-sitter",
|
||||
"ref": "master",
|
||||
"repo": "tree-sitter-bash",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-ini": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1725233451,
|
||||
"narHash": "sha256-G11Aynq2rnkRwdkhspjYqtBD/h5k4aD+NvuE0QfploU=",
|
||||
"owner": "justinmk",
|
||||
"repo": "tree-sitter-ini",
|
||||
"rev": "962568c9efa71d25720ab42c5d36e222626ef3a6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "justinmk",
|
||||
"repo": "tree-sitter-ini",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-lua": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1738303275,
|
||||
"narHash": "sha256-mE84uI5AKbLvX5CM7NvA59Z8Ux+QFdqVjZf4hi06NAM=",
|
||||
"owner": "MunifTanjim",
|
||||
"repo": "tree-sitter-lua",
|
||||
"rev": "68d29aa745b68ae22cbbdb5dcb68c20232521ff6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "MunifTanjim",
|
||||
"ref": "main",
|
||||
"repo": "tree-sitter-lua",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-puppet": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1734835631,
|
||||
"narHash": "sha256-bO5g5AdhzpB13yHklpAndUHIX7Rvd7OMjH0Ds2ATA6Q=",
|
||||
"owner": "amaanq",
|
||||
"repo": "tree-sitter-puppet",
|
||||
"rev": "15f192929b7d317f5914de2b4accd37b349182a6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "amaanq",
|
||||
"repo": "tree-sitter-puppet",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-python": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1738275152,
|
||||
"narHash": "sha256-t9etfZcrliF7f9hfiomh2U9P+3ufAm8iSK1y9rOhP7s=",
|
||||
"owner": "tree-sitter",
|
||||
"repo": "tree-sitter-python",
|
||||
"rev": "710796b8b877a970297106e5bbc8e2afa47f86ec",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "tree-sitter",
|
||||
"ref": "master",
|
||||
"repo": "tree-sitter-python",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-rasi": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1716296585,
|
||||
"narHash": "sha256-sPrIVgGGaBaXeqHNxjcdJ/S2FvxyV6rD9UPKU/tpspw=",
|
||||
"owner": "Fymyte",
|
||||
"repo": "tree-sitter-rasi",
|
||||
"rev": "6c9bbcfdf5f0f553d9ebc01750a3aa247a37b8aa",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Fymyte",
|
||||
"repo": "tree-sitter-rasi",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"tree-sitter-vimdoc": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1729686839,
|
||||
"narHash": "sha256-Vrl4/cZL+TWlUMEeWZoHCAWhvlefcl3ajGcwyTNKOhI=",
|
||||
"owner": "neovim",
|
||||
"repo": "tree-sitter-vimdoc",
|
||||
"rev": "d2e4b5c172a109966c2ce0378f73df6cede39400",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "neovim",
|
||||
"repo": "tree-sitter-vimdoc",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@ -1008,22 +476,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"wallpapers": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1657544922,
|
||||
"narHash": "sha256-1c1uDz37MhksWC75myv6jao5q2mIzD8X8I+TykXXmWg=",
|
||||
"owner": "exorcist365",
|
||||
"repo": "wallpapers",
|
||||
"rev": "8d2860ac6c05cec0f78d5c9d07510f4ff5da90dc",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"owner": "exorcist365",
|
||||
"repo": "wallpapers",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"wsl": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_2",
|
||||
@ -1032,11 +484,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1739577062,
|
||||
"narHash": "sha256-u/trdPzJO8UotNq48RbG7m6Pe8761IEMCOY0QidNjY4=",
|
||||
"lastModified": 1741870048,
|
||||
"narHash": "sha256-odXRdNZGdXg1LmwlAeWL85kgy/FVHsgKlDwrvbR2BsU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"rev": "0b2b8b31f69f24e9a75b4b18a32c771a48612d5e",
|
||||
"rev": "5d76001e33ee19644a598ad80e7318ab0957b122",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -1045,6 +497,28 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"zellij-switch": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"rust-overlay": "rust-overlay",
|
||||
"systems": "systems_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1737011317,
|
||||
"narHash": "sha256-A8VGuw/jIw+NCo5aCYy8MFrWpKzZLf77RApGGMzHxCY=",
|
||||
"owner": "mostafaqanbaryan",
|
||||
"repo": "zellij-switch",
|
||||
"rev": "15b02834c8be735fca0d9fb41f48709f97cc9afc",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "mostafaqanbaryan",
|
||||
"repo": "zellij-switch",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"zenyd-mpv-scripts": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
|
441
flake.nix
441
flake.nix
@ -1,5 +1,5 @@
|
||||
{
|
||||
description = "My system";
|
||||
description = "An opinionated flake containing the NixOS, nix-darwin, and home-manager configurations for multiple systems.";
|
||||
|
||||
# Other flakes that we want to pull from
|
||||
inputs = {
|
||||
@ -10,9 +10,6 @@
|
||||
# Used for specific stable packages
|
||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||
|
||||
# Used for caddy plugins
|
||||
nixpkgs-caddy.url = "github:jpds/nixpkgs/caddy-external-plugins";
|
||||
|
||||
# Used for MacOS system config
|
||||
darwin = {
|
||||
url = "github:lnl7/nix-darwin/master";
|
||||
@ -32,11 +29,8 @@
|
||||
};
|
||||
|
||||
# Community packages; used for Firefox extensions
|
||||
nur.url = "github:nix-community/nur";
|
||||
|
||||
# Use official Firefox binary for macOS
|
||||
firefox-darwin = {
|
||||
url = "github:bandithedoge/nixpkgs-firefox-darwin";
|
||||
nur = {
|
||||
url = "github:nix-community/nur";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
@ -52,12 +46,6 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Wallpapers
|
||||
wallpapers = {
|
||||
url = "gitlab:exorcist365/wallpapers";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Used to generate NixOS images for other platforms
|
||||
nixos-generators = {
|
||||
url = "github:nix-community/nixos-generators";
|
||||
@ -70,139 +58,18 @@
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Neovim plugins
|
||||
base16-nvim-src = {
|
||||
url = "github:RRethy/base16-nvim";
|
||||
flake = false;
|
||||
};
|
||||
nvim-lspconfig-src = {
|
||||
# https://github.com/neovim/nvim-lspconfig/tags
|
||||
url = "github:neovim/nvim-lspconfig/v0.1.8";
|
||||
flake = false;
|
||||
};
|
||||
cmp-nvim-lsp-src = {
|
||||
url = "github:hrsh7th/cmp-nvim-lsp";
|
||||
flake = false;
|
||||
};
|
||||
baleia-nvim-src = {
|
||||
# https://github.com/m00qek/baleia.nvim/tags
|
||||
url = "github:m00qek/baleia.nvim";
|
||||
flake = false;
|
||||
};
|
||||
nvim-treesitter-src = {
|
||||
# https://github.com/nvim-treesitter/nvim-treesitter/tags
|
||||
url = "github:nvim-treesitter/nvim-treesitter/v0.9.2";
|
||||
flake = false;
|
||||
};
|
||||
telescope-nvim-src = {
|
||||
# https://github.com/nvim-telescope/telescope.nvim/releases
|
||||
url = "github:nvim-telescope/telescope.nvim/0.1.8";
|
||||
flake = false;
|
||||
};
|
||||
telescope-project-nvim-src = {
|
||||
url = "github:nvim-telescope/telescope-project.nvim";
|
||||
flake = false;
|
||||
};
|
||||
toggleterm-nvim-src = {
|
||||
# https://github.com/akinsho/toggleterm.nvim/tags
|
||||
url = "github:akinsho/toggleterm.nvim/v2.12.0";
|
||||
flake = false;
|
||||
};
|
||||
bufferline-nvim-src = {
|
||||
# https://github.com/akinsho/bufferline.nvim/releases
|
||||
url = "github:akinsho/bufferline.nvim/v4.6.1";
|
||||
flake = false;
|
||||
};
|
||||
nvim-tree-lua-src = {
|
||||
url = "github:kyazdani42/nvim-tree.lua";
|
||||
flake = false;
|
||||
};
|
||||
hmts-nvim-src = {
|
||||
url = "github:calops/hmts.nvim";
|
||||
flake = false;
|
||||
};
|
||||
fidget-nvim-src = {
|
||||
# https://github.com/j-hui/fidget.nvim/tags
|
||||
url = "github:j-hui/fidget.nvim/v1.4.5";
|
||||
flake = false;
|
||||
};
|
||||
nvim-lint-src = {
|
||||
url = "github:mfussenegger/nvim-lint";
|
||||
flake = false;
|
||||
};
|
||||
tiny-inline-diagnostic-nvim-src = {
|
||||
url = "github:rachartier/tiny-inline-diagnostic.nvim";
|
||||
flake = false;
|
||||
};
|
||||
snipe-nvim-src = {
|
||||
url = "github:leath-dub/snipe.nvim";
|
||||
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;
|
||||
};
|
||||
|
||||
# Git alternative
|
||||
# Fixes: https://github.com/martinvonz/jj/issues/4784
|
||||
jujutsu = {
|
||||
url = "github:martinvonz/jj";
|
||||
# Zellij Switcher
|
||||
zellij-switch = {
|
||||
url = "github:mostafaqanbaryan/zellij-switch";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Ren and rep - CLI find and replace
|
||||
rep = {
|
||||
url = "github:robenkleene/rep-grep";
|
||||
flake = false;
|
||||
};
|
||||
ren = {
|
||||
url = "github:robenkleene/ren-find";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
gh-collaborators = {
|
||||
url = "github:katiem0/gh-collaborators";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Clipboard over SSH
|
||||
osc = {
|
||||
url = "github:theimpostor/osc/v0.4.6";
|
||||
flake = false;
|
||||
};
|
||||
|
||||
# Nextcloud Apps
|
||||
nextcloud-news = {
|
||||
# https://github.com/nextcloud/news/releases
|
||||
@ -232,199 +99,128 @@
|
||||
{ nixpkgs, ... }@inputs:
|
||||
|
||||
let
|
||||
|
||||
# Global configuration for my systems
|
||||
globals =
|
||||
hostnames =
|
||||
let
|
||||
baseName = "masu.rs";
|
||||
in
|
||||
rec {
|
||||
user = "noah";
|
||||
fullName = "Noah Masur";
|
||||
gitName = fullName;
|
||||
gitEmail = "7386960+nmasur@users.noreply.github.com";
|
||||
mail.server = "noahmasur.com";
|
||||
mail.imapHost = "imap.purelymail.com";
|
||||
mail.smtpHost = "smtp.purelymail.com";
|
||||
dotfilesRepo = "https://github.com/nmasur/dotfiles";
|
||||
hostnames = {
|
||||
audiobooks = "read.${baseName}";
|
||||
budget = "money.${baseName}";
|
||||
files = "files.${baseName}";
|
||||
git = "git.${baseName}";
|
||||
influxdb = "influxdb.${baseName}";
|
||||
irc = "irc.${baseName}";
|
||||
metrics = "metrics.${baseName}";
|
||||
minecraft = "minecraft.${baseName}";
|
||||
n8n = "n8n.${baseName}";
|
||||
notifications = "ntfy.${baseName}";
|
||||
prometheus = "prom.${baseName}";
|
||||
paperless = "paper.${baseName}";
|
||||
photos = "photos.${baseName}";
|
||||
secrets = "vault.${baseName}";
|
||||
stream = "stream.${baseName}";
|
||||
content = "cloud.${baseName}";
|
||||
books = "books.${baseName}";
|
||||
download = "download.${baseName}";
|
||||
status = "status.${baseName}";
|
||||
transmission = "transmission.${baseName}";
|
||||
};
|
||||
{
|
||||
audiobooks = "read.${baseName}";
|
||||
books = "books.${baseName}";
|
||||
budget = "money.${baseName}";
|
||||
content = "cloud.${baseName}";
|
||||
download = "download.${baseName}";
|
||||
files = "files.${baseName}";
|
||||
git = "git.${baseName}";
|
||||
imap = "imap.purelymail.com";
|
||||
influxdb = "influxdb.${baseName}";
|
||||
irc = "irc.${baseName}";
|
||||
mail = "noahmasur.com";
|
||||
metrics = "metrics.${baseName}";
|
||||
minecraft = "minecraft.${baseName}";
|
||||
n8n = "n8n.${baseName}";
|
||||
notifications = "ntfy.${baseName}";
|
||||
paperless = "paper.${baseName}";
|
||||
photos = "photos.${baseName}";
|
||||
prometheus = "prom.${baseName}";
|
||||
secrets = "vault.${baseName}";
|
||||
smtp = "smtp.purelymail.com";
|
||||
status = "status.${baseName}";
|
||||
stream = "stream.${baseName}";
|
||||
transmission = "transmission.${baseName}";
|
||||
};
|
||||
|
||||
# Common overlays to always use
|
||||
overlays = [
|
||||
inputs.nur.overlays.default
|
||||
inputs.nix2vim.overlay
|
||||
inputs.jujutsu.overlays.default # Fix: https://github.com/martinvonz/jj/issues/4784
|
||||
(import ./overlays/neovim-plugins.nix inputs)
|
||||
(import ./overlays/tree-sitter.nix inputs)
|
||||
(import ./overlays/mpv-scripts.nix inputs)
|
||||
(import ./overlays/nextcloud-apps.nix inputs)
|
||||
(import ./overlays/betterlockscreen.nix)
|
||||
(import ./overlays/gh-collaborators.nix inputs)
|
||||
(import ./overlays/osc.nix inputs)
|
||||
(import ./overlays/ren-rep.nix inputs)
|
||||
(import ./overlays/volnoti.nix)
|
||||
];
|
||||
|
||||
# System types to support.
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
in
|
||||
rec {
|
||||
|
||||
# Contains my full system builds, including home-manager
|
||||
# nixos-rebuild switch --flake .#tempest
|
||||
nixosConfigurations = {
|
||||
arrow = import ./hosts/arrow { inherit inputs globals overlays; };
|
||||
tempest = import ./hosts/tempest { inherit inputs globals overlays; };
|
||||
hydra = import ./hosts/hydra { inherit inputs globals overlays; };
|
||||
flame = import ./hosts/flame { inherit inputs globals overlays; };
|
||||
swan = import ./hosts/swan { inherit inputs globals overlays; };
|
||||
};
|
||||
lib = import ./lib inputs;
|
||||
|
||||
# Contains my full Mac system builds, including home-manager
|
||||
# darwin-rebuild switch --flake .#lookingglass
|
||||
darwinConfigurations = {
|
||||
lookingglass = import ./hosts/lookingglass { inherit inputs globals overlays; };
|
||||
};
|
||||
nixosConfigurations = builtins.mapAttrs (
|
||||
system: hosts:
|
||||
builtins.mapAttrs (
|
||||
name: module:
|
||||
lib.buildNixos {
|
||||
inherit system module;
|
||||
specialArgs = { inherit hostnames; };
|
||||
}
|
||||
) hosts
|
||||
) lib.linuxHosts;
|
||||
|
||||
# For quickly applying home-manager settings with:
|
||||
# home-manager switch --flake .#tempest
|
||||
homeConfigurations = {
|
||||
tempest = nixosConfigurations.tempest.config.home-manager.users.${globals.user}.home;
|
||||
lookingglass = darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home;
|
||||
};
|
||||
darwinConfigurations = builtins.mapAttrs (
|
||||
system: hosts:
|
||||
builtins.mapAttrs (
|
||||
name: module:
|
||||
lib.buildDarwin {
|
||||
inherit system module;
|
||||
specialArgs = { inherit hostnames; };
|
||||
}
|
||||
) hosts
|
||||
) lib.darwinHosts;
|
||||
|
||||
homeModules = builtins.mapAttrs (
|
||||
system: hosts:
|
||||
builtins.mapAttrs (
|
||||
name: module: (builtins.head (lib.attrsToList module.home-manager.users)).value
|
||||
) hosts
|
||||
) lib.hosts;
|
||||
|
||||
homeConfigurations = builtins.mapAttrs (
|
||||
system: hosts:
|
||||
builtins.mapAttrs (
|
||||
name: module:
|
||||
lib.buildHome {
|
||||
inherit system module;
|
||||
specialArgs = { inherit hostnames; };
|
||||
}
|
||||
) hosts
|
||||
) homeModules;
|
||||
|
||||
# Disk formatting, only used once
|
||||
diskoConfigurations = {
|
||||
root = import ./disks/root.nix;
|
||||
root = import ./hosts/x86_64-linux/swan/root.nix;
|
||||
};
|
||||
|
||||
packages =
|
||||
let
|
||||
staff =
|
||||
system:
|
||||
import ./hosts/staff {
|
||||
inherit
|
||||
inputs
|
||||
globals
|
||||
overlays
|
||||
system
|
||||
;
|
||||
};
|
||||
neovim =
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
in
|
||||
import ./modules/common/neovim/package {
|
||||
inherit pkgs;
|
||||
colors = (import ./colorscheme/gruvbox-dark).dark;
|
||||
};
|
||||
in
|
||||
{
|
||||
x86_64-linux.staff = staff "x86_64-linux";
|
||||
x86_64-linux.arrow = inputs.nixos-generators.nixosGenerate rec {
|
||||
system = "x86_64-linux";
|
||||
format = "iso";
|
||||
specialArgs = {
|
||||
pkgs-stable = import inputs.nixpkgs-stable { inherit system; };
|
||||
pkgs-caddy = import inputs.nixpkgs-caddy { inherit system; };
|
||||
};
|
||||
modules = import ./hosts/arrow/modules.nix { inherit inputs globals overlays; };
|
||||
};
|
||||
x86_64-linux.arrow-aws = inputs.nixos-generators.nixosGenerate rec {
|
||||
system = "x86_64-linux";
|
||||
generators = builtins.mapAttrs (
|
||||
system: hosts:
|
||||
builtins.mapAttrs (name: module: {
|
||||
aws = lib.generateImage {
|
||||
inherit system module;
|
||||
format = "amazon";
|
||||
specialArgs = {
|
||||
pkgs-stable = import inputs.nixpkgs-stable { inherit system; };
|
||||
pkgs-caddy = import inputs.nixpkgs-caddy { inherit system; };
|
||||
};
|
||||
modules = import ./hosts/arrow/modules.nix { inherit inputs globals overlays; } ++ [
|
||||
(
|
||||
{ ... }:
|
||||
{
|
||||
boot.kernelPackages = inputs.nixpkgs.legacyPackages.x86_64-linux.linuxKernel.packages.linux_6_6;
|
||||
amazonImage.sizeMB = 16 * 1024;
|
||||
permitRootLogin = "prohibit-password";
|
||||
boot.loader.systemd-boot.enable = inputs.nixpkgs.lib.mkForce false;
|
||||
boot.loader.efi.canTouchEfiVariables = inputs.nixpkgs.lib.mkForce false;
|
||||
services.amazon-ssm-agent.enable = true;
|
||||
users.users.ssm-user.extraGroups = [ "wheel" ];
|
||||
}
|
||||
)
|
||||
];
|
||||
specialArgs = { inherit hostnames; };
|
||||
};
|
||||
iso = lib.generateImage {
|
||||
inherit system module;
|
||||
format = "iso";
|
||||
specialArgs = { inherit hostnames; };
|
||||
};
|
||||
}) hosts
|
||||
) lib.linuxHosts;
|
||||
|
||||
# Package Neovim config into standalone package
|
||||
x86_64-linux.neovim = neovim "x86_64-linux";
|
||||
x86_64-darwin.neovim = neovim "x86_64-darwin";
|
||||
aarch64-linux.neovim = neovim "aarch64-linux";
|
||||
aarch64-darwin.neovim = neovim "aarch64-darwin";
|
||||
};
|
||||
|
||||
# Programs that can be run by calling this flake
|
||||
apps = forAllSystems (
|
||||
packages = lib.forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
in
|
||||
import ./apps { inherit pkgs; }
|
||||
# Get the configurations that we normally use
|
||||
{
|
||||
nixosConfigurations = nixosConfigurations.${system};
|
||||
darwinConfigurations = darwinConfigurations.${system};
|
||||
homeConfigurations = homeConfigurations.${system};
|
||||
generators = generators.${system};
|
||||
}
|
||||
//
|
||||
# Get the custom packages that I have placed under the nmasur namespace
|
||||
lib.pkgsBySystem.${system}.nmasur
|
||||
);
|
||||
|
||||
# Development environments
|
||||
devShells = forAllSystems (
|
||||
devShells = lib.forAllSystems (system: {
|
||||
default = lib.pkgsBySystem.${system}.nmasur.dotfiles-devshell;
|
||||
});
|
||||
|
||||
checks = lib.forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
in
|
||||
{
|
||||
|
||||
# Used to run commands and edit files in this repo
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
git
|
||||
stylua
|
||||
nixfmt-rfc-style
|
||||
shfmt
|
||||
shellcheck
|
||||
];
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = lib.overlays;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
checks = forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
in
|
||||
{
|
||||
neovim =
|
||||
@ -443,37 +239,18 @@
|
||||
}
|
||||
);
|
||||
|
||||
formatter = forAllSystems (
|
||||
formatter = lib.forAllSystems (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs { inherit system overlays; };
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
inherit (lib) overlays;
|
||||
};
|
||||
in
|
||||
pkgs.nixfmt-rfc-style
|
||||
);
|
||||
|
||||
# Templates for starting other projects quickly
|
||||
templates = rec {
|
||||
default = basic;
|
||||
basic = {
|
||||
path = ./templates/basic;
|
||||
description = "Basic program template";
|
||||
};
|
||||
poetry = {
|
||||
path = ./templates/poetry;
|
||||
description = "Poetry template";
|
||||
};
|
||||
python = {
|
||||
path = ./templates/python;
|
||||
description = "Legacy Python template";
|
||||
};
|
||||
haskell = {
|
||||
path = ./templates/haskell;
|
||||
description = "Haskell template";
|
||||
};
|
||||
rust = {
|
||||
path = ./templates/rust;
|
||||
description = "Rust template";
|
||||
};
|
||||
};
|
||||
templates = (import ./templates nixpkgs.lib);
|
||||
};
|
||||
}
|
||||
|
@ -1,26 +0,0 @@
|
||||
# Hosts
|
||||
|
||||
These are the individual machines managed by this flake.
|
||||
|
||||
| Host | Purpose |
|
||||
| --- | --- |
|
||||
| [aws](./aws/default.nix) | AWS AMI |
|
||||
| [staff](./staff/default.nix) | Live USB stick |
|
||||
| [flame](./flame/default.nix) | Oracle cloud server |
|
||||
| [hydra](./hydra/default.nix) | WSL config |
|
||||
| [lookingglass](./lookingglass/default.nix) | Work MacBook |
|
||||
| [swan](./swan/default.nix) | Home server |
|
||||
| [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.
|
40
hosts/aarch64-darwin/lookingglass/default.nix
Normal file
40
hosts/aarch64-darwin/lookingglass/default.nix
Normal file
@ -0,0 +1,40 @@
|
||||
# The Looking Glass
|
||||
# System configuration for my work Macbook
|
||||
|
||||
rec {
|
||||
networking.hostName = "NYCM-NMASUR2";
|
||||
networking.computerName = "NYCM-NMASUR2";
|
||||
|
||||
nmasur.settings = {
|
||||
username = "Noah.Masur";
|
||||
fullName = "Noah Masur";
|
||||
};
|
||||
|
||||
nmasur.profiles = {
|
||||
base.enable = true;
|
||||
work.enable = true;
|
||||
extra.enable = true;
|
||||
gaming.enable = true;
|
||||
};
|
||||
|
||||
home-manager.users."Noah.Masur" = {
|
||||
nmasur.settings = {
|
||||
username = nmasur.settings.username;
|
||||
fullName = nmasur.settings.fullName;
|
||||
};
|
||||
nmasur.profiles = {
|
||||
common.enable = true;
|
||||
darwin-base.enable = true;
|
||||
power-user.enable = true;
|
||||
work.enable = true;
|
||||
experimental.enable = true;
|
||||
};
|
||||
nmasur.presets.programs.git-work.work = {
|
||||
name = "Noah-Masur_1701";
|
||||
email = "${nmasur.settings.username}@take2games.com";
|
||||
};
|
||||
home.stateVersion = "23.05";
|
||||
};
|
||||
|
||||
system.stateVersion = 5;
|
||||
}
|
59
hosts/aarch64-linux/flame/default.nix
Normal file
59
hosts/aarch64-linux/flame/default.nix
Normal file
@ -0,0 +1,59 @@
|
||||
# The Flame
|
||||
# System configuration for an Oracle free server
|
||||
|
||||
# How to install:
|
||||
# https://blog.korfuri.fr/posts/2022/08/nixos-on-an-oracle-free-tier-ampere-machine/
|
||||
# These days, probably use nixos-anywhere instead.
|
||||
|
||||
rec {
|
||||
networking.hostName = "flame";
|
||||
|
||||
nmasur.settings = {
|
||||
username = "noah";
|
||||
fullName = "Noah Masur";
|
||||
};
|
||||
|
||||
nmasur.profiles = {
|
||||
base.enable = true;
|
||||
server.enable = true;
|
||||
communications.enable = true;
|
||||
};
|
||||
|
||||
home-manager.users."noah" = {
|
||||
nmasur.settings = {
|
||||
username = nmasur.settings.username;
|
||||
fullName = nmasur.settings.fullName;
|
||||
};
|
||||
nmasur.profiles = {
|
||||
common.enable = true;
|
||||
linux-base.enable = true;
|
||||
power-user.enable = true;
|
||||
};
|
||||
home.stateVersion = "23.05";
|
||||
};
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
# 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."/" = {
|
||||
device = "/dev/disk/by-uuid/e1b6bd50-306d-429a-9f45-78f57bc597c3";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# This is the boot filesystem for systemd-boot
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/D5CA-237A";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
# Allows private remote access over the internet
|
||||
nmasur.presets.services.cloudflared = {
|
||||
tunnel = {
|
||||
id = "bd250ee1-ed2e-42d2-b627-039f1eb5a4d2";
|
||||
credentialsFile = ./cloudflared-flame.age;
|
||||
ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK/6oyVqjFGX3Uvrc3VS8J9sphxzAnRzKC85xgkHfYgR3TK6qBGXzHrknEj21xeZrr3G2y1UsGzphWJd9ZfIcdA= open-ssh-ca@cloudflareaccess.org";
|
||||
};
|
||||
};
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
# The Arrow
|
||||
# System configuration for temporary VM
|
||||
|
||||
{
|
||||
inputs,
|
||||
globals,
|
||||
overlays,
|
||||
...
|
||||
}:
|
||||
|
||||
inputs.nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
pkgs-caddy = import inputs.nixpkgs-caddy { inherit system; };
|
||||
};
|
||||
modules = import ./modules.nix { inherit inputs globals overlays; } ++ [
|
||||
{
|
||||
# This is the root filesystem containing NixOS
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# This is the boot filesystem for Grub
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
virtualisation.vmVariant = {
|
||||
virtualisation.forwardPorts = [
|
||||
{
|
||||
from = "host";
|
||||
host.port = 2222;
|
||||
guest.port = 22;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
{
|
||||
inputs,
|
||||
globals,
|
||||
overlays,
|
||||
}:
|
||||
|
||||
[
|
||||
globals
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
nixpkgs.overlays = overlays;
|
||||
networking.hostName = "arrow";
|
||||
physical = false;
|
||||
server = true;
|
||||
gui.enable = false;
|
||||
theme.colors = (import ../../colorscheme/gruvbox).dark;
|
||||
publicKeys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKpPU2G9rSF8Q6waH62IJexDCQ6lY+8ZyVufGE3xMDGw deploy"
|
||||
];
|
||||
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
||||
cloudflare.enable = true;
|
||||
services.openssh.enable = true;
|
||||
services.caddy.enable = true;
|
||||
services.n8n.enable = true;
|
||||
|
||||
# nix-index seems to eat up too much memory for Vultr
|
||||
home-manager.users.${globals.user}.programs.nix-index.enable = inputs.nixpkgs.lib.mkForce false;
|
||||
}
|
||||
../../modules/common
|
||||
../../modules/nixos
|
||||
]
|
47
hosts/default.nix
Normal file
47
hosts/default.nix
Normal file
@ -0,0 +1,47 @@
|
||||
# Return a list of all hosts
|
||||
|
||||
nixpkgs:
|
||||
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
in
|
||||
|
||||
{
|
||||
# darwin-hosts = import ./darwin;
|
||||
aarch64-darwin-hosts = lib.pipe (lib.filesystem.listFilesRecursive ./aarch64-darwin) [
|
||||
# Get only files ending in default.nix
|
||||
(builtins.filter (name: lib.hasSuffix "default.nix" name))
|
||||
# Import each host function
|
||||
(map (file: {
|
||||
name = builtins.baseNameOf (builtins.dirOf file);
|
||||
value = import file;
|
||||
}))
|
||||
# Convert to an attrset of hostname -> host function
|
||||
(builtins.listToAttrs)
|
||||
];
|
||||
aarch64-linux-hosts = lib.pipe (lib.filesystem.listFilesRecursive ./aarch64-linux) [
|
||||
# Get only files ending in default.nix
|
||||
(builtins.filter (name: lib.hasSuffix "default.nix" name))
|
||||
# Remove the first file
|
||||
(builtins.filter (name: name != ./aarch64-linux/default.nix))
|
||||
# Import each host function
|
||||
(map (file: {
|
||||
name = builtins.baseNameOf (builtins.dirOf file);
|
||||
value = import file;
|
||||
}))
|
||||
# Convert to an attrset of hostname -> host function
|
||||
(builtins.listToAttrs)
|
||||
];
|
||||
x86_64-linux-hosts = lib.pipe (lib.filesystem.listFilesRecursive ./x86_64-linux) [
|
||||
# Get only files ending in default.nix
|
||||
(builtins.filter (name: lib.hasSuffix "default.nix" name))
|
||||
# Import each host function
|
||||
(map (file: {
|
||||
# name = lib.removeSuffix ".nix" (builtins.baseNameOf file);
|
||||
name = builtins.baseNameOf (builtins.dirOf file);
|
||||
value = import file;
|
||||
}))
|
||||
# Convert to an attrset of hostname -> host function
|
||||
(builtins.listToAttrs)
|
||||
];
|
||||
}
|
@ -1,141 +0,0 @@
|
||||
# The Flame
|
||||
# System configuration for an Oracle free server
|
||||
|
||||
# See [readme](../README.md) to explain how this file works.
|
||||
|
||||
# How to install:
|
||||
# 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,
|
||||
...
|
||||
}:
|
||||
|
||||
inputs.nixpkgs.lib.nixosSystem rec {
|
||||
system = "aarch64-linux";
|
||||
specialArgs = {
|
||||
pkgs-stable = import inputs.nixpkgs-stable { inherit system; };
|
||||
pkgs-caddy = import inputs.nixpkgs-caddy { inherit system; };
|
||||
};
|
||||
modules = [
|
||||
globals
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
../../modules/common
|
||||
../../modules/nixos
|
||||
{
|
||||
nixpkgs.overlays = overlays;
|
||||
|
||||
# Hardware
|
||||
server = true;
|
||||
networking.hostName = "flame";
|
||||
|
||||
# Not sure what's necessary but too afraid to remove anything
|
||||
imports = [ (inputs.nixpkgs + "/nixos/modules/profiles/qemu-guest.nix") ];
|
||||
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."/" = {
|
||||
device = "/dev/disk/by-uuid/e1b6bd50-306d-429a-9f45-78f57bc597c3";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# This is the boot filesystem for systemd-boot
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/D5CA-237A";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
# Theming
|
||||
|
||||
# Server doesn't require GUI
|
||||
gui.enable = false;
|
||||
|
||||
# Still require colors for programs like Neovim, K9S
|
||||
theme = {
|
||||
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
||||
};
|
||||
|
||||
# Programs and services
|
||||
atuin.enable = true;
|
||||
cloudflare.enable = true; # Proxy traffic with Cloudflare
|
||||
dotfiles.enable = true; # Clone dotfiles
|
||||
neovim.enable = true;
|
||||
giteaRunner.enable = true;
|
||||
services.actualbudget.enable = true;
|
||||
services.caddy.enable = true;
|
||||
services.grafana.enable = true;
|
||||
services.thelounge.enable = true;
|
||||
services.openssh.enable = true;
|
||||
services.victoriametrics.enable = true;
|
||||
services.influxdb2.enable = true;
|
||||
services.gitea.enable = true;
|
||||
services.vaultwarden.enable = true;
|
||||
services.minecraft-server.enable = true; # Setup Minecraft server
|
||||
services.n8n.enable = true;
|
||||
services.ntfy-sh.enable = true;
|
||||
services.postgresql.enable = true;
|
||||
services.uptime-kuma.enable = true;
|
||||
system.autoUpgrade.enable = true;
|
||||
|
||||
# Allows private remote access over the internet
|
||||
cloudflareTunnel = {
|
||||
enable = true;
|
||||
id = "bd250ee1-ed2e-42d2-b627-039f1eb5a4d2";
|
||||
credentialsFile = ../../private/cloudflared-flame.age;
|
||||
ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK/6oyVqjFGX3Uvrc3VS8J9sphxzAnRzKC85xgkHfYgR3TK6qBGXzHrknEj21xeZrr3G2y1UsGzphWJd9ZfIcdA= open-ssh-ca@cloudflareaccess.org";
|
||||
};
|
||||
|
||||
# Nextcloud backup config
|
||||
backup.s3 = {
|
||||
endpoint = "s3.us-west-002.backblazeb2.com";
|
||||
bucket = "noahmasur-backup";
|
||||
accessKeyId = "0026b0e73b2e2c80000000005";
|
||||
resticBucket = "noahmasur-restic";
|
||||
};
|
||||
|
||||
# Disable passwords, only use SSH key
|
||||
publicKeys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal"
|
||||
];
|
||||
|
||||
# # Wireguard config for Transmission
|
||||
# wireguard.enable = true;
|
||||
# networking.wireguard.interfaces.wg0 = {
|
||||
#
|
||||
# # The local IPs for this machine within the Wireguard network
|
||||
# # Any inbound traffic bound for these IPs should be kept on localhost
|
||||
# ips = [ "10.66.13.200/32" "fc00:bbbb:bbbb:bb01::3:dc7/128" ];
|
||||
#
|
||||
# peers = [{
|
||||
#
|
||||
# # Identity of Wireguard target peer (VPN)
|
||||
# publicKey = "bOOP5lIjqCdDx5t+mP/kEcSbHS4cZqE0rMlBI178lyY=";
|
||||
#
|
||||
# # The public internet address of the target peer
|
||||
# endpoint = "86.106.143.132:51820";
|
||||
#
|
||||
# # Which outgoing IP ranges should be sent through Wireguard
|
||||
# allowedIPs = [ "0.0.0.0/0" "::0/0" ];
|
||||
#
|
||||
# # Send heartbeat signal within the network
|
||||
# persistentKeepalive = 25;
|
||||
#
|
||||
# }];
|
||||
#
|
||||
# };
|
||||
|
||||
# # VPN port forwarding
|
||||
# services.transmission.settings.peer-port = 57599;
|
||||
}
|
||||
];
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
# The Hydra
|
||||
# System configuration for WSL
|
||||
|
||||
# See [readme](../README.md) to explain how this file works.
|
||||
|
||||
{
|
||||
inputs,
|
||||
globals,
|
||||
overlays,
|
||||
...
|
||||
}:
|
||||
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = { };
|
||||
modules = [
|
||||
../../modules/common
|
||||
../../modules/nixos
|
||||
../../modules/wsl
|
||||
globals
|
||||
inputs.wsl.nixosModules.wsl
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
networking.hostName = "hydra";
|
||||
nixpkgs.overlays = overlays;
|
||||
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
||||
gui.enable = false;
|
||||
theme = {
|
||||
colors = (import ../../colorscheme/gruvbox).dark;
|
||||
dark = true;
|
||||
};
|
||||
passwordHash = inputs.nixpkgs.lib.fileContents ../../misc/password.sha512;
|
||||
wsl = {
|
||||
enable = true;
|
||||
wslConf.automount.root = "/mnt";
|
||||
defaultUser = globals.user;
|
||||
startMenuLaunchers = true;
|
||||
nativeSystemd = true;
|
||||
wslConf.network.generateResolvConf = true; # Turn off if it breaks VPN
|
||||
interop.includePath = false; # Including Windows PATH will slow down Neovim command mode
|
||||
};
|
||||
|
||||
neovim.enable = true;
|
||||
mail.enable = true;
|
||||
mail.aerc.enable = true;
|
||||
mail.himalaya.enable = true;
|
||||
dotfiles.enable = true;
|
||||
lua.enable = true;
|
||||
}
|
||||
];
|
||||
}
|
@ -1,60 +0,0 @@
|
||||
# The Looking Glass
|
||||
# System configuration for my work Macbook
|
||||
|
||||
{
|
||||
inputs,
|
||||
globals,
|
||||
overlays,
|
||||
...
|
||||
}:
|
||||
|
||||
inputs.darwin.lib.darwinSystem {
|
||||
system = "aarch64-darwin";
|
||||
specialArgs = { };
|
||||
modules = [
|
||||
../../modules/common
|
||||
../../modules/darwin
|
||||
(
|
||||
globals
|
||||
// rec {
|
||||
user = "Noah.Masur";
|
||||
gitName = "Noah-Masur_1701";
|
||||
gitEmail = "${user}@take2games.com";
|
||||
}
|
||||
)
|
||||
inputs.home-manager.darwinModules.home-manager
|
||||
inputs.mac-app-util.darwinModules.default
|
||||
{
|
||||
nixpkgs.overlays = [ inputs.firefox-darwin.overlay ] ++ overlays;
|
||||
networking.hostName = "NYCM-NMASUR2";
|
||||
networking.computerName = "NYCM-NMASUR2";
|
||||
identityFile = "/Users/Noah.Masur/.ssh/id_ed25519";
|
||||
gui.enable = true;
|
||||
theme = {
|
||||
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
||||
dark = true;
|
||||
};
|
||||
mail.user = globals.user;
|
||||
atuin.enable = true;
|
||||
charm.enable = true;
|
||||
neovim.enable = true;
|
||||
mail.enable = true;
|
||||
mail.aerc.enable = true;
|
||||
mail.himalaya.enable = false;
|
||||
kitty.enable = true;
|
||||
discord.enable = true;
|
||||
firefox.enable = true;
|
||||
dotfiles.enable = true;
|
||||
terraform.enable = true;
|
||||
python.enable = true;
|
||||
rust.enable = true;
|
||||
lua.enable = true;
|
||||
obsidian.enable = true;
|
||||
kubernetes.enable = true;
|
||||
_1password.enable = true;
|
||||
slack.enable = true;
|
||||
wezterm.enable = true;
|
||||
yt-dlp.enable = true;
|
||||
}
|
||||
];
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
# The Staff
|
||||
# ISO configuration for my USB drive
|
||||
|
||||
{
|
||||
inputs,
|
||||
system,
|
||||
overlays,
|
||||
...
|
||||
}:
|
||||
|
||||
inputs.nixos-generators.nixosGenerate {
|
||||
inherit system;
|
||||
format = "install-iso";
|
||||
modules = [
|
||||
{
|
||||
nixpkgs.overlays = overlays;
|
||||
networking.hostName = "staff";
|
||||
users.extraUsers.root.openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"
|
||||
];
|
||||
services.openssh = {
|
||||
enable = true;
|
||||
ports = [ 22 ];
|
||||
allowSFTP = true;
|
||||
settings = {
|
||||
GatewayPorts = "no";
|
||||
X11Forwarding = false;
|
||||
PasswordAuthentication = false;
|
||||
PermitRootLogin = "yes";
|
||||
};
|
||||
};
|
||||
environment.systemPackages =
|
||||
let
|
||||
pkgs = import inputs.nixpkgs { inherit system overlays; };
|
||||
in
|
||||
with pkgs;
|
||||
[
|
||||
git
|
||||
vim
|
||||
wget
|
||||
curl
|
||||
(import ../../modules/common/neovim/package {
|
||||
inherit pkgs;
|
||||
colors = (import ../../colorscheme/gruvbox).dark;
|
||||
})
|
||||
];
|
||||
nix.extraOptions = ''
|
||||
experimental-features = nix-command flakes
|
||||
warn-dirty = false
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
@ -1,146 +0,0 @@
|
||||
# The Swan
|
||||
# System configuration for my home NAS server
|
||||
|
||||
{
|
||||
inputs,
|
||||
globals,
|
||||
overlays,
|
||||
...
|
||||
}:
|
||||
|
||||
inputs.nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
pkgs-stable = import inputs.nixpkgs-stable { inherit system; };
|
||||
pkgs-caddy = import inputs.nixpkgs-caddy { inherit system; };
|
||||
};
|
||||
modules = [
|
||||
globals
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.disko.nixosModules.disko
|
||||
../../modules/common
|
||||
../../modules/nixos
|
||||
{
|
||||
nixpkgs.overlays = overlays;
|
||||
|
||||
# Hardware
|
||||
server = true;
|
||||
physical = true;
|
||||
networking.hostName = "swan";
|
||||
|
||||
# Not sure what's necessary but too afraid to remove anything
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"nvme"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
|
||||
# Required for transcoding
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelParams = [
|
||||
"radeon.si_support=0"
|
||||
"amdgpu.si_support=1"
|
||||
"radeon.cik_support=0"
|
||||
"amdgpu.cik_support=1"
|
||||
"amdgpu.dc=1"
|
||||
];
|
||||
|
||||
# Required binary blobs to boot on this machine
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
# Prioritize efficiency over performance
|
||||
powerManagement.cpuFreqGovernor = "powersave";
|
||||
|
||||
# Allow firmware updates
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
# ZFS
|
||||
zfs.enable = true;
|
||||
# Generated with: head -c 8 /etc/machine-id
|
||||
networking.hostId = "600279f4"; # Random ID required for ZFS
|
||||
|
||||
# Sets root ext4 filesystem instead of declaring it manually
|
||||
disko = {
|
||||
enableConfig = true;
|
||||
devices = (import ../../disks/root.nix { disk = "/dev/nvme0n1"; });
|
||||
};
|
||||
|
||||
zramSwap.enable = true;
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/swapfile";
|
||||
size = 4 * 1024; # 4 GB
|
||||
}
|
||||
];
|
||||
|
||||
boot.zfs = {
|
||||
# Automatically load the ZFS pool on boot
|
||||
extraPools = [ "tank" ];
|
||||
# Only try to decrypt datasets with keyfiles
|
||||
requestEncryptionCredentials = [
|
||||
"tank/archive"
|
||||
"tank/generic"
|
||||
"tank/nextcloud"
|
||||
"tank/generic/git"
|
||||
];
|
||||
# If password is requested and fails, continue to boot eventually
|
||||
passwordTimeout = 300;
|
||||
};
|
||||
|
||||
# Theming
|
||||
|
||||
# Server doesn't require GUI
|
||||
gui.enable = false;
|
||||
|
||||
# Still require colors for programs like Neovim, K9S
|
||||
theme = {
|
||||
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
||||
};
|
||||
|
||||
# Programs and services
|
||||
atuin.enable = true;
|
||||
neovim.enable = true;
|
||||
cloudflare.enable = true;
|
||||
dotfiles.enable = true;
|
||||
arrs.enable = true;
|
||||
filebrowser.enable = true;
|
||||
services.audiobookshelf.enable = true;
|
||||
services.bind.enable = true;
|
||||
services.caddy.enable = true;
|
||||
services.immich.enable = true;
|
||||
services.jellyfin.enable = true;
|
||||
services.nextcloud.enable = true;
|
||||
services.calibre-web.enable = true;
|
||||
services.openssh.enable = true;
|
||||
services.prometheus.enable = false;
|
||||
services.vmagent.enable = true;
|
||||
services.samba.enable = true;
|
||||
services.paperless.enable = true;
|
||||
services.postgresql.enable = true;
|
||||
system.autoUpgrade.enable = false;
|
||||
|
||||
# Allows private remote access over the internet
|
||||
cloudflareTunnel = {
|
||||
enable = true;
|
||||
id = "646754ac-2149-4a58-b51a-e1d0a1f3ade2";
|
||||
credentialsFile = ../../private/cloudflared-swan.age;
|
||||
ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCHF/UMtJqPFrf6f6GRY0ZFnkCW7b6sYgUTjTtNfRj1RdmNic1NoJZql7y6BrqQinZvy7nsr1UFDNWoHn6ah3tg= open-ssh-ca@cloudflareaccess.org";
|
||||
};
|
||||
|
||||
# Send regular backups and litestream for DBs to an S3-like bucket
|
||||
backup.s3 = {
|
||||
endpoint = "s3.us-west-002.backblazeb2.com";
|
||||
bucket = "noahmasur-backup";
|
||||
accessKeyId = "0026b0e73b2e2c80000000005";
|
||||
resticBucket = "noahmasur-restic";
|
||||
};
|
||||
|
||||
# Disable passwords, only use SSH key
|
||||
publicKeys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s personal"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
@ -1,153 +0,0 @@
|
||||
# The Tempest
|
||||
# System configuration for my desktop
|
||||
|
||||
{
|
||||
inputs,
|
||||
globals,
|
||||
overlays,
|
||||
...
|
||||
}:
|
||||
|
||||
inputs.nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = {
|
||||
pkgs-stable = import inputs.nixpkgs-stable { inherit system; };
|
||||
pkgs-caddy = import inputs.nixpkgs-caddy { inherit system; };
|
||||
};
|
||||
modules = [
|
||||
globals
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
../../modules/common
|
||||
../../modules/nixos
|
||||
{
|
||||
nixpkgs.overlays = overlays;
|
||||
|
||||
# Hardware
|
||||
physical = true;
|
||||
networking.hostName = "tempest";
|
||||
|
||||
# Not sure what's necessary but too afraid to remove anything
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usb_storage"
|
||||
"usbhid"
|
||||
"sd_mod"
|
||||
];
|
||||
|
||||
# Graphics and VMs
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
|
||||
# I don't think I need this?
|
||||
# boot.kernelParams = [
|
||||
# "video=DP-0:2560x1440@165"
|
||||
# "video=DP-1:1920x1080@60"
|
||||
# ];
|
||||
|
||||
# Required binary blobs to boot on this machine
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
# Prioritize performance over efficiency
|
||||
powerManagement.cpuFreqGovernor = "performance";
|
||||
|
||||
# Allow firmware updates
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
|
||||
# Helps reduce GPU fan noise under idle loads
|
||||
hardware.fancontrol.enable = true;
|
||||
hardware.fancontrol.config = ''
|
||||
# Configuration file generated by pwmconfig, changes will be lost
|
||||
INTERVAL=10
|
||||
DEVPATH=hwmon0=devices/pci0000:00/0000:00:03.1/0000:06:00.0/0000:07:00.0/0000:08:00.0
|
||||
DEVNAME=hwmon0=amdgpu
|
||||
FCTEMPS=hwmon0/pwm1=hwmon0/temp1_input
|
||||
FCFANS= hwmon0/pwm1=hwmon0/fan1_input
|
||||
MINTEMP=hwmon0/pwm1=50
|
||||
MAXTEMP=hwmon0/pwm1=70
|
||||
MINSTART=hwmon0/pwm1=100
|
||||
MINSTOP=hwmon0/pwm1=10
|
||||
MINPWM=hwmon0/pwm1=10
|
||||
MAXPWM=hwmon0/pwm1=240
|
||||
'';
|
||||
|
||||
# File systems must be declared in order to boot
|
||||
|
||||
# This is the root filesystem containing NixOS
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# This is the boot filesystem for Grub
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
# Secrets must be prepared ahead before deploying
|
||||
passwordHash = inputs.nixpkgs.lib.fileContents ../../misc/password.sha512;
|
||||
|
||||
# Theming
|
||||
|
||||
# Turn on all features related to desktop and graphical applications
|
||||
gui.enable = true;
|
||||
|
||||
# Set the system-wide theme, also used for non-graphical programs
|
||||
theme = {
|
||||
colors = (import ../../colorscheme/gruvbox-dark).dark;
|
||||
dark = true;
|
||||
};
|
||||
wallpaper = "${inputs.wallpapers}/gruvbox/road.jpg";
|
||||
gtk.theme.name = inputs.nixpkgs.lib.mkDefault "Adwaita-dark";
|
||||
|
||||
# Programs and services
|
||||
atuin.enable = true;
|
||||
charm.enable = true;
|
||||
neovim.enable = true;
|
||||
media.enable = true;
|
||||
dotfiles.enable = true;
|
||||
firefox.enable = true;
|
||||
kitty.enable = true;
|
||||
_1password.enable = true;
|
||||
discord.enable = true;
|
||||
nautilus.enable = true;
|
||||
obsidian.enable = true;
|
||||
mail.enable = true;
|
||||
mail.aerc.enable = true;
|
||||
mail.himalaya.enable = true;
|
||||
keybase.enable = true;
|
||||
mullvad.enable = false;
|
||||
rust.enable = true;
|
||||
terraform.enable = true;
|
||||
wezterm.enable = true;
|
||||
yt-dlp.enable = true;
|
||||
gaming = {
|
||||
dwarf-fortress.enable = true;
|
||||
enable = true;
|
||||
steam.enable = true;
|
||||
moonlight.enable = true;
|
||||
legendary.enable = true;
|
||||
lutris.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 = {
|
||||
enable = true;
|
||||
id = "ac133a82-31fb-480c-942a-cdbcd4c58173";
|
||||
credentialsFile = ../../private/cloudflared-tempest.age;
|
||||
ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPY6C0HmdFCaxYtJxFr3qV4/1X4Q8KrYQ1hlme3u1hJXK+xW+lc9Y9glWHrhiTKilB7carYTB80US0O47gI5yU4= open-ssh-ca@cloudflareaccess.org";
|
||||
};
|
||||
|
||||
# Allows requests to force machine to wake up
|
||||
# This network interface might change, needs to be set specifically for each machine.
|
||||
# Or set usePredictableInterfaceNames = false
|
||||
networking.interfaces.enp5s0.wakeOnLan.enable = true;
|
||||
}
|
||||
];
|
||||
}
|
32
hosts/x86_64-linux/arrow/default.nix
Normal file
32
hosts/x86_64-linux/arrow/default.nix
Normal file
@ -0,0 +1,32 @@
|
||||
# The Arrow
|
||||
# System configuration for temporary VM
|
||||
|
||||
rec {
|
||||
# Hardware
|
||||
networking.hostName = "arrow";
|
||||
|
||||
nmasur.settings = {
|
||||
username = "noah";
|
||||
fullName = "Noah Masur";
|
||||
};
|
||||
|
||||
nmasur.profiles = {
|
||||
base.enable = true;
|
||||
server.enable = true;
|
||||
};
|
||||
|
||||
home-manager.users."noah" = {
|
||||
nmasur.settings = {
|
||||
username = nmasur.settings.username;
|
||||
fullName = nmasur.settings.fullName;
|
||||
};
|
||||
nmasur.profiles = {
|
||||
common.enable = true;
|
||||
linux-base.enable = true;
|
||||
};
|
||||
home.stateVersion = "23.05";
|
||||
};
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
|
||||
}
|
33
hosts/x86_64-linux/hydra/default.nix
Normal file
33
hosts/x86_64-linux/hydra/default.nix
Normal file
@ -0,0 +1,33 @@
|
||||
# The Hydra
|
||||
# System configuration for WSL
|
||||
|
||||
rec {
|
||||
# Hardware
|
||||
networking.hostName = "hydra";
|
||||
|
||||
nmasur.settings = {
|
||||
username = "noah";
|
||||
fullName = "Noah Masur";
|
||||
};
|
||||
|
||||
nmasur.profiles = {
|
||||
base.enable = true;
|
||||
wsl.enable = true;
|
||||
};
|
||||
|
||||
home-manager.users."noah" = {
|
||||
nmasur.settings = {
|
||||
username = nmasur.settings.username;
|
||||
fullName = nmasur.settings.fullName;
|
||||
};
|
||||
nmasur.profiles = {
|
||||
common.enable = true;
|
||||
linux-base.enable = true;
|
||||
power-user.enable = true;
|
||||
};
|
||||
home.stateVersion = "23.05";
|
||||
};
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
|
||||
}
|
64
hosts/x86_64-linux/staff/default.nix
Normal file
64
hosts/x86_64-linux/staff/default.nix
Normal file
@ -0,0 +1,64 @@
|
||||
# The Staff
|
||||
# System configuration test
|
||||
|
||||
rec {
|
||||
# Hardware
|
||||
networking.hostName = "staff";
|
||||
|
||||
nmasur.settings = {
|
||||
username = "noah";
|
||||
fullName = "Noah Masur";
|
||||
};
|
||||
|
||||
nmasur.profiles = {
|
||||
base.enable = true;
|
||||
home.enable = true;
|
||||
gui.enable = true;
|
||||
};
|
||||
nmasur.presets.services.cloudflared.enable = false;
|
||||
nmasur.presets.services.kanata.enable = false;
|
||||
nmasur.presets.services.openssh.enable = true;
|
||||
|
||||
home-manager.users."noah" = {
|
||||
nmasur.settings = {
|
||||
username = nmasur.settings.username;
|
||||
fullName = nmasur.settings.fullName;
|
||||
};
|
||||
nmasur.profiles = {
|
||||
common.enable = true;
|
||||
linux-base.enable = true;
|
||||
linux-gui.enable = true;
|
||||
power-user.enable = true;
|
||||
};
|
||||
nmasur.presets.services.mbsync = {
|
||||
user = nmasur.settings.username;
|
||||
server = "noahmasur.com";
|
||||
};
|
||||
home.stateVersion = "23.05";
|
||||
};
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
# Not sure what's necessary but too afraid to remove anything
|
||||
# File systems must be declared in order to boot
|
||||
|
||||
# This is the root filesystem containing NixOS
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# This is the boot filesystem for Grub
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
# Allows private remote access over the internet
|
||||
# nmasur.presets.services.cloudflared = {
|
||||
# tunnel = {
|
||||
# id = "ac133a82-31fb-480c-942a-cdbcd4c58173";
|
||||
# credentialsFile = ../../private/cloudflared-tempest.age;
|
||||
# ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPY6C0HmdFCaxYtJxFr3qV4/1X4Q8KrYQ1hlme3u1hJXK+xW+lc9Y9glWHrhiTKilB7carYTB80US0O47gI5yU4= open-ssh-ca@cloudflareaccess.org";
|
||||
# };
|
||||
# };
|
||||
}
|
81
hosts/x86_64-linux/swan/default.nix
Normal file
81
hosts/x86_64-linux/swan/default.nix
Normal file
@ -0,0 +1,81 @@
|
||||
# The Swan
|
||||
# System configuration for my home NAS server
|
||||
|
||||
rec {
|
||||
networking.hostName = "swan";
|
||||
|
||||
nmasur.settings = {
|
||||
username = "noah";
|
||||
fullName = "Noah Masur";
|
||||
};
|
||||
|
||||
nmasur.profiles = {
|
||||
base.enable = true;
|
||||
server.enable = true;
|
||||
home.enable = true;
|
||||
nas.enable = true;
|
||||
shared-media.enable = true;
|
||||
};
|
||||
|
||||
home-manager.users."noah" = {
|
||||
nmasur.settings = {
|
||||
username = nmasur.settings.username;
|
||||
fullName = nmasur.settings.fullName;
|
||||
};
|
||||
nmasur.profiles = {
|
||||
common.enable = true;
|
||||
linux-base.enable = true;
|
||||
power-user.enable = true;
|
||||
};
|
||||
home.stateVersion = "23.05";
|
||||
};
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
|
||||
# Not sure what's necessary but too afraid to remove anything
|
||||
boot.initrd.availableKernelModules = [
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"nvme"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
];
|
||||
|
||||
# Required for transcoding
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelParams = [
|
||||
"radeon.si_support=0"
|
||||
"amdgpu.si_support=1"
|
||||
"radeon.cik_support=0"
|
||||
"amdgpu.cik_support=1"
|
||||
"amdgpu.dc=1"
|
||||
];
|
||||
|
||||
# Required binary blobs to boot on this machine
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
# Prioritize efficiency over performance
|
||||
powerManagement.cpuFreqGovernor = "powersave";
|
||||
|
||||
# Allow firmware updates
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
# ZFS
|
||||
# Generated with: head -c 8 /etc/machine-id
|
||||
networking.hostId = "600279f4"; # Random ID required for ZFS
|
||||
|
||||
# Sets root ext4 filesystem instead of declaring it manually
|
||||
disko = {
|
||||
enableConfig = true;
|
||||
devices = (import ./root.nix { disk = "/dev/nvme0n1"; });
|
||||
};
|
||||
|
||||
# Allows private remote access over the internet
|
||||
nmasur.presets.services.cloudflared = {
|
||||
tunnel = {
|
||||
id = "646754ac-2149-4a58-b51a-e1d0a1f3ade2";
|
||||
credentialsFile = ./cloudflared-swan.age;
|
||||
ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBCHF/UMtJqPFrf6f6GRY0ZFnkCW7b6sYgUTjTtNfRj1RdmNic1NoJZql7y6BrqQinZvy7nsr1UFDNWoHn6ah3tg= open-ssh-ca@cloudflareaccess.org";
|
||||
};
|
||||
};
|
||||
}
|
109
hosts/x86_64-linux/tempest/default.nix
Normal file
109
hosts/x86_64-linux/tempest/default.nix
Normal file
@ -0,0 +1,109 @@
|
||||
# The Tempest
|
||||
# System configuration for my desktop
|
||||
|
||||
rec {
|
||||
# Hardware
|
||||
networking.hostName = "tempest";
|
||||
|
||||
nmasur.settings = {
|
||||
username = "noah";
|
||||
fullName = "Noah Masur";
|
||||
};
|
||||
|
||||
nmasur.profiles = {
|
||||
base.enable = true;
|
||||
home.enable = true;
|
||||
gui.enable = true;
|
||||
gaming.enable = true;
|
||||
};
|
||||
|
||||
nmasur.presets.services.grub.enable = true;
|
||||
|
||||
home-manager.users."noah" = {
|
||||
nmasur.settings = {
|
||||
username = nmasur.settings.username;
|
||||
fullName = nmasur.settings.fullName;
|
||||
};
|
||||
nmasur.profiles = {
|
||||
common.enable = true;
|
||||
linux-base.enable = true;
|
||||
linux-gui.enable = true;
|
||||
linux-gaming.enable = true;
|
||||
power-user.enable = true;
|
||||
developer.enable = true;
|
||||
experimental.enable = true;
|
||||
};
|
||||
home.stateVersion = "23.05";
|
||||
};
|
||||
|
||||
system.stateVersion = "23.05";
|
||||
|
||||
# Not sure what's necessary but too afraid to remove anything
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
"ahci"
|
||||
"usb_storage"
|
||||
"usbhid"
|
||||
"sd_mod"
|
||||
];
|
||||
|
||||
# Graphics and VMs
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||
|
||||
# Required binary blobs to boot on this machine
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
# Prioritize performance over efficiency
|
||||
powerManagement.cpuFreqGovernor = "performance";
|
||||
|
||||
# Allow firmware updates
|
||||
hardware.cpu.amd.updateMicrocode = true;
|
||||
|
||||
# Helps reduce GPU fan noise under idle loads
|
||||
hardware.fancontrol.enable = true;
|
||||
hardware.fancontrol.config = ''
|
||||
# Configuration file generated by pwmconfig, changes will be lost
|
||||
INTERVAL=10
|
||||
DEVPATH=hwmon0=devices/pci0000:00/0000:00:03.1/0000:06:00.0/0000:07:00.0/0000:08:00.0
|
||||
DEVNAME=hwmon0=amdgpu
|
||||
FCTEMPS=hwmon0/pwm1=hwmon0/temp1_input
|
||||
FCFANS= hwmon0/pwm1=hwmon0/fan1_input
|
||||
MINTEMP=hwmon0/pwm1=50
|
||||
MAXTEMP=hwmon0/pwm1=70
|
||||
MINSTART=hwmon0/pwm1=100
|
||||
MINSTOP=hwmon0/pwm1=10
|
||||
MINPWM=hwmon0/pwm1=10
|
||||
MAXPWM=hwmon0/pwm1=240
|
||||
'';
|
||||
|
||||
# File systems must be declared in order to boot
|
||||
|
||||
# This is the root filesystem containing NixOS
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
# This is the boot filesystem for Grub
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-label/boot";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
# Allows private remote access over the internet
|
||||
nmasur.presets.services.cloudflared = {
|
||||
tunnel = {
|
||||
id = "ac133a82-31fb-480c-942a-cdbcd4c58173";
|
||||
credentialsFile = ./cloudflared-tempest.age;
|
||||
ca = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPY6C0HmdFCaxYtJxFr3qV4/1X4Q8KrYQ1hlme3u1hJXK+xW+lc9Y9glWHrhiTKilB7carYTB80US0O47gI5yU4= open-ssh-ca@cloudflareaccess.org";
|
||||
};
|
||||
};
|
||||
|
||||
# Allows requests to force machine to wake up
|
||||
# This network interface might change, needs to be set specifically for each machine.
|
||||
# Or set usePredictableInterfaceNames = false
|
||||
networking.interfaces.enp5s0.wakeOnLan.enable = true;
|
||||
}
|
223
lib/default.nix
Normal file
223
lib/default.nix
Normal file
@ -0,0 +1,223 @@
|
||||
inputs:
|
||||
|
||||
let
|
||||
lib = inputs.nixpkgs.lib;
|
||||
in
|
||||
|
||||
lib
|
||||
// rec {
|
||||
|
||||
# Returns all files in a directory matching a suffix
|
||||
filesInDirectoryWithSuffix =
|
||||
directory: suffix:
|
||||
lib.pipe (lib.filesystem.listFilesRecursive directory) [
|
||||
# Get only files ending in .nix
|
||||
(builtins.filter (name: lib.hasSuffix suffix name))
|
||||
];
|
||||
|
||||
# Returns all files ending in .nix for a directory
|
||||
nixFiles = directory: filesInDirectoryWithSuffix directory ".nix";
|
||||
|
||||
# Returns all files ending in default.nix for a directory
|
||||
defaultFiles = directory: filesInDirectoryWithSuffix directory "default.nix";
|
||||
|
||||
# Imports all files in a directory and passes inputs
|
||||
importOverlays =
|
||||
directory:
|
||||
lib.pipe (nixFiles directory) [
|
||||
# Import each overlay file
|
||||
(map (file: (import file) inputs))
|
||||
];
|
||||
|
||||
# Import default files as attrset with keys provided by parent directory
|
||||
defaultFilesToAttrset =
|
||||
directory:
|
||||
lib.pipe (defaultFiles directory) [
|
||||
# Import each file
|
||||
(map (file: {
|
||||
name = builtins.baseNameOf (builtins.dirOf file);
|
||||
value = import file;
|
||||
}))
|
||||
# Convert to an attrset of parent dir name -> file
|
||||
(builtins.listToAttrs)
|
||||
];
|
||||
|
||||
# [ package1/package.nix package2/package.nix package2/hello.sh ]
|
||||
buildPkgsFromDirectoryAndPkgs =
|
||||
directory: pkgs:
|
||||
lib.pipe (filesInDirectoryWithSuffix directory "package.nix") [
|
||||
|
||||
# Apply callPackage to create a derivation
|
||||
# Must use final.callPackage to avoid infinite recursion
|
||||
# [ package1.drv package2.drv ]
|
||||
(builtins.map (name: pkgs.callPackage name { }))
|
||||
|
||||
# Convert the list to an attrset with keys from pname or name attr
|
||||
# { package1 = package1.drv, package2 = package2.drv }
|
||||
(builtins.listToAttrs (
|
||||
map (v: {
|
||||
name = v."pname" or v."name";
|
||||
value = v;
|
||||
})
|
||||
))
|
||||
];
|
||||
|
||||
# Common overlays to always use
|
||||
overlays = [
|
||||
inputs.nur.overlays.default
|
||||
inputs.nix2vim.overlay
|
||||
inputs.zellij-switch.overlays.default
|
||||
] ++ (importOverlays ../overlays);
|
||||
|
||||
# System types to support.
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"x86_64-darwin"
|
||||
"aarch64-linux"
|
||||
"aarch64-darwin"
|
||||
];
|
||||
|
||||
# Split system types by operating system
|
||||
linuxSystems = builtins.filter (lib.hasSuffix "linux") supportedSystems;
|
||||
darwinSystems = builtins.filter (lib.hasSuffix "darwin") supportedSystems;
|
||||
|
||||
# Helper function to generate an attrset '{ x86_64-linux = f "x86_64-linux"; ... }'.
|
||||
forSystems = systems: lib.genAttrs systems;
|
||||
forAllSystems = lib.genAttrs supportedSystems;
|
||||
|
||||
# { x86_64-linux = { tempest = { settings = ...; }; }; };
|
||||
hosts = forAllSystems (system: defaultFilesToAttrset ../hosts/${system});
|
||||
|
||||
linuxHosts = lib.filterAttrs (name: value: builtins.elem name linuxSystems) hosts;
|
||||
darwinHosts = lib.filterAttrs (name: value: builtins.elem name darwinSystems) hosts;
|
||||
|
||||
# { system -> pkgs }
|
||||
pkgsBySystem = forAllSystems (
|
||||
system:
|
||||
import inputs.nixpkgs {
|
||||
inherit system overlays;
|
||||
config.permittedInsecurePackages = [ "litestream-0.3.13" ];
|
||||
config.allowUnfree = true;
|
||||
}
|
||||
);
|
||||
|
||||
colorscheme = defaultFilesToAttrset ../colorscheme;
|
||||
|
||||
homeModule = {
|
||||
home-manager = {
|
||||
# Include home-manager config in NixOS
|
||||
sharedModules = nixFiles ../platforms/home-manager;
|
||||
# Use the system-level nixpkgs instead of Home Manager's
|
||||
useGlobalPkgs = lib.mkDefault true;
|
||||
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
|
||||
# using multiple profiles for one user
|
||||
useUserPackages = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
|
||||
buildHome =
|
||||
{
|
||||
system,
|
||||
module,
|
||||
specialArgs,
|
||||
}:
|
||||
inputs.home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = pkgsBySystem.${system};
|
||||
modules = [
|
||||
{ imports = (nixFiles ../platforms/home-manager); }
|
||||
module
|
||||
];
|
||||
extraSpecialArgs = {
|
||||
inherit colorscheme;
|
||||
} // specialArgs;
|
||||
};
|
||||
|
||||
buildNixos =
|
||||
{
|
||||
system,
|
||||
module,
|
||||
specialArgs,
|
||||
}:
|
||||
inputs.nixpkgs.lib.nixosSystem {
|
||||
inherit specialArgs;
|
||||
pkgs = pkgsBySystem.${system};
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.disko.nixosModules.disko
|
||||
inputs.wsl.nixosModules.wsl
|
||||
{ imports = (nixFiles ../platforms/nixos); }
|
||||
module
|
||||
{
|
||||
home-manager = {
|
||||
extraSpecialArgs = {
|
||||
inherit colorscheme;
|
||||
} // specialArgs;
|
||||
} // homeModule.home-manager;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
buildDarwin =
|
||||
{
|
||||
system,
|
||||
module,
|
||||
specialArgs,
|
||||
}:
|
||||
inputs.darwin.lib.darwinSystem {
|
||||
inherit system specialArgs;
|
||||
modules = [
|
||||
inputs.home-manager.darwinModules.home-manager
|
||||
inputs.mac-app-util.darwinModules.default
|
||||
{
|
||||
imports = (nixFiles ../platforms/nix-darwin);
|
||||
nixpkgs.pkgs = pkgsBySystem.${system};
|
||||
}
|
||||
module
|
||||
{
|
||||
home-manager = {
|
||||
extraSpecialArgs = {
|
||||
inherit colorscheme;
|
||||
} // specialArgs;
|
||||
} // homeModule.home-manager;
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
generatorOptions = {
|
||||
amazon = {
|
||||
aws.enable = true;
|
||||
};
|
||||
iso = { };
|
||||
};
|
||||
|
||||
generateImage =
|
||||
{
|
||||
system,
|
||||
module,
|
||||
format,
|
||||
specialArgs,
|
||||
}:
|
||||
inputs.nixos-generators.nixosGenerate {
|
||||
inherit system format;
|
||||
modules = [
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
inputs.disko.nixosModules.disko
|
||||
inputs.wsl.nixosModules.wsl
|
||||
{
|
||||
imports = (nixFiles ../platforms/nixos) ++ (nixFiles ../platforms/generators);
|
||||
}
|
||||
generatorOptions.${format}
|
||||
module
|
||||
{
|
||||
home-manager = {
|
||||
extraSpecialArgs = {
|
||||
inherit colorscheme;
|
||||
} // specialArgs;
|
||||
} // homeModule.home-manager;
|
||||
}
|
||||
];
|
||||
specialArgs = {
|
||||
} // specialArgs;
|
||||
};
|
||||
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
# Modules
|
||||
|
||||
| Module | Purpose |
|
||||
| --- | --- |
|
||||
| [common](./common/default.nix) | User programs and OS-agnostic configuration |
|
||||
| [darwin](./darwin/default.nix) | macOS-specific configuration |
|
||||
| [nixos](./nixos/default.nix) | NixOS-specific configuration |
|
||||
| [wsl](./wsl/default.nix) | WSL-specific configuration |
|
||||
|
@ -1,9 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
# AWS settings require this
|
||||
permitRootLogin = "prohibit-password";
|
||||
|
||||
# Make sure disk size is large enough
|
||||
# https://github.com/nix-community/nixos-generators/issues/150
|
||||
amazonImage.sizeMB = 16 * 1024;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
_1password = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable 1Password.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config._1password.enable) {
|
||||
unfreePackages = [
|
||||
"1password"
|
||||
"_1password-gui"
|
||||
"1password-cli"
|
||||
];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = [
|
||||
pkgs._1password-cli
|
||||
] ++ (if pkgs.stdenv.isLinux then [ pkgs._1password-gui ] else [ ]);
|
||||
};
|
||||
|
||||
# https://1password.community/discussion/135462/firefox-extension-does-not-connect-to-linux-app
|
||||
# On Mac, does not apply: https://1password.community/discussion/142794/app-and-browser-integration
|
||||
# However, the button doesn't work either:
|
||||
# https://1password.community/discussion/140735/extending-support-for-trusted-web-browsers
|
||||
environment.etc."1password/custom_allowed_browsers".text = ''
|
||||
${
|
||||
config.home-manager.users.${config.user}.programs.firefox.package
|
||||
}/Applications/Firefox.app/Contents/MacOS/firefox
|
||||
firefox
|
||||
'';
|
||||
};
|
||||
}
|
@ -1,107 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
alacritty = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Alacritty.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.alacritty.enable) {
|
||||
home-manager.users.${config.user} = {
|
||||
xsession.windowManager.i3.config.terminal = "alacritty";
|
||||
programs.rofi.terminal = "${pkgs.alacritty}/bin/alacritty";
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
window = {
|
||||
dimensions = {
|
||||
columns = 85;
|
||||
lines = 30;
|
||||
};
|
||||
padding = {
|
||||
x = 20;
|
||||
y = 20;
|
||||
};
|
||||
opacity = 1.0;
|
||||
};
|
||||
scrolling.history = 10000;
|
||||
font = {
|
||||
size = 14.0;
|
||||
};
|
||||
key_bindings = [
|
||||
# Used for word completion in fish_user_key_bindings
|
||||
{
|
||||
key = "Return";
|
||||
mods = "Shift";
|
||||
chars = "\\x1F";
|
||||
}
|
||||
# Used for searching nixpkgs in fish_user_key_bindings
|
||||
{
|
||||
key = "N";
|
||||
mods = "Control|Shift";
|
||||
chars = "\\x11F";
|
||||
}
|
||||
{
|
||||
key = "H";
|
||||
mods = "Control|Shift";
|
||||
mode = "~Vi";
|
||||
action = "ToggleViMode";
|
||||
}
|
||||
{
|
||||
key = "Return";
|
||||
mode = "Vi";
|
||||
action = "ToggleViMode";
|
||||
}
|
||||
# Used to enable $ keybind in Vi mode
|
||||
{
|
||||
key = 5; # Scancode for key4
|
||||
mods = "Shift";
|
||||
mode = "Vi|~Search";
|
||||
action = "Last";
|
||||
}
|
||||
];
|
||||
colors = {
|
||||
primary = {
|
||||
background = config.theme.colors.base00;
|
||||
foreground = config.theme.colors.base05;
|
||||
};
|
||||
cursor = {
|
||||
text = "#1d2021";
|
||||
cursor = config.theme.colors.base05;
|
||||
};
|
||||
normal = {
|
||||
black = "#1d2021";
|
||||
red = config.theme.colors.base08;
|
||||
green = config.theme.colors.base0B;
|
||||
yellow = config.theme.colors.base0A;
|
||||
blue = config.theme.colors.base0D;
|
||||
magenta = config.theme.colors.base0E;
|
||||
cyan = config.theme.colors.base0C;
|
||||
white = config.theme.colors.base05;
|
||||
};
|
||||
bright = {
|
||||
black = config.theme.colors.base03;
|
||||
red = config.theme.colors.base09;
|
||||
green = config.theme.colors.base01;
|
||||
yellow = config.theme.colors.base02;
|
||||
blue = config.theme.colors.base04;
|
||||
magenta = config.theme.colors.base06;
|
||||
cyan = config.theme.colors.base0F;
|
||||
white = config.theme.colors.base07;
|
||||
};
|
||||
};
|
||||
draw_bold_text_with_bright_colors = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
|
||||
imports = [
|
||||
./1password.nix
|
||||
./alacritty.nix
|
||||
./discord.nix
|
||||
./firefox.nix
|
||||
./kitty.nix
|
||||
./media.nix
|
||||
./obsidian.nix
|
||||
./qbittorrent.nix
|
||||
./slack.nix
|
||||
./wezterm.nix
|
||||
./yt-dlp.nix
|
||||
];
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
discord = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Discord.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.discord.enable) {
|
||||
unfreePackages = [ "discord" ];
|
||||
environment.systemPackages = [ pkgs.discord ];
|
||||
home-manager.users.${config.user} = {
|
||||
xdg.configFile."discord/settings.json".text = ''
|
||||
{
|
||||
"BACKGROUND_COLOR": "#202225",
|
||||
"IS_MAXIMIZED": false,
|
||||
"IS_MINIMIZED": false,
|
||||
"OPEN_ON_STARTUP": false,
|
||||
"MINIMIZE_TO_TRAY": false,
|
||||
"SKIP_HOST_UPDATE": true
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
@ -1,203 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
|
||||
options = {
|
||||
firefox = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Firefox.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.firefox.enable) {
|
||||
|
||||
unfreePackages = [
|
||||
(lib.mkIf config._1password.enable "onepassword-password-manager")
|
||||
"okta-browser-plugin"
|
||||
];
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.firefox = {
|
||||
enable = true;
|
||||
package = if pkgs.stdenv.isDarwin then pkgs.firefox-bin else pkgs.firefox;
|
||||
profiles.default = {
|
||||
id = 0;
|
||||
name = "default";
|
||||
isDefault = true;
|
||||
# https://nur.nix-community.org/repos/rycee/
|
||||
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||
(lib.mkIf config._1password.enable onepassword-password-manager)
|
||||
darkreader
|
||||
don-t-fuck-with-paste
|
||||
facebook-container
|
||||
markdownload
|
||||
multi-account-containers
|
||||
okta-browser-plugin
|
||||
reddit-enhancement-suite
|
||||
return-youtube-dislikes
|
||||
sponsorblock
|
||||
ublock-origin
|
||||
ublacklist
|
||||
vimium
|
||||
];
|
||||
settings = {
|
||||
"app.update.auto" = false;
|
||||
"browser.aboutConfig.showWarning" = false;
|
||||
"browser.warnOnQuit" = false;
|
||||
"browser.quitShortcut.disabled" = if pkgs.stdenv.isLinux then true else false;
|
||||
"browser.theme.dark-private-windows" = true;
|
||||
"browser.toolbars.bookmarks.visibility" = false;
|
||||
"browser.startup.page" = 3; # Restore previous session
|
||||
"browser.newtabpage.enabled" = false; # Make new tabs blank
|
||||
"trailhead.firstrun.didSeeAboutWelcome" = true; # Disable welcome splash
|
||||
"dom.forms.autocomplete.formautofill" = false; # Disable autofill
|
||||
"extensions.formautofill.creditCards.enabled" = false; # Disable credit cards
|
||||
"dom.payments.defaults.saveAddress" = false; # Disable address save
|
||||
"general.autoScroll" = true; # Drag middle-mouse to scroll
|
||||
"services.sync.prefs.sync.general.autoScroll" = false; # Prevent disabling autoscroll
|
||||
"extensions.pocket.enabled" = false;
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; # Allow userChrome.css
|
||||
"layout.css.color-mix.enabled" = true;
|
||||
"ui.systemUsesDarkTheme" = if config.theme.dark == true then 1 else 0;
|
||||
"media.ffmpeg.vaapi.enabled" = true; # Enable hardware video acceleration
|
||||
"cookiebanners.ui.desktop.enabled" = true; # Reject cookie popups
|
||||
"devtools.command-button-screenshot.enabled" = true; # Scrolling screenshot of entire page
|
||||
"svg.context-properties.content.enabled" = true; # Sidebery styling
|
||||
"browser.tabs.hoverPreview.enabled" = false; # Disable tab previews
|
||||
"browser.tabs.hoverPreview.showThumbnails" = false; # Disable tab previews
|
||||
};
|
||||
userChrome = ''
|
||||
:root {
|
||||
--focus-outline-color: ${config.theme.colors.base04} !important;
|
||||
--toolbar-color: ${config.theme.colors.base07} !important;
|
||||
--tab-min-height: 30px !important;
|
||||
}
|
||||
/* Background of tab bar */
|
||||
.toolbar-items {
|
||||
background-color: ${config.theme.colors.base00} !important;
|
||||
}
|
||||
/* Extra tab bar sides on macOS */
|
||||
.titlebar-spacer {
|
||||
background-color: ${config.theme.colors.base00} !important;
|
||||
}
|
||||
.titlebar-buttonbox-container {
|
||||
background-color: ${config.theme.colors.base00} !important;
|
||||
}
|
||||
#tabbrowser-tabs {
|
||||
border-inline-start: 0 !important;
|
||||
}
|
||||
/* Private Browsing indicator on macOS */
|
||||
#private-browsing-indicator-with-label {
|
||||
background-color: ${config.theme.colors.base00} !important;
|
||||
margin-inline: 0 !important;
|
||||
padding-inline: 7px;
|
||||
}
|
||||
/* Tabs themselves */
|
||||
.tabbrowser-tab .tab-stack {
|
||||
border-radius: 5px 5px 0 0;
|
||||
overflow: hidden;
|
||||
background-color: ${config.theme.colors.base00};
|
||||
color: ${config.theme.colors.base06} !important;
|
||||
}
|
||||
.tab-content {
|
||||
border-bottom: 2px solid color-mix(in srgb, var(--identity-tab-color) 40%, transparent);
|
||||
border-radius: 5px 5px 0 0;
|
||||
background-color: ${config.theme.colors.base00};
|
||||
color: ${config.theme.colors.base06} !important;
|
||||
}
|
||||
.tab-content[selected] {
|
||||
border-bottom: 2px solid color-mix(in srgb, var(--identity-tab-color) 25%, transparent);
|
||||
background-color: ${config.theme.colors.base01} !important;
|
||||
color: ${config.theme.colors.base07} !important;
|
||||
}
|
||||
/* Below tab bar */
|
||||
#nav-bar {
|
||||
background: ${config.theme.colors.base01} !important;
|
||||
}
|
||||
/* URL bar in nav bar */
|
||||
#urlbar[focused=true] {
|
||||
color: ${config.theme.colors.base07} !important;
|
||||
background: ${config.theme.colors.base02} !important;
|
||||
caret-color: ${config.theme.colors.base05} !important;
|
||||
}
|
||||
#urlbar:not([focused=true]) {
|
||||
color: ${config.theme.colors.base04} !important;
|
||||
background: ${config.theme.colors.base02} !important;
|
||||
}
|
||||
#urlbar ::-moz-selection {
|
||||
color: ${config.theme.colors.base07} !important;
|
||||
background: ${config.theme.colors.base02} !important;
|
||||
}
|
||||
#urlbar-input-container {
|
||||
border: 1px solid ${config.theme.colors.base01} !important;
|
||||
}
|
||||
#urlbar-background {
|
||||
background: ${config.theme.colors.base01} !important;
|
||||
}
|
||||
/* Text in URL bar */
|
||||
#urlbar-input, #urlbar-scheme, .searchbar-textbox {
|
||||
color: ${config.theme.colors.base07} !important;
|
||||
}
|
||||
'';
|
||||
userContent = ''
|
||||
@-moz-document url-prefix(about:blank) {
|
||||
* {
|
||||
background-color:${config.theme.colors.base01} !important;
|
||||
}
|
||||
}
|
||||
'';
|
||||
|
||||
extraConfig = "";
|
||||
};
|
||||
};
|
||||
|
||||
# Mimic nixpkgs package environment for read-only profiles.ini management
|
||||
# From: https://github.com/booxter/home-manager/commit/dd1602e306fec366280f5953c5e1b553e3d9672a
|
||||
home.sessionVariables = {
|
||||
MOZ_LEGACY_PROFILES = 1;
|
||||
MOZ_ALLOW_DOWNGRADE = 1;
|
||||
};
|
||||
|
||||
# launchd.user.envVariables = config.home-manager.users.${config.user}.home.sessionVariables;
|
||||
|
||||
xdg.mimeApps = {
|
||||
associations.added = {
|
||||
"text/html" = [ "firefox.desktop" ];
|
||||
};
|
||||
defaultApplications = {
|
||||
"text/html" = [ "firefox.desktop" ];
|
||||
};
|
||||
associations.removed = {
|
||||
"text/html" = [ "wine-extension-htm.desktop" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux {
|
||||
"${
|
||||
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
||||
}+Shift+b" = "exec ${
|
||||
# Don't name the script `firefox` or it will affect grep
|
||||
builtins.toString (
|
||||
pkgs.writeShellScript "focus-ff.sh" ''
|
||||
count=$(ps aux | grep -c firefox)
|
||||
if [ "$count" -eq 1 ]; then
|
||||
i3-msg "exec --no-startup-id firefox"
|
||||
sleep 0.5
|
||||
fi
|
||||
i3-msg "[class=firefox] focus"
|
||||
''
|
||||
)
|
||||
}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,118 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
kitty = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Kitty.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.kitty.enable) {
|
||||
|
||||
# Set the Rofi-Systemd terminal for viewing logs
|
||||
# Using optionalAttrs because only available in NixOS
|
||||
environment =
|
||||
{ }
|
||||
// lib.attrsets.optionalAttrs (builtins.hasAttr "sessionVariables" config.environment) {
|
||||
sessionVariables.ROFI_SYSTEMD_TERM = lib.mkDefault "${pkgs.kitty}/bin/kitty";
|
||||
};
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
# Set the i3 terminal
|
||||
xsession.windowManager.i3.config.terminal = lib.mkIf pkgs.stdenv.isLinux "kitty";
|
||||
|
||||
# Set the Rofi terminal for running programs
|
||||
programs.rofi.terminal = lib.mkIf pkgs.stdenv.isLinux (lib.mkDefault "${pkgs.kitty}/bin/kitty");
|
||||
|
||||
# Display images in the terminal
|
||||
programs.fish.interactiveShellInit = # fish
|
||||
''
|
||||
if test "$TERM" = "xterm-kitty"
|
||||
alias icat="kitty +kitten icat"
|
||||
alias ssh="kitty +kitten ssh"
|
||||
end
|
||||
'';
|
||||
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
environment = { };
|
||||
extraConfig = "";
|
||||
font.size = 14;
|
||||
keybindings = {
|
||||
# Use shift+enter to complete text suggestions in fish
|
||||
"shift+enter" = "send_text all \\x1F";
|
||||
|
||||
# Easy fullscreen toggle (for macOS)
|
||||
"super+f" = "toggle_fullscreen";
|
||||
};
|
||||
settings = {
|
||||
|
||||
# Colors (adapted from: https://github.com/kdrag0n/base16-kitty/blob/master/templates/default-256.mustache)
|
||||
background = config.theme.colors.base00;
|
||||
foreground = config.theme.colors.base05;
|
||||
selection_background = config.theme.colors.base05;
|
||||
selection_foreground = config.theme.colors.base00;
|
||||
url_color = config.theme.colors.base04;
|
||||
cursor = config.theme.colors.base05;
|
||||
active_border_color = config.theme.colors.base03;
|
||||
inactive_border_color = config.theme.colors.base01;
|
||||
active_tab_background = config.theme.colors.base00;
|
||||
active_tab_foreground = config.theme.colors.base05;
|
||||
inactive_tab_background = config.theme.colors.base01;
|
||||
inactive_tab_foreground = config.theme.colors.base04;
|
||||
tab_bar_background = config.theme.colors.base01;
|
||||
|
||||
# normal
|
||||
color0 = config.theme.colors.base00;
|
||||
color1 = config.theme.colors.base08;
|
||||
color2 = config.theme.colors.base0B;
|
||||
color3 = config.theme.colors.base0A;
|
||||
color4 = config.theme.colors.base0D;
|
||||
color5 = config.theme.colors.base0E;
|
||||
color6 = config.theme.colors.base0C;
|
||||
color7 = config.theme.colors.base05;
|
||||
|
||||
# bright
|
||||
color8 = config.theme.colors.base03;
|
||||
color9 = config.theme.colors.base08;
|
||||
color10 = config.theme.colors.base0B;
|
||||
color11 = config.theme.colors.base0A;
|
||||
color12 = config.theme.colors.base0D;
|
||||
color13 = config.theme.colors.base0E;
|
||||
color14 = config.theme.colors.base0C;
|
||||
color15 = config.theme.colors.base07;
|
||||
|
||||
# extended base16 colors
|
||||
color16 = config.theme.colors.base09;
|
||||
color17 = config.theme.colors.base0F;
|
||||
color18 = config.theme.colors.base01;
|
||||
color19 = config.theme.colors.base02;
|
||||
color20 = config.theme.colors.base04;
|
||||
color21 = config.theme.colors.base06;
|
||||
|
||||
# Scrollback
|
||||
scrollback_lines = 10000;
|
||||
scrollback_pager_history_size = 300; # MB
|
||||
|
||||
# Window
|
||||
window_padding_width = 6;
|
||||
|
||||
tab_bar_edge = "top";
|
||||
tab_bar_style = "slant";
|
||||
|
||||
# Disable audio
|
||||
enable_audio_bell = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
media = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable media programs.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.media.enable) {
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [
|
||||
nsxiv # Image viewer
|
||||
mupdf # PDF viewer
|
||||
zathura # PDF viewer
|
||||
];
|
||||
|
||||
# Video player
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
bindings = { };
|
||||
config = {
|
||||
image-display-duration = 2; # For cycling through images
|
||||
hwdec = "auto-safe"; # Attempt to use GPU decoding for video
|
||||
};
|
||||
scripts = [
|
||||
|
||||
# Automatically load playlist entries before and after current file
|
||||
pkgs.mpvScripts.autoload
|
||||
|
||||
# Delete current file after quitting
|
||||
pkgs.mpvScripts.mpv-delete-file
|
||||
];
|
||||
};
|
||||
|
||||
# Set default programs for opening PDFs and other media
|
||||
xdg.mimeApps = {
|
||||
associations.added = {
|
||||
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||
"image/jpeg" = [ "nsxiv.desktop" ];
|
||||
"image/png" = [ "nsxiv.desktop" ];
|
||||
"image/*" = [ "nsxiv.desktop" ];
|
||||
};
|
||||
associations.removed = {
|
||||
"application/pdf" = [
|
||||
"mupdf.desktop"
|
||||
"wine-extension-pdf.desktop"
|
||||
];
|
||||
};
|
||||
defaultApplications = {
|
||||
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||
"image/jpeg" = [ "nsxiv.desktop" ];
|
||||
"image/png" = [ "nsxiv.desktop" ];
|
||||
"image/*" = [ "nsxiv.desktop" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,28 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
obsidian = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Obsidian.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.obsidian.enable) {
|
||||
unfreePackages = [ "obsidian" ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ obsidian ];
|
||||
};
|
||||
|
||||
# Broken on 2023-12-11
|
||||
# https://forum.obsidian.md/t/electron-25-is-now-eol-please-upgrade-to-a-newer-version/72878/8
|
||||
insecurePackages = [ "electron-25.9.0" ];
|
||||
};
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
qbittorrent = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable qBittorrent.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.qbittorrent.enable) {
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.packages = with pkgs; [ qbittorrent ];
|
||||
};
|
||||
};
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
slack = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable Slack.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.slack.enable) {
|
||||
unfreePackages = [ "slack" ];
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [ slack ];
|
||||
};
|
||||
};
|
||||
|
||||
# Theme string: #1D2122,#665C54,#8EC07C,#BDAE93
|
||||
}
|
@ -1,286 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
wezterm = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable WezTerm terminal.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
font = config.home-manager.users.${config.user}.programs.kitty.font.name;
|
||||
in
|
||||
lib.mkIf (config.gui.enable && config.wezterm.enable) {
|
||||
|
||||
# Set the Rofi-Systemd terminal for viewing logs
|
||||
# Using optionalAttrs because only available in NixOS
|
||||
environment =
|
||||
{ }
|
||||
// lib.attrsets.optionalAttrs (builtins.hasAttr "sessionVariables" config.environment) {
|
||||
sessionVariables.ROFI_SYSTEMD_TERM = "${pkgs.wezterm}/bin/wezterm";
|
||||
};
|
||||
|
||||
terminal = "${pkgs.wezterm}/bin/wezterm";
|
||||
terminalLaunchCommand = "${config.terminal} start --";
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
# Set the i3 terminal
|
||||
xsession.windowManager.i3.config.terminal = lib.mkIf pkgs.stdenv.isLinux "wezterm";
|
||||
|
||||
# Display images in the terminal
|
||||
programs.fish.shellAliases = {
|
||||
icat = lib.mkForce "wezterm imgcat";
|
||||
};
|
||||
|
||||
programs.wezterm = {
|
||||
enable = true;
|
||||
colorSchemes = {
|
||||
myTheme = {
|
||||
background = config.theme.colors.base00;
|
||||
foreground = config.theme.colors.base05;
|
||||
cursor_bg = config.theme.colors.base05;
|
||||
cursor_fg = config.theme.colors.base00;
|
||||
cursor_border = config.theme.colors.base05;
|
||||
selection_bg = config.theme.colors.base05;
|
||||
selection_fg = config.theme.colors.base00;
|
||||
scrollbar_thumb = config.theme.colors.base03;
|
||||
ansi = [
|
||||
config.theme.colors.base01 # black
|
||||
config.theme.colors.base0F # maroon
|
||||
config.theme.colors.base0B # green
|
||||
config.theme.colors.base0A # olive
|
||||
config.theme.colors.base0D # navy
|
||||
config.theme.colors.base0E # purple
|
||||
config.theme.colors.base0C # teal
|
||||
config.theme.colors.base06 # silver
|
||||
];
|
||||
brights = [
|
||||
config.theme.colors.base03 # grey
|
||||
config.theme.colors.base08 # red
|
||||
config.theme.colors.base0B # lime
|
||||
config.theme.colors.base0A # yellow
|
||||
config.theme.colors.base0D # blue
|
||||
config.theme.colors.base0E # fuchsia
|
||||
config.theme.colors.base0C # aqua
|
||||
config.theme.colors.base07 # white
|
||||
];
|
||||
compose_cursor = config.theme.colors.base09; # orange
|
||||
copy_mode_active_highlight_bg = {
|
||||
Color = config.theme.colors.base03;
|
||||
};
|
||||
copy_mode_active_highlight_fg = {
|
||||
Color = config.theme.colors.base07;
|
||||
};
|
||||
copy_mode_inactive_highlight_bg = {
|
||||
Color = config.theme.colors.base02;
|
||||
};
|
||||
copy_mode_inactive_highlight_fg = {
|
||||
Color = config.theme.colors.base06;
|
||||
};
|
||||
quick_select_label_bg = {
|
||||
Color = config.theme.colors.base02;
|
||||
};
|
||||
quick_select_label_fg = {
|
||||
Color = config.theme.colors.base06;
|
||||
};
|
||||
quick_select_match_bg = {
|
||||
Color = config.theme.colors.base03;
|
||||
};
|
||||
quick_select_match_fg = {
|
||||
Color = config.theme.colors.base07;
|
||||
};
|
||||
};
|
||||
};
|
||||
extraConfig = ''
|
||||
local wezterm = require("wezterm")
|
||||
local config = wezterm.config_builder()
|
||||
config.check_for_updates = false
|
||||
config.color_scheme = "myTheme"
|
||||
|
||||
-- Scrollback
|
||||
config.scrollback_lines = 10000
|
||||
|
||||
-- Window
|
||||
config.window_padding = {
|
||||
left = 10,
|
||||
right = 10,
|
||||
top = 10,
|
||||
bottom = 12,
|
||||
}
|
||||
|
||||
config.font = wezterm.font('${font}', { weight = 'Bold'})
|
||||
config.font_size = ${if pkgs.stdenv.isLinux then "14.0" else "18.0"}
|
||||
|
||||
-- Fix color blocks instead of text
|
||||
config.front_end = "WebGpu"
|
||||
|
||||
-- Tab Bar
|
||||
config.hide_tab_bar_if_only_one_tab = true
|
||||
config.window_frame = {
|
||||
font = wezterm.font('${font}', { weight = 'Bold'}),
|
||||
font_size = ${if pkgs.stdenv.isLinux then "12.0" else "16.0"},
|
||||
}
|
||||
|
||||
config.colors = {
|
||||
tab_bar = {
|
||||
active_tab = {
|
||||
bg_color = '${config.theme.colors.base00}',
|
||||
fg_color = '${config.theme.colors.base04}',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
-- Disable audio
|
||||
config.audible_bell = "Disabled"
|
||||
|
||||
config.initial_rows = 80
|
||||
config.initial_cols = 200
|
||||
|
||||
config.unix_domains = {
|
||||
{
|
||||
name = 'unix',
|
||||
},
|
||||
}
|
||||
|
||||
-- This causes `wezterm` to act as though it was started as
|
||||
-- `wezterm connect unix` by default, connecting to the unix
|
||||
-- domain on startup.
|
||||
-- If you prefer to connect manually, leave out this line.
|
||||
config.default_gui_startup_args = { 'connect', 'unix' }
|
||||
|
||||
config.leader = {
|
||||
key = 'a',
|
||||
mods = 'CTRL',
|
||||
timeout_milliseconds = 2000,
|
||||
}
|
||||
|
||||
config.keys = {
|
||||
-- Attach to muxer
|
||||
{
|
||||
key = 'a',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.AttachDomain 'unix',
|
||||
},
|
||||
|
||||
-- Detach from muxer
|
||||
{
|
||||
key = 'd',
|
||||
mods = 'LEADER',
|
||||
action = wezterm.action.DetachDomain { DomainName = 'unix' },
|
||||
},
|
||||
-- sends completion string for fish autosuggestions
|
||||
{
|
||||
key = 'Enter',
|
||||
mods = 'SHIFT',
|
||||
action = wezterm.action.SendString '\x1F'
|
||||
},
|
||||
-- ctrl-shift-h was "hide"
|
||||
{
|
||||
key = 'H',
|
||||
mods = 'SHIFT|CTRL',
|
||||
action = wezterm.action.DisableDefaultAssignment
|
||||
},
|
||||
-- alt-enter was "fullscreen"
|
||||
{
|
||||
key = 'Enter',
|
||||
mods = 'ALT',
|
||||
action = wezterm.action.DisableDefaultAssignment
|
||||
},
|
||||
-- make super-f "fullscreen"
|
||||
{
|
||||
key = 'f',
|
||||
mods = 'SUPER',
|
||||
action = wezterm.action.ToggleFullScreen
|
||||
},
|
||||
-- super-t open new tab in new dir
|
||||
{
|
||||
key = 't',
|
||||
mods = ${if pkgs.stdenv.isDarwin then "'SUPER'" else "'ALT'"},
|
||||
action = wezterm.action.SpawnCommandInNewTab {
|
||||
cwd = wezterm.home_dir,
|
||||
},
|
||||
},
|
||||
-- shift-super-t open new tab in same dir
|
||||
{
|
||||
key = 't',
|
||||
mods = 'SUPER|SHIFT',
|
||||
action = wezterm.action.SpawnTab 'CurrentPaneDomain'
|
||||
},
|
||||
-- project switcher
|
||||
{
|
||||
key = 'P',
|
||||
mods = 'SUPER',
|
||||
action = wezterm.action_callback(function(window, pane)
|
||||
local choices = {}
|
||||
|
||||
wezterm.log_info "working?"
|
||||
|
||||
function scandir(directory)
|
||||
local i, t, popen = 0, {}, io.popen
|
||||
local pfile = popen('${pkgs.fd}/bin/fd --search-path "'..directory..'" --type directory --exact-depth 2 | ${pkgs.proximity-sort}/bin/proximity-sort "'..os.getenv("HOME").."/dev/work"..'"')
|
||||
for filename in pfile:lines() do
|
||||
i = i + 1
|
||||
t[i] = filename
|
||||
end
|
||||
pfile:close()
|
||||
return t
|
||||
end
|
||||
|
||||
for _, v in pairs(scandir(os.getenv("HOME").."/dev")) do
|
||||
table.insert(choices, { label = v })
|
||||
end
|
||||
|
||||
window:perform_action(
|
||||
wezterm.action.InputSelector {
|
||||
action = wezterm.action_callback(function(window, pane, id, label)
|
||||
if not id and not label then
|
||||
wezterm.log_info "cancelled"
|
||||
else
|
||||
window:perform_action(
|
||||
wezterm.action.SpawnCommandInNewTab {
|
||||
cwd = label,
|
||||
},
|
||||
pane
|
||||
)
|
||||
end
|
||||
end),
|
||||
fuzzy = true,
|
||||
title = "Select Project",
|
||||
choices = choices,
|
||||
},
|
||||
pane
|
||||
)
|
||||
end),
|
||||
},
|
||||
}
|
||||
|
||||
-- print the workspace name at the upper right
|
||||
wezterm.on("update-right-status", function(window, pane)
|
||||
window:set_right_status(window:active_workspace())
|
||||
end)
|
||||
-- load plugin
|
||||
local workspace_switcher = wezterm.plugin.require("https://github.com/MLFlexer/smart_workspace_switcher.wezterm")
|
||||
-- set path to zoxide
|
||||
workspace_switcher.zoxide_path = "${pkgs.zoxide}/bin/zoxide"
|
||||
-- keymaps
|
||||
table.insert(config.keys, { key = "s", mods = "CTRL|SHIFT", action = workspace_switcher.switch_workspace() })
|
||||
-- table.insert(config.keys, { key = "t", mods = "CTRL|SHIFT", action = wezterm.action.ShowLauncherArgs({ flags = "FUZZY|WORKSPACES" }) })
|
||||
table.insert(config.keys, { key = "[", mods = "CTRL|SHIFT", action = wezterm.action.SwitchWorkspaceRelative(1) })
|
||||
table.insert(config.keys, { key = "]", mods = "CTRL|SHIFT", action = wezterm.action.SwitchWorkspaceRelative(-1) })
|
||||
|
||||
return config
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
yt-dlp = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable YouTube downloader.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.yt-dlp.enable) {
|
||||
home-manager.users.${config.user} = {
|
||||
programs.yt-dlp = {
|
||||
enable = true;
|
||||
extraConfig = "";
|
||||
settings = {
|
||||
no-continue = true; # Always re-download each fragment
|
||||
no-overwrites = true; # Don't overwrite existing files
|
||||
download-archive = "archive.log"; # Log of archives
|
||||
embed-metadata = true;
|
||||
embed-thumbnail = true;
|
||||
embed-subs = true;
|
||||
sub-langs = "en.*";
|
||||
concurrent-fragments = 4; # Parallel download chunks
|
||||
};
|
||||
};
|
||||
|
||||
programs.fish.shellAbbrs.yt = "yt-dlp";
|
||||
};
|
||||
};
|
||||
}
|
@ -1,200 +0,0 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
imports = [
|
||||
./applications
|
||||
./mail
|
||||
./neovim
|
||||
./programming
|
||||
./repositories
|
||||
./shell
|
||||
];
|
||||
|
||||
options = {
|
||||
user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Primary user of the system";
|
||||
};
|
||||
fullName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Human readable name of the user";
|
||||
};
|
||||
userDirs = {
|
||||
# Required to prevent infinite recursion when referenced by himalaya
|
||||
download = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "XDG directory for downloads";
|
||||
default = if pkgs.stdenv.isDarwin then "$HOME/Downloads" else "$HOME/downloads";
|
||||
};
|
||||
};
|
||||
identityFile = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Path to existing private key file.";
|
||||
default = "/etc/ssh/ssh_host_ed25519_key";
|
||||
};
|
||||
gui = {
|
||||
enable = lib.mkEnableOption {
|
||||
description = "Enable graphics.";
|
||||
default = false;
|
||||
};
|
||||
};
|
||||
theme = {
|
||||
colors = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
description = "Base16 color scheme.";
|
||||
default = (import ../colorscheme/gruvbox).dark;
|
||||
};
|
||||
dark = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
description = "Enable dark mode.";
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
homePath = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Path of user's home directory.";
|
||||
default = builtins.toPath (
|
||||
if pkgs.stdenv.isDarwin then "/Users/${config.user}" else "/home/${config.user}"
|
||||
);
|
||||
};
|
||||
dotfilesPath = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Path of dotfiles repository.";
|
||||
default = config.homePath + "/dev/personal/dotfiles";
|
||||
};
|
||||
dotfilesRepo = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Link to dotfiles repository HTTPS URL.";
|
||||
};
|
||||
unfreePackages = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
description = "List of unfree packages to allow.";
|
||||
default = [ ];
|
||||
};
|
||||
insecurePackages = lib.mkOption {
|
||||
type = lib.types.listOf lib.types.str;
|
||||
description = "List of insecure packages to allow.";
|
||||
default = [ ];
|
||||
};
|
||||
hostnames = {
|
||||
audiobooks = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for audiobook server (Audiobookshelf).";
|
||||
};
|
||||
budget = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for budgeting server (ActualBudget).";
|
||||
};
|
||||
files = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for files server (Filebrowser).";
|
||||
};
|
||||
git = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for git server (Gitea).";
|
||||
};
|
||||
metrics = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for metrics server.";
|
||||
};
|
||||
minecraft = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for Minecraft server.";
|
||||
};
|
||||
paperless = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for document server (paperless-ngx).";
|
||||
};
|
||||
photos = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for photo management (Immich).";
|
||||
};
|
||||
prometheus = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for Prometheus server.";
|
||||
};
|
||||
influxdb = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for InfluxDB2 server.";
|
||||
};
|
||||
secrets = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for passwords and secrets (Vaultwarden).";
|
||||
};
|
||||
stream = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for video/media library (Jellyfin).";
|
||||
};
|
||||
content = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for personal content system (Nextcloud).";
|
||||
};
|
||||
books = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for books library (Calibre-Web).";
|
||||
};
|
||||
download = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for download services.";
|
||||
};
|
||||
irc = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for IRC services.";
|
||||
};
|
||||
n8n = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for n8n automation.";
|
||||
};
|
||||
notifications = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for push notification services (ntfy).";
|
||||
};
|
||||
status = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for status page (Uptime-Kuma).";
|
||||
};
|
||||
transmission = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Hostname for peer2peer downloads (Transmission).";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config =
|
||||
let
|
||||
stateVersion = "23.05";
|
||||
in
|
||||
{
|
||||
|
||||
# Basic common system packages for all devices
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
vim
|
||||
wget
|
||||
curl
|
||||
];
|
||||
|
||||
# Use the system-level nixpkgs instead of Home Manager's
|
||||
home-manager.useGlobalPkgs = true;
|
||||
|
||||
# Install packages to /etc/profiles instead of ~/.nix-profile, useful when
|
||||
# using multiple profiles for one user
|
||||
home-manager.useUserPackages = true;
|
||||
|
||||
# Allow specified unfree packages (identified elsewhere)
|
||||
# Retrieves package object based on string name
|
||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.unfreePackages;
|
||||
|
||||
# Allow specified insecure packages (identified elsewhere)
|
||||
nixpkgs.config.permittedInsecurePackages = config.insecurePackages;
|
||||
|
||||
# Pin a state version to prevent warnings
|
||||
home-manager.users.${config.user}.home.stateVersion = stateVersion;
|
||||
home-manager.users.root.home.stateVersion = stateVersion;
|
||||
};
|
||||
}
|
@ -1,220 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.mail.aerc.enable = lib.mkEnableOption "Aerc email.";
|
||||
|
||||
config = lib.mkIf config.mail.aerc.enable {
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
w3m # Render HTML
|
||||
dante # Socksify for rendering HTML
|
||||
];
|
||||
|
||||
programs.aerc = {
|
||||
enable = true;
|
||||
extraBinds = {
|
||||
# Binds are of the form <key sequence> = <command to run>
|
||||
# To use '=' in a key sequence, substitute it with "Eq": "<Ctrl+Eq>"
|
||||
# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit
|
||||
global = {
|
||||
"<C-p>" = ":prev-tab<Enter>";
|
||||
"<C-n>" = ":next-tab <Enter>";
|
||||
"<C-t>" = ":term<Enter>";
|
||||
"?" = ":help keys<Enter>";
|
||||
};
|
||||
|
||||
messages = {
|
||||
q = ":quit<Enter>";
|
||||
|
||||
j = ":next <Enter>";
|
||||
"<Down>" = ":next<Enter>";
|
||||
"<C-d>" = ":next 50%<Enter>";
|
||||
"<C-f>" = ":next 100%<Enter>";
|
||||
"<PgDn>" = ":next 100%<Enter>";
|
||||
|
||||
k = ":prev <Enter>";
|
||||
"<Up>" = ":prev<Enter>";
|
||||
"<C-u>" = ":prev 50%<Enter>";
|
||||
"<C-b>" = ":prev 100%<Enter>";
|
||||
"<PgUp>" = ":prev 100%<Enter>";
|
||||
g = ":select 0 <Enter>";
|
||||
G = ":select -1<Enter>";
|
||||
|
||||
J = ":next-folder <Enter>";
|
||||
K = ":prev-folder<Enter>";
|
||||
H = ":collapse-folder<Enter>";
|
||||
L = ":expand-folder<Enter>";
|
||||
|
||||
v = ":mark -t<Enter>";
|
||||
V = ":mark -v<Enter>";
|
||||
|
||||
T = ":toggle-threads<Enter>";
|
||||
|
||||
"<Enter>" = ":view<Enter>";
|
||||
d = ":prompt 'Really delete this message?' 'delete-message'<Enter>";
|
||||
D = ":move Trash<Enter>";
|
||||
A = ":archive flat<Enter>";
|
||||
|
||||
C = ":compose<Enter>";
|
||||
|
||||
rr = ":reply -a<Enter>";
|
||||
rq = ":reply -aq<Enter>";
|
||||
Rr = ":reply<Enter>";
|
||||
Rq = ":reply -q<Enter>";
|
||||
|
||||
c = ":cf<space>";
|
||||
"$" = ":term<space>";
|
||||
"!" = ":term<space>";
|
||||
"|" = ":pipe<space>";
|
||||
|
||||
"/" = ":search<space>-a<space>";
|
||||
"\\" = ":filter <space>";
|
||||
n = ":next-result<Enter>";
|
||||
N = ":prev-result<Enter>";
|
||||
"<Esc>" = ":clear<Enter>";
|
||||
};
|
||||
|
||||
"messages:folder=Drafts" = {
|
||||
"<Enter>" = ":recall<Enter>";
|
||||
};
|
||||
|
||||
view = {
|
||||
"/" = ":toggle-key-passthrough <Enter> /";
|
||||
q = ":close<Enter>";
|
||||
O = ":open<Enter>";
|
||||
S = ":save<space>";
|
||||
"|" = ":pipe<space>";
|
||||
D = ":move Trash<Enter>";
|
||||
A = ":archive flat<Enter>";
|
||||
|
||||
"<C-l>" = ":open-link <space>";
|
||||
|
||||
f = ":forward <Enter>";
|
||||
rr = ":reply -a<Enter>";
|
||||
rq = ":reply -aq<Enter>";
|
||||
Rr = ":reply<Enter>";
|
||||
Rq = ":reply -q<Enter>";
|
||||
|
||||
H = ":toggle-headers<Enter>";
|
||||
"<C-k>" = ":prev-part<Enter>";
|
||||
"<C-j>" = ":next-part<Enter>";
|
||||
J = ":next <Enter>";
|
||||
K = ":prev<Enter>";
|
||||
};
|
||||
|
||||
"view::passthrough" = {
|
||||
"$noinherit" = "true";
|
||||
"$ex" = "<C-x>";
|
||||
"<Esc>" = ":toggle-key-passthrough<Enter>";
|
||||
};
|
||||
|
||||
compose = {
|
||||
# Keybindings used when the embedded terminal is not selected in the compose
|
||||
# view
|
||||
"$noinherit" = "true";
|
||||
"$ex" = "<C-x>";
|
||||
"<C-k>" = ":prev-field<Enter>";
|
||||
"<C-j>" = ":next-field<Enter>";
|
||||
"<A-p>" = ":switch-account -p<Enter>";
|
||||
"<A-n>" = ":switch-account -n<Enter>";
|
||||
"<tab>" = ":next-field<Enter>";
|
||||
"<C-p>" = ":prev-tab<Enter>";
|
||||
"<C-n>" = ":next-tab<Enter>";
|
||||
};
|
||||
|
||||
"compose::editor" = {
|
||||
# Keybindings used when the embedded terminal is selected in the compose view
|
||||
"$noinherit" = "true";
|
||||
"$ex" = "<C-x>";
|
||||
"<C-k>" = ":prev-field<Enter>";
|
||||
"<C-j>" = ":next-field<Enter>";
|
||||
"<C-p>" = ":prev-tab<Enter>";
|
||||
"<C-n>" = ":next-tab<Enter>";
|
||||
};
|
||||
|
||||
"compose::review" = {
|
||||
# Keybindings used when reviewing a message to be sent
|
||||
y = ":send <Enter>";
|
||||
n = ":abort<Enter>";
|
||||
p = ":postpone<Enter>";
|
||||
q = ":choose -o d discard abort -o p postpone postpone<Enter>";
|
||||
e = ":edit<Enter>";
|
||||
a = ":attach<space>";
|
||||
d = ":detach<space>";
|
||||
};
|
||||
|
||||
terminal = {
|
||||
"$noinherit" = "true";
|
||||
"$ex" = "<C-x>";
|
||||
"<C-p>" = ":prev-tab<Enter>";
|
||||
"<C-n>" = ":next-tab<Enter>";
|
||||
};
|
||||
};
|
||||
extraConfig = {
|
||||
general = {
|
||||
unsafe-accounts-conf = true;
|
||||
# log-file = "~/.cache/aerc.log";
|
||||
# log-level = "debug";
|
||||
};
|
||||
viewer = {
|
||||
pager = "${pkgs.less}/bin/less -R";
|
||||
};
|
||||
filters = {
|
||||
"text/plain" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
||||
"text/calendar" = "${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/libexec/aerc/filters/calendar";
|
||||
"text/html" =
|
||||
"${pkgs.aerc}/libexec/aerc/filters/html | ${pkgs.aerc}/libexec/aerc/filters/colorize"; # Requires w3m, dante
|
||||
# "text/*" =
|
||||
# ''${pkgs.bat}/bin/bat -fP --file-name="$AERC_FILENAME "'';
|
||||
"message/delivery-status" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
||||
"message/rfc822" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
||||
"application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh";
|
||||
"application/pdf" = "${pkgs.zathura}/bin/zathura -";
|
||||
"audio/*" = "${pkgs.mpv}/bin/mpv -";
|
||||
"image/*" = "${pkgs.feh}/bin/feh -";
|
||||
};
|
||||
};
|
||||
};
|
||||
accounts.email.accounts.home.aerc = {
|
||||
enable = true;
|
||||
extraAccounts = {
|
||||
check-mail = "5m";
|
||||
check-mail-cmd = "${pkgs.isync}/bin/mbsync -a";
|
||||
check-mail-timeout = "15s";
|
||||
};
|
||||
};
|
||||
|
||||
xdg.desktopEntries.aerc = lib.mkIf (pkgs.stdenv.isLinux && config.gui.enable) {
|
||||
name = "aerc";
|
||||
exec = "${config.terminalLaunchCommand} aerc %u";
|
||||
};
|
||||
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux {
|
||||
"${config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier}+Shift+e" =
|
||||
"exec ${
|
||||
# Don't name the script `aerc` or it will affect grep
|
||||
builtins.toString (
|
||||
pkgs.writeShellScript "focus-mail.sh" ''
|
||||
count=$(ps aux | grep -c aerc)
|
||||
if [ "$count" -eq 1 ]; then
|
||||
i3-msg "exec --no-startup-id ${config.terminal} start --class aerc -- aerc"
|
||||
sleep 0.25
|
||||
fi
|
||||
i3-msg "[class=aerc] focus"
|
||||
''
|
||||
)
|
||||
}";
|
||||
};
|
||||
|
||||
programs.fish.shellAbbrs = {
|
||||
ae = "aerc";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,139 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
imports = [
|
||||
./himalaya.nix
|
||||
./aerc.nix
|
||||
./system.nix
|
||||
];
|
||||
|
||||
options = {
|
||||
mail.enable = lib.mkEnableOption "Mail service.";
|
||||
mail.user = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "User name for the email address.";
|
||||
default = config.user;
|
||||
};
|
||||
mail.server = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Server name for the email address.";
|
||||
};
|
||||
mail.imapHost = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Server host for IMAP (reading mail).";
|
||||
};
|
||||
mail.smtpHost = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Server host for SMTP (sending mail).";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mail.enable {
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
programs.mbsync = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# Automatically check for mail and keep files synced locally
|
||||
services.mbsync = lib.mkIf pkgs.stdenv.isLinux {
|
||||
enable = true;
|
||||
frequency = "*:0/5";
|
||||
postExec = "${pkgs.notmuch}/bin/notmuch new";
|
||||
};
|
||||
|
||||
# Used to watch for new mail and trigger sync
|
||||
services.imapnotify.enable = pkgs.stdenv.isLinux;
|
||||
|
||||
# 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 = {
|
||||
|
||||
# Where email files are stored
|
||||
maildirBasePath = "${config.homePath}/mail";
|
||||
|
||||
accounts = {
|
||||
home =
|
||||
let
|
||||
address = "${config.mail.user}@${config.mail.server}";
|
||||
in
|
||||
{
|
||||
userName = address;
|
||||
realName = config.fullName;
|
||||
primary = true;
|
||||
inherit address;
|
||||
aliases = map (user: "${user}@${config.mail.server}") [
|
||||
"me"
|
||||
"hey"
|
||||
"admin"
|
||||
];
|
||||
|
||||
# Options for contact completion
|
||||
alot = { };
|
||||
|
||||
imap = {
|
||||
host = config.mail.imapHost;
|
||||
port = 993;
|
||||
tls.enable = true;
|
||||
};
|
||||
|
||||
# Watch for mail and run notifications or sync
|
||||
imapnotify = {
|
||||
enable = true;
|
||||
boxes = [ "Inbox" ];
|
||||
onNotify = "${pkgs.isync}/bin/mbsync -a";
|
||||
onNotifyPost =
|
||||
lib.mkIf config.home-manager.users.${config.user}.services.dunst.enable
|
||||
"${pkgs.libnotify}/bin/notify-send 'New mail arrived'";
|
||||
};
|
||||
|
||||
# Name of the directory in maildir for this account
|
||||
maildir = {
|
||||
path = "main";
|
||||
};
|
||||
|
||||
# Bi-directional syncing options for local files
|
||||
mbsync = {
|
||||
enable = true;
|
||||
create = "both";
|
||||
expunge = "both";
|
||||
remove = "both";
|
||||
patterns = [ "*" ];
|
||||
extraConfig.channel = {
|
||||
CopyArrivalDate = "yes"; # Sync time of original message
|
||||
};
|
||||
};
|
||||
|
||||
# Enable indexing
|
||||
notmuch.enable = true;
|
||||
|
||||
# Used to login and send and receive emails
|
||||
passwordCommand = "${pkgs.age}/bin/age --decrypt --identity ~/.ssh/id_ed25519 ${pkgs.writeText "mailpass.age" (builtins.readFile ../../../private/mailpass.age)}";
|
||||
|
||||
smtp = {
|
||||
host = config.mail.smtpHost;
|
||||
port = 465;
|
||||
tls.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
|
||||
options.mail.himalaya.enable = lib.mkEnableOption "Himalaya email.";
|
||||
|
||||
config = lib.mkIf config.mail.himalaya.enable {
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.himalaya = {
|
||||
enable = true;
|
||||
};
|
||||
accounts.email.accounts.home.himalaya = {
|
||||
enable = true;
|
||||
settings = {
|
||||
downloads-dir = config.userDirs.download;
|
||||
smtp-insecure = true;
|
||||
};
|
||||
};
|
||||
|
||||
programs.fish.shellAbbrs = {
|
||||
hi = "himalaya";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
config = lib.mkIf (config.mail.enable || config.server) {
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.msmtp.enable = true;
|
||||
|
||||
# The system user for sending automatic notifications
|
||||
accounts.email.accounts.system =
|
||||
let
|
||||
address = "system@${config.mail.server}";
|
||||
in
|
||||
{
|
||||
userName = address;
|
||||
realName = "NixOS System";
|
||||
primary = !config.mail.enable; # Only primary if mail not enabled
|
||||
inherit address;
|
||||
passwordCommand = "${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${pkgs.writeText "mailpass-system.age" (builtins.readFile ../../../private/mailpass-system.age)}";
|
||||
msmtp.enable = true;
|
||||
smtp = {
|
||||
host = config.mail.smtpHost;
|
||||
port = 465;
|
||||
tls.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
neovim = import ./package {
|
||||
inherit pkgs;
|
||||
colors = config.theme.colors;
|
||||
terraform = config.terraform.enable;
|
||||
github = true;
|
||||
kubernetes = config.kubernetes.enable;
|
||||
};
|
||||
in
|
||||
{
|
||||
|
||||
options.neovim.enable = lib.mkEnableOption "Neovim.";
|
||||
|
||||
config = lib.mkIf config.neovim.enable {
|
||||
home-manager.users.${config.user} =
|
||||
|
||||
{
|
||||
|
||||
home.packages = [ neovim ];
|
||||
|
||||
# Use Neovim as the editor for git commit messages
|
||||
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 = {
|
||||
EDITOR = "nvim";
|
||||
MANPAGER = "nvim +Man!";
|
||||
};
|
||||
|
||||
# Create quick aliases for launching Neovim
|
||||
programs.fish = {
|
||||
shellAliases = {
|
||||
vim = "nvim";
|
||||
};
|
||||
shellAbbrs = {
|
||||
v = lib.mkForce "nvim";
|
||||
vl = lib.mkForce "nvim -c 'normal! `0' -c 'bdelete 1'";
|
||||
vll = "nvim -c 'Telescope oldfiles'";
|
||||
};
|
||||
};
|
||||
|
||||
# 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 && config.gui.enable) {
|
||||
name = "Neovim wrapper";
|
||||
exec = "${config.home-manager.users.${config.user}.programs.rofi.terminal} nvim %F";
|
||||
mimeType = [
|
||||
"text/plain"
|
||||
"text/markdown"
|
||||
];
|
||||
};
|
||||
xdg.mimeApps.defaultApplications = lib.mkIf pkgs.stdenv.isLinux {
|
||||
"text/plain" = [ "nvim.desktop" ];
|
||||
"text/markdown" = [ "nvim.desktop" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
|
||||
imports = [
|
||||
./haskell.nix
|
||||
./kubernetes.nix
|
||||
./lua.nix
|
||||
./python.nix
|
||||
./rust.nix
|
||||
./terraform.nix
|
||||
];
|
||||
}
|
@ -1,164 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.kubernetes.enable = lib.mkEnableOption "Kubernetes tools.";
|
||||
|
||||
config = lib.mkIf config.kubernetes.enable {
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
kubectl # Basic Kubernetes queries
|
||||
kubernetes-helm # Helm CLI
|
||||
fluxcd # Bootstrap clusters with Flux
|
||||
kustomize # Kustomize CLI (for Flux)
|
||||
];
|
||||
|
||||
programs.fish.shellAbbrs = {
|
||||
k = "kubectl";
|
||||
pods = "kubectl get pods -A";
|
||||
nodes = "kubectl get nodes";
|
||||
deploys = "kubectl get deployments -A";
|
||||
dash = "kube-dashboard";
|
||||
ks = "k9s";
|
||||
};
|
||||
|
||||
# Terminal Kubernetes UI
|
||||
programs.k9s = {
|
||||
enable = true;
|
||||
settings = {
|
||||
k9s = {
|
||||
ui = {
|
||||
enableMouse = true;
|
||||
headless = true;
|
||||
logoless = true;
|
||||
crumbsless = false;
|
||||
skin = "main";
|
||||
};
|
||||
};
|
||||
};
|
||||
skins = {
|
||||
main = {
|
||||
k9s = {
|
||||
body = {
|
||||
fgColor = config.theme.colors.base06;
|
||||
bgColor = "default";
|
||||
logoColor = config.theme.colors.base02; # *blue ?
|
||||
};
|
||||
# Search bar
|
||||
prompt = {
|
||||
fgColor = config.theme.colors.base06;
|
||||
bgColor = "default";
|
||||
suggestColor = config.theme.colors.base03;
|
||||
};
|
||||
# Header left side
|
||||
info = {
|
||||
fgColor = config.theme.colors.base04;
|
||||
sectionColor = config.theme.colors.base05;
|
||||
};
|
||||
dialog = {
|
||||
fgColor = config.theme.colors.base06;
|
||||
bgColor = "default";
|
||||
buttonFgColor = config.theme.colors.base06;
|
||||
buttonBgColor = config.theme.colors.base0E;
|
||||
buttonFocusFgColor = config.theme.colors.base07;
|
||||
buttonFocusBgColor = config.theme.colors.base02; # *cyan
|
||||
labelFgColor = config.theme.colors.base09;
|
||||
fieldFgColor = config.theme.colors.base06;
|
||||
};
|
||||
frame = {
|
||||
border = {
|
||||
fgColor = config.theme.colors.base01;
|
||||
focusColor = config.theme.colors.base06;
|
||||
};
|
||||
menu = {
|
||||
fgColor = config.theme.colors.base06;
|
||||
keyColor = config.theme.colors.base0E; # *magenta
|
||||
numKeyColor = config.theme.colors.base0E; # *magenta
|
||||
};
|
||||
crumbs = {
|
||||
fgColor = config.theme.colors.base06;
|
||||
bgColor = config.theme.colors.base01;
|
||||
activeColor = config.theme.colors.base03;
|
||||
};
|
||||
status = {
|
||||
newColor = config.theme.colors.base04; # *cyan
|
||||
modifyColor = config.theme.colors.base0D; # *blue
|
||||
addColor = config.theme.colors.base0B; # *green
|
||||
errorColor = config.theme.colors.base08; # *red
|
||||
highlightColor = config.theme.colors.base09; # *orange
|
||||
killColor = config.theme.colors.base03; # *comment
|
||||
completedColor = config.theme.colors.base03; # *comment
|
||||
};
|
||||
title = {
|
||||
fgColor = config.theme.colors.base06;
|
||||
bgColor = "default";
|
||||
highlightColor = config.theme.colors.base09; # *orange
|
||||
counterColor = config.theme.colors.base0D; # *blue
|
||||
filterColor = config.theme.colors.base0E; # *magenta
|
||||
};
|
||||
};
|
||||
views = {
|
||||
charts = {
|
||||
bgColor = "default";
|
||||
defaultDialColors = [
|
||||
config.theme.colors.base0D
|
||||
config.theme.colors.base08
|
||||
];
|
||||
# - *blue
|
||||
# - *red
|
||||
defaultChartColors = [
|
||||
config.theme.colors.base0D
|
||||
config.theme.colors.base08
|
||||
];
|
||||
# - *blue
|
||||
# - *red
|
||||
};
|
||||
table = {
|
||||
# List of resources
|
||||
fgColor = config.theme.colors.base06;
|
||||
bgColor = "default";
|
||||
|
||||
# Row selection
|
||||
cursorFgColor = config.theme.colors.base07;
|
||||
cursorBgColor = config.theme.colors.base01;
|
||||
|
||||
# Header row
|
||||
header = {
|
||||
fgColor = config.theme.colors.base0D;
|
||||
bgColor = "default";
|
||||
sorterColor = config.theme.colors.base0A; # *selection
|
||||
};
|
||||
};
|
||||
xray = {
|
||||
fgColor = config.theme.colors.base06;
|
||||
bgColor = "default";
|
||||
cursorColor = config.theme.colors.base06;
|
||||
graphicColor = config.theme.colors.base0D;
|
||||
showIcons = false;
|
||||
};
|
||||
yaml = {
|
||||
keyColor = config.theme.colors.base0D;
|
||||
colonColor = config.theme.colors.base04;
|
||||
fgColor = config.theme.colors.base03;
|
||||
};
|
||||
logs = {
|
||||
fgColor = config.theme.colors.base06;
|
||||
bgColor = "default";
|
||||
indicator = {
|
||||
fgColor = config.theme.colors.base06;
|
||||
bgColor = "default";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.lua.enable = lib.mkEnableOption "Lua programming language.";
|
||||
|
||||
config = lib.mkIf config.lua.enable {
|
||||
home-manager.users.${config.user}.home.packages = with pkgs; [
|
||||
stylua # Lua formatter
|
||||
sumneko-lua-language-server # Lua LSP
|
||||
];
|
||||
};
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.python.enable = lib.mkEnableOption "Python programming language.";
|
||||
|
||||
config = lib.mkIf config.python.enable {
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
# python310 # Standard Python interpreter
|
||||
pyright # Python language server
|
||||
black # Python formatter
|
||||
python310Packages.flake8 # Python linter
|
||||
];
|
||||
|
||||
programs.fish.shellAbbrs = {
|
||||
py = "python3";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.rust.enable = lib.mkEnableOption "Rust programming language.";
|
||||
|
||||
config = lib.mkIf config.rust.enable {
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.fish.shellAbbrs = {
|
||||
ca = "cargo";
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
cargo
|
||||
rustc
|
||||
clippy
|
||||
gcc
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options.terraform.enable = lib.mkEnableOption "Terraform tools.";
|
||||
|
||||
config = lib.mkIf config.terraform.enable {
|
||||
unfreePackages = [ "terraform" ];
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
programs.fish.shellAbbrs = {
|
||||
# Terraform
|
||||
te = "terraform";
|
||||
};
|
||||
home.packages = with pkgs; [
|
||||
terraform # Terraform executable
|
||||
terraform-ls # Language server
|
||||
tflint # Linter
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
|
||||
imports = [
|
||||
./dotfiles.nix
|
||||
./notes.nix
|
||||
];
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# Allows me to make sure I can work on my dotfiles locally
|
||||
|
||||
options.dotfiles.enable = lib.mkEnableOption "Clone dotfiles.";
|
||||
|
||||
config = lib.mkIf config.dotfiles.enable {
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.activation = {
|
||||
|
||||
# Always clone dotfiles repository if it doesn't exist
|
||||
cloneDotfiles = config.home-manager.users.${config.user}.lib.dag.entryAfter [ "writeBoundary" ] ''
|
||||
if [ ! -d "${config.dotfilesPath}" ]; then
|
||||
$DRY_RUN_CMD mkdir --parents $VERBOSE_ARG $(dirname "${config.dotfilesPath}")
|
||||
$DRY_RUN_CMD ${pkgs.git}/bin/git \
|
||||
clone ${config.dotfilesRepo} "${config.dotfilesPath}"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
# Set a variable for dotfiles repo, not necessary but convenient
|
||||
home.sessionVariables.DOTS = config.dotfilesPath;
|
||||
};
|
||||
};
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# This is just a placeholder as I expect to interact with my notes in a
|
||||
# certain location
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.sessionVariables = {
|
||||
NOTES_PATH = "${config.homePath}/dev/personal/notes/content";
|
||||
};
|
||||
|
||||
# Sync notes for Nextcloud automatically
|
||||
systemd.user.timers.refresh-notes = lib.mkIf config.services.nextcloud.enable {
|
||||
Timer = {
|
||||
OnCalendar = "*-*-* *:0/10:50"; # Every 10 minutes
|
||||
Unit = "refresh-notes.service";
|
||||
};
|
||||
};
|
||||
systemd.user.services.refresh-notes = {
|
||||
Unit.Description = "Get latest notes.";
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStartPre = "${pkgs.git}/bin/git -C /data/git/notes reset --hard master";
|
||||
ExecStart = "${pkgs.git}/bin/git -C /data/git/notes pull";
|
||||
WorkingDirectory = config.homePath;
|
||||
Environment = "PATH=${pkgs.openssh}/bin";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
{ config, lib, ... }:
|
||||
{
|
||||
|
||||
# Shell history sync
|
||||
|
||||
options.atuin.enable = lib.mkEnableOption "Atuin";
|
||||
|
||||
config = {
|
||||
|
||||
home-manager.users.${config.user} = lib.mkIf config.atuin.enable {
|
||||
|
||||
programs.atuin = {
|
||||
enable = true;
|
||||
flags = [
|
||||
"--disable-up-arrow"
|
||||
"--disable-ctrl-r"
|
||||
];
|
||||
settings = {
|
||||
auto_sync = true;
|
||||
update_check = false;
|
||||
sync_address = "https://api.atuin.sh";
|
||||
search_mode = "fuzzy";
|
||||
filter_mode = "host"; # global, host, session, directory
|
||||
search_mode_shell_up_key_binding = "fuzzy";
|
||||
filter_mode_shell_up_key_binding = "session";
|
||||
style = "compact"; # or auto,full
|
||||
show_help = true;
|
||||
history_filter = [ ];
|
||||
secrets_filter = true;
|
||||
enter_accept = false;
|
||||
keymap_mode = "vim-normal";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Give root user the same setup
|
||||
home-manager.users.root.programs.atuin = config.home-manager.users.${config.user}.programs.atuin;
|
||||
};
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
config = {
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
shellAliases = config.home-manager.users.${config.user}.programs.fish.shellAliases;
|
||||
initExtra = "";
|
||||
profileExtra = "";
|
||||
};
|
||||
|
||||
programs.starship.enableBashIntegration = false;
|
||||
programs.zoxide.enableBashIntegration = true;
|
||||
programs.fzf.enableBashIntegration = true;
|
||||
};
|
||||
};
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# Convenience utilities from charm.sh
|
||||
|
||||
options.charm.enable = lib.mkEnableOption "Charm utilities.";
|
||||
|
||||
config.home-manager.users.${config.user} = lib.mkIf config.charm.enable {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
glow # Markdown previews
|
||||
skate # Key-value store
|
||||
charm # Manage account and filesystem
|
||||
pop # Send emails from a TUI
|
||||
];
|
||||
};
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./atuin.nix
|
||||
./bash
|
||||
./charm.nix
|
||||
./direnv.nix
|
||||
./fish
|
||||
./fzf.nix
|
||||
./git.nix
|
||||
./github.nix
|
||||
./jujutsu.nix
|
||||
./nixpkgs.nix
|
||||
./starship.nix
|
||||
./utilities.nix
|
||||
./work.nix
|
||||
];
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
|
||||
# Enables quickly entering Nix shells when changing directories
|
||||
home-manager.users.${config.user}.programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
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
|
||||
nix.extraOptions = ''
|
||||
keep-outputs = true
|
||||
keep-derivations = true
|
||||
'';
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
set vimfile (fzf)
|
||||
and set vimfile (echo $vimfile | tr -d '\r')
|
||||
and commandline -r "vim \"$vimfile\""
|
||||
and commandline -f execute
|
@ -1,22 +0,0 @@
|
||||
bind -M insert \co edit
|
||||
bind -M default \co edit
|
||||
bind -M insert \cs search-and-edit
|
||||
bind -M default \cs search-and-edit
|
||||
bind -M insert \ca 'cd ~; and edit; and commandline -a "; cd -"; commandline -f execute'
|
||||
bind -M default \ca 'cd ~; and edit; and commandline -a "; cd -"; commandline -f execute'
|
||||
bind -M insert \ce recent
|
||||
bind -M default \ce recent
|
||||
bind -M default \cg commandline-git-commits
|
||||
bind -M insert \cg 'commandline -i (git rev-parse --show-toplevel 2>/dev/null || echo ".")'
|
||||
bind -M insert \cf fcd
|
||||
bind -M default \cf fcd
|
||||
bind -M insert \cp projects
|
||||
bind -M default \cp projects
|
||||
bind -M insert \x1F accept-autosuggestion
|
||||
bind -M default \x1F accept-autosuggestion
|
||||
bind -M insert \cn 'commandline -r "nix shell nixpkgs#"'
|
||||
bind -M default \cn 'commandline -r "nix shell nixpkgs#"'
|
||||
bind -M insert \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'
|
@ -1,122 +0,0 @@
|
||||
#!/usr/local/bin/fish
|
||||
|
||||
function fish_vi_cursor -d 'Set cursor shape for different vi modes'
|
||||
# If we're not interactive, there is effectively no bind mode.
|
||||
if not status is-interactive
|
||||
return
|
||||
end
|
||||
|
||||
# This is hard to test in expect, since the exact sequences depend on the environment.
|
||||
# Instead disable it.
|
||||
if set -q FISH_UNIT_TESTS_RUNNING
|
||||
return
|
||||
end
|
||||
|
||||
# If this variable is set, skip all checks
|
||||
if not set -q fish_vi_force_cursor
|
||||
|
||||
# Emacs Makes All Cursors Suck
|
||||
if set -q INSIDE_EMACS
|
||||
return
|
||||
end
|
||||
|
||||
# vte-based terms set $TERM = xterm*, but only gained support in 2015.
|
||||
# From https://bugzilla.gnome.org/show_bug.cgi?id=720821, it appears it was version 0.40.0
|
||||
if set -q VTE_VERSION
|
||||
and test "$VTE_VERSION" -lt 4000 2>/dev/null
|
||||
return
|
||||
end
|
||||
|
||||
# Similarly, genuine XTerm can do it since v280.
|
||||
if set -q XTERM_VERSION
|
||||
and not test (string replace -r "XTerm\((\d+)\)" '$1' -- "$XTERM_VERSION") -ge 280 2>/dev/null
|
||||
return
|
||||
end
|
||||
|
||||
# We need one of these terms.
|
||||
# It would be lovely if we could rely on terminfo, but:
|
||||
# - The "Ss" entry isn't a thing in macOS' old and crusty terminfo
|
||||
# - It is set for xterm, and everyone and their dog claims to be xterm
|
||||
#
|
||||
# So we just don't care about $TERM, unless it is one of the few terminals that actually have their own entry.
|
||||
#
|
||||
# Note: Previous versions also checked $TMUX, and made sure that then $TERM was screen* or tmux*.
|
||||
# We don't care, since we *cannot* handle term-in-a-terms 100% correctly.
|
||||
if not set -q KONSOLE_PROFILE_NAME
|
||||
and not test -n "$KONSOLE_VERSION" -a "$KONSOLE_VERSION" -ge 200400 # konsole, but new.
|
||||
and not set -q ITERM_PROFILE
|
||||
and not set -q VTE_VERSION # which version is already checked above
|
||||
and not set -q WT_PROFILE_ID
|
||||
and not set -q XTERM_VERSION
|
||||
and not string match -rq '^st(-.*)$' -- $TERM
|
||||
and not string match -q 'xterm-kitty*' -- $TERM
|
||||
and not string match -q 'rxvt*' -- $TERM
|
||||
and not string match -q 'alacritty*' -- $TERM
|
||||
return
|
||||
end
|
||||
|
||||
# HACK: Explicitly disable on ITERM because of #3696, which is weirdness with multi-line prompts.
|
||||
# --force-iterm is now deprecated; set $fish_vi_force_cursor instead
|
||||
if contains -- $argv[1] --force-iterm
|
||||
set -e argv[1]
|
||||
else if set -q ITERM_PROFILE
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
set -l terminal $argv[1]
|
||||
set -q terminal[1]
|
||||
or set terminal auto
|
||||
|
||||
set -l function
|
||||
switch "$terminal"
|
||||
case auto
|
||||
# Nowadays, konsole does not set $KONSOLE_PROFILE_NAME anymore,
|
||||
# and it uses the xterm sequences.
|
||||
if set -q KONSOLE_PROFILE_NAME
|
||||
set function __fish_cursor_konsole
|
||||
else if set -q ITERM_PROFILE
|
||||
set function __fish_cursor_1337
|
||||
else
|
||||
set function __fish_cursor_xterm
|
||||
end
|
||||
case konsole
|
||||
set function __fish_cursor_konsole
|
||||
case xterm
|
||||
set function __fish_cursor_xterm
|
||||
end
|
||||
|
||||
set -l tmux_prefix
|
||||
set -l tmux_postfix
|
||||
if set -q TMUX
|
||||
set tmux_prefix echo -ne "'\ePtmux;\e'"
|
||||
set tmux_postfix echo -ne "'\e\\\\'"
|
||||
end
|
||||
|
||||
set -q fish_cursor_unknown
|
||||
or set -g fish_cursor_unknown block blink
|
||||
|
||||
echo "
|
||||
function fish_vi_cursor_handle --on-variable fish_bind_mode --on-event fish_postexec --on-event fish_focus_in
|
||||
set -l varname fish_cursor_\$fish_bind_mode
|
||||
if not set -q \$varname
|
||||
set varname fish_cursor_unknown
|
||||
end
|
||||
$tmux_prefix
|
||||
$function \$\$varname
|
||||
$tmux_postfix
|
||||
end
|
||||
" | source
|
||||
|
||||
echo "
|
||||
function fish_vi_cursor_handle_preexec --on-event fish_preexec
|
||||
set -l varname fish_cursor_default
|
||||
if not set -q \$varname
|
||||
set varname fish_cursor_unknown
|
||||
end
|
||||
$tmux_prefix
|
||||
$function \$\$varname
|
||||
$tmux_postfix
|
||||
end
|
||||
" | source
|
||||
end
|
@ -1,4 +0,0 @@
|
||||
set vimfile (fd -t f --exec /usr/bin/stat -f "%m%t%N" | sort -nr | cut -f2 | fzf)
|
||||
and set vimfile (echo $vimfile | tr -d '\r')
|
||||
and commandline -r "vim $vimfile"
|
||||
and commandline -f execute
|
@ -1,21 +0,0 @@
|
||||
set vimfile ( \
|
||||
rg \
|
||||
--color=always \
|
||||
--line-number \
|
||||
--no-heading \
|
||||
--smart-case \
|
||||
--iglob "!/Library/**" \
|
||||
--iglob "!/System/**" \
|
||||
--iglob "!Users/$HOME/Library/*" \
|
||||
".*" \
|
||||
| fzf --ansi \
|
||||
--height "80%" \
|
||||
--color "hl:-1:underline,hl+:-1:underline:reverse" \
|
||||
--delimiter : \
|
||||
--preview 'bat --color=always {1} --highlight-line {2}' \
|
||||
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3'
|
||||
)
|
||||
and set line_number (echo $vimfile | tr -d '\r' | cut -d':' -f2)
|
||||
and set vimfile (echo $vimfile | tr -d '\r' | cut -d':' -f1)
|
||||
and commandline -r "vim +$line_number $vimfile"
|
||||
and commandline -f execute
|
@ -1,56 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
|
||||
# FZF is a fuzzy-finder for the terminal
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.fzf.enable = true;
|
||||
|
||||
programs.fish = {
|
||||
functions = {
|
||||
projects = {
|
||||
description = "Jump to a project";
|
||||
body = ''
|
||||
set projdir ( \
|
||||
fd \
|
||||
--search-path $HOME/dev \
|
||||
--type directory \
|
||||
--exact-depth 2 \
|
||||
| ${pkgs.proximity-sort}/bin/proximity-sort $PWD \
|
||||
| sed 's/\\/$//' \
|
||||
| fzf --tiebreak=index \
|
||||
)
|
||||
and cd $projdir
|
||||
and commandline -f execute
|
||||
'';
|
||||
};
|
||||
};
|
||||
shellAbbrs = {
|
||||
lsf = "ls -lh | fzf";
|
||||
};
|
||||
};
|
||||
|
||||
# Global fzf configuration
|
||||
home.sessionVariables =
|
||||
let
|
||||
fzfCommand = "fd --type file";
|
||||
in
|
||||
{
|
||||
FZF_DEFAULT_COMMAND = fzfCommand;
|
||||
FZF_CTRL_T_COMMAND = fzfCommand;
|
||||
FZF_DEFAULT_OPTS = "-m --height 50% --border";
|
||||
};
|
||||
|
||||
home.packages = [
|
||||
(pkgs.writeShellApplication {
|
||||
name = "jqr";
|
||||
runtimeInputs = [
|
||||
pkgs.jq
|
||||
pkgs.fzf
|
||||
];
|
||||
text = builtins.readFile ./bash/scripts/jqr.sh;
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
@ -1,195 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
home-packages = config.home-manager.users.${config.user}.home.packages;
|
||||
in
|
||||
{
|
||||
|
||||
options = {
|
||||
gitName = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Name to use for git commits";
|
||||
};
|
||||
gitEmail = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Email to use for git commits";
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
|
||||
home-manager.users.root.programs.git = {
|
||||
enable = true;
|
||||
extraConfig.safe.directory = config.dotfilesPath;
|
||||
};
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = config.gitName;
|
||||
userEmail = config.gitEmail;
|
||||
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";
|
||||
};
|
||||
safe = {
|
||||
directory = config.dotfilesPath;
|
||||
};
|
||||
pull = {
|
||||
ff = "only";
|
||||
};
|
||||
push = {
|
||||
autoSetupRemote = "true";
|
||||
};
|
||||
init = {
|
||||
defaultBranch = "master";
|
||||
};
|
||||
rebase = {
|
||||
autosquash = "true";
|
||||
};
|
||||
gpg = {
|
||||
format = "ssh";
|
||||
ssh.allowedSignersFile = "~/.config/git/allowed-signers";
|
||||
};
|
||||
# commit.gpgsign = true;
|
||||
# tag.gpgsign = true;
|
||||
};
|
||||
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"
|
||||
signingkey = ~/.ssh/id_ed25519
|
||||
[commit]
|
||||
gpgsign = true
|
||||
[tag]
|
||||
gpgsign = true
|
||||
'';
|
||||
|
||||
xdg.configFile."git/allowed-signers".text = ''
|
||||
7386960+nmasur@users.noreply.github.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s
|
||||
'';
|
||||
|
||||
programs.fish.shellAbbrs = {
|
||||
g = "git";
|
||||
gs = "git status";
|
||||
gd = "git diff";
|
||||
gds = "git diff --staged";
|
||||
gdp = "git diff HEAD^";
|
||||
ga = "git add";
|
||||
gaa = "git add -A";
|
||||
gac = "git commit -am";
|
||||
gc = "git commit -m";
|
||||
gca = "git commit --amend --no-edit";
|
||||
gcae = "git commit --amend";
|
||||
gu = "git pull";
|
||||
gp = "git push";
|
||||
gl = "git log --graph --decorate --oneline -20";
|
||||
gll = "git log --graph --decorate --oneline";
|
||||
gco = "git checkout";
|
||||
gcom = ''git switch (git symbolic-ref refs/remotes/origin/HEAD | cut -d"/" -f4)'';
|
||||
gcob = "git switch -c";
|
||||
gb = "git branch";
|
||||
gpd = "git push origin -d";
|
||||
gbd = "git branch -d";
|
||||
gbD = "git branch -D";
|
||||
gdd = {
|
||||
position = "anywhere";
|
||||
setCursor = true;
|
||||
expansion = "BRANCH=% git push origin -d $BRANCH and git branch -d $BRANCH";
|
||||
};
|
||||
gr = "git reset";
|
||||
grh = "git reset --hard";
|
||||
gm = "git merge";
|
||||
gcp = "git cherry-pick";
|
||||
cdg = "cd (git rev-parse --show-toplevel)";
|
||||
};
|
||||
|
||||
# Required for fish commands
|
||||
home.packages = with pkgs; [
|
||||
fish
|
||||
fzf
|
||||
bat
|
||||
];
|
||||
|
||||
programs.fish.functions =
|
||||
lib.mkIf (builtins.elem pkgs.fzf home-packages && builtins.elem pkgs.bat home-packages)
|
||||
{
|
||||
git = {
|
||||
body = builtins.readFile ./fish/functions/git.fish;
|
||||
};
|
||||
git-add-fuzzy = {
|
||||
body = builtins.readFile ./fish/functions/git-add-fuzzy.fish;
|
||||
};
|
||||
git-fuzzy-branch = {
|
||||
argumentNames = "header";
|
||||
body = builtins.readFile ./fish/functions/git-fuzzy-branch.fish;
|
||||
};
|
||||
git-checkout-fuzzy = {
|
||||
body = ''
|
||||
set branch (git-fuzzy-branch "checkout branch...")
|
||||
and git checkout $branch
|
||||
'';
|
||||
};
|
||||
git-delete-fuzzy = {
|
||||
body = ''
|
||||
set branch (git-fuzzy-branch "delete branch...")
|
||||
and git branch -d $branch
|
||||
'';
|
||||
};
|
||||
git-force-delete-fuzzy = {
|
||||
body = ''
|
||||
set branch (git-fuzzy-branch "force delete branch...")
|
||||
and git branch -D $branch
|
||||
'';
|
||||
};
|
||||
git-delete-both = {
|
||||
argumentNames = "branch";
|
||||
body = ''
|
||||
git push origin -d $branch
|
||||
git branch -d $branch
|
||||
'';
|
||||
};
|
||||
git-merge-fuzzy = {
|
||||
body = ''
|
||||
set branch (git-fuzzy-branch "merge from...")
|
||||
and git merge $branch
|
||||
'';
|
||||
};
|
||||
git-show-fuzzy = {
|
||||
body = builtins.readFile ./fish/functions/git-show-fuzzy.fish;
|
||||
};
|
||||
git-commits = {
|
||||
body = builtins.readFile ./fish/functions/git-commits.fish;
|
||||
};
|
||||
git-history = {
|
||||
body = builtins.readFile ./fish/functions/git-history.fish;
|
||||
};
|
||||
uncommitted = {
|
||||
description = "Find uncommitted git repos";
|
||||
body = builtins.readFile ./fish/functions/uncommitted.fish;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,18 +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;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,133 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.fish = {
|
||||
shellAbbrs = {
|
||||
n = "nix";
|
||||
ns = "nix-shell -p";
|
||||
nsf = "nix-shell --run fish -p";
|
||||
nsr = "nix-shell-run";
|
||||
nps = "nix repl --expr 'import <nixpkgs>{}'";
|
||||
nixo = "man configuration.nix";
|
||||
nixh = "man home-configuration.nix";
|
||||
nr = {
|
||||
function = "rebuild-nixos";
|
||||
};
|
||||
nro = {
|
||||
function = "rebuild-nixos-offline";
|
||||
};
|
||||
hm = {
|
||||
function = "rebuild-home";
|
||||
};
|
||||
};
|
||||
functions = {
|
||||
nix-shell-run = {
|
||||
body = ''
|
||||
set program $argv[1]
|
||||
if test (count $argv) -ge 2
|
||||
commandline -r "nix run nixpkgs#$program -- $argv[2..-1]"
|
||||
else
|
||||
commandline -r "nix run nixpkgs#$program"
|
||||
end
|
||||
commandline -f execute
|
||||
'';
|
||||
};
|
||||
nix-fzf = {
|
||||
body = ''
|
||||
commandline -i (nix-instantiate --eval --json \
|
||||
-E 'builtins.attrNames (import <nixpkgs> {})' \
|
||||
| jq '.[]' -r | fzf)
|
||||
commandline -f repaint
|
||||
'';
|
||||
};
|
||||
rebuild-nixos = {
|
||||
body = ''
|
||||
git -C ${config.dotfilesPath} add --intent-to-add --all
|
||||
echo "doas nixos-rebuild switch --flake ${config.dotfilesPath}#${config.networking.hostName}"
|
||||
'';
|
||||
};
|
||||
rebuild-nixos-offline = {
|
||||
body = ''
|
||||
git -C ${config.dotfilesPath} add --intent-to-add --all
|
||||
echo "doas nixos-rebuild switch --option substitute false --flake ${config.dotfilesPath}#${config.networking.hostName}"
|
||||
'';
|
||||
};
|
||||
rebuild-home = {
|
||||
body = ''
|
||||
git -C ${config.dotfilesPath} add --intent-to-add --all
|
||||
echo "${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#${config.networking.hostName}";
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Provides "command-not-found" options
|
||||
programs.nix-index = {
|
||||
enable = 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 = {
|
||||
|
||||
# Set channel to flake packages, used for nix-shell commands
|
||||
nixPath = [ "nixpkgs=${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;
|
||||
};
|
||||
};
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
home-manager.users.${config.user}.programs.starship = {
|
||||
enable = true;
|
||||
settings = {
|
||||
add_newline = false; # Don't print new line at the start of the prompt
|
||||
format = lib.concatStrings [
|
||||
"$directory"
|
||||
"$git_branch"
|
||||
"$git_commit"
|
||||
"$git_status"
|
||||
"$hostname"
|
||||
"$cmd_duration"
|
||||
"$character"
|
||||
];
|
||||
right_format = "$nix_shell";
|
||||
character = {
|
||||
success_symbol = "[❯](bold green)";
|
||||
error_symbol = "[❯](bold red)";
|
||||
vicmd_symbol = "[❮](bold green)";
|
||||
};
|
||||
cmd_duration = {
|
||||
min_time = 5000;
|
||||
show_notifications = if pkgs.stdenv.isLinux then false else true;
|
||||
min_time_to_notify = 30000;
|
||||
format = "[$duration]($style) ";
|
||||
};
|
||||
directory = {
|
||||
truncate_to_repo = true;
|
||||
truncation_length = 100;
|
||||
};
|
||||
git_branch = {
|
||||
format = "[$symbol$branch]($style)";
|
||||
};
|
||||
git_commit = {
|
||||
format = "( @ [$hash]($style) )";
|
||||
only_detached = false;
|
||||
};
|
||||
git_status = {
|
||||
format = "([$all_status$ahead_behind]($style) )";
|
||||
conflicted = "=";
|
||||
ahead = "⇡";
|
||||
behind = "⇣";
|
||||
diverged = "⇕";
|
||||
untracked = "⋄";
|
||||
stashed = "⩮";
|
||||
modified = "∽";
|
||||
staged = "+";
|
||||
renamed = "»";
|
||||
deleted = "✘";
|
||||
style = "red";
|
||||
};
|
||||
hostname = {
|
||||
ssh_only = true;
|
||||
format = "on [$hostname](bold red) ";
|
||||
};
|
||||
nix_shell = {
|
||||
format = "[$symbol $name]($style)";
|
||||
symbol = "❄️";
|
||||
};
|
||||
python = {
|
||||
format = "[\${version}\\(\${virtualenv}\\)]($style)";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
|
||||
ignorePatterns = ''
|
||||
!.env*
|
||||
!.github/
|
||||
!.gitignore
|
||||
!*.tfvars
|
||||
.terraform/
|
||||
.target/
|
||||
/Library/'';
|
||||
in
|
||||
{
|
||||
|
||||
config = {
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
age # Encryption
|
||||
bc # Calculator
|
||||
delta # Fancy diffs
|
||||
difftastic # Other fancy diffs
|
||||
dig # DNS lookup
|
||||
fd # find
|
||||
htop # Show system processes
|
||||
killall # Force quit
|
||||
inetutils # Includes telnet, whois
|
||||
jless # JSON viewer
|
||||
jo # JSON output
|
||||
jq # JSON manipulation
|
||||
lf # File viewer
|
||||
osc # Clipboard over SSH
|
||||
qrencode # Generate qr codes
|
||||
rsync # Copy folders
|
||||
# ren # Rename files
|
||||
# rep # Replace text in files
|
||||
ripgrep # grep
|
||||
sd # sed
|
||||
spacer # Output lines in terminal
|
||||
tealdeer # Cheatsheets
|
||||
tree # View directory hierarchy
|
||||
vimv-rs # Batch rename files
|
||||
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
|
||||
|
||||
home.file = {
|
||||
".rgignore".text = ignorePatterns;
|
||||
".digrc".text = "+noall +answer"; # Cleaner dig commands
|
||||
};
|
||||
|
||||
xdg.configFile."fd/ignore".text = ignorePatterns;
|
||||
|
||||
programs.bat = {
|
||||
enable = true; # cat replacement
|
||||
config = {
|
||||
theme = config.theme.colors.batTheme;
|
||||
pager = "less -R"; # Don't auto-exit if one screen
|
||||
};
|
||||
};
|
||||
|
||||
programs.fish.functions = {
|
||||
ping = {
|
||||
description = "Improved ping";
|
||||
argumentNames = "target";
|
||||
body = "${pkgs.prettyping}/bin/prettyping --nolegend $target";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,656 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# MacOS-specific settings for Alacritty
|
||||
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
programs.alacritty.settings = {
|
||||
font.size = lib.mkForce 20.0;
|
||||
shell.program = "${pkgs.fish}/bin/fish";
|
||||
window.startup_mode = "SimpleFullScreen";
|
||||
key_bindings = [
|
||||
{
|
||||
key = "F";
|
||||
mods = "Super";
|
||||
action = "ToggleSimpleFullscreen";
|
||||
}
|
||||
{
|
||||
key = "F";
|
||||
mods = "Control|Shift";
|
||||
action = "SearchForward";
|
||||
}
|
||||
{
|
||||
key = "L";
|
||||
mods = "Super";
|
||||
chars = "\\x1F";
|
||||
}
|
||||
# Some Mac key combinations need to be manually added
|
||||
{
|
||||
key = "Return";
|
||||
mods = "Shift";
|
||||
chars = "\\x1b[13;2u";
|
||||
}
|
||||
{
|
||||
key = "Return";
|
||||
mods = "Control";
|
||||
chars = "\\x1b[13;5u";
|
||||
}
|
||||
{
|
||||
key = "Return";
|
||||
mods = "Control|Shift";
|
||||
chars = "\\x1b[13;6u";
|
||||
}
|
||||
|
||||
{
|
||||
key = "N";
|
||||
mods = "Command";
|
||||
action = "SpawnNewInstance";
|
||||
}
|
||||
{
|
||||
key = "PageUp";
|
||||
action = "ScrollPageUp";
|
||||
}
|
||||
{
|
||||
key = "PageUp";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B[5~";
|
||||
}
|
||||
{
|
||||
key = "PageUp";
|
||||
mods = "Shift";
|
||||
chars = "\\x1B[5~";
|
||||
}
|
||||
{
|
||||
key = "PageDown";
|
||||
action = "ScrollPageDown";
|
||||
}
|
||||
{
|
||||
key = "PageDown";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B[6~";
|
||||
}
|
||||
{
|
||||
key = "PageDown";
|
||||
mods = "Shift";
|
||||
chars = "\\x1B[6~";
|
||||
}
|
||||
{
|
||||
key = "Home";
|
||||
action = "ScrollToTop";
|
||||
}
|
||||
{
|
||||
key = "Home";
|
||||
mods = "Alt";
|
||||
chars = "\\x1BOH";
|
||||
}
|
||||
{
|
||||
key = "Home";
|
||||
mods = "Shift";
|
||||
chars = "\\x1B[H";
|
||||
}
|
||||
{
|
||||
key = "End";
|
||||
action = "ScrollToBottom";
|
||||
}
|
||||
{
|
||||
key = "End";
|
||||
mods = "Alt";
|
||||
chars = "\\x1BOF";
|
||||
}
|
||||
{
|
||||
key = "End";
|
||||
mods = "Shift";
|
||||
chars = "\\x1B[F";
|
||||
}
|
||||
{
|
||||
key = "Tab";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B ";
|
||||
}
|
||||
{
|
||||
key = "Tab";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1Bx1B[Z";
|
||||
}
|
||||
# {
|
||||
# key = "Back";
|
||||
# chars = "\\x7F";
|
||||
# }
|
||||
{
|
||||
key = "Back";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bx7F";
|
||||
}
|
||||
{
|
||||
key = "Back";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1Bx08";
|
||||
}
|
||||
{
|
||||
key = "Space";
|
||||
mods = "Control";
|
||||
chars = "\\x00";
|
||||
}
|
||||
{
|
||||
key = "Space";
|
||||
mods = "Alt";
|
||||
chars = "\\x20";
|
||||
}
|
||||
{
|
||||
key = "Left";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bb";
|
||||
}
|
||||
{
|
||||
key = "Left";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1Bx1B[D";
|
||||
}
|
||||
{
|
||||
key = "Right";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bf";
|
||||
}
|
||||
{
|
||||
key = "Right";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1Bx1B[C";
|
||||
}
|
||||
{
|
||||
key = "Down";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bx1B[B";
|
||||
}
|
||||
{
|
||||
key = "Down";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1Bx1B[B";
|
||||
}
|
||||
{
|
||||
key = "Up";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bx1B[A";
|
||||
}
|
||||
{
|
||||
key = "Up";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1Bx1B[A";
|
||||
}
|
||||
{
|
||||
key = "A";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Ba";
|
||||
}
|
||||
{
|
||||
key = "A";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BA";
|
||||
}
|
||||
{
|
||||
key = "B";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bb";
|
||||
}
|
||||
{
|
||||
key = "B";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BB";
|
||||
}
|
||||
{
|
||||
key = "C";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bc";
|
||||
}
|
||||
{
|
||||
key = "C";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BC";
|
||||
}
|
||||
{
|
||||
key = "D";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bd";
|
||||
}
|
||||
{
|
||||
key = "D";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BD";
|
||||
}
|
||||
{
|
||||
key = "E";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Be";
|
||||
}
|
||||
{
|
||||
key = "E";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BE";
|
||||
}
|
||||
{
|
||||
key = "F";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bf";
|
||||
}
|
||||
{
|
||||
key = "F";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BF";
|
||||
}
|
||||
{
|
||||
key = "G";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bg";
|
||||
}
|
||||
{
|
||||
key = "G";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BG";
|
||||
}
|
||||
{
|
||||
key = "H";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bh";
|
||||
}
|
||||
{
|
||||
key = "H";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BH";
|
||||
}
|
||||
{
|
||||
key = "I";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bi";
|
||||
}
|
||||
{
|
||||
key = "I";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BI";
|
||||
}
|
||||
{
|
||||
key = "J";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bj";
|
||||
}
|
||||
{
|
||||
key = "J";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BJ";
|
||||
}
|
||||
{
|
||||
key = "K";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bk";
|
||||
}
|
||||
{
|
||||
key = "K";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BK";
|
||||
}
|
||||
{
|
||||
key = "L";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bl";
|
||||
}
|
||||
{
|
||||
key = "L";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BL";
|
||||
}
|
||||
{
|
||||
key = "M";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bm";
|
||||
}
|
||||
{
|
||||
key = "M";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BM";
|
||||
}
|
||||
{
|
||||
key = "N";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bn";
|
||||
}
|
||||
{
|
||||
key = "N";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BN";
|
||||
}
|
||||
{
|
||||
key = "O";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bo";
|
||||
}
|
||||
{
|
||||
key = "O";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BO";
|
||||
}
|
||||
{
|
||||
key = "P";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bp";
|
||||
}
|
||||
{
|
||||
key = "P";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BP";
|
||||
}
|
||||
{
|
||||
key = "Q";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bq";
|
||||
}
|
||||
{
|
||||
key = "Q";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BQ";
|
||||
}
|
||||
{
|
||||
key = "R";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Br";
|
||||
}
|
||||
{
|
||||
key = "R";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BR";
|
||||
}
|
||||
{
|
||||
key = "S";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bs";
|
||||
}
|
||||
{
|
||||
key = "S";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BS";
|
||||
}
|
||||
{
|
||||
key = "T";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bt";
|
||||
}
|
||||
{
|
||||
key = "T";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BT";
|
||||
}
|
||||
{
|
||||
key = "U";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bu";
|
||||
}
|
||||
{
|
||||
key = "U";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BU";
|
||||
}
|
||||
{
|
||||
key = "V";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bv";
|
||||
}
|
||||
{
|
||||
key = "V";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BV";
|
||||
}
|
||||
{
|
||||
key = "W";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bw";
|
||||
}
|
||||
{
|
||||
key = "W";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BW";
|
||||
}
|
||||
{
|
||||
key = "X";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bx";
|
||||
}
|
||||
{
|
||||
key = "X";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BX";
|
||||
}
|
||||
{
|
||||
key = "Y";
|
||||
mods = "Alt";
|
||||
chars = "\\x1By";
|
||||
}
|
||||
{
|
||||
key = "Y";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BY";
|
||||
}
|
||||
{
|
||||
key = "Z";
|
||||
mods = "Alt";
|
||||
chars = "\\x1Bz";
|
||||
}
|
||||
{
|
||||
key = "Z";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1BZ";
|
||||
}
|
||||
{
|
||||
key = "Key1";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B1";
|
||||
}
|
||||
{
|
||||
key = "Key1";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B!";
|
||||
}
|
||||
{
|
||||
key = "Key2";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B2";
|
||||
}
|
||||
{
|
||||
key = "Key2";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B#";
|
||||
}
|
||||
{
|
||||
key = "Key3";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B3";
|
||||
}
|
||||
{
|
||||
key = "Key3";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B#";
|
||||
}
|
||||
{
|
||||
key = "Key4";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B4";
|
||||
}
|
||||
{
|
||||
key = "Key4";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B$";
|
||||
}
|
||||
{
|
||||
key = "Key5";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B5";
|
||||
}
|
||||
{
|
||||
key = "Key5";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B%";
|
||||
}
|
||||
{
|
||||
key = "Key6";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B6";
|
||||
}
|
||||
{
|
||||
key = "Key6";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B^";
|
||||
}
|
||||
{
|
||||
key = "Key7";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B7";
|
||||
}
|
||||
{
|
||||
key = "Key7";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B&";
|
||||
}
|
||||
{
|
||||
key = "Key8";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B8";
|
||||
}
|
||||
{
|
||||
key = "Key8";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B*";
|
||||
}
|
||||
{
|
||||
key = "Key9";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B9";
|
||||
}
|
||||
{
|
||||
key = "Key9";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B(";
|
||||
}
|
||||
{
|
||||
key = "Key0";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B0";
|
||||
}
|
||||
{
|
||||
key = "Key0";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B)";
|
||||
}
|
||||
{
|
||||
key = "Minus";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B-";
|
||||
}
|
||||
{
|
||||
key = "Minus";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B_";
|
||||
}
|
||||
{
|
||||
key = "Equals";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B=";
|
||||
}
|
||||
{
|
||||
key = "Equals";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B+";
|
||||
}
|
||||
{
|
||||
key = "LBracket";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B[";
|
||||
}
|
||||
{
|
||||
key = "LBracket";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B{";
|
||||
}
|
||||
{
|
||||
key = "RBracket";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B]";
|
||||
}
|
||||
{
|
||||
key = "RBracket";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B}";
|
||||
}
|
||||
{
|
||||
key = "Backslash";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B\\\\";
|
||||
}
|
||||
{
|
||||
key = "Backslash";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B|";
|
||||
}
|
||||
{
|
||||
key = "Semicolon";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B;";
|
||||
}
|
||||
{
|
||||
key = "Semicolon";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B =";
|
||||
}
|
||||
{
|
||||
key = "Apostrophe";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B'";
|
||||
}
|
||||
{
|
||||
key = "Apostrophe";
|
||||
mods = "Alt|Shift";
|
||||
chars = ''\x1B"'';
|
||||
}
|
||||
{
|
||||
key = "Comma";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B;";
|
||||
}
|
||||
{
|
||||
key = "Comma";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B<";
|
||||
}
|
||||
{
|
||||
key = "Period";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B.";
|
||||
}
|
||||
{
|
||||
key = "Period";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B>";
|
||||
}
|
||||
{
|
||||
key = "Slash";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B/";
|
||||
}
|
||||
{
|
||||
key = "Slash";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B?";
|
||||
}
|
||||
{
|
||||
key = "Grave";
|
||||
mods = "Alt";
|
||||
chars = "\\x1B`";
|
||||
}
|
||||
{
|
||||
key = "Grave";
|
||||
mods = "Alt|Shift";
|
||||
chars = "\\x1B~";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
{ ... }:
|
||||
{
|
||||
|
||||
imports = [
|
||||
./alacritty.nix
|
||||
./fish.nix
|
||||
./fonts.nix
|
||||
./hammerspoon.nix
|
||||
./homebrew.nix
|
||||
./kitty.nix
|
||||
./networking.nix
|
||||
./nixpkgs.nix
|
||||
./system.nix
|
||||
./tmux.nix
|
||||
./user.nix
|
||||
./utilities.nix
|
||||
];
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
|
||||
config = {
|
||||
|
||||
# MacOS-specific settings for Fish
|
||||
programs.fish.useBabelfish = true;
|
||||
programs.fish.babelfishPackage = pkgs.babelfish;
|
||||
};
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
|
||||
home.packages = with pkgs; [ nerd-fonts.victor-mono ];
|
||||
|
||||
programs.alacritty.settings = {
|
||||
font.normal.family = "VictorMono";
|
||||
};
|
||||
|
||||
programs.kitty.font = {
|
||||
package = pkgs.nerd-fonts.victor-mono;
|
||||
name = "VictorMono Nerd Font Mono";
|
||||
};
|
||||
};
|
||||
}
|
@ -1,43 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# Hammerspoon - MacOS custom automation scripting
|
||||
|
||||
config = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
xdg.configFile."hammerspoon/init.lua".source = ./hammerspoon/init.lua;
|
||||
xdg.configFile."hammerspoon/Spoons/ControlEscape.spoon".source = ./hammerspoon/Spoons/ControlEscape.spoon;
|
||||
xdg.configFile."hammerspoon/Spoons/DismissAlerts.spoon".source = ./hammerspoon/Spoons/DismissAlerts.spoon;
|
||||
xdg.configFile."hammerspoon/Spoons/Launcher.spoon/init.lua".source = pkgs.substituteAll {
|
||||
src = ./hammerspoon/Spoons/Launcher.spoon/init.lua;
|
||||
firefox = "${pkgs.firefox-bin}/Applications/Firefox.app";
|
||||
discord = "${pkgs.discord}/Applications/Discord.app";
|
||||
wezterm = "${pkgs.wezterm}/Applications/WezTerm.app";
|
||||
obsidian = "${pkgs.obsidian}/Applications/Obsidian.app";
|
||||
slack = "${pkgs.slack}/Applications/Slack.app";
|
||||
};
|
||||
xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source = ./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" ];
|
||||
|
||||
system.activationScripts.postUserActivation.text = ''
|
||||
defaults write org.hammerspoon.Hammerspoon MJConfigFile "${config.homePath}/.config/hammerspoon/init.lua"
|
||||
sudo killall Dock
|
||||
'';
|
||||
};
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
# Credit: https://github.com/Ptujec/LaunchBar/blob/f7b5a0dba9919c2fec879513f68a044f78748539/Notifications/Dismiss%20all%20notifications.lbaction/Contents/Scripts/default.applescript
|
||||
|
||||
tell application "System Events"
|
||||
try
|
||||
set _groups to groups of UI element 1 of scroll area 1 of group 1 of window "Notification Center" of application process "NotificationCenter"
|
||||
|
||||
repeat with _group in _groups
|
||||
|
||||
set _actions to actions of _group
|
||||
|
||||
repeat with _action in _actions
|
||||
if description of _action is in {"Schlie§en", "Alle entfernen", "Close", "Clear All"} then
|
||||
perform _action
|
||||
|
||||
end if
|
||||
end repeat
|
||||
|
||||
end repeat
|
||||
|
||||
end try
|
||||
end tell
|
@ -1,298 +0,0 @@
|
||||
/* Credit: https://gist.github.com/lancethomps/a5ac103f334b171f70ce2ff983220b4f */
|
||||
|
||||
function run(input, parameters) {
|
||||
|
||||
const appNames = [];
|
||||
const skipAppNames = [];
|
||||
const verbose = true;
|
||||
|
||||
const scriptName = "close_notifications_applescript";
|
||||
|
||||
const CLEAR_ALL_ACTION = "Clear All";
|
||||
const CLEAR_ALL_ACTION_TOP = "Clear";
|
||||
const CLOSE_ACTION = "Close";
|
||||
|
||||
const notNull = (val) => {
|
||||
return val !== null && val !== undefined;
|
||||
};
|
||||
|
||||
const isNull = (val) => {
|
||||
return !notNull(val);
|
||||
};
|
||||
|
||||
const notNullOrEmpty = (val) => {
|
||||
return notNull(val) && val.length > 0;
|
||||
};
|
||||
|
||||
const isNullOrEmpty = (val) => {
|
||||
return !notNullOrEmpty(val);
|
||||
};
|
||||
|
||||
const isError = (maybeErr) => {
|
||||
return notNull(maybeErr) && (maybeErr instanceof Error || maybeErr.message);
|
||||
};
|
||||
|
||||
const systemVersion = () => {
|
||||
return Application("Finder").version().split(".").map(val => parseInt(val));
|
||||
};
|
||||
|
||||
const systemVersionGreaterThanOrEqualTo = (vers) => {
|
||||
return systemVersion()[0] >= vers;
|
||||
};
|
||||
|
||||
const isBigSurOrGreater = () => {
|
||||
return systemVersionGreaterThanOrEqualTo(11);
|
||||
};
|
||||
|
||||
const V11_OR_GREATER = isBigSurOrGreater();
|
||||
const APP_NAME_MATCHER_ROLE = V11_OR_GREATER ? "AXStaticText" : "AXImage";
|
||||
const hasAppNames = notNullOrEmpty(appNames);
|
||||
const hasSkipAppNames = notNullOrEmpty(skipAppNames);
|
||||
const hasAppNameFilters = hasAppNames || hasSkipAppNames;
|
||||
const appNameForLog = hasAppNames ? ` [${appNames.join(",")}]` : "";
|
||||
|
||||
const logs = [];
|
||||
const log = (message, ...optionalParams) => {
|
||||
let message_with_prefix = `${new Date().toISOString().replace("Z", "").replace("T", " ")} [${scriptName}]${appNameForLog} ${message}`;
|
||||
console.log(message_with_prefix, optionalParams);
|
||||
logs.push(message_with_prefix);
|
||||
};
|
||||
|
||||
const logError = (message, ...optionalParams) => {
|
||||
if (isError(message)) {
|
||||
let err = message;
|
||||
message = `${err}${err.stack ? (" " + err.stack) : ""}`;
|
||||
}
|
||||
log(`ERROR ${message}`, optionalParams);
|
||||
};
|
||||
|
||||
const logErrorVerbose = (message, ...optionalParams) => {
|
||||
if (verbose) {
|
||||
logError(message, optionalParams);
|
||||
}
|
||||
};
|
||||
|
||||
const logVerbose = (message) => {
|
||||
if (verbose) {
|
||||
log(message);
|
||||
}
|
||||
};
|
||||
|
||||
const getLogLines = () => {
|
||||
return logs.join("\n");
|
||||
};
|
||||
|
||||
const getSystemEvents = () => {
|
||||
let systemEvents = Application("System Events");
|
||||
systemEvents.includeStandardAdditions = true;
|
||||
return systemEvents;
|
||||
};
|
||||
|
||||
const getNotificationCenter = () => {
|
||||
try {
|
||||
return getSystemEvents().processes.byName("NotificationCenter");
|
||||
} catch (err) {
|
||||
logError("Could not get NotificationCenter");
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
const getNotificationCenterGroups = (retryOnError = false) => {
|
||||
try {
|
||||
let notificationCenter = getNotificationCenter();
|
||||
if (notificationCenter.windows.length <= 0) {
|
||||
return [];
|
||||
}
|
||||
if (!V11_OR_GREATER) {
|
||||
return notificationCenter.windows();
|
||||
}
|
||||
return notificationCenter.windows[0].uiElements[0].uiElements[0].uiElements();
|
||||
} catch (err) {
|
||||
logError("Could not get NotificationCenter groups");
|
||||
if (retryOnError) {
|
||||
logError(err);
|
||||
log("Retrying getNotificationCenterGroups...");
|
||||
return getNotificationCenterGroups(false);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const isClearButton = (description, name) => {
|
||||
return description === "button" && name === CLEAR_ALL_ACTION_TOP;
|
||||
};
|
||||
|
||||
const matchesAnyAppNames = (value, checkValues) => {
|
||||
if (isNullOrEmpty(checkValues)) {
|
||||
return false;
|
||||
}
|
||||
let lowerAppName = value.toLowerCase();
|
||||
for (let checkValue of checkValues) {
|
||||
if (lowerAppName === checkValue.toLowerCase()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
const matchesAppName = (role, value) => {
|
||||
if (role !== APP_NAME_MATCHER_ROLE) {
|
||||
return false;
|
||||
}
|
||||
if (hasAppNames) {
|
||||
return matchesAnyAppNames(value, appNames);
|
||||
}
|
||||
return !matchesAnyAppNames(value, skipAppNames);
|
||||
};
|
||||
|
||||
const notificationGroupMatches = (group) => {
|
||||
try {
|
||||
let description = group.description();
|
||||
if (V11_OR_GREATER && isClearButton(description, group.name())) {
|
||||
return true;
|
||||
}
|
||||
if (V11_OR_GREATER && description !== "group") {
|
||||
return false;
|
||||
}
|
||||
if (!V11_OR_GREATER) {
|
||||
let matchedAppName = !hasAppNameFilters;
|
||||
if (!matchedAppName) {
|
||||
for (let elem of group.uiElements()) {
|
||||
if (matchesAppName(elem.role(), elem.description())) {
|
||||
matchedAppName = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (matchedAppName) {
|
||||
return notNull(findCloseActionV10(group, -1));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (!hasAppNameFilters) {
|
||||
return true;
|
||||
}
|
||||
let firstElem = group.uiElements[0];
|
||||
return matchesAppName(firstElem.role(), firstElem.value());
|
||||
} catch (err) {
|
||||
logErrorVerbose(`Caught error while checking window, window is probably closed: ${err}`);
|
||||
logErrorVerbose(err);
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
const findCloseActionV10 = (group, closedCount) => {
|
||||
try {
|
||||
for (let elem of group.uiElements()) {
|
||||
if (elem.role() === "AXButton" && elem.title() === CLOSE_ACTION) {
|
||||
return elem.actions["AXPress"];
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
logErrorVerbose(`(group_${closedCount}) Caught error while searching for close action, window is probably closed: ${err}`);
|
||||
logErrorVerbose(err);
|
||||
return null;
|
||||
}
|
||||
log("No close action found for notification");
|
||||
return null;
|
||||
};
|
||||
|
||||
const findCloseAction = (group, closedCount) => {
|
||||
try {
|
||||
if (!V11_OR_GREATER) {
|
||||
return findCloseActionV10(group, closedCount);
|
||||
}
|
||||
let checkForPress = isClearButton(group.description(), group.name());
|
||||
let clearAllAction;
|
||||
let closeAction;
|
||||
for (let action of group.actions()) {
|
||||
let description = action.description();
|
||||
if (description === CLEAR_ALL_ACTION) {
|
||||
clearAllAction = action;
|
||||
break;
|
||||
} else if (description === CLOSE_ACTION) {
|
||||
closeAction = action;
|
||||
} else if (checkForPress && description === "press") {
|
||||
clearAllAction = action;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (notNull(clearAllAction)) {
|
||||
return clearAllAction;
|
||||
} else if (notNull(closeAction)) {
|
||||
return closeAction;
|
||||
}
|
||||
} catch (err) {
|
||||
logErrorVerbose(`(group_${closedCount}) Caught error while searching for close action, window is probably closed: ${err}`);
|
||||
logErrorVerbose(err);
|
||||
return null;
|
||||
}
|
||||
log("No close action found for notification");
|
||||
return null;
|
||||
};
|
||||
|
||||
const closeNextGroup = (groups, closedCount) => {
|
||||
try {
|
||||
for (let group of groups) {
|
||||
if (notificationGroupMatches(group)) {
|
||||
let closeAction = findCloseAction(group, closedCount);
|
||||
|
||||
if (notNull(closeAction)) {
|
||||
try {
|
||||
closeAction.perform();
|
||||
return [true, 1];
|
||||
} catch (err) {
|
||||
logErrorVerbose(`(group_${closedCount}) Caught error while performing close action, window is probably closed: ${err}`);
|
||||
logErrorVerbose(err);
|
||||
}
|
||||
}
|
||||
return [true, 0];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} catch (err) {
|
||||
logError("Could not run closeNextGroup");
|
||||
throw err;
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
let groupsCount = getNotificationCenterGroups(true).filter(group => notificationGroupMatches(group)).length;
|
||||
|
||||
if (groupsCount > 0) {
|
||||
logVerbose(`Closing ${groupsCount}${appNameForLog} notification group${(groupsCount > 1 ? "s" : "")}`);
|
||||
|
||||
let startTime = new Date().getTime();
|
||||
let closedCount = 0;
|
||||
let maybeMore = true;
|
||||
let maxAttempts = 2;
|
||||
let attempts = 1;
|
||||
while (maybeMore && ((new Date().getTime() - startTime) <= (1000 * 30))) {
|
||||
try {
|
||||
let closeResult = closeNextGroup(getNotificationCenterGroups(), closedCount);
|
||||
maybeMore = closeResult[0];
|
||||
if (maybeMore) {
|
||||
closedCount = closedCount + closeResult[1];
|
||||
}
|
||||
} catch (innerErr) {
|
||||
if (maybeMore && closedCount === 0 && attempts < maxAttempts) {
|
||||
log(`Caught an error before anything closed, trying ${maxAttempts - attempts} more time(s).`)
|
||||
attempts++;
|
||||
} else {
|
||||
throw innerErr;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw Error(`No${appNameForLog} notifications found...`);
|
||||
}
|
||||
} catch (err) {
|
||||
logError(err);
|
||||
logError(err.message);
|
||||
getLogLines();
|
||||
throw err;
|
||||
}
|
||||
|
||||
return getLogLines();
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
# config = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
# networking = {
|
||||
# computerName = config.networking.hostName;
|
||||
# # Adjust if necessary
|
||||
# # hostName = "";
|
||||
# };
|
||||
# };
|
||||
# }
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
|
||||
programs.fish = {
|
||||
shellAbbrs = {
|
||||
nr = {
|
||||
function = lib.mkForce "rebuild-darwin";
|
||||
};
|
||||
nro = {
|
||||
function = lib.mkForce "rebuild-darwin-offline";
|
||||
};
|
||||
};
|
||||
functions = {
|
||||
rebuild-darwin = {
|
||||
body = ''
|
||||
git -C ${config.dotfilesPath} add --intent-to-add --all
|
||||
echo "darwin-rebuild switch --flake ${config.dotfilesPath}#lookingglass"
|
||||
'';
|
||||
};
|
||||
rebuild-darwin-offline = {
|
||||
body = ''
|
||||
git -C ${config.dotfilesPath} add --intent-to-add --all
|
||||
echo "darwin-rebuild switch --option substitute false --flake ${config.dotfilesPath}#lookingglass"
|
||||
'';
|
||||
};
|
||||
rebuild-home = lib.mkForce {
|
||||
body = ''
|
||||
git -C ${config.dotfilesPath} add --intent-to-add --all
|
||||
echo "${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#lookingglass";
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -1,222 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
|
||||
options = {
|
||||
terminal = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Path to executable for terminal emulator program.";
|
||||
default = null;
|
||||
};
|
||||
terminalLaunchCommand = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Command for using the terminal to launch a new window with a program.";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
|
||||
services.nix-daemon.enable = true;
|
||||
|
||||
# This setting only applies to Darwin, different on NixOS
|
||||
nix.gc.interval = {
|
||||
Hour = 12;
|
||||
Minute = 15;
|
||||
Day = 1;
|
||||
};
|
||||
|
||||
environment.shells = [ pkgs.fish ];
|
||||
|
||||
security.pam.enableSudoTouchIdAuth = true;
|
||||
|
||||
system = {
|
||||
|
||||
stateVersion = 5;
|
||||
|
||||
keyboard = {
|
||||
remapCapsLockToControl = true;
|
||||
enableKeyMapping = true; # Allows for skhd
|
||||
};
|
||||
|
||||
defaults = {
|
||||
NSGlobalDomain = {
|
||||
|
||||
# Set to dark mode
|
||||
AppleInterfaceStyle = "Dark";
|
||||
|
||||
# Don't change from dark to light automatically
|
||||
# AppleInterfaceSwitchesAutomatically = false;
|
||||
|
||||
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
|
||||
AppleKeyboardUIMode = 3;
|
||||
|
||||
# Only hide menu bar in fullscreen
|
||||
_HIHideMenuBar = false;
|
||||
|
||||
# Expand save panel by default
|
||||
NSNavPanelExpandedStateForSaveMode = true;
|
||||
|
||||
# Expand print panel by default
|
||||
PMPrintingExpandedStateForPrint = true;
|
||||
|
||||
# Replace press-and-hold with key repeat
|
||||
ApplePressAndHoldEnabled = false;
|
||||
|
||||
# Set a fast key repeat rate
|
||||
KeyRepeat = 2;
|
||||
|
||||
# Shorten delay before key repeat begins
|
||||
InitialKeyRepeat = 12;
|
||||
|
||||
# Save to local disk by default, not iCloud
|
||||
NSDocumentSaveNewDocumentsToCloud = false;
|
||||
|
||||
# Disable autocorrect capitalization
|
||||
NSAutomaticCapitalizationEnabled = false;
|
||||
|
||||
# Disable autocorrect smart dashes
|
||||
NSAutomaticDashSubstitutionEnabled = false;
|
||||
|
||||
# Disable autocorrect adding periods
|
||||
NSAutomaticPeriodSubstitutionEnabled = false;
|
||||
|
||||
# Disable autocorrect smart quotation marks
|
||||
NSAutomaticQuoteSubstitutionEnabled = false;
|
||||
|
||||
# Disable autocorrect spellcheck
|
||||
NSAutomaticSpellingCorrectionEnabled = false;
|
||||
};
|
||||
|
||||
dock = {
|
||||
# Automatically show and hide the dock
|
||||
autohide = true;
|
||||
|
||||
# Add translucency in dock for hidden applications
|
||||
showhidden = true;
|
||||
|
||||
# Enable spring loading on all dock items
|
||||
enable-spring-load-actions-on-all-items = true;
|
||||
|
||||
# Highlight hover effect in dock stack grid view
|
||||
mouse-over-hilite-stack = true;
|
||||
|
||||
mineffect = "genie";
|
||||
orientation = "bottom";
|
||||
show-recents = false;
|
||||
tilesize = 44;
|
||||
|
||||
persistent-apps = [
|
||||
"/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.wezterm}/Applications/WezTerm.app"
|
||||
];
|
||||
};
|
||||
|
||||
finder = {
|
||||
|
||||
# Default Finder window set to column view
|
||||
FXPreferredViewStyle = "clmv";
|
||||
|
||||
# Finder search in current folder by default
|
||||
FXDefaultSearchScope = "SCcf";
|
||||
|
||||
# Disable warning when changing file extension
|
||||
FXEnableExtensionChangeWarning = false;
|
||||
|
||||
# Allow quitting of Finder application
|
||||
QuitMenuItem = true;
|
||||
};
|
||||
|
||||
# Disable "Are you sure you want to open" dialog
|
||||
LaunchServices.LSQuarantine = false;
|
||||
|
||||
# Disable trackpad tap to click
|
||||
trackpad.Clicking = false;
|
||||
|
||||
# Where to save screenshots
|
||||
screencapture.location = "~/Downloads";
|
||||
|
||||
# Show seconds on the clock
|
||||
menuExtraClock.ShowSeconds = true;
|
||||
|
||||
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;
|
||||
};
|
||||
# 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":""}'';
|
||||
teamsBrowser = ''{"deletable":true,"arguments":"","name":"Teams","path":""}'';
|
||||
KeyboardShortcuts_joinEventShortcut = ''{"carbonModifiers":6400,"carbonKeyCode":38}'';
|
||||
timeFormat = ''"12-hour"'';
|
||||
};
|
||||
};
|
||||
|
||||
CustomSystemPreferences = {
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
# Settings that don't have an option in nix-darwin
|
||||
activationScripts.postActivation.text = ''
|
||||
echo "Allow apps from anywhere"
|
||||
SPCTL=$(spctl --status)
|
||||
if ! [ "$SPCTL" = "assessments disabled" ]; then
|
||||
sudo spctl --master-disable
|
||||
fi
|
||||
'';
|
||||
|
||||
# User-level settings
|
||||
activationScripts.postUserActivation.text = ''
|
||||
echo "Show the ~/Library folder"
|
||||
chflags nohidden ~/Library
|
||||
|
||||
echo "Reduce Menu Bar padding"
|
||||
defaults write -globalDomain NSStatusItemSelectionPadding -int 6
|
||||
defaults write -globalDomain NSStatusItemSpacing -int 6
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user