init
This commit is contained in:
commit
1a5d89af7a
29 changed files with 911 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
result
|
||||
5
config/nvim/ftplugin/go.lua
Executable file
5
config/nvim/ftplugin/go.lua
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
vim.g.go_def_mode='gopls'
|
||||
vim.g.go_info_mode='gopls'
|
||||
vim.g.go_doc_popup_window = 1
|
||||
vim.g.go_play_browser_command = 'librewolf %URL% &'
|
||||
vim.g.go_doc_keywordprg_enabled = 1
|
||||
6
config/nvim/lua/blankline-conf.lua
Executable file
6
config/nvim/lua/blankline-conf.lua
Executable file
|
|
@ -0,0 +1,6 @@
|
|||
vim.cmd([[ hi IndentBlanklineChar ctermfg=240 ]])
|
||||
vim.cmd([[ hi IndentBlanklineContextChar ctermfg=7 ]])
|
||||
require("indent_blankline").setup {
|
||||
show_current_context = true,
|
||||
show_current_context_start = true,
|
||||
}
|
||||
7
config/nvim/lua/init.lua
Executable file
7
config/nvim/lua/init.lua
Executable file
|
|
@ -0,0 +1,7 @@
|
|||
require("blankline-conf")
|
||||
require("leap-conf")
|
||||
require("nvim-conf")
|
||||
require("nvim-treesitter-conf")
|
||||
require("plugins-conf")
|
||||
require("telescope-conf")
|
||||
require("toggleterm-conf")
|
||||
5
config/nvim/lua/leap-conf.lua
Executable file
5
config/nvim/lua/leap-conf.lua
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
local leap = require('leap')
|
||||
leap.set_default_keymaps()
|
||||
leap.init_highlight(true)
|
||||
vim.cmd([[ hi LeapLabelPrimary ctermbg=251 ctermfg=0 ]])
|
||||
|
||||
90
config/nvim/lua/nvim-conf.lua
Executable file
90
config/nvim/lua/nvim-conf.lua
Executable file
|
|
@ -0,0 +1,90 @@
|
|||
-- vim settings
|
||||
----------------------------------------
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.background = "light"
|
||||
vim.opt.backspace = "indent,eol,start"
|
||||
vim.opt.backup = false -- and auto backps, to instead use
|
||||
vim.opt.breakindent = true
|
||||
vim.opt.clipboard = "unnamedplus" -- use system clipboard
|
||||
vim.opt.completeopt = "menuone"
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.expandtab = true -- insert tabs as spaces
|
||||
vim.opt.guicursor = "" -- fixes alacritty changing cursor
|
||||
vim.opt.hidden = true -- dont save when switching buffers
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.ignorecase = true -- ignore case in searches
|
||||
vim.opt.inccommand = "split" -- incremental live completion
|
||||
vim.opt.incsearch = true
|
||||
vim.opt.laststatus = 1
|
||||
vim.opt.list = true
|
||||
vim.opt.listchars:append("trail:·")
|
||||
vim.opt.mouse = "a"
|
||||
vim.opt.nrformats:append("alpha") -- let Ctrl-a do letters as well
|
||||
vim.opt.number = true
|
||||
vim.opt.pastetoggle = "<F2>"
|
||||
vim.opt.path:append("**") -- enable fuzzy :find ing
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.shadafile = "NONE" -- disable shada
|
||||
vim.opt.shiftwidth = 0 -- >> shifts by tabstop
|
||||
vim.opt.showmatch = true -- highlight matching brackets
|
||||
vim.opt.signcolumn= "number"
|
||||
vim.opt.smartcase = true -- unless capital query
|
||||
vim.opt.smartindent = true -- indent according to lang
|
||||
vim.opt.softtabstop = -1 -- backspace removes tabstop
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.splitright = true
|
||||
vim.opt.swapfile = false -- disable swapfiles
|
||||
vim.opt.tabstop = 4 -- 4 space tabs
|
||||
vim.opt.undofile = true -- enable auto save of undos
|
||||
vim.opt.updatetime = 250 -- decrease update time
|
||||
vim.opt.virtualedit = "onemore"
|
||||
vim.opt.wildmenu = true
|
||||
|
||||
vim.g.netrw_banner = 0 -- disable annoying banner
|
||||
vim.g.netrw_altv = 1 -- open splits to the right
|
||||
vim.g.netrw_liststyle = 3 -- tree view
|
||||
vim.g.fzf_layout = { window = { width = 0.9, height = 0.6 } }
|
||||
vim.g.indent_blankline_use_treesitter = true
|
||||
|
||||
-- mappings
|
||||
----------------------------------------
|
||||
-- local func to set keybinds
|
||||
local remap = function(type, key, value)
|
||||
vim.api.nvim_set_keymap(type,key,value,{noremap = true, silent = true});
|
||||
end
|
||||
remap("i", "wq", "<esc>l")
|
||||
remap("v", "wq", "<esc>l")
|
||||
remap("n","gr", "gT")
|
||||
remap("i", "{<CR>", "{<CR>}<Esc>O")
|
||||
remap("i", "(<CR>", "(<CR>)<Esc>O")
|
||||
remap("n", "<C-L>", "<Cmd>nohlsearch<Bar>diffupdate<CR><C-L>")
|
||||
remap("n","n", "nzz")
|
||||
remap("n", "N", "Nzz")
|
||||
remap("n", "Y", "y$")
|
||||
remap("n","[<space>", ":<c-u>put!=repeat([''],v:count)<bar>']+1<cr>")
|
||||
remap("n","]<space>", ":<c-u>put =repeat([''],v:count)<bar>'[-1<cr><Esc>")
|
||||
|
||||
-- autocmd
|
||||
----------------------------------------
|
||||
local undopath = "~/.local/share/nvim/undo"
|
||||
vim.api.nvim_create_autocmd("VimEnter", {
|
||||
command = "silent !mkdir -p " .. undopath,
|
||||
group = vim.api.nvim_create_augroup("Init", {}),
|
||||
})
|
||||
|
||||
local toggle_rel_num = vim.api.nvim_create_augroup("ToggleRelNum", {})
|
||||
vim.api.nvim_create_autocmd("InsertEnter", {
|
||||
command = "set norelativenumber",
|
||||
group = toggle_rel_num,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("InsertLeave", {
|
||||
command = "set relativenumber",
|
||||
group = toggle_rel_num,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("TextYankPost", {
|
||||
callback = function()
|
||||
vim.highlight.on_yank({ higroup = "Visual" })
|
||||
end,
|
||||
group = vim.api.nvim_create_augroup("YankHighlight", {}),
|
||||
})
|
||||
|
||||
51
config/nvim/lua/nvim-treesitter-conf.lua
Executable file
51
config/nvim/lua/nvim-treesitter-conf.lua
Executable file
|
|
@ -0,0 +1,51 @@
|
|||
require("nvim-treesitter.configs").setup {
|
||||
ensure_installed = {},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
keymaps = {
|
||||
['ac'] = '@comment.outer',
|
||||
['ic'] = '@comment.inner',
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["aa"] = "@call.inner",
|
||||
},
|
||||
},
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = true, -- whether to set jumps in the jumplist
|
||||
goto_next_start = {
|
||||
[']]'] = '@function.outer',
|
||||
[']m'] = '@class.outer',
|
||||
},
|
||||
goto_next_end = {
|
||||
[']['] = '@function.outer',
|
||||
[']M'] = '@class.outer',
|
||||
},
|
||||
goto_previous_start = {
|
||||
['[['] = '@function.outer',
|
||||
['[m'] = '@class.outer',
|
||||
},
|
||||
goto_previous_end = {
|
||||
['[]'] = '@function.outer',
|
||||
['[M'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = '<CR>',
|
||||
scope_incremental = '<CR>',
|
||||
node_incremental = '<TAB>',
|
||||
node_decremental = '<S-TAB>',
|
||||
},
|
||||
},
|
||||
}
|
||||
2
config/nvim/lua/plugins-conf.lua
Executable file
2
config/nvim/lua/plugins-conf.lua
Executable file
|
|
@ -0,0 +1,2 @@
|
|||
-- telescope
|
||||
----------------------------------------
|
||||
44
config/nvim/lua/telescope-conf.lua
Executable file
44
config/nvim/lua/telescope-conf.lua
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
local telescope = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>fb", telescope.buffers, {noremap = true, silent = true})
|
||||
vim.keymap.set("n", "<leader>ff", telescope.find_files, {noremap = true, silent = true})
|
||||
vim.keymap.set("n", "<leader>fg", telescope.git_files, {noremap = true, silent = true})
|
||||
vim.keymap.set("n", "<leader>fv", telescope.command_history, {noremap = true, silent = true})
|
||||
vim.keymap.set("n", "<leader><leader>", telescope.live_grep, {noremap = true, silent = true})
|
||||
vim.keymap.set("n", "<leader>8", telescope.grep_string, {noremap = true, silent = true})
|
||||
vim.keymap.set("n", "<leader>fd", telescope.lsp_definitions, {noremap = true, silent = true})
|
||||
-- fix highlighting
|
||||
vim.cmd([[ hi telescopeselection ctermfg=242 ctermbg=252 ]])
|
||||
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
layout_strategy = "vertical",
|
||||
layout_config = { width = .90, },
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--hidden",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--smart-case"
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
["<esc>"] = require("telescope.actions").close,
|
||||
["<C-k>"] = require("telescope.actions").move_selection_previous,
|
||||
["<C-j>"] = require("telescope.actions").move_selection_next,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = true,
|
||||
find_command = { 'rg', '--files', '--iglob', '!.git', '--hidden' }
|
||||
},
|
||||
git_files = {
|
||||
hidden = true,
|
||||
find_command = { 'rg', '--files', '--iglob', '!.git', '--hidden' }
|
||||
},
|
||||
}
|
||||
})
|
||||
5
config/nvim/lua/toggleterm-conf.lua
Executable file
5
config/nvim/lua/toggleterm-conf.lua
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
require("toggleterm").setup{
|
||||
open_mapping = [[<leader>t]],
|
||||
shade_terminals = true,
|
||||
size = vim.o.lines * 0.4
|
||||
}
|
||||
48
flake.lock
generated
Executable file
48
flake.lock
generated
Executable file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"nodes": {
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1682203081,
|
||||
"narHash": "sha256-kRL4ejWDhi0zph/FpebFYhzqlOBrk0Pl3dzGEKSAlEw=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "32d3e39c491e2f91152c84f8ad8b003420eab0a1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1681920287,
|
||||
"narHash": "sha256-+/d6XQQfhhXVfqfLROJoqj3TuG38CAeoT6jO1g9r1k0=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "645bc49f34fa8eff95479f0345ff57e55b53437e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"home-manager": "home-manager",
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
||||
24
flake.nix
Executable file
24
flake.nix
Executable file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
description = "Home Manager configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, home-manager, ... }:
|
||||
let
|
||||
username = "e";
|
||||
in {
|
||||
nixosConfigurations = (
|
||||
import ./hosts {
|
||||
inherit (nixpkgs) lib;
|
||||
inherit nixpkgs home-manager username;
|
||||
}
|
||||
|
||||
);
|
||||
};
|
||||
}
|
||||
15
hosts/configuration.nix
Executable file
15
hosts/configuration.nix
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
{ config, pkgs, username, ... }:
|
||||
{
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
|
||||
time.timeZone = "America/Chicago";
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user.
|
||||
};
|
||||
environment.systemPackages = with pkgs; [
|
||||
curl
|
||||
];
|
||||
system.stateVersion = "22.11"; # Did you read the comment?
|
||||
}
|
||||
45
hosts/default.nix
Normal file
45
hosts/default.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{ lib, nixpkgs, username, home-manager, ... }:
|
||||
|
||||
let
|
||||
system = "x86_64-linux"; # System architecture
|
||||
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
config.allowUnfree = true; # Allow proprietary software
|
||||
};
|
||||
|
||||
lib = nixpkgs.lib;
|
||||
in
|
||||
{
|
||||
t14 = lib.nixosSystem { # Laptop profile
|
||||
inherit system;
|
||||
specialArgs = {
|
||||
inherit username;
|
||||
host = {
|
||||
hostName = "t14";
|
||||
};
|
||||
};
|
||||
modules = [
|
||||
./configuration.nix
|
||||
./t14/configuration.nix
|
||||
home-manager.nixosModules.home-manager {
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit username;
|
||||
host = {
|
||||
hostName = "t14";
|
||||
};
|
||||
};
|
||||
home-manager.users.${username} = {
|
||||
imports = [
|
||||
./home.nix
|
||||
./t14/home.nix
|
||||
];
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
14
hosts/home.nix
Executable file
14
hosts/home.nix
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
{ username, pkgs, ... }:
|
||||
{
|
||||
imports = ( import ../modules/programs );
|
||||
home = {
|
||||
inherit username;
|
||||
stateVersion = "22.11";
|
||||
packages = with pkgs; [
|
||||
htop
|
||||
appimage-run
|
||||
ripgrep
|
||||
];
|
||||
};
|
||||
xdg.enable = true;
|
||||
}
|
||||
25
hosts/t14/configuration.nix
Executable file
25
hosts/t14/configuration.nix
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
{ config, pkgs, ... }:
|
||||
{
|
||||
imports =
|
||||
[ # Include the results of the hardware scan.
|
||||
./hardware-configuration.nix
|
||||
./nano.nix
|
||||
];
|
||||
networking.hostName = "t14"; # Define your hostname.
|
||||
environment.systemPackages = with pkgs; [
|
||||
cryptsetup
|
||||
];
|
||||
fonts = {
|
||||
fonts = with pkgs; [
|
||||
spleen
|
||||
];
|
||||
};
|
||||
programs.light.enable = true;
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa.enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
system.stateVersion = "22.11"; # Did you read the comment?
|
||||
}
|
||||
40
hosts/t14/hardware-configuration.nix
Executable file
40
hosts/t14/hardware-configuration.nix
Executable file
|
|
@ -0,0 +1,40 @@
|
|||
# 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 + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
|
||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/f56e8356-3915-4ff8-957c-de7f9a72b326";
|
||||
fsType = "btrfs";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/346A-5AF5";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# 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
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp2s0f0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp5s0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.enp7s0f3u2.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
15
hosts/t14/home.nix
Executable file
15
hosts/t14/home.nix
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
{ username, pkgs, ... }:
|
||||
{
|
||||
imports = [
|
||||
../../modules/wayland
|
||||
../../modules/librewolf
|
||||
];
|
||||
home = {
|
||||
packages = with pkgs; [
|
||||
neofetch
|
||||
discord
|
||||
signal-desktop
|
||||
pulseaudio
|
||||
];
|
||||
};
|
||||
}
|
||||
16
hosts/t14/nano.nix
Normal file
16
hosts/t14/nano.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ ... }:
|
||||
{
|
||||
services.udev.extraRules = ''
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="1b7c", MODE="0660", TAG+="uaccess", TAG+="udev-acl"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="2b7c", MODE="0660", TAG+="uaccess", TAG+="udev-acl"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="3b7c", MODE="0660", TAG+="uaccess", TAG+="udev-acl"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="4b7c", MODE="0660", TAG+="uaccess", TAG+="udev-acl"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="1807", MODE="0660", TAG+="uaccess", TAG+="udev-acl"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="1808", MODE="0660", TAG+="uaccess", TAG+="udev-acl"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0000", MODE="0660", TAG+="uaccess", TAG+="udev-acl"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0001", MODE="0660", TAG+="uaccess", TAG+="udev-acl"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0004", MODE="0660", TAG+="uaccess", TAG+="udev-acl"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="1011", MODE="0660", GROUP="plugdev"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="1015", MODE="0660", GROUP="plugdev"
|
||||
'';
|
||||
}
|
||||
6
modules/discord/default.nix
Normal file
6
modules/discord/default.nix
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
discord
|
||||
];
|
||||
}
|
||||
4
modules/librewolf/default.nix
Normal file
4
modules/librewolf/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.librewolf.enable = true;
|
||||
}
|
||||
34
modules/programs/2fa/default.nix
Executable file
34
modules/programs/2fa/default.nix
Executable file
|
|
@ -0,0 +1,34 @@
|
|||
{ pkgs, ... }:
|
||||
{
|
||||
programs.gpg = {
|
||||
enable = true;
|
||||
settings = {
|
||||
personal-cipher-preferences = "AES256 AES192 AES";
|
||||
personal-digest-preferences = "SHA512 SHA384 SHA256";
|
||||
personal-compress-preferences = "ZLIB BZIP2 ZIP Uncompressed";
|
||||
default-preference-list = "SHA512 SHA384 SHA256 AES256 AES192 AES ZLIB BZIP2 ZIP Uncompressed";
|
||||
cert-digest-algo = "SHA512";
|
||||
s2k-digest-algo = "SHA512";
|
||||
s2k-cipher-algo = "AES256";
|
||||
charset = "utf-8";
|
||||
fixed-list-mode = true;
|
||||
no-emit-version = true;
|
||||
no-greeting = true;
|
||||
keyid-format = "0xshort";
|
||||
list-options = "show-uid-validity show-unusable-subkeys";
|
||||
verify-options = "show-uid-validity";
|
||||
with-fingerprint = true;
|
||||
with-key-origin = true;
|
||||
require-cross-certification = true;
|
||||
no-symkey-cache = true;
|
||||
default-recipient-self = true;
|
||||
};
|
||||
};
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
pinentryFlavor = "curses";
|
||||
};
|
||||
home.packages = with pkgs; [
|
||||
oath-toolkit
|
||||
];
|
||||
}
|
||||
84
modules/programs/alacritty/default.nix
Executable file
84
modules/programs/alacritty/default.nix
Executable file
|
|
@ -0,0 +1,84 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
window = {
|
||||
title = "alacritty";
|
||||
dynamic_padding = true;
|
||||
decorations = "none";
|
||||
padding = {
|
||||
x = 16;
|
||||
y = 16;
|
||||
};
|
||||
opacity = 1;
|
||||
};
|
||||
font = {
|
||||
normal = {
|
||||
family = "Spleen 32x64";
|
||||
style = "Medium";
|
||||
};
|
||||
size = 12;
|
||||
offset = {
|
||||
x = 1;
|
||||
y = 1;
|
||||
};
|
||||
};
|
||||
cursor = {
|
||||
style = "Block";
|
||||
unfocused_hollow = true;
|
||||
};
|
||||
draw_bold_text_with_bright_colors = true;
|
||||
colors = {
|
||||
primary = {
|
||||
background = "#090410";
|
||||
foreground = "#bababd";
|
||||
};
|
||||
normal = {
|
||||
black = "#090410";
|
||||
red = "#b02f30";
|
||||
green = "#037538";
|
||||
yellow = "#c59820";
|
||||
blue = "#2e528c";
|
||||
magenta = "#764783";
|
||||
cyan = "#277c8a";
|
||||
white = "#bababd";
|
||||
};
|
||||
bright = {
|
||||
black = "#95A5A6";
|
||||
red = "#b02f30";
|
||||
green = "#00853e";
|
||||
yellow = "#c59820";
|
||||
blue = "#2e528c";
|
||||
magenta = "#764783";
|
||||
cyan = "#277c8a";
|
||||
white = "#ECF0F1";
|
||||
};
|
||||
vi_mode_cursor = {
|
||||
text = "CellBackground";
|
||||
cursor = "#00CC22";
|
||||
};
|
||||
};
|
||||
key_bindings = [
|
||||
{
|
||||
key = "Q";
|
||||
mode = "Vi";
|
||||
action = "ToggleViMode";
|
||||
}
|
||||
{
|
||||
key = "K";
|
||||
mode = "~Alt";
|
||||
mods = "Control|Shift";
|
||||
action = "ScrollPageUp";
|
||||
}
|
||||
{
|
||||
key = "J";
|
||||
mode = "~Alt";
|
||||
mods = "Control|Shift";
|
||||
action = "ScrollPageDown";
|
||||
}
|
||||
];
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
7
modules/programs/default.nix
Normal file
7
modules/programs/default.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[
|
||||
./alacritty
|
||||
./nvim
|
||||
./shell
|
||||
./git
|
||||
./2fa
|
||||
]
|
||||
8
modules/programs/git/default.nix
Executable file
8
modules/programs/git/default.nix
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.git= {
|
||||
enable = true;
|
||||
userEmail = "cjriddz@protonmail.com";
|
||||
userName = "iofq";
|
||||
};
|
||||
}
|
||||
44
modules/programs/nvim/default.nix
Executable file
44
modules/programs/nvim/default.nix
Executable file
|
|
@ -0,0 +1,44 @@
|
|||
{ pkgs, ...}:
|
||||
{
|
||||
xdg.configFile.nvim = {
|
||||
source = ../../../config/nvim;
|
||||
recursive = true;
|
||||
};
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
vimAlias = true;
|
||||
vimdiffAlias = true;
|
||||
extraConfig = ":luafile ~/.config/nvim/lua/init.lua";
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
vim-commentary
|
||||
vim-surround
|
||||
toggleterm-nvim
|
||||
targets-vim
|
||||
indent-blankline-nvim
|
||||
vim-go
|
||||
vim-nix
|
||||
(nvim-treesitter.withPlugins
|
||||
(
|
||||
plugins: with plugins; [
|
||||
tree-sitter-bash
|
||||
tree-sitter-c
|
||||
tree-sitter-dockerfile
|
||||
tree-sitter-go
|
||||
tree-sitter-javascript
|
||||
tree-sitter-json
|
||||
tree-sitter-lua
|
||||
tree-sitter-nix
|
||||
tree-sitter-php
|
||||
tree-sitter-python
|
||||
tree-sitter-yaml
|
||||
]
|
||||
)
|
||||
)
|
||||
nvim-treesitter-textobjects
|
||||
leap-nvim
|
||||
telescope-nvim
|
||||
];
|
||||
};
|
||||
}
|
||||
70
modules/programs/shell/default.nix
Executable file
70
modules/programs/shell/default.nix
Executable file
|
|
@ -0,0 +1,70 @@
|
|||
{ homeDirectory, pkgs, ...}:
|
||||
{
|
||||
imports = [
|
||||
(import ./tmux.nix)
|
||||
];
|
||||
programs.bash = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
historyControl = [ "ignorespace" ];
|
||||
historyIgnore = [
|
||||
"ls"
|
||||
"cd"
|
||||
":q"
|
||||
"exit"
|
||||
];
|
||||
shellAliases = {
|
||||
la = "ls -lahrt --color=auto";
|
||||
ll = "la";
|
||||
":q" = "exit";
|
||||
mpv = "mpv --no-keepaspect-window";
|
||||
sus = "systemctl suspend";
|
||||
gitu = "git add . && git commit && git push";
|
||||
rcp = "rsync -avh --progress";
|
||||
|
||||
};
|
||||
shellOptions = [
|
||||
"cmdhist"
|
||||
"globstar"
|
||||
"dirspell"
|
||||
"dotglob"
|
||||
"extglob"
|
||||
"cdspell"
|
||||
"histappend"
|
||||
];
|
||||
bashrcExtra = ''
|
||||
export PROMPT_COMMAND="prompt_command;history -a"
|
||||
export PATH="/usr/local/go/bin:~/go/bin:~/.bin:~/.local/bin:$PATH"
|
||||
export GPG_2FA="cjriddz@protonmail.com"
|
||||
export MANPAGER="nvim +Man!"
|
||||
export EDITOR="nvim"
|
||||
[[ $- != *i* ]] && return
|
||||
function exists {
|
||||
type $1 >/dev/null 2>&1
|
||||
}
|
||||
|
||||
function prompt_command {
|
||||
GIT_BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null | cut -c 1-10)
|
||||
[[ $GIT_BRANCH != "" ]] && \
|
||||
PS1="\[\033[38;5;1m\][\u@\h\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;7m\]\W\[$(tput sgr0)\]\[\033[38;5;1m\]]\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;3m\]($GIT_BRANCH)\[\033[38;5;7m\]\$\[$(tput sgr0)\] " || \
|
||||
PS1="\[\033[38;5;1m\][\u@\h\[$(tput sgr0)\] \[$(tput sgr0)\]\[\033[38;5;7m\]\W\[$(tput sgr0)\]\[\033[38;5;1m\]]\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;3m\]\[\033[38;5;7m\]\$\[$(tput sgr0)\] "
|
||||
}
|
||||
bind "set completion-ignore-case on"
|
||||
bind "set completion-map-case on"
|
||||
bind "set show-all-if-ambiguous on"
|
||||
bind "set menu-complete-display-prefix on"
|
||||
bind '"\t":menu-complete'
|
||||
bind '"\C-k": previous-history'
|
||||
bind '"\C-j": next-history'
|
||||
function cd {
|
||||
cmd="ls"
|
||||
builtin cd "$@" && $cmd
|
||||
}
|
||||
exists "kubectl" && source <(kubectl completion bash)
|
||||
'';
|
||||
};
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
fileWidgetCommand = "command find -L . -mindepth 1 -o -fstype 'sysfs' -o -fstype 'devfs' -o -fstype 'devtmpfs' -o -fstype 'proc' -prune";
|
||||
};
|
||||
}
|
||||
22
modules/programs/shell/tmux.nix
Executable file
22
modules/programs/shell/tmux.nix
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
{ ... }:
|
||||
{
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
keyMode = "vi";
|
||||
mouse = true;
|
||||
newSession = true;
|
||||
prefix = "C-a";
|
||||
escapeTime = 0;
|
||||
baseIndex = 1;
|
||||
# vi mode navigation
|
||||
customPaneNavigationAndResize = true;
|
||||
extraConfig = ''
|
||||
bind-key -T copy-mode-vi 'v' send -X begin-selection
|
||||
bind-key -T copy-mode-vi 'y' send-keys -X copy-pipe-and-cancel 'xclip -sel clip -i'
|
||||
set -g status-right ""
|
||||
setw -g status-style 'bg=colour0 fg=colour7'
|
||||
setw -g window-status-current-format '[#P:#W*] '
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
174
modules/wayland/default.nix
Normal file
174
modules/wayland/default.nix
Normal file
|
|
@ -0,0 +1,174 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
{
|
||||
home.packages = with pkgs; [
|
||||
wl-clipboard
|
||||
autotiling-rs
|
||||
gammastep
|
||||
grim
|
||||
];
|
||||
systemd.user.services.autotiling = {
|
||||
Install = {
|
||||
WantedBy = [ "sway-session.target" ];
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.autotiling-rs}/bin/autotiling-rs";
|
||||
Restart = "always";
|
||||
RestartSec = 5;
|
||||
};
|
||||
};
|
||||
services.gammastep = {
|
||||
enable = true;
|
||||
dawnTime = "6:00-8:00";
|
||||
duskTime = "20:00-22:00";
|
||||
latitude = 43.0;
|
||||
longitude = -89.0;
|
||||
temperature.day = 6000;
|
||||
temperature.night = 3500;
|
||||
};
|
||||
wayland.windowManager.sway = {
|
||||
enable = true;
|
||||
wrapperFeatures.gtk = true;
|
||||
config = {
|
||||
terminal = "alacritty";
|
||||
focus = {
|
||||
followMouse = "no";
|
||||
mouseWarping = "container";
|
||||
};
|
||||
fonts = {
|
||||
names = [
|
||||
"Spleen 32x64"
|
||||
];
|
||||
style = "Medium";
|
||||
size = 12.0;
|
||||
};
|
||||
window = {
|
||||
border = 1;
|
||||
};
|
||||
colors = {
|
||||
focused = {
|
||||
border = "#dddddd";
|
||||
background = "#285577";
|
||||
childBorder = "#dddddd";
|
||||
indicator = "#2e9ef4";
|
||||
text = "#ffffff";
|
||||
};
|
||||
};
|
||||
gaps = {
|
||||
smartBorders = "on";
|
||||
};
|
||||
modifier = "Mod4";
|
||||
keybindings = let
|
||||
modifier = config.wayland.windowManager.sway.config.modifier;
|
||||
in lib.mkOptionDefault {
|
||||
"${modifier}+x" = "kill";
|
||||
"${modifier}+space" = "exec ${pkgs.dmenu}/bin/dmenu_path | ${pkgs.dmenu}/bin/dmenu | ${pkgs.findutils}/bin/xargs swaymsg exec --";
|
||||
"${modifier}+bracketleft" = "exec --no-startup-id grimshot --notify save area /tmp/scrot-$(date \"+%Y-%m-%d\"T\"%H:%M:%S\").png";
|
||||
"${modifier}+bracketright" = "exec --no-startup-id grimshot --notify copy area";
|
||||
};
|
||||
bars = [
|
||||
{
|
||||
mode = "dock";
|
||||
position = "top";
|
||||
statusCommand = "${pkgs.i3status}/bin/i3status";
|
||||
fonts = {
|
||||
names = [
|
||||
"Spleen 32x64"
|
||||
];
|
||||
style = "Medium";
|
||||
size = 12.0;
|
||||
};
|
||||
colors = {
|
||||
statusline = "#666666";
|
||||
focusedWorkspace = {
|
||||
background = "#000000";
|
||||
border = "#666666";
|
||||
text = "#666666";
|
||||
};
|
||||
inactiveWorkspace = {
|
||||
background = "#000000";
|
||||
border = "#000000";
|
||||
text = "#666666";
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
input = {
|
||||
"type:keyboard" = {
|
||||
xkb_options = "caps:super";
|
||||
repeat_delay = "300";
|
||||
repeat_rate = "60";
|
||||
};
|
||||
"type:touchpad" = {
|
||||
natural_scroll = "enabled";
|
||||
accel_profile = "flat";
|
||||
tap = "enabled";
|
||||
tap_button_map = "lrm";
|
||||
dwt = "enabled";
|
||||
middle_emulation = "enabled";
|
||||
};
|
||||
"type:touch" = {
|
||||
events = "disabled";
|
||||
};
|
||||
};
|
||||
output = {
|
||||
"*" = {
|
||||
bg = "#000000 solid_color";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
programs.i3status = {
|
||||
enable = true;
|
||||
general = {
|
||||
colors = false;
|
||||
separator = " | ";
|
||||
output_format = "none";
|
||||
};
|
||||
modules = {
|
||||
"ipv6" = {
|
||||
enable = false;
|
||||
};
|
||||
"disk /" = {
|
||||
enable = false;
|
||||
};
|
||||
"tztime local" = {
|
||||
settings = {
|
||||
format = "%m-%d-%y %H:%M ";
|
||||
};
|
||||
};
|
||||
"wireless _first_" = {
|
||||
settings = {
|
||||
format_down = "off";
|
||||
format_up = "%signal";
|
||||
};
|
||||
};
|
||||
"memory" = {
|
||||
settings = {
|
||||
format = "%used";
|
||||
format_degraded = "%used";
|
||||
threshold_degraded = "1G";
|
||||
};
|
||||
};
|
||||
"battery all" = {
|
||||
settings = {
|
||||
format = "%percentage%status %remaining";
|
||||
status_chr = "+";
|
||||
status_bat = "";
|
||||
status_full = "";
|
||||
};
|
||||
};
|
||||
"volume master" = {
|
||||
position = 3;
|
||||
settings = {
|
||||
format = "%volume";
|
||||
format_muted = "muted";
|
||||
device = "default";
|
||||
};
|
||||
};
|
||||
"ethernet _first_" = {
|
||||
enable = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue