modularise nixvim

This commit is contained in:
Sam 2024-06-03 11:05:46 +01:00
parent 33d41f4256
commit d6dc868814
28 changed files with 506 additions and 394 deletions

View File

@ -18,7 +18,7 @@
}, },
"devshell": { "devshell": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": [ "nixpkgs": [
"nixvim", "nixvim",
"nixpkgs" "nixpkgs"
@ -125,6 +125,21 @@
} }
}, },
"flake-utils": { "flake-utils": {
"locked": {
"lastModified": 1642700792,
"narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "846b2ae0fc4cc943637d3d1def4454213e203cba",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
}, },
@ -247,6 +262,26 @@
"type": "github" "type": "github"
} }
}, },
"mach-nix": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs",
"pypi-deps-db": "pypi-deps-db"
},
"locked": {
"lastModified": 1654084003,
"narHash": "sha256-j/XrVVistvM+Ua+0tNFvO5z83isL+LBgmBi9XppxuKA=",
"owner": "DavHau",
"repo": "mach-nix",
"rev": "7e14360bde07dcae32e5e24f366c83272f52923f",
"type": "github"
},
"original": {
"id": "mach-nix",
"ref": "3.5.0",
"type": "indirect"
}
},
"nix-colors": { "nix-colors": {
"inputs": { "inputs": {
"base16-schemes": "base16-schemes", "base16-schemes": "base16-schemes",
@ -305,15 +340,16 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1717112898, "lastModified": 1643805626,
"narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=", "narHash": "sha256-AXLDVMG+UaAGsGSpOtQHPIKB+IZ0KSd9WS77aanGzgc=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0", "rev": "554d2d8aa25b6e583575459c297ec23750adb6cb",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nixpkgs", "id": "nixpkgs",
"ref": "nixos-unstable",
"type": "indirect" "type": "indirect"
} }
}, },
@ -364,6 +400,20 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs_2": {
"locked": {
"lastModified": 1717112898,
"narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"nixvim": { "nixvim": {
"inputs": { "inputs": {
"devshell": "devshell", "devshell": "devshell",
@ -392,14 +442,31 @@
"type": "github" "type": "github"
} }
}, },
"pypi-deps-db": {
"flake": false,
"locked": {
"lastModified": 1643877077,
"narHash": "sha256-jv8pIvRFTP919GybOxXE5TfOkrjTbdo9QiCO1TD3ZaY=",
"owner": "DavHau",
"repo": "pypi-deps-db",
"rev": "da53397f0b782b0b18deb72ef8e0fb5aa7c98aa3",
"type": "github"
},
"original": {
"owner": "DavHau",
"repo": "pypi-deps-db",
"type": "github"
}
},
"root": { "root": {
"inputs": { "inputs": {
"disko": "disko", "disko": "disko",
"home-manager": "home-manager", "home-manager": "home-manager",
"impermanence": "impermanence", "impermanence": "impermanence",
"mach-nix": "mach-nix",
"nix-colors": "nix-colors", "nix-colors": "nix-colors",
"nix-secrets": "nix-secrets", "nix-secrets": "nix-secrets",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs_2",
"nixpkgs-unstable": "nixpkgs-unstable", "nixpkgs-unstable": "nixpkgs-unstable",
"nixvim": "nixvim", "nixvim": "nixvim",
"sops-nix": "sops-nix" "sops-nix": "sops-nix"

View File

@ -5,6 +5,8 @@
# Nixpkgs # Nixpkgs
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
mach-nix.url = "mach-nix/3.5.0";
# Home manager # Home manager
home-manager = { home-manager = {
url = "github:nix-community/home-manager"; url = "github:nix-community/home-manager";

View File

@ -3,7 +3,7 @@
imports = [ imports = [
inputs.nix-colors.homeManagerModules.default inputs.nix-colors.homeManagerModules.default
./zsh.nix ./zsh.nix
./nixvim.nix ./nixvim
./fonts.nix ./fonts.nix
] ; ] ;

View File

@ -1,383 +0,0 @@
{ inputs, pkgs, config, ... }: {
imports = [
inputs.nixvim.homeManagerModules.nixvim
];
programs.nixvim = {
enable = true;
enableMan = true; # install man pages for nixvim options
clipboard.register = "unnamedplus"; # use system clipboard instead of internal registers
colorschemes.kanagawa = {
enable = true;
settings = {
commentStyle = {
italic = true;
};
dimInactive = true;
terminalColors = true;
theme = "wave";
transparent = false;
undercurl = true;
};
};
# Base16 colorscheme
# colorschemes.base16 = {
# enable = true;
# colorscheme = {
# base00 = "#${config.colorScheme.colors.base00}";
# base01 = "#${config.colorScheme.colors.base01}";
# base02 = "#${config.colorScheme.colors.base02}";
# base03 = "#${config.colorScheme.colors.base03}";
# base04 = "#${config.colorScheme.colors.base04}";
# base05 = "#${config.colorScheme.colors.base05}";
# base06 = "#${config.colorScheme.colors.base06}";
# base07 = "#${config.colorScheme.colors.base07}";
# base08 = "#${config.colorScheme.colors.base08}";
# base09 = "#${config.colorScheme.colors.base09}";
# base0A = "#${config.colorScheme.colors.base0A}";
# base0B = "#${config.colorScheme.colors.base0B}";
# base0C = "#${config.colorScheme.colors.base0C}";
# base0D = "#${config.colorScheme.colors.base0D}";
# base0E = "#${config.colorScheme.colors.base0E}";
# base0F = "#${config.colorScheme.colors.base0F}";
# };
# };
opts = {
#
# ========= General Appearance =========
#
background = "";
number = true; # show line numbers
relativenumber = true; # show relative linenumbers
laststatus = 0; # Display status line always
history = 1000; # Store lots of :cmdline history
showcmd = true; # Show incomplete cmds down the bottom
showmode = true; # Show current mode down the bottom
autoread = true; # Reload files changed outside vim
lazyredraw = true; # Redraw only when needed
showmatch = true; # highlight matching braces
ruler = true; # show current line and column
visualbell = true; # No sounds
listchars = "trail:·"; # Display tabs and trailing spaces visually
# ========= Font =========
guifont = "NotoSansMono:h9"; # fontname:fontsize
# ========= Cursor =========
guicursor = "n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20,n-v-i:blinkon0";
# ========= Redirect Temp Files =========
# backup
backupdir = "$HOME/.local/state/vim/backup//,/tmp//,.";
writebackup = false;
# swap
directory = "$HOME/.local/vim/swap//,/tmp//,.";
# ================ Indentation ======================
autoindent = true;
cindent = true; # automatically indent braces
smartindent = true;
smarttab = true;
shiftwidth = 2;
softtabstop = 4;
tabstop = 2;
expandtab = true;
# ================ Folds ============================
foldmethod = "indent"; # fold based on indent
foldnestmax = 3; # deepest fold is 3 levels
foldenable = false; # don't fold by default
# ================ Completion =======================
wildmode = "list:longest";
wildmenu = true; # enable ctrl-n and ctrl-p to scroll thru matches
# stuff to ignore when tab completing
wildignore = "*.o,*.obj,*~,vim/backups,sass-cache,DS_Store,vendor/rails/**,vendor/cache/**,*.gem,log/**,tmp/**,*.png,*.jpg,*.gif";
# ================ Scrolling ========================
scrolloff = 4; # Start scrolling when we're 4 lines away from margins
sidescrolloff = 15;
sidescroll = 1;
# ================ Searching ========================
incsearch = true;
hlsearch = true;
ignorecase = true;
smartcase = true;
# ================ Movement ========================
backspace = "indent,eol,start"; # allow backspace in insert mode
};
#
# ========= UI Plugins =========
#
plugins.nvim-colorizer = {
enable = true;
fileTypes = [ "*" ];
};
plugins.treesitter = {
enable = true;
};
plugins.lualine = {
enable = true;
theme = "auto";
componentSeparators = {
left = "";
right = "";
};
sectionSeparators = {
left = "";
right = "";
};
sections = {
lualine_a = [ "mode" ];
lualine_b = [ "branch" "diff" "diagnostics" ];
lualine_c = [ "filename" ];
lualine_x = [ "encoding" "fileformat" "filetype" ];
lualine_y = [ "progress" ];
lualine_z = [ "locations" ];
};
};
#
# ========= File Search =========
#
plugins.telescope = {
# https://github.com/nvim-telescope/telescope.nvim
enable = true;
extensions.fzy-native.enable = true;
};
# ========= File Nav ===========
#
plugins.harpoon = {
enable = true;
keymaps = {
toggleQuickMenu = "<leader>b";
};
};
plugins.nvim-tree = {
enable = true;
view.width = {
min = 30;
max = -1;
padding = 1;
};
disableNetrw = true;
filters.dotfiles = true;
};
#
# ========== Dev Tools =========
#
plugins.surround.enable = true; # vim-surround
plugins.gitsigns = {
enable = true;
settings.signs.add = {
hl = "GitSignsAdd";
text = " ";
numhl = "GitSignsAddNr";
linehl = "GitSignsAddLn";
};
settings.signs.change = {
hl = "GitSignsChange";
text = " ";
numhl = "GitSignsChangeNr";
linehl = "GitSignsChangeLn";
};
settings.signs.delete = {
hl = "GitSignsDelete";
text = " ";
numhl = "GitSignsDeleteNr";
linehl = "GitSignsDeleteLn";
};
settings.signs.topdelete = {
hl = "GitSignsDelete";
text = " ";
numhl = "GitSignsDeleteNr";
linehl = "GitSignsDeleteLn";
};
settings.signs.changedelete = {
hl = "GitSignsChange";
text = " ";
numhl = "GitSignsChangeNr";
linehl = "GitSignsChangeLn";
};
};
# Load Plugins that aren't provided as modules by nixvim
extraPlugins = builtins.attrValues {
inherit (pkgs.vimPlugins)
ale
vim-numbertoggle# Use relative number on focused buffer only
vimade# Dim unfocused buffers
vimwiki# Vim Wiki
YouCompleteMe# Code completion engine
vim-dadbod
vim-dadbod-ui
# Keep vim-devicons as last entry
vim-devicons;
};
# ========= Mapleader =========
globals.mapleader = ";";
#
# ========= Key binds =========
#
keymaps = [
# Switching windows
{
mode = [ "n" ];
action = "<C-W>h";
key = "<S-h>";
options = {
silent = true;
};
}
{
mode = [ "n" ];
action = "<C-W>j";
key = "<S-j>";
options = {
silent = true;
};
}
{
mode = [ "n" ];
action = "<C-W>k";
key = "<S-k>";
options = {
silent = true;
};
}
{
mode = [ "n" ];
action = "<C-W>l";
key = "<S-l>";
options = {
silent = true;
};
}
# Toggle nvim-tree
{
mode = [ "n" ];
action = "<cmd>NvimTreeFindFileToggle<CR>";
key = "tt";
options = {
silent = true;
};
}
{
# clear search highlighting
mode = [ "n" ];
key = "<space><space>";
action = "<cmd>nohlsearch<CR>";
options = { noremap = true; };
}
# ========== Telescope Plugin =========
{
# find files
mode = [ "n" ];
key = "<Leader>ff";
action = "<cmd>Telescope find_files<CR>";
options = { noremap = true; };
}
{
# live grep
mode = [ "n" ];
key = "<Leader>fg";
action = "<cmd>Telescope live_grep<CR>";
options = { noremap = true; };
}
{
# buffers
mode = [ "n" ];
key = "<Leader>fb";
action = "<cmd>Telescope buffers<CR>";
options = { noremap = true; };
}
{
# help tags
mode = [ "n" ];
key = "<Leader>fh";
action = "<cmd>Telescope help_tags<CR>";
options = { noremap = true; };
}
];
extraConfigVim = ''
" ================ Persistent Undo ==================
" Keep undo history across sessions, by storing in file.
" Only works all the time.
if has('persistent_undo')
silent !mkdir ~/.vim/backups > /dev/null 2>&1
set undodir=~/.vim/backups
set undofile
endif
" ================ Vim Wiki config =================
" See :h vimwiki_list for info on registering wiki paths
let wiki_0 = {}
let wiki_0.path = '~/dotfiles.wiki/'
let wiki_0.index = 'home'
let wiki_0.syntax = 'markdown'
let wiki_0.ext = '.md'
" fill spaces in page names with _ in pathing
let wiki_0.links_space_char = '_'
" ================ Ale ========================
" linter and fixer packages have to be installed via AUR or pamac
let g:ale_linters = {
\ 'c': ['clang-tidy'],
\ 'python': ['flake8'],
\ 'vim': ['vint'],
\ 'markdown': ['markdownlint'],
\ }
let g:ale_fixers = {
\ 'c': ['clang-format'],
\ 'javascript': ['prettier', 'eslint'],
\ 'json': ['fixjson', 'prettier'],
\ 'python': ['black', 'isort'],
\ }
" Set global fixers for all file types except Markdown
" Why? because double spaces at the end of a line in markdown indicate a
" linebreak without creating a new paragraph
function! SetGlobalFixers()
let g:ale_fixers['*'] = ['trim_whitespace', 'remove_trailing_lines']
endfunction
augroup GlobalFixers
autocmd!
autocmd VimEnter * call SetGlobalFixers()
augroup END
" Set buffer-local fixers for Markdown files
augroup MarkdownFixers
autocmd!
autocmd FileType markdown let b:ale_fixers = ['prettier']
augroup END
let g:ale_fix_on_save = 1
'';
};
}

View File

@ -0,0 +1,43 @@
{ inputs, pkgs, ... }: {
imports = [
inputs.nixvim.homeManagerModules.nixvim
./plugins
./options.nix
./theme.nix
./keymaps.nix
];
# Install home packages needed for nixvim
home.packages = builtins.attrValues {
inherit (pkgs)
nixpkgs-fmt
prettierd
;};
programs.nixvim = {
enable = true;
enableMan = true; # install man pages for nixvim options
clipboard.register = "unnamedplus"; # use system clipboard instead of internal registers
globals.mapleader = ";";
extraConfigVim = ''
" ================ Persistent Undo ==================
" Keep undo history across sessions, by storing in file.
" Only works all the time.
if has('persistent_undo')
silent !mkdir ~/.vim/backups > /dev/null 2>&1
set undodir=~/.vim/backups
set undofile
endif
" ================ Vim Wiki config =================
" See :h vimwiki_list for info on registering wiki paths
let wiki_0 = {}
let wiki_0.path = '~/docs/wiki/'
let wiki_0.index = 'home'
let wiki_0.syntax = 'markdown'
let wiki_0.ext = '.md'
'';
};
}

View File

@ -0,0 +1,85 @@
{
programs.nixvim.keymaps = [
# Switching buffers
{
mode = [ "n" ];
action = "<C-W>h";
key = "<S-h>";
options = {
silent = true;
};
}
{
mode = [ "n" ];
action = "<C-W>j";
key = "<S-j>";
options = {
silent = true;
};
}
{
mode = [ "n" ];
action = "<C-W>k";
key = "<S-k>";
options = {
silent = true;
};
}
{
mode = [ "n" ];
action = "<C-W>l";
key = "<S-l>";
options = {
silent = true;
};
}
# Toggle nvim-tree
{
mode = [ "n" ];
action = "<cmd>NvimTreeFindFileToggle<CR>";
key = "tt";
options = {
silent = true;
};
}
# Clear search highlighting
{
mode = [ "n" ];
key = "<space><space>";
action = "<cmd>nohlsearch<CR>";
options = { noremap = true; };
}
# Telescope Plugin
{
# find files
mode = [ "n" ];
key = "<Leader>ff";
action = "<cmd>Telescope find_files<CR>";
options = { noremap = true; };
}
{
# live grep
mode = [ "n" ];
key = "<Leader>fg";
action = "<cmd>Telescope live_grep<CR>";
options = { noremap = true; };
}
{
# buffers
mode = [ "n" ];
key = "<Leader>fb";
action = "<cmd>Telescope buffers<CR>";
options = { noremap = true; };
}
{
# help tags
mode = [ "n" ];
key = "<Leader>fh";
action = "<cmd>Telescope help_tags<CR>";
options = { noremap = true; };
}
];
}

View File

@ -0,0 +1,35 @@
{
programs.nixvim.opts = {
background = "";
number = true; # show line numbers
relativenumber = true; # show relative linenumbers
laststatus = 0; # Display status line always
history = 1000; # Store lots of :cmdline history
showcmd = true; # Show incomplete cmds down the bottom
showmode = true; # Show current mode down the bottom
autoread = true; # Reload files changed outside vim
lazyredraw = true; # Redraw only when needed
showmatch = true; # highlight matching braces
ruler = true; # show current line and column
visualbell = true; # No sounds
listchars = "trail:·"; # Display tabs and trailing spaces visually
autoindent = true;
cindent = true; # automatically indent braces
smartindent = true;
smarttab = true;
shiftwidth = 2;
softtabstop = 4;
tabstop = 2;
expandtab = true;
wildmode = "list:longest";
wildmenu = true; # enable ctrl-n and ctrl-p to scroll thru matches
scrolloff = 4; # Start scrolling when we're 4 lines away from margins
sidescrolloff = 15;
sidescroll = 1;
incsearch = true;
hlsearch = true;
ignorecase = true;
smartcase = true;
backspace = "indent,eol,start"; # allow backspace in insert mode
};
}

View File

@ -0,0 +1,6 @@
{
programs.nixvim.plugins.nvim-colorizer = {
enable = true;
fileTypes = [ "*" ];
};
}

View File

@ -0,0 +1,21 @@
{
programs.nixvim.plugins.conform-nvim = {
enable = true;
formatOnSave = {
lspFallback = true;
timeoutMs = 500;
};
notifyOnError = true;
formattersByFt = {
html = [["prettierd" "prettier"]];
css = [["prettierd" "prettier"]];
javascript = [["prettierd" "prettier"]];
python = ["black"];
lua = ["stylua"];
nix = ["alejandra"];
markdown = [["prettierd" "prettier"]];
yaml = ["yamllint" "yamlfmt"];
sql = ["sqlfmt"];
};
};
}

View File

@ -0,0 +1,30 @@
{ pkgs, ... }:
{
imports = [
./colorizer.nix
./conform.nix
./gitsigns.nix
./harpoon.nix
./lsp.nix
./lualine.nix
./nvim-tree.nix
./surround.nix
./telescope.nix
./treesitter.nix
];
# Load Plugins that aren't provided as modules by nixvim
programs.nixvim.extraPlugins = builtins.attrValues {
inherit (pkgs.vimPlugins)
ale
vim-numbertoggle
vimwiki
vim-dadbod
vim-dadbod-ui
# Keep vim-devicons as last entry
vim-devicons;
};
}

View File

@ -0,0 +1,35 @@
{
programs.nixvim.plugins.gitsigns = {
enable = true;
settings.signs.add = {
hl = "GitSignsAdd";
text = " ";
numhl = "GitSignsAddNr";
linehl = "GitSignsAddLn";
};
settings.signs.change = {
hl = "GitSignsChange";
text = " ";
numhl = "GitSignsChangeNr";
linehl = "GitSignsChangeLn";
};
settings.signs.delete = {
hl = "GitSignsDelete";
text = " ";
numhl = "GitSignsDeleteNr";
linehl = "GitSignsDeleteLn";
};
settings.signs.topdelete = {
hl = "GitSignsDelete";
text = " ";
numhl = "GitSignsDeleteNr";
linehl = "GitSignsDeleteLn";
};
settings.signs.changedelete = {
hl = "GitSignsChange";
text = " ";
numhl = "GitSignsChangeNr";
linehl = "GitSignsChangeLn";
};
};
}

View File

@ -0,0 +1,8 @@
{
programs.nixvim.plugins.harpoon = {
enable = true;
keymaps = {
toggleQuickMenu = "<leader>b";
};
};
}

View File

@ -0,0 +1,51 @@
{
programs.nixvim.plugins.lsp = {
enable = true;
servers = {
lua-ls = {enable = true;};
nixd = {enable = true;};
bashls = {enable = true;};
pyright = {enable = true;};
html = {enable = true;};
yamlls = {enable = true;};
marksman = {enable = true;};
#sqls = {enable = true;};
};
keymaps = {
lspBuf = {
gd = {
action = "definition";
desc = "Goto Definition";
};
gr = {
action = "references";
desc = "Goto References";
};
gD = {
action = "declaration";
desc = "Goto Declaration";
};
gI = {
action = "implementation";
desc = "Goto Implementation";
};
gT = {
action = "type_definition";
desc = "Type Definition";
};
K = {
action = "hover";
desc = "Hover";
};
"<leader>cw" = {
action = "workspace_symbol";
desc = "Workspace Symbol";
};
"<leader>cr" = {
action = "rename";
desc = "Rename";
};
};
};
};
}

View File

@ -0,0 +1,13 @@
{
# Add tiny pictograms to lsp
programs.nixvim.plugins.lspkind = {
enable = true;
symbolMap = {
Copilot = "";
};
extraOptions = {
maxwidth = 50;
ellipsis_char = "...";
};
};
}

View File

@ -0,0 +1,22 @@
{
programs.nixvim.plugins.lualine = {
enable = true;
theme = "auto";
componentSeparators = {
left = "";
right = "";
};
sectionSeparators = {
left = "";
right = "";
};
sections = {
lualine_a = [ "mode" ];
lualine_b = [ "branch" "diff" "diagnostics" ];
lualine_c = [ "filename" ];
lualine_x = [ "encoding" "fileformat" "filetype" ];
lualine_y = [ "progress" ];
lualine_z = [ "locations" ];
};
};
}

View File

@ -0,0 +1,12 @@
{
programs.nixvim.plugins.nvim-tree = {
enable = true;
view.width = {
min = 30;
max = -1;
padding = 1;
};
disableNetrw = true;
filters.dotfiles = true;
};
}

View File

@ -0,0 +1,3 @@
{
programs.nixvim.plugins.surround.enable = true; # vim-surround
}

View File

@ -0,0 +1,6 @@
{
programs.nixvim.plugins.telescope = {
enable = true;
extensions.fzy-native.enable = true;
};
}

View File

@ -0,0 +1,5 @@
{
programs.nixvim.plugins.treesitter = {
enable = true;
};
}

View File

@ -0,0 +1,15 @@
{
programs.nixvim.colorschemes.kanagawa = {
enable = true;
settings = {
commentStyle = {
italic = true;
};
dimInactive = true;
terminalColors = true;
theme = "wave";
transparent = false;
undercurl = true;
};
};
}

View File

@ -3,13 +3,13 @@
./firefox.nix ./firefox.nix
./alacritty.nix ./alacritty.nix
]; ];
# Global packages for desktop environments # Global packages for desktop environments
home.packages = [ home.packages = [
pkgs.alacritty pkgs.alacritty
pkgs.libnotify pkgs.libnotify
pkgs.zathura pkgs.zathura
pkgs.xfce.thunar pkgs.xfce.thunar
pkgs.wofi
pkgs.kcolorchooser pkgs.kcolorchooser
]; ];
} }

View File

@ -6,10 +6,8 @@
}: { }: {
imports = [ imports = [
../wallpaper-changer/swww-wallpaper-changer
../common ../common
../waybar.nix ../wayland
../mako.nix
]; ];
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;

View File

@ -0,0 +1,13 @@
{ pkgs, ... }:
{
imports = [
./mako.nix
./waybar.nix
./swww-wallpaper-changer.nix
];
home.packages = [
pkgs.wofi
pkgs.wl-clipboard
];
}

View File

@ -2,5 +2,5 @@
# You can build them using 'nix build .#example' # You can build them using 'nix build .#example'
pkgs: { pkgs: {
sddm-theme = pkgs.callPackage ./sddm-theme { }; sddm-theme = pkgs.callPackage ./sddm-theme { };
wallpaper_changer = pkgs.callPackage ./wallpaper-changer { }; sqlfmt = pkgs.callPackage ./sqlfmt.nix { };
} }

25
pkgs/sqlfmt.nix Normal file
View File

@ -0,0 +1,25 @@
{ pkgs, fetchFromGitHub, }:
pkgs.stdenv.mkDerivation {
name = "sqlfmt-v0.21.3";
src = fetchFromGitHub {
owner = "tconbeer";
repo = "sqlfmt";
rev = "v0.21.3";
sha256 = "1sx8gf13pwsw63v5hfnml18fs2lnb2piigc1d4q8hmiywzmhzf85";
};
#buildInputs = [ pkgs.python3 pkgs.isort pkgs.black pkgs.python311Packages.pytest pkgs.python311Packages.flake8 pkgs.python311Packages.mypy ];
buildInputs = [ pkgs.python3 pkgs.python311Packages.pip pkgs.isort pkgs.black pkgs.python311Packages.pytest pkgs.python311Packages.flake8 pkgs.python311Packages.mypy ];
installPhase = ''
export PYTHONPATH="$\{python.sitePackages}:$PYTHONPATH"
$\{python}/bin/pip install --prefix $out .
'';
meta = {
description = "sqlfmt is a tool that autoformats your SQL queries.";
homepage = "https://github.com/tconbeer/sqlfmt";
license = "Apache 2.0";
};
}