t14: añade soporte para la thinkpad t14

This commit is contained in:
Fabian Montero 2023-03-22 20:39:10 -06:00
parent a42aa73c79
commit 34681c4353
10 changed files with 109 additions and 41 deletions

View file

@ -1,25 +1,11 @@
#### BASE
# Edet this configuration file to define what should be installed on # Edet this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page # your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running nixos-help). # and in the NixOS manual (accessible by running nixos-help).
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
{ {
imports =
[ # Include the results of the hardware scan.
./hardware-configuration-custom.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.tmpOnTmpfs = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
networking.hostName = "posixlycorrect"; # Define your hostname.
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/Costa_Rica";
# The global useDHCP flag is deprecated, therefore explicitly set to false here. # The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config # Per-interface useDHCP will be mandatory in the future, so this generated config
@ -63,23 +49,6 @@
groups.fabian.gid = 1002; groups.fabian.gid = 1002;
}; };
# esto es de la FGPA, eliminar cuando termine el curso
services.udev.extraRules = ''
# USB-Blaster
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="660", GROUP="dialout", TAG+="uaccess"
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6002", MODE="660", GROUP="dialout", TAG+="uaccess"
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6003", MODE="660", GROUP="dialout", TAG+="uaccess"
# USB-Blaster II
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6010", MODE="660", GROUP="dialout", TAG+="uaccess"
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6810", MODE="660", GROUP="dialout", TAG+="uaccess"
'';
users.users.temp = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
nixpkgs.config.allowUnfree = true; nixpkgs.config.allowUnfree = true;
virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm; virtualisation.libvirtd.qemu.package = pkgs.qemu_kvm;
@ -94,7 +63,7 @@
nix = { nix = {
package = pkgs.nixFlakes; package = pkgs.nixFlakes;
extraOptions = '' extraOptions = ''
experimental-features = nix-command flakes experimental-features = nix-command flakes repl-flake
''; '';
}; };
@ -104,5 +73,7 @@
system.stateVersion = "21.11"; # No tocar esto system.stateVersion = "21.11"; # No tocar esto
services.fprintd.enable = true;
} }

View file

@ -1,3 +0,0 @@
{
}

View file

@ -0,0 +1,3 @@
{
imports = [ ./hardware-configuration-custom.nix ];
}

View file

@ -1,3 +1,5 @@
###POSIXLYCORRECT
{ config, lib, pkgs, modulesPath, ... }: let { config, lib, pkgs, modulesPath, ... }: let
subvol = subvol: { subvol = subvol: {

View file

@ -0,0 +1,40 @@
### T14
# Edet 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, lib, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration-custom.nix
];
# Use the systemd-boot EFI boot loader.
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot.tmpOnTmpfs = true;
boot.kernelPackages = pkgs.linuxPackages_latest;
networking.hostName = "t14"; # Define your hostname.
networking.networkmanager.enable = true;
# Set your time zone.
time.timeZone = "America/Costa_Rica";
hardware.opengl.enable = true;
# esto es de la FGPA, eliminar cuando termine el curso
services.udev.extraRules = ''
# USB-Blaster
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6001", MODE="660", GROUP="dialout", TAG+="uaccess"
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6002", MODE="660", GROUP="dialout", TAG+="uaccess"
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6003", MODE="660", GROUP="dialout", TAG+="uaccess"
# USB-Blaster II
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6010", MODE="660", GROUP="dialout", TAG+="uaccess"
ATTRS{idVendor}=="09fb", ATTRS{idProduct}=="6810", MODE="660", GROUP="dialout", TAG+="uaccess"
'';
}

View file

@ -0,0 +1,55 @@
# 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")
];
services.xserver.videoDrivers = [ "i915" "modesetting" "fbdev" ];
boot = {
initrd = {
availableKernelModules = [ "xhci_pci" "thunderbolt" "nvme" "sdhci_pci" ];
kernelModules = [ "dm-snapshot" ];
luks.devices."tomb" = {
device = "/dev/disk/by-uuid/0b2b9aec-c239-4cce-948d-4411d9300c1d";
preLVM = true;
};
};
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
fileSystems = {
"/" = { device = "/dev/disk/by-uuid/2774158f-8ec5-4ba1-a4fb-a37f55b8bb38";
fsType = "btrfs";
options = [ "subvol=root" ];
};
"/boot" = { device = "/dev/disk/by-uuid/A7E5-EEAB";
fsType = "vfat";
};
"/nix" = { device = "/dev/disk/by-uuid/2774158f-8ec5-4ba1-a4fb-a37f55b8bb38";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
"/home" = { device = "/dev/disk/by-uuid/2774158f-8ec5-4ba1-a4fb-a37f55b8bb38";
fsType = "btrfs";
options = [ "subvol=home" ];
};
"/toplevel" = { device = "/dev/disk/by-uuid/2774158f-8ec5-4ba1-a4fb-a37f55b8bb38";
fsType = "btrfs";
};
};
swapDevices = [ ];
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -27,7 +27,7 @@
value = nixpkgs.lib.nixosSystem { value = nixpkgs.lib.nixosSystem {
inherit system; inherit system;
modules = [ ( import ./base ) ]; modules = [ ./base ./base/platforms/${platform} ];
}; };
}; };

View file

@ -24,4 +24,4 @@ in
terminal.enable = mkDefault true; terminal.enable = mkDefault true;
web.enable = mkDefault true; web.enable = mkDefault true;
}; };
} }

View file

@ -1,6 +1,6 @@
{ lib, pkgs, ... }: { lib, pkgs, ... }:
with lib; { with lib; {
static = true; static = false; # !!!!
namespaced = true; namespaced = true;
packages = with pkgs; [ packages = with pkgs; [
@ -80,4 +80,4 @@ with lib; {
platformTheme = "gtk"; platformTheme = "gtk";
}; };
}; };
} }