From 609af95915087d37d798c3304d77c7e7f4cca155 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Sun, 1 Sep 2024 12:15:52 +0400 Subject: [PATCH] yeah --- hosts/sakopc/configuration.nix | 1 + hosts/sakotop/configuration.nix | 2 ++ modules/shell/nix/default.nix | 1 + modules/shell/nix/nix-tree.nix | 14 ++++++++++++++ modules/shell/zsh/default.nix | 1 + 5 files changed, 19 insertions(+) create mode 100644 modules/shell/nix/nix-tree.nix diff --git a/hosts/sakopc/configuration.nix b/hosts/sakopc/configuration.nix index 1fc0707b..bdd16beb 100644 --- a/hosts/sakopc/configuration.nix +++ b/hosts/sakopc/configuration.nix @@ -94,6 +94,7 @@ search.enable = true; switch-to-configuration-ng.enable = true; nh.enable = true; + tree.enable = true }; zsh.enable = true; tmux.enable = true; diff --git a/hosts/sakotop/configuration.nix b/hosts/sakotop/configuration.nix index 6a0035e2..faa844d8 100644 --- a/hosts/sakotop/configuration.nix +++ b/hosts/sakotop/configuration.nix @@ -114,6 +114,8 @@ switch-to-configuration-ng.enable = true; # better cli nh.enable = true; + # tree + tree.enable = true; }; zsh.enable = true; tmux.enable = true; diff --git a/modules/shell/nix/default.nix b/modules/shell/nix/default.nix index 35a1c998..241c2721 100644 --- a/modules/shell/nix/default.nix +++ b/modules/shell/nix/default.nix @@ -4,5 +4,6 @@ ./optimization.nix ./switch-to-configuration-ng.nix ./nh.nix + ./nix-tree.nix ]; } diff --git a/modules/shell/nix/nix-tree.nix b/modules/shell/nix/nix-tree.nix new file mode 100644 index 00000000..e2d89957 --- /dev/null +++ b/modules/shell/nix/nix-tree.nix @@ -0,0 +1,14 @@ +{ inputs, options, config, lib, pkgs, ...}: +let cfg = config.modules.shell.nix.tree; +in +{ + options.modules.shell.nix.tree = { + enable = lib.mkEnableOption false; + }; + + config = lib.mkIf cfg.enable { + users.users.sako.packages = with pkgs; [ + nix-tree + ]; + }; +} diff --git a/modules/shell/zsh/default.nix b/modules/shell/zsh/default.nix index 897ea075..50a39efc 100644 --- a/modules/shell/zsh/default.nix +++ b/modules/shell/zsh/default.nix @@ -41,6 +41,7 @@ in { shell = "nix shell"; run = "nix run"; cleanup = "sudo nix-collect-garbage --delete-older-than 3d && nix-collect-garbage -d"; + current-system-tree = "nix-tree /nix/var/nix/profiles/system"; }; plugins = [ {