move more stuff

This commit is contained in:
mjallen18
2024-02-28 21:15:55 -06:00
parent 33c0b054d6
commit 31dd4950b1
16 changed files with 287 additions and 203 deletions

View File

@@ -32,7 +32,7 @@
# kde.nixosModules.plasma6 # kde.nixosModules.plasma6
nix-flatpak.nixosModules.nix-flatpak nix-flatpak.nixosModules.nix-flatpak
./hosts/desktop/configuration.nix ./hosts/desktop/configuration.nix
./hosts/desktop/impermanence.nix ./share/impermanence
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
{ {
home-manager.useGlobalPkgs = true; home-manager.useGlobalPkgs = true;

View File

@@ -6,6 +6,7 @@ in
imports = imports =
[ [
../modules ../modules
../share
]; ];
# Enable nix flakes and nix-command tools # Enable nix flakes and nix-command tools

View File

@@ -26,6 +26,12 @@ in
../default.nix ../default.nix
]; ];
share.hardware.amd = {
enable = true;
corectrl.enable = true;
corectrl.enablePolkit = true;
};
# Configure bootloader with lanzaboot and secureboot # Configure bootloader with lanzaboot and secureboot
boot = { boot = {
loader = { loader = {
@@ -54,7 +60,7 @@ in
kernelPackages = pkgs.linuxPackages_latest; kernelPackages = pkgs.linuxPackages_latest;
kernelParams = [ kernelParams = [
"quiet" "amdgpu.ppfeaturemask=0xffffffff" "quiet"
]; ];
consoleLogLevel = 3; consoleLogLevel = 3;
@@ -72,9 +78,9 @@ in
# Steam udev rules for remote play # Steam udev rules for remote play
steam-hardware.enable = true; steam-hardware.enable = true;
opengl.enable = true; # opengl.enable = true;
# Enables support for 32bit libs that steam uses # # Enables support for 32bit libs that steam uses
opengl.driSupport32Bit = true; # opengl.driSupport32Bit = true;
}; };
# Services configs # Services configs
@@ -112,25 +118,25 @@ in
]; ];
}; };
systemd.services.fix-wifi = { # systemd.services.fix-wifi = {
path = [ pkgs.bash ]; # path = [ pkgs.bash ];
script = '' # script = ''
sleep 5 # sleep 5
if ping -q -c1 10.0.1.1 &>/dev/null; then # if ping -q -c1 10.0.1.1 &>/dev/null; then
echo "No need to fix wifi" # echo "No need to fix wifi"
else # else
echo 1 | tee /sys/bus/pci/devices/0000\:09\:00.0/reset # echo 1 | tee /sys/bus/pci/devices/0000\:09\:00.0/reset
rmmod iwlwifi # rmmod iwlwifi
modprobe iwlwifi # modprobe iwlwifi
fi # fi
''; # '';
wantedBy = [ "multi-user.target" ]; # wantedBy = [ "multi-user.target" ];
after = [ "NetworkManager.target" ]; # after = [ "NetworkManager.target" ];
serviceConfig = { # serviceConfig = {
Type="oneshot"; # Type="oneshot";
RemainAfterExit=true; # RemainAfterExit=true;
}; # };
}; # };
# Networking configs # Networking configs
networking = { networking = {
@@ -177,22 +183,6 @@ in
groups = [ "wheel" ]; groups = [ "wheel" ];
}]; }];
}; };
# Configure polkit
polkit = {
enable = true;
extraConfig = ''
polkit.addRule(function(action, subject) {
if ((action.id == "org.corectrl.helper.init" ||
action.id == "org.corectrl.helperkiller.init") &&
subject.local == true &&
subject.active == true &&
subject.isInGroup("wheel")) {
return polkit.Result.YES;
}
});
'';
};
}; };
# Configure environment # Configure environment
@@ -205,7 +195,6 @@ in
nano nano
os-prober os-prober
efibootmgr efibootmgr
git
sbctl sbctl
gparted gparted
discover-wrapped discover-wrapped
@@ -218,26 +207,13 @@ in
aspellDicts.en-science aspellDicts.en-science
aha aha
clinfo clinfo
neofetch
gamescope
gamescope-wsi
mangohud
goverlay
heroic
python3
virt-manager
orca-slicer
]; ];
# Force radv
# variables.AMD_VULKAN_ICD = "RADV";
}; };
# Configure programs # Configure programs
programs = { programs = {
fish.enable = true; fish.enable = true;
java.enable = true; java.enable = true;
# corectrl.enable = true;
# Steam # Steam
steam = { steam = {
@@ -282,14 +258,6 @@ in
isNormalUser = true; isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ]; # Enable sudo for the user. extraGroups = [ "wheel" "networkmanager" ]; # Enable sudo for the user.
shell = pkgs.fish; shell = pkgs.fish;
packages = with pkgs; [
firefox
tree
lm_sensors
vmware-horizon-client
etcher
freerdp
];
}; };
# This option defines the first version of NixOS you have installed on this particular machine, # This option defines the first version of NixOS you have installed on this particular machine,

View File

@@ -16,10 +16,40 @@ in
enable = true; enable = true;
userName = "mjallen18"; userName = "mjallen18";
userEmail = "matt.l.jallen@gmail.com"; userEmail = "matt.l.jallen@gmail.com";
aliases = {
co = "checkout";
ci = "commit";
cia = "commit --amend";
s = "status";
st = "status";
b = "branch";
# p = "pull --rebase";
pu = "push";
};
}; };
home.packages = [ programs.command-not-found.enable = true;
home.packages = with pkgs; [
firefox
tree
lm_sensors
vmware-horizon-client
etcher
freerdp
neofetch
gamescope
gamescope-wsi
mangohud
goverlay
heroic
python3
virt-manager
orca-slicer
# Other packages # Other packages
vulkan-hdr-layer vulkan-hdr-layer
]; ];
# Garbage collect automatically every week
nix.gc.automatic = true;
} }

View File

@@ -1,21 +0,0 @@
{ pkgs, lib, LT, config, utils, inputs, ... }@args:
{
# Set up impernance configuration for things like bluetooth
# In this configuration with /etc and /var/log being persistent, only directories outside of that need to be done here. See hardware configuration for all mountpoints.
environment.persistence."/nix/persist/system" = {
hideMounts = true;
directories = [
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
"/etc/secureboot"
{ directory = "/var/lib/colord"; user = "colord"; group = "colord"; mode = "u=rwx,g=rx,o="; }
];
files = [
{ file = "/etc/nix/id_rsa"; parentDirectory = { mode = "u=rwx,g=,o="; }; }
];
};
}

View File

@@ -110,7 +110,12 @@ in
]; ];
}; };
share.hardware.nvidia = {
enable = true;
enableBeta = true;
nvidiaSettings = true;
enableNvidiaDocker = true;
}
# Configure bootloader with lanzaboot and secureboot # Configure bootloader with lanzaboot and secureboot
boot = { boot = {
@@ -142,43 +147,43 @@ in
zfs.requestEncryptionCredentials = false; zfs.requestEncryptionCredentials = false;
}; };
# Hardware configs # # Hardware configs
hardware = { # hardware = {
# Nvidia # # Nvidia
nvidia = { # nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.beta; # package = config.boot.kernelPackages.nvidiaPackages.beta;
# Modesetting is required. # # Modesetting is required.
modesetting.enable = true; # modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail. # # Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false; # powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use. # # Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer). # # Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false; # powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the # # Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver). # # independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of # # Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at: # # supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus # # https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+ # # Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting. # # Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false; # open = false;
# Enable the Nvidia settings menu, # # Enable the Nvidia settings menu,
# accessible via `nvidia-settings`. # # accessible via `nvidia-settings`.
nvidiaSettings = true; # nvidiaSettings = true;
}; # };
# Enable OpenGL # # Enable OpenGL
opengl = { # opengl = {
enable = true; # enable = true;
driSupport = true; # driSupport = true;
driSupport32Bit = true; # driSupport32Bit = true;
}; # };
}; # };
# Services configs # Services configs
services = { services = {
@@ -186,8 +191,8 @@ in
xserver = { xserver = {
enable = true; enable = true;
# Load nvidia driver for Xorg and Wayland # # Load nvidia driver for Xorg and Wayland
videoDrivers = ["nvidia"]; # videoDrivers = ["nvidia"];
# Enable the Plasma 6 Desktop Environment. # Enable the Plasma 6 Desktop Environment.
displayManager = { displayManager = {
@@ -338,6 +343,8 @@ in
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCw9zq8DLGByI5v2gAn95hKNyOsm3g61a2bu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ubUkiOgP+H3UbT2V/nTv/TFKdJcKw+WmizvTrxBmaMjWALlkYl+s= mattl@Jallen-PC"
# desktop nixos
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPTBMydhOc6SnOdB5WrEd7X07DrboAtagCUgXiOJjLov matt@matt-nixos"
]; ];
packages = with pkgs; [ packages = with pkgs; [
neofetch neofetch
@@ -367,7 +374,7 @@ in
virtualisation = { virtualisation = {
docker = { docker = {
enable = true; enable = true;
enableNvidia = true; # enableNvidia = true;
enableOnBoot = true; enableOnBoot = true;
}; };

View File

@@ -1,25 +0,0 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.hardware.gpu.amd;
in {
kernelParams = [ "amdgpu.ppfeaturemask=0xffffffff" ];
# Configure programs
programs = { corectrl.enable };
# Configure environment
environment = {
# Force radv
variables.AMD_VULKAN_ICD = "RADV";
};
# Hardware configs
hardware = {
# Enable OpenGL
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
};
}

View File

@@ -1,9 +0,0 @@
{ lib, ... }:
with lib;
{
options.hardware.gpu.amd = {
enable = mkEnableOption "amd hardware config";
};
}

View File

@@ -1,42 +0,0 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.hardware.gpu.nvidia;
in {
hardware = {
# Nvidia
nvidia = {
package = config.boot.kernelPackages.nvidiaPackages.beta;
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
};
# Enable OpenGL
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
};
}

View File

@@ -1,8 +0,0 @@
{ lib, ... }:
with lib;
{
options.hardware.gpu.nvidia = {
enable = mkEnableOption "nvidia hardware config";
};
}

48
share/amd/default.nix Normal file
View File

@@ -0,0 +1,48 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.share.hardware.amd;
in {
imports = [
./options.nix
];
config = mkIf cfg.enable {
boot.kernelParams = [ (if cfg.corectrl.enable then "amdgpu.ppfeaturemask=0xffffffff" else "") ];
# Configure programs
programs.corectrl.enable = cfg.corectrl.enable;
# Configure environment
environment = {
# Force radv
variables.AMD_VULKAN_ICD = "RADV";
};
# Hardware configs
hardware = {
# Enable OpenGL
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
};
# Configure polkit
security.polkit = {
enable = cfg.corectrl.enablePolkit;
extraConfig = ''
polkit.addRule(function(action, subject) {
if ((action.id == "org.corectrl.helper.init" ||
action.id == "org.corectrl.helperkiller.init") &&
subject.local == true &&
subject.active == true &&
subject.isInGroup("${cfg.corectrl.polkitGroup}")) {
return polkit.Result.YES;
}
});
'';
};
};
}

22
share/amd/options.nix Normal file
View File

@@ -0,0 +1,22 @@
{ lib, ... }:
with lib;
{
options.share.hardware.amd = {
enable = mkEnableOption "amd hardware config";
corectrl.enable = mkOption {
type = types.bool;
default = false;
};
corectrl.enablePolkit = mkOption {
type = types.bool;
default = false;
};
corectrl.polkitGroup = mkOption {
type = types.str;
default = "wheel";
};
};
}

7
share/default.nix Normal file
View File

@@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./amd
./nvidia
];
}

View File

@@ -0,0 +1,20 @@
{ pkgs, lib, LT, config, utils, inputs, ... }@args:
{
# Set up impernance configuration for things like bluetooth
# In this configuration with /etc and /var/log being persistent, only directories outside of that need to be done here. See hardware configuration for all mountpoints.
environment.persistence."/nix/persist/system" = {
hideMounts = true;
directories = [
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
"/etc/secureboot"
{ directory = "/var/lib/colord"; user = "colord"; group = "colord"; mode = "u=rwx,g=rx,o="; }
];
files = [
{ file = "/etc/nix/id_rsa"; parentDirectory = { mode = "u=rwx,g=,o="; }; }
];
};
}

59
share/nvidia/default.nix Normal file
View File

@@ -0,0 +1,59 @@
{ lib, pkgs, config, ... }:
with lib;
let
cfg = config.share.hardware.nvidia;
in {
imports = [
./options.nix
];
config = mkIf cfg.enable {
hardware = {
# Nvidia
nvidia = {
package = if cfg.enableBeta then config.boot.kernelPackages.nvidiaPackages.beta else config.boot.kernelPackages.nvidiaPackages.latest;
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = cfg.enableOpen;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = cfg.nvidiaSettings;
};
# Enable OpenGL
opengl = {
enable = true;
driSupport = true;
driSupport32Bit = true;
};
};
# Services configs
services.xserver = {
# Load nvidia driver for Xorg and Wayland
videoDrivers = ["nvidia"];
};
# Virtualisation
virtualisation.docker.enableNvidia = cfg.enableNvidiaDocker;
};
}

27
share/nvidia/options.nix Normal file
View File

@@ -0,0 +1,27 @@
{ lib, ... }:
with lib;
{
options.share.hardware.nvidia = {
enable = mkEnableOption "nvidia hardware config";
enableOpen = mkOption {
type = types.bool;
default = false;
};
nvidiaSettings = mkOption {
type = types.bool;
default = false;
};
enableBeta = mkOption {
type = types.bool;
default = false;
};
enableNvidiaDocker = mkOption {
type = types.bool;
default = false;
};
};
}