This commit is contained in:
Henri Dohmen 2025-05-30 22:46:27 +02:00
parent a992a7b701
commit b61bb970a5
30 changed files with 69 additions and 34 deletions

22
host/boot.nix Normal file
View file

@ -0,0 +1,22 @@
{ pkgs, ... }:
{
boot = {
loader = {
efi.canTouchEfiVariables = true;
grub = {
enable = true;
efiSupport = true;
device = "nodev";
};
};
# otherwise /tmp is on disk. This *may* be problematic as nix
# builds in /tmp but I think my swap is large enough...
tmp.useTmpfs = true;
kernelPackages = pkgs.linuxPackages_6_13;
kernel.sysctl."kernel.sysrq" = 1;
initrd.systemd.network.wait-online.enable = false;
};
}

View file

@ -7,6 +7,7 @@
common-cpu-intel
common-pc-laptop
common-pc-laptop-ssd
../../pc
];
boot.loader.efi.efiSysMountPoint = "/boot/efi";

10
host/default.nix Normal file
View file

@ -0,0 +1,10 @@
{ ... }:
{
imports = [
./boot.nix
./locale.nix
./nix.nix
./shell.nix
./users.nix
];
}

25
host/locale.nix Normal file
View file

@ -0,0 +1,25 @@
{ ... }:
{
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = {
LC_ADDRESS = "de_DE.UTF-8";
LC_IDENTIFICATION = "de_DE.UTF-8";
LC_MEASUREMENT = "de_DE.UTF-8";
LC_MONETARY = "de_DE.UTF-8";
LC_NAME = "de_DE.UTF-8";
LC_NUMERIC = "de_DE.UTF-8";
LC_PAPER = "de_DE.UTF-8";
LC_TELEPHONE = "de_DE.UTF-8";
LC_TIME = "de_DE.UTF-8";
};
console.keyMap = "de";
# Configure keymap in X11
services.xserver.xkb = {
layout = "de";
variant = "";
};
}

18
host/nix.nix Normal file
View file

@ -0,0 +1,18 @@
{
lib,
inputs,
config,
...
}:
{
nix.settings = {
experimental-features = [
"nix-command"
"flakes"
];
trusted-users = [ "root" ];
auto-optimise-store = true;
};
nixpkgs.config.allowUnfree = false;
}

View file

@ -1,11 +1,14 @@
{ lib', ... }:
let
submodules = lib'.walk-dir ./.;
in
{
networking.hostName = "roam";
imports = [ submodules.to_mod_without_default ];
imports = [
./hardware-configuration.nix
./networking.nix
./secruity.nix
./services.nix
./wireguard.nix
];
# ====== DON'T CHANGE ======
system.stateVersion = "24.11";

50
host/shell.nix Normal file
View file

@ -0,0 +1,50 @@
{ pkgs, inputs, ... }:
{
environment.shells = with pkgs; [
bashInteractive
fish
];
environment.systemPackages = with pkgs; [
bc
docker-compose
fd
gh
htop
killall
ripgrep
starship
stow
unzip
wget
wl-clipboard
colmena
unison
];
programs = {
fish.enable = true;
git.enable = true;
tmux = {
enable = true;
clock24 = true;
};
neovim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
};
};
# --- Excludes ---
programs.nano.enable = false;
# Enabled by fish but takes soooo long.
# This is apparently used by some of fish's
# autocomplete features.
documentation.man.generateCaches = false;
# To stop the annoying error on entering wrong commands
programs.command-not-found.enable = false;
}

View file

@ -1,11 +1,13 @@
{ lib', ... }:
let
submodules = lib'.walk-dir ./.;
in
{ ... }:
{
networking.hostName = "solo";
imports = [ submodules.to_mod_without_default ];
imports = [
./hardware-configuration.nix
./keyboard.nix
./nvidia-gpu.nix
../../pc
];
powerManagement = {
enable = true;

27
host/users.nix Normal file
View file

@ -0,0 +1,27 @@
{
pkgs,
lib,
options,
var,
...
}:
{
users = {
mutableUsers = false;
users."hd" = {
description = "Henri";
isNormalUser = true;
createHome = true;
home = "/home/hd";
extraGroups = [ "wheel" ];
shell = pkgs.fish;
packages = [ ];
openssh.authorizedKeys.keys = var.ssh-keys.unprivileged;
hashedPassword = "$y$jDT$dhvO.xqs8mopz.sFFul.q/$ud5642o7CnVetU6QEu0ctiVMFh7ngZznDf0wp4cXos8";
};
users.root = {
hashedPassword = "!";
openssh.authorizedKeys.keys = var.ssh-keys.priviliged;
};
};
}