mirror of
https://github.com/itme-brain/nixos.git
synced 2026-03-23 16:29:42 -04:00
still working
This commit is contained in:
parent
64235f2775
commit
0712b63194
14 changed files with 508 additions and 174 deletions
13
flake.nix
13
flake.nix
|
|
@ -8,12 +8,12 @@
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
nur = {
|
nur = {
|
||||||
url = "github:nix-community/NUR";
|
url = "github:nix-community/NUR";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
disko = {
|
disko = {
|
||||||
url = "github:nix-community/disko";
|
url = "github:nix-community/disko";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -30,11 +30,10 @@
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations.socrates = nixpkgs.lib.nixosSystem {
|
nixosConfigurations.socratesV2 = nixpkgs.lib.nixosSystem {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
./machines/hardware-configuration.nix
|
./machines
|
||||||
./machines/system.nix
|
|
||||||
disko.nixosModules.disko
|
disko.nixosModules.disko
|
||||||
home-manager.nixosModules.home-manager{
|
home-manager.nixosModules.home-manager{
|
||||||
home-manager.useGlobalPkgs = true;
|
home-manager.useGlobalPkgs = true;
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
{ imports = ./.; }
|
|
||||||
83
modules/alacritty/default.nix
Normal file
83
modules/alacritty/default.nix
Normal file
|
|
@ -0,0 +1,83 @@
|
||||||
|
{ pkgs, lib, config, ... } =
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let cfg = config.modules.alacritty;
|
||||||
|
|
||||||
|
in {
|
||||||
|
options.modules.alacritty = { enable = mkEnableOption "alacritty"; };
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.alacritty = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
|
||||||
|
scrolling = {
|
||||||
|
history = 10000;
|
||||||
|
multiplier = 3;
|
||||||
|
};
|
||||||
|
|
||||||
|
window = {
|
||||||
|
opacity = 0.95;
|
||||||
|
};
|
||||||
|
|
||||||
|
colors = {
|
||||||
|
primary = {
|
||||||
|
background = 0x0d1117;
|
||||||
|
foreground = 0xb3b1ad;
|
||||||
|
};
|
||||||
|
|
||||||
|
normal = {
|
||||||
|
black = 0x484f58;
|
||||||
|
red = 0xff7b72;
|
||||||
|
green = 0x3fb950;
|
||||||
|
yellow = 0xd29922;
|
||||||
|
blue = 0x58a6ff;
|
||||||
|
magenta = 0xbc8cff;
|
||||||
|
cyan = 0x39c5cf;
|
||||||
|
white = 0xb1bac4;
|
||||||
|
};
|
||||||
|
|
||||||
|
bright = {
|
||||||
|
black = 0x6e7681;
|
||||||
|
red = 0xffa198;
|
||||||
|
green = 0x56d364;
|
||||||
|
yellow = 0xe3b341;
|
||||||
|
blue = 0x79c0ff;
|
||||||
|
magenta = 0xd2a8ff;
|
||||||
|
cyan = 0x56d4dd;
|
||||||
|
white = 0xf0f6fc;
|
||||||
|
};
|
||||||
|
|
||||||
|
font = {
|
||||||
|
normal = {
|
||||||
|
family = TerminusWithNerdFont;
|
||||||
|
style = Medium;
|
||||||
|
};
|
||||||
|
|
||||||
|
bold = {
|
||||||
|
family = TerminusWithNerdFont;
|
||||||
|
style = Bold;
|
||||||
|
};
|
||||||
|
|
||||||
|
italic = {
|
||||||
|
family = TerminusWithNerdFont;
|
||||||
|
style = Medium Italic;
|
||||||
|
};
|
||||||
|
|
||||||
|
bold_italic = {
|
||||||
|
family = TerminusWithNerdFont;
|
||||||
|
style = Bold Italic;
|
||||||
|
};
|
||||||
|
|
||||||
|
size = 14;
|
||||||
|
|
||||||
|
cursor = {
|
||||||
|
color = 0xffffff;
|
||||||
|
style = {
|
||||||
|
shape = Block;
|
||||||
|
blinking = Always;
|
||||||
|
blink-interval = 750;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -64,120 +64,118 @@ in {
|
||||||
unset flake_icon
|
unset flake_icon
|
||||||
}
|
}
|
||||||
PROMPT_COMMAND="set_ps1_prompt; $PROMPT_COMMAND"
|
PROMPT_COMMAND="set_ps1_prompt; $PROMPT_COMMAND"
|
||||||
|
'';
|
||||||
|
|
||||||
function cdg() {
|
bashrcExtra = ''
|
||||||
if [[ $1 == "--help" ]]; then
|
function cdg() {
|
||||||
echo "A simple utility for navigating to the root of a git repo"
|
if [[ $1 == "--help" ]]; then
|
||||||
return 0
|
echo "A simple utility for navigating to the root of a git repo"
|
||||||
fi
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Check for invalid command
|
# Check for invalid command
|
||||||
if [[ -n "$1" ]]; then
|
if [[ -n "$1" ]]; then
|
||||||
echo "Invalid command: $1. Try 'cdg --help'."
|
echo "Invalid command: $1. Try 'cdg --help'."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local root_dir
|
local root_dir
|
||||||
root_dir=$(git rev-parse --show-toplevel 2>/dev/null)
|
root_dir=$(git rev-parse --show-toplevel 2>/dev/null)
|
||||||
local git_status=$?
|
local git_status=$?
|
||||||
|
|
||||||
if [ $git_status -ne 0 ]; then
|
if [ $git_status -ne 0 ]; then
|
||||||
echo "Error: Not a git repo."
|
echo "Error: Not a git repo."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$root_dir"
|
cd "$root_dir"
|
||||||
}
|
}
|
||||||
|
|
||||||
function ldv() {
|
function ldv() {
|
||||||
if [[ $1 == "help" ]] || [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
if [[ $1 == "help" ]] || [[ $1 == "-h" ]] || [[ $1 == "--help" ]]; then
|
||||||
cat << EOF
|
|
||||||
ldv
|
|
||||||
A simple utility for setting up development environments effortlessly.
|
|
||||||
Commands:
|
|
||||||
ldv Start a preconfigured nix shell.
|
|
||||||
init Create a new dev template in the current working directory.
|
|
||||||
help Show available commands and options.
|
|
||||||
|
|
||||||
Contributions welcome: https://github.com/itme-brain/ldv
|
|
||||||
EOF
|
|
||||||
|
|
||||||
elif [[ $1 == "init" ]] || [[ $1 == "-i" ]] || [[ $1 == "--init" ]]; then
|
|
||||||
if [[ -e ./shell.nix ]] || [[ -e ./.envrc ]]; then
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Existing environment found.
|
ldv
|
||||||
Initialization cancelled.
|
A simple utility for setting up development environments effortlessly.
|
||||||
EOF
|
Commands:
|
||||||
return
|
ldv Start a preconfigured nix shell.
|
||||||
|
init Create a new dev template in the current working directory.
|
||||||
|
help Show available commands and options.
|
||||||
|
|
||||||
|
Contributions welcome: https://github.com/itme-brain/ldv
|
||||||
|
EOF
|
||||||
|
|
||||||
|
elif [[ $1 == "init" ]] || [[ $1 == "-i" ]] || [[ $1 == "--init" ]]; then
|
||||||
|
if [[ -e ./shell.nix ]] || [[ -e ./.envrc ]]; then
|
||||||
|
cat << EOF
|
||||||
|
Existing environment found.
|
||||||
|
Initialization cancelled.
|
||||||
|
EOF
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat << EOF
|
||||||
|
Initializing a new environment...
|
||||||
|
Select an environment:
|
||||||
|
1. Web
|
||||||
|
2. Elixir
|
||||||
|
3. Haskell
|
||||||
|
EOF
|
||||||
|
|
||||||
|
read -p "Enter the number of your choice: " choice
|
||||||
|
|
||||||
|
case $choice in
|
||||||
|
1)
|
||||||
|
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/shells/web.nix -O shell.nix
|
||||||
|
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/utils/flake -O flake.nix
|
||||||
|
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/utils/envrc -O .envrc
|
||||||
|
direnv allow
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/shells/elixir.nix -O shell.nix
|
||||||
|
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/utils/flake -O flake.nix
|
||||||
|
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/utils/envrc -O .envrc
|
||||||
|
direnv allow
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/shells/haskell.nix -O shell.nix
|
||||||
|
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/utils/flake -O flake.nix
|
||||||
|
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/utils/envrc -O .envrc
|
||||||
|
direnv allow
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid choice."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
elif [[ -z $1 ]]; then
|
||||||
|
cat << EOF
|
||||||
|
Select an environment:
|
||||||
|
1. Web
|
||||||
|
2. Elixir
|
||||||
|
3. Haskell
|
||||||
|
EOF
|
||||||
|
|
||||||
|
read -p "Enter the number of your choice: " choice
|
||||||
|
|
||||||
|
case $choice in
|
||||||
|
1)
|
||||||
|
(nix develop github:itme-brain/ldv#web)
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
(nix develop github:itme-brain/ldv#elixir)
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
(nix develop github:itme-brain/ldv#haskell)
|
||||||
|
;;
|
||||||
|
# Add more cases here...
|
||||||
|
*)
|
||||||
|
echo "Invalid choice."
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
echo "Error: Invalid command. Try 'ldv --help'"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
cat << EOF
|
'';
|
||||||
Initializing a new environment...
|
|
||||||
Select an environment:
|
|
||||||
1. Web
|
|
||||||
2. Elixir
|
|
||||||
3. Haskell
|
|
||||||
EOF
|
|
||||||
|
|
||||||
read -p "Enter the number of your choice: " choice
|
|
||||||
|
|
||||||
case $choice in
|
|
||||||
1)
|
|
||||||
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/shells/web.nix -O shell.nix
|
|
||||||
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/utils/flake -O flake.nix
|
|
||||||
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/utils/envrc -O .envrc
|
|
||||||
direnv allow
|
|
||||||
;;
|
|
||||||
2)
|
|
||||||
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/shells/elixir.nix -O shell.nix
|
|
||||||
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/utils/flake -O flake.nix
|
|
||||||
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/utils/envrc -O .envrc
|
|
||||||
direnv allow
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/shells/haskell.nix -O shell.nix
|
|
||||||
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/utils/flake -O flake.nix
|
|
||||||
wget -q https://raw.githubusercontent.com/itme-brain/ldv/main/utils/envrc -O .envrc
|
|
||||||
direnv allow
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Invalid choice."
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
elif [[ -z $1 ]]; then
|
|
||||||
cat << EOF
|
|
||||||
Select an environment:
|
|
||||||
1. Web
|
|
||||||
2. Elixir
|
|
||||||
3. Haskell
|
|
||||||
EOF
|
|
||||||
|
|
||||||
read -p "Enter the number of your choice: " choice
|
|
||||||
|
|
||||||
case $choice in
|
|
||||||
1)
|
|
||||||
(nix develop github:itme-brain/ldv#web)
|
|
||||||
;;
|
|
||||||
2)
|
|
||||||
(nix develop github:itme-brain/ldv#elixir)
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
(nix develop github:itme-brain/ldv#haskell)
|
|
||||||
;;
|
|
||||||
# Add more cases here...
|
|
||||||
*)
|
|
||||||
echo "Invalid choice."
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
echo "Error: Invalid command. Try 'ldv --help'"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
|
||||||
ldv "$@"
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
shellAliases = {
|
shellAliases = {
|
||||||
ls = "lsd";
|
ls = "lsd";
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,13 @@ in
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
userName = "Bryan Ramos";
|
|
||||||
userEmail = "bryan@ramos.codes";
|
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
init = { defaultBranch = "main"; };
|
init = { defaultBranch = "main"; };
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.file = {
|
||||||
|
".gitconfig".source = ./gitconfig;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
4
modules/git/gitconfig
Normal file
4
modules/git/gitconfig
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
[user]
|
||||||
|
email = bryan@ramos.codes
|
||||||
|
name = Bryan Ramos
|
||||||
|
signingkey = F1F3466458452B2DF351F1E864D12BA95ACE1F2D
|
||||||
11
modules/gpg/default.nix
Normal file
11
modules/gpg/default.nix
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let cfg = config.modules.gpg;
|
||||||
|
|
||||||
|
in {
|
||||||
|
options.modules.gpg = { enable = mkEnableOption "gpg"; };
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
programs.gpg.enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
10
modules/gtk/default.nix
Normal file
10
modules/gtk/default.nix
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
|
||||||
|
with lib;
|
||||||
|
let cfg = config.modules.PROGRAM;
|
||||||
|
|
||||||
|
in {
|
||||||
|
options.modules.PROGRAM = { enable = mkEnableOption "PROGRAM"; };
|
||||||
|
config = mkIf cfg.enable {
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -8,7 +8,7 @@ let cfg = config.modules.neovim;
|
||||||
src = pkgs.fetchFromGithub {
|
src = pkgs.fetchFromGithub {
|
||||||
owner = "projekt0n";
|
owner = "projekt0n";
|
||||||
repo = "github-nvim-theme";
|
repo = "github-nvim-theme";
|
||||||
rev = "62b7b54a90c70c20cd1641f9facfced46bdd3561";
|
rev = "ea713c37691b2519f56cd801a2330bdf66393d0f";
|
||||||
sha256 = "0cwr3b5r2ac7aizxmwb3mlhdc2sh0pw670vcwps79x9jp52yrj2y";
|
sha256 = "0cwr3b5r2ac7aizxmwb3mlhdc2sh0pw670vcwps79x9jp52yrj2y";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
@ -27,7 +27,6 @@ in {
|
||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
|
|
||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
|
|
||||||
{
|
{
|
||||||
plugin = github-theme;
|
plugin = github-theme;
|
||||||
config = ''
|
config = ''
|
||||||
|
|
@ -37,13 +36,15 @@ in {
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
||||||
lazygit.nvim
|
{ plugin = lazygit.nvim; }
|
||||||
|
|
||||||
{
|
{
|
||||||
plugin = LazyVim;
|
plugin = LazyVim;
|
||||||
config = ''
|
config = ''
|
||||||
lua << EOF
|
lua << EOF
|
||||||
return {
|
return {
|
||||||
{'williamboman/mason.nvim', enabled = false },
|
{'williamboman/mason.nvim', enabled = false },
|
||||||
|
{'williamboman/mason-lspconfig.nvim', enabled = false },
|
||||||
{'nvim-treesitter/nvim-treesitter', enabled = false },
|
{'nvim-treesitter/nvim-treesitter', enabled = false },
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
@ -65,19 +66,162 @@ in {
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
plugin = nvim-treesitter.withAllGrammars
|
plugin = nvim-treesitter.withAllGrammars;
|
||||||
config = ''
|
config = ''
|
||||||
lua << EOF
|
lua << EOF
|
||||||
|
require'nvim-treesitter.configs'.setup {
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
}
|
||||||
EOF
|
EOF
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
extraLuaConfig = ''
|
||||||
|
lua << EOF
|
||||||
|
vim.opt.tabstop = 2
|
||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.expandtab = true
|
||||||
|
|
||||||
|
vim.o.clipboard = "unnamedplus"
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
|
|
||||||
|
generatedConfigs = {
|
||||||
|
lua = ''
|
||||||
|
require("config.lazy")
|
||||||
|
|
||||||
|
local lsp = require("lsp-zero").preset({})
|
||||||
|
|
||||||
|
lsp.on_attach(function(client, bufnr)
|
||||||
|
lsp.default_keymaps({ buffer = bufnr })
|
||||||
|
end)
|
||||||
|
|
||||||
|
lsp.setup_servers({
|
||||||
|
"tsserver",
|
||||||
|
"eslint",
|
||||||
|
"hls",
|
||||||
|
"pyright",
|
||||||
|
"nil_ls",
|
||||||
|
"cssls",
|
||||||
|
"html",
|
||||||
|
"jsonls",
|
||||||
|
"diagnosticls",
|
||||||
|
"lua_ls",
|
||||||
|
"marksman",
|
||||||
|
"purescriptls",
|
||||||
|
"tailwindcss",
|
||||||
|
"bashls",
|
||||||
|
})
|
||||||
|
|
||||||
|
require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls())
|
||||||
|
|
||||||
|
lsp.setup()
|
||||||
|
|
||||||
|
local cmp = require("cmp")
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require("luasnip").lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
sources = {
|
||||||
|
{ name = "nvim_lsp" },
|
||||||
|
{ name = "luasnip" },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.cmd([[
|
||||||
|
au BufRead,BufNewFile *.purs set filetype=purescript
|
||||||
|
]])
|
||||||
|
|
||||||
|
local has_words_before = function()
|
||||||
|
unpack = unpack or table.unpack
|
||||||
|
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||||
|
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
|
||||||
|
end
|
||||||
|
|
||||||
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
enabled = function()
|
||||||
|
-- disable completion in comments
|
||||||
|
local context = require("cmp.config.context")
|
||||||
|
-- keep command mode completion enabled when cursor is in a comment
|
||||||
|
if vim.api.nvim_get_mode().mode == "c" then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return not context.in_treesitter_capture("comment") and not context.in_syntax_group("Comment")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
mapping = {
|
||||||
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_next_item()
|
||||||
|
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
||||||
|
-- they way you will only jump inside the snippet region
|
||||||
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
luasnip.expand_or_jump()
|
||||||
|
elseif has_words_before() then
|
||||||
|
cmp.complete()
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
|
||||||
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
|
if cmp.visible() then
|
||||||
|
cmp.select_prev_item()
|
||||||
|
elseif luasnip.jumpable(-1) then
|
||||||
|
luasnip.jump(-1)
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end, { "i", "s" }),
|
||||||
|
|
||||||
|
["<CR>"] = cmp.mapping({
|
||||||
|
i = function(fallback)
|
||||||
|
if cmp.visible() and cmp.get_active_entry() then
|
||||||
|
cmp.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = false })
|
||||||
|
else
|
||||||
|
fallback()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
s = cmp.mapping.confirm({ select = true }),
|
||||||
|
c = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Replace, select = true }),
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||||
|
-- Disable virtual_text
|
||||||
|
virtual_text = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
require("notify").setup({
|
||||||
|
background_colour = "#000000",
|
||||||
|
})
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
|
nodePackages.eslint
|
||||||
|
nodePackages.vscode-langservers-extracted
|
||||||
|
nodePackages.typescript-language-server
|
||||||
|
nodePackages.diagnostic-languageserver
|
||||||
|
nodePackages.pyright
|
||||||
|
nodePackages.purescript-language-server
|
||||||
|
nodePackages."@tailwindcss/language-server"
|
||||||
|
nodePackages.bash-language-server
|
||||||
|
marksman
|
||||||
|
|
||||||
nil nixfmt
|
nil nixfmt
|
||||||
|
|
||||||
sumneko-lua-language-server stylua
|
sumneko-lua-language-server stylua
|
||||||
|
|
||||||
haskell-language-server hlint
|
haskell-language-server hlint
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
|
||||||
8
sysConfig/desktop/default.nix
Normal file
8
sysConfig/desktop/default.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./hardware.nix
|
||||||
|
./system.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
@ -2,17 +2,31 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||||
|
|
||||||
nix.system-features = "kvm";
|
|
||||||
environment.systemPackages = pkgs.virt-manager;
|
|
||||||
|
|
||||||
|
# Kernel
|
||||||
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "vmd" "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
boot.kernelParams = [ "intel_iommu=on" ];
|
boot.kernelParams = [ "intel_iommu=on" ];
|
||||||
boot.kernelModules = [ "kvm-intel" "virtio" "vfio-pci" "coretemp" ];
|
boot.kernelModules = [ "kvm-intel" "virtio" "vfio-pci" "coretemp" ];
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
|
|
||||||
|
# Bootloader
|
||||||
|
boot.loader = {
|
||||||
|
grub = {
|
||||||
|
enable = true;
|
||||||
|
useOSProber = true;
|
||||||
|
devices = [ "nodev" ];
|
||||||
|
efiSupport = true;
|
||||||
|
configurationLimit = 5;
|
||||||
|
};
|
||||||
|
|
||||||
|
efi = {
|
||||||
|
canTouchEfiVariables = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# FStab
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{ device = "/dev/disk/by-uuid/af24c5b3-8a6e-4333-a61d-922a97928cae";
|
{ device = "/dev/disk/by-uuid/af24c5b3-8a6e-4333-a61d-922a97928cae";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
|
|
@ -28,6 +42,8 @@
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# GPU
|
||||||
|
programs.sway.extraOptions = "--unsupported-gpu";
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
hardware = {
|
hardware = {
|
||||||
opengl.enable = true;
|
opengl.enable = true;
|
||||||
|
|
@ -37,6 +53,20 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Virtualisation
|
||||||
|
nix.system-features = "kvm";
|
||||||
|
environment.systemPackages = pkgs.virt-manager;
|
||||||
|
|
||||||
|
virtualisation.libvirtd = {
|
||||||
|
enable = true;
|
||||||
|
qemu = {
|
||||||
|
package = pkgs.qemu_kvm;
|
||||||
|
runAsRoot = true;
|
||||||
|
ovmf.enable = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# CPU
|
||||||
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
powerManagement.cpuFreqGovernor = lib.mkDefault "performance";
|
||||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
}
|
}
|
||||||
79
sysConfig/desktop/partitions.nix
Normal file
79
sysConfig/desktop/partitions.nix
Normal file
|
|
@ -0,0 +1,79 @@
|
||||||
|
{ disks ? [ "/dev/nvme0n1" "/dev/sda" ], ... }: {
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
one = {
|
||||||
|
type = "disk";
|
||||||
|
device = builtins.elemAt disks 0;
|
||||||
|
content = {
|
||||||
|
type = "table";
|
||||||
|
format = "gpt";
|
||||||
|
partitions = [
|
||||||
|
{
|
||||||
|
name = "boot";
|
||||||
|
start = "0";
|
||||||
|
end = "100M";
|
||||||
|
fs-type = "fat32";
|
||||||
|
bootable = true;
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "primary";
|
||||||
|
start = "100M";
|
||||||
|
end = "100%";
|
||||||
|
content = {
|
||||||
|
type = "lvm_pv";
|
||||||
|
vg = "pool";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
disk = {
|
||||||
|
two = {
|
||||||
|
type = "disk";
|
||||||
|
device = builtins.elemAt disks 1;
|
||||||
|
content = {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
lvm_vg = {
|
||||||
|
pool = {
|
||||||
|
type = "lvm_vg";
|
||||||
|
lvs = {
|
||||||
|
aaa = {
|
||||||
|
size = "1M";
|
||||||
|
};
|
||||||
|
zzz = {
|
||||||
|
size = "1M";
|
||||||
|
};
|
||||||
|
root = {
|
||||||
|
size = "100M";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext4";
|
||||||
|
mountpoint = "/";
|
||||||
|
mountOptions = [
|
||||||
|
"defaults"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
home = {
|
||||||
|
size = "100%FREE";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "ext4";
|
||||||
|
mountpoint = "/home";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
@ -6,7 +6,6 @@
|
||||||
nix = {
|
nix = {
|
||||||
extraOptions = "experimental-features = nix-command flakes";
|
extraOptions = "experimental-features = nix-command flakes";
|
||||||
settings = {
|
settings = {
|
||||||
allowed-users = "bryan";
|
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
};
|
};
|
||||||
gc = {
|
gc = {
|
||||||
|
|
@ -22,57 +21,34 @@
|
||||||
|
|
||||||
security.sudo.wheelNeedsPassword = false;
|
security.sudo.wheelNeedsPassword = false;
|
||||||
|
|
||||||
boot = {
|
# GUI
|
||||||
loader = {
|
|
||||||
grub = {
|
|
||||||
enable = true;
|
|
||||||
useOSProber = true;
|
|
||||||
devices = [ "nodev" ];
|
|
||||||
efiSupport = true;
|
|
||||||
configurationLimit = 5;
|
|
||||||
};
|
|
||||||
|
|
||||||
efi = {
|
|
||||||
canTouchEfiVariables = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
# extraModprobeConfig = ''
|
|
||||||
# options vfio-pci ids=10de:1f82,10de:10fa
|
|
||||||
# '';
|
|
||||||
};
|
|
||||||
|
|
||||||
programs = {
|
programs = {
|
||||||
sway = {
|
sway = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
extraPackages = with pkgs; [
|
extraPackages = with pkgs; [
|
||||||
rofi-wayland
|
rofi-wayland
|
||||||
grim
|
grim
|
||||||
slurp
|
slurp
|
||||||
wl-clipboard
|
wl-clipboard
|
||||||
|
|
||||||
xdg-utils
|
xdg-utils
|
||||||
|
|
||||||
fontconfig
|
fontconfig
|
||||||
qogir-icon-theme
|
qogir-icon-theme
|
||||||
emote
|
emote
|
||||||
|
|
||||||
|
pavucontrol
|
||||||
|
];
|
||||||
|
|
||||||
pavucontrol
|
|
||||||
];
|
|
||||||
extraSessionCommands = ''
|
extraSessionCommands = ''
|
||||||
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
|
if [ -z "$DISPLAY" ] && [ "$(tty)" = "/dev/tty1" ]; then
|
||||||
exec sway
|
exec sway
|
||||||
fi
|
fi
|
||||||
|
export _JAVA_AWT_WM_NONREPARENTING=1
|
||||||
if [ "$XDG_CURRENT_DESKTOP" = "sway" ] ; then
|
|
||||||
export _JAVA_AWT_WM_NONREPARENTING=1
|
|
||||||
fi
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
xwayland.enable = true;
|
||||||
xwayland = {
|
|
||||||
enable = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
xdg.portal.wlr.enable = true;
|
xdg.portal.wlr.enable = true;
|
||||||
|
|
||||||
gnupg = {
|
gnupg = {
|
||||||
|
|
@ -81,8 +57,6 @@
|
||||||
enableSSHSupport = true;
|
enableSSHSupport = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
git.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.pipewire = {
|
services.pipewire = {
|
||||||
|
|
@ -109,6 +83,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# System Services
|
||||||
services = {
|
services = {
|
||||||
trezord.enable = true;
|
trezord.enable = true;
|
||||||
|
|
||||||
|
|
@ -125,6 +100,7 @@
|
||||||
useXkbConfig = true;
|
useXkbConfig = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Locale
|
||||||
time = {
|
time = {
|
||||||
timeZone = "America/New_York";
|
timeZone = "America/New_York";
|
||||||
};
|
};
|
||||||
|
|
@ -148,13 +124,4 @@
|
||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
firewall.enable = true;
|
firewall.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
virtualisation.libvirtd = {
|
|
||||||
enable = true;
|
|
||||||
qemu = {
|
|
||||||
package = pkgs.qemu_kvm;
|
|
||||||
runAsRoot = true;
|
|
||||||
ovmf.enable = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue