add hm modules: riff
This commit is contained in:
parent
205e7de702
commit
f91842b292
6 changed files with 79 additions and 45 deletions
5
nixos/common/hm-modules/default.nix
Normal file
5
nixos/common/hm-modules/default.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
{ ... }: {
|
||||
imports = [
|
||||
./riff.nix
|
||||
];
|
||||
}
|
28
nixos/common/hm-modules/riff.nix
Normal file
28
nixos/common/hm-modules/riff.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{ config, pkgs, lib, inputs, ... }:
|
||||
with lib;
|
||||
let cfg = config.programs.riff;
|
||||
in {
|
||||
options.programs.riff = {
|
||||
enable = mkEnableOption "riff";
|
||||
direnv = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to enable direnv support
|
||||
'';
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
home.packages = [ inputs.riff.packages.${pkgs.system}.riff ];
|
||||
|
||||
xdg.configFile."direnv/lib/riff.sh" = mkIf cfg.direnv {
|
||||
executable = true;
|
||||
text = ''
|
||||
use_riff() {
|
||||
watch_file Cargo.toml watch_file Cargo.lock
|
||||
eval "$(riff --offline print-dev-env)"
|
||||
}
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue