mirror of
https://github.com/nmasur/dotfiles
synced 2026-11-13 21:45:02 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5c48b41fa |
No files matched your search
@@ -25,6 +25,9 @@ rec {
|
|||||||
# Re-encrypt secrets for all machines
|
# Re-encrypt secrets for all machines
|
||||||
reencrypt-secrets = import ./reencrypt-secrets.nix { inherit pkgs; };
|
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
|
# Run neovim as an app
|
||||||
neovim = import ./neovim.nix { inherit pkgs; };
|
neovim = import ./neovim.nix { inherit pkgs; };
|
||||||
nvim = neovim;
|
nvim = neovim;
|
||||||
|
|||||||
+33
-1
@@ -5,5 +5,37 @@
|
|||||||
|
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = pkgs.lib.getExe pkgs.format-root;
|
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}"
|
||||||
|
|
||||||
|
''
|
||||||
|
);
|
||||||
}
|
}
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
' • {{ Color "15" "57" " loadkey " }} {{ Italic "Load an ssh key for this machine using melt." }}' \
|
' • {{ Color "15" "57" " loadkey " }} {{ Italic "Load an ssh key for this machine using melt." }}' \
|
||||||
' • {{ Color "15" "57" " encrypt-secret " }} {{ Italic "Encrypt a secret for all machines." }}' \
|
' • {{ Color "15" "57" " encrypt-secret " }} {{ Italic "Encrypt a secret for all machines." }}' \
|
||||||
' • {{ Color "15" "57" " reencrypt-secrets " }} {{ Italic "Reencrypt all secrets when new machine is added." }}' \
|
' • {{ Color "15" "57" " reencrypt-secrets " }} {{ Italic "Reencrypt all secrets when new machine is added." }}' \
|
||||||
|
' • {{ Color "15" "57" " netdata " }} {{ Italic "Connect a machine to Netdata cloud." }}'
|
||||||
echo ""
|
echo ""
|
||||||
echo ""
|
echo ""
|
||||||
''
|
''
|
||||||
|
|||||||
+9
-3
@@ -1,9 +1,15 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
|
|
||||||
# TODO: just replace with packages instead of apps
|
|
||||||
|
|
||||||
type = "app";
|
type = "app";
|
||||||
|
|
||||||
program = "${pkgs.loadkey}/bin/loadkey";
|
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"
|
||||||
|
''
|
||||||
|
);
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{ 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"
|
||||||
|
''
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
{ 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";
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Generated
+117
-52
@@ -87,11 +87,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737162735,
|
"lastModified": 1735956190,
|
||||||
"narHash": "sha256-5T+HkouTMGaRm0rh3kgD4Z1O7ONKfgjyoPQH5rSyreU=",
|
"narHash": "sha256-svzx3yVXD5tbBJZCn3Lt1RriH8GHo6CyVUPTHejf7sU=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "87131f51f8256952d1a306b5521cedc2dc61aa08",
|
"rev": "3feaf376d75d3d58ebf7e9a4f584d00628548ad9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -108,11 +108,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737038063,
|
"lastModified": 1735468753,
|
||||||
"narHash": "sha256-rMEuiK69MDhjz1JgbaeQ9mBDXMJ2/P8vmOYRbFndXsk=",
|
"narHash": "sha256-2dt1nOe9zf9pDkf5Kn7FUFyPRo581s0n90jxYXJ94l0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "disko",
|
"repo": "disko",
|
||||||
"rev": "bf0abfde48f469c256f2b0f481c6281ff04a5db2",
|
"rev": "84a5b93637cc16cbfcc61b6e1684d626df61eb21",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -145,11 +145,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737161595,
|
"lastModified": 1735952135,
|
||||||
"narHash": "sha256-Txp3uh0KdB3+Pe6xihU0JWWe0LK8iXTUnZ8bOcKu3w0=",
|
"narHash": "sha256-1omANFYtwEeAwwzSQqJbob1ctswLa9L9QS18Kg8ICjc=",
|
||||||
"owner": "bandithedoge",
|
"owner": "bandithedoge",
|
||||||
"repo": "nixpkgs-firefox-darwin",
|
"repo": "nixpkgs-firefox-darwin",
|
||||||
"rev": "3224752c71a5245e90cfae360e0dc5de98e2b53c",
|
"rev": "72ce135b49236c110d86bce6e6d25bfafcc2158d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -268,14 +268,32 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flake-utils_4": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems_4"
|
||||||
|
},
|
||||||
|
"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"
|
||||||
|
}
|
||||||
|
},
|
||||||
"gh-collaborators": {
|
"gh-collaborators": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1736185279,
|
"lastModified": 1717117275,
|
||||||
"narHash": "sha256-SGmP/8Fvf2rcYkwscMOFG01Y0VJGb/TXrNZtLacurxA=",
|
"narHash": "sha256-x3p2bHL6U8gWanXnTTJGgA9x4Ixy9AOZiBbfcfn5VVw=",
|
||||||
"owner": "katiem0",
|
"owner": "katiem0",
|
||||||
"repo": "gh-collaborators",
|
"repo": "gh-collaborators",
|
||||||
"rev": "bf412dde50605e48af86f291c2ac8714f2c1b228",
|
"rev": "4dfcd0b5c2e31f2d0fbfd4b83fdfae787a5e6ff8",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -307,11 +325,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737120639,
|
"lastModified": 1735947440,
|
||||||
"narHash": "sha256-p5e/45V41YD3tMELuiNIoVCa25/w4nhOTm0B9MtdHFI=",
|
"narHash": "sha256-jnEcfmOhWntmVEcqlvs+j532+mvmgsKtQSSfukgkn+A=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "a0046af169ce7b1da503974e1b22c48ef4d71887",
|
"rev": "a9987622b7b93c82e147f198574e8e6ffbf5e327",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -330,11 +348,11 @@
|
|||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737163288,
|
"lastModified": 1735923240,
|
||||||
"narHash": "sha256-PROBXqOUzgqIG66S74P1nyg7MbNoQ01k3oF0IM7qpHY=",
|
"narHash": "sha256-xRJvm/YfV9aHyesx52N/t6fauk86Ajfj/ILFldEZ8nk=",
|
||||||
"owner": "martinvonz",
|
"owner": "martinvonz",
|
||||||
"repo": "jj",
|
"repo": "jj",
|
||||||
"rev": "83d40d2c425fa2e050bdac8837b19e5beb3bef25",
|
"rev": "1ddfc59ee95d680ccbd0cfcbcf86c9202f8e44ca",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -409,7 +427,7 @@
|
|||||||
"nextcloud-snappymail": {
|
"nextcloud-snappymail": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737171597,
|
"lastModified": 1735962117,
|
||||||
"narHash": "sha256-oCw6Brs85rINBHvz3UJXheyLVqvA3RgPXG03b30Fx7E=",
|
"narHash": "sha256-oCw6Brs85rINBHvz3UJXheyLVqvA3RgPXG03b30Fx7E=",
|
||||||
"type": "tarball",
|
"type": "tarball",
|
||||||
"url": "https://snappymail.eu/repository/nextcloud/snappymail-2.38.2-nextcloud.tar.gz"
|
"url": "https://snappymail.eu/repository/nextcloud/snappymail-2.38.2-nextcloud.tar.gz"
|
||||||
@@ -442,11 +460,11 @@
|
|||||||
},
|
},
|
||||||
"nixlib": {
|
"nixlib": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1736643958,
|
"lastModified": 1734829460,
|
||||||
"narHash": "sha256-tmpqTSWVRJVhpvfSN9KXBvKEXplrwKnSZNAoNPf/S/s=",
|
"narHash": "sha256-dPhc+f2wkmhMqMIfq+hColJdysgVxKP9ilZ5bR0NRZI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixpkgs.lib",
|
"repo": "nixpkgs.lib",
|
||||||
"rev": "1418bc28a52126761c02dd3d89b2d8ca0f521181",
|
"rev": "0a31e8d833173ae63e43fd9dbff1ccf09c4f778c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -463,11 +481,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737057290,
|
"lastModified": 1734915500,
|
||||||
"narHash": "sha256-3Pe0yKlCc7EOeq1X/aJVDH0CtNL+tIBm49vpepwL1MQ=",
|
"narHash": "sha256-A7CTIQ8SW0hfbhKlwK+vSsu4pD+Oaelw3v6goX6go+U=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixos-generators",
|
"repo": "nixos-generators",
|
||||||
"rev": "d002ce9b6e7eb467cd1c6bb9aef9c35d191b5453",
|
"rev": "051d1b2dda3b2e81b38d82e2b691e5c2f4d335f4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -478,11 +496,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737062831,
|
"lastModified": 1735834308,
|
||||||
"narHash": "sha256-Tbk1MZbtV2s5aG+iM99U8FqwxU/YNArMcWAv6clcsBc=",
|
"narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "5df43628fdf08d642be8ba5b3625a6c70731c19c",
|
"rev": "6df24922a1400241dae323af55f30e4318a6ca65",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -492,6 +510,22 @@
|
|||||||
"type": "github"
|
"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": {
|
"nixpkgs-stable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1735563628,
|
"lastModified": 1735563628,
|
||||||
@@ -508,20 +542,34 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1735834308,
|
||||||
|
"narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "6df24922a1400241dae323af55f30e4318a6ca65",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": [
|
"nixpkgs": "nixpkgs_2",
|
||||||
"nixpkgs"
|
|
||||||
],
|
|
||||||
"treefmt-nix": "treefmt-nix"
|
"treefmt-nix": "treefmt-nix"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737170882,
|
"lastModified": 1735962132,
|
||||||
"narHash": "sha256-Km700i1Eg72bFsU2X2ZgH4qEgx6SrdZFJURJGTSQH2M=",
|
"narHash": "sha256-7elXLoHAQ/+usWi6R08SntEiV8WyAisJAin3T0GEBPE=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nur",
|
"repo": "nur",
|
||||||
"rev": "62cdd681201843553ec740a85ccf2f0a6fca75c6",
|
"rev": "b085ce9e13651cc235ca993af7a5b09990d27807",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -533,11 +581,11 @@
|
|||||||
"nvim-lint-src": {
|
"nvim-lint-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1736154173,
|
"lastModified": 1734606055,
|
||||||
"narHash": "sha256-OChCLXHAqa129NiGfmwddq0Hj5F9AtC3TmFbnNCZqfo=",
|
"narHash": "sha256-tD1ciHUdHIcqymImZjSSNq6M5hjsrD66AJhmLTy0cIY=",
|
||||||
"owner": "mfussenegger",
|
"owner": "mfussenegger",
|
||||||
"repo": "nvim-lint",
|
"repo": "nvim-lint",
|
||||||
"rev": "dfa45de973c3ce7bd1b9a6d346f896a68ad07e44",
|
"rev": "1fea92f1d9908eaa5eb8bafe08b4293d7aadaa55",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -566,11 +614,11 @@
|
|||||||
"nvim-tree-lua-src": {
|
"nvim-tree-lua-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1737156486,
|
"lastModified": 1734820548,
|
||||||
"narHash": "sha256-b8YOOIYML9aKy4Y7S+iLKIaTfCqrxK1wB/ZaeFRCUmo=",
|
"narHash": "sha256-4PmP31vYPH9xw4AjV5rDSKvcvZGTnIaPfR4Bwc0lAiA=",
|
||||||
"owner": "kyazdani42",
|
"owner": "kyazdani42",
|
||||||
"repo": "nvim-tree.lua",
|
"repo": "nvim-tree.lua",
|
||||||
"rev": "fca0b67c0b5a31727fb33addc4d9c100736a2894",
|
"rev": "68fc4c20f5803444277022c681785c5edd11916d",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -667,6 +715,7 @@
|
|||||||
"nix2vim": "nix2vim",
|
"nix2vim": "nix2vim",
|
||||||
"nixos-generators": "nixos-generators",
|
"nixos-generators": "nixos-generators",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
|
"nixpkgs-caddy": "nixpkgs-caddy",
|
||||||
"nixpkgs-stable": "nixpkgs-stable",
|
"nixpkgs-stable": "nixpkgs-stable",
|
||||||
"nur": "nur",
|
"nur": "nur",
|
||||||
"nvim-lint-src": "nvim-lint-src",
|
"nvim-lint-src": "nvim-lint-src",
|
||||||
@@ -717,11 +766,11 @@
|
|||||||
"snipe-nvim-src": {
|
"snipe-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1736108869,
|
"lastModified": 1734918876,
|
||||||
"narHash": "sha256-sJ71eiE0XmMJkhNCkbY82R4eHzBOOKFrPa+nxLc1f8s=",
|
"narHash": "sha256-nut2POcxH1LgxTEKDikvRPPpbtmvlDDF52SoWZNC1Fg=",
|
||||||
"owner": "leath-dub",
|
"owner": "leath-dub",
|
||||||
"repo": "snipe.nvim",
|
"repo": "snipe.nvim",
|
||||||
"rev": "0d0a482ac713370196e4fc0025d5aaac5030104d",
|
"rev": "2550012916d4fb21d6d1c7a88a9bddde651bb1f0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -775,6 +824,21 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"systems_4": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"telescope-nvim-src": {
|
"telescope-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
@@ -811,11 +875,11 @@
|
|||||||
"tiny-inline-diagnostic-nvim-src": {
|
"tiny-inline-diagnostic-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1736959343,
|
"lastModified": 1735568714,
|
||||||
"narHash": "sha256-11+Z54shcy5oRevfTOu3dt5DtXhnYaH9zvktH6Lvxjs=",
|
"narHash": "sha256-rZ5+w6v9ONFTQIXvwTUJuwZKRaXdHZUNEUDfBsC2IMM=",
|
||||||
"owner": "rachartier",
|
"owner": "rachartier",
|
||||||
"repo": "tiny-inline-diagnostic.nvim",
|
"repo": "tiny-inline-diagnostic.nvim",
|
||||||
"rev": "aaa6f0dd097f8ca2478cad259e61b7cb26ec0eb8",
|
"rev": "867902d5974a18c156c918ab8addbf091719de27",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -910,11 +974,11 @@
|
|||||||
"tree-sitter-python": {
|
"tree-sitter-python": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1736288149,
|
"lastModified": 1734908773,
|
||||||
"narHash": "sha256-IIAL2qteFPBCPmDK1N2EdDgpI4CwfMuuVL8t5tYueLU=",
|
"narHash": "sha256-71Od4sUsxGEvTwmXX8hBvzqD55hnXkVJublrhp1GICg=",
|
||||||
"owner": "tree-sitter",
|
"owner": "tree-sitter",
|
||||||
"repo": "tree-sitter-python",
|
"repo": "tree-sitter-python",
|
||||||
"rev": "409b5d671eb0ea4972eeacaaca24bbec1acf79b1",
|
"rev": "bffb65a8cfe4e46290331dfef0dbf0ef3679de11",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -996,16 +1060,17 @@
|
|||||||
"wsl": {
|
"wsl": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat_2",
|
"flake-compat": "flake-compat_2",
|
||||||
|
"flake-utils": "flake-utils_4",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1736095716,
|
"lastModified": 1733854371,
|
||||||
"narHash": "sha256-csysw/Szu98QDiA2lhWk9seYOyCebeVEWL89zh1cduM=",
|
"narHash": "sha256-K9qGHniYBbjqVcEiwXyiofj/IFf78L5F0/FCf+CKyr0=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NixOS-WSL",
|
"repo": "NixOS-WSL",
|
||||||
"rev": "63c3b4ed1712a3a0621002cd59bfdc80875ecbb0",
|
"rev": "dee4425dcee3149475ead0cb6a616b8a028c5888",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
description = "An opinionated flake containing the NixOS, nix-darwin, and home-manager configurations for multiple systems.";
|
description = "My system";
|
||||||
|
|
||||||
# Other flakes that we want to pull from
|
# Other flakes that we want to pull from
|
||||||
inputs = {
|
inputs = {
|
||||||
@@ -10,6 +10,9 @@
|
|||||||
# Used for specific stable packages
|
# Used for specific stable packages
|
||||||
nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
|
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
|
# Used for MacOS system config
|
||||||
darwin = {
|
darwin = {
|
||||||
url = "github:lnl7/nix-darwin/master";
|
url = "github:lnl7/nix-darwin/master";
|
||||||
@@ -29,10 +32,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
# Community packages; used for Firefox extensions
|
# Community packages; used for Firefox extensions
|
||||||
nur = {
|
nur.url = "github:nix-community/nur";
|
||||||
url = "github:nix-community/nur";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
|
|
||||||
# Use official Firefox binary for macOS
|
# Use official Firefox binary for macOS
|
||||||
firefox-darwin = {
|
firefox-darwin = {
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ inputs.nixpkgs.lib.nixosSystem rec {
|
|||||||
endpoint = "s3.us-west-002.backblazeb2.com";
|
endpoint = "s3.us-west-002.backblazeb2.com";
|
||||||
bucket = "noahmasur-backup";
|
bucket = "noahmasur-backup";
|
||||||
accessKeyId = "0026b0e73b2e2c80000000005";
|
accessKeyId = "0026b0e73b2e2c80000000005";
|
||||||
resticBucket = "noahmasur-restic";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# Disable passwords, only use SSH key
|
# Disable passwords, only use SSH key
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ inputs.nixpkgs.lib.nixosSystem rec {
|
|||||||
endpoint = "s3.us-west-002.backblazeb2.com";
|
endpoint = "s3.us-west-002.backblazeb2.com";
|
||||||
bucket = "noahmasur-backup";
|
bucket = "noahmasur-backup";
|
||||||
accessKeyId = "0026b0e73b2e2c80000000005";
|
accessKeyId = "0026b0e73b2e2c80000000005";
|
||||||
resticBucket = "noahmasur-restic";
|
glacierBucket = "noahmasur-archive";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Disable passwords, only use SSH key
|
# Disable passwords, only use SSH key
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
# 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;
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,107 @@
|
|||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./1password.nix
|
||||||
|
./alacritty.nix
|
||||||
|
./discord.nix
|
||||||
|
./firefox.nix
|
||||||
|
./kitty.nix
|
||||||
|
./media.nix
|
||||||
|
./obsidian.nix
|
||||||
|
./qbittorrent.nix
|
||||||
|
./slack.nix
|
||||||
|
./wezterm.nix
|
||||||
|
./yt-dlp.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
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
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,203 @@
|
|||||||
|
{
|
||||||
|
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"
|
||||||
|
''
|
||||||
|
)
|
||||||
|
}";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
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" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
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 ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
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
|
||||||
|
}
|
||||||
@@ -0,0 +1,286 @@
|
|||||||
|
{
|
||||||
|
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
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
+131
-98
@@ -37,22 +37,40 @@
|
|||||||
description = "Path to existing private key file.";
|
description = "Path to existing private key file.";
|
||||||
default = "/etc/ssh/ssh_host_ed25519_key";
|
default = "/etc/ssh/ssh_host_ed25519_key";
|
||||||
};
|
};
|
||||||
# homePath = lib.mkOption {
|
gui = {
|
||||||
# type = lib.types.path;
|
enable = lib.mkEnableOption {
|
||||||
# description = "Path of user's home directory.";
|
description = "Enable graphics.";
|
||||||
# default = builtins.toPath (
|
default = false;
|
||||||
# if pkgs.stdenv.isDarwin then "/Users/${config.user}" else "/home/${config.user}"
|
};
|
||||||
# );
|
};
|
||||||
# };
|
theme = {
|
||||||
# dotfilesPath = lib.mkOption {
|
colors = lib.mkOption {
|
||||||
# type = lib.types.path;
|
type = lib.types.attrs;
|
||||||
# description = "Path of dotfiles repository.";
|
description = "Base16 color scheme.";
|
||||||
# default = config.homePath + "/dev/personal/dotfiles";
|
default = (import ../colorscheme/gruvbox).dark;
|
||||||
# };
|
};
|
||||||
# dotfilesRepo = lib.mkOption {
|
dark = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.bool;
|
||||||
# description = "Link to dotfiles repository HTTPS URL.";
|
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 {
|
unfreePackages = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.str;
|
||||||
description = "List of unfree packages to allow.";
|
description = "List of unfree packages to allow.";
|
||||||
@@ -63,88 +81,88 @@
|
|||||||
description = "List of insecure packages to allow.";
|
description = "List of insecure packages to allow.";
|
||||||
default = [ ];
|
default = [ ];
|
||||||
};
|
};
|
||||||
# hostnames = {
|
hostnames = {
|
||||||
# audiobooks = lib.mkOption {
|
audiobooks = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for audiobook server (Audiobookshelf).";
|
description = "Hostname for audiobook server (Audiobookshelf).";
|
||||||
# };
|
};
|
||||||
# budget = lib.mkOption {
|
budget = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for budgeting server (ActualBudget).";
|
description = "Hostname for budgeting server (ActualBudget).";
|
||||||
# };
|
};
|
||||||
# files = lib.mkOption {
|
files = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for files server (Filebrowser).";
|
description = "Hostname for files server (Filebrowser).";
|
||||||
# };
|
};
|
||||||
# git = lib.mkOption {
|
git = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for git server (Gitea).";
|
description = "Hostname for git server (Gitea).";
|
||||||
# };
|
};
|
||||||
# metrics = lib.mkOption {
|
metrics = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for metrics server.";
|
description = "Hostname for metrics server.";
|
||||||
# };
|
};
|
||||||
# minecraft = lib.mkOption {
|
minecraft = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for Minecraft server.";
|
description = "Hostname for Minecraft server.";
|
||||||
# };
|
};
|
||||||
# paperless = lib.mkOption {
|
paperless = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for document server (paperless-ngx).";
|
description = "Hostname for document server (paperless-ngx).";
|
||||||
# };
|
};
|
||||||
# photos = lib.mkOption {
|
photos = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for photo management (Immich).";
|
description = "Hostname for photo management (Immich).";
|
||||||
# };
|
};
|
||||||
# prometheus = lib.mkOption {
|
prometheus = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for Prometheus server.";
|
description = "Hostname for Prometheus server.";
|
||||||
# };
|
};
|
||||||
# influxdb = lib.mkOption {
|
influxdb = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for InfluxDB2 server.";
|
description = "Hostname for InfluxDB2 server.";
|
||||||
# };
|
};
|
||||||
# secrets = lib.mkOption {
|
secrets = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for passwords and secrets (Vaultwarden).";
|
description = "Hostname for passwords and secrets (Vaultwarden).";
|
||||||
# };
|
};
|
||||||
# stream = lib.mkOption {
|
stream = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for video/media library (Jellyfin).";
|
description = "Hostname for video/media library (Jellyfin).";
|
||||||
# };
|
};
|
||||||
# content = lib.mkOption {
|
content = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for personal content system (Nextcloud).";
|
description = "Hostname for personal content system (Nextcloud).";
|
||||||
# };
|
};
|
||||||
# books = lib.mkOption {
|
books = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for books library (Calibre-Web).";
|
description = "Hostname for books library (Calibre-Web).";
|
||||||
# };
|
};
|
||||||
# download = lib.mkOption {
|
download = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for download services.";
|
description = "Hostname for download services.";
|
||||||
# };
|
};
|
||||||
# irc = lib.mkOption {
|
irc = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for IRC services.";
|
description = "Hostname for IRC services.";
|
||||||
# };
|
};
|
||||||
# n8n = lib.mkOption {
|
n8n = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for n8n automation.";
|
description = "Hostname for n8n automation.";
|
||||||
# };
|
};
|
||||||
# notifications = lib.mkOption {
|
notifications = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for push notification services (ntfy).";
|
description = "Hostname for push notification services (ntfy).";
|
||||||
# };
|
};
|
||||||
# status = lib.mkOption {
|
status = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for status page (Uptime-Kuma).";
|
description = "Hostname for status page (Uptime-Kuma).";
|
||||||
# };
|
};
|
||||||
# transmission = lib.mkOption {
|
transmission = lib.mkOption {
|
||||||
# type = lib.types.str;
|
type = lib.types.str;
|
||||||
# description = "Hostname for peer2peer downloads (Transmission).";
|
description = "Hostname for peer2peer downloads (Transmission).";
|
||||||
# };
|
};
|
||||||
# };
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config =
|
config =
|
||||||
@@ -153,6 +171,21 @@
|
|||||||
in
|
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)
|
# Allow specified unfree packages (identified elsewhere)
|
||||||
# Retrieves package object based on string name
|
# Retrieves package object based on string name
|
||||||
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.unfreePackages;
|
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) config.unfreePackages;
|
||||||
|
|||||||
@@ -0,0 +1,220 @@
|
|||||||
|
{
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
+19
-3
@@ -6,6 +6,12 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./himalaya.nix
|
||||||
|
./aerc.nix
|
||||||
|
./system.nix
|
||||||
|
];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
mail.enable = lib.mkEnableOption "Mail service.";
|
mail.enable = lib.mkEnableOption "Mail service.";
|
||||||
mail.user = lib.mkOption {
|
mail.user = lib.mkOption {
|
||||||
@@ -38,7 +44,7 @@
|
|||||||
services.mbsync = lib.mkIf pkgs.stdenv.isLinux {
|
services.mbsync = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
enable = true;
|
enable = true;
|
||||||
frequency = "*:0/5";
|
frequency = "*:0/5";
|
||||||
postExec = "${lib.getExe pkgs.notmuch} new";
|
postExec = "${pkgs.notmuch}/bin/notmuch new";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Used to watch for new mail and trigger sync
|
# Used to watch for new mail and trigger sync
|
||||||
@@ -47,10 +53,20 @@
|
|||||||
# Allows sending email from CLI/sendmail
|
# Allows sending email from CLI/sendmail
|
||||||
programs.msmtp.enable = true;
|
programs.msmtp.enable = true;
|
||||||
|
|
||||||
|
# Better local mail search
|
||||||
|
programs.notmuch = {
|
||||||
|
enable = true;
|
||||||
|
new.ignore = [
|
||||||
|
".mbsyncstate.lock"
|
||||||
|
".mbsyncstate.journal"
|
||||||
|
".mbsyncstate.new"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
accounts.email = {
|
accounts.email = {
|
||||||
|
|
||||||
# Where email files are stored
|
# Where email files are stored
|
||||||
maildirBasePath = "${config.home.homeDirectory}/mail";
|
maildirBasePath = "${config.homePath}/mail";
|
||||||
|
|
||||||
accounts = {
|
accounts = {
|
||||||
home =
|
home =
|
||||||
@@ -84,7 +100,7 @@
|
|||||||
onNotify = "${pkgs.isync}/bin/mbsync -a";
|
onNotify = "${pkgs.isync}/bin/mbsync -a";
|
||||||
onNotifyPost =
|
onNotifyPost =
|
||||||
lib.mkIf config.home-manager.users.${config.user}.services.dunst.enable
|
lib.mkIf config.home-manager.users.${config.user}.services.dunst.enable
|
||||||
"${lib.getExe pkgs.libnotify} 'New mail arrived'";
|
"${pkgs.libnotify}/bin/notify-send 'New mail arrived'";
|
||||||
};
|
};
|
||||||
|
|
||||||
# Name of the directory in maildir for this account
|
# Name of the directory in maildir for this account
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{ 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
File renamed without changes.
File renamed without changes.
+1
-1
@@ -13,7 +13,7 @@
|
|||||||
description = "Attrset of base16 colorscheme key value pairs.";
|
description = "Attrset of base16 colorscheme key value pairs.";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.colors {
|
config = {
|
||||||
plugins = [ pkgs.vimPlugins.base16-nvim ];
|
plugins = [ pkgs.vimPlugins.base16-nvim ];
|
||||||
setup.base16-colorscheme = config.colors;
|
setup.base16-colorscheme = config.colors;
|
||||||
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,67 @@
|
|||||||
|
{
|
||||||
|
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" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
File renamed without changes.
File renamed without changes.
+13
-13
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
colors ? null,
|
colors,
|
||||||
terraform ? false,
|
terraform ? false,
|
||||||
github ? false,
|
github ? false,
|
||||||
kubernetes ? false,
|
kubernetes ? false,
|
||||||
@@ -46,17 +46,17 @@ pkgs.neovimBuilder {
|
|||||||
kubernetes
|
kubernetes
|
||||||
;
|
;
|
||||||
imports = [
|
imports = [
|
||||||
./config/align.nix
|
../config/align.nix
|
||||||
./config/bufferline.nix
|
../config/bufferline.nix
|
||||||
./config/colors.nix
|
../config/colors.nix
|
||||||
./config/completion.nix
|
../config/completion.nix
|
||||||
./config/gitsigns.nix
|
../config/gitsigns.nix
|
||||||
./config/lsp.nix
|
../config/lsp.nix
|
||||||
./config/misc.nix
|
../config/misc.nix
|
||||||
./config/statusline.nix
|
../config/statusline.nix
|
||||||
./config/syntax.nix
|
../config/syntax.nix
|
||||||
./config/telescope.nix
|
../config/telescope.nix
|
||||||
./config/toggleterm.nix
|
../config/toggleterm.nix
|
||||||
./config/tree.nix
|
../config/tree.nix
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
File renamed without changes.
@@ -0,0 +1,12 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./haskell.nix
|
||||||
|
./kubernetes.nix
|
||||||
|
./lua.nix
|
||||||
|
./python.nix
|
||||||
|
./rust.nix
|
||||||
|
./terraform.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
+2
-6
@@ -1,13 +1,9 @@
|
|||||||
{ config, lib, ... }:
|
{ config, lib, ... }:
|
||||||
let
|
|
||||||
cfg = config.nmasur.presets.programs.haskell;
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
|
|
||||||
options.nmasur.presets.programs.haskell.enable =
|
options.haskell.enable = lib.mkEnableOption "Haskell programming language.";
|
||||||
lib.mkEnableOption "Haskell programming language config.";
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf config.haskell.enable {
|
||||||
|
|
||||||
# Binary Cache for Haskell.nix
|
# Binary Cache for Haskell.nix
|
||||||
nix.settings.trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
|
nix.settings.trusted-public-keys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ];
|
||||||
@@ -0,0 +1,164 @@
|
|||||||
|
{
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./dotfiles.nix
|
||||||
|
./notes.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
{ 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;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
File renamed without changes.
File renamed without changes.
@@ -10,8 +10,6 @@ else
|
|||||||
input=$1
|
input=$1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TODO: make available on non-macOS
|
|
||||||
|
|
||||||
echo '' |
|
echo '' |
|
||||||
fzf --phony \
|
fzf --phony \
|
||||||
--height 100% \
|
--height 100% \
|
||||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
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
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
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
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
{ 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
|
||||||
|
'';
|
||||||
|
}
|
||||||
+54
-20
@@ -1,44 +1,54 @@
|
|||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.nmasur.presets.programs.fish;
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
options.nmasur.presets.programs.fish = {
|
users.users.${config.user}.shell = pkgs.fish;
|
||||||
enable = lib.mkEnableOption "Fish shell";
|
programs.fish.enable = true; # Needed for LightDM to remember username
|
||||||
fish_user_key_bindings = lib.mkOption {
|
|
||||||
type = lib.types.lines;
|
|
||||||
description = "Text of fish_user_key_bindings function";
|
|
||||||
default = "";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
cfg.fish_user_key_bindings = # fish
|
# Packages used in abbreviations and aliases
|
||||||
''
|
home.packages = with pkgs; [ curl ];
|
||||||
# Shift-Enter (defined by terminal)
|
|
||||||
bind -M insert \x1F accept-autosuggestion
|
|
||||||
bind -M default \x1F accept-autosuggestion
|
|
||||||
'';
|
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
shellAliases = {
|
||||||
|
|
||||||
|
# Version of bash which works much better on the terminal
|
||||||
|
bash = "${pkgs.bashInteractive}/bin/bash";
|
||||||
|
|
||||||
|
# Use eza (exa) instead of ls for fancier output
|
||||||
|
ls = "${pkgs.eza}/bin/eza --group";
|
||||||
|
|
||||||
|
# Move files to XDG trash on the commandline
|
||||||
|
trash = lib.mkIf pkgs.stdenv.isLinux "${pkgs.trash-cli}/bin/trash-put";
|
||||||
|
};
|
||||||
functions = {
|
functions = {
|
||||||
|
commandline-git-commits = {
|
||||||
|
description = "Insert commit into commandline";
|
||||||
|
body = builtins.readFile ./functions/commandline-git-commits.fish;
|
||||||
|
};
|
||||||
copy = {
|
copy = {
|
||||||
description = "Copy file contents into clipboard";
|
description = "Copy file contents into clipboard";
|
||||||
body = "cat $argv | pbcopy"; # Need to fix for non-macOS
|
body = "cat $argv | pbcopy"; # Need to fix for non-macOS
|
||||||
};
|
};
|
||||||
|
edit = {
|
||||||
|
description = "Open a file in Vim";
|
||||||
|
body = builtins.readFile ./functions/edit.fish;
|
||||||
|
};
|
||||||
envs = {
|
envs = {
|
||||||
description = "Evaluate a bash-like environment variables file";
|
description = "Evaluate a bash-like environment variables file";
|
||||||
body = ''set -gx (cat $argv | tr "=" " " | string split ' ')'';
|
body = ''set -gx (cat $argv | tr "=" " " | string split ' ')'';
|
||||||
};
|
};
|
||||||
|
fcd = {
|
||||||
|
description = "Jump to directory";
|
||||||
|
argumentNames = "directory";
|
||||||
|
body = builtins.readFile ./functions/fcd.fish;
|
||||||
|
};
|
||||||
fish_user_key_bindings = {
|
fish_user_key_bindings = {
|
||||||
body = builtins.readFile ./functions/fish_user_key_bindings.fish;
|
body = builtins.readFile ./functions/fish_user_key_bindings.fish;
|
||||||
};
|
};
|
||||||
@@ -49,6 +59,23 @@ in
|
|||||||
description = "Tidy up JSON using jq";
|
description = "Tidy up JSON using jq";
|
||||||
body = "pbpaste | jq '.' | pbcopy"; # Need to fix for non-macOS
|
body = "pbpaste | jq '.' | pbcopy"; # Need to fix for non-macOS
|
||||||
};
|
};
|
||||||
|
note = {
|
||||||
|
description = "Edit or create a note";
|
||||||
|
argumentNames = "filename";
|
||||||
|
body = builtins.readFile ./functions/note.fish;
|
||||||
|
};
|
||||||
|
recent = {
|
||||||
|
description = "Open a recent file in Vim";
|
||||||
|
body = builtins.readFile ./functions/recent.fish;
|
||||||
|
};
|
||||||
|
search-and-edit = {
|
||||||
|
description = "Search and open the relevant file in Vim";
|
||||||
|
body = builtins.readFile ./functions/search-and-edit.fish;
|
||||||
|
};
|
||||||
|
syncnotes = {
|
||||||
|
description = "Full git commit on notes";
|
||||||
|
body = builtins.readFile ./functions/syncnotes.fish;
|
||||||
|
};
|
||||||
_which = {
|
_which = {
|
||||||
description = "Identify the path to a program in the shell";
|
description = "Identify the path to a program in the shell";
|
||||||
body = "command --search (string sub --start=2 $argv)";
|
body = "command --search (string sub --start=2 $argv)";
|
||||||
@@ -100,6 +127,10 @@ in
|
|||||||
# Notes
|
# Notes
|
||||||
sn = "syncnotes";
|
sn = "syncnotes";
|
||||||
|
|
||||||
|
# Fun CLI Tools
|
||||||
|
weather = "curl wttr.in/$WEATHER_CITY";
|
||||||
|
moon = "curl wttr.in/Moon";
|
||||||
|
|
||||||
# Cheat Sheets
|
# Cheat Sheets
|
||||||
ssl = "openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr";
|
ssl = "openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr";
|
||||||
fingerprint = "ssh-keyscan myhost.com | ssh-keygen -lf -";
|
fingerprint = "ssh-keyscan myhost.com | ssh-keygen -lf -";
|
||||||
@@ -116,5 +147,8 @@ in
|
|||||||
|
|
||||||
home.sessionVariables.fish_greeting = "";
|
home.sessionVariables.fish_greeting = "";
|
||||||
|
|
||||||
|
programs.starship.enableFishIntegration = true;
|
||||||
|
programs.zoxide.enableFishIntegration = true;
|
||||||
|
programs.fzf.enableFishIntegration = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,22 @@
|
|||||||
|
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'
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
#!/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
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Executable → Regular
File renamed without changes.
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
if test -n "$filename"
|
if test -n "$filename"
|
||||||
vim "$NOTES_PATH/$filename.md"
|
vim $NOTES_PATH/$filename.md
|
||||||
else
|
else
|
||||||
set file (ls $NOTES_PATH | fzf)
|
set file (ls $NOTES_PATH | fzf)
|
||||||
if [ $status -eq 0 ]
|
if [ $status -eq 0 ]
|
||||||
vim "$NOTES_PATH/$file"
|
vim $NOTES_PATH/$file
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
File renamed without changes.
+1
-1
@@ -17,5 +17,5 @@ set vimfile ( \
|
|||||||
)
|
)
|
||||||
and set line_number (echo $vimfile | tr -d '\r' | cut -d':' -f2)
|
and set line_number (echo $vimfile | tr -d '\r' | cut -d':' -f2)
|
||||||
and set vimfile (echo $vimfile | tr -d '\r' | cut -d':' -f1)
|
and set vimfile (echo $vimfile | tr -d '\r' | cut -d':' -f1)
|
||||||
and commandline -r "vim +$line_number \"$vimfile\""
|
and commandline -r "vim +$line_number $vimfile"
|
||||||
and commandline -f execute
|
and commandline -f execute
|
||||||
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,56 @@
|
|||||||
|
{ 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;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,195 @@
|
|||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
+6
-10
@@ -4,18 +4,13 @@
|
|||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
|
||||||
cfg = config.nmasur.presets.programs.github;
|
|
||||||
in
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
options.nmasur.presets.programs.github.enable = lib.mkEnableOption "GitHub features";
|
unfreePackages = [ "gh-copilot" ];
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
programs.gh = {
|
programs.gh = lib.mkIf config.home-manager.users.${config.user}.programs.git.enable {
|
||||||
enable = true;
|
enable = true;
|
||||||
gitCredentialHelper.enable = true;
|
gitCredentialHelper.enable = true;
|
||||||
settings.git_protocol = "https";
|
settings.git_protocol = "https";
|
||||||
@@ -26,7 +21,7 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = lib.mkIf config.home-manager.users.${config.user}.programs.gh.enable {
|
||||||
shellAbbrs = {
|
shellAbbrs = {
|
||||||
ghr = "gh repo view -w";
|
ghr = "gh repo view -w";
|
||||||
gha = "gh run list | head -1 | awk '{ print \\$\\(NF-2\\) }' | xargs gh run view";
|
gha = "gh run list | head -1 | awk '{ print \\$\\(NF-2\\) }' | xargs gh run view";
|
||||||
@@ -56,6 +51,8 @@ in
|
|||||||
t2) organization="take-two" ;;
|
t2) organization="take-two" ;;
|
||||||
d2c) organization="take-two-t2gp" ;;
|
d2c) organization="take-two-t2gp" ;;
|
||||||
t2gp) organization="take-two-t2gp" ;;
|
t2gp) organization="take-two-t2gp" ;;
|
||||||
|
pd) organization="private-division" ;;
|
||||||
|
dots) organization="playdots" ;;
|
||||||
*) organization="nmasur" ;;
|
*) organization="nmasur" ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
@@ -88,6 +85,5 @@ in
|
|||||||
}
|
}
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{ 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,133 @@
|
|||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
{
|
||||||
|
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)";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
{ 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";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}:
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||||
|
|
||||||
|
home.packages =
|
||||||
|
let
|
||||||
|
ldap_scheme = "ldaps";
|
||||||
|
magic_prefix = "take";
|
||||||
|
ldap_port = 3269;
|
||||||
|
jq_parse = pkgs.writeShellScriptBin "ljq" ''
|
||||||
|
jq --slurp \
|
||||||
|
--raw-input 'split("\n\n")|map(split("\n")|map(select(.[0:1]!="#" and length>0)) |select(length > 0)|map(capture("^(?<key>[^:]*:?): *(?<value>.*)") |if .key[-1:.key|length] == ":" then .key=.key[0:-1]|.value=(.value|@base64d) else . end)| group_by(.key) | map({key:.[0].key,value:(if .|length > 1 then [.[].value] else .[].value end)}) | from_entries)' | jq -r 'del(.[].thumbnailPhoto)'
|
||||||
|
'';
|
||||||
|
ldap_script = pkgs.writeShellScriptBin "ldap" ''
|
||||||
|
if ! [ "$LDAP_HOST" ]; then
|
||||||
|
echo "No LDAP_HOST specified!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
SEARCH_FILTER="$@"
|
||||||
|
ldapsearch -LLL \
|
||||||
|
-B -o ldif-wrap=no \
|
||||||
|
-E pr=5000/prompt \
|
||||||
|
-H "${ldap_scheme}://''${LDAP_HOST}:${builtins.toString ldap_port}" \
|
||||||
|
-D "${pkgs.lib.toUpper magic_prefix}2\\${pkgs.lib.toLower config.user}" \
|
||||||
|
-w "$(${pkgs._1password-cli}/bin/op item get T2 --fields label=password --reveal)" \
|
||||||
|
-b "dc=''${LDAP_HOST//./,dc=}" \
|
||||||
|
-s "sub" -x "(cn=''${SEARCH_FILTER})" \
|
||||||
|
| ${jq_parse}/bin/ljq
|
||||||
|
'';
|
||||||
|
ldapm_script = pkgs.writeShellScriptBin "ldapm" ''
|
||||||
|
if ! [ "$LDAP_HOST" ]; then
|
||||||
|
echo "No LDAP_HOST specified!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
${ldap_script}/bin/ldap "$@" | jq '[ .[].memberOf] | add'
|
||||||
|
'';
|
||||||
|
ldapg_script = pkgs.writeShellScriptBin "ldapg" ''
|
||||||
|
if ! [ "$LDAP_HOST" ]; then
|
||||||
|
echo "No LDAP_HOST specified!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
${ldap_script}/bin/ldap "$@" | jq '[ .[].member] | add'
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
[
|
||||||
|
ldap_script
|
||||||
|
ldapm_script
|
||||||
|
ldapg_script
|
||||||
|
jq_parse
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,656 @@
|
|||||||
|
{
|
||||||
|
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~";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
{ ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
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
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
config = {
|
||||||
|
|
||||||
|
# MacOS-specific settings for Fish
|
||||||
|
programs.fish.useBabelfish = true;
|
||||||
|
programs.fish.babelfishPackage = pkgs.babelfish;
|
||||||
|
};
|
||||||
|
}
|
||||||
Loaded 100 of 346 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user