Merge pull request #67 from srid/p14s

Add config for Thinkpad P14s
This commit is contained in:
Sridhar Ratnakumar 2024-10-22 16:19:01 -04:00 committed by GitHub
commit 4d30d7442b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 145 additions and 60 deletions

View file

@ -1,55 +0,0 @@
# Hetzner dedicated: AX41-NVMe
{ flake, ... }:
let
inherit (flake) inputs;
inherit (inputs) self;
in
{
imports = [
inputs.disko.nixosModules.disko
self.nixosModules.default
"${self}/modules/nixos/linux/disko/trivial.nix"
"${self}/modules/nixos/linux/docker.nix"
"${self}/modules/nixos/linux/lxd.nix"
"${self}/modules/nixos/linux/hedgedoc.nix"
"${self}/modules/nixos/linux/server/harden/basics.nix"
"${self}/modules/nixos/shared/github-runner.nix"
];
nixos-unified.sshTarget = "srid@immediacy";
system.stateVersion = "23.11";
networking.hostName = "immediacy";
nixpkgs.hostPlatform = "x86_64-linux";
boot.loader.grub = {
devices = [ "/dev/nvme0n1" ];
efiSupport = true;
efiInstallAsRemovable = true;
};
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "sd_mod" ];
hardware.cpu.intel.updateMicrocode = true;
hardware.enableRedistributableFirmware = true;
# Hetzner networking
networking.useDHCP = false;
networking.interfaces."eth0".ipv4.addresses = [
{
address = "65.109.84.215"; # your IPv4 here
prefixLength = 24;
}
];
networking.interfaces."eth0".ipv6.addresses = [
{
address = "2a01:4f9:3051:52d3::2"; # Your IPv6 here
prefixLength = 64;
}
];
networking.defaultGateway = "65.109.84.193";
networking.nameservers = [ "8.8.8.8" ];
services.openssh.enable = true;
services.tailscale.enable = true;
programs.nix-ld.enable = true; # for vscode server
}

View file

@ -0,0 +1,74 @@
{ pkgs, ... }:
{
imports =
[
# Include the results of the hardware scan.
./hardware-configuration.nix
];
# Bootloader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
networking.hostName = "vixen"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# Enable networking
networking.networkmanager.enable = true;
# 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";
};
# Configure keymap in X11
services.xserver.xkb = {
layout = "us";
variant = "";
};
# Enable CUPS to print documents.
services.printing.enable = true;
# Enable sound with pipewire.
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
# List packages installed in system profile. To search, run:
# $ nix search wget
environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget
brave
vscode
];
# 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. Its 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?
}

View file

@ -0,0 +1,20 @@
# Hetzner dedicated: AX41-NVMe
{ flake, ... }:
let
inherit (flake) inputs;
inherit (inputs) self;
in
{
imports = [
self.nixosModules.default
inputs.nixos-hardware.nixosModules.lenovo-thinkpad-p14s-amd-gen4
./configuration.nix
(self + /modules/nixos/linux/gui/gnome.nix)
];
services.openssh.enable = true;
services.tailscale.enable = true;
programs.nix-ld.enable = true; # for vscode server
}

View file

@ -0,0 +1,45 @@
# 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 = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-amd" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{
device = "/dev/disk/by-uuid/5d20a7d3-e7b5-4554-ab7e-078c154545f9";
fsType = "ext4";
};
boot.initrd.luks.devices."luks-7cbdd6ee-fae2-4696-afc9-d7b7bae8246f".device = "/dev/disk/by-uuid/7cbdd6ee-fae2-4696-afc9-d7b7bae8246f";
fileSystems."/boot" =
{
device = "/dev/disk/by-uuid/665D-E58F";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
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.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp102s0u1u3c2.useDHCP = lib.mkDefault true;
# networking.interfaces.enp1s0f0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp2s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

6
flake.lock generated
View file

@ -772,11 +772,11 @@
},
"nixos-hardware": {
"locked": {
"lastModified": 1678397099,
"narHash": "sha256-5xq8YJe+h19TlD+EI4AE/3H3jcCcQ2AWU6CWBVc5tRc=",
"lastModified": 1729624485,
"narHash": "sha256-iEffyT68tEU5kHQuyP05QRH+JhWNNLAwHfgZAzXFS7o=",
"owner": "NixOS",
"repo": "nixos-hardware",
"rev": "556101ff85bd6e20900ec73ee525b935154bc8ea",
"rev": "22e8de2729f40d29a445c8baeaf22740b8b25daf",
"type": "github"
},
"original": {

View file

@ -6,6 +6,7 @@
};
environment.systemPackages = with pkgs; [
gnome.gnome-tweaks
# This is necessary to set CAPS to CTRL
gnome-tweaks
];
}

View file

@ -14,7 +14,7 @@
openssh.authorizedKeys.keys = myKeys;
} // lib.optionalAttrs pkgs.stdenv.isLinux {
isNormalUser = true;
extraGroups = [ "wheel" ];
extraGroups = [ "networkmanager" "wheel" ];
};
};