Add lf config

This commit is contained in:
Cameron Reed 2024-01-29 21:25:16 -07:00
parent c1463e04b0
commit 23274cb6d1
6 changed files with 81 additions and 6 deletions

View File

@ -0,0 +1,37 @@
{ pkgs, lib, inputs, config, osConfig, ... }:
{
programs.lf = {
enable = builtins.elem pkgs.lf osConfig.environment.systemPackages;
commands = {
delete = ''''${{
set -f
printf "$fx\n"
printf "delete? [y/N] "
read ans
[ "$ans" = "y" ] && rm -rf $fx
}}'';
};
keybindings = {
x = "delete";
"<delete>" = "delete";
"<enter>" = "open";
};
settings = {
scrolloff = 8;
preview = true;
drawbox = true;
icons = true;
cursorpreviewfmt = "\033[7;90m";
};
};
xdg.configFile."lf/icons" = {
enable = builtins.elem pkgs.lf osConfig.environment.systemPackages;
source = "${inputs.lf-icons}/etc/icons.example";
};
}

View File

@ -101,6 +101,15 @@ if command -v direnv &> /dev/null; then
fi
if command -v lf &> /dev/null; then
lfcd() {
cd "$(command lf -print-last-lf "$@")"
}
bindkey -s '^o' 'lfcd\n'
fi
if [ "$TERM" = "xterm-kitty" ]; then
alias ssh='kitty +kitten ssh'
alias clear='printf "\033c"'

View File

@ -1,4 +1,4 @@
{ pkgs, lib, config, osConfig, ... }:
{ pkgs, lib, inputs, config, osConfig, ... }:
{
imports = [
@ -12,8 +12,14 @@
./home-manager/waybar.nix
./home-manager/zsh.nix
./home-manager/lf.nix
];
home.username = "cameron";
home.homeDirectory = osConfig.users.users.cameron.home;
home.sessionVariables = {
EDITOR = "nvim";
};
}

View File

@ -41,6 +41,22 @@
"type": "github"
}
},
"lf-icons": {
"flake": false,
"locked": {
"lastModified": 1705549864,
"narHash": "sha256-JqjJLz+XxbvN2lC8+nhjvfheHjgjlLMp2NvQREF4zbk=",
"owner": "gokcehan",
"repo": "lf",
"rev": "8a14749154c2c11fce4fec0188dc204c012bd3e9",
"type": "github"
},
"original": {
"owner": "gokcehan",
"repo": "lf",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1706098335,
@ -75,6 +91,7 @@
"inputs": {
"home-manager": "home-manager",
"home-manager-unstable": "home-manager-unstable",
"lf-icons": "lf-icons",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable"
}

View File

@ -12,11 +12,17 @@
nixpkgs-unstable.url = "nixpkgs/nixos-unstable";
home-manager-unstable.url = "github:nix-community/home-manager";
home-manager-unstable.inputs.nixpkgs.follows = "nixpkgs-unstable";
lf-icons.url = "github:gokcehan/lf";
lf-icons.flake = false;
};
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, home-manager-unstable }:
let common_dir = ./common;
outputs = { self, nixpkgs, nixpkgs-unstable, home-manager, home-manager-unstable, lf-icons }:
let
common_dir = ./common;
inputs = { inherit lf-icons; };
in {
nixosConfigurations = {
@ -30,7 +36,7 @@
home-manager.useUserPackages = true;
home-manager.users.cameron = import ./hosts/nixos/home-manager/cameron.nix;
home-manager.extraSpecialArgs = { inherit common_dir; };
home-manager.extraSpecialArgs = { inherit common_dir inputs; };
}
];
};
@ -45,7 +51,7 @@
home-manager.useUserPackages = true;
home-manager.users.cameron = import ./hosts/nixserver/home-manager/cameron.nix;
home-manager.extraSpecialArgs = { inherit common_dir; };
home-manager.extraSpecialArgs = { inherit common_dir inputs; };
}
];
};

View File

@ -1,4 +1,4 @@
{ lib, pkgs, config, osConfig, common_dir, ... }:
{ lib, pkgs, inputs, config, osConfig, common_dir, ... }:
{
imports = [