fix helix and mpv modules
the helix wrapper wasn't working properly with spaced paths, and mpv seems to not be configured to use /etc/mpv on nixos. Now both of them work very similarly
This commit is contained in:
parent
f7ad07daf8
commit
a2a1530ed4
2 changed files with 23 additions and 5 deletions
|
|
@ -13,6 +13,8 @@ in
|
|||
options.nixowos.cli.${name} = {
|
||||
enable = lib.mkEnableOption name;
|
||||
|
||||
package = lib.mkPackageOption pkgs name { };
|
||||
|
||||
extraConfig = lib.mkOption {
|
||||
type = lib.types.lines;
|
||||
default = /* toml */ ''
|
||||
|
|
@ -31,12 +33,19 @@ in
|
|||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellScriptBin "hx" "${pkgs.helix}/bin/hx -c /etc/${name}.toml $@")
|
||||
(pkgs.symlinkJoin {
|
||||
inherit name;
|
||||
paths = [ cfg.package ];
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/hx \
|
||||
--add-flags "-c" \
|
||||
--add-flags "${pkgs.writeText "${name}.toml" cfg.extraConfig}"
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
||||
# nixos/modules/programs/environment.nix uses mkDefault "nano"
|
||||
environment.variables.EDITOR = lib.mkOverride 900 "hx";
|
||||
|
||||
environment.etc."${name}.toml".text = cfg.extraConfig;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,16 @@ in
|
|||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
environment.etc."${name}/${name}.conf".text = cfg.extraConfig;
|
||||
environment.systemPackages = [
|
||||
(pkgs.symlinkJoin {
|
||||
inherit name;
|
||||
paths = [ cfg.package ];
|
||||
nativeBuildInputs = [ pkgs.makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/${name} \
|
||||
--add-flags "--config-dir=${pkgs.writeTextDir "${name}.conf" cfg.extraConfig}"
|
||||
'';
|
||||
})
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue