add dnote
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{ config, lib, pkgs, inputs, ... }:
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
imports = [ ../gnome ../custom-programs ./neovim ];
|
||||
imports = [ ../gnome ../custom-programs ./neovim ./dnote.nix ];
|
||||
|
||||
# This value determines the Home Manager release that your configuration is
|
||||
# compatible with. This helps avoid breakage when a new Home Manager release
|
||||
@@ -72,6 +72,7 @@
|
||||
enable = true;
|
||||
flake = "/etc/nixos";
|
||||
};
|
||||
dnote.enable = true;
|
||||
home-manager.enable = true;
|
||||
bat = {
|
||||
enable = true;
|
||||
|
||||
35
home/common/dnote.nix
Normal file
35
home/common/dnote.nix
Normal file
@@ -0,0 +1,35 @@
|
||||
{ inputs, lib, pkgs, config, ... }:
|
||||
let
|
||||
completion = pkgs.stdenv.mkDerivation {
|
||||
name = "dnote-completion";
|
||||
phases = [ "unpackPhase" "installPhase" ];
|
||||
src = inputs.dnote;
|
||||
installPhase = ''
|
||||
mkdir -p $out/lib/dnote/zsh-completion/completions
|
||||
cp pkg/cli/dnote-completion.zsh $out/lib/dnote/zsh-completion/completions/_dnote
|
||||
'';
|
||||
};
|
||||
client = pkgs.stdenv.mkDerivation {
|
||||
name = "dnote-client";
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp ${unstablePkgs.dnote}/bin/dnote-cli $out/bin/dnote
|
||||
'';
|
||||
};
|
||||
cfg = config.programs.dnote;
|
||||
unstablePkgs = inputs.nixpkgs-unstable.legacyPackages.${pkgs.system};
|
||||
in
|
||||
{
|
||||
options.programs.dnote = {
|
||||
enable = pkgs.lib.mkEnableOption "Enable dnote";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = [ client ];
|
||||
home.shellAliases.dn = "dnote";
|
||||
programs.zsh.initExtra = ''
|
||||
fpath=(${completion}/lib/dnote/zsh-completion/completions $fpath)
|
||||
'';
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user