thelio76: reuse hm config (working)

This commit is contained in:
Alex 2024-07-26 19:05:13 -04:00
parent 577d977e4e
commit c924d9e84e
3 changed files with 14 additions and 40 deletions

View File

@ -1,4 +1,4 @@
{ system, inputs, ... }: { system, inputs, user, ... }:
{ {
modules = [ modules = [
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
@ -6,8 +6,9 @@
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true; home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup"; home-manager.backupFileExtension = "backup";
home-manager.users.alex = import ./config/users/alex; home-manager.users.${user} = import ../users/${user};
home-manager.extraSpecialArgs = { ff = inputs.firefox-addons.packages.${system}; };
home-manager.extraSpecialArgs = { inherit user; firefox-addons = inputs.firefox-addons.packages.${system}; };
} }
]; ];
} }

View File

@ -1,10 +1,10 @@
{ config, pkgs, ff, ... }: { config, pkgs, user, firefox-addons, ... }:
{ {
# Home Manager needs a bit of information about you and the # Home Manager needs a bit of information about you and the
# paths it should manage. # paths it should manage.
home.username = "alex"; home.username = user;
home.homeDirectory = "/home/alex"; home.homeDirectory = "/home/${user}";
# Packages that should be installed to the user profile. # Packages that should be installed to the user profile.
home.packages = with pkgs; [ home.packages = with pkgs; [
@ -71,7 +71,7 @@
settings = { settings = {
"extensions.autoDisableScopes" = 0; "extensions.autoDisableScopes" = 0;
}; };
extensions = with ff; [ extensions = with firefox-addons; [
darkreader darkreader
multi-account-containers multi-account-containers
simple-tab-groups simple-tab-groups

View File

@ -22,17 +22,6 @@
}; };
outputs = { self, nixpkgs, home-manager, firefox-addons, ... }@inputs: outputs = { self, nixpkgs, home-manager, firefox-addons, ... }@inputs:
let
hmModule = system: (
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.users.alex = import ./config/users/alex;
home-manager.extraSpecialArgs = { ff = firefox-addons.packages.${system}; };
}
);
in
{ {
nixosConfigurations = { nixosConfigurations = {
## ---- personal computers (linux) ---- ## ---- personal computers (linux) ----
@ -40,33 +29,17 @@
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./config/systems/nixos76 ./config/systems/nixos76
home-manager.nixosModules.home-manager ] ++ (import ./config/modules/home-manager.nix {
{ inherit system inputs; user = "alex";
home-manager.useGlobalPkgs = true; }).modules;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.users.alex = import ./config/users/alex;
# Optionally, use home-manager.extraSpecialArgs to pass
# arguments to home.nix
}
];
}; };
thelio76 = nixpkgs.lib.nixosSystem rec { thelio76 = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux"; system = "x86_64-linux";
modules = [ modules = [
./config/systems/thelio76 ./config/systems/thelio76
(import ./config/modules/home-manager.nix { ] ++ (import ./config/modules/home-manager.nix {
inherit system inputs; inherit system inputs; user = "alex";
}) }).modules;
# home-manager.nixosModules.home-manager
# {
# home-manager.useGlobalPkgs = true;
# home-manager.useUserPackages = true;
# home-manager.backupFileExtension = "backup";
# home-manager.users.alex = import ./config/users/alex;
# home-manager.extraSpecialArgs = { ff = firefox-addons.packages.${system}; };
# }
];
}; };
## ---- servers ---- ## ---- servers ----