mirror of
https://github.com/StevenBlack/hosts.git
synced 2024-06-10 16:05:27 +02:00
flake: rm flake-utils dependency
Pulling in an entire dependency to call a for-loop is wasteful & largely useless. When user adds this module to their config, flake-utils & all of its subdependencies will be pulled into the user’s flake.lock file. This for-loop was only being used for the developer shell to which a lot of folks probably aren’t doing active developments in this project as the module itself doesn’t require it. Potentially damagingly is that this project lacks its own flake.lock so the latest flake-utils will always be downloaded regardless of if it that version is compatible or not. Additionally, flake-utils’ default system list doesn’t include i686-linux which upstream Python3 in Nixpkgs does. The alternative solution to these problems is to remove the dependency & just write a for-loop in this project. This solution could be more or less robust, but it is an extensible version of that loop that could handle overlays or config changes if needed in the future.
This commit is contained in:
parent
87950f72ee
commit
34ba3638fb
25
flake.nix
25
flake.nix
|
@ -1,7 +1,14 @@
|
|||
{
|
||||
description = "Unified hosts file with base extensions.";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
outputs = { self, nixpkgs, flake-utils }: {
|
||||
outputs = { self, nixpkgs, ... }@inputs:
|
||||
let
|
||||
forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.platforms.unix;
|
||||
|
||||
nixpkgsFor = forAllSystems (system: import nixpkgs {
|
||||
inherit system;
|
||||
});
|
||||
in
|
||||
{
|
||||
nixosModule = { config, ... }:
|
||||
with nixpkgs.lib;
|
||||
let
|
||||
|
@ -27,19 +34,17 @@
|
|||
);
|
||||
};
|
||||
};
|
||||
} // flake-utils.lib.eachDefaultSystem
|
||||
(system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
|
||||
devShells = forAllSystems (system:
|
||||
let pkgs = nixpkgsFor.${system}; in
|
||||
{
|
||||
devShell = pkgs.mkShell {
|
||||
default = pkgs.mkShell {
|
||||
buildInputs = with pkgs; [
|
||||
python3
|
||||
python3Packages.flake8
|
||||
python3Packages.requests
|
||||
];
|
||||
};
|
||||
}
|
||||
);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user