diff options
author | Zhongheng Liu <z.liu@outlook.com.gr> | 2024-08-10 13:17:21 +0800 |
---|---|---|
committer | Zhongheng Liu <z.liu@outlook.com.gr> | 2024-08-10 13:17:21 +0800 |
commit | 8bdd51e77a9c997d3a0dfa14b01b57cb16280dcb (patch) | |
tree | 397a18ac92e0b9ab4cb1500f1b7b2536d6ae4a16 | |
parent | 51c7913ad5c29d5ef4efbb84bd02309a10ca9345 (diff) | |
download | nixos-configuration-8bdd51e77a9c997d3a0dfa14b01b57cb16280dcb.tar.gz nixos-configuration-8bdd51e77a9c997d3a0dfa14b01b57cb16280dcb.tar.bz2 nixos-configuration-8bdd51e77a9c997d3a0dfa14b01b57cb16280dcb.zip |
feat: added new configuration for enabling fish shell
-rw-r--r-- | home-manager/stvnliu/home.nix | 27 | ||||
-rw-r--r-- | home-manager/stvnliu/hypr/hyprland.nix | 2 | ||||
-rw-r--r-- | home-manager/stvnliu/shells/aliases/default.nix | 4 | ||||
-rw-r--r-- | home-manager/stvnliu/shells/default.nix | 13 | ||||
-rw-r--r-- | home-manager/stvnliu/shells/fish.nix | 32 | ||||
-rw-r--r-- | home-manager/stvnliu/shells/starship/default.nix | 3 | ||||
-rw-r--r-- | nixos/configuration.nix | 4 |
7 files changed, 73 insertions, 12 deletions
diff --git a/home-manager/stvnliu/home.nix b/home-manager/stvnliu/home.nix index e48ee22..0dfa1dd 100644 --- a/home-manager/stvnliu/home.nix +++ b/home-manager/stvnliu/home.nix @@ -65,6 +65,33 @@ zed-editor rhythmbox ]; + + programs.waybar = { + enable = true; + settings = [ + { + mainBar = { + layer = "top"; + position = "top"; + height = 30; + output = ["eDP-1" "HDMI-A-1"]; + modules-left = ["hyprland/workspaces" "hyprland/mode" "wlr/taskbar"]; + modules-center = ["hyprland/window" "custom/hello-from-waybar"]; + modules-right = ["mpd" "temperature"]; + "hyprland/workspaces" = { + disable-scroll = true; + all-outputs = true; + }; + "custom/hello-from-waybar" = { + format = "hello {}"; + max-length = 40; + interval = "once"; + exec = pkgs.writeShellScript "hello-from-waybar" ''echo "from within waybar"''; + }; + }; + } + ]; + }; programs.git = { enable = true; package = pkgs.gitFull; diff --git a/home-manager/stvnliu/hypr/hyprland.nix b/home-manager/stvnliu/hypr/hyprland.nix index cf36ddc..a57683a 100644 --- a/home-manager/stvnliu/hypr/hyprland.nix +++ b/home-manager/stvnliu/hypr/hyprland.nix @@ -40,7 +40,7 @@ # firefox quickstart "$mod, F, exec, ${pkgs.firefox}/bin/firefox" # foot terminal - "$mod, Return, exec, ${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=16' -o colors.alpha=0.85 zsh" + "$mod, Return, exec, ${pkgs.foot}/bin/foot -f 'BlexMono Nerd Font:size=16' -o colors.alpha=0.85 ${config.myShells.defaultShell}" ] ++ ( # workspaces diff --git a/home-manager/stvnliu/shells/aliases/default.nix b/home-manager/stvnliu/shells/aliases/default.nix index b974333..02954a8 100644 --- a/home-manager/stvnliu/shells/aliases/default.nix +++ b/home-manager/stvnliu/shells/aliases/default.nix @@ -1,6 +1,6 @@ {pkgs}: { - cd = "z"; - cdi = "zi"; + #cd = "z"; + #cdi = "zi"; ls = "${pkgs.eza}/bin/exa"; cat = "${pkgs.bat}/bin/bat"; ll = "ls -l"; diff --git a/home-manager/stvnliu/shells/default.nix b/home-manager/stvnliu/shells/default.nix index a5f14f9..54807d3 100644 --- a/home-manager/stvnliu/shells/default.nix +++ b/home-manager/stvnliu/shells/default.nix @@ -9,19 +9,20 @@ in with lib; { imports = [ ./zsh.nix + ./fish.nix ./direnv.nix ./starship ]; + options.myShells = { + defaultShell = with types; mkOption {type = str;}; enable = mkEnableOption "Enables the shell customisation module."; - useZsh = mkOption { - type = types.bool; - default = true; - }; }; - config = mkIf cfg.enable { + config = { myShells = { - zsh.enable = cfg.useZsh; + zsh.enable = false; + fish.enable = true; + defaultShell = "fish"; prompts.starship.enable = true; }; }; diff --git a/home-manager/stvnliu/shells/fish.nix b/home-manager/stvnliu/shells/fish.nix new file mode 100644 index 0000000..d2f423c --- /dev/null +++ b/home-manager/stvnliu/shells/fish.nix @@ -0,0 +1,32 @@ +{ + pkgs, + config, + lib, + ... +}: let + cfg = config.myShells.fish; +in + with lib; { + options = { + myShells.fish = { + enable = mkEnableOption "Enables fish and components."; + }; + }; + config = mkIf cfg.enable { + programs.fish = { + enable = true; + shellAliases = import ./aliases {inherit pkgs;}; + plugins = [ + #{ + # name = "z"; + # src = pkgs.fetchFromGitHub { + # owner = "jethrokuan"; + # repo = "z"; + # rev = "ddeb28a7b6a1f0ec6dae40c636e5ca4908ad160a"; + # sha256 = "0c5i7sdrsp0q3vbziqzdyqn4fmp235ax4mn4zslrswvn8g3fvdyh"; + # }; + #} + ]; + }; + }; + } diff --git a/home-manager/stvnliu/shells/starship/default.nix b/home-manager/stvnliu/shells/starship/default.nix index f53766a..14480f3 100644 --- a/home-manager/stvnliu/shells/starship/default.nix +++ b/home-manager/stvnliu/shells/starship/default.nix @@ -17,7 +17,8 @@ in config = { programs.starship = { enable = true; - enableZshIntegration = true; + enableZshIntegration = config.myShells.zsh.enable; + enableFishIntegration = config.myShells.fish.enable; settings = builtins.fromTOML (builtins.readFile cfg.confPath); }; }; diff --git a/nixos/configuration.nix b/nixos/configuration.nix index cad4cf7..80f254e 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -15,7 +15,7 @@ ./services/laptop.preset.nix ./hardware-configuration.nix ]; - boot.kernelPackages = pkgs.linuxPackages_latest; + #boot.kernelPackages = pkgs.linuxPackages_latest; boot.supportedFilesystems = ["ntfs"]; security.pam.services.hyprlock = {}; hardware.bluetooth = { @@ -98,7 +98,7 @@ packages = with pkgs; [ nh ]; - extraGroups = ["wheel"]; + extraGroups = ["wheel" "input"]; }; }; services.openssh = { |