update: 2023.8.3 -> 2023.10.0

* nixpkgs-23.05 -> nixpkgs-unstable (for nodejs 21)
* nodejs_20 -> nodejs_21
* go_1_20 -> go_1_21
* added workaround for poetry2nix to drop python dev-dependencies

Flake lock file updates:

• Updated input 'authentik-src':
    'github:goauthentik/authentik/f885f8c0395df639ccabd762910867bef0f4577c' (2023-09-11)
  → 'github:goauthentik/authentik/b7c02808c664714144bd7ae6fee4c6402a88f426' (2023-10-26)
• Updated input 'flake-compat':
    'github:edolstra/flake-compat/35bb57c0c8d8b62bbfd284272c928ceb64ddbde9' (2023-01-17)
  → 'github:edolstra/flake-compat/0f9255e01c2351cc7d116c072cb317785dd33b33' (2023-10-04)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/7f53fdb7bdc5bb237da7fefef12d099e4fd611ca' (2023-09-01)
  → 'github:hercules-ci/flake-parts/c9afaba3dfa4085dbd2ccb38dfade5141e33d9d4' (2023-10-03)
• Updated input 'flake-parts/nixpkgs-lib':
    'github:NixOS/nixpkgs/3e52e76b70d5508f3cec70b882a29199f4d1ee85?dir=lib' (2023-08-31)
  → 'github:NixOS/nixpkgs/f5892ddac112a1e9b3612c39af1b72987ee5783a?dir=lib' (2023-09-29)
• Updated input 'flake-utils':
    'github:numtide/flake-utils/f9e7cf818399d17d347f847525c5a5a8032e4e44' (2023-08-23)
  → 'github:numtide/flake-utils/ff7b65b44d01cf9ba6a71320833626af21126384' (2023-09-12)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/4c8cf44c5b9481a4f093f1df3b8b7ba997a7c760' (2023-09-10)
  → 'github:NixOS/nixpkgs/8efd5d1e283604f75a808a20e6cde0ef313d07d4' (2023-10-24)
• Updated input 'poetry2nix':
    'github:nix-community/poetry2nix/c3d3c4a0396b1bcccd72c82551a319229997f6e4' (2023-09-08)
  → 'github:nix-community/poetry2nix/8f2c483f9a40db26011f6668559574a4b86ed499' (2023-10-26)
• Updated input 'poetry2nix/nix-github-actions':
    'github:nix-community/nix-github-actions/165b1650b753316aa7f1787f3005a8d2da0f5301' (2023-07-09)
  → 'github:nix-community/nix-github-actions/bd5bdbb52350e145c526108f4ef192eb8e554fa0' (2023-09-02)
• Added input 'poetry2nix/systems':
    'github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e' (2023-04-09)
• Added input 'poetry2nix/treefmt-nix':
    'github:numtide/treefmt-nix/aae39f64f5ecbe89792d05eacea5cb241891292a' (2023-10-15)
• Added input 'poetry2nix/treefmt-nix/nixpkgs':
    follows 'poetry2nix/nixpkgs'
This commit is contained in:
WilliButz 2023-10-26 16:33:08 +02:00
parent e3e7edaba4
commit cdffc37ad9
No known key found for this signature in database
GPG key ID: FB0513677AB15BEA
3 changed files with 88 additions and 39 deletions

View file

@ -8,7 +8,7 @@
url = "github:edolstra/flake-compat";
flake = false;
};
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
poetry2nix = {
url = "github:nix-community/poetry2nix";
inputs = {
@ -24,7 +24,7 @@
};
};
authentik-src = { # change version string in outputs as well when updating
url = "github:goauthentik/authentik/version/2023.8.3";
url = "github:goauthentik/authentik/version/2023.10.0";
flake = false;
};
};
@ -43,7 +43,7 @@
{ inherit inputs; }
({ inputs, lib, withSystem, ... }:
let
authentik-version = "2023.8.3"; # to pass to the drvs of some components
authentik-version = "2023.10.0"; # to pass to the drvs of some components
in {
systems = [
"x86_64-linux"
@ -58,8 +58,8 @@
);
};
};
perSystem = { inputs', pkgs, system, ... }: let
inherit (inputs'.poetry2nix.legacyPackages)
perSystem = { pkgs, system, ... }: let
inherit (import inputs.poetry2nix { inherit pkgs; })
mkPoetryEnv
defaultPoetryOverrides;
in {
@ -79,15 +79,15 @@
mv -v ../website $out
'';
};
frontend = napalm.legacyPackages.${system}.buildPackage "${authentik-src}/web" {
frontend = napalm.legacyPackages.${system}.buildPackage "${authentik-src}/web" rec {
version = authentik-version; # 0.0.0 specified upstream in package.json
NODE_ENV = "production";
nodejs = pkgs.nodejs_20;
nodejs = pkgs.nodejs_21;
preBuild = ''
ln -sv ${docs} ../website
'';
npmCommands = [
"npm install --include=dev --nodedir=${pkgs.nodejs_20}/include/node --loglevel verbose --ignore-scripts"
"npm install --include=dev --nodedir=${nodejs}/include/node --loglevel verbose --ignore-scripts"
"npm run build"
];
installPhase = ''
@ -100,9 +100,16 @@
projectDir = authentik-src;
python = pkgs.python311;
overrides = [ defaultPoetryOverrides ] ++ (import ./poetry2nix-python-overrides.nix pkgs);
# workaround to remove dev-dependencies for the current combination of legacy pyproject.toml format
# used by authentik and poetry2nix's behavior
groups = [];
checkGroups = [];
pyproject = pkgs.runCommandLocal "patched-pyproject.toml" {} ''
sed -e 's,tool.poetry.dev-dependencies,tool.poetry.group.dev.dependencies,' ${authentik-src}/pyproject.toml > $out
'';
};
# server + outposts
gopkgs = pkgs.buildGo120Module {
gopkgs = pkgs.buildGo121Module {
pname = "authentik-gopkgs";
version = authentik-version;
prePatch = ''
@ -137,7 +144,7 @@
"cmd/proxy"
"cmd/radius"
];
vendorSha256 = "sha256-F3JzzL6Gg9H4qdmp4MbQFupccATYIUIFL05is6xzoZY=";
vendorSha256 = "sha256-JQRGlQ7iYrB5nKli3hoIAJHG9UeGqVD+dMupMUDZ2Zo=";
nativeBuildInputs = [ pkgs.makeWrapper ];
postInstall = ''
wrapProgram $out/bin/server --prefix PATH : ${pythonEnv}/bin
@ -162,8 +169,8 @@
patchShebangs $out/bin/migrate.py
substituteInPlace $out/bin/migrate.py \
--replace \
'migration in Path(__file__).parent.absolute().glob("system_migrations/*.py")' \
'migration in Path("${staticWorkdirDeps}/lifecycle").glob("system_migrations/*.py")'
'migration_path in Path(__file__).parent.absolute().glob("system_migrations/*.py")' \
'migration_path in Path("${staticWorkdirDeps}/lifecycle").glob("system_migrations/*.py")'
wrapProgram $out/bin/migrate.py \
--prefix PATH : ${pythonEnv}/bin \
--prefix PYTHONPATH : ${staticWorkdirDeps}