nix-conf/user/options.nix

72 lines
1.9 KiB
Nix
Raw Normal View History

2024-12-20 21:25:22 -05:00
{
config,
lib,
2024-12-20 23:32:08 -05:00
pkgs,
2024-12-20 21:25:22 -05:00
...
}: {
2024-10-31 16:15:52 -04:00
options.u = {
2024-12-17 19:09:12 -05:00
confPath = lib.mkOption {
type = lib.types.path;
description = "path to nixos config";
default = "${config.home.homeDirectory}/.local/nixos";
};
2024-10-31 16:15:52 -04:00
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 = "";
};
};
2024-11-07 15:42:00 -05:00
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";
};
2024-12-17 19:09:12 -05:00
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}";
2024-12-20 23:32:08 -05:00
fixXcursor = pkg:
pkg.overrideAttrs {
buildInputs = pkg.buildInputs ++ [pkgs.xorg.libXcursor];
env.NIX_LDFLAGS = "-lXcursor";
};
localHome = pkg: name: bin:
pkgs.symlinkJoin {
name = name;
paths = [pkg];
buildInputs = [pkgs.makeWrapper];
postBuild = ''
wrapProgram $out/${bin} \
--set HOME "${config.home.homeDirectory}/.local/home"
'';
};
2024-10-31 16:15:52 -04:00
};
}