From 09caae2e4ea915f7886b14711144a3f6333c4d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sat, 2 Mar 2024 13:54:08 +0100 Subject: [PATCH 01/21] feat: add gleam formatting and snippets --- modules/programs/nvim/plugins/lua/conform.lua | 9 ++ .../programs/nvim/plugins/lua/nvim-cmp.lua | 4 +- .../programs/nvim/plugins/snippets/gleam.lua | 120 ++++++++++++++++++ 3 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 modules/programs/nvim/plugins/snippets/gleam.lua diff --git a/modules/programs/nvim/plugins/lua/conform.lua b/modules/programs/nvim/plugins/lua/conform.lua index a7156e7..2675177 100644 --- a/modules/programs/nvim/plugins/lua/conform.lua +++ b/modules/programs/nvim/plugins/lua/conform.lua @@ -11,10 +11,19 @@ local formatters_by_ft = { sh = { "shfmt" }, toml = { "taplo" }, yaml = { "yamlfix" }, + gleam = { "gleam" }, } conform.setup({ formatters_by_ft = formatters_by_ft, + formatters = { + gleam = { + command = "gleam", + args = { "format", "--stdin" }, + stdin = true, + cwd = require("conform.util").root_file({ "gleam.toml" }), + }, + }, }) vim.api.nvim_create_user_command("Format", function(opts) diff --git a/modules/programs/nvim/plugins/lua/nvim-cmp.lua b/modules/programs/nvim/plugins/lua/nvim-cmp.lua index 19d9ffe..04b3daa 100644 --- a/modules/programs/nvim/plugins/lua/nvim-cmp.lua +++ b/modules/programs/nvim/plugins/lua/nvim-cmp.lua @@ -28,7 +28,7 @@ cmp.setup({ [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item({ behavior = cmp.SelectBehavior.Select }) - elseif luasnip.jumpable(1) then + elseif luasnip.locally_jumpable(1) then luasnip.jump(1) else fallback() @@ -37,7 +37,7 @@ cmp.setup({ [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item({ behavior = cmp.SelectBehavior.Select }) - elseif luasnip.jumpable(-1) then + elseif luasnip.locally_jumpable(-1) then luasnip.jump(-1) else fallback() diff --git a/modules/programs/nvim/plugins/snippets/gleam.lua b/modules/programs/nvim/plugins/snippets/gleam.lua new file mode 100644 index 0000000..94835bb --- /dev/null +++ b/modules/programs/nvim/plugins/snippets/gleam.lua @@ -0,0 +1,120 @@ +local ls = require("luasnip") +local s = ls.snippet +local sn = ls.snippet_node +local isn = ls.indent_snippet_node +local t = ls.text_node +local i = ls.insert_node +local f = ls.function_node +local c = ls.choice_node +local d = ls.dynamic_node +local r = ls.restore_node +local events = require("luasnip.util.events") +local ai = require("luasnip.nodes.absolute_indexer") +local extras = require("luasnip.extras") +local l = extras.lambda +local rep = extras.rep +local p = extras.partial +local m = extras.match +local n = extras.nonempty +local dl = extras.dynamic_lambda +local fmt = require("luasnip.extras.fmt").fmt +local fmta = require("luasnip.extras.fmt").fmta +local conds = require("luasnip.extras.expand_conditions") +local postfix = require("luasnip.extras.postfix").postfix +local types = require("luasnip.util.types") +local parse = require("luasnip.util.parser").parse_snippet +local ms = ls.multi_snippet +local k = require("luasnip.nodes.key_indexer").new_key +local matches = require("luasnip.extras.postfix").matches + +local case_template = [[ +case {expression} {{ + {pattern1} -> {result1} + {pattern2} -> {result2}{final} +}} +]] + +local dot_case = postfix({ filetype = "gleam", trig = ".case", match_pattern = matches.line }, { + d(1, function(_, parent) + return sn( + 1, + fmt(case_template, { + expression = t(parent.env.POSTFIX_MATCH), + pattern1 = i(1, "pattern"), + result1 = i(2, "todo"), + pattern2 = i(3, "_"), + result2 = i(4, "todo"), + final = i(0), + }) + ) + end), +}) + +local case = s( + { filetype = "gleam", trig = "case" }, + fmt(case_template, { + expression = i(1), + pattern1 = i(2), + result1 = i(3, "todo"), + pattern2 = i(4, "_"), + result2 = i(5, "todo"), + final = i(0), + }) +) + +local fn_template = [[ +fn {name}({args}) -> {rtype} {{ + {body} +}} +]] + +local fn = s( + { filetype = "gleam", trig = "fn" }, + fmt(fn_template, { + name = i(1), + args = i(2), + rtype = i(3), + body = i(0), + }) +) + +local pfn = s( + { filetype = "gleam", trig = "pfn" }, + fmt("pub " .. fn_template, { + name = i(1), + args = i(2), + rtype = i(3), + body = i(0), + }) +) + +local type_template = [[ +type {name} {{ + {body} +}} +]] + +local type = s( + { filetype = "gleam", trig = "type" }, + fmt(type_template, { + name = i(1), + body = i(0), + }) +) + +local ptype = s( + { filetype = "gleam", trig = "ptype" }, + fmt("pub " .. type_template, { + name = i(1), + body = i(0), + }) +) + +return { + case, + dot_case, + fn, + pfn, + type, + ptype, +} From e714349fe1d75f6de6c7d7f7a7f58573e03d3021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 21 Mar 2024 17:19:06 +0100 Subject: [PATCH 02/21] feat: add river and foot modules --- flake.lock | 369 +++++++++++++++---------- flake.nix | 2 +- hosts/nixos-laptop/default.nix | 3 +- hosts/nixos-laptop/impermanence.nix | 75 ----- modules/config/theming/_catppuccin.nix | 20 ++ modules/profiles/base.nix | 2 +- modules/programs/foot.nix | 30 ++ modules/programs/hyprland/_config.nix | 5 +- modules/programs/hyprland/default.nix | 2 +- modules/programs/river/default.nix | 207 ++++++++++++++ 10 files changed, 485 insertions(+), 230 deletions(-) delete mode 100644 hosts/nixos-laptop/impermanence.nix create mode 100644 modules/programs/foot.nix create mode 100644 modules/programs/river/default.nix diff --git a/flake.lock b/flake.lock index 6f7948c..dbb6550 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "actions-preview-nvim": { "flake": false, "locked": { - "lastModified": 1704627848, - "narHash": "sha256-iXqs1+3z6ujm/6thDpbgoyWmUJ5Nd+D0zxAW4jc+T2c=", + "lastModified": 1710009411, + "narHash": "sha256-PIzXWOqmTeesPZg82iLkvLpJtOoDDljvwJq8wdvRtqQ=", "owner": "aznhe21", "repo": "actions-preview.nvim", - "rev": "dd63df1a4ed0ffe1458945ee50ecb1dd02b605ab", + "rev": "5072b1b1065a6b22bdd46b5c21780a91d6a08071", "type": "github" }, "original": { @@ -26,11 +26,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1703433843, - "narHash": "sha256-nmtA4KqFboWxxoOAA6Y1okHbZh+HsXaMPFkYHsoDRDw=", + "lastModified": 1707830867, + "narHash": "sha256-PAdwm5QqdlwIqGrfzzvzZubM+FXtilekQ/FA0cI49/o=", "owner": "ryantm", "repo": "agenix", - "rev": "417caa847f9383e111d1397039c9d4337d024bf0", + "rev": "8cb01a0e717311680e0cbca06a76cbceba6f3ed6", "type": "github" }, "original": { @@ -42,11 +42,11 @@ "arkenfox-userjs": { "flake": false, "locked": { - "lastModified": 1700833105, - "narHash": "sha256-8mxKaA0yGx29X+E0ahCjsGXSc29I1+5timNP6cJHGM0=", + "lastModified": 1707077370, + "narHash": "sha256-624Giuo1TfeXQGzcGK9ETW86esNFhFZ5a46DCjT6K5I=", "owner": "arkenfox", "repo": "user.js", - "rev": "4a510a4b4ceda8a177831a77309f2faccf7e18d5", + "rev": "33a84b608c8a1f871c6ce9c4d2b932dc57078fae", "type": "github" }, "original": { @@ -100,11 +100,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1705332421, - "narHash": "sha256-USpGLPme1IuqG78JNqSaRabilwkCyHmVWY0M9vYyqEA=", + "lastModified": 1710156081, + "narHash": "sha256-4PMY6aumJi5dLFjBzF5O4flKXmadMNq3AGUHKYfchh0=", "owner": "numtide", "repo": "devshell", - "rev": "83cb93d6d063ad290beee669f4badf9914cc16ec", + "rev": "bc68b058dc7e6d4d6befc4ec6c60082b6e844b7d", "type": "github" }, "original": { @@ -118,11 +118,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1706261939, - "narHash": "sha256-KQ3Hb3XVSrxOLfiY2D63QD5+LsLwFeY81ZScD4GRp0o=", + "lastModified": 1711006105, + "narHash": "sha256-pvjqjx4L2Hx/NP3RWcwLjk+ABtMODAJ9+rgreU6fP6I=", "owner": "nix-community", "repo": "disko", - "rev": "c12719812dde4dcbc4119a2b09766a51c9c498d5", + "rev": "a8c966ee117c278a5aabc6f00b00ef62eb7e28f6", "type": "github" }, "original": { @@ -184,11 +184,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1704982712, - "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "lastModified": 1709336216, + "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", "type": "github" }, "original": { @@ -205,11 +205,11 @@ ] }, "locked": { - "lastModified": 1704982712, - "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "lastModified": 1709336216, + "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", "type": "github" }, "original": { @@ -227,11 +227,11 @@ ] }, "locked": { - "lastModified": 1701473968, - "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", + "lastModified": 1709336216, + "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", + "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", "type": "github" }, "original": { @@ -262,11 +262,11 @@ "systems": "systems_3" }, "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -276,24 +276,6 @@ } }, "flake-utils_3": { - "inputs": { - "systems": "systems_5" - }, - "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { "inputs": { "systems": "systems_6" }, @@ -311,14 +293,32 @@ "type": "github" } }, + "flake-utils_4": { + "inputs": { + "systems": "systems_7" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "gen-nvim": { "flake": false, "locked": { - "lastModified": 1703233104, - "narHash": "sha256-cNz/yPTTgt1ng4C2BqN4P62FBV7lmDIEmEsdDhfyKHk=", + "lastModified": 1710408235, + "narHash": "sha256-aZ/ZMmatoIXnY3qtRjUqJStlpg0VGbJ1XdRjyDMhHqU=", "owner": "David-Kunz", "repo": "gen.nvim", - "rev": "41ad952c8269fa7aa3a4b8a5abb44541cb628313", + "rev": "2cb643b1a827bcdfc665a37d5f8174249d2d5bf5", "type": "github" }, "original": { @@ -335,11 +335,11 @@ ] }, "locked": { - "lastModified": 1703887061, - "narHash": "sha256-gGPa9qWNc6eCXT/+Z5/zMkyYOuRZqeFZBDbopNZQkuY=", + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", "owner": "hercules-ci", "repo": "gitignore.nix", - "rev": "43e1aa1308018f37118e34d3a9cb4f5e75dc11d5", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", "type": "github" }, "original": { @@ -373,11 +373,11 @@ ] }, "locked": { - "lastModified": 1704029560, - "narHash": "sha256-a4Iu7x1OP+uSYpqadOu8VCPY+MPF3+f6KIi+MAxlgyw=", + "lastModified": 1710478346, + "narHash": "sha256-Xjf8BdnQG0tLhPMlqQdwCIjOp7Teox0DP3N/jjyiGM4=", "owner": "hercules-ci", "repo": "hercules-ci-effects", - "rev": "d5cbf433a6ae9cae05400189a8dbc6412a03ba16", + "rev": "64e7763d72c1e4c1e5e6472640615b6ae2d40fbf", "type": "github" }, "original": { @@ -414,17 +414,16 @@ ] }, "locked": { - "lastModified": 1705392270, - "narHash": "sha256-Y11fcK0ETTpfBxJ58w9amqTKuJSQ+lSs6nIV8DoplKo=", + "lastModified": 1710974515, + "narHash": "sha256-jZpdsypecYTOO9l12Vy77otGmh9uz8tGzcguifA30Vs=", "owner": "nix-community", "repo": "home-manager", - "rev": "bf4b576f84e1ce54ec886836bae7695738aa5a6c", + "rev": "1c2acec99933f9835cc7ad47e35303de92d923a4", "type": "github" }, "original": { "owner": "nix-community", "repo": "home-manager", - "rev": "bf4b576f84e1ce54ec886836bae7695738aa5a6c", "type": "github" } }, @@ -433,11 +432,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1706198673, - "narHash": "sha256-bHlxFd+3QHy6eXtTzzhwVNcyxBSOxTvBuJGNUzI4C4M=", + "lastModified": 1710868143, + "narHash": "sha256-U5DLWla6nNiomFyCskYn6QfNCpVyQTeyG6FOAuEKHRg=", "owner": "hyprwm", "repo": "contrib", - "rev": "16884001b26e6955ff4b88b4dfe4c8986e20f153", + "rev": "4ee76323053bfae15cc05c294c7fda9997ca7fc3", "type": "github" }, "original": { @@ -446,20 +445,48 @@ "type": "github" } }, + "hyprcursor": { + "inputs": { + "hyprlang": "hyprlang", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1710257359, + "narHash": "sha256-43re5pzE/cswFAgw92/ugsB3+d5ufDaCcLtl9ztKfBo=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "1761f6cefd77f4fcd2039d930c88d6716ddc4974", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, "hyprland": { "inputs": { + "hyprcursor": "hyprcursor", "hyprland-protocols": "hyprland-protocols", + "hyprlang": "hyprlang_2", "nixpkgs": "nixpkgs_4", - "systems": "systems_4", + "systems": "systems_5", "wlroots": "wlroots", "xdph": "xdph" }, "locked": { - "lastModified": 1706271892, - "narHash": "sha256-ln+6hdNB1gW7+pz9d24zdCGpVKW0M1c/Xea/w+ZKqGk=", + "lastModified": 1711034304, + "narHash": "sha256-K0Rt2uwpJ/5aFPwB7BICuSvZRardNKGLlgG+2CBnDxQ=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "5cd7e4587e0ae642ce60415f8e271df2095a3ff2", + "rev": "a94b902bef5eef3a4891726d51415c5d2e3391e3", "type": "github" }, "original": { @@ -497,16 +524,42 @@ "inputs": { "nixpkgs": [ "hyprland", - "xdph", + "hyprcursor", "nixpkgs" + ], + "systems": "systems_4" + }, + "locked": { + "lastModified": 1709914708, + "narHash": "sha256-bR4o3mynoTa1Wi4ZTjbnsZ6iqVcPGriXp56bZh5UFTk=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "a685493fdbeec01ca8ccdf1f3655c044a8ce2fe2", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprlang_2": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" ] }, "locked": { - "lastModified": 1704287638, - "narHash": "sha256-TuRXJGwtK440AXQNl5eiqmQqY4LZ/9+z/R7xC0ie3iA=", + "lastModified": 1709914708, + "narHash": "sha256-bR4o3mynoTa1Wi4ZTjbnsZ6iqVcPGriXp56bZh5UFTk=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "6624f2bb66d4d27975766e81f77174adbe58ec97", + "rev": "a685493fdbeec01ca8ccdf1f3655c044a8ce2fe2", "type": "github" }, "original": { @@ -517,11 +570,11 @@ }, "impermanence": { "locked": { - "lastModified": 1703656108, - "narHash": "sha256-hCSUqdFJKHHbER8Cenf5JRzjMlBjIdwdftGQsO0xoJs=", + "lastModified": 1708968331, + "narHash": "sha256-VUXLaPusCBvwM3zhGbRIJVeYluh2uWuqtj4WirQ1L9Y=", "owner": "nix-community", "repo": "impermanence", - "rev": "033643a45a4a920660ef91caa391fbffb14da466", + "rev": "a33ef102a02ce77d3e39c25197664b7a636f9c30", "type": "github" }, "original": { @@ -564,11 +617,11 @@ }, "master": { "locked": { - "lastModified": 1706273017, - "narHash": "sha256-Jt5JdzUq8NysMrQL/OCXD7g+bJQbbZ9nK5hw0GZXQic=", + "lastModified": 1711034981, + "narHash": "sha256-Ug9/tGewXnV9Y6VFa1viuLfS5NoW+o+UXzZfGrpqMIU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e78f177a8a7a79d6c7e1fcfe509901e87658ec63", + "rev": "952804a3d25df456584e1c95b42a7196b35b2ebf", "type": "github" }, "original": { @@ -626,11 +679,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1706140641, - "narHash": "sha256-H1qHhkf7sF7yrG2rb9Ks1Y4EtLY3cXGp16KCGveJWY4=", + "lastModified": 1710978612, + "narHash": "sha256-I/dYjIzi+aCDHn6pWx5yVrifrOLbAeazFBMXrQlTRs8=", "owner": "neovim", "repo": "neovim", - "rev": "4e59422e1d4950a3042bad41a7b81c8db4f8b648", + "rev": "c1c6c1ee12fa601194a410f78ecde11a9982a793", "type": "github" }, "original": { @@ -649,11 +702,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1706141075, - "narHash": "sha256-o66/XFTXmcJSpEcO508V5r765HtgT8qtr+H4LRIB9BY=", + "lastModified": 1710979437, + "narHash": "sha256-xUawWDHG4x71YxTfsjkmQ2FMPpEKqFKno3IbuX6bbqE=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "1da2e054a16309d7d7f7669438c8b9a5ef1b4642", + "rev": "d6386bdcfda37b9c7dca0b7e4c29993541f87fa3", "type": "github" }, "original": { @@ -669,11 +722,11 @@ ] }, "locked": { - "lastModified": 1705806513, - "narHash": "sha256-FcOmNjhHFfPz2udZbRpZ1sfyhVMr+C2O8kOxPj+HDDk=", + "lastModified": 1710644923, + "narHash": "sha256-0fjbN5GYYDKPyPay0l8gYoH+tFfNqPPwP5sxxBreeA4=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "f8e04fbcebcc24cebc91989981bd45f69b963ed7", + "rev": "e25efda85e39fcdc845e371971ac4384989c4295", "type": "github" }, "original": { @@ -706,11 +759,11 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1701958654, - "narHash": "sha256-ZhXujNwvwTDLmCpYb7h2bTDdZG4h97hEYjzBmKP8p2U=", + "lastModified": 1708070219, + "narHash": "sha256-/2fidzoXrrNwr8te2cU3JdtrpockWIjU4DpLgNr4FTo=", "owner": "privatevoid-net", "repo": "nix-super", - "rev": "661b025c79eac08beda593ede47b41b2052e8ebf", + "rev": "924eb1127a21ebf4bd7f438d7c6aca133ce1de84", "type": "github" }, "original": { @@ -738,11 +791,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1703961334, - "narHash": "sha256-M1mV/Cq+pgjk0rt6VxoyyD+O8cOUiai8t9Q6Yyq4noY=", + "lastModified": 1709237383, + "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b0d36bd0a420ecee3bc916c91886caca87c894e9", + "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", "type": "github" }, "original": { @@ -771,11 +824,11 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1704874635, - "narHash": "sha256-YWuCrtsty5vVZvu+7BchAxmcYzTMfolSPP5io8+WYCg=", + "lastModified": 1710695816, + "narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "3dc440faeee9e889fe2d1b4d25ad0f430d449356", + "rev": "614b4613980a522ba49f0d194531beddbb7220d3", "type": "github" }, "original": { @@ -787,11 +840,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1706173671, - "narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=", + "lastModified": 1710889954, + "narHash": "sha256-Pr6F5Pmd7JnNEMHHmspZ0qVqIBVxyZ13ik1pJtm2QXk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "4fddc9be4eaf195d631333908f2a454b03628ee5", + "rev": "7872526e9c5332274ea5932a0c3270d6e4724f3b", "type": "github" }, "original": { @@ -819,11 +872,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1705133751, - "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=", + "lastModified": 1710272261, + "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d", + "rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2", "type": "github" }, "original": { @@ -835,11 +888,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1706006310, - "narHash": "sha256-nDPz0fj0IFcDhSTlXBU2aixcnGs2Jm4Zcuoj0QtmiXQ=", + "lastModified": 1710889954, + "narHash": "sha256-Pr6F5Pmd7JnNEMHHmspZ0qVqIBVxyZ13ik1pJtm2QXk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "b43bb235efeab5324c5e486882ef46749188eee2", + "rev": "7872526e9c5332274ea5932a0c3270d6e4724f3b", "type": "github" }, "original": { @@ -867,11 +920,11 @@ }, "nixpkgs_7": { "locked": { - "lastModified": 1706173671, - "narHash": "sha256-lciR7kQUK2FCAYuszyd7zyRRmTaXVeoZsCyK6QFpGdk=", + "lastModified": 1710889954, + "narHash": "sha256-Pr6F5Pmd7JnNEMHHmspZ0qVqIBVxyZ13ik1pJtm2QXk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4fddc9be4eaf195d631333908f2a454b03628ee5", + "rev": "7872526e9c5332274ea5932a0c3270d6e4724f3b", "type": "github" }, "original": { @@ -883,11 +936,11 @@ }, "nixpkgs_8": { "locked": { - "lastModified": 1704842529, - "narHash": "sha256-OTeQA+F8d/Evad33JMfuXC89VMetQbsU4qcaePchGr4=", + "lastModified": 1710765496, + "narHash": "sha256-p7ryWEeQfMwTB6E0wIUd5V2cFTgq+DRRBz2hYGnJZyA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "eabe8d3eface69f5bb16c18f8662a702f50c20d5", + "rev": "e367f7a1fb93137af22a3908f00b9a35e2d286a7", "type": "github" }, "original": { @@ -916,11 +969,11 @@ "none-ls-nvim": { "flake": false, "locked": { - "lastModified": 1706069423, - "narHash": "sha256-s+Hp0Yzge7FKKDez4DO8uytsNORIqeNWYOLSO7kSZbo=", + "lastModified": 1711021139, + "narHash": "sha256-FjDb53SNILxP9N9l5cJVBocj1ro/9eE8VKgR0Mv5+gs=", "owner": "nvimtools", "repo": "none-ls.nvim", - "rev": "a311c7cc8f17543143a7482cdbe3a384c371d56a", + "rev": "18910d09d21d7df339805343bfe4a2b2e41c057b", "type": "github" }, "original": { @@ -931,11 +984,11 @@ }, "nur": { "locked": { - "lastModified": 1706270864, - "narHash": "sha256-+OtaanZN6C4rS6bNujBban8fT4HsnozFZtXfPTLuaTI=", + "lastModified": 1711034660, + "narHash": "sha256-AURgOJFzS+k+Sj9Aif198WM5dDyLJ1GMLaa9ge1NETY=", "owner": "nix-community", "repo": "NUR", - "rev": "0293fc1d7aefc2204a922ad41bb5141f085a13ec", + "rev": "1f626d2e2e780e5ba0fe203a7e74f79b57f1af67", "type": "github" }, "original": { @@ -947,11 +1000,11 @@ "nvim-lspconfig": { "flake": false, "locked": { - "lastModified": 1705757419, - "narHash": "sha256-StYsN9C2rV471JkncUR1PFeXs0S15ZGTF1DigSbwOHI=", + "lastModified": 1710924139, + "narHash": "sha256-wW6vmaCLBpiLtk87UXzppIP2WRzG/gdtsIcPPCnwucM=", "owner": "neovim", "repo": "nvim-lspconfig", - "rev": "8917d2c830e04bf944a699b8c41f097621283828", + "rev": "d67715d3b746a19e951b6b0a99663fa909bb9e64", "type": "github" }, "original": { @@ -963,11 +1016,11 @@ "nvim-puppeteer": { "flake": false, "locked": { - "lastModified": 1706210708, - "narHash": "sha256-tjL4qC1VAad4NXaZFDhTcmbrbdqNpVm7/MnyR/CE3rw=", + "lastModified": 1710266483, + "narHash": "sha256-rRsLPeLaJNvOxzwGO+LOXW8FMhHpVkjuccTZdaK3O7c=", "owner": "chrisgrieser", "repo": "nvim-puppeteer", - "rev": "048c819c8033e5febe0a04e63b98e74a5d0f8de6", + "rev": "ea340595967919222f3ba5c6c6def0787a336c82", "type": "github" }, "original": { @@ -979,11 +1032,11 @@ "nvim-treesitter": { "flake": false, "locked": { - "lastModified": 1706272330, - "narHash": "sha256-R+oQGVcmncAd39D5AkGV1HAPgGDPMiucrC1GHMLh/Xk=", + "lastModified": 1711032686, + "narHash": "sha256-jkZ8NuCUjUqHmpr8v1g/dbPDBTO6WRWmEhEJHY9HZWM=", "owner": "nvim-treesitter", "repo": "nvim-treesitter", - "rev": "efda19a54a157da8635aa6cb84f56a10593b1a23", + "rev": "722617e6726c1508adadf83d531f54987c703be0", "type": "github" }, "original": { @@ -1001,11 +1054,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1705757126, - "narHash": "sha256-Eksr+n4Q8EYZKAN0Scef5JK4H6FcHc+TKNHb95CWm+c=", + "lastModified": 1710923068, + "narHash": "sha256-6hOpUiuxuwpXXc/xfJsBUJeqqgGI+JMJuLo45aG3cKc=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "f56597d53fd174f796b5a7d3ee0b494f9e2285cc", + "rev": "e611897ddfdde3ed3eaac4758635d7177ff78673", "type": "github" }, "original": { @@ -1053,11 +1106,11 @@ "smartcolumn-nvim": { "flake": false, "locked": { - "lastModified": 1703592909, - "narHash": "sha256-c5tENO4LJaSRELxuCOp/aI94ifhKjqd8J2chJbxfFdc=", + "lastModified": 1710067624, + "narHash": "sha256-DHIeDNUF9n9s14GVeojIwc5QUPwJMYYl3gRvhvO/rdE=", "owner": "m4xshen", "repo": "smartcolumn.nvim", - "rev": "a52915d6d9abf9972e249ebcffcc651cf9b062dd", + "rev": "cefb17be095ad5526030a21bb2a80553cae09127", "type": "github" }, "original": { @@ -1085,11 +1138,11 @@ "statuscol-nvim": { "flake": false, "locked": { - "lastModified": 1703372986, - "narHash": "sha256-uEKdzttNTQqwZb2oPgzTDuvJRkoTCmGg3piFzwKBITc=", + "lastModified": 1708023805, + "narHash": "sha256-I6Wefl83mcMURtJEq1yaR2thxVMfpJmjSplapeVyKYE=", "owner": "luukvbaal", "repo": "statuscol.nvim", - "rev": "0a782cc73f935e9f790ed029dc316b297545d845", + "rev": "e9e4c30b68abe456d80a0b144149ebf3f4527ed8", "type": "github" }, "original": { @@ -1161,16 +1214,16 @@ }, "systems_5": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, @@ -1204,14 +1257,29 @@ "type": "github" } }, + "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "telekasten-nvim": { "flake": false, "locked": { - "lastModified": 1702296926, - "narHash": "sha256-Y6LVli8fMLVVRtwrpZ2uIWDUogwUtFhTB6W2RZH5S8c=", + "lastModified": 1709039416, + "narHash": "sha256-fIXLxnPUMs8rXuEcsGIoz+UprtQlW9SB75dS6LKQGg4=", "owner": "renerocksai", "repo": "telekasten.nvim", - "rev": "8c2b3889eb31009ae510a43384d1957b37654176", + "rev": "a684d6ebe7026944b0a5323219d5f5364511e5b2", "type": "github" }, "original": { @@ -1242,7 +1310,7 @@ }, "utils": { "inputs": { - "systems": "systems_7" + "systems": "systems_8" }, "locked": { "lastModified": 1692799911, @@ -1262,18 +1330,18 @@ "flake": false, "locked": { "host": "gitlab.freedesktop.org", - "lastModified": 1703963193, - "narHash": "sha256-ke8drv6PTrdQDruWbajrRJffP9A9PU6FRyjJGNZRTs4=", + "lastModified": 1709983277, + "narHash": "sha256-wXWIJLd4F2JZeMaihWVDW/yYXCLEC8OpeNJZg9a9ly8=", "owner": "wlroots", "repo": "wlroots", - "rev": "f81c3d93cd6f61b20ae784297679283438def8df", + "rev": "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b", "type": "gitlab" }, "original": { "host": "gitlab.freedesktop.org", "owner": "wlroots", "repo": "wlroots", - "rev": "f81c3d93cd6f61b20ae784297679283438def8df", + "rev": "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b", "type": "gitlab" } }, @@ -1283,7 +1351,10 @@ "hyprland", "hyprland-protocols" ], - "hyprlang": "hyprlang", + "hyprlang": [ + "hyprland", + "hyprlang" + ], "nixpkgs": [ "hyprland", "nixpkgs" @@ -1294,11 +1365,11 @@ ] }, "locked": { - "lastModified": 1704659450, - "narHash": "sha256-3lyoUVtUWz1LuxbltAtkJSK2IlVXmKhxCRU2/0PYCms=", + "lastModified": 1709299639, + "narHash": "sha256-jYqJM5khksLIbqSxCLUUcqEgI+O2LdlSlcMEBs39CAU=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "6a5de92769d5b7038134044053f90e7458f6a197", + "rev": "2d2fb547178ec025da643db57d40a971507b82fe", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 0933a50..dd97e6a 100644 --- a/flake.nix +++ b/flake.nix @@ -10,7 +10,7 @@ flake-parts.url = "github:hercules-ci/flake-parts"; flake-utils.url = "github:numtide/flake-utils"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; - home-manager.url = "github:nix-community/home-manager/bf4b576f84e1ce54ec886836bae7695738aa5a6c"; # FIXME: + home-manager.url = "github:nix-community/home-manager"; impermanence.url = "github:nix-community/impermanence"; master.url = "github:nixos/nixpkgs"; nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 313b541..4a41c0b 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -20,7 +20,8 @@ webis.enable = true; impermanence.enable = true; }; - programs.hyprland.monitors = [ "HDMI-A-1,3840x2160,auto,1.2" ",preferred,auto,1" ]; + programs.hyprland.enable = false; + programs.river.enable = true; programs.exercism.enable = true; }; diff --git a/hosts/nixos-laptop/impermanence.nix b/hosts/nixos-laptop/impermanence.nix deleted file mode 100644 index 13bcc83..0000000 --- a/hosts/nixos-laptop/impermanence.nix +++ /dev/null @@ -1,75 +0,0 @@ -{ config, ... }: - -{ - age.secrets = { - root-password.file = ../../secrets/root-password.age; - moritz-password.file = ../../secrets/moritz-password.age; - }; - users.users = { - root.hashedPasswordFile = config.age.secrets.root-password.path; - moritz.hashedPasswordFile = config.age.secrets.moritz-password.path; - }; - users.mutableUsers = false; - environment.persistence."/persist" = { - hideMounts = true; - directories = [ - "/etc/NetworkManager/system-connections" - "/var/db/dhcpcd/" - "/var/lib/NetworkManager/" - "/var/lib/bluetooth" - "/var/lib/nixos" - "/var/lib/systemd/coredump" - "/var/log" - ]; - files = [ - "/etc/machine-id" - "/etc/nix/id_rsa" - "/etc/ssh/ssh_host_ed25519_key" - "/etc/ssh/ssh_host_ed25519_key.pub" - "/etc/ssh/ssh_host_rsa_key" - "/etc/ssh/ssh_host_rsa_key.pub" - ]; - users.moritz = { - directories = [ - ".SynologyDrive/data" - ".SynologyDrive/log" - ".cache/keepassxc" - ".cache/nvim/luac" - ".config/Nextcloud" - ".config/keepassxc" - ".local/share/direnv" - ".local/share/nvim" - ".local/share/zoxide" - ".local/share/JetBrains" - ".config/JetBrains" - ".local/state/nvim" - ".config/kdeconnect" - ".cat_installer" # eduroam - ".mozilla" - "Documents" - "Downloads" - "Music" - "Pictures" - "Videos" - { directory = ".gnupg"; mode = "0700"; } - { directory = ".local/share/keyrings"; mode = "0700"; } - { directory = ".ssh"; mode = "0700"; } - ]; - files = [ - ".local/share/fish/fish_history" - ".local/share/nix/trusted-settings.json" - ".parallel/will-cite" - ]; - }; - users.root = { - home = "/root"; - directories = [ - { directory = ".gnupg"; mode = "0700"; } - { directory = ".ssh"; mode = "0700"; } - ]; - files = [ - ".local/share/nix/trusted-settings.json" - ]; - }; - }; -} diff --git a/modules/config/theming/_catppuccin.nix b/modules/config/theming/_catppuccin.nix index 17c9118..f205c62 100644 --- a/modules/config/theming/_catppuccin.nix +++ b/modules/config/theming/_catppuccin.nix @@ -47,6 +47,26 @@ prompt = "#${mauve}"; spinner = "#${rosewater}"; }; + foot.settings.colors = { + foreground = text; # Text + background = base; # Base + regular0 = surface1; # Surface 1 + regular1 = red; # red + regular2 = green; # green + regular3 = yellow; # yellow + regular4 = blue; + regular5 = pink; + regular6 = teal; + regular7 = subtext1; + bright0 = surface2; + bright1 = red; + bright2 = green; + bright3 = yellow; + bright4 = blue; + bright5 = pink; + bright6 = teal; + bright7 = subtext0; + }; kitty.extraConfig = '' # vim:ft=kitty diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index ad8cbe4..17eebd1 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -77,7 +77,7 @@ in isNormalUser = true; home = "/home/moritz"; extraGroups = [ "wheel" "networkmanager" "video" ]; - initialPassword = "password"; # CHANGE ME PLEASE + # initialPassword = "password"; # CHANGE ME PLEASE openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGoAqa2m7hIzZ2LS96Z+RCIlRvhBM/j7h27tMBCwMT+a" # Moritz "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDhtwHDGAZshiQWKkCcPWV9tC83b+bKBgjDcjP/N2CKO" # Laptop diff --git a/modules/programs/foot.nix b/modules/programs/foot.nix new file mode 100644 index 0000000..6cd4000 --- /dev/null +++ b/modules/programs/foot.nix @@ -0,0 +1,30 @@ +{ config +, lib +, ... +}: + +with lib; +let + cfg = config.my.programs.foot; +in +{ + options.my.programs.foot.enable = mkEnableOption "foot"; + + config = mkIf cfg.enable { + home-manager.users.moritz = { + # HACK: to make foot server work + systemd.user.services.foot.Service.Environment = "PATH=/run/current-system/sw/bin/"; + programs.foot = { + enable = true; + server.enable = true; + settings = { + main = { + term = "xterm-256color"; + font = "FiraCode Nerd Font:size=8"; + dpi-aware = true; + }; + }; + }; + }; + }; +} diff --git a/modules/programs/hyprland/_config.nix b/modules/programs/hyprland/_config.nix index 4ea8616..6703ae9 100644 --- a/modules/programs/hyprland/_config.nix +++ b/modules/programs/hyprland/_config.nix @@ -154,8 +154,9 @@ in bind = $mainMod , D , exec , hyprctl keyword general:layout dwindle bind = $mainMod , M , exec , hyprctl keyword general:layout master bind = $mainMod , R , exec , rofi -show combi - bind = $mainMod , RETURN , exec , kitty - bind = $mainMod SHIFT , RETURN , exec , kitty -- tmux new "ts || tn home ~" + bind = $mainMod , RETURN , exec , footclient + bind = $mainMod SHIFT , RETURN , exec , foot + # bind = $mainMod SHIFT , RETURN , exec , kitty -- tmux new "ts || tn home ~" # XF86 keys binde = , XF86AudioLowerVolume , exec , pamixer -d 5 diff --git a/modules/programs/hyprland/default.nix b/modules/programs/hyprland/default.nix index 1593b71..3b917a7 100644 --- a/modules/programs/hyprland/default.nix +++ b/modules/programs/hyprland/default.nix @@ -48,7 +48,7 @@ in ]; programs = { wallpaper.enable = true; - kitty.enable = true; + foot.enable = true; rofi.enable = true; }; wallpapers.enable = true; diff --git a/modules/programs/river/default.nix b/modules/programs/river/default.nix new file mode 100644 index 0000000..0580b88 --- /dev/null +++ b/modules/programs/river/default.nix @@ -0,0 +1,207 @@ +{ config +, lib +, pkgs +, inputs +, ... +} @ args: + +with lib; +let + cfg = config.my.programs.river; +in +{ + options.my.programs.river = { + enable = mkEnableOption "river"; + keyboardLayouts = mkOption { + type = types.listOf types.str; + description = "list of keyboard layouts"; + default = [ "de" "us" ]; + }; + monitors = mkOption { + type = types.listOf types.str; + description = "monitor settings"; + default = [ ",preferred,auto,1" ]; + }; + }; + + config = mkIf cfg.enable { + programs.river.enable = true; + my = { + programs = { + wallpaper.enable = true; + foot.enable = true; + rofi.enable = true; + }; + wallpapers.enable = true; + services = { + dunst.enable = true; + wallpaper = { + enable = true; + # target = "hyprland-session.target"; + }; + # spotify-player.target = "hyprland-session.target"; + }; + }; + + home-manager.users.moritz = { + # enable home-manager module + wayland.windowManager.river = { + enable = true; + settings = { + border-width = 2; + declare-mode = [ + "locked" + "normal" + "passthrough" + ]; + map = { + normal = { + "Super Q" = "close"; + "Super Return" = "spawn footclient"; + "Super+Shift Return" = "spawn foot"; + }; + }; + }; + }; + + # add waybar as a status bar + programs.waybar = { + enable = true; + + # start using systemd service + systemd = { + enable = true; + # target = "hyprland-session.target"; + }; + + settings = { + mainBar = { + start_hidden = true; + layer = "top"; + position = "top"; + height = 20; + modules-left = [ "river/mode" ]; + modules-center = [ "river/window" ]; + modules-right = [ "network" "memory" "cpu" "battery" "clock" ]; + }; + }; + }; + + # lock screen after timeout + programs.swaylock = { + enable = true; + settings = { + color = "000000"; + }; + }; + services.swayidle = { + enable = true; + events = [ + { + event = "before-sleep"; + command = "${getExe pkgs.swaylock} -fF"; + } + { + event = "lock"; + command = "${getExe pkgs.swaylock} -fF"; + } + ]; + timeouts = + let + lockTimeout = 10; + in + [ + { + timeout = lockTimeout * 60 - 10; + command = "${pkgs.libnotify}/bin/notify-send 'Locking screen!'"; + } + { + timeout = lockTimeout * 60 + 10; + command = "${pkgs.systemd}/bin/loginctl lock-session"; + } + ]; + # systemdTarget = "hyprland-session.target"; + }; + }; + + # adds pam module for swaylock + security.pam.services.swaylock = { }; + + # add user packages for wayland and hyprland in particular + users.users.moritz.packages = with pkgs; [ + brightnessctl # control brightness + grimblast # screenshot tool for hyprland + pamixer # pulse audio cli + playerctl # control media playback + slurp # region select for wayland (for screensharing) + wdisplays # manage monitors + wl-clipboard # clipboard tool for wayland + ]; + + + # additional environment variables + # environment.sessionVariables = + # { + # XDG_CURRENT_DESKTOP = "Hyprland"; + # XDG_SESSION_TYPE = "wayland"; + # XDG_SESSION_DESKTOP = "Hyprland"; + # QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + # QT_QPA_PLATFORM = "wayland;xcb"; + # QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + # QT_QPA_PLATFORMTHEME = "qt5ct"; + # _JAVA_AWT_WM_NONEREPARENTING = "1"; + # } // (optionalAttrs cfg.nvidiaSupport + # { + # LIBVA_DRIVER_NAME = "nvidia"; + # GBM_BACKEND = "nvidia-drm"; + # __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + # WLR_NO_HARDWARE_CURSORS = "1"; + # __GL_VRR_ALLOWED = "0"; + # }); + + services = { + dbus.enable = true; + # use pipewire (needed for screensharing) + pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + }; + xserver = { + enable = true; + displayManager = { + lightdm.enable = true; + autoLogin = { + enable = true; + user = "moritz"; + }; + defaultSession = "river"; + }; + }; + }; + security.rtkit.enable = true; + + # home-manager.users.moritz.systemd.user.services = + # let + # units = [ "waybar" ]; + # mkAfter = _: { + # Unit = { + # After = [ "hyprland-session.target" ]; + # Wants = [ "hyprland-session.target" ]; + # }; + # }; + # in + # genAttrs units mkAfter; + # + # systemd.user.services = + # let + # units = [ "pipewire" "xdg-desktop-portal" "xdg-desktop-portal-hyprland" "wireplumber" ]; + # mkAfter = _: { + # after = [ "hyprland-session.target" ]; + # wants = [ "hyprland-session.target" ]; + # }; + # in + # genAttrs units mkAfter; + }; +} From 10f93893197f13d3351761179f860361ea95d853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 21 Mar 2024 18:46:06 +0100 Subject: [PATCH 03/21] feat: improve gi script --- modules/profiles/base.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index ad8cbe4..41279d7 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -44,7 +44,7 @@ let gi = pkgs.writeFishApplication { name = "gi"; - runtimeInputs = with pkgs; [ fzf gum curl ]; + runtimeInputs = with pkgs; [ fzf gum curl coreutils-full ]; text = /* fish */ '' set url https://www.gitignore.io/api @@ -57,10 +57,12 @@ let set choice (string join "," $argv[1..]) end + set contents "$(curl -sL $url/$choice | head -n -2 | tail -n +4)" + if gum confirm "Overwrite current .gitignore?" - curl -sL $url/$choice > .gitignore + echo "$contents" > .gitignore else - curl -sL $url/$choice >> .gitignore + echo "$contents" >> .gitignore end ''; completions = /* fish */ '' From 4ff3bfbf50d0f6548075ede2fad8dc67473f8609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Thu, 21 Mar 2024 18:47:46 +0100 Subject: [PATCH 04/21] feat: remove programs/services and add others --- hosts/nixos-desktop/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index e79fd11..003984f 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -19,6 +19,7 @@ gaming.enable = true; personal.enable = true; impermanence.enable = true; + webis.enable = true; }; programs.hyprland = { nvidiaSupport = true; @@ -26,9 +27,8 @@ extraConfig = "exec=hyprctl keyword monitor HDMI-A-1,3840x2160@120,auto,1.2"; keyboardLayouts = [ "us" "de" ]; }; + programs.exercism.enable = true; services.wallpaper.enable = true; - services.ollama.enable = true; - programs.ledger.enable = true; }; home-manager.users.moritz.home.packages = with pkgs; [ From 006c4394f39a3a35dae74051c034ae9d28ec58aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 24 Mar 2024 13:15:17 +0100 Subject: [PATCH 05/21] feat: add tofi module --- modules/config/theming/_catppuccin.nix | 6 ++++ modules/config/theming/default.nix | 14 ++++++++ modules/profiles/impermanence.nix | 1 + modules/programs/river/default.nix | 3 +- modules/programs/tofi.nix | 44 ++++++++++++++++++++++++++ 5 files changed, 67 insertions(+), 1 deletion(-) create mode 100644 modules/programs/tofi.nix diff --git a/modules/config/theming/_catppuccin.nix b/modules/config/theming/_catppuccin.nix index f205c62..6d69def 100644 --- a/modules/config/theming/_catppuccin.nix +++ b/modules/config/theming/_catppuccin.nix @@ -31,6 +31,12 @@ }: { + my.programs.tofi.settings = { + text-color = "#${text}"; + prompt-color = "#${red}"; + selection-color = "#${yellow}"; + background-color = "#${base}"; + }; home-manager.users.moritz = { programs = { fzf.colors = { diff --git a/modules/config/theming/default.nix b/modules/config/theming/default.nix index 31d8cb4..9101c51 100644 --- a/modules/config/theming/default.nix +++ b/modules/config/theming/default.nix @@ -31,6 +31,20 @@ in }; config = mkIf cfg.enable { + my.programs.tofi.settings = { + font-size = "20"; + font = + let + fontBasePath = pkgs.nerdfonts.override { + fonts = [ "FiraCode" ]; + }; + in + "${fontBasePath}/share/fonts/truetype/NerdFonts/FiraCodeNerdFont-Regular.ttf"; + height = "360"; + width = "720"; + outline-width = "0"; + border-width = "0"; + }; home-manager.users.moritz = { services.polybar = { config = { diff --git a/modules/profiles/impermanence.nix b/modules/profiles/impermanence.nix index 43b58ce..5e23faa 100644 --- a/modules/profiles/impermanence.nix +++ b/modules/profiles/impermanence.nix @@ -54,6 +54,7 @@ in ".local/share/nvim" ".local/share/zoxide" ".local/state/nvim" + ".local/state/tofi-history" ".mozilla" "Documents" "Downloads" diff --git a/modules/programs/river/default.nix b/modules/programs/river/default.nix index 0580b88..61016ed 100644 --- a/modules/programs/river/default.nix +++ b/modules/programs/river/default.nix @@ -30,7 +30,7 @@ in programs = { wallpaper.enable = true; foot.enable = true; - rofi.enable = true; + tofi.enable = true; }; wallpapers.enable = true; services = { @@ -59,6 +59,7 @@ in "Super Q" = "close"; "Super Return" = "spawn footclient"; "Super+Shift Return" = "spawn foot"; + "Super R" = ''spawn 'exec $(tofi-run --fuzzy-match=true)' ''; }; }; }; diff --git a/modules/programs/tofi.nix b/modules/programs/tofi.nix new file mode 100644 index 0000000..54913ca --- /dev/null +++ b/modules/programs/tofi.nix @@ -0,0 +1,44 @@ +{ config +, lib +, pkgs +, ... +}: + +with lib; +let + cfg = config.my.programs.tofi; + + configText = + let + settingsStrings = mapAttrsToList (name: value: "${name} = ${value}") cfg.settings; + in + concatLines settingsStrings; +in +{ + options.my.programs.tofi = { + enable = mkEnableOption "tofi"; + settings = mkOption { + type = with types; attrsOf str; + default = { }; + }; + }; + + config = mkIf cfg.enable { + environment.systemPackages = with pkgs; [ + (lib.mkIf config.networking.networkmanager.enable networkmanager_dmenu) + # (lib.mkIf config.hardware.bluetooth.enable rofi-bluetooth) + # rofi-power-menu + ]; + home-manager.users.moritz = { + home.packages = with pkgs; [ tofi ]; + xdg = { + enable = true; + configFile."tofi/config".text = configText; + configFile."networkmanager-dmenu/config.ini".text = '' + [dmenu] + dmenu_command = tofi + ''; + }; + }; + }; +} From c02b5c01e530f998565b34cbb4d3daa5dff8b3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 24 Mar 2024 13:16:27 +0100 Subject: [PATCH 06/21] feat: use git river version --- flake.lock | 19 +++++++++++++++++++ flake.nix | 4 ++++ modules/programs/river/default.nix | 16 ++++++++++++++++ 3 files changed, 39 insertions(+) diff --git a/flake.lock b/flake.lock index 2562b61..83e43d8 100644 --- a/flake.lock +++ b/flake.lock @@ -1071,6 +1071,24 @@ "type": "github" } }, + "river": { + "flake": false, + "locked": { + "lastModified": 1711107438, + "narHash": "sha256-4nvFniKdJX+ZsoliFmWSzIAtZefekBCxmGS9xonHQN8=", + "ref": "refs/heads/master", + "rev": "b77b42f0d640457411204bbae346df1d1a0c4f44", + "revCount": 1214, + "submodules": true, + "type": "git", + "url": "https://github.com/riverwm/river" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://github.com/riverwm/river" + } + }, "root": { "inputs": { "actions-preview-nvim": "actions-preview-nvim", @@ -1099,6 +1117,7 @@ "nur": "nur", "nvim-lspconfig": "nvim-lspconfig", "pre-commit-hooks": "pre-commit-hooks", + "river": "river", "smartcolumn-nvim": "smartcolumn-nvim", "stable": "stable", "statuscol-nvim": "statuscol-nvim", diff --git a/flake.nix b/flake.nix index b7909c3..37e227d 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,10 @@ hawtkeys-nvim.flake = false; hawtkeys-nvim.url = "github:tris203/hawtkeys.nvim"; + # river + river.url = "git+https://github.com/riverwm/river?submodules=1"; + river.flake = false; + # Hyprland hypr-contrib.url = "github:hyprwm/contrib"; hyprland.url = "github:hyprwm/Hyprland"; diff --git a/modules/programs/river/default.nix b/modules/programs/river/default.nix index 61016ed..b0edbdc 100644 --- a/modules/programs/river/default.nix +++ b/modules/programs/river/default.nix @@ -47,6 +47,22 @@ in # enable home-manager module wayland.windowManager.river = { enable = true; + package = pkgs.river.overrideAttrs (old: { + src = inputs.river; + version = lib.my.mkVersionInput inputs.river; + # HACK: to change wlroots to 0.17.x + buildInputs = with pkgs; [ + libGL + libevdev + libinput + libxkbcommon + pixman + udev + wayland-protocols + wlroots_0_17 + xorg.libX11 + ]; + }); settings = { border-width = 2; declare-mode = [ From 67a019f76b0f72edd02758430a7ac3786e6d56ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 24 Mar 2024 13:20:14 +0100 Subject: [PATCH 07/21] feat: improve foot settings --- modules/programs/foot.nix | 6 ++++-- modules/programs/river/default.nix | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/programs/foot.nix b/modules/programs/foot.nix index 6cd4000..5486b3f 100644 --- a/modules/programs/foot.nix +++ b/modules/programs/foot.nix @@ -20,8 +20,10 @@ in settings = { main = { term = "xterm-256color"; - font = "FiraCode Nerd Font:size=8"; - dpi-aware = true; + font = "FiraCode Nerd Font:size=10"; + }; + colors = { + alpha = 0.98; }; }; }; diff --git a/modules/programs/river/default.nix b/modules/programs/river/default.nix index b0edbdc..2bf4196 100644 --- a/modules/programs/river/default.nix +++ b/modules/programs/river/default.nix @@ -73,7 +73,7 @@ in map = { normal = { "Super Q" = "close"; - "Super Return" = "spawn footclient"; + "Super Return" = ''spawn "systemctl --user is-active --quiet foot && footclient --no-wait || foot"''; "Super+Shift Return" = "spawn foot"; "Super R" = ''spawn 'exec $(tofi-run --fuzzy-match=true)' ''; }; From e1a1c5060ff6e0a7e8a592bbaebe1867bde07ab4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 24 Mar 2024 13:21:10 +0100 Subject: [PATCH 08/21] feat(river): use correct targets --- modules/programs/river/default.nix | 50 +++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/modules/programs/river/default.nix b/modules/programs/river/default.nix index 2bf4196..334a1df 100644 --- a/modules/programs/river/default.nix +++ b/modules/programs/river/default.nix @@ -37,9 +37,9 @@ in dunst.enable = true; wallpaper = { enable = true; - # target = "hyprland-session.target"; + target = "river-session.target"; }; - # spotify-player.target = "hyprland-session.target"; + spotify-player.target = "river-session.target"; }; }; @@ -88,7 +88,7 @@ in # start using systemd service systemd = { enable = true; - # target = "hyprland-session.target"; + target = "river-session.target"; }; settings = { @@ -137,7 +137,7 @@ in command = "${pkgs.systemd}/bin/loginctl lock-session"; } ]; - # systemdTarget = "hyprland-session.target"; + systemdTarget = "river-session.target"; }; }; @@ -199,26 +199,26 @@ in }; security.rtkit.enable = true; - # home-manager.users.moritz.systemd.user.services = - # let - # units = [ "waybar" ]; - # mkAfter = _: { - # Unit = { - # After = [ "hyprland-session.target" ]; - # Wants = [ "hyprland-session.target" ]; - # }; - # }; - # in - # genAttrs units mkAfter; - # - # systemd.user.services = - # let - # units = [ "pipewire" "xdg-desktop-portal" "xdg-desktop-portal-hyprland" "wireplumber" ]; - # mkAfter = _: { - # after = [ "hyprland-session.target" ]; - # wants = [ "hyprland-session.target" ]; - # }; - # in - # genAttrs units mkAfter; + home-manager.users.moritz.systemd.user.services = + let + units = [ "waybar" ]; + mkAfter = _: { + Unit = { + After = [ "river-session.target" ]; + Wants = [ "river-session.target" ]; + }; + }; + in + genAttrs units mkAfter; + + systemd.user.services = + let + units = [ "pipewire" "xdg-desktop-portal" "wireplumber" ]; + mkAfter = _: { + after = [ "river-session.target" ]; + wants = [ "river-session.target" ]; + }; + in + genAttrs units mkAfter; }; } From 9acdfd5e4b684c98193b195b1d6a8a763376a241 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 24 Mar 2024 13:21:59 +0100 Subject: [PATCH 09/21] feat(river): add binds and polish a bit --- modules/programs/river/default.nix | 93 ++++++++++++++++++++++-------- 1 file changed, 68 insertions(+), 25 deletions(-) diff --git a/modules/programs/river/default.nix b/modules/programs/river/default.nix index 334a1df..9e1e29b 100644 --- a/modules/programs/river/default.nix +++ b/modules/programs/river/default.nix @@ -17,11 +17,7 @@ in description = "list of keyboard layouts"; default = [ "de" "us" ]; }; - monitors = mkOption { - type = types.listOf types.str; - description = "monitor settings"; - default = [ ",preferred,auto,1" ]; - }; + nvidiaSupport = mkEnableOption "nvidiaSupport"; }; config = mkIf cfg.enable { @@ -44,7 +40,13 @@ in }; home-manager.users.moritz = { - # enable home-manager module + home.packages = with pkgs; [ + rivercarro + ]; + services.kanshi = { + enable = true; + systemdTarget = "river-session.target"; + }; wayland.windowManager.river = { enable = true; package = pkgs.river.overrideAttrs (old: { @@ -76,9 +78,44 @@ in "Super Return" = ''spawn "systemctl --user is-active --quiet foot && footclient --no-wait || foot"''; "Super+Shift Return" = "spawn foot"; "Super R" = ''spawn 'exec $(tofi-run --fuzzy-match=true)' ''; + "Super W" = ''spawn "pkill -USR1 waybar"''; + "Super+Shift R" = "spawn ~/.config/river/init"; + + # Focus view + "Super J" = "focus-view next"; + "Super K" = "focus-view previous"; + + # swap the focused view + "Super+Shift J" = "swap next"; + "Super+Shift K" = "swap previous"; + + # focus output + "Super Period" = "focus-output next"; + "Super Comma" = "focus-output previous"; + + # send to output + "Super+Shift Period" = "send-to-output next"; + "Super+Shift Comma" = "send-to-output previous"; + + # bump in layout stack + "Super Z" = "zoom"; + }; + }; + map-pointer = { + normal = { + "Super BTN_LEFT" = "move-view"; + "Super BTN_RIGHT" = "resize-view"; + "Super BTN_MIDDLE" = "toggle-float"; }; }; }; + extraConfig = /* bash */ '' + riverctl default-layout rivercarro + rivercarro_pid="$(pidof rivercarro)" + if [[ -z $rivercarro_pid ]]; then + rivercarro -inner-gaps 4 -outer-gaps 4 + fi + ''; }; # add waybar as a status bar @@ -97,7 +134,7 @@ in layer = "top"; position = "top"; height = 20; - modules-left = [ "river/mode" ]; + modules-left = [ "river/tags" ]; modules-center = [ "river/window" ]; modules-right = [ "network" "memory" "cpu" "battery" "clock" ]; }; @@ -157,24 +194,30 @@ in # additional environment variables - # environment.sessionVariables = - # { - # XDG_CURRENT_DESKTOP = "Hyprland"; - # XDG_SESSION_TYPE = "wayland"; - # XDG_SESSION_DESKTOP = "Hyprland"; - # QT_AUTO_SCREEN_SCALE_FACTOR = "1"; - # QT_QPA_PLATFORM = "wayland;xcb"; - # QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; - # QT_QPA_PLATFORMTHEME = "qt5ct"; - # _JAVA_AWT_WM_NONEREPARENTING = "1"; - # } // (optionalAttrs cfg.nvidiaSupport - # { - # LIBVA_DRIVER_NAME = "nvidia"; - # GBM_BACKEND = "nvidia-drm"; - # __GLX_VENDOR_LIBRARY_NAME = "nvidia"; - # WLR_NO_HARDWARE_CURSORS = "1"; - # __GL_VRR_ALLOWED = "0"; - # }); + environment.sessionVariables = + { + XDG_CURRENT_DESKTOP = "river"; + XDG_SESSION_TYPE = "wayland"; + XDG_SESSION_DESKTOP = "river"; + QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + QT_QPA_PLATFORM = "wayland;xcb"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + QT_QPA_PLATFORMTHEME = "qt5ct"; + _JAVA_AWT_WM_NONEREPARENTING = "1"; + } // (optionalAttrs cfg.nvidiaSupport + { + GBM_BACKEND = "nvidia-drm"; + GDK_BACKEND = "wayland"; + LIBVA_DRIVER_NAME = "nvidia"; + MOZ_ENABLE_WAYLAND = "1"; + WLR_DRM_DEVICES = "/dev/dri/card0"; + WLR_DRM_NO_ATOMIC = "1"; + WLR_NO_HARDWARE_CURSORS = "1"; + XDG_CURRENT_DESKTOP = "river"; + _GL_GSYNC_ALLOWED = "0"; + __GLX_VENDOR_LIBRARY_NAME = "nvidia"; + __GL_VRR_ALLOWED = "0"; + }); services = { dbus.enable = true; From a2a624d53485b1e4187e6a336298110d8c6e3ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 24 Mar 2024 13:22:41 +0100 Subject: [PATCH 10/21] feat: use river --- hosts/nixos-desktop/default.nix | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index 003984f..fea09f7 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -21,16 +21,22 @@ impermanence.enable = true; webis.enable = true; }; - programs.hyprland = { + programs.river = { + enable = true; nvidiaSupport = true; - monitors = [ "HDMI-A-1,3840x2160,auto,1.2" ",preferred,auto,1" ]; - extraConfig = "exec=hyprctl keyword monitor HDMI-A-1,3840x2160@120,auto,1.2"; - keyboardLayouts = [ "us" "de" ]; }; + programs.hyprland.enable = false; programs.exercism.enable = true; services.wallpaper.enable = true; }; + home-manager.users.moritz.services.kanshi.profiles = { + default = { + outputs = [ + { criteria = "HDMI-A-1"; mode = "3840x2160@60"; scale = 1.2; } + ]; + }; + }; home-manager.users.moritz.home.packages = with pkgs; [ anki calibre From 6a1b81565ab777716a287d1a00f4de7ba5101e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 24 Mar 2024 13:22:53 +0100 Subject: [PATCH 11/21] fix: typo --- modules/config/theming/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/config/theming/default.nix b/modules/config/theming/default.nix index 9101c51..9704874 100644 --- a/modules/config/theming/default.nix +++ b/modules/config/theming/default.nix @@ -53,7 +53,7 @@ in monitor = "\${env:MONITOR}"; bottom = true; width = "100%"; - heigth = 15; + height = 15; border-size = 2; From b09d30959b18f7af0d0f764b3e07bfaac34a43ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 21 Apr 2024 10:57:01 +0200 Subject: [PATCH 12/21] feat: switch back to hyprland --- hosts/nixos-desktop/default.nix | 11 ++++++----- modules/programs/hyprland/_config.nix | 6 ++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index fea09f7..c3f010a 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -21,11 +21,12 @@ impermanence.enable = true; webis.enable = true; }; - programs.river = { - enable = true; - nvidiaSupport = true; - }; - programs.hyprland.enable = false; + # programs.river = { + # enable = true; + # nvidiaSupport = true; + # }; + programs.hyprland.enable = true; + programs.hyprland.nvidiaSupport = true; programs.exercism.enable = true; services.wallpaper.enable = true; }; diff --git a/modules/programs/hyprland/_config.nix b/modules/programs/hyprland/_config.nix index 6703ae9..651a896 100644 --- a/modules/programs/hyprland/_config.nix +++ b/modules/programs/hyprland/_config.nix @@ -119,7 +119,7 @@ in # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # Firefox Sharing Indicator - ${mkRules ["float" "move 49% 40" "noborder" "nofullscreenrequest"] ["title:^(.*Sharing Indicator.*)$"]} + ${mkRules ["float" "move 49% 40" "noborder"] ["title:^(.*Sharing Indicator.*)$"]} # Emacs windowrulev2 = opaque, class:^(emacs)$ @@ -154,9 +154,7 @@ in bind = $mainMod , D , exec , hyprctl keyword general:layout dwindle bind = $mainMod , M , exec , hyprctl keyword general:layout master bind = $mainMod , R , exec , rofi -show combi - bind = $mainMod , RETURN , exec , footclient - bind = $mainMod SHIFT , RETURN , exec , foot - # bind = $mainMod SHIFT , RETURN , exec , kitty -- tmux new "ts || tn home ~" + bind = $mainMod , RETURN , exec , systemctl --user is-active --quiet foot && footclient --no-wait || foot # XF86 keys binde = , XF86AudioLowerVolume , exec , pamixer -d 5 From 54e55f4b6d1e8094b221a6221e892b0351bc9406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 21 Apr 2024 11:21:46 +0200 Subject: [PATCH 13/21] feat: cleanup --- modules/programs/nvim/plugins/coding.nix | 104 ++---------------- .../programs/nvim/plugins/lua/mini-nvim.lua | 46 -------- modules/programs/nvim/plugins/treesitter.nix | 10 -- modules/programs/nvim/plugins/ui.nix | 20 ---- 4 files changed, 7 insertions(+), 173 deletions(-) diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index 8f43ca2..7f40237 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -7,65 +7,18 @@ with builtins; plugin = oil-nvim; lazy = false; opts = { }; - dependencies = [ - { plugin = which-key-nvim; } - { plugin = nvim-web-devicons; } - ]; + dependencies = [{ plugin = nvim-web-devicons; }]; + } + { + plugin = lualine-nvim; + opts = { }; + dependencies = [{ plugin = nvim-web-devicons; }]; } { plugin = mini-nvim; lazy = false; conf = readFile ./lua/mini-nvim.lua; } - { - plugin = trouble-nvim; - cmd = [ "TodoTelescope" ]; - keys = [ - { - key = "cD"; - cmd = "TroubleToggle document_diagnostics"; - desc = "Document Diagnostics (Trouble)"; - } - { - key = "cW"; - cmd = "TroubleToggle workspace_diagnostics"; - desc = "Workspace Diagnostics (Trouble)"; - } - { key = "cl"; cmd = "TroubleToggle loclist"; desc = "Location List (Trouble)"; } - { key = "cq"; cmd = "TroubleToggle quickfix"; desc = "Quickfix List (Trouble)"; } - { key = "ft"; cmd = "TodoTelescope"; desc = "Todo"; } - { - key = "[q"; - func = /* lua */ '' - function() - if require("trouble").is_open() then - require("trouble").previous({ skip_groups = true, jump = true }) - else - vim.cmd.cprev() - end - end - ''; - desc = "Previous trouble/quickfix item"; - } - { - key = "]q"; - func = /* lua */ '' - function() - if require("trouble").is_open() then - require("trouble").next({ skip_groups = true, jump = true }) - else - vim.cmd.cnext() - end - end - ''; - desc = "Next trouble/quickfix item"; - } - ]; - opts = { }; - dependencies = [ - { plugin = nvim-web-devicons; } - ]; - } { plugin = nvim-cmp; keys = [ @@ -106,6 +59,7 @@ with builtins; conf = readFile ./lua/nvim-lspconfig.lua; dependencies = [ { + # TODO: add all required tools to neovim or silence warnings plugin = pkgs.vimPlugins.null-ls-nvim.overrideAttrs (_: { version = lib.my.mkVersionInput inputs.none-ls-nvim; src = inputs.none-ls-nvim; @@ -118,17 +72,6 @@ with builtins; } { plugin = which-key-nvim; } { plugin = lsp_lines-nvim; } - { - plugin = nvim-ufo; - conf = readFile ./lua/nvim-ufo.lua; - dependencies = [ - { plugin = promise-async; } - ]; - } - { - plugin = neodev-nvim; - conf = readFile ./lua/neodev-nvim.lua; - } { plugin = inc-rename-nvim; opts = { @@ -236,39 +179,6 @@ with builtins; event = [ "BufReadPost" "BufNewFile" ]; opts = { }; } - { - plugin = zen-mode-nvim; - keys = [ - { key = "tz"; cmd = "ZenMode"; desc = "Zen mode"; } - ]; - conf = /* lua */ '' - require("zen-mode").setup({ - plugins = { - tmux = { - enabled = true, - }, - }, - }) - ''; - dependencies = [ - { - plugin = twilight-nvim; - conf = /* lua */ '' - require("twilight").setup({ - context = 20, - expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types - "function", - "function_definition", - "if_statement", - "method", - "method_definition", - "table", - }, - }) - ''; - } - ]; - } { plugin = conform-nvim; keys = [ diff --git a/modules/programs/nvim/plugins/lua/mini-nvim.lua b/modules/programs/nvim/plugins/lua/mini-nvim.lua index 2a33821..9cbe157 100644 --- a/modules/programs/nvim/plugins/lua/mini-nvim.lua +++ b/modules/programs/nvim/plugins/lua/mini-nvim.lua @@ -1,47 +1 @@ require("mini.align").setup() -require("mini.move").setup() - -require("mini.statusline").setup({ - content = { - active = function() - local mode, mode_hl = MiniStatusline.section_mode({ trunc_width = 120 }) - local git = MiniStatusline.section_git({ trunc_width = 75 }) - local diagnostics = MiniStatusline.section_diagnostics({ trunc_width = 75 }) - local filename = MiniStatusline.section_filename({ trunc_width = 140 }) - local fileinfo = MiniStatusline.section_fileinfo({ trunc_width = 120 }) - local location = MiniStatusline.section_location({ trunc_width = 75 }) - local mode_hl_inverse = mode_hl .. "Inverse" - -- Usage of `MiniStatusline.combine_groups()` ensures highlighting and - -- correct padding with spaces between groups (accounts for 'missing' - -- sections, etc.) - return MiniStatusline.combine_groups({ - { hl = mode_hl_inverse, strings = {} }, - "", - { hl = mode_hl, strings = { mode } }, - { hl = "MiniStatuslineDevinfo", strings = { git, diagnostics } }, - "%<", -- Mark general truncate point - { hl = "MiniStatuslineFilename", strings = { filename } }, - "%=", -- End left alignment - { hl = "MiniStatuslineFileinfo", strings = { fileinfo } }, - { hl = mode_hl, strings = { location } }, - { hl = mode_hl_inverse, strings = {} }, - "", - }) - end, - }, -}) -local MiniStatuslineModes = { - "MiniStatuslineModeInsert", - "MiniStatuslineModeNormal", - "MiniStatuslineModeReplace", - "MiniStatuslineModeVisual", - "MiniStatuslineModeCommand", - "MiniStatuslineModeOther", -} -for _, mode_hl in ipairs(MiniStatuslineModes) do - local hl_table = vim.api.nvim_get_hl(0, { name = mode_hl }) - local fg = hl_table.fg - hl_table.fg = hl_table.bg - hl_table.bg = fg - vim.api.nvim_set_hl(0, mode_hl .. "Inverse", hl_table) -end diff --git a/modules/programs/nvim/plugins/treesitter.nix b/modules/programs/nvim/plugins/treesitter.nix index 8401f9f..2ba777c 100644 --- a/modules/programs/nvim/plugins/treesitter.nix +++ b/modules/programs/nvim/plugins/treesitter.nix @@ -65,15 +65,5 @@ with builtins; ]; } ) - { - plugin = nvim-treesitter-textsubjects; - event = [ "BufReadPost" "BufNewFile" ]; - conf = readFile ./lua/nvim-treesitter-textsubjects.lua; - } - { - plugin = nvim-treesitter-context; - event = [ "BufReadPost" "BufNewFile" ]; - opts = { }; - } ]; } diff --git a/modules/programs/nvim/plugins/ui.nix b/modules/programs/nvim/plugins/ui.nix index c44ce9b..ccfcb3b 100644 --- a/modules/programs/nvim/plugins/ui.nix +++ b/modules/programs/nvim/plugins/ui.nix @@ -20,26 +20,6 @@ with builtins; dependencies = [{ plugin = plenary-nvim; }]; opts = { }; } - { - plugin = pkgs.vimPlugins.statuscol-nvim.overrideAttrs (_: { - version = lib.my.mkVersionInput inputs.statuscol-nvim; - src = inputs.statuscol-nvim; - }); - event = [ "VeryLazy" ]; - conf = readFile ./lua/statuscol-nvim.lua; - } - { - plugin = pkgs.vimUtils.buildVimPlugin { - pname = "smartcolumn-nvim"; - version = lib.my.mkVersionInput inputs.smartcolumn-nvim; - src = inputs.smartcolumn-nvim; - }; - event = [ "BufReadPost" "BufNewFile" ]; - opts = { - colorcolumn = "120"; - disabled_filetypes = [ "help" "text" "markdown" "dashboard" ]; - }; - } { plugin = dressing-nvim; event = [ "VeryLazy" ]; From 2f4f58a68c647b8afe1b28934d985066af8b8ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 21 Apr 2024 11:54:00 +0200 Subject: [PATCH 14/21] feat: update inputs --- flake.lock | 294 +++++++++++++++----------------- hosts/nixos-desktop/default.nix | 2 +- modules/programs/foot.nix | 2 +- 3 files changed, 135 insertions(+), 163 deletions(-) diff --git a/flake.lock b/flake.lock index 83e43d8..939c222 100644 --- a/flake.lock +++ b/flake.lock @@ -26,11 +26,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1707830867, - "narHash": "sha256-PAdwm5QqdlwIqGrfzzvzZubM+FXtilekQ/FA0cI49/o=", + "lastModified": 1712079060, + "narHash": "sha256-/JdiT9t+zzjChc5qQiF+jhrVhRt8figYH29rZO7pFe4=", "owner": "ryantm", "repo": "agenix", - "rev": "8cb01a0e717311680e0cbca06a76cbceba6f3ed6", + "rev": "1381a759b205dff7a6818733118d02253340fd5e", "type": "github" }, "original": { @@ -100,11 +100,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1710156081, - "narHash": "sha256-4PMY6aumJi5dLFjBzF5O4flKXmadMNq3AGUHKYfchh0=", + "lastModified": 1713532798, + "narHash": "sha256-wtBhsdMJA3Wa32Wtm1eeo84GejtI43pMrFrmwLXrsEc=", "owner": "numtide", "repo": "devshell", - "rev": "bc68b058dc7e6d4d6befc4ec6c60082b6e844b7d", + "rev": "12e914740a25ea1891ec619bb53cf5e6ca922e40", "type": "github" }, "original": { @@ -118,11 +118,11 @@ "nixpkgs": "nixpkgs_2" }, "locked": { - "lastModified": 1711006105, - "narHash": "sha256-pvjqjx4L2Hx/NP3RWcwLjk+ABtMODAJ9+rgreU6fP6I=", + "lastModified": 1713406758, + "narHash": "sha256-kwZvhmx+hSZvjzemKxsAqzEqWmXZS47VVwQhNrINORQ=", "owner": "nix-community", "repo": "disko", - "rev": "a8c966ee117c278a5aabc6f00b00ef62eb7e28f6", + "rev": "1efd500e9805a9efbce401ed5999006d397b9f11", "type": "github" }, "original": { @@ -184,11 +184,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1709336216, - "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", "type": "github" }, "original": { @@ -205,11 +205,11 @@ ] }, "locked": { - "lastModified": 1709336216, - "narHash": "sha256-Dt/wOWeW6Sqm11Yh+2+t0dfEWxoMxGBvv3JpIocFl9E=", + "lastModified": 1712014858, + "narHash": "sha256-sB4SWl2lX95bExY2gMFG5HIzvva5AVMJd4Igm+GpZNw=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "f7b3c975cf067e56e7cda6cb098ebe3fb4d74ca2", + "rev": "9126214d0a59633752a136528f5f3b9aa8565b7d", "type": "github" }, "original": { @@ -277,14 +277,14 @@ }, "flake-utils_3": { "inputs": { - "systems": "systems_6" + "systems": "systems_5" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -295,7 +295,7 @@ }, "flake-utils_4": { "inputs": { - "systems": "systems_7" + "systems": "systems_6" }, "locked": { "lastModified": 1710146030, @@ -314,11 +314,11 @@ "gen-nvim": { "flake": false, "locked": { - "lastModified": 1710408235, - "narHash": "sha256-aZ/ZMmatoIXnY3qtRjUqJStlpg0VGbJ1XdRjyDMhHqU=", + "lastModified": 1712049871, + "narHash": "sha256-Bt7yJxToUnPv3JqBwWQeywIbVRqzHBqnu3NUaIxFx/M=", "owner": "David-Kunz", "repo": "gen.nvim", - "rev": "2cb643b1a827bcdfc665a37d5f8174249d2d5bf5", + "rev": "87fbe811155b90eea58622614809705b966009ad", "type": "github" }, "original": { @@ -351,11 +351,11 @@ "hawtkeys-nvim": { "flake": false, "locked": { - "lastModified": 1706046129, - "narHash": "sha256-mbMmepQ6TXdsqQ1X8mybvcasPRCHGYMQ+6N3IXP75sM=", + "lastModified": 1711836933, + "narHash": "sha256-wxxnQvIMHUbDOAbBAswueULavoIoIDHdJK7T09IHD8E=", "owner": "tris203", "repo": "hawtkeys.nvim", - "rev": "a6ca6e4a4d07386a7ab327646c1dbf5155f09c44", + "rev": "aeba04a4ccded2aa8c8fb5d74a3bea05a8f89dab", "type": "github" }, "original": { @@ -414,11 +414,11 @@ ] }, "locked": { - "lastModified": 1710974515, - "narHash": "sha256-jZpdsypecYTOO9l12Vy77otGmh9uz8tGzcguifA30Vs=", + "lastModified": 1713682182, + "narHash": "sha256-2RSqVmQMFmn6OjQ21SXnWC+HuSeqDLWLftRv/ZhEDZE=", "owner": "nix-community", "repo": "home-manager", - "rev": "1c2acec99933f9835cc7ad47e35303de92d923a4", + "rev": "4cec20dbf5c0a716115745ae32531e34816ecbbe", "type": "github" }, "original": { @@ -432,11 +432,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1710868143, - "narHash": "sha256-U5DLWla6nNiomFyCskYn6QfNCpVyQTeyG6FOAuEKHRg=", + "lastModified": 1712505318, + "narHash": "sha256-fzlBLhXUN6y7mzEtcGNRDXxFakBEfaj4Bmj5PuoCNaM=", "owner": "hyprwm", "repo": "contrib", - "rev": "4ee76323053bfae15cc05c294c7fda9997ca7fc3", + "rev": "5870244b592c22558b658dbaf94f9e41afb0316f", "type": "github" }, "original": { @@ -447,7 +447,10 @@ }, "hyprcursor": { "inputs": { - "hyprlang": "hyprlang", + "hyprlang": [ + "hyprland", + "hyprlang" + ], "nixpkgs": [ "hyprland", "nixpkgs" @@ -458,11 +461,11 @@ ] }, "locked": { - "lastModified": 1710257359, - "narHash": "sha256-43re5pzE/cswFAgw92/ugsB3+d5ufDaCcLtl9ztKfBo=", + "lastModified": 1713612213, + "narHash": "sha256-zJboXgWNpNhKyNF8H/3UYzWkx7w00TOCGKi3cwi+tsw=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "1761f6cefd77f4fcd2039d930c88d6716ddc4974", + "rev": "cab4746180f210a3c1dd3d53e45c510e309e90e1", "type": "github" }, "original": { @@ -475,18 +478,19 @@ "inputs": { "hyprcursor": "hyprcursor", "hyprland-protocols": "hyprland-protocols", - "hyprlang": "hyprlang_2", + "hyprlang": "hyprlang", + "hyprwayland-scanner": "hyprwayland-scanner", "nixpkgs": "nixpkgs_4", - "systems": "systems_5", + "systems": "systems_4", "wlroots": "wlroots", "xdph": "xdph" }, "locked": { - "lastModified": 1711034304, - "narHash": "sha256-K0Rt2uwpJ/5aFPwB7BICuSvZRardNKGLlgG+2CBnDxQ=", + "lastModified": 1713660608, + "narHash": "sha256-Wy9I4K1vuWtOv/UEpKmpDb6O8YaAY3GcC3pZu70DWMY=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "a94b902bef5eef3a4891726d51415c5d2e3391e3", + "rev": "7c3bd4c19fe47f2d92463b81d9b38651b7a1a268", "type": "github" }, "original": { @@ -524,17 +528,19 @@ "inputs": { "nixpkgs": [ "hyprland", - "hyprcursor", "nixpkgs" ], - "systems": "systems_4" + "systems": [ + "hyprland", + "systems" + ] }, "locked": { - "lastModified": 1709914708, - "narHash": "sha256-bR4o3mynoTa1Wi4ZTjbnsZ6iqVcPGriXp56bZh5UFTk=", + "lastModified": 1713121246, + "narHash": "sha256-502X0Q0fhN6tJK7iEUA8CghONKSatW/Mqj4Wappd++0=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "a685493fdbeec01ca8ccdf1f3655c044a8ce2fe2", + "rev": "78fcaa27ae9e1d782faa3ff06c8ea55ddce63706", "type": "github" }, "original": { @@ -543,7 +549,7 @@ "type": "github" } }, - "hyprlang_2": { + "hyprwayland-scanner": { "inputs": { "nixpkgs": [ "hyprland", @@ -555,16 +561,16 @@ ] }, "locked": { - "lastModified": 1709914708, - "narHash": "sha256-bR4o3mynoTa1Wi4ZTjbnsZ6iqVcPGriXp56bZh5UFTk=", + "lastModified": 1713619586, + "narHash": "sha256-fIhNlYhPhG5AJ8DxX3LaitnccnQ+X2MCL39W2Abp7mM=", "owner": "hyprwm", - "repo": "hyprlang", - "rev": "a685493fdbeec01ca8ccdf1f3655c044a8ce2fe2", + "repo": "hyprwayland-scanner", + "rev": "9e13e0915273959bfd98a10662f678c15ac71c77", "type": "github" }, "original": { "owner": "hyprwm", - "repo": "hyprlang", + "repo": "hyprwayland-scanner", "type": "github" } }, @@ -599,29 +605,13 @@ "type": "github" } }, - "lowdown-src": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, "master": { "locked": { - "lastModified": 1711034981, - "narHash": "sha256-Ug9/tGewXnV9Y6VFa1viuLfS5NoW+o+UXzZfGrpqMIU=", + "lastModified": 1713689773, + "narHash": "sha256-4M4c9n6sYbT7Sd/RvB9pej+7BoP7X1lNrFiboNV4O7I=", "owner": "nixos", "repo": "nixpkgs", - "rev": "952804a3d25df456584e1c95b42a7196b35b2ebf", + "rev": "a8a8401b7b26112a9b75d6c00306e160fe8f8cb3", "type": "github" }, "original": { @@ -679,11 +669,11 @@ }, "locked": { "dir": "contrib", - "lastModified": 1710978612, - "narHash": "sha256-I/dYjIzi+aCDHn6pWx5yVrifrOLbAeazFBMXrQlTRs8=", + "lastModified": 1713650988, + "narHash": "sha256-YAbwiZkKxpbM+fdTVcXmp49XtHMDYQNng/wc9L85eZs=", "owner": "neovim", "repo": "neovim", - "rev": "c1c6c1ee12fa601194a410f78ecde11a9982a793", + "rev": "9e1bbb9813e0ea4e37f6325fe00e8f43617ef912", "type": "github" }, "original": { @@ -702,11 +692,11 @@ "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1710979437, - "narHash": "sha256-xUawWDHG4x71YxTfsjkmQ2FMPpEKqFKno3IbuX6bbqE=", + "lastModified": 1713657840, + "narHash": "sha256-O99sOWro/5J4qWyIFZ3vEw+abLnzOv4jrfA7FaRoyrI=", "owner": "nix-community", "repo": "neovim-nightly-overlay", - "rev": "d6386bdcfda37b9c7dca0b7e4c29993541f87fa3", + "rev": "3ad9c1eae733e9ba5cc73c6833e3d62dbc12df9e", "type": "github" }, "original": { @@ -737,11 +727,11 @@ ] }, "locked": { - "lastModified": 1710644923, - "narHash": "sha256-0fjbN5GYYDKPyPay0l8gYoH+tFfNqPPwP5sxxBreeA4=", + "lastModified": 1713668931, + "narHash": "sha256-rVlwWQlgFGGK3aPVcKmtYqWgjYnPah5FOIsYAqrMN2w=", "owner": "Mic92", "repo": "nix-index-database", - "rev": "e25efda85e39fcdc845e371971ac4384989c4295", + "rev": "07ece11b22217b8459df589f858e92212b74f1a1", "type": "github" }, "original": { @@ -790,16 +780,15 @@ "inputs": { "flake-compat": "flake-compat_2", "libgit2": "libgit2", - "lowdown-src": "lowdown-src", "nixpkgs": "nixpkgs_6", "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1708070219, - "narHash": "sha256-/2fidzoXrrNwr8te2cU3JdtrpockWIjU4DpLgNr4FTo=", + "lastModified": 1713633256, + "narHash": "sha256-MKKP3oye1YlF4zq0cARo3BrYzinBaBSJzcdaTxatuew=", "owner": "privatevoid-net", "repo": "nix-super", - "rev": "924eb1127a21ebf4bd7f438d7c6aca133ce1de84", + "rev": "1a2019bb819dde804d7aed43853e31e1a6ea6ea3", "type": "github" }, "original": { @@ -827,11 +816,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1709237383, - "narHash": "sha256-cy6ArO4k5qTx+l5o+0mL9f5fa86tYUX3ozE1S+Txlds=", + "lastModified": 1711703276, + "narHash": "sha256-iMUFArF0WCatKK6RzfUJknjem0H9m4KgorO/p3Dopkk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "1536926ef5621b09bba54035ae2bb6d806d72ac8", + "rev": "d8fe5e6c92d0d190646fb9f1056741a229980089", "type": "github" }, "original": { @@ -876,11 +865,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1710889954, - "narHash": "sha256-Pr6F5Pmd7JnNEMHHmspZ0qVqIBVxyZ13ik1pJtm2QXk=", + "lastModified": 1713254108, + "narHash": "sha256-0TZIsfDbHG5zibtlw6x0yOp3jkInIGaJ35B7Y4G8Pec=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7872526e9c5332274ea5932a0c3270d6e4724f3b", + "rev": "2fd19c8be2551a61c1ddc3d9f86d748f4db94f00", "type": "github" }, "original": { @@ -892,11 +881,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1658161305, - "narHash": "sha256-X/nhnMCa1Wx4YapsspyAs6QYz6T/85FofrI6NpdPDHg=", + "lastModified": 1712163089, + "narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e4d49de45a3b5dbcb881656b4e3986e666141ea9", + "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5", "type": "github" }, "original": { @@ -908,11 +897,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1710272261, - "narHash": "sha256-g0bDwXFmTE7uGDOs9HcJsfLFhH7fOsASbAuOzDC+fhQ=", + "lastModified": 1713537308, + "narHash": "sha256-XtTSSIB2DA6tOv+l0FhvfDMiyCmhoRbNB+0SeInZkbk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0ad13a6833440b8e238947e47bea7f11071dc2b2", + "rev": "5c24cf2f0a12ad855f444c30b2421d044120c66f", "type": "github" }, "original": { @@ -924,11 +913,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1710889954, - "narHash": "sha256-Pr6F5Pmd7JnNEMHHmspZ0qVqIBVxyZ13ik1pJtm2QXk=", + "lastModified": 1713596654, + "narHash": "sha256-LJbHQQ5aX1LVth2ST+Kkse/DRzgxlVhTL1rxthvyhZc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "7872526e9c5332274ea5932a0c3270d6e4724f3b", + "rev": "fd16bb6d3bcca96039b11aa52038fafeb6e4f4be", "type": "github" }, "original": { @@ -940,27 +929,27 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1700748986, - "narHash": "sha256-/nqLrNU297h3PCw4QyDpZKZEUHmialJdZW2ceYFobds=", + "lastModified": 1709083642, + "narHash": "sha256-7kkJQd4rZ+vFrzWu8sTRtta5D1kBG0LSRYAfhtmMlSo=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "9ba29e2346bc542e9909d1021e8fd7d4b3f64db0", + "rev": "b550fe4b4776908ac2a861124307045f8e717c8e", "type": "github" }, "original": { "owner": "NixOS", - "ref": "nixos-23.05-small", + "ref": "release-23.11", "repo": "nixpkgs", "type": "github" } }, "nixpkgs_7": { "locked": { - "lastModified": 1710889954, - "narHash": "sha256-Pr6F5Pmd7JnNEMHHmspZ0qVqIBVxyZ13ik1pJtm2QXk=", + "lastModified": 1713627711, + "narHash": "sha256-kWlK1w/rqPBrs5rF4btRgXpzVstmNxA8rgc6kBzc89s=", "owner": "nixos", "repo": "nixpkgs", - "rev": "7872526e9c5332274ea5932a0c3270d6e4724f3b", + "rev": "0c97ced70e0b92d46e5e53e239fec5201f8b0811", "type": "github" }, "original": { @@ -1005,11 +994,11 @@ "none-ls-nvim": { "flake": false, "locked": { - "lastModified": 1711021139, - "narHash": "sha256-FjDb53SNILxP9N9l5cJVBocj1ro/9eE8VKgR0Mv5+gs=", + "lastModified": 1713584427, + "narHash": "sha256-tJEyILFUEdGASYkkaoUEsKcyTWU4XLHtkNF2MJstuyY=", "owner": "nvimtools", "repo": "none-ls.nvim", - "rev": "18910d09d21d7df339805343bfe4a2b2e41c057b", + "rev": "88821b67e6007041f43b802f58e3d9fa9bfce684", "type": "github" }, "original": { @@ -1020,11 +1009,11 @@ }, "nur": { "locked": { - "lastModified": 1711034660, - "narHash": "sha256-AURgOJFzS+k+Sj9Aif198WM5dDyLJ1GMLaa9ge1NETY=", + "lastModified": 1713683463, + "narHash": "sha256-4byae6EewzcPs1C1JGOts1PLVr+PlR7+FOOqJGNSBIQ=", "owner": "nix-community", "repo": "NUR", - "rev": "1f626d2e2e780e5ba0fe203a7e74f79b57f1af67", + "rev": "568cd159bad8d8a2e3c2f3f7b71dd27a3d553b45", "type": "github" }, "original": { @@ -1036,11 +1025,11 @@ "nvim-lspconfig": { "flake": false, "locked": { - "lastModified": 1710924139, - "narHash": "sha256-wW6vmaCLBpiLtk87UXzppIP2WRzG/gdtsIcPPCnwucM=", + "lastModified": 1713507075, + "narHash": "sha256-/SqLT0PG2RUWyknYpcXlcU/aUyKWZMBs35s1sPRkEmc=", "owner": "neovim", "repo": "nvim-lspconfig", - "rev": "d67715d3b746a19e951b6b0a99663fa909bb9e64", + "rev": "ed8b8a15acc441aec669f97d75f2c1f2ac8c8aa5", "type": "github" }, "original": { @@ -1058,11 +1047,11 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1710923068, - "narHash": "sha256-6hOpUiuxuwpXXc/xfJsBUJeqqgGI+JMJuLo45aG3cKc=", + "lastModified": 1712897695, + "narHash": "sha256-nMirxrGteNAl9sWiOhoN5tIHyjBbVi5e2tgZUgZlK3Y=", "owner": "cachix", "repo": "pre-commit-hooks.nix", - "rev": "e611897ddfdde3ed3eaac4758635d7177ff78673", + "rev": "40e6053ecb65fcbf12863338a6dcefb3f55f1bf8", "type": "github" }, "original": { @@ -1074,11 +1063,11 @@ "river": { "flake": false, "locked": { - "lastModified": 1711107438, - "narHash": "sha256-4nvFniKdJX+ZsoliFmWSzIAtZefekBCxmGS9xonHQN8=", + "lastModified": 1713527168, + "narHash": "sha256-oYVyqNfXjmR6axGyki+jZVOOHFVt1YWAX08eqxtVE6c=", "ref": "refs/heads/master", - "rev": "b77b42f0d640457411204bbae346df1d1a0c4f44", - "revCount": 1214, + "rev": "9bbd34a0e31b6d429df2d39a59d8990a9585e186", + "revCount": 1248, "submodules": true, "type": "git", "url": "https://github.com/riverwm/river" @@ -1236,16 +1225,16 @@ }, "systems_5": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, @@ -1279,29 +1268,14 @@ "type": "github" } }, - "systems_8": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, "telekasten-nvim": { "flake": false, "locked": { - "lastModified": 1709039416, - "narHash": "sha256-fIXLxnPUMs8rXuEcsGIoz+UprtQlW9SB75dS6LKQGg4=", + "lastModified": 1713339207, + "narHash": "sha256-eg1xJUl4a+tIyJyN+UcaK0bP1o+zEo6mARFlJcsAwM8=", "owner": "renerocksai", "repo": "telekasten.nvim", - "rev": "a684d6ebe7026944b0a5323219d5f5364511e5b2", + "rev": "24fd8c1e7eb989dba9efa5d174e42870f08da8fb", "type": "github" }, "original": { @@ -1332,7 +1306,7 @@ }, "utils": { "inputs": { - "systems": "systems_8" + "systems": "systems_7" }, "locked": { "lastModified": 1692799911, @@ -1351,20 +1325,18 @@ "wlroots": { "flake": false, "locked": { - "host": "gitlab.freedesktop.org", - "lastModified": 1709983277, - "narHash": "sha256-wXWIJLd4F2JZeMaihWVDW/yYXCLEC8OpeNJZg9a9ly8=", - "owner": "wlroots", - "repo": "wlroots", - "rev": "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b", - "type": "gitlab" + "lastModified": 1713124002, + "narHash": "sha256-vPeZCY+sdiGsz4fl3AVVujfyZyQBz6+vZdkUE4hQ+HI=", + "owner": "hyprwm", + "repo": "wlroots-hyprland", + "rev": "611a4f24cd2384378f6e500253983107c6656c64", + "type": "github" }, "original": { - "host": "gitlab.freedesktop.org", - "owner": "wlroots", - "repo": "wlroots", - "rev": "50eae512d9cecbf0b3b1898bb1f0b40fa05fe19b", - "type": "gitlab" + "owner": "hyprwm", + "repo": "wlroots-hyprland", + "rev": "611a4f24cd2384378f6e500253983107c6656c64", + "type": "github" } }, "xdph": { @@ -1387,11 +1359,11 @@ ] }, "locked": { - "lastModified": 1709299639, - "narHash": "sha256-jYqJM5khksLIbqSxCLUUcqEgI+O2LdlSlcMEBs39CAU=", + "lastModified": 1713214484, + "narHash": "sha256-h1bSIsDuPk1FGgvTuSHJyiU2Glu7oAyoPMJutKZmLQ8=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "2d2fb547178ec025da643db57d40a971507b82fe", + "rev": "bb44921534a9cee9635304fdb876c1b3ec3a8f61", "type": "github" }, "original": { diff --git a/hosts/nixos-desktop/default.nix b/hosts/nixos-desktop/default.nix index c3f010a..1df502b 100644 --- a/hosts/nixos-desktop/default.nix +++ b/hosts/nixos-desktop/default.nix @@ -40,7 +40,7 @@ }; home-manager.users.moritz.home.packages = with pkgs; [ anki - calibre + stable.calibre # NOTE: breaks often in unstable ]; hardware = { diff --git a/modules/programs/foot.nix b/modules/programs/foot.nix index 5486b3f..67d5a86 100644 --- a/modules/programs/foot.nix +++ b/modules/programs/foot.nix @@ -13,7 +13,7 @@ in config = mkIf cfg.enable { home-manager.users.moritz = { # HACK: to make foot server work - systemd.user.services.foot.Service.Environment = "PATH=/run/current-system/sw/bin/"; + systemd.user.services.foot.Service.Environment = lib.mkForce "PATH=/run/current-system/sw/bin/"; programs.foot = { enable = true; server.enable = true; From b1ecc723cc70f6572506837c4333f93fa4c484d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 21 Apr 2024 11:54:18 +0200 Subject: [PATCH 15/21] feat: do not use nix super by default --- modules/programs/nix.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/nix.nix b/modules/programs/nix.nix index 0e6fde9..9435552 100644 --- a/modules/programs/nix.nix +++ b/modules/programs/nix.nix @@ -38,8 +38,8 @@ in }; }; optimise.enable = mkEnableOption "nix-optimise"; - useSuper = mkEnableOption "use nix super" // { default = true; }; - useNom = mkEnableOption "use nix output monitor by default" // { default = true; }; + useSuper = mkEnableOption "use nix super"; + useNom = mkEnableOption "use nix output monitor" // { default = true; }; }; config = { From 42edc5bd2f031ac2d60d3cee31cf76270fe93a88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 21 Apr 2024 11:54:36 +0200 Subject: [PATCH 16/21] fix: todo-comments-nvim plugin --- modules/programs/nvim/plugins/ui.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/programs/nvim/plugins/ui.nix b/modules/programs/nvim/plugins/ui.nix index ccfcb3b..96e28c2 100644 --- a/modules/programs/nvim/plugins/ui.nix +++ b/modules/programs/nvim/plugins/ui.nix @@ -16,7 +16,6 @@ with builtins; } { plugin = todo-comments-nvim; - event = [ "BufReadPost" "BufNewFile" ]; dependencies = [{ plugin = plenary-nvim; }]; opts = { }; } From 1b5659ac6c4cf8917a628c4aa5f442c82d6613a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Sun, 21 Apr 2024 12:00:38 +0200 Subject: [PATCH 17/21] feat: add easy mapping for "Gedit :" --- modules/programs/nvim/plugins/coding.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/programs/nvim/plugins/coding.nix b/modules/programs/nvim/plugins/coding.nix index 7f40237..0c2d0bf 100644 --- a/modules/programs/nvim/plugins/coding.nix +++ b/modules/programs/nvim/plugins/coding.nix @@ -117,6 +117,9 @@ with builtins; "GDelete" "GBrowse" ]; + keys = [ + { key = "gg"; cmd = "Gedit :"; desc = "Open Status"; } + ]; } { plugin = vim-tmux-navigator; From 7ddd60e36c2ece69b471464200108e6e24b624f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 22 Apr 2024 09:31:59 +0200 Subject: [PATCH 18/21] feat: add sixel support to viu --- modules/profiles/base.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/profiles/base.nix b/modules/profiles/base.nix index 00096f8..7a5dd80 100644 --- a/modules/profiles/base.nix +++ b/modules/profiles/base.nix @@ -249,7 +249,7 @@ in parallel ripgrep vim - viu + (viu.override { withSixel = true; }) wget ]; From 05e7391cb4742b26adf60e64116d6f58c3034a55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 22 Apr 2024 09:35:04 +0200 Subject: [PATCH 19/21] fix: various small things --- modules/profiles/impermanence.nix | 2 +- modules/programs/foot.nix | 1 - modules/programs/wallpaper/default.nix | 9 ++++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/profiles/impermanence.nix b/modules/profiles/impermanence.nix index 5e23faa..6cf6c6e 100644 --- a/modules/profiles/impermanence.nix +++ b/modules/profiles/impermanence.nix @@ -54,7 +54,6 @@ in ".local/share/nvim" ".local/share/zoxide" ".local/state/nvim" - ".local/state/tofi-history" ".mozilla" "Documents" "Downloads" @@ -69,6 +68,7 @@ in ".local/share/fish/fish_history" ".local/share/nix/trusted-settings.json" ".parallel/will-cite" + ".local/state/tofi-history" ]; }; users.root = { diff --git a/modules/programs/foot.nix b/modules/programs/foot.nix index 5486b3f..7308afb 100644 --- a/modules/programs/foot.nix +++ b/modules/programs/foot.nix @@ -16,7 +16,6 @@ in systemd.user.services.foot.Service.Environment = "PATH=/run/current-system/sw/bin/"; programs.foot = { enable = true; - server.enable = true; settings = { main = { term = "xterm-256color"; diff --git a/modules/programs/wallpaper/default.nix b/modules/programs/wallpaper/default.nix index 2fdec75..cd7a7c4 100644 --- a/modules/programs/wallpaper/default.nix +++ b/modules/programs/wallpaper/default.nix @@ -8,7 +8,14 @@ let script = pkgs.writeShellApplication { name = "wallpaper"; - runtimeInputs = with pkgs; [ findutils coreutils feh swaybg fzf viu ]; + runtimeInputs = with pkgs; [ + findutils + coreutils + feh + swaybg + fzf + (viu.override { withSixel = true; }) + ]; text = builtins.readFile ./wallpaper.sh; }; in From 31cd3f9957bec70d04be8cda14ff96a78dfa5646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 22 Apr 2024 09:35:32 +0200 Subject: [PATCH 20/21] feat: switch back to hyprland --- hosts/nixos-laptop/default.nix | 4 ++-- modules/programs/hyprland/_config.nix | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hosts/nixos-laptop/default.nix b/hosts/nixos-laptop/default.nix index 4a41c0b..ca86959 100644 --- a/hosts/nixos-laptop/default.nix +++ b/hosts/nixos-laptop/default.nix @@ -20,8 +20,8 @@ webis.enable = true; impermanence.enable = true; }; - programs.hyprland.enable = false; - programs.river.enable = true; + programs.hyprland.enable = true; + # programs.river.enable = true; programs.exercism.enable = true; }; diff --git a/modules/programs/hyprland/_config.nix b/modules/programs/hyprland/_config.nix index 6703ae9..0575f7b 100644 --- a/modules/programs/hyprland/_config.nix +++ b/modules/programs/hyprland/_config.nix @@ -119,7 +119,7 @@ in # See https://wiki.hyprland.org/Configuring/Window-Rules/ for more # Firefox Sharing Indicator - ${mkRules ["float" "move 49% 40" "noborder" "nofullscreenrequest"] ["title:^(.*Sharing Indicator.*)$"]} + ${mkRules ["float" "move 49% 40" "noborder"] ["title:^(.*Sharing Indicator.*)$"]} # Emacs windowrulev2 = opaque, class:^(emacs)$ @@ -154,8 +154,7 @@ in bind = $mainMod , D , exec , hyprctl keyword general:layout dwindle bind = $mainMod , M , exec , hyprctl keyword general:layout master bind = $mainMod , R , exec , rofi -show combi - bind = $mainMod , RETURN , exec , footclient - bind = $mainMod SHIFT , RETURN , exec , foot + bind = $mainMod , RETURN , exec , systemctl --user is-active --quiet foot && footclient --no-wait || foot # bind = $mainMod SHIFT , RETURN , exec , kitty -- tmux new "ts || tn home ~" # XF86 keys From 5aba3a032c0a151f1b1d0a4221e0614b05f16dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Moritz=20B=C3=B6hme?= Date: Mon, 22 Apr 2024 09:35:59 +0200 Subject: [PATCH 21/21] feat: add tags keybinds to river --- modules/programs/river/default.nix | 41 +++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/modules/programs/river/default.nix b/modules/programs/river/default.nix index 9e1e29b..c0ae02d 100644 --- a/modules/programs/river/default.nix +++ b/modules/programs/river/default.nix @@ -99,7 +99,30 @@ in # bump in layout stack "Super Z" = "zoom"; - }; + + } // + # tags + ( + let + numbers = range 1 9; + toTag = num: "$((1 << (${toString num} - 1)))"; + + mkMappings = num: + let + numStr = toString num; + tag = toTag num; + in + [ + # Super+Control+[1-9] to toggle focus of tag [0-8] + { name = "Super ${numStr}"; value = "toggle-focused-tags ${tag}"; } + + # Super+Shift+Control+[1-9] to toggle tag [0-8] of focused view + { name = "Super+Shift ${numStr}"; value = "toggle-view-tags ${tag}"; } + ]; + mappings = flatten (map mkMappings numbers); + in + listToAttrs mappings + ); }; map-pointer = { normal = { @@ -108,12 +131,19 @@ in "Super BTN_MIDDLE" = "toggle-float"; }; }; + attach-mode = "bottom"; + default-layout = "rivercarro"; + focus-follows-cursor = "normal"; + hide-cursor = { + timeout = "1500"; + when-typing = "enabled"; + }; + set-cursor-warp = "on-focus-change"; }; extraConfig = /* bash */ '' - riverctl default-layout rivercarro rivercarro_pid="$(pidof rivercarro)" if [[ -z $rivercarro_pid ]]; then - rivercarro -inner-gaps 4 -outer-gaps 4 + rivercarro -inner-gaps 4 -outer-gaps 4 & fi ''; }; @@ -139,6 +169,11 @@ in modules-right = [ "network" "memory" "cpu" "battery" "clock" ]; }; }; + style = '' + #tags button.focused { + color: #ffffff + } + ''; }; # lock screen after timeout