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 = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
@@ -30,22 +30,50 @@
};
};
outputs = {
nixpkgs,
nur,
self,
nixvim,
stylix,
...
} @ inputs: let
outputs = { self, home-manager, nixpkgs, nur, nixvim, stylix, ... } @ inputs:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
username = "pagedmov";
in {
homeManagerModules.default = ./modules/home;
nixosModules.default = ./modules/sys;
serverModules.default = ./modules/server;
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 = {
oganesson = nixpkgs.lib.nixosSystem {
specialArgs = {
@@ -56,6 +84,7 @@
modules = [
./hosts/desktop/config.nix
./modules/sys
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix
nixvim.nixosModules.nixvim
nur.nixosModules.nur
@@ -67,9 +96,11 @@
host = "mercury";
inherit self inputs username;
};
inherit system;
modules = [
./hosts/laptop/config.nix
./modules/sys
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix
nixvim.nixosModules.nixvim
nur.nixosModules.nur
@@ -81,10 +112,12 @@
host = "xenon";
inherit self inputs username;
};
inherit system;
modules = [
./hosts/server/config.nix
./modules/sys
./modules/server
home-manager.nixosModules.home-manager
stylix.nixosModules.stylix
nixvim.nixosModules.nixvim
nur.nixosModules.nur
@@ -96,6 +129,7 @@
host = "installer";
inherit self inputs;
};
inherit system;
modules = [
./hosts/installer
nixvim.nixosModules.nixvim

View File

@@ -1,7 +1,6 @@
{pkgs, ...}: {
{pkgs, username, ...}: {
imports = [
./hardware.nix
./home.nix
];
# 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";
i18n.defaultLocale = "en_US.UTF-8";
}

View File

@@ -1,29 +1,16 @@
{
host,
pkgs,
self,
inputs,
username,
lib,
config,
...
}: let
nur = config.nur;
in {
imports = [inputs.home-manager.nixosModules.home-manager];
home-manager = {
useUserPackages = true;
useGlobalPkgs = true;
backupFileExtension = "backup";
extraSpecialArgs = {inherit self inputs host username nur;};
users = {
${username} = {
programs.home-manager.enable = true;
imports = [
inputs.self.outputs.homeManagerModules.default
];
}:
{
home.username = "${username}"; # Replace with your actual username
home.homeDirectory = "/home/${username}"; # Replace with your actual home directory
home.stateVersion = "24.05"; # Adjust this based on your system's NixOS version
programs.home-manager.enable = true;
# My custom home-manager modules
movOpts = {
# modules/home/files
homeFiles.enable = true;
@@ -60,35 +47,10 @@ in {
movScripts.nixShortcuts.enable = true;
};
dconf.settings = lib.mkIf config.movOpts.virtConfig.enable {
dconf.settings = {
"org/virt-manager/virt-manager/connections" = {
autoconnect = ["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
./home.nix
];
movOpts = {
nixSettings.enable = true;
networkModule.enable = true;
bootLoader.enable = true;
@@ -16,7 +17,7 @@
sysServices.enable = true;
jellyfinConfig.enable = true;
caddyConfig.enable = true;
};
networking.firewall = {
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 = {
movOpts.stylixHomeConfig.enable = lib.mkEnableOption "enables my stylix Home-Manager options";
};
config = lib.mkIf config.movOpts.stylixHomeConfig.enable {
stylix = {
enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/${scheme}.yaml";
image = wallpaper;
polarity = "dark";
autoEnable = true;
opacity.terminal = 0.50;
targets = {
# fzf.enable = true;
# kitty.enable = true;
# vesktop.enable = true;
waybar.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 = {
movOpts.firefoxConfig.enable = lib.mkEnableOption "enables my firefox configuration";
};
@@ -83,17 +83,6 @@
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 = ''
"browser.startup.homepage" = "${self}/glasshouse-desktop/home/firefox/homepage.html";
"browser.active_color" = "#EE0000";

View File

@@ -2,7 +2,7 @@
{
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 {
services.jellyfin = {

View File

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

View File

@@ -2,7 +2,7 @@
{
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 {
services.caddy = {