···30 })
31 ({ options, ... }: {
32 key = "nodes.nix-pkgs";
33- config = mkIf (!options.nixpkgs.pkgs.isDefined) {
34- # Ensure we do not use aliases. Ideally this is only set
35- # when the test framework is used by Nixpkgs NixOS tests.
36- nixpkgs.config.allowAliases = false;
37- # TODO: switch to nixpkgs.hostPlatform and make sure containers-imperative test still evaluates.
38- nixpkgs.system = hostPkgs.stdenv.hostPlatform.system;
39- };
0040 })
41 testModuleArgs.config.extraBaseModules
42 ];
···30 })
31 ({ options, ... }: {
32 key = "nodes.nix-pkgs";
33+ config = optionalAttrs (!config.node.pkgsReadOnly) (
34+ mkIf (!options.nixpkgs.pkgs.isDefined) {
35+ # Ensure we do not use aliases. Ideally this is only set
36+ # when the test framework is used by Nixpkgs NixOS tests.
37+ nixpkgs.config.allowAliases = false;
38+ # TODO: switch to nixpkgs.hostPlatform and make sure containers-imperative test still evaluates.
39+ nixpkgs.system = hostPkgs.stdenv.hostPlatform.system;
40+ }
41+ );
42 })
43 testModuleArgs.config.extraBaseModules
44 ];
···27 in {
28 name = "mongodb";
29 meta = with pkgs.lib.maintainers; {
30- maintainers = [ bluescreen303 offline cstrahan rvl phile314 ];
31 };
3233 nodes = {
···27 in {
28 name = "mongodb";
29 meta = with pkgs.lib.maintainers; {
30+ maintainers = [ bluescreen303 offline rvl phile314 ];
31 };
3233 nodes = {
+1-1
nixos/tests/osquery.nix
···36 machine.succeed("echo 'SELECT address FROM etc_hosts LIMIT 1;' | osqueryi | tee /dev/console | grep -q '127.0.0.1'")
3738 # osquery binaries respect configuration from the Nix config option.
39- machine.succeed("echo 'SELECT value FROM osquery_flags WHERE name = \"utc\";' | osqueryi | tee /dev/console | grep -q ${boolToString utc}")
4041 # osquery binaries respect configuration from the Nix flags option.
42 machine.succeed("echo 'SELECT value FROM osquery_flags WHERE name = \"config_refresh\";' | osqueryi | tee /dev/console | grep -q ${config_refresh}")
···36 machine.succeed("echo 'SELECT address FROM etc_hosts LIMIT 1;' | osqueryi | tee /dev/console | grep -q '127.0.0.1'")
3738 # osquery binaries respect configuration from the Nix config option.
39+ machine.succeed("echo 'SELECT value FROM osquery_flags WHERE name = \"utc\";' | osqueryi | tee /dev/console | grep -q ${lib.boolToString utc}")
4041 # osquery binaries respect configuration from the Nix flags option.
42 machine.succeed("echo 'SELECT value FROM osquery_flags WHERE name = \"config_refresh\";' | osqueryi | tee /dev/console | grep -q ${config_refresh}")
+9-9
nixos/tests/sftpgo.nix
···1718 # Returns an attributeset of users who are not system users.
19 normalUsers = config:
20- filterAttrs (name: user: user.isNormalUser) config.users.users;
2122 # Returns true if a user is a member of the given group
23 isMemberOf =
···26 groupName:
27 # users.users attrset
28 user:
29- any (x: x == user.name) config.users.groups.${groupName}.members;
3031 # Generates a valid SFTPGo user configuration for a given user
32 # Will be converted to JSON and loaded on application startup.
···52 # inside the dataprovider they will be automatically created.
53 # You have to create the folder on the filesystem yourself
54 virtual_folders =
55- lib.optional (lib.isMemberOf config sharedFolderName user) {
56 name = sharedFolderName;
57 mapped_path = "${config.services.sftpgo.dataDir}/${sharedFolderName}";
58 virtual_path = "/${sharedFolderName}";
···63 lib.recursiveUpdate {
64 "/" = [ "list" ]; # read-only top level directory
65 "/private" = [ "*" ]; # private subdirectory, not shared with others
66- } (lib.optionalAttrs (lib.isMemberOf config "shared" user) {
67 "/shared" = [ "*" ];
68 });
69···89 # of users and folders to import to SFTPGo.
90 loadDataJson = config: pkgs.writeText "users-and-folders.json" (builtins.toJSON {
91 users =
92- lib.mapAttrsToList (name: user: lib.generateUserAttrSet config user) (normalUsers config);
9394 folders = [
95 {
···144{
145 name = "sftpgo";
146147- meta.maintainers = with maintainers; [ yayayayaka ];
148149 nodes = {
150 server = { nodes, ... }: {
···228 # Created shared folder directories
229 "d ${statePath}/${sharedFolderName} 2770 ${sftpgoUser} ${sharedFolderName} -"
230 ]
231- ++ mapAttrsToList (name: user:
232 # Create private user directories
233 ''
234 d ${statePath}/users/${user.name} 0700 ${sftpgoUser} ${sftpgoGroup} -
···273 networking.firewall.allowedTCPPorts = [ 22 80 ];
274 services.sftpgo = {
275 settings = {
276- sftpd.bindings = mkForce [{
277 address = "";
278 port = 22;
279 }];
280281- httpd.bindings = mkForce [{
282 address = "";
283 port = 80;
284 }];
···1718 # Returns an attributeset of users who are not system users.
19 normalUsers = config:
20+ lib.filterAttrs (name: user: user.isNormalUser) config.users.users;
2122 # Returns true if a user is a member of the given group
23 isMemberOf =
···26 groupName:
27 # users.users attrset
28 user:
29+ lib.any (x: x == user.name) config.users.groups.${groupName}.members;
3031 # Generates a valid SFTPGo user configuration for a given user
32 # Will be converted to JSON and loaded on application startup.
···52 # inside the dataprovider they will be automatically created.
53 # You have to create the folder on the filesystem yourself
54 virtual_folders =
55+ lib.optional (isMemberOf config sharedFolderName user) {
56 name = sharedFolderName;
57 mapped_path = "${config.services.sftpgo.dataDir}/${sharedFolderName}";
58 virtual_path = "/${sharedFolderName}";
···63 lib.recursiveUpdate {
64 "/" = [ "list" ]; # read-only top level directory
65 "/private" = [ "*" ]; # private subdirectory, not shared with others
66+ } (lib.optionalAttrs (isMemberOf config "shared" user) {
67 "/shared" = [ "*" ];
68 });
69···89 # of users and folders to import to SFTPGo.
90 loadDataJson = config: pkgs.writeText "users-and-folders.json" (builtins.toJSON {
91 users =
92+ lib.mapAttrsToList (name: user: generateUserAttrSet config user) (normalUsers config);
9394 folders = [
95 {
···144{
145 name = "sftpgo";
146147+ meta.maintainers = with lib.maintainers; [ yayayayaka ];
148149 nodes = {
150 server = { nodes, ... }: {
···228 # Created shared folder directories
229 "d ${statePath}/${sharedFolderName} 2770 ${sftpgoUser} ${sharedFolderName} -"
230 ]
231+ ++ lib.mapAttrsToList (name: user:
232 # Create private user directories
233 ''
234 d ${statePath}/users/${user.name} 0700 ${sftpgoUser} ${sftpgoGroup} -
···273 networking.firewall.allowedTCPPorts = [ 22 80 ];
274 services.sftpgo = {
275 settings = {
276+ sftpd.bindings = lib.mkForce [{
277 address = "";
278 port = 22;
279 }];
280281+ httpd.bindings = lib.mkForce [{
282 address = "";
283 port = 80;
284 }];
···39 export HOME=$(mktemp -d)
40 '';
410000000000042 meta = {
43 description = "A tool for creating NATS account and user access configurations";
44 homepage = "https://github.com/nats-io/nsc";
45 license = with lib.licenses; [ asl20 ];
46 maintainers = with lib.maintainers; [ cbrewster ];
47 mainProgram = "nsc";
48- broken = stdenv.isDarwin;
49 };
50}
···39 export HOME=$(mktemp -d)
40 '';
4142+ # Tests currently fail on darwin because of a test in nsc which
43+ # expects command output to contain a specific path. However
44+ # the test strips table formatting from the command output in a naive way
45+ # that removes all the table characters, including '-'.
46+ # The nix build directory looks something like:
47+ # /private/tmp/nix-build-nsc-2.8.1.drv-0/nsc_test2000598938/keys
48+ # Then the `-` are removed from the path unintentionally and the test fails.
49+ # This should be fixed upstream to avoid mangling the path when
50+ # removing the table decorations from the command output.
51+ doCheck = !stdenv.isDarwin;
52+53 meta = {
54 description = "A tool for creating NATS account and user access configurations";
55 homepage = "https://github.com/nats-io/nsc";
56 license = with lib.licenses; [ asl20 ];
57 maintainers = with lib.maintainers; [ cbrewster ];
58 mainProgram = "nsc";
059 };
60}
···5556 ### A ###
57058 airfield = throw "airfield has been removed due to being unmaintained"; # Added 2023-05-19
59 alertmanager-bot = throw "alertmanager-bot is broken and has been archived by upstream" ; # Added 2023-07-28
60 alsaLib = alsa-lib; # Added 2021-06-09
···5556 ### A ###
5758+ a4term = a4; # Added 2023-10-06
59 airfield = throw "airfield has been removed due to being unmaintained"; # Added 2023-05-19
60 alertmanager-bot = throw "alertmanager-bot is broken and has been archived by upstream" ; # Added 2023-07-28
61 alsaLib = alsa-lib; # Added 2021-06-09