Skip to content

Commit

Permalink
Cleanup (#117)
Browse files Browse the repository at this point in the history
* Remove obsolete jh config.

* Move XDG config files to a better place.

* Fix tmux binding.
  • Loading branch information
attilaolah authored Oct 1, 2024
1 parent 58a3d99 commit 95df800
Show file tree
Hide file tree
Showing 16 changed files with 90 additions and 122 deletions.
Binary file removed home-manager/.config/wallpapers/alpeli-1020m.jpg
Binary file not shown.
98 changes: 9 additions & 89 deletions home-manager/file.nix
Original file line number Diff line number Diff line change
@@ -1,93 +1,13 @@
{
config,
desktop,
lib,
pkgs,
...
}: let
desktopAttrs = attrs: lib.attrsets.optionalAttrs desktop attrs;
foot-catppuccin-mocha = pkgs.stdenv.mkDerivation {
name = "foot-catppuccin-mocha";
# TODO: renovate
src = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "foot";
rev = "ee5549af72ab78520ac2aa1c671bf5c2d347c8ca";
sha256 = "sha256-3hK9klXwdHhprG2wUMt7nBfbL1mb/gl+k/MtJUuY000=";
{lib, ...}: {
home.file = {
".sops.yaml".text = lib.generators.toYAML {} {
creation_rules = [
{pgp = "BF2E475974D388E0E30C960407E6C0643FD142C3";}
];
};
installPhase = ''
cp --recursive catppuccin-mocha.ini $out
".ssh/config".text = ''
# Force GPG-agent's pinentry to use the current tmux pane.
Match host * exec "gpg-connect-agent UPDATESTARTUPTTY /bye"
'';
};
in {
home.file =
{
".sops.yaml".text = lib.generators.toYAML {} {
creation_rules = [
{pgp = "BF2E475974D388E0E30C960407E6C0643FD142C3";}
];
};
".ssh/config".text = ''
# Force GPG-agent's pinentry to use the current tmux pane.
Match host * exec "gpg-connect-agent UPDATESTARTUPTTY /bye"
'';
# TODO: Use xdg.configFile!
".config/nvim/init.lua".source = ./.config/nvim/init.lua;
".config/nvim/lua/chadrc.lua".source = ./.config/nvim/lua/chadrc.lua;
".config/nvim/lua/configs/conform.lua".source = ./.config/nvim/lua/configs/conform.lua;
".config/nvim/lua/configs/lazy.lua".source = ./.config/nvim/lua/configs/lazy.lua;
".config/nvim/lua/configs/lspconfig.lua".source = ./.config/nvim/lua/configs/lspconfig.lua;
".config/nvim/lua/mappings.lua".source = ./.config/nvim/lua/mappings.lua;
".config/nvim/lua/options.lua".source = ./.config/nvim/lua/options.lua;
".config/nvim/lua/plugins/init.lua".source = ./.config/nvim/lua/plugins/init.lua;
}
// desktopAttrs (let
brightnessctl = lib.getExe pkgs.brightnessctl;
hyprctl = lib.getExe' pkgs.hyprland "hyprctl";
hyprlock = lib.getExe pkgs.hyprlock;
loginctl = lib.getExe' pkgs.systemd "loginctl";
pidof = lib.getExe' pkgs.procps "pidof";
in {
# TODO: Use xdg.configFile!
".config/foot/foot.ini".text =
(lib.generators.toINI {} {
main = {
font = "monospace:size=16";
font-size-adjustment = 2;
};
})
+ builtins.readFile foot-catppuccin-mocha;

".config/hypr/hypridle.conf".text = ''
general {
lock_cmd = ${pidof} ${hyprlock} || ${hyprlock}
before_sleep_cmd = ${loginctl} lock-session
after_sleep_cmd = ${hyprctl} dispatch dpms on
}
listener {
timeout = ${toString (60 * 2)}
on-timeout = ${brightnessctl} --save set 5%
on-resume = ${brightnessctl} --restore
}
listener {
timeout = ${toString (60 * 20)}
on-timeout = ${hyprctl} dispatch dpms off
on-resume = ${hyprctl} dispatch dpms on
}
'';
# listener {
# timeout = ${toString (60 * 20 + 20)}
# on-timeout = ${loginctl} lock-session
# }

".config/davfs.conf".text = ''
secrets ${config.home.homeDirectory}/.config/davfs.secrets
'';

# Wallpaper:
".config/wallpapers/alpeli-1020m.jpg".source = ./.config/wallpapers/alpeli-1020m.jpg;

".config/wofi/style.css".source = ./.config/wofi/style.css;
});
}
4 changes: 2 additions & 2 deletions home-manager/programs/tmux.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
# Re-numbber windows on close.
set-option -g renumber-windows on
# Set by tmux-vim-navigator.
unbind -n C-L
# Undo tmux-vim-navigator binding.
unbind -n C-l
'';
};
}
81 changes: 79 additions & 2 deletions home-manager/xdg/config_file.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,82 @@
{
xdg.configFile = {
"hypr/hyprlock.conf".source = ./hypr/hyprlock.conf;
config,
desktop,
lib,
pkgs,
...
}: let
desktopAttrs = attrs: lib.attrsets.optionalAttrs desktop attrs;
foot-catppuccin-mocha = pkgs.stdenv.mkDerivation {
name = "foot-catppuccin-mocha";
# TODO: renovate
src = pkgs.fetchFromGitHub {
owner = "catppuccin";
repo = "foot";
rev = "ee5549af72ab78520ac2aa1c671bf5c2d347c8ca";
sha256 = "sha256-3hK9klXwdHhprG2wUMt7nBfbL1mb/gl+k/MtJUuY000=";
};
installPhase = ''
cp --recursive catppuccin-mocha.ini $out
'';
};
in {
xdg.configFile =
{
"hypr/hyprlock.conf".source = ./hypr/hyprlock.conf;
"nvim/init.lua".source = ./nvim/init.lua;
"nvim/lua/chadrc.lua".source = ./nvim/lua/chadrc.lua;
"nvim/lua/configs/conform.lua".source = ./nvim/lua/configs/conform.lua;
"nvim/lua/configs/lazy.lua".source = ./nvim/lua/configs/lazy.lua;
"nvim/lua/configs/lspconfig.lua".source = ./nvim/lua/configs/lspconfig.lua;
"nvim/lua/mappings.lua".source = ./nvim/lua/mappings.lua;
"nvim/lua/options.lua".source = ./nvim/lua/options.lua;
"nvim/lua/plugins/init.lua".source = ./nvim/lua/plugins/init.lua;
}
// desktopAttrs (let
brightnessctl = lib.getExe pkgs.brightnessctl;
hyprctl = lib.getExe' pkgs.hyprland "hyprctl";
hyprlock = lib.getExe pkgs.hyprlock;
loginctl = lib.getExe' pkgs.systemd "loginctl";
pidof = lib.getExe' pkgs.procps "pidof";
in {
# TODO: Use xdg.configFile!
"foot/foot.ini".text =
(lib.generators.toINI {} {
main = {
font = "monospace:size=16";
font-size-adjustment = 2;
};
})
+ builtins.readFile foot-catppuccin-mocha;

"hypr/hypridle.conf".text = ''
general {
lock_cmd = ${pidof} ${hyprlock} || ${hyprlock}
before_sleep_cmd = ${loginctl} lock-session
after_sleep_cmd = ${hyprctl} dispatch dpms on
}
listener {
timeout = ${toString (60 * 2)}
on-timeout = ${brightnessctl} --save set 5%
on-resume = ${brightnessctl} --restore
}
listener {
timeout = ${toString (60 * 20)}
on-timeout = ${hyprctl} dispatch dpms off
on-resume = ${hyprctl} dispatch dpms on
}
'';
# TODO: re-enable!
# listener {
# timeout = ${toString (60 * 20 + 20)}
# on-timeout = ${loginctl} lock-session
# }

"davfs.conf".text = ''
secrets ${config.home.homeDirectory}/.config/davfs.secrets
'';

"wofi/style.css".source = ./wofi/style.css;
});
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions hosts/jh/README.md

This file was deleted.

4 changes: 0 additions & 4 deletions hosts/jh/wireguard/.sops.yaml

This file was deleted.

19 changes: 0 additions & 19 deletions hosts/jh/wireguard/dh8.ini

This file was deleted.

0 comments on commit 95df800

Please sign in to comment.