From 6598510ac855ebf140550e2a032a8c5d580d1863 Mon Sep 17 00:00:00 2001 From: Tootbrute Date: Sat, 21 Dec 2024 19:42:09 +0800 Subject: [PATCH] Update NixOS config. --- aspirenix/configuration.nix | 45 ++++++++++++++++++++++++++++ aspirenix/hardware-configuration.nix | 42 ++++++++++++++++++++++++++ base.nix | 18 ----------- flake.nix | 20 +++++++++++++ 4 files changed, 107 insertions(+), 18 deletions(-) create mode 100644 aspirenix/configuration.nix create mode 100644 aspirenix/hardware-configuration.nix diff --git a/aspirenix/configuration.nix b/aspirenix/configuration.nix new file mode 100644 index 0000000..dce3081 --- /dev/null +++ b/aspirenix/configuration.nix @@ -0,0 +1,45 @@ +# 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 + ]; + + # Bootloader. + boot.initrd.luks.devices."luks-b665cacd-d82b-44cd-ab4a-61018efec103".device = "/dev/disk/by-uuid/b665cacd-d82b-44cd-ab4a-61018efec103"; + + networking.hostName = "aspirenix"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.elias = { + isNormalUser = true; + description = "Elias Gasparis"; + extraGroups = [ "networkmanager" "wheel" ]; + packages = with pkgs; [ + # thunderbird + htop + ]; + }; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.11"; # Did you read the comment? + +} diff --git a/aspirenix/hardware-configuration.nix b/aspirenix/hardware-configuration.nix new file mode 100644 index 0000000..3ada623 --- /dev/null +++ b/aspirenix/hardware-configuration.nix @@ -0,0 +1,42 @@ +# 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" "ehci_pci" "ahci" "usb_storage" "uas" "sd_mod" "rtsx_usb_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/f4554a8a-b8d9-4c9e-bea9-c39452383e62"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-8ae34699-9999-47dc-bc01-269b01f7c9bc".device = "/dev/disk/by-uuid/8ae34699-9999-47dc-bc01-269b01f7c9bc"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/E0DA-830C"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + swapDevices = + [ { device = "/dev/disk/by-uuid/fcd6ecf9-3d4d-4cb1-b217-957bae8fbc3f"; } + ]; + + # 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.wlp2s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/base.nix b/base.nix index 777eb60..ef67930 100644 --- a/base.nix +++ b/base.nix @@ -59,24 +59,6 @@ i18n.inputMethod = { ibus.engines = with pkgs.ibus-engines; [ libpinyin table-chinese]; }; -# doesn't work -# i18n.inputMethod = { -# type = "fcitx5"; -# fcitx5.waylandFrontend = true; -# fcitx5.addons = with pkgs; [ - # fcitx5-im #doesn't seem to help - # fcitx5-gtk # alternatively, kdePackages.fcitx5-qt - # fcitx5-chewing - # fcitx5-chinese-addons # table input method support - # fcitx5-nord # a color theme - # ]; - # }; -#old one didn't work -# i18n.inputMethod = { -# type = "fcitx5"; -# fcitx5.addons = with pkgs; [ fcitx5-chewing fcitx5-chinese-addons ]; -# }; - # Enable the X11 windowing system. services.xserver.enable = true; diff --git a/flake.nix b/flake.nix index 70666b9..13bf994 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,26 @@ } #close homemanager ]; #close modules }; # close bluenix + + # aspirenix - Grey Acer Aspire machine + aspirenix = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + modules = [ + ./base.nix + ./aspire/configuration.nix + + home-manager.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.elias = import ./home.nix; + + # Optionally, use home-manager.extraSpecialArgs to pass + # arguments to home.nix + } #close homemanager + ]; #close modules + }; # close bluenix + }; #close nixosconfigurations }; #close outputs }