mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-23 12:19:00 +00:00
tests/modules/home-manager: init
This commit is contained in:
parent
f016e180b5
commit
0f593318c5
56
tests/modules/home-manager/default.nix
Normal file
56
tests/modules/home-manager/default.nix
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# We're basically reimplmenting parts from the home-manager test suite here
|
||||||
|
# just with our own modules included.
|
||||||
|
{ pkgs ? import <nixpkgs> { }
|
||||||
|
, homeManagerSrc ? <home-manager>
|
||||||
|
, enableBig ? true
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
nmt = pkgs.nix-lib-nmt;
|
||||||
|
lib = import "${homeManagerSrc}/modules/lib/stdlib-extended.nix" pkgs.lib;
|
||||||
|
homeManagerModules = import "${homeManagerSrc}/modules/modules.nix" {
|
||||||
|
inherit pkgs lib;
|
||||||
|
check = false;
|
||||||
|
};
|
||||||
|
modules = homeManagerModules ++ [
|
||||||
|
../../../modules/home-manager
|
||||||
|
../../../modules/home-manager/_private
|
||||||
|
|
||||||
|
# Copied over from home-manager test suite.
|
||||||
|
{
|
||||||
|
# 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 = lib.mkDefault false;
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
"${homeManagerSrc}/tests/asserts.nix"
|
||||||
|
"${homeManagerSrc}/tests/big-test.nix"
|
||||||
|
"${homeManagerSrc}/tests/stubs.nix"
|
||||||
|
];
|
||||||
|
|
||||||
|
test.enableBig = enableBig;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux;
|
||||||
|
in
|
||||||
|
import nmt {
|
||||||
|
inherit pkgs lib modules;
|
||||||
|
testedAttrPath = [ "home" "activationPackage" ];
|
||||||
|
tests = builtins.foldl' (a: b: a // (import b)) { } [
|
||||||
|
./programs/neovide
|
||||||
|
];
|
||||||
|
}
|
29
tests/modules/home-manager/programs/neovide/basic.nix
Normal file
29
tests/modules/home-manager/programs/neovide/basic.nix
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
{ config, lib, ... }: {
|
||||||
|
programs.neovide = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
maximized = true;
|
||||||
|
font = {
|
||||||
|
normal = [ "MonoLisa Nerd Font" ];
|
||||||
|
size = 18;
|
||||||
|
features.MonoLisa = [
|
||||||
|
"+ss01"
|
||||||
|
"+ss07"
|
||||||
|
"+ss11"
|
||||||
|
"-calt"
|
||||||
|
"+ss09"
|
||||||
|
"+ss02"
|
||||||
|
"+ss14"
|
||||||
|
"+ss16"
|
||||||
|
"+ss17"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
test.stubs.neovide = { };
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertFileExists home-files/.config/neovide/config.toml
|
||||||
|
'';
|
||||||
|
}
|
4
tests/modules/home-manager/programs/neovide/default.nix
Normal file
4
tests/modules/home-manager/programs/neovide/default.nix
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
neovide-basic-settings = ./basic.nix;
|
||||||
|
neovide-empty-settings = ./empty-settings.nix;
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
{ ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
programs.neovide.enable = true;
|
||||||
|
|
||||||
|
test.stubs.neovide = { };
|
||||||
|
|
||||||
|
nmt.script = ''
|
||||||
|
assertPathNotExists home-files/.config/neovide/config.toml
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user