diff --git a/flake.nix b/flake.nix index 28f2096..8af3446 100755 --- a/flake.nix +++ b/flake.nix @@ -76,37 +76,9 @@ system = "x86_64-linux"; modules = [ ./hosts/demeter - ./modules/nixos/gaming - ./modules/nixos/audio - ./modules/nixos/networking - ./modules/nixos/fonts - ./modules/nixos/greeter - ./modules/nixos/core - ./overlays - - catppuccin.nixosModules.catppuccin - lix-module.nixosModules.default - lanzaboote.nixosModules.lanzaboote - home-manager.nixosModules.home-manager - { - home-manager.useGlobalPkgs = true; - home-manager.useUserPackages = true; - home-manager.backupFileExtension = "backup"; - home-manager.users.youwen = { - imports = [ - ./users/youwen/linux/desktop - ./users/youwen/linux/packages/x86_64 - ./users/youwen/linux/programs - ./users/youwen/common/neofetch - ./users/youwen/common/neovim - ./users/youwen/common - inputs.catppuccin.homeManagerModules.catppuccin - inputs.nixvim.homeManagerModules.nixvim - ]; - }; - } ]; }; + callisto = nixpkgs.lib.nixosSystem { specialArgs = {inherit inputs;}; system = "aarch64-linux"; @@ -117,6 +89,7 @@ ./modules/nixos/fonts ./modules/nixos/greeter ./modules/nixos/core + ./overlays apple-silicon.nixosModules.apple-silicon-support catppuccin.nixosModules.catppuccin @@ -160,6 +133,7 @@ ./modules/nixos/fonts ./modules/nixos/greeter ./modules/nixos/core + ./overlays catppuccin.nixosModules.catppuccin lix-module.nixosModules.default diff --git a/hosts/demeter/configuration.nix b/hosts/demeter/configuration.nix new file mode 100755 index 0000000..2adccad --- /dev/null +++ b/hosts/demeter/configuration.nix @@ -0,0 +1,210 @@ +# 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, + inputs, + pkgs, + lib, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Bootloader. + boot.loader = { + efi.canTouchEfiVariables = true; + timeout = 15; + # Lanzaboote currently replaces the systemd-boot module. + # This setting is usually set to true in configuration.nix + # generated at installation time. So we force it to false + # for now. + systemd-boot = { + enable = false; + consoleMode = "auto"; + }; + }; + + boot.lanzaboote = { + enable = true; + pkiBundle = "/etc/secureboot"; + }; + + boot.initrd.luks.devices."luks-af320a0f-b388-43f5-b5a3-af2b47cfc716".device = "/dev/disk/by-uuid/af320a0f-b388-43f5-b5a3-af2b47cfc716"; + + networking.hostName = "demeter"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + + # select kernel + boot.kernelPackages = pkgs.linuxPackages_zen; + + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Enable networking + networking.networkmanager.enable = true; + + # Set your time zone. + time.timeZone = "America/Los_Angeles"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; + + systemd.services = {NetworkManager-wait-online.enable = false;}; + + # Enable the X11 windowing system. + # You can disable this if you're only using the Wayland session. + services.xserver.enable = false; + + programs.nix-ld = { + enable = true; + libraries = with pkgs; [icu xorg.libXtst xorg.libXi]; + }; + + hardware.nvidia = { + modesetting.enable = true; + powerManagement.enable = true; + powerManagement.finegrained = false; + open = false; + nvidiaSettings = true; + }; + + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + + services.blueman.enable = true; + + hardware.graphics.enable = true; + + hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; + + services.xserver.videoDrivers = ["nvidia"]; + + services.flatpak.enable = true; + + # services.desktopManager.plasma6.enable = true; + + # Configure keymap in X11 + services.xserver = { + xkb.layout = "us"; + xkb.variant = ""; + }; + + # Enable CUPS to print documents. + services.printing.enable = true; + + # 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.youwen = { + isNormalUser = true; + description = "Youwen Wu"; + extraGroups = ["networkmanager" "wheel" "nixos" "realtime"]; + }; + + users.groups.realtime = {}; + + nix.settings = { + trusted-users = ["root" "youwen"]; + experimental-features = ["nix-command" "flakes"]; + }; + + services.udev.extraRules = '' + KERNEL=="cpu_dma_latency", GROUP="realtime" + ''; + + security.pam.loginLimits = [ + { + domain = "@realtime"; + type = "-"; + item = "rtprio"; + value = 98; + } + { + domain = "@realtime"; + type = "-"; + item = "memlock"; + value = "unlimited"; + } + { + domain = "@realtime"; + type = "-"; + item = "nice"; + value = -11; + } + ]; + + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + neovim + wget + git + curl + librewolf + gnumake + gcc + cachix + gnupg + openssh + python3 + steam-run + + # deps for neovim compilation + lua51Packages.lua + lua51Packages.luarocks + tree-sitter + ]; + + environment.variables = { + EDITOR = "nvim"; + NIX_AUTO_RUN = 1; + }; + + # tells electron apps to use Wayland + environment.sessionVariables.NIXOS_OZONE_WL = "1"; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + programs.dconf.enable = true; + + programs.hyprland.enable = true; + + programs.zsh.enable = false; + programs.fish.enable = true; + users.users.youwen.shell = pkgs.fish; + # 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.05"; # Did you read the comment? +} diff --git a/hosts/demeter/default.nix b/hosts/demeter/default.nix old mode 100755 new mode 100644 index 2adccad..109f20b --- a/hosts/demeter/default.nix +++ b/hosts/demeter/default.nix @@ -1,210 +1,34 @@ -# 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, - inputs, - pkgs, - lib, - ... -}: { - imports = [ - # Include the results of the hardware scan. - ./hardware-configuration.nix - ]; +{inputs, ...}: { + imports = with inputs; [ + ./configuration.nix + ../../modules/nixos/gaming + ../../modules/nixos/audio + ../../modules/nixos/networking + ../../modules/nixos/fonts + ../../modules/nixos/greeter + ../../modules/nixos/core + ../../overlays - # Bootloader. - boot.loader = { - efi.canTouchEfiVariables = true; - timeout = 15; - # Lanzaboote currently replaces the systemd-boot module. - # This setting is usually set to true in configuration.nix - # generated at installation time. So we force it to false - # for now. - systemd-boot = { - enable = false; - consoleMode = "auto"; - }; - }; - - boot.lanzaboote = { - enable = true; - pkiBundle = "/etc/secureboot"; - }; - - boot.initrd.luks.devices."luks-af320a0f-b388-43f5-b5a3-af2b47cfc716".device = "/dev/disk/by-uuid/af320a0f-b388-43f5-b5a3-af2b47cfc716"; - - networking.hostName = "demeter"; # Define your hostname. - # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. - - # select kernel - boot.kernelPackages = pkgs.linuxPackages_zen; - - # Configure network proxy if necessary - # networking.proxy.default = "http://user:password@proxy:port/"; - # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - - # Enable networking - networking.networkmanager.enable = true; - - # Set your time zone. - time.timeZone = "America/Los_Angeles"; - - # Select internationalisation properties. - i18n.defaultLocale = "en_US.UTF-8"; - - i18n.extraLocaleSettings = { - LC_ADDRESS = "en_US.UTF-8"; - LC_IDENTIFICATION = "en_US.UTF-8"; - LC_MEASUREMENT = "en_US.UTF-8"; - LC_MONETARY = "en_US.UTF-8"; - LC_NAME = "en_US.UTF-8"; - LC_NUMERIC = "en_US.UTF-8"; - LC_PAPER = "en_US.UTF-8"; - LC_TELEPHONE = "en_US.UTF-8"; - LC_TIME = "en_US.UTF-8"; - }; - - systemd.services = {NetworkManager-wait-online.enable = false;}; - - # Enable the X11 windowing system. - # You can disable this if you're only using the Wayland session. - services.xserver.enable = false; - - programs.nix-ld = { - enable = true; - libraries = with pkgs; [icu xorg.libXtst xorg.libXi]; - }; - - hardware.nvidia = { - modesetting.enable = true; - powerManagement.enable = true; - powerManagement.finegrained = false; - open = false; - nvidiaSettings = true; - }; - - hardware.bluetooth = { - enable = true; - powerOnBoot = true; - }; - - services.blueman.enable = true; - - hardware.graphics.enable = true; - - hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable; - - services.xserver.videoDrivers = ["nvidia"]; - - services.flatpak.enable = true; - - # services.desktopManager.plasma6.enable = true; - - # Configure keymap in X11 - services.xserver = { - xkb.layout = "us"; - xkb.variant = ""; - }; - - # Enable CUPS to print documents. - services.printing.enable = true; - - # 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.youwen = { - isNormalUser = true; - description = "Youwen Wu"; - extraGroups = ["networkmanager" "wheel" "nixos" "realtime"]; - }; - - users.groups.realtime = {}; - - nix.settings = { - trusted-users = ["root" "youwen"]; - experimental-features = ["nix-command" "flakes"]; - }; - - services.udev.extraRules = '' - KERNEL=="cpu_dma_latency", GROUP="realtime" - ''; - - security.pam.loginLimits = [ + catppuccin.nixosModules.catppuccin + lix-module.nixosModules.default + lanzaboote.nixosModules.lanzaboote + home-manager.nixosModules.home-manager { - domain = "@realtime"; - type = "-"; - item = "rtprio"; - value = 98; - } - { - domain = "@realtime"; - type = "-"; - item = "memlock"; - value = "unlimited"; - } - { - domain = "@realtime"; - type = "-"; - item = "nice"; - value = -11; + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.backupFileExtension = "backup"; + home-manager.users.youwen = { + imports = [ + ../../users/youwen/linux/desktop + ../../users/youwen/linux/packages/x86_64 + ../../users/youwen/linux/programs + ../../users/youwen/common/neofetch + ../../users/youwen/common/neovim + ../../users/youwen/common + inputs.catppuccin.homeManagerModules.catppuccin + inputs.nixvim.homeManagerModules.nixvim + ]; + }; } ]; - - # Allow unfree packages - nixpkgs.config.allowUnfree = true; - - # List packages installed in system profile. To search, run: - # $ nix search wget - environment.systemPackages = with pkgs; [ - neovim - wget - git - curl - librewolf - gnumake - gcc - cachix - gnupg - openssh - python3 - steam-run - - # deps for neovim compilation - lua51Packages.lua - lua51Packages.luarocks - tree-sitter - ]; - - environment.variables = { - EDITOR = "nvim"; - NIX_AUTO_RUN = 1; - }; - - # tells electron apps to use Wayland - environment.sessionVariables.NIXOS_OZONE_WL = "1"; - - # Some programs need SUID wrappers, can be configured further or are - # started in user sessions. - # programs.mtr.enable = true; - programs.gnupg.agent = { - enable = true; - enableSSHSupport = true; - }; - - programs.dconf.enable = true; - - programs.hyprland.enable = true; - - programs.zsh.enable = false; - programs.fish.enable = true; - users.users.youwen.shell = pkgs.fish; - # 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.05"; # Did you read the comment? } diff --git a/hosts/demeter/hardware-configuration.nix.old b/hosts/demeter/hardware-configuration.nix.old deleted file mode 100755 index df06d01..0000000 --- a/hosts/demeter/hardware-configuration.nix.old +++ /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" "nvme" "usbhid" "usb_storage" "sd_mod" ]; - boot.initrd.kernelModules = [ ]; - boot.kernelModules = [ "kvm-intel" ]; - boot.extraModulePackages = [ ]; - - fileSystems."/" = { - device = "/dev/disk/by-uuid/2616d86c-aac2-4780-9527-7b11192e783f"; - fsType = "ext4"; - }; - - fileSystems."/boot" = { - device = "/dev/disk/by-uuid/B826-E14B"; - 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.enp6s0.useDHCP = lib.mkDefault true; - # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; - - nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; - hardware.cpu.intel.updateMicrocode = - lib.mkDefault config.hardware.enableRedistributableFirmware; -}