Merge branch 'master' of git.bitlab21.com:sam/nixos
This commit is contained in:
commit
4b3aa6463e
|
@ -51,7 +51,7 @@ in {
|
||||||
../common/optional/fileserver/nfs-client/photos.nix
|
../common/optional/fileserver/nfs-client/photos.nix
|
||||||
../common/optional/fileserver/nfs-client/personal.nix
|
../common/optional/fileserver/nfs-client/personal.nix
|
||||||
|
|
||||||
../common/optional/printing.nix
|
# ../common/optional/printing.nix
|
||||||
../common/optional/backlight.nix
|
../common/optional/backlight.nix
|
||||||
../common/optional/xmodmap-arrow-remaps.nix
|
../common/optional/xmodmap-arrow-remaps.nix
|
||||||
../common/optional/nix-ld.nix
|
../common/optional/nix-ld.nix
|
||||||
|
|
|
@ -21,7 +21,6 @@ in {
|
||||||
extraGroups = [
|
extraGroups = [
|
||||||
"scanner"
|
"scanner"
|
||||||
"lp"
|
"lp"
|
||||||
"wheel"
|
|
||||||
];
|
];
|
||||||
|
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
|
@ -31,22 +30,9 @@ in {
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.persistence."/persist" = {
|
environment.persistence."/persist" = {
|
||||||
hideMounts = true;
|
directories = [
|
||||||
users.${username} = {
|
"/home/${username}"
|
||||||
directories = [
|
];
|
||||||
"Sync"
|
|
||||||
"Keep"
|
|
||||||
".ssh"
|
|
||||||
".config"
|
|
||||||
".mozilla"
|
|
||||||
".local"
|
|
||||||
".zotero"
|
|
||||||
".var"
|
|
||||||
".steam"
|
|
||||||
];
|
|
||||||
files = [
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
sops.secrets = {
|
sops.secrets = {
|
||||||
|
|
|
@ -55,6 +55,10 @@ in {
|
||||||
../common/optional/gaming.nix
|
../common/optional/gaming.nix
|
||||||
../common/optional/restic-backup.nix
|
../common/optional/restic-backup.nix
|
||||||
|
|
||||||
|
../common/optional/fileserver/nfs-client/media.nix
|
||||||
|
../common/optional/fileserver/nfs-client/photos.nix
|
||||||
|
../common/optional/fileserver/nfs-client/personal.nix
|
||||||
|
|
||||||
../common/optional/distributed-builds/local-machine.nix
|
../common/optional/distributed-builds/local-machine.nix
|
||||||
|
|
||||||
outputs.nixosModules.nixosAutoUpgrade
|
outputs.nixosModules.nixosAutoUpgrade
|
||||||
|
|
|
@ -1,35 +1,19 @@
|
||||||
{
|
{
|
||||||
inputs,
|
|
||||||
config,
|
|
||||||
lib,
|
lib,
|
||||||
configVars,
|
configVars,
|
||||||
outputs,
|
outputs,
|
||||||
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
# Disko setup
|
btrfsMountDevice = "/dev/root_vg/root";
|
||||||
fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence
|
merlinIp = configVars.networking.addresses.merlin.ip;
|
||||||
dev = "/dev/sda"; # depends on target hardware
|
|
||||||
encrypted = false; # currrently only applies to btrfs
|
|
||||||
btrfsMountDevice =
|
|
||||||
if encrypted
|
|
||||||
then "/dev/mapper/crypted"
|
|
||||||
else "/dev/root_vg/root";
|
|
||||||
impermanence = true;
|
|
||||||
piholeIp = configVars.networking.addresses.pihole.ip;
|
piholeIp = configVars.networking.addresses.pihole.ip;
|
||||||
gatewayIp = configVars.networking.addresses.gateway.ip;
|
gatewayIp = configVars.networking.addresses.gateway.ip;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
# Create users for this host
|
# Create users for this host
|
||||||
../common/users/media
|
../common/users/media
|
||||||
|
./hardware-configuration.nix
|
||||||
# Disk configuration
|
|
||||||
inputs.disko.nixosModules.disko
|
|
||||||
(import ../common/disks {
|
|
||||||
device = dev;
|
|
||||||
impermanence = impermanence;
|
|
||||||
fsType = fsType;
|
|
||||||
encrypted = encrypted;
|
|
||||||
})
|
|
||||||
|
|
||||||
# Impermanence
|
# Impermanence
|
||||||
(import ../common/disks/btrfs/impermanence.nix {
|
(import ../common/disks/btrfs/impermanence.nix {
|
||||||
|
@ -44,21 +28,12 @@ in {
|
||||||
# Import optional options
|
# Import optional options
|
||||||
../common/optional/openssh.nix
|
../common/optional/openssh.nix
|
||||||
../common/optional/persistence.nix
|
../common/optional/persistence.nix
|
||||||
# ../common/optional/fileserver/media.nix
|
../common/optional/fileserver/nfs-client/media.nix
|
||||||
../common/optional/gaming.nix
|
# ../common/optional/printing.nix
|
||||||
../common/optional/printing.nix
|
../common/optional/distributed-builds/local-machine.nix
|
||||||
outputs.nixosModules.nixosAutoUpgrade
|
outputs.nixosModules.nixosAutoUpgrade
|
||||||
];
|
];
|
||||||
|
|
||||||
boot = {
|
|
||||||
loader = {
|
|
||||||
systemd-boot.enable = true;
|
|
||||||
efi.canTouchEfiVariables = true;
|
|
||||||
timeout = 3;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
boot.kernelParams = ["i915.enable_psr=0"];
|
|
||||||
|
|
||||||
networking = {
|
networking = {
|
||||||
hostName = "sparky";
|
hostName = "sparky";
|
||||||
networkmanager.enable = true;
|
networkmanager.enable = true;
|
||||||
|
@ -66,30 +41,23 @@ in {
|
||||||
nameservers = ["${piholeIp}" "${gatewayIp}" "8.8.8.8"];
|
nameservers = ["${piholeIp}" "${gatewayIp}" "8.8.8.8"];
|
||||||
};
|
};
|
||||||
|
|
||||||
nixpkgs.config.allowUnfreePredicate = pkg:
|
|
||||||
builtins.elem (lib.getName pkg) [
|
|
||||||
# Add additional package names here
|
|
||||||
"nvidia-x11"
|
|
||||||
"nvidia-settings"
|
|
||||||
"nvidia-persistenced"
|
|
||||||
];
|
|
||||||
|
|
||||||
services.displayManager.defaultSession = "cinnamon";
|
services.displayManager.defaultSession = "cinnamon";
|
||||||
services.libinput.enable = true;
|
services.libinput.enable = true;
|
||||||
|
|
||||||
system.services.nixosAutoUpgrade = {
|
system.services.nixosAutoUpgrade = {
|
||||||
enable = true;
|
enable = true;
|
||||||
persistent = true;
|
persistent = true;
|
||||||
|
remote = "remotebuild@${merlinIp}";
|
||||||
reboot = false;
|
reboot = false;
|
||||||
pushUpdates = false;
|
pushUpdates = false;
|
||||||
configDir = "/etc/nixos";
|
configDir = "/etc/nixos";
|
||||||
onCalendar = "*-*-* 07:00:00";
|
onCalendar = "*-*-* 06:00:00";
|
||||||
user = "media";
|
user = "root";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
videoDrivers = ["nvidia"];
|
videoDrivers = ["modesetting"];
|
||||||
displayManager.lightdm.enable = true;
|
displayManager.lightdm.enable = true;
|
||||||
exportConfiguration = true;
|
exportConfiguration = true;
|
||||||
deviceSection = ''
|
deviceSection = ''
|
||||||
|
@ -99,19 +67,4 @@ in {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable OpenGL
|
|
||||||
hardware.opengl = {
|
|
||||||
enable = true;
|
|
||||||
driSupport32Bit = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
# Load nvidia driver
|
|
||||||
hardware.nvidia = {
|
|
||||||
# https://nixos.wiki/wiki/Nvidia
|
|
||||||
modesetting.enable = true;
|
|
||||||
powerManagement.enable = false;
|
|
||||||
open = false;
|
|
||||||
nvidiaSettings = true;
|
|
||||||
package = config.boot.kernelPackages.nvidiaPackages.stable;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,76 @@
|
||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
{ config, lib, pkgs, ... }:
|
||||||
# and may be overwritten by future invocations. Please make changes
|
|
||||||
# to /etc/nixos/configuration.nix instead.
|
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
{
|
||||||
imports =
|
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ];
|
||||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
|
||||||
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
boot.initrd.kernelModules = [ "dm-snapshot" ];
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
boot.kernelModules = [ ];
|
||||||
boot.extraModulePackages = [ ];
|
boot.extraModulePackages = [ ];
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
fileSystems."/" =
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
{ device = "/dev/disk/by-uuid/7e660e53-6c56-4679-ab25-3a2b1eacaebd";
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
fsType = "btrfs";
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
options = [ "subvol=root" ];
|
||||||
networking.useDHCP = lib.mkDefault true;
|
};
|
||||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
|
||||||
|
fileSystems."/persist" =
|
||||||
|
{ device = "/dev/disk/by-uuid/7e660e53-6c56-4679-ab25-3a2b1eacaebd";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=persist" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/nix" =
|
||||||
|
{ device = "/dev/disk/by-uuid/7e660e53-6c56-4679-ab25-3a2b1eacaebd";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=nix" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/.swapvol" =
|
||||||
|
{ device = "/dev/disk/by-uuid/7e660e53-6c56-4679-ab25-3a2b1eacaebd";
|
||||||
|
fsType = "btrfs";
|
||||||
|
options = [ "subvol=swap" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
fileSystems."/boot" =
|
||||||
|
{ device = "/dev/disk/by-uuid/3DC4-7CCE";
|
||||||
|
fsType = "vfat";
|
||||||
|
options = [ "fmask=0022" "dmask=0022" ];
|
||||||
|
};
|
||||||
|
|
||||||
|
swapDevices = [
|
||||||
|
{
|
||||||
|
device = "/.swapvol/swapfile";
|
||||||
|
size = 2 * 1024;
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
|
||||||
|
# Add hardware support for intel gpus as specified here: https://nixos.wiki/wiki/Jellyfin
|
||||||
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
|
vaapiIntel = pkgs.vaapiIntel.override {enableHybridCodec = true;};
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.graphics = {
|
||||||
|
enable = true;
|
||||||
|
extraPackages = with pkgs; [
|
||||||
|
intel-media-driver
|
||||||
|
intel-vaapi-driver
|
||||||
|
vaapiVdpau
|
||||||
|
libvdpau-va-gl
|
||||||
|
intel-compute-runtime
|
||||||
|
# only available on unstable
|
||||||
|
unstable.vpl-gpu-rt
|
||||||
|
intel-media-sdk
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
boot = {
|
||||||
|
loader = {
|
||||||
|
systemd-boot.enable = true;
|
||||||
|
efi.canTouchEfiVariables = true;
|
||||||
|
timeout = 3;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
boot.kernelParams = ["i915.enable_psr=0"];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue