Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
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-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 925501a5d554
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: c025f5c03dd7
Choose a head ref
  • 20 commits
  • 15 files changed
  • 7 contributors

Commits on Sep 6, 2019

  1. nixos/gitlab: Fix missing ca_file for SMTP

    Work around upstream issue #790 by explicitly referencing the
    ca-certificates.crt file.
    talyz committed Sep 6, 2019
    Copy the full SHA
    7648b4f View commit details
  2. nixos/gitlab: Add support for storing secrets in files

    Add support for storing secrets in files outside the nix store, since
    files in the nix store are world-readable and secrets therefore can't
    be stored safely there.
    
    The old string options are kept, since they can potentially be handy
    for testing purposes, but their descriptions now state that they
    shouldn't be used in production. The manual section is updated to use
    the file options rather than the string options and the tests now test
    both.
    talyz committed Sep 6, 2019
    Copy the full SHA
    cbdf94c View commit details
  3. nixos/gitlab: Use postgresql module options to provision local db

    Use the postgresql module to provision a local db (if
    databaseCreateLocally is true) instead of doing this locally.
    
    Switch to using the local unix socket for db connections by default;
    this is needed since dbs created by the postgresql module only support
    peer authentication.
    
    Instead of running the rake tasks db:schema:load, db:migrate and
    db:seed_fu, run gitlab:db:configure, which in turn runs these tasks
    when needed.
    
    Solves issue #53852 for gitlab.
    talyz committed Sep 6, 2019
    Copy the full SHA
    b351454 View commit details
  4. nixos/utils: Handle arbitrary secrets in JSON output files

    Introduce new functions which allows modules to define options where,
    if the input is an attrset and the output is JSON, the user can define
    arbitrary secrets.
    talyz committed Sep 6, 2019
    Copy the full SHA
    64358cb View commit details
  5. nixos/gitlab: Extract arbitrary secrets from extraConfig

    Adds the ability to make any parameter specified in extraConfig secret
    by defining it an attrset containing the attr _secret, which in turn
    is a path to a file containing the actual secret.
    talyz committed Sep 6, 2019
    Copy the full SHA
    240649a View commit details
  6. Copy the full SHA
    01ba11b View commit details

Commits on Sep 7, 2019

  1. starship: 0.13.1 -> 0.15.0

    marsam committed Sep 7, 2019

    Verified

    This commit was signed with the committer’s verified signature. The key has expired.
    marsam Mario Rodas
    Copy the full SHA
    7a77001 View commit details
  2. haskellPackages: unbreak cachix build

    marsam authored and peti committed Sep 7, 2019
    Copy the full SHA
    86321d3 View commit details
  3. haskellPackages.hnix: unmark as broken

    marsam authored and peti committed Sep 7, 2019
    Copy the full SHA
    c5b9baa View commit details
  4. Copy the full SHA
    3194a1e View commit details
  5. Copy the full SHA
    5f22000 View commit details
  6. hackage-packages.nix: automatic Haskell package set update

    This update was generated by hackage2nix v2.14.4-7-ga804c35 from Hackage revision
    commercialhaskell/all-cabal-hashes@4cf3608.
    peti committed Sep 7, 2019
    Copy the full SHA
    1878a24 View commit details
  7. perlPackages.MHonArc: 2.6.18 -> 2.6.19

    Needs a patch before it'll run, but it didn't run before and might as
    well be updated before it's patched.
    alyssais committed Sep 7, 2019
    Copy the full SHA
    5198699 View commit details
  8. Copy the full SHA
    cd714e7 View commit details
  9. Copy the full SHA
    fffe5f5 View commit details
  10. mhonarc: add top-level path to perlPackages.MHonArc

    Since MHonArc is a program, not a library, it makes sense to expose it
    on the top level, in lowercase, like other programs.
    alyssais committed Sep 7, 2019
    Copy the full SHA
    f8fd80b View commit details
  11. gitAndTools.hub: 2.12.3 -> 2.12.4

    doronbehar authored and alyssais committed Sep 7, 2019
    Copy the full SHA
    1ce20f2 View commit details
  12. Merge pull request #68270 from marsam/update-starship

    starship: 0.13.1 -> 0.15.0
    marsam authored Sep 7, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    493e51d View commit details
  13. Merge pull request #66274 from talyz/gitlab

    nixos/gitlab: Add support for secure secrets and more
    flokli authored Sep 7, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    2f3b9cd View commit details
  14. Merge pull request #68179 from aanderse/kdevelop

    kdevelop, kdev-php, kdev-python: 5.4.1 -> 5.4.2
    aanderse authored Sep 7, 2019

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c025f5c View commit details
112 changes: 112 additions & 0 deletions nixos/lib/utils.nix
Original file line number Diff line number Diff line change
@@ -24,4 +24,116 @@ pkgs: with pkgs.lib;
throw "${shell} is not a shell package"
else
shell;

/* Recurse into a list or an attrset, searching for attrs named like
the value of the "attr" parameter, and return an attrset where the
names are the corresponding jq path where the attrs were found and
the values are the values of the attrs.
Example:
recursiveGetAttrWithJqPrefix {
example = [
{
irrelevant = "not interesting";
}
{
ignored = "ignored attr";
relevant = {
secret = {
_secret = "/path/to/secret";
};
};
}
];
} "_secret" -> { ".example[1].relevant.secret" = "/path/to/secret"; }
*/
recursiveGetAttrWithJqPrefix = item: attr:
let
recurse = prefix: item:
if item ? ${attr} then
nameValuePair prefix item.${attr}
else if isAttrs item then
map (name: recurse (prefix + "." + name) item.${name}) (attrNames item)
else if isList item then
imap0 (index: item: recurse (prefix + "[${toString index}]") item) item
else
[];
in listToAttrs (flatten (recurse "" item));

/* Takes an attrset and a file path and generates a bash snippet that
outputs a JSON file at the file path with all instances of
{ _secret = "/path/to/secret" }
in the attrset replaced with the contents of the file
"/path/to/secret" in the output JSON.
When a configuration option accepts an attrset that is finally
converted to JSON, this makes it possible to let the user define
arbitrary secret values.
Example:
If the file "/path/to/secret" contains the string
"topsecretpassword1234",
genJqSecretsReplacementSnippet {
example = [
{
irrelevant = "not interesting";
}
{
ignored = "ignored attr";
relevant = {
secret = {
_secret = "/path/to/secret";
};
};
}
];
} "/path/to/output.json"
would generate a snippet that, when run, outputs the following
JSON file at "/path/to/output.json":
{
"example": [
{
"irrelevant": "not interesting"
},
{
"ignored": "ignored attr",
"relevant": {
"secret": "topsecretpassword1234"
}
}
]
}
*/
genJqSecretsReplacementSnippet = genJqSecretsReplacementSnippet' "_secret";

# Like genJqSecretsReplacementSnippet, but allows the name of the
# attr which identifies the secret to be changed.
genJqSecretsReplacementSnippet' = attr: set: output:
let
secrets = recursiveGetAttrWithJqPrefix set attr;
in ''
if [[ -h '${output}' ]]; then
rm '${output}'
fi
''
+ concatStringsSep
"\n"
(imap1 (index: name: "export secret${toString index}=$(<'${secrets.${name}}')")
(attrNames secrets))
+ "\n"
+ "${pkgs.jq}/bin/jq >'${output}' '"
+ concatStringsSep
" | "
(imap1 (index: name: ''${name} = $ENV.secret${toString index}'')
(attrNames secrets))
+ ''
' <<'EOF'
${builtins.toJSON set}
EOF
'';
}
Loading