Compare commits
282 commits
Author | SHA1 | Date | |
---|---|---|---|
|
cc57e70de5 | ||
|
d230f9fabe | ||
|
1bc2b60d6a | ||
|
640c3aec06 | ||
|
b05864573d | ||
|
dc1b120c50 | ||
|
fdea25896e | ||
|
13abafb1b2 | ||
|
f793e546f6 | ||
|
9c91d8634f | ||
|
7600d2f4cf | ||
|
b28f07d9db | ||
|
fc98b6020d | ||
|
3412b79c1b | ||
|
c6dea3b93d | ||
|
423553b292 | ||
|
de44eef38d | ||
|
7a78e34479 | ||
|
a29dd7f1d2 | ||
|
52242e645a | ||
|
2a8eb46b03 | ||
|
4fb8fab641 | ||
|
efb2ae0425 | ||
|
35645b93a6 | ||
|
79c293f29f | ||
|
23ee3bfab9 | ||
|
8242426c66 | ||
|
49aa21cf32 | ||
|
3a4100cb28 | ||
|
61b3fc2c75 | ||
|
04f5aa0f4b | ||
|
185ce55dbc | ||
|
ac15f698b0 | ||
|
4405ad4bf9 | ||
|
b1db2f2f85 | ||
|
9a7659814c | ||
|
ce25e44e57 | ||
|
128bad02f3 | ||
|
f4473b23b4 | ||
|
b063022753 | ||
|
011b80e760 | ||
|
2413c5b74f | ||
|
1bb3f8e5e1 | ||
|
a69f665865 | ||
|
d6998d84d0 | ||
|
5712f36177 | ||
|
16c948d70e | ||
|
aae39388b2 | ||
|
bf0eb1bb86 | ||
|
045eb7bb00 | ||
|
8319e4b87b | ||
|
7e7dde4c6f | ||
|
702f0a4d64 | ||
|
2ceaaeff76 | ||
|
724ced18f1 | ||
|
261efa8768 | ||
|
df6fc2d165 | ||
|
2789cbed33 | ||
|
4a2ba58cd4 | ||
|
e11914aa08 | ||
|
261f1f0f34 | ||
|
686d459f9c | ||
|
85a3c28438 | ||
|
c119757766 | ||
|
fc712b5223 | ||
|
c928cc2a86 | ||
|
eb36ad141b | ||
|
a504df00e9 | ||
|
27f1d01f31 | ||
|
a793ff8a13 | ||
|
22267e6c2e | ||
|
e581ce4582 | ||
|
4a396a28cc | ||
|
ba8c00497d | ||
|
3efa0d6230 | ||
|
917e5ae3fc | ||
|
beee9a7521 | ||
|
965466bf7e | ||
|
87d99ffbb2 | ||
|
1d0bc7a680 | ||
|
7c396e7615 | ||
|
b16a3b499c | ||
|
cb6a5f62f8 | ||
|
f9113c5334 | ||
|
8abca33123 | ||
|
dfcb1411fa | ||
|
32113a2b75 | ||
|
c98d947c26 | ||
|
09fa6eba73 | ||
|
b37246474c | ||
|
638957dbb5 | ||
|
1b22a41415 | ||
|
b94a738734 | ||
|
42d8107399 | ||
|
ecbabde0bd | ||
|
eea2b60b91 | ||
|
d17a69372a | ||
|
927a3fbfb1 | ||
|
8912b55ff9 | ||
|
8ea8963d9c | ||
|
e8e534a4ad | ||
|
6ddeafa403 | ||
|
edac66e017 | ||
|
b869da9668 | ||
|
31c3cd5f7d | ||
|
bde58a622d | ||
|
cab5bfa648 | ||
|
f08e17f51b | ||
|
158f0a6813 | ||
|
7ea031e84e | ||
|
ef22af1ee9 | ||
|
a51db7b00f | ||
|
fe7b03dd4a | ||
|
14081936af | ||
|
bfc7e894bf | ||
|
29bc56e749 | ||
|
b27ca31c71 | ||
|
5a1d50cece | ||
|
d11b941ead | ||
|
df78fafcb9 | ||
|
5faee0c1b4 | ||
|
7b7b451ab1 | ||
|
1230f92f70 | ||
|
55e49ea248 | ||
|
d1d36e28c6 | ||
|
906a6ddf84 | ||
|
3d367b0230 | ||
|
1471de3400 | ||
|
80ab476c80 | ||
|
6be9d173b6 | ||
|
7893d37df5 | ||
|
a72a054632 | ||
|
bd5b0dcec8 | ||
|
60de780156 | ||
|
2fd1f95b79 | ||
|
b70dcb797d | ||
|
6fd17209c7 | ||
|
67671e5568 | ||
|
4da31089e7 | ||
|
1e448f8ae2 | ||
|
ac16dde84e | ||
|
a44d11d20c | ||
|
a59961171a | ||
|
8667fbe805 | ||
|
9efff85115 | ||
|
5fb5e08ebd | ||
|
e502c23c02 | ||
|
cd6c33ce9a | ||
|
a6c90f335c | ||
|
66d8dc24b9 | ||
|
d896a0e3f3 | ||
|
e4384c5434 | ||
|
0861880a20 | ||
|
7a52fc6beb | ||
|
8acc916117 | ||
|
5f9dca81e1 | ||
|
684b8a5c9e | ||
|
638430a8e3 | ||
|
682db6c529 | ||
|
8d04980e50 | ||
|
31a3cfcaca | ||
|
9a57b0b425 | ||
|
86772cf04d | ||
|
1c67489caa | ||
|
8b561153bc | ||
|
8f08976322 | ||
|
9ee721e52f | ||
|
9102eccddf | ||
|
e3dc44a511 | ||
|
550870728f | ||
|
c1e0932486 | ||
|
2326ea6bb9 | ||
|
4f4b1e5140 | ||
|
5eeb29677d | ||
|
4f473a4248 | ||
|
cefaec73be | ||
|
c1e85636ae | ||
|
117c517810 | ||
|
6942e77ed3 | ||
|
71066fad02 | ||
|
068a005108 | ||
|
69f6134563 | ||
|
b0323e5fe1 | ||
|
39fb08bc48 | ||
|
4f81012634 | ||
|
0a3464bb12 | ||
|
b034a294cb | ||
|
064b6b07f9 | ||
|
5c7aca6b4a | ||
|
9b749922ea | ||
|
772374b0fd | ||
|
c8f8dc98e6 | ||
|
0667f0f4c9 | ||
|
9c9945523c | ||
|
8ccc90c9f3 | ||
|
8deffb3adb | ||
|
6753c39ccd | ||
|
a7c57a6501 | ||
|
691faaaec3 | ||
|
ac2b846662 | ||
|
3348300ab7 | ||
|
7691490e00 | ||
|
ac9aa96522 | ||
|
551880cc24 | ||
|
63be8a848c | ||
|
d649c7cee5 | ||
|
e56ccb5a97 | ||
|
23acd9ef5d | ||
|
06e12f7bb1 | ||
|
9a9cfc13f6 | ||
|
384e0c24b3 | ||
|
0665c3bfae | ||
|
177f8555a3 | ||
|
3b6033da4f | ||
|
107f3a0e3e | ||
|
85473011b2 | ||
|
ac29acb446 | ||
|
595e3996c3 | ||
|
c738d4137f | ||
|
5285b166b2 | ||
|
b01190a532 | ||
|
bc4be97591 | ||
|
315a06dbf2 | ||
|
dfa762d46e | ||
|
f4618c3271 | ||
|
5fd6448ba2 | ||
|
1ca52dc2ae | ||
|
f2710d1c19 | ||
|
585d764720 | ||
|
2caeb6f438 | ||
|
e1d746b0f5 | ||
|
b12b2e2911 | ||
|
534fb9d449 | ||
|
31c3dbb205 | ||
|
b7b25ea3cc | ||
|
d625b740be | ||
|
40ee4f048c | ||
|
6cf090e2f2 | ||
|
bc1efb0d25 | ||
|
99545ac48e | ||
|
731b85c948 | ||
|
b6c4957043 | ||
|
d31502f1da | ||
|
a8ec0fcfff | ||
|
2af97f6b5a | ||
|
a1400a2335 | ||
|
7f8b1e586c | ||
|
bc18bbcf82 | ||
|
ea9ed3f8dc | ||
|
32e5e90b16 | ||
|
354ad470f4 | ||
|
ab6e7efc1c | ||
|
8eaf865994 | ||
|
4dd98e97c1 | ||
|
3b32b5c302 | ||
|
4e1ad1c8f6 | ||
|
bab5698f39 | ||
|
94ce797784 | ||
|
d98290a6e4 | ||
|
27ff75260d | ||
|
a676406150 | ||
|
639a623db3 | ||
|
2216e1414d | ||
|
aa7b215055 | ||
|
244fd6daad | ||
|
c93185e9e8 | ||
|
45119487c3 | ||
|
dd7b67e811 | ||
|
6881d583b7 | ||
|
d232f20334 | ||
|
50b1565bf5 | ||
|
c6d7ffa4b6 | ||
|
4bc6445a4c | ||
|
820729a03d | ||
|
118fac38a8 | ||
|
29d5cf6844 | ||
|
555d1db3ba | ||
|
d2a2878c11 | ||
|
3d03229682 | ||
|
9994dadd6f | ||
|
b1162ce7a8 | ||
|
974d231027 |
19
.gitignore
vendored
19
.gitignore
vendored
|
@ -1,9 +1,22 @@
|
|||
# Python
|
||||
*.egg-info
|
||||
*.temp
|
||||
|
||||
# NPM
|
||||
*node_modules/
|
||||
*types
|
||||
*build/
|
||||
|
||||
# Direnv
|
||||
*.direnv/
|
||||
|
||||
# Generated by nix
|
||||
result*
|
||||
.nixd.json
|
||||
|
||||
## AGS
|
||||
modules/ags/config/ts/lockscreen/vars.ts
|
||||
*config.js
|
||||
*icons
|
||||
*.direnv/
|
||||
**/types
|
||||
|
||||
# Other
|
||||
*.temp
|
||||
|
|
18
README.md
18
README.md
|
@ -44,12 +44,18 @@ sudo ln -sf /home/matt/.nix /etc/nixos
|
|||
| ---------------------------------- | ----------- |
|
||||
| `nixosConfigurations` | [devices](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/devices)' + ISO's configurations |
|
||||
| `nixOnDroidConfigurations.default` | [Nix-On-Droid](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/devices/android)'s configuration |
|
||||
| `formatter` | I have yet to know if this has any uses but I format with [alejandra](https://github.com/kamadorueda/alejandra) |
|
||||
| `packages` | Some custom [packages](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/pkgs) not available in nixpkgs or modified from it |
|
||||
| `legacyPackages` | Some custom [package scopes](https://git.nelim.org/matt1432/nixos-configs/src/branch/master/pkgs) not available in nixpkgs or modified from it |
|
||||
| `formatter` | I format nix code with [alejandra](https://github.com/kamadorueda/alejandra) |
|
||||
| `devShells.default` | A dev shell to build an ISO from the live-image nixosConfiguration |
|
||||
| `devShells.ags` | A dev shell to have a NodeJS env when I enter my AGS's config directory |
|
||||
|
||||
### Flake Inputs
|
||||
|
||||
I prefer using a more descriptive format for my inputs like so:
|
||||
To allow use of the full nix language for my inputs, I use [genflake](https://github.com/jorsn/flakegen).
|
||||
Therefore, the flake I edit is located at `./flake.in.nix`.
|
||||
|
||||
I also prefer using a more descriptive format for my inputs like so:
|
||||
|
||||
```nix
|
||||
nixpkgs = {
|
||||
|
@ -67,17 +73,11 @@ nixpkgs = {
|
|||
|
||||
to make it more clear what is what in the flake URI
|
||||
|
||||
I also have a long list of inputs with `flake = false;` because
|
||||
it makes it easier to update non-flake custom packages or overlays
|
||||
to have the latest git. I make sure to end the names of these inputs
|
||||
with `src` to make it clear what they are.
|
||||
|
||||
### Secrets
|
||||
|
||||
All my secrets are in a private git repo that makes use of
|
||||
[sops-nix](https://github.com/Mic92/sops-nix).
|
||||
I only use secrets stored in `JSON` and generate `.sops.yaml`
|
||||
from `.sops.nix`:
|
||||
I generate `.sops.yaml` from `.sops.nix`:
|
||||
|
||||
```nix
|
||||
let
|
||||
|
|
14
ci.nix
Normal file
14
ci.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
# CI: https://github.com/Mic92/dotfiles/blob/c2f538934d67417941f83d8bb65b8263c43d32ca/flake.nix#L168
|
||||
{
|
||||
system,
|
||||
pkgs,
|
||||
self,
|
||||
}: let
|
||||
inherit (pkgs.lib) filterAttrs mapAttrs' nameValuePair;
|
||||
|
||||
nixosMachines =
|
||||
mapAttrs'
|
||||
(name: config: nameValuePair "nixos-${name}" config.config.system.build.toplevel)
|
||||
((filterAttrs (_: config: config.pkgs.system == system)) self.nixosConfigurations);
|
||||
in
|
||||
nixosMachines
|
|
@ -2,43 +2,37 @@
|
|||
config,
|
||||
home-manager,
|
||||
lib,
|
||||
mozilla-addons-to-nix,
|
||||
nh,
|
||||
nix-melt,
|
||||
nur,
|
||||
nurl,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
} @ inputs: {
|
||||
imports = [
|
||||
./vars
|
||||
|
||||
./modules
|
||||
./pkgs
|
||||
|
||||
nur.nixosModules.nur
|
||||
nh.nixosModules.default
|
||||
home-manager.nixosModules.home-manager
|
||||
|
||||
../modules/arion
|
||||
../modules/borgbackup
|
||||
../modules/nvidia.nix
|
||||
];
|
||||
|
||||
nixpkgs = {
|
||||
config.allowUnfree = true;
|
||||
overlays = import ./overlays inputs;
|
||||
boot.tmp.useTmpfs = true;
|
||||
|
||||
systemd.services.nix-daemon = {
|
||||
environment.TMPDIR = "/home/nix-cache";
|
||||
preStart = ''
|
||||
mkdir -p ${config.systemd.services.nix-daemon.environment.TMPDIR}
|
||||
'';
|
||||
};
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
|
||||
nix = {
|
||||
# Allow deleting store files with '.' in the name
|
||||
package = pkgs.nix.overrideAttrs (o: {
|
||||
patches =
|
||||
(o.patches or [])
|
||||
++ [
|
||||
./overlays/nix/patch
|
||||
];
|
||||
});
|
||||
package = pkgs.nixVersions.nix_2_22;
|
||||
|
||||
# Edit nix.conf
|
||||
settings = {
|
||||
# Store
|
||||
|
@ -51,14 +45,17 @@
|
|||
http-connections = 0; # unlimited for local cache
|
||||
warn-dirty = false;
|
||||
show-trace = true;
|
||||
allow-import-from-derivation = true;
|
||||
|
||||
# remote building
|
||||
trusted-users = ["matt" "nixremote"];
|
||||
};
|
||||
};
|
||||
|
||||
nh = {
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
package = nh.packages.${pkgs.system}.default;
|
||||
|
||||
# weekly cleanup
|
||||
clean = {
|
||||
enable = true;
|
||||
|
@ -75,7 +72,43 @@
|
|||
};
|
||||
};
|
||||
|
||||
boot.supportedFilesystems = ["ext4" "xfs" "btrfs" "vfat" "ntfs"];
|
||||
system.fsPackages = with pkgs; [
|
||||
btrfs-progs
|
||||
nfs-utils
|
||||
ntfs3g
|
||||
xfsprogs
|
||||
];
|
||||
|
||||
environment.systemPackages =
|
||||
(with pkgs; [
|
||||
# File management
|
||||
imagemagick
|
||||
unzip
|
||||
zip
|
||||
unzip
|
||||
p7zip
|
||||
rar
|
||||
unrar
|
||||
|
||||
# Peripherals
|
||||
hdparm
|
||||
pciutils
|
||||
usbutils
|
||||
])
|
||||
++ [
|
||||
nix-melt.packages.${pkgs.system}.default
|
||||
|
||||
(nurl.packages.${pkgs.system}.default.override {
|
||||
nix = config.nix.package;
|
||||
})
|
||||
|
||||
mozilla-addons-to-nix.packages.${pkgs.system}.default
|
||||
];
|
||||
|
||||
home-manager = let
|
||||
inherit (lib) mapAttrs' nameValuePair;
|
||||
|
||||
inherit (config.vars) mainUser;
|
||||
mainUserConf = config.home-manager.users.${mainUser};
|
||||
|
||||
|
@ -90,21 +123,22 @@
|
|||
};
|
||||
}
|
||||
|
||||
nur.hmModules.nur
|
||||
{
|
||||
programs.bash.sessionVariables = {
|
||||
FLAKE = config.environment.variables.FLAKE;
|
||||
};
|
||||
}
|
||||
|
||||
./home
|
||||
./home/trash-d
|
||||
./pkgs
|
||||
];
|
||||
|
||||
home.packages =
|
||||
[
|
||||
nix-melt.packages.${pkgs.system}.default
|
||||
nurl.packages.${pkgs.system}.default
|
||||
]
|
||||
++ (with config.nur.repos.rycee; [
|
||||
mozilla-addons-to-nix
|
||||
]);
|
||||
# Cache devShells
|
||||
home.file = mapAttrs' (n: v:
|
||||
nameValuePair ".cache/devShells/${n}" {
|
||||
source = v;
|
||||
})
|
||||
self.devShells.${pkgs.system};
|
||||
};
|
||||
in {
|
||||
users = {
|
||||
|
|
|
@ -123,9 +123,7 @@ in {
|
|||
#profileExtra = ''
|
||||
#'';
|
||||
bashrcExtra =
|
||||
/*
|
||||
bash
|
||||
*/
|
||||
# bash
|
||||
''
|
||||
# Check if shell is interactive
|
||||
[[ $- == *i* ]] || return 0
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
programs = {
|
||||
|
@ -41,15 +42,10 @@
|
|||
|
||||
bat = {
|
||||
enable = true;
|
||||
config = {
|
||||
theme = "dracula-bat";
|
||||
};
|
||||
themes = {
|
||||
dracula-bat = {
|
||||
src = pkgs.dracula-theme;
|
||||
file = "bat";
|
||||
};
|
||||
};
|
||||
|
||||
config.theme = "dracula-bat";
|
||||
themes.dracula-bat.src = self.legacyPackages.${pkgs.system}.dracula.bat;
|
||||
|
||||
extraPackages = with pkgs.bat-extras; [
|
||||
batman
|
||||
];
|
||||
|
|
|
@ -2,9 +2,10 @@
|
|||
programs.direnv = {
|
||||
enable = true;
|
||||
enableBashIntegration = true;
|
||||
|
||||
nix-direnv = {
|
||||
enable = true;
|
||||
package = pkgs.nix-direnv-flakes;
|
||||
package = pkgs.nix-direnv;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,41 +1,27 @@
|
|||
{pkgs, ...}: {
|
||||
{
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
mkRemoteConf = remote: email: name: {
|
||||
condition = "hasconfig:remote.*.url:${remote}:*/**";
|
||||
contents.user = {inherit email name;};
|
||||
};
|
||||
mkDefaultRemote = remote: mkRemoteConf remote "matt@nelim.org" "matt1432";
|
||||
in {
|
||||
programs = {
|
||||
git = {
|
||||
enable = true;
|
||||
lfs.enable = true;
|
||||
|
||||
includes = [
|
||||
{path = "${pkgs.dracula-theme}/git-colors";}
|
||||
{path = toString self.legacyPackages.${pkgs.system}.dracula.git;}
|
||||
|
||||
{
|
||||
condition = "hasconfig:remote.*.url:git@github.com:*/**";
|
||||
contents = {
|
||||
user = {
|
||||
email = "matt@nelim.org";
|
||||
name = "matt1432";
|
||||
};
|
||||
};
|
||||
}
|
||||
(mkDefaultRemote "https://github.com")
|
||||
(mkDefaultRemote "git@github.com")
|
||||
(mkDefaultRemote "git@git.nelim.org")
|
||||
|
||||
{
|
||||
condition = "hasconfig:remote.*.url:git@git.nelim.org:*/**";
|
||||
contents = {
|
||||
user = {
|
||||
email = "matt@nelim.org";
|
||||
name = "matt1432";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
{
|
||||
condition = "hasconfig:remote.*.url:git@gitlab.info.uqam.ca:*/**";
|
||||
contents = {
|
||||
user = {
|
||||
email = "gj591944@ens.uqam.ca";
|
||||
name = "Mathis Hurtubise";
|
||||
};
|
||||
};
|
||||
}
|
||||
(mkRemoteConf "git@gitlab.info.uqam.ca" "gj591944@ens.uqam.ca" "Mathis Hurtubise")
|
||||
];
|
||||
|
||||
delta = {
|
||||
|
|
107
common/home/neovim/.editorconfig
Normal file
107
common/home/neovim/.editorconfig
Normal file
|
@ -0,0 +1,107 @@
|
|||
# see https://github.com/CppCXY/EmmyLuaCodeStyle
|
||||
[*.lua]
|
||||
# [basic]
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
quote_style = single
|
||||
|
||||
max_line_length = 120
|
||||
end_of_line = lf
|
||||
|
||||
table_separator_style = comma
|
||||
trailing_table_separator = smart
|
||||
|
||||
call_arg_parentheses = keep
|
||||
|
||||
# [space]
|
||||
space_around_table_field_list = true
|
||||
space_before_attribute = true
|
||||
space_before_function_open_parenthesis = false
|
||||
space_before_function_call_open_parenthesis = false
|
||||
space_before_closure_open_parenthesis = false
|
||||
space_before_function_call_single_arg = false
|
||||
space_before_open_square_bracket = false
|
||||
space_inside_function_call_parentheses = false
|
||||
space_inside_function_param_list_parentheses = false
|
||||
space_inside_square_brackets = false
|
||||
|
||||
# like t[#t+1] = 1
|
||||
space_around_table_append_operator = false
|
||||
ignore_spaces_inside_function_call = false
|
||||
|
||||
# detail number or 'keep'
|
||||
space_before_inline_comment = 1
|
||||
|
||||
# convert '---' to '--- ' or '--' to '-- '
|
||||
space_after_comment_dash = false
|
||||
|
||||
# [operator space]
|
||||
space_around_math_operator = true
|
||||
space_around_math_operator.exponent = false
|
||||
space_around_concat_operator = true
|
||||
space_around_logical_operator = true
|
||||
space_around_assign_operator = true
|
||||
|
||||
space_after_comma = true
|
||||
space_after_comma_in_for_statement = true
|
||||
|
||||
# [align]
|
||||
align_call_args = false
|
||||
align_function_params = true
|
||||
align_continuous_assign_statement = true
|
||||
align_continuous_rect_table_field = true
|
||||
align_continuous_line_space = 2
|
||||
align_if_branch = false
|
||||
|
||||
# option none / always / contain_curly/
|
||||
align_array_table = true
|
||||
|
||||
align_continuous_similar_call_args = false
|
||||
|
||||
align_continuous_inline_comment = true
|
||||
# option none / always / only_call_stmt
|
||||
align_chain_expr = none
|
||||
|
||||
# [indent]
|
||||
never_indent_before_if_condition = false
|
||||
never_indent_comment_on_if_branch = false
|
||||
keep_indents_on_empty_lines = false
|
||||
allow_non_indented_comments = false
|
||||
|
||||
# [line space]
|
||||
|
||||
# The following configuration supports four expressions
|
||||
# keep
|
||||
# fixed(n)
|
||||
# min(n)
|
||||
# max(n)
|
||||
# for eg. min(2)
|
||||
|
||||
line_space_after_if_statement = keep
|
||||
|
||||
line_space_after_do_statement = keep
|
||||
|
||||
line_space_after_while_statement = keep
|
||||
|
||||
line_space_after_repeat_statement = keep
|
||||
|
||||
line_space_after_for_statement = keep
|
||||
|
||||
line_space_after_local_or_assign_statement = keep
|
||||
|
||||
line_space_after_function_statement = fixed(2)
|
||||
|
||||
line_space_after_expression_statement = keep
|
||||
|
||||
line_space_after_comment = keep
|
||||
|
||||
line_space_around_block = fixed(1)
|
||||
|
||||
# [line break]
|
||||
break_all_list_when_line_exceed = false
|
||||
auto_collapse_lines = false
|
||||
break_before_braces = false
|
||||
|
||||
# [preference]
|
||||
ignore_space_after_colon = false
|
||||
end_statement_with_semicolon = always
|
|
@ -1,2 +0,0 @@
|
|||
-- Add `:Format` command to format current buffer
|
||||
vim.api.nvim_create_user_command("Format", "call CocAction('format')", {})
|
|
@ -1,34 +0,0 @@
|
|||
" by default, the indent is 2 spaces.
|
||||
set smartindent
|
||||
set expandtab
|
||||
set shiftwidth=2
|
||||
set softtabstop=2
|
||||
set tabstop=2
|
||||
|
||||
" for html/rb files, 2 spaces
|
||||
autocmd Filetype html setlocal ts=2 sw=2 expandtab
|
||||
autocmd Filetype ruby setlocal ts=2 sw=2 expandtab
|
||||
|
||||
" for js/coffee/jade files, 4 spaces
|
||||
autocmd Filetype javascript setlocal ts=4 sw=4 sts=0 expandtab
|
||||
autocmd Filetype typescript setlocal ts=4 sw=4 sts=0 expandtab
|
||||
autocmd Filetype java setlocal ts=4 sw=4 sts=0 expandtab
|
||||
autocmd Filetype sh setlocal ts=4 sw=4 sts=0 expandtab
|
||||
autocmd Filetype hyprlang setlocal ts=4 sw=4 sts=0 expandtab
|
||||
|
||||
" support scss @
|
||||
autocmd FileType scss setl iskeyword+=@-@
|
||||
|
||||
set number
|
||||
set relativenumber
|
||||
|
||||
" TODO: make this work for nix-on-droid
|
||||
set undofile
|
||||
set undodir=/home/matt/.cache/nvim/
|
||||
|
||||
" remove highlight on words
|
||||
nnoremap <silent> <esc> :noh<cr><esc>
|
||||
|
||||
" Always show the signcolumn, otherwise it would shift the text each time
|
||||
" diagnostics appear/become resolved
|
||||
set signcolumn=yes
|
|
@ -1,340 +1,86 @@
|
|||
{
|
||||
config,
|
||||
neovim-nightly,
|
||||
pkgs,
|
||||
lib,
|
||||
nvim-theme-src,
|
||||
coc-stylelintplus,
|
||||
vimplugin-riscv-src,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) neovimIde;
|
||||
inherit (lib) fileContents hasAttr optionalAttrs optionals;
|
||||
|
||||
javaSdk = pkgs.temurin-bin-17;
|
||||
coc-stylelintplus-flake = coc-stylelintplus.packages.${pkgs.system}.default;
|
||||
inherit (pkgs) vimPlugins;
|
||||
in {
|
||||
home = optionalAttrs neovimIde {
|
||||
packages = with pkgs; [
|
||||
gradle
|
||||
maven
|
||||
alejandra
|
||||
];
|
||||
};
|
||||
|
||||
xdg.dataFile = optionalAttrs neovimIde {
|
||||
".gradle/gradle.properties".text = ''
|
||||
org.gradle.java.home = ${javaSdk}
|
||||
'';
|
||||
};
|
||||
imports = [
|
||||
./git.nix
|
||||
./langs
|
||||
./theme.nix
|
||||
./treesitter.nix
|
||||
];
|
||||
|
||||
programs = {
|
||||
java = optionalAttrs neovimIde {
|
||||
enable = true;
|
||||
package = javaSdk;
|
||||
};
|
||||
|
||||
# I love doing typos
|
||||
bash.shellAliases = {
|
||||
nivm = "nvim";
|
||||
nivim = "nvim";
|
||||
};
|
||||
|
||||
neovim = {
|
||||
enable = true;
|
||||
withNodeJs = true;
|
||||
withPython3 = true;
|
||||
withRuby = false;
|
||||
package = neovim-nightly.packages.${pkgs.system}.neovim;
|
||||
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
-- by default, the indent is 2 spaces.
|
||||
vim.opt.smartindent = true;
|
||||
vim.opt.expandtab = true;
|
||||
vim.opt.shiftwidth = 2;
|
||||
vim.opt.softtabstop = 2;
|
||||
vim.opt.tabstop = 2;
|
||||
|
||||
extraPackages = with pkgs; ([
|
||||
bat
|
||||
gcc
|
||||
]
|
||||
++ optionals neovimIde [
|
||||
nodejs_latest
|
||||
nodePackages.npm
|
||||
nodePackages.neovim
|
||||
gradle
|
||||
nil
|
||||
]);
|
||||
vim.opt.number = true;
|
||||
vim.opt.relativenumber = true;
|
||||
|
||||
extraPython3Packages = ps:
|
||||
optionals neovimIde [
|
||||
ps.pylint
|
||||
];
|
||||
vim.opt.undofile = true;
|
||||
vim.opt.undodir = '${config.xdg.cacheHome}/nvim/';
|
||||
|
||||
coc = optionalAttrs neovimIde {
|
||||
enable = true;
|
||||
settings = {
|
||||
# General
|
||||
colors.enable = true;
|
||||
coc.preferences.formatOnType = true;
|
||||
diagnostic.checkCurrentLine = true;
|
||||
inlayHint.enable = false;
|
||||
-- Always show the signcolumn, otherwise it would shift
|
||||
-- the text each time diagnostics appear/become resolved
|
||||
vim.opt.signcolumn = 'yes';
|
||||
|
||||
# ESLint
|
||||
eslint = {
|
||||
format.enable = true;
|
||||
autoFixOnSave = true;
|
||||
};
|
||||
-- remove highlight on words
|
||||
vim.keymap.set('n', '<esc>', ':noh<cr><esc>', {
|
||||
noremap = true,
|
||||
silent = true,
|
||||
});
|
||||
'';
|
||||
|
||||
# Stylelint
|
||||
stylelintplus = {
|
||||
enable = true;
|
||||
cssInJs = true;
|
||||
autoFixOnSave = true;
|
||||
autoFixOnFormat = true;
|
||||
};
|
||||
css.validate = false;
|
||||
less.validate = false;
|
||||
scss.validate = false;
|
||||
wxss.validate = false;
|
||||
plugins = [
|
||||
vimPlugins.fzfWrapper
|
||||
vimPlugins.fzf-vim
|
||||
|
||||
# Lua
|
||||
Lua = {
|
||||
misc.parameters = [
|
||||
"--metapath"
|
||||
"~/.cache/sumneko_lua/meta"
|
||||
"--logpath"
|
||||
"~/.cache/sumneko_lua/log"
|
||||
];
|
||||
workspace.library = [
|
||||
"$\{3rd\}/luv/library"
|
||||
];
|
||||
};
|
||||
sumneko-lua = {
|
||||
serverDir = "${pkgs.lua-language-server}/share/lua-language-server";
|
||||
enableNvimLuaDev = true;
|
||||
};
|
||||
{
|
||||
plugin = vimPlugins.todo-comments-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
require('todo-comments').setup();
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = vimPlugins.mini-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
-- TODO: see how this works
|
||||
local ts_input = require('mini.surround').gen_spec.input.treesitter;
|
||||
|
||||
languageserver = {
|
||||
# Nix
|
||||
nix = {
|
||||
command = "nil";
|
||||
filetypes = ["nix"];
|
||||
rootPatterns = ["flake.nix"];
|
||||
settings = {
|
||||
nil = {
|
||||
formatting.command = ["alejandra"];
|
||||
|
||||
nix = {
|
||||
maxMemoryMB = 2560;
|
||||
flake.autoArchive = hasAttr "sops" config;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Java
|
||||
java = {
|
||||
maven.downloadSources = true;
|
||||
eclipse.downloadSources = true;
|
||||
|
||||
format.settings.url = "eclipse-formatter.xml";
|
||||
|
||||
jdt.ls = {
|
||||
java.home = "${javaSdk}";
|
||||
statusIcons = {
|
||||
"busy" = "Busy";
|
||||
"ready" = "OK";
|
||||
"warning" = "Warning";
|
||||
"error" = "Error";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Bash
|
||||
bashIde.shellcheckPath = "${pkgs.shellcheck}/bin/shellcheck";
|
||||
|
||||
markdownlint.config = {
|
||||
no-trailing-spaces = true;
|
||||
no-multiple-blanks = false;
|
||||
no-duplicate-heading = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = fileContents ./base.vim;
|
||||
extraLuaConfig = fileContents ./base.lua;
|
||||
|
||||
plugins = with pkgs.vimPlugins;
|
||||
([
|
||||
fzfWrapper
|
||||
fzf-vim
|
||||
fugitive
|
||||
|
||||
{
|
||||
plugin = dracula-nvim.overrideAttrs {
|
||||
src = nvim-theme-src;
|
||||
};
|
||||
type = "viml";
|
||||
config = fileContents ./plugins/dracula.vim;
|
||||
}
|
||||
{
|
||||
plugin = todo-comments-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
/*
|
||||
lua
|
||||
*/
|
||||
''require('todo-comments').setup()'';
|
||||
}
|
||||
{
|
||||
plugin = gitsigns-nvim;
|
||||
type = "lua";
|
||||
config = fileContents ./plugins/gitsigns.lua;
|
||||
}
|
||||
{
|
||||
plugin = indent-blankline-nvim;
|
||||
type = "lua";
|
||||
config = fileContents ./plugins/indent.lua;
|
||||
}
|
||||
{
|
||||
plugin = mini-nvim;
|
||||
type = "lua";
|
||||
config = fileContents ./plugins/mini.lua;
|
||||
}
|
||||
]
|
||||
++ optionals neovimIde [
|
||||
markdown-preview-nvim
|
||||
|
||||
# Coc configured
|
||||
coc-css
|
||||
coc-eslint
|
||||
coc-java
|
||||
coc-sh
|
||||
coc-stylelintplus-flake
|
||||
{
|
||||
plugin = coc-snippets;
|
||||
type = "viml";
|
||||
config = fileContents ./plugins/snippets.vim;
|
||||
}
|
||||
|
||||
## Lua
|
||||
coc-sumneko-lua
|
||||
neodev-nvim
|
||||
|
||||
## Fzf
|
||||
coc-fzf
|
||||
|
||||
coc-highlight
|
||||
coc-json
|
||||
coc-pyright
|
||||
coc-vimlsp
|
||||
coc-yaml
|
||||
coc-toml
|
||||
coc-markdownlint
|
||||
coc-tsserver
|
||||
|
||||
{
|
||||
plugin = nvim-autopairs;
|
||||
type = "lua";
|
||||
config = fileContents ./plugins/autopairs.lua;
|
||||
}
|
||||
{
|
||||
plugin = lualine-nvim;
|
||||
type = "lua";
|
||||
config = fileContents ./plugins/lualine.lua;
|
||||
}
|
||||
{
|
||||
plugin = neo-tree-nvim;
|
||||
type = "viml";
|
||||
config = ''
|
||||
${fileContents ./plugins/neotree.vim}
|
||||
|
||||
lua << EOF
|
||||
${fileContents ./plugins/neotree.lua}
|
||||
EOF
|
||||
'';
|
||||
}
|
||||
(pkgs.vimUtils.buildVimPlugin {
|
||||
name = "riscv-asm";
|
||||
src = vimplugin-riscv-src;
|
||||
})
|
||||
])
|
||||
# Treesitter
|
||||
++ (with pkgs.vimPlugins; [
|
||||
nvim-treesitter-context
|
||||
nvim-treesitter-textobjects
|
||||
{
|
||||
type = "viml";
|
||||
config = fileContents ./plugins/treesitter.vim;
|
||||
plugin = nvim-treesitter.withPlugins (p: [
|
||||
p.awk
|
||||
p.bash
|
||||
p.c
|
||||
p.c_sharp
|
||||
p.cairo
|
||||
p.cmake
|
||||
p.comment
|
||||
p.cpp
|
||||
p.css
|
||||
p.csv
|
||||
p.cuda
|
||||
p.diff
|
||||
p.dockerfile
|
||||
p.dot
|
||||
p.git_config
|
||||
p.git_rebase
|
||||
p.gitattributes
|
||||
p.gitcommit
|
||||
p.gitignore
|
||||
p.go
|
||||
p.gomod
|
||||
p.gosum
|
||||
p.groovy
|
||||
p.haskell
|
||||
p.haskell_persistent
|
||||
p.hyprlang
|
||||
p.html
|
||||
p.ini
|
||||
p.java
|
||||
p.javascript
|
||||
p.jq
|
||||
p.jsdoc
|
||||
p.json
|
||||
p.json5
|
||||
p.jsonc
|
||||
p.jsonnet
|
||||
p.kotlin
|
||||
p.latex
|
||||
p.lua
|
||||
p.luadoc
|
||||
p.make
|
||||
p.markdown
|
||||
p.meson
|
||||
p.ninja
|
||||
p.nix
|
||||
p.passwd
|
||||
p.perl
|
||||
p.php
|
||||
p.phpdoc
|
||||
p.properties
|
||||
p.python
|
||||
p.rasi
|
||||
p.regex
|
||||
p.requirements
|
||||
p.ruby
|
||||
p.rust
|
||||
p.scss
|
||||
p.sql
|
||||
p.ssh_config
|
||||
p.toml
|
||||
p.todotxt
|
||||
p.typescript
|
||||
p.udev
|
||||
p.vim
|
||||
p.vimdoc
|
||||
p.vue
|
||||
p.xml
|
||||
p.yaml
|
||||
]);
|
||||
}
|
||||
]);
|
||||
require('mini.surround').setup({
|
||||
custom_surroundings = {
|
||||
-- Use tree-sitter to search for function call
|
||||
f = {
|
||||
input = ts_input({
|
||||
outer = '@call.outer',
|
||||
inner = '@call.inner',
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
33
common/home/neovim/git.nix
Normal file
33
common/home/neovim/git.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{pkgs, ...}: let
|
||||
inherit (pkgs) vimPlugins;
|
||||
in {
|
||||
programs = {
|
||||
neovim = {
|
||||
plugins = [
|
||||
vimPlugins.fugitive
|
||||
|
||||
{
|
||||
plugin = vimPlugins.gitsigns-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
local gitsigns = require("gitsigns");
|
||||
|
||||
local function visual_stage()
|
||||
local first_line = vim.fn.line('v');
|
||||
local last_line = vim.fn.getpos('.')[2];
|
||||
gitsigns.stage_hunk({ first_line, last_line });
|
||||
end
|
||||
|
||||
vim.keymap.set("v", "gs", function()
|
||||
visual_stage()
|
||||
end);
|
||||
|
||||
gitsigns.setup();
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
45
common/home/neovim/langs/bash.nix
Normal file
45
common/home/neovim/langs/bash.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) neovimIde;
|
||||
in {
|
||||
programs = {
|
||||
# I love doing typos
|
||||
bash.shellAliases = {
|
||||
nivm = "nvim";
|
||||
nivim = "nvim";
|
||||
};
|
||||
|
||||
neovim = {
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
|
||||
extraPackages = lib.mkIf neovimIde [
|
||||
pkgs.nodePackages.bash-language-server
|
||||
pkgs.shellcheck
|
||||
];
|
||||
|
||||
extraLuaConfig =
|
||||
lib.mkIf neovimIde
|
||||
# lua
|
||||
''
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'sh',
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
|
||||
require('lspconfig').bashls.setup(require('coq').lsp_ensure_capabilities({
|
||||
settings = {
|
||||
bashIde = {
|
||||
shellcheckPath = '${lib.getExe pkgs.shellcheck}',
|
||||
},
|
||||
},
|
||||
}));
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
46
common/home/neovim/langs/clang.nix
Normal file
46
common/home/neovim/langs/clang.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) neovimIde;
|
||||
inherit (pkgs) vimPlugins;
|
||||
in
|
||||
lib.mkIf neovimIde {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = with pkgs; [
|
||||
gcc
|
||||
clang-tools
|
||||
cmake-language-server
|
||||
];
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { 'cpp' , 'c'},
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
|
||||
local lsp = require('lspconfig');
|
||||
local coq = require('coq');
|
||||
|
||||
lsp.cmake.setup(coq.lsp_ensure_capabilities({}));
|
||||
|
||||
lsp.clangd.setup(coq.lsp_ensure_capabilities({
|
||||
handlers = require('lsp-status').extensions.clangd.setup(),
|
||||
on_attach = function(_, bufnr)
|
||||
require("clangd_extensions.inlay_hints").setup_autocmd()
|
||||
require("clangd_extensions.inlay_hints").set_inlay_hints()
|
||||
end,
|
||||
}));
|
||||
'';
|
||||
|
||||
plugins = [
|
||||
vimPlugins.clangd_extensions-nvim
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
136
common/home/neovim/langs/default.nix
Normal file
136
common/home/neovim/langs/default.nix
Normal file
|
@ -0,0 +1,136 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) neovimIde;
|
||||
inherit (pkgs) vimPlugins;
|
||||
in {
|
||||
imports = [
|
||||
./bash.nix
|
||||
./clang.nix
|
||||
./hyprlang.nix
|
||||
./java.nix
|
||||
./json.nix
|
||||
./lua.nix
|
||||
./markdown.nix
|
||||
./nix.nix
|
||||
./python.nix
|
||||
./rust.nix
|
||||
./web.nix
|
||||
];
|
||||
|
||||
programs = lib.mkIf neovimIde {
|
||||
neovim = {
|
||||
extraLuaConfig =
|
||||
lib.mkBefore
|
||||
# lua
|
||||
''
|
||||
-- Get rid of deprecated functions
|
||||
vim.tbl_add_reverse_lookup = function(tbl)
|
||||
for k, v in pairs(tbl) do
|
||||
tbl[v] = k;
|
||||
end
|
||||
end;
|
||||
vim.tbl_islist = function(tbl)
|
||||
return vim.islist(tbl);
|
||||
end;
|
||||
vim.tbl_flatten = function(tbl)
|
||||
return vim.iter(tbl):flatten():totable();
|
||||
end;
|
||||
vim.diagnostic.is_disabled = function()
|
||||
return not vim.diagnostic.is_enabled();
|
||||
end;
|
||||
vim.lsp.buf_get_clients = function()
|
||||
return vim.lsp.get_clients();
|
||||
end;
|
||||
vim.lsp.get_active_clients = function()
|
||||
return vim.lsp.get_clients();
|
||||
end;
|
||||
|
||||
-- Start completion / snippet stuff
|
||||
vim.g.coq_settings = {
|
||||
auto_start = 'shut-up',
|
||||
keymap = {
|
||||
recommended = false,
|
||||
},
|
||||
-- https://github.com/NixOS/nixpkgs/issues/168928#issuecomment-1109581739
|
||||
xdg = true,
|
||||
};
|
||||
|
||||
-- Add formatting cmd
|
||||
vim.api.nvim_create_user_command(
|
||||
'Format',
|
||||
function()
|
||||
vim.lsp.buf.format({ async = true });
|
||||
end,
|
||||
{}
|
||||
);
|
||||
|
||||
-- LSP-Status setup
|
||||
local lsp_status = require('lsp-status');
|
||||
lsp_status.register_progress();
|
||||
|
||||
-- Remove LSP highlighting to use Treesitter
|
||||
vim.api.nvim_create_autocmd("LspAttach", {
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id);
|
||||
client.server_capabilities.semanticTokensProvider = nil;
|
||||
lsp_status.on_attach(client);
|
||||
end,
|
||||
});
|
||||
|
||||
-- Disable virtual_text since it's redundant due to lsp_lines.
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
});
|
||||
|
||||
require('lsp_lines').setup();
|
||||
|
||||
-- Autopairs with coq
|
||||
local remap = vim.api.nvim_set_keymap
|
||||
local npairs = require('nvim-autopairs')
|
||||
|
||||
npairs.setup({ map_bs = false, map_cr = false })
|
||||
|
||||
_G.MUtils= {}
|
||||
|
||||
MUtils.CR = function()
|
||||
if vim.fn.pumvisible() ~= 0 then
|
||||
if vim.fn.complete_info({ 'selected' }).selected ~= -1 then
|
||||
return npairs.esc('<c-y>');
|
||||
else
|
||||
return npairs.esc('<c-e>') .. npairs.autopairs_cr();
|
||||
end
|
||||
else
|
||||
return npairs.autopairs_cr();
|
||||
end
|
||||
end
|
||||
remap('i', '<cr>', 'v:lua.MUtils.CR()', { expr = true, noremap = true });
|
||||
|
||||
MUtils.BS = function()
|
||||
if vim.fn.pumvisible() ~= 0 and vim.fn.complete_info({ 'mode' }).mode == 'eval' then
|
||||
return npairs.esc('<c-e>') .. npairs.autopairs_bs();
|
||||
else
|
||||
return npairs.autopairs_bs();
|
||||
end
|
||||
end
|
||||
remap('i', '<bs>', 'v:lua.MUtils.BS()', { expr = true, noremap = true });
|
||||
'';
|
||||
|
||||
plugins = [
|
||||
vimPlugins.nvim-lspconfig
|
||||
|
||||
vimPlugins.coq_nvim
|
||||
vimPlugins.coq-artifacts
|
||||
vimPlugins.coq-thirdparty
|
||||
|
||||
vimPlugins.nvim-autopairs
|
||||
|
||||
vimPlugins.lsp-status-nvim
|
||||
vimPlugins.lsp_lines-nvim
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
25
common/home/neovim/langs/hyprlang.nix
Normal file
25
common/home/neovim/langs/hyprlang.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) neovimIde;
|
||||
in
|
||||
lib.mkIf neovimIde {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
vim.filetype.add({
|
||||
pattern = { ['.*/hypr/.*%.conf'] = 'hyprlang' },
|
||||
});
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'hyprlang',
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
81
common/home/neovim/langs/java.nix
Normal file
81
common/home/neovim/langs/java.nix
Normal file
|
@ -0,0 +1,81 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (pkgs) vimPlugins;
|
||||
inherit (config.vars) neovimIde;
|
||||
|
||||
javaSdk = pkgs.temurin-bin-17;
|
||||
javaPkgs = with pkgs; [gradle maven];
|
||||
in
|
||||
lib.mkIf neovimIde {
|
||||
home.packages = javaPkgs;
|
||||
|
||||
xdg.dataFile.".gradle/gradle.properties".text = ''
|
||||
org.gradle.java.home = ${javaSdk}
|
||||
'';
|
||||
|
||||
programs = {
|
||||
java = {
|
||||
enable = true;
|
||||
package = javaSdk;
|
||||
};
|
||||
|
||||
neovim = {
|
||||
extraPackages = javaPkgs;
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'java',
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
'';
|
||||
|
||||
plugins = [
|
||||
{
|
||||
# TOOD: setup debugger https://github.com/mfussenegger/nvim-jdtls#debugger-via-nvim-dap
|
||||
plugin = vimPlugins.nvim-jdtls;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
local startJdtls = function()
|
||||
local config = require('coq').lsp_ensure_capabilities({
|
||||
cmd = { '${lib.getExe pkgs.jdt-language-server}' },
|
||||
root_dir = vim.fs.dirname(vim.fs.find(
|
||||
{ 'gradlew', '.git', 'mvnw', 'pom.xml' },
|
||||
{ upward = true }
|
||||
)[1]),
|
||||
|
||||
settings = {
|
||||
java = {
|
||||
configuration = {
|
||||
runtimes = {
|
||||
{
|
||||
name = 'JavaSE-17',
|
||||
path = '${javaSdk}',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
require('jdtls').start_or_attach(config);
|
||||
end
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'java',
|
||||
callback = startJdtls,
|
||||
});
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
48
common/home/neovim/langs/json.nix
Normal file
48
common/home/neovim/langs/json.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) neovimIde;
|
||||
in
|
||||
lib.mkIf neovimIde {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = [
|
||||
pkgs.vscode-langservers-extracted
|
||||
pkgs.yaml-language-server
|
||||
];
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'yaml',
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'json',
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
|
||||
local lsp = require('lspconfig');
|
||||
local coq = require('coq');
|
||||
|
||||
lsp.jsonls.setup(coq.lsp_ensure_capabilities({}));
|
||||
|
||||
lsp.yamlls.setup(coq.lsp_ensure_capabilities({
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
[
|
||||
"https://json.schemastore.org/github-workflow.json"
|
||||
] = "/.github/workflows/*",
|
||||
},
|
||||
},
|
||||
},
|
||||
}));
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
48
common/home/neovim/langs/lua.nix
Normal file
48
common/home/neovim/langs/lua.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) neovimIde;
|
||||
inherit (pkgs) vimPlugins;
|
||||
|
||||
flakeEnv = config.programs.bash.sessionVariables.FLAKE;
|
||||
in
|
||||
lib.mkIf neovimIde {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = [
|
||||
pkgs.lua-language-server
|
||||
];
|
||||
|
||||
plugins = [
|
||||
{
|
||||
plugin = vimPlugins.neodev-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'lua',
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
|
||||
-- IMPORTANT: make sure to setup neodev BEFORE lspconfig
|
||||
require("neodev").setup({
|
||||
override = function(root_dir, library)
|
||||
if root_dir:find('${flakeEnv}', 1, true) == 1 then
|
||||
library.enabled = true
|
||||
library.plugins = true
|
||||
end
|
||||
end,
|
||||
});
|
||||
|
||||
require('lspconfig').lua_ls.setup(
|
||||
require('coq').lsp_ensure_capabilities({}));
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
125
common/home/neovim/langs/markdown.nix
Normal file
125
common/home/neovim/langs/markdown.nix
Normal file
|
@ -0,0 +1,125 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
vimplugin-easytables-src,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) neovimIde;
|
||||
inherit (pkgs) vimPlugins;
|
||||
|
||||
inherit (import ../../../../lib.nix {inherit pkgs;}) buildPlugin;
|
||||
in
|
||||
lib.mkIf neovimIde {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = [
|
||||
pkgs.pandoc
|
||||
|
||||
# LaTeX packages
|
||||
pkgs.texlab
|
||||
pkgs.texliveFull
|
||||
pkgs.rubber
|
||||
];
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
local lsp = require('lspconfig');
|
||||
local coq = require('coq');
|
||||
|
||||
lsp.texlab.setup(coq.lsp_ensure_capabilities({
|
||||
settings = {
|
||||
texlab = {
|
||||
formatterLineLength = 100,
|
||||
latexFormatter = 'latexindent',
|
||||
latexindent = {
|
||||
modifyLineBreaks = false,
|
||||
["local"] = '.indentconfig.yaml';
|
||||
},
|
||||
},
|
||||
},
|
||||
}));
|
||||
'';
|
||||
|
||||
plugins = [
|
||||
{
|
||||
plugin = buildPlugin "easytables-nvim" vimplugin-easytables-src;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
require('easytables').setup();
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
plugin = vimPlugins.knap;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'tex',
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
|
||||
vim.g.knap_settings = {
|
||||
-- HTML
|
||||
htmloutputext = 'html',
|
||||
htmltohtml = 'none',
|
||||
htmltohtmlviewerlaunch = "",
|
||||
htmltohtmlviewerrefresh = 'none',
|
||||
|
||||
-- Markdown
|
||||
mdoutputext = 'html',
|
||||
markdownoutputext = 'html',
|
||||
|
||||
-- Markdown to PDF
|
||||
mdtopdf = 'pandoc %docroot% -o /tmp/%outputfile%',
|
||||
markdowntopdf = 'pandoc %docroot% -o /tmp/%outputfile%',
|
||||
mdtopdfviewerlaunch = 'sioyek /tmp/%outputfile%',
|
||||
markdowntopdfviewerlaunch = 'sioyek /tmp/%outputfile%',
|
||||
mdtopdfviewerrefresh = 'none',
|
||||
markdowntopdfviewerrefresh = "none",
|
||||
|
||||
-- Markdown to HTML
|
||||
mdtohtml = 'pandoc --standalone %docroot% -o /tmp/%outputfile%',
|
||||
markdowntohtml = 'pandoc --standalone %docroot% -o /tmp/%outputfile%',
|
||||
mdtohtmlviewerlaunch = 'firefox -new-window /tmp/%outputfile%',
|
||||
markdowntohtmlviewerlaunch = 'firefox -new-window /tmp/%outputfile%',
|
||||
mdtohtmlviewerrefresh = 'none',
|
||||
markdowntohtmlviewerrefresh = 'none',
|
||||
|
||||
-- LaTeX
|
||||
-- TODO: stop from polluting workspace
|
||||
};
|
||||
|
||||
-- F4 processes the document once, and refreshes the view
|
||||
vim.keymap.set({ 'n', 'v', 'i' }, '<F4>', function()
|
||||
require('knap').process_once();
|
||||
end);
|
||||
|
||||
-- F5 closes the viewer application, and
|
||||
-- allows settings to be reset
|
||||
vim.keymap.set({ 'n', 'v', 'i' }, '<F5>', function()
|
||||
require('knap').close_viewer();
|
||||
end);
|
||||
|
||||
-- F6 toggles the auto-processing on and off
|
||||
vim.keymap.set({ 'n', 'v', 'i' }, '<F6>', function()
|
||||
require('knap').toggle_autopreviewing();
|
||||
end);
|
||||
|
||||
-- F7 invokes a SyncTeX forward search, or similar,
|
||||
-- where appropriate
|
||||
vim.keymap.set({ 'n', 'v', 'i' }, '<F7>', function()
|
||||
require('knap').forward_jump();
|
||||
end);
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
69
common/home/neovim/langs/nix.nix
Normal file
69
common/home/neovim/langs/nix.nix
Normal file
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nixd,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) hostName mainUser neovimIde;
|
||||
inherit (lib) getExe hasPrefix removePrefix;
|
||||
|
||||
defaultFormat = self.formatter.${pkgs.system};
|
||||
|
||||
nixdPkg = nixd.packages.${pkgs.system}.default;
|
||||
|
||||
flakeEnv = config.programs.bash.sessionVariables.FLAKE;
|
||||
flakeDir = "${removePrefix "/home/${mainUser}/" flakeEnv}";
|
||||
in
|
||||
lib.mkIf neovimIde {
|
||||
assertions = [
|
||||
{
|
||||
assertion =
|
||||
neovimIde
|
||||
&& hasPrefix "/home/${mainUser}/" flakeEnv
|
||||
|| !neovimIde;
|
||||
message = ''
|
||||
Your $FLAKE environment variable needs to point to a directory in
|
||||
the main users' home to use the neovim module.
|
||||
'';
|
||||
}
|
||||
];
|
||||
|
||||
home.packages = [
|
||||
defaultFormat
|
||||
];
|
||||
|
||||
xdg.dataFile."${flakeDir}/.nixd.json".text = builtins.toJSON {
|
||||
nixpkgs = {
|
||||
expr = "import (builtins.getFlake \"${flakeDir}\").inputs.nixpkgs {}";
|
||||
};
|
||||
options.nixos = {
|
||||
expr = "(builtins.getFlake \"${flakeDir}\").nixosConfigurations.${hostName}.options";
|
||||
};
|
||||
};
|
||||
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = [
|
||||
nixdPkg
|
||||
];
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
require('lspconfig').nixd.setup(require('coq').lsp_ensure_capabilities({
|
||||
filetypes = { 'nix', 'in.nix' },
|
||||
settings = {
|
||||
nixd = {
|
||||
formatting = {
|
||||
-- TODO: Try to find <flake>.formatter
|
||||
command = { '${getExe defaultFormat}' },
|
||||
},
|
||||
},
|
||||
},
|
||||
}));
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
26
common/home/neovim/langs/python.nix
Normal file
26
common/home/neovim/langs/python.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) neovimIde;
|
||||
in
|
||||
lib.mkIf neovimIde {
|
||||
programs = {
|
||||
neovim = {
|
||||
withPython3 = true;
|
||||
|
||||
extraPackages = [
|
||||
pkgs.basedpyright
|
||||
];
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
require('lspconfig').basedpyright.setup(
|
||||
require('coq').lsp_ensure_capabilities({}));
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
34
common/home/neovim/langs/rust.nix
Normal file
34
common/home/neovim/langs/rust.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) neovimIde;
|
||||
in
|
||||
lib.mkIf neovimIde {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = with pkgs; [
|
||||
cargo
|
||||
rustc
|
||||
rust-analyzer
|
||||
rustfmt
|
||||
];
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { 'rust' },
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
|
||||
local lsp = require('lspconfig');
|
||||
local coq = require('coq');
|
||||
|
||||
lsp.rust_analyzer.setup(coq.lsp_ensure_capabilities({}));
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
89
common/home/neovim/langs/web.nix
Normal file
89
common/home/neovim/langs/web.nix
Normal file
|
@ -0,0 +1,89 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
vimplugin-ts-error-translator-src,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) neovimIde;
|
||||
inherit (pkgs) vimPlugins;
|
||||
|
||||
inherit (import ../../../../lib.nix {inherit pkgs;}) buildPlugin;
|
||||
in
|
||||
lib.mkIf neovimIde {
|
||||
programs = {
|
||||
neovim = {
|
||||
withNodeJs = true;
|
||||
|
||||
extraPackages = [
|
||||
pkgs.nodejs_latest
|
||||
pkgs.nodePackages.npm
|
||||
pkgs.nodePackages.neovim
|
||||
|
||||
pkgs.vscode-langservers-extracted
|
||||
];
|
||||
|
||||
extraLuaConfig =
|
||||
# lua
|
||||
''
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { 'javascript', 'typescript', 'css', 'scss' },
|
||||
command = 'setlocal ts=4 sw=4 sts=0 expandtab',
|
||||
});
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'html',
|
||||
command = 'setlocal ts=2 sw=2 expandtab',
|
||||
});
|
||||
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = 'scss',
|
||||
command = 'setlocal iskeyword+=@-@',
|
||||
});
|
||||
|
||||
local lsp = require('lspconfig');
|
||||
local coq = require('coq');
|
||||
local tsserver = require('typescript-tools');
|
||||
|
||||
tsserver.setup(coq.lsp_ensure_capabilities({
|
||||
handlers = {
|
||||
-- format error code with better error message
|
||||
['textDocument/publishDiagnostics'] = function(err, result, ctx, config)
|
||||
require('ts-error-translator').translate_diagnostics(err, result, ctx, config)
|
||||
vim.lsp.diagnostic.on_publish_diagnostics(err, result, ctx, config)
|
||||
end,
|
||||
},
|
||||
}));
|
||||
|
||||
lsp.eslint.setup(coq.lsp_ensure_capabilities({
|
||||
-- auto-save
|
||||
on_attach = function(client, bufnr)
|
||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
||||
buffer = bufnr,
|
||||
command = 'EslintFixAll',
|
||||
});
|
||||
end,
|
||||
}));
|
||||
|
||||
lsp.cssls.setup(coq.lsp_ensure_capabilities({
|
||||
settings = {
|
||||
css = {
|
||||
validate = false,
|
||||
},
|
||||
less = {
|
||||
validate = false,
|
||||
},
|
||||
scss = {
|
||||
validate = false,
|
||||
},
|
||||
},
|
||||
}));
|
||||
'';
|
||||
|
||||
plugins = [
|
||||
vimPlugins.typescript-tools-nvim
|
||||
(buildPlugin "ts-error-translator" vimplugin-ts-error-translator-src)
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
-- Auto indent when pressing Enter between brackets
|
||||
local remap = vim.api.nvim_set_keymap
|
||||
local npairs = require('nvim-autopairs')
|
||||
npairs.setup({map_cr=false})
|
||||
|
||||
_G.MUtils= {}
|
||||
|
||||
MUtils.completion_confirm=function()
|
||||
if vim.fn["coc#pum#visible"]() ~= 0 then
|
||||
return vim.fn["coc#pum#confirm"]()
|
||||
else
|
||||
return npairs.autopairs_cr()
|
||||
end
|
||||
end
|
||||
|
||||
remap('i' , '<CR>','v:lua.MUtils.completion_confirm()', {expr = true , noremap = true})
|
|
@ -1,10 +0,0 @@
|
|||
" set dot icon in place of trailing whitespaces
|
||||
set list listchars=tab:\ \ ,nbsp:␣,trail:•,extends:⟩,precedes:⟨
|
||||
|
||||
|
||||
lua << EOF
|
||||
-- Add visual indicator for trailing whitespaces
|
||||
vim.opt.fillchars = {eob = " "}
|
||||
|
||||
vim.cmd[[colorscheme dracula]]
|
||||
EOF
|
|
@ -1,13 +0,0 @@
|
|||
local gitsigns = require("gitsigns")
|
||||
|
||||
local function visual_stage()
|
||||
local first_line = vim.fn.line('v')
|
||||
local last_line = vim.fn.getpos('.')[2]
|
||||
gitsigns.stage_hunk({ first_line, last_line })
|
||||
end
|
||||
|
||||
vim.keymap.set("v", "gs", function()
|
||||
visual_stage()
|
||||
end)
|
||||
|
||||
gitsigns.setup();
|
443
common/home/neovim/plugins/heirline.lua
Normal file
443
common/home/neovim/plugins/heirline.lua
Normal file
|
@ -0,0 +1,443 @@
|
|||
-- Modified from https://github.com/lauranaujokat/nvim/blob/4102c789d05667f636107e3dae4ac589053ee88d/lua/setups/heirline.lua#L4
|
||||
|
||||
local conditions = require('heirline.conditions');
|
||||
local utils = require('heirline.utils');
|
||||
|
||||
---@class Palette
|
||||
---@field [string] any
|
||||
local dracula = require('dracula').colors();
|
||||
|
||||
local colors = {
|
||||
bright_bg = dracula.selection,
|
||||
dark_bg = dracula.menu,
|
||||
bright_fg = dracula.fg,
|
||||
red = dracula.red,
|
||||
dark_red = utils.get_highlight('DiffDelete').bg,
|
||||
green = dracula.green,
|
||||
blue = dracula.blue,
|
||||
gray = utils.get_highlight('NonText').fg,
|
||||
orange = utils.get_highlight('Constant').fg,
|
||||
purple = utils.get_highlight('Statement').fg,
|
||||
cyan = dracula.cyan,
|
||||
diag_warn = utils.get_highlight('DiagnosticWarn').fg,
|
||||
diag_error = utils.get_highlight('DiagnosticError').fg,
|
||||
diag_hint = utils.get_highlight('DiagnosticHint').fg,
|
||||
diag_info = utils.get_highlight('DiagnosticInfo').fg,
|
||||
git_del = utils.get_highlight('GitSignsDelete').fg,
|
||||
git_add = utils.get_highlight('GitSignsAdd').fg,
|
||||
git_change = utils.get_highlight('GitSignsChange').fg,
|
||||
};
|
||||
|
||||
require('heirline').load_colors(colors);
|
||||
|
||||
local ViMode = {
|
||||
-- get vim current mode, this information will be required by the provider
|
||||
-- and the highlight functions, so we compute it only once per component
|
||||
-- evaluation and store it as a component attribute
|
||||
init = function(self)
|
||||
self.mode = vim.fn.mode(1);
|
||||
|
||||
-- execute this only once, this is required if you want the ViMode
|
||||
-- component to be updated on operator pending mode
|
||||
if not self.once then
|
||||
vim.api.nvim_create_autocmd('ModeChanged', {
|
||||
pattern = '*:*o',
|
||||
command = 'redrawstatus',
|
||||
});
|
||||
self.once = true;
|
||||
end;
|
||||
end,
|
||||
|
||||
static = {
|
||||
mode_names = {
|
||||
n = 'N',
|
||||
no = 'N?',
|
||||
nov = 'N?',
|
||||
noV = 'N?',
|
||||
['no\22'] = 'N?',
|
||||
niI = 'Ni',
|
||||
niR = 'Nr',
|
||||
niV = 'Nv',
|
||||
nt = 'Nt',
|
||||
v = 'V',
|
||||
vs = 'Vs',
|
||||
V = 'V_',
|
||||
Vs = 'Vs',
|
||||
['\22'] = '^V',
|
||||
['\22s'] = '^V',
|
||||
s = 'S',
|
||||
S = 'S_',
|
||||
['\19'] = '^S',
|
||||
i = 'I',
|
||||
ic = 'Ic',
|
||||
ix = 'Ix',
|
||||
R = 'R',
|
||||
Rc = 'Rc',
|
||||
Rx = 'Rx',
|
||||
Rv = 'Rv',
|
||||
Rvc = 'Rv',
|
||||
Rvx = 'Rv',
|
||||
c = 'C',
|
||||
cv = 'Ex',
|
||||
r = '...',
|
||||
rm = 'M',
|
||||
['r?'] = '?',
|
||||
['!'] = '!',
|
||||
t = 'T',
|
||||
},
|
||||
|
||||
mode_colors = {
|
||||
n = 'red',
|
||||
i = 'green',
|
||||
v = 'cyan',
|
||||
V = 'cyan',
|
||||
['\22'] = 'cyan',
|
||||
c = 'orange',
|
||||
s = 'purple',
|
||||
S = 'purple',
|
||||
['\19'] = 'purple',
|
||||
R = 'orange',
|
||||
r = 'orange',
|
||||
['!'] = 'red',
|
||||
t = 'red',
|
||||
},
|
||||
},
|
||||
|
||||
-- To be extra meticulous, we can also add some vim statusline syntax to
|
||||
-- control the padding and make sure our string is always at least 2
|
||||
-- characters long. Plus a nice Icon.
|
||||
provider = function(self)
|
||||
return ' ' .. self.mode_names[self.mode] .. '%)';
|
||||
end,
|
||||
|
||||
-- Same goes for the highlight. Now the foreground will change according to the current mode.
|
||||
hl = function(self)
|
||||
local mode = self.mode:sub(1, 1); -- get only the first mode character
|
||||
return { fg = self.mode_colors[mode], bold = true };
|
||||
end,
|
||||
|
||||
-- Re-evaluate the component only on ModeChanged event
|
||||
update = {
|
||||
'ModeChanged',
|
||||
},
|
||||
};
|
||||
|
||||
local FileNameBlock = {
|
||||
init = function(self)
|
||||
self.filename = vim.api.nvim_buf_get_name(0);
|
||||
end,
|
||||
};
|
||||
|
||||
-- FileNameBlock children
|
||||
local FileIcon = {
|
||||
init = function(self)
|
||||
local filename = self.filename;
|
||||
local extension = vim.fn.fnamemodify(filename, ':e');
|
||||
self.icon, self.icon_color =
|
||||
require('nvim-web-devicons').get_icon_color(filename, extension, { default = true });
|
||||
end,
|
||||
|
||||
provider = function(self)
|
||||
return self.icon and (self.icon .. ' ');
|
||||
end,
|
||||
|
||||
hl = function(self)
|
||||
return { fg = self.icon_color };
|
||||
end,
|
||||
};
|
||||
|
||||
local FileName = {
|
||||
provider = function(self)
|
||||
-- first, trim the pattern relative to the current directory. For other
|
||||
-- options, see :h filename-modifers
|
||||
local filename = vim.fn.fnamemodify(self.filename, ':.');
|
||||
if filename == '' then
|
||||
return '[No Name]';
|
||||
end;
|
||||
-- now, if the filename would occupy more than 1/4th of the available
|
||||
-- space, we trim the file path to its initials
|
||||
-- See Flexible Components section below for dynamic truncation
|
||||
if not conditions.width_percent_below(#filename, 0.25) then
|
||||
filename = vim.fn.pathshorten(filename);
|
||||
end;
|
||||
return filename;
|
||||
end,
|
||||
|
||||
hl = { fg = utils.get_highlight('Directory').fg },
|
||||
};
|
||||
|
||||
local FileFlags = {
|
||||
{
|
||||
condition = function()
|
||||
return vim.bo.modified;
|
||||
end,
|
||||
provider = '[+]',
|
||||
hl = { fg = 'green' },
|
||||
},
|
||||
{
|
||||
condition = function()
|
||||
return not vim.bo.modifiable or vim.bo.readonly;
|
||||
end,
|
||||
provider = '',
|
||||
hl = { fg = 'orange' },
|
||||
},
|
||||
};
|
||||
|
||||
local FileNameModifer = {
|
||||
hl = function()
|
||||
if vim.bo.modified then
|
||||
-- use `force` because we need to override the child's hl foreground
|
||||
return { fg = 'cyan', bold = true, force = true };
|
||||
end;
|
||||
end,
|
||||
};
|
||||
|
||||
-- let's add the children to our FileNameBlock component
|
||||
FileNameBlock = utils.insert(
|
||||
FileNameBlock,
|
||||
FileIcon,
|
||||
utils.insert(FileNameModifer, FileName), -- a new table where FileName is a child of FileNameModifier
|
||||
unpack(FileFlags), -- A small optimisation, since their parent does nothing
|
||||
{ provider = '%<' } -- this means that the statusline is cut here when there's not enough space
|
||||
);
|
||||
|
||||
local Ruler = {
|
||||
provider = ' line: %l col: %c',
|
||||
hl = { fg = 'green', bold = false },
|
||||
};
|
||||
|
||||
local ScrollRuler = {
|
||||
-- %l = current line number
|
||||
-- %L = number of lines in the buffer
|
||||
-- %c = column number
|
||||
-- %P = percentage through file of displayed window
|
||||
provider = '%P',
|
||||
};
|
||||
|
||||
local ScrollBar = {
|
||||
static = {
|
||||
sbar = { '▁', '▂', '▃', '▄', '▅', '▆', '▇', '█' },
|
||||
-- sbar = { '🭶', '🭷', '🭸', '🭹', '🭺', '🭻' }
|
||||
},
|
||||
|
||||
provider = function(self)
|
||||
local curr_line = vim.api.nvim_win_get_cursor(0)[1];
|
||||
local lines = vim.api.nvim_buf_line_count(0);
|
||||
local i = math.floor((curr_line - 1) / lines * #self.sbar) + 1;
|
||||
return string.rep(self.sbar[i], 2);
|
||||
end,
|
||||
|
||||
hl = { fg = 'cyan', bg = 'bright_bg' },
|
||||
};
|
||||
|
||||
local LSPActive = {
|
||||
condition = conditions.lsp_attached,
|
||||
update = { 'LspAttach', 'LspDetach' },
|
||||
|
||||
provider = function()
|
||||
local names = {};
|
||||
for _, server in pairs(vim.lsp.get_clients()) do
|
||||
table.insert(names, server.name);
|
||||
end;
|
||||
return ' [' .. table.concat(names, ' ') .. '] ';
|
||||
end,
|
||||
|
||||
hl = { fg = 'green', bold = false },
|
||||
};
|
||||
|
||||
local spinner_frames = { '⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏' };
|
||||
|
||||
-- From https://github.com/mhartington/dotfiles/blob/5961460e3a492f7815259a692fca5ca2a1df924a/config/nvim/lua/mh/statusline/lsp_status.lua#L4
|
||||
local function get_lsp_progress()
|
||||
local messages = require('lsp-status/messaging').messages;
|
||||
local buf_messages = messages();
|
||||
local msgs = {};
|
||||
|
||||
for _, msg in ipairs(buf_messages) do
|
||||
local contents;
|
||||
|
||||
if msg.progress then
|
||||
contents = msg.title;
|
||||
|
||||
if msg.spinner then
|
||||
contents = spinner_frames[(msg.spinner % #spinner_frames) + 1] .. ' ' .. contents;
|
||||
end;
|
||||
elseif msg.status then
|
||||
contents = msg.content;
|
||||
|
||||
if msg.uri then
|
||||
local space = math.min(60, math.floor(0.6 * vim.fn.winwidth(0)));
|
||||
local filename = vim.uri_to_fname(msg.uri);
|
||||
|
||||
filename = vim.fn.fnamemodify(filename, ':~:.');
|
||||
|
||||
if #filename > space then
|
||||
filename = vim.fn.pathshorten(filename);
|
||||
end;
|
||||
|
||||
contents = '(' .. filename .. ') ' .. contents;
|
||||
end;
|
||||
else
|
||||
contents = msg.content;
|
||||
end;
|
||||
|
||||
table.insert(msgs, contents);
|
||||
end;
|
||||
|
||||
return table.concat(msgs, ' ');
|
||||
end;
|
||||
|
||||
local LSPMessages = {
|
||||
provider = function()
|
||||
local progress = get_lsp_progress();
|
||||
|
||||
if progress == '' then
|
||||
return '';
|
||||
else
|
||||
return ' ' .. progress;
|
||||
end;
|
||||
end,
|
||||
hl = { fg = 'purple' },
|
||||
};
|
||||
|
||||
local Diagnostics = {
|
||||
condition = conditions.has_diagnostics,
|
||||
|
||||
static = {
|
||||
error_icon = ' ',
|
||||
warn_icon = ' ',
|
||||
info_icon = ' ',
|
||||
hint_icon = ' ',
|
||||
},
|
||||
|
||||
init = function(self)
|
||||
self.errors = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.ERROR });
|
||||
self.warnings = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.WARN });
|
||||
self.hints = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.HINT });
|
||||
self.info = #vim.diagnostic.get(0, { severity = vim.diagnostic.severity.INFO });
|
||||
end,
|
||||
|
||||
update = { 'DiagnosticChanged', 'BufEnter' },
|
||||
|
||||
{
|
||||
provider = function(self)
|
||||
-- 0 is just another output, we can decide to print it or not!
|
||||
return self.errors > 0 and (self.error_icon .. self.errors);
|
||||
end,
|
||||
hl = { fg = 'diag_error' },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
return self.warnings > 0 and (self.warn_icon .. self.warnings);
|
||||
end,
|
||||
hl = { fg = 'diag_warn' },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
return self.info > 0 and (self.info_icon .. self.info);
|
||||
end,
|
||||
hl = { fg = 'diag_info' },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
return self.hints > 0 and (self.hint_icon .. self.hints);
|
||||
end,
|
||||
hl = { fg = 'diag_hint' },
|
||||
},
|
||||
};
|
||||
|
||||
local Git = {
|
||||
condition = conditions.is_git_repo,
|
||||
|
||||
init = function(self)
|
||||
self.status_dict = vim.b.gitsigns_status_dict;
|
||||
self.has_changes = self.status_dict.added ~= 0 or
|
||||
self.status_dict.removed ~= 0 or
|
||||
self.status_dict.changed ~= 0;
|
||||
end,
|
||||
|
||||
hl = { fg = 'orange' },
|
||||
|
||||
{ -- git branch name
|
||||
provider = function(self)
|
||||
return ' ' .. self.status_dict.head;
|
||||
end,
|
||||
hl = { bold = true },
|
||||
},
|
||||
-- You could handle delimiters, icons and counts similar to Diagnostics
|
||||
{
|
||||
condition = function(self)
|
||||
return self.has_changes;
|
||||
end,
|
||||
provider = '(',
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
local count = self.status_dict.added or 0;
|
||||
return count > 0 and ('+' .. count);
|
||||
end,
|
||||
hl = { fg = 'git_add' },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
local count = self.status_dict.removed or 0;
|
||||
return count > 0 and ('-' .. count);
|
||||
end,
|
||||
hl = { fg = 'git_del' },
|
||||
},
|
||||
{
|
||||
provider = function(self)
|
||||
local count = self.status_dict.changed or 0;
|
||||
return count > 0 and ('~' .. count);
|
||||
end,
|
||||
hl = { fg = 'git_change' },
|
||||
},
|
||||
{
|
||||
condition = function(self)
|
||||
return self.has_changes;
|
||||
end,
|
||||
provider = ')',
|
||||
},
|
||||
};
|
||||
|
||||
local Align = { provider = '%=' };
|
||||
local Space = { provider = ' ' };
|
||||
|
||||
Left = utils.surround({ '', '' }, 'bright_bg', { ViMode, Diagnostics, LSPMessages });
|
||||
Middle = utils.surround({ '', '' }, 'bright_bg', { LSPActive, FileNameBlock, Ruler });
|
||||
Right = utils.surround({ '', '' }, 'bright_bg', { Git, Space, ScrollRuler, Space, ScrollBar });
|
||||
|
||||
local DefaultStatusline = {
|
||||
hl = { bg = 'dark_bg' },
|
||||
condition = function()
|
||||
return true;
|
||||
end,
|
||||
Left,
|
||||
Align,
|
||||
Middle,
|
||||
Align,
|
||||
Right,
|
||||
};
|
||||
|
||||
local StatusLines = {
|
||||
hl = function()
|
||||
if conditions.is_active() then
|
||||
return 'StatusLine';
|
||||
else
|
||||
return 'StatusLineNC';
|
||||
end;
|
||||
end,
|
||||
|
||||
-- the first statusline with no condition, or which condition returns true is used.
|
||||
-- think of it as a switch case with breaks to stop fallthrough.
|
||||
fallthrough = false,
|
||||
|
||||
DefaultStatusline,
|
||||
};
|
||||
|
||||
-- Make it global
|
||||
vim.opt.laststatus = 3;
|
||||
|
||||
require('heirline').setup({
|
||||
statusline = StatusLines,
|
||||
});
|
|
@ -1,26 +0,0 @@
|
|||
local highlight = {
|
||||
"RainbowRed",
|
||||
"RainbowYellow",
|
||||
"RainbowBlue",
|
||||
"RainbowOrange",
|
||||
"RainbowGreen",
|
||||
"RainbowViolet",
|
||||
"RainbowCyan",
|
||||
}
|
||||
local hooks = require('ibl.hooks')
|
||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" })
|
||||
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" })
|
||||
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" })
|
||||
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" })
|
||||
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" })
|
||||
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" })
|
||||
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" })
|
||||
end)
|
||||
|
||||
require('ibl').setup({
|
||||
indent = {
|
||||
highlight = highlight,
|
||||
char = "▏",
|
||||
},
|
||||
})
|
|
@ -1,9 +0,0 @@
|
|||
require('lualine').setup({
|
||||
options = {
|
||||
theme = 'dracula',
|
||||
globalstatus = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_x = {'g:coc_status', 'bo:filetype'},
|
||||
}
|
||||
})
|
|
@ -1,23 +0,0 @@
|
|||
local map = require('mini.map')
|
||||
map.setup({
|
||||
integrations = {
|
||||
map.gen_integration.builtin_search(),
|
||||
map.gen_integration.gitsigns(),
|
||||
map.gen_integration.diagnostic(),
|
||||
},
|
||||
window = {
|
||||
focusable = false,
|
||||
width = 7,
|
||||
winblend = 75,
|
||||
},
|
||||
})
|
||||
|
||||
local ts_input = require('mini.surround').gen_spec.input.treesitter
|
||||
require('mini.surround').setup({
|
||||
custom_surroundings = {
|
||||
-- Use tree-sitter to search for function call
|
||||
f = {
|
||||
input = ts_input({ outer = '@call.outer', inner = '@call.inner' })
|
||||
},
|
||||
}
|
||||
})
|
|
@ -1,38 +1,63 @@
|
|||
-- Override netrw
|
||||
vim.g.loaded_netrw = 0
|
||||
vim.g.loaded_netrwPlugin = 0
|
||||
vim.g.loaded_netrw = 0;
|
||||
vim.g.loaded_netrwPlugin = 0;
|
||||
|
||||
require('neo-tree').setup({
|
||||
close_if_last_window = true,
|
||||
enable_refresh_on_write = true,
|
||||
close_if_last_window = true,
|
||||
enable_refresh_on_write = true,
|
||||
|
||||
window = {
|
||||
width = 22,
|
||||
},
|
||||
|
||||
filesystem = {
|
||||
use_libuv_file_watcher = true,
|
||||
group_empty_dirs = true,
|
||||
|
||||
filtered_items = {
|
||||
visible = false,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = true,
|
||||
hide_by_name = {},
|
||||
hide_by_pattern = {},
|
||||
always_show = {},
|
||||
never_show = {},
|
||||
never_show_by_pattern = {},
|
||||
window = {
|
||||
width = 22,
|
||||
},
|
||||
},
|
||||
|
||||
source_selector = {
|
||||
winbar = true,
|
||||
statusline = false
|
||||
},
|
||||
filesystem = {
|
||||
use_libuv_file_watcher = true,
|
||||
group_empty_dirs = true,
|
||||
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
leave_dirs_open = true,
|
||||
}
|
||||
})
|
||||
filtered_items = {
|
||||
visible = false,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = true,
|
||||
hide_by_name = {},
|
||||
hide_by_pattern = {},
|
||||
always_show = {},
|
||||
never_show = {},
|
||||
never_show_by_pattern = {},
|
||||
},
|
||||
},
|
||||
|
||||
source_selector = {
|
||||
winbar = true,
|
||||
statusline = false,
|
||||
},
|
||||
|
||||
follow_current_file = {
|
||||
enabled = true,
|
||||
leave_dirs_open = true,
|
||||
},
|
||||
});
|
||||
|
||||
local function is_neotree_open()
|
||||
local manager = require('neo-tree.sources.manager');
|
||||
local renderer = require('neo-tree.ui.renderer');
|
||||
local state = manager.get_state('filesystem');
|
||||
return renderer.window_exists(state);
|
||||
end;
|
||||
|
||||
-- Auto open Neo-Tree on big enough window
|
||||
vim.api.nvim_create_autocmd({ 'VimEnter', 'VimResized' }, {
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
if vim.api.nvim_eval([[&columns]]) > 100 then
|
||||
if is_neotree_open() == false then
|
||||
vim.cmd[[Neotree show]];
|
||||
vim.cmd[[Neotree close]];
|
||||
vim.cmd[[Neotree show]];
|
||||
end;
|
||||
else
|
||||
if is_neotree_open() then
|
||||
vim.cmd[[Neotree close]];
|
||||
end;
|
||||
end;
|
||||
end,
|
||||
});
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
" Auto open Neo-Tree on big enough window
|
||||
function! OpenTree() abort
|
||||
if &columns > 100
|
||||
Neotree show
|
||||
Neotree close
|
||||
Neotree show
|
||||
endif
|
||||
lua MiniMap.open()
|
||||
endfunction
|
||||
|
||||
autocmd VimEnter * call OpenTree()
|
|
@ -1,13 +0,0 @@
|
|||
" use vscode keybinds for snippets completion
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ coc#pum#visible() ? coc#_select_confirm() :
|
||||
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
|
||||
\ CheckBackspace() ? "\<TAB>" :
|
||||
\ coc#refresh()
|
||||
|
||||
function! CheckBackspace() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~# '\s'
|
||||
endfunction
|
||||
|
||||
let g:coc_snippet_next = '<tab>'
|
|
@ -1,21 +0,0 @@
|
|||
lua << EOF
|
||||
|
||||
require('nvim-treesitter.configs').setup({
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
|
||||
require('treesitter-context').setup({
|
||||
enable = true,
|
||||
max_lines = 3,
|
||||
min_window_height = 20,
|
||||
})
|
||||
|
||||
vim.filetype.add({
|
||||
pattern = { [".*/hypr/.*%.conf"] = "hyprlang" },
|
||||
})
|
||||
|
||||
EOF
|
||||
|
||||
" Add line under context
|
||||
hi TreesitterContextBottom gui=underline guisp=Grey
|
167
common/home/neovim/theme.nix
Normal file
167
common/home/neovim/theme.nix
Normal file
|
@ -0,0 +1,167 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
nvim-theme-src,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) neovimIde;
|
||||
inherit (lib) fileContents optionals;
|
||||
inherit (pkgs) vimPlugins;
|
||||
in {
|
||||
programs = {
|
||||
neovim = {
|
||||
extraPackages = with pkgs; [
|
||||
bat
|
||||
];
|
||||
|
||||
plugins =
|
||||
[
|
||||
{
|
||||
plugin = vimPlugins.dracula-nvim.overrideAttrs {
|
||||
src = nvim-theme-src;
|
||||
};
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
-- set dot icon in place of trailing whitespaces
|
||||
vim.opt.listchars = {
|
||||
tab = '→ ',
|
||||
trail = '•',
|
||||
extends = '⟩',
|
||||
precedes = '⟨',
|
||||
nbsp = '␣',
|
||||
};
|
||||
vim.opt.list = true;
|
||||
|
||||
-- Add visual indicator for trailing whitespaces
|
||||
vim.opt.fillchars = { eob = " " };
|
||||
vim.fn.matchadd('errorMsg', [[\s\+$]]);
|
||||
|
||||
vim.cmd.colorscheme('dracula');
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = vimPlugins.indent-blankline-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
local highlight = {
|
||||
"RainbowRed",
|
||||
"RainbowYellow",
|
||||
"RainbowBlue",
|
||||
"RainbowOrange",
|
||||
"RainbowGreen",
|
||||
"RainbowViolet",
|
||||
"RainbowCyan",
|
||||
};
|
||||
|
||||
local hooks = require('ibl.hooks');
|
||||
hooks.register(hooks.type.HIGHLIGHT_SETUP, function()
|
||||
vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" });
|
||||
vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" });
|
||||
vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" });
|
||||
vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" });
|
||||
vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" });
|
||||
vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" });
|
||||
vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#56B6C2" });
|
||||
end);
|
||||
|
||||
require('ibl').setup({
|
||||
indent = {
|
||||
highlight = highlight,
|
||||
char = "▏",
|
||||
},
|
||||
});
|
||||
'';
|
||||
}
|
||||
|
||||
# Deps of heirline config
|
||||
vimPlugins.nvim-web-devicons
|
||||
{
|
||||
plugin = vimPlugins.heirline-nvim;
|
||||
type = "lua";
|
||||
config = fileContents ./plugins/heirline.lua;
|
||||
}
|
||||
]
|
||||
++ optionals neovimIde [
|
||||
{
|
||||
plugin = vimPlugins.neo-tree-nvim;
|
||||
type = "lua";
|
||||
config = fileContents ./plugins/neotree.lua;
|
||||
}
|
||||
{
|
||||
plugin = vimPlugins.codewindow-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
--
|
||||
local codewindow = require('codewindow');
|
||||
|
||||
codewindow.setup({
|
||||
auto_enable = false,
|
||||
minimap_width = 8,
|
||||
relative = 'editor',
|
||||
window_border = 'none',
|
||||
exclude_filetypes = { 'help' },
|
||||
});
|
||||
|
||||
vim.api.nvim_create_autocmd({ 'VimEnter', 'VimResized' }, {
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
if vim.api.nvim_win_get_width(0) < 88 then
|
||||
codewindow.close_minimap();
|
||||
else
|
||||
codewindow.open_minimap();
|
||||
end
|
||||
end,
|
||||
});
|
||||
'';
|
||||
}
|
||||
{
|
||||
plugin = vimPlugins.transparent-nvim;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
require('transparent').setup({
|
||||
groups = {
|
||||
'Normal',
|
||||
'NormalNC',
|
||||
'Comment',
|
||||
'Constant',
|
||||
'Special',
|
||||
'Identifier',
|
||||
'Statement',
|
||||
'PreProc',
|
||||
'Type',
|
||||
'Underlined',
|
||||
'Todo',
|
||||
'String',
|
||||
'Function',
|
||||
'Conditional',
|
||||
'Repeat',
|
||||
'Operator',
|
||||
'Structure',
|
||||
'LineNr',
|
||||
'NonText',
|
||||
'SignColumn',
|
||||
'CursorLine',
|
||||
'CursorLineNr',
|
||||
'StatusLine',
|
||||
'StatusLineNC',
|
||||
'EndOfBuffer',
|
||||
},
|
||||
extra_groups = {},
|
||||
exclude_groups = {},
|
||||
});
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
40
common/home/neovim/treesitter.nix
Normal file
40
common/home/neovim/treesitter.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{pkgs, ...}: let
|
||||
inherit (pkgs) vimPlugins;
|
||||
in {
|
||||
programs = {
|
||||
neovim = {
|
||||
plugins = [
|
||||
{
|
||||
plugin = vimPlugins.nvim-treesitter-context;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
require('treesitter-context').setup({
|
||||
enable = true,
|
||||
max_lines = 3,
|
||||
min_window_height = 20,
|
||||
});
|
||||
|
||||
vim.cmd.hi('TreesitterContextBottom', 'gui=underline guisp=Grey');
|
||||
'';
|
||||
}
|
||||
|
||||
vimPlugins.nvim-treesitter-textobjects
|
||||
|
||||
{
|
||||
plugin = vimPlugins.nvim-treesitter.withAllGrammars;
|
||||
type = "lua";
|
||||
config =
|
||||
# lua
|
||||
''
|
||||
require('nvim-treesitter.configs').setup({
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
});
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
home.packages =
|
||||
(with config.customPkgs; [
|
||||
(with self.packages.${pkgs.system}; [
|
||||
pokemon-colorscripts
|
||||
repl
|
||||
])
|
||||
|
@ -12,19 +12,26 @@
|
|||
undollar
|
||||
])
|
||||
++ (with pkgs; [
|
||||
dracula-theme
|
||||
neofetch
|
||||
progress
|
||||
wget
|
||||
tree
|
||||
openssh
|
||||
mosh
|
||||
rsync
|
||||
killall
|
||||
imagemagick
|
||||
usbutils
|
||||
zip
|
||||
unzip
|
||||
# Networking
|
||||
dig.dnsutils
|
||||
]);
|
||||
mosh
|
||||
openssh
|
||||
rsync
|
||||
wget
|
||||
|
||||
# Misc CLI stuff
|
||||
killall
|
||||
nix-output-monitor
|
||||
progress
|
||||
tree
|
||||
])
|
||||
++ [
|
||||
# This could help as well: nix derivation show -r /run/current-system
|
||||
(pkgs.writeShellApplication {
|
||||
name = "listDerivs";
|
||||
text = ''
|
||||
nix-store --query --requisites /run/current-system | cut -d- -f2- | sort -u
|
||||
'';
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
|
@ -14,9 +14,7 @@
|
|||
plugins = with pkgs.tmuxPlugins; [dracula];
|
||||
|
||||
extraConfig =
|
||||
/*
|
||||
bash
|
||||
*/
|
||||
# bash
|
||||
''
|
||||
bind-key -n Home send Escape "OH"
|
||||
bind-key -n End send Escape "OF"
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
{pkgs, ...} @ inputs: let
|
||||
trash = pkgs.callPackage ./trash-d.nix inputs;
|
||||
in {
|
||||
home.packages = [trash];
|
||||
{
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
home.packages = [self.packages.${pkgs.system}.trash-d];
|
||||
|
||||
programs.bash.shellAliases.rm = "trash";
|
||||
}
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
{
|
||||
trash-d-src,
|
||||
stdenv,
|
||||
dmd,
|
||||
dub,
|
||||
ronn,
|
||||
...
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "trash";
|
||||
version = trash-d-src.shortRev;
|
||||
|
||||
src = trash-d-src;
|
||||
|
||||
buildInputs = [dub dmd ronn];
|
||||
|
||||
buildPhase = ''
|
||||
# https://github.com/svanderburg/node2nix/issues/217#issuecomment-751311272
|
||||
export HOME=$(mktemp -d)
|
||||
|
||||
dub build
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/man/man1
|
||||
|
||||
cp -a ./build/trash $out/bin/
|
||||
|
||||
ronn --roff --pipe MANUAL.md > $out/man/man1/trash.1
|
||||
'';
|
||||
}
|
|
@ -1,12 +1,15 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
environment.systemPackages = with pkgs; [
|
||||
(writeShellApplication {
|
||||
}: let
|
||||
inherit (lib) optionals;
|
||||
in {
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellApplication {
|
||||
name = "rebuild-no-cache";
|
||||
runtimeInputs = [config.nh.package];
|
||||
runtimeInputs = [config.programs.nh.package];
|
||||
text = ''
|
||||
nh os switch -- --option binary-caches "https://cache.nixos.org" "$@"
|
||||
'';
|
||||
|
@ -15,22 +18,29 @@
|
|||
|
||||
nix = {
|
||||
settings = {
|
||||
substituters = [
|
||||
"https://hyprland.cachix.org"
|
||||
"https://nix-gaming.cachix.org"
|
||||
# Nixpkgs-Wayland
|
||||
"https://cache.nixos.org"
|
||||
"https://nixpkgs-wayland.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
# Nix-community
|
||||
"https://nix-community.cachix.org"
|
||||
# Nh
|
||||
"https://viperml.cachix.org"
|
||||
# Caddy
|
||||
"https://caddycf.cachix.org"
|
||||
# Personal config cache
|
||||
"https://cache.nelim.org"
|
||||
];
|
||||
substituters =
|
||||
[
|
||||
"https://hyprland.cachix.org"
|
||||
"https://nix-gaming.cachix.org"
|
||||
# Nixpkgs-Wayland
|
||||
"https://cache.nixos.org"
|
||||
"https://nixpkgs-wayland.cachix.org"
|
||||
"https://nix-community.cachix.org"
|
||||
# Nix-community
|
||||
"https://nix-community.cachix.org"
|
||||
# Nh
|
||||
"https://viperml.cachix.org"
|
||||
# Caddy
|
||||
"https://caddycf.cachix.org"
|
||||
]
|
||||
++ optionals (!config.services.nix-serve.enable && config.services.tailscale.enable) [
|
||||
# Personal config cache
|
||||
"https://cache.nelim.org"
|
||||
]
|
||||
++ optionals (!config.services.nix-serve.enable && !config.services.tailscale.enable) [
|
||||
"http://10.0.0.249:5000"
|
||||
];
|
||||
|
||||
trusted-public-keys = [
|
||||
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
|
||||
"nix-gaming.cachix.org-1:nbjlureqMbRAxR1gJ/f3hxemL9svXaZF/Ees8vCUUs4="
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
nur,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
./vars
|
||||
./pkgs
|
||||
./modules/global.nix
|
||||
nur.nixosModules.nur
|
||||
];
|
||||
|
||||
nix = {
|
||||
|
@ -23,16 +20,10 @@
|
|||
substituters = [
|
||||
# Nix-community
|
||||
"https://nix-community.cachix.org"
|
||||
|
||||
# FIXME: cache doesn't work
|
||||
# Personal config cache
|
||||
# "https://cache.nelim.org"
|
||||
];
|
||||
trustedPublicKeys = [
|
||||
# Nix-community
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
# Personal config cache
|
||||
# "cache.nelim.org:JmFqkUdH11EA9EZOFAGVHuRYp7EbsdJDHvTQzG2pPyY="
|
||||
];
|
||||
};
|
||||
|
||||
|
@ -48,10 +39,7 @@
|
|||
};
|
||||
}
|
||||
|
||||
nur.hmModules.nur
|
||||
|
||||
./home
|
||||
./pkgs
|
||||
|
||||
{
|
||||
programs.bash.sessionVariables = {
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{nixpkgs-wayland, ...} @ inputs: [
|
||||
(import ./dracula-theme inputs)
|
||||
|
||||
nixpkgs-wayland.overlay
|
||||
]
|
|
@ -1,46 +0,0 @@
|
|||
{
|
||||
bat-theme-src,
|
||||
gtk-theme-src,
|
||||
xresources-theme-src,
|
||||
...
|
||||
} @ inputs: (final: prev: {
|
||||
dracula-theme = prev.dracula-theme.overrideAttrs (oldAttrs: let
|
||||
git-colors = prev.callPackage ./git.nix inputs;
|
||||
plymouth = prev.callPackage ./plymouth.nix inputs;
|
||||
wallpaper = prev.fetchurl (import ./wallpaper.nix);
|
||||
in {
|
||||
version = gtk-theme-src.shortRev;
|
||||
src = gtk-theme-src;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/share/plymouth/themes $out/wallpapers
|
||||
cp -a ${wallpaper} $out/wallpapers/waves.png
|
||||
|
||||
cp -a ${bat-theme-src}/Dracula.tmTheme $out/bat
|
||||
cp -a ${git-colors}/git-colors $out/git-colors
|
||||
cp -a ${plymouth}/share/plymouth/themes/dracula $out/share/plymouth/themes/
|
||||
cp -a ${xresources-theme-src}/Xresources $out/xres
|
||||
|
||||
# -------------------------------------------
|
||||
mkdir -p $out/share/themes/Dracula
|
||||
cp -a {assets,cinnamon,gnome-shell,gtk-2.0,gtk-3.0,gtk-3.20,gtk-4.0,index.theme,metacity-1,unity,xfwm4} $out/share/themes/Dracula
|
||||
|
||||
cp -a kde/{color-schemes,plasma} $out/share/
|
||||
cp -a kde/kvantum $out/share/Kvantum
|
||||
|
||||
mkdir -p $out/share/aurorae/themes
|
||||
cp -a kde/aurorae/* $out/share/aurorae/themes/
|
||||
|
||||
mkdir -p $out/share/sddm/themes
|
||||
cp -a kde/sddm/* $out/share/sddm/themes/
|
||||
|
||||
mkdir -p $out/share/icons/Dracula-cursors
|
||||
mv kde/cursors/Dracula-cursors/index.theme $out/share/icons/Dracula-cursors/cursor.theme
|
||||
mv kde/cursors/Dracula-cursors/cursors $out/share/icons/Dracula-cursors/cursors
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
});
|
||||
})
|
|
@ -1,23 +0,0 @@
|
|||
{
|
||||
stdenv,
|
||||
git-theme-src,
|
||||
...
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "dracula-git";
|
||||
version = git-theme-src.shortRev;
|
||||
|
||||
src = git-theme-src;
|
||||
|
||||
installPhase = ''
|
||||
# Git colors
|
||||
cp -a ./config/gitconfig ./git-colors
|
||||
chmod 777 ./git-colors
|
||||
|
||||
line=$(grep -n 'Dracula Dark Theme' ./git-colors | cut -d: -f1)
|
||||
sed -i "1,$((line-1))d" ./git-colors
|
||||
|
||||
mkdir $out
|
||||
cp -a ./git-colors $out
|
||||
'';
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
url = "https://raw.githubusercontent.com/aynp/dracula-wallpapers/main/Art/4k/Waves%201.png";
|
||||
hash = "sha256-f9FwSOSvqTeDj4bOjYUQ6TM+/carCD9o5dhg/MnP/lk=";
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
diff --git a/src/libstore/path.cc b/src/libstore/path.cc
|
||||
index e642abcd5..0e584ef33 100644
|
||||
--- a/src/libstore/path.cc
|
||||
+++ b/src/libstore/path.cc
|
||||
@@ -12,7 +12,7 @@ static void checkName(std::string_view path, std::string_view name)
|
||||
if (!((c >= '0' && c <= '9')
|
||||
|| (c >= 'a' && c <= 'z')
|
||||
|| (c >= 'A' && c <= 'Z')
|
||||
- || c == '+' || c == '-' || c == '.' || c == '_' || c == '?' || c == '='))
|
||||
+ || c == '+' || c == '-' || c == '.' || c == '_' || c == '?' || c == '=' || c == '!'))
|
||||
throw BadStorePath("store path '%s' contains illegal character '%s'", path, c);
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
} @ inputs: let
|
||||
inherit (lib) concatMapAttrs filterAttrs mkOption pathExists types;
|
||||
|
||||
mkPackage = name: v: {
|
||||
${name} = pkgs.callPackage ./${name} inputs;
|
||||
};
|
||||
|
||||
rmNotPackage = name: value:
|
||||
value
|
||||
== "directory"
|
||||
&& pathExists ./${name}/default.nix;
|
||||
|
||||
packages = filterAttrs rmNotPackage (builtins.readDir ./.);
|
||||
|
||||
pkgSet = concatMapAttrs mkPackage packages;
|
||||
in {
|
||||
options.customPkgs = mkOption {
|
||||
type = types.attrs;
|
||||
};
|
||||
|
||||
config.customPkgs = pkgSet;
|
||||
}
|
|
@ -1,41 +0,0 @@
|
|||
{
|
||||
stdenv,
|
||||
meson,
|
||||
ninja,
|
||||
pkg-config,
|
||||
glib,
|
||||
libfprint,
|
||||
polkit,
|
||||
dbus,
|
||||
systemd,
|
||||
pam,
|
||||
libpam-wrapper,
|
||||
pam-fprint-grosshack-src,
|
||||
...
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "pam-fprint-grosshack";
|
||||
version = pam-fprint-grosshack-src.shortRev;
|
||||
|
||||
src = pam-fprint-grosshack-src;
|
||||
|
||||
nativeBuildInputs = [
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
glib
|
||||
libfprint
|
||||
polkit
|
||||
dbus
|
||||
systemd
|
||||
pam
|
||||
libpam-wrapper
|
||||
];
|
||||
|
||||
mesonFlags = [
|
||||
"-Dpam_modules_dir=${placeholder "out"}/lib/security"
|
||||
"-Dsysconfdir=${placeholder "out"}/etc"
|
||||
"-Ddbus_service_dir=${placeholder "out"}/share/dbus-1/system-services"
|
||||
"-Dsystemd_system_unit_dir=${placeholder "out"}/lib/systemd/system"
|
||||
];
|
||||
}
|
|
@ -1,110 +0,0 @@
|
|||
{
|
||||
config,
|
||||
writeShellApplication,
|
||||
stdenvNoCC,
|
||||
jre,
|
||||
fetchFromGitHub,
|
||||
fetchurl,
|
||||
makeWrapper,
|
||||
makeDesktopItem,
|
||||
rsync,
|
||||
...
|
||||
}:
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
name = "rars-flatlaf";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "privat";
|
||||
repo = "rars";
|
||||
rev = "fd34014efd65b3cb5a52f1729c3b8240cae0c332";
|
||||
hash = "sha256-D8X/cr+fnq/OOFYfMG9aPss95J8Z2yiROuF9kmHkK40=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
desktopItem = let
|
||||
hyprland = config.home-manager.users.${config.vars.mainUser}.wayland.windowManager.hyprland.finalPackage;
|
||||
execScript = writeShellApplication {
|
||||
name = "execScript";
|
||||
runtimeInputs = [hyprland];
|
||||
text = "(sleep 1; hyprctl dispatch togglefloating) & ${name}";
|
||||
};
|
||||
in
|
||||
makeDesktopItem {
|
||||
name = "RARS";
|
||||
desktopName = "RARS";
|
||||
exec = "${execScript}/bin/execScript";
|
||||
icon = name;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [makeWrapper rsync jre];
|
||||
|
||||
installPhase = let
|
||||
flatlaf = fetchurl {
|
||||
url = "https://repo1.maven.org/maven2/com/formdev/flatlaf/3.2/flatlaf-3.2.jar";
|
||||
hash = "sha256-HAG+G9undDXWtySokKl7lkIUCFI7lEBduu+UgSVaxAA=";
|
||||
};
|
||||
icon = fetchurl {
|
||||
url = "https://riscv.or.jp/wp-content/uploads/2019/06/cropped-RISC-V-logo-figonly-mod-2.png";
|
||||
hash = "sha256-e1/iVmadVzyO77ikBr1cdXsJdDj8TiXh3Oyjek9GwqM=";
|
||||
};
|
||||
in
|
||||
/*
|
||||
bash
|
||||
*/
|
||||
''
|
||||
# ./build-jar.sh
|
||||
mkdir -p build
|
||||
find src -name "*.java" | xargs javac --release 8 -d build
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
find src -type f -not -name "*.java" -exec rsync -R {} build \;
|
||||
else
|
||||
find src -type f -not -name "*.java" -exec cp --parents {} build \;
|
||||
fi
|
||||
cp -rf build/src/* build
|
||||
rm -r build/src
|
||||
cp README.md License.txt build
|
||||
cd build
|
||||
jar cfm ../rars.jar ./META-INF/MANIFEST.MF *
|
||||
chmod +x ../rars.jar
|
||||
|
||||
cd ..
|
||||
|
||||
# ./build-jar-flatlaf.sh
|
||||
mkdir -p build-flatlaf/
|
||||
cd build-flatlaf/
|
||||
|
||||
cp ${flatlaf} ../flatlaf.jar
|
||||
|
||||
jar x < ../rars.jar
|
||||
jar x < "../flatlaf.jar"
|
||||
|
||||
cat > META-INF/MANIFEST.MF <<EOF
|
||||
Manifest-Version: 1.0
|
||||
Implementation-Version: 3.1.1
|
||||
Multi-Release: true
|
||||
Main-Class: rars.Launch
|
||||
EOF
|
||||
|
||||
jar cfm ../rars-flatlaf.jar META-INF/MANIFEST.MF *
|
||||
chmod +x ../rars-flatlaf.jar
|
||||
|
||||
cd ..
|
||||
|
||||
# InstallPhase
|
||||
runHook preInstall
|
||||
|
||||
cat > ./rars.desktop <<EOF
|
||||
EOF
|
||||
|
||||
mkdir -p "$out/share/pixmaps"
|
||||
cp "${icon}" "$out/share/pixmaps/${name}.png"
|
||||
install -D $desktopItem/share/applications/* $out/share/applications/rars.desktop
|
||||
|
||||
export JAR=$out/share/java/${name}/${name}.jar
|
||||
install -D ./${name}.jar $JAR
|
||||
makeWrapper ${jre}/bin/java $out/bin/${name} \
|
||||
--add-flags "-jar $JAR"
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
}
|
|
@ -3,7 +3,7 @@
|
|||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkOption types;
|
||||
inherit (lib) mkDefault mkOption types;
|
||||
flakeDir = config.environment.variables.FLAKE;
|
||||
cfg = config.vars;
|
||||
in {
|
||||
|
@ -23,7 +23,7 @@ in {
|
|||
};
|
||||
|
||||
promptMainColor = mkOption {
|
||||
type = types.enum ["red" "green" "blue" "purple" "orange" "yellow" "cyan" "pink"];
|
||||
type = types.enum (import ./prompt-schemes.nix {});
|
||||
default = "purple";
|
||||
};
|
||||
|
||||
|
@ -32,19 +32,20 @@ in {
|
|||
Colors used in starship prompt
|
||||
'';
|
||||
|
||||
default = import ./prompt-schemes.nix cfg.promptMainColor;
|
||||
default = import ./prompt-schemes.nix {color = cfg.promptMainColor;};
|
||||
|
||||
readOnly = true;
|
||||
type = with types;
|
||||
submodule {
|
||||
options = {
|
||||
textColor = mkOption {type = str;};
|
||||
firstColor = mkOption {type = str;};
|
||||
secondColor = mkOption {type = str;};
|
||||
thirdColor = mkOption {type = str;};
|
||||
fourthColor = mkOption {type = str;};
|
||||
};
|
||||
type = types.submodule {
|
||||
options = let
|
||||
inherit (types) str;
|
||||
in {
|
||||
textColor = mkOption {type = str;};
|
||||
firstColor = mkOption {type = str;};
|
||||
secondColor = mkOption {type = str;};
|
||||
thirdColor = mkOption {type = str;};
|
||||
fourthColor = mkOption {type = str;};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
configDir = mkOption {
|
||||
|
@ -55,28 +56,6 @@ in {
|
|||
'';
|
||||
};
|
||||
|
||||
mainMonitor = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
The name of the main monitor used for Hyprland
|
||||
and Regreet which also uses Hyprland
|
||||
'';
|
||||
# This is to allow a bash script to know whether this value exists
|
||||
default = "null";
|
||||
};
|
||||
|
||||
greetdDupe = mkOption {
|
||||
type = types.bool;
|
||||
description = ''
|
||||
If we should duplicate regreet on all monitors
|
||||
'';
|
||||
default = true;
|
||||
};
|
||||
|
||||
fontSize = mkOption {
|
||||
type = types.nullOr types.float;
|
||||
};
|
||||
|
||||
neovimIde = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
|
@ -84,6 +63,6 @@ in {
|
|||
};
|
||||
|
||||
config = {
|
||||
environment.variables.FLAKE = lib.mkDefault "/home/${cfg.mainUser}/.nix";
|
||||
environment.variables.FLAKE = mkDefault "/home/${cfg.mainUser}/.nix";
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
color: let
|
||||
{color ? null}: let
|
||||
inherit (builtins) attrNames removeAttrs;
|
||||
|
||||
schemes = {
|
||||
"purple" = {
|
||||
textColor = "#090c0c";
|
||||
|
@ -74,4 +76,6 @@ color: let
|
|||
};
|
||||
};
|
||||
in
|
||||
schemes.${color}
|
||||
if ! isNull color
|
||||
then schemes.${color}
|
||||
else attrNames (removeAttrs schemes ["color"])
|
||||
|
|
|
@ -4,15 +4,16 @@ This directory encompasses every device's main configuration file.
|
|||
|
||||
## List of my Devices
|
||||
|
||||
| Name | Description |
|
||||
| ---------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| `android` | My [Nix-On-Droid](https://github.com/nix-community/nix-on-droid) configuration for my OnePlus 9 Pro |
|
||||
| `binto` | My desktop PC with a multi-monitor setup and an NVIDIA (cringe) 3070 |
|
||||
| `cluster` | Two Lenovo mini PCs that make use of [NixOS-pcsd](https://github.com/matt1432/nixos-pcsd) to form a cluster |
|
||||
| `nos` | My custom built NAS |
|
||||
| `oksys` | A very old Acer laptop that went from sailing the seas for years to becoming my web server and VPN host. It is now retired indefinitely. |
|
||||
| `servivi` | A gaming PC in a previous life, it is now used to experiment and do heavier stuff |
|
||||
| `wim` | My 2-1 Lenovo Laptop that I use for uni |
|
||||
| Name | Description |
|
||||
| ----------- | ------------------------------------------------------------------------------------------------------- |
|
||||
| `android` | My [Nix-On-Droid](https://github.com/nix-community/nix-on-droid) configuration for my OnePlus 9 Pro |
|
||||
| `bbsteamie` | My wife's SteamDeck that has a pink case |
|
||||
| `binto` | My desktop PC with a multi-monitor setup and an NVIDIA (cringe) 3070 |
|
||||
| `cluster` | Two Lenovo mini PCs that make use of [NixOS-pcsd](https://github.com/matt1432/nixos-pcsd) to form a cluster |
|
||||
| `nos` | My custom built NAS |
|
||||
| `oksys` | A very old Acer laptop that went from sailing the seas for years to becoming my web server and VPN host. It is now retired indefinitely. |
|
||||
| `servivi` | A gaming PC in a previous life, it is now used as a build farm and hosts game servers |
|
||||
| `wim` | My 2-1 Lenovo Laptop that I use for uni |
|
||||
|
||||
## Global Vars
|
||||
|
||||
|
|
|
@ -1,25 +1,72 @@
|
|||
{
|
||||
home-manager,
|
||||
nixpkgs,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
} @ inputs: rec {
|
||||
extraSpecialArgs = inputs;
|
||||
home-manager-path = home-manager.outPath;
|
||||
pkgs = import nixpkgs {
|
||||
system = "aarch64-linux";
|
||||
overlays = import ../../common/overlays inputs;
|
||||
}: {
|
||||
vars = {
|
||||
mainUser = "nix-on-droid";
|
||||
hostName = "localhost";
|
||||
neovimIde = false;
|
||||
};
|
||||
|
||||
modules = [
|
||||
{
|
||||
options = with pkgs.lib; {
|
||||
environment.variables.FLAKE = mkOption {
|
||||
type = with types; nullOr str;
|
||||
};
|
||||
};
|
||||
}
|
||||
{home-manager.extraSpecialArgs = inputs;}
|
||||
../../common/nix-on-droid.nix
|
||||
./nix-on-droid.nix
|
||||
];
|
||||
environment.variables.FLAKE = "/data/data/com.termux.nix/files/home/.nix";
|
||||
|
||||
terminal.font = "${(pkgs.nerdfonts.override {
|
||||
fonts = [
|
||||
"JetBrainsMono"
|
||||
];
|
||||
})}/share/fonts/truetype/NerdFonts/JetBrainsMonoNerdFontMono-Regular.ttf";
|
||||
|
||||
environment.packages =
|
||||
(with pkgs; [
|
||||
diffutils
|
||||
findutils
|
||||
utillinux
|
||||
tzdata
|
||||
hostname
|
||||
man
|
||||
gnugrep
|
||||
ripgrep
|
||||
gnupg
|
||||
gnused
|
||||
gnutar
|
||||
bzip2
|
||||
gzip
|
||||
xz
|
||||
zip
|
||||
unzip
|
||||
openssh
|
||||
perl
|
||||
which
|
||||
alejandra
|
||||
])
|
||||
++ [
|
||||
(pkgs.writeShellApplication {
|
||||
name = "switch";
|
||||
runtimeInputs = with pkgs; [
|
||||
nix-output-monitor
|
||||
];
|
||||
text = ''
|
||||
exec nix-on-droid ${lib.concatStringsSep " " [
|
||||
"switch"
|
||||
"--flake ${config.environment.variables.FLAKE}"
|
||||
"--builders ssh-ng://matt@100.64.0.7"
|
||||
''"$@"''
|
||||
"|&"
|
||||
"nom"
|
||||
]}
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
||||
environment.etcBackupExtension = ".bak";
|
||||
environment.motd = null;
|
||||
home-manager.backupFileExtension = "hm-bak";
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/Montreal";
|
||||
|
||||
# No touchy
|
||||
system.stateVersion = "23.05";
|
||||
}
|
||||
|
|
|
@ -1,47 +0,0 @@
|
|||
{pkgs, ...}: {
|
||||
vars = {
|
||||
mainUser = "nix-on-droid";
|
||||
hostName = "localhost";
|
||||
neovimIde = false;
|
||||
};
|
||||
|
||||
environment.variables.FLAKE = "/data/data/com.termux.nix/files/home/.nix";
|
||||
|
||||
terminal.font = "${(pkgs.nerdfonts.override {
|
||||
fonts = [
|
||||
"JetBrainsMono"
|
||||
];
|
||||
})}/share/fonts/truetype/NerdFonts/JetBrainsMonoNerdFontMono-Regular.ttf";
|
||||
|
||||
environment.packages = with pkgs; [
|
||||
diffutils
|
||||
findutils
|
||||
utillinux
|
||||
tzdata
|
||||
hostname
|
||||
man
|
||||
gnugrep
|
||||
ripgrep
|
||||
gnupg
|
||||
gnused
|
||||
gnutar
|
||||
bzip2
|
||||
gzip
|
||||
xz
|
||||
zip
|
||||
unzip
|
||||
openssh
|
||||
perl
|
||||
alejandra
|
||||
];
|
||||
|
||||
environment.etcBackupExtension = ".bak";
|
||||
environment.motd = null;
|
||||
home-manager.backupFileExtension = "hm-bak";
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/Montreal";
|
||||
|
||||
# No touchy
|
||||
system.stateVersion = "23.05";
|
||||
}
|
57
devices/bbsteamie/default.nix
Normal file
57
devices/bbsteamie/default.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
config,
|
||||
jovian,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) mainUser hostName;
|
||||
in {
|
||||
imports = [
|
||||
jovian.nixosModules.default
|
||||
../../modules/kmscon.nix
|
||||
../../modules/sshd.nix
|
||||
|
||||
./hardware-configuration.nix
|
||||
|
||||
./modules/desktop.nix
|
||||
|
||||
self.nixosModules.plymouth
|
||||
];
|
||||
|
||||
vars = {
|
||||
mainUser = "mariah";
|
||||
hostName = "bbsteamie";
|
||||
promptMainColor = "pink";
|
||||
};
|
||||
|
||||
boot.plymouth = {
|
||||
enable = true;
|
||||
theme = "steamos";
|
||||
};
|
||||
|
||||
users.users.${mainUser} = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"adm"
|
||||
];
|
||||
};
|
||||
|
||||
networking = {
|
||||
inherit hostName;
|
||||
networkmanager.enable = true;
|
||||
};
|
||||
|
||||
home-manager.users.${mainUser} = {
|
||||
imports = [];
|
||||
|
||||
# No touchy
|
||||
home.stateVersion = "24.11";
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/Montreal";
|
||||
|
||||
# No touchy
|
||||
system.stateVersion = "24.11";
|
||||
}
|
57
devices/bbsteamie/hardware-configuration.nix
Normal file
57
devices/bbsteamie/hardware-configuration.nix
Normal file
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
modulesPath,
|
||||
...
|
||||
}: {
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
||||
|
||||
jovian = {
|
||||
steamos.useSteamOSConfig = true;
|
||||
|
||||
devices.steamdeck = {
|
||||
enable = true;
|
||||
enableGyroDsuService = true;
|
||||
};
|
||||
hardware.has.amd.gpu = true;
|
||||
};
|
||||
|
||||
boot = {
|
||||
kernelModules = ["kvm-amd"];
|
||||
initrd.availableKernelModules = ["nvme" "xhci_pci" "usbhid" "sdhci_pci"];
|
||||
|
||||
loader = {
|
||||
efi.canTouchEfiVariables = true;
|
||||
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
configurationLimit = 30;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
virtualisation.waydroid.enable = true;
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/NIXROOT";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-label/NIXBOOT";
|
||||
fsType = "vfat";
|
||||
options = ["fmask=0022" "dmask=0022"];
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{
|
||||
device = "/.swapfile";
|
||||
size = 16 * 1024; # 16GB
|
||||
}
|
||||
];
|
||||
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
161
devices/bbsteamie/modules/desktop.nix
Normal file
161
devices/bbsteamie/modules/desktop.nix
Normal file
|
@ -0,0 +1,161 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) getExe mkForce;
|
||||
inherit (config.vars) mainUser;
|
||||
|
||||
# FIXME: switch to wayland when possible
|
||||
defaultSession = "plasmax11";
|
||||
|
||||
switch-session = pkgs.writeShellApplication {
|
||||
name = "switch-session";
|
||||
|
||||
text = ''
|
||||
mkdir -p /etc/sddm.conf.d
|
||||
|
||||
cat <<EOF | tee /etc/sddm.conf.d/autologin.conf
|
||||
[Autologin]
|
||||
User=${mainUser}
|
||||
Session=$1
|
||||
Relogin=true
|
||||
EOF
|
||||
'';
|
||||
};
|
||||
|
||||
gaming-mode = pkgs.writeShellScriptBin "gaming-mode" ''
|
||||
sudo ${pkgs.systemd}/bin/systemctl start to-gaming-mode.service
|
||||
'';
|
||||
in {
|
||||
services = {
|
||||
xserver.enable = true;
|
||||
desktopManager.plasma6.enable = true;
|
||||
|
||||
displayManager = {
|
||||
sddm = {
|
||||
enable = true;
|
||||
autoLogin.relogin = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Sets the default session at launch
|
||||
systemd.services."set-session" = {
|
||||
wantedBy = ["multi-user.target"];
|
||||
before = ["display-manager.service"];
|
||||
|
||||
path = [switch-session];
|
||||
|
||||
script = ''
|
||||
switch-session "${defaultSession}"
|
||||
'';
|
||||
};
|
||||
|
||||
# Allows switching to gaming mode
|
||||
systemd.services."to-gaming-mode" = {
|
||||
wantedBy = mkForce [];
|
||||
|
||||
path = [switch-session];
|
||||
|
||||
script = ''
|
||||
switch-session "gamescope-wayland"
|
||||
systemctl restart display-manager
|
||||
sleep 10
|
||||
switch-session "${defaultSession}"
|
||||
'';
|
||||
};
|
||||
|
||||
# Make it so we don't need root to switch to gaming mode
|
||||
security.sudo.extraRules = [
|
||||
{
|
||||
users = [mainUser];
|
||||
groups = [100];
|
||||
commands = [
|
||||
{
|
||||
command = "${pkgs.systemd}/bin/systemctl start to-gaming-mode.service";
|
||||
options = ["SETENV" "NOPASSWD"];
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
# Add desktop entry to make it GUI friendly
|
||||
home-manager.users.${mainUser}.xdg.desktopEntries."Gaming Mode" = {
|
||||
name = "Gaming Mode";
|
||||
exec = getExe gaming-mode;
|
||||
icon = "steam";
|
||||
terminal = false;
|
||||
type = "Application";
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
# Misc apps for DE
|
||||
pkgs.firefox
|
||||
pkgs.kdePackages.discover
|
||||
pkgs.wl-clipboard
|
||||
|
||||
# FIXME:Ryujinx ACNH crashes on OpenGL AND Vulkan
|
||||
# https://github.com/Ryujinx/Ryujinx/issues/6993
|
||||
# https://github.com/Ryujinx/Ryujinx/issues/6708
|
||||
self.packages.${pkgs.system}.yuzu
|
||||
pkgs.steam-rom-manager
|
||||
];
|
||||
|
||||
programs = {
|
||||
xwayland.enable = true;
|
||||
kdeconnect.enable = true;
|
||||
|
||||
steam = {
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
extraCompatPackages = [
|
||||
pkgs.proton-ge-bin
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Enable flatpak support
|
||||
services.flatpak.enable = true;
|
||||
services.packagekit.enable = true;
|
||||
|
||||
# Jovian NixOS settings
|
||||
jovian.steam = {
|
||||
# Steam > Settings > System > Enable Developer Mode
|
||||
# Steam > Developer > CEF Remote Debugging
|
||||
enable = true;
|
||||
user = mainUser;
|
||||
|
||||
desktopSession = config.services.displayManager.defaultSession;
|
||||
};
|
||||
|
||||
jovian.decky-loader = {
|
||||
enable = true;
|
||||
user = mainUser;
|
||||
stateDir = "/home/${mainUser}/.local/share/decky"; # Keep scoped to user
|
||||
# https://github.com/Jovian-Experiments/Jovian-NixOS/blob/1171169117f63f1de9ef2ea36efd8dcf377c6d5a/modules/decky-loader.nix#L80-L84
|
||||
|
||||
extraPackages = with pkgs; [
|
||||
# Generic packages
|
||||
curl
|
||||
unzip
|
||||
util-linux
|
||||
gnugrep
|
||||
|
||||
readline.out
|
||||
procps
|
||||
pciutils
|
||||
libpulseaudio
|
||||
];
|
||||
|
||||
extraPythonPackages = pythonPackages:
|
||||
with pythonPackages; [
|
||||
python
|
||||
];
|
||||
};
|
||||
|
||||
# Takes way too long to shutdown
|
||||
systemd.services."decky-loader".serviceConfig.TimeoutStopSec = "5";
|
||||
}
|
|
@ -1,28 +1,40 @@
|
|||
{config, ...}: let
|
||||
{
|
||||
config,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) mainUser hostName;
|
||||
in {
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
|
||||
../../modules/android.nix
|
||||
../../modules/ags
|
||||
../../modules/audio.nix
|
||||
../../modules/hyprland
|
||||
../../modules/kmscon.nix
|
||||
../../modules/printer.nix
|
||||
../../modules/razer.nix
|
||||
../../modules/ratbag-mice.nix
|
||||
../../modules/sshd.nix
|
||||
../../modules/tailscale.nix
|
||||
|
||||
./modules/gpu-replay.nix
|
||||
./modules/nix-gaming.nix
|
||||
|
||||
self.nixosModules.desktop
|
||||
];
|
||||
|
||||
vars = {
|
||||
mainUser = "matt";
|
||||
hostName = "binto";
|
||||
promptMainColor = "purple";
|
||||
};
|
||||
|
||||
roles.desktop = {
|
||||
user = config.vars.mainUser;
|
||||
|
||||
mainMonitor = "desc:GIGA-BYTE TECHNOLOGY CO. LTD. G27QC 0x00000B1D";
|
||||
greetdDupe = false;
|
||||
displayManager.duplicateScreen = false;
|
||||
|
||||
fontSize = 12.5;
|
||||
};
|
||||
|
||||
|
@ -40,8 +52,6 @@ in {
|
|||
home-manager.users.${mainUser} = {
|
||||
imports = [
|
||||
../../home/firefox
|
||||
|
||||
./home/packages.nix
|
||||
];
|
||||
|
||||
# No touchy
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
{...}: {
|
||||
xdg.desktopEntries."com.github.iwalton3.jellyfin-media-player" = {
|
||||
name = "Jellyfin Media Player";
|
||||
comment = "Desktop client for Jellyfin";
|
||||
exec = "jellyfinmediaplayer --platform xcb";
|
||||
icon = "com.github.iwalton3.jellyfin-media-player";
|
||||
terminal = false;
|
||||
type = "Application";
|
||||
categories = ["AudioVideo" "Video" "Player" "TV"];
|
||||
settings = {
|
||||
Version = "1.0";
|
||||
StartupWMClass = "jellyfin-media-player";
|
||||
};
|
||||
actions = {
|
||||
"DesktopF" = {
|
||||
name = "Desktop [Fullscreen]";
|
||||
exec = "jellyfinmediaplayer --fullscreen --desktop --platform xcb";
|
||||
};
|
||||
"DesktopW" = {
|
||||
name = "Desktop [Windowed]";
|
||||
exec = "jellyfinmediaplayer --windowed --desktop --platform xcb";
|
||||
};
|
||||
"TVF" = {
|
||||
name = "TV [Fullscreen]";
|
||||
exec = "jellyfinmediaplayer --fullscreen --tv --platform xcb";
|
||||
};
|
||||
"TVW" = {
|
||||
name = "TV [Windowed]";
|
||||
exec = "jellyfinmediaplayer --windowed --tv --platform xcb";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,53 +1,18 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
gpu-screen-recorder-src,
|
||||
pkgs,
|
||||
self,
|
||||
...
|
||||
}: let
|
||||
inherit (config.vars) mainUser mainMonitor;
|
||||
inherit (lib) concatStringsSep removePrefix;
|
||||
|
||||
inherit (config.vars) mainUser;
|
||||
|
||||
cfgDesktop = config.roles.desktop;
|
||||
|
||||
gsr = self.packages.${pkgs.system}.gpu-screen-recorder;
|
||||
hyprPkgs = config.home-manager.users.${mainUser}.wayland.windowManager.hyprland.finalPackage;
|
||||
|
||||
gsr = pkgs.stdenv.mkDerivation {
|
||||
name = "gpu-screen-recorder";
|
||||
version = gpu-screen-recorder-src.shortRev;
|
||||
|
||||
src = gpu-screen-recorder-src;
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
pkg-config
|
||||
makeWrapper
|
||||
];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
libpulseaudio
|
||||
ffmpeg
|
||||
wayland
|
||||
libdrm
|
||||
libva
|
||||
xorg.libXcomposite
|
||||
xorg.libXrandr
|
||||
];
|
||||
|
||||
buildPhase = ''
|
||||
./build.sh
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
strip gsr-kms-server
|
||||
strip gpu-screen-recorder
|
||||
|
||||
install -Dm755 "gsr-kms-server" "$out/bin/gsr-kms-server"
|
||||
install -Dm755 "gpu-screen-recorder" "$out/bin/gpu-screen-recorder"
|
||||
#install -Dm644 "extra/gpu-screen-recorder.service" "$out/lib/systemd/user/gpu-screen-recorder.service"
|
||||
|
||||
wrapProgram $out/bin/gpu-screen-recorder --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [
|
||||
pkgs.addOpenGLRunpath.driverLink
|
||||
pkgs.libglvnd
|
||||
]}"
|
||||
'';
|
||||
};
|
||||
in {
|
||||
security.wrappers = {
|
||||
gpu-screen-recorder = {
|
||||
|
@ -66,22 +31,22 @@ in {
|
|||
};
|
||||
|
||||
home-manager.users.${mainUser} = {
|
||||
home.packages = with pkgs; [
|
||||
home.packages = [
|
||||
gsr
|
||||
|
||||
(writeShellApplication {
|
||||
(pkgs.writeShellApplication {
|
||||
name = "gpu-save-replay";
|
||||
runtimeInputs = [procps];
|
||||
runtimeInputs = [pkgs.procps];
|
||||
text = ''
|
||||
pkill --signal SIGUSR1 -f gpu-screen-recorder
|
||||
'';
|
||||
})
|
||||
|
||||
(writeShellApplication {
|
||||
(pkgs.writeShellApplication {
|
||||
name = "gsr-start";
|
||||
runtimeInputs = [pulseaudio hyprPkgs xorg.xrandr];
|
||||
runtimeInputs = [pkgs.pulseaudio hyprPkgs pkgs.xorg.xrandr];
|
||||
text = ''
|
||||
main="${removePrefix "desc:" mainMonitor}"
|
||||
main="${removePrefix "desc:" cfgDesktop.mainMonitor}"
|
||||
WINDOW=$(hyprctl -j monitors | jq '.[] |= (.description |= gsub(","; ""))' | jq -r ".[] | select(.description | test(\"$main\")) | .name")
|
||||
|
||||
# Fix fullscreen game resolution
|
||||
|
|
|
@ -3,26 +3,34 @@
|
|||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
nix-gaming.nixosModules.platformOptimizations
|
||||
];
|
||||
|
||||
programs = {
|
||||
steam = {
|
||||
# Disable HW accel to fix flickers
|
||||
enable = true;
|
||||
remotePlay.openFirewall = true;
|
||||
|
||||
extraCompatPackages = with pkgs; [
|
||||
proton-ge-bin
|
||||
];
|
||||
|
||||
platformOptimizations.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
(lutris.override {
|
||||
environment.systemPackages = [
|
||||
(pkgs.lutris.override {
|
||||
extraLibraries = pkgs: [
|
||||
# List library dependencies here
|
||||
];
|
||||
extraPkgs = pkgs: [
|
||||
nix-gaming.packages.${pkgs.system}.wine-ge
|
||||
# List extra packages available to lutris here
|
||||
];
|
||||
})
|
||||
|
||||
pkgs.r2modman
|
||||
pkgs.ryujinx
|
||||
];
|
||||
}
|
||||
|
|
|
@ -48,7 +48,18 @@ in {
|
|||
vault.reverseProxy = "${nosIP}:8781";
|
||||
hauk.reverseProxy = "${nosIP}:3003";
|
||||
headscale.reverseProxy = "${clusterIP}:8085";
|
||||
jelly.reverseProxy = "${nosIP}:8097";
|
||||
|
||||
jellyfin = {
|
||||
subDomainName = "jelly";
|
||||
reverseProxy = "${nosIP}:8096";
|
||||
|
||||
subDirectories = {
|
||||
jfa-go = {
|
||||
subDirName = "accounts";
|
||||
reverseProxy = "${nosIP}:8056";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
pcsd = {
|
||||
extraConfig = ''
|
||||
|
@ -125,10 +136,6 @@ in {
|
|||
|
||||
subDirectories = {
|
||||
bazarr.reverseProxy = "${nosIP}:6767";
|
||||
bazarr-french = {
|
||||
subDirName = "bafrr";
|
||||
reverseProxy = "${nosIP}:6766";
|
||||
};
|
||||
|
||||
prowlarr.reverseProxy = "${nosIP}:9696";
|
||||
radarr.reverseProxy = "${nosIP}:7878";
|
||||
|
|
|
@ -13,8 +13,7 @@ in {
|
|||
./modules/mergerfs.nix
|
||||
./modules/qbittorrent
|
||||
./modules/snapraid.nix
|
||||
./modules/subtitles/cleanup.nix
|
||||
./modules/subtitles/syncing.nix
|
||||
./modules/subtitles
|
||||
];
|
||||
|
||||
vars = {
|
||||
|
|
|
@ -1,10 +1,19 @@
|
|||
{
|
||||
config,
|
||||
modulesPath,
|
||||
self,
|
||||
...
|
||||
}: {
|
||||
nixpkgs.hostPlatform = "x86_64-linux";
|
||||
imports = [(modulesPath + "/installer/scan/not-detected.nix")];
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
self.nixosModules.nvidia
|
||||
];
|
||||
|
||||
nvidia = {
|
||||
enable = true;
|
||||
enableCUDA = true;
|
||||
};
|
||||
|
||||
boot = {
|
||||
kernelModules = ["kvm-intel"];
|
||||
|
@ -45,9 +54,4 @@
|
|||
zramSwap.enable = true;
|
||||
|
||||
hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware;
|
||||
|
||||
nvidia = {
|
||||
enable = true;
|
||||
enableCUDA = true;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -62,6 +62,11 @@ in {
|
|||
};
|
||||
|
||||
volumes = ["${rwPath}/act:/data"];
|
||||
|
||||
dns = ["1.0.0.1"];
|
||||
extra_hosts = [
|
||||
"git.nelim.org=10.0.0.130"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "vegardit/gitea-act-runner";
|
||||
imageDigest = "sha256:f793df4ed40227cd66dfbba730a448c23f14d81bf9d17857a352011bf6c06907";
|
||||
sha256 = "1c05n1w9f06mcwgpmswclbba898bwsqhx1mdlmi97nphphp9bmq5";
|
||||
imageDigest = "sha256:a6d70b4df97eab6b52ee7094c80109b28c0c2e8d9066c60b71b3222e88726444";
|
||||
sha256 = "0z0ffjavp2r07vp61f7ygwps28m0h9hkdvva0gj4bgsbwdk0pn76";
|
||||
finalImageName = "vegardit/gitea-act-runner";
|
||||
finalImageTag = "dind-latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "codeberg.org/forgejo/forgejo";
|
||||
imageDigest = "sha256:7aa26f80fb574cf7dc886e180d1e86462bf4110fd1d5343af33264c18ae3a1b3";
|
||||
sha256 = "1ij5cwbs8mv67pimkp43ia0fxli2rr5agy08sq8yimxmz4ayd60l";
|
||||
imageDigest = "sha256:6f4620d8fb4bb8288315b07ca65286da958745d623fc9eaef4bb4e0e34c68b3d";
|
||||
sha256 = "0k9nx7z20b60kavyawdhp7lk3abgy40lsbxl5p2qzgkhrc67bb31";
|
||||
finalImageName = "codeberg.org/forgejo/forgejo";
|
||||
finalImageTag = "1.21.10-0";
|
||||
finalImageTag = "7.0.5";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "postgres";
|
||||
imageDigest = "sha256:6779d7a308f3c9c518a644ad9326be6149dc50352c91927725936a1115e09b0d";
|
||||
sha256 = "1qckzi60db6q3dw61qqpfj4xsf7fa92aaf5x7ra2ac5sm1kbhl3x";
|
||||
imageDigest = "sha256:2f7365d1f574dba34f6332978169afe60af9de9608fffbbfecb7d04cc5233698";
|
||||
sha256 = "07v1r0ijag2kyr9nk5l7kphgvrb6lk71zyab4i31rkl1k27vfhwg";
|
||||
finalImageName = "postgres";
|
||||
finalImageTag = "14";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "theconnman/docker-hub-rss";
|
||||
imageDigest = "sha256:3850badd3ebdb7d6583c8b67ebbcdd077b4e4ff2d8362ee31d78e334462d616f";
|
||||
sha256 = "0h4lldnfd8nrrh598bxvnykkzjyqa9hqjb57g694fpy1zpqvy266";
|
||||
imageDigest = "sha256:7a6dd3f09dd9a3ad4ec3b6cf83ceb3fb11f15fd8df8b480a851e974ee0ff8e26";
|
||||
sha256 = "012cy2yqir36kpxb5jlyvsssm419bwrs4w7y8hz4nawvx69d1w69";
|
||||
finalImageName = "theconnman/docker-hub-rss";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "freshrss/freshrss";
|
||||
imageDigest = "sha256:c554223f485843553f7b7c9faff1f5c6c6113ce15b0288dd07210e97d8bbbbcc";
|
||||
sha256 = "1vjsr0hfq5dfma2dll6jzkir14ii423nlvjjq6gq0mp9s19jidr7";
|
||||
imageDigest = "sha256:0e8708498272dac567b9d1654822ccb22037cf4b1792ec75b9929e70e53ddd16";
|
||||
sha256 = "0qff5bvr21ibli4pxd6cs0knfmyh25s5123z9d1lndrlvnvifbdx";
|
||||
finalImageName = "freshrss/freshrss";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "postgres";
|
||||
imageDigest = "sha256:6779d7a308f3c9c518a644ad9326be6149dc50352c91927725936a1115e09b0d";
|
||||
sha256 = "1qckzi60db6q3dw61qqpfj4xsf7fa92aaf5x7ra2ac5sm1kbhl3x";
|
||||
imageDigest = "sha256:2f7365d1f574dba34f6332978169afe60af9de9608fffbbfecb7d04cc5233698";
|
||||
sha256 = "07v1r0ijag2kyr9nk5l7kphgvrb6lk71zyab4i31rkl1k27vfhwg";
|
||||
finalImageName = "postgres";
|
||||
finalImageTag = "14";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "rssbridge/rss-bridge";
|
||||
imageDigest = "sha256:b543b93acf3c5e5f011b940352032aabc98221716fed57b4c7f902908731beae";
|
||||
sha256 = "1lk5x15dlgcyly0in9xhn7ibxp9hp2h65x9q3axhqiz28dkd176a";
|
||||
imageDigest = "sha256:94480c924f35512e81ad846fd9968591c63d20221484b7774083055b990ab31f";
|
||||
sha256 = "18jakml7v01w4f1y40aflzsnnq5r2pj5wnh1xf2x9c5c5l0nvhfr";
|
||||
finalImageName = "rssbridge/rss-bridge";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "grimsi/gameyfin";
|
||||
imageDigest = "sha256:97842e65252e0854ccced478c10a007ee57e7a35c98c3cb26ecce9d0fd5be41c";
|
||||
sha256 = "19gbbaqg4n188piyh3lb54rfwz5xpj6f6fkvpqsbls3v9a4ambjw";
|
||||
imageDigest = "sha256:f7994b4d4da378d909c173115d71cfeb704980184e42db432bd309d51d92725e";
|
||||
sha256 = "07a10aw1x2qbfpcva30l0b33lhxshrsacxr1ia0lbbsch655iymq";
|
||||
finalImageName = "grimsi/gameyfin";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "ghcr.io/gethomepage/homepage";
|
||||
imageDigest = "sha256:13d1bf9c5cf7d2b0f3af90ddfe59302f32374b8f48a56c6f6afc2a475bf919df";
|
||||
sha256 = "12kzw2dvlfv78nh6y0iqygjndbizxra39kpsrif5026p2hjm4gyp";
|
||||
imageDigest = "sha256:cbc5b49533f9afd0be57f6d5168eef48be2d713709259d6697f0d33b4ecb2f28";
|
||||
sha256 = "1f07bv5c0ca70vqrlqlblqbjzpgdripvipkigh6lliam5v0405h0";
|
||||
finalImageName = "ghcr.io/gethomepage/homepage";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -155,18 +155,6 @@
|
|||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
"bazarr french" = rec {
|
||||
href = "https://lan.nelim.org/bafrr";
|
||||
icon = "bazarr.png";
|
||||
description = "fetches subs";
|
||||
widget = {
|
||||
type = "bazarr";
|
||||
url = href;
|
||||
key = "{{HOMEPAGE_VAR_BAZARRFR_API}}";
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
prowlarr = rec {
|
||||
href = "https://lan.nelim.org/prowlarr";
|
||||
|
|
|
@ -9,7 +9,6 @@ in {
|
|||
arion.projects."immich" = {
|
||||
"immich_server" = {
|
||||
image = ./images/server.nix;
|
||||
command = ["start.sh" "immich"];
|
||||
env_file = [
|
||||
"${./env}"
|
||||
secrets.immich.path
|
||||
|
@ -28,22 +27,6 @@ in {
|
|||
environment.NODE_ENV = "production";
|
||||
};
|
||||
|
||||
"immich_microservices" = {
|
||||
image = ./images/server.nix;
|
||||
command = ["start.sh" "microservices"];
|
||||
env_file = [
|
||||
"${./env}"
|
||||
secrets.immich.path
|
||||
];
|
||||
|
||||
volumes = [
|
||||
"${UPLOAD_LOCATION}:/usr/src/app/upload:rw"
|
||||
];
|
||||
|
||||
depends_on = ["immich_redis" "immich_postgres"];
|
||||
restart = "always";
|
||||
};
|
||||
|
||||
"immich_machine_learning" = {
|
||||
image = ./images/machine-learning.nix;
|
||||
restart = "always";
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "ghcr.io/immich-app/immich-machine-learning";
|
||||
imageDigest = "sha256:b0a22ca87496019f495ed5ce89df08da237e0987d389376b435b2226a8c29463";
|
||||
sha256 = "001nj0dsqzb3lhvjrm88wv3cmm5yx8wldw3i7kq1vs80gi4ckhs1";
|
||||
imageDigest = "sha256:4dc544396bf08cd92066f83a270155201d80512add127ca9fac2d3e56694d2a4";
|
||||
sha256 = "17hp5ljnc34nmj74wjvvicc3zjkwhrq4k748r5jbmydgb4bsvji7";
|
||||
finalImageName = "ghcr.io/immich-app/immich-machine-learning";
|
||||
finalImageTag = "v1.101.0";
|
||||
finalImageTag = "v1.108.0";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "ghcr.io/immich-app/immich-server";
|
||||
imageDigest = "sha256:0097562444db38ebd2e5f98e71bd27dc6dd69b7f786207f7d323febbf99b8f93";
|
||||
sha256 = "09iyqs2fspi021005iw510b6xj87lfwimng84izbxvya7l312kb0";
|
||||
imageDigest = "sha256:248a6da7dadeb57f90eacd5635ecc65e63d4c3646a6c94a362bb57cba1b314fa";
|
||||
sha256 = "03w9m0hsid9ppfyy8wmnccvmjh0m4h061yy1hwa4psijlx976xxp";
|
||||
finalImageName = "ghcr.io/immich-app/immich-server";
|
||||
finalImageTag = "v1.101.0";
|
||||
finalImageTag = "v1.108.0";
|
||||
}
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
ota.nelim.org {
|
||||
tls matt@nelim.org {
|
||||
dns cloudflare {env.CLOUDFLARE_API_TOKEN}
|
||||
resolvers 1.0.0.1
|
||||
}
|
||||
reverse_proxy lineageOTA
|
||||
}
|
|
@ -1,74 +0,0 @@
|
|||
{config, ...}: let
|
||||
inherit (config.sops) secrets;
|
||||
inherit (config.arion) rwDataDir;
|
||||
|
||||
rwPath = rwDataDir + "/lineageos";
|
||||
in {
|
||||
# FIXME: crashes when building
|
||||
# TODO: make sure it works with latest arion custom module
|
||||
|
||||
arion.projects."lineageos" = {
|
||||
"builder" = {
|
||||
image = "lineageos4microg/docker-lineage-cicd";
|
||||
container_name = "lineage_builder";
|
||||
|
||||
environment = {
|
||||
BRANCH_NAME = "lineage-20.0";
|
||||
DEVICE_LIST = "lemonadep";
|
||||
SIGN_BUILDS = "true";
|
||||
SIGNATURE_SPOOFING = "restricted";
|
||||
WITH_GMS = "true";
|
||||
ZIP_SUBDIR = "false";
|
||||
OTA_URL = "https://ota.nelim.org/api";
|
||||
CUSTOM_PACKAGES = "AuroraStore AvesLibre Droidify MJPdfReader Mull OpenCalc";
|
||||
INCLUDE_PROPRIETARY = "false";
|
||||
PARALLEL_JOBS = 6;
|
||||
CLEAN_AFTER_BUILD = "false";
|
||||
CCACHE_SIZE = "200G";
|
||||
};
|
||||
|
||||
volumes = [
|
||||
"${rwPath}/lineage/src:/srv/src"
|
||||
"${rwPath}/lineage/zips:/srv/zips"
|
||||
"${rwPath}/lineage/logs:/srv/logs"
|
||||
"${rwPath}/lineage/cache:/srv/ccache"
|
||||
"${rwPath}/lineage/keys:/srv/keys"
|
||||
|
||||
"${toString ./.}/manifests:/srv/local_manifests:ro"
|
||||
"${toString ./.}/scripts:/srv/userscripts:ro"
|
||||
"/etc/timezone:/etc/timezone:ro"
|
||||
"/etc/localtime:/etc/localtime:ro"
|
||||
];
|
||||
};
|
||||
|
||||
"OTA-server" = {
|
||||
container_name = "lineageOTA";
|
||||
image = "docker.io/julianxhokaxhiu/lineageota";
|
||||
volumes = [
|
||||
"${rwPath}/lineage/zips:/var/www/html/builds/full:ro"
|
||||
];
|
||||
};
|
||||
|
||||
"caddy" = {
|
||||
image = "quay.io/slothcroissant/caddy-cloudflaredns:latest";
|
||||
|
||||
ports = [
|
||||
"80:80"
|
||||
"443:443"
|
||||
];
|
||||
|
||||
volumes = [
|
||||
"${rwPath}/caddy/data:/data"
|
||||
"${rwPath}/caddy/config:/config"
|
||||
|
||||
"${toString ./.}/Caddyfile:/etc/caddy/Caddyfile:ro"
|
||||
];
|
||||
|
||||
env_file = [secrets.caddy-cloudflare.path];
|
||||
environment = {
|
||||
CLOUDFLARE_EMAIL = "matt@nelim.rg";
|
||||
ACME_AGREE = "true";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<manifest>
|
||||
<remote name="gitea" fetch="https://git.nelim.org/" />
|
||||
|
||||
<project name="matt1432/android_vendor_customs" path="vendor/alternatives" remote="gitea" revision="master" />
|
||||
|
||||
<project name="lineageos4microg/android_vendor_partner_gms" path="vendor/partner_gms" remote="github" revision="master" />
|
||||
<project name="matt1432/android_vendor_mulchwebview" path="vendor/mulch" remote="gitea" revision="main" />
|
||||
<project name="jgudec/android_vendor_lawnchair" path="vendor/lawnchair" remote="github" revision="13" />
|
||||
</manifest>
|
|
@ -1,10 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<manifest>
|
||||
<project name="TheMuppets/proprietary_vendor_oneplus_lemonadep" path="vendor/oneplus/lemonadep" remote="github" revision="lineage-20" />
|
||||
<project name="TheMuppets/proprietary_vendor_oneplus_sm8350-common" path="vendor/oneplus/sm8350-common" remote="github" revision="lineage-20" />
|
||||
|
||||
<project name="LineageOS/android_device_oneplus_lemonadep" path="device/oneplus/lemonadep" remote="github" revision="lineage-20" />
|
||||
<project name="LineageOS/android_hardware_oplus" path="hardware/oplus" remote="github" revision="lineage-20" />
|
||||
<project name="LineageOS/android_kernel_oneplus_sm8350" path="kernel/oneplus/sm8350" remote="github" revision="lineage-20" />
|
||||
<project name="LineageOS/android_device_oneplus_sm8350-common" path="device/oneplus/sm8350-common" remote="github" revision="lineage-20" />
|
||||
</manifest>
|
|
@ -1,20 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
## See here for AndroidAuto: https://github.com/sn-00-x/aa4mg
|
||||
|
||||
## add MulchWebView
|
||||
sed -i "1s;^;\$(call inherit-product-if-exists, vendor/mulch/mulch.mk)\n\n;" "/srv/src/LINEAGE_20_0/vendor/lineage/config/common.mk"
|
||||
|
||||
## add lawnchair overlay to build
|
||||
sed -i "1s;^;\$(call inherit-product-if-exists, vendor/lawnchair/lawnchair.mk)\n\n;" "/srv/src/LINEAGE_20_0/vendor/lineage/config/common.mk"
|
||||
|
||||
## remove Trebuchet
|
||||
sed -i 's/overrides.*/overrides: ["Home", "Launcher2", "Launcher3", "Launcher3QuickStep", "ParanoidQuickStep", "PixelLauncher", "TrebuchetQuickStep", "TrebuchetOverlay"],/' "/srv/src/LINEAGE_20_0/vendor/lawnchair/Android.bp"
|
||||
|
||||
## only add needed packages from microg
|
||||
echo "PRODUCT_PACKAGES += \\
|
||||
GmsCore \\
|
||||
GsfProxy \\
|
||||
FakeStore \\
|
||||
IchnaeaNlpBackend \\
|
||||
NominatimGeocoderBackend" > "/srv/src/LINEAGE_20_0/vendor/partner_gms/products/gms.mk"
|
|
@ -3,55 +3,28 @@
|
|||
|
||||
rwPath = rwDataDir + "/media/bazarr";
|
||||
in {
|
||||
arion.projects."bazarr" = {
|
||||
"bazarr" = {
|
||||
image = ./images/bazarr.nix;
|
||||
restart = "always";
|
||||
arion.projects."bazarr"."bazarr" = {
|
||||
image = ./images/bazarr.nix;
|
||||
restart = "always";
|
||||
|
||||
environment = {
|
||||
PUID = "1000";
|
||||
PGID = "1000";
|
||||
TZ = "America/New_York";
|
||||
};
|
||||
|
||||
extra_hosts = ["lan.nelim.org=10.0.0.130"];
|
||||
ports = [
|
||||
"6767:6767"
|
||||
];
|
||||
|
||||
volumes = [
|
||||
"${rwPath}/data:/config"
|
||||
"/data:/data"
|
||||
];
|
||||
|
||||
extraOptions = {
|
||||
deploy.resources.limits.cpus = "0.5";
|
||||
};
|
||||
environment = {
|
||||
PUID = "1000";
|
||||
PGID = "1000";
|
||||
TZ = "America/New_York";
|
||||
};
|
||||
|
||||
"bazarr-fr" = {
|
||||
image = ./images/bazarr.nix;
|
||||
restart = "always";
|
||||
extra_hosts = ["lan.nelim.org=10.0.0.130"];
|
||||
ports = [
|
||||
"6767:6767"
|
||||
];
|
||||
|
||||
environment = {
|
||||
PUID = "1000";
|
||||
PGID = "1000";
|
||||
TZ = "America/New_York";
|
||||
};
|
||||
volumes = [
|
||||
"${rwPath}/data:/config"
|
||||
"/data:/data"
|
||||
];
|
||||
|
||||
extra_hosts = ["lan.nelim.org=10.0.0.130"];
|
||||
ports = [
|
||||
"6766:6767"
|
||||
];
|
||||
|
||||
volumes = [
|
||||
"${rwPath}/data-fr:/config"
|
||||
"/data:/data"
|
||||
];
|
||||
|
||||
extraOptions = {
|
||||
deploy.resources.limits.cpus = "0.5";
|
||||
};
|
||||
extraOptions = {
|
||||
deploy.resources.limits.cpus = "2";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "ghcr.io/linuxserver/bazarr";
|
||||
imageDigest = "sha256:91f7199dc40ccb1ef6667e3f834bbc2c64ade9a25ec3941f6d5d908bddcd145e";
|
||||
sha256 = "18pbdw6ivchk2fwh8h7w91jl3zcr02zfqcf44adb0bvf1dziw30x";
|
||||
imageDigest = "sha256:5da74fc1bbd5da69e3b4f9b2376f6ccfbe3b47f143e6eb5651ed37cc1d4412dd";
|
||||
sha256 = "0k72wmxp4hfy9v1l6bjlrrhg6q5knlg6h48mvbw3y9sg2hy95kvp";
|
||||
finalImageName = "ghcr.io/linuxserver/bazarr";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "ghcr.io/linuxserver/calibre-web";
|
||||
imageDigest = "sha256:584366bdcad9b3e9e1143d9ff5b012f684f32071d515f532953680af7fa43418";
|
||||
sha256 = "1x3bkb2fv9vs30wy9b324wm956nv3zzh1wzn0z08ml4bpncyx61s";
|
||||
imageDigest = "sha256:73aa52c663537a21d0b2e5315ba1080aeaecff1fa29dc7c020a4107f64e96490";
|
||||
sha256 = "14mzhfq5pybv6dq4wvbgrk2iw3jq2hwyi095ymhb7qzwrvggmidx";
|
||||
finalImageName = "ghcr.io/linuxserver/calibre-web";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "ghcr.io/linuxserver/calibre";
|
||||
imageDigest = "sha256:b0c387456c059ead0d4cf76861d633c66b34a6b888ec5834d353951f1bde1384";
|
||||
sha256 = "1xaq1m8kcxvvi082lf8p6j48niqbivq61ddm3hilw4sjp9phq2a5";
|
||||
imageDigest = "sha256:4e886252cad4a7796289a737afb4b47e9b547b7e2d2b9e35fd3153c8f97eefca";
|
||||
sha256 = "10xan2lwgi77qgmq964j290xykn4pk75r397fqj5kkkbxkqbndgh";
|
||||
finalImageName = "ghcr.io/linuxserver/calibre";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "ghcr.io/flaresolverr/flaresolverr";
|
||||
imageDigest = "sha256:088412db1051d04ab32c902266510011aec1dc9f7a3a3bda3f58b93186591347";
|
||||
sha256 = "1x3s1qvzjz9kbxs829dyjp2m1fabmcvvi1n5z56j0dh1s0vcpb20";
|
||||
imageDigest = "sha256:f104ee51e5124d83cf3be9b37480649355d223f7d8f9e453d0d5ef06c6e3b31b";
|
||||
sha256 = "1ixsv5rv39bp7y1w2p0zjz9ivl82s3kndr5r39krgyknhzxavazc";
|
||||
finalImageName = "ghcr.io/flaresolverr/flaresolverr";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "ghcr.io/linuxserver/prowlarr";
|
||||
imageDigest = "sha256:a77b1f5b22fed9fd726e49bfa6800897676a3eee030d5f194d7858cb858aa6d0";
|
||||
sha256 = "1dbpm8cxqydm21ybkz8rvqyga4q7hg36w6fh8qdmgb4w4f3mv7pj";
|
||||
imageDigest = "sha256:c43dc0311d4381395b60b3a6068e82226eddb213278bfe886bebabe67eb0f762";
|
||||
sha256 = "0jnbf5vvjdyjl5mb76bg05hjqrabsvi4jczszi5sjx81fslz61qc";
|
||||
finalImageName = "ghcr.io/linuxserver/prowlarr";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "ghcr.io/linuxserver/radarr";
|
||||
imageDigest = "sha256:1afb332d12843163750a40a4e03b0a91b03db8831f9455cbb6fc06ebddbfa16e";
|
||||
sha256 = "13axfd2fwscy1s538hlhyvr8b1vrpw0akx3kwkmslhkc1fq62hq0";
|
||||
imageDigest = "sha256:bf5aaf1577edbc3ba33db069676e7f8324eda33761ca59721942bc8ef56c015c";
|
||||
sha256 = "08kdrxrvalvrb2g37fsn7zmhshfyc5n0k4h41wbdbyihs87ddvqr";
|
||||
finalImageName = "ghcr.io/linuxserver/radarr";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "ghcr.io/linuxserver/sabnzbd";
|
||||
imageDigest = "sha256:5b8d05994df326db82f744469e4321d1b9f4feb52f5d217c06ad384d5c8377e2";
|
||||
sha256 = "192f86wa3z8khr7fh7cnd1nin5ilmp3bhw5faygnv9fh58ywipmn";
|
||||
imageDigest = "sha256:cd0e0de27454b040a0d55d1a06885dc78366435ce6794b82a6e4194b795e213a";
|
||||
sha256 = "0gl8z845aih0kdqabdhhf8fvbldx121vqiind9lx6zjmxjrr22wk";
|
||||
finalImageName = "ghcr.io/linuxserver/sabnzbd";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "fallenbagel/jellyseerr";
|
||||
imageDigest = "sha256:6dcdb5ba50913a14b2bd7df6388607ce175121f3416679c2746501256ac9f075";
|
||||
sha256 = "0bcs4dfw6n78yp1br0z5ra6bf6f5hppxrs86b3b6pszzlp3ijjfw";
|
||||
finalImageName = "fallenbagel/jellyseerr";
|
||||
finalImageTag = "latest";
|
||||
imageName = "ghcr.io/fallenbagel/jellyseerr";
|
||||
imageDigest = "sha256:164365db8dc720291ba1eedab14e37025cd6b9e1ba45bebd06dac3bc15305f18";
|
||||
sha256 = "0614m68qibqblqj0g48b0cny2irpgqkgs519isw6blxc209z0yan";
|
||||
finalImageName = "ghcr.io/fallenbagel/jellyseerr";
|
||||
finalImageTag = "develop";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "ghcr.io/linuxserver/sonarr";
|
||||
imageDigest = "sha256:f11f32d67bb7ef20333e22546b04a244e4e8172cb9744b026381cf898a1f2ece";
|
||||
sha256 = "02mlalvi577ggb9ia2wggxnm8kwz92dsh9v98qq3y0zpsizyr4gn";
|
||||
imageDigest = "sha256:8414846e440ca34c1cbed96daf7d5b3bcde20aab79761aaaaef496f24cec8d20";
|
||||
sha256 = "02p0zjkcxcm091qdja465kibqp49q79ysrnxpbn0dh0zaff5i4bm";
|
||||
finalImageName = "ghcr.io/linuxserver/sonarr";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "craumix/jmusicbot";
|
||||
imageDigest = "sha256:361930342510033352a489bcfa0e2eda86de5b33f4057cd4ce2c2cbe1616ea11";
|
||||
sha256 = "0rb1nrjinpiyavybclghbizqzg2jy0yrldb0qanfnf9qyr2p7k08";
|
||||
imageDigest = "sha256:560d380cbe9e90fd51e420eb060d5780dca07a5e04457b221f72e89210d23eb2";
|
||||
sha256 = "0nncbacmwqm7qynzz6shmnibid9lfkaqyivh6nlkakpvhv78b46x";
|
||||
finalImageName = "craumix/jmusicbot";
|
||||
finalImageTag = "latest";
|
||||
finalImageTag = "0.4.1";
|
||||
}
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (config.sops) secrets;
|
||||
inherit (config.arion) rwDataDir;
|
||||
inherit (lib) concatStrings;
|
||||
|
||||
mainContainerName = "app-server";
|
||||
rwPath = rwDataDir + "/nextcloud";
|
||||
in {
|
||||
arion.projects."nextcloud" = {
|
||||
"app-server" = {
|
||||
"${mainContainerName}" = {
|
||||
image = ./images/nextcloud.nix;
|
||||
restart = "always";
|
||||
|
||||
|
@ -31,7 +33,6 @@ in {
|
|||
POSTGRES_HOST = "nextcloud-db";
|
||||
REDIS_HOST = "nextcloud-cache";
|
||||
REDIS_HOST_PASSWORD = "password";
|
||||
TRUSTED_PROXIES = "cloud.nelim.org";
|
||||
NEXTCLOUD_INIT_HTACCESS = "true";
|
||||
};
|
||||
};
|
||||
|
@ -58,12 +59,16 @@ in {
|
|||
"/var/lib/onlyoffice"
|
||||
];
|
||||
|
||||
# Fix mobile editing
|
||||
entrypoint = ''bash -c "${let
|
||||
filePath = "/var/www/onlyoffice/documentserver/web-apps/apps/*/mobile/dist/js/app.js";
|
||||
func = "isSupportEditFeature=function()";
|
||||
in
|
||||
concatStrings [
|
||||
# Fix proxies
|
||||
''sed -i 's/"allowPrivateIPAddress": false,/"allowPrivateIPAddress": true,/' /etc/onlyoffice/documentserver/default.json''
|
||||
''sed -i 's/"allowMetaIPAddress": false/"allowMetaIPAddress": true/' /etc/onlyoffice/documentserver/default.json''
|
||||
|
||||
# Fix mobile editing
|
||||
"sed -i 's/${func}{return!1}/${func}{return 1}/g' ${filePath};"
|
||||
"/app/ds/run-document-server.sh;"
|
||||
"apt update;"
|
||||
|
@ -103,4 +108,23 @@ in {
|
|||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Cron job
|
||||
systemd.timers.nextcloud-cron = {
|
||||
description = "Timer For Nextcloud Cron";
|
||||
wantedBy = ["timers.target"];
|
||||
|
||||
timerConfig.OnBootSec = "5m";
|
||||
timerConfig.OnUnitActiveSec = "5m";
|
||||
};
|
||||
systemd.services.nextcloud-cron = {
|
||||
description = "Nextcloud Cron";
|
||||
requires = ["arion-nextcloud.service"];
|
||||
after = ["arion-nextcloud.service"];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${pkgs.docker}/bin/docker exec -u www-data ${mainContainerName} php -f /var/www/html/cron.php";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "nextcloud";
|
||||
imageDigest = "sha256:b08377deee6dbecf2d885c278ff711fb6e63d855d8fad4717056246b928cc9da";
|
||||
sha256 = "027w6m8mrf1a92mmp68pgf93fmwgjgh5q007f6ff9nblacqdn4zz";
|
||||
imageDigest = "sha256:d2dc74b2ce5fc6b06e1bf454320bb6388817757b41314a0214af4eac278a3c42";
|
||||
sha256 = "0l5325msrbgzi5zhr9yjbvpnfn8i7p4nbiigbviriq1wsl24rkmw";
|
||||
finalImageName = "nextcloud";
|
||||
finalImageTag = "fpm";
|
||||
finalImageTag = "29.0.3-fpm";
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
pkgs:
|
||||
pkgs.dockerTools.pullImage {
|
||||
imageName = "nginx";
|
||||
imageDigest = "sha256:6db391d1c0cfb30588ba0bf72ea999404f2764febf0f1f196acd5867ac7efa7e";
|
||||
sha256 = "0mhc4872dw11x8378mwqbvbwylwaxly8qj3vj121bf7qjln4ad6a";
|
||||
imageDigest = "sha256:67682bda769fae1ccf5183192b8daf37b64cae99c6c3302650f6f8bf5f0f95df";
|
||||
sha256 = "17l0zpn8f8s25dwqkbm9ak9xbkz5czpfsnwvhdm7ykq52kxpxs5x";
|
||||
finalImageName = "nginx";
|
||||
finalImageTag = "latest";
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue