Skip to content

Commit

Permalink
hina: initial config
Browse files Browse the repository at this point in the history
  • Loading branch information
DanNixon committed Jun 21, 2024
1 parent 8ade7f4 commit 8faef65
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 0 deletions.
10 changes: 10 additions & 0 deletions configurations/hina/README.md
Original file line number Diff line number Diff line change
@@ -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
94 changes: 94 additions & 0 deletions configurations/hina/home-manager/default.nix
Original file line number Diff line number Diff line change
@@ -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://[email protected]/./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;
})
];
}
56 changes: 56 additions & 0 deletions configurations/hina/nixos/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
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/adb.nix
../../../modules/nixos/peripherals/probe-rs.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];
}
];
}
49 changes: 49 additions & 0 deletions configurations/hina/nixos/disk-config.nix
Original file line number Diff line number Diff line change
@@ -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 = "/";
};
};
};
};
};
};
};
}
13 changes: 13 additions & 0 deletions configurations/hina/nixos/hardware.nix
Original file line number Diff line number Diff line change
@@ -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";
}
2 changes: 2 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;};
Expand All @@ -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;};
Expand Down

0 comments on commit 8faef65

Please sign in to comment.