nvim stuff

This commit is contained in:
2025-08-05 19:13:18 +02:00
parent df513eb640
commit 504f9637d9
29 changed files with 322 additions and 256 deletions

View File

@@ -4,13 +4,10 @@
lib,
...
}:
with lib;
let
with lib; let
cfg = config.local.dock;
inherit (pkgs) stdenv dockutil;
in
{
in {
options = {
local.dock = {
enable = mkOption {
@@ -21,11 +18,10 @@ in
entries = mkOption {
description = "Entries on the Dock";
type =
with types;
type = with types;
listOf (submodule {
options = {
path = lib.mkOption { type = str; };
path = lib.mkOption {type = str;};
section = lib.mkOption {
type = str;
default = "apps";
@@ -48,11 +44,14 @@ in
config = mkIf cfg.enable (
let
normalize = path: if hasSuffix ".app" path then path + "/" else path;
entryURI =
path:
normalize = path:
if hasSuffix ".app" path
then path + "/"
else path;
entryURI = path:
"file://"
+ (builtins.replaceStrings
+ (
builtins.replaceStrings
[
" "
"!"
@@ -80,12 +79,12 @@ in
(normalize path)
);
wantURIs = concatMapStrings (entry: "${entryURI entry.path}\n") cfg.entries;
createEntries = concatMapStrings (
entry:
"${dockutil}/bin/dockutil --no-restart --add '${entry.path}' --section ${entry.section} ${entry.options}\n"
) cfg.entries;
in
{
createEntries =
concatMapStrings (
entry: "${dockutil}/bin/dockutil --no-restart --add '${entry.path}' --section ${entry.section} ${entry.options}\n"
)
cfg.entries;
in {
system.activationScripts.postActivation.text = ''
echo >&2 "Setting up the Dock for ${cfg.username}..."
su ${cfg.username} -s /bin/sh <<'USERBLOCK'