nvim stuff
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user