91 lines
2.4 KiB
Nix
91 lines
2.4 KiB
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}: {
|
|
options.u = {
|
|
confPath = lib.mkOption {
|
|
type = lib.types.path;
|
|
description = "path to nixos config";
|
|
default = "${config.home.homeDirectory}/.local/nixos";
|
|
};
|
|
tmux = {
|
|
plugins = lib.mkOption {
|
|
type = lib.types.listOf lib.types.package;
|
|
description = "tmux plugins to source in config";
|
|
};
|
|
extraConfig = lib.mkOption {
|
|
type = lib.types.lines;
|
|
description = "extra config to append to bottom of config";
|
|
default = "";
|
|
};
|
|
};
|
|
bin = lib.mkOption {
|
|
type = lib.types.attrsOf (lib.types.listOf lib.types.package);
|
|
description = "scripts to put in .local/bin and their dependencies";
|
|
};
|
|
bookmarks = lib.mkOption {
|
|
type = lib.types.listOf (lib.types.submodule {
|
|
options = {
|
|
href = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "link of the bookmark";
|
|
example = "file:///tmp";
|
|
};
|
|
name = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "name of the bookmark";
|
|
example = "tmp";
|
|
};
|
|
icon = lib.mkOption {
|
|
type = lib.types.str;
|
|
description = "icon name of the bookmark";
|
|
example = "folder-temp";
|
|
};
|
|
};
|
|
});
|
|
description = "list of file manager bookmarks";
|
|
};
|
|
has = let
|
|
mkOpt = name:
|
|
lib.mkOption {
|
|
type = lib.types.bool;
|
|
description = "enable ${name}";
|
|
default = true;
|
|
};
|
|
mkOptF = name:
|
|
lib.mkOption {
|
|
type = lib.types.bool;
|
|
description = "enable ${name}";
|
|
default = false;
|
|
};
|
|
in {
|
|
graphical = mkOpt "graphical";
|
|
wine = mkOpt "wine";
|
|
prog = mkOpt "prog";
|
|
activitywatch = mkOptF "activitywatch";
|
|
jp = mkOptF "jp";
|
|
};
|
|
lib = lib.mkOption {
|
|
type = lib.types.attrs;
|
|
description = "library";
|
|
};
|
|
};
|
|
config.u.lib = rec {
|
|
ln = base: x: config.lib.file.mkOutOfStoreSymlink "${base}/${x}";
|
|
lnh = ln "${config.home.homeDirectory}";
|
|
lnn = ln "${config.u.confPath}";
|
|
localHome = pkg: name: bin:
|
|
pkgs.symlinkJoin {
|
|
name = name;
|
|
paths = [pkg];
|
|
buildInputs = [pkgs.makeWrapper];
|
|
postBuild = ''
|
|
wrapProgram $out/${bin} \
|
|
--set HOME "${config.home.homeDirectory}/.local/home"
|
|
'';
|
|
};
|
|
};
|
|
}
|