reorganization & hardware

This commit is contained in:
Reid 2025-01-28 22:03:36 -08:00
parent b4b6ffc3b9
commit 1ae4c328f8
Signed by: reidlab
GPG key ID: DAF5EAF6665839FD
6 changed files with 48 additions and 50 deletions

View file

@ -12,6 +12,10 @@ in {
] ]
++ (mapModulesRec' (toString ./modules) import); ++ (mapModulesRec' (toString ./modules) import);
environment.variables = {
NIXPKGS_ALLOW_UNFREE = "1";
};
nix = { nix = {
package = pkgs.nix; package = pkgs.nix;
@ -32,11 +36,23 @@ in {
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
]; ];
}; };
optimise.automatic = true;
gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
}; };
# set our git revision inside `nixos-version` system.stateVersion = mkDefault "23.11";
system.configurationRevision = with inputs; mkIf (self ? rev) self.rev; system.configurationRevision = with inputs; mkIf (self ? rev) self.rev;
boot = {
kernelPackages = mkDefault pkgs.linuxPackages_latest;
kernelParams = [ "pci_aspm.policy=performance" ];
};
time.timeZone = mkDefault "America/Los_Angeles"; time.timeZone = mkDefault "America/Los_Angeles";
i18n.defaultLocale = mkDefault "en_US.UTF-8"; i18n.defaultLocale = mkDefault "en_US.UTF-8";
@ -47,10 +63,6 @@ in {
unrar unzip unrar unzip
micro micro
curl wget curl wget
# im pretty sure removing this breaks nixos-rebuild
# have fun
git git
]; ];
system.stateVersion = mkDefault "23.11";
} }

View file

@ -7,6 +7,8 @@
home-manager.url = "github:nix-community/home-manager"; home-manager.url = "github:nix-community/home-manager";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
hardware.url = "github:nixos/nixos-hardware";
vscode-server.url = "github:nix-community/nixos-vscode-server"; vscode-server.url = "github:nix-community/nixos-vscode-server";
}; };

View file

@ -1,8 +1,6 @@
{ config, lib, pkgs, ... }: { config, lib, pkgs, ... }:
let {
in {
imports = [ imports = [
./hardware.nix ./hardware.nix
./webapps/default.nix ./webapps/default.nix
@ -51,5 +49,6 @@ in {
}; };
# enable network manager - probably not the best on a single server but Oh Well # enable network manager - probably not the best on a single server but Oh Well
# perhaps i could move it next to my router for easier ethernet access
networking.networkmanager.enable = true; networking.networkmanager.enable = true;
} }

View file

@ -1,33 +1,34 @@
{ config, lib, pkgs, modulesPath, ... }: { inputs, config, lib, pkgs, modulesPath, ... }:
{ {
imports = imports = [
[ inputs.hardware.nixosModules.common-pc-ssd
(modulesPath + "/installer/scan/not-detected.nix") inputs.hardware.nixosModules.common-pc
]; # uses mkDefault to set to a patched kernel,
# but it conflicts with one of our mkDefault settings
#inputs.hardware.nixosModules.raspberry-pi-4
boot = { (modulesPath + "/installer/scan/not-detected.nix")
initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ]; ];
initrd.kernelModules = [ ];
kernelModules = [ ];
extraModulePackages = [ ];
# TODO: move bootloader, networking, boot speed to another file?
kernelPackages = pkgs.linuxPackages_latest;
loader = {
# use u-boot over grub
grub.enable = lib.mkForce false;
generic-extlinux-compatible.enable = true;
};
};
fileSystems."/" = { # use better power management for a device that's always on
device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888"; powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ ];
boot.extraModulePackages = [ ];
# for some god forsaken reason, generic-extlinux-compatible doesn't disable grub like systemd-boot does
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
fileSystems."/" =
{ device = "/dev/disk/by-uuid/44444444-4444-4444-8888-888888888888";
fsType = "ext4"; fsType = "ext4";
options = [ "noatime" "nodiratime" "discard" ];
}; };
swapDevices =
[ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking # 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 # (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 # still possible to use this option, but it's recommended to use it in conjunction
@ -37,5 +38,4 @@
# networking.interfaces.wlan0.useDHCP = lib.mkDefault true; # networking.interfaces.wlan0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux"; nixpkgs.hostPlatform = lib.mkDefault "aarch64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
} }

View file

@ -39,7 +39,7 @@ in {
locations."/f/".extraConfig = '' locations."/f/".extraConfig = ''
add_header Access-Control-Allow-Origin "*"; add_header Access-Control-Allow-Origin "*";
''; '';
# we should perhaps add something to help with this in staticsites? # TODO: we should perhaps add something to help with this in staticSites?
extraConfig = '' extraConfig = ''
error_page 404 /404.html; error_page 404 /404.html;
''; '';

View file

@ -1,9 +1,8 @@
{ options, config, lib, pkgs, ... }: { options, config, lib, pkgs, ... }:
with lib; with lib;
let {
# TODO: what the hell is this
in {
options = { options = {
user = mkOption { user = mkOption {
type = types.attrs; type = types.attrs;
@ -35,10 +34,6 @@ in {
description = "(XDG) Configuration files managed by home-manager"; description = "(XDG) Configuration files managed by home-manager";
}; };
}; };
configDir = mkOption {
type = types.path;
default = ../config;
};
}; };
config = { config = {
@ -56,16 +51,6 @@ in {
xdg.configFile = mkAliasDefinitions options.home.configFile; xdg.configFile = mkAliasDefinitions options.home.configFile;
}; };
environment = {
sessionVariables = {
XDG_CACHE_HOME = "$HOME/.cache";
XDG_CONFIG_HOME = "$HOME/.config";
XDG_DATA_HOME = "$HOME/.local/share";
XDG_BIN_HOME = "$HOME/.local/bin";
XDG_DESKTOP_DIR = "$HOME";
};
};
users.groups = mapAttrs (_: _: {}) config.normalUsers; users.groups = mapAttrs (_: _: {}) config.normalUsers;
users.users = mapAttrs (username: user: (mkMerge [ users.users = mapAttrs (username: user: (mkMerge [