-
Notifications
You must be signed in to change notification settings - Fork 67
Add an example of dogfooding (fix #121) #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Atry
wants to merge
20
commits into
hercules-ci:main
Choose a base branch
from
Atry:example-dogfooding
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
aafcaf1
Add dogfood template
Atry a13fbf2
Create a more sophisticated lazy self
Atry d30b7b2
Simplify dogfood.nix
Atry 1456b31
Merge commit '1e8a89e5f81bca67c5f649318179fc11727262d0' into example-…
Atry 7ca7b6f
Use moduleLocation instead of changing self
Atry 8ad164c
Use flake.nix as the location
Atry 9ee625d
Merge commit 'f76e870d64779109e41370848074ac4eaa1606ec' into HEAD
Atry 89c069d
Add bootstrap step
Atry 863f8b6
Add a dev flake
Atry 7b75530
Avoid double mkFlake
Atry 08d2ea1
Merge commit '8c9fa2545007b49a5db5f650ae91f227672c3877' into example-…
Atry 478396a
Update dev.nix
Atry de10e51
Update to nixpkgs 23.05
Atry 539814f
Remove .gitignore
Atry b75dd7c
Avoid moduleLocation comparison
Atry ebe79a3
Merge commit 'bcef6817a8b2aa20a5a6dbb19b43e63c5bf8619a' into example-…
Atry 0bbf4aa
Dogfooding via partitions
Atry 5ce8768
Add `options.enableUserStdenv`
Atry 1796154
Move `enableUserStdenv` to `customHello.enableUserStdenv`
Atry 56f98c5
23.05 -> 24.05
Atry File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| /.direnv/ |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| description = "Description for the project"; | ||
|
|
||
| inputs = { | ||
| nixpkgs_22_11.url = "github:NixOS/nixpkgs/nixos-22.11"; | ||
| }; | ||
|
|
||
| outputs = { flake-parts, self, nixpkgs, ... }@inputs: | ||
| flake-parts.lib.mkFlake | ||
| { | ||
| inherit inputs; | ||
| moduleLocation = ./flake.nix; | ||
| } | ||
| { | ||
| imports = [ | ||
| ./modules/anotherFlakeModule.nix | ||
| ./modules/dev.nix | ||
| ]; | ||
| }; | ||
| } | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| {inputs, ...}: { | ||
| imports = [ | ||
| inputs.flake-parts.flakeModules.flakeModules | ||
| ]; | ||
| flake.flakeModules.anotherFlakeModule = { | ||
| # Define another flake module here | ||
| }; | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| {flake-parts-lib, lib, inputs, ...}@topLevel: | ||
| rec { | ||
| imports = [ | ||
| inputs.flake-parts.flakeModules.flakeModules | ||
| flake.flakeModules.dev | ||
|
|
||
| # Use file name to dogfood a flake module defined from the current flake to avoid infinite recursion | ||
| ./hello.nix | ||
| ]; | ||
| flake.flakeModules.dev = dev: { | ||
| imports = lib.lists.optionals (topLevel.moduleLocation != dev.moduleLocation) [ | ||
| # Use attributes to reference the flake module from other flakes | ||
| topLevel.config.flake.flakeModules.hello | ||
| ]; | ||
|
|
||
| config.systems = [ "x86_64-linux" "aarch64-darwin" ]; | ||
|
|
||
| options.perSystem = flake-parts-lib.mkPerSystemOption ({pkgs, ...}@perSystem: { | ||
| devShells.default = pkgs.mkShell { | ||
| buildInputs = [ perSystem.config.packages.hello_22_11 ]; | ||
| shellHook = '' | ||
| hello | ||
| ''; | ||
| }; | ||
| }); | ||
| }; | ||
| } |
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| {inputs, flake-parts-lib, ...}: | ||
| rec { | ||
| imports = [ | ||
| inputs.flake-parts.flakeModules.flakeModules | ||
| flake.flakeModules.hello | ||
| ]; | ||
|
|
||
| flake.flakeModules.hello = { | ||
| options.perSystem = flake-parts-lib.mkPerSystemOption ({ system, ... }: { | ||
| packages.hello_22_11 = | ||
| inputs.nixpkgs_22_11.legacyPackages.${system}.hello; | ||
| }); | ||
| }; | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.