diff options
| author | Jokler <github@jokler.xyz> | 2026-10-05 16:07:10 +0200 |
|---|---|---|
| committer | Jokler <github@jokler.xyz> | 2026-10-05 22:25:43 +0200 |
| commit | 0fed68e150b028b9ad62e75e0472a34224042501 (patch) | |
| tree | b79d449ed201e646307ee4e9305fd041435856d2 /flake.nix | |
| parent | e6468b012d5b33dd16992652da57f11dd5a6e82f (diff) | |
| download | joklerpoints-0fed68e150b028b9ad62e75e0472a34224042501.tar.gz joklerpoints-0fed68e150b028b9ad62e75e0472a34224042501.zip | |
Add flake configuration
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 48 |
1 files changed, 48 insertions, 0 deletions
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;}; + }; +} |
