working on machines
This commit is contained in:
+1
-72
@@ -47,75 +47,4 @@
|
|||||||
machine:
|
machine:
|
||||||
lib.nixosSystem {
|
lib.nixosSystem {
|
||||||
inherit system;
|
inherit system;
|
||||||
modules = [
|
modules =
|
||||||
# Import machine-specific configurations
|
|
||||||
./assets/flake/machines/${machine}/top.nix
|
|
||||||
|
|
||||||
# Home Manager module
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = true;
|
|
||||||
home-manager.extraSpecialArgs = {
|
|
||||||
inherit user inputs;
|
|
||||||
flakeRoot = ./.;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
# Catppuccin theme module
|
|
||||||
inputs.catppuccin.nixosModules.catppuccin
|
|
||||||
|
|
||||||
# Anchoring all the other nixes
|
|
||||||
./generated/top.nix
|
|
||||||
|
|
||||||
# Enable Home Manager for the user
|
|
||||||
(
|
|
||||||
{ config, pkgs, ... }:
|
|
||||||
{
|
|
||||||
home-manager.users.${user.username} = {
|
|
||||||
enable = true;
|
|
||||||
homeDirectory = "/home/${user.username}";
|
|
||||||
};
|
|
||||||
systemd.users.services."home-manager-${user.username}" = {
|
|
||||||
description = "Home Manager service for ${user.username}";
|
|
||||||
wantedBy = [ "default.target" ];
|
|
||||||
serviceConfig.Type = "oneshot";
|
|
||||||
serviceConfig.RemainAfterExit = true;
|
|
||||||
serviceConfig.ExecStart = "${pkgs.home-manager}/bin/home-manager switch --flake ${self}#${user.username}@${machine}";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
)
|
|
||||||
];
|
|
||||||
specialArgs = {
|
|
||||||
inherit user inputs;
|
|
||||||
flakeRoot = ./.;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
# Home Manager configurations for each user/machine
|
|
||||||
homeConfigurations = lib.genAttrs (map (machine: user.username + "@" + machine) machines) (
|
|
||||||
userMachine:
|
|
||||||
let
|
|
||||||
parts = lib.splitString "@" userMachine;
|
|
||||||
username = builtins.elemAt parts 0;
|
|
||||||
machine = builtins.elemAt parts 1;
|
|
||||||
in
|
|
||||||
home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit system;
|
|
||||||
configuration = import ./assets/flake/users/${username}/home.nix {
|
|
||||||
inherit inputs user;
|
|
||||||
pkgs = import nixpkgs { inherit system; };
|
|
||||||
};
|
|
||||||
extraSpecialArgs = {
|
|
||||||
inherit user inputs;
|
|
||||||
flakeRoot = ./.;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
devShells.${system}.default = import ./assets/flake/terminal_shell/devshell.nix {
|
|
||||||
inherit (nixpkgs.legacyPackages.${system}) mkShell;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user