use gruvbox material

This commit is contained in:
js0ny 2025-11-29 23:40:48 +00:00
parent 384114d2ca
commit 91b011a725
33 changed files with 607 additions and 221 deletions

View file

@ -3,29 +3,37 @@
-- https://www.reddit.com/r/neovim/comments/1d3hk1t/automatic_dark_mode_following_system_theme_on/ -- https://www.reddit.com/r/neovim/comments/1d3hk1t/automatic_dark_mode_following_system_theme_on/
local function get_system_theme() local function get_system_theme()
-- Default value -- Default value
local background = 'light' local background = "light"
-- First check whether we are on MacOS -- First check whether we are on MacOS
if vim.loop.os_uname().sysname == "Darwin" then if vim.loop.os_uname().sysname == "Darwin" then
-- Check if 'defaults' is executable -- Check if 'defaults' is executable
if vim.fn.executable('defaults') ~= 0 then if vim.fn.executable("defaults") ~= 0 then
-- Execute command to check if the macOS appearance is set to Dark -- Execute command to check if the macOS appearance is set to Dark
local appleInterfaceStyle = vim.fn.system({ "defaults", "read", "-g", "AppleInterfaceStyle" }) local appleInterfaceStyle = vim.fn.system({ "defaults", "read", "-g", "AppleInterfaceStyle" })
if appleInterfaceStyle:find("Dark") then if appleInterfaceStyle:find("Dark") then
background = 'dark' background = "dark"
end end
end end
-- Check if 'busctl' is executable (part of systemd) -- Check if 'busctl' is executable (part of systemd)
elseif vim.fn.executable('busctl') ~= 0 then elseif vim.fn.executable("busctl") ~= 0 then
-- Get the current color scheme from xdg-desktop-portal using busctl -- Get the current color scheme from xdg-desktop-portal using busctl
local result = vim.fn.system({ local result = vim.fn.system({
"busctl", "--user", "call", "org.freedesktop.portal.Desktop", "/org/freedesktop/portal/desktop", "busctl",
"org.freedesktop.portal.Settings", "ReadOne", "ss", "org.freedesktop.appearance", "color-scheme" "--user",
"call",
"org.freedesktop.portal.Desktop",
"/org/freedesktop/portal/desktop",
"org.freedesktop.portal.Settings",
"ReadOne",
"ss",
"org.freedesktop.appearance",
"color-scheme",
}) })
-- The result is in the form of "v u 0" for light and "v u 1" for dark -- The result is in the form of "v u 0" for light and "v u 1" for dark
local color_scheme = result:match("u%s+(%d+)") local color_scheme = result:match("u%s+(%d+)")
if color_scheme == '1' then if color_scheme == "1" then
background = 'dark' background = "dark"
end end
else else
end end
@ -33,11 +41,13 @@ local function get_system_theme()
return background return background
end end
if get_system_theme() == 'dark' then vim.cmd.colorscheme("gruvbox-material")
vim.o.background = 'dark'
vim.cmd.colorscheme("catppuccin-mocha")
else
vim.o.background = 'light'
vim.cmd.colorscheme("catppuccin-latte")
end
-- if get_system_theme() == 'dark' then
-- vim.o.background = 'dark'
-- vim.cmd.colorscheme("catppuccin-mocha")
-- else
-- vim.o.background = 'light'
-- vim.cmd.colorscheme("catppuccin-latte")
-- end
--

View file

@ -27,6 +27,13 @@ return {
}, },
}, },
}, },
{
"f4z3r/gruvbox-material.nvim",
name = "gruvbox-material",
lazy = false,
priority = 1000,
opts = {},
},
{ {
"rose-pine/neovim", "rose-pine/neovim",
name = "rose-pine", name = "rose-pine",

View file

@ -20,5 +20,5 @@ return {
opts = {}, opts = {},
-- dev = true, -- dev = true,
-- dir = "~/Source/Forks/luasnip-latex-snippets.nvim/" -- dir = "~/Source/Forks/luasnip-latex-snippets.nvim/"
} },
} }

164
nixcfgs/flake.lock generated
View file

@ -113,11 +113,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1763385902, "lastModified": 1763946419,
"narHash": "sha256-ZuM6Ji52YtonM84E8L7HlYquYs1xL19Fld33nFpXZd4=", "narHash": "sha256-bcgbx3Ps7dL9hE+op6OSMVAMkXcidZHVNsFuBKbCy0w=",
"owner": "HeitorAugustoLN", "owner": "HeitorAugustoLN",
"repo": "betterfox-nix", "repo": "betterfox-nix",
"rev": "a1fb9f34cd5a0bbea43e744da998d54931184257", "rev": "9c394344f04e0bb89eeeb1ed36917e1dbfa59bab",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -137,11 +137,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763172111, "lastModified": 1763517499,
"narHash": "sha256-QseFQKZgMq/kbHlrhfaNlwEyQ1H3J+UhnbgpAIEGpvA=", "narHash": "sha256-N5y55DwDNT+0kLFck2sy1+DcnLOZ/N05UEvZ2R5pmWo=",
"owner": "caelestia-dots", "owner": "caelestia-dots",
"repo": "cli", "repo": "cli",
"rev": "d89c438284311e99148ece61054cd6f9bc8e8cb7", "rev": "1cfd405eaa74e66f33e7790c5c6586676f03a395",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -159,11 +159,11 @@
"quickshell": "quickshell" "quickshell": "quickshell"
}, },
"locked": { "locked": {
"lastModified": 1763256383, "lastModified": 1764132349,
"narHash": "sha256-Vwct8SbZkfoTY0BbB0XVmXo5KsRIH4asV7QzXpjZ4b8=", "narHash": "sha256-nXYDlrLaqEmb7JJ1aAt1cC97EyMFNNtJ4i1Ma/WsQX8=",
"owner": "caelestia-dots", "owner": "caelestia-dots",
"repo": "shell", "repo": "shell",
"rev": "58fe2962b6f515e879962953fcb4fcd9c8f39c32", "rev": "24b313497f22f837577371675c145ba9b51d7ee5",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -177,11 +177,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1763724081, "lastModified": 1764325801,
"narHash": "sha256-hCgZsbaw21R9uL3iJwG8WT3VCMXVa7xjmxGRf0nwvL4=", "narHash": "sha256-LQ7tsrXs1wuB6KBwUctL3JlUsG/FWI2pCI6NkoO52dk=",
"owner": "catppuccin", "owner": "catppuccin",
"repo": "nix", "repo": "nix",
"rev": "e4676e1fd9b09131feadd3df556fd1d3f31fdd2d", "rev": "a696fed6b9b6aa89ef495842cdca3fc2a7cef0de",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -250,11 +250,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763772597, "lastModified": 1764377464,
"narHash": "sha256-N0387BO34qALZSFcWH4VjNaEQgaH6vzq96z4AmvxpAI=", "narHash": "sha256-xE2W9lDbBcxHiETe439JWcTYyKzZyfGVyuUneoFHbZo=",
"owner": "petrkozorezov", "owner": "petrkozorezov",
"repo": "firefox-addons-nix", "repo": "firefox-addons-nix",
"rev": "17708cf20e6e88e1c29bc3d65ac9af65f8f7ccdc", "rev": "05e6a239a9c5cb433b66cc8315aed44fd88f8d36",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -317,11 +317,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1762980239, "lastModified": 1763759067,
"narHash": "sha256-8oNVE8TrD19ulHinjaqONf9QWCKK+w4url56cdStMpM=", "narHash": "sha256-LlLt2Jo/gMNYAwOgdRQBrsRoOz7BPRkzvNaI/fzXi2Q=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "52a2caecc898d0b46b2b905f058ccc5081f842da", "rev": "2cccadc7357c0ba201788ae99c4dfa90728ef5e0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -490,11 +490,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763837297, "lastModified": 1764361670,
"narHash": "sha256-o60Q4UcjzYgF3BjC5moJEs7bPIYedHWPVcFjeRaH/JE=", "narHash": "sha256-jgWzgpIaHbL3USIq0gihZeuy1lLf2YSfwvWEwnfAJUw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "f07573df41506a0890ae8529fa51fe60cf563f4a", "rev": "780be8ef503a28939cf9dc7996b48ffb1a3e04c6",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -804,11 +804,11 @@
}, },
"import-tree": { "import-tree": {
"locked": { "locked": {
"lastModified": 1763263999, "lastModified": 1763762820,
"narHash": "sha256-AZ4UkBJQKfaL9sX+/mzc1xBtcJk8hDQGkhjWX0Py5hU=", "narHash": "sha256-ZvYKbFib3AEwiNMLsejb/CWs/OL/srFQ8AogkebEPF0=",
"owner": "vic", "owner": "vic",
"repo": "import-tree", "repo": "import-tree",
"rev": "058bd03ac818ea349946323ae3c2837b4cab7f22", "rev": "3c23749d8013ec6daa1d7255057590e9ca726646",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -827,11 +827,11 @@
"xwayland-satellite-unstable": "xwayland-satellite-unstable" "xwayland-satellite-unstable": "xwayland-satellite-unstable"
}, },
"locked": { "locked": {
"lastModified": 1763835287, "lastModified": 1764405884,
"narHash": "sha256-8wPX0t4wM6uLVpbRnU8yBqV2e93eXiYPiAJYzS6HLNc=", "narHash": "sha256-TnvBRPmcpcyinvLgsitHS7w5soSa6yNBfRYEI2TK1Ts=",
"owner": "sodiboo", "owner": "sodiboo",
"repo": "niri-flake", "repo": "niri-flake",
"rev": "5e06972e46f11274ae3dcb5175c45dc5b9e85410", "rev": "10aae4855ee275f7d80d85f4328c24265fb20f1f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -860,11 +860,11 @@
"niri-unstable": { "niri-unstable": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1763799335, "lastModified": 1764399944,
"narHash": "sha256-b6hgDHjrLgTp4Y8DD5woGChg0R+yH16m0ZWVi9BhjrA=", "narHash": "sha256-FC9eYtSmplgxllCX4/3hJq5J3sXWKLSc7at8ZUxycVw=",
"owner": "YaLTeR", "owner": "YaLTeR",
"repo": "niri", "repo": "niri",
"rev": "cfc01b895c0c7cbb9692852488675cc46693bd2a", "rev": "b35bcae35b3f9665043c335e55ed5828af77db85",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -880,11 +880,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763505477, "lastModified": 1764161084,
"narHash": "sha256-nJRd4LY2kT3OELfHqdgWjvToNZ4w+zKCMzS2R6z4sXE=", "narHash": "sha256-HN84sByg9FhJnojkGGDSrcjcbeioFWoNXfuyYfJ1kBE=",
"owner": "nix-darwin", "owner": "nix-darwin",
"repo": "nix-darwin", "repo": "nix-darwin",
"rev": "3bda9f6b14161becbd07b3c56411f1670e19b9b5", "rev": "e95de00a471d07435e0527ff4db092c84998698e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -936,11 +936,11 @@
"nixpkgs": "nixpkgs_5" "nixpkgs": "nixpkgs_5"
}, },
"locked": { "locked": {
"lastModified": 1763819073, "lastModified": 1764432271,
"narHash": "sha256-oi+Nd8O+lWCj0Jh+8Px3UAo82HMTB2AaPiJsy5iUPt8=", "narHash": "sha256-XCZxe+UAiutOpR4vd2iT02uVw4Yb8UogNu4+ystCInE=",
"owner": "kaylorben", "owner": "kaylorben",
"repo": "nixcord", "repo": "nixcord",
"rev": "0bb86069c738dd300458ebdcd93b05cd3204a155", "rev": "5d37818d54213354ede10445c330104a25eeccf4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -951,11 +951,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1763191728, "lastModified": 1763806073,
"narHash": "sha256-esRhOS0APE6k40Hs/jjReXg+rx+J5LkWw7cuWFKlwYA=", "narHash": "sha256-FHsEKDvfWpzdADWj99z7vBk4D716Ujdyveo5+A048aI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "1d4c88323ac36805d09657d13a5273aea1b34f0c", "rev": "878e468e02bfabeda08c79250f7ad583037f2227",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -997,11 +997,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1763622513, "lastModified": 1764316264,
"narHash": "sha256-1jQnuyu82FpiSxowrF/iFK6Toh9BYprfDqfs4BB+19M=", "narHash": "sha256-82L+EJU+40+FIdeG4gmUlOF1jeSwlf2AwMarrpdHF6o=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c58bc7f5459328e4afac201c5c4feb7c818d604b", "rev": "9a7b80b6f82a71ea04270d7ba11b48855681c4b0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1013,11 +1013,11 @@
}, },
"nixpkgs-stable_2": { "nixpkgs-stable_2": {
"locked": { "locked": {
"lastModified": 1763622513, "lastModified": 1764316264,
"narHash": "sha256-1jQnuyu82FpiSxowrF/iFK6Toh9BYprfDqfs4BB+19M=", "narHash": "sha256-82L+EJU+40+FIdeG4gmUlOF1jeSwlf2AwMarrpdHF6o=",
"owner": "nixOS", "owner": "nixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c58bc7f5459328e4afac201c5c4feb7c818d604b", "rev": "9a7b80b6f82a71ea04270d7ba11b48855681c4b0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1109,11 +1109,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1763421233, "lastModified": 1763966396,
"narHash": "sha256-Stk9ZYRkGrnnpyJ4eqt9eQtdFWRRIvMxpNRf4sIegnw=", "narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "89c2b2330e733d6cdb5eae7b899326930c2c0648", "rev": "5ae3b07d8d6527c42f17c876e404993199144b6a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1141,11 +1141,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1763678758, "lastModified": 1764242076,
"narHash": "sha256-+hBiJ+kG5IoffUOdlANKFflTT5nO3FrrR2CA3178Y5s=", "narHash": "sha256-sKoIWfnijJ0+9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "117cc7f94e8072499b0a7aa4c52084fa4e11cc9b", "rev": "2fad6eac6077f03fe109c4d4eb171cf96791faa4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1173,11 +1173,11 @@
}, },
"nixpkgs_6": { "nixpkgs_6": {
"locked": { "locked": {
"lastModified": 1763618868, "lastModified": 1764384123,
"narHash": "sha256-v5afmLjn/uyD9EQuPBn7nZuaZVV9r+JerayK/4wvdWA=", "narHash": "sha256-UoliURDJFaOolycBZYrjzd9Cc66zULEyHqGFH3QHEq0=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "a8d610af3f1a5fb71e23e08434d8d61a466fc942", "rev": "59b6c96beacc898566c9be1052ae806f3835f87d",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1189,11 +1189,11 @@
}, },
"nixpkgs_7": { "nixpkgs_7": {
"locked": { "locked": {
"lastModified": 1763678758, "lastModified": 1764242076,
"narHash": "sha256-+hBiJ+kG5IoffUOdlANKFflTT5nO3FrrR2CA3178Y5s=", "narHash": "sha256-sKoIWfnijJ0+9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "117cc7f94e8072499b0a7aa4c52084fa4e11cc9b", "rev": "2fad6eac6077f03fe109c4d4eb171cf96791faa4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1241,11 +1241,11 @@
"nixpkgs": "nixpkgs_7" "nixpkgs": "nixpkgs_7"
}, },
"locked": { "locked": {
"lastModified": 1763839106, "lastModified": 1764430352,
"narHash": "sha256-Hc+lLe8tv5AGocqVBeobavqRlreipCmoAPGTMl18zlo=", "narHash": "sha256-TqKYm5P8f+pdjp2ScDUvr2AI02Z/Dls0TbqZXxoXPq8=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NUR", "repo": "NUR",
"rev": "262abd934836c79866f950dfb3093e1a0094b052", "rev": "8fbb75c232610b00689964d4f6d69033f00ffac4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1289,11 +1289,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1762784320, "lastModified": 1763909441,
"narHash": "sha256-odsk96Erywk5hs0dhArF38zb7Oe0q6LZ70gXbxAPKno=", "narHash": "sha256-56LwV51TX/FhgX+5LCG6akQ5KrOWuKgcJa+eUsRMxsc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "plasma-manager", "repo": "plasma-manager",
"rev": "7911a0f8a44c7e8b29d031be3149ee8943144321", "rev": "b24ed4b272256dfc1cc2291f89a9821d5f9e14b4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1334,11 +1334,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763210607, "lastModified": 1763629934,
"narHash": "sha256-gyEL9lw8oSbFbZ323vYUpIhcZLzudACEAQyCTkYh1WM=", "narHash": "sha256-jWz10RbNAyylJbH4cUTLS/CsDjkd8gxfT8OsIgQIgEg=",
"ref": "refs/heads/master", "ref": "refs/heads/master",
"rev": "0a7dcf30eaf438aa1ec72a9017cdb952df03f005", "rev": "ed036d514b0fdbce03158a0b331305be166f4555",
"revCount": 704, "revCount": 708,
"type": "git", "type": "git",
"url": "https://git.outfoxxed.me/outfoxxed/quickshell" "url": "https://git.outfoxxed.me/outfoxxed/quickshell"
}, },
@ -1378,11 +1378,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763607916, "lastModified": 1764021963,
"narHash": "sha256-VefBA1JWRXM929mBAFohFUtQJLUnEwZ2vmYUNkFnSjE=", "narHash": "sha256-1m84V2ROwNEbqeS9t37/mkry23GBhfMt8qb6aHHmjuc=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "877bb495a6f8faf0d89fc10bd142c4b7ed2bcc0b", "rev": "c482a1c1bbe030be6688ed7dc84f7213f304f1ec",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1410,11 +1410,11 @@
"tinted-zed": "tinted-zed" "tinted-zed": "tinted-zed"
}, },
"locked": { "locked": {
"lastModified": 1764191810, "lastModified": 1764254063,
"narHash": "sha256-rofXPD/9TGpHveo1MTlUfpnF0MCG1/uHUB9f0rosdqc=", "narHash": "sha256-V22JzkaTLF/GAL2LgqvOsJhAr8JbJsKaD8hnHjGwXfE=",
"owner": "nix-community", "owner": "nix-community",
"repo": "stylix", "repo": "stylix",
"rev": "70c444a10d0c9ef71a25580dfa79af9cd43f3a5e", "rev": "a1451bc40413870f0c7b576b751c1ca92055e323",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1621,11 +1621,11 @@
"systems": "systems_5" "systems": "systems_5"
}, },
"locked": { "locked": {
"lastModified": 1763837811, "lastModified": 1764259715,
"narHash": "sha256-N/zray+TTgnBHvbXm20hZ8eiFPTudvMVCUdRqywF+Mw=", "narHash": "sha256-N2GgoJbnpMc7FWr+oiV6Gi7Z0Wlz/of/9rSOA0AR2PQ=",
"owner": "abenz1267", "owner": "abenz1267",
"repo": "walker", "repo": "walker",
"rev": "2ddd6b93b3ecb500d5ef4622281f80536c918940", "rev": "4899a7842097cf5c3bc595c79e8311780bac1188",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1743,11 +1743,11 @@
"xwayland-satellite-unstable": { "xwayland-satellite-unstable": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1763704521, "lastModified": 1764366786,
"narHash": "sha256-ceYEV6PnvUN8Zixao4gpPuN+VT3B0SlAXKuPNHZhqUY=", "narHash": "sha256-yVCJ4Qe/JkdKDu0DddFdAQgDQVeF12nxH7zv3jtooV4=",
"owner": "Supreeeme", "owner": "Supreeeme",
"repo": "xwayland-satellite", "repo": "xwayland-satellite",
"rev": "f379ff5722a821212eb59ada9cf8e51cb3654aad", "rev": "b362a3873710a42f7ac2d8ba03772d8290733934",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1763,11 +1763,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1763697957, "lastModified": 1764216441,
"narHash": "sha256-p6CTJoeM3EK9tcqm6lgnKZFVJiGHCzcCftkko4EpEb0=", "narHash": "sha256-wvxWNSm19K5zSmTkQNkYwxMBZXOuZCbA45jiT1R9myU=",
"owner": "youwen5", "owner": "youwen5",
"repo": "zen-browser-flake", "repo": "zen-browser-flake",
"rev": "9eb198a4d7ea4bd1284254780e3c22533f743d55", "rev": "d620f0b8fac4e9b6ee2369fca071f4ea854399f6",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -118,6 +118,7 @@
xremap-flake.nixosModules.default xremap-flake.nixosModules.default
sops-nix.nixosModules.sops sops-nix.nixosModules.sops
catppuccin.nixosModules.catppuccin catppuccin.nixosModules.catppuccin
stylix.nixosModules.default
./hosts/${hostname} ./hosts/${hostname}
{nixpkgs.overlays = overlays;} {nixpkgs.overlays = overlays;}
]; ];

View file

@ -61,6 +61,11 @@
algorithm = "lz4"; algorithm = "lz4";
priority = 100; priority = 100;
}; };
stylix = {
enable = true;
autoEnable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-material-dark-hard.yaml";
};
# Disable modem # Disable modem
networking.modemmanager.enable = false; networking.modemmanager.enable = false;

View file

@ -1,55 +1,113 @@
{ {
lib, lib,
config, config,
pkgs,
... ...
}: { }: let
options.currentUser = { inherit (lib) mkOption types mkIf;
defaultShell = lib.mkOption { cfg = config.my; # 简写引用,方便后续使用
type = lib.types.enum ["zsh" "bash" "fish"]; in {
default = "zsh"; options.my = {
description = "The default shell to use."; # === 软件生态配置 (Software Ecosystem) ===
desktop = {
preferredApps = {
shell = mkOption {
type = types.package;
default = pkgs.bash;
description = "The default shell package to use.";
example = pkgs.zsh;
};
interactiveShell = mkOption {
type = types.package;
default = pkgs.bash;
description = "The default interactive shell package. (spawn by terminal emulators)";
example = pkgs.fish;
};
terminal = {
package = mkOption {
type = types.package;
default = pkgs.alacritty;
description = "The default terminal emulator package.";
example = pkgs.kitty;
};
execArg = mkOption {
type = types.str;
default = "-e";
description = "The argument used to execute a command in the terminal.";
};
};
fileManager = {
gui = mkOption {
type = types.package;
default = pkgs.thunar;
description = "The default GUI file explorer.";
example = pkgs.kdePackages.dolphin;
};
tui = mkOption {
type = types.package;
default = pkgs.yazi;
description = "The default TUI file explorer.";
example = pkgs.ranger;
};
};
};
style = {
iconTheme = {
# 分离包和名称:有些包名和主题名不一致
package = mkOption {
type = types.package;
default = pkgs.kdePackages.breeze-icons;
description = "The package containing the icon theme.";
example = pkgs.papirus-icon-theme;
};
light = mkOption {
type = types.str;
default = "Breeze";
description = "The internal name of the icon theme (as used in GTK/QT settings).";
example = "Papirus-Light";
};
dark = mkOption {
type = types.str;
default = "Breeze-Dark";
description = "The internal name of the dark icon theme (as used in GTK/QT settings).";
example = "Papirus-Dark";
};
};
};
}; };
defaultTerminal = lib.mkOption { # === 硬件/主机特性配置 (Hardware/Host Specifics) ===
type = lib.types.str; hardware = {
default = "ghostty"; # 使用 nullOr 允许该功能被完全禁用(如果在没有背光的台式机上)
description = "The default terminal emulator."; keyboardBacklight = mkOption {
}; type = types.nullOr (types.submodule {
options = {
device = mkOption {
type = types.str;
description = "Device identifier for brightnessctl.";
};
step = mkOption {
type = types.str;
default = "5%"; # 稍微调小默认步进,更精细
description = "Step percentage/integer for brightness adjustment.";
};
};
});
default = null;
description = "Keyboard backlight configuration. Set to null to disable.";
};
defaultTerminalRunner = lib.mkOption { isHeadless = mkOption {
type = lib.types.str; type = types.bool;
default = config.currentUser.defaultTerminal; default = false;
description = "The default terminal emulator to run CLI softwares directly"; description = "Whether the current host acts as a headless server.";
}; };
defaultExplorer = lib.mkOption {
type = lib.types.str;
default = "thunar";
description = "The default file explorer";
};
defaultTerminalExplorer = lib.mkOption {
type = lib.types.str;
default = "yazi";
description = "The default file explorer with TUI";
};
iconTheme = lib.mkOption {
type = lib.types.str;
default = "Breeze";
description = "Default icon theme";
};
};
options.currentHost = {
keyboardBacklightDevice = lib.mkOption {
type = lib.types.str;
default = "";
description = "Device Identifier that used for brightnessctl, get the identifier via brightnessctl --list";
};
keyboardBacklightStep = lib.mkOption {
type = lib.types.str;
default = "34%";
description = "Step to change keyboard backlight, integer or percentage accepted";
}; };
}; };
} }

View file

@ -12,6 +12,8 @@
runAsRoot = true; runAsRoot = true;
swtpm.enable = true; swtpm.enable = true;
}; };
onShutdown = "shutdown";
onBoot = "ignore";
}; };
users.users.js0ny = { users.users.js0ny = {
extraGroups = ["libvirtd"]; extraGroups = ["libvirtd"];

View file

@ -1,9 +1,14 @@
{ {pkgs, ...}: {
currentUser = { my = {
defaultShell = "zsh"; desktop = {
defaultTerminal = "kitty"; preferredApps = {
iconTheme = "Papirus"; shell = pkgs.zsh;
defaultExplorer = "dolphin"; interactiveShell = pkgs.fish;
defaultTerminalExplorer = "yazi"; terminal = {
package = pkgs.kitty;
execArg = "-e";
};
};
};
}; };
} }

View file

@ -9,7 +9,7 @@ in {
imports = [ imports = [
../../modules/home/options.nix ../../modules/home/options.nix
../../modules/home/do-not-track.nix ../../modules/home/do-not-track.nix
./config.nix # ./config.nix
]; ];
home.username = username; home.username = username;
home.homeDirectory = home.homeDirectory =
@ -29,6 +29,4 @@ in {
enable = true; enable = true;
}; };
}; };
home.sessionVariables.TERMINAL = config.currentUser.defaultTerminal;
} }

View file

@ -16,7 +16,6 @@
age age
aichat aichat
beancount beancount
gnumake
chezmoi chezmoi
curlie curlie
duf duf
@ -67,6 +66,7 @@
jless jless
unar unar
trash-cli trash-cli
aria2
] ]
++ ( ++ (
if pkgs.stdenv.isDarwin if pkgs.stdenv.isDarwin

View file

@ -0,0 +1,28 @@
{
pkgs,
config,
...
}: {
# Globally installed development tools
home.packages = with pkgs; [
vscode-json-languageserver
alejandra
gnumake
nil
jq
yq-go
tokei
socat
shellcheck
];
home.sessionVariables = {
CARGO_HOME = "${config.xdg.dataHome}/cargo";
GOPATH = "${config.xdg.dataHome}/go";
PYTHON_HISTORY = "${config.xdg.stateHome}/python/history";
};
systemd.user.tmpfiles.rules = [
"d ${config.xdg.dataHome}/cargo 0755 ${config.home.username} users -"
"d ${config.xdg.dataHome}/go 0755 ${config.home.username} users -"
"f ${config.xdg.stateHome}/python 0755 ${config.home.username} users -"
];
}

View file

@ -79,7 +79,43 @@ in {
sockets = ["wayland"]; sockets = ["wayland"];
}; };
}; };
xdg.dataFile = appWrappers; # xdg.dataFile = appWrappers;
xdg.dataFile =
{
# Patch for Hyprland (scale XWayland by hand)
"flatpak/exports/bin/com.qq.QQ" = {
text = ''
#!/bin/sh
EXTRA_APP_ARGS=""
if [ "$XDG_CURRENT_DESKTOP" = "Hyprland" ]; then
EXTRA_APP_ARGS="--force-device-scale-factor=1.5"
fi
exec flatpak run --branch=stable --arch=x86_64 com.qq.QQ "$EXTRA_APP_ARGS" "$@"
'';
enable = true;
executable = true;
};
"flatpak/exports/share/applications/com.qq.QQ.desktop" = {
text = ''
[Desktop Entry]
Name=QQ
Exec=${config.xdg.dataHome}/flatpak/exports/bin/com.qq.QQ
Terminal=false
Type=Application
Icon=com.qq.QQ
StartupWMClass=QQ
Categories=Network;
Comment=QQ
X-Flatpak=com.qq.QQ
'';
enable = true;
force = true;
};
}
// appWrappers;
home.activation.patchFlatpakDesktopFiles = lib.hm.dag.entryAfter ["writeBoundary"] '' home.activation.patchFlatpakDesktopFiles = lib.hm.dag.entryAfter ["writeBoundary"] ''
${lib.concatMapStringsSep "\n" (appid: '' ${lib.concatMapStringsSep "\n" (appid: ''
DESKTOP_FILE="${config.xdg.dataHome}/flatpak/exports/share/applications/${appid}.desktop" DESKTOP_FILE="${config.xdg.dataHome}/flatpak/exports/share/applications/${appid}.desktop"

View file

@ -67,10 +67,10 @@ in {
neovim.enable = false; neovim.enable = false;
firefox = { firefox = {
profileNames = ["default"]; profileNames = ["default"];
colorTheme.enable = false; # Firefox Color
}; };
}; };
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-material-dark-hard.yaml";
image = ./wallpaper.jpg; image = ./wallpaper.jpg;
polarity = "dark"; polarity = "dark";
}; };

View file

@ -1,6 +1,7 @@
{ {
pkgs, pkgs,
config, config,
lib,
... ...
}: { }: {
home.sessionVariables = { home.sessionVariables = {
@ -46,7 +47,7 @@
"org/gnome/desktop/interface" = { "org/gnome/desktop/interface" = {
clock-show-seconds = true; clock-show-seconds = true;
clock-show-weekday = true; clock-show-weekday = true;
icon-theme = "${config.currentUser.iconTheme}"; icon-theme = "${config.my.desktop.style.iconTheme.dark}";
accent-color = "pink"; accent-color = "pink";
show-battery-percentage = true; show-battery-percentage = true;
cursor-theme = "Adwaita"; cursor-theme = "Adwaita";
@ -111,12 +112,12 @@
}; };
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom-1" = { "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom-1" = {
name = "Open Terminal via Win-R"; name = "Open Terminal via Win-R";
command = "${config.currentUser.defaultTerminal}"; command = "${lib.getExe config.my.desktop.preferredApps.terminal.package}";
binding = "<Super>r"; binding = "<Super>r";
}; };
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom-2" = { "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom-2" = {
name = "Open Terminal via Ctrl-Alt-T"; name = "Open Terminal via Ctrl-Alt-T";
command = "${config.currentUser.defaultTerminal}"; command = "${lib.getExe config.my.desktop.preferredApps.terminal.package}";
binding = "<Ctrl><Alt>t"; binding = "<Ctrl><Alt>t";
}; };
"org/gnome/settings-daemon/plugins/media-keys" = { "org/gnome/settings-daemon/plugins/media-keys" = {

View file

@ -29,7 +29,7 @@
position = "center"; position = "center";
}; };
workspace = { workspace = {
iconTheme = "${config.currentUser.iconTheme}"; iconTheme = "${config.my.desktop.style.iconTheme.dark}";
colorScheme = "BreezeDark"; colorScheme = "BreezeDark";
}; };
kwin = { kwin = {

View file

@ -4,14 +4,13 @@
lib, lib,
... ...
}: let }: let
term = config.currentUser.defaultTerminal; term = lib.getExe config.my.desktop.preferredApps.terminal.package;
termRunner = config.currentUser.defaultTerminalRunner; iconTheme = config.my.desktop.style.iconTheme.dark;
iconTheme = config.currentUser.iconTheme; explorer = lib.getExe config.my.desktop.preferredApps.fileManager.gui;
explorer = config.currentUser.defaultExplorer; explorerTerm = lib.getExe config.my.desktop.preferredApps.fileManager.tui;
explorerTerm = config.currentUser.defaultTerminalExplorer;
launcher = "walker"; launcher = "walker";
kbdBacklightDev = config.currentHost.keyboardBacklightDevice; kbdBacklightDev = config.my.hardware.keyboardBacklight.device;
kbdBacklightStep = config.currentHost.keyboardBacklightStep; kbdBacklightStep = config.my.hardware.keyboardBacklight.step;
mainMod = "SUPER"; mainMod = "SUPER";
screenshotPath = "$HOME/Pictures/Screenshots/\"$(%Y-%m-%d_%H-%M-%S.png)\""; screenshotPath = "$HOME/Pictures/Screenshots/\"$(%Y-%m-%d_%H-%M-%S.png)\"";
my = import ./scripts.nix {inherit pkgs;}; my = import ./scripts.nix {inherit pkgs;};
@ -22,7 +21,7 @@ in {
bind = [ bind = [
# === Run Applications === # === Run Applications ===
"$mainMod, return, exec, ${term}" "$mainMod, return, exec, ${term}"
"$mainMod SHIFT, return, exec, ${termRunner} --directory ~/Atelier -e nvim" "$mainMod SHIFT, return, exec, ${term} --directory ~/Atelier -e nvim"
"$mainMod, B, exec, ${lib.getExe my.launch-or-focus} firefox firefox" "$mainMod, B, exec, ${lib.getExe my.launch-or-focus} firefox firefox"
"$mainMod SHIFT, B, exec, firefox --private-window" "$mainMod SHIFT, B, exec, firefox --private-window"
"$mainMod, A, exec, kitty --class=kitty-terminal-popup -e aichat --session" "$mainMod, A, exec, kitty --class=kitty-terminal-popup -e aichat --session"
@ -34,11 +33,11 @@ in {
''$mainMod SHIFT, F, exec, hyprctl --batch "dispatch togglefloating ; dispatch resizeactive exact 1440 810 ; dispatch centerwindow 1;"'' ''$mainMod SHIFT, F, exec, hyprctl --batch "dispatch togglefloating ; dispatch resizeactive exact 1440 810 ; dispatch centerwindow 1;"''
"$mainMod SHIFT, M, fullscreen" "$mainMod SHIFT, M, fullscreen"
"$mainMod, W, exec, ${launcher} -m windows" "$mainMod, W, exec, ${launcher} -m windows"
"$mainMod, Apostrophe, exec, EDITOR_MINIMAL=1 ${termRunner} -o close_on_child_death=yes --class=${termRunner}-terminal-popup -e edit-clipboard --minimal" "$mainMod, Apostrophe, exec, EDITOR_MINIMAL=1 ${term} -o close_on_child_death=yes --class=${term}-terminal-popup -e edit-clipboard --minimal"
"$mainMod, V, exec, ${launcher} -m clipboard" "$mainMod, V, exec, ${launcher} -m clipboard"
"alt, space, exec, ${launcher} -m desktopapplications" "alt, space, exec, ${launcher} -m desktopapplications"
"$mainMod, E, exec, ${explorer}" "$mainMod, E, exec, ${explorer}"
"$mainMod SHIFT, E, exec, ${termRunner} -e ${explorerTerm}" "$mainMod SHIFT, E, exec, ${term} -e ${explorerTerm}"
"CTRL ALT, DELETE, exec, uwsm exit" "CTRL ALT, DELETE, exec, uwsm exit"
"$mainMod, P, pseudo" "$mainMod, P, pseudo"
"$mainMod, Y, togglesplit" "$mainMod, Y, togglesplit"

View file

@ -11,6 +11,7 @@
# Right Top # Right Top
"float, pin, size 25%, move 73% 10%, class:^(org.pulseaudio.pavucontrol)$" "float, pin, size 25%, move 73% 10%, class:^(org.pulseaudio.pavucontrol)$"
"float, pin, size 25%, move 73% 10%, class:^(.bluetooth-manager-wrapped)$"
# Right Top + no focus # Right Top + no focus
"noinitialfocus, float, pin, size 25%, move 73% 10%, class:^(org.kde.(dolphin|ark))$, title:^(Extracting|Compressing)(.*)$" "noinitialfocus, float, pin, size 25%, move 73% 10%, class:^(org.kde.(dolphin|ark))$, title:^(Extracting|Compressing)(.*)$"
"noinitialfocus, float, pin, size 25%, move 73% 10%, class:^(thunar)$, title:^(File Operation Progress)$" "noinitialfocus, float, pin, size 25%, move 73% 10%, class:^(thunar)$, title:^(File Operation Progress)$"

View file

@ -4,14 +4,12 @@
lib, lib,
... ...
}: let }: let
term = config.currentUser.defaultTerminal; term = lib.getExe config.my.desktop.preferredApps.terminal.package;
termRunner = config.currentUser.defaultTerminalRunner; # TODO: Don't default to dark
iconTheme = config.currentUser.iconTheme; iconTheme = config.my.desktop.style.iconTheme.dark;
explorer = config.currentUser.defaultExplorer;
explorerTerm = config.currentUser.defaultTerminalExplorer;
launcher = "walker"; launcher = "walker";
kbdBacklightDev = config.currentHost.keyboardBacklightDevice; kbdBacklightDev = config.my.hardware.keyboardBacklight.device;
kbdBacklightStep = config.currentHost.keyboardBacklightStep; kbdBacklightStep = config.my.hardware.keyboardBacklight.step;
nirictl = import ./scripts.nix {inherit pkgs;}; nirictl = import ./scripts.nix {inherit pkgs;};
in { in {
home.packages = [ home.packages = [
@ -23,7 +21,7 @@ in {
"Mod+B".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "firefox" "firefox"; "Mod+B".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "firefox" "firefox";
"Mod+Shift+B".hotkey-overlay.title = "Launch web browser in private mode"; "Mod+Shift+B".hotkey-overlay.title = "Launch web browser in private mode";
"Mod+Shift+B".action = spawn "firefox" "--private-window"; "Mod+Shift+B".action = spawn "firefox" "--private-window";
"Mod+A".action = spawn-sh "${termRunner} --class=terminal-popup -e aichat --session"; "Mod+A".action = spawn-sh "${term} --class=terminal-popup -e aichat --session";
"Mod+Shift+A".hotkey-overlay.title = "Focus or launch CherryStudio (AI assistant)"; "Mod+Shift+A".hotkey-overlay.title = "Focus or launch CherryStudio (AI assistant)";
"Mod+Shift+A".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "CherryStudio" "cherry-studio"; "Mod+Shift+A".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "CherryStudio" "cherry-studio";
"Mod+O".hotkey-overlay.title = "Focus or launch Obsidian"; "Mod+O".hotkey-overlay.title = "Focus or launch Obsidian";
@ -31,12 +29,12 @@ in {
# TODO: Change "org.kde.dolphin" to a more generic explorer app id via config.currentUser # TODO: Change "org.kde.dolphin" to a more generic explorer app id via config.currentUser
"Mod+E".hotkey-overlay.title = "Focus or launch file explorer"; "Mod+E".hotkey-overlay.title = "Focus or launch file explorer";
"Mod+E".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "org.kde.dolphin" "dolphin"; "Mod+E".action = spawn "${lib.getExe nirictl.focusOrLaunch}" "org.kde.dolphin" "dolphin";
"Mod+T".action = spawn-sh "${termRunner} --class=terminal-popup"; "Mod+T".action = spawn-sh "${term} --class=terminal-popup";
"Mod+Shift+T".action = spawn-sh "${termRunner} --class=${termRunner}-terminal-popup --working-directory='${config.home.homeDirectory}/.config/shells/nohist' -e nix develop"; "Mod+Shift+T".action = spawn-sh "${term} --class=${term}-terminal-popup --working-directory='${config.home.homeDirectory}/.config/shells/nohist' -e nix develop";
"Mod+Semicolon".action = spawn "neovide" "${config.home.homeDirectory}/Atelier"; "Mod+Semicolon".action = spawn "neovide" "${config.home.homeDirectory}/Atelier";
"Mod+Apostrophe".action = "Mod+Apostrophe".action =
spawn-sh "EDITOR_MINIMAL=1 ${termRunner} -o close_on_child_death=yes --class=terminal-popup -e edit-clipboard --minimal"; spawn-sh "EDITOR_MINIMAL=1 ${term} -o close_on_child_death=yes --class=terminal-popup -e edit-clipboard --minimal";
"Mod+Shift+Slash".action = show-hotkey-overlay; "Mod+Shift+Slash".action = show-hotkey-overlay;

View file

@ -0,0 +1,87 @@
{...}: {
workspaces = [
{
id = 1;
name = "Master";
matches = [
{
class = "firefox";
}
];
}
{
id = 2;
name = "Project";
matches = [
{
class = "code|dev.zed.Zed|Vitis IDE|Vivado";
}
];
}
{
id = 3;
name = "Info";
matches = [
{
class = "discord|thunderbird|QQ|wechat|com.(telegram|ayugram).desktop|io.github.kukuruzka165.materialgram";
}
];
}
{
id = 9;
name = "Background";
matches = [
{
class = "feishin|Cider";
}
];
}
];
float-top-right-pin = [
{
class = "org.pulseaudio.pavucontrol";
}
{
class = ".bluetooth-manager-wrapped";
}
];
float-center = [
{
class = "com.(telegram|ayugram).desktop";
title = "Media viewer";
}
{
class = "io.github.kukuruzka165.materialgram";
title = "Media viewer";
}
{
class = "wechat";
title = "";
}
{
class = "QQ";
title = "";
}
{
class = "QQ";
title = "";
}
{
class = "CherryStudio";
title = "Cherry Studio Quick Assistant";
}
{
class = "anki";
title = "Add";
}
{
class = "kitty-terminal-popup";
}
{
title = "Open File||Select a File||Choose wallpaper|Open Folder|Save As||Library|File Upload(.*)";
}
{
class = "qt6ct";
}
];
}

View file

@ -20,6 +20,7 @@
nix-ts-mode nix-ts-mode
flycheck flycheck
highlight-indent-guides highlight-indent-guides
magit
]; ];
}; };
# TODO: tdlib version is too high # TODO: tdlib version is too high

View file

@ -1,6 +1,7 @@
{ {
config, config,
pkgs, pkgs,
lib,
... ...
}: { }: {
programs.ghostty = { programs.ghostty = {
@ -14,7 +15,7 @@
else true; else true;
# Not ready # Not ready
settings = { settings = {
command = "${config.currentUser.defaultShell}"; command = "${lib.getExe config.my.desktop.preferredApps.interactiveShell}";
font-size = 13; font-size = 13;
font-family = "Maple Mono NF CN"; font-family = "Maple Mono NF CN";
# theme = light:Catppuccin Latte,dark:Catppuccin Mocha; # theme = light:Catppuccin Latte,dark:Catppuccin Mocha;

View file

@ -1,6 +1,7 @@
{ {
config, config,
pkgs, pkgs,
lib,
... ...
}: let }: let
alt = alt =
@ -8,6 +9,7 @@
then "cmd" then "cmd"
else "alt"; else "alt";
in { in {
xdg.configFile."kitty/kitty.conf".force = true;
programs.kitty = { programs.kitty = {
enable = true; enable = true;
shellIntegration = { shellIntegration = {
@ -41,7 +43,7 @@ in {
macos_option_as_alt = true; macos_option_as_alt = true;
macos_quit_when_last_window_closed = true; macos_quit_when_last_window_closed = true;
enabled_layouts = "splits"; enabled_layouts = "splits";
shell = config.currentUser.defaultShell; shell = lib.getExe config.my.desktop.preferredApps.interactiveShell;
allow_remote_control = "socket-only"; allow_remote_control = "socket-only";
listen_on = "unix:/tmp/kitty.sock"; listen_on = "unix:/tmp/kitty.sock";
confirm_os_window_close = 0; confirm_os_window_close = 0;
@ -82,4 +84,33 @@ in {
} }
else {}; else {};
}; };
programs = {
bash.bashrcExtra = ''
if [ "$TERM" = "xterm-kitty" ]; then
alias ssh="kitty +kitten ssh"
alias icat="kitty +kitten icat"
fi
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
alias clip="kitty +kitten clipboard"
fi
'';
zsh.initContent = ''
if [ "$TERM" = "xterm-kitty" ]; then
alias ssh="kitty +kitten ssh"
alias icat="kitty +kitten icat"
fi
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then
alias clip="kitty +kitten clipboard"
fi
'';
fish.interactiveShellInit = ''
if test "$TERM" = "xterm-kitty"
abbr --add ssh "kitty +kitten ssh"
abbr --add icat "kitty +kitten icat"
end;
if test -n "$SSH_CLIENT" -o -n "$SSH_TTY"
abbr --add clip "kitty +kitten clipboard"
end;
'';
};
} }

View file

@ -1,8 +1,12 @@
{ {
pkgs, pkgs,
config, config,
lib,
... ...
}: { }: let
term = lib.getExe config.my.desktop.preferredApps.terminal.package;
termArg = config.my.desktop.preferredApps.terminal.execArg;
in {
home.packages = [pkgs.miniserve]; home.packages = [pkgs.miniserve];
home.file.".local/share/kio/servicemenus/miniserve.desktop" = { home.file.".local/share/kio/servicemenus/miniserve.desktop" = {
enable = true; enable = true;
@ -20,7 +24,7 @@
Name=Map Directory to Port 8080 Name=Map Directory to Port 8080
Name[CN]=(8080) Name[CN]=(8080)
Icon=network-server Icon=network-server
Exec=${config.currentUser.defaultTerminalRunner} -t "miniserve" -e miniserve "%f" --port 8080 Exec=${term} --title "miniserve" ${termArg} miniserve "%f" --port 8080
''; '';
}; };
} }

View file

@ -1,4 +1,26 @@
{...}: { {pkgs, ...}: let
dailyNote = pkgs.writeShellScriptBin "daily-note" ''
VAULT_DIR="$HOME/Obsidian/00 - Journal/Daily"
DATE_STR=$(date +%Y-%m-%d)
FILE_PATH="$VAULT_DIR/$DATE_STR.md"
if [ ! -d "$VAULT_DIR" ]; then
mkdir -p "$VAULT_DIR"
fi
if [ ! -f "$FILE_PATH" ]; then
echo "# $DATE_STR" > "$FILE_PATH"
echo "" >> "$FILE_PATH"
echo "## Highlights" >> "$FILE_PATH"
echo "" >> "$FILE_PATH"
echo "## Log" >> "$FILE_PATH"
echo "" >> "$FILE_PATH"
echo "- $(date +%H:%M) " >> "$FILE_PATH"
fi
nvim + "$FILE_PATH"
'';
in {
imports = [ imports = [
./vimrc-support.nix ./vimrc-support.nix
]; ];
@ -11,4 +33,18 @@
}; };
}; };
}; };
home.packages = [
dailyNote
];
programs = {
bash.shellAliases = {
dn = "daily-note";
};
zsh.shellAliases = {
dn = "daily-note";
};
fish.shellAbbrs = {
dn = "daily-note";
};
};
} }

View file

@ -1,58 +1,71 @@
{pkgs}: let {
pkgs,
lib,
config,
...
}: let
inherit (lib) optionalAttrs;
isDarwin = pkgs.stdenv.isDarwin;
isLinux = pkgs.stdenv.isLinux;
isHeadless = config.my.hardware.isHeadless;
commonAliases = { commonAliases = {
ni = "touch"; ni = "touch";
cls = "clear"; cls = "clear";
aic = "aichat -s"; aic = "aichat -s";
aicc = "aichat -c"; aicc = "aichat -c";
nrs = "sudo nixos-rebuild switch --flake ~/.dotfiles/nixcfgs"; py = "nix run 'nixpkgs#python3'";
clip = "wl-copy";
paste = "wl-paste";
py = "nix run 'nixpkgs#python314'"; # Python Interactive Shell
}; };
darwinAliases = { darwinAliases = {
reboot = "sudo reboot"; reboot = "sudo reboot";
clip = "pbcopy"; clip = "pbcopy";
paste = "pbpaste"; paste = "pbpaste";
ii = "open"; ii = "open";
brewi = "brew install"; brewi = "brew install";
brewr = "brew remove"; brewr = "brew remove";
brewu = "brew upgrade && brew update"; brewu = "brew upgrade && brew update";
brewc = "brew cleanup"; brewc = "brew cleanup";
brewl = "brew list"; brewl = "brew list";
}; };
linuxAliases = { linuxAliases = {
ii = "xdg-open"; ii = "xdg-open";
open = "xdg-open"; open = "xdg-open";
}; };
linuxGuiAliases = {
clip = "wl-copy";
paste = "wl-paste";
};
posixFx = '' posixFx = ''
mt() { mt() {
mkdir -p $(dirname $1) && touch $1 mkdir -p "$(dirname "$1")" && touch "$1"
} }
mtv() { mtv() {
mkdir -p $(dirname $1) && touch $1 && nvim $1 mkdir -p "$(dirname "$1")" && touch "$1" && $EDITOR "$1"
} }
''; '';
fishFx = '' fishFx = ''
function mt function mt
mkdir -p (dirname $argv[1]) && touch $argv[1] mkdir -p (dirname $argv[1]) && touch $argv[1]
end end
function mtv function mtv
mkdir -p (dirname $argv[1]) && touch $argv[1] && nvim $argv[1] mkdir -p (dirname $argv[1]) && touch $argv[1] && $EDITOR $argv[1]
end end
''; '';
in { in {
aliases = aliases =
commonAliases commonAliases
// ( // (optionalAttrs isDarwin darwinAliases)
if pkgs.stdenv.isLinux // (optionalAttrs isLinux (
then linuxAliases linuxAliases // (optionalAttrs (!isHeadless) linuxGuiAliases)
else {} ));
)
// (
if pkgs.stdenv.isDarwin
then darwinAliases
else {}
);
inherit posixFx fishFx; inherit posixFx fishFx;
} }

View file

@ -1,5 +1,10 @@
{pkgs, ...}: let {
aliasCfg = import ./aliases.nix {pkgs = pkgs;}; pkgs,
config,
lib,
...
}: let
aliasCfg = import ./aliases.nix {inherit pkgs config lib;};
in { in {
programs.bash = { programs.bash = {
enable = true; enable = true;

View file

@ -1,5 +1,10 @@
{pkgs, ...}: let {
aliasCfg = import ./aliases.nix {pkgs = pkgs;}; pkgs,
config,
lib,
...
}: let
aliasCfg = import ./aliases.nix {inherit pkgs config lib;};
in { in {
programs.fish = { programs.fish = {
enable = true; enable = true;
@ -42,7 +47,11 @@ in {
bind -M insert alt-delete kill-line bind -M insert alt-delete kill-line
''; '';
# preferAbbrs = true; # preferAbbrs = true;
shellAbbrs = aliasCfg.aliases; shellAbbrs =
aliasCfg.aliases
// {
l = "ls -lah";
};
}; };
programs.zed-editor.extensions = ["fish"]; programs.zed-editor.extensions = ["fish"];
} }

View file

@ -1,6 +1,4 @@
{pkgs, ...}: let {...}: {
aliases = import ./aliases.nix {pkgs = pkgs;};
in {
programs.nushell = { programs.nushell = {
enable = true; enable = true;
shellAliases = { shellAliases = {

View file

@ -1,9 +1,10 @@
{ {
config,
pkgs, pkgs,
config,
lib,
... ...
}: let }: let
aliasCfg = import ./aliases.nix {pkgs = pkgs;}; aliasCfg = import ./aliases.nix {inherit pkgs config lib;};
in { in {
home.packages = with pkgs; [ home.packages = with pkgs; [
zsh-fzf-tab zsh-fzf-tab

View file

@ -1,5 +1,14 @@
{pkgs, ...}: let {
pkgs,
config,
...
}: let
codeAlias = {"c" = "code";}; codeAlias = {"c" = "code";};
codeReleasesConfigDir = [
"Code"
"VSCodium"
"Antigravity"
];
in { in {
programs.vscode = { programs.vscode = {
package = pkgs.vscode; package = pkgs.vscode;
@ -17,6 +26,17 @@ in {
]; ];
}; };
# Remove default snippet dir before running this to avoid conflicts
xdg.configFile = builtins.listToAttrs (map (dir: {
name = "${dir}/User/snippets";
value = {
source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/lsp-snippets/snippets";
force = true;
# recursive = true;
};
})
codeReleasesConfigDir);
catppuccin.vscode.profiles.default.enable = false; catppuccin.vscode.profiles.default.enable = false;
programs.fish.shellAbbrs = codeAlias; programs.fish.shellAbbrs = codeAlias;
programs.bash.shellAliases = codeAlias; programs.bash.shellAliases = codeAlias;

View file

@ -1,4 +1,9 @@
{pkgs, ...}: { {
pkgs,
config,
...
}: {
xdg.configFile."zed/snippets".source = config.lib.file.mkOutOfStoreSymlink "${config.home.homeDirectory}/.config/lsp-snippets/snippets";
programs.zed-editor = { programs.zed-editor = {
enable = true; enable = true;
package = package =

View file

@ -1,5 +1,9 @@
# ~/.config/nixcfgs/users/js0ny/default.nix # ~/.config/nixcfgs/users/js0ny/default.nix
{...}: { {
pkgs,
config,
...
}: {
imports = [ imports = [
# General config # General config
./default.nix ./default.nix
@ -10,6 +14,7 @@
# Packages # Packages
./packages/cli.nix ./packages/cli.nix
./packages/gui.nix ./packages/gui.nix
./packages/devtools.nix
./packages/flatpak.nix ./packages/flatpak.nix
./packages/fonts.nix ./packages/fonts.nix
./packages/stylix.nix ./packages/stylix.nix
@ -83,10 +88,31 @@
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
currentHost = { my = {
keyboardBacklightDevice = "asus::kbd_backlight"; desktop = {
keyboardBacklightStep = "1"; preferredApps = {
shell = pkgs.zsh;
interactiveShell = pkgs.fish;
terminal = {
package = pkgs.kitty;
execArg = "-e";
};
fileManager = {
gui = pkgs.kdePackages.dolphin;
tui = pkgs.yazi;
};
};
};
hardware = {
keyboardBacklight = {
device = "asus::kbd_backlight";
step = "1";
};
isHeadless = false;
};
}; };
home.sessionVariables.TERMINAL = config.my.desktop.preferredApps.terminal.package;
home.stateVersion = "25.05"; home.stateVersion = "25.05";
} }