This repository provides the independent, pure, and declarative Nix/NixOS packaging and development environments for DanXi — the all-rounded service app for Fudan University students.
Since this repository is fully powered by Nix Flakes, you can run, develop, or build DanXi directly without manual installation or pre-configuring Flutter/Android SDKs.
Launch the latest compiled Linux desktop version of DanXi directly from GitHub:
nix run github:DanXi-Dev/DanXi-nixThe build outputs will be symlinked to the local ./result/ directory.
# Build Linux Desktop binary
nix build github:DanXi-Dev/DanXi-nix
# Build Android APK (Declarative Sandbox Build)
nix build github:DanXi-Dev/DanXi-nix#androidEnter a pure, reproducible development environment containing the exact Flutter SDK, Android SDK/Tools, and Linux native dependencies needed for DanXi:
# cd DanXi-Dev/DanXi
# Enter the default development shell
nix develop github:DanXi-Dev/DanXi-nix
# Alternative: Build Android APK inside the development shell environment
nix develop github:DanXi-Dev/DanXi-nix -c flutter build apkIf you want to install DanXi permanently on your NixOS system via your system configuration flake:
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
# Add DanXi-nix as an input
dan-xi.url = "github:DanXi-Dev/DanXi-nix";
};outputs = { nixpkgs, dan-xi, ... }: {
nixosConfigurations.${host} = nixpkgs.lib.nixosSystem {
modules = [
({ pkgs, ... }: {
environment.systemPackages = [
# Install the default Linux desktop package
dan-xi.packages.${pkgs.stdenv.hostPlatform.system}.default
];
})
];
};
};outputs = { nixpkgs, home-manager, dan-xi, ... }: {
homeConfigurations.${user} = home-manager.lib.homeManagerConfiguration {
modules = [
({ pkgs, ... }: {
home.packages = [
# Install the default Linux desktop package to user profile
dan-xi.packages.${pkgs.stdenv.hostPlatform.system}.default
];
})
];
};
};As a standalone package manager repository, keeping DanXi updated with the upstream repository is straightforward.
To update the tracked upstream commit of DanXi source code and bump the flake.lock:
nix flake update dan-xi-srcThis Nix packaging repository inherits the licensing of the main DanXi project.