Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 118-borg-backup-not-running-as-it-should
  • 125.dont-set-static-datasource-uids
  • 125.silence-broken-backup-alerts
  • 133.give-access-to-prod-infra
  • 149.fix-bootloader
  • 157.authorize-new-hro-key
  • 162.flexible-grafana-module
  • 163.jp-to-ben-for-prod
  • 164.grafana-alert-rules
  • 190-our-regular-updates-fill-up-the-servers-boot-partitions
  • 207.payment-server-exception-reporting
  • 287.publish-tahoe-error-rate
  • 300.monitor-payment-server
  • 352.cachix
  • 42.update-nixpkgs
  • 445.update-zkapauthorizer
  • 62.openssl-111k
  • 67.rationalize-morph-names.2
  • 87.qemu-local-grid
  • 87.test-local-grid
  • 88.no-gui-for-qemu
  • also-alert-on-incoming-network-errors
  • develop
  • doc-fix
  • dont-use-etc-hosts
  • failsafe-payment-process
  • fix-repo-update-docs
  • flake
  • hro-cloud
  • localdev-qemu
  • make-sure-we-run-a-openzfs-compatible-kernel
  • meejah-develop-patch-44361
  • monitored-node
  • nixpkgs-upgrade-2022-07-13
  • nixpkgs-upgrade-2022-07-14
  • nixpkgs-upgrade-2022-07-22
  • nixpkgs-upgrade-2023-11-06
  • nixpkgs-upgrade-2024-02-12
  • nixpkgs-upgrade-2024-02-19
  • nixpkgs-upgrade-2024-02-26
  • nixpkgs-upgrade-2024-03-04
  • nixpkgs-upgrade-2024-03-11
  • nixpkgs-upgrade-2024-03-18
  • nixpkgs-upgrade-2024-03-25
  • nixpkgs-upgrade-2024-04-22
  • nixpkgs-upgrade-2024-05-13
  • nixpkgs-upgrade-2024-10-14
  • nixpkgs-upgrade-2024-12-23
  • nixpkgs-upgrade-2025-06-16
  • parallel-privatestorage-system-tests
  • payment-proxy-timeouts
  • per-node-monitor-config
  • production
  • reproduce-permission-errors
  • smaller-system-images
  • spending-node
  • spending-node-rebase
  • staging
  • upgrade-nixos-to-22.11_with-libvirt-localgrid
59 results

Target

Select target project
  • privatestorage/PrivateStorageio
  • tomprince/PrivateStorageio
2 results
Select Git revision
  • arion
  • develop
  • dont-use-etc-hosts
  • local-test-grid
  • no-morph-on-nodes
  • sec
  • simple-docs-build
  • simplify-grafana
  • stuff
9 results
Show changes
{
"name": "source",
"url": "https://releases.nixos.org/nixos/25.05/nixos-25.05.805852.29e290002bff/nixexprs.tar.xz",
"sha256": "1izxvhsb055b1fbwd6is5h2g7bww77gz336wrfzw2pwr67da1mah"
}
\ No newline at end of file
import (builtins.fetchTarball (builtins.fromJSON (builtins.readFile ./nixpkgs-ps.json))) import (builtins.fetchTarball (builtins.fromJSON (builtins.readFile ./nixpkgs.json)))
{ stdenv, lib, graphviz, python3Packages }:
stdenv.mkDerivation rec {
version = "0.0";
name = "privatestorageio-${version}";
src = lib.cleanSource ./.;
depsBuildBuild = [
graphviz
];
buildPhase = ''
${python3Packages.sphinx}/bin/sphinx-build -W docs/source docs/build
'';
installPhase = ''
mkdir $out
mv docs/build $out/docs
'';
}
let let
release2105 = import ./nixpkgs-2105.nix { }; pinned-pkgs = import ./nixpkgs.nix { };
in in
{ pkgs ? release2105, lib ? pkgs.lib, python ? pkgs.python3 }: { pkgs ? pinned-pkgs, lib ? pkgs.lib, python ? pkgs.python3 }:
let let
tools = pkgs.callPackage ./tools {}; tools = pkgs.callPackage ./tools {};
in in
...@@ -10,7 +10,7 @@ pkgs.mkShell { ...@@ -10,7 +10,7 @@ pkgs.mkShell {
# first adds that path to the store, and then interpolates the store path # first adds that path to the store, and then interpolates the store path
# into the string. We use `builtins.toString` to convert the path to a # into the string. We use `builtins.toString` to convert the path to a
# string without copying it to the store before interpolating. Either the # string without copying it to the store before interpolating. Either the
# path is already in the store (e.g. when `pkgs` is `release2105`) so we # path is already in the store (e.g. when `pkgs` is `pinned-pkgs`) so we
# avoid making a second copy with a longer name, or the user passed in local # avoid making a second copy with a longer name, or the user passed in local
# path (e.g. a checkout of nixpkgs) and we point at it directly, rather than # path (e.g. a checkout of nixpkgs) and we point at it directly, rather than
# a snapshot of it. # a snapshot of it.
...@@ -22,6 +22,8 @@ pkgs.mkShell { ...@@ -22,6 +22,8 @@ pkgs.mkShell {
inputsFrom = [tools]; inputsFrom = [tools];
buildInputs = [ buildInputs = [
tools tools
pkgs.cacert
pkgs.nix
pkgs.morph pkgs.morph
pkgs.jp pkgs.jp
]; ];
......
...@@ -16,6 +16,7 @@ let ...@@ -16,6 +16,7 @@ let
python-commands = [ python-commands = [
./update-nixpkgs ./update-nixpkgs
./update-gitlab-repo ./update-gitlab-repo
./update-github-repo
]; ];
in in
# This derivation creates a package that wraps our tools to setup an environment # This derivation creates a package that wraps our tools to setup an environment
......
...@@ -9,11 +9,9 @@ ...@@ -9,11 +9,9 @@
{ pathToGrid }: { pathToGrid }:
let let
grid = import pathToGrid; grid = import pathToGrid;
vpnConfig = node: node.services.private-storage.monitoring.vpn or null; vpnIP = node: node.config.grid.monitoringvpnIPv4 or null; # "or null" since "network" in grid doesn't have a monitoringIPv4
vpnClientIP = node: (vpnConfig node).client.ip or null; in rec
vpnServerIP = node: (vpnConfig node).server.ip or null;
in
{ {
"serverIP" = vpnServerIP grid.monitoring; serverIP = vpnIP grid.monitoring;
"clientIPs" = builtins.filter (x: x != null) (map vpnClientIP (builtins.attrValues grid)); clientIPs = builtins.filter (x: x != serverIP && x != null) (map vpnIP (builtins.attrValues grid));
} }
#!/usr/bin/env python
"""
Update a pinned github repository.
Pass this path to a JSON file and it will update it to the latest
version of the branch it specifies. You can also pass a different
branch or repository owner, which will update the file to point at
the new branch/repository, and update to the latest version.
"""
import argparse
import json
from pathlib import Path
import httpx
from ps_tools import get_url_hash
HASH_TYPE = "sha512"
ARCHIVE_TEMPLATE = "https://api.github.com/repos/{owner}/{repo}/tarball/{rev}"
BRANCH_TEMPLATE = (
"https://api.github.com/repos/{owner}/{repo}/commits/{branch}"
)
def get_github_commit(config):
response = httpx.get(BRANCH_TEMPLATE.format(**config))
response.raise_for_status()
return response.json()["sha"]
def get_github_archive_url(config):
return ARCHIVE_TEMPLATE.format(**config)
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"repo_file",
metavar="repo-file",
type=Path,
help="JSON file with pinned configuration.",
)
parser.add_argument(
"--branch",
type=str,
help="Branch to update to.",
)
parser.add_argument(
"--owner",
type=str,
help="Repository owner to update to.",
)
parser.add_argument(
"--rev",
type=str,
help="Revision to pin.",
)
parser.add_argument(
"--dry-run",
action="store_true",
)
args = parser.parse_args()
repo_file = args.repo_file
config = json.loads(repo_file.read_text())
for key in ["owner", "branch"]:
if getattr(args, key) is not None:
config[key] = getattr(args, key)
if args.rev is not None:
config["rev"] = args.rev
else:
config["rev"] = get_github_commit(config)
archive_url = get_github_archive_url(config)
config.update(get_url_hash(HASH_TYPE, "source", archive_url))
output = json.dumps(config, indent=2)
if args.dry_run:
print(output)
else:
repo_file.write_text(output)
if __name__ == "__main__":
main()
...@@ -10,7 +10,7 @@ from ps_tools import get_url_hash ...@@ -10,7 +10,7 @@ from ps_tools import get_url_hash
# We pass this to builtins.fetchTarball which only supports sha256 # We pass this to builtins.fetchTarball which only supports sha256
HASH_TYPE = "sha256" HASH_TYPE = "sha256"
DEFAULT_CHANNEL = "nixos-21.05" DEFAULT_CHANNEL = "nixos-25.05"
CHANNEL_URL_TEMPLATE = "https://channels.nixos.org/{channel}/nixexprs.tar.xz" CHANNEL_URL_TEMPLATE = "https://channels.nixos.org/{channel}/nixexprs.tar.xz"
...@@ -24,9 +24,8 @@ def get_nixos_channel_url(*, channel): ...@@ -24,9 +24,8 @@ def get_nixos_channel_url(*, channel):
the release. the release.
""" """
response = httpx.head( response = httpx.head(
CHANNEL_URL_TEMPLATE.format(channel=channel), allow_redirects=False CHANNEL_URL_TEMPLATE.format(channel=channel), follow_redirects=False
) )
response.raise_for_status()
assert response.is_redirect assert response.is_redirect
return str(response.next_request.url) return str(response.next_request.url)
...@@ -37,7 +36,7 @@ def main(): ...@@ -37,7 +36,7 @@ def main():
"repo_file", "repo_file",
metavar="repo-file", metavar="repo-file",
nargs="?", nargs="?",
default=Path(__file__).parent.with_name("nixpkgs-2105.json"), default=Path(__file__).parent.with_name("nixpkgs.json"),
type=Path, type=Path,
help="JSON file with pinned configuration.", help="JSON file with pinned configuration.",
) )
...@@ -49,7 +48,9 @@ def main(): ...@@ -49,7 +48,9 @@ def main():
args = parser.parse_args() args = parser.parse_args()
repo_file = args.repo_file repo_file = args.repo_file
print(f"reading {repo_file}")
config = json.loads(repo_file.read_text()) config = json.loads(repo_file.read_text())
print(f"read {config!r}")
config["url"] = get_nixos_channel_url(channel=args.channel) config["url"] = get_nixos_channel_url(channel=args.channel)
hash_data = get_url_hash(HASH_TYPE, name=config["name"], url=config["url"]) hash_data = get_url_hash(HASH_TYPE, name=config["name"], url=config["url"])
...@@ -59,6 +60,7 @@ def main(): ...@@ -59,6 +60,7 @@ def main():
if args.dry_run: if args.dry_run:
print(output) print(output)
else: else:
print(f"writing to {repo_file}")
repo_file.write_text(output) repo_file.write_text(output)
......