initial commit
This commit is contained in:
commit
2fa019c567
5
alacritty.nix
Normal file
5
alacritty.nix
Normal file
@ -0,0 +1,5 @@
|
||||
{enable}: {
|
||||
inherit enable;
|
||||
settings.font.size = 14.0;
|
||||
settings.window.opacity = 0.8;
|
||||
}
|
8
bash.nix
Normal file
8
bash.nix
Normal file
@ -0,0 +1,8 @@
|
||||
{enable}: {
|
||||
inherit enable;
|
||||
shellAliases = {
|
||||
ll = "ls -lh";
|
||||
la = "ls -lah";
|
||||
".." = "cd ..";
|
||||
};
|
||||
}
|
25
firefox.nix
Normal file
25
firefox.nix
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
nur,
|
||||
enable,
|
||||
}: {
|
||||
inherit enable;
|
||||
profiles.kristian = {
|
||||
isDefault = true;
|
||||
search.default = "DuckDuckGo";
|
||||
search.force = true;
|
||||
extensions = builtins.attrValues {
|
||||
inherit
|
||||
(nur.repos.rycee.firefox-addons)
|
||||
ublock-origin
|
||||
umatrix
|
||||
sponsorblock
|
||||
xbrowsersync
|
||||
sidebery
|
||||
;
|
||||
};
|
||||
settings = {
|
||||
"extensions.pocket.enabled" = false;
|
||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
||||
};
|
||||
};
|
||||
}
|
236
flake.lock
generated
Normal file
236
flake.lock
generated
Normal file
@ -0,0 +1,236 @@
|
||||
{
|
||||
"nodes": {
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1673956053,
|
||||
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1659877975,
|
||||
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1687871164,
|
||||
"narHash": "sha256-bBFlPthuYX322xOlpJvkjUBz0C+MOBjZdDOOJJ+G2jU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "07c347bb50994691d7b0095f45ebd8838cf6bc38",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "release-23.05",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprland": {
|
||||
"inputs": {
|
||||
"hyprland-protocols": "hyprland-protocols",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"wlroots": "wlroots",
|
||||
"xdph": "xdph"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1690047096,
|
||||
"narHash": "sha256-VvZqoWLscSlRonCGq+OdIgA9GkZJJ/Z4yyoXn7m8kjY=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "Hyprland",
|
||||
"rev": "b21644b61143de0835fef9c3fa69fbdd2553cdfa",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "Hyprland",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"hyprland-protocols": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1684265364,
|
||||
"narHash": "sha256-AxNnWbthsuNx73HDQr0eBxrcE3+yfl/WsaXZqUFmkpQ=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprland-protocols",
|
||||
"rev": "8c279b9fb0f2b031427dc5ef4eab53f2ed835530",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "hyprland-protocols",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1688500189,
|
||||
"narHash": "sha256-djYYiY4lzJOlXOnTHytH6BUugrxHDZjuGxTSrU4gt4M=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "78419edadf0fabbe5618643bd850b2f2198ed060",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1689956312,
|
||||
"narHash": "sha256-NV9yamMhE5jgz+ZSM2IgXeYqOvmGIbIIJ+AFIhfD7Ek=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6da4bc6cb07cba1b8e53d139cbf1d2fb8061d967",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-23.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1689088367,
|
||||
"narHash": "sha256-Y2tl2TlKCWEHrOeM9ivjCLlRAKH3qoPUE/emhZECU14=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5c9ddb86679c400d6b7360797b8a22167c2053f8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "release-23.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1690055134,
|
||||
"narHash": "sha256-pca36VkwUxcygKtrY8OPWp9MpxHgWauwBWxO8lgHQTU=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"rev": "15a8d4645c280e35c00a36303bb76eb697d38206",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"hyprland": "hyprland",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"nur": "nur",
|
||||
"zig": "zig"
|
||||
}
|
||||
},
|
||||
"wlroots": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"host": "gitlab.freedesktop.org",
|
||||
"lastModified": 1689611045,
|
||||
"narHash": "sha256-3RTOlQabkNetQ4O4UzSf57JPco9VGVHhSU1ls5uKBeE=",
|
||||
"owner": "wlroots",
|
||||
"repo": "wlroots",
|
||||
"rev": "7791ffe0584c4ac13c170e1661ce33bdbd4a9b9e",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
"host": "gitlab.freedesktop.org",
|
||||
"owner": "wlroots",
|
||||
"repo": "wlroots",
|
||||
"rev": "7791ffe0584c4ac13c170e1661ce33bdbd4a9b9e",
|
||||
"type": "gitlab"
|
||||
}
|
||||
},
|
||||
"xdph": {
|
||||
"inputs": {
|
||||
"hyprland-protocols": [
|
||||
"hyprland",
|
||||
"hyprland-protocols"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"hyprland",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1685385764,
|
||||
"narHash": "sha256-r+XMyOoRXq+hlfjayb+fyi9kq2JK48TrwuNIAXqlj7U=",
|
||||
"owner": "hyprwm",
|
||||
"repo": "xdg-desktop-portal-hyprland",
|
||||
"rev": "4d9ff0c17716936e0b5ca577a39e263633901ed1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hyprwm",
|
||||
"repo": "xdg-desktop-portal-hyprland",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"zig": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1689899128,
|
||||
"narHash": "sha256-jlWnAn+KLgEsJzl9KPABOZrZ7gYmgUHDLfQLskY2O4g=",
|
||||
"owner": "mitchellh",
|
||||
"repo": "zig-overlay",
|
||||
"rev": "7af90962d9271745087d287248afe2766b58fb71",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "mitchellh",
|
||||
"repo": "zig-overlay",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
54
flake.nix
Normal file
54
flake.nix
Normal file
@ -0,0 +1,54 @@
|
||||
{
|
||||
description = "Home Manager configuration of kristian";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager/release-23.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
|
||||
# Hyprland Window Manager
|
||||
hyprland.url = "github:hyprwm/Hyprland";
|
||||
|
||||
# Nix User Repository
|
||||
nur.url = "github:nix-community/NUR";
|
||||
|
||||
# Zig
|
||||
zig.url = "github:mitchellh/zig-overlay";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
hyprland,
|
||||
nur,
|
||||
zig,
|
||||
} @ inputs: let
|
||||
system = "x86_64-linux";
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
formatter.${system} = nixpkgs.legacyPackages.${system}.alejandra;
|
||||
homeConfigurations = {
|
||||
kristian = home-manager.lib.homeManagerConfiguration {
|
||||
inherit pkgs;
|
||||
|
||||
modules = [
|
||||
./home.nix
|
||||
|
||||
{
|
||||
nixpkgs.overlays = [
|
||||
hyprland.overlays.default # Adds waybar-hyprland
|
||||
zig.overlays.default
|
||||
];
|
||||
}
|
||||
|
||||
hyprland.homeManagerModules.default
|
||||
|
||||
nur.nixosModules.nur
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
6
git.nix
Normal file
6
git.nix
Normal file
@ -0,0 +1,6 @@
|
||||
{enable}: {
|
||||
inherit enable;
|
||||
userName = "Kristian Krsnik";
|
||||
userEmail = "git@krsnik.at";
|
||||
extraConfig = {init.defaultBranch = "main";};
|
||||
}
|
111
home.nix
Normal file
111
home.nix
Normal file
@ -0,0 +1,111 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
options,
|
||||
specialArgs,
|
||||
modulesPath,
|
||||
}: {
|
||||
nixpkgs.config.allowUnfreePredicate = _: true;
|
||||
|
||||
home.stateVersion = "23.05";
|
||||
home.username = "kristian";
|
||||
home.homeDirectory = "/home/kristian";
|
||||
|
||||
# For cursor not showing in hyprland with nvidia
|
||||
home.sessionVariables.WLR_NO_HARDWARE_CURSORS = "1";
|
||||
|
||||
# Symlinks
|
||||
home.file = {
|
||||
".wallpaper".source = ./wallpaper; # Wallpaper
|
||||
#"Media".source = config.lib.file.mkOutOfStoreSymlink "/mnt/Media";
|
||||
#"Documents".source = config.lib.file.mkOutOfStoreSymlink "/mnt/Documents";
|
||||
};
|
||||
|
||||
# TODO: Change for Laptop
|
||||
targets.genericLinux.enable = false; # Enable on non-nixos ditros
|
||||
|
||||
# Keyboard Layout
|
||||
home.keyboard.layout = "at"; # NOTE: Set by Hyprland config
|
||||
|
||||
# Programs (additional programs)
|
||||
home.packages = import ./packages.nix {inherit pkgs;};
|
||||
|
||||
## Services
|
||||
services.copyq.enable = true;
|
||||
services.playerctld.enable = true; # for mpris waybar module
|
||||
|
||||
# Programs
|
||||
programs = {
|
||||
home-manager.enable = true; # Allow home-manager to manage itself
|
||||
wofi.enable = true;
|
||||
mpv.enable = true;
|
||||
obs-studio.enable = true;
|
||||
zathura.enable = true;
|
||||
yt-dlp.enable = true;
|
||||
lf.enable = true;
|
||||
vscode.enable = true;
|
||||
bashmount.enable = true;
|
||||
|
||||
bash = import ./bash.nix {enable = true;};
|
||||
alacritty = import ./alacritty.nix {enable = true;};
|
||||
neovim = import ./nvim {
|
||||
enable = true;
|
||||
pkgs = pkgs;
|
||||
};
|
||||
firefox = import ./firefox.nix {
|
||||
enable = true;
|
||||
nur = config.nur;
|
||||
};
|
||||
waybar = import ./waybar.nix {
|
||||
enable = true;
|
||||
pkgs = pkgs;
|
||||
};
|
||||
git = import ./git.nix {enable = true;};
|
||||
thunderbird = import ./thunderbird.nix {enable = true;};
|
||||
};
|
||||
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {"video/*" = ["mpv.desktop"];};
|
||||
};
|
||||
|
||||
systemd.user.mounts = let
|
||||
home = "home-kristian";
|
||||
in {
|
||||
"${home}-Media" = {
|
||||
Unit = {
|
||||
Description = "Mount disk-1 with sshfs";
|
||||
After = ["graphical-session-pre.target"];
|
||||
PartOf = ["graphical-session-pre.target"];
|
||||
};
|
||||
Install = {WantedBy = ["graphical-session-pre.target"];};
|
||||
Mount = {
|
||||
What = "kristian@krsnik.at:/mnt/TITAN/Media";
|
||||
Where = "/home/kristian/kristian/Media";
|
||||
Type = "fuse.sshfs";
|
||||
#Options=_netdev,reconnect,ServerAliveInterval=30,ServerAliveCountMax=5,x-systemd.automount
|
||||
#TimeoutSec=60
|
||||
#Options = "resolve-symlinks";
|
||||
};
|
||||
};
|
||||
"${home}-Documents" = {
|
||||
Unit = {
|
||||
Description = "Mount disk-1 with sshfs";
|
||||
After = ["graphical.target "];
|
||||
Wants = ["graphical.target"];
|
||||
};
|
||||
Install = {WantedBy = ["default.target"];};
|
||||
Mount = {
|
||||
What = "kristian@krsnik.at:/mnt/TITAN/Documents";
|
||||
Where = "/home/kristian/Documents";
|
||||
Type = "fuse.sshfs";
|
||||
Options = "_netdev,reconnect,ServerAliveInterval=30,ServerAliveCountMax=5,x-systemd.automount";
|
||||
TimeoutSec = 60;
|
||||
#Options = "resolve-symlinks";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
wayland.windowManager.hyprland = import ./hyprland.nix {enable = true;};
|
||||
}
|
90
hyprland.nix
Normal file
90
hyprland.nix
Normal file
@ -0,0 +1,90 @@
|
||||
{enable}: {
|
||||
inherit enable;
|
||||
xwayland.enable = true;
|
||||
extraConfig = ''
|
||||
# Waybar
|
||||
exec-once = waybar
|
||||
|
||||
# Notifications Daemon
|
||||
exec-once = dunst &
|
||||
|
||||
# Wallpaper
|
||||
exec-once = swww init
|
||||
exec-once = swww img ~/.wallpaper --transition-step 255
|
||||
|
||||
# Clipboard
|
||||
exec-once = copyq --start-server
|
||||
|
||||
# Window Rules
|
||||
windowrulev2 = float,title:(CopyQ)$
|
||||
windowrulev2 = float,title:^(Volume Control)$
|
||||
|
||||
# Keybinds
|
||||
$Mod = Alt
|
||||
$altMod = SUPER
|
||||
|
||||
bind = $Mod, D, exec, wofi --show drun
|
||||
bind = $Mod, Return, exec, alacritty
|
||||
bind = $Mod, V, exec, copyq
|
||||
bind = $Mod, S, exec, grim -g "$(slurp)"
|
||||
bind = $Mod SHIFT, C, exec, copyq show
|
||||
|
||||
bind = $Mod, C, killactive,
|
||||
bind = $Mod CONTROL SHIFT, K, exit,
|
||||
bind = $Mod, M, togglefloating
|
||||
bind = $Mod, F, fullscreen, 1 # maximize
|
||||
bind = $Mod SHIFT, F, fullscreen, 0 # fullscreen
|
||||
bind = $Mod, P, pseudo
|
||||
|
||||
# Move focus with mainMod + arrow keys
|
||||
bind = $Mod, h, movefocus, l
|
||||
bind = $Mod, j, movefocus, d
|
||||
bind = $Mod, k, movefocus, u
|
||||
bind = $Mod, l, movefocus, r
|
||||
|
||||
bind = $Mod SHIFT, h, swapwindow, l
|
||||
bind = $Mod SHIFT, j, swapwindow, d
|
||||
bind = $Mod SHIFT, k, swapwindow, u
|
||||
bind = $Mod SHIFT, l, swapwindow, r
|
||||
|
||||
bind = $Mod , Tab, cyclenext, prev
|
||||
bind = $Mod SHIFT, Tab, cyclenext,
|
||||
|
||||
# Layouting
|
||||
bind = $Mod , Space, togglegroup,
|
||||
bind = $altMod , Tab , changegroupactive, forward
|
||||
bind = $altMod SHIFT, Tab , changegroupactive, back
|
||||
|
||||
bind = $altMod, h, moveintogroup, l
|
||||
bind = $altMod, j, moveintogroup, d
|
||||
bind = $altMod, k, moveintogroup, u
|
||||
bind = $altMod, l, moveintogroup, r
|
||||
|
||||
bind = $altMod SHIFT, h, moveoutofgroup, l
|
||||
bind = $altMod SHIFT, j, moveoutofgroup, d
|
||||
bind = $altMod SHIFT, k, moveoutofgroup, u
|
||||
bind = $altMod SHIFT, l, moveoutofgroup, r
|
||||
|
||||
# Switch workspaces
|
||||
bind = $Mod, 1, workspace, -1
|
||||
bind = $Mod, 2, workspace, +1
|
||||
|
||||
# Move active window to a workspace
|
||||
bind = $Mod SHIFT, 1, movetoworkspace, -1
|
||||
bind = $Mod SHIFT, 2, movetoworkspace, +1
|
||||
|
||||
# Scroll through existing workspaces
|
||||
bind = $Mod, mouse_up, workspace, -1
|
||||
bind = $Mod, mouse_down, workspace, +1
|
||||
|
||||
# Move/resize windows
|
||||
bindm = $Mod, mouse:272, movewindow
|
||||
bindm = $Mod, mouse:273, resizewindow
|
||||
|
||||
# TODO: renameworkspace with dmenu or rofi prompt
|
||||
|
||||
input {
|
||||
kb_layout = at
|
||||
}
|
||||
'';
|
||||
}
|
64
nvim/cmp.lua
Normal file
64
nvim/cmp.lua
Normal file
@ -0,0 +1,64 @@
|
||||
-- Set up nvim-cmp.
|
||||
local cmp = require'cmp'
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
-- completion = cmp.config.window.bordered(),
|
||||
-- documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
-- { name = 'vsnip' }, -- For vsnip users.
|
||||
{ name = 'luasnip' }, -- For luasnip users.
|
||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||
-- { name = 'snippy' }, -- For snippy users.
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
-- Set configuration for specific filetype.
|
||||
cmp.setup.filetype('gitcommit', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
|
||||
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
})
|
||||
})
|
||||
|
||||
-- Set up lspconfig.
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
|
||||
require('lspconfig')['pyright'].setup {
|
||||
capabilities = capabilities
|
||||
}
|
11
nvim/colors.lua
Normal file
11
nvim/colors.lua
Normal file
@ -0,0 +1,11 @@
|
||||
require('tokyonight').setup({style = 'moon',})
|
||||
|
||||
function ColorMyPencils(color)
|
||||
color = color or 'tokyonight'
|
||||
vim.cmd.colorscheme(color)
|
||||
|
||||
vim.api.nvim_set_hl(0, 'Normal', { bg = 'none' })
|
||||
vim.api.nvim_set_hl(0, 'NormalFloat', { bg = 'none' })
|
||||
end
|
||||
|
||||
ColorMyPencils()
|
59
nvim/default.nix
Normal file
59
nvim/default.nix
Normal file
@ -0,0 +1,59 @@
|
||||
{
|
||||
pkgs,
|
||||
enable,
|
||||
}: {
|
||||
inherit enable;
|
||||
defaultEditor = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
|
||||
plugins = builtins.attrValues ({
|
||||
inherit
|
||||
(pkgs.vimPlugins)
|
||||
telescope-nvim # fuzzy finder
|
||||
tokyonight-nvim # theme
|
||||
undotree # undotree
|
||||
vim-fugitive # git integration
|
||||
nvim-treesitter # syntax highlighting
|
||||
|
||||
# Autocomplete and LSP
|
||||
|
||||
nvim-lspconfig
|
||||
nvim-cmp
|
||||
cmp-nvim-lsp
|
||||
luasnip
|
||||
;
|
||||
}
|
||||
// {
|
||||
# Parsers for syntax highlighting
|
||||
inherit
|
||||
(pkgs.vimPlugins.nvim-treesitter-parsers)
|
||||
nix
|
||||
zig
|
||||
python
|
||||
vim
|
||||
vimdoc
|
||||
markdown
|
||||
dockerfile
|
||||
yaml
|
||||
json
|
||||
toml
|
||||
lua
|
||||
c
|
||||
glsl
|
||||
bash
|
||||
;
|
||||
});
|
||||
extraPackages = [pkgs.nodePackages.pyright];
|
||||
extraLuaConfig =
|
||||
builtins.readFile ./keybinds.lua
|
||||
+ builtins.readFile ./colors.lua
|
||||
+ builtins.readFile ./undotree.lua
|
||||
+ builtins.readFile ./fugitive.lua
|
||||
+ builtins.readFile ./treesitter.lua
|
||||
+ builtins.readFile ./telescope.lua
|
||||
+ builtins.readFile ./cmp.lua
|
||||
+ builtins.readFile ./lspconfig.lua;
|
||||
extraConfig = "set number relativenumber";
|
||||
}
|
1
nvim/fugitive.lua
Normal file
1
nvim/fugitive.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.keymap.set('n', '<leader>gs', vim.cmd.Git)
|
2
nvim/keybinds.lua
Normal file
2
nvim/keybinds.lua
Normal file
@ -0,0 +1,2 @@
|
||||
vim.g.mapleader = ' '
|
||||
vim.keymap.set('n', '<leader>pv', vim.cmd.Ex)
|
40
nvim/lspconfig.lua
Normal file
40
nvim/lspconfig.lua
Normal file
@ -0,0 +1,40 @@
|
||||
-- Global mappings.
|
||||
-- See `:help vim.diagnostic.*` for documentation on any of the below functions
|
||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
|
||||
vim.keymap.set('n', '<C-p>', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', '<C-n>', vim.diagnostic.goto_next)
|
||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
|
||||
|
||||
-- Use LspAttach autocommand to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(ev)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf }
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts)
|
||||
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
|
||||
|
||||
vim.keymap.set('n', '<space>f', function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end, opts)
|
||||
end,
|
||||
})
|
7
nvim/telescope.lua
Normal file
7
nvim/telescope.lua
Normal file
@ -0,0 +1,7 @@
|
||||
local telescope = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set('n', '<leader>pf', telescope.find_files, {})
|
||||
vim.keymap.set('n', '<C-p>', telescope.git_files, {})
|
||||
vim.keymap.set('n', '<leader>ps', function()
|
||||
telescope.grep_string({ search = vim.fn.input("Grep > ")});
|
||||
end)
|
8
nvim/treesitter.lua
Normal file
8
nvim/treesitter.lua
Normal file
@ -0,0 +1,8 @@
|
||||
-- Treesitter
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
highlight = {
|
||||
-- `false` will disable the whole extension
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
}
|
1
nvim/undotree.lua
Normal file
1
nvim/undotree.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle)
|
48
packages.nix
Normal file
48
packages.nix
Normal file
@ -0,0 +1,48 @@
|
||||
{pkgs}:
|
||||
with pkgs; [
|
||||
# Basic utils
|
||||
unzip
|
||||
magic-wormhole
|
||||
wl-clipboard # vim clipboard access
|
||||
|
||||
# Audio
|
||||
pulseaudio
|
||||
pulsemixer
|
||||
pavucontrol
|
||||
|
||||
# Important graphical applications
|
||||
keepassxc
|
||||
logseq
|
||||
xournalpp
|
||||
onlyoffice-bin
|
||||
|
||||
# Communication
|
||||
discord
|
||||
telegram-desktop
|
||||
signal-desktop
|
||||
element-desktop
|
||||
|
||||
# For Hyprland
|
||||
libsForQt5.polkit-kde-agent # For permission pop-ups
|
||||
libsForQt5.qt5.qtwayland
|
||||
qt6.qtwayland
|
||||
dunst # Notifications
|
||||
swww # Wallpaper
|
||||
grim
|
||||
slurp # Screenshots
|
||||
|
||||
# Video Editor
|
||||
# davinci-resolve # Currently borken. Fixed in https://github.com/NixOS/nixpkgs/pull/242751
|
||||
|
||||
# LaTeX Editor
|
||||
setzer
|
||||
|
||||
gnome.nautilus
|
||||
|
||||
steam
|
||||
|
||||
# Misc
|
||||
nerdfonts # Font with glyphs for status bar
|
||||
|
||||
zigpkgs.master # latest nightly release of zig
|
||||
]
|
6
thunderbird.nix
Normal file
6
thunderbird.nix
Normal file
@ -0,0 +1,6 @@
|
||||
{enable}: {
|
||||
inherit enable;
|
||||
profiles.kristian = {
|
||||
isDefault = true;
|
||||
};
|
||||
}
|
113
waybar.nix
Normal file
113
waybar.nix
Normal file
@ -0,0 +1,113 @@
|
||||
{
|
||||
pkgs,
|
||||
enable,
|
||||
}: {
|
||||
inherit enable;
|
||||
package = pkgs.waybar-hyprland;
|
||||
settings = {
|
||||
mainBar = {
|
||||
layer = "top";
|
||||
height = 30;
|
||||
|
||||
modules-left = ["wlr/workspaces"];
|
||||
modules-center = ["clock"];
|
||||
modules-right = ["pulseaudio" "memory" "cpu" "tray"];
|
||||
|
||||
"hyprland/workspaces" = {
|
||||
format = "{icon}";
|
||||
on-click = "activate";
|
||||
on-scroll-up = "hyprctl dispatch workspace e+1";
|
||||
on-scroll-down = "hyprctl dispatch workspace e-1";
|
||||
#format-icons = {
|
||||
# "1" = "";
|
||||
# "2" = "";
|
||||
# "3" = "";
|
||||
# "4" = "";
|
||||
# "5" = "";
|
||||
# urgent = "";
|
||||
# active = "";
|
||||
# default = "";
|
||||
#};
|
||||
sort-by-number = true;
|
||||
};
|
||||
|
||||
"wlr/window" = {
|
||||
max-length = 50;
|
||||
};
|
||||
|
||||
mpris = {
|
||||
format = "DEFAULT: {player_icon} {dynamic}";
|
||||
format-paused = "DEFAULT: {status_icon} <i>{dynamic}</i>";
|
||||
player-icons = {
|
||||
default = "▶";
|
||||
mpv = "🎵";
|
||||
};
|
||||
status-icons = {
|
||||
paused = "⏸";
|
||||
};
|
||||
};
|
||||
|
||||
pulseaudio = {
|
||||
format = "{volume}% {icon}";
|
||||
format-bluetooth = " {volume}% {icon}";
|
||||
format-muted = "";
|
||||
format-icons = {
|
||||
headphone = "";
|
||||
hands-free = "";
|
||||
headset = "";
|
||||
phone = "";
|
||||
portable = "";
|
||||
car = "";
|
||||
default = ["" ""];
|
||||
};
|
||||
scroll-step = 1;
|
||||
on-click = "pavucontrol";
|
||||
ignored-sinks = ["Easy Effects Sink"];
|
||||
};
|
||||
|
||||
cpu = {
|
||||
interval = 10;
|
||||
format = " {load}% {icon}";
|
||||
format-icons = ["▁" "▂" "▃" "▄" "▅" "▆" "▇" "█"];
|
||||
};
|
||||
|
||||
memory = {
|
||||
interval = 30;
|
||||
format = " {used:0.1f}G / {total:0.1f}G";
|
||||
};
|
||||
|
||||
clock = {
|
||||
# TODO: Fix that calendar width is too small
|
||||
format = "{:%H:%M} ";
|
||||
format-alt = "{:%A, %B %d, %Y (%R)}";
|
||||
tooltip-format = "<tt><small>{calendar}</small></tt>";
|
||||
calendar = {
|
||||
mode = "year";
|
||||
mode-mon-col = 3;
|
||||
weeks-pos = "right";
|
||||
on-scroll = 1;
|
||||
on-click-right = "mode";
|
||||
format = {
|
||||
months = "<span color='#ffead3'><b>{}</b></span>";
|
||||
days = "<span color='#ecc6d9'><b>{}</b></span>";
|
||||
weeks = "<span color='#99ffdd'><b>W{}</b></span>";
|
||||
weekdays = "<span color='#ffcc66'><b>{}</b></span>";
|
||||
today = "<span color='#ff6699'><b><u>{}</u></b></span>";
|
||||
};
|
||||
};
|
||||
actions = {
|
||||
on-click-right = "mode";
|
||||
on-click-forward = "tz_up";
|
||||
on-click-backward = "tz_down";
|
||||
on-scroll-up = "shift_up";
|
||||
on-scroll-down = "shift_down";
|
||||
};
|
||||
};
|
||||
|
||||
tray = {
|
||||
"icon-size" = 21;
|
||||
"spacing" = 10;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user