Commit 5d308fb572b9

Vincent Demeester <vincent@sbr.pm>
2019-06-30 17:30:02
profiles: add zsh, enable it by default
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent b64b93d
Changed files (4)
modules/profiles/fish.nix
@@ -8,7 +8,35 @@ in
   options = {
     profiles.fish = {
       enable = mkOption {
-        default = true;
+        default = false;
+        description = "Enable fish profile";
+        type = types.bool;
+      };
+    };
+  };
+  config = mkIf cfg.enable {
+    programs.fish = {
+      enable = true;
+      promptInit = ''
+        source /etc/fish/functions/fish_prompt.fish
+        source /etc/fish/functions/fish_right_prompt.fish
+      '';
+    };
+    environment.etc."fish/functions/fish_prompt.fish".source = ./assets/fish/fish_prompt.fish;
+    environment.etc."fish/functions/fish_right_prompt.fish".source = ./assets/fish/fish_right_prompt.fish;
+  };
+}
+{ config, lib, pkgs, ... }:
+
+with lib;
+let
+  cfg = config.profiles.fish;
+in
+{
+  options = {
+    profiles.fish = {
+      enable = mkOption {
+        default = false;
         description = "Enable fish profile";
         type = types.bool;
       };
modules/profiles/users.nix
@@ -31,7 +31,7 @@ in
                     ++ optionals config.profiles.docker.enable [ "docker" ]
                     ++ optionals config.profiles.buildkit.enable [ "buildkit" ]
                     ++ optionals config.profiles.virtualization.enable [ "libvirtd" "vboxusers" ];
-          shell = if config.programs.fish.enable then pkgs.fish else pkgs.bash;
+          shell = if config.programs.fish.enable then pkgs.fish else pkgs.zsh;
           initialPassword = "changeMe";
           openssh.authorizedKeys.keys =
             with import ../../assets/machines.nix; [ ssh.kerkouane.key ssh.hokkaido.key ssh.california.key ssh.carthage.key ssh.wakasu.key ssh.vincent.key ssh.kobe.key ssh.houbeb.key ssh.phantom.key ssh.okinawa.key ssh.naruhodo.key ];
modules/profiles/zsh.nix
@@ -0,0 +1,22 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+let
+  cfg = config.profiles.zsh;
+in
+{
+  options = {
+    profiles.zsh = {
+      enable = mkOption {
+        default = true;
+        description = "Enable zsh profile";
+        type = types.bool;
+      };
+    };
+  };
+  config = mkIf cfg.enable {
+    programs.zsh = {
+      enable = true;
+    };
+  };
+}
modules/module-list.nix
@@ -29,6 +29,7 @@
     ./profiles/virtualization.nix
     ./profiles/wireguard.server.nix
     ./profiles/yubikey.nix
+    ./profiles/zsh.nix
     ./programs/podman.nix
     ./services/athens.nix
     ./services/coredns.nix