flake.nix: get rid of flake-utils

The function `flake-utils.lib.eachDefaultSystem` is superfluous and can be
substituted by native `nixpkgs.lib` functionality.
This commit is contained in:
Anderson Torres 2023-04-14 07:42:03 -03:00 committed by GitHub
parent 9f78c6de4f
commit 17198cf5ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,9 +2,8 @@
description = "Home Manager for Nix"; description = "Home Manager for Nix";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, utils, ... }: outputs = { self, nixpkgs, ... }:
{ {
nixosModules = rec { nixosModules = rec {
home-manager = import ./nixos; home-manager = import ./nixos;
@ -84,23 +83,29 @@
}; };
}); });
}; };
} // utils.lib.eachDefaultSystem (system: } // (let
let forAllSystems = nixpkgs.lib.genAttrs nixpkgs.lib.systems.flakeExposed;
pkgs = nixpkgs.legacyPackages.${system}; in {
docs = import ./docs { inherit pkgs; }; devShells = forAllSystems (system:
tests = import ./tests { inherit pkgs; }; let
hmPkg = pkgs.callPackage ./home-manager { }; pkgs = nixpkgs.legacyPackages.${system};
in { tests = import ./tests { inherit pkgs; };
devShells.tests = tests.run; in tests.run);
packages = {
packages = forAllSystems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
docs = import ./docs { inherit pkgs; };
hmPkg = pkgs.callPackage ./home-manager { };
in {
default = hmPkg; default = hmPkg;
home-manager = hmPkg; home-manager = hmPkg;
docs-html = docs.manual.html; docs-html = docs.manual.html;
docs-json = docs.options.json; docs-json = docs.options.json;
docs-manpages = docs.manPages; docs-manpages = docs.manPages;
}; });
# deprecated in Nix 2.7
defaultPackage = self.packages.${system}.default; defaultPackage = forAllSystems (system: self.packages.${system}.default);
}); });
} }