forked from irl/nix-configs
feat: refactor home-manager configs
This commit is contained in:
parent
442c9051ba
commit
fca82b60ce
13 changed files with 355 additions and 150 deletions
52
flake.nix
52
flake.nix
|
@ -1,6 +1,5 @@
|
|||
{
|
||||
description = "I have no idea what I'm doing";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs";
|
||||
apple-silicon = {
|
||||
|
@ -27,26 +26,31 @@
|
|||
};
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
apple-silicon,
|
||||
flake-utils,
|
||||
home-manager,
|
||||
nix-darwin,
|
||||
nixpkgs,
|
||||
nur,
|
||||
self,
|
||||
sops-nix,
|
||||
}@inputs:
|
||||
let
|
||||
homeRoles = [
|
||||
"desktop"
|
||||
"minimal"
|
||||
"server"
|
||||
];
|
||||
outputs = inputs.self;
|
||||
overlays = [
|
||||
apple-silicon.overlays.apple-silicon-overlay
|
||||
nur.overlays.default
|
||||
];
|
||||
supportedSystems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-darwin"
|
||||
"aarch64-linux"
|
||||
];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
overlays = [
|
||||
apple-silicon.overlays.apple-silicon-overlay
|
||||
nur.overlays.default
|
||||
];
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
|
@ -69,31 +73,24 @@
|
|||
specialArgs = inputs;
|
||||
};
|
||||
};
|
||||
homeConfigurations = nixpkgs.lib.foldl' (
|
||||
acc: system:
|
||||
acc
|
||||
// {
|
||||
"irl-${system}" = home-manager.lib.homeManagerConfiguration {
|
||||
homeManagerModules = import ./modules/home-manager;
|
||||
homeConfigurations = nixpkgs.lib.foldl' (c: e:
|
||||
c // {
|
||||
"irl-${e.role}-${e.system}" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system overlays;
|
||||
inherit overlays;
|
||||
system = e.system;
|
||||
};
|
||||
extraSpecialArgs = {
|
||||
inherit outputs;
|
||||
};
|
||||
modules = [
|
||||
./home/irl.nix
|
||||
];
|
||||
};
|
||||
"irl-gui-${system}" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system overlays;
|
||||
};
|
||||
modules = [
|
||||
./home/irl.nix
|
||||
{
|
||||
irl.gui-packages = true;
|
||||
}
|
||||
./home-manager/irl.nix
|
||||
{ role = "${e.role}"; }
|
||||
];
|
||||
};
|
||||
}
|
||||
) { } supportedSystems;
|
||||
) { } (nixpkgs.lib.cartesianProduct { role = homeRoles; system = supportedSystems; });
|
||||
}
|
||||
// flake-utils.lib.eachSystem supportedSystems (system: {
|
||||
formatter = nixpkgs.legacyPackages.${system}.nixfmt-tree;
|
||||
|
@ -103,6 +100,7 @@
|
|||
system = "aarch64-darwin";
|
||||
modules = [
|
||||
./darwin/common.nix
|
||||
./darwin/irl-mac-mini.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue