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, ... }: {
imports = [
# Mostly system related configuration
../../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/bluetooth.nix
../../nixos/fonts.nix
../../nixos/home-manager.nix
../../nixos/network-manager.nix
../../nixos/nix.nix
../../nixos/systemd-boot.nix
../../nixos/timezone.nix
../../nixos/tuigreet.nix
../../nixos/users.nix
../../nixos/utils.nix
../../nixos/xdg-portal.nix
../../nixos/docker.nix
../../nixos/variables-config.nix
# Choose your theme here
# ../../themes/stylix/yoru.nix
# ../../nixos/docker.nix
# You should let those lines as is
./hardware-configuration.nix
./variables.nix
];

View File

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

View File

@@ -1,5 +1,8 @@
{ config, ... }: {
imports = [ ../../nixos/variables-config.nix ../../themes/yoru.nix ];
{ config, lib, ... }: {
imports = [
# Choose your theme here:
../../themes/yoru.nix
];
config.var = {
hostname = "nixy";
@@ -21,8 +24,13 @@
autoUpgrade = false;
autoGarbageCollector = true;
};
# Choose your theme variables here
# theme = import ../../themes/var/2025.nix;
# Let this here
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;
powerOnBoot = true;
};
services.blueman.enable = true;
}

View File

@@ -1,4 +1,4 @@
{ pkgs, inputs, ... }: {
{ pkgs, ... }: {
fonts = {
packages = with pkgs; [
@@ -19,18 +19,8 @@
nerd-fonts.meslo-lg
openmoji-color
twemoji-color-font
inputs.apple-fonts.packages.${pkgs.system}.sf-pro-nerd
];
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 = {
auto-optimise-store = true;
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 = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
];
};
gc = {

View File

@@ -41,6 +41,22 @@ in {
true; # This can cause sleep/suspend to fail and saves entire VRAM to /tmp/
modesetting.enable = true;
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 = {
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
hostname = config.var.hostname;
keyboardLayout = config.var.keyboardLayout;
configDir = config.var.configDirectory;
in {
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 = {
xserver = {
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 = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern-Ice";
# package = pkgs.bibata-cursors;
# name = "Bibata-Modern-Ice";
size = 24;
};