1
Fork 0

Add base homserver config

This commit is contained in:
caem 2023-06-24 23:09:01 +02:00
parent 45d315023f
commit 26694e1e52
8 changed files with 101 additions and 17 deletions

14
.gitignore vendored
View file

@ -1,14 +1,2 @@
nixos/result nixos/result
pw
# -- Vim --
# swap
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
# session
Session.vim
# temporary
.netrwhist
*~
# auto-generated tag files
tags

View file

@ -12,6 +12,15 @@
outputs = { self, nixpkgs, ... }@attrs: let outputs = { self, nixpkgs, ... }@attrs: let
user = "user"; # Select user from `./users` directory user = "user"; # Select user from `./users` directory
in { in {
nixosConfigurations.homeserver = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
specialArgs = attrs;
modules = [
./users/${user}.nix
./systems/homeserver.nix
];
};
# Debugging VM configuration # Debugging VM configuration
nixosConfigurations.qemu-vm = nixpkgs.lib.nixosSystem { nixosConfigurations.qemu-vm = nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";

View file

@ -24,7 +24,6 @@
set number set number
set relativenumber set relativenumber
set nobackup set nobackup
set undofile
set scrolloff=8 set scrolloff=8
set sidescrolloff=8 set sidescrolloff=8
set fileencoding='utf-8' set fileencoding='utf-8'

View file

@ -0,0 +1,44 @@
{ config, lib, modulesPath, ... }:
{
imports = [
(modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "ums_realtek" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
boot.initrd.postDeviceCommands = lib.mkAfter ''
zfs rollback -r local/root@blank
'';
fileSystems."/" = {
device = "local/root";
fsType = "zfs";
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/5C0E-1600";
fsType = "vfat";
};
fileSystems."/nix" = {
device = "local/nix";
fsType = "zfs";
};
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;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

38
systems/homeserver.nix Normal file
View file

@ -0,0 +1,38 @@
{ ... }:
{
imports = [
./common.nix
./hardware/homeserver.nix
./persist/homeserver.nix
../sets/meta/sysadmin.nix
../packages/vim/package.nix
];
boot.loader = {
efi = {
canTouchEfiVariables = true;
};
grub = {
enable = true;
efiSupport = true;
device = "nodev";
};
};
networking = {
hostId = "95f846dc";
interfaces = {
eno1.ipv4.addresses = [{
address = "192.168.2.69";
prefixLength = 24;
}];
};
};
time.timeZone = "Europe/Berlin";
console = {
keyMap = "uk";
};
}

View file

@ -13,7 +13,6 @@
files = [ files = [
"/etc/machine-id" "/etc/machine-id"
"/etc/shadow"
]; ];
}; };
} }

View file

@ -0,0 +1,7 @@
{ ... }:
{
imports = [
./common.nix
];
}

View file

@ -1,9 +1,9 @@
{ config, pkgs, ... }: { ... }:
{ {
users.users.user = { users.users.user = {
isNormalUser = true; isNormalUser = true;
initialPassword = "ReplaceMe"; passwordFile = "/nix/config/pw"; # mkpasswd in config dir
description = "user"; description = "user";
extraGroups = [ extraGroups = [
"wheel" "wheel"