first commit

This commit is contained in:
2025-07-23 04:27:38 +02:00
commit caba04d493
18 changed files with 829 additions and 0 deletions

102
iso/config/nvim/init.lua Normal file
View File

@@ -0,0 +1,102 @@
vim.g.mapleader = " "
vim.opt.title = true
vim.opt.mouse = ""
vim.opt.wrap = true
vim.opt.fileencoding = "utf-8"
vim.opt.clipboard = "unnamedplus"
vim.opt.completeopt = { "menu", "menuone", "preview", "noselect" }
vim.opt.termguicolors = false
vim.opt.laststatus = 3
--- Search
vim.opt.ignorecase = true
vim.opt.smartcase = true
--- Numbers
vim.opt.number = true
vim.opt.relativenumber = true
--- Tab Options
vim.opt.smartindent = true
vim.opt.smarttab = true
vim.opt.expandtab = true
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.softtabstop = 2
vim.opt.showtabline = 2
--- Explorer
vim.g.netrw_banner = 0
vim.g.netrw_browse_split = 4
vim.g.netrw_altv = 1
vim.g.netrw_liststyle = 3
vim.g.netrw_winsize = 20
vim.opt.scrolloff = 6
vim.opt.sidescrolloff = 8
--- Swapfile
vim.opt.swapfile = false
vim.opt.backup = false
--- Keymap
-- Resource
vim.keymap.set("n", "<leader>r", ":source ~/.config/nvim/init.lua<cr>")
-- Explorer
vim.keymap.set("n", "<C-e>", ":Lexplore<cr>")
-- Windows
vim.keymap.set("n", "<C-Left>", "<C-w>h")
vim.keymap.set("n", "<C-Right>", "<C-w>l")
vim.keymap.set("n", "<C-Up>", "<C-w>k")
vim.keymap.set("n", "<C-Down>", "<C-w>j")
-- Resize
vim.keymap.set("n", "-", ":vertical resize -3<cr>")
vim.keymap.set("n", "+", ":vertical resize +3<cr>")
-- Buffer
vim.keymap.set("n", "<Tab>", ":buffer ")
-- Tabs
vim.keymap.set("n", "<leader>tn", ":tabnew<cr>")
vim.keymap.set("n", "<leader>tc", ":tabclose<cr>")
vim.keymap.set("n", "<S-Tab>", ":tabnext<cr>")
-- Cheatsheet
vim.keymap.set("n", "<C-s>", ":terminal ~/.config/nvim/nvim_help.sh<cr>i")
-- No highlight
vim.keymap.set("n", "<leader>nh", ":nohl<cr>")
--- Automaticly close brackets
vim.keymap.set("i", "'", "''<Left>")
vim.keymap.set("i", "\"", "\"\"<Left>")
vim.keymap.set("i", "(", "()<Left>")
vim.keymap.set("i", "{", "{}<Left>")
vim.keymap.set("i", "[", "[]<Left>")
--- Statusline
vim.cmd("highlight StatusNormal ctermbg=blue ctermfg=black")
vim.cmd("highlight StatusModified ctermbg=red ctermfg=black")
vim.cmd("highlight StatusGitBranch ctermbg=yellow ctermfg=black")
vim.cmd("highlight StatusGitDiffAdd ctermbg=green ctermfg=black")
vim.cmd("highlight StatusGitdiffRemove ctermbg=red ctermfg=black")
local function command(cmd)
local handle = io.popen(cmd)
local result = handle:read()
handle:close()
return result or ""
end
vim.o.statusline = "%#StatusNormal# "
.. "%#StatusGitBranch#"
.. command("git branch 2> /dev/null | sed -e 's/..//'")
.. "%#StatusNormal# "
.. "%#StatusGitDiffAdd#"
.. command("git diff --numstat | awk '{print \"+\"$1}'")
.. "%#StatusNormal# "
.. "%#StatusGitDiffRemove#"
.. command("git diff --numstat | awk '{print \"-\"$2}'")
.. "%#StatusNormal# "
.. ">>"
.. " %F "
.. "%#StatusModified#"
.. "%M"
.. "%#StatusNormal#"
.. " >>"
.. "%="
.. "<<"
.. " %Y "
.. "<<"
.. " %l,%c "
.. "<<"
.. " %p%% "

87
iso/customiso.nix Normal file
View File

@@ -0,0 +1,87 @@
{
pkgs,
modulesPath,
lib,
...
}:
{
imports = [
"${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
];
# Use the latest Linux kernel
boot.kernelPackages = pkgs.linuxPackages_latest;
# Create admin user
users.users = {
nixos = {
isNormalUser = true;
description = "Admin account";
extraGroups = [
"wheel"
];
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAKMJ3TkEmRQcX7RQijNa2km6a2xXJk6M6FERh7C9nTJ"
];
};
root = {
password = null;
openssh.authorizedKeys.keys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAKMJ3TkEmRQcX7RQijNa2km6a2xXJk6M6FERh7C9nTJ"
];
};
};
services.openssh = {
enable = true;
settings = {
PermitRootLogin = "prohibit-password";
};
};
# Allow sudo from admin user without password
security.sudo = {
enable = true;
extraRules = [
{
users = [ "nixos" ];
host = "ALL";
runAs = "ALL:ALL";
commands = [
{
command = "ALL";
options = [ "NOPASSWD" ];
}
];
}
];
};
# Packages for maintenance mode
environment.systemPackages = [
pkgs.neovim
pkgs.git
pkgs.curl
pkgs.nixos-anywhere
pkgs.nixos-generators
];
# Needed for https://github.com/NixOS/nixpkgs/issues/58959
boot.supportedFilesystems = lib.mkForce [
"btrfs"
"reiserfs"
"vfat"
"f2fs"
"xfs"
"ntfs"
"cifs"
"nfs"
];
environment.etc."xdg/nvim/init.lua" = {
source = ./config/nvim/init.lua;
mode = "0440";
};
}
# Config nvim