mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-01-30 22:57:55 +00:00
tests: update default arguments
The setup's tentative. Unfortunately, still requires the right experimental features enabled.
This commit is contained in:
parent
e9eae2f2eb
commit
5b7dae16d2
@ -1,8 +1,16 @@
|
|||||||
{ pkgs ? import <nixpkgs> { } }:
|
let
|
||||||
|
flakeUtils = import ../lib/flake.nix;
|
||||||
|
flake = flakeUtils.importFlakeMetadata ../flake.lock;
|
||||||
|
in
|
||||||
|
{ pkgs ? import (flakeUtils.fetchTree flake "nixos-unstable") { } }:
|
||||||
|
|
||||||
|
let
|
||||||
|
utils = import ./utils.nix { inherit pkgs; };
|
||||||
|
in
|
||||||
{
|
{
|
||||||
lib = import ./lib { inherit pkgs; };
|
lib = import ./lib { inherit pkgs utils; };
|
||||||
modules = {
|
modules = {
|
||||||
home-manager = import ./modules/home-manager { inherit pkgs; };
|
home-manager = import ./modules/home-manager { inherit pkgs utils; };
|
||||||
|
nixos = import ./modules/nixos { inherit pkgs utils; };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# For the environment-specific subset, we'll be simulating the configurations
|
# For the environment-specific subset, we'll be simulating the configurations
|
||||||
# as a simple attribute set since that's what they are anyways.
|
# as a simple attribute set since that's what they are anyways.
|
||||||
{ pkgs ? import <nixpkgs> { } }:
|
{ pkgs ? import <nixpkgs> { }, utils ? import ../utils.nix { inherit pkgs; } }:
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (pkgs) lib;
|
inherit (pkgs) lib;
|
||||||
|
20
tests/utils.nix
Normal file
20
tests/utils.nix
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# A set of functions to facilitate testing in the project.
|
||||||
|
{ pkgs }:
|
||||||
|
|
||||||
|
let
|
||||||
|
nixpkgsPath = pkgs.path;
|
||||||
|
nixosLib = import "${nixpkgsPath}/nixos/lib" { };
|
||||||
|
in
|
||||||
|
rec {
|
||||||
|
# We're not using this to test the hosts configuration (that would be
|
||||||
|
# atrocious). We're only using this for NixOS modules.
|
||||||
|
nixosTest = test:
|
||||||
|
nixosLib.runTest {
|
||||||
|
imports = [ test ];
|
||||||
|
hostPkgs = pkgs;
|
||||||
|
specialArgs = {
|
||||||
|
foodogsquaredUtils = import ../lib/utils/nixos.nix { inherit pkgs; };
|
||||||
|
foodogsquaredModulesPath = builtins.toString ../modules/nixos;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user