This commit is contained in:
Hadi 2024-08-19 00:38:27 +02:00
parent 31ac58592e
commit 849eb5dd11
14 changed files with 78 additions and 82 deletions

View File

@ -8,11 +8,12 @@ The laptop configuration is used by an Omen 16 laptop w/ nvidia and an amd gpu r
The configurations files can be found in the `hosts/laptop` directory.
| Category | Name |
|-----------------------------------------|----------------|
| --------------------------------------- | -------------- |
| WM | Hyprland |
| | hyprlock |
| | hyprpaper |
| | hypridle |
| | hyprcursor |
| | wlogout |
| Bar | waybar |
| Terminal | kitty |
@ -49,7 +50,6 @@ I exposed some services to the internet using a reverse proxy (Nginx) and cloudf
- Nextcloud
- Vaultwarden
- Adguard Home
- Unifi Controler
- Uptime Kuma
- "Jackflix"
- Jellyfin, Transmission, *arr

View File

@ -17,7 +17,7 @@ It's a simple way to manage your system configuration and dotfiles.
- 🏠 `home` are the dotfiles and configuration files for the users
- 'programs' is a collection of apps configured with home-manager
- 'scripts' is a folder full of bash scripts (see [SCRIPTS.md](docs/SCRIPTS.md))
- 'system' is some desktop environment like configuration
- 'system' is some "desktop environment" configuration
- 'wallpapers' are... wallpapers
- 💻 `hosts` are the system configuration files
- 'laptop' is my configuration for my laptop with Nvidia that you can copy

View File

@ -25,7 +25,7 @@
inputs.nixpkgs.follows = "nixpkgs";
};
hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
nurpkgs.url = "github:nix-community/NUR";
nurpkgs.url = "github:nix-community/NUR"; # TODO: test to remove
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
};
@ -36,7 +36,7 @@
system = "x86_64-linux";
modules = [
./hosts/laptop/configuration.nix # CHANGEME
inputs.nixos-hardware.nixosModules.omen-16-n0005ne # CHANGE ME
inputs.nixos-hardware.nixosModules.omen-16-n0280nd # CHANGEME
inputs.home-manager.nixosModules.home-manager
{
nixpkgs.overlays = [ inputs.nurpkgs.overlay ];

View File

@ -5,49 +5,20 @@
../modules/nvidia.nix
# ../modules/prime.nix
../modules/tuigreet.nix
../modules/timezone.nix
../modules/usb.nix
../modules/systemd-boot.nix
../modules/users.nix
../modules/audio.nix
../modules/bluetooth.nix
./variables.nix
];
# Bootloader.
boot = {
loader.efi.canTouchEfiVariables = true;
loader.systemd-boot = {
enable = true;
consoleMode = "auto";
};
tmp.cleanOnBoot = true;
kernelPackages =
pkgs.linuxPackages_latest; # _zen, _hardened, _rt, _rt_latest, etc.
};
# Networking
networking.networkmanager.enable = true;
networking.hostName = config.var.hostname;
systemd.services.NetworkManager-wait-online.enable = false;
# Timezone and locale
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;
};
# Users
users.users.${config.var.username} = {
isNormalUser = true;
description = "${config.var.username} account";
extraGroups = [ "networkmanager" "wheel" ];
};
services = {
tailscale.enable = config.var.tailscale;
xserver = {
@ -69,11 +40,6 @@
};
users.defaultUserShell = pkgs.zsh;
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
# Set environment variables
environment.variables = {
XDG_DATA_HOME = "$HOME/.local/share";
@ -85,25 +51,6 @@
NIXOS_OZONE_WL = "1";
};
security.rtkit.enable = true;
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber = {
enable = true;
extraConfig = {
"10-disable-camera" = {
"wireplumber.profiles" = { main."monitor.libcamera" = "disabled"; };
};
};
};
};
nix = {
extraOptions = ''
warn-dirty = false
@ -126,7 +73,8 @@
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [ networkmanagerapplet ];
nixpkgs.config.permittedInsecurePackages = [ "electron-25.9.0" ];
nixpkgs.config.permittedInsecurePackages =
[ "electron-25.9.0" ]; # TODO: test to remove
system.autoUpgrade = {
enable = config.var.autoUpgrade;
@ -136,7 +84,7 @@
allowReboot = false;
};
xdg.portal = {
xdg.portal = { # TODO: test to remove
enable = true;
configPackages = with pkgs; [ xdg-desktop-portal-gtk ];
};

View File

@ -27,7 +27,7 @@
# change the nvim's obsidian configuration if you want to enable that:
obsidian = true;
tailscale = true;
usbguard = false;
usbguard = false; # TODO: Add the allow list variable
theme = import ../themes/nixy.nix; # select your theme here
};

20
hosts/modules/audio.nix Normal file
View File

@ -0,0 +1,20 @@
{
security.rtkit.enable = true;
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
jack.enable = true;
wireplumber = {
enable = true;
extraConfig = {
"10-disable-camera" = {
"wireplumber.profiles" = { main."monitor.libcamera" = "disabled"; };
};
};
};
};
}

View File

@ -0,0 +1,6 @@
{
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
}

View File

@ -28,7 +28,6 @@
enableDefaultPackages = false;
# this fixes emoji stuff
fontconfig = {
defaultFonts = {
monospace = [ "FiraCode Nerd Font Mono" "Noto Color Emoji" ];
@ -37,6 +36,5 @@
emoji = [ "Noto Color Emoji" ];
};
};
};
}

View File

@ -1,7 +1,7 @@
{ lib, pkgs, config, ... }:
let
nvidiaDriverChannel =
config.boot.kernelPackages.nvidiaPackages.beta; # stable, latest, etc.
config.boot.kernelPackages.nvidiaPackages.beta; # stable, latest, beta, etc.
in {
# Load nvidia driver for Xorg and Wayland
services.xserver.videoDrivers =
@ -14,7 +14,6 @@ in {
];
environment.variables = {
GBM_BACKEND = "nvidia-drm";
WLR_NO_HARDWARE_CURSORS = "1";
LIBVA_DRIVER_NAME = "nvidia"; # hardware acceleration
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
};

View File

@ -0,0 +1,12 @@
{ pkgs, ... }: {
boot = {
loader.efi.canTouchEfiVariables = true;
loader.systemd-boot = {
enable = true;
consoleMode = "auto";
};
tmp.cleanOnBoot = true;
kernelPackages =
pkgs.linuxPackages_latest; # _zen, _hardened, _rt, _rt_latest, etc.
};
}

View File

@ -0,0 +1,15 @@
{ 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;
};
}

7
hosts/modules/users.nix Normal file
View File

@ -0,0 +1,7 @@
{ config, ... }: {
users.users.${config.var.username} = {
isNormalUser = true;
description = "${config.var.username} account";
extraGroups = [ "networkmanager" "wheel" ];
};
}

View File

@ -9,7 +9,6 @@
./modules/internal/openssh.nix
./modules/internal/adguard.nix
./modules/internal/cockpit.nix
# ./modules/internal/unifi.nix # FIXME: unifi5 is deprecated
# exposed
./modules/exposed/ntfy-sh.nix
@ -19,7 +18,6 @@
./modules/exposed/nginx.nix
./modules/exposed/nextcloud.nix
./modules/exposed/vaultwarden.nix
# ./modules/exposed/bitcoin-git.nix # FIXME: bitcoin-git is deprecated
./modules/www
# jackflix

View File

@ -1,7 +0,0 @@
# unifi controller service
{
services.unifi = {
enable = true;
openFirewall = true; # 8443(webui) and other port use by AP
};
}