-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1005 from nix-community/cross-platform-examples
tree-wide: make examples eval on all platforms...
- Loading branch information
Showing
26 changed files
with
831 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,5 @@ | |
builtins-derivation = { | ||
builder = "/bin/sh"; | ||
args = ["-c" "echo $name > $out"]; | ||
system = "x86_64-linux"; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,53 @@ | ||
{ | ||
description = "My flake with dream2nix packages"; | ||
# This example flake.nix is pretty generic and the same for all | ||
# examples, except when they define devShells or extra packages. | ||
description = "Dream2nix example flake"; | ||
|
||
# We import the latest commit of dream2nix main branch and instruct nix to | ||
# re-use the nixpkgs revision referenced by dream2nix. | ||
# This is what we test in CI with, but you can generally refer to any | ||
# recent nixpkgs commit here. | ||
inputs = { | ||
dream2nix.url = "github:nix-community/dream2nix"; | ||
nixpkgs.follows = "dream2nix/nixpkgs"; | ||
}; | ||
|
||
outputs = inputs @ { | ||
outputs = { | ||
self, | ||
dream2nix, | ||
nixpkgs, | ||
... | ||
}: let | ||
system = "x86_64-linux"; | ||
# A helper that helps us define the attributes below for | ||
# all systems we care about. | ||
eachSystem = nixpkgs.lib.genAttrs [ | ||
"aarch64-darwin" | ||
"aarch64-linux" | ||
"x86_64-darwin" | ||
"x86_64-linux" | ||
]; | ||
in { | ||
# All packages defined in ./packages/<name> are automatically added to the flake outputs | ||
# e.g., 'packages/hello/default.nix' becomes '.#packages.hello' | ||
packages.${system}.default = dream2nix.lib.evalModules { | ||
packageSets.nixpkgs = inputs.dream2nix.inputs.nixpkgs.legacyPackages.${system}; | ||
modules = [ | ||
./default.nix | ||
{ | ||
paths.projectRoot = ./.; | ||
# can be changed to ".git" or "flake.nix" to get rid of .project-root | ||
paths.projectRootFile = "flake.nix"; | ||
paths.package = ./.; | ||
} | ||
]; | ||
}; | ||
packages = eachSystem (system: { | ||
# For each system, we define our default package | ||
# by passing in our desired nixpkgs revision plus | ||
# any dream2nix modules needed by it. | ||
default = dream2nix.lib.evalModules { | ||
packageSets.nixpkgs = nixpkgs.legacyPackages.${system}; | ||
modules = [ | ||
# Import our actual package definiton as a dream2nix module from ./default.nix | ||
./default.nix | ||
{ | ||
builtins-derivation = {inherit system;}; | ||
} | ||
{ | ||
# Aid dream2nix to find the project root. This setup should also works for mono | ||
# repos. If you only have a single project, the defaults should be good enough. | ||
paths.projectRoot = ./.; | ||
# can be changed to ".git" or "flake.nix" to get rid of .project-root | ||
paths.projectRootFile = "flake.nix"; | ||
paths.package = ./.; | ||
} | ||
]; | ||
}; | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,50 @@ | ||
{ | ||
description = "My flake with dream2nix packages"; | ||
# This example flake.nix is pretty generic and the same for all | ||
# examples, except when they define devShells or extra packages. | ||
description = "Dream2nix example flake"; | ||
|
||
# We import the latest commit of dream2nix main branch and instruct nix to | ||
# re-use the nixpkgs revision referenced by dream2nix. | ||
# This is what we test in CI with, but you can generally refer to any | ||
# recent nixpkgs commit here. | ||
inputs = { | ||
dream2nix.url = "github:nix-community/dream2nix"; | ||
nixpkgs.follows = "dream2nix/nixpkgs"; | ||
}; | ||
|
||
outputs = inputs @ { | ||
outputs = { | ||
self, | ||
dream2nix, | ||
nixpkgs, | ||
... | ||
}: let | ||
system = "x86_64-linux"; | ||
# A helper that helps us define the attributes below for | ||
# all systems we care about. | ||
eachSystem = nixpkgs.lib.genAttrs [ | ||
"aarch64-darwin" | ||
"aarch64-linux" | ||
"x86_64-darwin" | ||
"x86_64-linux" | ||
]; | ||
in { | ||
# All packages defined in ./packages/<name> are automatically added to the flake outputs | ||
# e.g., 'packages/hello/default.nix' becomes '.#packages.hello' | ||
packages.${system}.default = dream2nix.lib.evalModules { | ||
packageSets.nixpkgs = inputs.dream2nix.inputs.nixpkgs.legacyPackages.${system}; | ||
modules = [ | ||
./default.nix | ||
{ | ||
paths.projectRoot = ./.; | ||
# can be changed to ".git" or "flake.nix" to get rid of .project-root | ||
paths.projectRootFile = "flake.nix"; | ||
paths.package = ./.; | ||
} | ||
]; | ||
}; | ||
packages = eachSystem (system: { | ||
# For each system, we define our default package | ||
# by passing in our desired nixpkgs revision plus | ||
# any dream2nix modules needed by it. | ||
default = dream2nix.lib.evalModules { | ||
packageSets.nixpkgs = nixpkgs.legacyPackages.${system}; | ||
modules = [ | ||
# Import our actual package definiton as a dream2nix module from ./default.nix | ||
./default.nix | ||
{ | ||
# Aid dream2nix to find the project root. This setup should also works for mono | ||
# repos. If you only have a single project, the defaults should be good enough. | ||
paths.projectRoot = ./.; | ||
# can be changed to ".git" or "flake.nix" to get rid of .project-root | ||
paths.projectRootFile = "flake.nix"; | ||
paths.package = ./.; | ||
} | ||
]; | ||
}; | ||
}); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,50 @@ | ||
{ | ||
description = "My flake with dream2nix packages"; | ||
# This example flake.nix is pretty generic and the same for all | ||
# examples, except when they define devShells or extra packages. | ||
description = "Dream2nix example flake"; | ||
|
||
# We import the latest commit of dream2nix main branch and instruct nix to | ||
# re-use the nixpkgs revision referenced by dream2nix. | ||
# This is what we test in CI with, but you can generally refer to any | ||
# recent nixpkgs commit here. | ||
inputs = { | ||
dream2nix.url = "github:nix-community/dream2nix"; | ||
nixpkgs.follows = "dream2nix/nixpkgs"; | ||
}; | ||
|
||
outputs = inputs @ { | ||
outputs = { | ||
self, | ||
dream2nix, | ||
nixpkgs, | ||
... | ||
}: let | ||
system = "x86_64-linux"; | ||
# A helper that helps us define the attributes below for | ||
# all systems we care about. | ||
eachSystem = nixpkgs.lib.genAttrs [ | ||
"aarch64-darwin" | ||
"aarch64-linux" | ||
"x86_64-darwin" | ||
"x86_64-linux" | ||
]; | ||
in { | ||
# All packages defined in ./packages/<name> are automatically added to the flake outputs | ||
# e.g., 'packages/hello/default.nix' becomes '.#packages.hello' | ||
packages.${system}.default = dream2nix.lib.evalModules { | ||
packageSets.nixpkgs = inputs.dream2nix.inputs.nixpkgs.legacyPackages.${system}; | ||
modules = [ | ||
./default.nix | ||
{ | ||
paths.projectRoot = ./.; | ||
# can be changed to ".git" or "flake.nix" to get rid of .project-root | ||
paths.projectRootFile = "flake.nix"; | ||
paths.package = ./.; | ||
} | ||
]; | ||
}; | ||
packages = eachSystem (system: { | ||
# For each system, we define our default package | ||
# by passing in our desired nixpkgs revision plus | ||
# any dream2nix modules needed by it. | ||
default = dream2nix.lib.evalModules { | ||
packageSets.nixpkgs = nixpkgs.legacyPackages.${system}; | ||
modules = [ | ||
# Import our actual package definiton as a dream2nix module from ./default.nix | ||
./default.nix | ||
{ | ||
# Aid dream2nix to find the project root. This setup should also works for mono | ||
# repos. If you only have a single project, the defaults should be good enough. | ||
paths.projectRoot = ./.; | ||
# can be changed to ".git" or "flake.nix" to get rid of .project-root | ||
paths.projectRootFile = "flake.nix"; | ||
paths.package = ./.; | ||
} | ||
]; | ||
}; | ||
}); | ||
}; | ||
} |
54 changes: 36 additions & 18 deletions
54
examples/packages/languages/haskell-local-development-cabal/flake.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,50 @@ | ||
{ | ||
description = "My flake with dream2nix packages"; | ||
# This example flake.nix is pretty generic and the same for all | ||
# examples, except when they define devShells or extra packages. | ||
description = "Dream2nix example flake"; | ||
|
||
# We import the latest commit of dream2nix main branch and instruct nix to | ||
# re-use the nixpkgs revision referenced by dream2nix. | ||
# This is what we test in CI with, but you can generally refer to any | ||
# recent nixpkgs commit here. | ||
inputs = { | ||
dream2nix.url = "github:nix-community/dream2nix"; | ||
nixpkgs.follows = "dream2nix/nixpkgs"; | ||
}; | ||
|
||
outputs = inputs @ { | ||
outputs = { | ||
self, | ||
dream2nix, | ||
nixpkgs, | ||
... | ||
}: let | ||
system = "x86_64-linux"; | ||
# A helper that helps us define the attributes below for | ||
# all systems we care about. | ||
eachSystem = nixpkgs.lib.genAttrs [ | ||
"aarch64-darwin" | ||
"aarch64-linux" | ||
"x86_64-darwin" | ||
"x86_64-linux" | ||
]; | ||
in { | ||
# All packages defined in ./packages/<name> are automatically added to the flake outputs | ||
# e.g., 'packages/hello/default.nix' becomes '.#packages.hello' | ||
packages.${system}.default = dream2nix.lib.evalModules { | ||
packageSets.nixpkgs = inputs.dream2nix.inputs.nixpkgs.legacyPackages.${system}; | ||
modules = [ | ||
./default.nix | ||
{ | ||
paths.projectRoot = ./.; | ||
# can be changed to ".git" or "flake.nix" to get rid of .project-root | ||
paths.projectRootFile = "flake.nix"; | ||
paths.package = ./.; | ||
} | ||
]; | ||
}; | ||
packages = eachSystem (system: { | ||
# For each system, we define our default package | ||
# by passing in our desired nixpkgs revision plus | ||
# any dream2nix modules needed by it. | ||
default = dream2nix.lib.evalModules { | ||
packageSets.nixpkgs = nixpkgs.legacyPackages.${system}; | ||
modules = [ | ||
# Import our actual package definiton as a dream2nix module from ./default.nix | ||
./default.nix | ||
{ | ||
# Aid dream2nix to find the project root. This setup should also works for mono | ||
# repos. If you only have a single project, the defaults should be good enough. | ||
paths.projectRoot = ./.; | ||
# can be changed to ".git" or "flake.nix" to get rid of .project-root | ||
paths.projectRootFile = "flake.nix"; | ||
paths.package = ./.; | ||
} | ||
]; | ||
}; | ||
}); | ||
}; | ||
} |
54 changes: 36 additions & 18 deletions
54
examples/packages/languages/nodejs-local-development-nextjs/flake.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,50 @@ | ||
{ | ||
description = "My flake with dream2nix packages"; | ||
# This example flake.nix is pretty generic and the same for all | ||
# examples, except when they define devShells or extra packages. | ||
description = "Dream2nix example flake"; | ||
|
||
# We import the latest commit of dream2nix main branch and instruct nix to | ||
# re-use the nixpkgs revision referenced by dream2nix. | ||
# This is what we test in CI with, but you can generally refer to any | ||
# recent nixpkgs commit here. | ||
inputs = { | ||
dream2nix.url = "github:nix-community/dream2nix"; | ||
nixpkgs.follows = "dream2nix/nixpkgs"; | ||
}; | ||
|
||
outputs = inputs @ { | ||
outputs = { | ||
self, | ||
dream2nix, | ||
nixpkgs, | ||
... | ||
}: let | ||
system = "x86_64-linux"; | ||
# A helper that helps us define the attributes below for | ||
# all systems we care about. | ||
eachSystem = nixpkgs.lib.genAttrs [ | ||
"aarch64-darwin" | ||
"aarch64-linux" | ||
"x86_64-darwin" | ||
"x86_64-linux" | ||
]; | ||
in { | ||
# All packages defined in ./packages/<name> are automatically added to the flake outputs | ||
# e.g., 'packages/hello/default.nix' becomes '.#packages.hello' | ||
packages.${system}.default = dream2nix.lib.evalModules { | ||
packageSets.nixpkgs = inputs.dream2nix.inputs.nixpkgs.legacyPackages.${system}; | ||
modules = [ | ||
./default.nix | ||
{ | ||
paths.projectRoot = ./.; | ||
# can be changed to ".git" or "flake.nix" to get rid of .project-root | ||
paths.projectRootFile = "flake.nix"; | ||
paths.package = ./.; | ||
} | ||
]; | ||
}; | ||
packages = eachSystem (system: { | ||
# For each system, we define our default package | ||
# by passing in our desired nixpkgs revision plus | ||
# any dream2nix modules needed by it. | ||
default = dream2nix.lib.evalModules { | ||
packageSets.nixpkgs = nixpkgs.legacyPackages.${system}; | ||
modules = [ | ||
# Import our actual package definiton as a dream2nix module from ./default.nix | ||
./default.nix | ||
{ | ||
# Aid dream2nix to find the project root. This setup should also works for mono | ||
# repos. If you only have a single project, the defaults should be good enough. | ||
paths.projectRoot = ./.; | ||
# can be changed to ".git" or "flake.nix" to get rid of .project-root | ||
paths.projectRootFile = "flake.nix"; | ||
paths.package = ./.; | ||
} | ||
]; | ||
}; | ||
}); | ||
}; | ||
} |
Oops, something went wrong.