···66For Home-Manager on Linux
77```shell
88home-manager switch --flake .#alex
99+```
1010+1111+For NixOS
1212+```shell
1313+sudo nixos-rebuild switch --flake .#otter --impure
914```
+22-18
nixos/otter/configuration.nix
···11-# Edit this configuration file to define what should be installed on
22-# your system. Help is available in the configuration.nix(5) man page
33-# and in the NixOS manual (accessible by running ‘nixos-help’).
44-51{ config, pkgs, inputs, ... }:
6273{
88- imports =
99- [ # Include the results of the hardware scan.
44+ imports = [ # Include the results of the hardware scan.
105 ./hardware-configuration.nix
116127 inputs.nixos-hardware.nixosModules.framework-13-7040-amd
1313- ];
88+ ];
99+1010+ hardware.enableRedistributableFirmware = true;
1111+ boot.kernelPackages = pkgs.linuxKernel.packages.linux_zen;
14121513 # Bootloader.
1614 boot.loader.systemd-boot.enable = true;
1715 boot.loader.efi.canTouchEfiVariables = true;
18161917 boot.initrd.luks.devices."luks-cd4e7e78-243a-4091-90dd-9ee091fbb27d".device = "/dev/disk/by-uuid/cd4e7e78-243a-4091-90dd-9ee091fbb27d";
2020- networking.hostName = "nixos"; # Define your hostname.
1818+ networking.hostName = "otter";
1919+2120 # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
2121+2222+ # Configure the governor used to regulate the frequency of the available CPUs.
2323+ powerManagement.cpuFreqGovernor = "powersave";
2424+22252326 # Framework quirks
2427 hardware.framework.amd-7040.preventWakeOnAC = true;
···9699 isNormalUser = true;
97100 description = "Alex";
98101 extraGroups = [ "networkmanager" "wheel" ];
9999- packages = with pkgs; [
100100- # thunderbird
101101- ];
102102+ packages = with pkgs; [];
102103 };
103104104105 # Install firefox.
···135136 # Or disable the firewall altogether.
136137 # networking.firewall.enable = false;
137138138138- # This value determines the NixOS release from which the default
139139- # settings for stateful data, like file locations and database versions
140140- # on your system were taken. It‘s perfectly fine and recommended to leave
141141- # this value at the release version of the first install of this system.
142142- # Before changing this value read the documentation for this option
143143- # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
144144- system.stateVersion = "24.05"; # Did you read the comment?
139139+ services.logind = {
140140+ powerKey = "suspend-then-hibernate";
141141+ lidSwitch = "suspend-then-hibernate";
142142+ lidSwitchExternalPower = "suspend";
143143+ extraConfig = ''
144144+ PowerKeyIgnoreInhibited=yes
145145+ LidSwitchIgnoreInhibited=no
146146+ '';
147147+ };
145148149149+ system.stateVersion = "24.05";
146150}
+13-19
nixos/otter/hardware-configuration.nix
···11-# Do not modify this file! It was generated by ‘nixos-generate-config’
22-# and may be overwritten by future invocations. Please make changes
33-# to /etc/nixos/configuration.nix instead.
41{ config, lib, pkgs, modulesPath, ... }:
5263{
77- imports =
88- [
99- (modulesPath + "/installer/scan/not-detected.nix")
1010- ];
44+ imports = [
55+ (modulesPath + "/installer/scan/not-detected.nix")
66+ ];
117128 boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usb_storage" "sd_mod" ];
139 boot.initrd.kernelModules = [ ];
1410 boot.kernelModules = [ "kvm-amd" ];
1511 boot.extraModulePackages = [ ];
16121717- fileSystems."/" =
1818- { device = "/dev/disk/by-uuid/d03072f3-9413-401e-b2dd-31589f3b4a05";
1919- fsType = "ext4";
2020- };
1313+ fileSystems."/" = {
1414+ device = "/dev/disk/by-uuid/d03072f3-9413-401e-b2dd-31589f3b4a05";
1515+ fsType = "ext4";
1616+ };
21172218 boot.initrd.luks.devices."luks-d2d68a53-c760-44db-bfd6-cc508e7f8406".device = "/dev/disk/by-uuid/d2d68a53-c760-44db-bfd6-cc508e7f8406";
23192424- fileSystems."/boot" =
2525- { device = "/dev/disk/by-uuid/CF41-F52D";
2626- fsType = "vfat";
2727- options = [ "fmask=0077" "dmask=0077" ];
2828- };
2020+ fileSystems."/boot" = {
2121+ device = "/dev/disk/by-uuid/CF41-F52D";
2222+ fsType = "vfat";
2323+ options = [ "fmask=0077" "dmask=0077" ];
2424+ };
29253030- swapDevices =
3131- [ { device = "/dev/disk/by-uuid/767cf96c-be48-473d-b7a7-15fa1cb7a3f2"; }
3232- ];
2626+ swapDevices = [ { device = "/dev/disk/by-uuid/767cf96c-be48-473d-b7a7-15fa1cb7a3f2"; } ];
33273428 # Enables DHCP on each ethernet and wireless interface. In case of scripted networking
3529 # (the default) this is the recommended approach. When using systemd-networkd it's