1
0
forked from extern/zaneyos

Move to using options.nix for user and system settings

This commit is contained in:
Tyler Kelley 2024-02-05 21:46:24 -06:00
parent 3c4f6d6433
commit 035f18c2f3
17 changed files with 82 additions and 74 deletions

View File

@ -1,5 +1,6 @@
{ config, pkgs, flakeDir, ... }:
{ config, pkgs, ... }:
let inherit (import ../../options.nix) flakeDir; in
{
# Configure Bash
programs.bash = {

View File

@ -1,10 +1,12 @@
{ pkgs, config, lib, browser,
cpuType, gpuType, wallpaperDir,
inputs, borderAnim, theKBDLayout, ... }:
{ pkgs, config, lib, inputs, ... }:
let
theme = config.colorScheme.palette;
hyprplugins = inputs.hyprland-plugins.packages.${pkgs.system};
inherit (import ../../options.nix)
browser cpuType gpuType
wallpaperDir borderAnim
theKBDLayout;
in with lib; {
wayland.windowManager.hyprland = {
enable = true;

View File

@ -1,7 +1,9 @@
{ pkgs, config, browser, wallpaperDir, flakeDir,
username, wallpaperGit, ... }:
{ pkgs, config, username, ... }:
{
let
inherit (import ../../options.nix)
browser wallpaperDir wallpaperGit flakeDir;
in {
# Install Packages For The User
home.packages = with pkgs; [
pkgs."${browser}" discord libvirt swww grim slurp gnome.file-roller

View File

@ -1,7 +1,8 @@
{ pkgs, config, lib, waybarStyle, ... }:
{ pkgs, config, lib, ... }:
let
palette = config.colorScheme.palette;
inherit (import ../../options.nix) waybarStyle;
in
lib.mkIf ("${waybarStyle}" == "style1") {
# Configure & Theme Waybar

View File

@ -2,6 +2,7 @@
let
palette = config.colorScheme.palette;
inherit (import ../../options.nix) waybarStyle;
in
lib.mkIf ("${waybarStyle}" == "style2") {
# Configure & Theme Waybar

View File

@ -1,5 +1,6 @@
{ pkgs, config, lib, gpuType, ... }:
{ pkgs, config, lib, ... }:
let inherit (import ../../options.nix) gpuType; in
lib.mkIf ("${gpuType}" == "amd") {
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"

View File

@ -1,6 +1,6 @@
{ pkgs, config, wallpaperDir,
wallpaperGit, username, ... }:
{ pkgs, config, username, ... }:
let inherit (import ../../options.nix) wallpaperDir wallpaperGit; in
{
# system.userActivationScripts = {
# gitwallpapers.text = ''

View File

@ -1,5 +1,6 @@
{ pkgs, config, theKBDLayout, ... }:
{ pkgs, config, ... }:
let inherit (import ../../options.nix) theKBDLayout; in
{
services.xserver = {
enable = true;

View File

@ -1,5 +1,6 @@
{ pkgs, config, lib, gpuType, ... }:
{ pkgs, config, lib, ... }:
let inherit (import ../../options.nix) gpuType; in
lib.mkIf ("${gpuType}" == "intel-amd") {
nixpkgs.config.packageOverrides =
pkgs: {

View File

@ -1,5 +1,6 @@
{ pkgs, config, lib, gpuType, ... }:
{ pkgs, config, lib, ... }:
let inherit (import ../../options.nix) gpuType; in
lib.mkIf ("${gpuType}" == "intel") {
nixpkgs.config.packageOverrides =
pkgs: {

View File

@ -1,6 +1,6 @@
{ pkgs, config, lib, gpuType,
intel-bus-id, nvidia-bus-id, ... }:
{ pkgs, config, lib, ... }:
let inherit (import ../../options.nix) intel-bus-id nvidia-bus-id gpuType; in
lib.mkIf ("${gpuType}" == "intel-nvidia") {
nixpkgs.config.packageOverrides =
pkgs: {

View File

@ -1,5 +1,6 @@
{ pkgs, config, lib, gpuType, ... }:
let inherit (import ../../options.nix) gpuType; in
lib.mkIf ("${gpuType}" == "nvidia") {
services.xserver.videoDrivers = ["nvidia"];
hardware.nvidia = {

View File

@ -1,5 +1,6 @@
{ pkgs, config, lib, cpuType, ... }:
{ pkgs, config, lib, ... }:
let inherit (import ../../options.nix) cpuType; in
lib.mkIf ("${cpuType}" == "vm") {
services.qemuGuest.enable = true;
services.spice-vdagentd.enable = true;

View File

@ -20,34 +20,8 @@
outputs = inputs@{ nixpkgs, home-manager, ... }:
let
system = "x86_64-linux";
# User Variables
hostname = "hyprnix";
username = "zaney";
gitUsername = "Tyler Kelley";
gitEmail = "tylerzanekelley@gmail.com";
theLocale = "en_US.UTF-8";
theKBDLayout = "us";
theLCVariables = "en_US.UTF-8";
theTimezone = "America/Chicago";
theme = "rose-pine";
waybarStyle = "style2"; # can be style1-2
borderAnim = "on"; # anything other than on disables anim borders in Hyprland
browser = "firefox";
wallpaperGit = "https://gitlab.com/Zaney/my-wallpapers.git";
wallpaperDir = "/home/${username}/Pictures/Wallpapers";
flakeDir = "/home/${username}/zaneyos";
# Driver selection profile
# Options include amd (tested), intel, nvidia
# GPU hybrid options: intel-nvidia, intel-amd
# vm for both if you are running a vm
cpuType = "intel";
gpuType = "amd";
# Run: sudo lshw -c display to find this info
# This is needed ONLY for hybrid nvidia offloading
# Run: nvidia-offload (insert program name)
intel-bus-id = "PCI:0:2:0";
nvidia-bus-id = "PCI:14:0:0";
hostname = "hyprnix";
pkgs = import nixpkgs {
inherit system;
@ -58,34 +32,23 @@
in {
nixosConfigurations = {
"${hostname}" = nixpkgs.lib.nixosSystem {
specialArgs = {
specialArgs = {
inherit system; inherit inputs;
inherit username; inherit hostname;
inherit gitUsername; inherit theTimezone;
inherit gitEmail; inherit theLocale;
inherit wallpaperDir; inherit wallpaperGit;
inherit cpuType; inherit theKBDLayout;
inherit theLCVariables; inherit gpuType;
inherit theme;
};
modules = [ ./system.nix
modules = [
./system.nix
home-manager.nixosModules.home-manager {
home-manager.extraSpecialArgs = { inherit username;
inherit gitUsername; inherit gitEmail;
inherit theKBDLayout; inherit inputs;
inherit theme; inherit browser;
inherit wallpaperDir; inherit wallpaperGit;
inherit flakeDir; inherit gpuType;
inherit cpuType; inherit waybarStyle;
inherit borderAnim;
home-manager.extraSpecialArgs = {
inherit username; inherit inputs;
inherit (inputs.nix-colors.lib-contrib {inherit pkgs;}) gtkThemeFromScheme;
};
home-manager.useGlobalPkgs = true;
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.backupFileExtension = "backup";
home-manager.users.${username} = import ./home.nix;
}
];
home-manager.users.${username} = import ./home.nix;
}
];
};
};
};

View File

@ -1,9 +1,11 @@
{ config, pkgs, inputs, username,
gitUsername, gitEmail, gtkThemeFromScheme,
theme, browser, wallpaperDir, wallpaperGit,
flakeDir, waybarStyle, ... }:
{
gtkThemeFromScheme, ... }:
let
inherit (import ./options.nix)
gitUsername gitEmail theme browser
wallpaperDir wallpaperGit flakeDir
waybarStyle;
in {
# Home Manager Settings
home.username = "${username}";
home.homeDirectory = "/home/${username}";

27
options.nix Normal file
View File

@ -0,0 +1,27 @@
{
# User Variables
gitUsername = "Tyler Kelley";
gitEmail = "tylerzanekelley@gmail.com";
theLocale = "en_US.UTF-8";
theKBDLayout = "us";
theLCVariables = "en_US.UTF-8";
theTimezone = "America/Chicago";
theme = "rose-pine";
waybarStyle = "style2"; # can be style1-2
borderAnim = "on"; # anything other than on disables anim borders in Hyprland
browser = "firefox";
wallpaperGit = "https://gitlab.com/Zaney/my-wallpapers.git";
wallpaperDir = "/home/zaney/Pictures/Wallpapers";
flakeDir = "/home/zaney/zaneyos";
# Driver selection profile
# Options include amd (tested), intel, nvidia
# GPU hybrid options: intel-nvidia, intel-amd
# vm for both if you are running a vm
cpuType = "intel";
gpuType = "amd";
# Run: sudo lshw -c display to find this info
# This is needed ONLY for hybrid nvidia offloading
# Run: nvidia-offload (insert program name)
intel-bus-id = "PCI:0:2:0";
nvidia-bus-id = "PCI:14:0:0";
}

View File

@ -1,9 +1,12 @@
{ inputs, config, pkgs, username,
hostname, gitUsername, theLocale,
theTimezone, wallpaperDir, wallpaperGit,
theLCVariables, theKBDLayout, ... }:
{ inputs, config, pkgs,
username, hostname, ... }:
{
let
inherit (import ./options.nix)
theLocale theTimezone gitUsername
wallpaperDir wallpaperGit
theLCVariables theKBDLayout;
in {
imports =
[
inputs.nixvim.nixosModules.nixvim