mirror of
https://github.com/lightly-toasted/nix-config.git
synced 2025-10-04 11:35:41 +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
32
flake.nix
32
flake.nix
|
@ -29,18 +29,28 @@
|
||||||
rootPath = ./.;
|
rootPath = ./.;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
|
nixosConfigurations = {
|
||||||
specialArgs = { inherit inputs rootPath; };
|
nixos = nixpkgs.lib.nixosSystem {
|
||||||
modules = [
|
specialArgs = { inherit inputs rootPath; };
|
||||||
./hosts/nixos/configuration.nix
|
modules = [ ./hosts/nixos/configuration.nix ];
|
||||||
];
|
};
|
||||||
|
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;
|
homeConfigurations = {
|
||||||
extraSpecialArgs = { inherit inputs rootPath; };
|
"toast@nixos" = home-manager.lib.homeManagerConfiguration {
|
||||||
modules = [
|
pkgs = nixpkgs.legacyPackages.x86_64-linux;
|
||||||
./home/toast/home.nix
|
extraSpecialArgs = { inherit inputs rootPath; };
|
||||||
];
|
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;
|
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, ... }:
|
{ config, pkgs, inputs, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.nixvim.homeManagerModules.nixvim
|
inputs.nixvim.homeManagerModules.nixvim
|
||||||
|
@ -7,10 +8,10 @@
|
||||||
inputs.sops-nix.homeManagerModules.sops
|
inputs.sops-nix.homeManagerModules.sops
|
||||||
] ++ (
|
] ++ (
|
||||||
let
|
let
|
||||||
modulesPath = ./modules;
|
modulesPath = ../modules;
|
||||||
moduleFiles = builtins.attrNames (builtins.readDir modulesPath);
|
cliModules = builtins.attrNames (builtins.readDir (modulesPath + "/cli/"));
|
||||||
in
|
in
|
||||||
map (module: modulesPath + ("/" + module)) moduleFiles
|
map (module: modulesPath + "/cli/${module}") cliModules
|
||||||
);
|
);
|
||||||
|
|
||||||
home = {
|
home = {
|
Loading…
Add table
Add a link
Reference in a new issue