feat: use flake-parts to clean up the flake.nix
All checks were successful
/ check (push) Successful in 20s
/ build (audiomenu) (push) Successful in 2s
/ build (docs) (push) Successful in 2s
/ build (jpassmenu) (push) Successful in 2s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Successful in 2s
/ build (nvim) (push) Successful in 1s
All checks were successful
/ check (push) Successful in 20s
/ build (audiomenu) (push) Successful in 2s
/ build (docs) (push) Successful in 2s
/ build (jpassmenu) (push) Successful in 2s
/ build (nixosConfigurations.vm.config.system.build.toplevel) (push) Successful in 2s
/ build (nvim) (push) Successful in 1s
This is much more manageable!
This commit is contained in:
parent
584945f1e8
commit
e03cd65e87
11 changed files with 250 additions and 198 deletions
43
flake-modules/nixos-modules.nix
Normal file
43
flake-modules/nixos-modules.nix
Normal file
|
@ -0,0 +1,43 @@
|
|||
{ inputs, lib, ... }:
|
||||
{
|
||||
flake.nixosModules =
|
||||
let
|
||||
nvim-config.imports = [
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
../nvim
|
||||
];
|
||||
homeManagerModuleSandalone = import ../home {
|
||||
inherit nvim-config;
|
||||
inherit (inputs) stylix;
|
||||
};
|
||||
homeManagerModuleNixOS = import ../home { inherit nvim-config; };
|
||||
nixosModule = {
|
||||
imports = [
|
||||
(import ../system { inherit (inputs) stylix; })
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
] ++ lib.optional (inputs.lix-module != null) inputs.lix-module.nixosModules.default;
|
||||
home-manager = {
|
||||
useGlobalPkgs = true;
|
||||
useUserPackages = true;
|
||||
sharedModules = [ homeManagerModuleNixOS ];
|
||||
};
|
||||
# Pin nixpkgs
|
||||
nix.registry.nixpkgs.flake = inputs.nixpkgs;
|
||||
};
|
||||
|
||||
machines = [ "vm" ];
|
||||
mkMachine = hostname: {
|
||||
imports = [
|
||||
nixosModule
|
||||
(import (../machines + "/${hostname}"))
|
||||
];
|
||||
home-manager.sharedModules = [ { jhome.hostName = hostname; } ];
|
||||
};
|
||||
machineModules = lib.genAttrs machines mkMachine;
|
||||
in
|
||||
{
|
||||
default = nixosModule;
|
||||
inherit nixosModule homeManagerModuleNixOS homeManagerModuleSandalone;
|
||||
}
|
||||
// machineModules;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue