New structure since I kept struggling with the home-manager implemnentation
This commit is contained in:
+13
-66
@@ -1,87 +1,34 @@
|
||||
{
|
||||
description = "Droidnix: A dendritic NixOS + Home Manager configuration";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
home-manager = {
|
||||
url = "github:nix-community/home-manager";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
catppuccin = {
|
||||
url = "github:catppuccin/nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
stylix = {
|
||||
url = "github:nix-community/stylix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
emacs-overlay = {
|
||||
url = "github:nix-community/emacs-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
zen-browser = {
|
||||
url = "github:youwen5/zen-browser-flake";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
hyprland.url = "github:hyprwm/Hyprland";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
inputs@{
|
||||
self,
|
||||
nixpkgs,
|
||||
home-manager,
|
||||
emacs-overlay,
|
||||
catppuccin,
|
||||
zen-browser,
|
||||
hyprland,
|
||||
stylix,
|
||||
...
|
||||
}:
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
system = "x86_64-linux";
|
||||
user = import ./generated/out_of_tree/users/henrov.nix;
|
||||
machines = [
|
||||
"traveldroid"
|
||||
"maindroid"
|
||||
];
|
||||
flakeRoot = ./.; # Define flakeRoot here
|
||||
in
|
||||
{
|
||||
nixosConfigurations = lib.genAttrs machines (
|
||||
machine:
|
||||
lib.nixosSystem {
|
||||
inherit system;
|
||||
modules = [
|
||||
# Import machine-specific configurations
|
||||
./generated/out_of_tree/machines/traveldroid/top.nix
|
||||
# Anchoring all the other nixes
|
||||
./generated/top.nix
|
||||
# Home Manager module
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
outputs = inputs@{self, nixpkgs,home-manager, emacs-overlay, zen-browser, hyprland, stylix, import-tree,...};
|
||||
flake-parts.lib.mkFlake { inherit inputs; }
|
||||
{
|
||||
# flake-parts requires you to define systems
|
||||
systems = [ "x86_64-linux" ];
|
||||
|
||||
home-manager.extraSpecialArgs = { inherit user inputs flakeRoot; };
|
||||
}
|
||||
imports = [
|
||||
(import-tree ./generated/modules) # Auto-loads your modules
|
||||
.generated/hosts/traveldroid/traveldroid.nix # Explicitly load grouped host
|
||||
];
|
||||
specialArgs = { inherit user inputs flakeRoot; };
|
||||
}
|
||||
);
|
||||
|
||||
homeConfigurations = lib.genAttrs (map (machine: "${user.username}@${machine}") machines) (
|
||||
userMachine:
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
inherit system;
|
||||
configuration = import ./user.nix { inherit inputs user flakeRoot; };
|
||||
extraSpecialArgs = { inherit user inputs flakeRoot; };
|
||||
}
|
||||
);
|
||||
|
||||
devShells.${system}.default = import ./generated/out_of_tree/terminal_shell/devshell.nix {
|
||||
inherit (nixpkgs.legacyPackages.${system}) mkShell;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user