chore: format using nixpkgs-fmt
This commit is contained in:
parent
8b0286d8d8
commit
87781f976a
26 changed files with 130 additions and 127 deletions
53
flake.nix
53
flake.nix
|
|
@ -9,35 +9,36 @@
|
||||||
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
|
nix-vscode-extensions.url = "github:nix-community/nix-vscode-extensions";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = inputs@{ self, nixpkgs, home-manager, ... }: let
|
outputs = inputs@{ self, nixpkgs, home-manager, ... }:
|
||||||
|
let
|
||||||
|
|
||||||
pkgs = system: import nixpkgs {
|
pkgs = system: import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [
|
overlays = [
|
||||||
inputs.nix-vscode-extensions.overlays.default
|
inputs.nix-vscode-extensions.overlays.default
|
||||||
];
|
|
||||||
config = {allowUnfree = true;};
|
|
||||||
};
|
|
||||||
|
|
||||||
in {
|
|
||||||
|
|
||||||
nixosConfigurations = {
|
|
||||||
|
|
||||||
fedfer-main-laptop-nixos = nixpkgs.lib.nixosSystem rec {
|
|
||||||
system = "x86_64-linux";
|
|
||||||
specialArgs = { pkgs = pkgs system; };
|
|
||||||
modules = [
|
|
||||||
./hosts/main-laptop/configuration.nix
|
|
||||||
home-manager.nixosModules.home-manager
|
|
||||||
{
|
|
||||||
home-manager.useGlobalPkgs = true;
|
|
||||||
home-manager.useUserPackages = false;
|
|
||||||
home-manager.users.fedfer = import ./hosts/main-laptop/home.nix;
|
|
||||||
home-manager.backupFileExtension = "backup";
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
config = { allowUnfree = true; };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
in
|
||||||
|
{
|
||||||
|
|
||||||
|
nixosConfigurations = {
|
||||||
|
fedfer-main-laptop-nixos = nixpkgs.lib.nixosSystem rec {
|
||||||
|
system = "x86_64-linux";
|
||||||
|
specialArgs = { pkgs = (pkgs system); };
|
||||||
|
modules = [
|
||||||
|
./hosts/main-laptop/configuration.nix
|
||||||
|
home-manager.nixosModules.home-manager
|
||||||
|
{
|
||||||
|
home-manager.useGlobalPkgs = true;
|
||||||
|
home-manager.useUserPackages = false;
|
||||||
|
home-manager.users.fedfer = import ./hosts/main-laptop/home.nix;
|
||||||
|
home-manager.backupFileExtension = "backup";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
{ config, pkgs, ... }: {
|
{ pkgs, ... }: {
|
||||||
|
|
||||||
boot.kernelPackages = pkgs.linuxPackages_latest;
|
boot.kernelPackages = pkgs.linuxPackages_latest;
|
||||||
boot.loader.systemd-boot.enable = true;
|
boot.loader.systemd-boot.enable = true;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
[
|
[
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../nixosModules/default.nix
|
../../nixosModules/default.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
settings = {
|
settings = {
|
||||||
programs.docker.enable = lib.mkForce true;
|
programs.docker.enable = lib.mkForce true;
|
||||||
|
|
@ -49,11 +49,11 @@
|
||||||
#todo need to move this to modules
|
#todo need to move this to modules
|
||||||
services = {
|
services = {
|
||||||
libinput = {
|
libinput = {
|
||||||
enable = true;
|
enable = true;
|
||||||
touchpad = {
|
touchpad = {
|
||||||
tapping = true;
|
tapping = true;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
#remove various bloat
|
#remove various bloat
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
[
|
||||||
|
(modulesPath + "/installer/scan/not-detected.nix")
|
||||||
];
|
];
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ];
|
boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "usbhid" "usb_storage" "sd_mod" ];
|
||||||
|
|
@ -14,18 +15,19 @@
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
fileSystems."/" =
|
fileSystems."/" =
|
||||||
{ device = "/dev/disk/by-label/nixos";
|
{
|
||||||
|
device = "/dev/disk/by-label/nixos";
|
||||||
fsType = "ext4";
|
fsType = "ext4";
|
||||||
};
|
};
|
||||||
|
|
||||||
fileSystems."/boot" =
|
fileSystems."/boot" =
|
||||||
{ device = "/dev/disk/by-label/BOOT";
|
{
|
||||||
|
device = "/dev/disk/by-label/BOOT";
|
||||||
fsType = "vfat";
|
fsType = "vfat";
|
||||||
};
|
};
|
||||||
|
|
||||||
swapDevices =
|
swapDevices =
|
||||||
[ { device = "/dev/disk/by-label/swap"; }
|
[{ device = "/dev/disk/by-label/swap"; }];
|
||||||
];
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
# 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
|
# (the default) this is the recommended approach. When using systemd-networkd it's
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
{ lib, config, ... }: {
|
{ lib, config, ... }: {
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
settings.drivers.gpu.amd.enable = lib.mkEnableOption "enable AMD gpu drivers";
|
settings.drivers.gpu.amd.enable = lib.mkEnableOption "enable AMD gpu drivers";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.settings.drivers.gpu.amd.enable {
|
config = lib.mkIf config.settings.drivers.gpu.amd.enable {
|
||||||
boot.initrd.kernelModules = [ "amdgpu" ];
|
boot.initrd.kernelModules = [ "amdgpu" ];
|
||||||
services.xserver.videoDrivers = [ "amdgpu" ];
|
services.xserver.videoDrivers = [ "amdgpu" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,24 @@
|
||||||
{ lib, config, ... }: {
|
{ lib, config, ... }: {
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
settings.drivers.gpu.nvidia.forceDisable = lib.mkEnableOption "force disable all nvidia drivers";
|
settings.drivers.gpu.nvidia.forceDisable = lib.mkEnableOption "force disable all nvidia drivers";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.settings.drivers.gpu.nvidia.forceDisable {
|
config = lib.mkIf config.settings.drivers.gpu.nvidia.forceDisable {
|
||||||
boot.extraModprobeConfig = ''
|
boot.extraModprobeConfig = ''
|
||||||
blacklist nouveau
|
blacklist nouveau
|
||||||
options nouveau modeset=0
|
options nouveau modeset=0
|
||||||
'';
|
'';
|
||||||
services.udev.extraRules = ''
|
services.udev.extraRules = ''
|
||||||
# Remove NVIDIA USB xHCI Host Controller devices, if present
|
# Remove NVIDIA USB xHCI Host Controller devices, if present
|
||||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
|
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
|
||||||
# Remove NVIDIA USB Type-C UCSI devices, if present
|
# Remove NVIDIA USB Type-C UCSI devices, if present
|
||||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
|
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
|
||||||
# Remove NVIDIA Audio devices, if present
|
# Remove NVIDIA Audio devices, if present
|
||||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
|
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
|
||||||
# Remove NVIDIA VGA/3D controller devices
|
# Remove NVIDIA VGA/3D controller devices
|
||||||
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
|
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
|
||||||
'';
|
'';
|
||||||
boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_uvm" "nvidiafb" "nvidia_drm" "nvidia_modeset" ];
|
boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_uvm" "nvidiafb" "nvidia_drm" "nvidia_modeset" ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,25 @@
|
||||||
{ lib, config, ... }: {
|
{ lib, config, ... }: {
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
settings.drivers.gpu.nvidia.enable = lib.mkEnableOption "Enable Nvidia proprietary drivers";
|
settings.drivers.gpu.nvidia.enable = lib.mkEnableOption "Enable Nvidia proprietary drivers";
|
||||||
settings.drivers.gpu.nvidia.offload = lib.mkEnableOption "Enable prime offloading";
|
settings.drivers.gpu.nvidia.offload = lib.mkEnableOption "Enable prime offloading";
|
||||||
settings.drivers.gpu.nvidia.sync = lib.mkEnableOption "Enable prime sync";
|
settings.drivers.gpu.nvidia.sync = lib.mkEnableOption "Enable prime sync";
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf config.settings.drivers.gpu.nvidia.enable {
|
config = lib.mkIf config.settings.drivers.gpu.nvidia.enable {
|
||||||
services.xserver.videoDrivers = [ "nvidia" ];
|
services.xserver.videoDrivers = [ "nvidia" ];
|
||||||
hardware.nvidia = {
|
hardware.nvidia = {
|
||||||
modesetting.enable = true;
|
modesetting.enable = true;
|
||||||
prime = {
|
prime = {
|
||||||
nvidiaBusId = "pci:1:0:0";
|
nvidiaBusId = "pci:1:0:0";
|
||||||
amdgpuBusId = "pci:5:0:0";
|
amdgpuBusId = "pci:5:0:0";
|
||||||
};
|
};
|
||||||
prime.offload = lib.mkIf config.settings.drivers.gpu.nvidia.offload {
|
prime.offload = lib.mkIf config.settings.drivers.gpu.nvidia.offload {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableOffloadCmd = true;
|
enableOffloadCmd = true;
|
||||||
};
|
};
|
||||||
prime.sync.enable = lib.mkIf config.settings.drivers.gpu.nvidia.sync true;
|
prime.sync.enable = lib.mkIf config.settings.drivers.gpu.nvidia.sync true;
|
||||||
nvidiaSettings = true;
|
nvidiaSettings = true;
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -1,26 +1,26 @@
|
||||||
{ config, lib, pkgs, ... }: {
|
{ config, lib, pkgs, ... }: {
|
||||||
options = {
|
options = {
|
||||||
settings.gnome.enable = lib.mkEnableOption "enable gnome de";
|
settings.gnome.enable = lib.mkEnableOption "enable gnome de";
|
||||||
};
|
};
|
||||||
|
|
||||||
#todo make this more configurable
|
#todo make this more configurable
|
||||||
config = lib.mkIf config.settings.gnome.enable {
|
config = lib.mkIf config.settings.gnome.enable {
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
displayManager.gdm.enable = true;
|
displayManager.gdm.enable = true;
|
||||||
desktopManager.gnome.enable = true;
|
desktopManager.gnome.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.gnome.gnome-tweaks ];
|
environment.systemPackages = [ pkgs.gnome.gnome-tweaks ];
|
||||||
|
|
||||||
#enable browser connector for installing extensions
|
#enable browser connector for installing extensions
|
||||||
services.gnome.gnome-browser-connector.enable = true;
|
services.gnome.gnome-browser-connector.enable = true;
|
||||||
|
|
||||||
# Gnome enables pulse by default smh
|
# Gnome enables pulse by default smh
|
||||||
# make sure to have PIPEWIRE enabled!
|
# make sure to have PIPEWIRE enabled!
|
||||||
hardware.pulseaudio.enable = false;
|
hardware.pulseaudio.enable = false;
|
||||||
|
|
||||||
# remove various bloat
|
# remove various bloat
|
||||||
environment.gnome.excludePackages = with pkgs.gnome; [ epiphany gnome-contacts gnome-maps gnome-music gnome-weather totem yelp pkgs.gnome-tour ];
|
environment.gnome.excludePackages = with pkgs.gnome; [ epiphany gnome-contacts gnome-maps gnome-music gnome-weather totem yelp pkgs.gnome-tour ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue