Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5751e005b436
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d2d009f4a6b9
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Nov 8, 2019

  1. Copy the full SHA
    18f9cfa View commit details
  2. Copy the full SHA
    ece9c41 View commit details

Commits on Nov 10, 2019

  1. Merge pull request #73080 from flokli/nixos-samba-python-tmpfiles

    nixos/samba: use tmpfiles, port test to python
    aanderse authored Nov 10, 2019
    Copy the full SHA
    d2d009f View commit details
Showing with 15 additions and 19 deletions.
  1. +8 −12 nixos/modules/services/network-filesystems/samba.nix
  2. +7 −7 nixos/tests/samba.nix
20 changes: 8 additions & 12 deletions nixos/modules/services/network-filesystems/samba.nix
Original file line number Diff line number Diff line change
@@ -12,11 +12,6 @@ let

samba = cfg.package;

setupScript =
''
mkdir -p /var/lock/samba /var/log/samba /var/cache/samba /var/lib/samba/private
'';

shareConfig = name:
let share = getAttr name cfg.shares; in
"[${name}]\n " + (smbToString (
@@ -62,6 +57,7 @@ let
Type = "notify";
NotifyAccess = "all"; #may not do anything...
};
unitConfig.RequiresMountsFor = "/var/lib/samba";

restartTriggers = [ configFile ];
};
@@ -228,8 +224,7 @@ in
systemd = {
targets.samba = {
description = "Samba Server";
requires = [ "samba-setup.service" ];
after = [ "samba-setup.service" "network.target" ];
after = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
};
# Refer to https://github.com/samba-team/samba/tree/master/packaging/systemd
@@ -238,12 +233,13 @@ in
samba-smbd = daemonService "smbd" "";
samba-nmbd = mkIf cfg.enableNmbd (daemonService "nmbd" "");
samba-winbindd = mkIf cfg.enableWinbindd (daemonService "winbindd" "");
samba-setup = {
description = "Samba Setup Task";
script = setupScript;
unitConfig.RequiresMountsFor = "/var/lib/samba";
};
};
tmpfiles.rules = [
"d /var/lock/samba - - - - -"
"d /var/log/samba - - - - -"
"d /var/cache/samba - - - - -"
"d /var/lib/samba/private - - - - -"
];
};

security.pam.services.samba = {};
14 changes: 7 additions & 7 deletions nixos/tests/samba.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ./make-test.nix ({ pkgs, ... }:
import ./make-test-python.nix ({ pkgs, ... }:

{
name = "samba";
@@ -36,12 +36,12 @@ import ./make-test.nix ({ pkgs, ... }:

testScript =
''
$server->start;
$server->waitForUnit("samba.target");
$server->succeed("mkdir -p /public; echo bar > /public/foo");
server.start()
server.wait_for_unit("samba.target")
server.succeed("mkdir -p /public; echo bar > /public/foo")
$client->start;
$client->waitForUnit("remote-fs.target");
$client->succeed("[[ \$(cat /public/foo) = bar ]]");
client.start()
client.wait_for_unit("remote-fs.target")
client.succeed("[[ $(cat /public/foo) = bar ]]")
'';
})