mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-26 05:40:52 +01:00
Initial commit
This commit is contained in:
commit
e598a0a70e
12 changed files with 1014 additions and 0 deletions
47
config/home/home-lisa.nix
Normal file
47
config/home/home-lisa.nix
Normal file
|
@ -0,0 +1,47 @@
|
||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
nvimsettings = import ./nvim/nvim.nix;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
# Let Home Manager install and manage itself.
|
||||||
|
programs.home-manager.enable = true;
|
||||||
|
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
rnix-lsp
|
||||||
|
sumneko-lua-language-server
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(import (builtins.fetchTarball {
|
||||||
|
url = https://github.com/nix-community/neovim-nightly-overlay/archive/master.tar.gz;
|
||||||
|
}))
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
programs.neovim = nvimsettings pkgs;
|
||||||
|
programs.fish.functions = {
|
||||||
|
fish_greeting = {
|
||||||
|
description = "Greeting to show when starting a fish shell";
|
||||||
|
body = "";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
programs.git = {
|
||||||
|
enable = true;
|
||||||
|
userName = "Julien Malka";
|
||||||
|
userEmail = "julien.malka@me.com";
|
||||||
|
};
|
||||||
|
|
||||||
|
# Home Manager needs a bit of information about you and the
|
||||||
|
# paths it should manage.
|
||||||
|
home.username = "julien";
|
||||||
|
home.homeDirectory = "/home/julien";
|
||||||
|
|
||||||
|
home.stateVersion = "21.11";
|
||||||
|
|
||||||
|
}
|
40
config/home/mails.nix
Normal file
40
config/home/mails.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.mbsync.enable = true;
|
||||||
|
programs.msmtp.enable = true;
|
||||||
|
programs.afew.enable = true;
|
||||||
|
accounts.email = {
|
||||||
|
accounts.ens = {
|
||||||
|
address = "julien.malka@ens.fr";
|
||||||
|
imap.host = "clipper.ens.fr";
|
||||||
|
mbsync = {
|
||||||
|
enable = true;
|
||||||
|
create = "maildir";
|
||||||
|
};
|
||||||
|
msmtp.enable = true;
|
||||||
|
notmuch.enable = true;
|
||||||
|
primary = true;
|
||||||
|
realName = "Julien Malka";
|
||||||
|
passwordCommand = "echo ***REMOVED***";
|
||||||
|
smtp = {
|
||||||
|
host = "clipper.ens.fr";
|
||||||
|
};
|
||||||
|
userName = "jmalka";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.mbsync.enable = true;
|
||||||
|
services.mbsync.frequency = "*-*-* *:*:00";
|
||||||
|
services.mbsync.postExec = "${pkgs.notmuch}/bin/notmuch new";
|
||||||
|
services.mbsync.verbose = false;
|
||||||
|
|
||||||
|
programs.notmuch = {
|
||||||
|
enable = true;
|
||||||
|
new.tags = ["new"];
|
||||||
|
hooks.postNew = ''
|
||||||
|
${pkgs.afew}/bin/afew --tag --new
|
||||||
|
${pkgs.afew}/bin/afew --move-mails
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
204
config/home/nvim/lua/galaxyline.lua
Executable file
204
config/home/nvim/lua/galaxyline.lua
Executable file
|
@ -0,0 +1,204 @@
|
||||||
|
-- This file configures galaxyline, a fast and small statusline for nvim.
|
||||||
|
-- The configuration was taken from github.com/siduck76/neovim-dotfiles/
|
||||||
|
-- All I did was change the colors. Full credit goes to siduck76
|
||||||
|
|
||||||
|
local gl = require("galaxyline")
|
||||||
|
local gls = gl.section
|
||||||
|
|
||||||
|
gl.short_line_list = {" "} -- keeping this table { } as empty will show inactive statuslines
|
||||||
|
|
||||||
|
local colors = {
|
||||||
|
bg = "#2e303e",
|
||||||
|
line_bg = "#2e303e",
|
||||||
|
fg = "#e3e6ee",
|
||||||
|
green = "#29d398",
|
||||||
|
orange = "#efb993",
|
||||||
|
red = "#e95678",
|
||||||
|
lightbg = "#2e303e",
|
||||||
|
lightbasdfg = "#393b4d",
|
||||||
|
nord = "#9699b7",
|
||||||
|
greenYel = "#efb993"
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[1] = {
|
||||||
|
leftRounded = {
|
||||||
|
provider = function()
|
||||||
|
return " "
|
||||||
|
end,
|
||||||
|
highlight = {colors.nord, colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[2] = {
|
||||||
|
statusIcon = {
|
||||||
|
provider = function()
|
||||||
|
return " "
|
||||||
|
end,
|
||||||
|
highlight = {colors.fg, colors.bg},
|
||||||
|
separator = " ",
|
||||||
|
separator_highlight = {colors.lightbg, colors.lightbg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[3] = {
|
||||||
|
FileIcon = {
|
||||||
|
provider = "FileIcon",
|
||||||
|
condition = buffer_not_empty,
|
||||||
|
highlight = {require("galaxyline.provider_fileinfo").get_file_icon_color, colors.lightbg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[4] = {
|
||||||
|
FileName = {
|
||||||
|
provider = {"FileName", "FileSize"},
|
||||||
|
condition = buffer_not_empty,
|
||||||
|
highlight = {colors.fg, colors.lightbg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[5] = {
|
||||||
|
teech = {
|
||||||
|
provider = function()
|
||||||
|
return " "
|
||||||
|
end,
|
||||||
|
separator = " ",
|
||||||
|
highlight = {colors.lightbg, colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
local checkwidth = function()
|
||||||
|
local squeeze_width = vim.fn.winwidth(0) / 2
|
||||||
|
if squeeze_width > 40 then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
gls.left[6] = {
|
||||||
|
DiffAdd = {
|
||||||
|
provider = "DiffAdd",
|
||||||
|
condition = checkwidth,
|
||||||
|
icon = " ",
|
||||||
|
highlight = {colors.greenYel, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[7] = {
|
||||||
|
DiffModified = {
|
||||||
|
provider = "DiffModified",
|
||||||
|
condition = checkwidth,
|
||||||
|
icon = " ",
|
||||||
|
highlight = {colors.orange, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[8] = {
|
||||||
|
DiffRemove = {
|
||||||
|
provider = "DiffRemove",
|
||||||
|
condition = checkwidth,
|
||||||
|
icon = " ",
|
||||||
|
highlight = {colors.lightbg, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[9] = {
|
||||||
|
LeftEnd = {
|
||||||
|
provider = function()
|
||||||
|
return " "
|
||||||
|
end,
|
||||||
|
separator = " ",
|
||||||
|
separator_highlight = {colors.line_bg, colors.line_bg},
|
||||||
|
highlight = {colors.line_bg, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[10] = {
|
||||||
|
DiagnosticError = {
|
||||||
|
provider = "DiagnosticError",
|
||||||
|
icon = " ",
|
||||||
|
highlight = {colors.red, colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[11] = {
|
||||||
|
Space = {
|
||||||
|
provider = function()
|
||||||
|
return " "
|
||||||
|
end,
|
||||||
|
highlight = {colors.line_bg, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.left[12] = {
|
||||||
|
DiagnosticWarn = {
|
||||||
|
provider = "DiagnosticWarn",
|
||||||
|
icon = " ",
|
||||||
|
highlight = {colors.red, colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[1] = {
|
||||||
|
GitIcon = {
|
||||||
|
provider = function()
|
||||||
|
return " "
|
||||||
|
end,
|
||||||
|
condition = require("galaxyline.provider_vcs").check_git_workspace,
|
||||||
|
highlight = {colors.green, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[2] = {
|
||||||
|
GitBranch = {
|
||||||
|
provider = "GitBranch",
|
||||||
|
condition = require("galaxyline.provider_vcs").check_git_workspace,
|
||||||
|
highlight = {colors.green, colors.line_bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[3] = {
|
||||||
|
right_LeftRounded = {
|
||||||
|
provider = function()
|
||||||
|
return " "
|
||||||
|
end,
|
||||||
|
separator = " ",
|
||||||
|
separator_highlight = {colors.bg, colors.bg},
|
||||||
|
highlight = {colors.lightbg, colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[4] = {
|
||||||
|
ViMode = {
|
||||||
|
provider = function()
|
||||||
|
local alias = {
|
||||||
|
n = "NORMAL",
|
||||||
|
i = "INSERT",
|
||||||
|
c = "COMMAND",
|
||||||
|
V = "VISUAL",
|
||||||
|
[""] = "VISUAL",
|
||||||
|
v = "VISUAL",
|
||||||
|
R = "REPLACE"
|
||||||
|
}
|
||||||
|
return alias[vim.fn.mode()]
|
||||||
|
end,
|
||||||
|
highlight = {colors.fg, colors.lightbg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[5] = {
|
||||||
|
PerCent = {
|
||||||
|
provider = "LinePercent",
|
||||||
|
separator = " ",
|
||||||
|
separator_highlight = {colors.lightbg, colors.lightbg},
|
||||||
|
highlight = {colors.fg, colors.lightbg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gls.right[6] = {
|
||||||
|
rightRounded = {
|
||||||
|
provider = function()
|
||||||
|
return " "
|
||||||
|
end,
|
||||||
|
highlight = {colors.lightbg, colors.bg}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
76
config/home/nvim/lua/lsp.lua
Executable file
76
config/home/nvim/lua/lsp.lua
Executable file
|
@ -0,0 +1,76 @@
|
||||||
|
-- This file sets up autocompletion for neovim's native lsp
|
||||||
|
|
||||||
|
-- This enables all the language servers I want on my system
|
||||||
|
-- Change these to whatever languages you use
|
||||||
|
|
||||||
|
require'lspconfig'.rnix.setup{}
|
||||||
|
require'lspconfig'.sumneko_lua.setup{}
|
||||||
|
vim.o.completeopt = "menuone,noselect"
|
||||||
|
|
||||||
|
-- Autocompletion setup
|
||||||
|
require'compe'.setup {
|
||||||
|
enabled = true;
|
||||||
|
autocomplete = true;
|
||||||
|
debug = false;
|
||||||
|
min_length = 1;
|
||||||
|
preselect = 'enable';
|
||||||
|
throttle_time = 80;
|
||||||
|
source_timeout = 200;
|
||||||
|
incomplete_delay = 400;
|
||||||
|
max_abbr_width = 100;
|
||||||
|
max_kind_width = 100;
|
||||||
|
max_menu_width = 100;
|
||||||
|
documentation = false;
|
||||||
|
source = {
|
||||||
|
path = true;
|
||||||
|
buffer = true;
|
||||||
|
nvim_lsp = true;
|
||||||
|
treesitter = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Set tab to accept the autocompletion
|
||||||
|
local t = function(str)
|
||||||
|
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||||
|
end
|
||||||
|
_G.tab_complete = function()
|
||||||
|
if vim.fn.pumvisible() == 1 then
|
||||||
|
return t "<C-n>"
|
||||||
|
else
|
||||||
|
return t "<S-Tab>"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
vim.api.nvim_set_keymap("i", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||||
|
vim.api.nvim_set_keymap("s", "<Tab>", "v:lua.tab_complete()", {expr = true})
|
||||||
|
|
||||||
|
|
||||||
|
-- set the path to the sumneko installation; if you previously installed via the now deprecated :LspInstall, use
|
||||||
|
local sumneko_root_path = vim.fn.stdpath('cache')..'/lspconfig/sumneko_lua/lua-language-server'
|
||||||
|
local sumneko_binary = "lua-language-server"
|
||||||
|
|
||||||
|
local runtime_path = vim.split(package.path, ';')
|
||||||
|
table.insert(runtime_path, "lua/?.lua")
|
||||||
|
table.insert(runtime_path, "lua/?/init.lua")
|
||||||
|
|
||||||
|
require'lspconfig'.sumneko_lua.setup {
|
||||||
|
cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"};
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
version = 'LuaJIT',
|
||||||
|
path = runtime_path,
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
globals = {'vim'},
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
preloadFileSize = 120
|
||||||
|
},
|
||||||
|
telemetry = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
60
config/home/nvim/lua/nvim-tree.lua
Executable file
60
config/home/nvim/lua/nvim-tree.lua
Executable file
|
@ -0,0 +1,60 @@
|
||||||
|
-- following options are the default
|
||||||
|
-- each of these are documented in `:help nvim-tree.OPTION_NAME`
|
||||||
|
require'nvim-tree'.setup {
|
||||||
|
disable_netrw = true,
|
||||||
|
hijack_netrw = true,
|
||||||
|
open_on_setup = false,
|
||||||
|
ignore_ft_on_setup = {},
|
||||||
|
auto_close = false,
|
||||||
|
open_on_tab = false,
|
||||||
|
hijack_cursor = false,
|
||||||
|
update_cwd = false,
|
||||||
|
update_to_buf_dir = {
|
||||||
|
enable = true,
|
||||||
|
auto_open = true,
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
enable = false,
|
||||||
|
icons = {
|
||||||
|
hint = "",
|
||||||
|
info = "",
|
||||||
|
warning = "",
|
||||||
|
error = "",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
update_focused_file = {
|
||||||
|
enable = false,
|
||||||
|
update_cwd = false,
|
||||||
|
ignore_list = {}
|
||||||
|
},
|
||||||
|
system_open = {
|
||||||
|
cmd = nil,
|
||||||
|
args = {}
|
||||||
|
},
|
||||||
|
filters = {
|
||||||
|
dotfiles = false,
|
||||||
|
custom = {}
|
||||||
|
},
|
||||||
|
git = {
|
||||||
|
enable = true,
|
||||||
|
ignore = true,
|
||||||
|
timeout = 500,
|
||||||
|
},
|
||||||
|
view = {
|
||||||
|
width = 30,
|
||||||
|
height = 30,
|
||||||
|
hide_root_folder = false,
|
||||||
|
side = 'left',
|
||||||
|
auto_resize = false,
|
||||||
|
mappings = {
|
||||||
|
custom_only = false,
|
||||||
|
list = {}
|
||||||
|
},
|
||||||
|
number = false,
|
||||||
|
relativenumber = false
|
||||||
|
},
|
||||||
|
trash = {
|
||||||
|
cmd = "trash",
|
||||||
|
require_confirm = true
|
||||||
|
}
|
||||||
|
}
|
96
config/home/nvim/lua/settings.lua
Normal file
96
config/home/nvim/lua/settings.lua
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
-- Lazy load everything!
|
||||||
|
--
|
||||||
|
--
|
||||||
|
--dofile("lsp.lua")
|
||||||
|
--dofile("galaxyline.lua")
|
||||||
|
--dofile("nvim-tree.lua")
|
||||||
|
local opt = vim.opt
|
||||||
|
local g = vim.g
|
||||||
|
|
||||||
|
|
||||||
|
vim.cmd [[
|
||||||
|
set nowrap
|
||||||
|
set nobackup
|
||||||
|
set nowritebackup
|
||||||
|
set noerrorbells
|
||||||
|
set noswapfile
|
||||||
|
|
||||||
|
colorscheme dusk
|
||||||
|
function! Preserve(command)
|
||||||
|
let w = winsaveview()
|
||||||
|
execute a:command
|
||||||
|
call winrestview(w)
|
||||||
|
endfunction
|
||||||
|
autocmd FileType nix map <nowait> <leader>u :call Preserve("%!update-nix-fetchgit --location=" . line(".") . ":" . col("."))<CR>
|
||||||
|
autocmd BufWinEnter NvimTree setlocal nonumber
|
||||||
|
map ; :
|
||||||
|
highlight IndentBlanklineChar guifg = #393b4d
|
||||||
|
|
||||||
|
]]
|
||||||
|
|
||||||
|
-- Enable plugins
|
||||||
|
require('bufferline').setup{}
|
||||||
|
require('pears').setup()
|
||||||
|
require('colorizer').setup()
|
||||||
|
|
||||||
|
-- Treesitter settings
|
||||||
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
|
||||||
|
highlight = {
|
||||||
|
enable = true
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
local map = vim.api.nvim_set_keymap
|
||||||
|
options = { noremap = true }
|
||||||
|
map('n', '<C-p>', ':NvimTreeToggle <CR>', options)
|
||||||
|
map('n', '<C-f>', ':Telescope find_files <CR>', options)
|
||||||
|
map('n', '<C-n>', ':Telescope live_grep <CR>', options)
|
||||||
|
map('n', '<C-l>', ':noh <CR>', options)
|
||||||
|
map('n', '<C-s>', ':!xclip -sel c -o | pygmentize -f html | xclip -sel c <CR> <CR>', options)
|
||||||
|
vim.api.nvim_set_keymap('n', '0', "getline('.')[0 : col('.') - 2] =~# '^\\s\\+$' ? '0' : '^'", {silent = true, noremap = true, expr = true})
|
||||||
|
g.mapleader = ' '
|
||||||
|
|
||||||
|
-- Indent line
|
||||||
|
g.indent_blankline_char = '▏'
|
||||||
|
|
||||||
|
-- Performance
|
||||||
|
opt.lazyredraw = true;
|
||||||
|
opt.shell = "zsh"
|
||||||
|
opt.shadafile = "NONE"
|
||||||
|
|
||||||
|
-- Colors
|
||||||
|
opt.termguicolors = true
|
||||||
|
|
||||||
|
-- Undo files
|
||||||
|
opt.undofile = true
|
||||||
|
|
||||||
|
-- Indentation
|
||||||
|
opt.smartindent = true
|
||||||
|
opt.tabstop = 4
|
||||||
|
opt.shiftwidth = 4
|
||||||
|
opt.shiftround = true
|
||||||
|
opt.expandtab = true
|
||||||
|
opt.scrolloff = 3
|
||||||
|
|
||||||
|
-- Set clipboard to use system clipboard
|
||||||
|
opt.clipboard = "unnamedplus"
|
||||||
|
|
||||||
|
-- Use mouse
|
||||||
|
opt.mouse = "a"
|
||||||
|
|
||||||
|
-- Nicer UI settings
|
||||||
|
opt.cursorline = true
|
||||||
|
opt.relativenumber = true
|
||||||
|
opt.number = true
|
||||||
|
|
||||||
|
-- Get rid of annoying viminfo file
|
||||||
|
opt.viminfo = ""
|
||||||
|
opt.viminfofile = "NONE"
|
||||||
|
|
||||||
|
-- Miscellaneous quality of life
|
||||||
|
opt.ignorecase = true
|
||||||
|
opt.ttimeoutlen = 5
|
||||||
|
opt.compatible = false
|
||||||
|
opt.hidden = true
|
||||||
|
opt.shortmess = "atI"
|
62
config/home/nvim/nvim.nix
Executable file
62
config/home/nvim/nvim.nix
Executable file
|
@ -0,0 +1,62 @@
|
||||||
|
# This is my configuration file for neovim.
|
||||||
|
# I've written it in nix for ease of use with home-manager,
|
||||||
|
# but there are several vimscript and lua files imported as well.
|
||||||
|
# If you want more help understanding or modifying these configurations,
|
||||||
|
# please submit an issue on Github or contact me on Discord 'notusknot#5622'
|
||||||
|
{ pkgs, config, ... }:
|
||||||
|
let
|
||||||
|
dusk-vim = pkgs.vimUtils.buildVimPlugin {
|
||||||
|
name = "dusk-vim";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "notusknot";
|
||||||
|
repo = "dusk-vim";
|
||||||
|
rev = "8eb71f092ebfa173a6568befbe522a56e8382756";
|
||||||
|
sha256 = "09l4hda5jnyigc2hhlirv1rc8hsnsc4zgcv4sa4br8fryi73nf4g";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
enable = true;
|
||||||
|
package = pkgs.neovim-unwrapped;
|
||||||
|
plugins = with pkgs.vimPlugins; [
|
||||||
|
# File tree
|
||||||
|
nvim-web-devicons
|
||||||
|
nvim-tree-lua
|
||||||
|
# LSP
|
||||||
|
nvim-lspconfig
|
||||||
|
# Languages
|
||||||
|
vim-nix
|
||||||
|
|
||||||
|
# Eyecandy
|
||||||
|
nvim-treesitter
|
||||||
|
bufferline-nvim
|
||||||
|
galaxyline-nvim
|
||||||
|
nvim-colorizer-lua
|
||||||
|
pears-nvim
|
||||||
|
dusk-vim
|
||||||
|
|
||||||
|
# Lsp and completion
|
||||||
|
nvim-lspconfig
|
||||||
|
nvim-compe
|
||||||
|
|
||||||
|
# Telescope
|
||||||
|
telescope-nvim
|
||||||
|
|
||||||
|
# Indent lines
|
||||||
|
indent-blankline-nvim
|
||||||
|
];
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
gcc
|
||||||
|
rnix-lsp
|
||||||
|
tree-sitter
|
||||||
|
sumneko-lua-language-server
|
||||||
|
];
|
||||||
|
extraConfig = ''
|
||||||
|
luafile ${./lua}/lsp.lua
|
||||||
|
luafile ${./lua}/nvim-tree.lua
|
||||||
|
luafile ${./lua}/galaxyline.lua
|
||||||
|
luafile ${./lua}/settings.lua
|
||||||
|
'';
|
||||||
|
}
|
64
config/hosts/lisa.nix
Normal file
64
config/hosts/lisa.nix
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[
|
||||||
|
(modulesPath + "/profiles/qemu-guest.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "sd_mod" "sr_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ ];
|
||||||
|
boot.kernelModules = [ ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
|
fileSystems."/" =
|
||||||
|
{ device = "/dev/disk/by-uuid/eaec3978-f462-4634-95e6-06d59512deb8";
|
||||||
|
fsType = "ext4";
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/EAD2-51DB";
|
||||||
|
fsType = "vfat";
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices =
|
||||||
|
[ { device = "/dev/disk/by-uuid/c19ec918-ba8c-4bab-9ee0-831465cb432e"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
nix.maxJobs = lib.mkDefault 8;
|
||||||
|
|
||||||
|
# Specific to lisa but not hardware
|
||||||
|
|
||||||
|
|
||||||
|
# Use the systemd-boot EFI boot loader.
|
||||||
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
boot.loader.efi.canTouchEfiVariables = true;
|
||||||
|
|
||||||
|
networking.hostName = "lisa"; # Define your hostname.
|
||||||
|
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
|
||||||
|
|
||||||
|
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
|
||||||
|
# Per-interface useDHCP will be mandatory in the future, so this generated config
|
||||||
|
# replicates the default behaviour.
|
||||||
|
networking.useDHCP = false;
|
||||||
|
networking.interfaces.ens18.useDHCP = true;
|
||||||
|
networking.interfaces.ens19.useDHCP = false;
|
||||||
|
networking.interfaces.ens19.ipv6.addresses = [ {
|
||||||
|
address = "2a01:e0a:5f9:9681:5880:c9ff:fe9f:3dfb";
|
||||||
|
prefixLength = 120;
|
||||||
|
} ];
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [22 80 443 8096 8920];
|
||||||
|
networking.firewall.allowedUDPPorts = [22 80 443 1900 7359];
|
||||||
|
networking.firewall.allowedUDPPortRanges = [ { from = 60000; to = 61000;}];
|
||||||
|
|
||||||
|
|
||||||
|
system.stateVersion = "20.09"; # Did you read the comment?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
121
config/web-services/lisa-services.nix
Normal file
121
config/web-services/lisa-services.nix
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
services.jellyfin = {
|
||||||
|
enable = true;
|
||||||
|
group = "tv";
|
||||||
|
package = pkgs.jellyfin;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.sonarr = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
group = "tv";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.radarr = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
group = "tv";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.transmission = {
|
||||||
|
enable = true;
|
||||||
|
group = "tv";
|
||||||
|
downloadDirPermissions = "774";
|
||||||
|
settings = {
|
||||||
|
rpc-port = 9091;
|
||||||
|
download-dir = "/home/transmission/Downloads/";
|
||||||
|
incomplete-dir = "/home/transmission/Incomplete/";
|
||||||
|
incomplete-dir-enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.jackett = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
virtualHosts."julienmalka.me" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
root = "/var/www/julienmalka.me";
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualHosts."www.julienmalka.me" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
root = "/var/www/julienmalka.me";
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualHosts."tv.julienmalka.me" = {
|
||||||
|
addSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:8096";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualHosts."series.julienmalka.me" = {
|
||||||
|
addSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:8989";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualHosts."downloads.julienmalka.me" = {
|
||||||
|
addSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:9091";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualHosts."jackett.julienmalka.me" = {
|
||||||
|
addSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:9117";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
virtualHosts."films.julienmalka.me" = {
|
||||||
|
addSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://localhost:7878";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
security.acme.certs = {
|
||||||
|
"www.julienmalka.me".email = "julien.malka@me.com";
|
||||||
|
"julienmalka.me".email = "julien.malka@me.com";
|
||||||
|
"tv.julienmalka.me".email = "julien.malka@me.com";
|
||||||
|
"series.julienmalka.me".email = "julien.malka@me.com";
|
||||||
|
"downloads.julienmalka.me".email = "julien.malka@me.com";
|
||||||
|
"jackett.julienmalka.me".email = "julien.malka@me.com";
|
||||||
|
"films.julienmalka.me".email = "julien.malka@me.com";
|
||||||
|
};
|
||||||
|
|
||||||
|
security.acme.acceptTerms = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
36
configuration.nix
Normal file
36
configuration.nix
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
nix = {
|
||||||
|
autoOptimiseStore = true;
|
||||||
|
allowedUsers = [ "julien" ];
|
||||||
|
gc = {
|
||||||
|
automatic = true;
|
||||||
|
dates = "daily";
|
||||||
|
};
|
||||||
|
package = pkgs.nixUnstable;
|
||||||
|
extraOptions = ''
|
||||||
|
experimental-features = nix-command flakes
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
time.timeZone = "Europe/Paris";
|
||||||
|
i18n.defaultLocale = "en_US.UTF-8";
|
||||||
|
console = {
|
||||||
|
font = "Lat2-Terminus16";
|
||||||
|
keyMap = "fr";
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.julien = {
|
||||||
|
isNormalUser = true;
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
home = "/home/julien";
|
||||||
|
shell = pkgs.fish;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
services.openssh.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
168
flake.lock
generated
Normal file
168
flake.lock
generated
Normal file
|
@ -0,0 +1,168 @@
|
||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"flake-compat": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1627913399,
|
||||||
|
"narHash": "sha256-hY8g6H2KFL8ownSiFeMOjwPC8P0ueXpCVEbxgda3pko=",
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"rev": "12c64ca55c1014cdc1b16ed5a804aa8576601ff2",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "edolstra",
|
||||||
|
"repo": "flake-compat",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"flake-utils": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1629481132,
|
||||||
|
"narHash": "sha256-JHgasjPR0/J1J3DRm4KxM4zTyAj4IOJY8vIl75v/kPI=",
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"rev": "997f7efcb746a9c140ce1f13c72263189225f482",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "numtide",
|
||||||
|
"repo": "flake-utils",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"home-manager": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1638311312,
|
||||||
|
"narHash": "sha256-OMAd3WZ/VtMK0QQwDrrynP6+jOlWLd1yQtnW56+eZtA=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"rev": "f23073f1daa769a28a12ac587eea487aa8afb196",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "home-manager",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"neovim-flake": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": "flake-utils",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"dir": "contrib",
|
||||||
|
"lastModified": 1638329954,
|
||||||
|
"narHash": "sha256-xYlTATWAX9Vu0yK39mFO4UX0Yl/Xz3if+/a7iAV3kV8=",
|
||||||
|
"owner": "neovim",
|
||||||
|
"repo": "neovim",
|
||||||
|
"rev": "d3585e0ec52ee828fd68c4bd3e3ec1c294e1f4a0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"dir": "contrib",
|
||||||
|
"owner": "neovim",
|
||||||
|
"repo": "neovim",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"neovim-nightly-overlay": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-compat": "flake-compat",
|
||||||
|
"neovim-flake": "neovim-flake",
|
||||||
|
"nixpkgs": "nixpkgs_2"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1638346476,
|
||||||
|
"narHash": "sha256-n6gMG7+3C2DjpvzwRYC1Ag3QsfovJPKPj5Ds3LOTXg0=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "neovim-nightly-overlay",
|
||||||
|
"rev": "3099b910be69b6e9c1bf00b25df9de2932d5318f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "neovim-nightly-overlay",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1638376152,
|
||||||
|
"narHash": "sha256-ucgLpVqhFnClH7YRUHBHnmiOd82RZdFR3XJt36ks5fE=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "6daa4a5c045d40e6eae60a3b6e427e8700f1c07f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_2": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1638376152,
|
||||||
|
"narHash": "sha256-ucgLpVqhFnClH7YRUHBHnmiOd82RZdFR3XJt36ks5fE=",
|
||||||
|
"owner": "nixos",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "6daa4a5c045d40e6eae60a3b6e427e8700f1c07f",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nixos",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs_3": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1638371214,
|
||||||
|
"narHash": "sha256-0kE6KhgH7n0vyuX4aUoGsGIQOqjIx2fJavpCWtn73rc=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "a640d8394f34714578f3e6335fc767d0755d78f9",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-21.11",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nur": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1638435562,
|
||||||
|
"narHash": "sha256-l7+pHUJ3C2WVEWRDANHuIJ9R4AhxZoAgDC0HbkrjlWI=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "NUR",
|
||||||
|
"rev": "68bbcc08934f7185fb39d8abaf9b4dbcadf045bf",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"id": "nur",
|
||||||
|
"type": "indirect"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"home-manager": "home-manager",
|
||||||
|
"neovim-nightly-overlay": "neovim-nightly-overlay",
|
||||||
|
"nixpkgs": "nixpkgs_3",
|
||||||
|
"nur": "nur"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
40
flake.nix
Normal file
40
flake.nix
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
{
|
||||||
|
description = "A flake for my personnal configurations";
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = github:NixOS/nixpkgs/nixos-21.11;
|
||||||
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
|
||||||
|
neovim-nightly-overlay = {
|
||||||
|
url = "github:nix-community/neovim-nightly-overlay";
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs = {home-manager, nixpkgs, neovim-nightly-overlay, nur, ... }@inputs :
|
||||||
|
|
||||||
|
{
|
||||||
|
nixosConfigurations = {
|
||||||
|
lisa = nixpkgs.lib.nixosSystem {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
modules = [ ./configuration.nix ./config/hosts/lisa.nix ./config/web-services/lisa-services.nix
|
||||||
|
home-manager.nixosModules.home-manager {
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = true;
|
||||||
|
home-manager.users.julien = import ./config/home/home-lisa.nix;
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
inputs.neovim-nightly-overlay.overlay
|
||||||
|
];
|
||||||
|
|
||||||
|
}];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue