code dump v1
This commit is contained in:
parent
72c9007b05
commit
d8a9e92dff
@ -39,8 +39,7 @@
|
||||
modules = [
|
||||
./modules/common/core.nix
|
||||
./modules/common/users.nix
|
||||
./modules/machine/sephiroth/configuration.nix
|
||||
./modules/machine/sephiroth/apps.nix
|
||||
./modules/machine/sephiroth
|
||||
|
||||
home-manager.darwinModules.home-manager
|
||||
{
|
||||
@ -64,8 +63,7 @@
|
||||
nix-ld.nixosModules.nix-ld
|
||||
./modules/common/core.nix
|
||||
./modules/common/users.nix
|
||||
./modules/machine/cloud/hardware-configuration.nix
|
||||
./modules/machine/cloud/configuration.nix
|
||||
./modules/machine/cloud
|
||||
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
|
36
modules/apps/flatpak.nix
Normal file
36
modules/apps/flatpak.nix
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
flatpakPackages ? [],
|
||||
flatpakRemotes ? [],
|
||||
}: {
|
||||
services.flatpak = {
|
||||
enable = true;
|
||||
remotes =
|
||||
if flatpakRemotes == []
|
||||
then [
|
||||
{
|
||||
name = "flathub";
|
||||
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
|
||||
}
|
||||
]
|
||||
else flatpakRemotes;
|
||||
# packages = [
|
||||
# "com.github.tchx84.Flatseal"
|
||||
# "com.slack.Slack"
|
||||
# "info.beyondallreason.bar"
|
||||
# "io.dbeaver.DBeaverCommunity"
|
||||
# "io.openrct2.OpenRCT2"
|
||||
# "md.obsidian.Obsidian"
|
||||
# "org.prismlauncher.PrismLauncher"
|
||||
# "sh.cider.Cider"
|
||||
# ];
|
||||
packages = flatpakPackages;
|
||||
update = {
|
||||
auto = {
|
||||
enable = true;
|
||||
onCalendar = "weekly";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
42
modules/graphics/default.nix
Normal file
42
modules/graphics/default.nix
Normal file
@ -0,0 +1,42 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
nixosModules.gpuHardware = {gpuVendor ? null, ...}: {
|
||||
hardware.opengl = {
|
||||
# Always enable OpenGL support
|
||||
enable = true;
|
||||
|
||||
# Dynamically select packages based on GPU vendor
|
||||
extraPackages = with pkgs; (
|
||||
# Base packages that are always included
|
||||
[
|
||||
mesa
|
||||
libvdpau-va-gl
|
||||
libva
|
||||
libva-utils
|
||||
]
|
||||
# Vendor-specific packages
|
||||
++ (
|
||||
if gpuVendor == "intel"
|
||||
then [
|
||||
intel-vaapi-driver
|
||||
intel-media-driver
|
||||
]
|
||||
else if gpuVendor == "amd"
|
||||
then [
|
||||
rocm-opencl-icd
|
||||
]
|
||||
else if gpuVendor == "nvidia"
|
||||
then [
|
||||
# Add Nvidia-specific packages if needed
|
||||
nvidia-vaapi-driver
|
||||
]
|
||||
else []
|
||||
)
|
||||
);
|
||||
};
|
||||
};
|
||||
}
|
@ -1,8 +1,18 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
userName,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
../../apps/flatpak.nix
|
||||
../../sound/pipewire.nix
|
||||
../../sound/shairport.nix
|
||||
../../virtualization/podman.nix
|
||||
../../virtualization/hardware.nix
|
||||
(config.nixosModules.gpuHardware {gpuVendor = "amd";})
|
||||
];
|
||||
|
||||
# Enable flakes for NixOS
|
||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||
|
||||
@ -10,46 +20,12 @@
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
# Install and enable common graphics drivers
|
||||
hardware.opengl = {
|
||||
# driSupport = true;
|
||||
extraPackages = with pkgs; [
|
||||
mesa
|
||||
libvdpau-va-gl
|
||||
libva
|
||||
libva-utils
|
||||
intel-vaapi-driver # for Intel
|
||||
intel-media-driver # for Intel
|
||||
rocm-opencl-icd # for AMD
|
||||
];
|
||||
};
|
||||
|
||||
# For systems with AMD graphics, this enables Vulkan on 32-bit applications
|
||||
# For 64-bit application, however, Vulkan is enabled by default
|
||||
# hardware.graphics.driSupport32Bit = true;
|
||||
|
||||
# For systems with AMD graphics, enable AMDVLK
|
||||
#hardware.graphics = {
|
||||
# extraPackages = with pkgs; [
|
||||
# amdvlk
|
||||
# ];
|
||||
# extraPackages32 = with pkgs; [
|
||||
# driversi686Linux
|
||||
# ];
|
||||
#};
|
||||
|
||||
# Enable Bluetooth if present
|
||||
hardware.bluetooth.enable = true;
|
||||
|
||||
# Set your timezone
|
||||
time.timeZone = "America/Detroit";
|
||||
|
||||
# Enable Pipewire (sound)
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
# Enable touchpad
|
||||
services.libinput.enable = true;
|
||||
|
||||
@ -59,7 +35,6 @@
|
||||
neovim
|
||||
git
|
||||
wireguard-tools
|
||||
podman
|
||||
buildah
|
||||
podman-tui
|
||||
podman-compose
|
||||
@ -160,34 +135,6 @@
|
||||
networking.firewall.allowedUDPPorts = [];
|
||||
networking.networkmanager.enable = true; # Linux tool for managing network connections
|
||||
|
||||
# Enable Flatpak (app containerization)
|
||||
# services.flatpak.enable = true;
|
||||
services.flatpak = {
|
||||
enable = true;
|
||||
remotes = [
|
||||
{
|
||||
name = "flathub";
|
||||
location = "https://dl.flathub.org/repo/flathub.flatpakrepo";
|
||||
}
|
||||
];
|
||||
packages = [
|
||||
"com.github.tchx84.Flatseal"
|
||||
"com.slack.Slack"
|
||||
"info.beyondallreason.bar"
|
||||
"io.dbeaver.DBeaverCommunity"
|
||||
"io.openrct2.OpenRCT2"
|
||||
"md.obsidian.Obsidian"
|
||||
"org.prismlauncher.PrismLauncher"
|
||||
"sh.cider.Cider"
|
||||
];
|
||||
update = {
|
||||
auto = {
|
||||
enable = true;
|
||||
onCalendar = "weekly";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Enable Podman (OCI containers)
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
@ -195,12 +142,6 @@
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
|
||||
services.shairport-sync = {
|
||||
enable = pkgs.stdenv.isLinux;
|
||||
openFirewall = pkgs.stdenv.isLinux;
|
||||
arguments = "-v -o pw";
|
||||
};
|
||||
|
||||
# users.users."${userName}" = {
|
||||
# group = "${userName}";
|
||||
# isNormalUser = true;
|
||||
|
6
modules/machine/cloud/default.nix
Normal file
6
modules/machine/cloud/default.nix
Normal file
@ -0,0 +1,6 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./configuration.nix
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
}
|
@ -3,30 +3,22 @@
|
||||
hostname,
|
||||
...
|
||||
}: {
|
||||
imports = [
|
||||
../../virtualization/podman.nix
|
||||
];
|
||||
|
||||
system = {
|
||||
# activationScripts are executed every time you boot the system or run `nixos-rebuild` / `darwin-rebuild`.
|
||||
activationScripts.postUserActivation.text = ''
|
||||
# activateSettings -u will reload the settings from the database and apply them to the current session,
|
||||
# so we do not need to logout and login again to make the changes take effect.
|
||||
/System/Library/PrivateFrameworks/SystemAdministration.framework/Resources/activateSettings -u
|
||||
'';
|
||||
|
||||
defaults = {
|
||||
menuExtraClock.Show24Hour = true; # show 24 hour clock
|
||||
menuExtraClock.Show24Hour = true;
|
||||
|
||||
# customize dock
|
||||
dock = {
|
||||
autohide = true;
|
||||
# show-recents = false; # disable recent apps
|
||||
|
||||
# # customize Hot Corners
|
||||
# wvous-tl-corner = 2; # top-left - Mission Control
|
||||
# wvous-tr-corner = 13; # top-right - Lock Screen
|
||||
# wvous-bl-corner = 3; # bottom-left - Application Windows
|
||||
# wvous-br-corner = 4; # bottom-right - Desktop
|
||||
};
|
||||
|
||||
# # customize finder
|
||||
finder = {
|
||||
_FXShowPosixPathInTitle = true; # show full path in finder title
|
||||
AppleShowAllExtensions = true; # show all file extensions
|
||||
@ -36,7 +28,6 @@
|
||||
ShowStatusBar = true; # show status bar
|
||||
};
|
||||
|
||||
# # customize trackpad
|
||||
# trackpad = {
|
||||
# Clicking = true; # enable tap to click
|
||||
# TrackpadRightClick = true; # enable two finger right click
|
||||
|
6
modules/machine/sephiroth/default.nix
Normal file
6
modules/machine/sephiroth/default.nix
Normal file
@ -0,0 +1,6 @@
|
||||
{...}: {
|
||||
imports = [
|
||||
./apps.nix
|
||||
./configuration.nix
|
||||
];
|
||||
}
|
6
modules/sound/pipewire.nix
Normal file
6
modules/sound/pipewire.nix
Normal file
@ -0,0 +1,6 @@
|
||||
{...}: {
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
}
|
7
modules/sound/shairport.nix
Normal file
7
modules/sound/shairport.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{pkgs}: {
|
||||
services.shairport-sync = {
|
||||
enable = pkgs.stdenv.isLinux;
|
||||
openFirewall = pkgs.stdenv.isLinux;
|
||||
arguments = "-v -o pw";
|
||||
};
|
||||
}
|
6
modules/virtualization/docker.nix
Normal file
6
modules/virtualization/docker.nix
Normal file
@ -0,0 +1,6 @@
|
||||
{...}: {
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
enableOnBoot = true;
|
||||
};
|
||||
}
|
4
modules/virtualization/hardware.nix
Normal file
4
modules/virtualization/hardware.nix
Normal file
@ -0,0 +1,4 @@
|
||||
{...}: {
|
||||
virtualisation.libvirtd.enable = true;
|
||||
programs.virt-manager.enable = true;
|
||||
}
|
7
modules/virtualization/podman.nix
Normal file
7
modules/virtualization/podman.nix
Normal file
@ -0,0 +1,7 @@
|
||||
{...}: {
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerSocket.enable = true;
|
||||
defaultNetwork.settings.dns_enabled = true;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user