mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-06 23:40:15 +00:00
Compare commits
101 Commits
7063bd5f7a
...
unfree-pre
Author | SHA1 | Date | |
---|---|---|---|
8ab86428ec | |||
d4fa322fb1 | |||
3d73f8cab4 | |||
0df8af607d | |||
61d9b103b0 | |||
71d0d3ca14 | |||
d5b0405b99 | |||
3cad3d2fb0 | |||
2acd9b3478 | |||
bf4be11718 | |||
4d38d1094f | |||
183babd2f0 | |||
12682a57e1 | |||
31170a616f | |||
4502c5ff62 | |||
59bd3590a4 | |||
ebacff7250 | |||
763f0bbdda | |||
18505d4cbb | |||
a7c04b59ed | |||
d46e6dad6b | |||
5e4642b92e | |||
7ab78767d4 | |||
366a7f6157 | |||
fb47302f3b | |||
cda3ee0a4c | |||
0ed11de174 | |||
ab6f80fc18 | |||
d1f21ec874 | |||
cdcc90f85d | |||
f5674134fc | |||
d37cabfd9a | |||
6e117769c6 | |||
f648e92c28 | |||
43343b2824 | |||
ab9136af2c | |||
a7fe90b236 | |||
5557065c8b | |||
de1fae2baf | |||
2c310fd2f2 | |||
aa4dc4a0c2 | |||
44821ea344 | |||
cb60542980 | |||
3fe6911e2d | |||
afa62c5510 | |||
fea0396dce | |||
13014e6cc1 | |||
640e447006 | |||
595a02383e | |||
3689f8ef52 | |||
ab6a339c34 | |||
e6456d7f02 | |||
fb74122458 | |||
d56a48cf65 | |||
30fe7c2d18 | |||
08716d1c98 | |||
60b68785a9 | |||
c360460d80 | |||
b1b5e77f47 | |||
67af160088 | |||
80d0451ff3 | |||
0ba2492c61 | |||
3dd7fa12b0 | |||
741692e6f1 | |||
7a547f99c0 | |||
18c9e1efc8 | |||
ac3d5e495c | |||
252b3d5dac | |||
6d0b0e3560 | |||
48d33a9ef5 | |||
c08f08692b | |||
a8d1369c49 | |||
450118d234 | |||
cc84f1d37a | |||
ded498f4c9 | |||
0d0ee1fc5a | |||
251dce68bb | |||
448c97665b | |||
86aa02aae4 | |||
6cd22bc7ce | |||
048de4772c | |||
700e59e6c8 | |||
07e0afa1e9 | |||
6577b9e49b | |||
58a0e6166d | |||
e8c5a10df7 | |||
37fa835c66 | |||
fa69557ced | |||
a9a06fb5fc | |||
ceaad9d186 | |||
521937e366 | |||
8915f17ea3 | |||
17799909b2 | |||
7a4c3b930d | |||
e7bbee5da0 | |||
2dda6a31bd | |||
e4d76189e6 | |||
0bc8a233d8 | |||
524a5aa347 | |||
b4ddb149cc | |||
d021baa1bb |
36
README.md
36
README.md
@ -1,3 +1,5 @@
|
|||||||
|
# System Configurations
|
||||||
|
|
||||||
This repository contains configuration files for my NixOS, macOS, and WSL
|
This repository contains configuration files for my NixOS, macOS, and WSL
|
||||||
hosts.
|
hosts.
|
||||||
|
|
||||||
@ -6,31 +8,31 @@ configuration may be difficult to translate to a non-Nix system.
|
|||||||
|
|
||||||
However, some of the configurations are easier to lift directly:
|
However, some of the configurations are easier to lift directly:
|
||||||
|
|
||||||
- [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/neovim/config)
|
- [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/common/neovim/config)
|
||||||
- [Fish functions](https://github.com/nmasur/dotfiles/tree/master/modules/shell/fish/functions)
|
- [Fish functions](https://github.com/nmasur/dotfiles/tree/master/modules/common/shell/fish/functions)
|
||||||
- [More fish aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/fish/default.nix)
|
- [More fish aliases](https://github.com/nmasur/dotfiles/blob/master/modules/common/shell/fish/default.nix)
|
||||||
- [Git aliases](https://github.com/nmasur/dotfiles/blob/master/modules/shell/git.nix)
|
- [Git aliases](https://github.com/nmasur/dotfiles/blob/master/modules/common/shell/git.nix)
|
||||||
- [Hammerspoon](https://github.com/nmasur/dotfiles/tree/master/modules/darwin/hammerspoon)
|
- [Hammerspoon](https://github.com/nmasur/dotfiles/tree/master/modules/darwin/hammerspoon)
|
||||||
|
|
||||||
Try out my Neovim config:
|
Try out my Neovim config (requires [nix](https://nixos.org/download.html)):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
nix run github:nmasur/dotfiles#neovim
|
nix run github:nmasur/dotfiles#neovim
|
||||||
```
|
```
|
||||||
|
|
||||||
Or build it as a package:
|
Or build it as a package (requires [nix](https://nixos.org/download.html)):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
nix build github:nmasur/dotfiles#neovim
|
nix build github:nmasur/dotfiles#neovim
|
||||||
```
|
```
|
||||||
|
|
||||||
If you already have a Neovim configuration, you may need to move it out of
|
If you already have a Neovim configuration, you may need to move it out of
|
||||||
`~/.config/nvim` or set `XDG_CONFIG_HOME` to another value; otherwise, both
|
`~/.config/nvim` or set `XDG_CONFIG_HOME` to another value; otherwise both
|
||||||
configs might conflict with each other.
|
configs might conflict with each other.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
# Installation
|
# Full Installation
|
||||||
|
|
||||||
## NixOS - From Live Disk
|
## NixOS - From Live Disk
|
||||||
|
|
||||||
@ -42,7 +44,7 @@ installer disk:
|
|||||||
```bash
|
```bash
|
||||||
lsblk # Choose the disk you want to wipe
|
lsblk # Choose the disk you want to wipe
|
||||||
nix-shell -p nixVersions.stable
|
nix-shell -p nixVersions.stable
|
||||||
nix run github:nmasur/dotfiles#installer -- nvme0n1 desktop
|
nix run github:nmasur/dotfiles#installer -- nvme0n1 tempest
|
||||||
```
|
```
|
||||||
|
|
||||||
## NixOS - From Existing System
|
## NixOS - From Existing System
|
||||||
@ -52,7 +54,7 @@ following command:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
nix-shell -p nixVersions.stable
|
nix-shell -p nixVersions.stable
|
||||||
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#desktop
|
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#tempest
|
||||||
```
|
```
|
||||||
|
|
||||||
## Windows - From NixOS WSL
|
## Windows - From NixOS WSL
|
||||||
@ -63,7 +65,7 @@ the WSL configuration:
|
|||||||
|
|
||||||
```
|
```
|
||||||
nix-shell -p nixVersions.stable
|
nix-shell -p nixVersions.stable
|
||||||
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#wsl
|
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#hydra
|
||||||
```
|
```
|
||||||
|
|
||||||
You should also download the
|
You should also download the
|
||||||
@ -90,17 +92,7 @@ nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
|
|||||||
Then switch to the macOS configuration:
|
Then switch to the macOS configuration:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
darwin-rebuild switch --flake github:nmasur/dotfiles#macbook
|
darwin-rebuild switch --flake github:nmasur/dotfiles#lookingglass
|
||||||
```
|
|
||||||
|
|
||||||
### Dealing with corporate MITM SSL certificates:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Get the certificates
|
|
||||||
openssl s_client -showcerts -verify 5 -connect cache.nixos.org:443 < /dev/null
|
|
||||||
|
|
||||||
# Paste them in here
|
|
||||||
sudo nvim $NIX_SSL_CERT_FILE
|
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
@ -1,45 +1,19 @@
|
|||||||
{ pkgs, ... }: rec {
|
{ pkgs, ... }: rec {
|
||||||
|
|
||||||
default = {
|
# Show quick helper
|
||||||
type = "app";
|
default = import ./help.nix { inherit pkgs; };
|
||||||
program = builtins.toString (pkgs.writeShellScript "default" ''
|
|
||||||
${pkgs.gum}/bin/gum style --margin "1 2" --padding "0 2" --foreground "15" --background "55" "Options"
|
|
||||||
${pkgs.gum}/bin/gum format --type=template -- ' {{ Italic "Run with" }} {{ Color "15" "69" " nix run github:nmasur/dotfiles#" }}{{ Color "15" "62" "someoption" }}{{ Color "15" "69" " " }}.'
|
|
||||||
echo ""
|
|
||||||
echo ""
|
|
||||||
${pkgs.gum}/bin/gum format --type=template -- \
|
|
||||||
' • {{ Color "15" "57" " readme " }} {{ Italic "Documentation for this repository." }}' \
|
|
||||||
' • {{ Color "15" "57" " rebuild " }} {{ Italic "Switch to this configuration." }}' \
|
|
||||||
' • {{ Color "15" "57" " installer " }} {{ Italic "Format and install from nothing." }}' \
|
|
||||||
' • {{ Color "15" "57" " neovim " }} {{ Italic "Test out the Neovim package." }}' \
|
|
||||||
' • {{ Color "15" "57" " loadkey " }} {{ Italic "Load an ssh key for this machine using melt." }}' \
|
|
||||||
' • {{ Color "15" "57" " encrypt-secret " }} {{ Italic "Encrypt a secret for all machines." }}' \
|
|
||||||
' • {{ Color "15" "57" " reencrypt-secrets " }} {{ Italic "Reencrypt all secrets when new machine is added." }}' \
|
|
||||||
' • {{ Color "15" "57" " netdata " }} {{ Italic "Connect a machine to Netdata cloud." }}'
|
|
||||||
echo ""
|
|
||||||
echo ""
|
|
||||||
'');
|
|
||||||
};
|
|
||||||
|
|
||||||
# Format and install from nothing
|
# Format primary disk
|
||||||
|
format-root = import ./format-root.nix { inherit pkgs; };
|
||||||
|
|
||||||
|
# Format and install from nothing (deprecated)
|
||||||
installer = import ./installer.nix { inherit pkgs; };
|
installer = import ./installer.nix { inherit pkgs; };
|
||||||
|
|
||||||
# Display the readme for this repository
|
# Display the readme for this repository
|
||||||
readme = import ./readme.nix { inherit pkgs; };
|
readme = import ./readme.nix { inherit pkgs; };
|
||||||
|
|
||||||
# Rebuild
|
# Rebuild
|
||||||
rebuild = {
|
rebuild = import ./rebuild.nix { inherit pkgs; };
|
||||||
type = "app";
|
|
||||||
program = builtins.toString (pkgs.writeShellScript "rebuild" ''
|
|
||||||
echo ${pkgs.system}
|
|
||||||
SYSTEM=${if pkgs.stdenv.isDarwin then "darwin" else "linux"}
|
|
||||||
if [ "$SYSTEM" == "darwin" ]; then
|
|
||||||
darwin-rebuild switch --flake github:nmasur/dotfiles#macbook
|
|
||||||
else
|
|
||||||
nixos-rebuild switch --flake github:nmasur/dotfiles
|
|
||||||
fi
|
|
||||||
'');
|
|
||||||
};
|
|
||||||
|
|
||||||
# Load the SSH key for this machine
|
# Load the SSH key for this machine
|
||||||
loadkey = import ./loadkey.nix { inherit pkgs; };
|
loadkey = import ./loadkey.nix { inherit pkgs; };
|
||||||
@ -54,17 +28,7 @@
|
|||||||
netdata = import ./netdata-cloud.nix { inherit pkgs; };
|
netdata = import ./netdata-cloud.nix { inherit pkgs; };
|
||||||
|
|
||||||
# Run neovim as an app
|
# Run neovim as an app
|
||||||
neovim = {
|
neovim = import ./neovim.nix { inherit pkgs; };
|
||||||
type = "app";
|
|
||||||
program = "${
|
|
||||||
(import ../modules/neovim/package {
|
|
||||||
inherit pkgs;
|
|
||||||
colors =
|
|
||||||
import ../colorscheme/gruvbox/neovim-gruvbox.nix { inherit pkgs; };
|
|
||||||
})
|
|
||||||
}/bin/nvim";
|
|
||||||
};
|
|
||||||
|
|
||||||
nvim = neovim;
|
nvim = neovim;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
echo "''${secret}" > ''${tmpfile}
|
echo "''${secret}" > ''${tmpfile}
|
||||||
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
|
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
|
||||||
builtins.toString ../hosts/public-keys
|
builtins.toString ../public-keys
|
||||||
} $tmpfile
|
} $tmpfile
|
||||||
rm $tmpfile
|
rm $tmpfile
|
||||||
'');
|
'');
|
||||||
|
39
apps/format-root.nix
Normal file
39
apps/format-root.nix
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
# This script will partition and format drives; use at your own risk!
|
||||||
|
|
||||||
|
type = "app";
|
||||||
|
|
||||||
|
program = builtins.toString (pkgs.writeShellScript "format-root" ''
|
||||||
|
set -e
|
||||||
|
|
||||||
|
DISK=$1
|
||||||
|
|
||||||
|
if [ -z "''${DISK}" ]; then
|
||||||
|
${pkgs.gum}/bin/gum style --width 50 --margin "1 2" --padding "2 4" \
|
||||||
|
--foreground "#fb4934" \
|
||||||
|
"Missing required parameter." \
|
||||||
|
"Usage: format-root -- <disk>" \
|
||||||
|
"Flake example: nix run github:nmasur/dotfiles#format-root -- nvme0n1"
|
||||||
|
echo "(exiting)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
${pkgs.disko-packaged}/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-packaged}/bin/disko \
|
||||||
|
--mode create \
|
||||||
|
--flake "path:$(pwd)#root" \
|
||||||
|
--arg disk "/dev/''${DISK}"
|
||||||
|
|
||||||
|
'');
|
||||||
|
|
||||||
|
}
|
23
apps/help.nix
Normal file
23
apps/help.nix
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
type = "app";
|
||||||
|
|
||||||
|
program = builtins.toString (pkgs.writeShellScript "default" ''
|
||||||
|
${pkgs.gum}/bin/gum style --margin "1 2" --padding "0 2" --foreground "15" --background "55" "Options"
|
||||||
|
${pkgs.gum}/bin/gum format --type=template -- ' {{ Italic "Run with" }} {{ Color "15" "69" " nix run github:nmasur/dotfiles#" }}{{ Color "15" "62" "someoption" }}{{ Color "15" "69" " " }}.'
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
${pkgs.gum}/bin/gum format --type=template -- \
|
||||||
|
' • {{ Color "15" "57" " readme " }} {{ Italic "Documentation for this repository." }}' \
|
||||||
|
' • {{ Color "15" "57" " rebuild " }} {{ Italic "Switch to this configuration." }}' \
|
||||||
|
' • {{ Color "15" "57" " installer " }} {{ Italic "Format and install from nothing." }}' \
|
||||||
|
' • {{ Color "15" "57" " neovim " }} {{ Italic "Test out the Neovim package." }}' \
|
||||||
|
' • {{ Color "15" "57" " loadkey " }} {{ Italic "Load an ssh key for this machine using melt." }}' \
|
||||||
|
' • {{ Color "15" "57" " encrypt-secret " }} {{ Italic "Encrypt a secret for all machines." }}' \
|
||||||
|
' • {{ Color "15" "57" " reencrypt-secrets " }} {{ Italic "Reencrypt all secrets when new machine is added." }}' \
|
||||||
|
' • {{ Color "15" "57" " netdata " }} {{ Italic "Connect a machine to Netdata cloud." }}'
|
||||||
|
echo ""
|
||||||
|
echo ""
|
||||||
|
'');
|
||||||
|
|
||||||
|
}
|
13
apps/neovim.nix
Normal file
13
apps/neovim.nix
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
type = "app";
|
||||||
|
|
||||||
|
program = "${
|
||||||
|
(import ../modules/common/neovim/package {
|
||||||
|
inherit pkgs;
|
||||||
|
colors =
|
||||||
|
import ../colorscheme/gruvbox/neovim-gruvbox.nix { inherit pkgs; };
|
||||||
|
})
|
||||||
|
}/bin/nvim";
|
||||||
|
|
||||||
|
}
|
15
apps/rebuild.nix
Normal file
15
apps/rebuild.nix
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
|
type = "app";
|
||||||
|
|
||||||
|
program = builtins.toString (pkgs.writeShellScript "rebuild" ''
|
||||||
|
echo ${pkgs.system}
|
||||||
|
SYSTEM=${if pkgs.stdenv.isDarwin then "darwin" else "linux"}
|
||||||
|
if [ "$SYSTEM" == "darwin" ]; then
|
||||||
|
darwin-rebuild switch --flake github:nmasur/dotfiles#lookingglass
|
||||||
|
else
|
||||||
|
nixos-rebuild switch --flake github:nmasur/dotfiles
|
||||||
|
fi
|
||||||
|
'');
|
||||||
|
|
||||||
|
}
|
@ -17,7 +17,7 @@
|
|||||||
--identity ~/.ssh/id_ed25519 $encryptedfile > $tmpfile
|
--identity ~/.ssh/id_ed25519 $encryptedfile > $tmpfile
|
||||||
echo "Encrypting ''${encryptedfile}..."
|
echo "Encrypting ''${encryptedfile}..."
|
||||||
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
|
${pkgs.age}/bin/age --encrypt --armor --recipients-file ${
|
||||||
builtins.toString ../hosts/public-keys
|
builtins.toString ../public-keys
|
||||||
} $tmpfile > $encryptedfile
|
} $tmpfile > $encryptedfile
|
||||||
rm $tmpfile
|
rm $tmpfile
|
||||||
done
|
done
|
||||||
|
44
disks/root.nix
Normal file
44
disks/root.nix
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
{ disk, ... }: {
|
||||||
|
disk = {
|
||||||
|
boot = {
|
||||||
|
type = "disk";
|
||||||
|
device = disk;
|
||||||
|
content = {
|
||||||
|
type = "table";
|
||||||
|
format = "gpt";
|
||||||
|
partitions = [
|
||||||
|
# Boot partition
|
||||||
|
{
|
||||||
|
type = "partition";
|
||||||
|
name = "ESP";
|
||||||
|
start = "0";
|
||||||
|
end = "512MiB";
|
||||||
|
fs-type = "fat32";
|
||||||
|
bootable = true;
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
extraArgs = [ "-n boot" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
# Root partition ext4
|
||||||
|
{
|
||||||
|
type = "partition";
|
||||||
|
name = "root";
|
||||||
|
start = "512MiB";
|
||||||
|
end = "100%";
|
||||||
|
part-type = "primary";
|
||||||
|
bootable = true;
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext4";
|
||||||
|
mountpoint = "/";
|
||||||
|
extraArgs = [ "-L nixos" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
95
disks/zfs.nix
Normal file
95
disks/zfs.nix
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
{ 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";
|
||||||
|
# };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
23
docs/restore-calibre.md
Normal file
23
docs/restore-calibre.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Restoring Calibre From Backup
|
||||||
|
|
||||||
|
The `metadata.db` holds the library and `app.db` and `gdrive.db` contain the
|
||||||
|
web/account information.
|
||||||
|
|
||||||
|
Place books directories in `/data/books/`.
|
||||||
|
|
||||||
|
Place `metadata.db` in `/var/lib/calibre-web-db/`.
|
||||||
|
|
||||||
|
Symlink `metadata.db` to the library:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo ln -s /var/lib/calibre-web-db/metadata.db /data/books/metadata.db
|
||||||
|
```
|
||||||
|
|
||||||
|
Place `app.db` and `gdrive.db` in `/var/lib/calibre-web/`.
|
||||||
|
|
||||||
|
Restart Calibre:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo systemctl restart calibre-web.service
|
||||||
|
```
|
||||||
|
|
43
docs/restore-nextcloud.md
Normal file
43
docs/restore-nextcloud.md
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
# Restoring Nextcloud From Backup
|
||||||
|
|
||||||
|
Install the `litestream` package.
|
||||||
|
|
||||||
|
```
|
||||||
|
nix-shell --run fish -p litestream
|
||||||
|
```
|
||||||
|
|
||||||
|
Set the S3 credentials:
|
||||||
|
|
||||||
|
```
|
||||||
|
set -x AWS_ACCESS_KEY_ID (read)
|
||||||
|
set -x AWS_SECRET_ACCESS_KEY (read)
|
||||||
|
```
|
||||||
|
|
||||||
|
Restore from S3:
|
||||||
|
|
||||||
|
```
|
||||||
|
litestream restore -o nextcloud.db s3://noahmasur-backup.s3.us-west-002.backblazeb2.com/nextcloud
|
||||||
|
```
|
||||||
|
|
||||||
|
Install Nextcloud. Then copy DB:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo rm /data/nextcloud/data/nextcloud.db*
|
||||||
|
sudo mv nextcloud.db /data/nextcloud/data/
|
||||||
|
sudo chown nextcloud:nextcloud /data/nextcloud/data/nextcloud.db
|
||||||
|
sudo chmod 770 /data/nextcloud/data/nextcloud.db
|
||||||
|
```
|
||||||
|
|
||||||
|
Restart Nextcloud:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo systemctl restart phpfpm-nextcloud.service
|
||||||
|
```
|
||||||
|
|
||||||
|
Adjust Permissions and Directories:
|
||||||
|
|
||||||
|
```
|
||||||
|
sudo mkdir /data/nextcloud/data/noah/files
|
||||||
|
sudo chown nextcloud:nextcloud /data/nextcloud/data/noah/files
|
||||||
|
```
|
||||||
|
|
165
flake.lock
generated
165
flake.lock
generated
@ -3,11 +3,11 @@
|
|||||||
"Comment-nvim-src": {
|
"Comment-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668781964,
|
"lastModified": 1674040818,
|
||||||
"narHash": "sha256-po1MyuuOH3e8yJTAtkxnusFSJuNpQnjpe+zfWPoO62E=",
|
"narHash": "sha256-7UtZAE9tPlnpeHS2LLol/LGVOxptDXNKWXHNHvFBNk4=",
|
||||||
"owner": "numToStr",
|
"owner": "numToStr",
|
||||||
"repo": "Comment.nvim",
|
"repo": "Comment.nvim",
|
||||||
"rev": "5f01c1a89adafc52bf34e3bf690f80d9d726715d",
|
"rev": "eab2c83a0207369900e92783f56990808082eac2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -19,11 +19,11 @@
|
|||||||
"bufferline-nvim-src": {
|
"bufferline-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668632062,
|
"lastModified": 1676130961,
|
||||||
"narHash": "sha256-qGl1jwBaMFWsrth7F20KrfJpyVENF8GEOJsVBBcSTVA=",
|
"narHash": "sha256-3LT45i0eSMfUV9EBrtdtzHxFKRATIhRy/faDd3lI3mA=",
|
||||||
"owner": "akinsho",
|
"owner": "akinsho",
|
||||||
"repo": "bufferline.nvim",
|
"repo": "bufferline.nvim",
|
||||||
"rev": "4ecfa81e470a589e74adcde3d5bb1727dd407363",
|
"rev": "84b0822b2af478d0b4f7b0f9249ca218855331db",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -35,11 +35,11 @@
|
|||||||
"cmp-nvim-lsp-src": {
|
"cmp-nvim-lsp-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668566979,
|
"lastModified": 1675708067,
|
||||||
"narHash": "sha256-Mqkp8IH/laUx0cK7S0BjusTT+OtOOJOamZM4+93RHdU=",
|
"narHash": "sha256-DxpcPTBlvVP88PDoTheLV2fC76EXDqS2UpM5mAfj/D4=",
|
||||||
"owner": "hrsh7th",
|
"owner": "hrsh7th",
|
||||||
"repo": "cmp-nvim-lsp",
|
"repo": "cmp-nvim-lsp",
|
||||||
"rev": "59224771f91b86d1de12570b4070fe4ad7cd1eeb",
|
"rev": "0e6b2ed705ddcff9738ec4ea838141654f12eeef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -55,11 +55,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671196037,
|
"lastModified": 1673295039,
|
||||||
"narHash": "sha256-2+J98SeczFWonbqFLMEAQC7vZEe6I2gM17XYvEmG52I=",
|
"narHash": "sha256-AsdYgE8/GPwcelGgrntlijMg4t3hLFJFCRF3tL5WVjA=",
|
||||||
"owner": "lnl7",
|
"owner": "lnl7",
|
||||||
"repo": "nix-darwin",
|
"repo": "nix-darwin",
|
||||||
"rev": "adb8ac0453c8b2c40f5bffb578453dbaee838952",
|
"rev": "87b9d090ad39b25b2400029c64825fc2a8868943",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -69,16 +69,36 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"disko": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1677116397,
|
||||||
|
"narHash": "sha256-2OHwhv4k1SDEuNxhq+zluvrd5pbW8d4TP9NKW4B8iO8=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "disko",
|
||||||
|
"rev": "8fddb2fd721365fa77ff68b709539639d4dc65d7",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "disko",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"firefox-darwin": {
|
"firefox-darwin": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671410692,
|
"lastModified": 1676854489,
|
||||||
"narHash": "sha256-azBs+c7zMnjNXntsnFM67AKsTdlUhU4eFzZwtTEGScs=",
|
"narHash": "sha256-hWmx3JFLNPGMtflyjgEn5GZydbLW3msjXvarS1NsBDM=",
|
||||||
"owner": "bandithedoge",
|
"owner": "bandithedoge",
|
||||||
"repo": "nixpkgs-firefox-darwin",
|
"repo": "nixpkgs-firefox-darwin",
|
||||||
"rev": "ce6bde60382284ca3044b4010143fec0c44a3cf5",
|
"rev": "6a5cca0ea8dfab4718e1e43e243c80ba110c2364",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -90,11 +110,11 @@
|
|||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1668681692,
|
"lastModified": 1673956053,
|
||||||
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
|
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||||
"owner": "edolstra",
|
"owner": "edolstra",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
|
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -156,11 +176,11 @@
|
|||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671459164,
|
"lastModified": 1678271387,
|
||||||
"narHash": "sha256-RbkDnvLV7WjbiF4Dpiezrf8kXxwieQXAVtY8ciRQj6Q=",
|
"narHash": "sha256-H2dv/i1LRlunRtrESirELzfPWdlG/6ElDB1ksO529H4=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "e7eba9cc46547ae86642ad3c6a9a4fb22c07bc26",
|
"rev": "36999b8d19eb6eebb41983ef017d7e0095316af2",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -177,11 +197,11 @@
|
|||||||
"rust-overlay": "rust-overlay"
|
"rust-overlay": "rust-overlay"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1670595719,
|
"lastModified": 1676110678,
|
||||||
"narHash": "sha256-9jvA0QdcZtGWImiRZ8KRhXNsy5NxgZBm0TXtNLmFbyM=",
|
"narHash": "sha256-hemg8rMKS2me2Wua9ZG/0aQ8fEOfytjyKB+WYcXfEKE=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "nil",
|
"repo": "nil",
|
||||||
"rev": "1c122ae707c6365ea731565daf307844df03e95e",
|
"rev": "ce2e0b5d60fe497134050796f7d12ffb6b50eb28",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -198,11 +218,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671522211,
|
"lastModified": 1673891598,
|
||||||
"narHash": "sha256-i5BLrj3wlIC1VMQTfBSYIasEmv3D4as0Mu2K3rdJrSU=",
|
"narHash": "sha256-EevceKxQtA+I0XVA8tBGKmYV1V1KbWc3gsswysMzeDk=",
|
||||||
"owner": "gytis-ivaskevicius",
|
"owner": "gytis-ivaskevicius",
|
||||||
"repo": "nix2vim",
|
"repo": "nix2vim",
|
||||||
"rev": "3cc95ef557b6e2f97f5ff14ae89997a564d3a130",
|
"rev": "5b31eb81e2c6c74f9e8a4911660f3bf585d55158",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -234,11 +254,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671355134,
|
"lastModified": 1674666581,
|
||||||
"narHash": "sha256-ZtnUWTDDyFog+NQBjZpnhgPdj3gHp5ImxFVWy+ObNno=",
|
"narHash": "sha256-KNI2s/xrL7WOYaPJAWKBtb7cCH3335rLfsL+B+ssuGY=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nixos-generators",
|
"repo": "nixos-generators",
|
||||||
"rev": "64a96ca8621d03cb3889daf0d3ff58d8209e3e0c",
|
"rev": "6a5dc1d3d557ea7b5c19b15ff91955124d0400fa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -265,11 +285,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1670559856,
|
"lastModified": 1675309347,
|
||||||
"narHash": "sha256-xUkgQRFqE6HIFQXs9SIXMZiXcLaH2415UR6w/FnsgcY=",
|
"narHash": "sha256-D3CQ6HRDT2m3XJlrzb5jKq4vNFR5xFTEFKC7iSjlFpM=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "6bc6f77cb171a74001033d94f17f49043a9f1804",
|
"rev": "006c3bd4dd2f5d1d2094047f307cbf9e2b73d9c5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -281,11 +301,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_3": {
|
"nixpkgs_3": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671359686,
|
"lastModified": 1676885936,
|
||||||
"narHash": "sha256-3MpC6yZo+Xn9cPordGz2/ii6IJpP2n8LE8e/ebUXLrs=",
|
"narHash": "sha256-ZRKb6zBfTvdCOXI7nGC1L9UWSU5ay2ltxg+f5UIzBOU=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "04f574a1c0fde90b51bf68198e2297ca4e7cccf4",
|
"rev": "b69883faca9542d135fa6bab7928ff1b233c167f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -297,11 +317,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs_4": {
|
"nixpkgs_4": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671313200,
|
"lastModified": 1674868155,
|
||||||
"narHash": "sha256-itZTrtHeDJjV696+ur0/TzkTqb5y3Eb57WRLRPK3rwA=",
|
"narHash": "sha256-eFNm2h6fNbgD7ZpO4MHikCB5pSnCJ7DTmwPisjetmwc=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "0938d73bb143f4ae037143572f11f4338c7b2d1c",
|
"rev": "ce20e9ebe1903ea2ba1ab006ec63093020c761cb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -314,11 +334,11 @@
|
|||||||
"null-ls-nvim-src": {
|
"null-ls-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671458255,
|
"lastModified": 1676246878,
|
||||||
"narHash": "sha256-YQaWKSW9D1HEBva9GeivQkylFeYfTrFUiTkXYF4V8SA=",
|
"narHash": "sha256-hAUEa2zNsYXQ+TsHYHBzcW67lCxhiD7x+uPbdOZwY8o=",
|
||||||
"owner": "jose-elias-alvarez",
|
"owner": "jose-elias-alvarez",
|
||||||
"repo": "null-ls.nvim",
|
"repo": "null-ls.nvim",
|
||||||
"rev": "db1c7cb5f6d6f6036b7f8433bb3cfcbe985cb3d1",
|
"rev": "d4594231a06cecce73a78a256b0d7c7ab51f7dd5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -329,11 +349,11 @@
|
|||||||
},
|
},
|
||||||
"nur": {
|
"nur": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671547500,
|
"lastModified": 1676251563,
|
||||||
"narHash": "sha256-97hzIBBNDbva9eRj1WomM+pimxt7hVrH/yNjUfJSMJc=",
|
"narHash": "sha256-itLKR2Haeh5wQ6dxkuZ8L5gwp3+CAggpN+w2e7cLQPg=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "nur",
|
"repo": "nur",
|
||||||
"rev": "4103fbdf825891b4dc54a6bda72ef1757081444c",
|
"rev": "9a8b28a9d6611f6af9f7abb3e690fc755d6906fe",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -345,11 +365,11 @@
|
|||||||
"nvim-lspconfig-src": {
|
"nvim-lspconfig-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671517641,
|
"lastModified": 1676175675,
|
||||||
"narHash": "sha256-RWXc/nCVNPv0BQN99QQMfeplQFpEsNJdmyoC/TQuIYQ=",
|
"narHash": "sha256-Wg3NatT4DRBMF6hCxK4C2DC+geFMpfFUFogPbqeMt6E=",
|
||||||
"owner": "neovim",
|
"owner": "neovim",
|
||||||
"repo": "nvim-lspconfig",
|
"repo": "nvim-lspconfig",
|
||||||
"rev": "d597b0f3605f43526f1b6948c6d7ca2919ea32ac",
|
"rev": "1712672e4da3003a0dd9f771d30389600b360f42",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -361,11 +381,11 @@
|
|||||||
"nvim-tree-lua-src": {
|
"nvim-tree-lua-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671430707,
|
"lastModified": 1676244722,
|
||||||
"narHash": "sha256-SdQ7nCgrtSN96XeaPjDoGnc++jllYy/up/jDc5LunRM=",
|
"narHash": "sha256-xoSekdZhWr59qTOM0/ihYiuKiwHiKYb42Ep5JHn65UM=",
|
||||||
"owner": "kyazdani42",
|
"owner": "kyazdani42",
|
||||||
"repo": "nvim-tree.lua",
|
"repo": "nvim-tree.lua",
|
||||||
"rev": "e14c2895b4f36a22001f7773244041c173dcf867",
|
"rev": "ba1778e061f25814bc5940be886a7f41d7d7736e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -377,11 +397,11 @@
|
|||||||
"nvim-treesitter-src": {
|
"nvim-treesitter-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671521720,
|
"lastModified": 1676240774,
|
||||||
"narHash": "sha256-GeuRomX3cFXK/zqWf1SJ3WXbTSLLy3FT99lIyhVnefo=",
|
"narHash": "sha256-eRSU/9ysSvTyYxBrp9Whg0eXgAOsCdmIHMlYZK7bjRg=",
|
||||||
"owner": "nvim-treesitter",
|
"owner": "nvim-treesitter",
|
||||||
"repo": "nvim-treesitter",
|
"repo": "nvim-treesitter",
|
||||||
"rev": "eedb7b9c69b13afe86461b0742266bb62b811ece",
|
"rev": "7eb5f1a2e3949496f26c4084b521b30f2d08137a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -396,6 +416,7 @@
|
|||||||
"bufferline-nvim-src": "bufferline-nvim-src",
|
"bufferline-nvim-src": "bufferline-nvim-src",
|
||||||
"cmp-nvim-lsp-src": "cmp-nvim-lsp-src",
|
"cmp-nvim-lsp-src": "cmp-nvim-lsp-src",
|
||||||
"darwin": "darwin",
|
"darwin": "darwin",
|
||||||
|
"disko": "disko",
|
||||||
"firefox-darwin": "firefox-darwin",
|
"firefox-darwin": "firefox-darwin",
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nil": "nil",
|
"nil": "nil",
|
||||||
@ -426,11 +447,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1670552927,
|
"lastModified": 1675391458,
|
||||||
"narHash": "sha256-lCE51eAGrAFS4k9W5aDGFpVtOAwQQ/rFMN80PCDh0vo=",
|
"narHash": "sha256-ukDKZw922BnK5ohL9LhwtaDAdCsJL7L6ScNEyF1lO9w=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "a0fdafd18c9cf599fde17fbaf07dbb20fa57eecb",
|
"rev": "383a4acfd11d778d5c2efcf28376cbd845eeaedf",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -442,11 +463,11 @@
|
|||||||
"telescope-nvim-src": {
|
"telescope-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1669979094,
|
"lastModified": 1675149856,
|
||||||
"narHash": "sha256-5UgCqnDs4iubnq7gER1wC8Mk9UZuo8cWqDB8ZbyGCRI=",
|
"narHash": "sha256-L4Kw94CUy6N7zcyy9INuR/O0fxQ7sp0IvGd/u7fHxMA=",
|
||||||
"owner": "nvim-telescope",
|
"owner": "nvim-telescope",
|
||||||
"repo": "telescope.nvim",
|
"repo": "telescope.nvim",
|
||||||
"rev": "cabf991b1d3996fa6f3232327fc649bbdf676496",
|
"rev": "203bf5609137600d73e8ed82703d6b0e320a5f36",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -458,11 +479,11 @@
|
|||||||
"telescope-project-nvim-src": {
|
"telescope-project-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1665406281,
|
"lastModified": 1671805267,
|
||||||
"narHash": "sha256-ZBFgUlW+h7vndazZ0lZux8i7yQHKJNDPQPZ2z96Rfpk=",
|
"narHash": "sha256-S4SOHzQ17ux5pcwwYFpVVLzjLeC4/EJ0IFPbrfzUJC8=",
|
||||||
"owner": "nvim-telescope",
|
"owner": "nvim-telescope",
|
||||||
"repo": "telescope-project.nvim",
|
"repo": "telescope-project.nvim",
|
||||||
"rev": "ff4d3cea905383a67d1a47b9dd210c4907d858c2",
|
"rev": "8e8ee37b7210761502cdf2c3a82b5ba8fb5b2972",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -474,11 +495,11 @@
|
|||||||
"toggleterm-nvim-src": {
|
"toggleterm-nvim-src": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1670593071,
|
"lastModified": 1675358836,
|
||||||
"narHash": "sha256-0n3WbUM3rYyR2BXgeyYuyTZIbIs5dzuIu8imsSvAc8U=",
|
"narHash": "sha256-9O7p/7tRStg51OFhMc88M5ewYquiYC9x9CV4s5veVP8=",
|
||||||
"owner": "akinsho",
|
"owner": "akinsho",
|
||||||
"repo": "toggleterm.nvim",
|
"repo": "toggleterm.nvim",
|
||||||
"rev": "b02a1674bd0010d7982b056fd3df4f717ff8a57a",
|
"rev": "19aad0f41f47affbba1274f05e3c067e6d718e1e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -489,11 +510,11 @@
|
|||||||
},
|
},
|
||||||
"utils": {
|
"utils": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667395993,
|
"lastModified": 1676283394,
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -525,11 +546,11 @@
|
|||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671480147,
|
"lastModified": 1676126384,
|
||||||
"narHash": "sha256-IzWdZL8jMNtyKsXXJjn2L4MsBeR52WBdhciPw4latHU=",
|
"narHash": "sha256-3aAnN891Cb1pizewAgaHIo3W1WbAjXtoWuX8n3j8YoI=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "NixOS-WSL",
|
"repo": "NixOS-WSL",
|
||||||
"rev": "577d7919e4380e6905e69d4a5f8f48a41ca37187",
|
"rev": "a1c7e8bebac32cfac7aa8498bdfc60cbff13eb50",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
54
flake.nix
54
flake.nix
@ -29,6 +29,12 @@
|
|||||||
# Use official Firefox binary for macOS
|
# Use official Firefox binary for macOS
|
||||||
firefox-darwin.url = "github:bandithedoge/nixpkgs-firefox-darwin";
|
firefox-darwin.url = "github:bandithedoge/nixpkgs-firefox-darwin";
|
||||||
|
|
||||||
|
# Manage disk format and partitioning
|
||||||
|
disko = {
|
||||||
|
url = "github:nix-community/disko";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
# Wallpapers
|
# Wallpapers
|
||||||
wallpapers = {
|
wallpapers = {
|
||||||
url = "gitlab:exorcist365/wallpapers";
|
url = "gitlab:exorcist365/wallpapers";
|
||||||
@ -94,7 +100,7 @@
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, ... }@inputs:
|
outputs = { nixpkgs, ... }@inputs:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -112,7 +118,8 @@
|
|||||||
overlays = [
|
overlays = [
|
||||||
inputs.nur.overlay
|
inputs.nur.overlay
|
||||||
inputs.nix2vim.overlay
|
inputs.nix2vim.overlay
|
||||||
(import ./modules/neovim/plugins-overlay.nix inputs)
|
(import ./overlays/neovim-plugins.nix inputs)
|
||||||
|
(import ./overlays/calibre-web.nix)
|
||||||
];
|
];
|
||||||
|
|
||||||
# System types to support.
|
# System types to support.
|
||||||
@ -125,34 +132,45 @@
|
|||||||
in rec {
|
in rec {
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations = {
|
||||||
desktop = import ./hosts/desktop { inherit inputs globals overlays; };
|
tempest = import ./hosts/tempest { inherit inputs globals overlays; };
|
||||||
wsl = import ./hosts/wsl { inherit inputs globals overlays; };
|
hydra = import ./hosts/hydra { inherit inputs globals overlays; };
|
||||||
oracle = import ./hosts/oracle { inherit inputs globals overlays; };
|
flame = import ./hosts/flame { inherit inputs globals overlays; };
|
||||||
|
swan = import ./hosts/swan { inherit inputs globals overlays; };
|
||||||
};
|
};
|
||||||
|
|
||||||
darwinConfigurations = {
|
darwinConfigurations = {
|
||||||
macbook = import ./hosts/macbook { inherit inputs globals overlays; };
|
lookingglass =
|
||||||
|
import ./hosts/lookingglass { inherit inputs globals overlays; };
|
||||||
};
|
};
|
||||||
|
|
||||||
# For quickly applying local settings with:
|
# For quickly applying local settings with:
|
||||||
# home-manager switch --flake .#desktop
|
# home-manager switch --flake .#tempest
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
desktop =
|
tempest =
|
||||||
nixosConfigurations.desktop.config.home-manager.users.${globals.user}.home;
|
nixosConfigurations.tempest.config.home-manager.users.${globals.user}.home;
|
||||||
macbook =
|
lookingglass =
|
||||||
darwinConfigurations.macbook.config.home-manager.users."Noah.Masur".home;
|
darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Disk formatting
|
||||||
|
diskoConfigurations = { root = import ./disks/root.nix; };
|
||||||
|
|
||||||
# Package servers into images with a generator
|
# Package servers into images with a generator
|
||||||
packages = forAllSystems (system: {
|
packages = forAllSystems (system: {
|
||||||
|
|
||||||
aws = {
|
aws = {
|
||||||
"${system}" =
|
"${system}" =
|
||||||
import ./hosts/aws { inherit inputs globals system overlays; };
|
import ./generators/aws { inherit inputs globals system overlays; };
|
||||||
|
};
|
||||||
|
|
||||||
|
staff = {
|
||||||
|
"${system}" = import ./generators/staff {
|
||||||
|
inherit inputs globals system overlays;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
neovim = let pkgs = import nixpkgs { inherit system overlays; };
|
neovim = let pkgs = import nixpkgs { inherit system overlays; };
|
||||||
in import ./modules/neovim/package {
|
in import ./modules/common/neovim/package {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
colors =
|
colors =
|
||||||
import ./colorscheme/gruvbox/neovim-gruvbox.nix { inherit pkgs; };
|
import ./colorscheme/gruvbox/neovim-gruvbox.nix { inherit pkgs; };
|
||||||
@ -161,7 +179,15 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
apps = forAllSystems (system:
|
apps = forAllSystems (system:
|
||||||
let pkgs = import nixpkgs { inherit system overlays; };
|
let
|
||||||
|
pkgs = import nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = overlays ++ [
|
||||||
|
(final: prev: {
|
||||||
|
disko-packaged = inputs.disko.packages.${system}.disko;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
};
|
||||||
in import ./apps { inherit pkgs; });
|
in import ./apps { inherit pkgs; });
|
||||||
|
|
||||||
devShells = forAllSystems (system:
|
devShells = forAllSystems (system:
|
||||||
|
@ -15,16 +15,16 @@ nixos-generators.nixosGenerate {
|
|||||||
gitEmail = globals.gitEmail;
|
gitEmail = globals.gitEmail;
|
||||||
networking.hostName = "sheep";
|
networking.hostName = "sheep";
|
||||||
gui.enable = false;
|
gui.enable = false;
|
||||||
colorscheme = (import ../modules/colorscheme/gruvbox);
|
colorscheme = (import ../colorscheme/gruvbox);
|
||||||
passwordHash = null;
|
passwordHash = null;
|
||||||
publicKey =
|
publicKey =
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
||||||
# AWS settings require this
|
# AWS settings require this
|
||||||
permitRootLogin = "prohibit-password";
|
permitRootLogin = "prohibit-password";
|
||||||
}
|
}
|
||||||
../../hosts/common.nix
|
../../modules/common
|
||||||
../../modules/nixos
|
../../modules/nixos
|
||||||
../../modules/services/sshd.nix
|
../../modules/common/services/sshd.nix
|
||||||
] ++ [
|
] ++ [
|
||||||
# Required to fix diskSize errors during build
|
# Required to fix diskSize errors during build
|
||||||
({ ... }: { amazonImage.sizeMB = 16 * 1024; })
|
({ ... }: { amazonImage.sizeMB = 16 * 1024; })
|
47
generators/staff/default.nix
Normal file
47
generators/staff/default.nix
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# The Staff
|
||||||
|
# ISO configuration for my USB drive
|
||||||
|
|
||||||
|
{ inputs, system, overlays, ... }:
|
||||||
|
|
||||||
|
with inputs;
|
||||||
|
|
||||||
|
nixos-generators.nixosGenerate {
|
||||||
|
inherit system;
|
||||||
|
format = "install-iso";
|
||||||
|
modules = [{
|
||||||
|
nixpkgs.overlays = overlays;
|
||||||
|
networking.hostName = "staff";
|
||||||
|
users.extraUsers.root.openssh.authorizedKeys.keys = [
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s"
|
||||||
|
];
|
||||||
|
services.openssh = {
|
||||||
|
enable = true;
|
||||||
|
ports = [ 22 ];
|
||||||
|
allowSFTP = true;
|
||||||
|
settings = {
|
||||||
|
GatewayPorts = "no";
|
||||||
|
X11Forwarding = false;
|
||||||
|
PasswordAuthentication = false;
|
||||||
|
PermitRootLogin = "yes";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
environment.systemPackages =
|
||||||
|
let pkgs = import inputs.nixpkgs { inherit system overlays; };
|
||||||
|
in with pkgs; [
|
||||||
|
git
|
||||||
|
vim
|
||||||
|
wget
|
||||||
|
curl
|
||||||
|
(import ../../modules/common/neovim/package {
|
||||||
|
inherit pkgs;
|
||||||
|
# colors = import ../../colorscheme/gruvbox.dark.neovimConfig {
|
||||||
|
# inherit pkgs;
|
||||||
|
# };
|
||||||
|
})
|
||||||
|
];
|
||||||
|
nix.extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
warn-dirty = false
|
||||||
|
'';
|
||||||
|
}];
|
||||||
|
}
|
@ -1,30 +0,0 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
|
||||||
# and may be overwritten by future invocations. Please make changes
|
|
||||||
# to /etc/nixos/configuration.nix instead.
|
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules =
|
|
||||||
[ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
fileSystems."/" = {
|
|
||||||
device = "/dev/disk/by-label/nixos";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems."/boot" = {
|
|
||||||
device = "/dev/disk/by-label/boot";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [ ];
|
|
||||||
|
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
|
||||||
hardware.cpu.intel.updateMicrocode =
|
|
||||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
}
|
|
@ -1,30 +1,35 @@
|
|||||||
{ inputs, globals, overlays, ... }:
|
# The Flame
|
||||||
|
|
||||||
with inputs;
|
|
||||||
|
|
||||||
# System configuration for an Oracle free server
|
# System configuration for an Oracle free server
|
||||||
|
|
||||||
# How to install:
|
# How to install:
|
||||||
# https://blog.korfuri.fr/posts/2022/08/nixos-on-an-oracle-free-tier-ampere-machine/
|
# https://blog.korfuri.fr/posts/2022/08/nixos-on-an-oracle-free-tier-ampere-machine/
|
||||||
|
|
||||||
|
{ inputs, globals, overlays, ... }:
|
||||||
|
|
||||||
|
with inputs;
|
||||||
|
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
system = "aarch64-linux";
|
system = "aarch64-linux";
|
||||||
specialArgs = { };
|
specialArgs = { };
|
||||||
modules = [
|
modules = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../modules
|
../../modules/common
|
||||||
|
../../modules/nixos
|
||||||
(removeAttrs globals [ "mail.server" ])
|
(removeAttrs globals [ "mail.server" ])
|
||||||
|
wsl.nixosModules.wsl
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
server = true;
|
server = true;
|
||||||
gui.enable = false;
|
gui.enable = false;
|
||||||
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
|
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
|
||||||
nixpkgs.overlays = overlays;
|
nixpkgs.overlays = overlays;
|
||||||
|
wsl.enable = false;
|
||||||
|
caddy.enable = true;
|
||||||
|
|
||||||
# FQDNs for various services
|
# FQDNs for various services
|
||||||
networking.hostName = "oracle";
|
networking.hostName = "flame";
|
||||||
bookServer = "books.masu.rs";
|
bookServer = "books.masu.rs";
|
||||||
streamServer = "stream.masu.rs";
|
# streamServer = "stream.masu.rs";
|
||||||
nextcloudServer = "cloud.masu.rs";
|
nextcloudServer = "cloud.masu.rs";
|
||||||
transmissionServer = "download.masu.rs";
|
transmissionServer = "download.masu.rs";
|
||||||
metricsServer = "metrics.masu.rs";
|
metricsServer = "metrics.masu.rs";
|
||||||
@ -46,6 +51,7 @@ nixpkgs.lib.nixosSystem {
|
|||||||
users.users.nextcloud.extraGroups = [ "jellyfin" ];
|
users.users.nextcloud.extraGroups = [ "jellyfin" ];
|
||||||
|
|
||||||
# Wireguard config for Transmission
|
# Wireguard config for Transmission
|
||||||
|
wireguard.enable = true;
|
||||||
networking.wireguard.interfaces.wg0 = {
|
networking.wireguard.interfaces.wg0 = {
|
||||||
|
|
||||||
# The local IPs for this machine within the Wireguard network
|
# The local IPs for this machine within the Wireguard network
|
||||||
@ -85,6 +91,8 @@ nixpkgs.lib.nixosSystem {
|
|||||||
# Clone dotfiles
|
# Clone dotfiles
|
||||||
dotfiles.enable = true;
|
dotfiles.enable = true;
|
||||||
|
|
||||||
|
neovim.enable = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
{ lib, modulesPath, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
|
@ -1,18 +1,22 @@
|
|||||||
{ inputs, globals, ... }:
|
# The Hydra
|
||||||
|
# System configuration for WSL
|
||||||
|
|
||||||
|
{ inputs, globals, overlays, ... }:
|
||||||
|
|
||||||
with inputs;
|
with inputs;
|
||||||
|
|
||||||
# System configuration for WSL
|
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { };
|
specialArgs = { };
|
||||||
modules = [
|
modules = [
|
||||||
|
../../modules/common
|
||||||
|
../../modules/nixos
|
||||||
globals
|
globals
|
||||||
wsl.nixosModules.wsl
|
wsl.nixosModules.wsl
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
../../modules
|
|
||||||
{
|
{
|
||||||
networking.hostName = "wsl";
|
networking.hostName = "hydra";
|
||||||
|
nixpkgs.overlays = overlays;
|
||||||
# Set registry to flake packages, used for nix X commands
|
# Set registry to flake packages, used for nix X commands
|
||||||
nix.registry.nixpkgs.flake = nixpkgs;
|
nix.registry.nixpkgs.flake = nixpkgs;
|
||||||
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
||||||
@ -21,17 +25,20 @@ nixpkgs.lib.nixosSystem {
|
|||||||
colors = (import ../../colorscheme/gruvbox).dark;
|
colors = (import ../../colorscheme/gruvbox).dark;
|
||||||
dark = true;
|
dark = true;
|
||||||
};
|
};
|
||||||
passwordHash = nixpkgs.lib.fileContents ../../private/password.sha512;
|
passwordHash = nixpkgs.lib.fileContents ../../password.sha512;
|
||||||
wsl = {
|
wsl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
automountPath = "/mnt";
|
wslConf.automount.root = "/mnt";
|
||||||
defaultUser = globals.user;
|
defaultUser = globals.user;
|
||||||
startMenuLaunchers = true;
|
startMenuLaunchers = true;
|
||||||
|
nativeSystemd = true;
|
||||||
wslConf.network.generateResolvConf = true; # Turn off if it breaks VPN
|
wslConf.network.generateResolvConf = true; # Turn off if it breaks VPN
|
||||||
interop.includePath =
|
interop.includePath =
|
||||||
false; # Including Windows PATH will slow down Neovim command mode
|
false; # Including Windows PATH will slow down Neovim command mode
|
||||||
};
|
};
|
||||||
|
|
||||||
|
neovim.enable = true;
|
||||||
|
mail.enable = true;
|
||||||
mail.aerc.enable = true;
|
mail.aerc.enable = true;
|
||||||
mail.himalaya.enable = true;
|
mail.himalaya.enable = true;
|
||||||
dotfiles.enable = true;
|
dotfiles.enable = true;
|
@ -1,13 +1,16 @@
|
|||||||
|
# The Looking Glass
|
||||||
|
# System configuration for my work Macbook
|
||||||
|
|
||||||
{ inputs, globals, overlays, ... }:
|
{ inputs, globals, overlays, ... }:
|
||||||
|
|
||||||
with inputs;
|
with inputs;
|
||||||
|
|
||||||
# System configuration for my work MacBook
|
|
||||||
darwin.lib.darwinSystem {
|
darwin.lib.darwinSystem {
|
||||||
system = "x86_64-darwin";
|
system = "x86_64-darwin";
|
||||||
specialArgs = { };
|
specialArgs = { };
|
||||||
modules = [
|
modules = [
|
||||||
../../modules
|
../../modules/common
|
||||||
|
../../modules/darwin
|
||||||
(globals // {
|
(globals // {
|
||||||
user = "Noah.Masur";
|
user = "Noah.Masur";
|
||||||
gitName = "Noah-Masur_1701";
|
gitName = "Noah-Masur_1701";
|
||||||
@ -26,7 +29,9 @@ darwin.lib.darwinSystem {
|
|||||||
nixpkgs.overlays = [ firefox-darwin.overlay ] ++ overlays;
|
nixpkgs.overlays = [ firefox-darwin.overlay ] ++ overlays;
|
||||||
# Set registry to flake packages, used for nix X commands
|
# Set registry to flake packages, used for nix X commands
|
||||||
nix.registry.nixpkgs.flake = nixpkgs;
|
nix.registry.nixpkgs.flake = nixpkgs;
|
||||||
|
charm.enable = true;
|
||||||
|
neovim.enable = true;
|
||||||
|
mail.enable = true;
|
||||||
mail.aerc.enable = true;
|
mail.aerc.enable = true;
|
||||||
mail.himalaya.enable = true;
|
mail.himalaya.enable = true;
|
||||||
kitty.enable = true;
|
kitty.enable = true;
|
||||||
@ -38,7 +43,8 @@ darwin.lib.darwinSystem {
|
|||||||
python.enable = true;
|
python.enable = true;
|
||||||
lua.enable = true;
|
lua.enable = true;
|
||||||
kubernetes.enable = true;
|
kubernetes.enable = true;
|
||||||
"1password".enable = true;
|
_1password.enable = true;
|
||||||
|
slack.enable = true;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
64
hosts/swan/default.nix
Normal file
64
hosts/swan/default.nix
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
# The Swan
|
||||||
|
# System configuration for my home NAS server
|
||||||
|
|
||||||
|
{ inputs, globals, overlays, ... }:
|
||||||
|
|
||||||
|
with inputs;
|
||||||
|
|
||||||
|
nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs = { };
|
||||||
|
modules = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
../../modules/common
|
||||||
|
../../modules/nixos
|
||||||
|
(removeAttrs globals [ "mail.server" ])
|
||||||
|
wsl.nixosModules.wsl
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
disko.nixosModules.disko
|
||||||
|
{
|
||||||
|
server = true;
|
||||||
|
networking.hostName = "swan";
|
||||||
|
|
||||||
|
# head -c 8 /etc/machine-id
|
||||||
|
networking.hostId = "600279f4"; # Random ID required for ZFS
|
||||||
|
|
||||||
|
zfs.enable = true;
|
||||||
|
disko = {
|
||||||
|
enableConfig = true;
|
||||||
|
devices = (import ../../disks/root.nix { disk = "/dev/nvme0n1"; });
|
||||||
|
# // (import ../../disks/zfs.nix {
|
||||||
|
# pool = "tank";
|
||||||
|
# disks = [ "/dev/sda" "/dev/sdb" "/dev/sdc" ];
|
||||||
|
# });
|
||||||
|
};
|
||||||
|
boot.zfs.extraPools = [ "tank" ];
|
||||||
|
|
||||||
|
gui.enable = false;
|
||||||
|
theme = { colors = (import ../../colorscheme/gruvbox).dark; };
|
||||||
|
nixpkgs.overlays = overlays;
|
||||||
|
neovim.enable = true;
|
||||||
|
caddy.enable = true;
|
||||||
|
streamServer = "stream.masu.rs";
|
||||||
|
nextcloudServer = "cloud.masu.rs";
|
||||||
|
bookServer = "books.masu.rs";
|
||||||
|
samba.enable = true;
|
||||||
|
|
||||||
|
backup.s3 = {
|
||||||
|
endpoint = "s3.us-west-002.backblazeb2.com";
|
||||||
|
bucket = "noahmasur-backup";
|
||||||
|
accessKeyId = "0026b0e73b2e2c80000000005";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Disable passwords, only use SSH key
|
||||||
|
publicKey =
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB+AbmjGEwITk5CK9y7+Rg27Fokgj9QEjgc9wST6MA3s";
|
||||||
|
|
||||||
|
# Clone dotfiles
|
||||||
|
dotfiles.enable = true;
|
||||||
|
|
||||||
|
# services.nfs.server.enable = true;
|
||||||
|
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
39
hosts/swan/hardware-configuration.nix
Normal file
39
hosts/swan/hardware-configuration.nix
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules =
|
||||||
|
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
# fileSystems."/" = {
|
||||||
|
# device = "/dev/disk/by-label/nixos";
|
||||||
|
# fsType = "ext4";
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# fileSystems."/boot" = {
|
||||||
|
# device = "/dev/disk/by-label/boot";
|
||||||
|
# fsType = "vfat";
|
||||||
|
# };
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||||
|
hardware.cpu.intel.updateMicrocode =
|
||||||
|
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
@ -1,18 +1,24 @@
|
|||||||
{ inputs, globals, ... }:
|
# The Tempest
|
||||||
|
# System configuration for my desktop
|
||||||
|
|
||||||
|
{ inputs, globals, overlays, ... }:
|
||||||
|
|
||||||
with inputs;
|
with inputs;
|
||||||
|
|
||||||
# System configuration for my desktop
|
|
||||||
nixpkgs.lib.nixosSystem {
|
nixpkgs.lib.nixosSystem {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
specialArgs = { };
|
specialArgs = { };
|
||||||
modules = [
|
modules = [
|
||||||
|
./hardware-configuration.nix
|
||||||
|
../../modules/common
|
||||||
|
../../modules/nixos
|
||||||
globals
|
globals
|
||||||
|
wsl.nixosModules.wsl
|
||||||
home-manager.nixosModules.home-manager
|
home-manager.nixosModules.home-manager
|
||||||
{
|
{
|
||||||
physical = true;
|
physical = true;
|
||||||
networking.hostName = "desktop";
|
networking.hostName = "tempest";
|
||||||
nixpkgs.overlays = [ nur.overlay ];
|
nixpkgs.overlays = [ nur.overlay ] ++ overlays;
|
||||||
# Set registry to flake packages, used for nix X commands
|
# Set registry to flake packages, used for nix X commands
|
||||||
nix.registry.nixpkgs.flake = nixpkgs;
|
nix.registry.nixpkgs.flake = nixpkgs;
|
||||||
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
identityFile = "/home/${globals.user}/.ssh/id_ed25519";
|
||||||
@ -23,27 +29,36 @@ nixpkgs.lib.nixosSystem {
|
|||||||
};
|
};
|
||||||
wallpaper = "${wallpapers}/gruvbox/road.jpg";
|
wallpaper = "${wallpapers}/gruvbox/road.jpg";
|
||||||
gtk.theme.name = nixpkgs.lib.mkDefault "Adwaita-dark";
|
gtk.theme.name = nixpkgs.lib.mkDefault "Adwaita-dark";
|
||||||
passwordHash = nixpkgs.lib.fileContents ../../private/password.sha512;
|
passwordHash = nixpkgs.lib.fileContents ../../password.sha512;
|
||||||
|
wsl.enable = false;
|
||||||
|
publicKey = null;
|
||||||
|
|
||||||
|
charm.enable = true;
|
||||||
|
neovim.enable = true;
|
||||||
media.enable = true;
|
media.enable = true;
|
||||||
firefox.enable = true;
|
firefox.enable = true;
|
||||||
kitty.enable = true;
|
kitty.enable = true;
|
||||||
"1password".enable = true;
|
_1password.enable = true;
|
||||||
discord.enable = true;
|
discord.enable = true;
|
||||||
nautilus.enable = true;
|
nautilus.enable = true;
|
||||||
obsidian.enable = true;
|
obsidian.enable = true;
|
||||||
|
mail.enable = true;
|
||||||
mail.aerc.enable = true;
|
mail.aerc.enable = true;
|
||||||
mail.himalaya.enable = true;
|
mail.himalaya.enable = true;
|
||||||
gaming.enable = true;
|
|
||||||
gaming.steam.enable = true;
|
|
||||||
gaming.legendary.enable = true;
|
|
||||||
keybase.enable = true;
|
keybase.enable = true;
|
||||||
mullvad.enable = true;
|
# mullvad.enable = true;
|
||||||
nixlang.enable = true;
|
nixlang.enable = true;
|
||||||
dotfiles.enable = true;
|
dotfiles.enable = true;
|
||||||
}
|
yt-dlp.enable = true;
|
||||||
|
|
||||||
./hardware-configuration.nix
|
gaming = {
|
||||||
../../modules
|
enable = true;
|
||||||
|
steam.enable = true;
|
||||||
|
legendary.enable = true;
|
||||||
|
lutris.enable = true;
|
||||||
|
leagueoflegends.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
40
hosts/tempest/hardware-configuration.nix
Normal file
40
hosts/tempest/hardware-configuration.nix
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules =
|
||||||
|
[ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||||
|
|
||||||
|
fileSystems."/" = {
|
||||||
|
device = "/dev/disk/by-label/nixos";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" = {
|
||||||
|
device = "/dev/disk/by-label/boot";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [ ];
|
||||||
|
|
||||||
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp4s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||||
|
hardware.cpu.amd.updateMicrocode =
|
||||||
|
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
@ -1,4 +0,0 @@
|
|||||||
#!/usr/local/bin/nu
|
|
||||||
|
|
||||||
ls | sort-by size | reverse | keep 10
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/usr/local/bin/nu
|
|
||||||
|
|
||||||
ls **/* | where type == File | sort-by size | reverse | keep 10
|
|
@ -1,26 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Stop all containers
|
|
||||||
if [ "$(docker ps -a -q)" ]; then
|
|
||||||
echo "Stopping docker containers..."
|
|
||||||
docker stop "$(docker ps -a -q)"
|
|
||||||
else
|
|
||||||
echo "No running docker containers."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove all stopped containers
|
|
||||||
if [ "$(docker ps -a -q)" ]; then
|
|
||||||
echo "Removing docker containers..."
|
|
||||||
docker rm "$(docker ps -a -q)"
|
|
||||||
else
|
|
||||||
echo "No stopped docker containers."
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove all untagged images
|
|
||||||
if [[ $(docker images | grep "^<none>") ]]; then
|
|
||||||
docker rmi "$(docker images | grep "^<none>" | awk '{print $3}')"
|
|
||||||
else
|
|
||||||
echo "No untagged docker images."
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Cleaned up docker."
|
|
@ -1,37 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Adapted from: https://seb.jambor.dev/posts/improving-shell-workflows-with-fzf/
|
|
||||||
# Requires the following variables to be set:
|
|
||||||
# - ATLASSIAN_EMAIL
|
|
||||||
# - ATLASSIAN_API_TOKEN
|
|
||||||
# - JIRA_HOSTNAME
|
|
||||||
# - JIRA_PROJECT
|
|
||||||
|
|
||||||
choose_issue() {
|
|
||||||
jq_template='"\(.key): \(.fields.summary)"'
|
|
||||||
query="project=$JIRA_PROJECT AND status not in (\"Done\") AND assignee=currentUser()"
|
|
||||||
|
|
||||||
branch_name=$(
|
|
||||||
curl \
|
|
||||||
--data-urlencode "jql=$query" \
|
|
||||||
--get \
|
|
||||||
--user "$ATLASSIAN_EMAIL:$ATLASSIAN_API_TOKEN" \
|
|
||||||
--silent \
|
|
||||||
--compressed \
|
|
||||||
"https://$JIRA_HOSTNAME/rest/api/2/search" |
|
|
||||||
jq ".issues[] | $jq_template" |
|
|
||||||
sed -e 's/"\(.*\)"/\1/' |
|
|
||||||
fzf \
|
|
||||||
--preview='jira-details {1}' \
|
|
||||||
--preview-window=top:wrap |
|
|
||||||
sed -e 's/: /:/' -e 's/[^a-zA-Z0-9:]/-/g' |
|
|
||||||
awk -F ":" '{printf "%s/%s", $1, tolower($2)}'
|
|
||||||
)
|
|
||||||
|
|
||||||
echo "$branch_name"
|
|
||||||
}
|
|
||||||
|
|
||||||
issue_branch=$(choose_issue)
|
|
||||||
if [ -n "$issue_branch" ]; then
|
|
||||||
echo "git checkout -b \"$issue_branch\""
|
|
||||||
fi
|
|
@ -1,38 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Adapted from: https://seb.jambor.dev/posts/improving-shell-workflows-with-fzf/
|
|
||||||
# Requires the following variables to be set:
|
|
||||||
# - ATLASSIAN_EMAIL
|
|
||||||
# - ATLASSIAN_API_TOKEN
|
|
||||||
# - JIRA_HOSTNAME
|
|
||||||
# - JIRA_PROJECT (for other script)
|
|
||||||
|
|
||||||
issue_details() {
|
|
||||||
jira_key=$(echo "$1" | cut -d":" -f1)
|
|
||||||
jq_template='"'\
|
|
||||||
'# \(.key): \(.fields.summary)\n'\
|
|
||||||
'\n'\
|
|
||||||
'*Created*: \(.fields.created)\n'\
|
|
||||||
'*Status*: \(.fields.status.statusCategory.name)\n'\
|
|
||||||
'*Reporter*: \(.fields.reporter.displayName)\n'\
|
|
||||||
'*Priority*: \(.fields.priority.name)\n'\
|
|
||||||
"*Epic*: https://$JIRA_HOSTNAME/browse/\(.fields.customfield_10014)\n"\
|
|
||||||
'\n'\
|
|
||||||
'## Link\n\n'\
|
|
||||||
"https://$JIRA_HOSTNAME/browse/\(.key)\n"\
|
|
||||||
'\n'\
|
|
||||||
'## Description\n\n'\
|
|
||||||
'\(.fields.description)'\
|
|
||||||
'"'
|
|
||||||
curl \
|
|
||||||
--get \
|
|
||||||
--user "$ATLASSIAN_EMAIL:$ATLASSIAN_API_TOKEN" \
|
|
||||||
--silent \
|
|
||||||
--compressed \
|
|
||||||
"https://$JIRA_HOSTNAME/rest/api/2/issue/$jira_key" |
|
|
||||||
jq "$jq_template" |
|
|
||||||
xargs printf |
|
|
||||||
bat -l md --color always --style plain
|
|
||||||
}
|
|
||||||
|
|
||||||
issue_details "$1"
|
|
@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
kubectl -n kube-system get secret "$(
|
|
||||||
kubectl -n kube-system get secret |
|
|
||||||
grep dashboard-admin |
|
|
||||||
awk '{print $1}'
|
|
||||||
)" -o json |
|
|
||||||
jq -j --raw-output '.data.token' |
|
|
||||||
base64 --decode |
|
|
||||||
pbcopy
|
|
||||||
|
|
||||||
open http://localhost:8001/api/v1/namespaces/default/services/https:kubernetes-dashboard:https/proxy/#!/login
|
|
||||||
|
|
||||||
kubectl proxy
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/usr/local/bin/nu
|
|
||||||
|
|
||||||
ls | sort-by modified | reverse | keep 5
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/usr/local/bin/nu
|
|
||||||
|
|
||||||
ls | sort-by modified | keep 5
|
|
@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
# Credit: https://github.com/junegunn/fzf/blob/master/ADVANCED.md
|
|
||||||
|
|
||||||
read -ra tokens < <(
|
|
||||||
kubectl get pods --all-namespaces |
|
|
||||||
fzf --info=inline --layout=reverse --header-lines=1 --border \
|
|
||||||
--prompt "$(kubectl config current-context | sed 's/-context$//')> " \
|
|
||||||
--header $'Press CTRL-O to open log in editor\n\n' \
|
|
||||||
--bind ctrl-/:toggle-preview \
|
|
||||||
--bind "ctrl-o:execute:${EDITOR:-vim} <(kubectl logs --namespace {1} {2}) > /dev/tty" \
|
|
||||||
--preview-window up,follow \
|
|
||||||
--preview 'kubectl logs --follow --tail=100000 --namespace {1} {2}' "$@"
|
|
||||||
)
|
|
||||||
[ ${#tokens} -gt 1 ] &&
|
|
||||||
kubectl exec -it --namespace "${tokens[0]}" "${tokens[1]}" -- /bin/sh
|
|
@ -1,3 +0,0 @@
|
|||||||
#!/usr/local/bin/nu
|
|
||||||
|
|
||||||
ls -al | where type == Symlink | select name target
|
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
|
|
||||||
|
|
||||||
urldecode "$@"
|
|
@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>Label</key>
|
|
||||||
<string>com.noah.newsboat</string>
|
|
||||||
|
|
||||||
<key>ProgramArguments</key>
|
|
||||||
<array>
|
|
||||||
<string>/usr/local/bin/newsboat -x reload</string>
|
|
||||||
</array>
|
|
||||||
|
|
||||||
<key>Nice</key>
|
|
||||||
<integer>1</integer>
|
|
||||||
|
|
||||||
<key>StartInterval</key>
|
|
||||||
<integer>1800</integer>
|
|
||||||
|
|
||||||
<key>RunAtLoad</key>
|
|
||||||
<false/>
|
|
||||||
|
|
||||||
<key>StandardErrorPath</key>
|
|
||||||
<string>/tmp/newsboat.err</string>
|
|
||||||
|
|
||||||
<key>StandardOutPath</key>
|
|
||||||
<string>/tmp/newsboat.out</string>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
@ -1,40 +0,0 @@
|
|||||||
browser "$BROWSER %u"
|
|
||||||
prepopulate-query-feeds yes
|
|
||||||
feed-sort-order lastupdated
|
|
||||||
reload-only-visible-feeds yes
|
|
||||||
text-width 72
|
|
||||||
|
|
||||||
bind-key j down
|
|
||||||
bind-key k up
|
|
||||||
bind-key j next articlelist
|
|
||||||
bind-key k prev articlelist
|
|
||||||
bind-key G end
|
|
||||||
bind-key g home
|
|
||||||
bind-key d pagedown
|
|
||||||
bind-key u pageup
|
|
||||||
bind-key n next-unread
|
|
||||||
bind-key p prev-unread
|
|
||||||
bind-key ; macro-prefix
|
|
||||||
bind-key B bookmark
|
|
||||||
bind-key f edit-flags
|
|
||||||
|
|
||||||
macro v set browser "mpv %u"; open-in-browser; set browser "$BROWSER %u"
|
|
||||||
macro p set browser "echo %u"; one; set browser "$BROWSER %u"
|
|
||||||
macro H set browser "clx view $(echo %u | cut -d '=' -f2)"; one; set browser "$BROWSER %u"
|
|
||||||
macro h set browser "clx view $(echo %u | cut -d '=' -f2)"; two; set browser "$BROWSER %u"
|
|
||||||
macro w set browser "w3m -o confirm_qq=false %u"; open-in-browser; set browser "$BROWSER %u"
|
|
||||||
macro r set browser "url-markdown %u | glow -p -w 72 -"; open-in-browser; set browser "$BROWSER %u"
|
|
||||||
macro d set browser "youtube-dl -o ~/Downloads/%(title)s.%(ext)s %u &"; open-in-browser-noninteractively; set browser "$BROWSER %u"
|
|
||||||
macro n set-tag News; reload-all
|
|
||||||
macro a set-tag All
|
|
||||||
macro e set-tag Reddit; reload-all
|
|
||||||
macro y set-tag YouTube; reload-all
|
|
||||||
|
|
||||||
bookmark-cmd "bookmark"
|
|
||||||
|
|
||||||
highlight article "^(Feed|Title|Author|Link|Date):.*" color243 default
|
|
||||||
highlight article "^(Links):.*" color243 default
|
|
||||||
highlight article "^(\\[[0-9]+\\]):.*" color243 default
|
|
||||||
highlight article "^(\\[[0-9]+\\])" color243 default
|
|
||||||
highlight article "^\\[.*\\]$" color243 default
|
|
||||||
highlight article "^(Title:).*" color249 default
|
|
@ -1,137 +0,0 @@
|
|||||||
# Setup Nix
|
|
||||||
|
|
||||||
# We need to distinguish between single-user and multi-user installs.
|
|
||||||
# This is difficult because there's no official way to do this.
|
|
||||||
# We could look for the presence of /nix/var/nix/daemon-socket/socket but this will fail if the
|
|
||||||
# daemon hasn't started yet. /nix/var/nix/daemon-socket will exist if the daemon has ever run, but
|
|
||||||
# I don't think there's any protection against accidentally running `nix-daemon` as a user.
|
|
||||||
# We also can't just look for /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh because
|
|
||||||
# older single-user installs used the default profile instead of a per-user profile.
|
|
||||||
# We can still check for it first, because all multi-user installs should have it, and so if it's
|
|
||||||
# not present that's a pretty big indicator that this is a single-user install. If it does exist,
|
|
||||||
# we still need to verify the install type. To that end we'll look for a root owner and sticky bit
|
|
||||||
# on /nix/store. Multi-user installs set both, single-user installs don't. It's certainly possible
|
|
||||||
# someone could do a single-user install as root and then manually set the sticky bit but that
|
|
||||||
# would be extremely unusual.
|
|
||||||
|
|
||||||
set -l nix_profile_path /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh
|
|
||||||
set -l single_user_profile_path ~/.nix-profile/etc/profile.d/nix.sh
|
|
||||||
if test -e $nix_profile_path
|
|
||||||
# The path exists. Double-check that this is a multi-user install.
|
|
||||||
# We can't just check for ~/.nix-profile/… because this may be a single-user install running as
|
|
||||||
# the wrong user.
|
|
||||||
|
|
||||||
# stat is not portable. Splitting the output of ls -nd is reliable on most platforms.
|
|
||||||
set -l owner (string split -n ' ' (command ls -nd /nix/store 2>/dev/null))[3]
|
|
||||||
if not test -k /nix/store -a $owner -eq 0
|
|
||||||
# /nix/store is either not owned by root or not sticky. Assume single-user.
|
|
||||||
set nix_profile_path $single_user_profile_path
|
|
||||||
end
|
|
||||||
else
|
|
||||||
# The path doesn't exist. Assume single-user
|
|
||||||
set nix_profile_path $single_user_profile_path
|
|
||||||
end
|
|
||||||
|
|
||||||
if test -e $nix_profile_path
|
|
||||||
# Source the nix setup script
|
|
||||||
# We're going to run the regular Nix profile under bash and then print out a few variables
|
|
||||||
for line in (command env -u BASH_ENV bash -c '. "$0"; for name in PATH "${!NIX_@}"; do printf "%s=%s\0" "$name" "${!name}"; done' $nix_profile_path | string split0)
|
|
||||||
set -xg (string split -m 1 = $line)
|
|
||||||
end
|
|
||||||
|
|
||||||
# Insert Nix's fish share directories into fish's special variables.
|
|
||||||
# nixpkgs-installed fish tries to set these up already if NIX_PROFILES is defined, which won't
|
|
||||||
# be the case when sourcing $__fish_data_dir/share/config.fish normally, but might be for a
|
|
||||||
# recursive invocation. To guard against that, we'll only insert paths that don't already exit.
|
|
||||||
# Furthermore, for the vendor_conf.d sourcing, we'll use the pre-existing presence of a path in
|
|
||||||
# $fish_function_path to determine whether we want to source the relevant vendor_conf.d folder.
|
|
||||||
|
|
||||||
# To start, let's locally define NIX_PROFILES if it doesn't already exist.
|
|
||||||
set -al NIX_PROFILES
|
|
||||||
if test (count $NIX_PROFILES) -eq 0
|
|
||||||
set -a NIX_PROFILES $HOME/.nix-profile
|
|
||||||
end
|
|
||||||
# Replicate the logic from nixpkgs version of $__fish_data_dir/__fish_build_paths.fish.
|
|
||||||
set -l __nix_profile_paths (string split ' ' -- $NIX_PROFILES)[-1..1]
|
|
||||||
set -l __extra_completionsdir \
|
|
||||||
$__nix_profile_paths/etc/fish/completions \
|
|
||||||
$__nix_profile_paths/share/fish/vendor_completions.d
|
|
||||||
set -l __extra_functionsdir \
|
|
||||||
$__nix_profile_paths/etc/fish/functions \
|
|
||||||
$__nix_profile_paths/share/fish/vendor_functions.d
|
|
||||||
set -l __extra_confdir \
|
|
||||||
$__nix_profile_paths/etc/fish/conf.d \
|
|
||||||
$__nix_profile_paths/share/fish/vendor_conf.d
|
|
||||||
### Configure fish_function_path ###
|
|
||||||
# Remove any of our extra paths that may already exist.
|
|
||||||
# Record the equivalent __extra_confdir path for any function path that exists.
|
|
||||||
set -l existing_conf_paths
|
|
||||||
for path in $__extra_functionsdir
|
|
||||||
if set -l idx (contains --index -- $path $fish_function_path)
|
|
||||||
set -e fish_function_path[$idx]
|
|
||||||
set -a existing_conf_paths $__extra_confdir[(contains --index -- $path $__extra_functionsdir)]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
# Insert the paths before $__fish_data_dir.
|
|
||||||
if set -l idx (contains --index -- $__fish_data_dir/functions $fish_function_path)
|
|
||||||
# Fish has no way to simply insert into the middle of an array.
|
|
||||||
set -l new_path $fish_function_path[1..$idx]
|
|
||||||
set -e new_path[$idx]
|
|
||||||
set -a new_path $__extra_functionsdir
|
|
||||||
set fish_function_path $new_path $fish_function_path[$idx..-1]
|
|
||||||
else
|
|
||||||
set -a fish_function_path $__extra_functionsdir
|
|
||||||
end
|
|
||||||
|
|
||||||
### Configure fish_complete_path ###
|
|
||||||
# Remove any of our extra paths that may already exist.
|
|
||||||
for path in $__extra_completionsdir
|
|
||||||
if set -l idx (contains --index -- $path $fish_complete_path)
|
|
||||||
set -e fish_complete_path[$idx]
|
|
||||||
end
|
|
||||||
end
|
|
||||||
# Insert the paths before $__fish_data_dir.
|
|
||||||
if set -l idx (contains --index -- $__fish_data_dir/completions $fish_complete_path)
|
|
||||||
set -l new_path $fish_complete_path[1..$idx]
|
|
||||||
set -e new_path[$idx]
|
|
||||||
set -a new_path $__extra_completionsdir
|
|
||||||
set fish_complete_path $new_path $fish_complete_path[$idx..-1]
|
|
||||||
else
|
|
||||||
set -a fish_complete_path $__extra_completionsdir
|
|
||||||
end
|
|
||||||
|
|
||||||
### Source conf directories ###
|
|
||||||
# The built-in directories were already sourced during shell initialization.
|
|
||||||
# Any __extra_confdir that came from $__fish_data_dir/__fish_build_paths.fish was also sourced.
|
|
||||||
# As explained above, we're using the presence of pre-existing paths in $fish_function_path as a
|
|
||||||
# signal that the corresponding conf dir has also already been sourced.
|
|
||||||
# In order to simulate this, we'll run through the same algorithm as found in
|
|
||||||
# $__fish_data_dir/config.fish except we'll avoid sourcing the file if it comes from an
|
|
||||||
# already-sourced location.
|
|
||||||
# Caveats:
|
|
||||||
# * Files will be sourced in a different order than we'd ideally do (because we're coming in
|
|
||||||
# after the fact to source them).
|
|
||||||
# * If there are existing extra conf paths, files in them may have been sourced that should have
|
|
||||||
# been suppressed by paths we're inserting in front.
|
|
||||||
# * Similarly any files in $__fish_data_dir/vendor_conf.d that should have been suppressed won't
|
|
||||||
# have been.
|
|
||||||
set -l sourcelist
|
|
||||||
for file in $__fish_config_dir/conf.d/*.fish $__fish_sysconf_dir/conf.d/*.fish
|
|
||||||
# We know these paths were sourced already. Just record them.
|
|
||||||
set -l basename (string replace -r '^.*/' '' -- $file)
|
|
||||||
contains -- $basename $sourcelist
|
|
||||||
or set -a sourcelist $basename
|
|
||||||
end
|
|
||||||
for root in $__extra_confdir
|
|
||||||
for file in $root/*.fish
|
|
||||||
set -l basename (string replace -r '^.*/' '' -- $file)
|
|
||||||
contains -- $basename $sourcelist
|
|
||||||
and continue
|
|
||||||
set -a sourcelist $basename
|
|
||||||
contains -- $root $existing_conf_paths
|
|
||||||
and continue # this is a pre-existing path, it will have been sourced already
|
|
||||||
[ -f $file -a -r $file ]
|
|
||||||
and source $file
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,168 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)"
|
|
||||||
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
|
|
||||||
|
|
||||||
echo "Automatically show and hide the dock"
|
|
||||||
defaults write com.apple.dock autohide -bool true
|
|
||||||
|
|
||||||
echo "Automatically show and hide the menu bar"
|
|
||||||
defaults write NSGlobalDomain _HIHideMenuBar -bool true
|
|
||||||
|
|
||||||
echo "Make Dock icons of hidden applications translucent"
|
|
||||||
defaults write com.apple.dock showhidden -bool true
|
|
||||||
|
|
||||||
echo "Use current directory as default search scope in Finder"
|
|
||||||
defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
|
|
||||||
|
|
||||||
echo "Expand save panel by default"
|
|
||||||
defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
|
|
||||||
|
|
||||||
echo "Expand print panel by default"
|
|
||||||
defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
|
|
||||||
|
|
||||||
echo "Disable the \"Are you sure you want to open this application?\" dialog"
|
|
||||||
defaults write com.apple.LaunchServices LSQuarantine -bool false
|
|
||||||
|
|
||||||
echo "Enable highlight hover effect for the grid view of a stack (Dock)"
|
|
||||||
defaults write com.apple.dock mouse-over-hilte-stack -bool true
|
|
||||||
|
|
||||||
echo "Enable spring loading for all Dock items"
|
|
||||||
defaults write enable-spring-load-actions-on-all-items -bool true
|
|
||||||
|
|
||||||
echo "Disable press-and-hold for keys in favor of key repeat"
|
|
||||||
defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
|
|
||||||
defaults write -g ApplePressAndHoldEnabled -bool false
|
|
||||||
|
|
||||||
echo "Set a blazingly fast keyboard repeat rate"
|
|
||||||
defaults write NSGlobalDomain KeyRepeat -int 2
|
|
||||||
|
|
||||||
echo "Set a shorter Delay until key repeat"
|
|
||||||
defaults write NSGlobalDomain InitialKeyRepeat -int 12
|
|
||||||
|
|
||||||
echo "Disable disk image verification"
|
|
||||||
defaults write com.apple.frameworks.diskimages skip-verify -bool true
|
|
||||||
defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
|
|
||||||
defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
|
|
||||||
|
|
||||||
echo "Avoid creating .DS_Store files on network volumes"
|
|
||||||
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
|
|
||||||
|
|
||||||
echo "Disable the warning when changing a file extension"
|
|
||||||
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
|
|
||||||
|
|
||||||
# echo "Enable snap-to-grid for desktop icons"
|
|
||||||
# /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
|
|
||||||
|
|
||||||
echo "Disable the warning before emptying the Trash"
|
|
||||||
defaults write com.apple.finder WarnOnEmptyTrash -bool false
|
|
||||||
|
|
||||||
echo "Disable tap to click (Trackpad)"
|
|
||||||
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool false
|
|
||||||
|
|
||||||
echo "Enable Safari’s debug menu"
|
|
||||||
defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
|
|
||||||
|
|
||||||
echo "Make Safari’s search banners default to Contains instead of Starts With"
|
|
||||||
defaults write com.apple.Safari FindOnPageMatchesWordStartsOnly -bool false
|
|
||||||
|
|
||||||
echo "Add a context menu item for showing the Web Inspector in web views"
|
|
||||||
defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
|
|
||||||
|
|
||||||
echo "Save to disk (not to iCloud) by default"
|
|
||||||
defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
|
|
||||||
|
|
||||||
echo "Disable automatic capitalization as it’s annoying when typing code"
|
|
||||||
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
|
|
||||||
|
|
||||||
echo "Disable smart dashes as they’re annoying when typing code"
|
|
||||||
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
|
|
||||||
|
|
||||||
echo "Disable automatic period substitution as it’s annoying when typing code"
|
|
||||||
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
|
|
||||||
|
|
||||||
echo "Disable smart quotes as they’re annoying when typing code"
|
|
||||||
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
|
|
||||||
|
|
||||||
echo "Disable auto-correct"
|
|
||||||
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
|
|
||||||
|
|
||||||
echo "Use scroll gesture with the Ctrl (^) modifier key to zoom"
|
|
||||||
defaults write com.apple.universalaccess closeViewScrollWheelToggle -bool true
|
|
||||||
defaults write com.apple.universalaccess HIDScrollZoomModifierMask -int 262144
|
|
||||||
echo "Follow the keyboard focus while zoomed in"
|
|
||||||
defaults write com.apple.universalaccess closeViewZoomFollowsFocus -bool true
|
|
||||||
|
|
||||||
echo "Require password immediately after sleep or screen saver begins"
|
|
||||||
defaults write com.apple.screensaver askForPassword -int 1
|
|
||||||
defaults write com.apple.screensaver askForPasswordDelay -int 0
|
|
||||||
|
|
||||||
echo "Save screenshots to downloads"
|
|
||||||
defaults write com.apple.screencapture location -string "${HOME}/Downloads"
|
|
||||||
|
|
||||||
echo "Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons"
|
|
||||||
defaults write com.apple.finder QuitMenuItem -bool true
|
|
||||||
|
|
||||||
echo "Show the ~/Library folder"
|
|
||||||
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library
|
|
||||||
|
|
||||||
# Noah Prefs
|
|
||||||
echo "Enable dock magnification"
|
|
||||||
defaults write com.apple.dock magnification -bool true
|
|
||||||
|
|
||||||
echo "Set dock size"
|
|
||||||
defaults write com.apple.dock largesize -int 48
|
|
||||||
defaults write com.apple.dock tilesize -int 44
|
|
||||||
|
|
||||||
echo "Choose and order dock icons"
|
|
||||||
__dock_item() {
|
|
||||||
printf '%s%s%s%s%s' \
|
|
||||||
'<dict><key>tile-data</key><dict><key>file-data</key><dict>' \
|
|
||||||
'<key>_CFURLString</key><string>' \
|
|
||||||
"$1" \
|
|
||||||
'</string><key>_CFURLStringType</key><integer>0</integer>' \
|
|
||||||
'</dict></dict></dict>'
|
|
||||||
}
|
|
||||||
|
|
||||||
defaults write com.apple.dock persistent-apps -array \
|
|
||||||
"$(__dock_item /Applications/1Password\ 7.app)" \
|
|
||||||
"$(__dock_item /Applications/Slack.app)" \
|
|
||||||
"$(__dock_item /System/Applications/Calendar.app)" \
|
|
||||||
"$(__dock_item /Applications/Firefox.app)" \
|
|
||||||
"$(__dock_item /System/Applications/Messages.app)" \
|
|
||||||
"$(__dock_item /System/Applications/Mail.app)" \
|
|
||||||
"$(__dock_item /Applications/Mimestream.app)" \
|
|
||||||
"$(__dock_item /Applications/zoom.us.app)" \
|
|
||||||
"$(__dock_item /Applications/Obsidian.app)" \
|
|
||||||
"$(__dock_item /Applications/Alacritty.app)" \
|
|
||||||
"$(__dock_item /System/Applications/System\ Preferences.app)"
|
|
||||||
|
|
||||||
echo "No recent items in dock"
|
|
||||||
defaults write com.apple.dock show-recents -bool FALSE
|
|
||||||
|
|
||||||
echo "Switch to dark mode"
|
|
||||||
defaults write "Apple Global Domain" "AppleInterfaceStyle" "Dark"
|
|
||||||
|
|
||||||
echo "Turn on Scroll Reverser"
|
|
||||||
open /Applications/Scroll\ Reverser.app
|
|
||||||
osascript -e 'tell application "System Events" to make login item at end with properties {path:"/Applications/Scroll Reverser.app", hidden:false}'
|
|
||||||
|
|
||||||
echo "Allow apps from anywhere"
|
|
||||||
SPCTL=$(spctl --status)
|
|
||||||
if ! [ "$SPCTL" = "assessments disabled" ]
|
|
||||||
then
|
|
||||||
sudo spctl --master-disable
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ---
|
|
||||||
|
|
||||||
echo "Reset Launchpad"
|
|
||||||
# [ -e ~/Library/Application\ Support/Dock/*.db ] && rm ~/Library/Application\ Support/Dock/*.db
|
|
||||||
rm ~/Library/Application\ Support/Dock/*.db
|
|
||||||
|
|
||||||
echo "Show the ~/Library folder"
|
|
||||||
chflags nohidden ~/Library
|
|
||||||
|
|
||||||
# Clean up
|
|
||||||
echo "Kill affected applications"
|
|
||||||
for app in Safari Finder Dock Mail SystemUIServer; do killall "$app" >/dev/null 2>&1; done
|
|
@ -1,5 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
npm update -g
|
|
||||||
npm install -g pyright
|
|
||||||
npm install -g diagnostic-languageserver
|
|
@ -1,48 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
install_rust() {
|
|
||||||
if ! (which ~/.cargo/bin/rustup > /dev/null)
|
|
||||||
then
|
|
||||||
echo "installing rustup"
|
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "rustup ✓"
|
|
||||||
}
|
|
||||||
|
|
||||||
update_rust() {
|
|
||||||
~/.cargo/bin/rustup update > /dev/null 2>&1
|
|
||||||
rust_version=$(~/.cargo/bin/rustc --version | awk '{print $2}')
|
|
||||||
|
|
||||||
echo "latest rust: $rust_version ✓"
|
|
||||||
}
|
|
||||||
|
|
||||||
download_rust_analyzer() {
|
|
||||||
if ! (which rust-analyzer > /dev/null)
|
|
||||||
then
|
|
||||||
echo "downloading rust analyzer"
|
|
||||||
rust_analyzer_bin=/usr/local/bin/rust-analyzer
|
|
||||||
curl -s -L https://github.com/rust-analyzer/rust-analyzer/releases/latest/download/rust-analyzer-mac -o $rust_analyzer_bin
|
|
||||||
chmod +x $rust_analyzer_bin
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "rust-analyzer ✓"
|
|
||||||
}
|
|
||||||
|
|
||||||
# cargo-edit: quickly add and remove packages
|
|
||||||
# whatfeatures: see optional features for a package
|
|
||||||
install_cargos() {
|
|
||||||
set -- \
|
|
||||||
'cargo-edit' \
|
|
||||||
'cargo-whatfeatures'
|
|
||||||
for program do
|
|
||||||
cargo install "$program"
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "cargos ✓"
|
|
||||||
}
|
|
||||||
|
|
||||||
install_rust
|
|
||||||
update_rust
|
|
||||||
download_rust_analyzer
|
|
||||||
install_cargos
|
|
@ -1,6 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "downloading cheatsheet"
|
|
||||||
curl https://cht.sh/:cht.sh > ~/.local/bin/cheat
|
|
||||||
chmod 755 ~/.local/bin/cheat
|
|
||||||
echo "cheatsheet ✓"
|
|
@ -1,46 +0,0 @@
|
|||||||
#!/usr/bin/env fish
|
|
||||||
|
|
||||||
set -U FISH_DIR (readlink ~/.config/fish) # Used for getting to this repo
|
|
||||||
set -Ux DOTS (dirname $FISH_DIR) # Directory of this config repo
|
|
||||||
set -U CDPATH . $HOME # Directories available for immediate cd
|
|
||||||
set -Ux EDITOR nvim # Preferred text editor
|
|
||||||
set -U PROJ $HOME/dev/work # Projects directory
|
|
||||||
set -Ux NOTES_PATH "$HOME/dev/personal/notes" # Notes directory
|
|
||||||
set -Ux MANPAGER "nvim +Man!" # Used for reading man pages
|
|
||||||
set -Ux DIRENV_LOG_FORMAT "" # Disable direnv output
|
|
||||||
set -Ux BROWSER "/Applications/Firefox.app/Contents/MacOS/firefox"
|
|
||||||
|
|
||||||
# Load abbreviations
|
|
||||||
abbrs
|
|
||||||
|
|
||||||
# Turn off greeting
|
|
||||||
set -U fish_greeting ""
|
|
||||||
|
|
||||||
# Set colors (Base16 Eighties)
|
|
||||||
set -U fish_color_normal normal
|
|
||||||
set -U fish_color_command 99cc99
|
|
||||||
set -U fish_color_quote ffcc66
|
|
||||||
set -U fish_color_redirection d3d0c8
|
|
||||||
set -U fish_color_end cc99cc
|
|
||||||
set -U fish_color_error f2777a
|
|
||||||
set -U fish_color_selection white --bold --background=brblack
|
|
||||||
set -U fish_color_search_match bryellow --background=brblack
|
|
||||||
set -U fish_color_history_current --bold
|
|
||||||
set -U fish_color_operator 6699cc
|
|
||||||
set -U fish_color_escape 66cccc
|
|
||||||
set -U fish_color_cwd green
|
|
||||||
set -U fish_color_cwd_root red
|
|
||||||
set -U fish_color_valid_path --underline
|
|
||||||
set -U fish_color_autosuggestion 747369
|
|
||||||
set -U fish_color_user brgreen
|
|
||||||
set -U fish_color_host normal
|
|
||||||
set -U fish_color_cancel -r
|
|
||||||
set -U fish_pager_color_completion normal
|
|
||||||
set -U fish_pager_color_description B3A06D yellow
|
|
||||||
set -U fish_pager_color_prefix white --bold --underline
|
|
||||||
set -U fish_pager_color_progress brwhite --background=cyan
|
|
||||||
set -U fish_color_comment ffcc66
|
|
||||||
set -U fish_color_param d3d0c8
|
|
||||||
set -U fish_color_match 6699cc
|
|
||||||
|
|
||||||
echo "fish setup ✓"
|
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
echo "downloading ytfzf"
|
|
||||||
mkdir -p ~/.local/bin
|
|
||||||
curl -sL "https://raw.githubusercontent.com/pystardust/ytfzf/master/ytfzf" >~/.local/bin/ytfzf
|
|
||||||
chmod 755 ~/.local/bin/ytfzf
|
|
||||||
echo "ytfzf ✓"
|
|
@ -1,8 +0,0 @@
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: ClusterRole
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
rules:
|
|
||||||
- apiGroups: [""]
|
|
||||||
resources:
|
|
||||||
verbs: []
|
|
@ -1,12 +0,0 @@
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: ClusterRoleBinding
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
roleRef:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
kind: ClusterRole
|
|
||||||
name:
|
|
||||||
subjects:
|
|
||||||
- kind: ServiceAccount
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
@ -1,8 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
||||||
annotations:
|
|
||||||
replicator.v1.mittwald.de/replicate-to: ".*"
|
|
||||||
data:
|
|
@ -1,33 +0,0 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app:
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app:
|
|
||||||
spec:
|
|
||||||
serviceAccountName:
|
|
||||||
containers:
|
|
||||||
- name:
|
|
||||||
image:
|
|
||||||
imagePullPolicy: Always
|
|
||||||
envFrom:
|
|
||||||
- configMapRef:
|
|
||||||
name:
|
|
||||||
- secretRef:
|
|
||||||
name:
|
|
||||||
ports:
|
|
||||||
- containerPort:
|
|
||||||
protocol: TCP
|
|
||||||
resources:
|
|
||||||
limits:
|
|
||||||
cpu:
|
|
||||||
requests:
|
|
||||||
cpu:
|
|
@ -1,21 +0,0 @@
|
|||||||
apiVersion: networking.k8s.io/v1beta1 # must be beta until k8s 1.19
|
|
||||||
kind: Ingress
|
|
||||||
metadata:
|
|
||||||
annotations:
|
|
||||||
kubernetes.io/ingress.class: alb
|
|
||||||
alb.ingress.kubernetes.io/group.name:
|
|
||||||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
|
|
||||||
alb.ingress.kubernetes.io/scheme: internet-facing
|
|
||||||
alb.ingress.kubernetes.io/security-groups:
|
|
||||||
alb.ingress.kubernetes.io/tags: Project=
|
|
||||||
alb.ingress.kubernetes.io/target-type: instance
|
|
||||||
name:
|
|
||||||
namespace:
|
|
||||||
spec:
|
|
||||||
rules:
|
|
||||||
- host:
|
|
||||||
http:
|
|
||||||
paths:
|
|
||||||
- backend:
|
|
||||||
serviceName:
|
|
||||||
servicePort:
|
|
@ -1,10 +0,0 @@
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: Role
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
||||||
rules:
|
|
||||||
- apiGroups: [""]
|
|
||||||
resourceNames:
|
|
||||||
resources:
|
|
||||||
verbs:
|
|
@ -1,13 +0,0 @@
|
|||||||
apiVersion: rbac.authorization.k8s.io/v1
|
|
||||||
kind: RoleBinding
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
||||||
roleRef:
|
|
||||||
kind:
|
|
||||||
name:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
||||||
subjects:
|
|
||||||
- kind:
|
|
||||||
name:
|
|
||||||
apiGroup: rbac.authorization.k8s.io
|
|
@ -1,8 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Secret
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
||||||
annotations:
|
|
||||||
replicator.v1.mittwald.de/replicate-to: ".*"
|
|
||||||
data:
|
|
@ -1,15 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
annotations:
|
|
||||||
alb.ingress.kubernetes.io/healthcheck-path:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: 443
|
|
||||||
protocol: TCP
|
|
||||||
targetPort: 80
|
|
||||||
selector:
|
|
||||||
app:
|
|
||||||
type: NodePort
|
|
@ -1,5 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ServiceAccount
|
|
||||||
metadata:
|
|
||||||
name:
|
|
||||||
namespace: default
|
|
@ -1,12 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
"""
|
|
||||||
Program
|
|
||||||
"""
|
|
||||||
|
|
||||||
def main():
|
|
||||||
"""Run the program"""
|
|
||||||
pass
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
@ -1,8 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ "$1" = "--help" ] || [ "$1" = "-h" ]; then
|
|
||||||
cat <<EOH
|
|
||||||
Help text
|
|
||||||
EOH
|
|
||||||
exit
|
|
||||||
fi
|
|
@ -1,21 +0,0 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
|
||||||
|
|
||||||
options = {
|
|
||||||
media = {
|
|
||||||
enable = lib.mkEnableOption {
|
|
||||||
description = "Enable media programs.";
|
|
||||||
default = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = lib.mkIf (config.gui.enable && config.media.enable) {
|
|
||||||
home-manager.users.${config.user}.home.packages = with pkgs; [
|
|
||||||
mpv # Video viewer
|
|
||||||
sxiv # Image viewer
|
|
||||||
mupdf # PDF viewer
|
|
||||||
zathura # PDF viewer
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
@ -1,7 +1,7 @@
|
|||||||
{ config, pkgs, lib, ... }: {
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
"1password" = {
|
_1password = {
|
||||||
enable = lib.mkEnableOption {
|
enable = lib.mkEnableOption {
|
||||||
description = "Enable 1Password.";
|
description = "Enable 1Password.";
|
||||||
default = false;
|
default = false;
|
||||||
@ -10,8 +10,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf
|
config = lib.mkIf
|
||||||
(config.gui.enable && config."1password".enable && pkgs.stdenv.isLinux) {
|
(config.gui.enable && config._1password.enable && pkgs.stdenv.isLinux) {
|
||||||
unfreePackages = [ "1password" "_1password-gui" ];
|
unfreePackages = with pkgs; [ _1password _1password-gui ];
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
home.packages = with pkgs; [ _1password-gui ];
|
home.packages = with pkgs; [ _1password-gui ];
|
||||||
};
|
};
|
@ -3,14 +3,15 @@
|
|||||||
imports = [
|
imports = [
|
||||||
./1password.nix
|
./1password.nix
|
||||||
./alacritty.nix
|
./alacritty.nix
|
||||||
./calibre.nix
|
|
||||||
./discord.nix
|
./discord.nix
|
||||||
./firefox.nix
|
./firefox.nix
|
||||||
./kitty.nix
|
./kitty.nix
|
||||||
./media.nix
|
./media.nix
|
||||||
|
./nautilus.nix
|
||||||
./obsidian.nix
|
./obsidian.nix
|
||||||
./qbittorrent.nix
|
./qbittorrent.nix
|
||||||
./nautilus.nix
|
./slack.nix
|
||||||
|
./yt-dlp.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
@ -10,7 +10,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf (config.gui.enable && config.discord.enable) {
|
config = lib.mkIf (config.gui.enable && config.discord.enable) {
|
||||||
unfreePackages = [ "discord" ];
|
unfreePackages = [ pkgs.discord ];
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
home.packages = with pkgs; [ discord ];
|
home.packages = with pkgs; [ discord ];
|
||||||
xdg.configFile."discord/settings.json".text = ''
|
xdg.configFile."discord/settings.json".text = ''
|
@ -13,9 +13,9 @@
|
|||||||
|
|
||||||
config = lib.mkIf (config.gui.enable && config.firefox.enable) {
|
config = lib.mkIf (config.gui.enable && config.firefox.enable) {
|
||||||
|
|
||||||
unfreePackages = [
|
unfreePackages = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||||
(lib.mkIf config."1password".enable "onepassword-password-manager")
|
(lib.mkIf config._1password.enable onepassword-password-manager)
|
||||||
"okta-browser-plugin"
|
okta-browser-plugin
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
@ -24,29 +24,28 @@
|
|||||||
enable = true;
|
enable = true;
|
||||||
package =
|
package =
|
||||||
if pkgs.stdenv.isDarwin then pkgs.firefox-bin else pkgs.firefox;
|
if pkgs.stdenv.isDarwin then pkgs.firefox-bin else pkgs.firefox;
|
||||||
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
|
||||||
ublock-origin
|
|
||||||
vimium
|
|
||||||
multi-account-containers
|
|
||||||
facebook-container
|
|
||||||
temporary-containers
|
|
||||||
(lib.mkIf config."1password".enable onepassword-password-manager)
|
|
||||||
okta-browser-plugin
|
|
||||||
sponsorblock
|
|
||||||
reddit-enhancement-suite
|
|
||||||
return-youtube-dislikes
|
|
||||||
bypass-paywalls-clean
|
|
||||||
markdownload
|
|
||||||
darkreader
|
|
||||||
snowflake
|
|
||||||
don-t-fuck-with-paste
|
|
||||||
i-dont-care-about-cookies
|
|
||||||
wappalyzer
|
|
||||||
];
|
|
||||||
profiles.default = {
|
profiles.default = {
|
||||||
id = 0;
|
id = 0;
|
||||||
name = "default";
|
name = "default";
|
||||||
isDefault = true;
|
isDefault = true;
|
||||||
|
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||||
|
ublock-origin
|
||||||
|
vimium
|
||||||
|
multi-account-containers
|
||||||
|
facebook-container
|
||||||
|
temporary-containers
|
||||||
|
(lib.mkIf config._1password.enable onepassword-password-manager)
|
||||||
|
okta-browser-plugin
|
||||||
|
sponsorblock
|
||||||
|
reddit-enhancement-suite
|
||||||
|
return-youtube-dislikes
|
||||||
|
markdownload
|
||||||
|
darkreader
|
||||||
|
snowflake
|
||||||
|
don-t-fuck-with-paste
|
||||||
|
i-dont-care-about-cookies
|
||||||
|
wappalyzer
|
||||||
|
];
|
||||||
settings = {
|
settings = {
|
||||||
"app.update.auto" = false;
|
"app.update.auto" = false;
|
||||||
"browser.aboutConfig.showWarning" = false;
|
"browser.aboutConfig.showWarning" = false;
|
||||||
@ -54,7 +53,7 @@
|
|||||||
"browser.quitShortcut.disabled" =
|
"browser.quitShortcut.disabled" =
|
||||||
if pkgs.stdenv.isLinux then true else false;
|
if pkgs.stdenv.isLinux then true else false;
|
||||||
"browser.theme.dark-private-windows" = true;
|
"browser.theme.dark-private-windows" = true;
|
||||||
"browser.toolbars.bookmarks.visibility" = "newtab";
|
"browser.toolbars.bookmarks.visibility" = false;
|
||||||
"browser.startup.page" = 3; # Restore previous session
|
"browser.startup.page" = 3; # Restore previous session
|
||||||
"browser.newtabpage.enabled" = false; # Make new tabs blank
|
"browser.newtabpage.enabled" = false; # Make new tabs blank
|
||||||
"trailhead.firstrun.didSeeAboutWelcome" =
|
"trailhead.firstrun.didSeeAboutWelcome" =
|
38
modules/common/applications/media.nix
Normal file
38
modules/common/applications/media.nix
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{ 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; [
|
||||||
|
mpv # Video viewer
|
||||||
|
sxiv # Image viewer
|
||||||
|
mupdf # PDF viewer
|
||||||
|
zathura # PDF viewer
|
||||||
|
];
|
||||||
|
|
||||||
|
# Set default for opening PDFs
|
||||||
|
xdg.mimeApps = {
|
||||||
|
associations.added = {
|
||||||
|
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||||
|
"image/*" = [ "sxiv.desktop" ];
|
||||||
|
};
|
||||||
|
associations.removed = { "application/pdf" = [ "mupdf.desktop" ]; };
|
||||||
|
defaultApplications = {
|
||||||
|
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||||
|
"image/*" = [ "sxiv.desktop" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -17,6 +17,10 @@
|
|||||||
gnome.sushi # Quick preview with spacebar
|
gnome.sushi # Quick preview with spacebar
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# Set default for opening directories
|
||||||
|
xdg.mimeApps.defaultApplications."inode/directory" =
|
||||||
|
[ "nautilus.desktop" ];
|
||||||
|
|
||||||
programs.fish.functions = {
|
programs.fish.functions = {
|
||||||
qr = {
|
qr = {
|
||||||
body =
|
body =
|
||||||
@ -24,6 +28,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
@ -10,7 +10,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf (config.gui.enable && config.obsidian.enable) {
|
config = lib.mkIf (config.gui.enable && config.obsidian.enable) {
|
||||||
unfreePackages = [ "obsidian" ];
|
unfreePackages = [ pkgs.obsidian ];
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
home.packages = with pkgs; [ obsidian ];
|
home.packages = with pkgs; [ obsidian ];
|
||||||
};
|
};
|
19
modules/common/applications/slack.nix
Normal file
19
modules/common/applications/slack.nix
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
|
options = {
|
||||||
|
slack = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable Slack.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (config.gui.enable && config.slack.enable) {
|
||||||
|
unfreePackages = [ pkgs.slack ];
|
||||||
|
home-manager.users.${config.user} = {
|
||||||
|
home.packages = with pkgs; [ slack ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
35
modules/common/applications/yt-dlp.nix
Normal file
35
modules/common/applications/yt-dlp.nix
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{ config, pkgs, lib, ... }: {
|
||||||
|
|
||||||
|
options = {
|
||||||
|
yt-dlp = {
|
||||||
|
enable = lib.mkEnableOption {
|
||||||
|
description = "Enable YouTube downloader.";
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf (config.yt-dlp.enable) {
|
||||||
|
home-manager.users.${config.user} = {
|
||||||
|
programs.yt-dlp = {
|
||||||
|
enable = true;
|
||||||
|
extraConfig = "";
|
||||||
|
settings = {
|
||||||
|
no-continue = true; # Always re-download each fragment
|
||||||
|
no-overwrites = true; # Don't overwrite existing files
|
||||||
|
download-archive = "archive.log"; # Log of archives
|
||||||
|
embed-metadata = true;
|
||||||
|
embed-thumbnail = true;
|
||||||
|
embed-subs = true;
|
||||||
|
sub-langs = "en.*";
|
||||||
|
concurrent-fragments = 4; # Parallel download chunks
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.fish.shellAbbrs.yt = "yt-dlp";
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -1,20 +1,7 @@
|
|||||||
{ config, lib, pkgs, ... }: {
|
{ config, lib, pkgs, ... }: {
|
||||||
|
|
||||||
imports = [
|
imports =
|
||||||
./applications
|
[ ./applications ./mail ./neovim ./programming ./repositories ./shell ];
|
||||||
./darwin
|
|
||||||
./gaming
|
|
||||||
./graphical
|
|
||||||
./hardware
|
|
||||||
./mail
|
|
||||||
./neovim
|
|
||||||
./nixos
|
|
||||||
./programming
|
|
||||||
./repositories
|
|
||||||
./services
|
|
||||||
./shell
|
|
||||||
./wsl
|
|
||||||
];
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
user = lib.mkOption {
|
user = lib.mkOption {
|
||||||
@ -81,7 +68,7 @@
|
|||||||
description = "Link to dotfiles repository.";
|
description = "Link to dotfiles repository.";
|
||||||
};
|
};
|
||||||
unfreePackages = lib.mkOption {
|
unfreePackages = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
type = lib.types.listOf lib.types.package;
|
||||||
description = "List of unfree packages to allow.";
|
description = "List of unfree packages to allow.";
|
||||||
default = [ ];
|
default = [ ];
|
||||||
};
|
};
|
||||||
@ -90,11 +77,29 @@
|
|||||||
config = let stateVersion = "23.05";
|
config = let stateVersion = "23.05";
|
||||||
in {
|
in {
|
||||||
|
|
||||||
# Enable features in Nix commands
|
nix = {
|
||||||
nix.extraOptions = ''
|
|
||||||
experimental-features = nix-command flakes
|
# Enable features in Nix commands
|
||||||
warn-dirty = false
|
extraOptions = ''
|
||||||
'';
|
experimental-features = nix-command flakes
|
||||||
|
warn-dirty = false
|
||||||
|
'';
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
|
||||||
|
# Add community Cachix to binary cache
|
||||||
|
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
|
||||||
|
auto-optimise-store = true;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
# Basic common system packages for all devices
|
# Basic common system packages for all devices
|
||||||
environment.systemPackages = with pkgs; [ git vim wget curl ];
|
environment.systemPackages = with pkgs; [ git vim wget curl ];
|
||||||
@ -108,8 +113,10 @@
|
|||||||
|
|
||||||
# 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
|
||||||
|
# Idea: https://discourse.nixos.org/t/how-to-use-packages-directly-in-allowunfreepredicate/22455/6
|
||||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
nixpkgs.config.allowUnfreePredicate = pkg:
|
||||||
builtins.elem (lib.getName pkg) config.unfreePackages;
|
builtins.elem (pkg.name or (builtins.parseDrvName pkg.pname).name)
|
||||||
|
(map lib.getName config.unfreePackages);
|
||||||
|
|
||||||
# Pin a state version to prevent warnings
|
# Pin a state version to prevent warnings
|
||||||
home-manager.users.${config.user}.home.stateVersion = stateVersion;
|
home-manager.users.${config.user}.home.stateVersion = stateVersion;
|
@ -3,6 +3,7 @@
|
|||||||
imports = [ ./himalaya.nix ./aerc.nix ];
|
imports = [ ./himalaya.nix ./aerc.nix ];
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
|
mail.enable = lib.mkEnableOption "Mail service.";
|
||||||
mail.user = lib.mkOption {
|
mail.user = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "User name for the email address.";
|
description = "User name for the email address.";
|
||||||
@ -14,7 +15,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf (config.mail.user != null && config.mail.server != null) {
|
config = lib.mkIf config.mail.enable {
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
programs.mbsync = { enable = true; };
|
programs.mbsync = { enable = true; };
|
||||||
@ -66,7 +67,7 @@
|
|||||||
notmuch.enable = false;
|
notmuch.enable = false;
|
||||||
passwordCommand =
|
passwordCommand =
|
||||||
"${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${
|
"${pkgs.age}/bin/age --decrypt --identity ${config.identityFile} ${
|
||||||
builtins.toString ../../private/mailpass.age
|
builtins.toString ../../../private/mailpass.age
|
||||||
}";
|
}";
|
||||||
smtp = {
|
smtp = {
|
||||||
host = "smtp.purelymail.com";
|
host = "smtp.purelymail.com";
|
9
modules/common/neovim/config/align.nix
Normal file
9
modules/common/neovim/config/align.nix
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
plugins = [ pkgs.vimPlugins.tabular ];
|
||||||
|
lua = ''
|
||||||
|
-- Align
|
||||||
|
vim.keymap.set("", "<Leader>ta", ":Tabularize /")
|
||||||
|
vim.keymap.set("", "<Leader>t#", ":Tabularize /#<CR>")
|
||||||
|
vim.keymap.set("", "<Leader>tl", ":Tabularize /---<CR>")
|
||||||
|
'';
|
||||||
|
}
|
@ -6,10 +6,10 @@
|
|||||||
pkgs.vimPlugins.null-ls-nvim
|
pkgs.vimPlugins.null-ls-nvim
|
||||||
];
|
];
|
||||||
|
|
||||||
use.lspconfig.sumneko_lua.setup = dsl.callWith {
|
use.lspconfig.lua_ls.setup = dsl.callWith {
|
||||||
settings = { Lua = { diagnostics = { globals = [ "vim" "hs" ]; }; }; };
|
settings = { Lua = { diagnostics = { globals = [ "vim" "hs" ]; }; }; };
|
||||||
capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
|
capabilities = dsl.rawLua "require('cmp_nvim_lsp').default_capabilities()";
|
||||||
cmd = [ "${pkgs.sumneko-lua-language-server}/bin/lua-language-server" ];
|
cmd = [ "${pkgs.lua-language-server}/bin/lua-language-server" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
use.lspconfig.nil_ls.setup = dsl.callWith {
|
use.lspconfig.nil_ls.setup = dsl.callWith {
|
||||||
@ -42,7 +42,10 @@
|
|||||||
command = "${pkgs.shfmt}/bin/shfmt",
|
command = "${pkgs.shfmt}/bin/shfmt",
|
||||||
extra_args = { "-i", "4", "-ci" },
|
extra_args = { "-i", "4", "-ci" },
|
||||||
}),
|
}),
|
||||||
require("null-ls").builtins.formatting.terraform_fmt.with({ command = "${pkgs.terraform}/bin/terraform" }),
|
require("null-ls").builtins.formatting.terraform_fmt.with({
|
||||||
|
command = "${pkgs.terraform}/bin/terraform",
|
||||||
|
extra_filetypes = { "hcl" },
|
||||||
|
}),
|
||||||
},
|
},
|
||||||
|
|
||||||
on_attach = function(client, bufnr)
|
on_attach = function(client, bufnr)
|
@ -1,7 +1,7 @@
|
|||||||
{ pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
plugins = [
|
plugins = [
|
||||||
(pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins:
|
(pkgs.vimPlugins.nvim-treesitter.withPlugins (_plugins:
|
||||||
with pkgs.tree-sitter-grammars; [
|
with pkgs.tree-sitter-grammars; [
|
||||||
tree-sitter-hcl
|
tree-sitter-hcl
|
||||||
tree-sitter-python
|
tree-sitter-python
|
@ -34,6 +34,14 @@ in {
|
|||||||
programs.kitty.settings.scrollback_pager = lib.mkForce ''
|
programs.kitty.settings.scrollback_pager = lib.mkForce ''
|
||||||
${neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
|
${neovim}/bin/nvim -c 'setlocal nonumber nolist showtabline=0 foldcolumn=0|Man!' -c "autocmd VimEnter * normal G" -'';
|
||||||
|
|
||||||
|
xdg.desktopEntries.nvim = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
|
name = "Neovim wrapper";
|
||||||
|
exec = "kitty nvim %F";
|
||||||
|
};
|
||||||
|
xdg.mimeApps = lib.mkIf pkgs.stdenv.isLinux {
|
||||||
|
defaultApplications."text/markdown" = [ "nvim.desktop" ];
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# # Used for icons in Vim
|
# # Used for icons in Vim
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user