home-manager/tests/default.nix

242 lines
7.1 KiB
Nix
Raw Normal View History

2021-01-29 16:43:49 +00:00
{ pkgs ? import <nixpkgs> {}, enableBig ? true }:
2018-12-10 23:51:48 +00:00
let
lib = import ../modules/lib/stdlib-extended.nix pkgs.lib;
nmt = fetchTarball {
url =
2023-05-15 22:23:00 +00:00
"https://gitlab.com/api/v4/projects/rycee%2Fnmt/repository/archive.tar.gz?sha=4df00c569b1badfedffecd7ccd60f794550486db";
sha256 = "1cyly1zazgj8z6bazml4js7lqaqvpp8lw045aqchlpvp42bl1lp4";
};
2018-12-10 23:51:48 +00:00
modules = import ../modules/modules.nix {
inherit lib pkgs;
check = false;
} ++ [
{
# Bypass <nixpkgs> reference inside modules/modules.nix to make the test
# suite more pure.
_module.args.pkgsPath = pkgs.path;
# Fix impurities. Without these some of the user's environment
# will leak into the tests through `builtins.getEnv`.
xdg.enable = true;
home = {
username = "hm-user";
homeDirectory = "/home/hm-user";
stateVersion = lib.mkDefault "18.09";
};
# Avoid including documentation since this will cause
# unnecessary rebuilds of the tests.
manual.manpages.enable = false;
imports = [ ./asserts.nix ./big-test.nix ./stubs.nix ];
test.enableBig = enableBig;
}
];
isDarwin = pkgs.stdenv.hostPlatform.isDarwin;
isLinux = pkgs.stdenv.hostPlatform.isLinux;
2018-12-10 23:51:48 +00:00
in
import nmt {
inherit lib pkgs modules;
2018-12-10 23:51:48 +00:00
testedAttrPath = [ "home" "activationPackage" ];
tests = builtins.foldl' (a: b: a // (import b)) { } ([
./lib/generators
./lib/types
./modules/files
./modules/home-environment
./modules/misc/fontconfig
nix: add structural settings (#2718) Nix permits user level configurations through ~/.config/nix/nix.conf that allow customization of system-wide settings and behavior. This is beneficial in chroot environments and for per-user configurations. System level Nix configurations in the form of /etc/nix/nix.conf can be specified declaratively via the NixOS nix module but as of currently no counter part exists in home-manager. This PR is a port of the RFC42 implementation for the NixOS nix module[1] to home-manager. Non-applicable options have been excluded and the config generation backends have been tweaked to the backends offered by home-manager. A notable change from the NixOS module is a mandatory option to specify the Nix binary corresponding to the version "nix.conf" should be generated against. This is necessary because the validation phase is dependent on the `nix show-config` subcommand on the host platform. While it is possible to avoid validation entirely, the lack of type checking was deemed too significant. In NixOs, the version information can be retrieved from the `package` option itself which declares the Nix binary system-wide. However in home-manager, there is no pure way to detect the system Nix version and what state version the "nix.conf" should be generated against. Thus an option is used to overcome this limitation by forcing the user to specify the Nix package. Note this interaction can still be automated by forwarding the system-wide Nix package to the home-manager module if needed. Three unit tests were added to test the module behavior for the empty settings, the example settings and the example registry configurations respectively. [1] - NixOS/nixpkgs#139075
2022-03-18 02:47:32 +00:00
./modules/misc/nix
./modules/misc/specialisation
./modules/programs/aerc
./modules/programs/alacritty
./modules/programs/alot
./modules/programs/antidote
2020-04-28 18:38:41 +00:00
./modules/programs/aria2
./modules/programs/atuin
./modules/programs/autojump
./modules/programs/bash
./modules/programs/bat
./modules/programs/bottom
./modules/programs/broot
./modules/programs/browserpass
2022-08-17 16:16:01 +00:00
./modules/programs/btop
2023-04-14 21:41:51 +00:00
./modules/programs/comodoro
2023-03-27 18:25:17 +00:00
./modules/programs/darcs
2020-05-06 16:23:40 +00:00
./modules/programs/dircolors
./modules/programs/direnv
./modules/programs/emacs
./modules/programs/feh
./modules/programs/fish
./modules/programs/gallery-dl
2020-10-15 20:25:47 +00:00
./modules/programs/gh
2023-05-05 17:25:28 +00:00
./modules/programs/git-cliff
./modules/programs/git
./modules/programs/gpg
2022-01-03 23:09:24 +00:00
./modules/programs/helix
./modules/programs/himalaya
./modules/programs/htop
2022-08-01 15:03:41 +00:00
./modules/programs/hyfetch
2020-05-01 03:49:20 +00:00
./modules/programs/i3status
./modules/programs/irssi
2023-01-27 21:15:17 +00:00
./modules/programs/jujutsu
2022-10-23 19:22:14 +00:00
./modules/programs/k9s
./modules/programs/kakoune
./modules/programs/kitty
./modules/programs/khal
./modules/programs/ledger
./modules/programs/less
./modules/programs/lf
./modules/programs/lieer
./modules/programs/man
./modules/programs/mbsync
./modules/programs/micro
./modules/programs/mpv
./modules/programs/mu
./modules/programs/mujmap
2020-08-26 19:20:54 +00:00
./modules/programs/ncmpcpp
./modules/programs/ne
./modules/programs/neomutt
./modules/programs/neovim
./modules/programs/newsboat
2022-08-17 11:58:46 +00:00
./modules/programs/nheko
./modules/programs/nix-index
./modules/programs/nnn
2020-07-24 15:15:55 +00:00
./modules/programs/nushell
2022-09-29 11:08:53 +00:00
./modules/programs/oh-my-posh
./modules/programs/pandoc
2023-01-27 04:20:00 +00:00
./modules/programs/papis
./modules/programs/pet
2022-03-28 15:19:38 +00:00
./modules/programs/pistol
2022-09-30 16:53:39 +00:00
./modules/programs/pls
./modules/programs/powerline-go
./modules/programs/pubs
./modules/programs/pyenv
2020-04-07 07:10:07 +00:00
./modules/programs/qutebrowser
./modules/programs/readline
./modules/programs/ripgrep
2023-06-07 08:32:56 +00:00
./modules/programs/rtx
2021-12-30 11:47:44 +00:00
./modules/programs/sagemath
2021-01-30 02:29:23 +00:00
./modules/programs/sbt
./modules/programs/scmpuff
./modules/programs/sioyek
2021-07-11 17:28:56 +00:00
./modules/programs/sm64ex
./modules/programs/ssh
./modules/programs/starship
2023-02-08 16:59:38 +00:00
./modules/services/syncthing/common
./modules/programs/taskwarrior
./modules/programs/texlive
2022-09-21 20:59:50 +00:00
./modules/programs/tmate
./modules/programs/tmux
2021-04-28 23:56:58 +00:00
./modules/programs/topgrade
2023-05-11 09:21:18 +00:00
./modules/programs/translate-shell
./modules/programs/vim-vint
./modules/programs/vscode
./modules/programs/watson
2022-04-08 06:48:27 +00:00
./modules/programs/wezterm
./modules/programs/zellij
./modules/programs/zplug
./modules/programs/zsh
./modules/xresources
] ++ lib.optionals isDarwin [
./modules/launchd
./modules/targets-darwin
./modules/programs/goimapnotify
] ++ lib.optionals isLinux [
./modules/config/i18n
2021-06-15 22:59:25 +00:00
./modules/i18n/input-method
./modules/misc/debug
./modules/misc/editorconfig
./modules/misc/gtk
./modules/misc/numlock
./modules/misc/pam
./modules/misc/qt
./modules/misc/xdg
./modules/misc/xsession
./modules/programs/abook
./modules/programs/autorandr
./modules/programs/beets # One test relies on services.mpd
2022-09-25 17:27:04 +00:00
./modules/programs/borgmatic
./modules/programs/boxxy
./modules/programs/firefox
./modules/programs/foot
2023-03-01 14:57:55 +00:00
./modules/programs/fuzzel
./modules/programs/getmail
./modules/programs/gnome-terminal
./modules/programs/hexchat
./modules/programs/i3status-rust
./modules/programs/imv
./modules/programs/kodi
2022-10-09 18:11:59 +00:00
./modules/programs/looking-glass-client
2021-06-12 07:55:58 +00:00
./modules/programs/mangohud
2020-08-26 19:20:54 +00:00
./modules/programs/ncmpcpp-linux
./modules/programs/rbw
./modules/programs/rofi
./modules/programs/rofi-pass
2022-06-07 19:01:14 +00:00
./modules/programs/swaylock
./modules/programs/terminator
./modules/programs/thunderbird
2020-07-29 20:29:51 +00:00
./modules/programs/waybar
2023-01-31 16:06:18 +00:00
./modules/programs/wlogout
./modules/programs/wofi
./modules/programs/xmobar
2022-09-09 07:56:07 +00:00
./modules/programs/yt-dlp
./modules/services/avizo
./modules/services/barrier
2022-09-25 17:27:04 +00:00
./modules/services/borgmatic
2022-10-27 17:08:14 +00:00
./modules/services/cachix-agent
2022-08-27 18:52:41 +00:00
./modules/services/clipman
2023-04-14 21:41:51 +00:00
./modules/services/comodoro
./modules/services/devilspie2
./modules/services/dropbox
./modules/services/emacs
./modules/services/espanso
2021-10-11 19:41:49 +00:00
./modules/services/flameshot
./modules/services/fluidsynth
./modules/services/fnott
./modules/services/fusuma
2021-07-15 01:20:28 +00:00
./modules/services/git-sync
2021-11-25 18:28:18 +00:00
./modules/services/gpg-agent
2019-02-24 19:33:56 +00:00
./modules/services/gromit-mpx
./modules/services/home-manager-auto-upgrade
2020-04-12 13:42:43 +00:00
./modules/services/kanshi
./modules/services/lieer
./modules/services/mopidy
2022-03-03 23:43:40 +00:00
./modules/services/mpd
2022-05-25 16:31:08 +00:00
./modules/services/mpdris2
2022-12-27 17:15:51 +00:00
./modules/services/mpd-mpris
2021-06-07 21:38:42 +00:00
./modules/services/pantalaimon
2022-12-28 21:16:14 +00:00
./modules/services/parcellite
./modules/services/pass-secret-service
2020-12-03 02:55:37 +00:00
./modules/services/pbgopy
./modules/services/picom
2021-01-30 17:20:36 +00:00
./modules/services/playerctld
2020-03-02 21:31:15 +00:00
./modules/services/polybar
2022-02-07 10:54:09 +00:00
./modules/services/recoll
./modules/services/redshift-gammastep
./modules/services/screen-locker
./modules/services/swayidle
2023-07-07 08:15:43 +00:00
./modules/services/swayosd
./modules/services/sxhkd
2023-02-08 16:59:38 +00:00
./modules/services/syncthing/linux
2021-07-21 20:43:18 +00:00
./modules/services/trayer
./modules/services/twmn
2022-08-22 15:01:54 +00:00
./modules/services/udiskie
./modules/services/window-managers/bspwm
2021-11-09 22:17:36 +00:00
./modules/services/window-managers/herbstluftwm
./modules/services/window-managers/i3
2022-07-08 17:31:25 +00:00
./modules/services/window-managers/spectrwm
./modules/services/window-managers/sway
./modules/services/wlsunset
./modules/services/xsettingsd
./modules/systemd
./modules/targets-linux
]);
2018-12-10 23:51:48 +00:00
}