-
Notifications
You must be signed in to change notification settings - Fork 14
Remove flake-utils input
#171
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,69 +1,76 @@ | ||
| # Copyright 2025 The zb Authors | ||
| # SPDX-License-Identifier: MIT | ||
|
|
||
| { | ||
| inputs = { | ||
| nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; | ||
| flake-utils.url = "flake-utils"; | ||
| }; | ||
|
|
||
| outputs = | ||
| { | ||
| self, | ||
| nixpkgs, | ||
| flake-utils, | ||
| ... | ||
| }: | ||
| flake-utils.lib.eachDefaultSystem ( | ||
| system: | ||
| let | ||
| pkgs = import nixpkgs { | ||
| inherit system; | ||
| }; | ||
| let | ||
| inherit (nixpkgs) lib; | ||
|
|
||
| inherit (pkgs.lib.attrsets) optionalAttrs; | ||
| forEachSystem = | ||
| fn: lib.genAttrs lib.systems.flakeExposed (system: fn system nixpkgs.legacyPackages.${system}); | ||
| in | ||
| { | ||
| devShells = forEachSystem ( | ||
| _: pkgs: { | ||
| default = pkgs.mkShellNoCC { | ||
| packages = [ | ||
| # Go tooling. | ||
| (pkgs.delve.override { | ||
| buildGoModule = pkgs.buildGo125Module; | ||
| }) | ||
| pkgs.go_1_25 | ||
| pkgs.gopls | ||
|
|
||
| go = pkgs.go_1_25; | ||
| buildGoModule = pkgs.buildGo125Module; | ||
| # JavaScript tooling. | ||
| pkgs.nodejs_22 | ||
| ]; | ||
|
|
||
| zbPackage = pkgs.callPackage ./package.nix { | ||
| inherit buildGoModule; | ||
| }; | ||
| # Since using Go 1.25 from nixpkgs, | ||
| # the Go tool seems to try to use cgo for net and os/user, | ||
| # even though it is not necessary. | ||
| # We disable cgo forcibly for consistency. | ||
| CGO_ENABLED = "0"; | ||
|
|
||
| installerPackage = pkgs.callPackage ./installer {}; | ||
| in | ||
| { | ||
| devShells.default = pkgs.mkShellNoCC { | ||
| packages = [ | ||
| # Go tooling. | ||
| (pkgs.delve.override { | ||
| inherit buildGoModule; | ||
| }) | ||
| go | ||
| pkgs.gopls | ||
| hardeningDisable = [ "fortify" ]; | ||
| }; | ||
| } | ||
| ); | ||
|
|
||
| # JavaScript tooling. | ||
| pkgs.nodejs_22 | ||
| ]; | ||
| packages = forEachSystem ( | ||
| system: pkgs: | ||
| let | ||
| buildGoModule = pkgs.buildGo125Module; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like that this is separated from the Go up above and I'm worried it's going to get out of sync. Can we restructure this so that it is a top-level for-each like what's in main?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Then aren't we just trying to re-create I'll try to unify the behavior here. |
||
|
|
||
| # Since using Go 1.25 from nixpkgs, | ||
| # the Go tool seems to try to use cgo for net and os/user, | ||
| # even though it is not necessary. | ||
| # We disable cgo forcibly for consistency. | ||
| CGO_ENABLED = "0"; | ||
| zbPackage = pkgs.callPackage ./package.nix { | ||
| inherit buildGoModule; | ||
| }; | ||
|
|
||
| hardeningDisable = [ "fortify" ]; | ||
| }; | ||
| installerPackage = pkgs.callPackage ./installer { }; | ||
| in | ||
| ( | ||
| { | ||
| default = zbPackage; | ||
| } | ||
| // lib.optionalAttrs (builtins.elem system installerPackage.meta.platforms) { | ||
| installer = installerPackage; | ||
| } | ||
| ) | ||
| ); | ||
|
|
||
| packages = { | ||
| default = zbPackage; | ||
| } // optionalAttrs (builtins.elem system installerPackage.meta.platforms) { | ||
| installer = installerPackage; | ||
| }; | ||
| } | ||
| ) | ||
| // { | ||
| nixosModules.default = {pkgs, lib, ... }: | ||
| nixosModules.default = | ||
| { | ||
| pkgs, | ||
| lib, | ||
| ... | ||
| }: | ||
| let | ||
| # Slightly higher than option defaults (1500), | ||
| # but lower than lib.mkDefault (1000). | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per nixpkgs:
I also don't really want to expand to that potential set to what nixpkgs supports: zb is very OS-dependent, and so the exact set of targets is important. Let's use an explicit list of systems.