Successfully separated home-manager configs from system configs

This commit is contained in:
pagedmov
2024-11-06 22:28:16 -05:00
parent 1a2402dee7
commit fc99570fdc
9 changed files with 209 additions and 175 deletions

View File

@@ -1,5 +1,5 @@
{ {
description = "pagedMov's NixOS configuration"; description = "pagedMov's NixOS and Home Manager configuration";
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
@@ -30,22 +30,50 @@
}; };
}; };
outputs = { outputs = { self, home-manager, nixpkgs, nur, nixvim, stylix, ... } @ inputs:
nixpkgs, let
nur,
self,
nixvim,
stylix,
...
} @ inputs: let
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
username = "pagedmov"; username = "pagedmov";
in { in {
homeManagerModules.default = ./modules/home;
nixosModules.default = ./modules/sys;
serverModules.default = ./modules/server;
nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ]; nix.nixPath = [ "nixpkgs=${inputs.nixpkgs}" ];
# Home Manager configurations for each user/machine
homeConfigurations = {
oganessonHome = home-manager.lib.homeManagerConfiguration {
inherit pkgs;
extraSpecialArgs = {
host = "oganesson";
inherit self username inputs nur;
};
# Specific Home Manager config for oganesson
modules = [
./hosts/desktop/home.nix
./modules/home
stylix.homeManagerModules.stylix
];
};
mercuryHome = home-manager.lib.homeManagerConfiguration {
inherit system;
pkgs = pkgs;
extraSpecialArgs = { inherit self inputs username; };
# Specific Home Manager config for mercury
configuration = import ./hosts/laptop/home.nix;
};
xenonHome = home-manager.lib.homeManagerConfiguration {
inherit system;
pkgs = pkgs;
extraSpecialArgs = { inherit self inputs username; };
# Specific Home Manager config for xenon
configuration = import ./hosts/server/home.nix;
};
};
nixosConfigurations = { nixosConfigurations = {
oganesson = nixpkgs.lib.nixosSystem { oganesson = nixpkgs.lib.nixosSystem {
specialArgs = { specialArgs = {
@@ -56,6 +84,7 @@
modules = [ modules = [
./hosts/desktop/config.nix ./hosts/desktop/config.nix
./modules/sys ./modules/sys
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix stylix.nixosModules.stylix
nixvim.nixosModules.nixvim nixvim.nixosModules.nixvim
nur.nixosModules.nur nur.nixosModules.nur
@@ -67,9 +96,11 @@
host = "mercury"; host = "mercury";
inherit self inputs username; inherit self inputs username;
}; };
inherit system;
modules = [ modules = [
./hosts/laptop/config.nix ./hosts/laptop/config.nix
./modules/sys ./modules/sys
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix stylix.nixosModules.stylix
nixvim.nixosModules.nixvim nixvim.nixosModules.nixvim
nur.nixosModules.nur nur.nixosModules.nur
@@ -81,10 +112,12 @@
host = "xenon"; host = "xenon";
inherit self inputs username; inherit self inputs username;
}; };
inherit system;
modules = [ modules = [
./hosts/server/config.nix ./hosts/server/config.nix
./modules/sys ./modules/sys
./modules/server ./modules/server
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix stylix.nixosModules.stylix
nixvim.nixosModules.nixvim nixvim.nixosModules.nixvim
nur.nixosModules.nur nur.nixosModules.nur
@@ -96,6 +129,7 @@
host = "installer"; host = "installer";
inherit self inputs; inherit self inputs;
}; };
inherit system;
modules = [ modules = [
./hosts/installer ./hosts/installer
nixvim.nixosModules.nixvim nixvim.nixosModules.nixvim

View File

@@ -1,7 +1,6 @@
{pkgs, ...}: { {pkgs, username, ...}: {
imports = [ imports = [
./hardware.nix ./hardware.nix
./home.nix
]; ];
# My module options # My module options
@@ -43,6 +42,23 @@
]; ];
}; };
users = {
groups.persist = {};
users = {
root.initialPassword = "1234";
${username} = {
isNormalUser = true;
initialPassword = "1234";
shell = pkgs.zsh;
extraGroups = ["wheel" "persist" "libvirtd"];
};
};
};
security.sudo.extraConfig = ''
${username} ALL=(ALL) NOPASSWD: /etc/profiles/per-user/${username}/bin/rebuild
'';
nix.settings.allowed-users = ["${username}"];
time.timeZone = "America/New_York"; time.timeZone = "America/New_York";
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
} }

View File

@@ -1,29 +1,16 @@
{ {
host,
pkgs,
self,
inputs,
username, username,
lib, lib,
config, config,
... ...
}: let }:
nur = config.nur; {
in { home.username = "${username}"; # Replace with your actual username
imports = [inputs.home-manager.nixosModules.home-manager]; home.homeDirectory = "/home/${username}"; # Replace with your actual home directory
home-manager = { home.stateVersion = "24.05"; # Adjust this based on your system's NixOS version
useUserPackages = true;
useGlobalPkgs = true; programs.home-manager.enable = true;
backupFileExtension = "backup";
extraSpecialArgs = {inherit self inputs host username nur;};
users = {
${username} = {
programs.home-manager.enable = true;
imports = [
inputs.self.outputs.homeManagerModules.default
];
# My custom home-manager modules
movOpts = { movOpts = {
# modules/home/files # modules/home/files
homeFiles.enable = true; homeFiles.enable = true;
@@ -60,35 +47,10 @@ in {
movScripts.nixShortcuts.enable = true; movScripts.nixShortcuts.enable = true;
}; };
dconf.settings = lib.mkIf config.movOpts.virtConfig.enable { dconf.settings = {
"org/virt-manager/virt-manager/connections" = { "org/virt-manager/virt-manager/connections" = {
autoconnect = ["qemu:///system"]; autoconnect = ["qemu:///system"];
uris = ["qemu:///system"]; uris = ["qemu:///system"];
}; };
}; };
home = {
username = "${username}";
homeDirectory = "/home/${username}";
stateVersion = "24.05";
};
};
};
};
users = {
groups.persist = {};
users = {
root.initialPassword = "1234";
${username} = {
isNormalUser = true;
initialPassword = "1234";
shell = pkgs.zsh;
extraGroups = ["wheel" "persist" "libvirtd"];
};
};
};
security.sudo.extraConfig = ''
${username} ALL=(ALL) NOPASSWD: /etc/profiles/per-user/${username}/bin/rebuild
'';
nix.settings.allowed-users = ["${username}"];
} }

View File

@@ -7,6 +7,7 @@
./hardware.nix ./hardware.nix
./home.nix ./home.nix
]; ];
movOpts = {
nixSettings.enable = true; nixSettings.enable = true;
networkModule.enable = true; networkModule.enable = true;
bootLoader.enable = true; bootLoader.enable = true;
@@ -16,7 +17,7 @@
sysServices.enable = true; sysServices.enable = true;
jellyfinConfig.enable = true; jellyfinConfig.enable = true;
caddyConfig.enable = true; caddyConfig.enable = true;
};
networking.firewall = { networking.firewall = {
allowedTCPPorts = [ 443 8920 ]; allowedTCPPorts = [ 443 8920 ];
}; };

View File

@@ -1,18 +1,49 @@
{lib, config, pkgs, ... }: { {lib, self, config, pkgs, ... }:
let
scheme = "tokyo-night-dark";
wallpaper = "${self}/assets/wallpapers/dark-waves.jpg";
in
{
options = { options = {
movOpts.stylixHomeConfig.enable = lib.mkEnableOption "enables my stylix Home-Manager options"; movOpts.stylixHomeConfig.enable = lib.mkEnableOption "enables my stylix Home-Manager options";
}; };
config = lib.mkIf config.movOpts.stylixHomeConfig.enable { config = lib.mkIf config.movOpts.stylixHomeConfig.enable {
stylix = { stylix = {
enable = true; enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/${scheme}.yaml";
image = wallpaper;
polarity = "dark";
autoEnable = true; autoEnable = true;
opacity.terminal = 0.50;
targets = { targets = {
# fzf.enable = true;
# kitty.enable = true;
# vesktop.enable = true;
waybar.enable = false; waybar.enable = false;
btop.enable = false; btop.enable = false;
}; };
cursor = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
};
fonts = {
monospace = {
package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];};
name = "JetBrains Mono Nerd Font";
};
sansSerif = {
package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];};
name = "JetBrains Mono Nerd Font";
};
serif = {
package = pkgs.nerdfonts.override {fonts = ["JetBrainsMono"];};
name = "JetBrains Mono Nerd Font";
};
sizes = {
desktop = 10;
applications = 14;
terminal = 14;
popups = 16;
};
};
}; };
}; };
} }

View File

@@ -1,4 +1,4 @@
{lib, config, nur, username, self, ... }: { {lib, config, nur, username, self, pkgs, ... }: {
options = { options = {
movOpts.firefoxConfig.enable = lib.mkEnableOption "enables my firefox configuration"; movOpts.firefoxConfig.enable = lib.mkEnableOption "enables my firefox configuration";
}; };
@@ -83,17 +83,6 @@
url = "https://www.nerdfonts.com/cheat-sheet"; url = "https://www.nerdfonts.com/cheat-sheet";
} }
]; ];
extensions = with nur.repos.rycee.firefox-addons; [
darkreader
adnauseam
cookie-autodelete
disconnect
firefox-color
vimium
firenvim
privacy-badger
new-tab-override
];
extraConfig = '' extraConfig = ''
"browser.startup.homepage" = "${self}/glasshouse-desktop/home/firefox/homepage.html"; "browser.startup.homepage" = "${self}/glasshouse-desktop/home/firefox/homepage.html";
"browser.active_color" = "#EE0000"; "browser.active_color" = "#EE0000";

View File

@@ -2,7 +2,7 @@
{ {
options = { options = {
jellyfinConfig.enable = lib.mkEnableOption "Enables the server's jellyfin config"; movOpts.jellyfinConfig.enable = lib.mkEnableOption "Enables the server's jellyfin config";
}; };
config = lib.mkIf config.movOpts.jellyfinConfig.enable { config = lib.mkIf config.movOpts.jellyfinConfig.enable {
services.jellyfin = { services.jellyfin = {

View File

@@ -5,7 +5,8 @@
./cdn ./cdn
./glasshaus ./glasshaus
]; ];
movOpts = {
jellyfinConfig.enable = lib.mkDefault false; jellyfinConfig.enable = lib.mkDefault false;
caddyConfig.enable = lib.mkDefault false; caddyConfig.enable = lib.mkDefault false;
};
} }

View File

@@ -2,7 +2,7 @@
{ {
options = { options = {
caddyConfig.enable = lib.mkEnableOption "Enable my caddy config for the glasshaus.info domain name"; movOpts.caddyConfig.enable = lib.mkEnableOption "Enable my caddy config for the glasshaus.info domain name";
}; };
config = lib.mkIf config.movOpts.caddyConfig.enable { config = lib.mkIf config.movOpts.caddyConfig.enable {
services.caddy = { services.caddy = {