From 76ebdad3ce4fa68423326c85ed5ab2fe8aa5bb9e Mon Sep 17 00:00:00 2001 From: Martin Berg Alstad <git@martials.no> Date: Sun, 2 Feb 2025 15:06:34 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Mpv=20loop=20config,=20moved=20f?= =?UTF-8?q?ish=20aliases=20to=20proper=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- home-manager/default.nix | 6 +- home-manager/fastfetch.nix | 107 ++++++++++++++++++----------------- home-manager/fish.nix | 8 +++ home-manager/kitty.nix | 20 ++++--- home-manager/mpv.nix | 23 +++++--- modules/default.nix | 2 +- modules/shell.nix | 19 +++++++ modules/terminal/default.nix | 11 ---- modules/terminal/shell.nix | 32 ----------- 9 files changed, 113 insertions(+), 115 deletions(-) create mode 100644 modules/shell.nix delete mode 100644 modules/terminal/default.nix delete mode 100644 modules/terminal/shell.nix diff --git a/home-manager/default.nix b/home-manager/default.nix index 1ca2fe1..968c2dd 100644 --- a/home-manager/default.nix +++ b/home-manager/default.nix @@ -26,7 +26,7 @@ in ./rofi ./wlogout ./hyprland - ./spicetify.nix + ./spicetify.nix # TODO env conflict on latest version ./yazi ]; @@ -34,9 +34,7 @@ in enable = true; settings = { # Prefer dark mode for all GTK apps - "org/gnome/desktop/interface" = { - color-scheme = "prefer-dark"; - }; + "org/gnome/desktop/interface".color-scheme = "prefer-dark"; }; }; diff --git a/home-manager/fastfetch.nix b/home-manager/fastfetch.nix index ac86767..3da66cf 100644 --- a/home-manager/fastfetch.nix +++ b/home-manager/fastfetch.nix @@ -1,57 +1,60 @@ { - programs.fastfetch = { - enable = true; - settings = { - logo = { - source = "${../Catppuccin.png}"; - type = "kitty"; - height = 18; - padding.top = 2; + programs = { + fish.shellAliases.fetch = "fastfetch"; + fastfetch = { + enable = true; + settings = { + logo = { + source = "${../Catppuccin.png}"; + type = "kitty"; + height = 18; + padding.top = 2; + }; + display.separator = " "; + modules = + let + keyColor = "34"; + module = type: key: { + inherit type key keyColor; + }; + formatModule = type: key: format: { + inherit + type + key + format + keyColor + ; + }; + in + [ + "break" + "break" + { + type = "title"; + keyWidth = 10; + } + "break" + (module "os" " ") + (module "kernel" " ") + (formatModule "packages" " " "{} (nixpkgs)") + (module "shell" " ") + (module "terminal" " ") + (module "wm" " ") + (module "theme" " ") + (module "cursor" " ") + (module "terminalfont" " ") + (module "uptime" " ") + (formatModule "datetime" " " "{1}-{3}-{11}") + (module "cpu" " ") + (module "gpu" " ") + (module "sound" " ") + (module "lm" " ") + "break" + "colors" + "break" + "break" + ]; }; - display.separator = " "; - modules = - let - keyColor = "34"; - module = type: key: { - inherit type key keyColor; - }; - formatModule = type: key: format: { - inherit - type - key - format - keyColor - ; - }; - in - [ - "break" - "break" - { - type = "title"; - keyWidth = 10; - } - "break" - (module "os" " ") - (module "kernel" " ") - (formatModule "packages" " " "{} (nixpkgs)") - (module "shell" " ") - (module "terminal" " ") - (module "wm" " ") - (module "theme" " ") - (module "cursor" " ") - (module "terminalfont" " ") - (module "uptime" " ") - (formatModule "datetime" " " "{1}-{3}-{11}") - (module "cpu" " ") - (module "gpu" " ") - (module "sound" " ") - (module "lm" " ") - "break" - "colors" - "break" - "break" - ]; }; }; } diff --git a/home-manager/fish.nix b/home-manager/fish.nix index 7e8beac..e041567 100644 --- a/home-manager/fish.nix +++ b/home-manager/fish.nix @@ -17,6 +17,11 @@ in programs = { fish = { enable = true; + # Start starship when creating a new shell + interactiveShellInit = '' + starship init fish | source + fortune | cowsay -f tux + ''; plugins = [ { # !! to get the previous command @@ -30,6 +35,9 @@ in }; } ]; + shellAliases = { + nix-shell = "nix-shell --run fish"; # Start nix-shells using fishcd + }; }; starship = { diff --git a/home-manager/kitty.nix b/home-manager/kitty.nix index 1da5b5e..4316146 100644 --- a/home-manager/kitty.nix +++ b/home-manager/kitty.nix @@ -8,14 +8,18 @@ in flavor = theme.flavor; }; - programs.kitty = { - enable = common.default.terminal == "kitty"; - font.name = theme.nerdFont; - settings = { - background_blur = 5; - background_opacity = 0.8; - confirm_os_window_close = 0; - window_padding_width = 10; + programs = { + # Transfer shell config to target device + fish.shellAliases.ssh = "kitty +kitten ssh"; + kitty = { + enable = common.default.terminal == "kitty"; + font.name = theme.nerdFont; + settings = { + background_blur = 5; + background_opacity = 0.8; + confirm_os_window_close = 0; + window_padding_width = 10; + }; }; }; } diff --git a/home-manager/mpv.nix b/home-manager/mpv.nix index 081d89d..ef88358 100644 --- a/home-manager/mpv.nix +++ b/home-manager/mpv.nix @@ -8,13 +8,22 @@ flavor = theme.flavor; }; - programs.mpv = { - enable = true; - config = { - hwdec = "auto-safe"; - vo = "gpu"; - profile = "gpu-hq"; - gpu-context = "wayland"; + programs = { + fish.shellAliases.mpvl = "mpv --profile=loop"; + mpv = { + enable = true; + config = { + hwdec = "auto-safe"; + vo = "gpu"; + profile = "gpu-hq"; + gpu-context = "wayland"; + }; + profiles = { + loop = { + loop-playlist = "inf"; + loop-file = "inf"; + }; + }; }; }; } diff --git a/modules/default.nix b/modules/default.nix index cb524a3..7830ab7 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -10,8 +10,8 @@ ./hyprland ./sddm.nix ./security.nix + ./shell.nix ./steam.nix - ./terminal ./qt.nix ]; } diff --git a/modules/shell.nix b/modules/shell.nix new file mode 100644 index 0000000..84b5931 --- /dev/null +++ b/modules/shell.nix @@ -0,0 +1,19 @@ +# For Fish dotfiles, see: /home-manager/fish.nix +{ pkgs, ... }: + +{ + programs = { + bash = { + # Starts the OS using Bash, then starts fish if it's not running + interactiveShellInit = '' + if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] + then + shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" + exec ${pkgs.fish}/bin/fish $LOGIN_OPTION + fi + ''; + }; + + fish.enable = true; + }; +} diff --git a/modules/terminal/default.nix b/modules/terminal/default.nix deleted file mode 100644 index 265d24a..0000000 --- a/modules/terminal/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, ... }: - -{ - imports = [ - ./shell.nix - ]; - - environment.systemPackages = with pkgs; [ - kitty - ]; -} diff --git a/modules/terminal/shell.nix b/modules/terminal/shell.nix deleted file mode 100644 index c84a020..0000000 --- a/modules/terminal/shell.nix +++ /dev/null @@ -1,32 +0,0 @@ -# For Fish dotfiles, see: /home-manager/fish.nix and home-manager/starship.nix -{ pkgs, ... }: - -{ - programs = { - bash = { - # Starts the OS using Bash, then starts fish if it's not running - interactiveShellInit = '' - if [[ $(${pkgs.procps}/bin/ps --no-header --pid=$PPID --format=comm) != "fish" && -z ''${BASH_EXECUTION_STRING} ]] - then - shopt -q login_shell && LOGIN_OPTION='--login' || LOGIN_OPTION="" - exec ${pkgs.fish}/bin/fish $LOGIN_OPTION - fi - ''; - }; - - fish = { - enable = true; - # Start starship when creating a new shell - interactiveShellInit = '' - starship init fish | source - fortune | cowsay -f tux - ''; - shellAliases = { - # Transfer shell config to target device - ssh = "kitty +kitten ssh"; - nix-shell = "nix-shell --run fish"; # Start nix-shells using fishcd - fetch = "fastfetch"; - }; - }; - }; -}