Unified home and system modules!
This commit is contained in:
46
hosts/kopavogur/default.nix
Normal file
46
hosts/kopavogur/default.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
];
|
||||
|
||||
# - Basic --------------------------------------
|
||||
|
||||
user.name = "marc";
|
||||
user.shell = pkgs.zsh;
|
||||
networking.hostName = "kopavogur";
|
||||
|
||||
# - Bootloader ---------------------------------
|
||||
|
||||
boot.loader.grub.enable = true;
|
||||
boot.loader.grub.device = "/dev/sda";
|
||||
boot.loader.grub.useOSProber = true;
|
||||
|
||||
# - Modules ------------------------------------
|
||||
|
||||
samfelag.modules = {
|
||||
# - Common -----------------------------------
|
||||
# See modules/common.nix for common packages installed
|
||||
|
||||
# - System -----------------------------------
|
||||
|
||||
# - Desktop ----------------------------------
|
||||
desktop = {
|
||||
enable = true;
|
||||
laptop = true;
|
||||
|
||||
};
|
||||
|
||||
# - Editors and development ------------------
|
||||
editors.emacs.enable = true;
|
||||
|
||||
dev.git.userName = "marc";
|
||||
dev.git.userEmail = "marc@sastre.cat";
|
||||
|
||||
# - Other apps -------------------------------
|
||||
app.spotify.enable = true;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
40
hosts/kopavogur/hardware.nix
Normal file
40
hosts/kopavogur/hardware.nix
Normal file
@@ -0,0 +1,40 @@
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot = {
|
||||
initrd = {
|
||||
availableKernelModules = [ "uhci_hcd" "ehci_pci" "ata_piix" "ahci" "xhci_pci" "pata_jmicron" "firewire_ohci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
|
||||
kernelModules = [ ];
|
||||
};
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
extraModulePackages = [ config.boot.kernelPackages.rtl88xxau-aircrack ];
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-label/BOOT";
|
||||
fsType = "vfat";
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-label/swap"; }
|
||||
];
|
||||
|
||||
networking = {
|
||||
useDHCP = lib.mkDefault true;
|
||||
interfaces = {
|
||||
enp7s0.useDHCP = lib.mkDefault true;
|
||||
wlp0s26f7u2.useDHCP = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
2
hosts/kopavogur/readme.org
Normal file
2
hosts/kopavogur/readme.org
Normal file
@@ -0,0 +1,2 @@
|
||||
* Kopavogur
|
||||
Ordinador (torre) de l'Ajuntament
|
||||
50
hosts/reykjavik/default.nix
Normal file
50
hosts/reykjavik/default.nix
Normal file
@@ -0,0 +1,50 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware.nix
|
||||
./nvidia.nix
|
||||
];
|
||||
|
||||
# - Basic --------------------------------------
|
||||
|
||||
user.name = "marc";
|
||||
user.shell = pkgs.zsh;
|
||||
networking.hostName = "reykjavik";
|
||||
|
||||
# - Bootloader ---------------------------------
|
||||
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
|
||||
# - Modules ------------------------------------
|
||||
|
||||
samfelag.modules = {
|
||||
# - Common -----------------------------------
|
||||
# See modules/common.nix for common packages installed
|
||||
|
||||
# - System -----------------------------------
|
||||
system.bluetooth.enable = true;
|
||||
|
||||
# - Desktop ----------------------------------
|
||||
desktop = {
|
||||
enable = true;
|
||||
laptop = true;
|
||||
|
||||
};
|
||||
|
||||
# - Editors and development ------------------
|
||||
editors.emacs.enable = true;
|
||||
|
||||
dev.git.userName = "marc";
|
||||
dev.git.userEmail = "marc@sastre.cat";
|
||||
|
||||
# - Other apps -------------------------------
|
||||
app.spotify.enable = true;
|
||||
|
||||
# - Gaming -----------------------------------
|
||||
gaming.lutris.enable = true;
|
||||
gaming.steam.enable = true;
|
||||
app.discord.enable = true;
|
||||
};
|
||||
|
||||
}
|
||||
41
hosts/reykjavik/hardware.nix
Normal file
41
hosts/reykjavik/hardware.nix
Normal file
@@ -0,0 +1,41 @@
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
boot = {
|
||||
initrd = {
|
||||
availableKernelModules = [ "xhci_pci" "thunderbolt" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
|
||||
kernelModules = [ ];
|
||||
};
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
extraModulePackages = [ ];
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-label/nixos";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-label/BOOT";
|
||||
fsType = "vfat";
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-label/swap"; }
|
||||
];
|
||||
|
||||
networking = {
|
||||
useDHCP = lib.mkDefault true;
|
||||
interfaces = {
|
||||
enp92s0.useDHCP = lib.mkDefault true;
|
||||
wlp0s20f3.useDHCP = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
29
hosts/reykjavik/nvidia.nix
Normal file
29
hosts/reykjavik/nvidia.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
nvidia-offload = pkgs.writeShellScriptBin "nvidia-offload" ''
|
||||
export __NV_PRIME_RENDER_OFFLOAD=1
|
||||
export __NV_PRIME_RENDER_OFFLOAD_PROVIDER=NVIDIA-G0
|
||||
export __GLX_VENDOR_LIBRARY_NAME=nvidia
|
||||
export __VK_LAYER_NV_optimus=NVIDIA_only
|
||||
exec "$@"
|
||||
'';
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [ nvidia-offload ];
|
||||
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.opengl.enable = true;
|
||||
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
|
||||
|
||||
hardware.nvidia.prime = {
|
||||
offload.enable = true;
|
||||
|
||||
# Bus ID of the Intel GPU. You can find it using lspci, either under 3D or VGA
|
||||
intelBusId = "PCI:0:2:0";
|
||||
|
||||
# Bus ID of the NVIDIA GPU. You can find it using lspci, either under 3D or VGA
|
||||
nvidiaBusId = "PCI:1:0:0";
|
||||
};
|
||||
}
|
||||
2
hosts/reykjavik/readme.org
Normal file
2
hosts/reykjavik/readme.org
Normal file
@@ -0,0 +1,2 @@
|
||||
* Reykjavik
|
||||
Portàtil Lenovo Legion 5 15ITH6H
|
||||
Reference in New Issue
Block a user