Skip to content
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

fix config handling revert complex patch handling #90

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:

# Execute /tests/*
- run: nix develop --command check-derivation-outputs
- run: nix develop --command check-derivation-outputs-old
- run: nix develop --command check-channel-patching
- run: nix develop --command check-overlays-flow
- run: nix develop --command check-hosts-config

Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ Main flake-utils-plus features (Attributes visible from `flake.nix`):
- Option [`nix.generateNixPathFromInputs`](./lib/options.nix) - Generate `nix.nixPath` from available inputs.
- Option [`nix.linkInputs`](./lib/options.nix) - Symlink inputs to /etc/nix/inputs.
- Simple and clean support for multiple `nixpkgs` references.
- `nixpkgs` references patching.
- `channelsConfig` - Config applied to all `nixpkgs` references.
- `hostDefaults` - Default configuration shared between host definitions.
- `outputsBuilder` - Clean way to export packages/apps/etc.
Expand Down Expand Up @@ -92,9 +91,6 @@ in flake-utils-plus.lib.mkFlake {
# Channel specific config options.
channels.<name>.config = { allowUnfree = true; };

# Patches to apply on selected channel.
channels.<name>.patches = [ ./someAwesomePatch.patch ];

# Overlays to apply on a selected channel.
channels.<name>.overlaysBuilder = channels: [
(final: prev: { inherit (channels.unstable) neovim; })
Expand Down
4 changes: 1 addition & 3 deletions devShell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,10 @@ devshell.mkShell {
command = "fd --extension nix --exec nix-instantiate --parse --quiet {} >/dev/null";
}

(test "channel-patching")
(test "derivation-outputs")
(test "derivation-outputs-old")
(test "hosts-config")
(test "overlays-flow")
(test "all" // { command = "check-channel-patching && check-derivation-outputs && check-derivation-outputs-old && check-hosts-config && check-overlays-flow"; })
(test "all" // { command = "check-derivation-outputs && check-hosts-config && check-overlays-flow"; })

(dry-nixos-build "minimal-multichannel" "Hostname1")
(dry-nixos-build "minimal-multichannel" "Hostname2")
Expand Down
1 change: 1 addition & 0 deletions examples/exporters/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
inherit self inputs;

# Channel specific overlays. Overlays `coreutils` from `unstable` channel.
channels.unstable = { };
channels.nixpkgs.overlaysBuilder = channels: [
(final: prev: { inherit (channels.unstable) ranger; })
];
Expand Down
1 change: 1 addition & 0 deletions examples/home-manager+nur+neovim/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@


channelsConfig.allowUnfree = true;
channels.nixpkgs = { };

sharedOverlays = [
nur.overlay
Expand Down
2 changes: 2 additions & 0 deletions examples/minimal-multichannel/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
# Channels are automatically generated from nixpkgs inputs
# e.g the inputs which contain `legacyPackages` attribute are used.
channelsConfig.allowUnfree = true;
channels.nixpkgs = { };
channels.unstable = { };


# Modules shared between all hosts
Expand Down
21 changes: 1 addition & 20 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,16 @@
rec {
inherit overlay;

# Deprecated in favor of 'nix.generateRegistryFromInputs = true;'
nixosModules.saneFlakeDefaults = { nix.generateRegistryFromInputs = true; };
nixosModules.autoGenFromInputs = import ./lib/options.nix;

devShell.x86_64-linux = import ./devShell.nix { system = "x86_64-linux"; };

lib = flake-utils.lib // {
inherit mkFlake exportModules exportOverlays exportPackages;

# Deprecated - should use top-level functions instead
exporters = {
inherit modulesFromList fromOverlays internalOverlays;
};
inherit systemFlake modulesFromList;
inherit mkFlake exportModules exportOverlays exportPackages systemFlake modulesFromList;

# DO NOT USE - subject to change without notice
internal = internal-functions;

repl = ./lib/repl.nix;

# merge nested attribute sets and lists
mergeAny = lhs: rhs:
lhs // mapAttrs
Expand All @@ -53,15 +43,6 @@
else value
)
rhs;

patchChannel = system: channel: patches:
if patches == [ ] then channel else
(import channel { inherit system; }).pkgs.applyPatches {
name = if channel ? shortRev then "nixpkgs-patched-${channel.shortRev}" else "nixpkgs-patched";
src = channel;
patches = patches;
};

};
};
}
Expand Down
Loading