Merge branch 'nixbook/cosmic' into zenix/hm-cosmic
This commit is contained in:
commit
ee902d57c8
5 changed files with 159 additions and 40 deletions
2
.rgignore
Normal file
2
.rgignore
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
lib/words.txt
|
||||||
|
flake.lock
|
||||||
|
|
@ -23,14 +23,17 @@ in {
|
||||||
options = ["subvol=@" "compress=zstd" "autodefrag"];
|
options = ["subvol=@" "compress=zstd" "autodefrag"];
|
||||||
};
|
};
|
||||||
|
|
||||||
boot.initrd.postDeviceCommands = pkgs.lib.mkBefore (decrypt {
|
boot.initrd.luks.devices."usbkey" = {
|
||||||
keydevice = "/dev/disk/by-id/usb-Generic_Flash_Disk_BCC97785-0:0";
|
device = "/dev/disk/by-id/usb-Generic_Flash_Disk_BCC97785-0:0";
|
||||||
keypartname = "usbkey";
|
};
|
||||||
});
|
|
||||||
|
|
||||||
boot.initrd.luks.devices."cryptroot" = {
|
boot.initrd.luks.devices."cryptroot" = {
|
||||||
device = "/dev/disk/by-uuid/570cc51f-bd5c-4bee-a18f-f6aabaf60881";
|
device = "/dev/disk/by-uuid/570cc51f-bd5c-4bee-a18f-f6aabaf60881";
|
||||||
keyFileSize = 4096;
|
keyFileSize = 4096;
|
||||||
|
preOpenCommands = ''
|
||||||
|
mkdir -m 0755 -p /key
|
||||||
|
mount -n -t vfat -o ro /dev/mapper/usbkey /key
|
||||||
|
'';
|
||||||
keyFile = "/key/keyfile";
|
keyFile = "/key/keyfile";
|
||||||
preLVM = false;
|
preLVM = false;
|
||||||
};
|
};
|
||||||
|
|
@ -54,6 +57,11 @@ in {
|
||||||
|
|
||||||
swapDevices = [{device = "/swap/swapfile";}];
|
swapDevices = [{device = "/swap/swapfile";}];
|
||||||
|
|
||||||
|
boot.plymouth.enable = true;
|
||||||
|
boot.initrd.verbose = false;
|
||||||
|
boot.consoleLogLevel = 1;
|
||||||
|
boot.kernelParams = [ "quiet" "udev.log_level=3" ];
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
# still possible to use this option, but it's recommended to use it in conjunction
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
shortwave
|
shortwave
|
||||||
|
|
||||||
# other
|
# other
|
||||||
element-desktop
|
element-desktop-wayland
|
||||||
brave
|
brave
|
||||||
bitwarden
|
bitwarden
|
||||||
];
|
];
|
||||||
|
|
@ -44,15 +44,6 @@
|
||||||
|
|
||||||
gtk = {
|
gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
iconTheme = {
|
|
||||||
name = "Vimix-Doder";
|
|
||||||
package = pkgs.vimix-icon-theme;
|
|
||||||
};
|
|
||||||
cursorTheme = {
|
|
||||||
name = "Vanilla-DMZ";
|
|
||||||
package = pkgs.vanilla-dmz;
|
|
||||||
size = 24;
|
|
||||||
};
|
|
||||||
gtk3.bookmarks = [
|
gtk3.bookmarks = [
|
||||||
"file:///home/tristan/Documents"
|
"file:///home/tristan/Documents"
|
||||||
"file:///home/tristan/Pictures/Screenshots"
|
"file:///home/tristan/Pictures/Screenshots"
|
||||||
|
|
|
||||||
154
lib/nixvim.nix
154
lib/nixvim.nix
|
|
@ -5,17 +5,26 @@
|
||||||
opts = {
|
opts = {
|
||||||
number = true;
|
number = true;
|
||||||
relativenumber = true;
|
relativenumber = true;
|
||||||
tabstop = 2;
|
tabstop = 4;
|
||||||
shiftwidth = 2;
|
shiftwidth = 2;
|
||||||
expandtab = true;
|
expandtab = true;
|
||||||
smartindent = true;
|
smartindent = true;
|
||||||
scrolloff = 4;
|
scrolloff = 4;
|
||||||
|
|
||||||
undofile = true;
|
undofile = true;
|
||||||
|
undodir.__raw = ''vim.fn.expand("$HOME/.local/share/nvim/undo")'';
|
||||||
|
|
||||||
|
list = true;
|
||||||
|
listchars = builtins.concatStringsSep "," [
|
||||||
|
"tab: >"
|
||||||
|
"leadmultispace: |"
|
||||||
|
"trail:."
|
||||||
|
"extends:>"
|
||||||
|
"precedes:<"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
extraPlugins = [(pkgs.vimPlugins.actions-preview-nvim)];
|
extraPlugins = [(pkgs.vimPlugins.actions-preview-nvim)];
|
||||||
extraConfigLua = ''
|
extraConfigLua = ''
|
||||||
vim.o.undodir = vim.fn.expand("$HOME/.local/share/nvim/undo")
|
|
||||||
require("actions-preview").setup {
|
require("actions-preview").setup {
|
||||||
highlight_command = {
|
highlight_command = {
|
||||||
require("actions-preview.highlight").delta("${pkgs.delta}/bin/delta --no-gitconfig --side-by-side"),
|
require("actions-preview.highlight").delta("${pkgs.delta}/bin/delta --no-gitconfig --side-by-side"),
|
||||||
|
|
@ -49,6 +58,14 @@
|
||||||
require("actions-preview").code_actions
|
require("actions-preview").code_actions
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
key = "<C-Tab>";
|
||||||
|
action = "<CMD>tabnext<CR>";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<C-S-Tab>";
|
||||||
|
action = "<CMD>tabprev<CR>";
|
||||||
|
}
|
||||||
{
|
{
|
||||||
key = "gl";
|
key = "gl";
|
||||||
action = "g$";
|
action = "g$";
|
||||||
|
|
@ -57,30 +74,84 @@
|
||||||
key = "gh";
|
key = "gh";
|
||||||
action = "g0";
|
action = "g0";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
mode = "v";
|
||||||
|
key = ">";
|
||||||
|
action = ">gv";
|
||||||
|
options.desc = "indent";
|
||||||
|
options.silent = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mode = "v";
|
||||||
|
key = "<";
|
||||||
|
action = "<gv";
|
||||||
|
options.desc = "deindent";
|
||||||
|
options.silent = true;
|
||||||
|
}
|
||||||
{
|
{
|
||||||
key = "<leader>q";
|
key = "<leader>q";
|
||||||
action = ":bd<CR>";
|
action = "<CMD>bd<CR>";
|
||||||
options.desc = "close buffer";
|
options.desc = "close buffer";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>g";
|
||||||
|
action = "";
|
||||||
|
options.desc = "Gitsigns";
|
||||||
|
}
|
||||||
{
|
{
|
||||||
key = "<leader>gs";
|
key = "<leader>gs";
|
||||||
action = ":Gitsigns stage_hunk<CR>";
|
action = "<CMD>Gitsigns stage_hunk<CR>";
|
||||||
options.desc = "git stage hunk";
|
options.desc = "git stage hunk";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>gn";
|
||||||
|
action = "<CMD>Gitsigns next_hunk<CR>zz";
|
||||||
|
options.desc = "next git hunk";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>gd";
|
||||||
|
action = "<CMD>Gitsigns preview_hunk_inline<CR>";
|
||||||
|
options.desc = "git diff hunk";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>gD";
|
||||||
|
action = "<CMD>Gitsigns diffthis<CR>";
|
||||||
|
options.desc = "git diff buffer";
|
||||||
|
}
|
||||||
{
|
{
|
||||||
key = "<leader>gr";
|
key = "<leader>gr";
|
||||||
action = ":Gitsigns reset_hunk<CR>";
|
action = "<CMD>Gitsigns reset_hunk<CR>";
|
||||||
options.desc = "git restore hunk";
|
options.desc = "git restore hunk";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
key = "<leader>gb";
|
key = "<leader>gb";
|
||||||
action = ":Gitsigns blame<CR>";
|
action = "<CMD>Gitsigns blame<CR>";
|
||||||
options.desc = "show git blame";
|
options.desc = "show git blame";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
key = "<leader>gg";
|
key = "<leader>gg";
|
||||||
action = ":LazyGit<CR>";
|
action = "<CMD>LazyGit<CR>";
|
||||||
options.desc = "open lazy git";
|
options.desc = "open lazygit";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>-";
|
||||||
|
action = "<CMD>Oil<CR>";
|
||||||
|
options.desc = "open dir in Oil";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>f";
|
||||||
|
action = "";
|
||||||
|
options.desc = "Telescope";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>c";
|
||||||
|
action = "";
|
||||||
|
options.desc = "LSP";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
key = "<leader>h";
|
||||||
|
action = "";
|
||||||
|
options.desc = "Harpoon";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
@ -94,6 +165,11 @@
|
||||||
|
|
||||||
telescope = {
|
telescope = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
defaults = {
|
||||||
|
file_ignore_patterns = [".*lock.*"];
|
||||||
|
};
|
||||||
|
};
|
||||||
keymaps = {
|
keymaps = {
|
||||||
"<leader>fg" = "live_grep";
|
"<leader>fg" = "live_grep";
|
||||||
"<leader>/" = "live_grep";
|
"<leader>/" = "live_grep";
|
||||||
|
|
@ -101,6 +177,9 @@
|
||||||
"<leader>fb" = "buffers";
|
"<leader>fb" = "buffers";
|
||||||
"<leader>fh" = "help_tags";
|
"<leader>fh" = "help_tags";
|
||||||
"<leader>:" = "commands";
|
"<leader>:" = "commands";
|
||||||
|
"<leader>ft" = "treesitter";
|
||||||
|
"<leader>fr" = "lsp_references";
|
||||||
|
"<leader>cr" = "lsp_definition";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -114,17 +193,6 @@
|
||||||
lspBuf = {
|
lspBuf = {
|
||||||
"<leader>ck" = "hover";
|
"<leader>ck" = "hover";
|
||||||
"K" = "hover";
|
"K" = "hover";
|
||||||
|
|
||||||
# using actions-preview instead
|
|
||||||
# "<leader>ca" = "code_action";
|
|
||||||
# "<C-.>" = "code_action";
|
|
||||||
|
|
||||||
"<leader>cd" = "definition";
|
|
||||||
"gd" = "definition";
|
|
||||||
|
|
||||||
"<leader>cf" = "references";
|
|
||||||
"gr" = "references";
|
|
||||||
|
|
||||||
"<leader>cr" = "rename";
|
"<leader>cr" = "rename";
|
||||||
"<F2>" = "rename";
|
"<F2>" = "rename";
|
||||||
};
|
};
|
||||||
|
|
@ -133,11 +201,29 @@
|
||||||
|
|
||||||
cmp = {
|
cmp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
autoEnableSources = true;
|
settings = {
|
||||||
|
mapping = {
|
||||||
|
"<C-Space>" = "cmp.mapping.complete()";
|
||||||
|
"<C-u>" = "cmp.mapping.scroll_docs(4)";
|
||||||
|
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
|
||||||
|
"<C-e>" = "cmp.mapping.close()";
|
||||||
|
"<CR>" = "cmp.mapping.confirm({ select = true })";
|
||||||
|
"<C-p>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
|
||||||
|
"<C-n>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
|
||||||
|
};
|
||||||
|
sources = [
|
||||||
|
{ name = "nvim_lsp"; }
|
||||||
|
{ name = "path"; }
|
||||||
|
{ name = "buffer"; }
|
||||||
|
];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
cmp-nvim-lsp.enable = true;
|
cmp-nvim-lsp.enable = true;
|
||||||
|
cmp-nvim-lsp-signature-help.enable = true;
|
||||||
cmp-path.enable = true;
|
cmp-path.enable = true;
|
||||||
|
cmp-buffer.enable = true;
|
||||||
|
|
||||||
|
trouble.enable = true;
|
||||||
|
|
||||||
gitsigns.enable = true;
|
gitsigns.enable = true;
|
||||||
git-worktree = {
|
git-worktree = {
|
||||||
|
|
@ -148,10 +234,6 @@
|
||||||
lazygit.enable = true;
|
lazygit.enable = true;
|
||||||
which-key.enable = true;
|
which-key.enable = true;
|
||||||
|
|
||||||
dap = {
|
|
||||||
enable = true;
|
|
||||||
extensions.dap-ui.enable = true;
|
|
||||||
};
|
|
||||||
harpoon = {
|
harpoon = {
|
||||||
enable = true;
|
enable = true;
|
||||||
keymaps = {
|
keymaps = {
|
||||||
|
|
@ -162,6 +244,28 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
vim-css-color.enable = true;
|
vim-css-color.enable = true;
|
||||||
|
|
||||||
|
treesitter = {
|
||||||
|
enable = true;
|
||||||
|
folding = true;
|
||||||
|
};
|
||||||
|
treesitter-textobjects = {
|
||||||
|
enable = true;
|
||||||
|
select = {
|
||||||
|
enable = true;
|
||||||
|
lookahead = true;
|
||||||
|
keymaps = {
|
||||||
|
"af" = { query = "@function.outer"; desc = "Function Outer"; };
|
||||||
|
"ac" = { query = "@comment.outer"; desc = "Comment Outer"; };
|
||||||
|
"if" = { query = "@function.inner"; desc = "Function Inner"; };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
oil.enable = true;
|
||||||
|
autoclose.enable = true;
|
||||||
|
ts-autotag.enable = true;
|
||||||
|
guess-indent.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,13 +52,27 @@
|
||||||
stylix = {
|
stylix = {
|
||||||
enable = true;
|
enable = true;
|
||||||
image = ../images/nix-soft.png;
|
image = ../images/nix-soft.png;
|
||||||
base16Scheme = "${pkgs.base16-schemes}/share/themes/onedark.yaml";
|
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
|
||||||
opacity = {
|
opacity = {
|
||||||
terminal = 0.9;
|
terminal = 0.9;
|
||||||
applications = 0.9;
|
applications = 0.9;
|
||||||
desktop = 0.9;
|
desktop = 0.9;
|
||||||
popups = 0.9;
|
popups = 0.9;
|
||||||
};
|
};
|
||||||
|
cursor = {
|
||||||
|
name = "Vanilla-DMZ";
|
||||||
|
package = pkgs.vanilla-dmz;
|
||||||
|
size = 24;
|
||||||
|
};
|
||||||
|
targets = {
|
||||||
|
gtk.enable = false; # fails to switch with cosmic overriding it (grr)
|
||||||
|
grub = {
|
||||||
|
useImage = true;
|
||||||
|
};
|
||||||
|
nixvim = {
|
||||||
|
transparentBackground.main = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue