Compare commits

..

1 commit

Author SHA1 Message Date
4be4a7979f
feat: add "ubuntu" config for containers 2024-12-16 14:08:48 +01:00
21 changed files with 124 additions and 374 deletions

11
.envrc
View file

@ -1,5 +1,8 @@
export DIRENV_WARN_TIMEOUT=20s use flake .nix
eval "$(devenv direnvrc)" if on_git_branch; then
echo
use devenv git status --short --branch
echo
git fetch
fi

7
.gitignore vendored
View file

@ -2,10 +2,3 @@
# Ignore build outputs from performing a nix-build or `nix build` command # Ignore build outputs from performing a nix-build or `nix build` command
result result
result-* result-*
# Devenv
.devenv*
devenv.local.nix
# direnv
.direnv

25
.nix/flake.lock generated Normal file
View file

@ -0,0 +1,25 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1729665710,
"narHash": "sha256-AlcmCXJZPIlO5dmFzV3V2XF6x/OpNWUV8Y/FMPGd8Z4=",
"rev": "2768c7d042a37de65bb1b5b3268fc987e534c49d",
"revCount": 696158,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.1.696158%2Brev-2768c7d042a37de65bb1b5b3268fc987e534c49d/0192bd28-d6c0-735c-ab86-8ab9d12f7d62/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.1.%2A.tar.gz"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

32
.nix/flake.nix Normal file
View file

@ -0,0 +1,32 @@
{
description = "A flake editing flake";
inputs.nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.1.*.tar.gz";
outputs = { nixpkgs, ... }:
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in
{
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell.override
{
# Override stdenv in order to change compiler:
# stdenv = pkgs.clangStdenv;
}
{
packages = with pkgs; [
pre-commit
commitizen
];
shellHook = ''
pre-commit install --allow-missing-config --hook-type pre-commit --hook-type commit-msg
'';
};
});
};
}

View file

@ -1,103 +0,0 @@
{
"nodes": {
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1742320965,
"owner": "cachix",
"repo": "devenv",
"rev": "6bde92766ddd3ee1630029a03d36baddd51934e2",
"type": "github"
},
"original": {
"dir": "src/modules",
"owner": "cachix",
"repo": "devenv",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1742300892,
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "ea26a82dda75bee6783baca6894040c8e6599728",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1733477122,
"owner": "cachix",
"repo": "devenv-nixpkgs",
"rev": "7bd9e84d0452f6d2e63b6e6da29fe73fac951857",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "rolling",
"repo": "devenv-nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devenv": "devenv",
"git-hooks": "git-hooks",
"nixpkgs": "nixpkgs",
"pre-commit-hooks": [
"git-hooks"
]
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,11 +0,0 @@
{ pkgs, ... }:
{
packages = with pkgs; [
git
];
git-hooks.hooks = {
commitizen.enable = true;
};
}

View file

@ -1,15 +0,0 @@
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json
inputs:
nixpkgs:
url: github:cachix/devenv-nixpkgs/rolling
# If you're using non-OSS software, you can set allowUnfree to true.
# allowUnfree: true
# If you're willing to use a package that's vulnerable
# permittedInsecurePackages:
# - "openssl-1.1.1w"
# If you have more than one devenv you can merge them
#imports:
# - ./backend

12
flake.lock generated
View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1742447757, "lastModified": 1734093295,
"narHash": "sha256-Q0KXcHQmum8L6IzGhhkVhjFMKY6BvYa/rhmLP26Ws8o=", "narHash": "sha256-hSwgGpcZtdDsk1dnzA0xj5cNaHgN9A99hRF/mxMtwS4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "94605dcadefeaff6b35c8931c9f38e4f4dc7ad0a", "rev": "66c5d8b62818ec4c1edb3e941f55ef78df8141a8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -22,11 +22,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1742288794, "lastModified": 1734119587,
"narHash": "sha256-Txwa5uO+qpQXrNG4eumPSD+hHzzYi/CdaM80M9XRLCo=", "narHash": "sha256-AKU6qqskl0yf2+JdRdD0cfxX4b9x3KKV5RqA6wijmPM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "b6eaf97c6960d97350c584de1b6dcff03c9daf42", "rev": "3566ab7246670a43abd2ffa913cc62dad9cdf7d5",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -59,6 +59,27 @@
vimwikiPath = "~/vimwiki"; vimwikiPath = "~/vimwiki";
}; };
}; };
"ubuntu" = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
./shell
./git
./gpg
./neovim
./horsch.nix
];
extraSpecialArgs = {
user = "ubuntu";
userName = "Michael Mandl";
userEmail = "michael.mandl@horsch.com";
gpgSigningKey = "088ED38F036C7AF2";
gpgSSHKeys = [ "AEB2BF3FF9CF9529E9A3C6F1A202D21686FF9278" ];
theme = "dark";
vimwikiPath = "~/vimwiki";
};
};
}; };
}; };
} }

View file

@ -4,10 +4,6 @@
programs = { programs = {
less.enable = true; less.enable = true;
git-credential-oauth.enable = true; git-credential-oauth.enable = true;
git-worktree-switcher = {
enable = true;
enableZshIntegration = true;
};
git = { git = {
enable = true; enable = true;
@ -30,35 +26,14 @@
}; };
extraConfig = { extraConfig = {
branch.sort = "-committerdate"; core.editor = "nvim";
core.pager = "less -FX";
core = { diff.ignoreSubmodules = "none";
editor = "nvim";
fsmonitor = true;
pager = "less -FX";
untrackedCache = true;
};
column.ui = "auto"; fetch.parallel = 8;
fetch.writeCommitGraph = true;
commit.verbose = true; fetch.recurseSubmodules = true;
diff = {
algorithm = "histogram";
colorMoved = "plain";
ignoreSubmodules = "none";
mnemonicPrefix = true;
renames = true;
};
fetch = {
all = true;
parallel = 8;
prune = true;
pruneTags = true;
recurseSubmodules = true;
writeCommitGraph = true;
};
format.pretty = "format:%C(yellow)%h %Cblue%>(12)%ad %C(red)%G? %Cgreen%<(7,trunc)%aN%Cred%d %Creset%s"; format.pretty = "format:%C(yellow)%h %Cblue%>(12)%ad %C(red)%G? %Cgreen%<(7,trunc)%aN%Cred%d %Creset%s";
@ -66,45 +41,27 @@
log.date = "relative"; log.date = "relative";
merge = { merge.ff = false;
conflictstyle = "zdiff3"; merge.tool = "nvim";
ff = false;
tool = "nvim";
};
mergetool.nvim.cmd = "nvim -d $BASE $LOCAL $REMOTE $MERGED -c 'DiffviewOpen'"; mergetool.nvim.cmd = "nvim -f -c \"Gdiffsplit!\" \"$MERGED\"";
mergetool.nvim.trustExitCode = false;
mergetool.prompt = false; mergetool.prompt = false;
pager.difftool = true; pager.difftool = true;
pull.rebase = true; pull.rebase = true;
push = { push.recurseSubmodules = "on-demand";
autoSetupRemote = true;
default = "simple";
followTags = true;
recurseSubmodules = "on-demand";
};
rebase = { rebase.autostash = true;
qutoSquash = true;
autoStash = true;
updateRefs = true;
};
rerere = { rerere.enabled = true;
autoupdate = true;
enabled = true;
};
status.submoduleSummary = true; status.submoduleSummary = true;
submodule.fetchJobs = 8; submodule.fetchJobs = 8;
submodule.recurse = true; submodule.recurse = true;
tag.sort = "version:refname";
worktree.guessRemote = true; worktree.guessRemote = true;
}; };

View file

@ -1,35 +1,11 @@
{ pkgs, lib, ... }: { ... }:
{ {
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ programs.gh = {
"gh-copilot"
];
programs = {
gh = {
enable = true; enable = true;
settings = { settings = {
git_protocol = "ssh"; git_protocol = "ssh";
}; };
extensions = with pkgs; [
gh-copilot
gh-dash
];
};
gh-dash = {
enable = true;
settings = {
defaults = {
preview = {
open = true;
width = 64;
};
};
};
};
}; };
} }

View file

@ -15,9 +15,6 @@
# auto-close brackets, etc # auto-close brackets, etc
nvim-autopairs nvim-autopairs
# trailing whirespaces
vim-better-whitespace
# better wildmenu # better wildmenu
wilder-nvim wilder-nvim
@ -41,7 +38,6 @@
nvim-treesitter-textobjects nvim-treesitter-textobjects
nvim-ts-context-commentstring nvim-ts-context-commentstring
markdown-preview-nvim # use({ "iamcco/markdown-preview.nvim", run = ":call mkdp#util#install()" }) markdown-preview-nvim # use({ "iamcco/markdown-preview.nvim", run = ":call mkdp#util#install()" })
render-markdown-nvim
toggleterm-nvim toggleterm-nvim
nvim-notify nvim-notify
comment-nvim comment-nvim
@ -59,7 +55,6 @@
vim-flog vim-flog
git-blame-nvim git-blame-nvim
nvim-web-devicons # used by diffview-nvim nvim-web-devicons # used by diffview-nvim
diffview-nvim
# snippets # snippets
friendly-snippets friendly-snippets
@ -89,12 +84,6 @@
none-ls-nvim none-ls-nvim
lsp_lines-nvim lsp_lines-nvim
lsp-inlayhints-nvim lsp-inlayhints-nvim
lspkind-nvim
# Copilot
copilot-lua
copilot-cmp
CopilotChat-nvim
# debugging # debugging
nvim-dap nvim-dap
@ -102,9 +91,6 @@
# vim-wiki # vim-wiki
vimwiki vimwiki
# firenvim
firenvim
]; ];
withNodeJs = true; withNodeJs = true;
@ -126,8 +112,6 @@
nixd nixd
nixpkgs-fmt nixpkgs-fmt
bitbake-language-server bitbake-language-server
pyright
(python3.withPackages (ps: with ps; [ (python3.withPackages (ps: with ps; [
pep8 pep8
autopep8 autopep8
@ -153,12 +137,8 @@
require("local_toggleterm") require("local_toggleterm")
require("local_notify") require("local_notify")
require("local_comment") require("local_comment")
if vim.g.started_by_firenvim ~= true then
require("local_lualine") require("local_lualine")
require("local_tabline") require("local_tabline")
end
require("local_indent-blankline") require("local_indent-blankline")
require("local_gitsigns") require("local_gitsigns")
require("local_luasnip") require("local_luasnip")
@ -178,34 +158,6 @@
require("nvim-autopairs").setup({}) require("nvim-autopairs").setup({})
require("neogen").setup({ snippet_engine = "luasnip" }) require("neogen").setup({ snippet_engine = "luasnip" })
require("local_firenvim")
require("CopilotChat").setup({
highlight_headers = false,
separator = "---",
error_header = "> [!ERROR] Error",
window = {
layout = "float",
width = 0.8,
height = 0.8,
},
})
require("diffview").setup({
view = {
merge_tool = {
layout = "diff4_mixed",
disable_diagnostics = true,
}
}
})
require("render-markdown").setup({
file_types = { "markdown", "vimwiki", "copilot-chat" },
})
vim.g.strip_whitespace_on_save = 1
''; '';
}; };
}; };
@ -234,5 +186,4 @@
home.file.".config/nvim/lua/local_dap.lua".source = ./dap.lua; home.file.".config/nvim/lua/local_dap.lua".source = ./dap.lua;
home.file.".config/nvim/lua/local_illuminate.lua".source = ./illuminate.lua; home.file.".config/nvim/lua/local_illuminate.lua".source = ./illuminate.lua;
home.file.".config/nvim/lua/local_wilder.lua".source = ./wilder.lua; home.file.".config/nvim/lua/local_wilder.lua".source = ./wilder.lua;
home.file.".config/nvim/lua/local_firenvim.lua".source = ./firenvim.lua;
} }

View file

@ -1,38 +0,0 @@
if vim.g.started_by_firenvim ~= true then
return
end
vim.g.firenvim_config = {
globalSettings = { alt = "all" },
localSettings = {
[".*"] = {
cmdline = "neovim",
content = "text",
priority = 0,
selector = "textarea",
takeover = "never"
}
}
}
vim.api.nvim_create_autocmd('UIEnter', {
callback = function()
local client = vim.api.nvim_get_chan_info(vim.v.event.chan).client
if client ~= nil and client.name == "Firenvim" then
vim.o.laststatus = 0
end
end
})
vim.api.nvim_create_autocmd({ 'TextChanged', 'TextChangedI' }, {
callback = function()
if vim.g.timer_started == true then
return
end
vim.g.timer_started = true
vim.fn.timer_start(500, function()
vim.g.timer_started = false
vim.cmd('silent write')
end)
end
})

View file

@ -20,7 +20,6 @@ nnoremap("<leader>g", ":0Git<CR>")
-- vim-flog -- vim-flog
nnoremap("<leader>G", ":Flog -all -date=relative -open-cmd=new<CR>") nnoremap("<leader>G", ":Flog -all -date=relative -open-cmd=new<CR>")
nnoremap("<leader>F", ":Flog -path=% -date=relative -open-cmd=new<CR>")
-- telescope -- telescope
local telescope = require("telescope.builtin") local telescope = require("telescope.builtin")
@ -68,6 +67,3 @@ vim.cmd('nnoremap <expr> * v:hlsearch ? ":nohlsearch<cr>" : "*"')
-- insert-map jj/jk to escape -- insert-map jj/jk to escape
require("better_escape").setup() require("better_escape").setup()
-- open Copilot Chat window
nnoremap("<leader>cc", ":lua require('CopilotChat').open()<CR>")

View file

@ -113,7 +113,6 @@ local servers = {
} }
} }
}, },
["pyright"] = {},
["texlab"] = {}, ["texlab"] = {},
["yamlls"] = { ["yamlls"] = {
yaml = { yaml = {

View file

@ -7,12 +7,6 @@ end
local cmp = require("cmp") local cmp = require("cmp")
local luasnip = require("luasnip") local luasnip = require("luasnip")
local copilot_lua = require("copilot")
local copilot_cmp = require("copilot_cmp")
local lspkind = require("lspkind")
copilot_lua.setup({})
copilot_cmp.setup({})
cmp.setup({ cmp.setup({
snippet = { snippet = {
@ -21,7 +15,6 @@ cmp.setup({
end end
}, },
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "copilot" },
{ name = "nvim_lsp" }, { name = "nvim_lsp" },
{ name = "nvim_lsp_signature_help" }, { name = "nvim_lsp_signature_help" },
{ name = "luasnip" }, { name = "luasnip" },
@ -63,18 +56,18 @@ cmp.setup({
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
}, },
formatting = { formatting = {
format = lspkind.cmp_format({ fields = { "menu", "abbr", "kind" },
mode = "symbol", format = function(entry, item)
maxwidth = { local menu_icon = {
menu = 50, nvim_lsp = "λ",
abbr = 50, luasnip = "",
}, buffer = "Ω",
ellipsis_char = "...", path = "🖿",
show_labelDetails = true,
symbol_map = {
Copilot = "",
} }
}),
item.menu = menu_icon[entry.source.name]
return item
end,
}, },
}) })

View file

@ -1,4 +1,4 @@
{ pkgs, user, lib, ... }: { pkgs, user, ... }:
{ {
home.username = user; home.username = user;
@ -13,8 +13,7 @@
thunderbird thunderbird
keepassxc keepassxc
light light
# element-desktop-wayland element-desktop-wayland
element-desktop
darktable darktable
kubectl kubectl
kubectx kubectx
@ -26,11 +25,6 @@
evince evince
inkscape inkscape
chromium chromium
zoom-us
];
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"zoom"
]; ];
programs.home-manager.enable = true; programs.home-manager.enable = true;
@ -40,6 +34,5 @@
./kitty.nix ./kitty.nix
./nextcloud.nix ./nextcloud.nix
./sway ./sway
./private/ssh.nix
]; ];
} }

View file

@ -1,19 +0,0 @@
{ ... }:
{
programs = {
ssh = {
enable = true;
matchBlocks = {
tc-0x = {
host = "tc-*";
user = "root";
};
ed-0x = {
host = "ed-*";
user = "root";
};
};
};
};
}

View file

@ -1,13 +1,11 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
home.packages = with pkgs; [ home.packages = with pkgs; [
devenv
difftastic difftastic
dust dust
htop htop
jq jq
nh nh
sshfs
unzip unzip
xclip xclip
]; ];

View file

@ -4,7 +4,6 @@
programs = { programs = {
direnv = { direnv = {
enable = true; enable = true;
silent = true;
enableZshIntegration = true; enableZshIntegration = true;
nix-direnv.enable = true; nix-direnv.enable = true;
}; };

View file

@ -7,7 +7,7 @@
gs = "git status"; gs = "git status";
gd = "git diff"; gd = "git diff";
gf = "git fetch"; gf = "git fetch";
gfg = "git fetch --no-recurse-submodules && git graph --all --max-count 32"; gfp = "git fetch --prune";
k = "kubectl"; k = "kubectl";
ww = "nvim -c VimwikiIndex"; ww = "nvim -c VimwikiIndex";
}; };