mirror of
https://github.com/buckley310/nixos-config.git
synced 2024-12-21 19:24:15 +00:00
refactor lib
This commit is contained in:
parent
cea56aa037
commit
9b28154273
1 changed files with 11 additions and 11 deletions
22
flake.nix
22
flake.nix
|
@ -6,6 +6,12 @@
|
||||||
let
|
let
|
||||||
|
|
||||||
mypkgs = import ./pkgs;
|
mypkgs = import ./pkgs;
|
||||||
|
getHosts = import lib/hosts.nix;
|
||||||
|
morphHosts = import lib/morph.nix;
|
||||||
|
|
||||||
|
forAllSystems = f: builtins.listToAttrs (map
|
||||||
|
(name: { inherit name; value = f name; })
|
||||||
|
(with nixpkgs.lib.systems.supported; tier1 ++ tier2));
|
||||||
|
|
||||||
pins = {
|
pins = {
|
||||||
nix.registry.nixpkgs.flake = nixpkgs;
|
nix.registry.nixpkgs.flake = nixpkgs;
|
||||||
|
@ -18,6 +24,8 @@
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
lib = { inherit forAllSystems getHosts morphHosts; };
|
||||||
|
|
||||||
nixosModules =
|
nixosModules =
|
||||||
{
|
{
|
||||||
inherit pins;
|
inherit pins;
|
||||||
|
@ -35,24 +43,16 @@
|
||||||
nixpkgs.overlays = [ (_: mypkgs) ];
|
nixpkgs.overlays = [ (_: mypkgs) ];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixosConfigurations = self.lib.getHosts {
|
nixosConfigurations = getHosts {
|
||||||
path = ./hosts;
|
path = ./hosts;
|
||||||
inherit nixpkgs;
|
inherit nixpkgs;
|
||||||
inherit (self) nixosModule;
|
inherit (self) nixosModule;
|
||||||
};
|
};
|
||||||
|
|
||||||
lib = {
|
packages = forAllSystems
|
||||||
getHosts = import lib/hosts.nix;
|
|
||||||
morphHosts = import lib/morph.nix;
|
|
||||||
forAllSystems = f: builtins.listToAttrs (map
|
|
||||||
(name: { inherit name; value = f name; })
|
|
||||||
(with nixpkgs.lib.systems.supported; tier1 ++ tier2));
|
|
||||||
};
|
|
||||||
|
|
||||||
packages = self.lib.forAllSystems
|
|
||||||
(system: mypkgs nixpkgs.legacyPackages.${system});
|
(system: mypkgs nixpkgs.legacyPackages.${system});
|
||||||
|
|
||||||
apps = self.lib.forAllSystems (system:
|
apps = forAllSystems (system:
|
||||||
with nixpkgs.legacyPackages.${system};
|
with nixpkgs.legacyPackages.${system};
|
||||||
{
|
{
|
||||||
gnome-extensions = writeShellScriptBin "gnome-extensions" ''
|
gnome-extensions = writeShellScriptBin "gnome-extensions" ''
|
||||||
|
|
Loading…
Reference in a new issue