hosts/artemis: init
All checks were successful
Check flake / build-amd64-linux (push) Successful in 1m22s

This commit is contained in:
2025-07-19 15:22:05 +01:00
parent 8421c327e4
commit 8a4ae7b3b7
6 changed files with 279 additions and 4 deletions

8
flake.lock generated
View File

@@ -1000,11 +1000,11 @@
"secrets": {
"flake": false,
"locked": {
"lastModified": 1750611706,
"narHash": "sha256-bKhQ+lAaNtfpTUR3fysCdbnMfYT5PJ4diiM9EkHMdHI=",
"lastModified": 1752936308,
"narHash": "sha256-OAlj8oJpcKo9cCIwxzMolnwdfczlovvC1y1MeIpDPYM=",
"ref": "refs/heads/master",
"rev": "ae16fda90546dde6c014a4f91a5443bce4dce234",
"revCount": 34,
"rev": "eddee7a0b83063ba60c0dd49fc18399b6564559d",
"revCount": 36,
"type": "git",
"url": "ssh://git@git.vimium.com/jordan/nix-secrets.git"
},

36
hosts/artemis/README.md Normal file
View File

@@ -0,0 +1,36 @@
# Artemis
## Overview
Couch gaming PC and media centre
## Specs
* CPU - AMD Ryzen 7 9800X3D @ 4.70GHz
* Chipset - AMD B850
* Memory - 64 GB DDR5
* Motherboard - ASUS ROG STRIX B850-I Gaming WiFi
* GPU - AMD Radeon 7900 XTX
* Case - MCPRUE Apollo S v4
### Disks
Device | Partitions _(filesystem, size, usage)_
--- | ---
WD Black SN850X | `/dev/nvme0n1p1` (EFI, 500 MiB, NixOS Boot) <br> `/dev/nvme0n1p2` (ZFS, 4 TiB, NixOS Root)
#### 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 `10.0.1.0/24` subnet.
- Tailscale on `100.64.0.0/10` subnet. FQDN: `artemis.mesh.vimium.net`.

56
hosts/artemis/default.nix Normal file
View File

@@ -0,0 +1,56 @@
{
inputs,
lib,
pkgs,
...
}:
{
imports = [
inputs.disko.nixosModules.disko
./hardware-configuration.nix
./disko-config.nix
../desktop.nix
];
nixpkgs = {
hostPlatform = "x86_64-linux";
};
boot.loader = {
systemd-boot = {
enable = true;
graceful = true;
};
efi.canTouchEfiVariables = true;
};
networking = {
hostId = "4f9a2b7e";
networkmanager.enable = true;
};
services.sunshine = {
enable = false;
package = pkgs.unstable.sunshine;
capSysAdmin = true;
};
modules = {
services = {
borgmatic = {
enable = true;
directories = [
"/home/jordan/Documents"
];
repoPath = "ssh://neafzrj7@neafzrj7.repo.borgbase.com/./repo";
};
};
system.desktop = {
gnome.enable = lib.mkForce false;
hyprland.enable = true;
};
};
system.stateVersion = "25.05";
}

View File

@@ -0,0 +1,118 @@
{ ... }:
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/disk/by-id/nvme-WD_BLACK_SN850X_4000GB_25115L4A0708";
content = {
type = "gpt";
partitions = {
ESP = {
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "rpool";
};
};
};
};
};
};
zpool = {
rpool = {
type = "zpool";
options = {
ashift = "12";
};
rootFsOptions = {
canmount = "off";
mountpoint = "none";
dnodesize = "auto";
xattr = "sa";
};
postCreateHook = "zfs snapshot rpool@blank";
datasets = {
local = {
type = "zfs_fs";
options = {
mountpoint = "none";
};
};
"local/nix" = {
type = "zfs_fs";
mountpoint = "/nix";
options = {
atime = "off";
mountpoint = "legacy";
};
};
"local/tmp" = {
type = "zfs_fs";
mountpoint = "/tmp";
options = {
setuid = "off";
devices = "off";
mountpoint = "legacy";
};
};
system = {
type = "zfs_fs";
mountpoint = "/";
options = {
mountpoint = "legacy";
};
};
"system/var" = {
type = "zfs_fs";
mountpoint = "/var";
options = {
mountpoint = "legacy";
};
};
"system/var/tmp" = {
type = "zfs_fs";
mountpoint = "/var/tmp";
options = {
devices = "off";
mountpoint = "legacy";
};
};
"system/var/log" = {
type = "zfs_fs";
mountpoint = "/var/log";
options = {
compression = "on";
acltype = "posix";
mountpoint = "legacy";
};
};
user = {
type = "zfs_fs";
options = {
mountpoint = "none";
};
};
"user/home" = {
type = "zfs_fs";
mountpoint = "/home";
options = {
setuid = "off";
devices = "off";
mountpoint = "legacy";
};
};
};
};
};
};
}

View File

@@ -0,0 +1,45 @@
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot = {
initrd.availableKernelModules = [
"xhci_pci"
"ehci_pci"
"nvme"
"usbhid"
"usb_storage"
"sd_mod"
];
initrd.kernelModules = [ ];
initrd.supportedFilesystems = [ "zfs" ];
kernelModules = [ "kvm-amd" ];
kernelPackages = pkgs.linuxPackages_6_12;
supportedFilesystems = [ "ntfs" ];
};
hardware = {
bluetooth = {
enable = true;
powerOnBoot = true;
};
cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
};
powerManagement.cpuFreqGovernor = "schedutil";
services.xserver.videoDrivers = [ "amdgpu" ];
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

20
users/jordan/artemis.nix Normal file
View File

@@ -0,0 +1,20 @@
{
pkgs,
...
}:
{
imports = [
./common/optional/graphical/firefox.nix
./common/optional/graphical/fonts.nix
./common/optional/graphical/hyprland
./common/optional/graphical/mimeapps.nix
];
home.packages = with pkgs; [
jellyfin-media-player
lutris
unstable.pcsx2
xemu
];
}