Compare commits
459 commits
Author | SHA1 | Date | |
---|---|---|---|
52aa60db5e | |||
b79ffba8e8 | |||
e4ea8e8a4f | |||
605d98f559 | |||
19429f231f | |||
709a3b9d6a | |||
9dd541f228 | |||
ea8e5fd3e6 | |||
6c2e5217ce | |||
ebe669ca0b | |||
0068c3d6d3 | |||
f054d7186e | |||
29e910e061 | |||
699dddca99 | |||
d987e13e04 | |||
0c8b4ccfa9 | |||
02adc74c5a | |||
17e3cca037 | |||
b54924fec6 | |||
6ed0c4561c | |||
fa6763821c | |||
857a925476 | |||
0c7e2bd304 | |||
53c8eb919d | |||
d8df732fdd | |||
fd9cfd4d0f | |||
291b01a996 | |||
8c31eb51d0 | |||
dd98328b1c | |||
8f84feece6 | |||
c9d6554663 | |||
83f3edf2d3 | |||
809141fc66 | |||
14f49e21aa | |||
47ccc19409 | |||
45fa574d81 | |||
4b6f14b2d2 | |||
b698d359bc | |||
8e4c1fdd74 | |||
8cfa57bb04 | |||
aaa8649bcf | |||
b1ee77f2c3 | |||
14cbb1507e | |||
69e86ebfd3 | |||
e2b65ceead | |||
7e46da362b | |||
047fa9425c | |||
c8d290c36f | |||
3d887fc5c5 | |||
be70cb6736 | |||
a4c37a779e | |||
67311435fc | |||
d5242c8929 | |||
6a4c1b34bf | |||
dd5a1d52da | |||
265b1ab049 | |||
4b2997c4de | |||
743258bb44 | |||
e23ee8e96e | |||
8761dae20c | |||
7aa65ef8f4 | |||
470af133c0 | |||
16f352e90d | |||
60fd73e044 | |||
4c82c3afba | |||
cac01b2a09 | |||
528246061a | |||
29bc56b8a5 | |||
55eedcea01 | |||
69e8ca76f9 | |||
c6ad76c196 | |||
515eb067d3 | |||
69aba935c0 | |||
5b3d999a86 | |||
0c0dd6ab30 | |||
b6c1431526 | |||
c2be22d5c6 | |||
d13a06c7f6 | |||
cab5d4a468 | |||
648ccadf10 | |||
6519189644 | |||
9ca0a899a8 | |||
2e91bb6963 | |||
fb13480de6 | |||
f72d3e6f59 | |||
0398153793 | |||
845d9a6248 | |||
675c0c32c8 | |||
6c225f12c0 | |||
2d24794ea1 | |||
63de62454c | |||
9360c07a60 | |||
45830f76f9 | |||
2a47f10731 | |||
41ef1daa6e | |||
eb7894f880 | |||
5b7a06506b | |||
1da72f7350 | |||
ca5af092fe | |||
0305b1ce40 | |||
fea9eb7c94 | |||
a92d376132 | |||
91a7f8b164 | |||
7f234717f5 | |||
912b8e0c94 | |||
e1d3c6b888 | |||
86a20a3849 | |||
d91180f763 | |||
6d422179ec | |||
cc20c8cd1c | |||
e60f4e19b7 | |||
3afe8e0baf | |||
39b8fd69d7 | |||
df43ff334c | |||
1ab1765492 | |||
2146363559 | |||
6ae147ddab | |||
90d2cb2699 | |||
f1eb673e27 | |||
004d355a17 | |||
b97972d692 | |||
f4377d2665 | |||
a05e5a0b78 | |||
33d479e414 | |||
14fa321c4f | |||
d5aaa84302 | |||
9be1af00f8 | |||
7f2c004895 | |||
f2cb23acf3 | |||
b26ab08b03 | |||
b05f277ea4 | |||
9b46f6e9e9 | |||
84614d89e0 | |||
ad901449e1 | |||
756536a2ee | |||
3581dfc24a | |||
e4ac3e8977 | |||
cc1bff80f7 | |||
e668b690c2 | |||
ff1b2bed1e | |||
77b95427af | |||
eb96ea8168 | |||
2f64d316fe | |||
b21b9b774d | |||
e1b0524991 | |||
82e0880f9a | |||
c89623fdf0 | |||
2a45f5837e | |||
4dd1cefb30 | |||
dd03bd6090 | |||
71393d8ec5 | |||
8e4fc00255 | |||
c1e8037290 | |||
bfd1b01d65 | |||
925a7948a5 | |||
4545dd5efe | |||
b5b149474b | |||
e91191eacd | |||
b9e66cbecb | |||
c0769b53c8 | |||
b7dcc5e579 | |||
35003d7f2c | |||
f5e054813f | |||
9e32507665 | |||
9367167e92 | |||
5ed372d1f4 | |||
28be439381 | |||
c6295daafe | |||
576cf1f077 | |||
29fca3dd76 | |||
d83bf9d4ab | |||
f4725f1030 | |||
e5d4bffe8d | |||
4fd9643425 | |||
8a97ba6c49 | |||
3572685386 | |||
5a9cf4c15c | |||
a00655b02f | |||
6fa61fff7f | |||
7177ce3a10 | |||
099959a30a | |||
255847b6e1 | |||
76a885e0d3 | |||
470f738403 | |||
49217e1bcc | |||
a932b4598d | |||
13b0e7593e | |||
d1b633b086 | |||
77a765e332 | |||
6043b73a04 | |||
c213949f6f | |||
1debdb71d8 | |||
26591d2175 | |||
2bf237f1da | |||
b0e2738905 | |||
20c587bb5e | |||
3c7751feda | |||
93fde832ea | |||
e6b3ee395c | |||
a4ed0a03d1 | |||
4068f391f2 | |||
4d3850020b | |||
89e314d3bb | |||
910cb992f8 | |||
92a980dab2 | |||
51a6f74c5f | |||
7a0bbc1548 | |||
4f73668bf4 | |||
f992567e47 | |||
5f4de04583 | |||
e217c6f579 | |||
0bc23cc772 | |||
a479aa7046 | |||
05498907b4 | |||
b52422d58c | |||
42bf9fba59 | |||
6a73e54b73 | |||
1450de1c2b | |||
f73fbed43a | |||
a1a5d9a90c | |||
241dc3e053 | |||
f01d6cccb9 | |||
ef886a63a4 | |||
22eb62df23 | |||
8c6e4e9ca5 | |||
7d581901ec | |||
78128824d9 | |||
ef005f364e | |||
b88f16f43e | |||
7ff2eb63b2 | |||
9f8d290d10 | |||
25c25a4a96 | |||
889739e443 | |||
d483cad685 | |||
af58abcf3c | |||
4faa092004 | |||
6652435bd4 | |||
96286d85e9 | |||
108baeae60 | |||
a6d9f57d8e | |||
af61ee537a | |||
311ae93432 | |||
184495ae51 | |||
b3feafcaef | |||
de24f3c5f6 | |||
1e3e0d585f | |||
db42af3c0f | |||
f89d5b0f6e | |||
554c16b739 | |||
772b1e0948 | |||
8facfb044b | |||
fe5205de3a | |||
a12e904d6e | |||
16fae21651 | |||
0e6a8e8348 | |||
e9f7194e35 | |||
1537656a8c | |||
9db80d436b | |||
1ecf04323a | |||
f77e3f4627 | |||
4d725ec1b8 | |||
75bd610b36 | |||
72195f5d5c | |||
1896804153 | |||
04180ce54a | |||
d632864cfc | |||
65aa06c5f5 | |||
73df2f82c0 | |||
7d7e92f88c | |||
9cfab6dd2a | |||
448e3beadf | |||
9d92ac2d0d | |||
db57f01f8b | |||
bb38367685 | |||
6172e26bb1 | |||
a84d27734c | |||
23e41b0447 | |||
20475505d0 | |||
9a21734c30 | |||
f5ce1e764b | |||
8bc84b70ce | |||
8595592ecf | |||
d271bd977e | |||
d0ae7b1f22 | |||
faa9747d05 | |||
3ea35b67ae | |||
c5b0d3966c | |||
e806b77315 | |||
415ced0290 | |||
fbe05e5abc | |||
e204a2a176 | |||
edc8264713 | |||
3344d7ab11 | |||
8409bc7f9e | |||
f77c2c4a41 | |||
af3d70ccf0 | |||
61c6788047 | |||
8e27d7112b | |||
1816515644 | |||
ce8953a179 | |||
fd5838d3f3 | |||
6edfb42e95 | |||
4f987b0a6f | |||
66b96a843f | |||
6b5be4cead | |||
6a3dc93ed1 | |||
f807e11b6c | |||
fd4e1ce93d | |||
d210f0eefb | |||
26f369a9ee | |||
fb666e0c55 | |||
026095f971 | |||
69e80b19bb | |||
88fd84d058 | |||
e17fb2a821 | |||
1a16816996 | |||
4e921bfee2 | |||
e8ad16a7e6 | |||
b59053bc18 | |||
5de98e93e2 | |||
9e47462835 | |||
fa8354f1f8 | |||
c50872c6e7 | |||
fc21e3db22 | |||
3626a8cb99 | |||
03c92b4722 | |||
126b71a6db | |||
d7081e45fb | |||
29dd8a6349 | |||
105d869bbb | |||
bdf4e931e7 | |||
f6ad0a24b2 | |||
94e8e98c77 | |||
743a0f6daa | |||
8f9aeb27a5 | |||
80a209ece5 | |||
1a5a1f1db0 | |||
cbf62f5bfb | |||
1fafe02965 | |||
e188718244 | |||
de9327e3c4 | |||
7cfbadfe08 | |||
5b07d8331b | |||
3ea58a37a3 | |||
190081b246 | |||
a839540671 | |||
ad7384f5b1 | |||
25855e6dc0 | |||
1624cf7a21 | |||
285995dbe3 | |||
8d0af4d0c2 | |||
0398828021 | |||
5c42cc1416 | |||
1ba3db0dbb | |||
068b314dc7 | |||
7f9239f1f4 | |||
d1cc0f5fc6 | |||
c80c2737e0 | |||
e0ad3bc362 | |||
f6e9fe3aa6 | |||
f042ecc70f | |||
9c5c1adaac | |||
b166ce3656 | |||
bfb25dc49f | |||
0dd253f01a | |||
289a073275 | |||
e1771e53b5 | |||
d7c0570ad3 | |||
9188251b85 | |||
b5c9d8b07d | |||
041cfc3ec6 | |||
96deb059f3 | |||
f531bfd4a7 | |||
0d25c08745 | |||
ae480c4541 | |||
8fad99d37f | |||
fa15362b60 | |||
275c7ba60b | |||
dc01308c20 | |||
603971e590 | |||
5d3e9d47ff | |||
e53f2fd23d | |||
e2d1a54594 | |||
f364afefd9 | |||
61bcca0e3d | |||
14f7c99c30 | |||
fc804cd443 | |||
dc8c3121ef | |||
627b5a6aa1 | |||
4a67198a86 | |||
ea753db9c4 | |||
568f5dfbc3 | |||
26bf0c8618 | |||
035dfa62a1 | |||
a019e2f168 | |||
c89472f897 | |||
a4d176a3b8 | |||
64168f40c9 | |||
6894adf02e | |||
8c2ed133c3 | |||
b96bf6dd06 | |||
5035b060f3 | |||
9017706dbd | |||
1d2f4c677c | |||
24e1850800 | |||
4303d86e7f | |||
954653ad31 | |||
2ecc6e684a | |||
3d2f4e8724 | |||
18d08756cd | |||
d7d9bfcc74 | |||
abacd345af | |||
d875ef3466 | |||
5270b13465 | |||
01e315370e | |||
bbe8d280c1 | |||
0b7e8328f5 | |||
cdc88dd4ee | |||
56af3a2118 | |||
03d2ee2836 | |||
4873555459 | |||
1259f0a032 | |||
eb9fcf9fea | |||
108c7a3378 | |||
af735eecad | |||
ec5801ab36 | |||
a6abfb5639 | |||
a9f33961aa | |||
b0d8723793 | |||
b47394fcb6 | |||
f5044e4d8d | |||
e27ad55ae9 | |||
744c486e83 | |||
c2a910524c | |||
6aee8be124 | |||
1ac89233a1 | |||
671373b34c | |||
72006c4716 | |||
e8dfc420fe | |||
0c1666d911 | |||
01f497e64c | |||
de179d7332 | |||
3213902bb6 | |||
de70c6a16b | |||
6d78f64de1 | |||
279d309c73 | |||
37d462c75f | |||
9b851c37b8 | |||
bacd50086e | |||
bff5e90721 | |||
d446d04ad7 | |||
e9540a5880 | |||
37833f942a | |||
f054c33ce0 | |||
fd99785855 | |||
85caea0cb3 | |||
68e7208177 | |||
6ef0dca25f | |||
20a3fe4538 |
315 changed files with 13631 additions and 7404 deletions
7
.sops.yaml
Normal file
7
.sops.yaml
Normal file
|
@ -0,0 +1,7 @@
|
|||
keys:
|
||||
- &franz age1uauvjwfvg8u0zkn58ematurcptf43gz6vx44nwkq3xcnmwq95psqna9psw
|
||||
creation_rules:
|
||||
- path_regex: secrets/franz.yaml$
|
||||
key_groups:
|
||||
- age:
|
||||
- *franz
|
20
README.md
Normal file
20
README.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Nix-Config
|
||||
|
||||
## Installation
|
||||
|
||||
The NixOS installer image comes with password SSH auth disabled. Simply allowing the public Git keys is a nice workaround.
|
||||
```sh
|
||||
sudo systemctl start sshd
|
||||
mkdir ~/.ssh; curl https://git.ghoscht.com/ghoscht.keys > ~/.ssh/authorized_keys
|
||||
```
|
||||
|
||||
The specific config from "hosts" can be installed using the following command. Limiting the download speed is optional, but can come in handy.
|
||||
```sh
|
||||
sudo nixos-install --option download-speed 4000 --flake .#<CONFIG_NAME_HERE>
|
||||
```
|
||||
|
||||
## RPi Image generation
|
||||
```sh
|
||||
nix build .#nixosConfigurations.eustachius.config.system.build.sdImage
|
||||
sudo dd if=./result/sd-image/<IMAGE_NAME>.img of=/dev/<DEVICE_NAME> bs=1M status=progress
|
||||
```
|
74
disko/btrfs-swap.nix
Normal file
74
disko/btrfs-swap.nix
Normal file
|
@ -0,0 +1,74 @@
|
|||
{device ? throw "Set this to your disk device, e.g. /dev/sda", ...}: {
|
||||
disko.devices = {
|
||||
disk.main = {
|
||||
inherit device;
|
||||
type = "disk";
|
||||
content = {
|
||||
type = "gpt";
|
||||
partitions = {
|
||||
boot = {
|
||||
name = "boot";
|
||||
size = "1M";
|
||||
type = "EF02";
|
||||
};
|
||||
esp = {
|
||||
name = "ESP";
|
||||
size = "500M";
|
||||
type = "EF00";
|
||||
content = {
|
||||
type = "filesystem";
|
||||
format = "vfat";
|
||||
mountpoint = "/boot";
|
||||
mountOptions = ["umask=0077"];
|
||||
};
|
||||
};
|
||||
swap = {
|
||||
size = "4G";
|
||||
content = {
|
||||
type = "swap";
|
||||
resumeDevice = true;
|
||||
};
|
||||
};
|
||||
root = {
|
||||
name = "root";
|
||||
size = "100%";
|
||||
content = {
|
||||
type = "lvm_pv";
|
||||
vg = "root_vg";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
lvm_vg = {
|
||||
root_vg = {
|
||||
type = "lvm_vg";
|
||||
lvs = {
|
||||
root = {
|
||||
size = "100%FREE";
|
||||
content = {
|
||||
type = "btrfs";
|
||||
extraArgs = ["-f"];
|
||||
|
||||
subvolumes = {
|
||||
"/root" = {
|
||||
mountpoint = "/";
|
||||
};
|
||||
|
||||
"/home" = {
|
||||
mountOptions = ["compress=zstd"];
|
||||
mountpoint = "/home";
|
||||
};
|
||||
|
||||
"/nix" = {
|
||||
mountOptions = ["subvol=nix" "compress=zstd" "noatime"];
|
||||
mountpoint = "/nix";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
1622
flake.lock
1622
flake.lock
File diff suppressed because it is too large
Load diff
238
flake.nix
238
flake.nix
|
@ -1,76 +1,178 @@
|
|||
#
|
||||
# flake.nix *
|
||||
# ├─ ./hosts
|
||||
# │ └─ default.nix
|
||||
# ├─ ./darwin
|
||||
# │ └─ default.nix
|
||||
# └─ ./nix
|
||||
# └─ default.nix
|
||||
#
|
||||
{
|
||||
description = "Nix, NixOS and Nix Darwin System Flake Configuration";
|
||||
description = "GHOSCHT's NixOS config";
|
||||
|
||||
inputs =
|
||||
# References Used by Flake
|
||||
{
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; # Stable Nix Packages (Default)
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; # Unstable Nix Packages
|
||||
inputs = {
|
||||
# Nixpkgs
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
|
||||
home-manager = {
|
||||
# User Environment Manager
|
||||
url = "github:nix-community/home-manager/release-23.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nur = {
|
||||
# NUR Community Packages
|
||||
url = "github:nix-community/NUR"; # Requires "nur.nixosModules.nur" to be added to the host modules
|
||||
};
|
||||
|
||||
hyprland = {
|
||||
# Official Hyprland Flake
|
||||
url = "github:hyprwm/Hyprland"; # Requires "hyprland.nixosModules.default" to be added the host modules
|
||||
inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||
};
|
||||
|
||||
split-monitor-workspaces = {
|
||||
url = "github:Duckonaut/split-monitor-workspaces";
|
||||
inputs.hyprland.follows = "hyprland"; # <- make sure this line is present for the plugin to work as intended
|
||||
};
|
||||
# Home manager
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-24.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
nixpkgs-unstable,
|
||||
home-manager,
|
||||
nur,
|
||||
hyprland,
|
||||
split-monitor-workspaces,
|
||||
...
|
||||
}:
|
||||
# Function telling flake which inputs to use
|
||||
let
|
||||
vars = {
|
||||
# Variables Used In Flake
|
||||
user = "ghoscht";
|
||||
location = "$HOME/.setup";
|
||||
terminal = "alacritty";
|
||||
editor = "nvim";
|
||||
};
|
||||
in {
|
||||
nixosConfigurations = ( # NixOS Configurations
|
||||
import ./hosts {
|
||||
inherit (nixpkgs) lib;
|
||||
inherit inputs nixpkgs nixpkgs-unstable home-manager nur hyprland split-monitor-workspaces vars; # Inherit inputs
|
||||
}
|
||||
);
|
||||
hardware.url = "github:nixos/nixos-hardware";
|
||||
|
||||
homeConfigurations = ( # Nix Configurations
|
||||
import ./nix/home.nix {
|
||||
inherit (nixpkgs) lib;
|
||||
inherit inputs nixpkgs nixpkgs-unstable home-manager vars hyprland split-monitor-workspaces;
|
||||
}
|
||||
);
|
||||
disko = {
|
||||
url = "github:nix-community/disko";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
firefox-addons = {
|
||||
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
xremap = {
|
||||
url = "github:xremap/nix-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nix-flatpak.url = "github:gmodena/nix-flatpak/?ref=latest";
|
||||
|
||||
heliox-cli = {
|
||||
url = "git+https://git.ghoscht.com/heliox/cli?ref=custom-dimming";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
picokontroller = {
|
||||
url = "git+https://git.ghoscht.com/ghoscht/picoKontroller";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
sops-nix = {
|
||||
url = "github:Mic92/sops-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
arion = {
|
||||
url = "github:hercules-ci/arion";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
stylix = {
|
||||
url = "github:danth/stylix/release-24.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
nixvim = {
|
||||
url = "github:nix-community/nixvim/nixos-24.11";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{ self
|
||||
, nixpkgs
|
||||
, home-manager
|
||||
, ...
|
||||
} @ inputs:
|
||||
let
|
||||
inherit (self) outputs;
|
||||
# Supported systems for your flake packages, shell, etc.
|
||||
systems = [
|
||||
"aarch64-linux"
|
||||
"i686-linux"
|
||||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
"x86_64-darwin"
|
||||
];
|
||||
# This is a function that generates an attribute by calling a function you
|
||||
# pass to it, with each system as an argument
|
||||
forAllSystems = nixpkgs.lib.genAttrs systems;
|
||||
vars = import ./vars.nix;
|
||||
in
|
||||
{
|
||||
# Your custom packages
|
||||
# Accessible through 'nix build', 'nix shell', etc
|
||||
packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system});
|
||||
# Formatter for your nix files, available through 'nix fmt'
|
||||
# Other options beside 'alejandra' include 'nixpkgs-fmt'
|
||||
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra);
|
||||
|
||||
# Your custom packages and modifications, exported as overlays
|
||||
overlays = import ./overlays { inherit inputs; };
|
||||
# Reusable nixos modules you might want to export
|
||||
# These are usually stuff you would upstream into nixpkgs
|
||||
nixosModules = import ./modules/nixos;
|
||||
# Reusable home-manager modules you might want to export
|
||||
# These are usually stuff you would upstream into home-manager
|
||||
homeManagerModules = import ./modules/home-manager;
|
||||
|
||||
# NixOS configuration entrypoint
|
||||
# Available through 'nixos-rebuild --flake .#your-hostname'
|
||||
nixosConfigurations = {
|
||||
adalbert = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs outputs vars; };
|
||||
modules = [
|
||||
./hosts/adalbert
|
||||
];
|
||||
};
|
||||
ludwig = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs outputs vars; };
|
||||
modules = [
|
||||
./hosts/ludwig
|
||||
];
|
||||
};
|
||||
leopold = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs outputs vars; };
|
||||
modules = [
|
||||
./hosts/leopold
|
||||
];
|
||||
};
|
||||
franz = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs outputs vars; };
|
||||
modules = [
|
||||
./hosts/franz
|
||||
];
|
||||
};
|
||||
# build with nix build .#nixosConfigurations.eustachius.config.system.build.sdImage
|
||||
eustachius = nixpkgs.lib.nixosSystem {
|
||||
system = "aarch64-linux";
|
||||
modules = [
|
||||
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64-installer.nix"
|
||||
./hosts/eustachius
|
||||
|
||||
# extra config for sdImage generator
|
||||
{
|
||||
sdImage.compressImage = false;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Standalone home-manager configuration entrypoint
|
||||
# Available through 'home-manager --flake .#your-username@your-hostname'
|
||||
homeConfigurations = {
|
||||
"${vars.user}@adalbert" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = { inherit inputs outputs vars; };
|
||||
modules = [
|
||||
./home/adalbert.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
"${vars.user}@ludwig" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = { inherit inputs outputs vars; };
|
||||
modules = [
|
||||
./home/ludwig.nix
|
||||
];
|
||||
};
|
||||
"${vars.user}@franz" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance
|
||||
extraSpecialArgs = { inherit inputs outputs vars; };
|
||||
modules = [
|
||||
./home/franz.nix
|
||||
];
|
||||
};
|
||||
# "${vars.user}@eustachius" = home-manager.lib.homeManagerConfiguration {
|
||||
# pkgs = nixpkgs.legacyPackages.aarch64-linux; # Home-manager requires 'pkgs' instance
|
||||
# extraSpecialArgs = {inherit inputs outputs vars;};
|
||||
# modules = [
|
||||
# ./home/eustachius.nix
|
||||
# ];
|
||||
# };
|
||||
};
|
||||
}
|
||||
|
|
48
home/adalbert.nix
Normal file
48
home/adalbert.nix
Normal file
|
@ -0,0 +1,48 @@
|
|||
{ inputs
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
./global
|
||||
./features/desktop/awesome
|
||||
./features/desktop/hyprland
|
||||
./features/games
|
||||
./features/coding
|
||||
./features/desktop/common/alacritty.nix
|
||||
];
|
||||
|
||||
home.packages = [
|
||||
inputs.picokontroller.packages.x86_64-linux.default
|
||||
];
|
||||
nixpkgs = {
|
||||
config = {
|
||||
permittedInsecurePackages = [
|
||||
"electron-25.9.0"
|
||||
"nix-2.15.3"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
exec-once = [
|
||||
"picokontroller" # volume & light control
|
||||
"easyeffects --gapplication-service"
|
||||
"xrandr --output DP-3 --primary" # since wayland doesn't have a concept of primary monitors
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
home.file = {
|
||||
".local/share/jellyfinmediaplayer/scripts/mpris.so".source = "${pkgs.mpvScripts.mpris}/share/mpv/scripts/mpris.so";
|
||||
};
|
||||
|
||||
services.flatpak.overrides = {
|
||||
"com.github.iwalton3.jellyfin-media-player".Context = {
|
||||
sockets = [
|
||||
"!wayland"
|
||||
"x11"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
5
home/features/cli/bat.nix
Normal file
5
home/features/cli/bat.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
12
home/features/cli/btop.nix
Normal file
12
home/features/cli/btop.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{config, ...}: {
|
||||
programs.btop = {
|
||||
enable = true;
|
||||
settings = {
|
||||
theme_background = false;
|
||||
truecolor = true;
|
||||
vim_keys = true;
|
||||
rounded_corners = true;
|
||||
proc_gradient = false;
|
||||
};
|
||||
};
|
||||
}
|
40
home/features/cli/default.nix
Normal file
40
home/features/cli/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./bat.nix
|
||||
./direnv.nix
|
||||
./fish.nix
|
||||
./git.nix
|
||||
./gpg.nix
|
||||
./btop.nix
|
||||
./nix-index.nix
|
||||
./lazygit.nix
|
||||
];
|
||||
home.packages = with pkgs; [
|
||||
comma # Install and run programs by sticking a , before them
|
||||
distrobox # Nice escape hatch, integrates docker images with my environment
|
||||
|
||||
bc # Calculator
|
||||
eza # Better ls
|
||||
ripgrep # Better grep
|
||||
fd # Better find
|
||||
httpie # Better curl
|
||||
diffsitter # Better diff
|
||||
jq # JSON pretty printer and manipulator
|
||||
timer # Nice looking timer
|
||||
lazydocker # Docker TUI
|
||||
fastfetch # Unixporn stuff
|
||||
tldr # Nice & short manual snippets
|
||||
ntfy-sh # Push notifications to other devices
|
||||
ipinfo # IP geolocation
|
||||
ranger # TUI file manager
|
||||
trickle # cli network limiter
|
||||
du-dust # disk usage visualizer
|
||||
lftp # FTP client
|
||||
unar # unarchive files like rar, zip, tar
|
||||
glow # fancy markdown viewer
|
||||
|
||||
nvd # Differ
|
||||
nix-output-monitor
|
||||
nh # Nice wrapper for NixOS and HM
|
||||
];
|
||||
}
|
6
home/features/cli/direnv.nix
Normal file
6
home/features/cli/direnv.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
}
|
106
home/features/cli/fish.nix
Normal file
106
home/features/cli/fish.nix
Normal file
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf;
|
||||
hasPackage = pname: lib.any (p: p ? pname && p.pname == pname) config.home.packages;
|
||||
hasLftp = hasPackage "lftp";
|
||||
hasExa = hasPackage "eza";
|
||||
hasLazygit = config.programs.lazygit.enable;
|
||||
hasLazydocker = hasPackage "lazydocker";
|
||||
hasNixYourShell = hasPackage "nix-your-shell";
|
||||
hasWezterm = config.programs.wezterm.enable;
|
||||
in {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
interactiveShellInit = ''
|
||||
${
|
||||
if hasNixYourShell
|
||||
then "nix-your-shell fish | source"
|
||||
else ""
|
||||
}
|
||||
'';
|
||||
plugins = [
|
||||
{
|
||||
name = "grc";
|
||||
src = pkgs.fishPlugins.grc.src;
|
||||
}
|
||||
{
|
||||
name = "fzf";
|
||||
src = pkgs.fishPlugins.fzf.src;
|
||||
}
|
||||
{
|
||||
name = "tide";
|
||||
src = pkgs.fishPlugins.tide.src;
|
||||
}
|
||||
{
|
||||
name = "sponge";
|
||||
src = pkgs.fishPlugins.sponge.src;
|
||||
}
|
||||
{
|
||||
name = "autopair";
|
||||
src = pkgs.fishPlugins.autopair.src;
|
||||
}
|
||||
{
|
||||
name = "puffer";
|
||||
src = pkgs.fishPlugins.puffer.src;
|
||||
}
|
||||
{
|
||||
name = "z";
|
||||
src = pkgs.fishPlugins.z.src;
|
||||
}
|
||||
];
|
||||
shellAliases = {
|
||||
lzg = mkIf hasLazygit "lazygit";
|
||||
lzd = mkIf hasLazydocker "lazydocker";
|
||||
batt = ''upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep -e "percentage" -e "state"'';
|
||||
slp = "systemctl suspend";
|
||||
sdn = "shutdown 0";
|
||||
nrs = "nh os switch ~/.setup";
|
||||
|
||||
ls = mkIf hasExa "eza";
|
||||
ll = mkIf hasExa "eza -l";
|
||||
la = mkIf hasExa "eza -la";
|
||||
exa = mkIf hasExa "eza";
|
||||
|
||||
imgcat = mkIf hasWezterm "wezterm imgcat";
|
||||
};
|
||||
shellAbbrs = rec {
|
||||
jqless = "jq -C | less -r";
|
||||
|
||||
n = "nix";
|
||||
nd = "nix develop -c $SHELL";
|
||||
ns = "nix shell";
|
||||
nsn = "nix shell nixpkgs#";
|
||||
nb = "nix build";
|
||||
nbn = "nix build nixpkgs#";
|
||||
nf = "nix flake";
|
||||
|
||||
glk = "gpg --list-keys --with-keygrip";
|
||||
gssh = "gpg --export-ssh-key";
|
||||
gnk = "gpg --full-generate-key --expert";
|
||||
gek = "gpg --edit-key --expert";
|
||||
|
||||
udmount = "udisksctl mount -b";
|
||||
udumount = "udisksctl unmount -b";
|
||||
|
||||
fftp = mkIf hasLftp "lftp -u ghoscht, sftp://192.168.178.35";
|
||||
arss = "sudo autorestic exec -av -- snapshots";
|
||||
};
|
||||
functions = {
|
||||
# Disable greeting
|
||||
fish_greeting = "";
|
||||
fish_init_custom = ''
|
||||
tide configure --auto --style=Rainbow --prompt_colors='True color' --show_time=No --rainbow_prompt_separators=Vertical --powerline_prompt_heads=Slanted --powerline_prompt_tails=Flat --powerline_prompt_style='Two lines, frame' --prompt_connection=Solid --powerline_right_prompt_frame=No --prompt_connection_andor_frame_color=Darkest --prompt_spacing=Compact --icons='Many icons' --transient=Yes
|
||||
'';
|
||||
};
|
||||
};
|
||||
home.packages = with pkgs; [grc fzf nix-your-shell];
|
||||
|
||||
# Applies tide configure on rebuild
|
||||
home.activation.configureTide = lib.hm.dag.entryAfter ["writeBoundary"] ''
|
||||
${lib.getExe pkgs.fish} -c "fish_init_custom"
|
||||
'';
|
||||
}
|
22
home/features/cli/git.nix
Normal file
22
home/features/cli/git.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{pkgs, ...}: {
|
||||
#Prefer IPv4 for ssh
|
||||
# home.file.".ssh/config".text = "AddressFamily inet";
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
userName = "GHOSCHT";
|
||||
userEmail = "31184695+GHOSCHT@users.noreply.github.com";
|
||||
package = pkgs.gitAndTools.gitFull;
|
||||
|
||||
extraConfig = {
|
||||
commit.gpgsign = true;
|
||||
user.signingkey = "0x2C2C1C62A5388E82";
|
||||
init.defaultBranch = "main";
|
||||
pull.rebase = false; # merge by default
|
||||
};
|
||||
lfs.enable = true;
|
||||
aliases = {
|
||||
graph = "log --decorate --oneline --graph";
|
||||
};
|
||||
};
|
||||
}
|
25
home/features/cli/gpg.nix
Normal file
25
home/features/cli/gpg.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.gpg = {
|
||||
enable = true;
|
||||
};
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
enableSshSupport = true;
|
||||
enableFishIntegration = true;
|
||||
enableZshIntegration = true;
|
||||
pinentryPackage = pkgs.pinentry-gnome3;
|
||||
};
|
||||
|
||||
# Prevent clobbering SSH_AUTH_SOCK
|
||||
home.sessionVariables.GSM_SKIP_SSH_AGENT_WORKAROUND = "1";
|
||||
|
||||
# Disable gnome-keyring ssh-agent
|
||||
xdg.configFile."autostart/gnome-keyring-ssh.desktop".text = ''
|
||||
${lib.fileContents "${pkgs.gnome-keyring}/etc/xdg/autostart/gnome-keyring-ssh.desktop"}
|
||||
Hidden=true
|
||||
'';
|
||||
}
|
5
home/features/cli/lazygit.nix
Normal file
5
home/features/cli/lazygit.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{config, ...}: {
|
||||
programs.lazygit = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
33
home/features/cli/nix-index.nix
Normal file
33
home/features/cli/nix-index.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{pkgs, ...}: let
|
||||
update-script = pkgs.writeShellApplication {
|
||||
name = "fetch-nix-index-database";
|
||||
runtimeInputs = with pkgs; [wget coreutils];
|
||||
text = ''
|
||||
filename="index-x86_64-linux"
|
||||
mkdir -p ~/.cache/nix-index
|
||||
cd ~/.cache/nix-index
|
||||
wget -N "https://github.com/Mic92/nix-index-database/releases/latest/download/$filename"
|
||||
ln -f "$filename" files
|
||||
'';
|
||||
};
|
||||
in {
|
||||
programs.nix-index.enable = true;
|
||||
|
||||
systemd.user.services.nix-index-database-sync = {
|
||||
Unit = {Description = "fetch mic92/nix-index-database";};
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = "${update-script}/bin/fetch-nix-index-database";
|
||||
Restart = "on-failure";
|
||||
RestartSec = "5m";
|
||||
};
|
||||
};
|
||||
systemd.user.timers.nix-index-database-sync = {
|
||||
Unit = {Description = "Automatic github:mic92/nix-index-database fetching";};
|
||||
Timer = {
|
||||
OnBootSec = "10m";
|
||||
OnUnitActiveSec = "24h";
|
||||
};
|
||||
Install = {WantedBy = ["timers.target"];};
|
||||
};
|
||||
}
|
9
home/features/coding/default.nix
Normal file
9
home/features/coding/default.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
# ./nvim
|
||||
./nixvim
|
||||
./vscode.nix
|
||||
./intellij.nix
|
||||
./tmux.nix
|
||||
];
|
||||
}
|
14
home/features/coding/intellij.nix
Normal file
14
home/features/coding/intellij.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{ pkgs, ... }:
|
||||
let
|
||||
intellij = pkgs.unstable.jetbrains.idea-ultimate.override {
|
||||
jdk = pkgs.pkgs.openjdk17;
|
||||
};
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
(pkgs.unstable.jetbrains.plugins.addPlugins intellij [ "ideavim" ])
|
||||
];
|
||||
home.sessionVariables = {
|
||||
LD_LIBRARY_PATH = "${pkgs.libGL}/lib:${pkgs.gtk3}/lib:${pkgs.glib.out}/lib:${pkgs.xorg.libXtst}/lib";
|
||||
};
|
||||
}
|
95
home/features/coding/nixvim/cmp.nix
Normal file
95
home/features/coding/nixvim/cmp.nix
Normal file
|
@ -0,0 +1,95 @@
|
|||
{
|
||||
programs.nixvim.plugins = {
|
||||
cmp-emoji = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
cmp = {
|
||||
enable = true;
|
||||
settings = {
|
||||
completion = {
|
||||
completeopt = "menu,menuone,noinsert";
|
||||
};
|
||||
autoEnableSources = true;
|
||||
experimental = {ghost_text = true;};
|
||||
performance = {
|
||||
debounce = 60;
|
||||
fetchingTimeout = 200;
|
||||
maxViewEntries = 30;
|
||||
};
|
||||
snippet = {
|
||||
expand = ''
|
||||
function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end
|
||||
'';
|
||||
};
|
||||
formatting = {fields = ["kind" "abbr" "menu"];};
|
||||
sources = [
|
||||
{name = "nvim_lsp";}
|
||||
{name = "emoji";}
|
||||
{
|
||||
name = "buffer"; # text within current buffer
|
||||
option.get_bufnrs.__raw = "vim.api.nvim_list_bufs";
|
||||
keywordLength = 3;
|
||||
}
|
||||
# { name = "copilot"; } # enable/disable copilot
|
||||
{
|
||||
name = "path"; # file system paths
|
||||
keywordLength = 3;
|
||||
}
|
||||
{
|
||||
name = "luasnip"; # snippets
|
||||
keywordLength = 3;
|
||||
}
|
||||
];
|
||||
|
||||
window = {
|
||||
completion = {border = "solid";};
|
||||
documentation = {border = "solid";};
|
||||
};
|
||||
|
||||
mapping = {
|
||||
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
||||
"<C-j>" = "cmp.mapping.select_next_item()";
|
||||
"<C-k>" = "cmp.mapping.select_prev_item()";
|
||||
"<C-e>" = "cmp.mapping.abort()";
|
||||
"<C-b>" = "cmp.mapping.scroll_docs(-4)";
|
||||
"<C-f>" = "cmp.mapping.scroll_docs(4)";
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||
"<S-CR>" = "cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true })";
|
||||
"<C-l>" = ''
|
||||
cmp.mapping(function()
|
||||
if luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
end
|
||||
end, { 'i', 's' })
|
||||
'';
|
||||
"<C-h>" = ''
|
||||
cmp.mapping(function()
|
||||
if luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
end
|
||||
end, { 'i', 's' })
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
cmp-nvim-lsp = {
|
||||
enable = true; # LSP
|
||||
};
|
||||
cmp-buffer = {
|
||||
enable = true;
|
||||
};
|
||||
cmp-path = {
|
||||
enable = true; # file system paths
|
||||
};
|
||||
cmp_luasnip = {
|
||||
enable = true; # snippets
|
||||
};
|
||||
cmp-cmdline = {
|
||||
enable = true; # autocomplete for cmdline
|
||||
};
|
||||
};
|
||||
}
|
12
home/features/coding/nixvim/default.nix
Normal file
12
home/features/coding/nixvim/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{inputs, ...}: {
|
||||
imports = [
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
./options.nix
|
||||
./plugins.nix
|
||||
./cmp.nix
|
||||
./lsp.nix
|
||||
./none-ls.nix
|
||||
./keymaps.nix
|
||||
];
|
||||
programs.nixvim.enable = true;
|
||||
}
|
118
home/features/coding/nixvim/keymaps.nix
Normal file
118
home/features/coding/nixvim/keymaps.nix
Normal file
|
@ -0,0 +1,118 @@
|
|||
{
|
||||
programs.nixvim.keymaps = [
|
||||
{
|
||||
mode = [
|
||||
"n"
|
||||
"v"
|
||||
];
|
||||
key = "<leader>fc";
|
||||
action = "<cmd>lua vim.lsp.buf.format()<cr>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Format Code";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ch";
|
||||
action = "<cmd>noh<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Clear Highlighting";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-p>";
|
||||
action = "<cmd>Telescope live_grep<CR>";
|
||||
options = {
|
||||
desc = "Telescope LiveGrep";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fg";
|
||||
action = "<cmd>Telescope find_files<CR>";
|
||||
options = {
|
||||
desc = "Telescope File Search";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<C-n>";
|
||||
action = "<Cmd>Neotree toggle<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Toggle Neotree";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab><tab>";
|
||||
action = "<cmd>tabnew<cr>";
|
||||
options = {
|
||||
desc = "New Tab";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>]";
|
||||
action = "<cmd>BufferNext<cr>";
|
||||
options = {
|
||||
desc = "Next Tab";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>d";
|
||||
action = "<cmd>BufferClose<cr>";
|
||||
options = {
|
||||
desc = "Close Tab";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader><tab>[";
|
||||
action = "<cmd>BufferPrevious<cr>";
|
||||
options = {
|
||||
desc = "Previous Tab";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<c-k>";
|
||||
action = ":wincmd k<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Go Up";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<c-j>";
|
||||
action = ":wincmd j<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Go Down";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<c-h>";
|
||||
action = ":wincmd h<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Go Left";
|
||||
};
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<c-l>";
|
||||
action = ":wincmd l<CR>";
|
||||
options = {
|
||||
silent = true;
|
||||
desc = "Go Right";
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
29
home/features/coding/nixvim/lsp.nix
Normal file
29
home/features/coding/nixvim/lsp.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
programs.nixvim.plugins = {
|
||||
rustaceanvim.enable = true;
|
||||
|
||||
lsp = {
|
||||
enable = true;
|
||||
inlayHints = true;
|
||||
|
||||
servers = {
|
||||
ts_ls.enable = true; # TS/JS
|
||||
cssls.enable = true; # CSS
|
||||
html.enable = true; # HTML
|
||||
pyright.enable = true; # Python
|
||||
marksman.enable = true; # Markdown
|
||||
nil_ls.enable = true; # Nix
|
||||
dockerls.enable = true; # Docker
|
||||
bashls.enable = true; # Bash
|
||||
clangd.enable = true; # C/C++
|
||||
yamlls.enable = true; # YAML
|
||||
gopls.enable = true; # Go
|
||||
lua_ls = {
|
||||
# Lua
|
||||
enable = true;
|
||||
settings.telemetry.enable = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
44
home/features/coding/nixvim/none-ls.nix
Normal file
44
home/features/coding/nixvim/none-ls.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{
|
||||
programs.nixvim.plugins = {
|
||||
none-ls = {
|
||||
enable = true;
|
||||
sources = {
|
||||
code_actions = {
|
||||
statix.enable = true;
|
||||
gitsigns.enable = true;
|
||||
};
|
||||
diagnostics = {
|
||||
statix.enable = true;
|
||||
deadnix.enable = true;
|
||||
pylint.enable = true;
|
||||
checkstyle.enable = true;
|
||||
golangci_lint.enable = true; # Go
|
||||
};
|
||||
formatting = {
|
||||
alejandra.enable = true;
|
||||
stylua.enable = true;
|
||||
shfmt.enable = true;
|
||||
nixpkgs_fmt.enable = true;
|
||||
google_java_format.enable = false;
|
||||
gofmt.enable = true; # Go
|
||||
prettier = {
|
||||
enable = true;
|
||||
disableTsServerFormatter = true;
|
||||
};
|
||||
black = {
|
||||
enable = true;
|
||||
settings = ''
|
||||
{
|
||||
extra_args = { "--fast" },
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
completion = {
|
||||
luasnip.enable = true;
|
||||
spell.enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
53
home/features/coding/nixvim/options.nix
Normal file
53
home/features/coding/nixvim/options.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
{
|
||||
programs.nixvim = {
|
||||
config = {
|
||||
# System clipboard support, needs xclip/wl-clipboard
|
||||
clipboard = {
|
||||
providers = {
|
||||
wl-copy.enable = true; # Wayland
|
||||
xsel.enable = true; # For X11
|
||||
};
|
||||
register = "unnamedplus";
|
||||
};
|
||||
globals.mapleader = " ";
|
||||
opts = {
|
||||
number = true; # Show line numbers
|
||||
relativenumber = true; # Show relative line numbers
|
||||
shiftwidth = 0; # Tab width should be 2
|
||||
tabstop = 3; # Tab width should be 4
|
||||
|
||||
# Always show the signcolumn, otherwise text would be shifted when displaying error icons
|
||||
signcolumn = "yes";
|
||||
|
||||
# Enable mouse
|
||||
mouse = "a";
|
||||
|
||||
# Search
|
||||
ignorecase = true;
|
||||
smartcase = true;
|
||||
|
||||
# Save undo history
|
||||
undofile = true;
|
||||
|
||||
# Global substitution by default
|
||||
gdefault = true;
|
||||
|
||||
# Start scrolling when the cursor is X lines away from the top/bottom
|
||||
scrolloff = 8;
|
||||
|
||||
# Enable 24-bit RGB color in the TUI
|
||||
termguicolors = true;
|
||||
|
||||
# Wrap long lines at a character in 'breakat'
|
||||
linebreak = true;
|
||||
|
||||
smartindent = true;
|
||||
|
||||
# Remove EOB
|
||||
fillchars = {
|
||||
eob = " ";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
112
home/features/coding/nixvim/plugins.nix
Normal file
112
home/features/coding/nixvim/plugins.nix
Normal file
|
@ -0,0 +1,112 @@
|
|||
{pkgs, ...}: {
|
||||
programs.nixvim.plugins = {
|
||||
lualine.enable = true;
|
||||
oil.enable = true;
|
||||
nvim-surround.enable = true;
|
||||
|
||||
treesitter = {
|
||||
enable = true;
|
||||
grammarPackages = with pkgs.vimPlugins.nvim-treesitter.builtGrammars; [
|
||||
markdown
|
||||
# nix
|
||||
vim
|
||||
bash
|
||||
lua
|
||||
python
|
||||
json
|
||||
java
|
||||
rust
|
||||
cpp
|
||||
c
|
||||
css
|
||||
csv
|
||||
dockerfile
|
||||
diff
|
||||
gitignore
|
||||
git_config
|
||||
gitattributes
|
||||
make
|
||||
yaml
|
||||
toml
|
||||
typescript
|
||||
xml
|
||||
];
|
||||
};
|
||||
|
||||
# Autopairs
|
||||
nvim-autopairs = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
luasnip.enable = true;
|
||||
lazygit.enable = true;
|
||||
barbar.enable = true;
|
||||
rainbow-delimiters.enable = true;
|
||||
web-devicons.enable = true;
|
||||
|
||||
telescope = {
|
||||
enable = true;
|
||||
extensions = {
|
||||
fzf-native = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Dashboard
|
||||
alpha = {
|
||||
enable = true;
|
||||
theme = "dashboard";
|
||||
};
|
||||
# File tree
|
||||
neo-tree = {
|
||||
enable = true;
|
||||
enableDiagnostics = false;
|
||||
enableGitStatus = true;
|
||||
enableModifiedMarkers = true;
|
||||
enableRefreshOnWrite = true;
|
||||
closeIfLastWindow = true;
|
||||
popupBorderStyle = "rounded"; # Type: null or one of “NC”, “double”, “none”, “rounded”, “shadow”, “single”, “solid” or raw lua code
|
||||
buffers = {
|
||||
bindToCwd = false;
|
||||
followCurrentFile = {
|
||||
enabled = true;
|
||||
};
|
||||
};
|
||||
window = {
|
||||
width = 40;
|
||||
height = 15;
|
||||
autoExpandWidth = false;
|
||||
mappings = {
|
||||
"<space>" = "none";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Todo comments
|
||||
todo-comments = {
|
||||
enable = true;
|
||||
settings.colors = {
|
||||
error = ["DiagnosticError" "ErrorMsg" "#DC2626"];
|
||||
warning = ["DiagnosticWarn" "WarningMsg" "#FBBF24"];
|
||||
info = ["DiagnosticInfo" "#2563EB"];
|
||||
hint = ["DiagnosticHint" "#10B981"];
|
||||
default = ["Identifier" "#7C3AED"];
|
||||
test = ["Identifier" "#FF00FF"];
|
||||
};
|
||||
};
|
||||
|
||||
# Highlight word under cursor
|
||||
illuminate = {
|
||||
enable = true;
|
||||
underCursor = false;
|
||||
filetypesDenylist = [
|
||||
"Outline"
|
||||
"TelescopePrompt"
|
||||
"alpha"
|
||||
"harpoon"
|
||||
"reason"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
245
home/features/coding/nvim/default.nix
Normal file
245
home/features/coding/nvim/default.nix
Normal file
|
@ -0,0 +1,245 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
# vars,
|
||||
...
|
||||
}: let
|
||||
vars = import ../../../../vars.nix;
|
||||
stableExtraPkgs = with pkgs; [
|
||||
# LSP
|
||||
lua-language-server
|
||||
pkgs.nodePackages.typescript-language-server
|
||||
clang-tools
|
||||
|
||||
# Formatters
|
||||
stylua # lua
|
||||
black # pyton
|
||||
alejandra # nix
|
||||
clang-tools_16 # c/c++
|
||||
rustfmt
|
||||
yamlfmt
|
||||
prettierd
|
||||
vscode-langservers-extracted
|
||||
|
||||
# Linters
|
||||
ruff # python
|
||||
nodePackages.jsonlint # json
|
||||
nodePackages.eslint_d # javascript
|
||||
|
||||
# Tools
|
||||
xclip
|
||||
wl-clipboard
|
||||
fzf
|
||||
gcc
|
||||
|
||||
# idk?
|
||||
lua
|
||||
];
|
||||
unstableExtraPkgs = with pkgs.unstable; [
|
||||
# LSP
|
||||
nixd
|
||||
];
|
||||
in {
|
||||
home.sessionVariables.EDITOR = "nvim";
|
||||
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
|
||||
extraPackages = stableExtraPkgs ++ unstableExtraPkgs;
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
{
|
||||
plugin = neodev-nvim;
|
||||
type = "lua";
|
||||
config = ''
|
||||
require("neodev").setup({
|
||||
override = function(root_dir, library)
|
||||
if root_dir:find("/home/${vars.user + "/" + vars.dir_name}", 1, true) == 1 then
|
||||
library.enabled = true
|
||||
library.plugins = true
|
||||
end
|
||||
end,
|
||||
})
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
plugin = nvim-lspconfig;
|
||||
config = builtins.readFile ./plugin/lsp.lua;
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
{
|
||||
plugin = comment-nvim;
|
||||
config = "require('Comment').setup()";
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
cmp-path
|
||||
nvim-cmp
|
||||
{
|
||||
plugin = nvim-cmp;
|
||||
config = builtins.readFile ./plugin/cmp.lua;
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
{
|
||||
plugin = telescope-nvim;
|
||||
config = builtins.readFile ./plugin/telescope.lua;
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
telescope-fzf-native-nvim
|
||||
telescope-ui-select-nvim
|
||||
|
||||
cmp_luasnip
|
||||
cmp-nvim-lsp
|
||||
|
||||
luasnip
|
||||
friendly-snippets
|
||||
|
||||
{
|
||||
plugin = nvim-treesitter.withPlugins (p: [
|
||||
p.vim
|
||||
p.bash
|
||||
p.lua
|
||||
p.python
|
||||
p.json
|
||||
p.java
|
||||
p.rust
|
||||
p.cpp
|
||||
p.c
|
||||
p.css
|
||||
p.csv
|
||||
p.dockerfile
|
||||
p.diff
|
||||
p.gitignore
|
||||
p.git_config
|
||||
p.gitattributes
|
||||
p.make
|
||||
p.yaml
|
||||
p.toml
|
||||
p.typescript
|
||||
p.xml
|
||||
]);
|
||||
config = builtins.readFile ./plugin/treesitter.lua;
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
vim-nix
|
||||
|
||||
{
|
||||
plugin = lualine-nvim;
|
||||
config = builtins.readFile ./plugin/lualine.lua;
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
nvim-web-devicons
|
||||
plenary-nvim
|
||||
nui-nvim
|
||||
{
|
||||
plugin = neo-tree-nvim;
|
||||
config = builtins.readFile ./plugin/neo-tree.lua;
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
{
|
||||
plugin = gitsigns-nvim;
|
||||
config = "require('gitsigns').setup()";
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
diffview-nvim
|
||||
lazygit-nvim
|
||||
|
||||
{
|
||||
plugin = todo-comments-nvim;
|
||||
config = builtins.readFile ./plugin/todo.lua;
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
{
|
||||
plugin = alpha-nvim;
|
||||
config = builtins.readFile ./plugin/alpha.lua;
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
{
|
||||
plugin = none-ls-nvim;
|
||||
config = builtins.readFile ./plugin/none-ls.lua;
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
{
|
||||
plugin = nvim-autopairs;
|
||||
config = "require('nvim-autopairs').setup()";
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
barbar-nvim
|
||||
|
||||
{
|
||||
plugin = nvim-surround;
|
||||
config = "require('nvim-surround').setup({})";
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
vim-be-good
|
||||
|
||||
rainbow-delimiters-nvim
|
||||
|
||||
rustaceanvim
|
||||
|
||||
{
|
||||
plugin = vim-tmux-navigator;
|
||||
config = builtins.readFile ./plugin/vim-tmux-navigator.lua;
|
||||
type = "lua";
|
||||
}
|
||||
|
||||
{
|
||||
plugin = nvim-ts-autotag;
|
||||
config = "require('nvim-ts-autotag').setup({})";
|
||||
type = "lua";
|
||||
}
|
||||
];
|
||||
|
||||
extraLuaConfig = ''
|
||||
${builtins.readFile ./options.lua}
|
||||
'';
|
||||
};
|
||||
|
||||
xdg.desktopEntries = {
|
||||
nvim = {
|
||||
name = "Neovim";
|
||||
genericName = "Text Editor";
|
||||
comment = "Edit text files";
|
||||
exec = "nvim %F";
|
||||
icon = "nvim";
|
||||
mimeType = [
|
||||
"text/english"
|
||||
"text/plain"
|
||||
"text/x-makefile"
|
||||
"text/x-c++hdr"
|
||||
"text/x-c++src"
|
||||
"text/x-chdr"
|
||||
"text/x-csrc"
|
||||
"text/x-java"
|
||||
"text/x-moc"
|
||||
"text/x-pascal"
|
||||
"text/x-tcl"
|
||||
"text/x-tex"
|
||||
"application/x-shellscript"
|
||||
"text/x-c"
|
||||
"text/x-c++"
|
||||
];
|
||||
terminal = true;
|
||||
type = "Application";
|
||||
categories = ["Utility" "TextEditor"];
|
||||
};
|
||||
};
|
||||
}
|
25
home/features/coding/nvim/options.lua
Normal file
25
home/features/coding/nvim/options.lua
Normal file
|
@ -0,0 +1,25 @@
|
|||
vim.keymap.set("", "<Space>", "<Nop>")
|
||||
vim.keymap.set("", "<C-Space>", "<Nop>")
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = " "
|
||||
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
|
||||
-- vim.o.number = true
|
||||
vim.o.relativenumber = true
|
||||
|
||||
vim.o.signcolumn = "yes"
|
||||
|
||||
vim.o.tabstop = 4
|
||||
vim.o.shiftwidth = 4
|
||||
|
||||
vim.o.updatetime = 300
|
||||
|
||||
vim.o.termguicolors = true
|
||||
|
||||
vim.o.mouse = "a"
|
||||
|
||||
-- disable empty line ~
|
||||
vim.o.fillchars = "eob: "
|
||||
|
||||
vim.o.undofile = true
|
32
home/features/coding/nvim/plugin/alpha.lua
Normal file
32
home/features/coding/nvim/plugin/alpha.lua
Normal file
|
@ -0,0 +1,32 @@
|
|||
local dashboard = require("alpha.themes.dashboard")
|
||||
local function button(sc, txt, keybind, keybind_opts)
|
||||
local b = dashboard.button(sc, txt, keybind, keybind_opts)
|
||||
b.opts.hl = "Identifier"
|
||||
b.opts.hl_shortcut = "Identifier"
|
||||
return b
|
||||
end
|
||||
|
||||
dashboard.section.buttons.val = {
|
||||
button("r", " > Recent files", ":Telescope oldfiles<CR>"),
|
||||
button("n", " > New file", ":ene <BAR> startinsert <CR>"),
|
||||
button("f", " > Find files", ":Telescope find_files hidden=true<CR>"),
|
||||
button("u", " > Update plugins", ":PackerSync<CR>"),
|
||||
button("q", " > Quit Neovim", ":qa<CR>"),
|
||||
}
|
||||
dashboard.section.footer.val = require("alpha.fortune")
|
||||
dashboard.section.header.val = {
|
||||
[[ ███▄ █ ▓█████ ▒█████ ██▒ █▓ ██▓ ███▄ ▄███▓]],
|
||||
[[ ██ ▀█ █ ▓█ ▀ ▒██▒ ██▒▓██░ █▒▓██▒▓██▒▀█▀ ██▒]],
|
||||
[[▓██ ▀█ ██▒▒███ ▒██░ ██▒ ▓██ █▒░▒██▒▓██ ▓██░]],
|
||||
[[▓██▒ ▐▌██▒▒▓█ ▄ ▒██ ██░ ▒██ █░░░██░▒██ ▒██ ]],
|
||||
[[▒██░ ▓██░░▒████▒░ ████▓▒░ ▒▀█░ ░██░▒██▒ ░██▒]],
|
||||
[[░ ▒░ ▒ ▒ ░░ ▒░ ░░ ▒░▒░▒░ ░ ▐░ ░▓ ░ ▒░ ░ ░]],
|
||||
[[░ ░░ ░ ▒░ ░ ░ ░ ░ ▒ ▒░ ░ ░░ ▒ ░░ ░ ░]],
|
||||
[[ ░ ░ ░ ░ ░ ░ ░ ▒ ░░ ▒ ░░ ░ ]],
|
||||
[[ ░ ░ ░ ░ ░ ░ ░ ░ ]],
|
||||
[[ ░ ]],
|
||||
}
|
||||
|
||||
dashboard.section.header.opts.hl = "Function"
|
||||
dashboard.section.footer.opts.hl = "Function"
|
||||
require("alpha").setup(require("alpha.themes.dashboard").opts)
|
0
home/features/coding/nvim/plugin/barbar.lua
Normal file
0
home/features/coding/nvim/plugin/barbar.lua
Normal file
47
home/features/coding/nvim/plugin/cmp.lua
Normal file
47
home/features/coding/nvim/plugin/cmp.lua
Normal file
|
@ -0,0 +1,47 @@
|
|||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
luasnip.config.setup({})
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-n>"] = cmp.mapping.select_next_item(),
|
||||
["<C-p>"] = cmp.mapping.select_prev_item(),
|
||||
["<C-d>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete({}),
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = true,
|
||||
}),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_locally_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.locally_jumpable(-1) then
|
||||
luasnip.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "path" },
|
||||
},
|
||||
})
|
75
home/features/coding/nvim/plugin/lsp.lua
Normal file
75
home/features/coding/nvim/plugin/lsp.lua
Normal file
|
@ -0,0 +1,75 @@
|
|||
local on_attach = function(_, bufnr)
|
||||
local bufmap = function(keys, func)
|
||||
vim.keymap.set("n", keys, func, { buffer = bufnr })
|
||||
end
|
||||
|
||||
bufmap("<leader>r", vim.lsp.buf.rename)
|
||||
bufmap("<leader>a", vim.lsp.buf.code_action)
|
||||
|
||||
bufmap("gd", vim.lsp.buf.definition)
|
||||
bufmap("gD", vim.lsp.buf.declaration)
|
||||
bufmap("gI", vim.lsp.buf.implementation)
|
||||
bufmap("<leader>D", vim.lsp.buf.type_definition)
|
||||
|
||||
bufmap("gr", require("telescope.builtin").lsp_references)
|
||||
bufmap("<leader>s", require("telescope.builtin").lsp_document_symbols)
|
||||
bufmap("<leader>S", require("telescope.builtin").lsp_dynamic_workspace_symbols)
|
||||
|
||||
bufmap("K", vim.lsp.buf.hover)
|
||||
|
||||
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
|
||||
vim.lsp.buf.format()
|
||||
end, {})
|
||||
end
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||
|
||||
require("lspconfig").lua_ls.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = function()
|
||||
return vim.loop.cwd()
|
||||
end,
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = { checkThirdParty = false },
|
||||
telemetry = { enable = false },
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("lspconfig").nixd.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
require("lspconfig").ts_lsp.setup({
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
require("lspconfig").eslint.setup({
|
||||
settings = {
|
||||
packageManager = "yarn",
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
buffer = bufnr,
|
||||
command = "EslintFixAll",
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
callback = function()
|
||||
vim.lsp.buf.format()
|
||||
end,
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
require("lspconfig").clangd.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
client.server_capabilities.signatureHelpProvider = false
|
||||
on_attach(client, bufnr)
|
||||
end,
|
||||
capabilities = capabilities,
|
||||
})
|
10
home/features/coding/nvim/plugin/lualine.lua
Normal file
10
home/features/coding/nvim/plugin/lualine.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
local lualine = require("lualine")
|
||||
|
||||
local config = {
|
||||
options = {
|
||||
theme = "base16",
|
||||
globalstatus = true,
|
||||
},
|
||||
}
|
||||
|
||||
lualine.setup(config)
|
19
home/features/coding/nvim/plugin/neo-tree.lua
Normal file
19
home/features/coding/nvim/plugin/neo-tree.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
require("neo-tree").setup({
|
||||
close_if_last_window = true, -- Close Neo-tree if it is the last window left in the tab
|
||||
hide_root_node = true, -- Hide the root node
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
visible = false,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
hide_by_name = {
|
||||
".git",
|
||||
".DS_Store",
|
||||
"thumbs.db",
|
||||
},
|
||||
show_hidden_count = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "<C-n>", "<Cmd>Neotree toggle<CR>")
|
47
home/features/coding/nvim/plugin/none-ls.lua
Normal file
47
home/features/coding/nvim/plugin/none-ls.lua
Normal file
|
@ -0,0 +1,47 @@
|
|||
local null_ls = require("null-ls")
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
|
||||
local opts = {
|
||||
sources = {
|
||||
-- Lua
|
||||
null_ls.builtins.formatting.stylua,
|
||||
-- Python
|
||||
null_ls.builtins.formatting.black,
|
||||
-- null_ls.builtins.diagnostics.ruff,
|
||||
-- Javascript
|
||||
-- null_ls.builtins.diagnostics.eslint_d,
|
||||
-- null_ls.builtins.diagnostics.jsonlint,
|
||||
-- C/C++
|
||||
null_ls.builtins.formatting.clang_format,
|
||||
-- Nix
|
||||
null_ls.builtins.formatting.alejandra,
|
||||
-- Rust
|
||||
-- null_ls.builtins.formatting.rustfmt,
|
||||
-- YAML
|
||||
null_ls.builtins.formatting.yamlfmt,
|
||||
-- Typescript
|
||||
null_ls.builtins.formatting.prettier.with({
|
||||
condition = function(utils)
|
||||
return utils.has_file({ ".prettierrc.js" })
|
||||
end,
|
||||
}),
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.format({ bufnr = bufnr })
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
null_ls.setup(opts)
|
||||
vim.keymap.set("n", "<leader>gf", vim.lsp.buf.format, {})
|
1
home/features/coding/nvim/plugin/other.lua
Normal file
1
home/features/coding/nvim/plugin/other.lua
Normal file
|
@ -0,0 +1 @@
|
|||
|
20
home/features/coding/nvim/plugin/telescope.lua
Normal file
20
home/features/coding/nvim/plugin/telescope.lua
Normal file
|
@ -0,0 +1,20 @@
|
|||
require("telescope").setup({
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = true, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
-- the default case_mode is "smart_case"
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown({}),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("telescope").load_extension("fzf")
|
||||
require("telescope").load_extension("ui-select")
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<C-p>", builtin.find_files, {})
|
||||
vim.keymap.set("n", "<leader>fg", builtin.live_grep, {})
|
55
home/features/coding/nvim/plugin/todo.lua
Normal file
55
home/features/coding/nvim/plugin/todo.lua
Normal file
|
@ -0,0 +1,55 @@
|
|||
require("todo-comments").setup({
|
||||
signs = true,
|
||||
sign_priority = 8,
|
||||
keywords = {
|
||||
FIX = {
|
||||
icon = " ", -- icon used for the sign, and in search results
|
||||
color = "error", -- can be a hex color, or a named color (see below)
|
||||
alt = { "FIXME", "BUG", "FIXIT", "ISSUE" }, -- a set of other keywords that all map to this FIX keywords
|
||||
-- signs = false, -- configure signs for some keywords individually
|
||||
},
|
||||
TODO = { icon = " ", color = "info" },
|
||||
HACK = { icon = " ", color = "warning" },
|
||||
WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
|
||||
PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
|
||||
NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
|
||||
TEST = { icon = " ", color = "test", alt = { "TESTING", "PASSED", "FAILED" } },
|
||||
},
|
||||
gui_style = {
|
||||
fg = "NONE", -- The gui style to use for the fg highlight group.
|
||||
bg = "BOLD", -- The gui style to use for the bg highlight group.
|
||||
},
|
||||
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
|
||||
highlight = {
|
||||
multiline = true, -- enable multine todo comments
|
||||
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
|
||||
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
|
||||
before = "", -- "fg" or "bg" or empty
|
||||
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
|
||||
after = "fg", -- "fg" or "bg" or empty
|
||||
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
|
||||
comments_only = true, -- uses treesitter to match keywords in comments only
|
||||
max_line_len = 400, -- ignore lines longer than this
|
||||
exclude = {}, -- list of file types to exclude highlighting
|
||||
},
|
||||
colors = {
|
||||
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
|
||||
warning = { "DiagnosticWarn", "WarningMsg", "#FBBF24" },
|
||||
info = { "DiagnosticInfo", "#2563EB" },
|
||||
hint = { "DiagnosticHint", "#10B981" },
|
||||
default = { "Identifier", "#7C3AED" },
|
||||
test = { "Identifier", "#FF00FF" },
|
||||
},
|
||||
search = {
|
||||
command = "rg",
|
||||
args = {
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
},
|
||||
-- pattern = [[\b(KEYWORDS):]], -- ripgrep regex
|
||||
pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon.
|
||||
},
|
||||
})
|
9
home/features/coding/nvim/plugin/treesitter.lua
Normal file
9
home/features/coding/nvim/plugin/treesitter.lua
Normal file
|
@ -0,0 +1,9 @@
|
|||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {},
|
||||
|
||||
auto_install = false,
|
||||
|
||||
highlight = { enable = true },
|
||||
|
||||
indent = { enable = true },
|
||||
})
|
5
home/features/coding/nvim/plugin/vim-tmux-navigator.lua
Normal file
5
home/features/coding/nvim/plugin/vim-tmux-navigator.lua
Normal file
|
@ -0,0 +1,5 @@
|
|||
-- Navigate vim panes better
|
||||
vim.keymap.set("n", "<c-k>", ":wincmd k<CR>")
|
||||
vim.keymap.set("n", "<c-j>", ":wincmd j<CR>")
|
||||
vim.keymap.set("n", "<c-h>", ":wincmd h<CR>")
|
||||
vim.keymap.set("n", "<c-l>", ":wincmd l<CR>")
|
46
home/features/coding/tmux.nix
Normal file
46
home/features/coding/tmux.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = [pkgs.tmuxinator-fzf-start];
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
keyMode = "vi";
|
||||
customPaneNavigationAndResize = true;
|
||||
mouse = true;
|
||||
tmuxinator.enable = true;
|
||||
shortcut = "Space";
|
||||
extraConfig = ''
|
||||
bind % split-window -h -c "#{pane_current_path}"
|
||||
bind '"' split-window -v -c "#{pane_current_path}"
|
||||
set -sg escape-time 0
|
||||
'';
|
||||
plugins = with pkgs; [
|
||||
tmuxPlugins.vim-tmux-navigator
|
||||
{
|
||||
plugin = tmuxPlugins.catppuccin;
|
||||
extraConfig = ''
|
||||
set -g status-position top
|
||||
|
||||
set-option -sa terminal-features ',xterm-256color:RGB'
|
||||
|
||||
set -g @catppuccin_window_left_separator ""
|
||||
set -g @catppuccin_window_right_separator " "
|
||||
set -g @catppuccin_window_middle_separator " █"
|
||||
set -g @catppuccin_window_number_position "right"
|
||||
|
||||
set -g @catppuccin_window_default_fill "number"
|
||||
set -g @catppuccin_window_default_text "#W"
|
||||
|
||||
set -g @catppuccin_window_current_fill "number"
|
||||
set -g @catppuccin_window_current_text "#W"
|
||||
|
||||
set -g @catppuccin_status_modules_right "directory session"
|
||||
set -g @catppuccin_status_left_separator " "
|
||||
set -g @catppuccin_status_right_separator ""
|
||||
set -g @catppuccin_status_fill "icon"
|
||||
set -g @catppuccin_status_connect_separator "no"
|
||||
|
||||
set -g @catppuccin_directory_text "#{pane_current_path}"
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
68
home/features/coding/vscode.nix
Normal file
68
home/features/coding/vscode.nix
Normal file
|
@ -0,0 +1,68 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
vars,
|
||||
...
|
||||
}: let
|
||||
in {
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
package = pkgs.vscodium;
|
||||
enableUpdateCheck = false;
|
||||
extensions = with pkgs.vscode-extensions;
|
||||
[
|
||||
catppuccin.catppuccin-vsc
|
||||
pkief.material-icon-theme
|
||||
vscodevim.vim
|
||||
bbenoist.nix
|
||||
ms-python.python
|
||||
ms-toolsai.jupyter
|
||||
ms-toolsai.jupyter-renderers
|
||||
ms-toolsai.jupyter-keymap
|
||||
]
|
||||
++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
|
||||
{
|
||||
name = "remote-ssh-edit";
|
||||
publisher = "ms-vscode-remote";
|
||||
version = "0.47.2";
|
||||
sha256 = "1hp6gjh4xp2m1xlm1jsdzxw9d8frkiidhph6nvl24d0h8z34w49g";
|
||||
}
|
||||
];
|
||||
userSettings = {
|
||||
#Theming
|
||||
"window.menuBarVisibility" = "toggle";
|
||||
"editor.minimap.autohide" = false;
|
||||
#Extensions - General
|
||||
"extensions.autoCheckUpdates" = false;
|
||||
"extensions.autoUpdate" = false;
|
||||
# Startup
|
||||
"workbench.startupEditor" = "none";
|
||||
# Vim
|
||||
"editor.lineNumbers" = "relative";
|
||||
};
|
||||
keybindings = [
|
||||
# Navigating Autosuggest and Quick Open entries
|
||||
{
|
||||
"key" = "ctrl+j";
|
||||
"command" = "selectNextSuggestion";
|
||||
"when" = "suggestWidgetVisible";
|
||||
}
|
||||
{
|
||||
"key" = "ctrl+k";
|
||||
"command" = "selectPrevSuggestion";
|
||||
"when" = "suggestWidgetVisible";
|
||||
}
|
||||
{
|
||||
"key" = "ctrl+j";
|
||||
"command" = "workbench.action.quickOpenSelectNext";
|
||||
"when" = "inQuickOpen";
|
||||
}
|
||||
{
|
||||
"key" = "ctrl+k";
|
||||
"command" = "workbench.action.quickOpenSelectPrevious";
|
||||
"when" = "inQuickOpen";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
28
home/features/desktop/awesome/default.nix
Normal file
28
home/features/desktop/awesome/default.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
../common
|
||||
./zathura.nix
|
||||
];
|
||||
|
||||
home = {
|
||||
file.".wallpapers" = {
|
||||
source = ../../../../rsc/wallpaper;
|
||||
recursive = true;
|
||||
};
|
||||
file.".config/awesome/" = {
|
||||
source = ../../../../rsc/config/awesome;
|
||||
recursive = true;
|
||||
};
|
||||
|
||||
packages = with pkgs; [
|
||||
rofi
|
||||
redshift
|
||||
xbindkeys
|
||||
clipmenu
|
||||
flameshot
|
||||
xclip
|
||||
brightnessctl
|
||||
feh
|
||||
];
|
||||
};
|
||||
}
|
9
home/features/desktop/awesome/zathura.nix
Normal file
9
home/features/desktop/awesome/zathura.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
programs.zathura = {
|
||||
enable = true;
|
||||
options = {
|
||||
selection-clipboard = "clipboard";
|
||||
statusbar-home-tilde = true;
|
||||
};
|
||||
};
|
||||
}
|
3
home/features/desktop/common/3d-printing.nix
Normal file
3
home/features/desktop/common/3d-printing.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [freecad cura];
|
||||
}
|
11
home/features/desktop/common/alacritty.nix
Normal file
11
home/features/desktop/common/alacritty.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
programs.alacritty.enable = true;
|
||||
programs.alacritty.settings = {
|
||||
window = {
|
||||
padding = {
|
||||
x = 0;
|
||||
y = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
24
home/features/desktop/common/default.nix
Normal file
24
home/features/desktop/common/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
./firefox.nix
|
||||
./wezterm.nix
|
||||
./font.nix
|
||||
./playerctl.nix
|
||||
./easyeffects.nix
|
||||
./nextcloud.nix
|
||||
./flatpak.nix
|
||||
./notes.nix
|
||||
./fcitx5.nix
|
||||
];
|
||||
|
||||
home.packages = with pkgs;
|
||||
[
|
||||
signal-desktop # secure messenger
|
||||
webcord-vencord # more "privacy friendly" discord client
|
||||
anki
|
||||
calibre
|
||||
|
||||
mpv # Video player
|
||||
]
|
||||
++ (with pkgs.unstable; [feishin]);
|
||||
}
|
7
home/features/desktop/common/easyeffects.nix
Normal file
7
home/features/desktop/common/easyeffects.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{pkgs, ...}: {
|
||||
# services.easyeffects.enable = true;
|
||||
xdg.configFile."easyeffects/output/Beyerdynamic_DT990_Oratory.json" = {
|
||||
source = ../../../../rsc/config/easyeffects/Beyerdynamic_DT990_Oratory.json;
|
||||
};
|
||||
home.packages = with pkgs; [easyeffects];
|
||||
}
|
107
home/features/desktop/common/fcitx5.nix
Normal file
107
home/features/desktop/common/fcitx5.nix
Normal file
|
@ -0,0 +1,107 @@
|
|||
{pkgs, ...}: {
|
||||
# xdg.configFile."fcitx5" = {
|
||||
# source = ../../../../rsc/config/fcitx5;
|
||||
# recursive = true;
|
||||
# };
|
||||
xdg.configFile = {
|
||||
"fcitx5/config" = {
|
||||
force = true;
|
||||
text = ''
|
||||
[Hotkey]
|
||||
# Enumerate when press trigger key repeatedly
|
||||
EnumerateWithTriggerKeys=True
|
||||
# Temporally switch between first and current Input Method
|
||||
AltTriggerKeys=
|
||||
# Enumerate Input Method Forward
|
||||
EnumerateForwardKeys=
|
||||
# Enumerate Input Method Backward
|
||||
EnumerateBackwardKeys=
|
||||
# Skip first input method while enumerating
|
||||
EnumerateSkipFirst=False
|
||||
# Enumerate Input Method Group Forward
|
||||
EnumerateGroupForwardKeys=
|
||||
# Enumerate Input Method Group Backward
|
||||
EnumerateGroupBackwardKeys=
|
||||
# Activate Input Method
|
||||
ActivateKeys=
|
||||
# Deactivate Input Method
|
||||
DeactivateKeys=
|
||||
# Default Previous page
|
||||
PrevPage=
|
||||
# Default Next page
|
||||
NextPage=
|
||||
# Default Previous Candidate
|
||||
PrevCandidate=
|
||||
# Default Next Candidate
|
||||
NextCandidate=
|
||||
# Toggle embedded preedit
|
||||
TogglePreedit=
|
||||
|
||||
[Hotkey/TriggerKeys]
|
||||
0=Control+Alt+space
|
||||
|
||||
[Behavior]
|
||||
# Active By Default
|
||||
ActiveByDefault=False
|
||||
# Share Input State
|
||||
ShareInputState=No
|
||||
# Show preedit in application
|
||||
PreeditEnabledByDefault=True
|
||||
# Show Input Method Information when switch input method
|
||||
ShowInputMethodInformation=True
|
||||
# Show Input Method Information when changing focus
|
||||
showInputMethodInformationWhenFocusIn=False
|
||||
# Show compact input method information
|
||||
CompactInputMethodInformation=True
|
||||
# Show first input method information
|
||||
ShowFirstInputMethodInformation=True
|
||||
# Default page size
|
||||
DefaultPageSize=5
|
||||
# Override Xkb Option
|
||||
OverrideXkbOption=False
|
||||
# Custom Xkb Option
|
||||
CustomXkbOption=
|
||||
# Force Enabled Addons
|
||||
EnabledAddons=
|
||||
# Force Disabled Addons
|
||||
DisabledAddons=
|
||||
# Preload input method to be used by default
|
||||
PreloadInputMethod=True
|
||||
# Allow input method in the password field
|
||||
AllowInputMethodForPassword=False
|
||||
# Show preedit text when typing password
|
||||
ShowPreeditForPassword=False
|
||||
# Interval of saving user data in minutes
|
||||
AutoSavePeriod=30
|
||||
'';
|
||||
};
|
||||
|
||||
"fcitx5/profile" = {
|
||||
force = true;
|
||||
text = ''
|
||||
[Groups/0]
|
||||
# Group Name
|
||||
Name="Group 1"
|
||||
# Layout
|
||||
Default Layout=de
|
||||
# Default Input Method
|
||||
DefaultIM=mozc
|
||||
|
||||
[Groups/0/Items/0]
|
||||
# Name
|
||||
Name=keyboard-de
|
||||
# Layout
|
||||
Layout=
|
||||
|
||||
[Groups/0/Items/1]
|
||||
# Name
|
||||
Name=mozc
|
||||
# Layout
|
||||
Layout=
|
||||
|
||||
[GroupOrder]
|
||||
0="Group 1"
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
150
home/features/desktop/common/firefox.nix
Normal file
150
home/features/desktop/common/firefox.nix
Normal file
|
@ -0,0 +1,150 @@
|
|||
{ inputs
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
programs.librewolf = {
|
||||
enable = true;
|
||||
package = pkgs.librewolf.override {
|
||||
nativeMessagingHosts = with pkgs; [
|
||||
kdePackages.plasma-browser-integration
|
||||
];
|
||||
};
|
||||
|
||||
profiles.Default = {
|
||||
extensions = with inputs.firefox-addons.packages."x86_64-linux"; [
|
||||
bitwarden
|
||||
ublock-origin
|
||||
darkreader
|
||||
tabliss
|
||||
consent-o-matic
|
||||
floccus
|
||||
gesturefy
|
||||
plasma-integration
|
||||
libredirect
|
||||
yomitan
|
||||
];
|
||||
|
||||
search.engines = {
|
||||
"Nix Packages" = {
|
||||
urls = [
|
||||
{
|
||||
template = "https://search.nixos.org/packages";
|
||||
params = [
|
||||
{
|
||||
name = "type";
|
||||
value = "packages";
|
||||
}
|
||||
{
|
||||
name = "query";
|
||||
value = "{searchTerms}";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||
definedAliases = [ "@np" ];
|
||||
};
|
||||
|
||||
"Home Manager" = {
|
||||
urls = [
|
||||
{
|
||||
template = "https://home-manager-options.extranix.com";
|
||||
params = [
|
||||
{
|
||||
name = "query";
|
||||
value = "{searchTerms}";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg";
|
||||
definedAliases = [ "@hm" ];
|
||||
};
|
||||
|
||||
"Searx" = {
|
||||
urls = [
|
||||
{
|
||||
template = "https://paulgo.io/search";
|
||||
params = [
|
||||
{
|
||||
name = "q";
|
||||
value = "{searchTerms}";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
iconUpdateURL = "https://paulgo.io/favicon.ico";
|
||||
definedAliases = [ "@sx" ];
|
||||
};
|
||||
|
||||
"Amazon" = {
|
||||
urls = [
|
||||
{
|
||||
template = "https://www.amazon.de/s";
|
||||
params = [
|
||||
{
|
||||
name = "k";
|
||||
value = "{searchTerms}";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
iconUpdateURL = "https://amazon.de/favicon.ico";
|
||||
definedAliases = [ "@a" ];
|
||||
};
|
||||
|
||||
"YouTube" = {
|
||||
urls = [
|
||||
{
|
||||
template = "https://efy.piped.pages.dev/results";
|
||||
params = [
|
||||
{
|
||||
name = "search_query";
|
||||
value = "{searchTerms}";
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
iconUpdateURL = "https://piped.video/favicon.ico";
|
||||
definedAliases = [ "yt" ];
|
||||
};
|
||||
};
|
||||
search = {
|
||||
force = true;
|
||||
default = "DuckDuckGo";
|
||||
privateDefault = "DuckDuckGo";
|
||||
};
|
||||
|
||||
settings = {
|
||||
"ui.context_menus.after_mouseup" = true; # Fixes context menu after Gesturefy swipe
|
||||
"extensions.screenshots.disabled" = true; # Firefox Screenshot feature is annoying
|
||||
"privacy.clearOnShutdown_v2.cookiesAndStorage" = false; # Disable cookie clearing
|
||||
"media.hardwaremediakeys.enabled" = false; # Interferes with KDE Connect
|
||||
"browser.urlbar.keepPanelOpenDuringImeComposition" = true; # Improve Firefox IME support
|
||||
"media.eme.enabled" = true; # Enable DRM for e.g. Spotify
|
||||
"privacy.resistFingerprinting.autoDeclineNoUserInputCanvasPrompts" = true; # Automatically decline Canvas request
|
||||
"media.videocontrols.picture-in-picture.video-toggle.enabled" = false; # Disable picture in picture
|
||||
"dom.security.https_only_mode" = true;
|
||||
"browser.download.panel.shown" = false;
|
||||
"browser.toolbars.bookmarks.visibility" = "always";
|
||||
"signon.rememberSignons" = false;
|
||||
"browser.formfill.enable" = false;
|
||||
"signon. prefillForms" = false;
|
||||
"browser.shell.checkDefaultBrowser" = false;
|
||||
"browser.uiCustomization.state" = ''{"placements":{"widget-overflow-fixed-list":[],"unified-extensions-area":["addon_darkreader_org-browser-action","plasma-browser-integration_kde_org-browser-action","_506e023c-7f2b-40a3-8066-bc5deb40aebe_-browser-action","_testpilot-containers-browser-action","7esoorv3_alefvanoon_anonaddy_me-browser-action","_a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7_-browser-action","gdpr_cavi_au_dk-browser-action","firefoxcolor_mozilla_com-browser-action","firefox-translations-addon_mozilla_org-browser-action"],"nav-bar":["back-button","forward-button","stop-reload-button","urlbar-container","downloads-button","unified-extensions-button","ublock0_raymondhill_net-browser-action","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action"],"toolbar-menubar":["menubar-items"],"TabsToolbar":["tabbrowser-tabs","new-tab-button","alltabs-button"],"PersonalToolbar":["personal-bookmarks"]},"seen":["save-to-pocket-button","developer-button","_446900e4-71c2-419f-a6a7-df9c091e268b_-browser-action","addon_darkreader_org-browser-action","ublock0_raymondhill_net-browser-action","plasma-browser-integration_kde_org-browser-action","_506e023c-7f2b-40a3-8066-bc5deb40aebe_-browser-action","_testpilot-containers-browser-action","7esoorv3_alefvanoon_anonaddy_me-browser-action","_a6c4a591-f1b2-4f03-b3ff-767e5bedf4e7_-browser-action","gdpr_cavi_au_dk-browser-action","firefoxcolor_mozilla_com-browser-action","firefox-translations-addon_mozilla_org-browser-action"],"dirtyAreaCache":["nav-bar","PersonalToolbar","toolbar-menubar","TabsToolbar","unified-extensions-area"],"currentVersion":20,"newElementCount":4}'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
xdg.mimeApps.defaultApplications = {
|
||||
"text/html" = [ "firefox.desktop" ];
|
||||
"text/xml" = [ "firefox.desktop" ];
|
||||
"x-scheme-handler/http" = [ "firefox.desktop" ];
|
||||
"x-scheme-handler/https" = [ "firefox.desktop" ];
|
||||
};
|
||||
}
|
23
home/features/desktop/common/flatpak.nix
Normal file
23
home/features/desktop/common/flatpak.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ inputs, ... }: {
|
||||
imports = [ inputs.nix-flatpak.homeManagerModules.nix-flatpak ];
|
||||
services.flatpak = {
|
||||
uninstallUnmanaged = true;
|
||||
packages = [
|
||||
"md.obsidian.Obsidian"
|
||||
"com.github.iwalton3.jellyfin-media-player"
|
||||
"com.github.tchx84.Flatseal"
|
||||
];
|
||||
overrides = {
|
||||
global = {
|
||||
Context = {
|
||||
sockets = [ "wayland" "!x11" "!fallback-x11" ];
|
||||
filesystems = [
|
||||
"~/.local/share/fonts:ro"
|
||||
"~/.icons:ro"
|
||||
"/nix/store:ro"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
13
home/features/desktop/common/font.nix
Normal file
13
home/features/desktop/common/font.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{pkgs, ...}: {
|
||||
fontProfiles = {
|
||||
enable = true;
|
||||
monospace = {
|
||||
family = "JetBrains Mono Nerd Font";
|
||||
package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];};
|
||||
};
|
||||
regular = {
|
||||
family = "Fira Sans";
|
||||
package = pkgs.fira;
|
||||
};
|
||||
};
|
||||
}
|
3
home/features/desktop/common/nextcloud.nix
Normal file
3
home/features/desktop/common/nextcloud.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
services.nextcloud-client.enable = true;
|
||||
}
|
5
home/features/desktop/common/notes.nix
Normal file
5
home/features/desktop/common/notes.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
xournalpp
|
||||
];
|
||||
}
|
6
home/features/desktop/common/playerctl.nix
Normal file
6
home/features/desktop/common/playerctl.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [playerctl];
|
||||
services.playerctld = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
22
home/features/desktop/common/wezterm.nix
Normal file
22
home/features/desktop/common/wezterm.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
programs.wezterm = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
return {
|
||||
front_end = "WebGpu", -- fixes https://github.com/wez/wezterm/issues/5990H
|
||||
warn_about_missing_glyphs=false,
|
||||
enable_wayland = true,
|
||||
hide_tab_bar_if_only_one_tab = true,
|
||||
window_close_confirmation = "NeverPrompt",
|
||||
use_ime = true,
|
||||
set_environment_variables = {
|
||||
TERM = 'wezterm',
|
||||
},
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
5
home/features/desktop/gnome/default.nix
Normal file
5
home/features/desktop/gnome/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [
|
||||
../common
|
||||
];
|
||||
}
|
260
home/features/desktop/hyprland/config.nix
Normal file
260
home/features/desktop/hyprland/config.nix
Normal file
|
@ -0,0 +1,260 @@
|
|||
{
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
# autostart
|
||||
exec-once = [
|
||||
"systemctl --user start hyprpolkitagent" # polkit agent
|
||||
"hyprshade on bluelight" # set bluelight shader
|
||||
"fcitx5 -d" # japanese typing
|
||||
"webcord --start-minimized --force-audio-share-support" # discord but some privacy
|
||||
"kdeconnect-indicator & kdeconnect-cli -l" # kde connect
|
||||
"signal-desktop --start-in-tray"
|
||||
"wl-clip-persist --clipboard both &" # Keep Wayland clipboard even after programs close
|
||||
"wl-paste --watch cliphist store &" # Store clipboard contents in cliphist on each change
|
||||
];
|
||||
|
||||
input = {
|
||||
kb_layout = "de";
|
||||
numlock_by_default = true;
|
||||
follow_mouse = 1;
|
||||
sensitivity = 0; # 0 means no modification
|
||||
touchpad = {
|
||||
natural_scroll = true;
|
||||
};
|
||||
};
|
||||
|
||||
general = {
|
||||
"$mainMod" = "SUPER";
|
||||
"$terminal" = "alacritty";
|
||||
"$menu" = "wofi --show drun --allow-images --no-actions";
|
||||
layout = "dwindle";
|
||||
gaps_in = 5;
|
||||
gaps_out = 10;
|
||||
border_size = 2;
|
||||
border_part_of_window = false;
|
||||
no_border_on_floating = false;
|
||||
};
|
||||
|
||||
plugin = {
|
||||
hyprsplit = {
|
||||
num_workspaces = 10;
|
||||
};
|
||||
};
|
||||
|
||||
misc = {
|
||||
disable_hyprland_logo = true;
|
||||
always_follow_on_dnd = true;
|
||||
layers_hog_keyboard_focus = true;
|
||||
animate_manual_resizes = false;
|
||||
enable_swallow = true;
|
||||
focus_on_activate = true;
|
||||
new_window_takes_over_fullscreen = 2;
|
||||
middle_click_paste = false;
|
||||
};
|
||||
|
||||
dwindle = {
|
||||
pseudotile = true;
|
||||
preserve_split = true;
|
||||
};
|
||||
|
||||
master = {
|
||||
new_status = "master";
|
||||
};
|
||||
|
||||
decoration = {
|
||||
rounding = 10;
|
||||
|
||||
blur = {
|
||||
enabled = true;
|
||||
passes = 3;
|
||||
};
|
||||
|
||||
shadow = {
|
||||
enabled = true;
|
||||
range = 4;
|
||||
render_power = 3;
|
||||
};
|
||||
};
|
||||
|
||||
animations = {
|
||||
enabled = true;
|
||||
|
||||
# Default animations, see https://wiki.hyprland.org/Configuring/Animations/ for more
|
||||
|
||||
bezier = [
|
||||
"easeOutQuint,0.23,1,0.32,1"
|
||||
"easeInOutCubic,0.65,0.05,0.36,1"
|
||||
"linear,0,0,1,1"
|
||||
"almostLinear,0.5,0.5,0.75,1.0"
|
||||
"quick,0.15,0,0.1,1"
|
||||
];
|
||||
|
||||
animation = [
|
||||
"global, 1, 10, default"
|
||||
"border, 1, 5.39, easeOutQuint"
|
||||
"windows, 1, 4.79, easeOutQuint"
|
||||
"windowsIn, 1, 4.1, easeOutQuint, popin 87%"
|
||||
"windowsOut, 1, 1.49, linear, popin 87%"
|
||||
"fadeIn, 1, 1.73, almostLinear"
|
||||
"fadeOut, 1, 1.46, almostLinear"
|
||||
"fade, 1, 3.03, quick"
|
||||
"layers, 1, 3.81, easeOutQuint"
|
||||
"layersIn, 1, 4, easeOutQuint, fade"
|
||||
"layersOut, 1, 1.5, linear, fade"
|
||||
"fadeLayersIn, 1, 1.79, almostLinear"
|
||||
"fadeLayersOut, 1, 1.39, almostLinear"
|
||||
"workspaces, 1, 1.94, almostLinear, fade"
|
||||
"workspacesIn, 1, 1.21, almostLinear, fade"
|
||||
"workspacesOut, 1, 1.94, almostLinear, fade"
|
||||
];
|
||||
};
|
||||
|
||||
bind = [
|
||||
"$mainMod, Return, exec, $terminal"
|
||||
"$mainMod SHIFT, C, killactive"
|
||||
"$mainMod, C ,exec, hyprshade off && hyprpicker -a && hyprshade on bluelight"
|
||||
"$mainMod SHIFT, Q, exit"
|
||||
"$mainMod, T, togglefloating"
|
||||
"$mainMod, Space, exec, $menu"
|
||||
"$mainMod, P, pseudo" # determine subsplit
|
||||
"$mainMod, F, fullscreen, 0"
|
||||
"$mainMod SHIFT, F, fullscreen, 1"
|
||||
", Print, exec, hyprshade off && grim -g \"$(slurp -w 0 -d -b 00000080)\" - | wl-copy && hyprshade on bluelight"
|
||||
"$mainMod, L, exec, hyprlock" # lockscreen
|
||||
"$mainMod SHIFT, L, exec, hyprlock & disown && systemctl suspend" # hibernation with lockscreen
|
||||
|
||||
# Move focus with mainMod + arrow keys
|
||||
"$mainMod, left, movefocus, l"
|
||||
"$mainMod, right, movefocus, r"
|
||||
"$mainMod, up, movefocus, u"
|
||||
"$mainMod, down, movefocus, d"
|
||||
"$mainMod, h, movefocus, l"
|
||||
"$mainMod, j, movefocus, d"
|
||||
"$mainMod, k, movefocus, u"
|
||||
"$mainMod, l, movefocus, r"
|
||||
|
||||
# Switch workspaces with mainMod + [0-9]
|
||||
"$mainMod, 1, split:workspace, 1"
|
||||
"$mainMod, 2, split:workspace, 2"
|
||||
"$mainMod, 3, split:workspace, 3"
|
||||
"$mainMod, 4, split:workspace, 4"
|
||||
"$mainMod, 5, split:workspace, 5"
|
||||
"$mainMod, 6, split:workspace, 6"
|
||||
"$mainMod, 7, split:workspace, 7"
|
||||
"$mainMod, 8, split:workspace, 8"
|
||||
"$mainMod, 9, split:workspace, 9"
|
||||
"$mainMod, 0, split:workspace, 10"
|
||||
|
||||
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
||||
"$mainMod SHIFT, 1, split:movetoworkspacesilent, 1"
|
||||
"$mainMod SHIFT, 2, split:movetoworkspacesilent, 2"
|
||||
"$mainMod SHIFT, 3, split:movetoworkspacesilent, 3"
|
||||
"$mainMod SHIFT, 4, split:movetoworkspacesilent, 4"
|
||||
"$mainMod SHIFT, 5, split:movetoworkspacesilent, 5"
|
||||
"$mainMod SHIFT, 6, split:movetoworkspacesilent, 6"
|
||||
"$mainMod SHIFT, 7, split:movetoworkspacesilent, 7"
|
||||
"$mainMod SHIFT, 8, split:movetoworkspacesilent, 8"
|
||||
"$mainMod SHIFT, 9, split:movetoworkspacesilent, 9"
|
||||
"$mainMod SHIFT, 0, split:movetoworkspacesilent, 10"
|
||||
|
||||
# window control
|
||||
"$mainMod SHIFT, left, movewindow, l"
|
||||
"$mainMod SHIFT, right, movewindow, r"
|
||||
"$mainMod SHIFT, up, movewindow, u"
|
||||
"$mainMod SHIFT, down, movewindow, d"
|
||||
"$mainMod SHIFT, h, movewindow, l"
|
||||
"$mainMod SHIFT, j, movewindow, d"
|
||||
"$mainMod SHIFT, k, movewindow, u"
|
||||
"$mainMod SHIFT, l, movewindow, r"
|
||||
|
||||
"$mainMod CTRL, left, resizeactive, -80 0"
|
||||
"$mainMod CTRL, right, resizeactive, 80 0"
|
||||
"$mainMod CTRL, up, resizeactive, 0 -80"
|
||||
"$mainMod CTRL, down, resizeactive, 0 80"
|
||||
"$mainMod CTRL, h, resizeactive, -80 0"
|
||||
"$mainMod CTRL, j, resizeactive, 0 80"
|
||||
"$mainMod CTRL, k, resizeactive, 0 -80"
|
||||
"$mainMod CTRL, l, resizeactive, 80 0"
|
||||
|
||||
"$mainMod ALT, left, moveactive, -80 0"
|
||||
"$mainMod ALT, right, moveactive, 80 0"
|
||||
"$mainMod ALT, up, moveactive, 0 -80"
|
||||
"$mainMod ALT, down, moveactive, 0 80"
|
||||
"$mainMod ALT, h, moveactive, -80 0"
|
||||
"$mainMod ALT, j, moveactive, 0 80"
|
||||
"$mainMod ALT, k, moveactive, 0 -80"
|
||||
"$mainMod ALT, l, moveactive, 80 0"
|
||||
|
||||
# Example special workspace (scratchpad)
|
||||
"$mainMod, S, togglespecialworkspace, magic"
|
||||
"$mainMod SHIFT, S, movetoworkspace, special:magic"
|
||||
|
||||
# Scroll through existing workspaces with mainMod + scroll
|
||||
"$mainMod, mouse_down, workspace, e+1"
|
||||
"$mainMod, mouse_up, workspace, e-1"
|
||||
|
||||
# media and volume controls
|
||||
",XF86AudioPlay,exec, playerctl play-pause"
|
||||
",XF86AudioNext,exec, playerctl next"
|
||||
",XF86AudioPrev,exec, playerctl previous"
|
||||
",XF86AudioStop,exec, playerctl stop"
|
||||
|
||||
# clipboard manager
|
||||
"$mainMod, V, exec, cliphist list | wofi --show dmenu | cliphist decode | wl-copy"
|
||||
];
|
||||
|
||||
# Move/resize windows with mainMod + LMB/RMB and dragging
|
||||
bindm = [
|
||||
"$mainMod, mouse:272, movewindow"
|
||||
"$mainMod, mouse:273, resizewindow"
|
||||
];
|
||||
|
||||
windowrulev2 = [
|
||||
"suppressevent maximize, class:.*" # Ignore maximize requests from apps. You'll probably like this.
|
||||
"nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0" # Fix some dragging issues with XWayland
|
||||
|
||||
"float, title:^(Picture-in-Picture)$"
|
||||
"opacity 1.0 override 1.0 override, title:^(Picture-in-Picture)$"
|
||||
"pin, title:^(Picture-in-Picture)$"
|
||||
"float,class:^(pavucontrol)$"
|
||||
"float,class:^(SoundWireServer)$"
|
||||
"float,class:^(.sameboy-wrapped)$"
|
||||
"float,class:^(file_progress)$"
|
||||
"float,class:^(confirm)$"
|
||||
"float,class:^(dialog)$"
|
||||
"float,class:^(download)$"
|
||||
"float,class:^(notification)$"
|
||||
"float,class:^(error)$"
|
||||
"float,class:^(confirmreset)$"
|
||||
"float,title:^(Open File)$"
|
||||
"float,title:^(File Upload)$"
|
||||
"float,title:^(branchdialog)$"
|
||||
"float,title:^(Confirm to replace files)$"
|
||||
"float,title:^(File Operation Progress)$"
|
||||
|
||||
# workspace setup
|
||||
"workspace 10, class:^(feishin)$"
|
||||
|
||||
# nextcloud
|
||||
"float,class:^(com.nextcloud.desktopclient.nextcloud)$"
|
||||
"stayfocused,class:^(com.nextcloud.desktopclient.nextcloud)$" # otherwise window immediately closes
|
||||
|
||||
# Remove context menu transparency in chromium based apps
|
||||
"opaque,class:^()$,title:^()$"
|
||||
"noshadow,class:^()$,title:^()$"
|
||||
"noblur,class:^()$,title:^()$"
|
||||
];
|
||||
|
||||
monitor = [
|
||||
"DP-1, 1920x1080@74.97, auto-left, 1" # Adalbert: Left
|
||||
"DP-3, 2560x1440@143.86, auto-right, 1" # Adalbert: Right
|
||||
"eDP-1, 1920x1080@60, auto, 1" # Ludwig
|
||||
",preferred,auto,auto"
|
||||
];
|
||||
|
||||
misc = {
|
||||
vrr = 1;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
117
home/features/desktop/hyprland/default.nix
Normal file
117
home/features/desktop/hyprland/default.nix
Normal file
|
@ -0,0 +1,117 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
imports = [ ./config.nix ./variables.nix ./hyprlock.nix];
|
||||
home.packages = with pkgs; [
|
||||
hyprpicker # color picker
|
||||
wofi # dmenu replacement
|
||||
hyprshade # shader control, used for rudimentary blue-light filter
|
||||
hyprpolkitagent
|
||||
grim
|
||||
slurp
|
||||
|
||||
# clipboard management
|
||||
wl-clip-persist
|
||||
wl-clipboard
|
||||
cliphist
|
||||
];
|
||||
wayland.windowManager.hyprland = {
|
||||
enable = true;
|
||||
xwayland.enable = true;
|
||||
systemd.enable = true;
|
||||
plugins = [ pkgs.hyprlandPlugins.hyprsplit ];
|
||||
};
|
||||
services.dunst = {
|
||||
enable = true;
|
||||
settings = {
|
||||
global = {
|
||||
corner_radius = 5;
|
||||
};
|
||||
};
|
||||
};
|
||||
programs.waybar = {
|
||||
enable = true;
|
||||
systemd.enable = true;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
position = "top";
|
||||
|
||||
modules-left = [ "hyprland/workspaces" ];
|
||||
modules-center = [ "hyprland/window" ];
|
||||
modules-right = lib.mkDefault [ "tray" "memory" "cpu" "clock" ];
|
||||
|
||||
tray.spacing = 10;
|
||||
|
||||
clock.tooltip-format = "{:%d.%m.%Y}";
|
||||
cpu.format = "{}% ";
|
||||
memory.format = " | {}% ";
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
format = "{icon}";
|
||||
format-icons = {
|
||||
"9" = "";
|
||||
"10" = "";
|
||||
"11" = "1";
|
||||
"12" = "2";
|
||||
"13" = "3";
|
||||
"14" = "4";
|
||||
"15" = "5";
|
||||
"16" = "6";
|
||||
"17" = "7";
|
||||
"18" = "8";
|
||||
"19" = "9";
|
||||
"20" = "10";
|
||||
"urgent" = "";
|
||||
"focused" = "";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
xdg.configFile."hypr/shaders/bluelight.glsl".text = ''
|
||||
precision highp float;
|
||||
varying vec2 v_texcoord;
|
||||
uniform sampler2D tex;
|
||||
|
||||
const float temperature = 4000.0;
|
||||
const float temperatureStrength = 1.0;
|
||||
|
||||
#define WithQuickAndDirtyLuminancePreservation
|
||||
const float LuminancePreservationFactor = 1.0;
|
||||
|
||||
// function from https://www.shadertoy.com/view/4sc3D7
|
||||
// valid from 1000 to 40000 K (and additionally 0 for pure full white)
|
||||
vec3 colorTemperatureToRGB(const in float temperature) {
|
||||
// values from: http://blenderartists.org/forum/showthread.php?270332-OSL-Goodness&p=2268693&viewfull=1#post2268693
|
||||
mat3 m = (temperature <= 6500.0) ? mat3(vec3(0.0, -2902.1955373783176, -8257.7997278925690),
|
||||
vec3(0.0, 1669.5803561666639, 2575.2827530017594),
|
||||
vec3(1.0, 1.3302673723350029, 1.8993753891711275))
|
||||
: mat3(vec3(1745.0425298314172, 1216.6168361476490, -8257.7997278925690),
|
||||
vec3(-2666.3474220535695, -2173.1012343082230, 2575.2827530017594),
|
||||
vec3(0.55995389139931482, 0.70381203140554553, 1.8993753891711275));
|
||||
return mix(clamp(vec3(m[0] / (vec3(clamp(temperature, 1000.0, 40000.0)) + m[1]) + m[2]), vec3(0.0), vec3(1.0)),
|
||||
vec3(1.0), smoothstep(1000.0, 0.0, temperature));
|
||||
}
|
||||
|
||||
void main() {
|
||||
vec4 pixColor = texture2D(tex, v_texcoord);
|
||||
|
||||
// RGB
|
||||
vec3 color = vec3(pixColor[0], pixColor[1], pixColor[2]);
|
||||
|
||||
#ifdef WithQuickAndDirtyLuminancePreservation
|
||||
color *= mix(1.0, dot(color, vec3(0.2126, 0.7152, 0.0722)) / max(dot(color, vec3(0.2126, 0.7152, 0.0722)), 1e-5),
|
||||
LuminancePreservationFactor);
|
||||
#endif
|
||||
|
||||
color = mix(color, color * colorTemperatureToRGB(temperature), temperatureStrength);
|
||||
|
||||
vec4 outCol = vec4(color, pixColor[3]);
|
||||
|
||||
gl_FragColor = outCol;
|
||||
}
|
||||
'';
|
||||
}
|
36
home/features/desktop/hyprland/hyprlock.nix
Normal file
36
home/features/desktop/hyprland/hyprlock.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{ config, ... }:
|
||||
let
|
||||
textColor = config.lib.stylix.colors.base05;
|
||||
in
|
||||
{
|
||||
programs.hyprlock = {
|
||||
enable = true;
|
||||
settings = {
|
||||
# background = {
|
||||
# blur_passes = 1;
|
||||
# };
|
||||
label = [
|
||||
# Date
|
||||
{
|
||||
text = ''cmd[update:3600000] echo -e "<b> "$(date +'%A, %-d. %B %Y')" </b>"'';
|
||||
font_size = 35;
|
||||
color = "rgb(${textColor})";
|
||||
position = "0, -150";
|
||||
halign = "center";
|
||||
valign = "top";
|
||||
shadow_passes = 3;
|
||||
}
|
||||
# Time
|
||||
{
|
||||
text = ''cmd[update:3600000] echo -e "<b><big> $(date +"%H:%M") </big></b>"'';
|
||||
font_size = 94;
|
||||
color = "rgb(${textColor})";
|
||||
position = "0, -210";
|
||||
halign = "center";
|
||||
valign = "top";
|
||||
shadow_passes = 3;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
11
home/features/desktop/hyprland/variables.nix
Normal file
11
home/features/desktop/hyprland/variables.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
home.sessionVariables = {
|
||||
NIXOS_OZONE_WL = "1";
|
||||
GDK_BACKEND = "wayland";
|
||||
DIRENV_LOG_FORMAT = "";
|
||||
QT_QPA_PLATFORM = "xcb";
|
||||
XDG_SESSION_TYPE = "wayland";
|
||||
SDL_VIDEODRIVER = "wayland";
|
||||
CLUTTER_BACKEND = "wayland";
|
||||
};
|
||||
}
|
12
home/features/games/default.nix
Normal file
12
home/features/games/default.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{pkgs, ...}: {
|
||||
home.packages = with pkgs; [
|
||||
protonup-rs
|
||||
heroic
|
||||
(lutris.override {
|
||||
extraLibraries = pkgs: [
|
||||
wine
|
||||
wineWowPackages.stable
|
||||
];
|
||||
})
|
||||
];
|
||||
}
|
14
home/features/general/xdg-dirs.nix
Normal file
14
home/features/general/xdg-dirs.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
xdg.userDirs = {
|
||||
enable = true;
|
||||
createDirectories = true;
|
||||
desktop = "/home/ghoscht/Uni";
|
||||
download = "/home/ghoscht/Downloads";
|
||||
documents = "/home/ghoscht/Documents";
|
||||
music = null;
|
||||
pictures = "/home/ghoscht/Pictures";
|
||||
publicShare = null;
|
||||
templates = null;
|
||||
videos = null;
|
||||
};
|
||||
}
|
24
home/franz.nix
Normal file
24
home/franz.nix
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
inputs,
|
||||
outputs,
|
||||
...
|
||||
}: let
|
||||
in {
|
||||
imports = [
|
||||
./global
|
||||
./features/coding/nixvim
|
||||
./features/coding/tmux.nix
|
||||
];
|
||||
|
||||
home.file.".docker" = {
|
||||
source = ../rsc/docker/franz;
|
||||
recursive = true;
|
||||
};
|
||||
nixpkgs = {
|
||||
config = {
|
||||
permittedInsecurePackages = [
|
||||
"nix-2.15.3"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
84
home/global/default.nix
Normal file
84
home/global/default.nix
Normal file
|
@ -0,0 +1,84 @@
|
|||
# This is your home-manager configuration file
|
||||
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
|
||||
{
|
||||
inputs,
|
||||
outputs,
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
vars,
|
||||
...
|
||||
}: {
|
||||
# You can import other home-manager modules here
|
||||
imports =
|
||||
[
|
||||
# If you want to use modules your own flake exports (from modules/home-manager):
|
||||
# outputs.homeManagerModules.example
|
||||
|
||||
# Or modules exported from other flakes (such as nix-colors):
|
||||
# inputs.nix-colors.homeManagerModules
|
||||
|
||||
# You can also split up your configuration and import pieces of it here:
|
||||
../features/cli
|
||||
../features/general/xdg-dirs.nix
|
||||
]
|
||||
++ (builtins.attrValues outputs.homeManagerModules);
|
||||
|
||||
nixpkgs = {
|
||||
# You can add overlays here
|
||||
overlays =
|
||||
[
|
||||
# Add overlays your own flake exports (from overlays and pkgs dir):
|
||||
# outputs.overlays.additions
|
||||
# outputs.overlays.modifications
|
||||
# outputs.overlays.unstable-packages
|
||||
|
||||
# You can also add overlays exported from other flakes:
|
||||
# neovim-nightly-overlay.overlays.default
|
||||
|
||||
# Or define it inline, for example:
|
||||
# (final: prev: {
|
||||
# hi = final.hello.overrideAttrs (oldAttrs: {
|
||||
# patches = [ ./change-hello-to-hi.patch ];
|
||||
# });
|
||||
# })
|
||||
]
|
||||
++ (builtins.attrValues outputs.overlays);
|
||||
# Configure your nixpkgs instance
|
||||
config = {
|
||||
# Disable if you don't want unfree packages
|
||||
allowUnfree = true;
|
||||
permittedInsecurePackages = [
|
||||
"electron-24.8.6" #fixes Feishin & Webcord
|
||||
];
|
||||
# Workaround for https://github.com/nix-community/home-manager/issues/2942
|
||||
allowUnfreePredicate = _: true;
|
||||
};
|
||||
};
|
||||
|
||||
nix = {
|
||||
package = lib.mkDefault pkgs.nix;
|
||||
settings = {
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
warn-dirty = false;
|
||||
};
|
||||
};
|
||||
|
||||
home = {
|
||||
username = lib.mkDefault vars.user;
|
||||
homeDirectory = lib.mkDefault "/home/${config.home.username}";
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
stateVersion = "23.11";
|
||||
};
|
||||
|
||||
# Add stuff for your user as you see fit:
|
||||
# programs.neovim.enable = true;
|
||||
# home.packages = with pkgs; [ steam ];
|
||||
|
||||
# Enable home-manager and git
|
||||
programs.home-manager.enable = true;
|
||||
programs.git.enable = true;
|
||||
|
||||
# Nicely reload system units when changing configs
|
||||
systemd.user.startServices = "sd-switch";
|
||||
}
|
52
home/ludwig.nix
Normal file
52
home/ludwig.nix
Normal file
|
@ -0,0 +1,52 @@
|
|||
{ lib
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
./global
|
||||
./features/desktop/awesome
|
||||
./features/desktop/common/alacritty.nix
|
||||
./features/desktop/hyprland
|
||||
./features/desktop/gnome
|
||||
./features/coding
|
||||
];
|
||||
|
||||
home.packages = with pkgs; [ nextcloud-client ];
|
||||
|
||||
nixpkgs = {
|
||||
config = {
|
||||
permittedInsecurePackages = [
|
||||
"electron-25.9.0"
|
||||
"nix-2.15.3"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = {
|
||||
settings = {
|
||||
exec-once = [
|
||||
"${lib.getExe pkgs.batsignal} -c 20 -w 30 -f 80 -n BAT0 -a Battery"
|
||||
];
|
||||
bind = [
|
||||
", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%+"
|
||||
", XF86AudioLowerVolume, exec, wpctl set-volume -l 1.5 @DEFAULT_AUDIO_SINK@ 5%-"
|
||||
", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"
|
||||
", XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} set +10%"
|
||||
", XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} set 10%-"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
programs.waybar = {
|
||||
settings = {
|
||||
mainBar = {
|
||||
modules-right = [ "tray" "memory" "cpu" "battery" "clock" ];
|
||||
battery = {
|
||||
format = "{capacity}% {icon} ";
|
||||
format-icons = [ "" "" "" "" "" ];
|
||||
max-length = 25;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
84
hosts/adalbert/default.nix
Normal file
84
hosts/adalbert/default.nix
Normal file
|
@ -0,0 +1,84 @@
|
|||
{ inputs
|
||||
, outputs
|
||||
, pkgs
|
||||
, ...
|
||||
}: {
|
||||
imports = [
|
||||
inputs.hardware.nixosModules.common-cpu-amd-pstate
|
||||
inputs.hardware.nixosModules.common-gpu-nvidia-nonprime
|
||||
inputs.hardware.nixosModules.common-pc-ssd
|
||||
|
||||
./hardware-configuration.nix
|
||||
|
||||
../common/global
|
||||
../common/optional/desktop/awesome.nix
|
||||
../common/optional/desktop/hyprland.nix
|
||||
|
||||
../common/optional/systemd-boot.nix
|
||||
../common/optional/wireshark.nix
|
||||
../common/optional/kde-connect.nix
|
||||
../common/optional/gnome-keyring.nix
|
||||
../common/optional/adb.nix
|
||||
../common/optional/docker.nix
|
||||
../common/optional/gaming/gamemode.nix
|
||||
../common/optional/gaming/steam.nix
|
||||
../common/optional/desktop/japanese.nix
|
||||
../common/optional/udisks.nix
|
||||
../common/optional/fhs-compat.nix
|
||||
../common/optional/stylix.nix
|
||||
];
|
||||
|
||||
nixpkgs = {
|
||||
overlays = [
|
||||
outputs.overlays.additions
|
||||
outputs.overlays.modifications
|
||||
outputs.overlays.unstable-packages
|
||||
];
|
||||
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
firefox.enablePlasmaBrowserIntegration = true;
|
||||
segger-jlink.acceptLicense = true;
|
||||
permittedInsecurePackages = [ "segger-jlink-qt4-796s" "dotnet-runtime-6.0.36" "dotnet-sdk-wrapped-6.0.428" "dotnet-sdk-6.0.428" ];
|
||||
};
|
||||
};
|
||||
|
||||
networking.hostName = "adalbert";
|
||||
|
||||
services.udev.packages = [ inputs.heliox-cli.packages.x86_64-linux.default pkgs.segger-jlink ];
|
||||
environment.systemPackages = [ inputs.heliox-cli.packages.x86_64-linux.default ];
|
||||
|
||||
services.xserver.displayManager.gdm.enable = true;
|
||||
|
||||
boot.binfmt.emulatedSystems = [
|
||||
"aarch64-linux"
|
||||
"riscv64-linux"
|
||||
];
|
||||
|
||||
programs = {
|
||||
adb.enable = true;
|
||||
dconf.enable = true;
|
||||
coolercontrol = {
|
||||
enable = true;
|
||||
nvidiaSupport = true;
|
||||
};
|
||||
|
||||
# Personalausweis reader
|
||||
ausweisapp = {
|
||||
enable = true;
|
||||
openFirewall = true; # also sets firewall entry
|
||||
};
|
||||
};
|
||||
|
||||
hardware = {
|
||||
graphics.enable = true;
|
||||
opentabletdriver.enable = true;
|
||||
nvidia = {
|
||||
open = false;
|
||||
powerManagement.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
|
||||
system.stateVersion = "23.11";
|
||||
}
|
|
@ -18,17 +18,17 @@
|
|||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/f9ba57fb-0b82-47e0-8189-7bbebc530e2b";
|
||||
device = "/dev/disk/by-uuid/e92a5e85-52ce-4627-be79-5c07a99e2d1b";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/BCF2-51D4";
|
||||
device = "/dev/disk/by-uuid/348E-AC69";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{device = "/dev/disk/by-uuid/4834fbc3-3feb-4b93-b11f-8b9bd054c5c1";}
|
||||
{device = "/dev/disk/by-uuid/ae322cab-c083-4644-80ff-9122498d54e8";}
|
||||
];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
32
hosts/common/global/default.nix
Normal file
32
hosts/common/global/default.nix
Normal file
|
@ -0,0 +1,32 @@
|
|||
# This file (and the global directory) holds config that i use on all hosts
|
||||
{
|
||||
inputs,
|
||||
outputs,
|
||||
...
|
||||
}: {
|
||||
imports =
|
||||
[
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
./user.nix
|
||||
./fish.nix
|
||||
./locale.nix
|
||||
./nix.nix
|
||||
./power-button.nix
|
||||
./documentation.nix
|
||||
]
|
||||
++ (builtins.attrValues outputs.nixosModules);
|
||||
|
||||
home-manager.extraSpecialArgs = {inherit inputs outputs;};
|
||||
|
||||
nixpkgs = {
|
||||
overlays = builtins.attrValues outputs.overlays;
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Enable networking
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
boot.supportedFilesystems = ["ntfs"];
|
||||
}
|
9
hosts/common/global/documentation.nix
Normal file
9
hosts/common/global/documentation.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{pkgs, ...}: {
|
||||
environment.systemPackages = with pkgs; [man-pages man-pages-posix];
|
||||
documentation.dev.enable = true;
|
||||
documentation.man = {
|
||||
# In order to enable to mandoc man-db has to be disabled.
|
||||
man-db.enable = false;
|
||||
mandoc.enable = true;
|
||||
};
|
||||
}
|
17
hosts/common/global/fish.nix
Normal file
17
hosts/common/global/fish.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
vendor = {
|
||||
completions.enable = true;
|
||||
config.enable = true;
|
||||
functions.enable = true;
|
||||
};
|
||||
useBabelfish = true;
|
||||
};
|
||||
users.defaultUserShell = pkgs.fish;
|
||||
environment.shells = with pkgs; [fish];
|
||||
}
|
20
hosts/common/global/locale.nix
Normal file
20
hosts/common/global/locale.nix
Normal file
|
@ -0,0 +1,20 @@
|
|||
{lib, ...}: {
|
||||
time.timeZone = "Europe/Berlin";
|
||||
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
extraLocaleSettings = {
|
||||
LC_ADDRESS = "de_DE.UTF-8";
|
||||
LC_IDENTIFICATION = "de_DE.UTF-8";
|
||||
LC_MEASUREMENT = "de_DE.UTF-8";
|
||||
LC_MONETARY = "de_DE.UTF-8";
|
||||
LC_NAME = "de_DE.UTF-8";
|
||||
LC_NUMERIC = "de_DE.UTF-8";
|
||||
LC_PAPER = "de_DE.UTF-8";
|
||||
LC_TELEPHONE = "de_DE.UTF-8";
|
||||
LC_TIME = "de_DE.UTF-8";
|
||||
};
|
||||
};
|
||||
console.keyMap = "de";
|
||||
services.xserver.xkb.layout = "de";
|
||||
}
|
28
hosts/common/global/nix.nix
Normal file
28
hosts/common/global/nix.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
nix = {
|
||||
settings = {
|
||||
auto-optimise-store = lib.mkDefault true;
|
||||
experimental-features = ["nix-command" "flakes"];
|
||||
warn-dirty = false;
|
||||
system-features = ["kvm" "big-parallel" "nixos-test"];
|
||||
};
|
||||
gc = {
|
||||
automatic = true;
|
||||
dates = "weekly";
|
||||
# Keep the last 3 generations
|
||||
options = "--delete-older-than +3";
|
||||
};
|
||||
|
||||
# This will add each flake input as a registry
|
||||
# To make nix3 commands consistent with your flake
|
||||
registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs);
|
||||
|
||||
# Add nixpkgs input to NIX_PATH
|
||||
# This lets nix2 commands still use <nixpkgs>
|
||||
nixPath = ["nixpkgs=${inputs.nixpkgs.outPath}"];
|
||||
};
|
||||
}
|
10
hosts/common/global/podman.nix
Normal file
10
hosts/common/global/podman.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{config, ...}: let
|
||||
dockerEnabled = config.virtualisation.docker.enable;
|
||||
in {
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerCompat = !dockerEnabled;
|
||||
dockerSocket.enable = !dockerEnabled;
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
}
|
10
hosts/common/global/power-button.nix
Normal file
10
hosts/common/global/power-button.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
services.logind.extraConfig = ''
|
||||
# don't shutdown when power button is short-pressed
|
||||
HandlePowerKey=ignore
|
||||
'';
|
||||
}
|
45
hosts/common/global/user.nix
Normal file
45
hosts/common/global/user.nix
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
inputs,
|
||||
outputs,
|
||||
pkgs,
|
||||
config,
|
||||
vars,
|
||||
...
|
||||
}: let
|
||||
ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups;
|
||||
in {
|
||||
users.users.${vars.user} = {
|
||||
isNormalUser = true;
|
||||
shell = pkgs.fish;
|
||||
extraGroups =
|
||||
[
|
||||
"wheel"
|
||||
"video"
|
||||
"audio"
|
||||
"camera"
|
||||
]
|
||||
++ ifTheyExist [
|
||||
"minecraft"
|
||||
"network"
|
||||
"networkmanager"
|
||||
"wireshark"
|
||||
"i2c"
|
||||
"mysql"
|
||||
"docker"
|
||||
"podman"
|
||||
"git"
|
||||
"libvirtd"
|
||||
"deluge"
|
||||
"lp"
|
||||
"scanner"
|
||||
"kvm"
|
||||
"libvirtd"
|
||||
"tty"
|
||||
"dialout"
|
||||
];
|
||||
|
||||
packages = [pkgs.home-manager];
|
||||
};
|
||||
|
||||
home-manager.users.${vars.user} = import ../../../home/${config.networking.hostName}.nix;
|
||||
}
|
5
hosts/common/optional/adb.nix
Normal file
5
hosts/common/optional/adb.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{vars, ...}: let
|
||||
in {
|
||||
programs.adb.enable = true;
|
||||
users.users.${vars.user}.extraGroups = ["adbusers"];
|
||||
}
|
15
hosts/common/optional/desktop/awesome.nix
Normal file
15
hosts/common/optional/desktop/awesome.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [./global.nix ./x11.nix];
|
||||
|
||||
services = {
|
||||
xserver = {
|
||||
# dpi = 180;
|
||||
windowManager.awesome.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
14
hosts/common/optional/desktop/flatpak.nix
Normal file
14
hosts/common/optional/desktop/flatpak.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# Enable Flatpak
|
||||
services.flatpak.enable = true;
|
||||
|
||||
# Create folder where all fonts are linked to /run/current-system/sw/share/X11/fonts
|
||||
fonts.fontDir.enable = true;
|
||||
|
||||
xdg.portal.enable = true;
|
||||
}
|
16
hosts/common/optional/desktop/global.nix
Normal file
16
hosts/common/optional/desktop/global.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [./pipewire.nix ../printing.nix ./flatpak.nix ./xremap.nix];
|
||||
|
||||
# Enable for GTK
|
||||
programs.dconf.enable = true;
|
||||
|
||||
# Fix for qt6 plugins
|
||||
environment.profileRelativeSessionVariables = {
|
||||
QT_PLUGIN_PATH = ["/lib/qt-6/plugins"];
|
||||
};
|
||||
}
|
47
hosts/common/optional/desktop/gnome.nix
Normal file
47
hosts/common/optional/desktop/gnome.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [./global.nix ./x11.nix ./wayland.nix];
|
||||
|
||||
services = {
|
||||
libinput.enable = true;
|
||||
xserver = {
|
||||
desktopManager.gnome = {
|
||||
enable = true;
|
||||
};
|
||||
modules = [pkgs.xf86_input_wacom];
|
||||
wacom.enable = true;
|
||||
};
|
||||
udev.packages = with pkgs; [
|
||||
gnome-settings-daemon
|
||||
];
|
||||
};
|
||||
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
# System-Wide Packages
|
||||
adwaita-icon-theme
|
||||
dconf-editor
|
||||
gnome-tweaks
|
||||
gnomeExtensions.kimpanel
|
||||
gnomeExtensions.vitals
|
||||
gnomeExtensions.tray-icons-reloaded
|
||||
];
|
||||
gnome.excludePackages = with pkgs; [
|
||||
gnome-tour
|
||||
gedit
|
||||
atomix
|
||||
epiphany
|
||||
geary
|
||||
gnome-characters
|
||||
gnome-contacts
|
||||
gnome-initial-setup
|
||||
hitori
|
||||
iagno
|
||||
tali
|
||||
];
|
||||
};
|
||||
}
|
16
hosts/common/optional/desktop/hyprland.nix
Normal file
16
hosts/common/optional/desktop/hyprland.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, ... }: {
|
||||
imports = [ ./global.nix ./x11.nix ./wayland.nix ];
|
||||
|
||||
programs.hyprland.enable = true;
|
||||
security.pam.services.hyprlock = { }; # Enable Hyprlock PAM support
|
||||
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
wlr.enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
extraPortals = [
|
||||
pkgs.xdg-desktop-portal-hyprland
|
||||
pkgs.xdg-desktop-portal-gtk
|
||||
];
|
||||
};
|
||||
}
|
14
hosts/common/optional/desktop/japanese.nix
Normal file
14
hosts/common/optional/desktop/japanese.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{pkgs, ...}: {
|
||||
i18n.inputMethod = {
|
||||
enable = true;
|
||||
type = "fcitx5";
|
||||
fcitx5.addons = with pkgs; [
|
||||
fcitx5-mozc
|
||||
fcitx5-gtk
|
||||
];
|
||||
fcitx5.waylandFrontend = true;
|
||||
};
|
||||
fonts.packages = with pkgs; [
|
||||
noto-fonts-cjk-sans
|
||||
];
|
||||
}
|
13
hosts/common/optional/desktop/pipewire.nix
Normal file
13
hosts/common/optional/desktop/pipewire.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{pkgs, ...}: {
|
||||
security.rtkit.enable = true;
|
||||
hardware.pulseaudio.enable = false;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
alsa.support32Bit = true;
|
||||
pulse.enable = true;
|
||||
jack.enable = true;
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [pavucontrol pulseaudio qpwgraph];
|
||||
}
|
15
hosts/common/optional/desktop/plasma.nix
Normal file
15
hosts/common/optional/desktop/plasma.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{pkgs, ...}: {
|
||||
imports = [./global.nix ./x11.nix];
|
||||
|
||||
services.xserver.desktopManager.plasma5.enable = true;
|
||||
environment.plasma5.excludePackages = with pkgs.libsForQt5; [
|
||||
elisa
|
||||
gwenview
|
||||
okular
|
||||
oxygen
|
||||
khelpcenter
|
||||
konsole
|
||||
plasma-browser-integration
|
||||
print-manager
|
||||
];
|
||||
}
|
15
hosts/common/optional/desktop/wayland.nix
Normal file
15
hosts/common/optional/desktop/wayland.nix
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
# Hint electron apps to use wayland
|
||||
environment.sessionVariables.NIXOS_OZONE_WL = "1";
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
xwaylandvideobridge
|
||||
libsForQt5.qt5.qtwayland
|
||||
qt6.qtwayland
|
||||
];
|
||||
}
|
29
hosts/common/optional/desktop/x11.nix
Normal file
29
hosts/common/optional/desktop/x11.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
services = {
|
||||
libinput.enable = true; # Enable touchpad support
|
||||
libinput.touchpad.naturalScrolling = true;
|
||||
|
||||
# Enable the X11 windowing system.
|
||||
xserver = {
|
||||
enable = true;
|
||||
# Remove xterm terminal
|
||||
excludePackages = with pkgs; [xterm];
|
||||
modules = [pkgs.xf86_input_wacom];
|
||||
wacom.enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
# Install installation
|
||||
environment = {
|
||||
systemPackages = with pkgs; [
|
||||
# X11
|
||||
xorg.xkbutils
|
||||
xorg.xkill
|
||||
];
|
||||
};
|
||||
}
|
14
hosts/common/optional/desktop/xdg.nix
Normal file
14
hosts/common/optional/desktop/xdg.nix
Normal file
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
xdg.portal = {
|
||||
enable = true;
|
||||
xdgOpenUsePortal = true;
|
||||
wlr.enable = true;
|
||||
extraPortals = with pkgs; [xdg-desktop-portal-gtk];
|
||||
configPackages = with pkgs; [gnome.gnome-session];
|
||||
};
|
||||
}
|
67
hosts/common/optional/desktop/xremap.nix
Normal file
67
hosts/common/optional/desktop/xremap.nix
Normal file
|
@ -0,0 +1,67 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
inputs.xremap.nixosModules.default
|
||||
];
|
||||
|
||||
hardware.uinput.enable = true;
|
||||
users.groups.uinput.members = ["ghoscht"];
|
||||
users.groups.input.members = ["ghoscht"];
|
||||
|
||||
systemd.user.services.set-xhost = {
|
||||
description = "Run a one-shot command upon user login";
|
||||
path = [pkgs.xorg.xhost];
|
||||
wantedBy = ["default.target"];
|
||||
script = "xhost +SI:localuser:root";
|
||||
environment.DISPLAY = ":0"; # NOTE: This is hardcoded for this flake
|
||||
};
|
||||
|
||||
services.xremap = {
|
||||
withX11 = true;
|
||||
watch = true;
|
||||
debug = false;
|
||||
userName = "ghoscht";
|
||||
serviceMode = "user";
|
||||
config = {
|
||||
keymap = [
|
||||
{
|
||||
name = "Global";
|
||||
remap = {
|
||||
"CapsLock" = "Esc";
|
||||
"Esc" = "CapsLock";
|
||||
super-x = {
|
||||
launch = ["${lib.getExe pkgs.wezterm}"];
|
||||
};
|
||||
# super-space = {
|
||||
# launch = ["${lib.getExe pkgs.rofi}" "-i" "-show" "drun" "-show-icons"];
|
||||
# };
|
||||
# super-control-l = {
|
||||
# launch = ["${lib.getExe pkgs.firefox}"];
|
||||
# };
|
||||
# super-control-shift-l = {
|
||||
# launch = ["${lib.getExe pkgs.firefox}" "--private-window"];
|
||||
# };
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "Music";
|
||||
remap = {
|
||||
"KEY_PLAYPAUSE" = {
|
||||
launch = ["${lib.getExe pkgs.playerctl}" "play-pause"];
|
||||
};
|
||||
"KEY_NEXTSONG" = {
|
||||
launch = ["${lib.getExe pkgs.playerctl}" "next"];
|
||||
};
|
||||
"KEY_PREVIOUSSONG" = {
|
||||
launch = ["${lib.getExe pkgs.playerctl}" "previous"];
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
13
hosts/common/optional/docker.nix
Normal file
13
hosts/common/optional/docker.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
daemon.settings = {
|
||||
"default-address-pools" = [
|
||||
{
|
||||
"base" = "172.29.0.0/16";
|
||||
"size" = 24;
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
7
hosts/common/optional/encrypted-root.nix
Normal file
7
hosts/common/optional/encrypted-root.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{config, ...}: let
|
||||
hostname = config.networking.hostName;
|
||||
in {
|
||||
boot.initrd = {
|
||||
luks.devices."${hostname}".device = "/dev/disk/by-label/${hostname}_crypt";
|
||||
};
|
||||
}
|
69
hosts/common/optional/fhs-compat.nix
Normal file
69
hosts/common/optional/fhs-compat.nix
Normal file
|
@ -0,0 +1,69 @@
|
|||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
services.envfs.enable = lib.mkDefault true;
|
||||
|
||||
programs.nix-ld.enable = lib.mkDefault true;
|
||||
programs.nix-ld.libraries = with pkgs;
|
||||
[
|
||||
acl
|
||||
attr
|
||||
bzip2
|
||||
dbus
|
||||
expat
|
||||
fontconfig
|
||||
freetype
|
||||
fuse3
|
||||
icu
|
||||
libnotify
|
||||
libsodium
|
||||
libssh
|
||||
libunwind
|
||||
libusb1
|
||||
libuuid
|
||||
nspr
|
||||
nss
|
||||
stdenv.cc.cc
|
||||
util-linux
|
||||
zlib
|
||||
zstd
|
||||
]
|
||||
++ lib.optionals (config.hardware.graphics.enable) [
|
||||
pipewire
|
||||
cups
|
||||
libxkbcommon
|
||||
pango
|
||||
mesa
|
||||
libdrm
|
||||
libglvnd
|
||||
libpulseaudio
|
||||
atk
|
||||
cairo
|
||||
alsa-lib
|
||||
at-spi2-atk
|
||||
at-spi2-core
|
||||
gdk-pixbuf
|
||||
glib
|
||||
gtk3
|
||||
libGL
|
||||
libappindicator-gtk3
|
||||
vulkan-loader
|
||||
xorg.libX11
|
||||
xorg.libXScrnSaver
|
||||
xorg.libXcomposite
|
||||
xorg.libXcursor
|
||||
xorg.libXdamage
|
||||
xorg.libXext
|
||||
xorg.libXfixes
|
||||
xorg.libXi
|
||||
xorg.libXrandr
|
||||
xorg.libXrender
|
||||
xorg.libXtst
|
||||
xorg.libxcb
|
||||
xorg.libxkbfile
|
||||
xorg.libxshmfence
|
||||
];
|
||||
}
|
3
hosts/common/optional/gaming/gamemode.nix
Normal file
3
hosts/common/optional/gaming/gamemode.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
programs.gamemode.enable = true;
|
||||
}
|
17
hosts/common/optional/gaming/steam.nix
Normal file
17
hosts/common/optional/gaming/steam.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
programs = {
|
||||
steam = {
|
||||
enable = true;
|
||||
};
|
||||
};
|
||||
|
||||
xdg.mime = {
|
||||
defaultApplications."x-scheme-handler/steam" = "steam.desktop";
|
||||
addedAssociations."x-scheme-handler/steam" = "steam.desktop";
|
||||
};
|
||||
}
|
|
@ -2,10 +2,10 @@
|
|||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
vars,
|
||||
...
|
||||
}: {
|
||||
security.pam.services.${vars.user}.enableGnomeKeyring = true;
|
||||
}: let
|
||||
in {
|
||||
security.pam.services.sddm.enableGnomeKeyring = true;
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
programs.seahorse.enable = true;
|
||||
}
|
16
hosts/common/optional/kde-connect.nix
Normal file
16
hosts/common/optional/kde-connect.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ pkgs, ... }: {
|
||||
programs.kdeconnect.enable = true;
|
||||
|
||||
# Create system services for KDE connect
|
||||
systemd.user.services.kdeconnect = {
|
||||
description = "Adds communication between your desktop and your smartphone";
|
||||
after = [ "graphical-session-pre.target" ];
|
||||
partOf = [ "graphical-session.target" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.plasma5Packages.kdeconnect-kde}/libexec/kdeconnectd";
|
||||
Restart = "on-abort";
|
||||
};
|
||||
};
|
||||
}
|
25
hosts/common/optional/printing.nix
Normal file
25
hosts/common/optional/printing.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
services = {
|
||||
# Printer Setup
|
||||
printing.enable = true;
|
||||
avahi = {
|
||||
enable = true;
|
||||
nssmdns4 = true;
|
||||
nssmdns6 = true;
|
||||
# for a WiFi printer
|
||||
openFirewall = true;
|
||||
};
|
||||
udev.packages = [pkgs.utsushi];
|
||||
};
|
||||
|
||||
# Scanner Setup
|
||||
hardware.sane = {
|
||||
enable = true;
|
||||
extraBackends = [pkgs.utsushi];
|
||||
};
|
||||
}
|
12
hosts/common/optional/rgb.nix
Normal file
12
hosts/common/optional/rgb.nix
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
services.hardware.openrgb = {
|
||||
enable = true;
|
||||
package = pkgs.openrgb-with-all-plugins;
|
||||
motherboard = lib.mkDefault config.variables.machine.motherboard;
|
||||
};
|
||||
}
|
36
hosts/common/optional/stylix.nix
Normal file
36
hosts/common/optional/stylix.nix
Normal file
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
inputs,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
imports = [inputs.stylix.nixosModules.stylix];
|
||||
|
||||
stylix = {
|
||||
enable = true;
|
||||
polarity = "dark";
|
||||
image = ../../../rsc/wallpaper/rolltreppe-gluehwein.jpg;
|
||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-mocha.yaml";
|
||||
opacity.terminal = 0.83;
|
||||
|
||||
cursor = {
|
||||
package = pkgs.bibata-cursors;
|
||||
name = "Bibata-Modern-Ice";
|
||||
size = 25;
|
||||
};
|
||||
|
||||
fonts = {
|
||||
monospace = {
|
||||
package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];};
|
||||
name = "JetBrainsMono Nerd Font Mono";
|
||||
};
|
||||
sansSerif = {
|
||||
package = pkgs.dejavu_fonts;
|
||||
name = "DejaVu Sans";
|
||||
};
|
||||
serif = {
|
||||
package = pkgs.dejavu_fonts;
|
||||
name = "DejaVu Serif";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
10
hosts/common/optional/systemd-boot.nix
Normal file
10
hosts/common/optional/systemd-boot.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
boot.loader = {
|
||||
systemd-boot = {
|
||||
enable = true;
|
||||
consoleMode = "max";
|
||||
configurationLimit = 42;
|
||||
};
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
}
|
6
hosts/common/optional/systemd-exit-node.nix
Normal file
6
hosts/common/optional/systemd-exit-node.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
imports = [../global/tailscale.nix];
|
||||
services.tailscale = {
|
||||
useRoutingFeatures = "both";
|
||||
};
|
||||
}
|
10
hosts/common/optional/tailscale.nix
Normal file
10
hosts/common/optional/tailscale.nix
Normal file
|
@ -0,0 +1,10 @@
|
|||
{lib, ...}: {
|
||||
services.tailscale = {
|
||||
enable = true;
|
||||
useRoutingFeatures = lib.mkDefault "client";
|
||||
};
|
||||
networking.firewall = {
|
||||
checkReversePath = "loose";
|
||||
allowedUDPPorts = [41641]; # Facilitate firewall punching
|
||||
};
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue