home-manager/tests/default.nix

197 lines
5.7 KiB
Nix
Raw Normal View History

2021-01-29 17:43:49 +01:00
{ pkgs ? import <nixpkgs> {}, enableBig ? true }:
2018-12-11 00:51:48 +01:00
let
lib = import ../modules/lib/stdlib-extended.nix pkgs.lib;
nmt = fetchTarball {
url =
"https://gitlab.com/api/v4/projects/rycee%2Fnmt/repository/archive.tar.gz?sha=d83601002c99b78c89ea80e5e6ba21addcfe12ae";
sha256 = "1xzwwxygzs1cmysg97hzd285r7n1g1lwx5y1ar68gwq07a1rczmv";
};
2018-12-11 00:51:48 +01: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-11 00:51:48 +01:00
in
import nmt {
inherit lib pkgs modules;
2018-12-11 00:51:48 +01:00
testedAttrPath = [ "home" "activationPackage" ];
tests = builtins.foldl' (a: b: a // (import b)) { } ([
./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 03:47:32 +01:00
./modules/misc/nix
./modules/misc/specialization
./modules/programs/aerc
./modules/programs/alacritty
./modules/programs/alot
2020-04-28 20:38:41 +02: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
2020-05-06 18:23:40 +02:00
./modules/programs/dircolors
./modules/programs/direnv
./modules/programs/emacs
./modules/programs/feh
./modules/programs/fish
2020-10-15 22:25:47 +02:00
./modules/programs/gh
./modules/programs/git
./modules/programs/gpg
2022-01-04 00:09:24 +01:00
./modules/programs/helix
./modules/programs/himalaya
./modules/programs/htop
2022-08-01 17:03:41 +02:00
./modules/programs/hyfetch
2020-05-01 05:49:20 +02:00
./modules/programs/i3status
./modules/programs/irssi
./modules/programs/kakoune
./modules/programs/kitty
./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 21:20:54 +02:00
./modules/programs/ncmpcpp
./modules/programs/ne
./modules/programs/neomutt
./modules/programs/newsboat
./modules/programs/nix-index
./modules/programs/nnn
2020-07-24 17:15:55 +02:00
./modules/programs/nushell
./modules/programs/pandoc
./modules/programs/pet
2022-03-28 17:19:38 +02:00
./modules/programs/pistol
./modules/programs/powerline-go
./modules/programs/pubs
2020-04-07 09:10:07 +02:00
./modules/programs/qutebrowser
./modules/programs/readline
2021-12-30 12:47:44 +01:00
./modules/programs/sagemath
2021-01-30 03:29:23 +01:00
./modules/programs/sbt
./modules/programs/scmpuff
2021-07-11 19:28:56 +02:00
./modules/programs/sm64ex
./modules/programs/ssh
./modules/programs/starship
./modules/programs/taskwarrior
./modules/programs/texlive
./modules/programs/tmux
2021-04-29 01:56:58 +02:00
./modules/programs/topgrade
./modules/programs/vscode
./modules/programs/watson
2022-04-08 08:48:27 +02:00
./modules/programs/wezterm
./modules/programs/zplug
./modules/programs/zsh
./modules/xresources
] ++ lib.optionals isDarwin [
./modules/launchd
./modules/targets-darwin
] ++ lib.optionals isLinux [
./modules/config/i18n
2021-06-16 00:59:25 +02:00
./modules/i18n/input-method
./modules/misc/debug
./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/firefox
./modules/programs/foot
./modules/programs/getmail
./modules/programs/gnome-terminal
./modules/programs/hexchat
./modules/programs/i3status-rust
./modules/programs/kodi
2021-06-12 09:55:58 +02:00
./modules/programs/mangohud
2020-08-26 21:20:54 +02:00
./modules/programs/ncmpcpp-linux
./modules/programs/neovim # Broken package dependency on Darwin.
./modules/programs/rbw
./modules/programs/rofi
./modules/programs/rofi-pass
2022-06-07 21:01:14 +02:00
./modules/programs/swaylock
./modules/programs/terminator
2020-07-29 22:29:51 +02:00
./modules/programs/waybar
./modules/programs/xmobar
./modules/services/barrier
./modules/services/devilspie2
./modules/services/dropbox
./modules/services/emacs
./modules/services/espanso
2021-10-11 21:41:49 +02:00
./modules/services/flameshot
./modules/services/fluidsynth
./modules/services/fnott
./modules/services/fusuma
2021-07-15 03:20:28 +02:00
./modules/services/git-sync
2021-11-25 19:28:18 +01:00
./modules/services/gpg-agent
2019-02-24 20:33:56 +01:00
./modules/services/gromit-mpx
./modules/services/home-manager-auto-upgrade
2020-04-12 15:42:43 +02:00
./modules/services/kanshi
./modules/services/lieer
./modules/services/mopidy
2022-03-04 00:43:40 +01:00
./modules/services/mpd
2022-05-25 18:31:08 +02:00
./modules/services/mpdris2
2021-06-07 23:38:42 +02:00
./modules/services/pantalaimon
2020-12-03 03:55:37 +01:00
./modules/services/pbgopy
./modules/services/picom
2021-01-30 18:20:36 +01:00
./modules/services/playerctld
2020-03-02 22:31:15 +01:00
./modules/services/polybar
2022-02-07 11:54:09 +01:00
./modules/services/recoll
./modules/services/redshift-gammastep
./modules/services/screen-locker
./modules/services/swayidle
./modules/services/sxhkd
./modules/services/syncthing
2021-07-21 22:43:18 +02:00
./modules/services/trayer
./modules/services/twmn
2022-08-22 17:01:54 +02:00
./modules/services/udiskie
./modules/services/window-managers/bspwm
2021-11-09 23:17:36 +01:00
./modules/services/window-managers/herbstluftwm
./modules/services/window-managers/i3
2022-07-08 19:31:25 +02:00
./modules/services/window-managers/spectrwm
./modules/services/window-managers/sway
./modules/services/wlsunset
./modules/services/xsettingsd
./modules/systemd
./modules/targets-linux
]);
2018-12-11 00:51:48 +01:00
}