Compare commits

..

3 commits

Author SHA1 Message Date
Antoine Vaure
5f0a2ff631 add devShell to flake template snippet 2025-10-10 14:53:10 +02:00
Antoine Vaure
5fbfe594d9 run darkman specific code only if darkman is available 2025-10-10 14:50:44 +02:00
Antoine Vaure
f65569dc50 add snippet for python 2025-10-08 14:31:08 +02:00
3 changed files with 22 additions and 12 deletions

View file

@ -70,18 +70,20 @@ end
vim.cmd.colorscheme "catppuccin" vim.cmd.colorscheme "catppuccin"
function set_theme_according_to_darkman() function set_theme_according_to_darkman()
local obj = vim.system({ 'darkman', 'get' }, { text = true }):wait() if vim.fn.executable("darkman") == 1 then
if obj.code == 0 then local obj = vim.system({ 'darkman', 'get' }, { text = true }):wait()
local theme = "light" if obj.code == 0 then
if obj.stdout == "dark\n" then local theme = "light"
theme = "dark" if obj.stdout == "dark\n" then
end theme = "dark"
if obj.stdout == "light\n" then end
theme = "light" if obj.stdout == "light\n" then
end theme = "light"
end
opt.background = theme opt.background = theme
vim.api.nvim_exec_autocmds("ColorScheme", {}) vim.api.nvim_exec_autocmds("ColorScheme", {})
end
end end
end end

View file

@ -33,7 +33,7 @@ snippet flake
let let
pkgs = nixpkgs.legacyPackages.\${system}; pkgs = nixpkgs.legacyPackages.\${system};
in in
{ rec {
packages = rec { packages = rec {
$1 = pkgs.stdenv.mkDerivation { $1 = pkgs.stdenv.mkDerivation {
name = "$1"; name = "$1";
@ -43,6 +43,12 @@ snippet flake
}; };
default = $1; default = $1;
}; };
devShells.default = {
inputsFrom = [ packages.default ];
packages = with pkgs; [
$3
];
};
} }
); );
} }

2
snippets/python.snippets Normal file
View file

@ -0,0 +1,2 @@
snippet exception Exception statement
Exception(f"$1")