diff options
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;}; + }; +} |
