diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3e9613..0187d45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,6 +50,7 @@ jobs: config: - dan@akane - generic + - dan@hina - dan@kawashiro - dan@maya - minimal diff --git a/configurations/hina/README.md b/configurations/hina/README.md new file mode 100644 index 0000000..7fa6f3f --- /dev/null +++ b/configurations/hina/README.md @@ -0,0 +1,10 @@ +# `hina` + +ThinkPad that I bought used for cheap recently. + +## Hardware + +- Lenovo ThinkPad T470s +- Intel i7-7500U @ 2.7GHz +- 16GB memory +- 250GB NVMe SSD diff --git a/configurations/hina/home-manager/default.nix b/configurations/hina/home-manager/default.nix new file mode 100644 index 0000000..592bee0 --- /dev/null +++ b/configurations/hina/home-manager/default.nix @@ -0,0 +1,94 @@ +{ + inputs, + outputs, +}: let + pkgs-unstable = inputs.nixpkgs-unstable.legacyPackages.x86_64-linux; +in + inputs.home-manager.lib.homeManagerConfiguration { + pkgs = inputs.nixpkgs.legacyPackages.x86_64-linux; + extraSpecialArgs = {inherit inputs outputs pkgs-unstable;}; + + modules = [ + ../../../modules/home-manager/terminal_environment + ../../../modules/home-manager/terminal_environment/hsxkpasswd + ../../../modules/home-manager/terminal_environment/rclone + ../../../modules/home-manager/terminal_environment/ssh-config + ../../../modules/home-manager/desktop_environment + ../../../modules/home-manager/borgmatic.nix + ../../../modules/home-manager/cad.nix + ../../../modules/home-manager/development.nix + ../../../modules/home-manager/media.nix + ../../../modules/home-manager/office.nix + + ({pkgs, ...}: { + home.packages = with pkgs; [ + lightburn + scrcpy + nur.repos.DanNixon.metty + nur.repos.DanNixon.satorictl-unstable + ]; + + services.flatpak.packages = [ + "org.chromium.Chromium" + "com.microsoft.Edge" + + "com.adobe.Flash-Player-Projector" + ]; + + services.mpd.enable = true; + + programs.borgmatic.backups."main" = { + location = { + sourceDirectories = [ + "/home/dan/docs" + "/home/dan/notebook" + "/home/dan/.local/share/password-store" + "/home/dan/phone" + "/home/dan/tombs" + ]; + repositories = ["ssh://r4zp295h@r4zp295h.repo.borgbase.com/./repo"]; + }; + storage.encryptionPasscommand = "pass borg/hina/passphrase"; + }; + + wayland.windowManager.sway = { + checkConfig = false; # Does not work with background image paths + + config = { + input."2:7:SynPS/2_Synaptics_TouchPad" = { + events = "disabled"; + }; + + output = { + LVDS-1 = { + enable = ""; + }; + }; + }; + }; + + programs.i3status-rust.bars.main.blocks = [ + { + block = "sound"; + driver = "pulseaudio"; + device_kind = "sink"; + } + { + block = "sound"; + driver = "pulseaudio"; + device_kind = "source"; + } + { + block = "battery"; + } + { + block = "time"; + interval = 1; + format = " $timestamp.datetime(f:'%Y-%m-%d %H:%M:%S') "; + } + ]; + + programs.bottom.settings.flags.battery = true; + }) + ]; + } diff --git a/configurations/hina/nixos/default.nix b/configurations/hina/nixos/default.nix new file mode 100644 index 0000000..fad28b7 --- /dev/null +++ b/configurations/hina/nixos/default.nix @@ -0,0 +1,54 @@ +{ + inputs, + outputs, +}: +inputs.nixpkgs.lib.nixosSystem { + specialArgs = {inherit inputs outputs;}; + + modules = [ + inputs.disko.nixosModules.disko + ({modulesPath, ...}: { + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + }) + ./hardware.nix + ./disk-config.nix + inputs.nixos-hardware.nixosModules.lenovo-thinkpad-t470s + inputs.nixos-hardware.nixosModules.common-pc-ssd + + ../../../modules/nixos/base + ../../../modules/nixos/dan.nix + ../../../modules/nixos/desktop-environment.nix + ../../../modules/nixos/dnscrypt-proxy.nix + ../../../modules/nixos/networkmanager.nix + ../../../modules/nixos/peripherals/scanner.nix + ../../../modules/nixos/peripherals/sound.nix + ../../../modules/nixos/peripherals/yubikey.nix + ../../../modules/nixos/ssh.nix + ../../../modules/nixos/syncthing.nix + + { + networking.hostName = "hina"; + + services.dnscrypt-proxy2.settings.forwarding_rules = "/etc/dnscrypt-proxy2/forwarding-rules.txt"; + environment.etc."dnscrypt-proxy2/forwarding-rules.txt".text = '' + castle.dan-nixon.com 100.103.214.89 + ''; + + virtualisation.podman.enable = true; + services.upower.enable = true; + + services.tailscale = { + enable = true; + useRoutingFeatures = "client"; + }; + + dotfiles.dan.groups = ["video" "dialout"]; + dotfiles.dan.initialPassword = "change-me"; + + # Required for Bambu Lab printer discovery + networking.firewall.allowedUDPPorts = [2021]; + } + ]; +} diff --git a/configurations/hina/nixos/disk-config.nix b/configurations/hina/nixos/disk-config.nix new file mode 100644 index 0000000..763b753 --- /dev/null +++ b/configurations/hina/nixos/disk-config.nix @@ -0,0 +1,49 @@ +{ + disko.devices.disk = { + sda = { + type = "disk"; + device = "/dev/disk/by-id/nvme-SAMSUNG_MZVLW256HEHP-000L7_S35ENA0K226098"; + + content = { + type = "gpt"; + + partitions = { + boot = { + name = "boot"; + size = "1M"; + type = "EF02"; + }; + + ESP = { + name = "ESP"; + size = "512M"; + type = "EF00"; + + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + + root = { + name = "root"; + size = "100%"; + + content = { + type = "luks"; + name = "cryptedroot"; + extraOpenArgs = ["--allow-discards"]; + + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + }; + }; + }; + }; + }; + }; + }; +} diff --git a/configurations/hina/nixos/hardware.nix b/configurations/hina/nixos/hardware.nix new file mode 100644 index 0000000..4af2e5d --- /dev/null +++ b/configurations/hina/nixos/hardware.nix @@ -0,0 +1,13 @@ +{...}: { + boot.loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" "sr_mod"]; + boot.kernelModules = ["kvm-intel"]; + + hardware.cpu.intel.updateMicrocode = true; + + nixpkgs.hostPlatform = "x86_64-linux"; +} diff --git a/flake.nix b/flake.nix index bbd1bbf..a0a4bb9 100644 --- a/flake.nix +++ b/flake.nix @@ -92,6 +92,7 @@ nixosConfigurations = { akane = import ./configurations/akane/nixos {inherit inputs outputs;}; + hina = import ./configurations/hina/nixos {inherit inputs outputs;}; kawashiro = import ./configurations/kawashiro/nixos {inherit inputs outputs;}; maya = import ./configurations/maya/nixos {inherit inputs outputs;}; mitori = import ./configurations/mitori/nixos {inherit inputs outputs;}; @@ -102,6 +103,7 @@ homeConfigurations = { "dan@akane" = import ./configurations/akane/home-manager {inherit inputs outputs;}; generic = import ./configurations/generic/home-manager {inherit inputs outputs;}; + "dan@hina" = import ./configurations/hina/home-manager {inherit inputs outputs;}; "dan@kawashiro" = import ./configurations/kawashiro/home-manager {inherit inputs outputs;}; "dan@mitori" = import ./configurations/mitori/home-manager {inherit inputs outputs;}; "dan@maya" = import ./configurations/maya/home-manager {inherit inputs outputs;};