new meat
This commit is contained in:
parent
914788cd30
commit
8003d9b2a6
10 changed files with 379 additions and 121 deletions
|
@ -16,6 +16,7 @@ in {
|
|||
./util/ez.nix
|
||||
./util/flatpak.nix
|
||||
./util/cosmic.nix
|
||||
./util/murex.nix # TODO use these options, write plugin pkgs, etc
|
||||
inputs.nix-index-database.hmModules.nix-index
|
||||
];
|
||||
|
||||
|
|
66
home/util/murex.nix
Normal file
66
home/util/murex.nix
Normal file
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
lib,
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkEnableOption mkOption mkIf types;
|
||||
inherit (builtins) listToAttrs;
|
||||
cfg = config.programs.murex;
|
||||
in {
|
||||
options.programs.murex = {
|
||||
enable = mkEnableOption "murex shell";
|
||||
managePlugins = mkEnableOption "plugin management";
|
||||
plugins = mkOption {
|
||||
type = with types; listOf package;
|
||||
default = [];
|
||||
};
|
||||
direnv = mkEnableOption "direnv integration";
|
||||
profile = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
preload = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
config = {
|
||||
home.file =
|
||||
{
|
||||
".murex_preload" = {
|
||||
text = cfg.preload;
|
||||
enable = cfg.preload != "";
|
||||
};
|
||||
".murex_profile" = {
|
||||
text =
|
||||
cfg.profile
|
||||
++ (
|
||||
if cfg.direnv
|
||||
then ''
|
||||
direnv hook murex -> source
|
||||
''
|
||||
else ""
|
||||
);
|
||||
enable = cfg.direnv || (cfg.profile != "");
|
||||
};
|
||||
".murex_modules/packages.json" = {
|
||||
text = builtins.toJSON (map (plugin: {
|
||||
Protocol = "nix";
|
||||
URI = "https://none.thanks/managed.git";
|
||||
Package = plugin.pname;
|
||||
})
|
||||
cfg.plugins);
|
||||
enable = cfg.managePlugins && (cfg.plugins != []);
|
||||
};
|
||||
}
|
||||
// (mkIf cfg.managePlugins (listToAttrs (map (plugin: {
|
||||
name = ".murex_modules/${plugin.pname}";
|
||||
value = {
|
||||
recursive = true;
|
||||
source = plugin;
|
||||
};
|
||||
})
|
||||
cfg.plugins)));
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue