fork/home-manager

git clone https://git.julia.blue/fork/home-manager

mat essfish: always run fish_indent7e81e7ae

master
1.1 KiB42 linesraw
1{ lib, pkgs, ... }:
2
3let
4  fishRegex = ''
5    function __fish_command_not_found_handler --on-event fish_command_not_found
6        /nix/store/.*command-not-found $argv
7    end
8  '';
9in {
10  config = {
11    programs.bash.enable = true;
12    programs.fish.enable = true;
13    programs.zsh.enable = true;
14
15    # Needed to avoid error with dummy fish package.
16    xdg.dataFile."fish/home-manager_generated_completions".source =
17      lib.mkForce (builtins.toFile "empty" "");
18
19    test.stubs.zsh = { };
20
21    programs.nix-index.enable = true;
22
23    nmt.script = ''
24      # Bash integration
25      assertFileExists home-files/.bashrc
26      assertFileRegex \
27        home-files/.bashrc \
28        'source /nix/store/.*nix-index.*/etc/profile.d/command-not-found.sh'
29
30      # Zsh integration
31      assertFileExists home-files/.zshrc
32      assertFileRegex \
33        home-files/.zshrc \
34        'source /nix/store/.*nix-index.*/etc/profile.d/command-not-found.sh'
35
36      # Fish integration
37      assertFileExists home-files/.config/fish/config.fish
38      assertFileRegex \
39        home-files/.config/fish/config.fish '${fishRegex}'
40    '';
41  };
42}