From 2332e9f2a382c4bb01c5f44cb28aba05b773b7bb Mon Sep 17 00:00:00 2001 From: k3t Date: Mon, 15 Jun 2026 07:52:21 -0600 Subject: [PATCH] introduce IdeaPad to nix flake --- hosts/IdeaPad/configuration.nix | 19 ++++++++++++++ hosts/IdeaPad/hardware-configuration.nix | 33 ++++++++++++++++++++++++ modules/net/services/printing.nix | 9 +++++-- modules/sys/hw/boot.nix | 2 +- 4 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 hosts/IdeaPad/configuration.nix create mode 100644 hosts/IdeaPad/hardware-configuration.nix diff --git a/hosts/IdeaPad/configuration.nix b/hosts/IdeaPad/configuration.nix new file mode 100644 index 0000000..ff91184 --- /dev/null +++ b/hosts/IdeaPad/configuration.nix @@ -0,0 +1,19 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). + +{ config, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + networking.hostName = "IdeaPad"; + + #users.users.k3t = { + # packages = with pkgs; [ + # ]; + #}; +} diff --git a/hosts/IdeaPad/hardware-configuration.nix b/hosts/IdeaPad/hardware-configuration.nix new file mode 100644 index 0000000..548ea66 --- /dev/null +++ b/hosts/IdeaPad/hardware-configuration.nix @@ -0,0 +1,33 @@ +# 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" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-label/NixOS"; + fsType = "btrfs"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-label/EFI"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-label/Swap"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/net/services/printing.nix b/modules/net/services/printing.nix index 0b218a8..0a07cf7 100644 --- a/modules/net/services/printing.nix +++ b/modules/net/services/printing.nix @@ -10,12 +10,17 @@ cups-pdf-to-pdf gutenprint-bin canon-cups-ufr2 + cnijfilter2 ]; }; hardware.sane = { enable = true; - extraBackends = [ pkgs.sane-airscan pkgs.sane-pixma ]; + extraBackends = [ pkgs.sane-airscan pkgs.cnijfilter2 pkgs.sane-backends ]; }; - services.udev.packages = [ pkgs.sane-airscan pkgs.sane-pixma ]; + services.udev.packages = [ pkgs.sane-airscan pkgs.cnijfilter2 pkgs.sane-backends ]; services.ipp-usb.enable=true; + environment.systemPackages = with pkgs; [ + kdePackages.skanlite + sane-frontends + ]; } \ No newline at end of file diff --git a/modules/sys/hw/boot.nix b/modules/sys/hw/boot.nix index f18d385..c98896b 100644 --- a/modules/sys/hw/boot.nix +++ b/modules/sys/hw/boot.nix @@ -9,6 +9,6 @@ boot.loader.limine.enable = true; boot.loader.efi.canTouchEfiVariables = true; boot.extraModulePackages = [ ]; - boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" "v4l2loopback" "i915" "amdgpu" ]; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" "sr_mod" "i915" "amdgpu" ]; boot.kernelModules = [ "v4l2loopback" ]; }