Compare commits
203 Commits
guard-nvim
...
nixos
Author | SHA1 | Date |
---|---|---|
Moritz Böhme | 101ab079ac | |
Moritz Böhme | 6dde791fb7 | |
Moritz Böhme | 6487394f14 | |
Moritz Böhme | f72096b717 | |
Moritz Böhme | ea07a73d07 | |
Moritz Böhme | 6cbe647af7 | |
Moritz Böhme | 781d06f3de | |
Moritz Böhme | c249fab5cb | |
Moritz Böhme | 02473b02f3 | |
Moritz Böhme | 7fb108df31 | |
Moritz Böhme | 56505a065f | |
Moritz Böhme | a4cb8f2dfd | |
Moritz Böhme | f08c343ddf | |
Moritz Böhme | fc4dcbeeec | |
Moritz Böhme | f19d50407e | |
Moritz Böhme | 5c666feefb | |
Moritz Böhme | 82e64e198f | |
Moritz Böhme | 928f8b77fa | |
Moritz Böhme | 6bcccc1ff9 | |
Moritz Böhme | 9e2c4205d9 | |
Moritz Böhme | 667b7a9db3 | |
Moritz Böhme | cb8597a97a | |
Moritz Böhme | 1cae5d144a | |
Moritz Böhme | 7472b94108 | |
Moritz Böhme | e94c6ea4d7 | |
Moritz Böhme | b8ec445560 | |
Moritz Böhme | 9f931b563f | |
Moritz Böhme | a11717c8ce | |
Moritz Böhme | 55325053ec | |
Moritz Böhme | 9bd0870f1d | |
Moritz Böhme | 189036f2c8 | |
Moritz Böhme | 72def5c785 | |
Moritz Böhme | 891283aa43 | |
Moritz Böhme | 17ab5faf24 | |
Moritz Böhme | 2e38c56c93 | |
Moritz Böhme | fe78e6c206 | |
Moritz Böhme | 331c34b147 | |
Moritz Böhme | 9bbe4516f4 | |
Moritz Böhme | 1dee671b98 | |
Moritz Böhme | 4328c77625 | |
Moritz Böhme | 2381db697d | |
Moritz Böhme | 4762f6f196 | |
Moritz Böhme | b03934b4a3 | |
Moritz Böhme | 1a2369c8db | |
Moritz Böhme | d4db0cec27 | |
Moritz Böhme | b5b54eb0e7 | |
Moritz Böhme | 053f516175 | |
Moritz Böhme | 5c73524196 | |
Moritz Böhme | f837b84892 | |
Moritz Böhme | c3bec6a16d | |
Moritz Böhme | 4dd2b63b9a | |
Moritz Böhme | 57d91555a0 | |
Moritz Böhme | 3b4b7b6657 | |
Moritz Böhme | 73689d50bf | |
Moritz Böhme | ca9f07d950 | |
Moritz Böhme | fad19c6a58 | |
Moritz Böhme | ed9c5111e4 | |
Moritz Böhme | 8ce8af36de | |
Moritz Böhme | fcfc548717 | |
Moritz Böhme | c11a2c5596 | |
Moritz Böhme | e45b2241fa | |
Moritz Böhme | a5a784b2d5 | |
Moritz Böhme | 11d13544c1 | |
Moritz Böhme | e83ce10ad7 | |
Moritz Böhme | bdc849205e | |
Moritz Böhme | bee307ae9c | |
Moritz Böhme | f6174bc0ba | |
Moritz Böhme | b526cfc6f8 | |
Moritz Böhme | f851cd63f6 | |
Moritz Böhme | f417d8b819 | |
Moritz Böhme | 946cb89900 | |
Moritz Böhme | 462cb1d851 | |
Moritz Böhme | f1b86275da | |
Moritz Böhme | 5aba3a032c | |
Moritz Böhme | 31cd3f9957 | |
Moritz Böhme | 05e7391cb4 | |
Moritz Böhme | 7ddd60e36c | |
Moritz Böhme | 1b5659ac6c | |
Moritz Böhme | 42edc5bd2f | |
Moritz Böhme | b1ecc723cc | |
Moritz Böhme | 2f4f58a68c | |
Moritz Böhme | 54e55f4b6d | |
Moritz Böhme | b09d30959b | |
Moritz Böhme | 6a1b81565a | |
Moritz Böhme | a2a624d534 | |
Moritz Böhme | 9acdfd5e4b | |
Moritz Böhme | e1a1c5060f | |
Moritz Böhme | 67a019f76b | |
Moritz Böhme | c02b5c01e5 | |
Moritz Böhme | 006c4394f3 | |
Moritz Böhme | ac9b136e6c | |
Moritz Böhme | 4ff3bfbf50 | |
Moritz Böhme | 10f9389319 | |
Moritz Böhme | e714349fe1 | |
Moritz Böhme | 09caae2e4e | |
Moritz Böhme | ad8ff7d016 | |
Moritz Böhme | e07c55d902 | |
Moritz Böhme | 8dab093deb | |
Moritz Böhme | 43d2bd3645 | |
Moritz Böhme | 71fe796589 | |
Moritz Böhme | 66cbbaa4ba | |
Moritz Böhme | d098a8f907 | |
Moritz Böhme | 591f981e71 | |
Moritz Böhme | 8a9d67a3d5 | |
Moritz Böhme | 5559e9291e | |
Moritz Böhme | 73f597b1c0 | |
Moritz Böhme | 298aa410eb | |
Moritz Böhme | 33df89b381 | |
Moritz Böhme | 2b8335ffb0 | |
Moritz Böhme | 386da4ccb9 | |
Moritz Böhme | 1166a87fcb | |
Moritz Böhme | 4cf72f2a09 | |
Moritz Böhme | 2be2adcaab | |
Moritz Böhme | 9e4fdb00e3 | |
Moritz Böhme | a14f999ab9 | |
Moritz Böhme | 96697c684c | |
Moritz Böhme | e87d0c7ec3 | |
Moritz Böhme | 59c843d452 | |
Moritz Böhme | 659e719c47 | |
Moritz Böhme | ae44ce2133 | |
Moritz Böhme | 8003f15242 | |
Moritz Böhme | cf47ac19a8 | |
Moritz Böhme | e5a9677140 | |
Moritz Böhme | 89104209e8 | |
Moritz Böhme | 2c038e43c1 | |
Moritz Böhme | a9e0b92d81 | |
Moritz Böhme | 0a0c675552 | |
Moritz Böhme | 45a1190af7 | |
Moritz Böhme | b0951b6805 | |
Moritz Böhme | c37a55d570 | |
Moritz Böhme | 8d5300682c | |
Moritz Böhme | d50a58463f | |
Moritz Böhme | cb881fbbc8 | |
Moritz Böhme | f79dec2ebf | |
Moritz Böhme | c17fe56071 | |
Moritz Böhme | a3289ee611 | |
Moritz Böhme | 6ceddb1f94 | |
Moritz Böhme | e468d26c51 | |
Moritz Böhme | 8364d22f92 | |
Moritz Böhme | 7baa2db2b6 | |
Moritz Böhme | ed1c1a6f69 | |
Moritz Böhme | 07dfe50be0 | |
Moritz Böhme | d6c97b11c5 | |
Moritz Böhme | 09b7d43847 | |
Moritz Böhme | d23863f934 | |
Moritz Böhme | e7fd307bfb | |
Moritz Böhme | 82ffbcbde4 | |
Moritz Böhme | ddc2989620 | |
Moritz Böhme | 80443f80ca | |
Moritz Böhme | 072d016f46 | |
Moritz Böhme | 1b22c1345f | |
Moritz Böhme | 4f9b3b082a | |
Moritz Böhme | 6847ada8ae | |
Moritz Böhme | 05927d1ae6 | |
Moritz Böhme | 4848428c30 | |
Moritz Böhme | b880e27deb | |
Moritz Böhme | a02aeede10 | |
Moritz Böhme | da6601884d | |
Moritz Böhme | 360c8b155e | |
Moritz Böhme | 118fe7ba67 | |
Moritz Böhme | 70e95a1ea4 | |
Moritz Böhme | e10bfd9390 | |
Moritz Böhme | fd159af54c | |
Moritz Böhme | c17d3f21d7 | |
Moritz Böhme | 1735fb38da | |
Moritz Böhme | cf425d4db9 | |
Moritz Böhme | 9c70942dfb | |
Moritz Böhme | 4cb8457075 | |
Moritz Böhme | 528098839d | |
Moritz Böhme | 8bc546daf0 | |
Moritz Böhme | c7e7b39d83 | |
Moritz Böhme | 19da904219 | |
Moritz Böhme | 844c7a9876 | |
Moritz Böhme | 37ad1080e7 | |
Moritz Böhme | e715dff0a4 | |
Moritz Böhme | 54c907ff3b | |
Moritz Böhme | 92f3484bd0 | |
Moritz Böhme | 70a01fd0a4 | |
Moritz Böhme | 02d9e30ce7 | |
Moritz Böhme | 2c2824a395 | |
Moritz Böhme | 58c8efa332 | |
Moritz Böhme | 6707e03547 | |
Moritz Böhme | 387477a746 | |
Moritz Böhme | af0c89d576 | |
Moritz Böhme | b1b17737d0 | |
Moritz Böhme | 0618e8c6da | |
Moritz Böhme | 12a28e1f84 | |
Moritz Böhme | 300d5058c5 | |
Moritz Böhme | 41369784d2 | |
Moritz Böhme | da18eac2da | |
Moritz Böhme | 9ab5495843 | |
Moritz Böhme | f051785545 | |
Moritz Böhme | ea13f39c9f | |
Moritz Böhme | 9f9badff24 | |
Moritz Böhme | 5a1853ea22 | |
Moritz Böhme | 1e335c8195 | |
Moritz Böhme | 7d54b6d42b | |
Moritz Böhme | cb262d4cf5 | |
Moritz Böhme | 1eb008e41e | |
Moritz Böhme | 28961fe114 | |
Moritz Böhme | 0c04788cd4 | |
Moritz Böhme | c13e68d881 | |
Moritz Böhme | 35c349f370 |
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
"options": {
|
|
||||||
"enable": true,
|
|
||||||
"target": {
|
|
||||||
"args": [],
|
|
||||||
"installable": ".#nixosConfigurations.nixos-desktop.options"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
1159
flake.lock
113
flake.nix
|
@ -15,46 +15,50 @@
|
||||||
master.url = "github:nixos/nixpkgs";
|
master.url = "github:nixos/nixpkgs";
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
|
||||||
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
|
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
|
||||||
stable.url = "github:nixos/nixpkgs/nixos-23.05";
|
stable.url = "github:nixos/nixpkgs/nixos-24.05";
|
||||||
|
nur.url = "github:nix-community/NUR";
|
||||||
|
nix-index-database.url = "github:Mic92/nix-index-database";
|
||||||
|
nix-index-database.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
||||||
# Programs
|
# Programs
|
||||||
nix-super.inputs.nixpkgs.follows = "stable";
|
|
||||||
nix-super.url = "github:privatevoid-net/nix-super";
|
nix-super.url = "github:privatevoid-net/nix-super";
|
||||||
rofi-wayland.flake = false;
|
nix-monitored.url = "github:ners/nix-monitored";
|
||||||
rofi-wayland.url = "github:lbonn/rofi/wayland";
|
nix-monitored.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git";
|
timers.url = "git+https://gitea.moritzboeh.me/moritz/timers.git";
|
||||||
|
|
||||||
# Neovim
|
# Neovim
|
||||||
actions-preview-nvim.flake = false;
|
actions-preview-nvim.flake = false;
|
||||||
actions-preview-nvim.url = "github:aznhe21/actions-preview.nvim";
|
actions-preview-nvim.url = "github:aznhe21/actions-preview.nvim";
|
||||||
codeium-nvim = {
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
inputs.flake-utils.follows = "flake-utils";
|
|
||||||
url = "github:jcdickinson/codeium.nvim";
|
|
||||||
};
|
|
||||||
hmts-nvim.flake = false;
|
|
||||||
hmts-nvim.url = "github:calops/hmts.nvim";
|
|
||||||
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
neovim-nightly-overlay.url = "github:nix-community/neovim-nightly-overlay";
|
||||||
nix-lazy-nvim.url = "git+https://git.moritzboeh.me/moritz/NixLazy.nvim";
|
nix-lazy-nvim.url = "git+https://git.moritzboeh.me/moritz/NixLazy.nvim";
|
||||||
nvim-lspconfig.flake = false;
|
nvim-lspconfig.flake = false;
|
||||||
nvim-lspconfig.url = "github:neovim/nvim-lspconfig";
|
nvim-lspconfig.url = "github:neovim/nvim-lspconfig";
|
||||||
nvim-puppeteer.flake = false;
|
|
||||||
nvim-puppeteer.url = "github:chrisgrieser/nvim-puppeteer";
|
|
||||||
nvim-treesitter.flake = false;
|
|
||||||
nvim-treesitter.url = "github:nvim-treesitter/nvim-treesitter/v0.9.1"; # NOTE: to fix weird latest issues
|
|
||||||
smartcolumn-nvim.flake = false;
|
smartcolumn-nvim.flake = false;
|
||||||
smartcolumn-nvim.url = "github:m4xshen/smartcolumn.nvim";
|
smartcolumn-nvim.url = "github:m4xshen/smartcolumn.nvim";
|
||||||
telekasten-nvim.flake = false;
|
telekasten-nvim.flake = false;
|
||||||
telekasten-nvim.url = "github:renerocksai/telekasten.nvim";
|
telekasten-nvim.url = "github:renerocksai/telekasten.nvim";
|
||||||
telescope-nvim.flake = false;
|
neotest-python.flake = false;
|
||||||
telescope-nvim.url = "github:nvim-telescope/telescope.nvim";
|
neotest-python.url = "github:MoritzBoehme/neotest-python/fix-runtimepath-search";
|
||||||
guard-nvim.flake = false;
|
gen-nvim.flake = false;
|
||||||
guard-nvim.url = "/home/moritz/Devel/Lua/guard.nvim";
|
gen-nvim.url = "github:David-Kunz/gen.nvim";
|
||||||
|
hawtkeys-nvim.flake = false;
|
||||||
|
hawtkeys-nvim.url = "github:tris203/hawtkeys.nvim";
|
||||||
|
none-ls-shellcheck-nvim.flake = false;
|
||||||
|
none-ls-shellcheck-nvim.url = "github:gbprod/none-ls-shellcheck.nvim";
|
||||||
|
cmp-vimtex.flake = false;
|
||||||
|
cmp-vimtex.url = "github:micangl/cmp-vimtex";
|
||||||
|
|
||||||
|
# river
|
||||||
|
river.url = "git+https://github.com/riverwm/river?submodules=1";
|
||||||
|
river.flake = false;
|
||||||
|
|
||||||
# Hyprland
|
# Hyprland
|
||||||
hypr-contrib.url = "github:hyprwm/contrib";
|
hypr-contrib.url = "github:hyprwm/contrib";
|
||||||
hyprland.url = "github:hyprwm/Hyprland";
|
hyprland = {
|
||||||
hyprpaper.url = "github:hyprwm/hyprpaper";
|
type = "git";
|
||||||
|
url = "https://github.com/hyprwm/Hyprland";
|
||||||
|
submodules = true;
|
||||||
|
};
|
||||||
|
|
||||||
# Laptop
|
# Laptop
|
||||||
asus-touchpad-numpad-driver.url = "github:MoritzBoehme/asus-touchpad-numpad-driver/german-layout";
|
asus-touchpad-numpad-driver.url = "github:MoritzBoehme/asus-touchpad-numpad-driver/german-layout";
|
||||||
|
@ -66,29 +70,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ self, flake-parts, ... }:
|
outputs = inputs@{ self, flake-parts, ... }:
|
||||||
let
|
|
||||||
defaultOverlays = [
|
|
||||||
inputs.hypr-contrib.overlays.default
|
|
||||||
inputs.neovim-nightly-overlay.overlay
|
|
||||||
self.overlays.default
|
|
||||||
];
|
|
||||||
|
|
||||||
finalOverlays = defaultOverlays ++ [
|
|
||||||
(
|
|
||||||
_: prev: {
|
|
||||||
master = import inputs.master {
|
|
||||||
inherit (prev) system;
|
|
||||||
overlays = defaultOverlays;
|
|
||||||
};
|
|
||||||
stable = import inputs.stable {
|
|
||||||
inherit (prev) system;
|
|
||||||
overlays = defaultOverlays;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
in
|
|
||||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
|
debug = true; # NOTE: for nixd
|
||||||
imports = [
|
imports = [
|
||||||
inputs.pre-commit-hooks.flakeModule
|
inputs.pre-commit-hooks.flakeModule
|
||||||
inputs.devshell.flakeModule
|
inputs.devshell.flakeModule
|
||||||
|
@ -96,12 +79,6 @@
|
||||||
|
|
||||||
systems = [ "x86_64-linux" ];
|
systems = [ "x86_64-linux" ];
|
||||||
perSystem = { config, self', inputs', pkgs, system, ... }: {
|
perSystem = { config, self', inputs', pkgs, system, ... }: {
|
||||||
_module.args.pkgs =
|
|
||||||
import inputs.nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
overlays = finalOverlays;
|
|
||||||
};
|
|
||||||
|
|
||||||
devshells.default = {
|
devshells.default = {
|
||||||
devshell.startup.pre-commit-hook.text = config.pre-commit.installationScript;
|
devshell.startup.pre-commit-hook.text = config.pre-commit.installationScript;
|
||||||
commands = [
|
commands = [
|
||||||
|
@ -113,7 +90,7 @@
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "nixos-build";
|
name = "build";
|
||||||
help = "use nom to build system";
|
help = "use nom to build system";
|
||||||
command =
|
command =
|
||||||
''
|
''
|
||||||
|
@ -121,21 +98,25 @@
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "nixos-switch";
|
name = "apply";
|
||||||
help = "wrapper for nixos-rebuild switch";
|
help = "wrapper for nixos-rebuild switch";
|
||||||
command = "sudo nixos-rebuild switch --flake . $@";
|
command = "sudo nixos-rebuild switch --flake . $@";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "nixos-test";
|
name = "test";
|
||||||
help = "wrapper for nixos-rebuild switch";
|
help = "wrapper for nixos-rebuild switch";
|
||||||
command = "sudo nixos-rebuild test --flake . $@";
|
command = "sudo nixos-rebuild test --flake . $@";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "nixos-boot";
|
name = "boot";
|
||||||
help = "wrapper for nixos-rebuild switch";
|
help = "wrapper for nixos-rebuild switch";
|
||||||
command = "sudo nixos-rebuild boot --flake . $@";
|
command = "sudo nixos-rebuild boot --flake . $@";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
packages = with pkgs; [
|
||||||
|
stylua
|
||||||
|
sumneko-lua-language-server
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
pre-commit = {
|
pre-commit = {
|
||||||
|
@ -152,20 +133,12 @@
|
||||||
|
|
||||||
legacyPackages = pkgs;
|
legacyPackages = pkgs;
|
||||||
|
|
||||||
packages =
|
|
||||||
self.lib.filterAttrs (_: self.lib.isDerivation)
|
|
||||||
(self.overlays.default pkgs pkgs);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
flake = {
|
flake = {
|
||||||
lib = inputs.nixpkgs.lib.extend
|
lib = inputs.nixpkgs.lib.extend
|
||||||
(self: _: { my = import ./lib { lib = self; }; });
|
(self: _: { my = import ./lib { lib = self; }; });
|
||||||
|
|
||||||
overlays.default = import ./overlays {
|
|
||||||
inherit inputs;
|
|
||||||
inherit (self) lib;
|
|
||||||
};
|
|
||||||
|
|
||||||
nixosConfigurations = self.lib.my.mapModules
|
nixosConfigurations = self.lib.my.mapModules
|
||||||
(path: self.lib.nixosSystem {
|
(path: self.lib.nixosSystem {
|
||||||
inherit (self) lib;
|
inherit (self) lib;
|
||||||
|
@ -175,12 +148,6 @@
|
||||||
modules =
|
modules =
|
||||||
[
|
[
|
||||||
./modules
|
./modules
|
||||||
{
|
|
||||||
nixpkgs = {
|
|
||||||
overlays = finalOverlays;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
{
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
|
@ -193,10 +160,22 @@
|
||||||
inputs.disko.nixosModules.default
|
inputs.disko.nixosModules.default
|
||||||
inputs.home-manager.nixosModule
|
inputs.home-manager.nixosModule
|
||||||
inputs.impermanence.nixosModules.impermanence
|
inputs.impermanence.nixosModules.impermanence
|
||||||
|
inputs.nix-index-database.nixosModules.nix-index
|
||||||
path
|
path
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
./hosts;
|
./hosts;
|
||||||
|
|
||||||
|
templates = {
|
||||||
|
python = {
|
||||||
|
description = "Simple poetry shell.nix";
|
||||||
|
path = ./templates/python;
|
||||||
|
};
|
||||||
|
rust = {
|
||||||
|
description = "Crane + Fenix flake with mold for faster local builds.";
|
||||||
|
path = ./templates/rust;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# your system. Help is available in the configuration.nix(5) man page
|
# your system. Help is available in the configuration.nix(5) man page
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
{ pkgs
|
{ pkgs
|
||||||
|
, config
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -9,6 +10,7 @@
|
||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
|
./disko.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
my = {
|
my = {
|
||||||
|
@ -16,53 +18,47 @@
|
||||||
desktop.enable = true;
|
desktop.enable = true;
|
||||||
gaming.enable = true;
|
gaming.enable = true;
|
||||||
personal.enable = true;
|
personal.enable = true;
|
||||||
|
impermanence.enable = true;
|
||||||
|
webis.enable = true;
|
||||||
};
|
};
|
||||||
programs.hyprland = {
|
programs.hyprland.enable = true;
|
||||||
nvidiaSupport = true;
|
programs.hyprland.nvidiaSupport = true;
|
||||||
monitors = [ "HDMI-A-1,3840x2160,auto,1.2" ",preferred,auto,1" ];
|
programs.hyprland.keyboardLayouts = [ "us" "de" ];
|
||||||
extraConfig = "exec=hyprctl keyword monitor HDMI-A-1,3840x2160@120,auto,1.2";
|
programs.hyprland.monitors."HDMI-A-2" = { scale = 1.2; };
|
||||||
keyboardLayouts = [ "us" "de" ];
|
programs.exercism.enable = true;
|
||||||
};
|
|
||||||
services.mullvad.enable = true;
|
|
||||||
services.wallpaper.enable = true;
|
services.wallpaper.enable = true;
|
||||||
programs.ledger.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtualisation.containers.cdi.dynamic.nvidia.enable = true;
|
||||||
|
|
||||||
home-manager.users.moritz.home.packages = with pkgs; [
|
home-manager.users.moritz.home.packages = with pkgs; [
|
||||||
jetbrains.idea-community
|
anki
|
||||||
|
stable.calibre # NOTE: breaks often in unstable
|
||||||
];
|
];
|
||||||
|
|
||||||
hardware = {
|
hardware = {
|
||||||
keyboard.qmk.enable = true;
|
keyboard.qmk.enable = true;
|
||||||
nvidia.modesetting.enable = true;
|
nvidia.modesetting.enable = true;
|
||||||
opengl = {
|
opengl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
driSupport32Bit = true;
|
driSupport32Bit = true;
|
||||||
driSupport = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# sensors
|
# sensors
|
||||||
enableAllFirmware = true;
|
enableAllFirmware = true;
|
||||||
|
|
||||||
bluetooth.enable = true;
|
bluetooth.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
boot = {
|
boot = {
|
||||||
# KERNEL
|
# KERNEL
|
||||||
kernelPackages = pkgs.linuxPackages_latest;
|
kernelPackages = config.boot.zfs.package.latestCompatibleLinuxPackages; # NOTE: use latest zfs compatible kernel
|
||||||
|
|
||||||
# BOOT
|
# BOOT
|
||||||
|
supportedFilesystems = [ "zfs" "btrfs" "ntfs" ];
|
||||||
supportedFilesystems = [ "btrfs" "ntfs" ];
|
|
||||||
loader = {
|
loader = {
|
||||||
grub = {
|
systemd-boot.enable = true;
|
||||||
enable = true;
|
|
||||||
device = "nodev";
|
|
||||||
efiSupport = true;
|
|
||||||
useOSProber = true;
|
|
||||||
};
|
|
||||||
efi.canTouchEfiVariables = true;
|
efi.canTouchEfiVariables = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
kernelModules = [ "lm92" "drivetemp" ];
|
kernelModules = [ "lm92" "drivetemp" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -72,7 +68,7 @@
|
||||||
defaultGateway = "192.168.0.1";
|
defaultGateway = "192.168.0.1";
|
||||||
nameservers = [ "192.168.0.4" ];
|
nameservers = [ "192.168.0.4" ];
|
||||||
useDHCP = false;
|
useDHCP = false;
|
||||||
interfaces.enp42s0 = {
|
interfaces.enp6s0 = {
|
||||||
ipv4.addresses = [
|
ipv4.addresses = [
|
||||||
{
|
{
|
||||||
address = "192.168.0.14";
|
address = "192.168.0.14";
|
||||||
|
|
|
@ -0,0 +1,102 @@
|
||||||
|
{ lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# needed for zfs pool
|
||||||
|
networking.hostId = "1f8b8073";
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
main = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/disk/by-id/ata-Samsung_SSD_850_EVO_500GB_S2RBNX0J351943M";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
ESP = {
|
||||||
|
size = "512M";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
encryptedSwap = {
|
||||||
|
size = "8G";
|
||||||
|
content = {
|
||||||
|
type = "swap";
|
||||||
|
randomEncryption = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zfs = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "zfs";
|
||||||
|
pool = "zroot";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
zpool = {
|
||||||
|
zroot = {
|
||||||
|
type = "zpool";
|
||||||
|
rootFsOptions = {
|
||||||
|
compression = "zstd";
|
||||||
|
"com.sun:auto-snapshot" = "false";
|
||||||
|
"acltype" = "posixacl"; # NOTE: needed for systemd https://github.com/NixOS/nixpkgs/issues/16954
|
||||||
|
};
|
||||||
|
mountpoint = null;
|
||||||
|
|
||||||
|
datasets = {
|
||||||
|
encrypted = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options = {
|
||||||
|
mountpoint = "none";
|
||||||
|
encryption = "aes-256-gcm";
|
||||||
|
keyformat = "passphrase";
|
||||||
|
};
|
||||||
|
# use this to read the key during boot
|
||||||
|
postCreateHook = ''
|
||||||
|
zfs set keylocation="prompt" "zroot/$name";
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
"encrypted/root" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/";
|
||||||
|
postCreateHook = "zfs snapshot zroot/encrypted/root@blank";
|
||||||
|
};
|
||||||
|
"encrypted/nix" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/nix";
|
||||||
|
};
|
||||||
|
"encrypted/persist" = {
|
||||||
|
type = "zfs_fs";
|
||||||
|
options.mountpoint = "legacy";
|
||||||
|
mountpoint = "/persist";
|
||||||
|
options."com.sun:auto-snapshot" = "true";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
# rollback to blank
|
||||||
|
boot.initrd.postDeviceCommands = lib.mkAfter ''
|
||||||
|
zfs rollback -r zroot/encrypted/root@blank && echo "rollback complete"
|
||||||
|
'';
|
||||||
|
fileSystems."/persist".neededForBoot = true;
|
||||||
|
# HACK: to fix issue of agenix running before impermanence
|
||||||
|
age.identityPaths = [
|
||||||
|
"/etc/ssh/ssh_host_ed25519_key"
|
||||||
|
"/etc/ssh/ssh_host_rsa_key"
|
||||||
|
"/persist/etc/ssh/ssh_host_ed25519_key"
|
||||||
|
"/persist/etc/ssh/ssh_host_rsa_key"
|
||||||
|
];
|
||||||
|
services.zfs = {
|
||||||
|
autoScrub.enable = true;
|
||||||
|
trim.enable = true;
|
||||||
|
autoSnapshot.enable = true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,62 +1,27 @@
|
||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
# and may be overwritten by future invocations. Please make changes
|
# and may be overwritten by future invocations. Please make changes
|
||||||
# to /etc/nixos/configuration.nix instead.
|
# to /etc/nixos/configuration.nix instead.
|
||||||
{ config
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
, lib
|
|
||||||
, modulesPath
|
|
||||||
, ...
|
|
||||||
}: {
|
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
|
||||||
boot = {
|
|
||||||
initrd = {
|
|
||||||
availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
|
||||||
kernelModules = [ ];
|
|
||||||
luks.devices."enc".device = "/dev/disk/by-uuid/30025a9f-44cf-4074-8ae2-d4925efd67dd";
|
|
||||||
};
|
|
||||||
kernelModules = [ "kvm-amd" ];
|
|
||||||
extraModulePackages = [ ];
|
|
||||||
};
|
|
||||||
fileSystems = {
|
|
||||||
"/" = {
|
|
||||||
device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1";
|
|
||||||
fsType = "btrfs";
|
|
||||||
options = [ "subvol=root" "compress=zstd" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
"/home" = {
|
{
|
||||||
device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1";
|
imports =
|
||||||
fsType = "btrfs";
|
[
|
||||||
options = [ "subvol=home" "compress=zstd" ];
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
};
|
];
|
||||||
|
|
||||||
"/nix" = {
|
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usbhid" "sd_mod" ];
|
||||||
device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1";
|
boot.initrd.kernelModules = [ ];
|
||||||
fsType = "btrfs";
|
boot.kernelModules = [ "kvm-amd" ];
|
||||||
options = [ "subvol=nix" "compress=zstd" ];
|
boot.extraModulePackages = [ ];
|
||||||
};
|
|
||||||
|
|
||||||
"/var/log" = {
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
device = "/dev/disk/by-uuid/668a49b3-d169-461f-861d-0c3e6a1642d1";
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
fsType = "btrfs";
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
options = [ "subvol=log" "compress=zstd" ];
|
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||||
neededForBoot = true;
|
networking.useDHCP = lib.mkDefault true;
|
||||||
};
|
# networking.interfaces.enp6s0.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.wlp7s0.useDHCP = lib.mkDefault true;
|
||||||
"/boot" = {
|
|
||||||
device = "/dev/disk/by-uuid/297B-C04C";
|
|
||||||
fsType = "vfat";
|
|
||||||
};
|
|
||||||
|
|
||||||
"/media/games" = {
|
|
||||||
device = "/dev/disk/by-uuid/8f92ff36-a685-4a67-a3d4-55136dc5f286";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [{ device = "/dev/disk/by-uuid/00ad6f74-f23e-4ac0-abfb-89bdfe5ab8ae"; }];
|
|
||||||
|
|
||||||
hardware.cpu.amd.updateMicrocode =
|
|
||||||
lib.mkDefault config.hardware.enableRedistributableFirmware;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,14 +3,12 @@
|
||||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||||
{ pkgs
|
{ pkgs
|
||||||
, inputs
|
, inputs
|
||||||
, lib
|
|
||||||
, ...
|
, ...
|
||||||
}: {
|
}: {
|
||||||
imports = [
|
imports = [
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./disko.nix
|
./disko.nix
|
||||||
./impermanence.nix
|
|
||||||
];
|
];
|
||||||
|
|
||||||
my = {
|
my = {
|
||||||
|
@ -19,25 +17,121 @@
|
||||||
profiles = {
|
profiles = {
|
||||||
desktop.enable = true;
|
desktop.enable = true;
|
||||||
personal.enable = true;
|
personal.enable = true;
|
||||||
# webis.enable = true;
|
webis.enable = true;
|
||||||
|
impermanence.enable = true;
|
||||||
};
|
};
|
||||||
|
programs.river.enable = true;
|
||||||
|
programs.hyprland.enable = false;
|
||||||
|
programs.exercism.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [
|
users.users.moritz.packages = [ pkgs.poetry ];
|
||||||
(
|
|
||||||
pkgs.writeShellApplication {
|
home-manager.users.moritz.services.kanshi.profiles = {
|
||||||
name = "zfs-diff";
|
undocked = {
|
||||||
runtimeInputs = with pkgs; [ zfs coreutils parallel tree ];
|
outputs = [
|
||||||
text = ''
|
{
|
||||||
zfs diff -F zroot/encrypted/root@blank | awk '$2 == "F" && system("test -e /persist/"$3) != 0 { print $3 }' 2>/dev/null | tree --fromfile . "$@"
|
criteria = "eDP-1";
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
)
|
|
||||||
];
|
];
|
||||||
|
};
|
||||||
|
docked = {
|
||||||
|
outputs = [
|
||||||
|
{
|
||||||
|
criteria = "eDP-1";
|
||||||
|
position = "640,1800"; # NOTE: 2160 / 1.2 = 1800
|
||||||
|
}
|
||||||
|
{
|
||||||
|
criteria = "DP-3";
|
||||||
|
scale = 1.2;
|
||||||
|
position = "0,0";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
home-manager.users.moritz.home.packages = with pkgs; [
|
services.kanata = {
|
||||||
# jetbrains.idea-ultimate
|
enable = true;
|
||||||
|
keyboards = {
|
||||||
|
laptop = {
|
||||||
|
devices = [
|
||||||
|
"/dev/input/by-path/platform-i8042-serio-0-event-kbd"
|
||||||
];
|
];
|
||||||
|
config = "
|
||||||
|
(defsrc
|
||||||
|
grv 1 2 3 4 5 6 7 8 9 0 - = bspc
|
||||||
|
tab q w e r t y u i o p [ ] \
|
||||||
|
caps a s d f g h j k l ; ' ret
|
||||||
|
lsft z x c v b n m , . / rsft
|
||||||
|
lctl lmet lalt spc ralt rctl
|
||||||
|
)
|
||||||
|
|
||||||
|
(deflayermap (default)
|
||||||
|
;; tarmak 1a
|
||||||
|
j n
|
||||||
|
n k
|
||||||
|
k e
|
||||||
|
|
||||||
|
;; tarmak 1b
|
||||||
|
h m
|
||||||
|
m h
|
||||||
|
|
||||||
|
;; tarmak 2a
|
||||||
|
b z
|
||||||
|
z x
|
||||||
|
x c
|
||||||
|
|
||||||
|
;; tarmak 2b
|
||||||
|
e f
|
||||||
|
f t
|
||||||
|
t b
|
||||||
|
|
||||||
|
;; tarmak 3
|
||||||
|
c d
|
||||||
|
d s
|
||||||
|
s r
|
||||||
|
|
||||||
|
;; tarmak 4
|
||||||
|
r p
|
||||||
|
p ;
|
||||||
|
; o
|
||||||
|
o y
|
||||||
|
y j
|
||||||
|
|
||||||
|
;; tarmak 5
|
||||||
|
u l
|
||||||
|
l i
|
||||||
|
i u
|
||||||
|
|
||||||
|
;; caps-word tap-dance
|
||||||
|
lsft (tap-dance 200 (_ (caps-word 2000) _ _))
|
||||||
|
|
||||||
|
;; change ctrl alt and meta
|
||||||
|
lctl lalt
|
||||||
|
lmet lctl
|
||||||
|
lalt (tap-dance 200 (lmet (multi lmet alt) lmet lmet))
|
||||||
|
|
||||||
|
;; hjkl layer
|
||||||
|
ralt (tap-hold 200 200 (layer-switch hjkl) (layer-while-held hjkl)) ;; tap: switch hold: switch while held
|
||||||
|
|
||||||
|
;; switch to normal keyboard layout
|
||||||
|
rctl (layer-switch normal)
|
||||||
|
)
|
||||||
|
|
||||||
|
(deflayermap (normal)
|
||||||
|
rctl (layer-switch default))
|
||||||
|
|
||||||
|
(deflayermap (hjkl)
|
||||||
|
h left
|
||||||
|
j down
|
||||||
|
k up
|
||||||
|
l right
|
||||||
|
|
||||||
|
ralt (layer-switch default))
|
||||||
|
";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
# BOOT
|
# BOOT
|
||||||
boot = {
|
boot = {
|
||||||
|
@ -47,8 +141,8 @@
|
||||||
|
|
||||||
# SERVICES
|
# SERVICES
|
||||||
services = {
|
services = {
|
||||||
xserver.libinput.enable = true;
|
libinput.enable = true;
|
||||||
xserver.libinput.touchpad.disableWhileTyping = true;
|
libinput.touchpad.disableWhileTyping = true;
|
||||||
printing.enable = true;
|
printing.enable = true;
|
||||||
logind.lidSwitch = "hybrid-sleep";
|
logind.lidSwitch = "hybrid-sleep";
|
||||||
};
|
};
|
||||||
|
@ -111,7 +205,7 @@
|
||||||
}/bin/python asus_touchpad.py m433ia
|
}/bin/python asus_touchpad.py m433ia
|
||||||
'';
|
'';
|
||||||
# Probably needed because it fails on boot seemingly because the driver
|
# Probably needed because it fails on boot seemingly because the driver
|
||||||
# is not ready yet. Alternativly, you can use `sleep 3` or similar in the
|
# is not ready yet. Alternatively, you can use `sleep 3` or similar in the
|
||||||
# `script`.
|
# `script`.
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
RestartSec = "1s";
|
RestartSec = "1s";
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
type = "gpt";
|
type = "gpt";
|
||||||
partitions = {
|
partitions = {
|
||||||
ESP = {
|
ESP = {
|
||||||
size = "64M";
|
size = "512M";
|
||||||
type = "EF00";
|
type = "EF00";
|
||||||
content = {
|
content = {
|
||||||
type = "filesystem";
|
type = "filesystem";
|
||||||
|
@ -37,6 +37,7 @@
|
||||||
rootFsOptions = {
|
rootFsOptions = {
|
||||||
compression = "zstd";
|
compression = "zstd";
|
||||||
"com.sun:auto-snapshot" = "false";
|
"com.sun:auto-snapshot" = "false";
|
||||||
|
"acltype" = "posixacl"; # NOTE: needed for systemd https://github.com/NixOS/nixpkgs/issues/16954
|
||||||
};
|
};
|
||||||
mountpoint = null;
|
mountpoint = null;
|
||||||
|
|
||||||
|
|
|
@ -1,71 +0,0 @@
|
||||||
{ config, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
age.secrets = {
|
|
||||||
root-password.file = ../../secrets/root-password.age;
|
|
||||||
moritz-password.file = ../../secrets/moritz-password.age;
|
|
||||||
};
|
|
||||||
users.users = {
|
|
||||||
root.hashedPasswordFile = config.age.secrets.root-password.path;
|
|
||||||
moritz.hashedPasswordFile = config.age.secrets.moritz-password.path;
|
|
||||||
};
|
|
||||||
users.mutableUsers = false;
|
|
||||||
environment.persistence."/persist" = {
|
|
||||||
hideMounts = true;
|
|
||||||
directories = [
|
|
||||||
"/etc/NetworkManager/system-connections"
|
|
||||||
"/var/db/dhcpcd/"
|
|
||||||
"/var/lib/NetworkManager/"
|
|
||||||
"/var/lib/bluetooth"
|
|
||||||
"/var/lib/nixos"
|
|
||||||
"/var/lib/systemd/coredump"
|
|
||||||
"/var/log"
|
|
||||||
];
|
|
||||||
files = [
|
|
||||||
"/etc/machine-id"
|
|
||||||
"/etc/nix/id_rsa"
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key"
|
|
||||||
"/etc/ssh/ssh_host_ed25519_key.pub"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key"
|
|
||||||
"/etc/ssh/ssh_host_rsa_key.pub"
|
|
||||||
];
|
|
||||||
users.moritz = {
|
|
||||||
directories = [
|
|
||||||
".SynologyDrive/data"
|
|
||||||
".SynologyDrive/log"
|
|
||||||
".cache/keepassxc"
|
|
||||||
".cache/nvim/luac"
|
|
||||||
".config/Nextcloud"
|
|
||||||
".config/keepassxc"
|
|
||||||
".local/share/direnv"
|
|
||||||
".local/share/nvim"
|
|
||||||
".local/share/zoxide"
|
|
||||||
".local/state/nvim"
|
|
||||||
".mozilla"
|
|
||||||
"Documents"
|
|
||||||
"Downloads"
|
|
||||||
"Music"
|
|
||||||
"Pictures"
|
|
||||||
"Videos"
|
|
||||||
{ directory = ".gnupg"; mode = "0700"; }
|
|
||||||
{ directory = ".local/share/keyrings"; mode = "0700"; }
|
|
||||||
{ directory = ".ssh"; mode = "0700"; }
|
|
||||||
];
|
|
||||||
files = [
|
|
||||||
".local/share/fish/fish_history"
|
|
||||||
".local/share/nix/trusted-settings.json"
|
|
||||||
".parallel/will-cite"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
users.root = {
|
|
||||||
home = "/root";
|
|
||||||
directories = [
|
|
||||||
{ directory = ".gnupg"; mode = "0700"; }
|
|
||||||
{ directory = ".ssh"; mode = "0700"; }
|
|
||||||
];
|
|
||||||
files = [
|
|
||||||
".local/share/nix/trusted-settings.json"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -31,6 +31,12 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
{
|
{
|
||||||
|
my.programs.tofi.settings = {
|
||||||
|
text-color = "#${text}";
|
||||||
|
prompt-color = "#${red}";
|
||||||
|
selection-color = "#${yellow}";
|
||||||
|
background-color = "#${base}";
|
||||||
|
};
|
||||||
home-manager.users.moritz = {
|
home-manager.users.moritz = {
|
||||||
programs = {
|
programs = {
|
||||||
fzf.colors = {
|
fzf.colors = {
|
||||||
|
@ -47,6 +53,26 @@
|
||||||
prompt = "#${mauve}";
|
prompt = "#${mauve}";
|
||||||
spinner = "#${rosewater}";
|
spinner = "#${rosewater}";
|
||||||
};
|
};
|
||||||
|
foot.settings.colors = {
|
||||||
|
foreground = text; # Text
|
||||||
|
background = base; # Base
|
||||||
|
regular0 = surface1; # Surface 1
|
||||||
|
regular1 = red; # red
|
||||||
|
regular2 = green; # green
|
||||||
|
regular3 = yellow; # yellow
|
||||||
|
regular4 = blue;
|
||||||
|
regular5 = pink;
|
||||||
|
regular6 = teal;
|
||||||
|
regular7 = subtext1;
|
||||||
|
bright0 = surface2;
|
||||||
|
bright1 = red;
|
||||||
|
bright2 = green;
|
||||||
|
bright3 = yellow;
|
||||||
|
bright4 = blue;
|
||||||
|
bright5 = pink;
|
||||||
|
bright6 = teal;
|
||||||
|
bright7 = subtext0;
|
||||||
|
};
|
||||||
kitty.extraConfig = ''
|
kitty.extraConfig = ''
|
||||||
# vim:ft=kitty
|
# vim:ft=kitty
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ in
|
||||||
(import ./_catppuccin.nix
|
(import ./_catppuccin.nix
|
||||||
{
|
{
|
||||||
inherit config lib pkgs;
|
inherit config lib pkgs;
|
||||||
flavor = "mocha";
|
flavor = "macchiato";
|
||||||
rosewater = "f4dbd6";
|
rosewater = "f4dbd6";
|
||||||
flamingo = "f0c6c6";
|
flamingo = "f0c6c6";
|
||||||
pink = "f5bde6";
|
pink = "f5bde6";
|
||||||
|
|
|
@ -31,6 +31,20 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
my.programs.tofi.settings = {
|
||||||
|
font-size = "20";
|
||||||
|
font =
|
||||||
|
let
|
||||||
|
fontBasePath = pkgs.nerdfonts.override {
|
||||||
|
fonts = [ "FiraCode" ];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
"${fontBasePath}/share/fonts/truetype/NerdFonts/FiraCodeNerdFont-Regular.ttf";
|
||||||
|
height = "360";
|
||||||
|
width = "720";
|
||||||
|
outline-width = "0";
|
||||||
|
border-width = "0";
|
||||||
|
};
|
||||||
home-manager.users.moritz = {
|
home-manager.users.moritz = {
|
||||||
services.polybar = {
|
services.polybar = {
|
||||||
config = {
|
config = {
|
||||||
|
@ -39,7 +53,7 @@ in
|
||||||
monitor = "\${env:MONITOR}";
|
monitor = "\${env:MONITOR}";
|
||||||
bottom = true;
|
bottom = true;
|
||||||
width = "100%";
|
width = "100%";
|
||||||
heigth = 15;
|
height = 15;
|
||||||
|
|
||||||
border-size = 2;
|
border-size = 2;
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 1.4 MiB |
Before Width: | Height: | Size: 12 MiB |
Before Width: | Height: | Size: 4.6 MiB After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 1.2 MiB |
Before Width: | Height: | Size: 10 MiB |
After Width: | Height: | Size: 1.8 MiB |
|
@ -0,0 +1,60 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.my.nixpkgs;
|
||||||
|
|
||||||
|
overlayType = mkOptionType {
|
||||||
|
name = "nixpkgs-overlay";
|
||||||
|
description = "nixpkgs overlay";
|
||||||
|
check = lib.isFunction;
|
||||||
|
merge = lib.mergeOneOption;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.nixpkgs = {
|
||||||
|
overlays = mkOption {
|
||||||
|
default = [ ];
|
||||||
|
type = types.listOf overlayType;
|
||||||
|
example = literalExpression
|
||||||
|
''
|
||||||
|
[
|
||||||
|
(self: super: {
|
||||||
|
openssh = super.openssh.override {
|
||||||
|
hpnSupport = true;
|
||||||
|
kerberos = self.libkrb5;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
channels = mkOption {
|
||||||
|
default = { };
|
||||||
|
example = literalExpression ''
|
||||||
|
{
|
||||||
|
stable = inputs.nixpkgs-stable;
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
type = with types; attrsOf package;
|
||||||
|
};
|
||||||
|
overlaysForAllChannels = mkEnableOption "apply overlays for all channels";
|
||||||
|
};
|
||||||
|
|
||||||
|
config.nixpkgs = {
|
||||||
|
overlays =
|
||||||
|
let
|
||||||
|
channelOverlays = _: prev:
|
||||||
|
mapAttrs
|
||||||
|
(_: value:
|
||||||
|
import value {
|
||||||
|
inherit (prev) system;
|
||||||
|
overlays = optional cfg.overlaysForAllChannels cfg.overlays;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
cfg.channels;
|
||||||
|
in
|
||||||
|
cfg.overlays ++ [ channelOverlays ];
|
||||||
|
|
||||||
|
config.allowUnfree = true;
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
{ config
|
{ config
|
||||||
, lib
|
, lib
|
||||||
, pkgs
|
, pkgs
|
||||||
|
, inputs
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ let
|
||||||
|
|
||||||
gi = pkgs.writeFishApplication {
|
gi = pkgs.writeFishApplication {
|
||||||
name = "gi";
|
name = "gi";
|
||||||
runtimeInputs = with pkgs; [ fzf gum curl ];
|
runtimeInputs = with pkgs; [ fzf gum curl coreutils-full ];
|
||||||
text = /* fish */ ''
|
text = /* fish */ ''
|
||||||
set url https://www.gitignore.io/api
|
set url https://www.gitignore.io/api
|
||||||
|
|
||||||
|
@ -56,10 +57,12 @@ let
|
||||||
set choice (string join "," $argv[1..])
|
set choice (string join "," $argv[1..])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set contents "$(curl -sL $url/$choice | head -n -2 | tail -n +4)"
|
||||||
|
|
||||||
if gum confirm "Overwrite current .gitignore?"
|
if gum confirm "Overwrite current .gitignore?"
|
||||||
curl -sL $url/$choice > .gitignore
|
echo "$contents" > .gitignore
|
||||||
else
|
else
|
||||||
curl -sL $url/$choice >> .gitignore
|
echo "$contents" >> .gitignore
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
completions = /* fish */ ''
|
completions = /* fish */ ''
|
||||||
|
@ -76,7 +79,7 @@ in
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
home = "/home/moritz";
|
home = "/home/moritz";
|
||||||
extraGroups = [ "wheel" "networkmanager" "video" ];
|
extraGroups = [ "wheel" "networkmanager" "video" ];
|
||||||
initialPassword = "password"; # CHANGE ME PLEASE
|
# initialPassword = "password"; # CHANGE ME PLEASE
|
||||||
openssh.authorizedKeys.keys = [
|
openssh.authorizedKeys.keys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGoAqa2m7hIzZ2LS96Z+RCIlRvhBM/j7h27tMBCwMT+a" # Moritz
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGoAqa2m7hIzZ2LS96Z+RCIlRvhBM/j7h27tMBCwMT+a" # Moritz
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDhtwHDGAZshiQWKkCcPWV9tC83b+bKBgjDcjP/N2CKO" # Laptop
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDhtwHDGAZshiQWKkCcPWV9tC83b+bKBgjDcjP/N2CKO" # Laptop
|
||||||
|
@ -88,6 +91,95 @@ in
|
||||||
time.timeZone = "Europe/Berlin";
|
time.timeZone = "Europe/Berlin";
|
||||||
|
|
||||||
my = {
|
my = {
|
||||||
|
nixpkgs = {
|
||||||
|
overlays = [
|
||||||
|
(_: prev:
|
||||||
|
{
|
||||||
|
nur = import inputs.nur {
|
||||||
|
pkgs = prev;
|
||||||
|
nurpkgs = prev;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
(
|
||||||
|
final: _:
|
||||||
|
|
||||||
|
with final.lib;
|
||||||
|
rec {
|
||||||
|
fishFile =
|
||||||
|
{ name
|
||||||
|
, destination
|
||||||
|
, content
|
||||||
|
, checkPhase ? null
|
||||||
|
}:
|
||||||
|
final.writeTextFile {
|
||||||
|
inherit name destination;
|
||||||
|
executable = true;
|
||||||
|
allowSubstitutes = true;
|
||||||
|
preferLocalBuild = false;
|
||||||
|
text = ''
|
||||||
|
#!${getExe final.fish}
|
||||||
|
|
||||||
|
${content}
|
||||||
|
'';
|
||||||
|
|
||||||
|
checkPhase =
|
||||||
|
if checkPhase == null then ''
|
||||||
|
runHook preCheck
|
||||||
|
${getExe final.fish} -n "$target"
|
||||||
|
runHook postCheck
|
||||||
|
''
|
||||||
|
else checkPhase;
|
||||||
|
};
|
||||||
|
|
||||||
|
writeFishApplication =
|
||||||
|
{ name
|
||||||
|
, text
|
||||||
|
, completions ? null
|
||||||
|
, runtimeInputs ? [ ]
|
||||||
|
, checkPhase ? null
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
runtimeHeader = optionalString (runtimeInputs != [ ])
|
||||||
|
''export PATH="${makeBinPath runtimeInputs}:$PATH"'';
|
||||||
|
|
||||||
|
script = fishFile {
|
||||||
|
inherit checkPhase;
|
||||||
|
name = "${name}_script";
|
||||||
|
destination = "/bin/${name}";
|
||||||
|
content = concatLines [ runtimeHeader text ];
|
||||||
|
};
|
||||||
|
completions_file = fishFile {
|
||||||
|
inherit checkPhase;
|
||||||
|
name = "${name}_completions";
|
||||||
|
destination = "/share/fish/vendor_completions.d/${name}.fish";
|
||||||
|
content = concatLines [ runtimeHeader completions ];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
final.symlinkJoin {
|
||||||
|
inherit name;
|
||||||
|
paths = [
|
||||||
|
script
|
||||||
|
] ++ optional (completions != null) completions_file;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
(
|
||||||
|
_: prev: {
|
||||||
|
xorg = prev.xorg // {
|
||||||
|
lndir = prev.xorg.lndir.overrideAttrs (_: {
|
||||||
|
meta.mainProgram = "lndir";
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
channels = {
|
||||||
|
master = inputs.master;
|
||||||
|
stable = inputs.stable;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
bin.enable = true;
|
bin.enable = true;
|
||||||
shell = {
|
shell = {
|
||||||
abbreviations = {
|
abbreviations = {
|
||||||
|
@ -101,7 +193,6 @@ in
|
||||||
cat = "bat";
|
cat = "bat";
|
||||||
rm = "rm -i";
|
rm = "rm -i";
|
||||||
mv = "mv -i";
|
mv = "mv -i";
|
||||||
cd = "__zoxide_z";
|
|
||||||
|
|
||||||
nixos-update = "pushd ~/.dotfiles && nix flake update && popd";
|
nixos-update = "pushd ~/.dotfiles && nix flake update && popd";
|
||||||
};
|
};
|
||||||
|
@ -123,10 +214,8 @@ in
|
||||||
"|" = "split-window -h";
|
"|" = "split-window -h";
|
||||||
"C-l" = "send-keys C-l";
|
"C-l" = "send-keys C-l";
|
||||||
"R" = "source-file $XDG_CONFIG_HOME/tmux/tmux.conf \\; display-message 'Reloaded tmux.conf'";
|
"R" = "source-file $XDG_CONFIG_HOME/tmux/tmux.conf \\; display-message 'Reloaded tmux.conf'";
|
||||||
};
|
"f" = "new-window ts";
|
||||||
root = {
|
"a" = "new-window ta";
|
||||||
"C-f" = "new-window ts";
|
|
||||||
"C-a" = "new-window ta";
|
|
||||||
};
|
};
|
||||||
copy-mode-vi = {
|
copy-mode-vi = {
|
||||||
"v" = "send -X begin-selection";
|
"v" = "send -X begin-selection";
|
||||||
|
@ -160,23 +249,23 @@ in
|
||||||
parallel
|
parallel
|
||||||
ripgrep
|
ripgrep
|
||||||
vim
|
vim
|
||||||
viu
|
(viu.override { withSixel = true; })
|
||||||
wget
|
wget
|
||||||
];
|
];
|
||||||
|
|
||||||
fonts = {
|
fonts = {
|
||||||
enableDefaultPackages = true;
|
enableDefaultPackages = true;
|
||||||
packages = with pkgs; [
|
packages = [
|
||||||
(nerdfonts.override {
|
(pkgs.nerdfonts.override {
|
||||||
fonts = [ "FiraCode" ];
|
fonts = [ "FiraCode" ];
|
||||||
})
|
})
|
||||||
|
pkgs.master.intel-one-mono
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
mtr.enable = true;
|
mtr.enable = true;
|
||||||
command-not-found.enable = true;
|
command-not-found.enable = false;
|
||||||
starship.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
|
@ -210,6 +299,7 @@ in
|
||||||
"--cmd c"
|
"--cmd c"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
starship.enable = true;
|
||||||
};
|
};
|
||||||
home = {
|
home = {
|
||||||
username = "moritz";
|
username = "moritz";
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) mkEnableOption mkIf mkDefault;
|
||||||
cfg = config.my.profiles.desktop;
|
cfg = config.my.profiles.desktop;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -16,7 +16,7 @@ in
|
||||||
yubikey = {
|
yubikey = {
|
||||||
enable = mkDefault true;
|
enable = mkDefault true;
|
||||||
luksSupport = {
|
luksSupport = {
|
||||||
enable = mkDefault true;
|
enable = mkDefault false;
|
||||||
devices = mkDefault [ "enc" ];
|
devices = mkDefault [ "enc" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -32,7 +32,6 @@ in
|
||||||
firefox.enable = mkDefault true;
|
firefox.enable = mkDefault true;
|
||||||
gpg.enable = mkDefault true;
|
gpg.enable = mkDefault true;
|
||||||
hyprland.enable = mkDefault true;
|
hyprland.enable = mkDefault true;
|
||||||
logseq.enable = mkDefault true;
|
|
||||||
nix-edit.enable = mkDefault true;
|
nix-edit.enable = mkDefault true;
|
||||||
nvim.enable = mkDefault true;
|
nvim.enable = mkDefault true;
|
||||||
python.versions."311".enable = mkDefault true;
|
python.versions."311".enable = mkDefault true;
|
||||||
|
@ -91,6 +90,15 @@ in
|
||||||
stable.texlive.combined.scheme-full # NOTE breaks often
|
stable.texlive.combined.scheme-full # NOTE breaks often
|
||||||
thunderbird
|
thunderbird
|
||||||
vlc
|
vlc
|
||||||
|
(symlinkJoin {
|
||||||
|
name = "obsidian-wayland";
|
||||||
|
paths = [ obsidian ];
|
||||||
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
postBuild = ''
|
||||||
|
wrapProgram $out/bin/obsidian \
|
||||||
|
--add-flags "--socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland"
|
||||||
|
'';
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.nix-ld.enable = true;
|
programs.nix-ld.enable = true;
|
||||||
|
@ -100,10 +108,14 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
startInBackground = true;
|
startInBackground = true;
|
||||||
};
|
};
|
||||||
|
systemd.user.services.nextcloud-client.Service = {
|
||||||
|
RestartSec = "500ms";
|
||||||
|
Restart = "on-failure";
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
illum.enable = true;
|
illum.enable = true;
|
||||||
resolved.enable = true;
|
|
||||||
gnome.gnome-keyring.enable = true;
|
gnome.gnome-keyring.enable = true;
|
||||||
pipewire = {
|
pipewire = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -111,5 +123,19 @@ in
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# faster startup https://majiehong.com/post/2021-07-30_slow_nixos_startup/
|
||||||
|
networking = {
|
||||||
|
# no need to wait interfaces to have an IP to continue booting
|
||||||
|
dhcpcd.wait = "background";
|
||||||
|
# avoid checking if IP is already taken to boot a few seconds faster
|
||||||
|
dhcpcd.extraConfig = "noarp";
|
||||||
|
};
|
||||||
|
# disable network-online.target
|
||||||
|
systemd.services.NetworkManager-wait-online.enable = false;
|
||||||
|
boot = {
|
||||||
|
consoleLogLevel = 0;
|
||||||
|
kernelParams = [ "quiet" "udev.log_level=3" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@ in
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
lutris
|
lutris
|
||||||
legendary-gl
|
legendary-gl
|
||||||
heroic
|
|
||||||
mangohud
|
mangohud
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.my.profiles.impermanence;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.profiles.impermanence.enable = mkEnableOption "impermanence";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
age.secrets = {
|
||||||
|
root-password.file = ../../secrets/root-password.age;
|
||||||
|
moritz-password.file = ../../secrets/moritz-password.age;
|
||||||
|
};
|
||||||
|
users.users = {
|
||||||
|
root.hashedPasswordFile = config.age.secrets.root-password.path;
|
||||||
|
moritz.hashedPasswordFile = config.age.secrets.moritz-password.path;
|
||||||
|
};
|
||||||
|
users.mutableUsers = false;
|
||||||
|
environment.persistence."/persist" = {
|
||||||
|
hideMounts = true;
|
||||||
|
directories = [
|
||||||
|
"/etc/NetworkManager/system-connections"
|
||||||
|
"/var/db/dhcpcd/"
|
||||||
|
"/var/lib/NetworkManager/"
|
||||||
|
"/var/lib/bluetooth"
|
||||||
|
"/var/lib/nixos"
|
||||||
|
"/var/lib/systemd"
|
||||||
|
"/var/log"
|
||||||
|
];
|
||||||
|
files = [
|
||||||
|
"/etc/machine-id"
|
||||||
|
"/etc/nix/id_rsa"
|
||||||
|
"/etc/ssh/ssh_host_ed25519_key"
|
||||||
|
"/etc/ssh/ssh_host_ed25519_key.pub"
|
||||||
|
"/etc/ssh/ssh_host_rsa_key"
|
||||||
|
"/etc/ssh/ssh_host_rsa_key.pub"
|
||||||
|
];
|
||||||
|
users.moritz = {
|
||||||
|
directories = [
|
||||||
|
".SynologyDrive/data"
|
||||||
|
".SynologyDrive/log"
|
||||||
|
".cache/keepassxc"
|
||||||
|
".cache/nvim/luac"
|
||||||
|
".cat_installer" # eduroam
|
||||||
|
".config/JetBrains"
|
||||||
|
".config/Nextcloud"
|
||||||
|
".config/calibre"
|
||||||
|
".config/github-copilot"
|
||||||
|
".config/kdeconnect"
|
||||||
|
".config/keepassxc"
|
||||||
|
".java/.userPrefs/jetbrains/"
|
||||||
|
".local/share/JetBrains"
|
||||||
|
".local/share/direnv"
|
||||||
|
".local/share/nvim"
|
||||||
|
".local/share/zoxide"
|
||||||
|
".local/state/nvim"
|
||||||
|
".mozilla"
|
||||||
|
"Documents"
|
||||||
|
"Downloads"
|
||||||
|
"Music"
|
||||||
|
"Pictures"
|
||||||
|
"Videos"
|
||||||
|
{ directory = ".gnupg"; mode = "0700"; }
|
||||||
|
{ directory = ".local/share/keyrings"; mode = "0700"; }
|
||||||
|
{ directory = ".ssh"; mode = "0700"; }
|
||||||
|
];
|
||||||
|
files = [
|
||||||
|
".local/share/fish/fish_history"
|
||||||
|
".local/share/nix/trusted-settings.json"
|
||||||
|
".parallel/will-cite"
|
||||||
|
".local/state/tofi-history"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
users.root = {
|
||||||
|
home = "/root";
|
||||||
|
directories = [
|
||||||
|
{ directory = ".gnupg"; mode = "0700"; }
|
||||||
|
{ directory = ".ssh"; mode = "0700"; }
|
||||||
|
];
|
||||||
|
files = [
|
||||||
|
".local/share/nix/trusted-settings.json"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [
|
||||||
|
(
|
||||||
|
pkgs.writeShellApplication {
|
||||||
|
name = "zfs-diff";
|
||||||
|
runtimeInputs = with pkgs; [ zfs coreutils parallel tree ];
|
||||||
|
text = ''
|
||||||
|
zfs diff -F zroot/encrypted/root@blank | awk '$2 == "F" && system("test -e /persist/"$3) != 0 { print $3 }' 2>/dev/null | tree --fromfile . "$@"
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
)
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -30,8 +30,8 @@ in
|
||||||
"browser.search.suggest.enabled" = true;
|
"browser.search.suggest.enabled" = true;
|
||||||
"browser.urlbar.suggest.searches" = true;
|
"browser.urlbar.suggest.searches" = true;
|
||||||
|
|
||||||
# startup page
|
# Restore previous session on startup
|
||||||
"browser.startup.page" = 0;
|
"browser.startup.page" = 3;
|
||||||
|
|
||||||
# drm
|
# drm
|
||||||
"media.eme.enabled" = true;
|
"media.eme.enabled" = true;
|
||||||
|
@ -41,30 +41,6 @@ in
|
||||||
|
|
||||||
# disable letterboxing
|
# disable letterboxing
|
||||||
"privacy.resistFingerprinting.letterboxing" = false;
|
"privacy.resistFingerprinting.letterboxing" = false;
|
||||||
|
|
||||||
## OTHER
|
|
||||||
# Dont show warning when accessing about:config
|
|
||||||
"browser.aboutConfig.showWarning" = false;
|
|
||||||
|
|
||||||
# Hide bookmarks
|
|
||||||
"browser.toolbars.bookmarks.visibility" = "never";
|
|
||||||
|
|
||||||
# Smooth scrolling
|
|
||||||
"general.smoothScroll.lines.durationMaxMS" = 125;
|
|
||||||
"general.smoothScroll.lines.durationMinMS" = 125;
|
|
||||||
"general.smoothScroll.mouseWheel.durationMaxMS" = 200;
|
|
||||||
"general.smoothScroll.mouseWheel.durationMinMS" = 100;
|
|
||||||
"general.smoothScroll.msdPhysics.enabled" = true;
|
|
||||||
"general.smoothScroll.other.durationMaxMS" = 125;
|
|
||||||
"general.smoothScroll.other.durationMinMS" = 125;
|
|
||||||
"general.smoothScroll.pages.durationMaxMS" = 125;
|
|
||||||
"general.smoothScroll.pages.durationMinMS" = 125;
|
|
||||||
"mousewheel.min_line_scroll_amount" = 40;
|
|
||||||
"mousewheel.system_scroll_override_on_root_content.enabled" = true;
|
|
||||||
"mousewheel.system_scroll_override_on_root_content.horizontal.factor" = 175;
|
|
||||||
"mousewheel.system_scroll_override_on_root_content.vertical.factor" = 175;
|
|
||||||
"toolkit.scrollbox.horizontalScrollDistance" = 6;
|
|
||||||
"toolkit.scrollbox.verticalScrollDistance" = 2;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,16 +4,23 @@
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
cfg = config.my.profiles.webis;
|
cfg = config.my.profiles.webis;
|
||||||
|
inherit (lib) mkEnableOption mkIf;
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
options.my.profiles.webis.enable = mkEnableOption "webis profile";
|
options.my.profiles.webis.enable = mkEnableOption "webis profile";
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
my.programs.ssh.includeSecrets = [ ../../secrets/webis-ssh.age ];
|
my.programs = {
|
||||||
|
ssh.includeSecrets = [ ../../secrets/webis-ssh.age ];
|
||||||
|
jetbrains = {
|
||||||
|
pycharm.enable = true;
|
||||||
|
pycharm.package = pkgs.jetbrains.pycharm-professional;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
age.secrets.webis = {
|
age.secrets.webis = {
|
||||||
file = ../../secrets/webis.age;
|
file = ../../secrets/webis.age;
|
||||||
name = "webis.ovpn";
|
name = "webis.ovpn";
|
||||||
|
@ -25,9 +32,6 @@ in
|
||||||
updateResolvConf = true;
|
updateResolvConf = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
jetbrains.pycharm-professional
|
|
||||||
];
|
|
||||||
programs.dconf.enable = true;
|
programs.dconf.enable = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.my.programs.exercism;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.programs.exercism.enable = mkEnableOption "Exercism";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [ exercism ];
|
||||||
|
|
||||||
|
age.secrets.exercism = {
|
||||||
|
path = "/home/moritz/.config/exercism/user.json";
|
||||||
|
file = ../../secrets/exercism.age;
|
||||||
|
owner = "1000";
|
||||||
|
mode = "500";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
{ config
|
{ config
|
||||||
, lib
|
, lib
|
||||||
, inputs
|
, inputs
|
||||||
|
, pkgs
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -28,18 +29,153 @@ in
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.firefox;
|
||||||
|
example = pkgs.firefox-esr;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home-manager.users.moritz.programs.firefox = {
|
home-manager.users.moritz.programs.firefox = {
|
||||||
enable = true;
|
enable = true;
|
||||||
profiles."default".extraConfig = mkIf cfg.arkenfox.enable ''
|
policies =
|
||||||
|
let
|
||||||
|
removeExtensions = [ "Google" "Amazon.de" "Bing" "Amazon" "Wikipedia (en)" "Wikipedia (de)" ];
|
||||||
|
convertName = name:
|
||||||
|
let
|
||||||
|
lower = toLower name;
|
||||||
|
escaped = replaceStrings [ "." ] [ "dot" ] lower;
|
||||||
|
sanitized = head (splitString " " escaped);
|
||||||
|
in
|
||||||
|
"${sanitized}@search.mozilla.org";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
SearchEngines = mkIf (hasInfix "esr" cfg.package) {
|
||||||
|
Default = "Kagi";
|
||||||
|
Remove = removeExtensions;
|
||||||
|
};
|
||||||
|
ExtensionSettings = genAttrs
|
||||||
|
(map convertName removeExtensions)
|
||||||
|
(_: { installation_mode = "blocked"; });
|
||||||
|
};
|
||||||
|
profiles."default" = {
|
||||||
|
extraConfig = mkIf cfg.arkenfox.enable ''
|
||||||
// Arkenfox user.js
|
// Arkenfox user.js
|
||||||
${arkenfox}
|
${arkenfox}
|
||||||
|
|
||||||
// Overrides
|
// Overrides
|
||||||
${cfg.arkenfox.overrides}
|
${cfg.arkenfox.overrides}
|
||||||
'';
|
'';
|
||||||
|
extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
||||||
|
darkreader
|
||||||
|
firefox-color
|
||||||
|
istilldontcareaboutcookies
|
||||||
|
kagi-search
|
||||||
|
keepassxc-browser
|
||||||
|
languagetool
|
||||||
|
multi-account-containers
|
||||||
|
sponsorblock
|
||||||
|
temporary-containers
|
||||||
|
ublock-origin
|
||||||
|
vimium
|
||||||
|
];
|
||||||
|
settings = {
|
||||||
|
# Disable Pocket
|
||||||
|
"extensions.pocket.enabled" = false;
|
||||||
|
|
||||||
|
# Disable Activity Stream
|
||||||
|
# https://wiki.mozilla.org/Firefox/Activity_Stream
|
||||||
|
"browser.newtabpage.activity-stream.enabled" = false;
|
||||||
|
"browser.newtabpage.activity-stream.telemetry" = false;
|
||||||
|
"browser.newtabpage.activity-stream.feeds.discoverystreamfeed" = false;
|
||||||
|
"browser.newtabpage.activity-stream.feeds.section.topstories" = false;
|
||||||
|
"browser.newtabpage.activity-stream.section.highlights.includePocket" = false;
|
||||||
|
"browser.newtabpage.activity-stream.showSponsored" = false;
|
||||||
|
"browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.havePinned" = "";
|
||||||
|
"browser.newtabpage.activity-stream.improvesearch.topSiteSearchShortcuts.searchEngines" = "";
|
||||||
|
"browser.newtabpage.pinned" = "[]";
|
||||||
|
|
||||||
|
# Disable new tab tile ads & preload
|
||||||
|
# http://www.thewindowsclub.com/disable-remove-ad-tiles-from-firefox
|
||||||
|
# http://forums.mozillazine.org/viewtopic.php?p=13876331#p13876331
|
||||||
|
# https://wiki.mozilla.org/Tiles/Technical_Documentation#Ping
|
||||||
|
# https://gecko.readthedocs.org/en/latest/browser/browser/DirectoryLinksProvider.html#browser-newtabpage-directory-source
|
||||||
|
# https://gecko.readthedocs.org/en/latest/browser/browser/DirectoryLinksProvider.html#browser-newtabpage-directory-ping
|
||||||
|
"browser.newtabpage.enhanced" = false;
|
||||||
|
"browser.newtabpage.introShown" = true;
|
||||||
|
"browser.newtab.preload" = false;
|
||||||
|
"browser.newtabpage.directory.ping" = "";
|
||||||
|
"browser.newtabpage.directory.source" = "data:text/plain,{}";
|
||||||
|
|
||||||
|
# Disable some not so useful functionality.
|
||||||
|
"browser.disableResetPrompt" = true; # "Looks like you haven't started Firefox in a while."
|
||||||
|
"browser.onboarding.enabled" = false; # "New to Firefox? Let's get started!" tour
|
||||||
|
"browser.aboutConfig.showWarning" = false; # Warning when opening about:config
|
||||||
|
"extensions.shield-recipe-client.enabled" = false;
|
||||||
|
|
||||||
|
# do not offer to save passwords = nor allow the user to enable the feature
|
||||||
|
"signon.rememberSignons" = false;
|
||||||
|
"signon.rememberSignons.visibilityToggle" = false;
|
||||||
|
|
||||||
|
# send do not track header
|
||||||
|
"privacy.donottrackheader.enabled" = true;
|
||||||
|
|
||||||
|
# Hide bookmarks
|
||||||
|
"browser.toolbars.bookmarks.visibility" = "never";
|
||||||
|
|
||||||
|
# Smooth scrolling
|
||||||
|
"general.smoothScroll.lines.durationMaxMS" = 125;
|
||||||
|
"general.smoothScroll.lines.durationMinMS" = 125;
|
||||||
|
"general.smoothScroll.mouseWheel.durationMaxMS" = 200;
|
||||||
|
"general.smoothScroll.mouseWheel.durationMinMS" = 100;
|
||||||
|
"general.smoothScroll.msdPhysics.enabled" = true;
|
||||||
|
"general.smoothScroll.other.durationMaxMS" = 125;
|
||||||
|
"general.smoothScroll.other.durationMinMS" = 125;
|
||||||
|
"general.smoothScroll.pages.durationMaxMS" = 125;
|
||||||
|
"general.smoothScroll.pages.durationMinMS" = 125;
|
||||||
|
"mousewheel.min_line_scroll_amount" = 40;
|
||||||
|
"mousewheel.system_scroll_override_on_root_content.enabled" = true;
|
||||||
|
"mousewheel.system_scroll_override_on_root_content.horizontal.factor" = 175;
|
||||||
|
"mousewheel.system_scroll_override_on_root_content.vertical.factor" = 175;
|
||||||
|
"toolkit.scrollbox.horizontalScrollDistance" = 6;
|
||||||
|
"toolkit.scrollbox.verticalScrollDistance" = 2;
|
||||||
|
|
||||||
|
# Do not check if Firefox is the default browser
|
||||||
|
"browser.shell.checkDefaultBrowser" = false;
|
||||||
|
|
||||||
|
# Reduce search engine noise in the urlbar's completion window. The
|
||||||
|
# shortcuts and suggestions will still work, but Firefox won't clutter
|
||||||
|
# its UI with reminders that they exist.
|
||||||
|
"browser.urlbar.suggest.searches" = false;
|
||||||
|
"browser.urlbar.shortcuts.bookmarks" = false;
|
||||||
|
"browser.urlbar.shortcuts.history" = false;
|
||||||
|
"browser.urlbar.shortcuts.tabs" = false;
|
||||||
|
"browser.urlbar.showSearchSuggestionsFirst" = false;
|
||||||
|
"browser.urlbar.speculativeConnect.enabled" = false;
|
||||||
|
|
||||||
|
# https://bugzilla.mozilla.org/1642623
|
||||||
|
"browser.urlbar.dnsResolveSingleWordsAfterSearch" = 0;
|
||||||
|
# https://blog.mozilla.org/data/2021/09/15/data-and-firefox-suggest/
|
||||||
|
"browser.urlbar.suggest.quicksuggest.nonsponsored" = false;
|
||||||
|
"browser.urlbar.suggest.quicksuggest.sponsored" = false;
|
||||||
|
|
||||||
|
# Show whole URL in address bar
|
||||||
|
"browser.urlbar.trimURLs" = false;
|
||||||
|
|
||||||
|
# auto enable addons
|
||||||
|
"extensions.autoDisableScopes" = 0;
|
||||||
|
|
||||||
|
# Disable Form autofill
|
||||||
|
# https://wiki.mozilla.org/Firefox/Features/Form_Autofill
|
||||||
|
"browser.formfill.enable" = false;
|
||||||
|
"extensions.formautofill.addresses.enabled" = false;
|
||||||
|
"extensions.formautofill.available" = "off";
|
||||||
|
"extensions.formautofill.creditCards.available" = false;
|
||||||
|
"extensions.formautofill.creditCards.enabled" = false;
|
||||||
|
"extensions.formautofill.heuristics.enabled" = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
shellAbbrs = shellConfig.abbreviations;
|
shellAbbrs = shellConfig.abbreviations;
|
||||||
shellAliases = shellConfig.aliases;
|
shellAliases = shellConfig.aliases;
|
||||||
shellInit = ''
|
shellInit = /* fish */ ''
|
||||||
# Vi Mode
|
# Vi Mode
|
||||||
fish_vi_key_bindings
|
fish_vi_key_bindings
|
||||||
|
|
||||||
|
@ -62,7 +62,7 @@ in
|
||||||
end
|
end
|
||||||
abbr --add dotdot --regex '^\.\.+$' --function multicd
|
abbr --add dotdot --regex '^\.\.+$' --function multicd
|
||||||
|
|
||||||
abbr -a P --position anywhere --set-cursor "% | $PAGER"
|
abbr -a .P --position anywhere --set-cursor "% | $PAGER"
|
||||||
|
|
||||||
function editor_edit
|
function editor_edit
|
||||||
echo $EDITOR $argv
|
echo $EDITOR $argv
|
||||||
|
@ -114,6 +114,7 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
starship.enableTransience = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
{ config
|
||||||
|
, lib
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.my.programs.foot;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.programs.foot.enable = mkEnableOption "foot";
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
home-manager.users.moritz = {
|
||||||
|
programs.foot = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
main = {
|
||||||
|
term = "xterm-256color";
|
||||||
|
font = "FiraCode Nerd Font:size=10";
|
||||||
|
};
|
||||||
|
colors = {
|
||||||
|
alpha = 0.98;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -1,6 +1,5 @@
|
||||||
{ config
|
{ config
|
||||||
, lib
|
, lib
|
||||||
, pkgs
|
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -30,18 +29,24 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
my.shell.abbreviations = {
|
my.shell.abbreviations = {
|
||||||
|
g = "git";
|
||||||
|
gC = "git clone";
|
||||||
|
gF = "git pull";
|
||||||
|
gS = "git switch";
|
||||||
ga = "git add";
|
ga = "git add";
|
||||||
gap = "git add --patch";
|
gap = "git add --patch";
|
||||||
gr = "git restore";
|
|
||||||
grp = "git restore --patch";
|
|
||||||
gb = "git branch";
|
gb = "git branch";
|
||||||
gc = "git commit";
|
gc = "git commit";
|
||||||
gco = "git checkout";
|
gco = "git checkout";
|
||||||
gd = "git diff";
|
gd = "git diff";
|
||||||
gds = "git diff --staged";
|
gds = "git diff --staged";
|
||||||
gp = "git push";
|
|
||||||
gf = "git fetch";
|
gf = "git fetch";
|
||||||
gF = "git pull";
|
gp = "git push";
|
||||||
|
gr = "git restore";
|
||||||
|
grm = "git rm --cached";
|
||||||
|
grp = "git restore --patch";
|
||||||
|
grps = "git restore --patch --staged";
|
||||||
|
grs = "git restore --staged";
|
||||||
gs = "git status";
|
gs = "git status";
|
||||||
};
|
};
|
||||||
home-manager.users.moritz = {
|
home-manager.users.moritz = {
|
||||||
|
@ -50,21 +55,23 @@ in
|
||||||
userName = cfg.identity.name;
|
userName = cfg.identity.name;
|
||||||
userEmail = cfg.identity.email;
|
userEmail = cfg.identity.email;
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
|
commit.verbose = true;
|
||||||
|
diff.algorithm = "histogram";
|
||||||
|
fetch.fsckobjects = true;
|
||||||
init.defaultBranch = "main";
|
init.defaultBranch = "main";
|
||||||
merge.conflictstyle = "zdiff3";
|
merge.conflictstyle = "zdiff3";
|
||||||
diff.external = getExe pkgs.difftastic;
|
|
||||||
push.autoSetupRemote = true;
|
push.autoSetupRemote = true;
|
||||||
|
receive.fsckObjects = true;
|
||||||
|
transfer.fsckobjects = true;
|
||||||
};
|
};
|
||||||
signing = mkIf cfg.signing {
|
signing = mkIf cfg.signing {
|
||||||
key = "0x970C6E89EB0547A9";
|
key = "0x970C6E89EB0547A9";
|
||||||
signByDefault = true;
|
signByDefault = true;
|
||||||
};
|
};
|
||||||
lfs.enable = true;
|
lfs.enable = true;
|
||||||
|
delta.enable = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
programs.git = {
|
programs.git.enable = true;
|
||||||
enable = true;
|
|
||||||
config.safe.directory = "/home/moritz/.dotfiles";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
{ config
|
||||||
|
, pkgs
|
||||||
|
, lib
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkEnableOption mkIf mkOption types;
|
||||||
|
|
||||||
|
cfg = config.my.programs.gitbutler;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.programs.gitbutler = {
|
||||||
|
enable = mkEnableOption "gitbutler";
|
||||||
|
package = mkOption {
|
||||||
|
default = pkgs.callPackage ./package.nix { };
|
||||||
|
type = types.package;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = [ cfg.package ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
{ fetchzip, appimageTools }:
|
||||||
|
|
||||||
|
let
|
||||||
|
pname = "git-butler";
|
||||||
|
version = "0.12.4";
|
||||||
|
buildNum = "994";
|
||||||
|
|
||||||
|
srcZipped = fetchzip {
|
||||||
|
url = "https://releases.gitbutler.com/releases/release/${version}-${buildNum}/linux/x86_64/git-butler_${version}_amd64.AppImage.tar.gz";
|
||||||
|
hash = "sha256-+QP+H0bVSLbobv/W6lFBbl08RnwKvG8BVo68bwMrAzM=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
appimageTools.wrapType2 {
|
||||||
|
inherit pname version;
|
||||||
|
src = "${srcZipped}/git-butler_${version}_amd64.AppImage";
|
||||||
|
}
|
|
@ -20,10 +20,7 @@ in
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
hardware = {
|
hardware = {
|
||||||
opengl = {
|
opengl.enable = true;
|
||||||
enable = true;
|
|
||||||
driSupport = true;
|
|
||||||
};
|
|
||||||
pulseaudio.enable = false;
|
pulseaudio.enable = false;
|
||||||
};
|
};
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
|
|
|
@ -3,10 +3,18 @@
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) concatStringsSep flip boolToString mapAttrsToList;
|
||||||
cfg = config.my.programs.hyprland;
|
cfg = config.my.programs.hyprland;
|
||||||
|
|
||||||
|
mkMonitor = { name, resolution, position, scale, disabled, extra }:
|
||||||
|
if disabled
|
||||||
|
then "monitor=${name},disabled"
|
||||||
|
else "monitor=${name},${resolution},${position},${scale},${extra}";
|
||||||
|
|
||||||
|
monitorsList = mapAttrsToList (name: value: { name = name; } // value) cfg.monitors;
|
||||||
|
monitors = map mkMonitor monitorsList;
|
||||||
|
|
||||||
mkRule = rule: windowRegexes: "windowrulev2 = ${rule},${concatStringsSep "," windowRegexes}";
|
mkRule = rule: windowRegexes: "windowrulev2 = ${rule},${concatStringsSep "," windowRegexes}";
|
||||||
mkRules = rules: windowRegexes: concatStringsSep "\n" (map (flip mkRule windowRegexes) rules);
|
mkRules = rules: windowRegexes: concatStringsSep "\n" (map (flip mkRule windowRegexes) rules);
|
||||||
in
|
in
|
||||||
|
@ -17,17 +25,14 @@ in
|
||||||
#
|
#
|
||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||||
${concatLines (map (x: "monitor=${x}") cfg.monitors)}
|
${concatStringsSep "\n" monitors}
|
||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||||
|
|
||||||
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
|
# For all categories, see https://wiki.hyprland.org/Configuring/Variables/
|
||||||
input {
|
input {
|
||||||
kb_layout = ${concatStringsSep "," cfg.keyboardLayouts}
|
kb_layout = ${concatStringsSep "," cfg.keyboardLayouts}
|
||||||
kb_variant =
|
|
||||||
kb_model =
|
|
||||||
kb_options = grp:win_space_toggle,caps:escape
|
kb_options = grp:win_space_toggle,caps:escape
|
||||||
kb_rules =
|
|
||||||
|
|
||||||
follow_mouse = 1
|
follow_mouse = 1
|
||||||
|
|
||||||
|
@ -47,11 +52,13 @@ in
|
||||||
col.active_border = rgba(1affffee)
|
col.active_border = rgba(1affffee)
|
||||||
col.inactive_border = rgba(595959aa)
|
col.inactive_border = rgba(595959aa)
|
||||||
|
|
||||||
cursor_inactive_timeout = 1
|
|
||||||
|
|
||||||
layout = dwindle
|
layout = dwindle
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cursor {
|
||||||
|
inactive_timeout = 1
|
||||||
|
}
|
||||||
|
|
||||||
decoration {
|
decoration {
|
||||||
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
# See https://wiki.hyprland.org/Configuring/Variables/ for more
|
||||||
|
|
||||||
|
@ -102,7 +109,7 @@ in
|
||||||
master {
|
master {
|
||||||
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
# See https://wiki.hyprland.org/Configuring/Master-Layout/ for more
|
||||||
no_gaps_when_only = true
|
no_gaps_when_only = true
|
||||||
new_is_master = false
|
new_on_top = false
|
||||||
}
|
}
|
||||||
|
|
||||||
gestures {
|
gestures {
|
||||||
|
@ -111,21 +118,28 @@ in
|
||||||
}
|
}
|
||||||
|
|
||||||
misc {
|
misc {
|
||||||
# disable_hypr_chan = true
|
vrr = 0
|
||||||
vrr = 1
|
|
||||||
mouse_move_enables_dpms = true
|
mouse_move_enables_dpms = true
|
||||||
key_press_enables_dpms = true
|
key_press_enables_dpms = true
|
||||||
|
force_default_wallpaper = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
xwayland {
|
||||||
|
force_zero_scaling = true
|
||||||
|
}
|
||||||
|
|
||||||
|
# scale non native wayland gtk applications
|
||||||
|
env = GDK_SCALE,1.2
|
||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more
|
||||||
# Firefox Sharing Indicator
|
# Firefox Sharing Indicator
|
||||||
${mkRules ["float" "move 49% 40" "noborder" "nofullscreenrequest"] ["title:^(.*Sharing Indicator.*)$"]}
|
${mkRules ["float" "move 49% 40" "noborder"] ["title:^(.*Sharing Indicator.*)$"]}
|
||||||
|
|
||||||
# Emacs
|
# Emacs
|
||||||
windowrulev2 = opaque, class:^(emacs)$
|
windowrulev2 = opaque, class:^(emacs)$
|
||||||
|
|
||||||
# Fullscreen Applications
|
# Fullscreen Applications
|
||||||
${mkRules ["opaque" "noblur" "noborder" "noshadow" "forceinput"] ["fullscreen:1"]}
|
${mkRules ["opaque" "noblur" "noborder" "noshadow" "allowsinput"] ["fullscreen:1"]}
|
||||||
|
|
||||||
${mkRules ["tile" "opaque"] ["class:^(neovide)$"]}
|
${mkRules ["tile" "opaque"] ["class:^(neovide)$"]}
|
||||||
|
|
||||||
|
@ -133,7 +147,7 @@ in
|
||||||
windowrulev2 = rounding 0, xwayland:1, floating:1
|
windowrulev2 = rounding 0, xwayland:1, floating:1
|
||||||
windowrulev2 = center, class:^(.*jetbrains.*)$, title:^(Confirm Exit|Open Project|win424|win201|splash)$
|
windowrulev2 = center, class:^(.*jetbrains.*)$, title:^(Confirm Exit|Open Project|win424|win201|splash)$
|
||||||
windowrulev2 = size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$
|
windowrulev2 = size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$
|
||||||
${mkRules ["opaque" "noshadow" "noblur" "noanim" "move cursor 5 5"] ["class:^(.*jetbrains-.*)$"]}
|
windowrulev2 = nofocus, class:^jetbrains-(?!toolbox), floating:1, title:^win\d+$
|
||||||
|
|
||||||
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
# See https://wiki.hyprland.org/Configuring/Keywords/ for more
|
||||||
$mainMod = SUPER
|
$mainMod = SUPER
|
||||||
|
@ -154,6 +168,7 @@ in
|
||||||
bind = $mainMod , D , exec , hyprctl keyword general:layout dwindle
|
bind = $mainMod , D , exec , hyprctl keyword general:layout dwindle
|
||||||
bind = $mainMod , M , exec , hyprctl keyword general:layout master
|
bind = $mainMod , M , exec , hyprctl keyword general:layout master
|
||||||
bind = $mainMod , R , exec , rofi -show combi
|
bind = $mainMod , R , exec , rofi -show combi
|
||||||
|
# bind = $mainMod , RETURN , exec , systemctl --user is-active --quiet foot && footclient --no-wait || foot
|
||||||
bind = $mainMod , RETURN , exec , kitty
|
bind = $mainMod , RETURN , exec , kitty
|
||||||
|
|
||||||
# XF86 keys
|
# XF86 keys
|
||||||
|
@ -165,57 +180,65 @@ in
|
||||||
bind = , XF86AudioPrev , exec , playerctl -p "spotifyd,firefox" previous
|
bind = , XF86AudioPrev , exec , playerctl -p "spotifyd,firefox" previous
|
||||||
|
|
||||||
# Move focus with mainMod + hjkl
|
# Move focus with mainMod + hjkl
|
||||||
binde = $mainMod, H, movefocus, l
|
binde = $mainMod , H , movefocus , l
|
||||||
binde = $mainMod, L, movefocus, r
|
binde = $mainMod , L , movefocus , r
|
||||||
binde = $mainMod, K, movefocus, u
|
binde = $mainMod , K , movefocus , u
|
||||||
binde = $mainMod, J, movefocus, d
|
binde = $mainMod , J , movefocus , d
|
||||||
|
|
||||||
# Change current active window size with mainMod + SHIFT + hjkl
|
# Change current active window size with mainMod + SHIFT + hjkl
|
||||||
binde = $mainMod SHIFT, H, resizeactive, -10 0
|
binde = $mainMod SHIFT , H , resizeactive , -10 0
|
||||||
binde = $mainMod SHIFT, J, resizeactive, 0 10
|
binde = $mainMod SHIFT , J , resizeactive , 0 10
|
||||||
binde = $mainMod SHIFT, K, resizeactive, 0 -10
|
binde = $mainMod SHIFT , K , resizeactive , 0 -10
|
||||||
binde = $mainMod SHIFT, L, resizeactive, 10 0
|
binde = $mainMod SHIFT , L , resizeactive , 10 0
|
||||||
|
|
||||||
# Move current active window with mainMod + ALT + hjkl
|
# Move current active window with mainMod + ALT + hjkl
|
||||||
bind = $mainMod ALT, H, movewindow, l
|
bind = $mainMod ALT , H , movewindow , l
|
||||||
bind = $mainMod ALT, J, movewindow, d
|
bind = $mainMod ALT , J , movewindow , d
|
||||||
bind = $mainMod ALT, K, movewindow, u
|
bind = $mainMod ALT , K , movewindow , u
|
||||||
bind = $mainMod ALT, L, movewindow, r
|
bind = $mainMod ALT , L , movewindow , r
|
||||||
|
|
||||||
# Switch workspaces with mainMod + [0-9]
|
# Switch workspaces with mainMod + [0-9]
|
||||||
bind = $mainMod, 1, workspace, 1
|
bind = $mainMod , 1 , workspace , 1
|
||||||
bind = $mainMod, 2, workspace, 2
|
bind = $mainMod , 2 , workspace , 2
|
||||||
bind = $mainMod, 3, workspace, 3
|
bind = $mainMod , 3 , workspace , 3
|
||||||
bind = $mainMod, 4, workspace, 4
|
bind = $mainMod , 4 , workspace , 4
|
||||||
bind = $mainMod, 5, workspace, 5
|
bind = $mainMod , 5 , workspace , 5
|
||||||
bind = $mainMod, 6, workspace, 6
|
bind = $mainMod , 6 , workspace , 6
|
||||||
bind = $mainMod, 7, workspace, 7
|
bind = $mainMod , 7 , workspace , 7
|
||||||
bind = $mainMod, 8, workspace, 8
|
bind = $mainMod , 8 , workspace , 8
|
||||||
bind = $mainMod, 9, workspace, 9
|
bind = $mainMod , 9 , workspace , 9
|
||||||
bind = $mainMod, 0, workspace, 10
|
bind = $mainMod , 0 , workspace , 10
|
||||||
|
|
||||||
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
# Move active window to a workspace with mainMod + SHIFT + [0-9]
|
||||||
bind = $mainMod SHIFT, 1, movetoworkspace, 1
|
bind = $mainMod SHIFT , 1 , movetoworkspace , 1
|
||||||
bind = $mainMod SHIFT, 2, movetoworkspace, 2
|
bind = $mainMod SHIFT , 2 , movetoworkspace , 2
|
||||||
bind = $mainMod SHIFT, 3, movetoworkspace, 3
|
bind = $mainMod SHIFT , 3 , movetoworkspace , 3
|
||||||
bind = $mainMod SHIFT, 4, movetoworkspace, 4
|
bind = $mainMod SHIFT , 4 , movetoworkspace , 4
|
||||||
bind = $mainMod SHIFT, 5, movetoworkspace, 5
|
bind = $mainMod SHIFT , 5 , movetoworkspace , 5
|
||||||
bind = $mainMod SHIFT, 6, movetoworkspace, 6
|
bind = $mainMod SHIFT , 6 , movetoworkspace , 6
|
||||||
bind = $mainMod SHIFT, 7, movetoworkspace, 7
|
bind = $mainMod SHIFT , 7 , movetoworkspace , 7
|
||||||
bind = $mainMod SHIFT, 8, movetoworkspace, 8
|
bind = $mainMod SHIFT , 8 , movetoworkspace , 8
|
||||||
bind = $mainMod SHIFT, 9, movetoworkspace, 9
|
bind = $mainMod SHIFT , 9 , movetoworkspace , 9
|
||||||
bind = $mainMod SHIFT, 0, movetoworkspace, 10
|
bind = $mainMod SHIFT , 0 , movetoworkspace , 10
|
||||||
|
|
||||||
# Scroll through existing workspaces with mainMod + scroll
|
# Scroll through existing workspaces with mainMod + scroll
|
||||||
bind = $mainMod, mouse_down, workspace, e+1
|
bind = $mainMod , mouse_down , workspace , e+1
|
||||||
bind = $mainMod, mouse_up, workspace, e-1
|
bind = $mainMod , mouse_up , workspace , e-1
|
||||||
|
|
||||||
# Move/resize windows with mainMod + LMB/RMB and dragging
|
# Move/resize windows with mainMod + LMB/RMB and dragging
|
||||||
bindm = $mainMod, mouse:272, movewindow
|
bindm = $mainMod , mouse:272 , movewindow
|
||||||
bindm = $mainMod, mouse:273, resizewindow
|
bindm = $mainMod , mouse:273 , resizewindow
|
||||||
|
|
||||||
# Toggle waybar
|
# Toggle waybar
|
||||||
bindr = $mainMod, SUPER_L, exec, pkill -USR1 waybar
|
bindr = $mainMod , SUPER_L , exec , pkill -USR1 waybar
|
||||||
|
|
||||||
|
# Lid open/close
|
||||||
|
bindl=,switch:on:Lid Switch,exec,monitors="$(hyprctl monitors | grep -c '^Monitor')" && hyprctl keyword monitor "eDP-1, disable" && [ "$monitors" = 1 ] && loginctl lock-session
|
||||||
|
bindl=,switch:off:Lid Switch,exec, hyprctl keyword monitor "eDP-1, preferred, auto"
|
||||||
|
|
||||||
|
|
||||||
|
# Lock Screen
|
||||||
|
bind=$mainMod ALT, L, exec, loginctl lock-session
|
||||||
|
|
||||||
# Extra Config
|
# Extra Config
|
||||||
${cfg.extraConfig}
|
${cfg.extraConfig}
|
||||||
|
|
|
@ -5,12 +5,11 @@
|
||||||
, ...
|
, ...
|
||||||
} @ args:
|
} @ args:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) mkOption mkEnableOption mkIf types getExe genAttrs optionalAttrs optional;
|
||||||
cfg = config.my.programs.hyprland;
|
cfg = config.my.programs.hyprland;
|
||||||
|
|
||||||
hyprland-nvidia = pkgs.hyprland.override { enableNvidiaPatches = true; };
|
hyprland = inputs.hyprland.packages.${pkgs.system}.default;
|
||||||
hyprland = if cfg.nvidiaSupport then hyprland-nvidia else pkgs.hyprland;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.programs.hyprland = {
|
options.my.programs.hyprland = {
|
||||||
|
@ -32,9 +31,35 @@ in
|
||||||
default = [ "de" "us" ];
|
default = [ "de" "us" ];
|
||||||
};
|
};
|
||||||
monitors = mkOption {
|
monitors = mkOption {
|
||||||
|
type = types.attrsOf (
|
||||||
|
let
|
||||||
|
sub = types.submodule {
|
||||||
|
options = {
|
||||||
|
resolution = mkOption {
|
||||||
|
type = types.strMatching "\(preferred\)|\([[:digit:]]+x[[:digit:]]+\(@[[:digit:]]+\)\?\)";
|
||||||
|
default = "preferred";
|
||||||
|
};
|
||||||
|
position = mkOption {
|
||||||
|
type = types.strMatching "\(auto\)|\(-\?[[:digit:]]+x-?[[:digit:]]+\)";
|
||||||
|
default = "auto";
|
||||||
|
};
|
||||||
|
disabled = mkEnableOption "disabled";
|
||||||
|
scale = mkOption {
|
||||||
|
type = types.oneOf [ types.float (types.strMatching "auto") ];
|
||||||
|
default = 1.0;
|
||||||
|
apply = x: if lib.isFloat x then lib.strings.floatToString x else x;
|
||||||
|
};
|
||||||
|
extra = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
description = "monitor settings";
|
default = [ ];
|
||||||
default = [ ",preferred,auto,1" ];
|
apply = lib.concatStringsSep ",";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
sub
|
||||||
|
);
|
||||||
|
description = "monitor setting";
|
||||||
};
|
};
|
||||||
extraConfig = mkOption {
|
extraConfig = mkOption {
|
||||||
type = types.str;
|
type = types.str;
|
||||||
|
@ -44,37 +69,63 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
my = {
|
my = {
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
inputs.hypr-contrib.overlays.default
|
||||||
|
];
|
||||||
programs = {
|
programs = {
|
||||||
wallpaper.enable = true;
|
wallpaper.enable = true;
|
||||||
|
# foot.enable = true;
|
||||||
kitty.enable = true;
|
kitty.enable = true;
|
||||||
rofi.enable = true;
|
rofi.enable = true;
|
||||||
|
hyprland.monitors."" = lib.mkDefault { };
|
||||||
|
hyprland.monitors."Unknown-1" = { disabled = true; };
|
||||||
};
|
};
|
||||||
wallpapers.enable = true;
|
wallpapers.enable = true;
|
||||||
services.dunst.enable = true;
|
services = {
|
||||||
services.wallpaper.enable = true;
|
dunst.enable = true;
|
||||||
|
wallpaper = {
|
||||||
|
enable = true;
|
||||||
|
target = "hyprland-session.target";
|
||||||
|
};
|
||||||
|
spotify-player.target = "hyprland-session.target";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.hyprland = {
|
||||||
|
enable = true;
|
||||||
|
package = hyprland;
|
||||||
|
portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.moritz = {
|
home-manager.users.moritz = {
|
||||||
|
|
||||||
# import home-manager module
|
|
||||||
imports = [ inputs.hyprland.homeManagerModules.default ];
|
|
||||||
|
|
||||||
# enable home-manager module
|
# enable home-manager module
|
||||||
wayland.windowManager.hyprland = {
|
wayland.windowManager.hyprland = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = hyprland;
|
|
||||||
recommendedEnvironment = true;
|
|
||||||
extraConfig = import ./_config.nix args;
|
extraConfig = import ./_config.nix args;
|
||||||
|
systemd.extraCommands = [
|
||||||
|
"systemctl --user stop hyprland-session.target"
|
||||||
|
"sleep 1.5"
|
||||||
|
"systemctl --user start hyprland-session.target"
|
||||||
|
"systemctl --user start xdg-desktop-portal-hyprland.service"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
# add waybar as a status bar
|
# add waybar as a status bar
|
||||||
programs.waybar = {
|
programs.waybar = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
package = pkgs.waybar.overrideAttrs (old: {
|
||||||
|
patches = old.patches or [ ] ++ [
|
||||||
|
(pkgs.fetchpatch {
|
||||||
|
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/waybar/-/raw/0306af03fcb6de6aee1e288f42b0bf1b223513bd/a544f4b2cdcf632f1a4424b89f6e3d85ef5aaa85.patch";
|
||||||
|
sha256 = "sha256-S/1oUj9Aj6BElNTsDY8CTcKtS1j7Gl54JFgCywH05pg=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
# start using systemd service
|
# start using systemd service
|
||||||
systemd = {
|
systemd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
target = "graphical-session.target";
|
target = "hyprland-session.target";
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
@ -82,7 +133,7 @@ in
|
||||||
start_hidden = true;
|
start_hidden = true;
|
||||||
layer = "top";
|
layer = "top";
|
||||||
position = "top";
|
position = "top";
|
||||||
height = 20;
|
height = 24;
|
||||||
modules-left = [ "hyprland/workspaces" ];
|
modules-left = [ "hyprland/workspaces" ];
|
||||||
modules-center = [ "hyprland/window" ];
|
modules-center = [ "hyprland/window" ];
|
||||||
modules-right = [ "hyprland/language" "network" "memory" "cpu" "battery" "clock" ];
|
modules-right = [ "hyprland/language" "network" "memory" "cpu" "battery" "clock" ];
|
||||||
|
@ -135,29 +186,11 @@ in
|
||||||
};
|
};
|
||||||
systemdTarget = "hyprland-session.target";
|
systemdTarget = "hyprland-session.target";
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.user.services.nextcloud-client.Service = {
|
|
||||||
RestartSec = "500ms";
|
|
||||||
Restart = "on-failure";
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
# adds pam module for swaylock
|
# adds pam module for swaylock
|
||||||
security.pam.services.swaylock = { };
|
security.pam.services.swaylock = { };
|
||||||
|
|
||||||
# only consider graphical-session.target started when hyprland-sesstion.target is reached
|
|
||||||
systemd.user.targets.hyprland-session = {
|
|
||||||
partOf = [ "graphical-session.target" ];
|
|
||||||
wantedBy = [ "graphical-session.target" ];
|
|
||||||
before = [ "graphical-session.target" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.services.xdg-desktop-portal-hyprland = {
|
|
||||||
after = [ "hyrpland-session.target" ];
|
|
||||||
requiredBy = [ "xdg-desktop-portal.service" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# add user packages for wayland and hyprland in particular
|
# add user packages for wayland and hyprland in particular
|
||||||
users.users.moritz.packages = with pkgs; [
|
users.users.moritz.packages = with pkgs; [
|
||||||
brightnessctl # control brightness
|
brightnessctl # control brightness
|
||||||
|
@ -190,7 +223,6 @@ in
|
||||||
__GL_VRR_ALLOWED = "0";
|
__GL_VRR_ALLOWED = "0";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
services = {
|
services = {
|
||||||
dbus.enable = true;
|
dbus.enable = true;
|
||||||
# use pipewire (needed for screensharing)
|
# use pipewire (needed for screensharing)
|
||||||
|
@ -200,27 +232,39 @@ in
|
||||||
alsa.support32Bit = true;
|
alsa.support32Bit = true;
|
||||||
pulse.enable = true;
|
pulse.enable = true;
|
||||||
};
|
};
|
||||||
xserver = {
|
|
||||||
enable = true;
|
|
||||||
displayManager = {
|
displayManager = {
|
||||||
lightdm.enable = true;
|
enable = true;
|
||||||
autoLogin = {
|
autoLogin = {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "moritz";
|
user = "moritz";
|
||||||
};
|
};
|
||||||
defaultSession = "hyprland";
|
defaultSession = "hyprland";
|
||||||
sessionPackages = [ hyprland ]; # can't set the defaultSession otherwise
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
xserver.enable = true;
|
||||||
|
xserver.displayManager.lightdm.enable = true;
|
||||||
};
|
};
|
||||||
security.rtkit.enable = true;
|
security.rtkit.enable = true;
|
||||||
|
|
||||||
|
home-manager.users.moritz.systemd.user.services =
|
||||||
# desktop portal (for screensharing)
|
let
|
||||||
xdg.portal = {
|
units = [ "waybar" ];
|
||||||
enable = true;
|
mkAfter = _: {
|
||||||
wlr.enable = mkForce false;
|
Unit = {
|
||||||
extraPortals = [ pkgs.xdg-desktop-portal-hyprland ];
|
After = [ "hyprland-session.target" ];
|
||||||
|
Wants = [ "hyprland-session.target" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
in
|
||||||
|
genAttrs units mkAfter;
|
||||||
|
|
||||||
|
systemd.user.services =
|
||||||
|
let
|
||||||
|
units = [ "pipewire" "xdg-desktop-portal" "xdg-desktop-portal-hyprland" "wireplumber" ];
|
||||||
|
mkAfter = _: {
|
||||||
|
after = [ "hyprland-session.target" ];
|
||||||
|
wants = [ "hyprland-session.target" ];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
genAttrs units mkAfter;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,38 @@
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) any filterAttrs mapAttrsToList mkEnableOption mkIf mkOption;
|
||||||
|
|
||||||
|
cfg = config.my.programs.jetbrains;
|
||||||
|
isEnabled = _: value: value.enable;
|
||||||
|
anyEnabled = any (x: x) (mapAttrsToList isEnabled cfg);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.programs.jetbrains = {
|
||||||
|
pycharm = {
|
||||||
|
enable = mkEnableOption "pycharm";
|
||||||
|
package = mkOption {
|
||||||
|
default = pkgs.jetbrains.pycharm-community;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
idea = {
|
||||||
|
enable = mkEnableOption "idea";
|
||||||
|
package = mkOption {
|
||||||
|
default = pkgs.jetbrains.idea-community;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf anyEnabled {
|
||||||
|
home-manager.users.moritz = {
|
||||||
|
xdg.configFile."ideavim/ideavimrc" = {
|
||||||
|
source = ./ideavimrc;
|
||||||
|
};
|
||||||
|
home.packages =
|
||||||
|
let
|
||||||
|
enabledPackages = filterAttrs isEnabled cfg;
|
||||||
|
in
|
||||||
|
mapAttrsToList (_: value: value.package) enabledPackages;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,90 @@
|
||||||
|
""" Map leader to space ---------------------
|
||||||
|
let mapleader=" "
|
||||||
|
|
||||||
|
""" Plugins --------------------------------
|
||||||
|
set surround
|
||||||
|
set commentary
|
||||||
|
set NERDTree
|
||||||
|
|
||||||
|
""" Common settings -------------------------
|
||||||
|
set showmode
|
||||||
|
set so=5
|
||||||
|
set incsearch
|
||||||
|
set nu
|
||||||
|
set relativenumber
|
||||||
|
set number
|
||||||
|
|
||||||
|
""" Which-Key
|
||||||
|
set which-key
|
||||||
|
set timeoutlen=5000
|
||||||
|
|
||||||
|
""" Idea specific settings ------------------
|
||||||
|
set ideajoin
|
||||||
|
|
||||||
|
""" Mappings --------------------------------
|
||||||
|
"" Quick action
|
||||||
|
let g:WhichKeyDesc_quick_action = '<leader>q Quick action'
|
||||||
|
map <leader>q <Action>(ShowIntentionActions)
|
||||||
|
|
||||||
|
"" Refactor binds
|
||||||
|
let g:WhichKeyDesc_inline = '<leader>i Inline'
|
||||||
|
map <leader>i <Action>(Inline)
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_extract = '<leader>e Extract'
|
||||||
|
let g:WhichKeyDesc_extract_variable = '<leader>ev Extract variable'
|
||||||
|
map <leader>ev <Action>(IntroduceVariable)
|
||||||
|
let g:WhichKeyDesc_extract_constant = '<leader>ec Extract constant'
|
||||||
|
map <leader>ec <Action>(IntroduceConstant)
|
||||||
|
let g:WhichKeyDesc_extract_field = '<leader>ef Extract field'
|
||||||
|
map <leader>ef <Action>(IntroduceField)
|
||||||
|
let g:WhichKeyDesc_extract_parameter = '<leader>ep Extract parameter'
|
||||||
|
map <leader>ep <Action>(IntroduceParameter)
|
||||||
|
let g:WhichKeyDesc_extract_method = '<leader>em Extract method'
|
||||||
|
map <leader>em <Action>(ExtractMethod)
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_rename = '<leader>r Rename'
|
||||||
|
map <leader>r <Action>(RenameElement)
|
||||||
|
|
||||||
|
"" Navigation
|
||||||
|
let g:WhichKeyDesc_prev_buffer = ']b Previous buffer'
|
||||||
|
map [b <Action>(PreviousTab)
|
||||||
|
let g:WhichKeyDesc_next_buffer = ']b Next buffer'
|
||||||
|
map ]b <Action>(NextTab)
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_goto_impl = 'gI Goto implementation'
|
||||||
|
map gI <Action>(GotoImplementation)
|
||||||
|
let g:WhichKeyDesc_goto_type = 'gt Goto type declaration'
|
||||||
|
map gt <Action>(GotoTypeDeclaration)
|
||||||
|
|
||||||
|
"" Other
|
||||||
|
let g:WhichKeyDesc_terminal = '<leader>t Terminal'
|
||||||
|
map <leader>t <Action>(ActivateTerminalToolWindow)
|
||||||
|
map = <Action>(ReformatCode)
|
||||||
|
|
||||||
|
"" Folding
|
||||||
|
let g:WhichKeyDesc_folding = 'z Folding'
|
||||||
|
let g:WhichKeyDesc_folding_toggle = 'za Toggle fold'
|
||||||
|
map za <Action>(ExpandCollapseToggleAction)
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_folding_expand = 'zr Fold less'
|
||||||
|
map zr <Action>(ExpandRegion)
|
||||||
|
let g:WhichKeyDesc_folding_collapse = 'zR Open all folds'
|
||||||
|
map zR <Action>(ExpandAllRegions)
|
||||||
|
let g:WhichKeyDesc_folding_collapse = 'zm Fold more'
|
||||||
|
map zm <Action>(CollapseRegion)
|
||||||
|
let g:WhichKeyDesc_folding_collapse = 'zM Close all folds'
|
||||||
|
map zM <Action>(CollapseAllRegions)
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_folding_collapse_doc = 'zc Collapse doc comments'
|
||||||
|
map zc <Action>(CollapseDocComments)
|
||||||
|
let g:WhichKeyDesc_folding_expand_doc = 'zC Expand doc comments'
|
||||||
|
map zC <Action>(ExpandDocComments)
|
||||||
|
|
||||||
|
let g:WhichKeyDesc_folding_expand_level_one = 'z1 Expand all to level 1'
|
||||||
|
map z1 <Action>(ExpandAllToLevel1)
|
||||||
|
let g:WhichKeyDesc_folding_expand_level_two = 'z2 Expand all to level 2'
|
||||||
|
map z2 <Action>(ExpandAllToLevel2)
|
||||||
|
let g:WhichKeyDesc_folding_expand_level_three = 'z3 Expand all to level 3'
|
||||||
|
map z3 <Action>(ExpandAllToLevel3)
|
||||||
|
let g:WhichKeyDesc_folding_expand_level_four = 'z4 Expand all to level 4'
|
||||||
|
map z4 <Action>(ExpandAllToLevel4)
|
|
@ -22,13 +22,15 @@ in
|
||||||
window_padding_width = 3;
|
window_padding_width = 3;
|
||||||
confirm_os_window_close = 0;
|
confirm_os_window_close = 0;
|
||||||
background_opacity = "0.9";
|
background_opacity = "0.9";
|
||||||
|
font_features = "IntelOneMono-Regular +ss01";
|
||||||
|
resize_in_steps = "yes";
|
||||||
};
|
};
|
||||||
keybindings = {
|
keybindings = {
|
||||||
"ctrl+plus" = "change_font_size all +2.0";
|
"ctrl+plus" = "change_font_size all +2.0";
|
||||||
"ctrl+minus" = "change_font_size all -2.0";
|
"ctrl+minus" = "change_font_size all -2.0";
|
||||||
};
|
};
|
||||||
font = {
|
font = {
|
||||||
name = "FiraCode Nerd Font";
|
name = "Intel One Mono";
|
||||||
size = 10;
|
size = 10;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,9 +6,16 @@
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) mkEnableOption mkOption types;
|
||||||
|
|
||||||
cfg = config.my.programs.nix;
|
cfg = config.my.programs.nix;
|
||||||
|
mkNom = system: nix:
|
||||||
|
inputs.nix-monitored.packages.${system}.default.override
|
||||||
|
{
|
||||||
|
withNotify = false;
|
||||||
|
nix = nix;
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.programs.nix = {
|
options.my.programs.nix = {
|
||||||
|
@ -23,10 +30,24 @@ in
|
||||||
optimise.enable = mkEnableOption "nix-optimise";
|
optimise.enable = mkEnableOption "nix-optimise";
|
||||||
};
|
};
|
||||||
|
|
||||||
config.nix = {
|
config = {
|
||||||
|
my.nixpkgs.overlays = [
|
||||||
|
(final: prev:
|
||||||
|
{
|
||||||
|
nixos-rebuild = prev.nixos-rebuild.override {
|
||||||
|
nix = mkNom final.system final.nix;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
home-manager.users.moritz.programs.direnv.nix-direnv.package = pkgs.nix-direnv.override {
|
||||||
|
nix = config.nix.package;
|
||||||
|
};
|
||||||
|
|
||||||
|
nix = {
|
||||||
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
|
||||||
|
|
||||||
package = pkgs.nix-super;
|
package = pkgs.nix;
|
||||||
|
|
||||||
extraOptions = "experimental-features = nix-command flakes";
|
extraOptions = "experimental-features = nix-command flakes";
|
||||||
|
|
||||||
|
@ -52,6 +73,7 @@ in
|
||||||
stable.flake = inputs.stable;
|
stable.flake = inputs.stable;
|
||||||
dotfiles.flake = self;
|
dotfiles.flake = self;
|
||||||
default.flake = self;
|
default.flake = self;
|
||||||
|
d.flake = self;
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
|
@ -65,4 +87,5 @@ in
|
||||||
trusted-users = [ "root" "@wheel" ];
|
trusted-users = [ "root" "@wheel" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{ config, lib, pkgs, ... }:
|
{ config, lib, pkgs, inputs, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) mkEnableOption mkIf readFile;
|
||||||
|
|
||||||
cfg = config.my.programs.nvim;
|
cfg = config.my.programs.nvim;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -11,17 +12,18 @@ in
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home-manager.users.moritz = {
|
home-manager.users.moritz = {
|
||||||
|
xdg.configFile."nvim/snippets" = {
|
||||||
|
recursive = true;
|
||||||
|
source = ./plugins/snippets;
|
||||||
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
(
|
xdotool # for vimtex
|
||||||
if config.my.programs.hyprland.enable
|
|
||||||
then neovide-hyprland
|
|
||||||
else neovide
|
|
||||||
)
|
|
||||||
];
|
];
|
||||||
|
|
||||||
programs.neovim = {
|
programs.neovim = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.neovim-nightly;
|
package = inputs.neovim-nightly-overlay.packages.${pkgs.system}.default;
|
||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
vimdiffAlias = true;
|
vimdiffAlias = true;
|
||||||
withNodeJs = true;
|
withNodeJs = true;
|
||||||
|
@ -29,23 +31,23 @@ in
|
||||||
extraPackages = with pkgs;
|
extraPackages = with pkgs;
|
||||||
[
|
[
|
||||||
alejandra
|
alejandra
|
||||||
black
|
checkmake
|
||||||
|
codespell
|
||||||
deadnix
|
deadnix
|
||||||
isort
|
dotenv-linter
|
||||||
|
fish
|
||||||
jq
|
jq
|
||||||
|
nil
|
||||||
nixd
|
nixd
|
||||||
nixpkgs-fmt
|
nixpkgs-fmt
|
||||||
nodePackages.bash-language-server
|
nodePackages.bash-language-server
|
||||||
rustfmt
|
python3Packages.python-lsp-server
|
||||||
shellcheck
|
shellcheck
|
||||||
shfmt
|
shfmt
|
||||||
|
stable.yamlfix
|
||||||
statix
|
statix
|
||||||
stylua
|
|
||||||
sumneko-lua-language-server
|
|
||||||
taplo
|
taplo
|
||||||
typst
|
yamllint
|
||||||
typst-lsp
|
|
||||||
yamlfmt
|
|
||||||
];
|
];
|
||||||
extraLuaConfig = readFile ./options.lua;
|
extraLuaConfig = readFile ./options.lua;
|
||||||
lazy.enable = true;
|
lazy.enable = true;
|
||||||
|
|
|
@ -26,6 +26,17 @@ vim.opt.updatetime = 300
|
||||||
vim.opt_local.spell = true
|
vim.opt_local.spell = true
|
||||||
vim.opt_local.spelllang = { "en", "de_20" } -- all English regions and new German spelling
|
vim.opt_local.spelllang = { "en", "de_20" } -- all English regions and new German spelling
|
||||||
|
|
||||||
|
-- Abbreviations for common typos
|
||||||
|
vim.cmd("cnoreabbrev W! w!")
|
||||||
|
vim.cmd("cnoreabbrev Q! q!")
|
||||||
|
vim.cmd("cnoreabbrev Qall! qall!")
|
||||||
|
vim.cmd("cnoreabbrev Wq wq")
|
||||||
|
vim.cmd("cnoreabbrev Wa wa")
|
||||||
|
vim.cmd("cnoreabbrev wQ wq")
|
||||||
|
vim.cmd("cnoreabbrev WQ wq")
|
||||||
|
vim.cmd("cnoreabbrev W w")
|
||||||
|
vim.cmd("cnoreabbrev Q q")
|
||||||
|
|
||||||
if vim.g.neovide then
|
if vim.g.neovide then
|
||||||
vim.opt.guifont = "Fira Code Nerd Font:h10"
|
vim.opt.guifont = "Fira Code Nerd Font:h10"
|
||||||
vim.g.neovide_scale_factor = 0.7
|
vim.g.neovide_scale_factor = 0.7
|
||||||
|
|
|
@ -1,145 +1,123 @@
|
||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, inputs, ... }:
|
||||||
|
|
||||||
with builtins;
|
let
|
||||||
|
inherit (builtins) readFile;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [
|
config.home-manager.users.moritz.programs.neovim.lazy.plugins = [
|
||||||
{
|
{
|
||||||
plugin = formatter-nvim;
|
plugin = pkgs.vimPlugins.oil-nvim;
|
||||||
cmd = [ "Format" "Fmt" ];
|
|
||||||
keys = [
|
|
||||||
{
|
|
||||||
key = "=";
|
|
||||||
cmd = "<cmd>Format<cr>";
|
|
||||||
desc = "format (formatter)";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
conf = readFile ./lua/formatter-nvim.lua;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = oil-nvim;
|
|
||||||
lazy = false;
|
lazy = false;
|
||||||
opts = { };
|
opts = { };
|
||||||
dependencies = [
|
dependencies = [{ plugin = pkgs.vimPlugins.nvim-web-devicons; }];
|
||||||
{ plugin = which-key-nvim; }
|
|
||||||
{ plugin = nvim-web-devicons; }
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = mini-nvim;
|
plugin = pkgs.vimPlugins.lualine-nvim;
|
||||||
|
opts = { };
|
||||||
|
dependencies = [{ plugin = pkgs.vimPlugins.nvim-web-devicons; }];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
plugin = pkgs.vimPlugins.mini-nvim;
|
||||||
lazy = false;
|
lazy = false;
|
||||||
conf = readFile ./lua/mini-nvim.lua;
|
conf = readFile ./lua/mini-nvim.lua;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = trouble-nvim;
|
plugin = pkgs.vimPlugins.nvim-cmp;
|
||||||
keys = [
|
keys = [
|
||||||
{ key = "<leader>xx"; cmd = "<cmd>TroubleToggle document_diagnostics<cr>"; desc = "Document Diagnostics (Trouble)"; }
|
{ key = "<leader>tc"; cmd = "<cmd>CmpToggle<cr>"; desc = "Toggle Cmp sources"; }
|
||||||
{ key = "<leader>xX"; cmd = "<cmd>TroubleToggle workspace_diagnostics<cr>"; desc = "Workspace Diagnostics (Troule)"; }
|
|
||||||
{ key = "<leader>xl"; cmd = "<cmd>TroubleToggle loclist<cr>"; desc = "Location List (Trouble)"; }
|
|
||||||
{ key = "<leader>xq"; cmd = "<cmd>TroubleToggle quickfix<cr>"; desc = "Quickfix List (Trouble)"; }
|
|
||||||
{ key = "<leader>xt"; cmd = "<cmd>TodoTrouble<cr>"; desc = "Todo (Trouble)"; }
|
|
||||||
{ key = "<leader>xT"; cmd = "<cmd>TodoTrouble keywords=TODO,FIX,FIXME<cr>"; desc = "Todo/Fix/Fixme (Trouble)"; }
|
|
||||||
{ key = "<leader>ft"; cmd = "<cmd>TodoTelescope<cr>"; desc = "Todo"; }
|
|
||||||
{
|
|
||||||
key = "[q";
|
|
||||||
func = /* lua */ ''
|
|
||||||
function()
|
|
||||||
if require("trouble").is_open() then
|
|
||||||
require("trouble").previous({ skip_groups = true, jump = true })
|
|
||||||
else
|
|
||||||
vim.cmd.cprev()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
desc = "Previous trouble/quickfix item";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "]q";
|
|
||||||
func = /* lua */ ''
|
|
||||||
function()
|
|
||||||
if require("trouble").is_open() then
|
|
||||||
require("trouble").next({ skip_groups = true, jump = true })
|
|
||||||
else
|
|
||||||
vim.cmd.cnext()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
desc = "Next trouble/quickfix item";
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
opts = { };
|
|
||||||
dependencies = [
|
|
||||||
{ plugin = which-key-nvim; }
|
|
||||||
{ plugin = nvim-web-devicons; }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = nvim-cmp;
|
|
||||||
conf = readFile ./lua/nvim-cmp.lua;
|
conf = readFile ./lua/nvim-cmp.lua;
|
||||||
event = [ "InsertEnter" ];
|
event = [ "InsertEnter" ];
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{
|
{
|
||||||
plugin = nvim-autopairs;
|
plugin = pkgs.vimPlugins.nvim-autopairs;
|
||||||
opts = { };
|
opts = { };
|
||||||
}
|
}
|
||||||
{ plugin = cmp-async-path; }
|
{ plugin = pkgs.vimPlugins.cmp-async-path; }
|
||||||
{ plugin = cmp-buffer; }
|
{ plugin = pkgs.vimPlugins.cmp-buffer; }
|
||||||
{ plugin = cmp-cmdline; }
|
{ plugin = pkgs.vimPlugins.cmp-cmdline; }
|
||||||
{ plugin = cmp-nvim-lsp; }
|
{ plugin = pkgs.vimPlugins.cmp-nvim-lsp-signature-help; }
|
||||||
{ plugin = cmp_luasnip; }
|
{ plugin = pkgs.vimPlugins.cmp-nvim-lsp; }
|
||||||
{
|
{
|
||||||
plugin = codeium-nvim;
|
plugin = pkgs.vimUtils.buildVimPlugin {
|
||||||
opts = { };
|
pname = "cmp-vimtex";
|
||||||
|
version = lib.my.mkVersionInput inputs.cmp-vimtex;
|
||||||
|
src = inputs.cmp-vimtex;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{ plugin = pkgs.vimPlugins.cmp_luasnip; }
|
||||||
|
# {
|
||||||
|
# plugin = pkgs.vimPlugins.copilot-cmp;
|
||||||
|
# opts = { };
|
||||||
|
# dependencies = [
|
||||||
|
# {
|
||||||
|
# plugin = pkgs.vimPlugins.copilot-lua;
|
||||||
|
# opts = {
|
||||||
|
# suggestion = { enabled = false; };
|
||||||
|
# panel = { enabled = false; };
|
||||||
|
# };
|
||||||
|
# conf = /* lua */ ''
|
||||||
|
# require("copilot").setup(opts)
|
||||||
|
# vim.cmd("Copilot disable")
|
||||||
|
# '';
|
||||||
|
# }
|
||||||
|
# ];
|
||||||
|
# }
|
||||||
|
{ plugin = pkgs.vimPlugins.friendly-snippets; }
|
||||||
|
{ plugin = pkgs.vimPlugins.lspkind-nvim; }
|
||||||
|
{
|
||||||
|
plugin = pkgs.vimPlugins.luasnip;
|
||||||
|
conf = readFile ./lua/luasnip.lua;
|
||||||
}
|
}
|
||||||
{ plugin = friendly-snippets; }
|
|
||||||
{ plugin = lspkind-nvim; }
|
|
||||||
{ plugin = luasnip; }
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = direnv-vim;
|
plugin = pkgs.vimPlugins.direnv-vim;
|
||||||
lazy = false;
|
lazy = false;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = nvim-lspconfig;
|
plugin = pkgs.vimPlugins.nvim-lspconfig.overrideAttrs (_: {
|
||||||
|
version = lib.my.mkVersionInput inputs.nvim-lspconfig;
|
||||||
|
src = inputs.nvim-lspconfig;
|
||||||
|
});
|
||||||
event = [ "BufRead" "BufNewFile" ];
|
event = [ "BufRead" "BufNewFile" ];
|
||||||
conf = readFile ./lua/nvim-lspconfig.lua;
|
conf = readFile ./lua/nvim-lspconfig.lua;
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ plugin = lsp_signature-nvim; }
|
|
||||||
{
|
{
|
||||||
plugin = null-ls-nvim;
|
# TODO: add all required tools to neovim or silence warnings
|
||||||
|
plugin = pkgs.vimPlugins.none-ls-nvim;
|
||||||
conf = readFile ./lua/null-ls-nvim.lua;
|
conf = readFile ./lua/null-ls-nvim.lua;
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ plugin = which-key-nvim; }
|
{
|
||||||
{ plugin = plenary-nvim; }
|
plugin = pkgs.vimUtils.buildVimPlugin {
|
||||||
|
pname = "none-ls-shellcheck.nvim";
|
||||||
|
version = lib.my.mkVersionInput inputs.none-ls-shellcheck-nvim;
|
||||||
|
src = inputs.none-ls-shellcheck-nvim;
|
||||||
|
};
|
||||||
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{ plugin = which-key-nvim; }
|
{ plugin = pkgs.vimPlugins.lsp_lines-nvim; }
|
||||||
{ plugin = lsp_lines-nvim; }
|
|
||||||
{
|
{
|
||||||
plugin = nvim-ufo;
|
plugin = pkgs.vimPlugins.inc-rename-nvim;
|
||||||
conf = readFile ./lua/nvim-ufo.lua;
|
|
||||||
dependencies = [
|
|
||||||
{ plugin = promise-async; }
|
|
||||||
];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = neodev-nvim;
|
|
||||||
conf = readFile ./lua/neodev-nvim.lua;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = inc-rename-nvim;
|
|
||||||
opts = {
|
opts = {
|
||||||
input_buffer_type = "dressing";
|
input_buffer_type = "dressing";
|
||||||
};
|
};
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ plugin = dressing-nvim; }
|
{ plugin = pkgs.vimPlugins.dressing-nvim; }
|
||||||
];
|
|
||||||
}
|
|
||||||
{ plugin = actions-preview-nvim; }
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = vim-fugitive;
|
plugin = pkgs.vimUtils.buildVimPlugin {
|
||||||
|
pname = "actions-preview-nvim";
|
||||||
|
version = lib.my.mkVersionInput inputs.actions-preview-nvim;
|
||||||
|
src = inputs.actions-preview-nvim;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
plugin = pkgs.vimPlugins.vim-fugitive;
|
||||||
cmd = [
|
cmd = [
|
||||||
"G"
|
"G"
|
||||||
"Git"
|
"Git"
|
||||||
|
@ -165,13 +143,16 @@ with builtins;
|
||||||
"GDelete"
|
"GDelete"
|
||||||
"GBrowse"
|
"GBrowse"
|
||||||
];
|
];
|
||||||
|
keys = [
|
||||||
|
{ key = "<leader>gg"; cmd = "<cmd>Gedit :<cr>"; desc = "Open Status"; }
|
||||||
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = vim-tmux-navigator;
|
plugin = pkgs.vimPlugins.vim-tmux-navigator;
|
||||||
event = [ "VeryLazy" ];
|
event = [ "VeryLazy" ];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = nvim-lastplace;
|
plugin = pkgs.vimPlugins.nvim-lastplace;
|
||||||
event = [ "BufReadPost" "BufNewFile" ];
|
event = [ "BufReadPost" "BufNewFile" ];
|
||||||
opts = {
|
opts = {
|
||||||
lastplace_ignore_buftype = [ "quickfix" "nofile" "help" ];
|
lastplace_ignore_buftype = [ "quickfix" "nofile" "help" ];
|
||||||
|
@ -180,135 +161,73 @@ with builtins;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = telescope-nvim;
|
plugin = pkgs.vimPlugins.telescope-nvim;
|
||||||
cmd = [ "Telescope" ];
|
cmd = [ "Telescope" ];
|
||||||
conf = builtins.readFile ./lua/telescope.lua;
|
conf = builtins.readFile ./lua/telescope.lua;
|
||||||
keys = [
|
keys = [
|
||||||
{ key = "<leader>ff"; cmd = "<cmd>Telescope find_files<cr>"; desc = "Find files"; }
|
{ key = "<leader>ff"; cmd = "<cmd>Telescope find_files<cr>"; desc = "Find files"; }
|
||||||
{ key = "<leader>fb"; cmd = "<cmd>Telescope buffers<cr>"; desc = "Find buffers"; }
|
{ key = "<leader>fb"; cmd = "<cmd>Telescope buffers<cr>"; desc = "Find buffers"; }
|
||||||
{ key = "<leader>fl"; cmd = "<cmd>Telescope current_buffer_fuzzy_find<cr>"; desc = "Search lines"; }
|
{ key = "<leader>fl"; cmd = "<cmd>Telescope current_buffer_fuzzy_find<cr>"; desc = "Search lines"; }
|
||||||
|
{
|
||||||
|
key = "<leader>fl";
|
||||||
|
cmd = "y<ESC>:Telescope current_buffer_fuzzy_find default_text=<c-r>0<CR>";
|
||||||
|
desc = "Search lines (selection)";
|
||||||
|
mode = [ "v" ];
|
||||||
|
}
|
||||||
{ key = "<leader>fg"; cmd = "<cmd>Telescope live_grep<cr>"; desc = "Live grep"; }
|
{ key = "<leader>fg"; cmd = "<cmd>Telescope live_grep<cr>"; desc = "Live grep"; }
|
||||||
|
{
|
||||||
|
key = "<leader>fg";
|
||||||
|
cmd = "y<ESC>:Telescope live_grep default_text=<c-r>0<CR>";
|
||||||
|
desc = "Live grep (selection)";
|
||||||
|
mode = [ "v" ];
|
||||||
|
}
|
||||||
{ key = "<leader>fh"; cmd = "<cmd>Telescope help_tags<cr>"; desc = "Help tags"; }
|
{ key = "<leader>fh"; cmd = "<cmd>Telescope help_tags<cr>"; desc = "Help tags"; }
|
||||||
|
{ key = "<leader>fr"; cmd = "<cmd>Telescope oldfiles<cr>"; desc = "Recent files"; }
|
||||||
];
|
];
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ plugin = plenary-nvim; }
|
{ plugin = pkgs.vimPlugins.plenary-nvim; }
|
||||||
{ plugin = telescope-fzf-native-nvim; }
|
{ plugin = pkgs.vimPlugins.telescope-fzf-native-nvim; }
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = vim-startuptime;
|
plugin = pkgs.vimPlugins.vim-startuptime;
|
||||||
cmd = [ "StartupTime" ];
|
cmd = [ "StartupTime" ];
|
||||||
conf = readFile ./lua/vim-startuptime.lua;
|
conf = readFile ./lua/vim-startuptime.lua;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = typst-vim;
|
plugin = pkgs.vimPlugins.typst-vim;
|
||||||
ft = [ "typst" "typ" ];
|
ft = [ "typst" "typ" ];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = comment-nvim;
|
plugin = pkgs.vimPlugins.comment-nvim;
|
||||||
event = [ "BufReadPost" "BufNewFile" ];
|
event = [ "BufReadPost" "BufNewFile" ];
|
||||||
opts = { };
|
opts = { };
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = telekasten-nvim;
|
plugin = pkgs.vimPlugins.nvim-surround;
|
||||||
dependencies = [
|
|
||||||
{ plugin = telescope-nvim; }
|
|
||||||
{ plugin = which-key-nvim; }
|
|
||||||
{
|
|
||||||
plugin = markdown-preview-nvim;
|
|
||||||
ft = [ "md" ];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
cmd = [ "Telekasten" ];
|
|
||||||
keys = [
|
|
||||||
{ key = "<leader>z"; cmd = "<cmd>Telekasten<cr>"; desc = "zettelkasten"; }
|
|
||||||
];
|
|
||||||
conf = builtins.readFile ./lua/zettelkasten-nvim.lua;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = nvim-surround;
|
|
||||||
event = [ "BufReadPost" "BufNewFile" ];
|
event = [ "BufReadPost" "BufNewFile" ];
|
||||||
opts = { };
|
opts = { };
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = zen-mode-nvim;
|
plugin = pkgs.vimPlugins.conform-nvim;
|
||||||
keys = [
|
keys = [
|
||||||
{ key = "<leader>tz"; cmd = "<cmd>ZenMode<cr>"; desc = "Zen mode"; }
|
{ key = "="; cmd = "<cmd>lua require('conform').format()<cr>"; desc = "format buffer"; mode = [ "n" "v" ]; }
|
||||||
];
|
|
||||||
conf = /* lua */ ''
|
|
||||||
require("zen-mode").setup({
|
|
||||||
plugins = {
|
|
||||||
tmux = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
'';
|
|
||||||
dependencies = [
|
|
||||||
{
|
|
||||||
plugin = twilight-nvim;
|
|
||||||
conf = /* lua */ ''
|
|
||||||
require("twilight").setup({
|
|
||||||
context = 20,
|
|
||||||
expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types
|
|
||||||
"function",
|
|
||||||
"function_definition",
|
|
||||||
"if_statement",
|
|
||||||
"method",
|
|
||||||
"method_definition",
|
|
||||||
"table",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
cmd = [ "ConformInfo" "Format" ];
|
||||||
|
conf = readFile ./lua/conform.lua;
|
||||||
}
|
}
|
||||||
|
{ plugin = pkgs.vimPlugins.plantuml-syntax; }
|
||||||
{
|
{
|
||||||
plugin = refactoring-nvim;
|
plugin = pkgs.vimPlugins.vimtex;
|
||||||
keys = [
|
|
||||||
{ key = "<leader>re"; cmd = ": Refactor eextract "; desc = "Extract"; mode = [ "x" ]; }
|
|
||||||
{ key = "<leader>rf"; cmd = ": Refactor extract_to_file "; desc = "Extract to file"; mode = [ "x" ]; }
|
|
||||||
{ key = "<leader>rv"; cmd = ": Refactor extract_var "; desc = "Extract variable"; mode = [ "x" ]; }
|
|
||||||
{ key = "<leader>ri"; cmd = ": Refactor inline_var"; desc = "Inline variable"; mode = [ "n" "x" ]; }
|
|
||||||
{ key = "<leader>rI"; cmd = ": Refactor inline_func"; desc = "Inline function"; mode = [ "n" "x" ]; }
|
|
||||||
{ key = "<leader>rb"; cmd = ": Refactor extract_block"; desc = "Extract block"; mode = [ "n" ]; }
|
|
||||||
{ key = "<leader>rbf"; cmd = ": Refactor extract_block_to_file"; desc = "Extract block to file"; mode = [ "n" ]; }
|
|
||||||
];
|
|
||||||
dependencies = [
|
|
||||||
{ plugin = which-key-nvim; }
|
|
||||||
{ plugin = plenary-nvim; }
|
|
||||||
{ plugin = nvim-lspconfig; }
|
|
||||||
];
|
|
||||||
init = /* lua */ ''
|
|
||||||
require("which-key").register({
|
|
||||||
["<leader>r"] = {
|
|
||||||
name = "refactoring",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
'';
|
|
||||||
opts = { };
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = harpoon;
|
|
||||||
keys = [
|
|
||||||
{ key = "<leader>ha"; cmd = "<cmd>lua require('harpoon.mark').add_file()<cr>"; desc = "Add file"; }
|
|
||||||
{ key = "<leader>hh"; cmd = "<cmd>lua require('harpoon.ui').toggle_quick_menu()<cr>"; desc = "Harpoon"; }
|
|
||||||
{ key = "<leader>h1"; cmd = "<cmd>lua require('harpoon.ui').nav_file(1)<cr>"; desc = "Harpoon file 1"; }
|
|
||||||
{ key = "<leader>h2"; cmd = "<cmd>lua require('harpoon.ui').nav_file(2)<cr>"; desc = "Harpoon file 2"; }
|
|
||||||
{ key = "<leader>h3"; cmd = "<cmd>lua require('harpoon.ui').nav_file(3)<cr>"; desc = "Harpoon file 3"; }
|
|
||||||
{ key = "<leader>h4"; cmd = "<cmd>lua require('harpoon.ui').nav_file(4)<cr>"; desc = "Harpoon file 4"; }
|
|
||||||
];
|
|
||||||
opts = { };
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = nvim-puppeteer;
|
|
||||||
lazy = false; # NOTE: plugin lazy-loads itself.
|
|
||||||
}
|
|
||||||
{
|
|
||||||
# TODO: replace formatter-nvim with this as well
|
|
||||||
plugin = guard-nvim;
|
|
||||||
lazy = false;
|
lazy = false;
|
||||||
conf = readFile ./lua/guard.lua;
|
conf = /* lua */ ''
|
||||||
|
vim.g.vimtex_view_method = "zathura"
|
||||||
|
vim.g.vimtex_mappings_disable = vim.fn.executable("texlab") == 1 and { ["n"] = { "K" } } or {} -- disable `K` as it conflicts with LSP hover if texlab is in path
|
||||||
|
vim.g.vimtex_quickfix_method = vim.fn.executable("pplatex") == 1 and "pplatex" or "latexlog"
|
||||||
|
'';
|
||||||
|
keys = [
|
||||||
|
{ key = "<localleader>l"; cmd = ""; desc = "+vimtex"; }
|
||||||
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
with builtins;
|
||||||
|
{
|
||||||
|
config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [
|
||||||
|
{
|
||||||
|
plugin = nvim-dap;
|
||||||
|
keys = [
|
||||||
|
{ key = "<leader>cb"; cmd = "<cmd>lua require('dap').toggle_breakpoint()<cr>"; desc = "Toggle breakpoint"; }
|
||||||
|
{ key = "<leader>cd"; cmd = "<cmd>lua require('dap').continue()<cr>"; desc = "Continue"; }
|
||||||
|
];
|
||||||
|
dependencies = [
|
||||||
|
{
|
||||||
|
plugin = nvim-dap-python;
|
||||||
|
ft = [ "python" ];
|
||||||
|
conf =
|
||||||
|
let
|
||||||
|
pythonWithDebugpy = pkgs.python3.withPackages (ps: with ps; [ debugpy ]);
|
||||||
|
in
|
||||||
|
/* lua */ ''
|
||||||
|
require("dap-python").setup("${lib.getExe pythonWithDebugpy}")
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
{
|
||||||
|
plugin = nvim-dap-virtual-text;
|
||||||
|
opts = { };
|
||||||
|
}
|
||||||
|
{
|
||||||
|
plugin = nvim-dap-ui;
|
||||||
|
opts = { };
|
||||||
|
conf = /* lua */ ''
|
||||||
|
local dap = require("dap")
|
||||||
|
local dapui = require("dapui")
|
||||||
|
dapui.setup(opts)
|
||||||
|
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||||
|
dapui.open({})
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||||
|
dapui.close({})
|
||||||
|
end
|
||||||
|
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||||
|
dapui.close({})
|
||||||
|
end
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
local conform = require("conform")
|
||||||
|
|
||||||
|
local formatters_by_ft = {
|
||||||
|
["*"] = { "codespell", "trim_whitespace" },
|
||||||
|
elixir = { "mix" },
|
||||||
|
gleam = { "gleam" },
|
||||||
|
go = { "gofmt" },
|
||||||
|
json = { "jq" },
|
||||||
|
lua = { "stylua" },
|
||||||
|
nix = { { "nixpkgs_fmt", "alejandra" } },
|
||||||
|
python = { { "ruff_fix", "isort" }, { "ruff_format", "black" } },
|
||||||
|
rust = { "rustfmt" },
|
||||||
|
sh = { "shfmt" },
|
||||||
|
tex = { "latexindent" },
|
||||||
|
toml = { "taplo" },
|
||||||
|
yaml = { "yamlfix" },
|
||||||
|
}
|
||||||
|
|
||||||
|
conform.setup({
|
||||||
|
formatters_by_ft = formatters_by_ft,
|
||||||
|
formatters = {
|
||||||
|
gleam = {
|
||||||
|
command = "gleam",
|
||||||
|
args = { "format", "--stdin" },
|
||||||
|
stdin = true,
|
||||||
|
cwd = require("conform.util").root_file({ "gleam.toml" }),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.api.nvim_create_user_command("Format", function(opts)
|
||||||
|
conform.format({ formatters = opts.fargs })
|
||||||
|
end, {
|
||||||
|
nargs = "+",
|
||||||
|
complete = function()
|
||||||
|
local names = formatters_by_ft[vim.bo.filetype] or formatters_by_ft["_"] or {}
|
||||||
|
names = vim.list_extend(names, formatters_by_ft["*"] or {})
|
||||||
|
names = vim.tbl_flatten(names)
|
||||||
|
local formatters = vim.tbl_map(conform.get_formatter_info, names)
|
||||||
|
formatters = vim.tbl_filter(function(formatter)
|
||||||
|
return formatter.available
|
||||||
|
end, formatters)
|
||||||
|
return vim.tbl_map(function(formatter_info)
|
||||||
|
return formatter_info.name
|
||||||
|
end, formatters)
|
||||||
|
end,
|
||||||
|
})
|
|
@ -1,70 +0,0 @@
|
||||||
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
|
|
||||||
require("formatter").setup({
|
|
||||||
-- Enable or disable logging
|
|
||||||
logging = true,
|
|
||||||
-- Set the log level
|
|
||||||
log_level = vim.log.levels.WARN,
|
|
||||||
-- All formatter configurations are opt-in
|
|
||||||
filetype = {
|
|
||||||
go = {
|
|
||||||
require("formatter.filetypes.go").gofmt,
|
|
||||||
},
|
|
||||||
json = {
|
|
||||||
require("formatter.filetypes.json").jq,
|
|
||||||
},
|
|
||||||
lua = {
|
|
||||||
require("formatter.filetypes.lua").stylua,
|
|
||||||
},
|
|
||||||
nix = {
|
|
||||||
require("formatter.filetypes.nix").nixpkgs_fmt,
|
|
||||||
},
|
|
||||||
python = {
|
|
||||||
require("formatter.filetypes.python").black,
|
|
||||||
},
|
|
||||||
rust = {
|
|
||||||
require("formatter.filetypes.rust").rustfmt,
|
|
||||||
},
|
|
||||||
sh = {
|
|
||||||
require("formatter.filetypes.sh").shfmt,
|
|
||||||
},
|
|
||||||
toml = {
|
|
||||||
require("formatter.filetypes.toml").taplo,
|
|
||||||
},
|
|
||||||
yaml = {
|
|
||||||
require("formatter.filetypes.yaml").yamlfmt,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- HACK to use specific formatters only when specified
|
|
||||||
alejandra = {
|
|
||||||
require("formatter.filetypes.nix").alejandra,
|
|
||||||
},
|
|
||||||
isort = {
|
|
||||||
require("formatter.filetypes.python").isort,
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Use the special "*" filetype for defining formatter configurations on
|
|
||||||
-- any filetype
|
|
||||||
["*"] = {
|
|
||||||
-- "formatter.filetypes.any" defines default configurations for any
|
|
||||||
-- filetype
|
|
||||||
require("formatter.filetypes.any").remove_trailing_whitespace,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_user_command("Fmt", function(opts)
|
|
||||||
local params = vim.split(opts.args, "%s+", { trimempty = true })
|
|
||||||
local filetype = vim.bo.filetype
|
|
||||||
vim.cmd("set filetype=" .. params[1]) -- fake filetype
|
|
||||||
vim.cmd(":Format")
|
|
||||||
vim.cmd("set filetype=" .. filetype) -- restore original filetype
|
|
||||||
end, {
|
|
||||||
nargs = 1,
|
|
||||||
complete = function()
|
|
||||||
local languages = {
|
|
||||||
nix = { "alejandra" },
|
|
||||||
python = { "isort" },
|
|
||||||
}
|
|
||||||
return languages[vim.bo.filetype] or {}
|
|
||||||
end,
|
|
||||||
})
|
|
|
@ -1,15 +1,13 @@
|
||||||
require("gitsigns").setup()
|
require("gitsigns").setup()
|
||||||
require("which-key").register({
|
require("which-key").add({
|
||||||
["[h"] = { "<cmd>Gitsigns prev_hunk<cr>", "Previous hunk" },
|
{ "<leader>gP", "<cmd>Gitsigns preview_hunk<cr>", desc = "Preview hunk (float)" },
|
||||||
["]h"] = { "<cmd>Gitsigns next_hunk<cr>", "Next hunk" },
|
{ "<leader>gR", "<cmd>Gitsigns reset_buffer<cr>", desc = "Reset buffer" },
|
||||||
["<leader>g"] = {
|
{ "<leader>gS", "<cmd>Gitsigns stage_buffer<cr>", desc = "Stage buffer" },
|
||||||
s = { "<cmd>Gitsigns stage_hunk<cr>", "Stage hunk", mode = { "n", "v" } },
|
{ "<leader>gp", "<cmd>Gitsigns preview_hunk_inline<cr>", desc = "Preview hunk (inline)" },
|
||||||
r = { "<cmd>Gitsigns reset_hunk<cr>", "Reset hunk", mode = { "n", "v" } },
|
{ "<leader>gu", "<cmd>Gitsigns undo_stage_hunk<cr>", desc = "Undo stage hunk" },
|
||||||
S = { "<cmd>Gitsigns stage_buffer<cr>", "Stage buffer" },
|
{ "[h", "<cmd>Gitsigns prev_hunk<cr>", desc = "Previous hunk" },
|
||||||
R = { "<cmd>Gitsigns reset_buffer<cr>", "Reset buffer" },
|
{ "]h", "<cmd>Gitsigns next_hunk<cr>", desc = "Next hunk" },
|
||||||
u = { "<cmd>Gitsigns undo_stage_hunk<cr>", "Undo stage hunk" },
|
{ "<leader>gr", "<cmd>Gitsigns reset_hunk<cr>", desc = "Reset hunk", mode = { "n", "v" } },
|
||||||
p = { "<cmd>Gitsigns preview_hunk_inline<cr>", "Preview hunk (inline)" },
|
{ "<leader>gs", "<cmd>Gitsigns stage_hunk<cr>", desc = "Stage hunk", mode = { "n", "v" } },
|
||||||
P = { "<cmd>Gitsigns preview_hunk<cr>", "Preview hunk (float)" },
|
{ "ih", ":<C-U>Gitsigns select_hunk<cr>", desc = "gitsigns hunk", mode = { "o", "x" } },
|
||||||
},
|
|
||||||
["ih"] = { ":<C-U>Gitsigns select_hunk<cr>", "gitsigns hunk", mode = { "o", "x" } },
|
|
||||||
})
|
})
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
local ls = require("luasnip")
|
||||||
|
local types = require("luasnip.util.types")
|
||||||
|
|
||||||
|
-- Every unspecified option will be set to the default.
|
||||||
|
ls.setup({
|
||||||
|
history = true,
|
||||||
|
|
||||||
|
-- Update more often, :h events for more info.
|
||||||
|
update_events = "TextChanged,TextChangedI",
|
||||||
|
-- Snippets aren't automatically removed if their text is deleted.
|
||||||
|
-- `delete_check_events` determines on which events (:h events) a check for
|
||||||
|
-- deleted snippets is performed.
|
||||||
|
-- This can be especially useful when `history` is enabled.
|
||||||
|
delete_check_events = "TextChanged",
|
||||||
|
ext_opts = {
|
||||||
|
[types.choiceNode] = {
|
||||||
|
active = {
|
||||||
|
virt_text = { { "<--", "Error" } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
ft_func = require("luasnip.extras.filetype_functions").from_pos_or_filetype,
|
||||||
|
})
|
||||||
|
|
||||||
|
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets" })
|
|
@ -1,60 +1 @@
|
||||||
require("mini.align").setup()
|
require("mini.align").setup()
|
||||||
require("mini.move").setup()
|
|
||||||
require("mini.starter").setup()
|
|
||||||
|
|
||||||
require("mini.statusline").setup({
|
|
||||||
content = {
|
|
||||||
active = function()
|
|
||||||
local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 })
|
|
||||||
local git = MiniStatusline.section_git({ trunc_width = 75 })
|
|
||||||
local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75 })
|
|
||||||
local filename = MiniStatusline.section_filename({ trunc_width = 140 })
|
|
||||||
local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 })
|
|
||||||
local location = MiniStatusline.section_location({ trunc_width = 75 })
|
|
||||||
local mode_hl_inverse = mode_hl .. "Inverse"
|
|
||||||
-- Usage of `MiniStatusline.combine_groups()` ensures highlighting and
|
|
||||||
-- correct padding with spaces between groups (accounts for 'missing'
|
|
||||||
-- sections, etc.)
|
|
||||||
return MiniStatusline.combine_groups({
|
|
||||||
{ hl = mode_hl_inverse, strings = {} },
|
|
||||||
"",
|
|
||||||
{ hl = mode_hl, strings = { mode } },
|
|
||||||
{ hl = "MiniStatuslineDevinfo", strings = { git, diagnostics } },
|
|
||||||
"%<", -- Mark general truncate point
|
|
||||||
{ hl = "MiniStatuslineFilename", strings = { filename } },
|
|
||||||
"%=", -- End left alignment
|
|
||||||
{ hl = "MiniStatuslineFileinfo", strings = { fileinfo } },
|
|
||||||
{ hl = mode_hl, strings = { location } },
|
|
||||||
{ hl = mode_hl_inverse, strings = {} },
|
|
||||||
"",
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
local MiniStatuslineModes = {
|
|
||||||
"MiniStatuslineModeInsert",
|
|
||||||
"MiniStatuslineModeNormal",
|
|
||||||
"MiniStatuslineModeReplace",
|
|
||||||
"MiniStatuslineModeVisual",
|
|
||||||
"MiniStatuslineModeCommand",
|
|
||||||
"MiniStatuslineModeOther",
|
|
||||||
}
|
|
||||||
for _, mode_hl in ipairs(MiniStatuslineModes) do
|
|
||||||
local hl_table = vim.api.nvim_get_hl(0, { name = mode_hl })
|
|
||||||
local fg = hl_table.fg
|
|
||||||
hl_table.fg = hl_table.bg
|
|
||||||
hl_table.bg = fg
|
|
||||||
vim.api.nvim_set_hl(0, mode_hl .. "Inverse", hl_table)
|
|
||||||
end
|
|
||||||
|
|
||||||
local animate = require("mini.animate")
|
|
||||||
local animation = {
|
|
||||||
timing = animate.gen_timing.quadratic({ duration = 100, unit = "total" }),
|
|
||||||
}
|
|
||||||
animate.setup({
|
|
||||||
cursor = animation,
|
|
||||||
scroll = { enable = false },
|
|
||||||
resize = animation,
|
|
||||||
open = animation,
|
|
||||||
close = animation,
|
|
||||||
})
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
require("neotest").setup({
|
||||||
|
adapters = {
|
||||||
|
require("neotest-python")({
|
||||||
|
dap = { justMyCode = false },
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
|
@ -3,29 +3,16 @@ local null_ls = require("null-ls")
|
||||||
null_ls.setup({
|
null_ls.setup({
|
||||||
sources = {
|
sources = {
|
||||||
-- Code actions
|
-- Code actions
|
||||||
null_ls.builtins.code_actions.shellcheck,
|
require("none-ls-shellcheck.code_actions"),
|
||||||
null_ls.builtins.code_actions.statix,
|
null_ls.builtins.code_actions.statix,
|
||||||
-- Completion
|
|
||||||
null_ls.builtins.completion.spell,
|
|
||||||
-- Diagnostics
|
-- Diagnostics
|
||||||
|
null_ls.builtins.diagnostics.checkmake,
|
||||||
null_ls.builtins.diagnostics.deadnix,
|
null_ls.builtins.diagnostics.deadnix,
|
||||||
null_ls.builtins.diagnostics.shellcheck,
|
null_ls.builtins.diagnostics.dotenv_linter,
|
||||||
|
null_ls.builtins.diagnostics.fish,
|
||||||
|
require("none-ls-shellcheck.diagnostics"),
|
||||||
null_ls.builtins.diagnostics.statix,
|
null_ls.builtins.diagnostics.statix,
|
||||||
|
null_ls.builtins.diagnostics.trail_space,
|
||||||
|
null_ls.builtins.diagnostics.yamllint,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
-- disable (c)spell initially
|
|
||||||
null_ls.disable("spell")
|
|
||||||
|
|
||||||
-- make sources toggle able
|
|
||||||
require("which-key").register({
|
|
||||||
n = {
|
|
||||||
name = "null-ls",
|
|
||||||
s = {
|
|
||||||
function()
|
|
||||||
null_ls.toggle("spell")
|
|
||||||
end,
|
|
||||||
"spell",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}, { prefix = "<leader>t" })
|
|
||||||
|
|
|
@ -2,14 +2,6 @@ local cmp = require("cmp")
|
||||||
local luasnip = require("luasnip")
|
local luasnip = require("luasnip")
|
||||||
require("luasnip.loaders.from_vscode").lazy_load()
|
require("luasnip.loaders.from_vscode").lazy_load()
|
||||||
|
|
||||||
local has_words_before = function()
|
|
||||||
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
|
||||||
return col ~= 0 and vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match("^%s*$") == nil
|
|
||||||
end
|
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
formatting = {
|
formatting = {
|
||||||
format = require("lspkind").cmp_format({
|
format = require("lspkind").cmp_format({
|
||||||
|
@ -17,7 +9,7 @@ cmp.setup({
|
||||||
maxwidth = 50, -- prevent the popup from showing more than provided characters
|
maxwidth = 50, -- prevent the popup from showing more than provided characters
|
||||||
ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead
|
ellipsis_char = "...", -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead
|
||||||
symbol_map = {
|
symbol_map = {
|
||||||
Codeium = "",
|
-- Copilot = "",
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
|
@ -31,34 +23,55 @@ cmp.setup({
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
["<S-CR>"] = cmp.mapping.abort(),
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() and has_words_before() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
elseif luasnip.expand_or_jumpable() then
|
elseif luasnip.locally_jumpable(1) then
|
||||||
luasnip.expand_or_jump()
|
luasnip.jump(1)
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select })
|
||||||
elseif luasnip.jumpable(-1) then
|
elseif luasnip.locally_jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<C-n>"] = cmp.mapping(function(fallback)
|
||||||
|
if luasnip.choice_active() then
|
||||||
|
luasnip.change_choice(1)
|
||||||
|
elseif luasnip.locally_jumpable(1) then
|
||||||
|
luasnip.jump(1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
["<C-p>"] = cmp.mapping(function(fallback)
|
||||||
|
if luasnip.choice_active() then
|
||||||
|
luasnip.change_choice(-1)
|
||||||
|
elseif luasnip.locally_jumpable(-1) then
|
||||||
luasnip.jump(-1)
|
luasnip.jump(-1)
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { "i", "s" }),
|
end, { "i", "s" }),
|
||||||
}),
|
}),
|
||||||
sources = {
|
sources = cmp.config.sources({
|
||||||
{ name = "async_path", priority = 1 },
|
{ priority = 1, name = "async_path" },
|
||||||
{ name = "buffer", priority = 1 },
|
{ priority = 1, name = "buffer" },
|
||||||
{ name = "luasnip", priority = 2 },
|
{ priority = 1, name = "spell" },
|
||||||
{ name = "codeium", priority = 3 },
|
{ priority = 2, name = "nvim_lsp" },
|
||||||
{ name = "nvim_lsp", priority = 3 },
|
-- { priority = 3, name = "copilot" },
|
||||||
},
|
{ priority = 3, name = "nvim_lsp_signature_help" },
|
||||||
|
{ priority = 4, name = "luasnip" },
|
||||||
|
{ priority = 4, name = "vimtex" },
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Set configuration for specific filetype.
|
-- Set configuration for specific filetype.
|
||||||
|
@ -120,3 +133,97 @@ cmp.event:on(
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
local pickers = require("telescope.pickers")
|
||||||
|
local finders = require("telescope.finders")
|
||||||
|
local conf = require("telescope.config").values
|
||||||
|
local actions = require("telescope.actions")
|
||||||
|
local action_state = require("telescope.actions.state")
|
||||||
|
|
||||||
|
local all_sources = vim.deepcopy(cmp.get_config().sources)
|
||||||
|
|
||||||
|
local find = function(sources, name)
|
||||||
|
for k, source in ipairs(sources) do
|
||||||
|
if source.name == name then
|
||||||
|
return k
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local is_active = function(name)
|
||||||
|
local active_sources = cmp.get_config().sources
|
||||||
|
local index = find(active_sources, name)
|
||||||
|
return index ~= nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local enable_source = function(name, force)
|
||||||
|
if force or not is_active(name) then
|
||||||
|
local source_index = find(all_sources, name)
|
||||||
|
if source_index ~= nil then
|
||||||
|
local active_sources = cmp.get_config().sources
|
||||||
|
local source = all_sources[source_index]
|
||||||
|
table.insert(active_sources, 1, source)
|
||||||
|
cmp.setup({ sources = active_sources })
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local disable_source = function(identifier)
|
||||||
|
if type(identifier) == "string" then
|
||||||
|
identifier = find(all_sources, identifier)
|
||||||
|
end
|
||||||
|
local active_sources = cmp.get_config().sources
|
||||||
|
table.remove(active_sources, identifier)
|
||||||
|
end
|
||||||
|
|
||||||
|
local toggle_sources = function(name)
|
||||||
|
local active_sources = cmp.get_config().sources
|
||||||
|
local index = find(active_sources, name)
|
||||||
|
if index ~= nil then
|
||||||
|
disable_source(index)
|
||||||
|
else
|
||||||
|
enable_source(name, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- our picker function: sources
|
||||||
|
local sources_picker = function(opts)
|
||||||
|
opts = opts or {}
|
||||||
|
pickers
|
||||||
|
.new(opts, {
|
||||||
|
prompt_title = "sources",
|
||||||
|
finder = finders.new_table({
|
||||||
|
results = vim.tbl_map(function(source)
|
||||||
|
return source.name
|
||||||
|
end, all_sources),
|
||||||
|
entry_maker = function(entry)
|
||||||
|
return {
|
||||||
|
value = entry,
|
||||||
|
display = function(tbl)
|
||||||
|
local name = tbl["ordinal"]
|
||||||
|
local active = is_active(name)
|
||||||
|
return string.format("%s %s", name, active and "✅" or "❌")
|
||||||
|
end,
|
||||||
|
ordinal = entry,
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
}),
|
||||||
|
sorter = conf.generic_sorter(opts),
|
||||||
|
attach_mappings = function(prompt_bufnr, _)
|
||||||
|
actions.select_default:replace(function()
|
||||||
|
actions.close(prompt_bufnr)
|
||||||
|
local selection = action_state.get_selected_entry()
|
||||||
|
toggle_sources(selection["value"])
|
||||||
|
end)
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
:find()
|
||||||
|
end
|
||||||
|
|
||||||
|
-- autocommand for sources_picker
|
||||||
|
vim.api.nvim_create_user_command("CmpToggle", sources_picker, {})
|
||||||
|
|
||||||
|
-- disable sources by default
|
||||||
|
-- disable_source("codeium")
|
||||||
|
|
|
@ -21,38 +21,28 @@ capabilities.didChangeWatchedFiles = {
|
||||||
|
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
local on_attach_def = function(client, bufnr)
|
local on_attach_def = function(client, bufnr)
|
||||||
require("which-key").register({
|
require("which-key").add({
|
||||||
K = {
|
{ "<leader>c", buffer = bufnr, group = "code" },
|
||||||
function()
|
{
|
||||||
local winid = require("ufo").peekFoldedLinesUnderCursor()
|
"<leader>cr",
|
||||||
if not winid then
|
|
||||||
vim.lsp.buf.hover()
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
"Hover",
|
|
||||||
},
|
|
||||||
["<leader>"] = {
|
|
||||||
l = {
|
|
||||||
name = "lsp",
|
|
||||||
d = { vim.diagnostic.open_float, "Open diagnostic window" },
|
|
||||||
c = { require("actions-preview").code_actions, "Code action", mode = { "v", "n" } },
|
|
||||||
r = {
|
|
||||||
function()
|
function()
|
||||||
return ":IncRename " .. vim.fn.expand("<cword>")
|
return ":IncRename " .. vim.fn.expand("<cword>")
|
||||||
end,
|
end,
|
||||||
"Rename",
|
buffer = bufnr,
|
||||||
|
desc = "Rename",
|
||||||
expr = true,
|
expr = true,
|
||||||
|
replace_keycodes = false,
|
||||||
},
|
},
|
||||||
f = {
|
{
|
||||||
|
"<leader>ti",
|
||||||
function()
|
function()
|
||||||
vim.lsp.buf.format({ async = true })
|
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||||
end,
|
end,
|
||||||
"Format (lsp)",
|
buffer = bufnr,
|
||||||
mode = { "n", "v" },
|
desc = "LSP inlay hints",
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
t = {
|
"<leader>tl",
|
||||||
l = {
|
|
||||||
function()
|
function()
|
||||||
lsp_lines.toggle()
|
lsp_lines.toggle()
|
||||||
if vim.diagnostic.is_disabled() then
|
if vim.diagnostic.is_disabled() then
|
||||||
|
@ -61,58 +51,59 @@ local on_attach_def = function(client, bufnr)
|
||||||
vim.diagnostic.disable()
|
vim.diagnostic.disable()
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
"LSP lines",
|
buffer = bufnr,
|
||||||
|
desc = "LSP lines",
|
||||||
},
|
},
|
||||||
i = {
|
{ "K", vim.lsp.buf.hover, buffer = bufnr, desc = "Hover" },
|
||||||
function()
|
{ "[d", vim.diagnostic.goto_prev, buffer = bufnr, desc = "Previous diagnostic" },
|
||||||
vim.lsp.inlay_hint(bufnr, nil)
|
{ "]d", vim.diagnostic.goto_next, buffer = bufnr, desc = "Next diagnostic" },
|
||||||
end,
|
{ "gD", vim.lsp.buf.declaration, buffer = bufnr, desc = "Goto declaration" },
|
||||||
"LSP inlay hints",
|
{ "gI", "<cmd>Telescope lsp_implementations<cr>", buffer = bufnr, desc = "Goto implementation" },
|
||||||
},
|
{ "gK", vim.lsp.buf.signature_help, buffer = bufnr, desc = "Signature help" },
|
||||||
},
|
{
|
||||||
},
|
"gd",
|
||||||
g = {
|
|
||||||
d = {
|
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").lsp_definitions({ reuse_win = true })
|
require("telescope.builtin").lsp_definitions({ reuse_win = true })
|
||||||
end,
|
end,
|
||||||
"Goto definition",
|
buffer = bufnr,
|
||||||
|
desc = "Goto definition",
|
||||||
},
|
},
|
||||||
t = {
|
{ "gr", "<cmd>Telescope lsp_references<cr>", buffer = bufnr, desc = "Goto references" },
|
||||||
|
{
|
||||||
|
"gt",
|
||||||
|
|
||||||
function()
|
function()
|
||||||
require("telescope.builtin").lsp_type_definitions({ reuse_win = true })
|
require("telescope.builtin").lsp_type_definitions({ reuse_win = true })
|
||||||
end,
|
end,
|
||||||
"Goto type defininition",
|
buffer = bufnr,
|
||||||
|
desc = "Goto type definition",
|
||||||
},
|
},
|
||||||
r = { "<cmd>Telescope lsp_references<cr>", "Goto references" },
|
{
|
||||||
D = { vim.lsp.buf.declaration, "Goto declaration" },
|
"<leader>cc",
|
||||||
I = { "<cmd>Telescope lsp_implementations<cr>", "Goto implementation" },
|
require("actions-preview").code_actions,
|
||||||
K = { vim.lsp.buf.signature_help, "Signature help" },
|
buffer = bufnr,
|
||||||
|
desc = "Code action",
|
||||||
|
mode = { "n", "v" },
|
||||||
},
|
},
|
||||||
["["] = {
|
{
|
||||||
d = { vim.diagnostic.goto_prev, "Previous diagnostic" },
|
"<leader>cf",
|
||||||
|
function()
|
||||||
|
vim.lsp.buf.format({ async = true })
|
||||||
|
end,
|
||||||
|
buffer = bufnr,
|
||||||
|
desc = "Format (lsp)",
|
||||||
|
mode = { "n", "v" },
|
||||||
},
|
},
|
||||||
["]"] = {
|
})
|
||||||
d = { vim.diagnostic.goto_next, "Next diagnostic" },
|
|
||||||
},
|
|
||||||
}, { buffer = bufnr, silent = true })
|
|
||||||
|
|
||||||
if client.server_capabilities.inlayHintProvider then
|
if client.server_capabilities.inlayHintProvider then
|
||||||
local slow_lsp_servers = {
|
local slow_lsp_servers = {
|
||||||
"rust_analyzer",
|
"rust_analyzer",
|
||||||
}
|
}
|
||||||
local timeout = vim.tbl_contains(slow_lsp_servers, client.name, {}) and 500 or 0
|
local timeout = vim.tbl_contains(slow_lsp_servers, client.name, {}) and 500 or 0
|
||||||
vim.defer_fn(function()
|
vim.defer_fn(function()
|
||||||
vim.lsp.inlay_hint(bufnr, true)
|
vim.lsp.inlay_hint.enable(true, { bufnr })
|
||||||
end, timeout)
|
end, timeout)
|
||||||
end
|
end
|
||||||
|
|
||||||
require("lsp_signature").on_attach({
|
|
||||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
|
||||||
handler_opts = {
|
|
||||||
border = "rounded",
|
|
||||||
},
|
|
||||||
}, bufnr)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local lspconfig_default_options = {
|
local lspconfig_default_options = {
|
||||||
|
@ -134,16 +125,64 @@ end
|
||||||
|
|
||||||
local servers = {
|
local servers = {
|
||||||
"bashls",
|
"bashls",
|
||||||
"nixd",
|
"gleam",
|
||||||
"pylsp",
|
|
||||||
"ruff_lsp",
|
|
||||||
"typst_lsp",
|
|
||||||
"gopls",
|
"gopls",
|
||||||
|
"pylsp",
|
||||||
|
"ruff",
|
||||||
|
"templ",
|
||||||
|
"typst_lsp",
|
||||||
}
|
}
|
||||||
for _, lsp in ipairs(servers) do
|
for _, lsp in ipairs(servers) do
|
||||||
lspconfig_setup(lsp, {})
|
lspconfig_setup(lsp, {})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
lspconfig_setup("elixirls", {
|
||||||
|
cmd = { "elixir-ls" },
|
||||||
|
})
|
||||||
|
|
||||||
|
lspconfig_setup("nil_ls", {
|
||||||
|
settings = {
|
||||||
|
flake = {
|
||||||
|
autoArchive = true,
|
||||||
|
autoEvalInputs = true,
|
||||||
|
nixpkgsInputName = "nixpkgs",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
lspconfig_setup("nixd", {
|
||||||
|
settings = {
|
||||||
|
nixd = {
|
||||||
|
nixpkgs = {
|
||||||
|
expr = "import <nixpkgs> { }",
|
||||||
|
},
|
||||||
|
options = {
|
||||||
|
nixos = {
|
||||||
|
expr = '(builtins.getFlake ("git+file://" + toString ./.)).nixosConfigurations.nixos-desktop.options',
|
||||||
|
},
|
||||||
|
["flake-parts"] = {
|
||||||
|
expr = '(builtins.getFlake ("git+file://" + toString ./.)).debug.options',
|
||||||
|
},
|
||||||
|
["flake-parts2"] = {
|
||||||
|
expr = '(builtins.getFlake ("git+file://" + toString ./.)).currentSystem.options',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Add templ filetype
|
||||||
|
vim.filetype.add({ extension = { templ = "templ" } })
|
||||||
|
|
||||||
|
lspconfig_setup("htmx", {
|
||||||
|
filetypes = { "html", "templ" },
|
||||||
|
})
|
||||||
|
|
||||||
|
lspconfig_setup("tailwindcss", {
|
||||||
|
filetypes = { "templ", "astro", "javascript", "typescript", "react" },
|
||||||
|
init_options = { userLanguages = { templ = "html" } },
|
||||||
|
})
|
||||||
|
|
||||||
lspconfig_setup("rust_analyzer", {
|
lspconfig_setup("rust_analyzer", {
|
||||||
settings = {
|
settings = {
|
||||||
["rust-analyzer"] = {
|
["rust-analyzer"] = {
|
||||||
|
|
|
@ -1,10 +1 @@
|
||||||
require("nvim-treesitter.configs").setup({
|
require("nvim-treesitter.configs").setup()
|
||||||
sync_install = false,
|
|
||||||
auto_install = false,
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
context_commentstring = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
vim.o.fillchars = [[eob: ,fold: ,foldopen:,foldsep: ,foldclose:]]
|
|
||||||
local builtin = require("statuscol.builtin")
|
|
||||||
require("statuscol").setup({
|
|
||||||
segments = {
|
|
||||||
{
|
|
||||||
sign = { name = { ".*" }, auto = true },
|
|
||||||
click = "v:lua.ScSa",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text = { builtin.lnumfunc },
|
|
||||||
click = "v:lua.ScLa",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
sign = { name = { "GitSigns" }, auto = true },
|
|
||||||
click = "v:lua.ScSa",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text = { builtin.foldfunc, " " },
|
|
||||||
click = "v:lua.ScFa",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
|
@ -2,62 +2,50 @@ vim.o.timeout = true
|
||||||
vim.o.timeoutlen = 500
|
vim.o.timeoutlen = 500
|
||||||
|
|
||||||
-- Delete
|
-- Delete
|
||||||
require("which-key").register({
|
require("which-key").add({
|
||||||
d = {
|
{ "<leader>d", group = "delete" },
|
||||||
name = "delete",
|
{ "<leader>db", "<cmd>bd<cr>", desc = "Delete buffer" },
|
||||||
b = { "<cmd>bd<cr>", "Delete buffer" },
|
{ "<leader>dw", "<C-w>c", desc = "Delete window" },
|
||||||
w = { "<C-w>c", "Delete window" },
|
})
|
||||||
},
|
|
||||||
}, { prefix = "<leader>" })
|
|
||||||
|
|
||||||
-- buffer
|
-- buffer
|
||||||
require("which-key").register({
|
require("which-key").add({
|
||||||
["["] = {
|
{ "[b", "<cmd>bprevious<cr>", desc = "Previous buffer" },
|
||||||
b = { "<cmd>bprevious<cr>", "Previous buffer" },
|
{ "]b", "<cmd>bnext<cr>", desc = "Next buffer" },
|
||||||
},
|
|
||||||
["]"] = {
|
|
||||||
b = { "<cmd>bnext<cr>", "Next buffer" },
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- window
|
-- window
|
||||||
require("which-key").register({
|
require("which-key").add({
|
||||||
w = {
|
{ "<leader>w", group = "window" },
|
||||||
name = "window",
|
{ "<leader>w-", "<C-w>s", desc = "Split window vertically" },
|
||||||
["|"] = { "<C-w>v", "Split window horizontally" },
|
{ "<leader>ww", "<C-w>w", desc = "Switch window" },
|
||||||
["-"] = { "<C-w>s", "Split window vertically" },
|
{ "<leader>w|", "<C-w>v", desc = "Split window horizontally" },
|
||||||
w = { "<C-w>w", "Switch window" },
|
})
|
||||||
},
|
|
||||||
}, { prefix = "<leader>" })
|
|
||||||
|
|
||||||
-- better descriptions for navigation
|
-- better descriptions for navigation
|
||||||
require("which-key").register({
|
require("which-key").add({
|
||||||
["<leader>"] = {
|
{ "<leader>c", group = "code" },
|
||||||
f = { name = "file/find" },
|
{ "<leader>f", group = "file/find" },
|
||||||
g = { name = "git" },
|
{ "<leader>g", group = "git" },
|
||||||
l = { name = "lsp" },
|
{ "<leader>s", group = "search" },
|
||||||
o = { name = "org" },
|
{ "<leader>t", group = "toggle" },
|
||||||
s = { name = "search" },
|
{ "[", group = "prev" },
|
||||||
t = { name = "toggle" },
|
{ "]", group = "next" },
|
||||||
x = { name = "diagnostics/quickfix" },
|
{ "g", group = "goto" },
|
||||||
},
|
|
||||||
["["] = { name = "prev" },
|
|
||||||
["]"] = { name = "next" },
|
|
||||||
g = { name = "goto" },
|
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Clear search with <esc>
|
-- Clear search with <esc>
|
||||||
require("which-key").register({
|
require("which-key").add({
|
||||||
["<esc>"] = { "<cmd>noh<cr><esc>", "Escape and clear hlsearch", mode = { "n", "i" } },
|
{ "<esc>", "<cmd>noh<cr><esc>", desc = "Escape and clear hlsearch", mode = { "i", "n" } },
|
||||||
})
|
})
|
||||||
|
|
||||||
-- better indenting
|
-- better indenting
|
||||||
require("which-key").register({
|
require("which-key").add({
|
||||||
["<"] = { "<gv", "Shift left" },
|
{ "<", "<gv", desc = "Shift left", mode = "v" },
|
||||||
[">"] = { ">gv", "Shift right" },
|
{ ">", ">gv", desc = "Shift right", mode = "v" },
|
||||||
}, { mode = "v" })
|
})
|
||||||
|
|
||||||
-- better yank in visual mode
|
-- better yank in visual mode
|
||||||
require("which-key").register({
|
require("which-key").add({
|
||||||
y = { "ygv<esc>", "Yank" },
|
{ "y", "ygv<esc>", desc = "Yank", mode = "v" },
|
||||||
}, { mode = "v" })
|
})
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
local telekasten = require("telekasten")
|
local telekasten = require("telekasten")
|
||||||
telekasten.setup({
|
telekasten.setup({
|
||||||
home = vim.fn.expand("~/Nextcloud/Notes/zettelkasten"),
|
home = vim.fn.expand("~/Documents/Nextcloud/Notes/zettelkasten"),
|
||||||
auto_set_filetype = false,
|
auto_set_filetype = false,
|
||||||
image_subdir = "assets",
|
image_subdir = "assets",
|
||||||
})
|
})
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
local ls = require("luasnip")
|
||||||
|
local s = ls.snippet
|
||||||
|
local sn = ls.snippet_node
|
||||||
|
local isn = ls.indent_snippet_node
|
||||||
|
local t = ls.text_node
|
||||||
|
local i = ls.insert_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local c = ls.choice_node
|
||||||
|
local d = ls.dynamic_node
|
||||||
|
local r = ls.restore_node
|
||||||
|
local events = require("luasnip.util.events")
|
||||||
|
local ai = require("luasnip.nodes.absolute_indexer")
|
||||||
|
local extras = require("luasnip.extras")
|
||||||
|
local l = extras.lambda
|
||||||
|
local rep = extras.rep
|
||||||
|
local p = extras.partial
|
||||||
|
local m = extras.match
|
||||||
|
local n = extras.nonempty
|
||||||
|
local dl = extras.dynamic_lambda
|
||||||
|
local fmt = require("luasnip.extras.fmt").fmt
|
||||||
|
local fmta = require("luasnip.extras.fmt").fmta
|
||||||
|
local conds = require("luasnip.extras.expand_conditions")
|
||||||
|
local postfix = require("luasnip.extras.postfix").postfix
|
||||||
|
local types = require("luasnip.util.types")
|
||||||
|
local parse = require("luasnip.util.parser").parse_snippet
|
||||||
|
local ms = ls.multi_snippet
|
||||||
|
local k = require("luasnip.nodes.key_indexer").new_key
|
||||||
|
|
||||||
|
local def_template = [[
|
||||||
|
def {fname}({args}) do
|
||||||
|
{final}
|
||||||
|
end
|
||||||
|
]]
|
||||||
|
|
||||||
|
local def = s(
|
||||||
|
"def",
|
||||||
|
fmt(def_template, {
|
||||||
|
fname = i(1, "fname"),
|
||||||
|
args = i(2),
|
||||||
|
final = i(3),
|
||||||
|
}, { priority = 1001 })
|
||||||
|
)
|
||||||
|
|
||||||
|
return {
|
||||||
|
def,
|
||||||
|
}
|
|
@ -0,0 +1,120 @@
|
||||||
|
local ls = require("luasnip")
|
||||||
|
local s = ls.snippet
|
||||||
|
local sn = ls.snippet_node
|
||||||
|
local isn = ls.indent_snippet_node
|
||||||
|
local t = ls.text_node
|
||||||
|
local i = ls.insert_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local c = ls.choice_node
|
||||||
|
local d = ls.dynamic_node
|
||||||
|
local r = ls.restore_node
|
||||||
|
local events = require("luasnip.util.events")
|
||||||
|
local ai = require("luasnip.nodes.absolute_indexer")
|
||||||
|
local extras = require("luasnip.extras")
|
||||||
|
local l = extras.lambda
|
||||||
|
local rep = extras.rep
|
||||||
|
local p = extras.partial
|
||||||
|
local m = extras.match
|
||||||
|
local n = extras.nonempty
|
||||||
|
local dl = extras.dynamic_lambda
|
||||||
|
local fmt = require("luasnip.extras.fmt").fmt
|
||||||
|
local fmta = require("luasnip.extras.fmt").fmta
|
||||||
|
local conds = require("luasnip.extras.expand_conditions")
|
||||||
|
local postfix = require("luasnip.extras.postfix").postfix
|
||||||
|
local types = require("luasnip.util.types")
|
||||||
|
local parse = require("luasnip.util.parser").parse_snippet
|
||||||
|
local ms = ls.multi_snippet
|
||||||
|
local k = require("luasnip.nodes.key_indexer").new_key
|
||||||
|
local matches = require("luasnip.extras.postfix").matches
|
||||||
|
|
||||||
|
local case_template = [[
|
||||||
|
case {expression} {{
|
||||||
|
{pattern1} -> {result1}
|
||||||
|
{pattern2} -> {result2}{final}
|
||||||
|
}}
|
||||||
|
]]
|
||||||
|
|
||||||
|
local dot_case = postfix({ filetype = "gleam", trig = ".case", match_pattern = matches.line }, {
|
||||||
|
d(1, function(_, parent)
|
||||||
|
return sn(
|
||||||
|
1,
|
||||||
|
fmt(case_template, {
|
||||||
|
expression = t(parent.env.POSTFIX_MATCH),
|
||||||
|
pattern1 = i(1, "pattern"),
|
||||||
|
result1 = i(2, "todo"),
|
||||||
|
pattern2 = i(3, "_"),
|
||||||
|
result2 = i(4, "todo"),
|
||||||
|
final = i(0),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
end),
|
||||||
|
})
|
||||||
|
|
||||||
|
local case = s(
|
||||||
|
{ filetype = "gleam", trig = "case" },
|
||||||
|
fmt(case_template, {
|
||||||
|
expression = i(1),
|
||||||
|
pattern1 = i(2),
|
||||||
|
result1 = i(3, "todo"),
|
||||||
|
pattern2 = i(4, "_"),
|
||||||
|
result2 = i(5, "todo"),
|
||||||
|
final = i(0),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
local fn_template = [[
|
||||||
|
fn {name}({args}) -> {rtype} {{
|
||||||
|
{body}
|
||||||
|
}}
|
||||||
|
]]
|
||||||
|
|
||||||
|
local fn = s(
|
||||||
|
{ filetype = "gleam", trig = "fn" },
|
||||||
|
fmt(fn_template, {
|
||||||
|
name = i(1),
|
||||||
|
args = i(2),
|
||||||
|
rtype = i(3),
|
||||||
|
body = i(0),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
local pfn = s(
|
||||||
|
{ filetype = "gleam", trig = "pfn" },
|
||||||
|
fmt("pub " .. fn_template, {
|
||||||
|
name = i(1),
|
||||||
|
args = i(2),
|
||||||
|
rtype = i(3),
|
||||||
|
body = i(0),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
local type_template = [[
|
||||||
|
type {name} {{
|
||||||
|
{body}
|
||||||
|
}}
|
||||||
|
]]
|
||||||
|
|
||||||
|
local type = s(
|
||||||
|
{ filetype = "gleam", trig = "type" },
|
||||||
|
fmt(type_template, {
|
||||||
|
name = i(1),
|
||||||
|
body = i(0),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
local ptype = s(
|
||||||
|
{ filetype = "gleam", trig = "ptype" },
|
||||||
|
fmt("pub " .. type_template, {
|
||||||
|
name = i(1),
|
||||||
|
body = i(0),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
return {
|
||||||
|
case,
|
||||||
|
dot_case,
|
||||||
|
fn,
|
||||||
|
pfn,
|
||||||
|
type,
|
||||||
|
ptype,
|
||||||
|
}
|
|
@ -0,0 +1,138 @@
|
||||||
|
local ls = require("luasnip")
|
||||||
|
local s = ls.snippet
|
||||||
|
local sn = ls.snippet_node
|
||||||
|
local isn = ls.indent_snippet_node
|
||||||
|
local t = ls.text_node
|
||||||
|
local i = ls.insert_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local c = ls.choice_node
|
||||||
|
local d = ls.dynamic_node
|
||||||
|
local r = ls.restore_node
|
||||||
|
local events = require("luasnip.util.events")
|
||||||
|
local ai = require("luasnip.nodes.absolute_indexer")
|
||||||
|
local extras = require("luasnip.extras")
|
||||||
|
local l = extras.lambda
|
||||||
|
local rep = extras.rep
|
||||||
|
local p = extras.partial
|
||||||
|
local m = extras.match
|
||||||
|
local n = extras.nonempty
|
||||||
|
local dl = extras.dynamic_lambda
|
||||||
|
local fmt = require("luasnip.extras.fmt").fmt
|
||||||
|
local fmta = require("luasnip.extras.fmt").fmta
|
||||||
|
local conds = require("luasnip.extras.expand_conditions")
|
||||||
|
local postfix = require("luasnip.extras.postfix").postfix
|
||||||
|
local types = require("luasnip.util.types")
|
||||||
|
local parse = require("luasnip.util.parser").parse_snippet
|
||||||
|
local ms = ls.multi_snippet
|
||||||
|
local k = require("luasnip.nodes.key_indexer").new_key
|
||||||
|
|
||||||
|
local pe = s(
|
||||||
|
"pe",
|
||||||
|
fmt("<%= {final} %>", {
|
||||||
|
final = i(1),
|
||||||
|
}, { priority = 1001 })
|
||||||
|
)
|
||||||
|
|
||||||
|
local ln = s(
|
||||||
|
"ln",
|
||||||
|
fmt(
|
||||||
|
[[
|
||||||
|
<.link navigate={{~p"{path}"}}">{final}</.link>
|
||||||
|
]],
|
||||||
|
{ path = i(1, "/"), final = i(2) },
|
||||||
|
{ priority = 1001 }
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
local lp = s(
|
||||||
|
"lp",
|
||||||
|
fmt(
|
||||||
|
[[
|
||||||
|
<.link patch={{~p"{path}"}}">{final}</.link>
|
||||||
|
]],
|
||||||
|
{ path = i(1, "/"), final = i(2) },
|
||||||
|
{ priority = 1001 }
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
local if_ = s(
|
||||||
|
"if",
|
||||||
|
fmt("<%= if {condition} do %>{final}<% end %>", { condition = i(1, "condition"), final = i(2) }, { priority = 1001 })
|
||||||
|
)
|
||||||
|
|
||||||
|
local ife = s(
|
||||||
|
"ife",
|
||||||
|
fmt(
|
||||||
|
[[
|
||||||
|
<%= if {condition} do %>
|
||||||
|
{when}
|
||||||
|
<% else %>
|
||||||
|
{final}
|
||||||
|
<% end %>"
|
||||||
|
]],
|
||||||
|
{ condition = i(1, "condition"), when = i(2), final = i(3) },
|
||||||
|
{ priority = 1001 }
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
local for_ = s(
|
||||||
|
"for",
|
||||||
|
fmt(
|
||||||
|
[[
|
||||||
|
<%= for {item} <- {list} do %>
|
||||||
|
{final}
|
||||||
|
<% end %>
|
||||||
|
]],
|
||||||
|
{ item = i(1, "item"), list = i(2, "items"), final = i(3) },
|
||||||
|
{ priority = 1001 }
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
local lc =
|
||||||
|
s("lc", fmt("<.live_component module={{{module}}} id={{{id}}} />", { module = i(1), id = i(2) }, { priority = 1001 }))
|
||||||
|
|
||||||
|
local slot = s(
|
||||||
|
"slot",
|
||||||
|
fmt("<:slot>{final}</:slot>", {
|
||||||
|
final = i(1),
|
||||||
|
}, { priority = 1001 })
|
||||||
|
)
|
||||||
|
|
||||||
|
local socketp = s(
|
||||||
|
"socketp",
|
||||||
|
fmt(
|
||||||
|
[[
|
||||||
|
socket =
|
||||||
|
socket
|
||||||
|
|> {final}
|
||||||
|
]],
|
||||||
|
{ final = i(1) },
|
||||||
|
{ priority = 1001 }
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
local fl = s(
|
||||||
|
"fl",
|
||||||
|
fmt(
|
||||||
|
[[
|
||||||
|
<{elem} :for={{{item} <- {list}}} class="{class}">
|
||||||
|
{final}
|
||||||
|
</{elem}>
|
||||||
|
]],
|
||||||
|
{ elem = i(1, "div"), item = i(2, "item"), list = i(3, "items"), class = i(4), final = i(5) },
|
||||||
|
{ priority = 1001, repeat_duplicates = true }
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return {
|
||||||
|
pe,
|
||||||
|
ln,
|
||||||
|
lp,
|
||||||
|
if_,
|
||||||
|
ife,
|
||||||
|
for_,
|
||||||
|
lc,
|
||||||
|
slot,
|
||||||
|
socketp,
|
||||||
|
fl,
|
||||||
|
}
|
|
@ -0,0 +1,242 @@
|
||||||
|
local ls = require("luasnip")
|
||||||
|
local s = ls.snippet
|
||||||
|
local sn = ls.snippet_node
|
||||||
|
local isn = ls.indent_snippet_node
|
||||||
|
local t = ls.text_node
|
||||||
|
local i = ls.insert_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local c = ls.choice_node
|
||||||
|
local d = ls.dynamic_node
|
||||||
|
local r = ls.restore_node
|
||||||
|
local events = require("luasnip.util.events")
|
||||||
|
local ai = require("luasnip.nodes.absolute_indexer")
|
||||||
|
local extras = require("luasnip.extras")
|
||||||
|
local l = extras.lambda
|
||||||
|
local rep = extras.rep
|
||||||
|
local p = extras.partial
|
||||||
|
local m = extras.match
|
||||||
|
local n = extras.nonempty
|
||||||
|
local dl = extras.dynamic_lambda
|
||||||
|
local fmt = require("luasnip.extras.fmt").fmt
|
||||||
|
local fmta = require("luasnip.extras.fmt").fmta
|
||||||
|
local conds = require("luasnip.extras.expand_conditions")
|
||||||
|
local postfix = require("luasnip.extras.postfix").postfix
|
||||||
|
local types = require("luasnip.util.types")
|
||||||
|
local parse = require("luasnip.util.parser").parse_snippet
|
||||||
|
local ms = ls.multi_snippet
|
||||||
|
local k = require("luasnip.nodes.key_indexer").new_key
|
||||||
|
|
||||||
|
local arg_template = [[
|
||||||
|
{arg}: {type}
|
||||||
|
]]
|
||||||
|
|
||||||
|
local function pyarg()
|
||||||
|
return sn(
|
||||||
|
nil,
|
||||||
|
fmt(arg_template, {
|
||||||
|
arg = i(1, "arg"),
|
||||||
|
type = i(2, "Any"),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
local function pyargs(_, _, _, user_args)
|
||||||
|
local choices = {
|
||||||
|
sn(nil, i(1)),
|
||||||
|
sn(nil, {
|
||||||
|
not user_args and t(", ") or t(""),
|
||||||
|
d(1, pyarg),
|
||||||
|
d(2, pyargs, { user_args = { false } }),
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
-- switch order for first call
|
||||||
|
if user_args then
|
||||||
|
local fst, snd = unpack(choices)
|
||||||
|
choices = { snd, fst }
|
||||||
|
end
|
||||||
|
|
||||||
|
return sn(nil, c(1, choices))
|
||||||
|
end
|
||||||
|
|
||||||
|
local def_template = [[
|
||||||
|
def {fname}({args}) -> {rtype}:
|
||||||
|
"""
|
||||||
|
{docs}
|
||||||
|
"""
|
||||||
|
{final}
|
||||||
|
]]
|
||||||
|
|
||||||
|
local def = s(
|
||||||
|
"def",
|
||||||
|
fmt(def_template, {
|
||||||
|
fname = i(1, "fname"),
|
||||||
|
args = d(2, pyargs, nil, { user_args = { true } }),
|
||||||
|
rtype = i(3, "None"),
|
||||||
|
docs = i(4, "Documentation"),
|
||||||
|
final = i(5, "pass"),
|
||||||
|
}, { priority = 1001 })
|
||||||
|
)
|
||||||
|
|
||||||
|
local defs_template = [[
|
||||||
|
def {mname}(self, {args}) -> {rtype}:
|
||||||
|
"""
|
||||||
|
{docs}
|
||||||
|
"""
|
||||||
|
{final}
|
||||||
|
]]
|
||||||
|
|
||||||
|
local defs = s(
|
||||||
|
"defs",
|
||||||
|
fmt(defs_template, {
|
||||||
|
mname = i(1, "mname"),
|
||||||
|
args = d(2, pyargs, nil, { user_args = { true } }),
|
||||||
|
rtype = i(3, "None"),
|
||||||
|
docs = i(4, "Documentation"),
|
||||||
|
final = i(5, "pass"),
|
||||||
|
}, { priority = 1001 })
|
||||||
|
)
|
||||||
|
|
||||||
|
local enum_template = [[
|
||||||
|
for {i}, {value} in enumerate({iter}):
|
||||||
|
{final}
|
||||||
|
]]
|
||||||
|
|
||||||
|
local dot_enum = postfix(".enum", {
|
||||||
|
d(1, function(_, parent)
|
||||||
|
return sn(
|
||||||
|
1,
|
||||||
|
fmt(enum_template, {
|
||||||
|
i = i(1, "i"),
|
||||||
|
value = i(2, "value"),
|
||||||
|
iter = t(parent.env.POSTFIX_MATCH),
|
||||||
|
final = i(3, "pass"),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
end),
|
||||||
|
})
|
||||||
|
|
||||||
|
local enum = s(
|
||||||
|
"enum",
|
||||||
|
fmt(enum_template, {
|
||||||
|
i = i(1, "i"),
|
||||||
|
value = i(2, "value"),
|
||||||
|
iter = i(3, "iter"),
|
||||||
|
final = i(4, "pass"),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
local for_template = [[
|
||||||
|
for {item} in {iter}:
|
||||||
|
{final}
|
||||||
|
]]
|
||||||
|
|
||||||
|
local dot_for = postfix(".for", {
|
||||||
|
d(1, function(_, parent)
|
||||||
|
return sn(
|
||||||
|
1,
|
||||||
|
fmt(for_template, {
|
||||||
|
item = i(1, "item"),
|
||||||
|
iter = t(parent.env.POSTFIX_MATCH),
|
||||||
|
final = i(2, "pass"),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
end),
|
||||||
|
})
|
||||||
|
|
||||||
|
local items_template = [[
|
||||||
|
for {key}, {value} in {iter}:
|
||||||
|
{final}
|
||||||
|
]]
|
||||||
|
|
||||||
|
local dot_items = postfix(".items", {
|
||||||
|
d(1, function(_, parent)
|
||||||
|
return sn(
|
||||||
|
1,
|
||||||
|
fmt(items_template, {
|
||||||
|
key = i(1, "key"),
|
||||||
|
value = i(2, "value"),
|
||||||
|
iter = t(parent.env.POSTFIX_MATCH),
|
||||||
|
final = i(3, "pass"),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
end),
|
||||||
|
})
|
||||||
|
|
||||||
|
local try_template = [[
|
||||||
|
try:
|
||||||
|
{raises}
|
||||||
|
except {exception} as {ename}:
|
||||||
|
{final}
|
||||||
|
]]
|
||||||
|
|
||||||
|
local dot_try = postfix(".try", {
|
||||||
|
d(1, function(_, parent)
|
||||||
|
return sn(
|
||||||
|
1,
|
||||||
|
fmt(try_template, {
|
||||||
|
raises = t(parent.env.POSTFIX_MATCH),
|
||||||
|
exception = i(1, "Exception"),
|
||||||
|
ename = i(2, "e"),
|
||||||
|
final = i(3, "pass"),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
end),
|
||||||
|
})
|
||||||
|
|
||||||
|
local parr = s(
|
||||||
|
"parr",
|
||||||
|
fmt(
|
||||||
|
[[
|
||||||
|
:param {name}: {description}
|
||||||
|
:type {name}: {type}
|
||||||
|
]],
|
||||||
|
{
|
||||||
|
name = i(1, "name"),
|
||||||
|
description = i(2, "description"),
|
||||||
|
type = i(3, "type"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
repeat_duplicates = true,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
local retr = s(
|
||||||
|
"retr",
|
||||||
|
fmt(
|
||||||
|
[[
|
||||||
|
:return: {description}
|
||||||
|
:rtype: {rtype}
|
||||||
|
]],
|
||||||
|
{
|
||||||
|
description = i(1, "description"),
|
||||||
|
rtype = i(2, "rtype"),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
local raisr = s(
|
||||||
|
"raisr",
|
||||||
|
fmt(
|
||||||
|
[[
|
||||||
|
:raises {exception}: {description}
|
||||||
|
]],
|
||||||
|
{
|
||||||
|
exception = i(1, "Exception"),
|
||||||
|
description = i(2, "description"),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return {
|
||||||
|
def,
|
||||||
|
defs,
|
||||||
|
dot_enum,
|
||||||
|
dot_for,
|
||||||
|
dot_items,
|
||||||
|
dot_try,
|
||||||
|
enum,
|
||||||
|
parr,
|
||||||
|
retr,
|
||||||
|
raisr,
|
||||||
|
}
|
|
@ -1,42 +1,68 @@
|
||||||
{ lib, pkgs, ... }:
|
{ pkgs, inputs, lib, ... }:
|
||||||
|
|
||||||
with builtins;
|
|
||||||
{
|
{
|
||||||
config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [
|
config.home-manager.users.moritz.programs.neovim.lazy.plugins = [
|
||||||
|
(
|
||||||
|
let
|
||||||
|
nvim-treesitter = pkgs.vimPlugins.nvim-treesitter;
|
||||||
|
parserDir = pkgs.symlinkJoin {
|
||||||
|
name = "tresitter-grammars-all";
|
||||||
|
paths = nvim-treesitter.withAllGrammars.dependencies;
|
||||||
|
};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
plugin = nvim-treesitter;
|
plugin = nvim-treesitter;
|
||||||
event = [ "BufReadPost" "BufNewFile" ];
|
event = [ "BufReadPost" "BufNewFile" ];
|
||||||
conf =
|
opts = {
|
||||||
let
|
sync_install = false;
|
||||||
parserDir = pkgs.symlinkJoin {
|
auto_install = false;
|
||||||
name = "tresitter-grammars-all";
|
highlight = {
|
||||||
paths = lib.attrValues (lib.filterAttrs (_: builtins.isAttrs) nvim-treesitter-parsers);
|
enable = true;
|
||||||
|
disable = [ "latex" ];
|
||||||
};
|
};
|
||||||
in
|
textobjects =
|
||||||
readFile ./lua/nvim-treesitter.lua + ''
|
{
|
||||||
vim.opt.runtimepath:append("${parserDir}")
|
select =
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
|
||||||
require'nvim-treesitter.configs'.setup {
|
# Automatically jump forward to textobj, similar to targets.vim
|
||||||
parser_install_dir = "${parserDir}",
|
lookahead = false;
|
||||||
}
|
|
||||||
|
keymaps = {
|
||||||
|
# You can use the capture groups defined in textobjects.scm
|
||||||
|
"af" = {
|
||||||
|
query = "@function.outer";
|
||||||
|
desc = "Select outer part of a function region";
|
||||||
|
};
|
||||||
|
"if" = {
|
||||||
|
query = "@function.inner";
|
||||||
|
desc = "Select inner part of a function region";
|
||||||
|
};
|
||||||
|
"ac" = {
|
||||||
|
query = "@class.outer";
|
||||||
|
desc = "Select outer part of a class region";
|
||||||
|
};
|
||||||
|
"ic" = {
|
||||||
|
query = "@class.inner";
|
||||||
|
desc = "Select inner part of a class region";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
conf =
|
||||||
|
/* lua */ ''
|
||||||
|
vim.opt.runtimepath:append("${parserDir}")
|
||||||
|
local final_opts = vim.tbl_deep_extend("keep", opts, { parser_install_dir = "${parserDir}" })
|
||||||
|
require('nvim-treesitter.configs').setup(final_opts)
|
||||||
'';
|
'';
|
||||||
|
priority = 100;
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ plugin = nvim-ts-context-commentstring; }
|
{ plugin = pkgs.vimPlugins.nvim-treesitter-textobjects; }
|
||||||
|
{ plugin = pkgs.vimPlugins.nvim-ts-context-commentstring; opts = { }; }
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
)
|
||||||
plugin = nvim-treesitter-textsubjects;
|
|
||||||
event = [ "BufReadPost" "BufNewFile" ];
|
|
||||||
conf = readFile ./lua/nvim-treesitter-textsubjects.lua;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = nvim-treesitter-context;
|
|
||||||
event = [ "BufReadPost" "BufNewFile" ];
|
|
||||||
opts = { };
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = hmts-nvim;
|
|
||||||
ft = [ "nix" ];
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,47 +1,84 @@
|
||||||
{ pkgs, ... }:
|
{ pkgs, lib, inputs, ... }:
|
||||||
|
|
||||||
with builtins;
|
let
|
||||||
|
inherit (lib) readFile;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
config.home-manager.users.moritz.programs.neovim.lazy.plugins = with pkgs.vimPlugins; [
|
config.home-manager.users.moritz.programs.neovim.lazy.plugins = [
|
||||||
{
|
{
|
||||||
plugin = which-key-nvim;
|
plugin = pkgs.vimPlugins.which-key-nvim;
|
||||||
lazy = false;
|
lazy = false;
|
||||||
conf = readFile ./lua/which-key-nvim.lua;
|
conf = readFile ./lua/which-key-nvim.lua;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = catppuccin-nvim;
|
plugin = pkgs.vimPlugins.catppuccin-nvim;
|
||||||
conf = readFile ./lua/catppuccin-nvim.lua;
|
conf = readFile ./lua/catppuccin-nvim.lua;
|
||||||
lazy = false;
|
lazy = false;
|
||||||
priority = 99;
|
priority = 99;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = todo-comments-nvim;
|
plugin = pkgs.vimPlugins.todo-comments-nvim;
|
||||||
event = [ "BufReadPost" "BufNewFile" ];
|
dependencies = [{ plugin = pkgs.vimPlugins.plenary-nvim; }];
|
||||||
dependencies = [{ plugin = plenary-nvim; }];
|
|
||||||
opts = { };
|
opts = { };
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = statuscol-nvim;
|
plugin = pkgs.vimPlugins.dressing-nvim;
|
||||||
event = [ "VeryLazy" ];
|
|
||||||
conf = readFile ./lua/statuscol-nvim.lua;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = smartcolumn-nvim;
|
|
||||||
event = [ "BufReadPost" "BufNewFile" ];
|
|
||||||
opts = {
|
|
||||||
colorcolumn = "120";
|
|
||||||
disabled_filetypes = [ "help" "text" "markdown" "dashboard" ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
{
|
|
||||||
plugin = dressing-nvim;
|
|
||||||
event = [ "VeryLazy" ];
|
event = [ "VeryLazy" ];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
plugin = gitsigns-nvim;
|
plugin = pkgs.vimPlugins.gitsigns-nvim;
|
||||||
event = [ "BufReadPost" "BufNewFile" ];
|
event = [ "BufReadPost" "BufNewFile" ];
|
||||||
conf = readFile ./lua/gitsigns-nvim.lua;
|
conf = readFile ./lua/gitsigns-nvim.lua;
|
||||||
dependencies = [{ plugin = which-key-nvim; }];
|
dependencies = [{ plugin = pkgs.vimPlugins.which-key-nvim; }];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
plugin = pkgs.vimUtils.buildVimPlugin {
|
||||||
|
pname = "hawtkeys-nvim";
|
||||||
|
version = lib.my.mkVersionInput inputs.hawtkeys-nvim;
|
||||||
|
src = inputs.hawtkeys-nvim;
|
||||||
|
};
|
||||||
|
cmd = [ "Hawtkeys" "HawtkeysAll" "HawtkeysDupes" ];
|
||||||
|
opts = { };
|
||||||
|
dependencies = [
|
||||||
|
{ plugin = pkgs.vimPlugins.plenary-nvim; }
|
||||||
|
{ plugin = pkgs.vimPlugins.nvim-treesitter; }
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
plugin = pkgs.vimPlugins.zen-mode-nvim;
|
||||||
|
keys = [
|
||||||
|
{ key = "<leader>tz"; cmd = "<cmd>ZenMode<cr>"; desc = "Zen mode"; }
|
||||||
|
];
|
||||||
|
conf = /* lua */ ''
|
||||||
|
require("zen-mode").setup({
|
||||||
|
plugins = {
|
||||||
|
tmux = {
|
||||||
|
enabled = true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
'';
|
||||||
|
dependencies = [
|
||||||
|
{
|
||||||
|
plugin = pkgs.vimPlugins.twilight-nvim;
|
||||||
|
keys = [
|
||||||
|
{ key = "<leader>tZ"; cmd = "<cmd>Twilight<cr>"; desc = "Twilight mode"; }
|
||||||
|
];
|
||||||
|
conf = /* lua */ ''
|
||||||
|
require("twilight").setup({
|
||||||
|
context = 20,
|
||||||
|
expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types
|
||||||
|
"function",
|
||||||
|
"function_definition",
|
||||||
|
"if_statement",
|
||||||
|
"method",
|
||||||
|
"method_definition",
|
||||||
|
"table",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
'';
|
||||||
|
}
|
||||||
|
];
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,13 @@
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
|
inherit (lib) range filterAttrs attrNames foldl' head tail mkOption mkEnableOption intersectLists genAttrs flip getAttr;
|
||||||
|
inherit (lib.types) listOf enum package;
|
||||||
|
|
||||||
cfg = config.my.programs.python;
|
cfg = config.my.programs.python;
|
||||||
|
|
||||||
pythonVersions = map (version: "3${toString version}") (range 8 11);
|
pythonVersions = map (version: "3${toString version}") (range 8 13);
|
||||||
enabledVersions = filterAttrs (_: value: value.enable) cfg.versions;
|
enabledVersions = filterAttrs (_: value: value.enable) cfg.versions;
|
||||||
|
|
||||||
pythonPackages = version: attrNames pkgs."python${version}Packages";
|
pythonPackages = version: attrNames pkgs."python${version}Packages";
|
||||||
|
@ -23,7 +25,7 @@ let
|
||||||
enable = mkEnableOption (toString version);
|
enable = mkEnableOption (toString version);
|
||||||
pythonPackages = mkOption {
|
pythonPackages = mkOption {
|
||||||
default = [ ];
|
default = [ ];
|
||||||
type = with types; listOf (enum (pythonPackages version));
|
type = listOf (enum (pythonPackages version));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
@ -32,15 +34,11 @@ in
|
||||||
versions = genAttrs pythonVersions versionOpts;
|
versions = genAttrs pythonVersions versionOpts;
|
||||||
defaultPackages = mkOption {
|
defaultPackages = mkOption {
|
||||||
default = [ ];
|
default = [ ];
|
||||||
type = with types; listOf (enum commonPackages);
|
type = listOf (enum commonPackages);
|
||||||
};
|
};
|
||||||
extraPackages = mkOption {
|
extraPackages = mkOption {
|
||||||
default = with pkgs; [
|
default = [ ];
|
||||||
poetry
|
type = listOf package;
|
||||||
ruff
|
|
||||||
python310Packages.python-lsp-server
|
|
||||||
];
|
|
||||||
type = with types; listOf package;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,293 @@
|
||||||
|
{ config
|
||||||
|
, lib
|
||||||
|
, pkgs
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
|
||||||
|
|
||||||
|
let
|
||||||
|
inherit (lib) mkEnableOption mkIf mkOption types;
|
||||||
|
|
||||||
|
cfg = config.my.programs.river;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.programs.river = {
|
||||||
|
enable = mkEnableOption "river";
|
||||||
|
keyboardLayouts = mkOption {
|
||||||
|
type = types.listOf types.str;
|
||||||
|
description = "list of keyboard layouts";
|
||||||
|
default = [ "us" "de" ];
|
||||||
|
};
|
||||||
|
nvidiaSupport = mkEnableOption "nvidiaSupport";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.river.enable = true;
|
||||||
|
my = {
|
||||||
|
programs = {
|
||||||
|
wallpaper.enable = true;
|
||||||
|
kitty.enable = true;
|
||||||
|
tofi.enable = true;
|
||||||
|
};
|
||||||
|
wallpapers.enable = true;
|
||||||
|
services = {
|
||||||
|
dunst.enable = true;
|
||||||
|
wallpaper = {
|
||||||
|
enable = true;
|
||||||
|
target = "river-session.target";
|
||||||
|
};
|
||||||
|
spotify-player.target = "river-session.target";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
home-manager.users.moritz = {
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
rivercarro
|
||||||
|
];
|
||||||
|
services.kanshi = {
|
||||||
|
enable = true;
|
||||||
|
systemdTarget = "river-session.target";
|
||||||
|
};
|
||||||
|
wayland.windowManager.river = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
border-width = 2;
|
||||||
|
declare-mode = [
|
||||||
|
"locked"
|
||||||
|
"normal"
|
||||||
|
"passthrough"
|
||||||
|
];
|
||||||
|
map = {
|
||||||
|
normal = {
|
||||||
|
"Super Q" = "close";
|
||||||
|
"Super Return" = "spawn kitty";
|
||||||
|
"Super R" = ''spawn 'exec $(tofi-run --fuzzy-match=true)' '';
|
||||||
|
"Super W" = ''spawn "pkill -USR1 waybar"'';
|
||||||
|
"Super+Shift R" = "spawn ~/.config/river/init";
|
||||||
|
|
||||||
|
# Focus view
|
||||||
|
"Super J" = "focus-view next";
|
||||||
|
"Super K" = "focus-view previous";
|
||||||
|
|
||||||
|
# swap the focused view
|
||||||
|
"Super+Shift J" = "swap next";
|
||||||
|
"Super+Shift K" = "swap previous";
|
||||||
|
|
||||||
|
# focus output
|
||||||
|
"Super Period" = "focus-output next";
|
||||||
|
"Super Comma" = "focus-output previous";
|
||||||
|
|
||||||
|
# send to output
|
||||||
|
"Super+Shift Period" = "send-to-output next";
|
||||||
|
"Super+Shift Comma" = "send-to-output previous";
|
||||||
|
|
||||||
|
# bump in layout stack
|
||||||
|
"Super Z" = "zoom";
|
||||||
|
|
||||||
|
# lock screen
|
||||||
|
"Super+Alt L" = ''spawn "loginctl lock-session"'';
|
||||||
|
} //
|
||||||
|
# tags
|
||||||
|
(
|
||||||
|
let
|
||||||
|
numbers = lib.range 1 9;
|
||||||
|
toTag = num: "$((1 << (${toString num} - 1)))";
|
||||||
|
|
||||||
|
mkMappings = num:
|
||||||
|
let
|
||||||
|
numStr = toString num;
|
||||||
|
tag = toTag num;
|
||||||
|
in
|
||||||
|
[
|
||||||
|
# Super+Control+[1-9] to toggle focus of tag [0-8]
|
||||||
|
{ name = "Super ${numStr}"; value = "set-focused-tags ${tag}"; }
|
||||||
|
|
||||||
|
# Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view
|
||||||
|
{ name = "Super+Shift ${numStr}"; value = "toggle-view-tags ${tag}"; }
|
||||||
|
];
|
||||||
|
mappings = lib.flatten (map mkMappings numbers);
|
||||||
|
in
|
||||||
|
lib.listToAttrs mappings
|
||||||
|
);
|
||||||
|
};
|
||||||
|
map-pointer = {
|
||||||
|
normal = {
|
||||||
|
"Super BTN_LEFT" = "move-view";
|
||||||
|
"Super BTN_RIGHT" = "resize-view";
|
||||||
|
"Super BTN_MIDDLE" = "toggle-float";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
attach-mode = "bottom";
|
||||||
|
default-layout = "rivercarro";
|
||||||
|
focus-follows-cursor = "normal";
|
||||||
|
hide-cursor = {
|
||||||
|
timeout = "1500";
|
||||||
|
when-typing = "enabled";
|
||||||
|
};
|
||||||
|
set-cursor-warp = "on-focus-change";
|
||||||
|
keyboard-layout = "-options grp:win_space_toggle,caps:escape ${lib.concatStringsSep "," cfg.keyboardLayouts}";
|
||||||
|
};
|
||||||
|
extraConfig = /* bash */ ''
|
||||||
|
rivercarro_pid="$(pidof rivercarro)"
|
||||||
|
if [[ -z $rivercarro_pid ]]; then
|
||||||
|
rivercarro -inner-gaps 4 -outer-gaps 4 &
|
||||||
|
fi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# add waybar as a status bar
|
||||||
|
programs.waybar = {
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.waybar.overrideAttrs (old: {
|
||||||
|
patches = old.patches or [ ] ++ [
|
||||||
|
(pkgs.fetchpatch {
|
||||||
|
url = "https://gitlab.archlinux.org/archlinux/packaging/packages/waybar/-/raw/0306af03fcb6de6aee1e288f42b0bf1b223513bd/a544f4b2cdcf632f1a4424b89f6e3d85ef5aaa85.patch";
|
||||||
|
sha256 = "sha256-S/1oUj9Aj6BElNTsDY8CTcKtS1j7Gl54JFgCywH05pg=";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
});
|
||||||
|
|
||||||
|
# start using systemd service
|
||||||
|
systemd = {
|
||||||
|
enable = true;
|
||||||
|
target = "river-session.target";
|
||||||
|
};
|
||||||
|
|
||||||
|
settings = {
|
||||||
|
mainBar = {
|
||||||
|
start_hidden = true;
|
||||||
|
layer = "top";
|
||||||
|
position = "top";
|
||||||
|
height = 20;
|
||||||
|
modules-left = [ "river/tags" ];
|
||||||
|
modules-center = [ "river/window" ];
|
||||||
|
modules-right = [ "network" "memory" "cpu" "battery" "clock" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
style = lib.readFile ./style.css;
|
||||||
|
};
|
||||||
|
|
||||||
|
# lock screen after timeout
|
||||||
|
programs.swaylock = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
color = "000000";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
services.swayidle = {
|
||||||
|
enable = true;
|
||||||
|
events = [
|
||||||
|
{
|
||||||
|
event = "before-sleep";
|
||||||
|
command = "${lib.getExe pkgs.swaylock} -fF";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
event = "lock";
|
||||||
|
command = "${lib.getExe pkgs.swaylock} -fF";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
timeouts =
|
||||||
|
let
|
||||||
|
lockTimeout = 10;
|
||||||
|
in
|
||||||
|
[
|
||||||
|
{
|
||||||
|
timeout = lockTimeout * 60 - 10;
|
||||||
|
command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
timeout = lockTimeout * 60 + 10;
|
||||||
|
command = "${pkgs.systemd}/bin/loginctl lock-session";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
systemdTarget = "river-session.target";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# adds pam module for swaylock
|
||||||
|
security.pam.services.swaylock = { };
|
||||||
|
|
||||||
|
# add user packages for wayland and hyprland in particular
|
||||||
|
users.users.moritz.packages = with pkgs; [
|
||||||
|
brightnessctl # control brightness
|
||||||
|
grimblast # screenshot tool for hyprland
|
||||||
|
pamixer # pulse audio cli
|
||||||
|
playerctl # control media playback
|
||||||
|
slurp # region select for wayland (for screensharing)
|
||||||
|
wdisplays # manage monitors
|
||||||
|
wl-clipboard # clipboard tool for wayland
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
# additional environment variables
|
||||||
|
environment.sessionVariables =
|
||||||
|
{
|
||||||
|
XDG_CURRENT_DESKTOP = "river";
|
||||||
|
XDG_SESSION_TYPE = "wayland";
|
||||||
|
XDG_SESSION_DESKTOP = "river";
|
||||||
|
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
|
||||||
|
QT_QPA_PLATFORM = "wayland;xcb";
|
||||||
|
QT_WAYLAND_DISABLE_WINDOWDECORATION = "1";
|
||||||
|
QT_QPA_PLATFORMTHEME = "qt5ct";
|
||||||
|
_JAVA_AWT_WM_NONEREPARENTING = "1";
|
||||||
|
} // (lib.optionalAttrs cfg.nvidiaSupport
|
||||||
|
{
|
||||||
|
GBM_BACKEND = "nvidia-drm";
|
||||||
|
GDK_BACKEND = "wayland";
|
||||||
|
LIBVA_DRIVER_NAME = "nvidia";
|
||||||
|
MOZ_ENABLE_WAYLAND = "1";
|
||||||
|
WLR_DRM_DEVICES = "/dev/dri/card0";
|
||||||
|
WLR_DRM_NO_ATOMIC = "1";
|
||||||
|
WLR_NO_HARDWARE_CURSORS = "1";
|
||||||
|
XDG_CURRENT_DESKTOP = "river";
|
||||||
|
_GL_GSYNC_ALLOWED = "0";
|
||||||
|
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||||
|
__GL_VRR_ALLOWED = "0";
|
||||||
|
});
|
||||||
|
|
||||||
|
services = {
|
||||||
|
dbus.enable = true;
|
||||||
|
# use pipewire (needed for screensharing)
|
||||||
|
pipewire = {
|
||||||
|
enable = true;
|
||||||
|
alsa.enable = true;
|
||||||
|
alsa.support32Bit = true;
|
||||||
|
pulse.enable = true;
|
||||||
|
};
|
||||||
|
displayManager = {
|
||||||
|
autoLogin = {
|
||||||
|
enable = true;
|
||||||
|
user = "moritz";
|
||||||
|
};
|
||||||
|
defaultSession = "river";
|
||||||
|
};
|
||||||
|
xserver = {
|
||||||
|
enable = true;
|
||||||
|
displayManager.lightdm.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
security.rtkit.enable = true;
|
||||||
|
|
||||||
|
home-manager.users.moritz.systemd.user.services =
|
||||||
|
let
|
||||||
|
units = [ "waybar" ];
|
||||||
|
mkAfter = _: {
|
||||||
|
Unit = {
|
||||||
|
After = [ "river-session.target" ];
|
||||||
|
Wants = [ "river-session.target" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
lib.genAttrs units mkAfter;
|
||||||
|
|
||||||
|
systemd.user.services =
|
||||||
|
let
|
||||||
|
units = [ "pipewire" "xdg-desktop-portal" "wireplumber" ];
|
||||||
|
mkAfter = _: {
|
||||||
|
after = [ "river-session.target" ];
|
||||||
|
wants = [ "river-session.target" ];
|
||||||
|
};
|
||||||
|
in
|
||||||
|
lib.genAttrs units mkAfter;
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,339 @@
|
||||||
|
* {
|
||||||
|
/* `otf-font-awesome` is required to be installed for icons */
|
||||||
|
font-family: FontAwesome, Roboto, Helvetica, Arial, sans-serif;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
window#waybar {
|
||||||
|
background-color: rgba(43, 48, 59, 0.5);
|
||||||
|
border-bottom: 3px solid rgba(100, 114, 125, 0.5);
|
||||||
|
color: #ffffff;
|
||||||
|
transition-property: background-color;
|
||||||
|
transition-duration: .5s;
|
||||||
|
}
|
||||||
|
|
||||||
|
window#waybar.hidden {
|
||||||
|
opacity: 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
window#waybar.empty {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
window#waybar.solo {
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
window#waybar.termite {
|
||||||
|
background-color: #3F3F3F;
|
||||||
|
}
|
||||||
|
|
||||||
|
window#waybar.chromium {
|
||||||
|
background-color: #000000;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
/* Use box-shadow instead of border so the text isn't offset */
|
||||||
|
box-shadow: inset 0 -3px transparent;
|
||||||
|
/* Avoid rounded borders under each button name */
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||||
|
button:hover {
|
||||||
|
background: inherit;
|
||||||
|
box-shadow: inset 0 -3px #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* you can set a style on hover for any module like this */
|
||||||
|
#pulseaudio:hover {
|
||||||
|
background-color: #a37800;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button {
|
||||||
|
padding: 0 5px;
|
||||||
|
background-color: transparent;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button:hover {
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.focused {
|
||||||
|
background-color: #64727D;
|
||||||
|
box-shadow: inset 0 -3px #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#workspaces button.urgent {
|
||||||
|
background-color: #eb4d4b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mode {
|
||||||
|
background-color: #64727D;
|
||||||
|
box-shadow: inset 0 -3px #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock,
|
||||||
|
#battery,
|
||||||
|
#cpu,
|
||||||
|
#memory,
|
||||||
|
#disk,
|
||||||
|
#temperature,
|
||||||
|
#backlight,
|
||||||
|
#network,
|
||||||
|
#pulseaudio,
|
||||||
|
#wireplumber,
|
||||||
|
#custom-media,
|
||||||
|
#tray,
|
||||||
|
#mode,
|
||||||
|
#idle_inhibitor,
|
||||||
|
#scratchpad,
|
||||||
|
#power-profiles-daemon,
|
||||||
|
#mpd {
|
||||||
|
padding: 0 10px;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#window,
|
||||||
|
#workspaces {
|
||||||
|
margin: 0 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If workspaces is the leftmost module, omit left margin */
|
||||||
|
.modules-left > widget:first-child > #workspaces {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* If workspaces is the rightmost module, omit right margin */
|
||||||
|
.modules-right > widget:last-child > #workspaces {
|
||||||
|
margin-right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#clock {
|
||||||
|
background-color: #64727D;
|
||||||
|
}
|
||||||
|
|
||||||
|
#battery {
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#battery.charging, #battery.plugged {
|
||||||
|
color: #ffffff;
|
||||||
|
background-color: #26A65B;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes blink {
|
||||||
|
to {
|
||||||
|
background-color: #ffffff;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Using steps() instead of linear as a timing function to limit cpu usage */
|
||||||
|
#battery.critical:not(.charging) {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
color: #ffffff;
|
||||||
|
animation-name: blink;
|
||||||
|
animation-duration: 0.5s;
|
||||||
|
animation-timing-function: steps(12);
|
||||||
|
animation-iteration-count: infinite;
|
||||||
|
animation-direction: alternate;
|
||||||
|
}
|
||||||
|
|
||||||
|
#power-profiles-daemon {
|
||||||
|
padding-right: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#power-profiles-daemon.performance {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#power-profiles-daemon.balanced {
|
||||||
|
background-color: #2980b9;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
#power-profiles-daemon.power-saver {
|
||||||
|
background-color: #2ecc71;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
label:focus {
|
||||||
|
background-color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cpu {
|
||||||
|
background-color: #2ecc71;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#memory {
|
||||||
|
background-color: #9b59b6;
|
||||||
|
}
|
||||||
|
|
||||||
|
#disk {
|
||||||
|
background-color: #964B00;
|
||||||
|
}
|
||||||
|
|
||||||
|
#backlight {
|
||||||
|
background-color: #90b1b1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#network {
|
||||||
|
background-color: #2980b9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#network.disconnected {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pulseaudio {
|
||||||
|
background-color: #f1c40f;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pulseaudio.muted {
|
||||||
|
background-color: #90b1b1;
|
||||||
|
color: #2a5c45;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wireplumber {
|
||||||
|
background-color: #fff0f5;
|
||||||
|
color: #000000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#wireplumber.muted {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-media {
|
||||||
|
background-color: #66cc99;
|
||||||
|
color: #2a5c45;
|
||||||
|
min-width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-media.custom-spotify {
|
||||||
|
background-color: #66cc99;
|
||||||
|
}
|
||||||
|
|
||||||
|
#custom-media.custom-vlc {
|
||||||
|
background-color: #ffa000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#temperature {
|
||||||
|
background-color: #f0932b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#temperature.critical {
|
||||||
|
background-color: #eb4d4b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tray {
|
||||||
|
background-color: #2980b9;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tray > .passive {
|
||||||
|
-gtk-icon-effect: dim;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tray > .needs-attention {
|
||||||
|
-gtk-icon-effect: highlight;
|
||||||
|
background-color: #eb4d4b;
|
||||||
|
}
|
||||||
|
|
||||||
|
#idle_inhibitor {
|
||||||
|
background-color: #2d3436;
|
||||||
|
}
|
||||||
|
|
||||||
|
#idle_inhibitor.activated {
|
||||||
|
background-color: #ecf0f1;
|
||||||
|
color: #2d3436;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd {
|
||||||
|
background-color: #66cc99;
|
||||||
|
color: #2a5c45;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd.disconnected {
|
||||||
|
background-color: #f53c3c;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd.stopped {
|
||||||
|
background-color: #90b1b1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#mpd.paused {
|
||||||
|
background-color: #51a37a;
|
||||||
|
}
|
||||||
|
|
||||||
|
#language {
|
||||||
|
background: #00b093;
|
||||||
|
color: #740864;
|
||||||
|
padding: 0 5px;
|
||||||
|
margin: 0 5px;
|
||||||
|
min-width: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#keyboard-state {
|
||||||
|
background: #97e1ad;
|
||||||
|
color: #000000;
|
||||||
|
padding: 0 0px;
|
||||||
|
margin: 0 5px;
|
||||||
|
min-width: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#keyboard-state > label {
|
||||||
|
padding: 0 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#keyboard-state > label.locked {
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
#scratchpad {
|
||||||
|
background: rgba(0, 0, 0, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
#scratchpad.empty {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
#privacy {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#privacy-item {
|
||||||
|
padding: 0 5px;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#privacy-item.screenshare {
|
||||||
|
background-color: #cf5700;
|
||||||
|
}
|
||||||
|
|
||||||
|
#privacy-item.audio-in {
|
||||||
|
background-color: #1ca000;
|
||||||
|
}
|
||||||
|
|
||||||
|
#privacy-item.audio-out {
|
||||||
|
background-color: #0069d4;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tags button {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tags button.occupied {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
|
||||||
|
#tags button.focused {
|
||||||
|
background-color: grey;
|
||||||
|
}
|
|
@ -12,10 +12,8 @@ in
|
||||||
options.my.programs.sway.enable = mkEnableOption "sway";
|
options.my.programs.sway.enable = mkEnableOption "sway";
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
hardware.opengl = {
|
hardware.opengl.enable = true;
|
||||||
enable = true;
|
|
||||||
driSupport = true;
|
|
||||||
};
|
|
||||||
environment.loginShellInit = ''
|
environment.loginShellInit = ''
|
||||||
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
|
if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then
|
||||||
exec sway
|
exec sway
|
||||||
|
|
|
@ -7,8 +7,7 @@ let
|
||||||
tmux-switch = pkgs.writeShellApplication {
|
tmux-switch = pkgs.writeShellApplication {
|
||||||
name = "tmux-switch";
|
name = "tmux-switch";
|
||||||
runtimeInputs = with pkgs; [ tmux ];
|
runtimeInputs = with pkgs; [ tmux ];
|
||||||
text = ''
|
text = /* bash */ ''
|
||||||
#!/usr/bin/env bash
|
|
||||||
if [[ -z ''${TMUX+x} ]]; then
|
if [[ -z ''${TMUX+x} ]]; then
|
||||||
tmux attach -t "$1"
|
tmux attach -t "$1"
|
||||||
else
|
else
|
||||||
|
@ -19,7 +18,7 @@ let
|
||||||
|
|
||||||
tmux-sessionizer = pkgs.writeFishApplication {
|
tmux-sessionizer = pkgs.writeFishApplication {
|
||||||
name = "ts";
|
name = "ts";
|
||||||
runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd tmux-switch ];
|
runtimeInputs = with pkgs; [ tmux findutils coreutils procps fd tmux-new gawk ];
|
||||||
text = readFile ./tmux-sessionizer/script.fish;
|
text = readFile ./tmux-sessionizer/script.fish;
|
||||||
completions = readFile ./tmux-sessionizer/completions.fish;
|
completions = readFile ./tmux-sessionizer/completions.fish;
|
||||||
};
|
};
|
||||||
|
@ -31,6 +30,17 @@ let
|
||||||
completions = readFile ./tmux-attach/completions.fish;
|
completions = readFile ./tmux-attach/completions.fish;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tmux-new = pkgs.writeFishApplication {
|
||||||
|
name = "tn";
|
||||||
|
runtimeInputs = with pkgs; [ tmux ];
|
||||||
|
text = /* fish */ ''
|
||||||
|
if ! tmux has-session -t $argv[1] 2> /dev/null
|
||||||
|
tmux new-session -ds $argv[1] -c $argv[2]
|
||||||
|
end
|
||||||
|
|
||||||
|
tmux-switch $argv[1]
|
||||||
|
'';
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.my.programs.tmux = {
|
options.my.programs.tmux = {
|
||||||
|
@ -60,6 +70,8 @@ in
|
||||||
home-manager.users.moritz.home.packages = [
|
home-manager.users.moritz.home.packages = [
|
||||||
tmux-sessionizer
|
tmux-sessionizer
|
||||||
tmux-attach
|
tmux-attach
|
||||||
|
tmux-switch
|
||||||
|
tmux-new
|
||||||
];
|
];
|
||||||
home-manager.users.moritz.programs = {
|
home-manager.users.moritz.programs = {
|
||||||
tmux = {
|
tmux = {
|
||||||
|
@ -97,7 +109,7 @@ in
|
||||||
if ! fish_is_root_user && test "$TERM_PROGRAM" != 'vscode' && ${insideVariableMissing}
|
if ! fish_is_root_user && test "$TERM_PROGRAM" != 'vscode' && ${insideVariableMissing}
|
||||||
if test -z $tmux_autostarted
|
if test -z $tmux_autostarted
|
||||||
set -x tmux_autostarted true
|
set -x tmux_autostarted true
|
||||||
ts
|
tn home ~
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
set selected (tmux list-sessions -F '#{session_name}' 2>/dev/null | fzf $argv)
|
set selected (tmux list-sessions -F '#{session_name}' 2>/dev/null | fzf --query "$argv")
|
||||||
if not test -n "$selected"
|
if not test -n "$selected"
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
|
#!/usr/bin/env fish
|
||||||
set pipe (mktemp --dry-run)
|
set pipe (mktemp --dry-run)
|
||||||
mkfifo $pipe
|
mkfifo $pipe
|
||||||
|
|
||||||
fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec dirname {} | tee $pipe >/dev/null &
|
fd -HIg '.git' ~/ --min-depth 1 --max-depth 5 --type d --prune --exec-batch dirname {} | tee $pipe >/dev/null &
|
||||||
fd . ~/ --min-depth 1 --max-depth 3 --type d | tee $pipe >/dev/null &
|
fd . ~/ --min-depth 1 --max-depth 3 --type d --exec-batch realpath {} | tee $pipe >/dev/null &
|
||||||
|
set selected (cat $pipe | awk '!seen[$0]++' | fzf --query "$argv")
|
||||||
set selected (cat $pipe | fzf $argv)
|
|
||||||
rm -f "$pipe"
|
rm -f "$pipe"
|
||||||
|
|
||||||
set selected_name (basename $selected 2>/dev/null | string replace "." "_")
|
set selected_name (basename $selected 2>/dev/null | string replace "." "_")
|
||||||
|
@ -13,8 +13,4 @@ if not test -n "$selected_name"
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
if ! tmux has-session -t $selected_name 2> /dev/null
|
tn "$selected_name" "$selected"
|
||||||
tmux new-session -ds $selected_name -c $selected
|
|
||||||
end
|
|
||||||
|
|
||||||
tmux-switch $selected_name
|
|
||||||
|
|
|
@ -0,0 +1,44 @@
|
||||||
|
{ config
|
||||||
|
, lib
|
||||||
|
, pkgs
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.my.programs.tofi;
|
||||||
|
|
||||||
|
configText =
|
||||||
|
let
|
||||||
|
settingsStrings = mapAttrsToList (name: value: "${name} = ${value}") cfg.settings;
|
||||||
|
in
|
||||||
|
concatLines settingsStrings;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.programs.tofi = {
|
||||||
|
enable = mkEnableOption "tofi";
|
||||||
|
settings = mkOption {
|
||||||
|
type = with types; attrsOf str;
|
||||||
|
default = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
(lib.mkIf config.networking.networkmanager.enable networkmanager_dmenu)
|
||||||
|
# (lib.mkIf config.hardware.bluetooth.enable rofi-bluetooth)
|
||||||
|
# rofi-power-menu
|
||||||
|
];
|
||||||
|
home-manager.users.moritz = {
|
||||||
|
home.packages = with pkgs; [ tofi ];
|
||||||
|
xdg = {
|
||||||
|
enable = true;
|
||||||
|
configFile."tofi/config".text = configText;
|
||||||
|
configFile."networkmanager-dmenu/config.ini".text = ''
|
||||||
|
[dmenu]
|
||||||
|
dmenu_command = tofi
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -8,7 +8,14 @@ let
|
||||||
|
|
||||||
script = pkgs.writeShellApplication {
|
script = pkgs.writeShellApplication {
|
||||||
name = "wallpaper";
|
name = "wallpaper";
|
||||||
runtimeInputs = with pkgs; [ findutils coreutils feh swaybg fzf viu ];
|
runtimeInputs = with pkgs; [
|
||||||
|
findutils
|
||||||
|
coreutils
|
||||||
|
feh
|
||||||
|
swaybg
|
||||||
|
fzf
|
||||||
|
(viu.override { withSixel = true; })
|
||||||
|
];
|
||||||
text = builtins.readFile ./wallpaper.sh;
|
text = builtins.readFile ./wallpaper.sh;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{ config
|
{ config
|
||||||
, lib
|
, lib
|
||||||
|
, pkgs
|
||||||
, ...
|
, ...
|
||||||
}: {
|
}: {
|
||||||
## System security tweaks
|
## System security tweaks
|
||||||
|
@ -69,6 +70,7 @@
|
||||||
|
|
||||||
# SSH
|
# SSH
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
|
package = pkgs.master.openssh; # HACK: to fix CVE-2024-6387
|
||||||
settings = {
|
settings = {
|
||||||
# Disable ssh password login
|
# Disable ssh password login
|
||||||
PasswordAuthentication = lib.mkDefault false;
|
PasswordAuthentication = lib.mkDefault false;
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let
|
||||||
|
cfg = config.my.services.ollama;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.my.services.ollama = {
|
||||||
|
enable = mkEnableOption "ollama";
|
||||||
|
package = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
default = pkgs.ollama;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
systemd.user.services.ollama = {
|
||||||
|
after = [ "network.target" ];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
Restart = "on-failure";
|
||||||
|
RestartSec = "1s";
|
||||||
|
ExecStart = "${getExe cfg.package} serve";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -15,7 +15,7 @@ in
|
||||||
};
|
};
|
||||||
avahi = {
|
avahi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
nssmdns = true;
|
nssmdns4 = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -30,6 +30,10 @@ in
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.spotify-player;
|
default = pkgs.spotify-player;
|
||||||
};
|
};
|
||||||
|
target = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "graphical-session.target";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
@ -44,9 +48,8 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
systemd.user.services.spotify-player = {
|
systemd.user.services.spotify-player = {
|
||||||
after = [ "graphical-session.target" "network.target" ];
|
after = [ cfg.target "network.target" ];
|
||||||
partOf = [ "graphical-session.target" ];
|
wantedBy = [ cfg.target ];
|
||||||
wantedBy = [ "graphical-session.target" ];
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "forking";
|
Type = "forking";
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
{ config
|
{ config
|
||||||
|
, inputs
|
||||||
, lib
|
, lib
|
||||||
, pkgs
|
, pkgs
|
||||||
, ...
|
, ...
|
||||||
|
@ -12,7 +13,7 @@ in
|
||||||
options.my.services.timers.enable = mkEnableOption "timers";
|
options.my.services.timers.enable = mkEnableOption "timers";
|
||||||
options.my.services.timers.package = mkOption {
|
options.my.services.timers.package = mkOption {
|
||||||
type = types.package;
|
type = types.package;
|
||||||
default = pkgs.timers;
|
inherit (inputs.timers.packages.${pkgs.system}) default;
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
|
|
|
@ -10,12 +10,17 @@ in
|
||||||
type = types.str;
|
type = types.str;
|
||||||
default = "30m";
|
default = "30m";
|
||||||
};
|
};
|
||||||
|
target = mkOption {
|
||||||
|
type = types.str;
|
||||||
|
default = "graphical-session.target";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
systemd.user.services.wallpaper = {
|
systemd.user.services.wallpaper = {
|
||||||
script = "${getExe config.my.programs.wallpaper.package} -r -v";
|
script = "${getExe config.my.programs.wallpaper.package} -r -v";
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ cfg.target ];
|
||||||
|
after = [ cfg.target ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
RuntimeMaxSec = cfg.frequency;
|
RuntimeMaxSec = cfg.frequency;
|
||||||
|
|
|
@ -1,62 +0,0 @@
|
||||||
_:
|
|
||||||
|
|
||||||
final: _:
|
|
||||||
with final.lib;
|
|
||||||
rec {
|
|
||||||
fishFile =
|
|
||||||
{ name
|
|
||||||
, destination
|
|
||||||
, content
|
|
||||||
, checkPhase ? null
|
|
||||||
}:
|
|
||||||
final.writeTextFile {
|
|
||||||
inherit name destination;
|
|
||||||
executable = true;
|
|
||||||
allowSubstitutes = true;
|
|
||||||
preferLocalBuild = false;
|
|
||||||
text = ''
|
|
||||||
#!${getExe final.fish}
|
|
||||||
|
|
||||||
${content}
|
|
||||||
'';
|
|
||||||
|
|
||||||
checkPhase =
|
|
||||||
if checkPhase == null then ''
|
|
||||||
runHook preCheck
|
|
||||||
${getExe final.fish} -n "$target"
|
|
||||||
runHook postCheck
|
|
||||||
''
|
|
||||||
else checkPhase;
|
|
||||||
};
|
|
||||||
|
|
||||||
writeFishApplication =
|
|
||||||
{ name
|
|
||||||
, text
|
|
||||||
, completions ? null
|
|
||||||
, runtimeInputs ? [ ]
|
|
||||||
, checkPhase ? null
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
runtimeHeader = optionalString (runtimeInputs != [ ])
|
|
||||||
''export PATH="${makeBinPath runtimeInputs}:$PATH"'';
|
|
||||||
|
|
||||||
script = fishFile {
|
|
||||||
inherit checkPhase;
|
|
||||||
name = "${name}_script";
|
|
||||||
destination = "/bin/${name}";
|
|
||||||
content = concatLines [ runtimeHeader text ];
|
|
||||||
};
|
|
||||||
completions_file = fishFile {
|
|
||||||
inherit checkPhase;
|
|
||||||
name = "${name}_completions";
|
|
||||||
destination = "/share/fish/vendor_completions.d/${name}.fish";
|
|
||||||
content = concatLines [ runtimeHeader completions ];
|
|
||||||
};
|
|
||||||
in
|
|
||||||
final.symlinkJoin {
|
|
||||||
inherit name;
|
|
||||||
paths = [
|
|
||||||
script
|
|
||||||
] ++ optional (completions != null) completions_file;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
{ lib, ... }@args:
|
|
||||||
|
|
||||||
lib.composeManyExtensions
|
|
||||||
(lib.my.mapModules' (file: import file args) ./.)
|
|
|
@ -1,16 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
|
|
||||||
final: prev: {
|
|
||||||
# python-poetry/poetry#5929
|
|
||||||
poetry = final.symlinkJoin {
|
|
||||||
name = "poetry";
|
|
||||||
paths = [ prev.poetry ];
|
|
||||||
postBuild =
|
|
||||||
let
|
|
||||||
regex = "s/'([a-z]*[[:blank:]][a-z]*)''/\1'/g";
|
|
||||||
in
|
|
||||||
''
|
|
||||||
${lib.getExe final.gnused} -i -E "${regex}" "$out/share/fish/vendor_completions.d/poetry.fish"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{ lib, ... }:
|
|
||||||
|
|
||||||
_: _: {
|
|
||||||
inherit lib;
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
{ inputs, lib, ... }:
|
|
||||||
|
|
||||||
final: prev:
|
|
||||||
{
|
|
||||||
agenix = inputs.agenix.packages.${prev.system}.default;
|
|
||||||
hyprpaper = inputs.hyprpaper.packages.${prev.system}.default;
|
|
||||||
nix-super = inputs.nix-super.packages.${prev.system}.default;
|
|
||||||
rofi-wayland = prev.rofi-wayland.overrideAttrs (_: {
|
|
||||||
src = inputs.rofi-wayland;
|
|
||||||
version = lib.my.mkVersionInput inputs.rofi-wayland;
|
|
||||||
});
|
|
||||||
timers = inputs.timers.packages.${prev.system}.default;
|
|
||||||
hyprland = inputs.hyprland.packages.${prev.system}.default;
|
|
||||||
}
|
|
|
@ -1,61 +0,0 @@
|
||||||
{ inputs, lib }:
|
|
||||||
|
|
||||||
_: prev:
|
|
||||||
with lib.my;
|
|
||||||
{
|
|
||||||
vimPlugins = prev.vimPlugins // {
|
|
||||||
inherit (inputs.codeium-nvim.packages.${prev.system}.vimPlugins) codeium-nvim;
|
|
||||||
|
|
||||||
smartcolumn-nvim = prev.vimUtils.buildVimPluginFrom2Nix {
|
|
||||||
pname = "smartcolumn-nvim";
|
|
||||||
version = mkVersionInput inputs.smartcolumn-nvim;
|
|
||||||
src = inputs.smartcolumn-nvim;
|
|
||||||
};
|
|
||||||
|
|
||||||
telekasten-nvim = prev.vimUtils.buildVimPluginFrom2Nix {
|
|
||||||
pname = "telekasten-nvim";
|
|
||||||
version = mkVersionInput inputs.telekasten-nvim;
|
|
||||||
src = inputs.telekasten-nvim;
|
|
||||||
};
|
|
||||||
|
|
||||||
hmts-nvim = prev.vimUtils.buildVimPluginFrom2Nix {
|
|
||||||
pname = "hmts-nvim";
|
|
||||||
version = mkVersionInput inputs.hmts-nvim;
|
|
||||||
src = inputs.hmts-nvim;
|
|
||||||
};
|
|
||||||
|
|
||||||
actions-preview-nvim = prev.vimUtils.buildVimPluginFrom2Nix {
|
|
||||||
pname = "actions-preview-nvim";
|
|
||||||
version = mkVersionInput inputs.actions-preview-nvim;
|
|
||||||
src = inputs.actions-preview-nvim;
|
|
||||||
};
|
|
||||||
|
|
||||||
telescope-nvim = prev.vimPlugins.telescope-nvim.overrideAttrs (_: {
|
|
||||||
version = mkVersionInput inputs.telescope-nvim;
|
|
||||||
src = inputs.telescope-nvim;
|
|
||||||
});
|
|
||||||
|
|
||||||
nvim-treesitter = prev.vimPlugins.nvim-treesitter.overrideAttrs (_: {
|
|
||||||
version = mkVersionInput inputs.nvim-treesitter;
|
|
||||||
src = inputs.nvim-treesitter;
|
|
||||||
});
|
|
||||||
|
|
||||||
# HACK: to fix error in nixpkgs version of nvim-lspconfig
|
|
||||||
nvim-lspconfig = prev.vimPlugins.nvim-lspconfig.overrideAttrs (_: {
|
|
||||||
version = mkVersionInput inputs.nvim-lspconfig;
|
|
||||||
src = inputs.nvim-lspconfig;
|
|
||||||
});
|
|
||||||
|
|
||||||
nvim-puppeteer = prev.vimUtils.buildVimPluginFrom2Nix {
|
|
||||||
pname = "nvim-puppeteer";
|
|
||||||
version = mkVersionInput inputs.nvim-puppeteer;
|
|
||||||
src = inputs.nvim-puppeteer;
|
|
||||||
};
|
|
||||||
|
|
||||||
guard-nvim = prev.vimUtils.buildVimPluginFrom2Nix {
|
|
||||||
pname = "guard-nvim";
|
|
||||||
version = mkVersionInput inputs.guard-nvim;
|
|
||||||
src = inputs.guard-nvim;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
_:
|
|
||||||
|
|
||||||
final: prev: {
|
|
||||||
neovide-hyprland = final.symlinkJoin {
|
|
||||||
name = "neovide-hyprland-${final.neovide.version}";
|
|
||||||
paths = [ final.neovide ];
|
|
||||||
nativeBuildInputs = [ final.makeWrapper ];
|
|
||||||
postBuild = ''
|
|
||||||
rm $out/bin/neovide
|
|
||||||
makeWrapper ${final.neovide}/bin/neovide $out/bin/neovide --set WINIT_UNIX_BACKEND x11
|
|
||||||
'';
|
|
||||||
meta = final.neovide.meta // {
|
|
||||||
mainProgram = "neovide";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
logseq-wayland = prev.symlinkJoin {
|
|
||||||
name = "logseq-wayland";
|
|
||||||
paths = [ prev.logseq ];
|
|
||||||
nativeBuildInputs = [ prev.makeWrapper ];
|
|
||||||
postBuild = ''
|
|
||||||
wrapProgram $out/bin/logseq \
|
|
||||||
--add-flags "--socket=wayland --enable-features=UseOzonePlatform --ozone-platform=wayland"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -23,6 +23,7 @@ in
|
||||||
"wireguard-private-key.age".publicKeys = personal;
|
"wireguard-private-key.age".publicKeys = personal;
|
||||||
"webis.age".publicKeys = hosts-personal ++ [ scadspc25 moritz ];
|
"webis.age".publicKeys = hosts-personal ++ [ scadspc25 moritz ];
|
||||||
"webis-ssh.age".publicKeys = hosts-personal ++ [ scadspc25 moritz ];
|
"webis-ssh.age".publicKeys = hosts-personal ++ [ scadspc25 moritz ];
|
||||||
"root-password.age".publicKeys = hosts-personal ++ [ moritz ];
|
"root-password.age".publicKeys = personal;
|
||||||
"moritz-password.age".publicKeys = hosts-personal ++ [ moritz ];
|
"moritz-password.age".publicKeys = personal;
|
||||||
|
"exercism.age".publicKeys = personal;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
disabled = []
|
||||||
|
nix_version = '2.4'
|
||||||
|
ignore = ['.direnv' 'templates']
|
|
@ -0,0 +1 @@
|
||||||
|
use nix
|
|
@ -0,0 +1,14 @@
|
||||||
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
|
|
||||||
|
let
|
||||||
|
poetry2nix = import (fetchTarball "https://github.com/nix-community/poetry2nix/archive/master.tar.gz") { };
|
||||||
|
project =
|
||||||
|
poetry2nix.mkPoetryApplication {
|
||||||
|
projectDir = ./.;
|
||||||
|
preferWheels = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
pkgs.mkShell {
|
||||||
|
inputsFrom = [ project ];
|
||||||
|
packages = [ pkgs.poetry ];
|
||||||
|
}
|
|
@ -0,0 +1 @@
|
||||||
|
use flake
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Created by https://www.toptal.com/developers/gitignore/api/rust,direnv
|
||||||
|
# Edit at https://www.toptal.com/developers/gitignore?templates=rust,direnv
|
||||||
|
|
||||||
|
### direnv ###
|
||||||
|
.direnv
|
||||||
|
.envrc
|
||||||
|
|
||||||
|
### Rust ###
|
||||||
|
# Generated by Cargo
|
||||||
|
# will have compiled files and executables
|
||||||
|
debug/
|
||||||
|
target/
|
||||||
|
|
||||||
|
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
||||||
|
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
||||||
|
# Cargo.lock
|
||||||
|
|
||||||
|
# These are backup files generated by rustfmt
|
||||||
|
**/*.rs.bk
|
||||||
|
|
||||||
|
# MSVC Windows builds of rustc generate these, which store debugging information
|
||||||
|
*.pdb
|
||||||
|
|
||||||
|
# End of https://www.toptal.com/developers/gitignore/api/rust,direnv
|
|
@ -0,0 +1,59 @@
|
||||||
|
{
|
||||||
|
inputs = {
|
||||||
|
crane.url = "github:ipetkov/crane";
|
||||||
|
crane.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
fenix.url = "github:nix-community/fenix";
|
||||||
|
fenix.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
flake-utils.url = "github:numtide/flake-utils";
|
||||||
|
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = { self, crane, flake-utils, nixpkgs, ... }@inputs:
|
||||||
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
|
let
|
||||||
|
inherit (pkgs) lib;
|
||||||
|
pkgs = import nixpkgs { inherit system; };
|
||||||
|
fenix = inputs.fenix.packages.${system};
|
||||||
|
craneLib = crane.lib.${system}.overrideToolchain toolchain.toolchain;
|
||||||
|
mkSrc = extraPaths: with lib.fileset; let
|
||||||
|
root = ./.;
|
||||||
|
rustFiles = fromSource (craneLib.cleanCargoSource root);
|
||||||
|
fileset = union rustFiles (unions extraPaths);
|
||||||
|
in
|
||||||
|
toSource { inherit root fileset; };
|
||||||
|
|
||||||
|
## Customize here ##
|
||||||
|
toolchain = fenix.complete; # or fenix.stable;
|
||||||
|
stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.stdenv;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
packages.default = craneLib.buildPackage {
|
||||||
|
inherit stdenv;
|
||||||
|
src = mkSrc [ ];
|
||||||
|
strictDeps = true;
|
||||||
|
buildInputs = [
|
||||||
|
# Add additional build inputs here
|
||||||
|
] ++ lib.optionals pkgs.stdenv.isDarwin [
|
||||||
|
# Additional darwin specific inputs can be set here
|
||||||
|
pkgs.libiconv
|
||||||
|
];
|
||||||
|
# Additional environment variables can be set directly
|
||||||
|
# MY_CUSTOM_VAR = "some value";
|
||||||
|
};
|
||||||
|
|
||||||
|
devShells.default = pkgs.mkShell.override { inherit stdenv; }
|
||||||
|
{
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
# Add additional build inputs here
|
||||||
|
] ++ (with toolchain; [
|
||||||
|
cargo
|
||||||
|
clippy
|
||||||
|
rustfmt
|
||||||
|
rustc
|
||||||
|
fenix.rust-analyzer
|
||||||
|
]);
|
||||||
|
RUST_SRC_PATH = "${toolchain.rust-src}/lib/rustlib/src/rust/library";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|