refactor!: restructure and document configuration
This commit is contained in:
parent
4a02e072a7
commit
f87f9995be
126 changed files with 957 additions and 590 deletions
53
hosts/wizlap/hardware-configuration.nix
Normal file
53
hosts/wizlap/hardware-configuration.nix
Normal file
|
@ -0,0 +1,53 @@
|
|||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
"nvme"
|
||||
"xhci_pci"
|
||||
];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-amd" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/796d5ad8-db83-4c4f-883d-2f1f4f1937de";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
boot.initrd.luks.devices."luks-94d233be-889a-46a4-9c20-b7f026980cbf".device = "/dev/disk/by-uuid/94d233be-889a-46a4-9c20-b7f026980cbf";
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/CA05-302F";
|
||||
fsType = "vfat";
|
||||
options = [
|
||||
"fmask=0022"
|
||||
"dmask=0022"
|
||||
];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||
# still possible to use this option, but it's recommended to use it in conjunction
|
||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.docker0.useDHCP = lib.mkDefault true;
|
||||
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
145
hosts/wizlap/home-manager.nix
Normal file
145
hosts/wizlap/home-manager.nix
Normal file
|
@ -0,0 +1,145 @@
|
|||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
#
|
||||
## HOME CONFIGURATION #
|
||||
#
|
||||
|
||||
# Import configurations for better modularity.
|
||||
imports = [
|
||||
../../modules/emacs
|
||||
../../modules/hyprland/home-manager.nix
|
||||
../../modules/neovim
|
||||
../../shared/home-manager
|
||||
];
|
||||
|
||||
# Home Manager needs a bit of information about you and the paths it should
|
||||
# manage.
|
||||
home.username = "wizardlink";
|
||||
home.homeDirectory = "/home/wizardlink";
|
||||
|
||||
# This value determines the Home Manager release that your configuration is
|
||||
# compatible with. This helps avoid breakage when a new Home Manager release
|
||||
# introduces backwards incompatible changes.
|
||||
#
|
||||
# You should not change this value, even if you update Home Manager. If you do
|
||||
# want to update the value, then make sure to first check the Home Manager
|
||||
# release notes.
|
||||
home.stateVersion = "23.05"; # Please read the comment before changing.
|
||||
|
||||
home.file = {
|
||||
# Create wallpaper script to be read by the start_services.sh script.
|
||||
".local/share/scripts/wallpaper.sh" = {
|
||||
executable = true;
|
||||
text = # sh
|
||||
''
|
||||
#
|
||||
## Start wallpaper daemon and set one.
|
||||
#
|
||||
OUTPUT_1="eDP-1"
|
||||
IMAGE_1="/home/wizardlink/Pictures/wallhaven-x6p3y3.jpg"
|
||||
|
||||
function load_wallpapers() {
|
||||
swww img -t any --transition-bezier 0.0,0.0,1.0,1.0 --transition-duration .8 --transition-step 255 --transition-fps 60 -o $OUTPUT_1 $IMAGE_1;
|
||||
}
|
||||
|
||||
if ! swww query; then
|
||||
swww-daemon &
|
||||
fi
|
||||
|
||||
load_wallpapers &
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
#
|
||||
# PACKAGES #
|
||||
#
|
||||
|
||||
programs.direnv = {
|
||||
config = {
|
||||
whitelist = {
|
||||
prefix = [
|
||||
"/home/wizardlink/Documents/projects"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
home.packages = with pkgs; [
|
||||
## Tools
|
||||
# Utilities
|
||||
brightnessctl
|
||||
|
||||
# Create an FHS environment using the command `fhs`, enabling the execution of non-NixOS packages in NixOS!
|
||||
(
|
||||
let
|
||||
base = appimageTools.defaultFhsEnvArgs;
|
||||
in
|
||||
buildFHSEnv (
|
||||
base
|
||||
// {
|
||||
name = "fhs";
|
||||
targetPkgs =
|
||||
pkgs:
|
||||
(
|
||||
# pkgs.buildFHSUserEnv provides only a minimal FHS environment,
|
||||
# lacking many basic packages needed by most software.
|
||||
# Therefore, we need to add them manually.
|
||||
#
|
||||
# pkgs.appimageTools provides basic packages required by most software.
|
||||
(base.targetPkgs pkgs)
|
||||
++ (with pkgs; [
|
||||
])
|
||||
);
|
||||
profile = "export FHS=1";
|
||||
runScript = "bash";
|
||||
extraOutputsToInstall = [ "dev" ];
|
||||
}
|
||||
)
|
||||
)
|
||||
];
|
||||
|
||||
#
|
||||
# MODULES #
|
||||
#
|
||||
|
||||
# Enable neovim
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
|
||||
# Enable ollama support
|
||||
ollama.enable = true;
|
||||
|
||||
# Set the hostname for nixd in neovim
|
||||
nixd.hostname = "wizlap";
|
||||
};
|
||||
|
||||
# Add monitor configuration to hyprland
|
||||
modules.hyprland = {
|
||||
# Enable scripts
|
||||
scripts = {
|
||||
startup.enable = true;
|
||||
screenshot.enable = true;
|
||||
};
|
||||
|
||||
# Add monitor configuration to hyprland
|
||||
extraConfig = # hyprlang
|
||||
''
|
||||
# See https://wiki.hyprland.org/Configuring/Monitors/
|
||||
monitor = eDP-1, 1920x1080@60.01, 0x0, 1
|
||||
|
||||
# Bind workspaces to specific monitors
|
||||
workspace = 1, monitor:eDP-1
|
||||
workspace = 2, monitor:eDP-1
|
||||
workspace = 3, monitor:eDP-1
|
||||
workspace = 4, monitor:eDP-1
|
||||
workspace = 5, monitor:eDP-1
|
||||
workspace = 6, monitor:eDP-1
|
||||
workspace = 7, monitor:eDP-1
|
||||
workspace = 8, monitor:eDP-1
|
||||
workspace = 9, monitor:eDP-1
|
||||
workspace = 0, monitor:eDP-1
|
||||
'';
|
||||
};
|
||||
}
|
118
hosts/wizlap/nixos.nix
Normal file
118
hosts/wizlap/nixos.nix
Normal file
|
@ -0,0 +1,118 @@
|
|||
{ config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
../../modules/hyprland/nixos.nix
|
||||
../../shared/nixos
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
#
|
||||
# NIXOS #
|
||||
#
|
||||
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It‘s perfectly fine and recommended to leave
|
||||
# this value at the release version of the first install of this system.
|
||||
# Before changing this value read the documentation for this option
|
||||
# (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
|
||||
system.stateVersion = "23.05";
|
||||
|
||||
# Consume my desktop's binary cache. This is specially useful since (in theory)
|
||||
# I will always update the flake and desktop machine first, so when I pull the changes,
|
||||
# my desktop will have all the binaries my laptop needs.
|
||||
nix.settings.substituters = [ "http://192.168.0.100:7373" ];
|
||||
nix.settings.trusted-public-keys = [
|
||||
"wizdesk-1:2UvctPjiMwMs7r2r7VPvoPmh4OcUjY3JmaRDJnOTZY8="
|
||||
];
|
||||
|
||||
#
|
||||
# SYSTEM #
|
||||
#
|
||||
networking.hostName = "wizlap"; # Define your hostname.
|
||||
|
||||
# Open ports in the firewall.
|
||||
networking.firewall = {
|
||||
allowedTCPPortRanges = [
|
||||
{
|
||||
from = 1714;
|
||||
to = 1764;
|
||||
} # KDEConnect
|
||||
];
|
||||
allowedUDPPortRanges = [
|
||||
{
|
||||
from = 1714;
|
||||
to = 1764;
|
||||
} # KDEConnect
|
||||
];
|
||||
};
|
||||
|
||||
# Define a user account. Don't forget to set a password with ‘passwd’.
|
||||
users.users.wizardlink = {
|
||||
createHome = true;
|
||||
description = "Alexandre Cavalheiro";
|
||||
extraGroups = [
|
||||
"docker"
|
||||
"gamemode"
|
||||
"libvirtd"
|
||||
"networkmanager"
|
||||
"openrazer"
|
||||
"postgresql"
|
||||
"wheel"
|
||||
];
|
||||
|
||||
initialPassword = "wizardlink";
|
||||
isNormalUser = true;
|
||||
|
||||
openssh.authorizedKeys.keys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDdGOyRbu6IOw9yqotxE6m7wCif7oP/2D0tlREa5Q6uo Alexandre Cavalheiro S. Tiago da Silva <contact@thewizard.link>"
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIISfCUsZrnCMZapdrvkUCrdRiX+1xuZBdGrynNRzDI2v" # SpaceEEC
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPInBFp7zBLhFluoww65CZzcnMdhndTawBv8QYJ5s/Xt david.alejandro.rubio@gmail.com" # Kodehawa
|
||||
];
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "America/Sao_Paulo";
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n = {
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
supportedLocales = [
|
||||
"C.UTF-8/UTF-8"
|
||||
"en_GB.UTF-8/UTF-8"
|
||||
"en_US.UTF-8/UTF-8"
|
||||
"ja_JP.UTF-8/UTF-8"
|
||||
"pt_BR.UTF-8/UTF-8"
|
||||
];
|
||||
|
||||
extraLocaleSettings = {
|
||||
LANGUAGE = "en_US.UTF-8";
|
||||
LC_ADDRESS = "en_US.UTF-8";
|
||||
LC_ALL = "en_US.UTF-8";
|
||||
LC_IDENTIFICATION = "en_US.UTF-8";
|
||||
LC_MEASUREMENT = "pt_BR.UTF-8";
|
||||
LC_MONETARY = "en_US.UTF-8";
|
||||
LC_NAME = "en_US.UTF-8";
|
||||
LC_NUMERIC = "pt_BR.UTF-8";
|
||||
LC_PAPER = "pt_BR.UTF-8";
|
||||
LC_TELEPHONE = "pt_BR.UTF-8";
|
||||
LC_TIME = "en_GB.UTF-8";
|
||||
};
|
||||
};
|
||||
|
||||
#
|
||||
# HARDWARE #
|
||||
#
|
||||
|
||||
# Enable Zenergy
|
||||
boot.initrd.kernelModules = [
|
||||
"zenergy"
|
||||
];
|
||||
boot.extraModulePackages = [
|
||||
config.boot.kernelPackages.zenergy
|
||||
];
|
||||
|
||||
# enable a better driver for wireless xbox controllers.
|
||||
hardware.xpadneo.enable = true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue