diff --git a/configuration.nix b/configuration.nix index 7d6f7cc..d7a3c71 100644 --- a/configuration.nix +++ b/configuration.nix @@ -13,6 +13,13 @@ # Bootloader. boot.loader.systemd-boot.enable = true; boot.loader.efi.canTouchEfiVariables = true; + + # Boot time optimizations + boot.loader.timeout = 0; # Boot immediately without waiting for user input + + # Disable slow services that delay boot + systemd.services.systemd-udev-settle.enable = false; + systemd.services.NetworkManager-wait-online.enable = false; networking.hostName = "framework"; # Define your hostname. # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. @@ -20,6 +27,11 @@ # Configure network proxy if necessary # networking.proxy.default = "http://user:password@proxy:port/"; # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Optimize network configuration for faster boot + networking.dhcpcd.wait = "background"; # Avoid waiting for IP during boot + networking.dhcpcd.extraConfig = "noarp"; # Skip ARP checks to speed up + hardware.bluetooth = { enable = true; powerOnBoot = true; @@ -54,6 +66,13 @@ # Enable the X11 windowing system. services.xserver.enable = true; + # Framework Laptop 13 AMD AI 300 Series specific configurations + # Enable AMD GPU support and power management + hardware.graphics = { + enable = true; + enable32Bit = true; + }; + # Enable keyd for key remapping services.keyd = { enable = true; @@ -120,11 +139,11 @@ # 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’. + # Define a user account. Don't forget to set a password with 'passwd'. users.users.jet = { isNormalUser = true; description = "Jet"; - extraGroups = [ "networkmanager" "wheel" "podman" ]; + extraGroups = [ "networkmanager" "wheel" "docker" ]; }; # Allow unfree packages @@ -132,13 +151,28 @@ # Enable the Flakes feature and the accompanying new nix command-line tool nix.settings.experimental-features = [ "nix-command" "flakes" ]; + + # Framework-specific services + # Enable fwupd for BIOS updates (distributed through LVFS) + services.fwupd.enable = true; + + # Enable automatic garbage collection to prevent old generations from slowing boot + nix.gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; # Power management for laptop # Configure lid switch behavior - hybrid-sleep for optimal power management services.logind = { - lidSwitch = "hybrid-sleep"; - lidSwitchExternalPower = "hybrid-sleep"; - lidSwitchDocked = "ignore"; + settings = { + Login = { + HandleLidSwitch = "hibernate"; + HandleLidSwitchExternalPower = "hybrid-sleep"; + HandleLidSwitchDocked = "ignore"; + }; + }; }; # Enable auto-cpufreq for intelligent power management (replaces TLP) @@ -154,14 +188,25 @@ }; }; - # Disable power-profiles-daemon to avoid conflict with auto-cpufreq - services.power-profiles-daemon.enable = false; - # Enable thermald for thermal management services.thermald.enable = true; + # Framework Laptop 13 specific power optimizations + # Enable power-profiles-daemon for better AMD power management + # (Note: This conflicts with auto-cpufreq, so we'll keep auto-cpufreq disabled) + services.power-profiles-daemon.enable = false; + + # AMD specific power management + powerManagement.cpuFreqGovernor = "powersave"; + # Enable power management powerManagement.enable = true; + + # Enable ZRAM swap for better memory management and potentially faster boot + zramSwap = { + enable = true; + algorithm = "zstd"; + }; # List packages installed in system profile. To search, run: # $ nix search wget @@ -170,8 +215,8 @@ helix # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. wget vim - podman - podman-compose + docker + docker-compose ]; environment.variables.EDITOR = "helix"; @@ -192,23 +237,18 @@ # Enable the OpenSSH daemon. # services.openssh.enable = true; - # Enable Podman with rootless support - virtualisation = { - containers.enable = true; - oci-containers.backend = "podman"; - podman = { + # Enable rootless Docker + virtualisation.docker = { + enable = true; + rootless = { enable = true; - autoPrune.enable = true; - # Create a `docker` alias for podman, to use it as a drop-in replacement - dockerCompat = true; - # Required for containers under podman-compose to be able to talk to each other. - defaultNetwork.settings.dns_enabled = true; + setSocketVariable = true; }; }; - # Create podman group - users.groups.podman = { - name = "podman"; + # Create docker group + users.groups.docker = { + name = "docker"; }; # Open ports in the firewall. diff --git a/flake.lock b/flake.lock index 95181ef..c3c15bc 100644 --- a/flake.lock +++ b/flake.lock @@ -7,11 +7,11 @@ ] }, "locked": { - "lastModified": 1755121891, - "narHash": "sha256-UtYkukiGnPRJ5rpd4W/wFVrLMh8fqtNkqHTPgHEtrqU=", + "lastModified": 1756777514, + "narHash": "sha256-BVCWCoYNCqTt8UuEUbsHJmwjEOGjKatbrBTlLg2rwzU=", "owner": "nix-community", "repo": "home-manager", - "rev": "279ca5addcdcfa31ac852b3ecb39fc372684f426", + "rev": "e31db6141e47f1007a54bc9e4d8b2a26a9fbd697", "type": "github" }, "original": { @@ -41,13 +41,28 @@ "type": "github" } }, + "nixos-hardware": { + "locked": { + "lastModified": 1756750488, + "narHash": "sha256-e4ZAu2sjOtGpvbdS5zo+Va5FUUkAnizl4wb0/JlIL2I=", + "owner": "NixOS", + "repo": "nixos-hardware", + "rev": "47eb4856cfd01eaeaa7bb5944a0f27db8fb9b94a", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixos-hardware", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1755027561, - "narHash": "sha256-IVft239Bc8p8Dtvf7UAACMG5P3ZV+3/aO28gXpGtMXI=", + "lastModified": 1756542300, + "narHash": "sha256-tlOn88coG5fzdyqz6R93SQL5Gpq+m/DsWpekNFhqPQk=", "owner": "nixos", "repo": "nixpkgs", - "rev": "005433b926e16227259a1843015b5b2b7f7d1fc3", + "rev": "d7600c775f877cd87b4f5a831c28aa94137377aa", "type": "github" }, "original": { @@ -60,6 +75,7 @@ "root": { "inputs": { "home-manager": "home-manager", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", "zen-browser": "zen-browser" } @@ -72,11 +88,11 @@ ] }, "locked": { - "lastModified": 1755199018, - "narHash": "sha256-y7dM6ihF4feDgbssaeFxKXjsJb6Rzjz1brc17kSkcoQ=", + "lastModified": 1756772830, + "narHash": "sha256-Cn2q2OpSu9aX0j5uRolbPU5Ms6RalVVc6QWibgZb3ak=", "owner": "0xc000022070", "repo": "zen-browser-flake", - "rev": "8bf64e38baa26429c31d0623c3f16812b794b436", + "rev": "b60c294e338f7d15a34f46cb380c6ec84ef4b79a", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index fbe3de8..5a8ea8f 100644 --- a/flake.nix +++ b/flake.nix @@ -5,6 +5,7 @@ nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; home-manager.url = "github:nix-community/home-manager"; home-manager.inputs.nixpkgs.follows = "nixpkgs"; + nixos-hardware.url = "github:NixOS/nixos-hardware"; zen-browser = { url = "github:0xc000022070/zen-browser-flake"; inputs.nixpkgs.follows = "nixpkgs"; @@ -15,6 +16,7 @@ self, nixpkgs, home-manager, + nixos-hardware, ... }: { nixosConfigurations = { @@ -22,6 +24,7 @@ system = "x86_64-linux"; modules = [ ./configuration.nix + nixos-hardware.nixosModules.framework-amd-ai-300-series home-manager.nixosModules.home-manager { home-manager.useGlobalPkgs = true; diff --git a/hardware-configuration.nix b/hardware-configuration.nix index d5b4b01..15c86a4 100644 --- a/hardware-configuration.nix +++ b/hardware-configuration.nix @@ -16,6 +16,7 @@ fileSystems."/" = { device = "/dev/disk/by-uuid/687945b8-9e15-473d-b083-d3a3b12ac98f"; fsType = "ext4"; + options = [ "noatime" ]; }; fileSystems."/boot" = diff --git a/home.nix b/home.nix index b384788..9173926 100644 --- a/home.nix +++ b/home.nix @@ -87,6 +87,8 @@ ffmpeg google-chrome pdftk + gh + nmap ]; programs.helix = { @@ -172,6 +174,7 @@ jsq = "jj squash"; ns = "sudo nixos-rebuild switch --flake ~/Documents/nixos-config#jet"; nd = "nix develop"; + h = "hx"; }; }; @@ -239,6 +242,7 @@ "${pkgs.kitty}/share/applications/kitty.desktop" "${inputs.zen-browser.packages."${pkgs.system}".twilight-official}/share/applications/zen-twilight.desktop" "${pkgs.code-cursor}/share/applications/cursor.desktop" + "${pkgs.signal-desktop}/share/applications/signal.desktop" ]; };