mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-10-04 07:25:40 +00:00
feat: refactor home-manager configuration for multi-host support
This commit is contained in:
parent
f20c875a48
commit
6d1fd47bea
47 changed files with 51 additions and 14 deletions
26
flake.nix
26
flake.nix
|
@ -29,18 +29,28 @@
|
|||
rootPath = ./.;
|
||||
in
|
||||
{
|
||||
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
|
||||
nixosConfigurations = {
|
||||
nixos = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs rootPath; };
|
||||
modules = [
|
||||
./hosts/nixos/configuration.nix
|
||||
];
|
||||
modules = [ ./hosts/nixos/configuration.nix ];
|
||||
};
|
||||
homeConfigurations."toast@nixos" = home-manager.lib.homeManagerConfiguration {
|
||||
wsl = nixpkgs.lib.nixosSystem {
|
||||
specialArgs = { inherit inputs rootPath; };
|
||||
modules = [ ./hosts/wsl/configuration.nix ];
|
||||
};
|
||||
};
|
||||
|
||||
homeConfigurations = {
|
||||
"toast@nixos" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
extraSpecialArgs = { inherit inputs rootPath; };
|
||||
modules = [
|
||||
./home/toast/home.nix
|
||||
];
|
||||
modules = [ ./home/hosts/nixos.nix ];
|
||||
};
|
||||
"toast@wsl" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||
extraSpecialArgs = { inherit inputs rootPath; };
|
||||
modules = [ ./home/hosts/wsl.nix ];
|
||||
};
|
||||
};
|
||||
|
||||
packages.x86_64-linux.default = self.homeConfigurations."toast@nixos".activationPackage;
|
||||
|
|
26
home/hosts/nixos.nix
Normal file
26
home/hosts/nixos.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ config, pkgs, inputs, ... }:
|
||||
{
|
||||
imports = [
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
inputs.nixcord.homeModules.nixcord
|
||||
inputs.nix-flatpak.homeManagerModules.nix-flatpak
|
||||
inputs.sops-nix.homeManagerModules.sops
|
||||
] ++ (
|
||||
let
|
||||
modulesPath = ../modules;
|
||||
cliModules = builtins.attrNames (builtins.readDir ( modulesPath + "/cli" ));
|
||||
graphicalModules = builtins.attrNames (builtins.readDir ( modulesPath + "/graphical" ));
|
||||
in
|
||||
map (module: modulesPath + "/cli/${module}") cliModules
|
||||
++ map (module: modulesPath + "/graphical/${module}") graphicalModules
|
||||
);
|
||||
|
||||
home = {
|
||||
username = "toast";
|
||||
homeDirectory = "/home/toast";
|
||||
stateVersion = "24.11";
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
systemd.user.startServices = "sd-switch";
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
{ config, pkgs, inputs, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
inputs.nixvim.homeManagerModules.nixvim
|
||||
|
@ -7,10 +8,10 @@
|
|||
inputs.sops-nix.homeManagerModules.sops
|
||||
] ++ (
|
||||
let
|
||||
modulesPath = ./modules;
|
||||
moduleFiles = builtins.attrNames (builtins.readDir modulesPath);
|
||||
modulesPath = ../modules;
|
||||
cliModules = builtins.attrNames (builtins.readDir (modulesPath + "/cli/"));
|
||||
in
|
||||
map (module: modulesPath + ("/" + module)) moduleFiles
|
||||
map (module: modulesPath + "/cli/${module}") cliModules
|
||||
);
|
||||
|
||||
home = {
|
Loading…
Add table
Add a link
Reference in a new issue