Add zsh completions for nix flakes

This commit is contained in:
Alexander Bantyev 2021-03-08 17:57:55 +03:00
parent 094d662633
commit 94120c7861
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
4 changed files with 28 additions and 0 deletions

18
flake.lock generated
View File

@ -209,6 +209,23 @@
"type": "indirect"
}
},
"nix-zsh-completions": {
"flake": false,
"locked": {
"lastModified": 1600188236,
"narHash": "sha256-3HVYez/wt7EP8+TlhTppm968Wl8x5dXuGU0P+8xNDpo=",
"owner": "Ma27",
"repo": "nix-zsh-completions",
"rev": "939c48c182e9d018eaea902b1ee9d00a415dba86",
"type": "github"
},
"original": {
"owner": "Ma27",
"ref": "flakes",
"repo": "nix-zsh-completions",
"type": "github"
}
},
"nixos-fhs-compat": {
"locked": {
"lastModified": 1588706047,
@ -373,6 +390,7 @@
"lambda-launcher": "lambda-launcher",
"materia-theme": "materia-theme",
"nix": "nix",
"nix-zsh-completions": "nix-zsh-completions",
"nixos-fhs-compat": "nixos-fhs-compat",
"nixpkgs": "nixpkgs_5",
"nixpkgs-old": "nixpkgs-old",

View File

@ -49,6 +49,8 @@
simple-osd-daemons.url = "github:balsoft/simple-osd-daemons";
wee-slack.url = "github:wee-slack/wee-slack";
wee-slack.flake = false;
nix-zsh-completions.url = "github:Ma27/nix-zsh-completions/flakes";
nix-zsh-completions.flake = false;
};
outputs = { nixpkgs, nix, self, deploy-rs, ... }@inputs: {

View File

@ -41,6 +41,10 @@ in {
patches = [(builtins.elemAt oa.patches 0)];
});
nix-zsh-completions = super.nix-zsh-completions.overrideAttrs (_: {
src = inputs.nix-zsh-completions;
});
# inherit (inputs.nixpkgs-mesa.legacyPackages.x86_64-linux) sway mesa_drivers;
})
];

View File

@ -102,6 +102,10 @@
function rs() { nix run "self#$1" }
function is() { nix search "self#$1" }
source ${pkgs.nix-zsh-completions}/share/zsh/plugins/nix/nix-zsh-completions.plugin.zsh
fpath=(${pkgs.nix-zsh-completions}/share/zsh/site-functions $fpath)
autoload -U compinit && compinit
PS1="$PS1
$ "
'';