Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Nix Build and Check

on:
push:
branches: [ main, v4-main ]
pull_request:
branches: [ main, v4-main ]

jobs:
nix-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v27
with:
extra_nix_config: |
experimental-features = nix-command flakes

- name: Check flake
run: nix flake check

- name: Build package
run: nix build

- name: Test wikiteam3dumpgenerator
run: |
nix run . -- --help

- name: Verify reproducibility
run: |
nix build --rebuild
nix path-info --json | jq -r '.[].narHash'
56 changes: 56 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
description = "wikiteam3 - Nix flake for reproducible wiki archiving";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};

outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};

wikiteam3 = pkgs.python3Packages.buildPythonApplication {
pname = "wikiteam3";
version = "3.11.0";

pyproject = true;

src = ./.;

build-system = with pkgs.python3Packages; [
setuptools
];

propagatedBuildInputs = with pkgs.python3Packages; [
requests
mwclient
mwparserfromhell
file-read-backwards
python-slugify
];

meta = with pkgs.lib; {
description = "Tools for archiving wikis";
homepage = "https://github.com/saveweb/wikiteam3";
license = licenses.gpl3;
maintainers = [ "Meta-Introspector Research Group" ];
};
};

in {
packages.${system} = {
default = wikiteam3;
wikiteam3 = wikiteam3;
};

apps.${system}.default = {
type = "app";
program = "${wikiteam3}/bin/wikiteam3dumpgenerator";
};

devShells.${system}.default = pkgs.mkShell {
buildInputs = [ wikiteam3 ];
};
};
}
Loading