A simple flake template
0
flake.nix
37 lines 931 B view raw
1{ 2 # heavily inspired by Mr. Raf (aka @NotAShelf) 3 description = "A Rexie flake template"; 4 5 inputs = { 6 nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; 7 systems.url = "github:nix-systems/default"; 8 }; 9 10 outputs = { 11 self, 12 nixpkgs, 13 systems, 14 ... 15 }: let 16 pkgsOf = nixpkgs.legacyPackages; 17 eachSystem = nixpkgs.lib.genAttrs (import systems); 18 in { 19 packages = eachSystem (system: { 20 default = pkgsOf.${system}.callPackage ./nix/package.nix {}; # ALWAYS callPackage your package drvs 21 }); 22 23 devShells = eachSystem (system: { 24 default = pkgsOf.${system}.callPackage ./nix/shell.nix { 25 your-package-name = self.packages.${system}.default; 26 }; 27 ### nix/shell.nix 28 ## {mkShell, your-package-name}: 29 ## mkShell { 30 ## inputsFrom = [your-package-name]; 31 ## packages = [ 32 ## # other dev packages 33 ## ] 34 ## } 35 }); 36 }; 37}