diff --git a/.ci/scripts/build-all-dev-envs.sh b/.ci/scripts/build-all-dev-envs.sh index 67f6258..80aa6c4 100755 --- a/.ci/scripts/build-all-dev-envs.sh +++ b/.ci/scripts/build-all-dev-envs.sh @@ -5,7 +5,7 @@ PROJECT_FLAKES_DIR="project-flakes" set -ex # Loop through each sub-directory in 'project-flakes' -for project in "$PROJECT_FLAKES_DIR"/*/ ; do +for project in "$PROJECT_FLAKES_DIR"/*/ ; do # Remove the trailing '/' project=${project%*/} # Extract the project name @@ -24,7 +24,7 @@ for project in "$PROJECT_FLAKES_DIR"/*/ ; do # Enter the project directory. cd "$project" # Show the generated outputs of the flake. - nix flake show .. + nix flake show --impure .. # Attempt to build and enter the development environment, # then run the specified test command. nix develop --impure ..#"$project" -c bash -c "$cmd" @@ -32,4 +32,4 @@ for project in "$PROJECT_FLAKES_DIR"/*/ ; do cd .. # Delete the project directory. rm -rf "$project" -done \ No newline at end of file +done diff --git a/README.md b/README.md index db8fb90..a890053 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ installer](https://github.com/DeterminateSystems/nix-installer?tab=readme-ov-fil Then at the root of your local Synapse checkout, run the following command: ```shell -nix develop impure github:element-hq/nix-flakes#synapse +nix develop --impure github:element-hq/nix-flakes#synapse ``` Dependencies will be downloaded and installed for you, and you'll be dropped @@ -59,7 +59,7 @@ If typing `nix develop --impure ...` gets tiring, you can automatically enter the desired project development environment by installing `direnv` and creating a `.envrc` file with the following contents: -``` +```shell use flake --impure github:element-hq/nix-flakes#synapse ``` @@ -145,15 +145,15 @@ language that returns a devenv module. A basic example of a `module.nix`: To test a development environment locally without pushing it to git, you can use the following to reference a development environment in a local directory: -``` +```shell nix develop path:///home/work/code/nix-flakes#synapse --impure ``` -...which would drop you into a new `synapse` development environment shell. +... which would drop you into a new `synapse` development environment shell. The same can be done when using `direnv`. Just set your `.envrc` file to: -``` +```shell use flake path:///home/work/code/nix-flakes#synapse --impure ``` @@ -168,4 +168,4 @@ is where all that happens. available options you can specify. The [Nix Language basics](https://zero-to-nix.com/concepts/nix-language) is a -recommended read. \ No newline at end of file +recommended read. diff --git a/flake.lock b/flake.lock index dc07ec6..5c0744a 100644 --- a/flake.lock +++ b/flake.lock @@ -333,14 +333,18 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 0, - "narHash": "sha256-CyyxvOwFf12I91PBWz43iGT1kjsf5oi6ax7CrvaMyAo=", - "path": "/nix/store/yqy82fn77fy3rv7lpwa9m11w3a2nnqg5-source", - "type": "path" + "lastModified": 1729265718, + "narHash": "sha256-4HQI+6LsO3kpWTYuVGIzhJs1cetFcwT7quWCk/6rqeo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ccc0c2126893dd20963580b6478d1a10a4512185", + "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs_4": { diff --git a/flake.nix b/flake.nix index 434bb21..3c61b45 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,7 @@ { inputs = { + # Aim for the latest versions of packages by default. + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; # A development environment manager built on Nix. See https://devenv.sh. devenv.url = "github:cachix/devenv/v1.0.7"; # Output a development shell for x86_64/aarch64 Linux/Darwin (MacOS). @@ -111,4 +113,4 @@ } ); }; -} \ No newline at end of file +} diff --git a/project-flakes/matrix-hyper-federation-client/module.nix b/project-flakes/matrix-hyper-federation-client/module.nix index a1d2318..422d835 100644 --- a/project-flakes/matrix-hyper-federation-client/module.nix +++ b/project-flakes/matrix-hyper-federation-client/module.nix @@ -7,10 +7,10 @@ # Search for package names at https://search.nixos.org/packages?channel=unstable packages = with pkgs; [ # The rust toolchain and related tools. - (rust-bin.stable."1.66.0".default.override { + (rust-bin.stable."1.70.0".default.override { extensions = [ "rust-src" ]; }) - + # For enabling faster Rust compile times. See the `env` option below. clang mold @@ -27,4 +27,4 @@ # TODO: The lld flags may be Linux-only? "RUSTFLAGS" = "-Clinker=clang -Clink-arg=-fuse-ld=${pkgs.mold}/bin/mold"; }; -} \ No newline at end of file +} diff --git a/project-flakes/synapse/module.nix b/project-flakes/synapse/module.nix index 651425c..cb3d755 100644 --- a/project-flakes/synapse/module.nix +++ b/project-flakes/synapse/module.nix @@ -54,7 +54,7 @@ # Automatically activate the poetry virtualenv upon entering the shell. languages.python.poetry.activate.enable = true; # 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"]; # Install the 'matrix-synapse' package from the local checkout. languages.python.poetry.install.installRootPackage = true; @@ -81,8 +81,8 @@ # Create a postgres user called 'synapse_user' which has ownership # over the 'synapse' database. services.postgres.initialScript = '' - CREATE USER synapse_user; - ALTER DATABASE synapse OWNER TO synapse_user; + CREATE USER synapse_user; + ALTER DATABASE synapse OWNER TO synapse_user; ''; # Redis is needed in order to run Synapse in worker mode. @@ -130,4 +130,4 @@ enterShell = '' unset LD_LIBRARY_PATH ''; -} \ No newline at end of file +} diff --git a/project-flakes/sytest/module.nix b/project-flakes/sytest/module.nix index 42585e3..8984139 100644 --- a/project-flakes/sytest/module.nix +++ b/project-flakes/sytest/module.nix @@ -43,7 +43,7 @@ # corresponding Nix packages on https://search.nixos.org/packages. # # This was done until `./install-deps.pl --dryrun` produced no output. - env.PERL5LIB = "${with pkgs.perl536Packages; makePerlPath [ + env.PERL5LIB = "${with pkgs.perl538Packages; makePerlPath [ DBI ClassMethodModifiers CryptEd25519 @@ -79,4 +79,4 @@ URI YAMLLibYAML ]}"; -} \ No newline at end of file +}