Compare commits

...

3 Commits

Author SHA1 Message Date
Zynh Ludwig d5c455cf37 all: use paths option 2024-08-07 04:46:08 -07:00
Zynh Ludwig 9ef497f991 sources: module init 2024-08-07 04:46:08 -07:00
Zynh Ludwig c85f5e013b tmux-sessionizer: paths option 2024-08-07 04:46:08 -07:00
6 changed files with 46 additions and 11 deletions

View File

@ -12,5 +12,9 @@ in
config = lib.mkIf cfg.enable {
home.file.projects.source = link "${config.home.homeDirectory}/Documents/projects/";
snowhawk.tmux.sessionizer.paths = [
config.home.file.projects.target
];
};
}

21
home/modules/sources.nix Normal file
View File

@ -0,0 +1,21 @@
{ lib, inputs, config, ... }:
let
cfg = config.snowhawk.sources;
in
{
options.snowhawk.sources = {
enable = lib.mkEnableOption "nix sources home-manager module";
};
config = lib.mkIf cfg.enable {
home.file = {
"src/nixpkgs".source = inputs.nixpkgs;
"src/home-manager".source = inputs.home-manager;
};
snowhawk.tmux.sessionizer.paths = [
"~/src"
];
};
}

View File

@ -11,6 +11,19 @@ in
snowhawk.tmux.sessionizer = {
enable = lib.mkEnableOption "tmux-sessionizer home-manager module";
paths = lib.mkOption {
type = with lib.types; listOf str;
description = ''
list of paths to select with tmux-sessionizer
'';
default = [ ];
example = [
"~"
"~/projects"
"~/src"
];
};
pkg = lib.mkOption {
type = lib.types.package;
description = ''
@ -35,7 +48,7 @@ in
if [[ $# -eq 1 ]]; then
selected=$1
else
selected=$(${find} -L ~/projects ~/ ~/.config ~/src -mindepth 1 -maxdepth 1 -type d | ${fzf})
selected=$(${find} -L ${lib.escapeShellArgs cfg.paths} -mindepth 1 -maxdepth 1 -type d | ${fzf})
fi
if [[ -z $selected ]]; then

View File

@ -22,5 +22,10 @@ in
home.sessionPath = [
"${config.home.homeDirectory}/.cargo/bin"
];
snowhawk.tmux.sessionizer.paths = [
"~"
"~/.config"
];
};
}

View File

@ -8,6 +8,7 @@
snowhawk = {
alacritty.enable = true;
macos.enable = true;
sources = true;
ssh = {
enable = true;
homeNetwork = true;
@ -41,11 +42,6 @@
fzf
];
home.file = {
"src/nixpkgs".source = inputs.nixpkgs;
"src/home-manager".source = inputs.home-manager;
};
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
home.stateVersion = "23.11";

View File

@ -25,6 +25,7 @@ in
xivlauncher.enable = true;
flameshot.enable = true;
tldr.enable = true;
sources.enable = true;
};
snowhawk.ssh = {
enable = true;
@ -86,11 +87,6 @@ in
nomacs
];
home.file = {
"src/nixpkgs".source = inputs.nixpkgs;
"src/home-manager".source = inputs.home-manager;
};
# wayland.windowManager.hyprland = {
# enable = true;
# package = pkgs.hyprland;