mirror of
https://github.com/ryanccn/flake.git
synced 2025-12-06 08:10:43 +01:00
refactor: programs -> home
This commit is contained in:
parent
042cd345f9
commit
650542009d
21 changed files with 7 additions and 7 deletions
|
|
@ -1,35 +0,0 @@
|
|||
{lib, ...}: let
|
||||
aliases = import ./aliases.nix;
|
||||
shellAbbrs = builtins.mapAttrs (_: a: a.command) (lib.filterAttrs (_: b: !(b.fishAlias or false)) aliases);
|
||||
shellAliases = builtins.mapAttrs (_: a: a.command) (lib.filterAttrs (_: b: builtins.hasAttr "fishAlias" b && b.fishAlias) aliases);
|
||||
in {
|
||||
programs.fish = {
|
||||
enable = true;
|
||||
inherit shellAbbrs shellAliases;
|
||||
|
||||
functions = {
|
||||
take = ''
|
||||
set dir $argv[1]
|
||||
if test -z "$dir"
|
||||
return 1
|
||||
end
|
||||
|
||||
mkdir -p "$dir"
|
||||
cd "$dir"
|
||||
'';
|
||||
|
||||
code = ''
|
||||
if test -d "$argv[1]" -o -f "$argv[1]"
|
||||
open -a "Visual Studio Code" "$argv[1]"
|
||||
else
|
||||
command code $argv
|
||||
end
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".config/fish/conf.d" = {
|
||||
source = ./fish/conf.d;
|
||||
recursive = true;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue