refactor: move lib into flake module
This commit is contained in:
parent
99daa25dee
commit
6dda98201d
|
@ -82,7 +82,8 @@ rec {
|
||||||
outputs = { self, nixpkgs, nixpkgs-unstable, ... }@inputs:
|
outputs = { self, nixpkgs, nixpkgs-unstable, ... }@inputs:
|
||||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||||
systems = [ "x86_64-linux" "aarch64-linux" ];
|
systems = [ "x86_64-linux" "aarch64-linux" ];
|
||||||
imports = [ ./pkgs/flake-module.nix ./lib ./overlays.nix ];
|
imports =
|
||||||
|
[ ./pkgs/flake-module.nix ./lib/flake-module.nix ./overlays.nix ];
|
||||||
flake = {
|
flake = {
|
||||||
inherit nixConfig;
|
inherit nixConfig;
|
||||||
|
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
{ inputs, ... }:
|
|
||||||
|
|
||||||
let createUser' = import ./createUser.nix;
|
|
||||||
in {
|
|
||||||
flake = {
|
|
||||||
lib = {
|
|
||||||
createSystem = hostName:
|
|
||||||
{ hardwareConfig, config }:
|
|
||||||
({ pkgs, lib, ... }: {
|
|
||||||
networking.hostName = hostName;
|
|
||||||
|
|
||||||
imports = [ ../modules/common.nix hardwareConfig config ];
|
|
||||||
});
|
|
||||||
createUser = name: args:
|
|
||||||
({ pkgs, ... }@args2:
|
|
||||||
(createUser' name args)
|
|
||||||
({ inherit (inputs) home-manager; } // args2));
|
|
||||||
createMediaGroup = _: { users.groups.media.gid = 600; };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
18
lib/flake-module.nix
Normal file
18
lib/flake-module.nix
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{ inputs, ... }:
|
||||||
|
|
||||||
|
let createUser' = import ./createUser.nix;
|
||||||
|
in {
|
||||||
|
flake.lib = {
|
||||||
|
createSystem = hostName:
|
||||||
|
{ hardwareConfig, config }:
|
||||||
|
({ pkgs, lib, ... }: {
|
||||||
|
networking.hostName = hostName;
|
||||||
|
|
||||||
|
imports = [ ../modules/common.nix hardwareConfig config ];
|
||||||
|
});
|
||||||
|
createUser = name: args:
|
||||||
|
({ pkgs, ... }@args2:
|
||||||
|
(createUser' name args) ({ inherit (inputs) home-manager; } // args2));
|
||||||
|
createMediaGroup = _: { users.groups.media.gid = 600; };
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue