From 0fed68e150b028b9ad62e75e0472a34224042501 Mon Sep 17 00:00:00 2001 From: Jokler Date: Mon, 5 Oct 2026 16:07:10 +0200 Subject: Add flake configuration --- flake.nix | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..35a8084 --- /dev/null +++ b/flake.nix @@ -0,0 +1,48 @@ +{ + description = "Jokler points website"; + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { + self, + nixpkgs, + fenix, + }: let + supportedSystems = ["x86_64-linux"]; + forEachSystem = nixpkgs.lib.genAttrs supportedSystems; + overlayList = [self.overlays.default]; + pkgsBySystem = forEachSystem ( + system: + import nixpkgs { + inherit system; + overlays = overlayList; + } + ); + in { + overlays.default = final: prev: {joklerpoint = final.callPackage ./package.nix {};}; + + packages = forEachSystem (system: { + joklerpoint = let + inherit (fenix.packages.${system}.minimal) toolchain; + in + pkgsBySystem.${system}.callPackage ./package.nix { + rustPlatform = pkgsBySystem.${system}.makeRustPlatform { + cargo = toolchain; + rustc = toolchain; + }; + }; + default = self.packages.${system}.joklerpoint; + }); + + devShells = forEachSystem (system: { + default = pkgsBySystem.${system}.callPackage ./shell.nix {}; + }); + + nixosModules = import ./nixos-modules {overlays = overlayList;}; + }; +} -- cgit v1.3.1