diff --git a/hosts/bocchi/configuration.nix b/hosts/bocchi/configuration.nix index dd022a7..b6f60ba 100644 --- a/hosts/bocchi/configuration.nix +++ b/hosts/bocchi/configuration.nix @@ -2,7 +2,8 @@ { imports = [ - ./hardware-configuration.nix + ./disko.nix +# ./hardware-configuration.nix ]; networking.hostName = "bocchi"; diff --git a/hosts/bocchi/disko.nix b/hosts/bocchi/disko.nix new file mode 100644 index 0000000..3c56014 --- /dev/null +++ b/hosts/bocchi/disko.nix @@ -0,0 +1,78 @@ +{ ... }: + +{ + disko.devices = { + disk = { + main = { + type = "disk"; + device = "/dev/nvme0n1"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "1G"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ "umask=0077" ]; + }; + }; + root = { + size = "100%"; + content = { + type = "btrfs"; + extraArgs = [ "-f" ]; # Override existing partition + # Subvolumes must set a mountpoint in order to be mounted, + # unless their parent is mounted + subvolumes = { + # Subvolume name is different from mountpoint + "/root" = { + mountpoint = "/"; + }; + + # Subvolume name is the same as the mountpoint + "/home" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/home"; + }; + + "/nix" = { + mountOptions = [ + "compress=zstd" + "noatime" + ]; + mountpoint = "/nix"; + }; + + "/media" = { + mountOptions = [ "compress=zstd" ]; + mountpoint = "/media"; + }; + + "/media/shows" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/shows"; }; + "/media/movies" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/movies"; }; + "/media/music" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/music"; }; + "/media/books" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/books"; }; + "/media/repositories" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/repositories"; }; + "/media/torrents" = { mountOptions = [ "compress=zstd" ]; mountpoint = "/media/torrents"; }; + + # Subvolume for the swapfile + "/swap" = { + mountpoint = "/.swapvol"; + swap = { + swapfile.size = "20M"; + swapfile2.size = "20M"; + swapfile2.path = "rel-path"; + }; + }; + }; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/bocchi/hardware-configuration.nix b/hosts/bocchi/hardware-configuration.nix deleted file mode 100644 index b7f7214..0000000 --- a/hosts/bocchi/hardware-configuration.nix +++ /dev/null @@ -1,39 +0,0 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: - -{ - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; - - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" "wl" ]; - boot.extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; - - fileSystems."/" = - { device = "/dev/disk/by-uuid/ff0cbf64-8bff-46a3-9bb2-8e314fcfda94"; - fsType = "btrfs"; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/795C-AFC7"; - fsType = "vfat"; - options = [ "fmask=0022" "dmask=0022" ]; - }; - - swapDevices = [ ]; - - # 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 - # still possible to use this option, but it's recommended to use it in conjunction - # with explicit per-interface declarations with `networking.interfaces..useDHCP`. - networking.useDHCP = lib.mkDefault true; - # networking.interfaces.enp0s20u1.useDHCP = lib.mkDefault true; - # networking.interfaces.enp4s0f0.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; -} diff --git a/hosts/nijika/configuration.nix b/hosts/nijika/configuration.nix index 392e884..e80eda3 100644 --- a/hosts/nijika/configuration.nix +++ b/hosts/nijika/configuration.nix @@ -9,26 +9,19 @@ networking.hostName = "nijika"; - # enable vaapi on OS-level - nixpkgs.config.packageOverrides = pkgs: { - intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; }; - }; - - environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD"; # Same here - hardware.graphics = { - enable = true; - extraPackages = with pkgs; [ - intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD - libva-vdpau-driver # Previously vaapiVdpau - intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in) - # OpenCL support for intel CPUs before 12th gen - # see: https://github.com/NixOS/nixpkgs/issues/356535 - intel-compute-runtime-legacy1 - vpl-gpu-rt # QSV on 11th gen or newer - intel-media-sdk # QSV up to 11th gen - intel-ocl # OpenCL support - ]; - }; + hardware.graphics.enable = true; + environment.sessionVariables.LIBVA_DRIVER_NAME = "iHD"; + hardware.graphics.extraPackages = with pkgs; [ + intel-media-driver # For Broadwell (2014) or newer processors. LIBVA_DRIVER_NAME=iHD + libva-vdpau-driver # Previously vaapiVdpau + intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in) + # OpenCL support for intel CPUs before 12th gen + # see: https://github.com/NixOS/nixpkgs/issues/356535 +# intel-compute-runtime-legacy1 + vpl-gpu-rt # QSV on 11th gen or newer + intel-media-sdk # QSV up to 11th gen + intel-ocl # OpenCL support + ]; services.logind.lidSwitchExternalPower = "ignore"; }