working on home-manager
This commit is contained in:
+381
-349
File diff suppressed because it is too large
Load Diff
+39
-7
@@ -378,7 +378,7 @@ The Nix flake definition for Droidnix.
|
||||
}:
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
system = "x86_64-linux"; # Define the system explicitly
|
||||
system = "x86_64-linux";
|
||||
user = import ./assets/flake/users/henrov.nix;
|
||||
machines = [
|
||||
"traveldroid"
|
||||
@@ -394,20 +394,53 @@ The Nix flake definition for Droidnix.
|
||||
# Import machine-specific configurations
|
||||
./assets/flake/machines/${machine}/top.nix
|
||||
|
||||
# Home Manager and theme modules
|
||||
# Home Manager module
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.enable = true;
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit user inputs; flakeRoot = ./.; };
|
||||
home-manager.extraSpecialArgs = { inherit user inputs; flakeRoot = ./.; };
|
||||
}
|
||||
|
||||
# Catppuccin theme module
|
||||
inputs.catppuccin.nixosModules.catppuccin
|
||||
|
||||
# Let's start importing the whole generated tree
|
||||
# Generated configuration
|
||||
./generated/top.nix
|
||||
|
||||
# Ensure Home Manager is enabled for the user
|
||||
({ config, pkgs, ... }: {
|
||||
programs.home-manager.enable = true;
|
||||
systemd.users.services."home-manager-${user.username}" = {
|
||||
description = "Home Manager service for ${user.username}";
|
||||
wantedBy = [ "multi-user.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 = ./.; };
|
||||
specialArgs = { inherit user inputs; flakeRoot = ./.; };
|
||||
}
|
||||
);
|
||||
|
||||
# Home Manager configurations for each user/machine
|
||||
homeConfigurations = lib.genAttrs [
|
||||
(user.username + "@" + machine)
|
||||
for machine in machines
|
||||
] (
|
||||
userMachine:
|
||||
let
|
||||
username = lib.splitString "@" userMachine !!"";
|
||||
machine = lib.splitString "@" userMachine !!"";
|
||||
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 = ./.; };
|
||||
}
|
||||
);
|
||||
|
||||
@@ -416,7 +449,6 @@ The Nix flake definition for Droidnix.
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
#+END_SRC
|
||||
|
||||
* First the nix-files that flake really needs and that do not fit wel in the hierarchical structure
|
||||
|
||||
+39
-6
@@ -35,7 +35,7 @@
|
||||
}:
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
system = "x86_64-linux"; # Define the system explicitly
|
||||
system = "x86_64-linux";
|
||||
user = import ./assets/flake/users/henrov.nix;
|
||||
machines = [
|
||||
"traveldroid"
|
||||
@@ -51,20 +51,53 @@
|
||||
# Import machine-specific configurations
|
||||
./assets/flake/machines/${machine}/top.nix
|
||||
|
||||
# Home Manager and theme modules
|
||||
# Home Manager module
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
home-manager.enable = true;
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = { inherit user inputs; flakeRoot = ./.; };
|
||||
home-manager.extraSpecialArgs = { inherit user inputs; flakeRoot = ./.; };
|
||||
}
|
||||
|
||||
# Catppuccin theme module
|
||||
inputs.catppuccin.nixosModules.catppuccin
|
||||
|
||||
# Let's start importing the whole generated tree
|
||||
# Generated configuration
|
||||
./generated/top.nix
|
||||
|
||||
# Ensure Home Manager is enabled for the user
|
||||
({ config, pkgs, ... }: {
|
||||
programs.home-manager.enable = true;
|
||||
systemd.users.services."home-manager-${user.username}" = {
|
||||
description = "Home Manager service for ${user.username}";
|
||||
wantedBy = [ "multi-user.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 = ./.; };
|
||||
specialArgs = { inherit user inputs; flakeRoot = ./.; };
|
||||
}
|
||||
);
|
||||
|
||||
# Home Manager configurations for each user/machine
|
||||
homeConfigurations = lib.genAttrs [
|
||||
(user.username + "@" + machine)
|
||||
for machine in machines
|
||||
] (
|
||||
userMachine:
|
||||
let
|
||||
username = lib.splitString "@" userMachine !!"";
|
||||
machine = lib.splitString "@" userMachine !!"";
|
||||
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 = ./.; };
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user