1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-14 11:57:55 +00:00
home-manager/tests/default.nix
Naïm Camille Favier 64ab7d6e8d
Prepare inclusion in nixos-search (#2971)
* Add flake.lock and clean up flake.nix

Add a lockfile to work around https://github.com/NixOS/nix/issues/6541
(and because it's a good idea anyway).

Also use flake-utils, and restrict ourselves to the five platforms
supported by nixpkgs. Otherwise, the IFD for nmd fails on weird
platforms. This fixes `nix flake check`.

Remove the redundant `apps` output, see https://github.com/nix-community/home-manager/pull/2442#issuecomment-1133670487

* nixos,nix-darwin: factor out into a common module

* nixos,nix-darwin: make `home-managers.users` shallowly visible

Make sure the option is included in the NixOS/nix-darwin manual (but the
HM submodule options aren't).

Also add a static description to the HM submodule type so that we don't need to
evaluate the submodules just to build the option manual. This makes
nixos-search able to index the home-manager flake.

Also clean up some TODOs.

* flake: add nmd and nmt

This avoids having to use `pkgs.fetchFromGitLab` in an IFD, which causes
issues when indexing packages with nixos-search because `pkgs` is
instantiated with every platform.
2022-06-07 20:45:06 +02:00

175 lines
5 KiB
Nix

{ pkgs ? import <nixpkgs> {}, enableBig ? true }:
let
lib = import ../modules/lib/stdlib-extended.nix pkgs.lib;
inherit ((import ./.. { }).inputs) nmt;
modules = import ../modules/modules.nix {
inherit lib pkgs;
check = false;
} ++ [
{
# 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";
home.homeDirectory = "/home/hm-user";
# 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;
in
import nmt {
inherit lib pkgs modules;
testedAttrPath = [ "home" "activationPackage" ];
tests = builtins.foldl' (a: b: a // (import b)) { } ([
./lib/types
./modules/files
./modules/home-environment
./modules/misc/fontconfig
./modules/misc/nix
./modules/misc/specialization
./modules/programs/alacritty
./modules/programs/alot
./modules/programs/aria2
./modules/programs/atuin
./modules/programs/autojump
./modules/programs/bash
./modules/programs/bat
./modules/programs/bottom
./modules/programs/broot
./modules/programs/browserpass
./modules/programs/dircolors
./modules/programs/direnv
./modules/programs/emacs
./modules/programs/feh
./modules/programs/fish
./modules/programs/gh
./modules/programs/git
./modules/programs/gpg
./modules/programs/helix
./modules/programs/himalaya
./modules/programs/htop
./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/mpv
./modules/programs/mu
./modules/programs/ncmpcpp
./modules/programs/ne
./modules/programs/neomutt
./modules/programs/newsboat
./modules/programs/nix-index
./modules/programs/nnn
./modules/programs/nushell
./modules/programs/pandoc
./modules/programs/pet
./modules/programs/powerline-go
./modules/programs/pubs
./modules/programs/qutebrowser
./modules/programs/readline
./modules/programs/sagemath
./modules/programs/sbt
./modules/programs/scmpuff
./modules/programs/sm64ex
./modules/programs/ssh
./modules/programs/starship
./modules/programs/taskwarrior
./modules/programs/texlive
./modules/programs/tmux
./modules/programs/topgrade
./modules/programs/vscode
./modules/programs/watson
./modules/programs/zplug
./modules/programs/zsh
./modules/xresources
] ++ lib.optionals isDarwin [
./modules/launchd
./modules/targets-darwin
] ++ lib.optionals isLinux [
./modules/config/i18n
./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
./modules/programs/mangohud
./modules/programs/ncmpcpp-linux
./modules/programs/neovim # Broken package dependency on Darwin.
./modules/programs/rbw
./modules/programs/rofi
./modules/programs/rofi-pass
./modules/programs/terminator
./modules/programs/waybar
./modules/programs/xmobar
./modules/services/barrier
./modules/services/devilspie2
./modules/services/dropbox
./modules/services/emacs
./modules/services/espanso
./modules/services/flameshot
./modules/services/fluidsynth
./modules/services/fnott
./modules/services/fusuma
./modules/services/git-sync
./modules/services/gpg-agent
./modules/services/gromit-mpx
./modules/services/home-manager-auto-upgrade
./modules/services/kanshi
./modules/services/lieer
./modules/services/mopidy
./modules/services/mpd
./modules/services/mpdris2
./modules/services/pantalaimon
./modules/services/pbgopy
./modules/services/picom
./modules/services/playerctld
./modules/services/polybar
./modules/services/redshift-gammastep
./modules/services/screen-locker
./modules/services/swayidle
./modules/services/sxhkd
./modules/services/syncthing
./modules/services/trayer
./modules/services/twmn
./modules/services/window-managers/bspwm
./modules/services/window-managers/herbstluftwm
./modules/services/window-managers/i3
./modules/services/window-managers/sway
./modules/services/wlsunset
./modules/services/xsettingsd
./modules/systemd
./modules/targets-linux
]);
}