mirror of
https://github.com/nmasur/dotfiles
synced 2025-07-07 19:30:14 +00:00
Compare commits
22 Commits
unfree-pre
...
b06b6490f4
Author | SHA1 | Date | |
---|---|---|---|
b06b6490f4 | |||
514244476d | |||
47590abc3a | |||
f69d233c39 | |||
9b97c9ac84 | |||
bda59eeb4a | |||
e7468ecc46 | |||
1b798f5af0 | |||
4406116203 | |||
c53f1470ee | |||
da89732001 | |||
2176a53c4a | |||
28576c1b8f | |||
64590c539b | |||
78b364afd7 | |||
f219ce45c8 | |||
5002c881f7 | |||
5859377802 | |||
e6dbed2e17 | |||
86076f0844 | |||
2aea76c0e3 | |||
42a5ad40de |
118
README.md
118
README.md
@ -6,21 +6,56 @@ hosts.
|
||||
They are organized and managed by [Nix](https://nixos.org), so some of the
|
||||
configuration may be difficult to translate to a non-Nix system.
|
||||
|
||||
However, some of the configurations are easier to lift directly:
|
||||
## System Features
|
||||
|
||||
- [Neovim](https://github.com/nmasur/dotfiles/tree/master/modules/common/neovim/config)
|
||||
- [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/common/shell/fish/default.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)
|
||||
| Feature | Program | Configuration |
|
||||
| --- | --- | --- |
|
||||
| OS | [NixOS](https://nixos.org) | [Link](./modules/nixos) |
|
||||
| Display Server | [X11](https://www.x.org/wiki/) | [Link](./modules/nixos/graphical/xorg.nix) |
|
||||
| Compositor | [Picom](https://github.com/yshui/picom) | [Link](./modules/nixos/graphical/picom.nix) |
|
||||
| Window Manager | [i3](https://i3wm.org/) | [Link](./modules/nixos/graphical/i3.nix) |
|
||||
| Panel | [Polybar](https://polybar.github.io/) | [Link](./modules/nixos/graphical/polybar.nix) |
|
||||
| Font | [Victor Mono](https://rubjo.github.io/victor-mono/) | [Link](./modules/nixos/graphical/fonts.nix) |
|
||||
| Launcher | [Rofi](https://github.com/davatorium/rofi) | [Link](./modules/nixos/graphical/rofi.nix) |
|
||||
|
||||
Try out my Neovim config (requires [nix](https://nixos.org/download.html)):
|
||||
## User Features
|
||||
|
||||
| Feature | Program | Configuration |
|
||||
| --- | --- | --- |
|
||||
| Dotfiles | [Home-Manager](https://github.com/nix-community/home-manager) | [Link](./modules/common) |
|
||||
| Terminal | [Kitty](https://sw.kovidgoyal.net/kitty/) | [Link](./modules/common/applications/kitty.nix) |
|
||||
| Shell | [Fish](https://fishshell.com/) | [Link](./modules/common/shell/fish) |
|
||||
| Shell Prompt | [Starship](https://starship.rs/) | [Link](./modules/common/shell/starhip.nix) |
|
||||
| Colorscheme | [Gruvbox](https://github.com/morhetz/gruvbox) | [Link](./colorscheme/gruvbox) |
|
||||
| Wallpaper | [Road](https://gitlab.com/exorcist365/wallpapers/-/blob/master/gruvbox/road.jpg) | [Link](./hosts/tempest/default.nix)
|
||||
| Text Editor | [Neovim](https://neovim.io/) | [Link](./modules/common/neovim/config) |
|
||||
| Browser | [Firefox](https://www.mozilla.org/en-US/firefox/new/) | [Link](./modules/common/applications/firefox.nix) |
|
||||
| E-Mail | [Aerc](https://aerc-mail.org/) | [Link](./modules/common/mail/aerc.nix) |
|
||||
| File Manager | [Nautilus](https://wiki.gnome.org/action/show/Apps/Files) | [Link](./modules/common/applications/nautilus.nix) |
|
||||
| PDF Reader | [Zathura](https://pwmt.org/projects/zathura/) | [Link](./modules/common/applications/media.nix) |
|
||||
| Video Player | [mpv](https://mpv.io/) | [Link](./modules/common/applications/media.nix) |
|
||||
|
||||
## macOS Features
|
||||
|
||||
| Feature | Program | Configuration |
|
||||
| --- | --- | --- |
|
||||
| Keybinds | [Hammerspoon](https://www.hammerspoon.org/) | [Link](./modules/darwin/hammerspoon) |
|
||||
|
||||
---
|
||||
|
||||
# Installation
|
||||
|
||||
Click [here](./docs/installation.md) for detailed installation instructions.
|
||||
|
||||
# Neovim
|
||||
|
||||
Try out my Neovim config with nix:
|
||||
|
||||
```bash
|
||||
nix run github:nmasur/dotfiles#neovim
|
||||
```
|
||||
|
||||
Or build it as a package (requires [nix](https://nixos.org/download.html)):
|
||||
Or build it as a package:
|
||||
|
||||
```bash
|
||||
nix build github:nmasur/dotfiles#neovim
|
||||
@ -30,73 +65,6 @@ 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
|
||||
configs might conflict with each other.
|
||||
|
||||
---
|
||||
|
||||
# Full Installation
|
||||
|
||||
## NixOS - From Live Disk
|
||||
|
||||
Format drives and build system from any NixOS host, including the live
|
||||
installer disk:
|
||||
|
||||
**This will erase your drives; use at your own risk!**
|
||||
|
||||
```bash
|
||||
lsblk # Choose the disk you want to wipe
|
||||
nix-shell -p nixVersions.stable
|
||||
nix run github:nmasur/dotfiles#installer -- nvme0n1 tempest
|
||||
```
|
||||
|
||||
## NixOS - From Existing System
|
||||
|
||||
If you're already running NixOS, you can switch to this configuration with the
|
||||
following command:
|
||||
|
||||
```bash
|
||||
nix-shell -p nixVersions.stable
|
||||
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#tempest
|
||||
```
|
||||
|
||||
## Windows - From NixOS WSL
|
||||
|
||||
After [installing NixOS on
|
||||
WSL](https://xeiaso.net/blog/nix-flakes-4-wsl-2022-05-01), you can switch to
|
||||
the WSL configuration:
|
||||
|
||||
```
|
||||
nix-shell -p nixVersions.stable
|
||||
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#hydra
|
||||
```
|
||||
|
||||
You should also download the
|
||||
[FiraCode](https://github.com/ryanoasis/nerd-fonts/releases/download/v2.2.2/FiraCode.zip)
|
||||
font and install it on Windows. Install [Alacritty](https://alacritty.org/) and
|
||||
move the `windows/alacritty.yml` file to
|
||||
`C:\Users\<user>\AppData\Roaming\alacritty`.
|
||||
|
||||
## macOS
|
||||
|
||||
To get started on a bare macOS installation, first install Nix:
|
||||
|
||||
```bash
|
||||
sh -c "$(curl -L https://nixos.org/nix/install)"
|
||||
```
|
||||
|
||||
Then use Nix to build nix-darwin:
|
||||
|
||||
```bash
|
||||
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
|
||||
./result/bin/darwin-installer
|
||||
```
|
||||
|
||||
Then switch to the macOS configuration:
|
||||
|
||||
```bash
|
||||
darwin-rebuild switch --flake github:nmasur/dotfiles#lookingglass
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
# Flake Templates
|
||||
|
||||
You can also use the [templates](./templates/) as flakes for starting new
|
||||
|
67
docs/installation.md
Normal file
67
docs/installation.md
Normal file
@ -0,0 +1,67 @@
|
||||
[Back to README](../README.md)
|
||||
|
||||
---
|
||||
|
||||
# Installation
|
||||
|
||||
## NixOS - From Live Disk
|
||||
|
||||
Format drives and build system from any NixOS host, including the live
|
||||
installer disk:
|
||||
|
||||
**This will erase your drives; use at your own risk!**
|
||||
|
||||
```bash
|
||||
lsblk # Choose the disk you want to wipe
|
||||
nix-shell -p nixVersions.stable
|
||||
nix run github:nmasur/dotfiles#installer -- nvme0n1 tempest
|
||||
```
|
||||
|
||||
## NixOS - From Existing System
|
||||
|
||||
If you're already running NixOS, you can switch to this configuration with the
|
||||
following command:
|
||||
|
||||
```bash
|
||||
nix-shell -p nixVersions.stable
|
||||
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#tempest
|
||||
```
|
||||
|
||||
## Windows - From NixOS WSL
|
||||
|
||||
After [installing NixOS on
|
||||
WSL](https://xeiaso.net/blog/nix-flakes-4-wsl-2022-05-01), you can switch to
|
||||
the WSL configuration:
|
||||
|
||||
```
|
||||
nix-shell -p nixVersions.stable
|
||||
sudo nixos-rebuild switch --flake github:nmasur/dotfiles#hydra
|
||||
```
|
||||
|
||||
You should also download the
|
||||
[FiraCode](https://github.com/ryanoasis/nerd-fonts/releases/download/v2.2.2/FiraCode.zip)
|
||||
font and install it on Windows. Install [Alacritty](https://alacritty.org/) and
|
||||
move the `windows/alacritty.yml` file to
|
||||
`C:\Users\<user>\AppData\Roaming\alacritty`.
|
||||
|
||||
## macOS
|
||||
|
||||
To get started on a bare macOS installation, first install Nix:
|
||||
|
||||
```bash
|
||||
sh -c "$(curl -L https://nixos.org/nix/install)"
|
||||
```
|
||||
|
||||
Then use Nix to build nix-darwin:
|
||||
|
||||
```bash
|
||||
nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer
|
||||
./result/bin/darwin-installer
|
||||
```
|
||||
|
||||
Then switch to the macOS configuration:
|
||||
|
||||
```bash
|
||||
darwin-rebuild switch --flake github:nmasur/dotfiles#lookingglass
|
||||
```
|
||||
|
132
flake.lock
generated
132
flake.lock
generated
@ -3,11 +3,11 @@
|
||||
"Comment-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1674040818,
|
||||
"narHash": "sha256-7UtZAE9tPlnpeHS2LLol/LGVOxptDXNKWXHNHvFBNk4=",
|
||||
"lastModified": 1678452935,
|
||||
"narHash": "sha256-mVJJJ9fUJYgVyGZnW8e6P5QWB0K8nuhTwSWzlBvxv2M=",
|
||||
"owner": "numToStr",
|
||||
"repo": "Comment.nvim",
|
||||
"rev": "eab2c83a0207369900e92783f56990808082eac2",
|
||||
"rev": "8d3aa5c22c2d45e788c7a5fe13ad77368b783c20",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -19,11 +19,11 @@
|
||||
"bufferline-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1676130961,
|
||||
"narHash": "sha256-3LT45i0eSMfUV9EBrtdtzHxFKRATIhRy/faDd3lI3mA=",
|
||||
"lastModified": 1677796018,
|
||||
"narHash": "sha256-tuGitJQ2eXB9/SIHAyPrEVgy2n++GOlBOPLvFv3Ds4E=",
|
||||
"owner": "akinsho",
|
||||
"repo": "bufferline.nvim",
|
||||
"rev": "84b0822b2af478d0b4f7b0f9249ca218855331db",
|
||||
"rev": "3677aceb9a72630b0613e56516c8f7151b86f95c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -76,11 +76,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1677116397,
|
||||
"narHash": "sha256-2OHwhv4k1SDEuNxhq+zluvrd5pbW8d4TP9NKW4B8iO8=",
|
||||
"lastModified": 1678912468,
|
||||
"narHash": "sha256-oUo6ZrsuqymuMLLvGfgnQ464OMKnUONv+ryea07iGrE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "disko",
|
||||
"rev": "8fddb2fd721365fa77ff68b709539639d4dc65d7",
|
||||
"rev": "e8650fc36bf9d2acb411ba0047f863b8e481e3bb",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -94,11 +94,11 @@
|
||||
"nixpkgs": "nixpkgs"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1676854489,
|
||||
"narHash": "sha256-hWmx3JFLNPGMtflyjgEn5GZydbLW3msjXvarS1NsBDM=",
|
||||
"lastModified": 1679446046,
|
||||
"narHash": "sha256-CBjVE3Sj7Ls1pffxGavqPXRkaLYy1+O88NzBwNdgNcY=",
|
||||
"owner": "bandithedoge",
|
||||
"repo": "nixpkgs-firefox-darwin",
|
||||
"rev": "6a5cca0ea8dfab4718e1e43e243c80ba110c2364",
|
||||
"rev": "1531f1477881e76c67b123a55f3d44ed7f83a4ba",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -125,11 +125,11 @@
|
||||
},
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1667395993,
|
||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||
"lastModified": 1676283394,
|
||||
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -155,11 +155,11 @@
|
||||
},
|
||||
"flake-utils_3": {
|
||||
"locked": {
|
||||
"lastModified": 1667395993,
|
||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||
"lastModified": 1676283394,
|
||||
"narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||
"rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -176,11 +176,11 @@
|
||||
"utils": "utils"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1678271387,
|
||||
"narHash": "sha256-H2dv/i1LRlunRtrESirELzfPWdlG/6ElDB1ksO529H4=",
|
||||
"lastModified": 1679067095,
|
||||
"narHash": "sha256-G2dJQURL/CCi+8RP6jNJG8VqgtzEMCA+6mNodd3VR6E=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "36999b8d19eb6eebb41983ef017d7e0095316af2",
|
||||
"rev": "3239e0b40f242f47bf6c0c37b2fd35ab3e76e370",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -197,11 +197,11 @@
|
||||
"rust-overlay": "rust-overlay"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1676110678,
|
||||
"narHash": "sha256-hemg8rMKS2me2Wua9ZG/0aQ8fEOfytjyKB+WYcXfEKE=",
|
||||
"lastModified": 1678728829,
|
||||
"narHash": "sha256-KbA8uakGfjfvRH+Td/VegiLdHrnqIZHkMTQ5XBjL2dE=",
|
||||
"owner": "oxalica",
|
||||
"repo": "nil",
|
||||
"rev": "ce2e0b5d60fe497134050796f7d12ffb6b50eb28",
|
||||
"rev": "e7045f1779fd202a3316f84b864c304f339cccea",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -233,11 +233,11 @@
|
||||
},
|
||||
"nixlib": {
|
||||
"locked": {
|
||||
"lastModified": 1636849918,
|
||||
"narHash": "sha256-nzUK6dPcTmNVrgTAC1EOybSMsrcx+QrVPyqRdyKLkjA=",
|
||||
"lastModified": 1677373009,
|
||||
"narHash": "sha256-kxhz4QUP8tXa/yVSpEzDDZSEp9FvhzRqZzb+SeUaekw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixpkgs.lib",
|
||||
"rev": "28a5b0557f14124608db68d3ee1f77e9329e9dd5",
|
||||
"rev": "c9d4f2476046c6a7a2ce3c2118c48455bf0272ea",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -254,11 +254,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1674666581,
|
||||
"narHash": "sha256-KNI2s/xrL7WOYaPJAWKBtb7cCH3335rLfsL+B+ssuGY=",
|
||||
"lastModified": 1678351966,
|
||||
"narHash": "sha256-tRFEU0lu3imZb3dtELBY+UbEhWXbb0xlBrsIlpICb+A=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-generators",
|
||||
"rev": "6a5dc1d3d557ea7b5c19b15ff91955124d0400fa",
|
||||
"rev": "0c043999b16caba6fb571af2d228775729829943",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -285,11 +285,11 @@
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1675309347,
|
||||
"narHash": "sha256-D3CQ6HRDT2m3XJlrzb5jKq4vNFR5xFTEFKC7iSjlFpM=",
|
||||
"lastModified": 1678298120,
|
||||
"narHash": "sha256-iaV5xqgn29xy765Js3EoZePQyZIlLZA3pTYtTnKkejg=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "006c3bd4dd2f5d1d2094047f307cbf9e2b73d9c5",
|
||||
"rev": "1e383aada51b416c6c27d4884d2e258df201bc11",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -301,11 +301,11 @@
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1676885936,
|
||||
"narHash": "sha256-ZRKb6zBfTvdCOXI7nGC1L9UWSU5ay2ltxg+f5UIzBOU=",
|
||||
"lastModified": 1679262748,
|
||||
"narHash": "sha256-DQCrrAFrkxijC6haUzOC5ZoFqpcv/tg2WxnyW3np1Cc=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b69883faca9542d135fa6bab7928ff1b233c167f",
|
||||
"rev": "60c1d71f2ba4c80178ec84523c2ca0801522e0a6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -317,11 +317,11 @@
|
||||
},
|
||||
"nixpkgs_4": {
|
||||
"locked": {
|
||||
"lastModified": 1674868155,
|
||||
"narHash": "sha256-eFNm2h6fNbgD7ZpO4MHikCB5pSnCJ7DTmwPisjetmwc=",
|
||||
"lastModified": 1677779205,
|
||||
"narHash": "sha256-6DBjL9wjq86p2GczmwnHtFRnWPBPItc67gapWENBgX8=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ce20e9ebe1903ea2ba1ab006ec63093020c761cb",
|
||||
"rev": "96e18717904dfedcd884541e5a92bf9ff632cf39",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -334,11 +334,11 @@
|
||||
"null-ls-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1676246878,
|
||||
"narHash": "sha256-hAUEa2zNsYXQ+TsHYHBzcW67lCxhiD7x+uPbdOZwY8o=",
|
||||
"lastModified": 1679325581,
|
||||
"narHash": "sha256-ixhy8qgP2GEPqrMdI+GsHzeHxESwhRw6cjf5hcpwP1w=",
|
||||
"owner": "jose-elias-alvarez",
|
||||
"repo": "null-ls.nvim",
|
||||
"rev": "d4594231a06cecce73a78a256b0d7c7ab51f7dd5",
|
||||
"rev": "13dd1fc13063681ca7e039436c88f6eca7e3e937",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -349,11 +349,11 @@
|
||||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1676251563,
|
||||
"narHash": "sha256-itLKR2Haeh5wQ6dxkuZ8L5gwp3+CAggpN+w2e7cLQPg=",
|
||||
"lastModified": 1679482366,
|
||||
"narHash": "sha256-88K2ABCsdsVwq6Go/uEn/fds1fUeeeoixOALjrrUI0Q=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nur",
|
||||
"rev": "9a8b28a9d6611f6af9f7abb3e690fc755d6906fe",
|
||||
"rev": "e9088dc6f9f289fbff984744ad04dccbd5c1f8ac",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -365,11 +365,11 @@
|
||||
"nvim-lspconfig-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1676175675,
|
||||
"narHash": "sha256-Wg3NatT4DRBMF6hCxK4C2DC+geFMpfFUFogPbqeMt6E=",
|
||||
"lastModified": 1679319980,
|
||||
"narHash": "sha256-UQ/Zng1/9rXRnQeAjemA21qfCltmZRq9QekQ0vGYlX8=",
|
||||
"owner": "neovim",
|
||||
"repo": "nvim-lspconfig",
|
||||
"rev": "1712672e4da3003a0dd9f771d30389600b360f42",
|
||||
"rev": "0f94c5fded29c0024254259f3d8a0284bfb507ea",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -381,11 +381,11 @@
|
||||
"nvim-tree-lua-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1676244722,
|
||||
"narHash": "sha256-xoSekdZhWr59qTOM0/ihYiuKiwHiKYb42Ep5JHn65UM=",
|
||||
"lastModified": 1678748807,
|
||||
"narHash": "sha256-u9ZLBL4FY/bkvl4+ofKifyEHM9+KhqeYovhr9VQYG7c=",
|
||||
"owner": "kyazdani42",
|
||||
"repo": "nvim-tree.lua",
|
||||
"rev": "ba1778e061f25814bc5940be886a7f41d7d7736e",
|
||||
"rev": "1d79a64a88af47ddbb55f4805ab537d11d5b908e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -397,11 +397,11 @@
|
||||
"nvim-treesitter-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1676240774,
|
||||
"narHash": "sha256-eRSU/9ysSvTyYxBrp9Whg0eXgAOsCdmIHMlYZK7bjRg=",
|
||||
"lastModified": 1679482116,
|
||||
"narHash": "sha256-SofmIKv/zGsocOBEbmzOraTE0GuLDjrJB2gZhKCz8ok=",
|
||||
"owner": "nvim-treesitter",
|
||||
"repo": "nvim-treesitter",
|
||||
"rev": "7eb5f1a2e3949496f26c4084b521b30f2d08137a",
|
||||
"rev": "dbdbd71b41a3627e0f2784eff746ad4366e2a21c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -447,11 +447,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1675391458,
|
||||
"narHash": "sha256-ukDKZw922BnK5ohL9LhwtaDAdCsJL7L6ScNEyF1lO9w=",
|
||||
"lastModified": 1678415622,
|
||||
"narHash": "sha256-tems1jHETCYEen8QrW61yVVX0F4zOGy4ImB43iDc7bY=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "383a4acfd11d778d5c2efcf28376cbd845eeaedf",
|
||||
"rev": "9f687941160108f89dd8bd2c650d32c15a35c7c7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -463,11 +463,11 @@
|
||||
"telescope-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1675149856,
|
||||
"narHash": "sha256-L4Kw94CUy6N7zcyy9INuR/O0fxQ7sp0IvGd/u7fHxMA=",
|
||||
"lastModified": 1677414372,
|
||||
"narHash": "sha256-QmyVJ/LZFtb/qqD5Q5fHsqAGgqaOT9XkVoLyOcqM14w=",
|
||||
"owner": "nvim-telescope",
|
||||
"repo": "telescope.nvim",
|
||||
"rev": "203bf5609137600d73e8ed82703d6b0e320a5f36",
|
||||
"rev": "a3f17d3baf70df58b9d3544ea30abe52a7a832c2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -495,11 +495,11 @@
|
||||
"toggleterm-nvim-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1675358836,
|
||||
"narHash": "sha256-9O7p/7tRStg51OFhMc88M5ewYquiYC9x9CV4s5veVP8=",
|
||||
"lastModified": 1678645191,
|
||||
"narHash": "sha256-nK9eUHeFjZtUPC4cOCILg7J54rDHGI52AIXX5j7E4rE=",
|
||||
"owner": "akinsho",
|
||||
"repo": "toggleterm.nvim",
|
||||
"rev": "19aad0f41f47affbba1274f05e3c067e6d718e1e",
|
||||
"rev": "c8e982ad2739eeb0b13d0fecb14820c9bf5e3da0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@ -546,11 +546,11 @@
|
||||
"nixpkgs": "nixpkgs_4"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1676126384,
|
||||
"narHash": "sha256-3aAnN891Cb1pizewAgaHIo3W1WbAjXtoWuX8n3j8YoI=",
|
||||
"lastModified": 1678648312,
|
||||
"narHash": "sha256-aY3CBNyenTUkStQhwigm30+BjXQyA8rCChGD+Z98qqE=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"rev": "a1c7e8bebac32cfac7aa8498bdfc60cbff13eb50",
|
||||
"rev": "c6f663e8583912059605b55c07583b6e96b5e690",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
20
flake.nix
20
flake.nix
@ -16,7 +16,7 @@
|
||||
# Used for Windows Subsystem for Linux compatibility
|
||||
wsl.url = "github:nix-community/NixOS-WSL";
|
||||
|
||||
# Used for user packages
|
||||
# Used for user packages and dotfiles
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/master";
|
||||
inputs.nixpkgs.follows =
|
||||
@ -111,6 +111,8 @@
|
||||
gitName = fullName;
|
||||
gitEmail = "7386960+nmasur@users.noreply.github.com";
|
||||
mail.server = "noahmasur.com";
|
||||
mail.imapHost = "imap.purelymail.com";
|
||||
mail.smtpHost = "smtp.purelymail.com";
|
||||
dotfilesRepo = "git@github.com:nmasur/dotfiles";
|
||||
};
|
||||
|
||||
@ -119,6 +121,7 @@
|
||||
inputs.nur.overlay
|
||||
inputs.nix2vim.overlay
|
||||
(import ./overlays/neovim-plugins.nix inputs)
|
||||
(import ./overlays/lib.nix)
|
||||
(import ./overlays/calibre-web.nix)
|
||||
];
|
||||
|
||||
@ -131,6 +134,8 @@
|
||||
|
||||
in rec {
|
||||
|
||||
# Contains my full system builds, including home-manager
|
||||
# nixos-rebuild switch --flake .#tempest
|
||||
nixosConfigurations = {
|
||||
tempest = import ./hosts/tempest { inherit inputs globals overlays; };
|
||||
hydra = import ./hosts/hydra { inherit inputs globals overlays; };
|
||||
@ -138,6 +143,8 @@
|
||||
swan = import ./hosts/swan { inherit inputs globals overlays; };
|
||||
};
|
||||
|
||||
# Contains my full Mac system builds, including home-manager
|
||||
# darwin-rebuild switch --flake .#lookingglass
|
||||
darwinConfigurations = {
|
||||
lookingglass =
|
||||
import ./hosts/lookingglass { inherit inputs globals overlays; };
|
||||
@ -152,23 +159,24 @@
|
||||
darwinConfigurations.lookingglass.config.home-manager.users."Noah.Masur".home;
|
||||
};
|
||||
|
||||
# Disk formatting
|
||||
# Disk formatting, only used once
|
||||
diskoConfigurations = { root = import ./disks/root.nix; };
|
||||
|
||||
# Package servers into images with a generator
|
||||
# Other packages, such as system images or programs
|
||||
packages = forAllSystems (system: {
|
||||
|
||||
# Package servers into images with a generator
|
||||
aws = {
|
||||
"${system}" =
|
||||
import ./generators/aws { inherit inputs globals system overlays; };
|
||||
};
|
||||
|
||||
staff = {
|
||||
"${system}" = import ./generators/staff {
|
||||
inherit inputs globals system overlays;
|
||||
};
|
||||
};
|
||||
|
||||
# Package Neovim config into standalone package
|
||||
neovim = let pkgs = import nixpkgs { inherit system overlays; };
|
||||
in import ./modules/common/neovim/package {
|
||||
inherit pkgs;
|
||||
@ -178,6 +186,7 @@
|
||||
|
||||
});
|
||||
|
||||
# Programs that can be run by calling this flake
|
||||
apps = forAllSystems (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
@ -190,6 +199,7 @@
|
||||
};
|
||||
in import ./apps { inherit pkgs; });
|
||||
|
||||
# Development environments
|
||||
devShells = forAllSystems (system:
|
||||
let pkgs = import nixpkgs { inherit system overlays; };
|
||||
in {
|
||||
@ -199,6 +209,8 @@
|
||||
buildInputs = with pkgs; [ git stylua nixfmt shfmt shellcheck ];
|
||||
};
|
||||
|
||||
test = pkgs.mkShell { buildInputs = with pkgs; [ age ]; };
|
||||
|
||||
# Used for cloud and systems development and administration
|
||||
devops = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
|
10
hosts/README.md
Normal file
10
hosts/README.md
Normal file
@ -0,0 +1,10 @@
|
||||
# Hosts
|
||||
|
||||
| Host | Purpose |
|
||||
| --- | --- |
|
||||
| [flame](./flame/default.nix) | Oracle cloud server |
|
||||
| [hydra](./hydra/default.nix) | WSL config |
|
||||
| [lookingglass](./lookingglass/default.nix) | Work macOS |
|
||||
| [swan](./swan/default.nix) | Home NAS and server |
|
||||
| [tempest](./tempest/default.nix) | Desktop |
|
||||
|
@ -12,7 +12,7 @@ nixpkgs.lib.nixosSystem {
|
||||
./hardware-configuration.nix
|
||||
../../modules/common
|
||||
../../modules/nixos
|
||||
(removeAttrs globals [ "mail.server" ])
|
||||
globals
|
||||
wsl.nixosModules.wsl
|
||||
home-manager.nixosModules.home-manager
|
||||
disko.nixosModules.disko
|
||||
@ -42,6 +42,7 @@ nixpkgs.lib.nixosSystem {
|
||||
streamServer = "stream.masu.rs";
|
||||
nextcloudServer = "cloud.masu.rs";
|
||||
bookServer = "books.masu.rs";
|
||||
arrServer = "download.masu.rs";
|
||||
samba.enable = true;
|
||||
|
||||
backup.s3 = {
|
||||
|
@ -37,4 +37,20 @@
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||
hardware.cpu.amd.updateMicrocode =
|
||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
|
||||
hardware.fancontrol.enable = true;
|
||||
hardware.fancontrol.config = ''
|
||||
# Configuration file generated by pwmconfig, changes will be lost
|
||||
INTERVAL=10
|
||||
DEVPATH=hwmon0=devices/pci0000:00/0000:00:03.1/0000:06:00.0/0000:07:00.0/0000:08:00.0
|
||||
DEVNAME=hwmon0=amdgpu
|
||||
FCTEMPS=hwmon0/pwm1=hwmon0/temp1_input
|
||||
FCFANS= hwmon0/pwm1=hwmon0/fan1_input
|
||||
MINTEMP=hwmon0/pwm1=50
|
||||
MAXTEMP=hwmon0/pwm1=70
|
||||
MINSTART=hwmon0/pwm1=100
|
||||
MINSTOP=hwmon0/pwm1=10
|
||||
MINPWM=hwmon0/pwm1=10
|
||||
MAXPWM=hwmon0/pwm1=240
|
||||
'';
|
||||
}
|
||||
|
8
modules/README.md
Normal file
8
modules/README.md
Normal file
@ -0,0 +1,8 @@
|
||||
# Modules
|
||||
|
||||
| Module | Purpose |
|
||||
| --- | --- |
|
||||
| [common](./common/default.nix) | User programs and OS-agnostic configuration |
|
||||
| [darwin](./darwin/default.nix) | macOS-specific configuration |
|
||||
| [nixos](./nixos/default.nix) | NixOS-specific configuration |
|
||||
|
@ -10,9 +10,24 @@
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.gui.enable && config.kitty.enable) {
|
||||
|
||||
# Set the Rofi-Systemd terminal for viewing logs
|
||||
# Using optionalAttrs because only available in NixOS
|
||||
environment = { } // lib.attrsets.optionalAttrs
|
||||
(builtins.hasAttr "sessionVariables" config.environment) {
|
||||
sessionVariables.ROFI_SYSTEMD_TERM = "${pkgs.kitty}/bin/kitty";
|
||||
};
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
# xsession.windowManager.i3.config.terminal = "kitty";
|
||||
# programs.rofi.terminal = "${pkgs.kitty}/bin/kitty";
|
||||
|
||||
# Set the i3 terminal
|
||||
xsession.windowManager.i3.config.terminal =
|
||||
lib.mkIf pkgs.stdenv.isLinux "kitty";
|
||||
|
||||
# Set the Rofi terminal for running programs
|
||||
programs.rofi.terminal =
|
||||
lib.mkIf pkgs.stdenv.isLinux "${pkgs.kitty}/bin/kitty";
|
||||
|
||||
programs.kitty = {
|
||||
enable = true;
|
||||
environment = { };
|
||||
|
@ -12,22 +12,29 @@
|
||||
config = lib.mkIf (config.gui.enable && config.media.enable) {
|
||||
home-manager.users.${config.user} = {
|
||||
home.packages = with pkgs; [
|
||||
mpv # Video viewer
|
||||
sxiv # Image viewer
|
||||
nsxiv # Image viewer
|
||||
mupdf # PDF viewer
|
||||
zathura # PDF viewer
|
||||
];
|
||||
|
||||
# Video player
|
||||
programs.mpv = {
|
||||
enable = true;
|
||||
bindings = { };
|
||||
config = { image-display-duration = 2; };
|
||||
scripts = [ pkgs.mpvScripts.autoload ];
|
||||
};
|
||||
|
||||
# Set default for opening PDFs
|
||||
xdg.mimeApps = {
|
||||
associations.added = {
|
||||
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||
"image/*" = [ "sxiv.desktop" ];
|
||||
"image/*" = [ "nsxiv.desktop" ];
|
||||
};
|
||||
associations.removed = { "application/pdf" = [ "mupdf.desktop" ]; };
|
||||
defaultApplications = {
|
||||
"application/pdf" = [ "pwmt.zathura-cb.desktop" ];
|
||||
"image/*" = [ "sxiv.desktop" ];
|
||||
"image/*" = [ "nsxiv.desktop" ];
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -44,11 +44,6 @@
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
# colorscheme = lib.mkOption {
|
||||
# type = types.attrs;
|
||||
# description = "Base16 color scheme";
|
||||
# };
|
||||
homePath = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Path of user's home directory.";
|
||||
@ -57,7 +52,6 @@
|
||||
else
|
||||
"/home/${config.user}");
|
||||
};
|
||||
|
||||
dotfilesPath = lib.mkOption {
|
||||
type = lib.types.path;
|
||||
description = "Path of dotfiles repository.";
|
||||
@ -95,7 +89,8 @@
|
||||
];
|
||||
|
||||
# Scans and hard links identical files in the store
|
||||
auto-optimise-store = true;
|
||||
# Not working with macOS: https://github.com/NixOS/nix/issues/7273
|
||||
auto-optimise-store = lib.mkIf (!pkgs.stdenv.isDarwin) true;
|
||||
|
||||
};
|
||||
|
||||
|
@ -170,6 +170,8 @@
|
||||
"${pkgs.gawk}/bin/awk -f ${pkgs.aerc}/share/aerc/filters/colorize";
|
||||
"application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh";
|
||||
"application/pdf" = "${pkgs.zathura}/bin/zathura -";
|
||||
"audio/*" = "${pkgs.mpv}/bin/mpv -";
|
||||
"image/*" = "${pkgs.feh}/bin/feh -";
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -181,6 +183,17 @@
|
||||
};
|
||||
};
|
||||
|
||||
xdg.desktopEntries.aerc = lib.mkIf pkgs.stdenv.isLinux {
|
||||
name = "aerc";
|
||||
exec = "kitty aerc %u";
|
||||
};
|
||||
xsession.windowManager.i3.config.keybindings =
|
||||
lib.mkIf pkgs.stdenv.isLinux {
|
||||
"${
|
||||
config.home-manager.users.${config.user}.xsession.windowManager.i3.config.modifier
|
||||
}+Shift+e" = "exec --no-startup-id kitty aerc";
|
||||
};
|
||||
|
||||
programs.fish.shellAbbrs = { ae = "aerc"; };
|
||||
|
||||
};
|
||||
|
@ -10,9 +10,17 @@
|
||||
default = config.user;
|
||||
};
|
||||
mail.server = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Server name for the email address.";
|
||||
};
|
||||
mail.imapHost = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Server host for IMAP (reading mail).";
|
||||
};
|
||||
mail.smtpHost = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Server host for SMTP (sending mail).";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.mail.enable {
|
||||
@ -42,7 +50,7 @@
|
||||
folders = { };
|
||||
getmail = { };
|
||||
imap = {
|
||||
host = "imap.purelymail.com";
|
||||
host = config.mail.imapHost;
|
||||
port = 993;
|
||||
tls.enable = true;
|
||||
};
|
||||
@ -55,9 +63,9 @@
|
||||
maildir = { path = "main"; };
|
||||
mbsync = {
|
||||
enable = true;
|
||||
create = "maildir";
|
||||
expunge = "none";
|
||||
remove = "none";
|
||||
create = "both";
|
||||
expunge = "both";
|
||||
remove = "both";
|
||||
patterns = [ "*" ];
|
||||
extraConfig.channel = {
|
||||
CopyArrivalDate = "yes"; # Sync time of original message
|
||||
@ -70,7 +78,7 @@
|
||||
builtins.toString ../../../private/mailpass.age
|
||||
}";
|
||||
smtp = {
|
||||
host = "smtp.purelymail.com";
|
||||
host = config.mail.smtpHost;
|
||||
port = 465;
|
||||
tls.enable = true;
|
||||
};
|
||||
|
20
modules/common/shell/bash/default.nix
Normal file
20
modules/common/shell/bash/default.nix
Normal file
@ -0,0 +1,20 @@
|
||||
{ config, pkgs, lib, ... }: {
|
||||
|
||||
config = {
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
shellAliases =
|
||||
config.home-manager.users.${config.user}.programs.fish.shellAliases;
|
||||
initExtra = "";
|
||||
profileExtra = "";
|
||||
};
|
||||
|
||||
programs.starship.enableBashIntegration = false;
|
||||
programs.zoxide.enableBashIntegration = true;
|
||||
programs.fzf.enableBashIntegration = true;
|
||||
|
||||
};
|
||||
};
|
||||
}
|
@ -1,5 +1,6 @@
|
||||
{ ... }: {
|
||||
imports = [
|
||||
./bash
|
||||
./charm.nix
|
||||
./direnv.nix
|
||||
./fish
|
||||
|
@ -76,7 +76,6 @@
|
||||
set -g fish_cursor_replace_one underscore
|
||||
'';
|
||||
loginShellInit = "";
|
||||
shellAliases = { };
|
||||
shellAbbrs = {
|
||||
|
||||
# Directory aliases
|
||||
|
@ -18,21 +18,22 @@ in {
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.packages = with pkgs; [
|
||||
unzip # Extract zips
|
||||
age # Encryption
|
||||
bc # Calculator
|
||||
dig # DNS lookup
|
||||
fd # find
|
||||
htop # Show system processes
|
||||
inetutils # Includes telnet, whois
|
||||
jq # JSON manipulation
|
||||
lf # File viewer
|
||||
qrencode # Generate qr codes
|
||||
rsync # Copy folders
|
||||
ripgrep # grep
|
||||
fd # find
|
||||
sd # sed
|
||||
jq # JSON manipulation
|
||||
tealdeer # Cheatsheets
|
||||
tree # View directory hierarchy
|
||||
htop # Show system processes
|
||||
qrencode # Generate qr codes
|
||||
vimv-rs # Batch rename files
|
||||
dig # DNS lookup
|
||||
lf # File viewer
|
||||
inetutils # Includes telnet, whois
|
||||
age # Encryption
|
||||
unzip # Extract zips
|
||||
];
|
||||
|
||||
programs.zoxide.enable = true; # Shortcut jump command
|
||||
|
@ -90,6 +90,7 @@ function obj:init()
|
||||
self:switch("System Preferences.app")
|
||||
end)
|
||||
self.launcher:bind("", "R", function()
|
||||
hs.console.clearConsole()
|
||||
hs.reload()
|
||||
end)
|
||||
self.launcher:bind("", "S", function()
|
||||
|
@ -1,19 +1,6 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
let
|
||||
|
||||
# Quickly package shell scripts with their dependencies
|
||||
# From https://discourse.nixos.org/t/how-to-create-a-script-with-dependencies/7970/6
|
||||
mkScript = { name, file, env ? [ ] }:
|
||||
pkgs.writeScriptBin name ''
|
||||
for i in ${lib.concatStringsSep " " env}; do
|
||||
export PATH="$i/bin:$PATH"
|
||||
done
|
||||
|
||||
exec ${pkgs.bash}/bin/bash ${file} $@
|
||||
'';
|
||||
|
||||
in {
|
||||
{
|
||||
|
||||
home-manager.users.${config.user} = lib.mkIf pkgs.stdenv.isDarwin {
|
||||
|
||||
@ -32,7 +19,7 @@ in {
|
||||
consul
|
||||
noti # Create notifications programmatically
|
||||
ipcalc # Make IP network calculations
|
||||
(mkScript {
|
||||
(pkgs.extraLib.mkScript {
|
||||
name = "ocr";
|
||||
file = ../../modules/common/shell/bash/scripts/ocr.sh;
|
||||
env = [ tesseract ];
|
||||
|
@ -10,8 +10,8 @@ in {
|
||||
config = lib.mkIf config.gaming.legendary.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
legendary-gl
|
||||
rare # GUI for Legendary (not working)
|
||||
wineWowPackages.stable # 32-bit and 64-bit wineWowPackages, see https://nixos.wiki/wiki/Wine
|
||||
heroic # GUI launcher
|
||||
];
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
@ -17,6 +17,10 @@
|
||||
type = lib.types.str;
|
||||
description = "Command to use for choosing windows";
|
||||
};
|
||||
audioSwitchCommand = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Command to use for switching audio sink";
|
||||
};
|
||||
toggleBarCommand = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
description = "Command to hide and show the status bar.";
|
||||
|
@ -112,6 +112,8 @@ in {
|
||||
"exec --no-startup-id ${config.launcherCommand}";
|
||||
"${modifier}+Shift+s" =
|
||||
"exec --no-startup-id ${config.systemdSearch}";
|
||||
"${modifier}+Shift+a" =
|
||||
"exec --no-startup-id ${config.audioSwitchCommand}";
|
||||
"Mod1+Tab" = "exec --no-startup-id ${config.altTabCommand}";
|
||||
"${modifier}+Shift+c" = "reload";
|
||||
"${modifier}+Shift+r" = "restart";
|
||||
|
@ -1,9 +1,17 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
let
|
||||
|
||||
rofi = config.home-manager.users.${config.user}.programs.rofi.finalPackage;
|
||||
|
||||
in {
|
||||
|
||||
config = lib.mkIf (pkgs.stdenv.isLinux && config.services.xserver.enable) {
|
||||
|
||||
# Set the Rofi-Systemd terminal for viewing logs
|
||||
environment.sessionVariables.ROFI_SYSTEMD_TERM =
|
||||
lib.mkIf config.kitty.enable "${pkgs.kitty}/bin/kitty";
|
||||
|
||||
home-manager.users.${config.user} = {
|
||||
|
||||
home.packages = with pkgs;
|
||||
@ -144,10 +152,16 @@
|
||||
|
||||
};
|
||||
|
||||
launcherCommand = "${pkgs.rofi}/bin/rofi -show run -modi run";
|
||||
launcherCommand = "${rofi}/bin/rofi -modes drun -show drun";
|
||||
systemdSearch = "${pkgs.rofi-systemd}/bin/rofi-systemd";
|
||||
altTabCommand = "${pkgs.rofi}/bin/rofi -show window -modi window";
|
||||
|
||||
altTabCommand = "${rofi}/bin/rofi -show window -modi window";
|
||||
audioSwitchCommand = "${
|
||||
(pkgs.extraLib.mkScript {
|
||||
name = "switch-audio";
|
||||
file = ./rofi/pulse-sink.sh;
|
||||
env = [ pkgs.ponymix rofi ];
|
||||
})
|
||||
}/bin/switch-audio";
|
||||
};
|
||||
|
||||
}
|
||||
|
15
modules/nixos/graphical/rofi/pulse-sink.sh
Executable file
15
modules/nixos/graphical/rofi/pulse-sink.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Credit: https://gist.github.com/Nervengift/844a597104631c36513c
|
||||
|
||||
sink=$(
|
||||
ponymix -t sink list |
|
||||
awk '/^sink/ {s=$1" "$2;getline;gsub(/^ +/,"",$0);print s" "$0}' |
|
||||
rofi -dmenu -p 'pulseaudio sink:' -location 6 -width 100 -theme-str 'inputbar { enabled: false; }' |
|
||||
grep -Po '[0-9]+(?=:)'
|
||||
) &&
|
||||
ponymix set-default -d "$sink" &&
|
||||
for input in $(ponymix list -t sink-input | grep -Po '[0-9]+(?=:)'); do
|
||||
echo "$input -> $sink"
|
||||
ponymix -t sink-input -d "$input" move "$sink"
|
||||
done
|
@ -1,15 +1,22 @@
|
||||
{ ... }: {
|
||||
{ config, ... }: {
|
||||
|
||||
services.xserver = {
|
||||
config = {
|
||||
|
||||
layout = "us";
|
||||
services.xserver = {
|
||||
|
||||
# Keyboard responsiveness
|
||||
autoRepeatDelay = 250;
|
||||
autoRepeatInterval = 40;
|
||||
layout = "us";
|
||||
|
||||
# Swap escape key with caps lock key
|
||||
xkbOptions = "eurosign:e,caps:swapescape";
|
||||
# Keyboard responsiveness
|
||||
autoRepeatDelay = 250;
|
||||
autoRepeatInterval = 40;
|
||||
|
||||
# Swap escape key with caps lock key
|
||||
xkbOptions = "eurosign:e,caps:swapescape";
|
||||
|
||||
};
|
||||
|
||||
# Enable num lock on login
|
||||
home-manager.users.${config.user}.xsession.numlock.enable = true;
|
||||
|
||||
};
|
||||
|
||||
|
74
modules/nixos/services/arr.nix
Normal file
74
modules/nixos/services/arr.nix
Normal file
@ -0,0 +1,74 @@
|
||||
{ config, lib, ... }: {
|
||||
|
||||
options = {
|
||||
arrServer = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
description = "Hostname for arr services";
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf (config.arrServer != null) {
|
||||
|
||||
services.sonarr.enable = true;
|
||||
services.radarr.enable = true;
|
||||
services.bazarr.enable = true;
|
||||
services.prowlarr.enable = true;
|
||||
|
||||
# Grant users access to destination directories
|
||||
users.users.sonarr.extraGroups = [ "jellyfin" ];
|
||||
users.users.radarr.extraGroups = [ "jellyfin" ];
|
||||
users.users.bazarr.extraGroups = [ "jellyfin" ];
|
||||
|
||||
# Requires updating the base_url config value in each service
|
||||
# If you try to rewrite the URL, the service won't redirect properly
|
||||
caddy.routes = [
|
||||
{
|
||||
group = "download";
|
||||
match = [{
|
||||
host = [ config.arrServer ];
|
||||
path = [ "/sonarr*" ];
|
||||
}];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:8989"; }];
|
||||
}];
|
||||
}
|
||||
{
|
||||
group = "download";
|
||||
match = [{
|
||||
host = [ config.arrServer ];
|
||||
path = [ "/radarr*" ];
|
||||
}];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:7878"; }];
|
||||
}];
|
||||
}
|
||||
{
|
||||
group = "download";
|
||||
match = [{
|
||||
host = [ config.arrServer ];
|
||||
path = [ "/prowlarr*" ];
|
||||
}];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:9696"; }];
|
||||
}];
|
||||
}
|
||||
{
|
||||
group = "download";
|
||||
match = [{
|
||||
host = [ config.arrServer ];
|
||||
path = [ "/bazarr*" ];
|
||||
}];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
upstreams = [{ dial = "localhost:6767"; }];
|
||||
}];
|
||||
}
|
||||
];
|
||||
|
||||
};
|
||||
|
||||
}
|
@ -24,6 +24,16 @@
|
||||
listen = [ ":443" ];
|
||||
routes = config.caddy.routes;
|
||||
errors.routes = config.caddy.blocks;
|
||||
# logs = { }; # Uncomment to collect access logs
|
||||
};
|
||||
logging.logs.main = {
|
||||
encoder = { format = "console"; };
|
||||
writer = {
|
||||
output = "file";
|
||||
filename = "${config.services.caddy.logDir}/caddy.log";
|
||||
roll = true;
|
||||
};
|
||||
level = "INFO";
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -41,6 +41,9 @@ in {
|
||||
}];
|
||||
}];
|
||||
|
||||
# Grant user access to Calibre directories
|
||||
users.users.${config.user}.extraGroups = [ "calibre-web" ];
|
||||
|
||||
# Run a backup on a schedule
|
||||
systemd.timers.calibre-backup = lib.mkIf config.backups.calibre {
|
||||
timerConfig = {
|
||||
|
@ -1,6 +1,7 @@
|
||||
{ ... }: {
|
||||
|
||||
imports = [
|
||||
./arr.nix
|
||||
./backups.nix
|
||||
./caddy.nix
|
||||
./calibre.nix
|
||||
|
@ -41,7 +41,9 @@
|
||||
};
|
||||
|
||||
# Create reverse proxy for web UI
|
||||
caddy.routes = [{
|
||||
caddy.routes = lib.mkAfter [{
|
||||
group =
|
||||
lib.mkIf (config.arrServer == config.transmissionServer) "download";
|
||||
match = [{ host = [ config.transmissionServer ]; }];
|
||||
handle = [{
|
||||
handler = "reverse_proxy";
|
||||
|
16
overlays/lib.nix
Normal file
16
overlays/lib.nix
Normal file
@ -0,0 +1,16 @@
|
||||
_final: prev: {
|
||||
extraLib = prev.lib // {
|
||||
|
||||
# Quickly package shell scripts with their dependencies
|
||||
# From https://discourse.nixos.org/t/how-to-create-a-script-with-dependencies/7970/6
|
||||
mkScript = { name, file, env ? [ ] }:
|
||||
prev.pkgs.writeScriptBin name ''
|
||||
for i in ${prev.lib.concatStringsSep " " env}; do
|
||||
export PATH="$i/bin:$PATH"
|
||||
done
|
||||
|
||||
exec ${prev.pkgs.bash}/bin/bash ${file} $@
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
Reference in New Issue
Block a user