Migrate config from dotfiles

This commit is contained in:
2023-06-26 14:40:59 +01:00
parent e45609ea4b
commit a7e1525e34
69 changed files with 2236 additions and 161 deletions

38
hosts/helios/README.md Normal file
View File

@ -0,0 +1,38 @@
# Helios
## Overview
Dell OptiPlex 980 small form factor desktop.
## Specs
* CPU - Intel Core i7-860 @ 2.8GHz
* Chipset - Intel Q57 Express
* Memory - 8 GB DDR2
* GPU - AMD FirePro 2460
* NIC - Intel Gigabit 82578DM
### Disks
Device | Partitions _(filesystem, size, usage)_
--- | ---
SanDisk Ultra II | `/dev/sda1` (ext2, 200 MiB, NixOS Boot) <br> `/dev/sda2` (ZFS, 480 GiB, NixOS Root)
> Note: The BIOS firmware on this machine only supports booting from disks with
> an MBR partition table.
#### ZFS pool layout
```
rpool/
├── local
│ ├── nix
│ └── tmp
├── system
│ ├── root
│ └── var
└── user
└── home
```
See [Graham Christensen's article](https://grahamc.com/blog/nixos-on-zfs/#datasets) for the motivation behind these datasets.
### Networks
- DHCP on `192.168.1.0/24` subnet.
- Tailscale on `100.64.0.0/10` subnet. FQDN: `helios.mesh.vimium.net`.

50
hosts/helios/default.nix Normal file
View File

@ -0,0 +1,50 @@
{ config, lib, pkgs, ... }:
with lib.my;
{
imports = [
./hardware-configuration.nix
../desktop.nix
];
boot.loader.grub.enable = true;
boot.loader.grub.version = 2;
boot.loader.grub.device = "/dev/sda";
boot.loader.grub.zfsSupport = true;
networking.hostName = "helios";
networking.hostId = "47d23505";
networking.networkmanager.enable = true;
nix.package = pkgs.nixFlakes;
nix.extraOptions = ''
experimental-features = nix-command flakes
'';
users.defaultUserShell = pkgs.zsh;
system.stateVersion = "22.11";
modules = {
desktop = {
apps.qbittorrent.enable = true;
browsers = {
firefox.enable = true;
};
};
dev = {
node.enable = true;
};
editors = {
neovim.enable = true;
};
security = {
gpg.enable = true;
pass.enable = true;
};
shell = {
git.enable = true;
zsh.enable = true;
};
};
}

View File

@ -0,0 +1,65 @@
# 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 = [ "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" "zfs" ];
boot.initrd.kernelModules = [ ];
boot.initrd.supportedFilesystems = [ "zfs" ];
boot.kernelModules = [ "kvm-intel" ];
boot.kernelParams = [ "elevator=none" ];
boot.extraModulePackages = [ ];
boot.supportedFilesystems = [ "zfs" ];
fileSystems."/" =
{ device = "rpool/system/root";
fsType = "zfs";
};
fileSystems."/home" =
{ device = "rpool/user/home";
fsType = "zfs";
};
fileSystems."/nix" =
{ device = "rpool/local/nix";
fsType = "zfs";
};
fileSystems."/tmp" =
{ device = "rpool/local/tmp";
fsType = "zfs";
};
fileSystems."/var/log" =
{ device = "rpool/system/var/log";
fsType = "zfs";
};
fileSystems."/var/tmp" =
{ device = "rpool/system/var/tmp";
fsType = "zfs";
};
fileSystems."/boot" =
{ device = "/dev/sda1";
fsType = "ext2";
};
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.eno1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}