From b813ad2f361b9f8f557042fc24996b90f6d04c98 Mon Sep 17 00:00:00 2001 From: tulg Date: Tue, 13 Jan 2026 00:11:24 +0300 Subject: [PATCH] hosts/beatrice, global/avahi --- flake.nix | 4 +- hardware-configuration.nix | 25 ++++++++++++ hosts/beatrice/configuration.nix | 49 +++++++++++++++++++++++ hosts/beatrice/disko.nix | 32 +++++++++++++++ hosts/beatrice/hardware-configuration.nix | 31 ++++++++++++++ modules/nixos/services.nix | 5 +++ 6 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 hardware-configuration.nix create mode 100644 hosts/beatrice/configuration.nix create mode 100644 hosts/beatrice/disko.nix create mode 100644 hosts/beatrice/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 774db3f..cde764b 100644 --- a/flake.nix +++ b/flake.nix @@ -101,11 +101,11 @@ ]; }; #placeholder - nixosConfigurations.phoenix = nixpkgs.lib.nixosSystem { + nixosConfigurations.beatrice = nixpkgs.lib.nixosSystem { inherit system; specialArgs = {inherit inputs;}; modules = [ - ./hosts/phoenix/configuration.nix + ./hosts/beatrice/configuration.nix home-manager.nixosModules.home-manager inputs.disko.nixosModules.disko stylix.nixosModules.stylix diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..7ceee89 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,25 @@ +# 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" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + # 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.enp0s31f6.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/beatrice/configuration.nix b/hosts/beatrice/configuration.nix new file mode 100644 index 0000000..9e7e864 --- /dev/null +++ b/hosts/beatrice/configuration.nix @@ -0,0 +1,49 @@ +# 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, + self, + ... +}: { + imports = [ + ./disko.nix + ./hardware-configuration.nix + ../../modules/nixos/networking/default.nix + ../../modules/nixos/virtualization/default.nix + ../../modules/nixos/common.nix + ../../modules/nixos/fonts.nix + ../../modules/nixos/services.nix + ../../modules/nixos/users/tulg.nix + ]; + + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "beatrice"; + + programs.hyprland = { + enable = true; + xwayland.enable = true; + }; + + powerManagement.powertop.enable = true; + services.upower.enable = true; + services = { + power-profiles-daemon.enable = true; + tlp = { + enable = false; + settings = { + CPU_BOOST_ON_AC = 1; + CPU_BOOST_ON_BAT = 0; + CPU_SCALING_GOVERNOR_ON_AC = "performance"; + CPU_SCALING_GOVERNOR_ON_BAT = "powersave"; + STOP_CHARGE_THRESH_BAT0 = 95; + }; + }; + }; + + system.stateVersion = "25.05"; # Did you read the comment? +} diff --git a/hosts/beatrice/disko.nix b/hosts/beatrice/disko.nix new file mode 100644 index 0000000..529c945 --- /dev/null +++ b/hosts/beatrice/disko.nix @@ -0,0 +1,32 @@ +{ + disko.devices = { + disk = { + nixos = { + type = "disk"; + device = "/dev/sda"; + content = { + type = "gpt"; + partitions = { + ESP = { + size = "512M"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + size = "100%"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/beatrice/hardware-configuration.nix b/hosts/beatrice/hardware-configuration.nix new file mode 100644 index 0000000..9bbb751 --- /dev/null +++ b/hosts/beatrice/hardware-configuration.nix @@ -0,0 +1,31 @@ +# 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" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; + + 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.enp0s31f6.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/modules/nixos/services.nix b/modules/nixos/services.nix index 8f94f10..fca7205 100644 --- a/modules/nixos/services.nix +++ b/modules/nixos/services.nix @@ -4,6 +4,11 @@ programs.thunar.enable = true; programs.xfconf.enable = true; services.displayManager.ly.enable = true; + services.avahi = { + # so host.local works + enable = true; + nssmdns4 = true; + }; programs.thunar.plugins = with pkgs.xfce; [ thunar-archive-plugin