diff --git a/config/base.nix b/config/base.nix index 4270753..0fa99ac 100644 --- a/config/base.nix +++ b/config/base.nix @@ -16,8 +16,18 @@ }; nix.registry = (lib.mapAttrs (_: flake: {inherit flake;})) ((lib.filterAttrs (_: lib.isType "flake")) inputs); - nix.nixPath = ["/etc/nix/path"]; + programs.fish.enable = true; + programs.bash = { + 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 + ''; + }; + users.defaultUserShell = pkgs.bash; environment.etc = lib.mapAttrs' (name: value: { @@ -78,7 +88,7 @@ boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; console.keyMap = "sv-latin1"; - programs.zsh.enable = true; + # programs.zsh.enable = true; services = { openssh = { diff --git a/config/home.nix b/config/home.nix index b3dd2f2..1b5246e 100644 --- a/config/home.nix +++ b/config/home.nix @@ -13,7 +13,9 @@ ../moduler/common/dmenu.nix ../moduler/common/kitty.nix ../moduler/common/tmux.nix - ../moduler/common/zsh.nix + # ../moduler/common/zsh.nix + ../moduler/common/fish.nix + ../moduler/common/starship.nix ../moduler/common/git.nix ../moduler/common/nixpkgs.nix ../moduler/common/firefox.nix @@ -69,6 +71,7 @@ bluez-tools sops age + grc #Terminal git @@ -90,6 +93,8 @@ poppler_utils pandoc ncspot + starship + any-nix-shell #Desktop aerc @@ -163,6 +168,7 @@ dotnetPackages.Nuget ]; programs.home-manager.enable = true; + programs.fish.enable = true; xsession.enable = true; xsession.windowManager.command = "exec dwm"; diff --git a/config/users.nix b/config/users.nix index 750fba2..171f254 100644 --- a/config/users.nix +++ b/config/users.nix @@ -4,7 +4,7 @@ }: { # TODO: Configure your system-wide user settings (groups, etc), add more users as needed. users = { - defaultUserShell = pkgs.zsh; + defaultUserShell = pkgs.bash; users = { fw = { initialPassword = "password"; diff --git a/maskiner/laptop/configuration.nix b/maskiner/laptop/configuration.nix index 83d48f9..3ebaeb6 100644 --- a/maskiner/laptop/configuration.nix +++ b/maskiner/laptop/configuration.nix @@ -16,15 +16,9 @@ ]; networking.hostName = myhostname; - sops.defaultSopsFile = ../../secrets/fred.yaml; - # This will automatically import SSH keys as age keys - sops.age.sshKeyPaths = [ "~/.ssh/id_ed" ]; - # This is using an age key that is expected to already be in the filesystem - sops.age.keyFile = "~/.config/sops/age/keys.txt"; - sops.secrets.spotify_password = {}; services.xserver.dpi = 140; - services.spotifyd.settings.password = "${config.sops.secrets.spotify_password}"; + # services.spotifyd.settings.password = config.sops.secrets."spotify_password".path; # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = "23.11"; } diff --git a/moduler/common/fish.nix b/moduler/common/fish.nix index 2292d60..6eee371 100644 --- a/moduler/common/fish.nix +++ b/moduler/common/fish.nix @@ -12,7 +12,17 @@ sha256 = "0dbnir6jbwjpjalz14snzd3cgdysgcs3raznsijd6savad3qhijc"; }; } - { name = "grc"; src = pkgs.fishPlugins.grc.src; } + { + name = "grc"; + src = pkgs.fishPlugins.grc.src; + } ]; + shellAbbrs = { + homec="nvim ~/nix/config/home.nix"; + ls="exa -lag --header"; + }; + interactiveShellInit = '' + ${pkgs.any-nix-shell}/bin/any-nix-shell fish --info-right | source + ''; }; } diff --git a/moduler/common/kitty.nix b/moduler/common/kitty.nix index d74f88e..2750ded 100644 --- a/moduler/common/kitty.nix +++ b/moduler/common/kitty.nix @@ -12,7 +12,7 @@ # size = 30; }; shellIntegration = { - enableZshIntegration = true; + # enableZshIntegration = true; mode = "no-cursor"; }; theme = "Catppuccin-Macchiato"; diff --git a/moduler/common/spotifyd.nix b/moduler/common/spotifyd.nix index 63e2270..fca3e3e 100644 --- a/moduler/common/spotifyd.nix +++ b/moduler/common/spotifyd.nix @@ -4,7 +4,7 @@ enable = true; settings = { username = "fredzyw"; - password = sops.secrets.spotify_password; + # password = sops.secrets.spotify_password; device_name = myhostname; }; }; diff --git a/moduler/common/starship.nix b/moduler/common/starship.nix index c75a7c4..fa73e30 100644 --- a/moduler/common/starship.nix +++ b/moduler/common/starship.nix @@ -1,20 +1,59 @@ # This file is generated from "README.org" { pkgs, ... }: { - programs.starship.enable = true; - programs.starship.enableFishIntegration = true; - programs.starship.package = pkgs.unstable.starship; - programs.starship.settings.add_newline = true; - programs.starship.settings.character = { - success_symbol = "[𝝺](#c792ea)"; - vicmd_symbol = "[ ](bold green)"; - error_symbol = "[☓ ](bold red)"; - }; - programs.starship.settings.directory = { - style = "bold cyan"; - }; - programs.starship.settings.nix_shell = { - disabled = false; - symbol = " "; - }; + programs.starship = + let + flavour = "macchiato"; # One of `latte`, `frappe`, `macchiato`, or `mocha` + in + { + enable = true; + enableFishIntegration = true; + settings = { + # Other config here + # format = "$all"; # Remove this line to disable the default prompt format + palette = "catppuccin_${flavour}"; + nix_shell = { + disabled = false; + symbol = " "; + }; + } // builtins.fromTOML (builtins.readFile + (pkgs.fetchFromGitHub + { + owner = "catppuccin"; + repo = "starship"; + rev = "5629d2356f62a9f2f8efad3ff37476c19969bd4f"; # Replace with the latest commit hash + sha256 = "sha256-nsRuxQFKbQkyEI4TXgvAjcroVdG+heKX5Pauq/4Ota0="; + } + /palettes/${flavour}.toml)); + }; + # programs.starship = { + # enable = true; + # enableFishIntegration = true; + # package = pkgs.starship; + # settings = { + # # Other config here + # format = "$all"; # Remove this line to disable the default prompt format + # palette = "catppuccin_macchiato"; + # add_newline = true; + # character = { + # success_symbol = "[𝝺](#c792ea)"; + # vicmd_symbol = "[ ](bold green)"; + # error_symbol = "[☓ ](bold red)"; + # }; + # directory = { + # style = "bold cyan"; + # }; + # nix_shell = { + # disabled = false; + # symbol = " "; + # }; + # } // builtins.fromTOML (builtins.readFile + # (pkgs.fetchFromGitHub + # { + # owner = "catppuccin"; + # repo = "starship"; + # rev = ""; # Replace with the latest commit hash + # sha256 = ""; + # } + /palettes/macchiato.toml)); + # }; + # } } diff --git a/moduler/common/zsh.nix b/moduler/common/zsh.nix index 55dd6be..e555c5b 100644 --- a/moduler/common/zsh.nix +++ b/moduler/common/zsh.nix @@ -21,8 +21,20 @@ file = "share/zsh-powerlevel10k/powerlevel10k.zsh-theme"; } { - name = "zsh-syntax-highlighting"; - src = pkgs.zsh-syntax-highlighting; + name = "fash-syntax-highlighting"; + file = "fast-syntax-highlighting.plugin.zsh"; + src = builtins.fetchGit { + url = "https://github.com/zdharma-continuum/fast-syntax-highlighting"; + rev = "cf318e06a9b7c9f2219d78f41b46fa6e06011fd9"; + }; + } + { + name = "zsh-fzf-history-search"; + file = "zsh-fzf-history-search.plugin.zsh"; + src = builtins.fetchGit { + url = "https://github.com/joshskidmore/zsh-fzf-history-search"; + rev = "741012388886e7ee39330fe3cdb6a4803012dc0b"; + }; } { name = "zsh-autosuggestions";