Add Lenovo laptop

This commit is contained in:
jimjam4real 2024-09-08 21:45:54 -04:00
parent 7bbc3ac209
commit fd0316e588
14 changed files with 201 additions and 17 deletions

View file

@ -68,6 +68,12 @@
jovian-nixos.nixosModules.default
];
};
JimLenovo = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
modules = [
./nixos/lenovo.nix
];
};
};
# Standalone home-manager configuration
@ -96,6 +102,14 @@
nur.nixosModules.nur
];
};
"jimbo@JimLenovo" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
extraSpecialArgs = {inherit inputs outputs;};
modules = [
./home-manager/jimbo_lenovo.nix
nur.nixosModules.nur
];
};
# Derivation for ssh envrionments on other people's servers
"jimbo@SSH" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;

View file

@ -37,13 +37,14 @@
./services/udiskie.nix
];
# Rebuild this entire system
# ZSH rebuild commands
programs.zsh = {
shellAliases = let
auth = import ./common/auth.nix;
hostname = "JimDeck";
in {
sysdate = "${auth.method} nixos-rebuild switch --flake /etc/nixos/.#JimDeck";
homedate = "home-manager switch --flake /etc/nixos/.#jimbo@JimDeck";
sysdate = "${auth.method} nixos-rebuild switch --flake /etc/nixos/.#${hostname}";
homedate = "home-manager switch --flake /etc/nixos/.#jimbo@${hostname}";
nixdate = "sysdate; homedate; notify-send 'NixOS switch done.'";
};
};

View file

@ -39,13 +39,14 @@
./services/udiskie.nix
];
# Rebuild this entire system
# ZSH rebuild commands
programs.zsh = {
shellAliases = let
auth = import ./common/auth.nix;
hostname = "JimDesktop";
in {
sysdate = "${auth.method} nixos-rebuild switch --flake /etc/nixos/.#JimDesktop";
homedate = "home-manager switch --flake /etc/nixos/.#jimbo@JimDesktop";
sysdate = "${auth.method} nixos-rebuild switch --flake /etc/nixos/.#${hostname}";
homedate = "home-manager switch --flake /etc/nixos/.#jimbo@${hostname}";
nixdate = "sysdate; homedate; notify-send 'NixOS switch done.'";
};
};

View file

@ -0,0 +1,58 @@
{config, ...}: {
imports = [
# Common modules
./home.nix
./users/jimbo.nix
./tuiapps/git.nix
# GUI Apps
./misc/guifiles.nix
./sway/sway.nix
./sway/swaylock.nix
./guiapps/gtk.nix
./guiapps/foot.nix
./guiapps/librewolf.nix
./guiapps/mangohud.nix
./guiapps/mpv.nix
./guiapps/obs.nix
./guiapps/pcmanfm-qt.nix
./guiapps/rofi.nix
./guiapps/swappy.nix
./guiapps/easyeffects.nix
./tuiapps/ncmpcpp.nix
# Misc apps and tools
./misc/useful.nix
./misc/avtools.nix
./misc/filemanager.nix
./misc/gaming.nix
./misc/xash3d.nix
./misc/remotedesktop.nix
./misc/school.nix
./misc/variables.nix
# Services
./services/gnome-keyring.nix
./services/mako.nix
./services/udiskie.nix
];
# ZSH rebuild commands
programs.zsh = {
shellAliases = let
auth = import ./common/auth.nix;
hostname = "JimLenovo";
in {
sysdate = "${auth.method} nixos-rebuild switch --flake /etc/nixos/.#${hostname}";
homedate = "home-manager switch --flake /etc/nixos/.#jimbo@${hostname}";
nixdate = "sysdate; homedate; notify-send 'NixOS switch done.'";
};
};
# Symlinks
home.file = {
"VMs" = {
source = config.lib.file.mkOutOfStoreSymlink "/etc/libvirt/VMs";
};
};
}

View file

@ -6,14 +6,15 @@
./tuiapps/git.nix
];
# Rebuild this entire system
# ZSH rebuild commands
programs.zsh = {
shellAliases = let
auth = import ./common/auth.nix;
hostname = "JimServer";
in {
sysdate = "${auth.method} nixos-rebuild switch --flake /etc/nixos/.#JimServer";
homedate = "home-manager switch --flake /etc/nixos/.#jimbo@JimServer";
nixdate = "sysdate; homedate";
sysdate = "${auth.method} nixos-rebuild switch --flake /etc/nixos/.#${hostname}";
homedate = "home-manager switch --flake /etc/nixos/.#jimbo@${hostname}";
nixdate = "sysdate; homedate; notify-send 'NixOS switch done.'";
};
};
}

View file

@ -9,8 +9,9 @@
programs.zsh = {
shellAliases = let
auth = import ./common/auth.nix;
hostname = "SSH";
in {
homedate = "home-manager switch --flake ~/.home-manager/.#jimbo@SSH --extra-experimental-features 'nix-command flakes'";
homedate = "home-manager switch --flake ~/.home-manager/.#jimbo@${hostname} --extra-experimental-features 'nix-command flakes'";
};
};
}

View file

@ -23,7 +23,7 @@
# Foreground apps
{command = "librewolf -P Misc --name=MiscBrowser";}
{command = "vesktop --ozone-platform-hint=auto";}
{command = "vesktop";}
{command = "element-desktop";}
{command = "thunderbird";}
];

View file

@ -97,8 +97,8 @@
# Communication
"${ws.w3a}" = [{class = "zoom";}];
"${ws.w7}" = [{app_id = "MiscBrowser";} {app_id = "vesktop";}];
"${ws.w8}" = [{app_id = "Element";}];
"${ws.w7}" = [{app_id = "MiscBrowser";} {app_id = "vesktop";} {class = "vesktop";}];
"${ws.w8}" = [{app_id = "Element";} {class = "Element";}];
"${ws.w9}" = [{app_id = "thunderbird";}];
# Else

View file

@ -73,7 +73,4 @@
# Allow binary firmware
hardware.enableRedistributableFirmware = true;
# Force Electron to use Wayland
environment.sessionVariables.NIXOS_OZONE_WL = "1";
}

View file

@ -35,8 +35,12 @@
./services/mpd.nix
];
# Set hostname
networking.hostName = "JimDeck";
# Force Electron to use Wayland
environment.sessionVariables.NIXOS_OZONE_WL = "1";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.11";
}

View file

@ -38,8 +38,12 @@
./services/mpd.nix
];
# Set hostname
networking.hostName = "JimDesktop";
# Force Electron to use Wayland
environment.sessionVariables.NIXOS_OZONE_WL = "1";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -0,0 +1,54 @@
# This file was initially made by 'nixos-generate-config', try not to edit too much
{ config, lib, pkgs, modulesPath, ... }: {
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
# Set all boot options
boot = {
# Set a kernel version and load/blacklist drivers
kernelPackages = pkgs.linuxPackages_zen;
blacklistedKernelModules = [
"pcspkr"
];
kernel.sysctl."vm.max_map_count" = 2147483642;
initrd = {
availableKernelModules = [
"nvme"
"xhci_pci"
"usbhid"
"usb_storage"
"sd_mod"
"sdhci_pci"
];
kernelModules = [
"kvm-amd"
];
};
# Manage supported filesystems
supportedFilesystems = {
ntfs = true;
zfs = lib.mkForce false;
};
};
# Mount everything as necessary
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/c0fe8419-88f9-48a0-8c5b-acd4c11f8037";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/5669-7EF6";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
};
# Enables DHCP on each ethernet and wireless interface.
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

46
nixos/lenovo.nix Normal file
View file

@ -0,0 +1,46 @@
{
imports = [
# Base configs
./base.nix
# Import users and groups
./users/jimbo.nix
./users/groups.nix
# Desktop only
./desktop/misc.nix
./desktop/sway.nix
./desktop/greetd-sway.nix
./desktop/printing.nix
./desktop/gaming.nix
./desktop/pipewire.nix
./desktop/bluetooth.nix
./desktop/firewall.nix
./desktop/fonts.nix
./desktop/qt.nix
# Laptop/Portable only
./hardware/wireless.nix
# Modules
./modules/security.nix
./modules/legacy.nix
# Hardware
./hardware/machines/lenovo.nix
./hardware/systemdboot.nix
./hardware/opengl.nix
# Services
./services/openssh.nix
./services/udev.nix
./services/sunshine.nix
./services/mpd.nix
];
# Set hostname
networking.hostName = "JimLenovo";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion
system.stateVersion = "24.05";
}

View file

@ -45,7 +45,10 @@
./server/matrix-discord.nix
];
# Set custom openssh port
services.openssh.ports = [ 2222 ];
# Set hostname
networking.hostName = "JimServer";
# https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion