Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from nix-community:master #18

Merged
merged 4 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/misc/xdg-mime-apps.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let
coercedTo (either (listOf str) str) toList (listOf str);

in {
meta.maintainers = with maintainers; [ pacien ];
meta.maintainers = with maintainers; [ euxane ];

options.xdg.mimeApps = {
enable = mkOption {
Expand Down
2 changes: 1 addition & 1 deletion modules/misc/xdg-user-dirs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
cfg = config.xdg.userDirs;

in {
meta.maintainers = with maintainers; [ pacien ];
meta.maintainers = with maintainers; [ euxane ];

imports = [
(mkRenamedOptionModule [ "xdg" "userDirs" "publishShare" ] [
Expand Down
2 changes: 1 addition & 1 deletion modules/programs/password-store.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
cfg = config.programs.password-store;

in {
meta.maintainers = with maintainers; [ pacien ];
meta.maintainers = with maintainers; [ euxane ];

options.programs.password-store = {
enable = mkEnableOption "Password store";
Expand Down
2 changes: 1 addition & 1 deletion modules/services/muchsync.nix
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ let
};

in {
meta.maintainers = with maintainers; [ pacien ];
meta.maintainers = with maintainers; [ euxane ];

options.services.muchsync = {
remotes = mkOption {
Expand Down
2 changes: 1 addition & 1 deletion modules/services/taskwarrior-sync.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ let
cfg = config.services.taskwarrior-sync;

in {
meta.maintainers = with maintainers; [ minijackson pacien ];
meta.maintainers = with maintainers; [ euxane minijackson ];

options.services.taskwarrior-sync = {
enable = mkEnableOption "Taskwarrior periodic sync";
Expand Down
2 changes: 1 addition & 1 deletion modules/services/unison.nix
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ let
cfg.pairs;

in {
meta.maintainers = with maintainers; [ pacien ];
meta.maintainers = with maintainers; [ euxane ];

options.services.unison = {
enable = mkEnableOption "Unison synchronisation";
Expand Down
1 change: 1 addition & 0 deletions tests/integration/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ let
home-with-symbols = runTest ./standalone/home-with-symbols.nix;
kitty = runTest ./standalone/kitty.nix;
mu = runTest ./standalone/mu;
nh = runTest ./standalone/nh.nix;
nixos-basics = runTest ./nixos/basics.nix;
standalone-flake-basics = runTest ./standalone/flake-basics.nix;
standalone-standard-basics = runTest ./standalone/standard-basics.nix;
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/standalone/flake-basics.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

testScript = ''
start_all()
machine.wait_for_unit("network-online.target")
machine.wait_for_unit("network.target")
machine.wait_for_unit("multi-user.target")

def login_as_alice():
Expand Down
1 change: 0 additions & 1 deletion tests/integration/standalone/home-with-symbols.nix
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,5 @@ in {

# The default configuration creates this link on activation.
machine.succeed("test -L '${pyHome}/.cache/.keep'")
succeed_as_alice("nix-shell \"<home-manager>\" -A install")
'';
}
89 changes: 89 additions & 0 deletions tests/integration/standalone/nh.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{ pkgs, ... }:

let

inherit (pkgs.lib) escapeShellArg;

home = "/home/alice";

in {
name = "works-with-nh-stable";
meta.maintainers = [ pkgs.lib.maintainers.rycee ];

nodes.machine = { ... }: {
imports = [ "${pkgs.path}/nixos/modules/installer/cd-dvd/channel.nix" ];
virtualisation.memorySize = 2048;
environment.systemPackages = [ pkgs.nh ];
nix = {
registry.home-manager.to = {
type = "path";
path = ../../..;
};
settings.extra-experimental-features = [ "nix-command" "flakes" ];
};
users.users.alice = {
isNormalUser = true;
description = "Alice Foobar";
password = "foobar";
uid = 1000;
inherit home;
};
};

testScript = ''
import shlex

start_all()
machine.wait_for_unit("network.target")
machine.wait_for_unit("multi-user.target")

home_manager = "${../..}"

def login_as_alice():
machine.wait_until_tty_matches("1", "login: ")
machine.send_chars("alice\n")
machine.wait_until_tty_matches("1", "Password: ")
machine.send_chars("foobar\n")
machine.wait_until_tty_matches("1", "alice\\@machine")

def logout_alice():
machine.send_chars("exit\n")

def alice_cmd(cmd):
cmd = shlex.quote(f"export XDG_RUNTIME_DIR=/run/user/$UID ; {cmd}")
return f"su -l alice --shell /bin/sh -c {cmd}"

def succeed_as_alice(cmd):
return machine.succeed(alice_cmd(cmd))

def fail_as_alice(cmd):
return machine.fail(alice_cmd(cmd))

# Create a persistent login so that Alice has a systemd session.
login_as_alice()

# Set up a home-manager channel.
succeed_as_alice(" ; ".join([
"mkdir -p ${home}/.nix-defexpr/channels",
f"ln -s {home_manager} ${home}/.nix-defexpr/channels/home-manager"
]))

with subtest("Run nh home switch"):
# Copy a configuration to activate.
succeed_as_alice(" ; ".join([
"mkdir -vp ${home}/.config/home-manager",
"cp -v ${
./alice-flake-init.nix
} ${home}/.config/home-manager/flake.nix",
"cp -v ${./alice-home-next.nix} ${home}/.config/home-manager/home.nix"
]))

actual = succeed_as_alice("nh home switch --no-nom '${home}/.config/home-manager'")
expected = "Starting Home Manager activation"
assert expected in actual, \
f"expected nh home switch to contain {expected}, but got {actual}"

# The default configuration creates this link on activation.
machine.succeed("test -L '${home}/.cache/.keep'")
'';
}
Loading