diff --git a/devices/hardware/mini-pc.nix b/devices/hardware/mini-pc.nix new file mode 100755 index 0000000..7fe4130 --- /dev/null +++ b/devices/hardware/mini-pc.nix @@ -0,0 +1,46 @@ +# 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 = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "uas" "usbhid" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems = { + "/" = { + device = "/dev/disk/by-uuid/5938c796-6ff5-49d9-a3a6-022b4c32beeb"; + fsType = "ext4"; + }; + "/boot" = { + device = "/dev/disk/by-uuid/61BF-3342"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/d89bccd2-0672-4855-9d87-40e2688cdec4"; } + ]; + + # 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.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.enp100s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp98s0.useDHCP = lib.mkDefault true; + + #nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/devices/laptop.nix b/devices/laptop.nix index a1aa224..d41be65 100755 --- a/devices/laptop.nix +++ b/devices/laptop.nix @@ -38,7 +38,7 @@ let "fmask=0007" "dmask=0007" "nofail" - "x-systemd.device-timeout=0" + #"x-systemd.device-timeout=0" ]; }; "${inputs.zeroq.dirs.vetymae-drive}" = { @@ -50,8 +50,8 @@ let "gid=1000" "fmask=0007" "dmask=0007" - #"nofail" - "x-systemd.device-timeout=0" + "nofail" + #"x-systemd.device-timeout=0" ]; }; "/mnt/beets/music" = { @@ -63,7 +63,7 @@ let "fmask=0077" "dmask=0077" "nofail" - "x-systemd.device-timeout=0" + #"x-systemd.device-timeout=0" ]; }; }; diff --git a/devices/mini-pc.nix b/devices/mini-pc.nix new file mode 100755 index 0000000..24c3194 --- /dev/null +++ b/devices/mini-pc.nix @@ -0,0 +1,165 @@ +{ + inputs, + ... +}@flakeContext: +let + nixosModule = + { + config, + lib, + pkgs, + ... + }: + { + imports = + with inputs; + [ + ./hardware/mini-pc.nix + ./hardware/logitech.nix + self.nixosModules.default + #nixos-hardware.nixosModules.asus-fa506ic + + self.nixosModules.software.wine + self.nixosModules.software.beets + self.nixosModules.desktop + self.homeConfigurations.main.nixosModule + self.homeConfigurations.root.nixosModule + ] + ++ builtins.attrValues inputs.self.nixosModules.extra.self; + + fileSystems = { + "${inputs.zeroq.dirs.therima-drive}" = { + device = "/dev/disk/by-uuid/C0A2DDEFA2DDEA44"; + fsType = "ntfs3"; + options = [ + "defaults" + "uid=1000" + "gid=1000" + "fmask=0007" + "dmask=0007" + "nofail" + #"x-systemd.device-timeout=0" + ]; + }; + "${inputs.zeroq.dirs.vetymae-drive}" = { + device = "/dev/disk/by-uuid/38D63C6ED63C2E8E"; + fsType = "ntfs3"; + options = [ + "defaults" + "uid=1000" + "gid=1000" + "fmask=0007" + "dmask=0007" + "nofail" + #"x-systemd.device-timeout=0" + ]; + }; + "/mnt/beets/music" = { + device = "/home/${inputs.zeroq.devices.admin}/Music"; # "${inputs.zeroq.dirs.vetymae-drive}/Users/User/Music" + options = [ + "bind" + #"uid=1000" + #"gid=1000" + "fmask=0077" + "dmask=0077" + "nofail" + #"x-systemd.device-timeout=0" + ]; + }; + }; + + boot = { + kernelPackages = lib.mkDefault pkgs.linuxPackages_xanmod_stable; + kernelParams = [ #"usbcore.autosuspend=-1" ]; + loader = { + systemd-boot.enable = lib.mkDefault true; + efi.canTouchEfiVariables = lib.mkDefault true; + }; + }; + + hardware = { + bluetooth.enable = true; + }; + + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + networking = { + hostName = "${inputs.zeroq.devices.laptop.hostname}"; + networkmanager.enable = true; + firewall.enable = false; + }; + + i18n = { + extraLocaleSettings = { + LC_ADDRESS = "ru_RU.UTF-8"; + LC_IDENTIFICATION = "ru_RU.UTF-8"; + LC_MEASUREMENT = "ru_RU.UTF-8"; + LC_MONETARY = "ru_RU.UTF-8"; + LC_NAME = "ru_RU.UTF-8"; + LC_NUMERIC = "ru_RU.UTF-8"; + LC_PAPER = "ru_RU.UTF-8"; + LC_TELEPHONE = "ru_RU.UTF-8"; + LC_TIME = "ru_RU.UTF-8"; + }; + }; + + services = { + xserver = { + videoDrivers = [ + "amdgpu" + #"nvidia" + ]; + }; + syncthing = { + enable = true; + systemService = true; + configDir = "${inputs.zeroq.dirs.user-storage}/Syncthing/${config.system.name}"; # ${inputs.zeroq.devices.laptop.hostname} + dataDir = "${inputs.zeroq.dirs.user-home}"; + group = "users"; + user = "${inputs.zeroq.devices.admin}"; + }; + pipewire = { + enable = lib.mkDefault true; + systemWide = true; + alsa.enable = false; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + extraConfig.pipewire = { + "99-default.conf" = { + "context.properties" = { + "default.clock.rate" = 96000; + "default.clock.allowed-rates" = [ + 44100 + 48000 + 96000 + ]; + "default.clock.quantum" = 1024; + "default.clock.min-quantum" = 256; + "default.clock.max-quantum" = 2048; + }; + }; + }; + }; + thermald.enable = true; + earlyoom.enable = true; + preload.enable = true; + }; + nixpkgs.config.pulseaudio = true; + + #services.power-profiles-daemon.enable = false; + + security = { + rtkit.enable = true; + }; + + system.stateVersion = "25.11"; + }; +in +inputs.nixpkgs.lib.nixosSystem { + modules = [ + nixosModule + inputs.sops-nix.nixosModules.sops + ]; + system = "x86_64-linux"; +} diff --git a/flake.nix b/flake.nix index 56bb8ba..5ffb530 100755 --- a/flake.nix +++ b/flake.nix @@ -86,7 +86,7 @@ in { nixosConfigurations = { - atoridu = import ./devices/laptop.nix flakeContext; # atoridu + atoridu = import ./devices/mini-pc.nix flakeContext; # atoridu lamet = import ./devices/mini-laptop.nix flakeContext; # lamet sapphira = import ./devices/server.nix flakeContext; # sapphira wsl = import ./devices/wsl.nix flakeContext; # wsl