refactor variables & theme

Former-commit-id: 276756d998
This commit is contained in:
Hadi
2025-03-04 20:58:20 +01:00
parent b314c9648f
commit 4d80db7ccb
17 changed files with 68 additions and 125 deletions

View File

@@ -1,26 +1,19 @@
{ config, ... }: { { config, ... }: {
imports = [ imports = [
# Mostly system related configuration
../../nixos/nvidia.nix # CHANGEME: Remove this line if you don't have an Nvidia GPU ../../nixos/nvidia.nix # CHANGEME: Remove this line if you don't have an Nvidia GPU
../../nixos/prime.nix # CHANGEME: Remove this line if you don't have an Nvidia GPU
../../nixos/audio.nix ../../nixos/audio.nix
../../nixos/bluetooth.nix ../../nixos/bluetooth.nix
../../nixos/fonts.nix ../../nixos/fonts.nix
../../nixos/home-manager.nix ../../nixos/home-manager.nix
../../nixos/network-manager.nix
../../nixos/nix.nix ../../nixos/nix.nix
../../nixos/systemd-boot.nix ../../nixos/systemd-boot.nix
../../nixos/timezone.nix
../../nixos/tuigreet.nix ../../nixos/tuigreet.nix
../../nixos/users.nix ../../nixos/users.nix
../../nixos/utils.nix ../../nixos/utils.nix
../../nixos/xdg-portal.nix # ../../nixos/docker.nix
../../nixos/docker.nix
../../nixos/variables-config.nix
# Choose your theme here
# ../../themes/stylix/yoru.nix
# You should let those lines as is
./hardware-configuration.nix ./hardware-configuration.nix
./variables.nix ./variables.nix
]; ];

View File

@@ -1,13 +1,12 @@
{ pkgs, config, ... }: { { pkgs, config, ... }: {
imports = [ imports = [
# Mostly user-specific configuration
./variables.nix ./variables.nix
# Programs # Programs
../../home/programs/kitty ../../home/programs/kitty
../../home/programs/nvim ../../home/programs/nvim
# ../../home/programs/nvf
# ../../home/programs/qutebrowser
../../home/programs/shell ../../home/programs/shell
../../home/programs/fetch ../../home/programs/fetch
../../home/programs/git ../../home/programs/git
@@ -17,7 +16,6 @@
../../home/programs/lazygit ../../home/programs/lazygit
../../home/programs/zen ../../home/programs/zen
../../home/programs/duckduckgo-colorscheme ../../home/programs/duckduckgo-colorscheme
../../home/programs/superfile
../../home/programs/discord ../../home/programs/discord
# Scripts # Scripts
@@ -36,8 +34,6 @@
../../home/system/udiskie ../../home/system/udiskie
../../home/system/clipman ../../home/system/clipman
# ../../themes/stylix/yoru.nix
./secrets # CHANGEME: You should probably remove this line, this is where I store my secrets ./secrets # CHANGEME: You should probably remove this line, this is where I store my secrets
]; ];
@@ -62,17 +58,14 @@
nodejs nodejs
python3 python3
jq jq
figlet
just just
pnpm pnpm
lazydocker
# Utils # Utils
zip zip
unzip unzip
optipng optipng
pfetch pfetch
pandoc
btop btop
fastfetch fastfetch

View File

@@ -1,5 +1,8 @@
{ config, ... }: { { config, lib, ... }: {
imports = [ ../../nixos/variables-config.nix ../../themes/yoru.nix ]; imports = [
# Choose your theme here:
../../themes/yoru.nix
];
config.var = { config.var = {
hostname = "nixy"; hostname = "nixy";
@@ -21,8 +24,13 @@
autoUpgrade = false; autoUpgrade = false;
autoGarbageCollector = true; autoGarbageCollector = true;
};
# Choose your theme variables here # Let this here
# theme = import ../../themes/var/2025.nix; options = {
var = lib.mkOption {
type = lib.types.attrs;
default = { };
};
}; };
} }

View File

@@ -1,11 +0,0 @@
{ config, ... }:
let configDir = config.var.configDirectory;
in {
system.autoUpgrade = {
enable = config.var.autoUpgrade;
dates = "04:00";
flake = "${configDir}";
flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ];
allowReboot = false;
};
}

View File

@@ -4,6 +4,5 @@
enable = true; enable = true;
powerOnBoot = true; powerOnBoot = true;
}; };
services.blueman.enable = true; services.blueman.enable = true;
} }

View File

@@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: { { pkgs, ... }: {
fonts = { fonts = {
packages = with pkgs; [ packages = with pkgs; [
@@ -19,18 +19,8 @@
nerd-fonts.meslo-lg nerd-fonts.meslo-lg
openmoji-color openmoji-color
twemoji-color-font twemoji-color-font
inputs.apple-fonts.packages.${pkgs.system}.sf-pro-nerd
]; ];
enableDefaultPackages = false; enableDefaultPackages = false;
fontconfig = {
defaultFonts = {
monospace = [ "FiraCode Nerd Font Mono" "Noto Color Emoji" ];
sansSerif = [ "SFProDisplay Nerd Font" "Noto Color Emoji" ];
serif = [ "SFProDisplay Nerd Font" "Noto Color Emoji" ];
emoji = [ "Noto Color Emoji" ];
};
};
}; };
} }

View File

@@ -1,4 +0,0 @@
{
networking.networkmanager.enable = true;
systemd.services.NetworkManager-wait-online.enable = false;
}

View File

@@ -14,9 +14,14 @@ in {
settings = { settings = {
auto-optimise-store = true; auto-optimise-store = true;
experimental-features = [ "nix-command" "flakes" ]; experimental-features = [ "nix-command" "flakes" ];
substituters = [ "https://hyprland.cachix.org" ]; substituters = [
"https://cache.nixos.org/"
"https://hyprland.cachix.org"
"https://nix-community.cachix.org"
];
trusted-public-keys = [ trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
]; ];
}; };
gc = { gc = {

View File

@@ -41,6 +41,22 @@ in {
true; # This can cause sleep/suspend to fail and saves entire VRAM to /tmp/ true; # This can cause sleep/suspend to fail and saves entire VRAM to /tmp/
modesetting.enable = true; modesetting.enable = true;
package = nvidiaDriverChannel; package = nvidiaDriverChannel;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
# sync.enable = true;
# CHANGEME: Change those values to match your hardware (if prime is imported)
amdgpuBusId =
"PCI:5:0:0"; # Set this to the bus ID of your AMD GPU if you have one
# intelBusId = "PCI:0:2:0"; # Set this to the bus ID of your Intel GPU if you have one
nvidiaBusId =
"PCI:1:0:0"; # Set this to the bus ID of your Nvidia GPU if you have one
};
}; };
graphics = { graphics = {
enable = true; enable = true;
@@ -55,4 +71,5 @@ in {
]; ];
}; };
}; };
} }

View File

@@ -1,10 +0,0 @@
{ config, ... }: {
services.pia.enable = true;
# Alternatively, you can use the `authUserPassFile` attribute if you are using
# a Nix secrets manager. Here's an example using sops-nix.
#
# The secret you provide to `authUserPassFile` should be a multiline string with
# a single username on the first line a single password on the second line.
services.pia.authUserPassFile = "/home/hadi/.config/pia/pia.ovpn";
}

View File

@@ -1,17 +0,0 @@
{
hardware.nvidia.prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
# sync.enable = true;
# CHANGEME: Change those values to match your hardware (if prime is imported)
amdgpuBusId =
"PCI:5:0:0"; # Set this to the bus ID of your AMD GPU if you have one
# intelBusId = "PCI:0:2:0"; # Set this to the bus ID of your Intel GPU if you have one
nvidiaBusId =
"PCI:1:0:0"; # Set this to the bus ID of your Nvidia GPU if you have one
};
}

View File

@@ -1,15 +0,0 @@
{ config, ... }: {
time.timeZone = config.var.timeZone;
i18n.defaultLocale = config.var.defaultLocale;
i18n.extraLocaleSettings = {
LC_ADDRESS = config.var.extraLocale;
LC_IDENTIFICATION = config.var.extraLocale;
LC_MEASUREMENT = config.var.extraLocale;
LC_MONETARY = config.var.extraLocale;
LC_NAME = config.var.extraLocale;
LC_NUMERIC = config.var.extraLocale;
LC_PAPER = config.var.extraLocale;
LC_TELEPHONE = config.var.extraLocale;
LC_TIME = config.var.extraLocale;
};
}

View File

@@ -2,10 +2,36 @@
let let
hostname = config.var.hostname; hostname = config.var.hostname;
keyboardLayout = config.var.keyboardLayout; keyboardLayout = config.var.keyboardLayout;
configDir = config.var.configDirectory;
in { in {
networking.hostName = hostname; networking.hostName = hostname;
networking.networkmanager.enable = true;
systemd.services.NetworkManager-wait-online.enable = false;
system.autoUpgrade = {
enable = config.var.autoUpgrade;
dates = "04:00";
flake = "${configDir}";
flags = [ "--update-input" "nixpkgs" "--commit-lock-file" ];
allowReboot = false;
};
time.timeZone = config.var.timeZone;
i18n.defaultLocale = config.var.defaultLocale;
i18n.extraLocaleSettings = {
LC_ADDRESS = config.var.extraLocale;
LC_IDENTIFICATION = config.var.extraLocale;
LC_MEASUREMENT = config.var.extraLocale;
LC_MONETARY = config.var.extraLocale;
LC_NAME = config.var.extraLocale;
LC_NUMERIC = config.var.extraLocale;
LC_PAPER = config.var.extraLocale;
LC_TELEPHONE = config.var.extraLocale;
LC_TIME = config.var.extraLocale;
};
services = { services = {
xserver = { xserver = {
enable = true; enable = true;

View File

@@ -1,8 +0,0 @@
{ lib, ... }: {
options = {
var = lib.mkOption {
type = lib.types.attrs;
default = { };
};
};
}

View File

@@ -1,9 +0,0 @@
{ config, ... }:
let username = config.var.username;
in {
virtualisation.virtualbox.host = {
enable = true;
enableExtensionPack = true;
};
users.extraGroups.vboxusers.members = [ username ];
}

View File

@@ -1,14 +0,0 @@
{ pkgs, ... }: {
xdg.portal = {
enable = true;
config.common.default = "*";
wlr.enable = true;
xdgOpenUsePortal = true;
extraPortals = [
pkgs.xdg-desktop-portal-hyprland
pkgs.xdg-desktop-portal-gtk
pkgs.libsForQt5.xdg-desktop-portal-kde
];
config.hyprland = { default = [ "hyprland" "gtk" ]; };
};
}

View File

@@ -56,8 +56,8 @@
}; };
cursor = { cursor = {
package = pkgs.bibata-cursors; # package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice"; # name = "Bibata-Modern-Ice";
size = 24; size = 24;
}; };