Improve nix flake to use nixpkgs-unstable in lieu of master (#17852)

This commit is contained in:
Sandro 2024-11-06 15:03:46 +01:00 committed by GitHub
parent 46bd7e136d
commit 75698a3e53
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 15 deletions

1
changelog.d/17852.misc Normal file
View file

@ -0,0 +1 @@
The nix flake inside the repository no longer tracks nixpkgs/master to not catch the latest bugs from a PR merged 5 minutes ago.

View file

@ -186,16 +186,16 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1690535733, "lastModified": 1729265718,
"narHash": "sha256-WgjUPscQOw3cB8yySDGlyzo6cZNihnRzUwE9kadv/5I=", "narHash": "sha256-4HQI+6LsO3kpWTYuVGIzhJs1cetFcwT7quWCk/6rqeo=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8cacc05fbfffeaab910e8c2c9e2a7c6b32ce881a", "rev": "ccc0c2126893dd20963580b6478d1a10a4512185",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "NixOS", "owner": "NixOS",
"ref": "master", "ref": "nixpkgs-unstable",
"repo": "nixpkgs", "repo": "nixpkgs",
"type": "github" "type": "github"
} }

View file

@ -3,13 +3,13 @@
# (https://github.com/matrix-org/complement) Matrix homeserver test suites are also # (https://github.com/matrix-org/complement) Matrix homeserver test suites are also
# installed automatically. # installed automatically.
# #
# You must have already installed Nix (https://nixos.org) on your system to use this. # You must have already installed Nix (https://nixos.org/download/) on your system to use this.
# Nix can be installed on Linux or MacOS; NixOS is not required. Windows is not # Nix can be installed on any Linux distribiution or MacOS; NixOS is not required.
# directly supported, but Nix can be installed inside of WSL2 or even Docker # Windows is not directly supported, but Nix can be installed inside of WSL2 or even Docker
# containers. Please refer to https://nixos.org/download for details. # containers. Please refer to https://nixos.org/download for details.
# #
# You must also enable support for flakes in Nix. See the following for how to # You must also enable support for flakes in Nix. See the following for how to
# do so permanently: https://nixos.wiki/wiki/Flakes#Enable_flakes # do so permanently: https://wiki.nixos.org/wiki/Flakes#Other_Distros,_without_Home-Manager
# #
# Be warned: you'll need over 3.75 GB of free space to download all the dependencies. # Be warned: you'll need over 3.75 GB of free space to download all the dependencies.
# #
@ -20,7 +20,7 @@
# locally from "services", such as PostgreSQL and Redis. # locally from "services", such as PostgreSQL and Redis.
# #
# You should now be dropped into a new shell with all programs and dependencies # You should now be dropped into a new shell with all programs and dependencies
# availabile to you! # available to you!
# #
# You can start up pre-configured local Synapse, PostgreSQL and Redis instances by # You can start up pre-configured local Synapse, PostgreSQL and Redis instances by
# running: `devenv up`. To stop them, use Ctrl-C. # running: `devenv up`. To stop them, use Ctrl-C.
@ -39,9 +39,9 @@
{ {
inputs = { inputs = {
# Use the master/unstable branch of nixpkgs. Used to fetch the latest # Use the rolling/unstable branch of nixpkgs. Used to fetch the latest
# available versions of packages. # available versions of packages.
nixpkgs.url = "github:NixOS/nixpkgs/master"; nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
# Output a development shell for x86_64/aarch64 Linux/Darwin (MacOS). # Output a development shell for x86_64/aarch64 Linux/Darwin (MacOS).
systems.url = "github:nix-systems/default"; systems.url = "github:nix-systems/default";
# A development environment manager built on Nix. See https://devenv.sh. # A development environment manager built on Nix. See https://devenv.sh.
@ -50,7 +50,7 @@
rust-overlay.url = "github:oxalica/rust-overlay"; rust-overlay.url = "github:oxalica/rust-overlay";
}; };
outputs = { self, nixpkgs, devenv, systems, rust-overlay, ... } @ inputs: outputs = { nixpkgs, devenv, systems, rust-overlay, ... } @ inputs:
let let
forEachSystem = nixpkgs.lib.genAttrs (import systems); forEachSystem = nixpkgs.lib.genAttrs (import systems);
in { in {
@ -126,7 +126,7 @@
# Automatically activate the poetry virtualenv upon entering the shell. # Automatically activate the poetry virtualenv upon entering the shell.
languages.python.poetry.activate.enable = true; languages.python.poetry.activate.enable = true;
# Install all extra Python dependencies; this is needed to run the unit # Install all extra Python dependencies; this is needed to run the unit
# tests and utilitise all Synapse features. # tests and utilise all Synapse features.
languages.python.poetry.install.arguments = ["--extras all"]; languages.python.poetry.install.arguments = ["--extras all"];
# Install the 'matrix-synapse' package from the local checkout. # Install the 'matrix-synapse' package from the local checkout.
languages.python.poetry.install.installRootPackage = true; languages.python.poetry.install.installRootPackage = true;
@ -163,8 +163,8 @@
# Create a postgres user called 'synapse_user' which has ownership # Create a postgres user called 'synapse_user' which has ownership
# over the 'synapse' database. # over the 'synapse' database.
services.postgres.initialScript = '' services.postgres.initialScript = ''
CREATE USER synapse_user; CREATE USER synapse_user;
ALTER DATABASE synapse OWNER TO synapse_user; ALTER DATABASE synapse OWNER TO synapse_user;
''; '';
# Redis is needed in order to run Synapse in worker mode. # Redis is needed in order to run Synapse in worker mode.