feat: integrate home manager with the system config

This commit is contained in:
2023-12-26 12:11:34 +01:00
parent 044e96eda4
commit ba39b55193
21 changed files with 47 additions and 37 deletions

View File

@@ -39,27 +39,10 @@
]; ];
}); });
mkHome = {
username,
desktop,
system,
}:
home-manager.lib.homeManagerConfiguration rec {
homeDirectory = "/home/${username}";
modules = [
ags.homeManagerModules.default
nixvim.homeManagerModules.nixvim
anyrun.homeManagerModules.default
./home/packages
./home/programs
./home/services
./home/desktops/${desktop}
];
pkgs = legacyPackages.${system};
};
mkHost = { mkHost = {
hostname, hostname,
username,
desktop,
system, system,
stateVersion, stateVersion,
}: }:
@@ -68,21 +51,26 @@
modules = [ modules = [
./modules/nixos/hid-fanatecff ./modules/nixos/hid-fanatecff
./hosts/${hostname} ./hosts/${hostname}
home-manager.nixosModules.home-manager
{ {
_module.args = {inherit username;};
networking.hostName = hostname; networking.hostName = hostname;
system.stateVersion = stateVersion; system.stateVersion = stateVersion;
home-manager = {
useGlobalPkgs = true;
useUserPackages = true;
extraSpecialArgs = {inherit username desktop stateVersion inputs;};
users.${username} = import ./home;
};
} }
]; ];
specialArgs = inputs; specialArgs = inputs;
}; };
in { in {
homeConfigurations.theaninova = mkHome {
username = "theaninova";
desktop = "hyprland";
};
nixosConfigurations.MONSTER = mkHost { nixosConfigurations.MONSTER = mkHost {
hostname = "MONSTER"; hostname = "MONSTER";
username = "theaninova";
desktop = "hyprland";
system = "x86_64-linux"; system = "x86_64-linux";
stateVersion = "23.05"; stateVersion = "23.05";
}; };

View File

@@ -1,2 +1,26 @@
{...}: { {
username,
desktop,
stateVersion,
osConfig,
inputs,
...
}: {
home = {
inherit username stateVersion;
homeDirectory = "/home/${username}";
shellAliases = {
nix-reload-home = "home-manager switch --flake ${./..}";
nix-reload-system = "nixos-rebuild switch --flake ${./..}";
};
};
imports = [
inputs.ags.homeManagerModules.default
inputs.nixvim.homeManagerModules.nixvim
inputs.anyrun.homeManagerModules.default
./packages
./programs
./services
./desktops/${desktop}
];
} }

View File

@@ -1,6 +1,6 @@
{ {
pkgs, pkgs,
homeDirectory, config,
... ...
}: { }: {
services.darkman = { services.darkman = {
@@ -68,10 +68,10 @@
bash bash
*/ */
'' ''
${pkgs.kitty}/bin/kitty +kitten themes --reload-in=all --config-file-name ${homeDirectory}/.config/kitty/current-colors.conf Catppuccin-Frappe ${pkgs.kitty}/bin/kitty +kitten themes --reload-in=all --config-file-name ${config.home.homeDirectory}/.config/kitty/current-colors.conf Catppuccin-Frappe
''; '';
wallpaper = '' wallpaper = ''
${pkgs.swww}/bin/swww img ${./Lakeside-2/Lakeside-2-1.jpg} ${pkgs.swww}/bin/swww img ${./wallpapers/Lakeside-2/Lakeside-2-1.jpg}
''; '';
}; };
lightModeScripts = { lightModeScripts = {
@@ -88,10 +88,10 @@
bash bash
*/ */
'' ''
${pkgs.kitty}/bin/kitty +kitten themes --reload-in=all --config-file-name ${homeDirectory}/.config/kitty/current-colors.conf Catppuccin-Latte ${pkgs.kitty}/bin/kitty +kitten themes --reload-in=all --config-file-name ${config.home.homeDirectory}/.config/kitty/current-colors.conf Catppuccin-Latte
''; '';
wallpaper = '' wallpaper = ''
${pkgs.swww}/bin/swww img ${./Lakeside-2/Lakeside-2-10.jpg} ${pkgs.swww}/bin/swww img ${./wallpapers/Lakeside-2/Lakeside-2-10.jpg}
''; '';
}; };
}; };

View File

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

View File

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 2.1 MiB

View File

Before

Width:  |  Height:  |  Size: 2.0 MiB

After

Width:  |  Height:  |  Size: 2.0 MiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

Before

Width:  |  Height:  |  Size: 1.7 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

View File

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

View File

@@ -4,6 +4,7 @@
{ {
config, config,
pkgs, pkgs,
username,
... ...
}: { }: {
imports = [ imports = [
@@ -145,14 +146,13 @@
}; };
# Define a user account. Don't forget to set a password with passwd. # Define a user account. Don't forget to set a password with passwd.
services.getty.autologinUser = "theaninova"; services.getty.autologinUser = "${username}";
services.getty.extraArgs = ["--noclear" "--noissue" "--nonewline"]; services.getty.extraArgs = ["--noclear" "--noissue" "--nonewline"];
services.getty.loginOptions = "-p -f -- \\u"; # preserve environment services.getty.loginOptions = "-p -f -- \\u"; # preserve environment
programs.hyprland.enable = true; programs.hyprland.enable = true;
programs.hyprland.enableNvidiaPatches = true; programs.hyprland.enableNvidiaPatches = true;
users.users.theaninova = { users.users.${username} = {
isNormalUser = true; isNormalUser = true;
description = "Thea Schöbl";
extraGroups = ["networkmanager" "wheel" "audio" "video" "dialout" "plugdev" "scanner" "lp" "input" "adbusers" "cdrom"]; extraGroups = ["networkmanager" "wheel" "audio" "video" "dialout" "plugdev" "scanner" "lp" "input" "adbusers" "cdrom"];
}; };
@@ -193,9 +193,6 @@
(nerdfonts.override {fonts = ["JetBrainsMono" "Noto" "NerdFontsSymbolsOnly"];}) (nerdfonts.override {fonts = ["JetBrainsMono" "Noto" "NerdFontsSymbolsOnly"];})
]; ];
programs.fish.enable = true;
users.users.theaninova.shell = pkgs.fish;
networking = { networking = {
firewall = { firewall = {
allowedTCPPorts = [8100 5037]; allowedTCPPorts = [8100 5037];
@@ -204,7 +201,8 @@
networkmanager.enable = true; networkmanager.enable = true;
hosts = { hosts = {
"192.168.0.184" = ["kookaborrow"]; "192.168.0.219" = ["kookaborrow"];
"192.168.0.1" = ["router"];
}; };
}; };