attempt modularilty

This commit is contained in:
ringofstorms 2024-03-31 19:39:48 -05:00
parent 3f7c2eccc2
commit 73f883e6a4
5 changed files with 156 additions and 12 deletions

View file

@ -26,13 +26,7 @@
nixosSystem = nixpkgs.lib.nixosSystem;
mkMerge = nixpkgs.lib.mkMerge;
settings = {
system = {
hostname = "gpdPocket3";
architecture = "x86_64-linux";
timeZone = "America/Chicago";
defaultLocale = "en_US.UTF-8";
};
sett = {
user = {
username = "josh";
git = {
@ -51,10 +45,38 @@
ylib = ypkgs.lib;
in
{
nixosConfigurations.${settings.system.hostname} = nixosSystem {
system = settings.system.architecture;
modules = [ ./systems/_common/configuration.nix ./systems/${settings.system.hostname}/configuration.nix ];
specialArgs = inputs // { inherit settings; inherit ylib; };
nixosConfigurations = {
gpdPocket3 = nixosSystem {
system = "x86_64-linux";
modules = [ ./systems/_common/configuration.nix ./systems/gpdPocket3/configuration.nix ];
specialArgs = inputs // { inherit ylib;
settings = sett // {
system = {
# TODO remove these probably not needed anymore with per machine specified here
hostname = "gpdPocket3";
architecture = "x86_64-linux";
timeZone = "America/Chicago"; # TODO roaming?
defaultLocale = "en_US.UTF-8";
};
};
};
};
joe = nixosSystem {
system = "x86_64-linux";
modules = [ ./systems/_common/configuration.nix ./systems/joe/configuration.nix ];
specialArgs = inputs // { inherit ylib;
settings = sett // {
system = {
# TODO remove these probably not needed anymore with per machine specified here
hostname = "joe";
architecture = "x86_64-linux";
# TODO remove?
timeZone = "America/Chicago";
defaultLocale = "en_US.UTF-8";
};
};
};
};
};
# homeConfigurations = { };
};

View file

@ -9,8 +9,12 @@
let
publicKeys = [
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBdG4tG18VeuEr/g4GM7HWUzHuUVcR9k6oS3TPBs4JRF ragenix authority key"
# gpdPocket3
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMhgYzACsd0GPuF8bl9SFB5y9KDwv+pU9UihoInzhRok josh@gpdPocket3"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJnV4aVyKStFH1KySfnuqBq+DLvyvJhRfKtMs7PCKlIq root@nixos"
# joe
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG4PwrrOuZJWRjlc2dKBUKKE4ybqifJeVOn7x9J5IxIS josh@joe"
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP+GYfPPKxR/18RdD736G7IQhImX/CYU3A+Gifud3CHg root@joe"
];
in
{

View file

@ -10,7 +10,6 @@ in
imports =
[
# Include the results of the hardware scan.
# Note we need to be in the /etc/nixos directory with this entire config repo for this relative path to work
(/${settings.systemsDir}/${settings.system.hostname}/hardware-configuration.nix)
# home manager import
(import "${home-manager}/nixos")

View file

@ -0,0 +1,81 @@
{ config, lib, pkgs, settings, ... } @ args:
{
imports =
[
(settings.usersDir + "/root/configuration.nix")
(settings.usersDir + "/josh/configuration.nix")
];
# Use the systemd-boot EFI boot loader.
boot.loader = {
systemd-boot = {
enable = true;
consoleMode = "keep";
};
timeout = 5;
efi = {
canTouchEfiVariables = true;
};
};
# We want connectivity
networking.networkmanager.enable = true;
hardware.bluetooth.enable = true;
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
hardware.pulseaudio.package = pkgs.pulseaudioFull;
hardware.enableAllFirmware = true;
# I want this globally even for root so doing it outside of home manager
services.xserver.xkbOptions = "caps:escape";
console = {
earlySetup = true;
packages = with pkgs; [ terminus_font ];
# We want to be able to read the screen so use a 32 sized font...
# font = "${pkgs.terminus_font}/share/consolefonts/ter-132n.psf.gz";
useXkbConfig = true; # use xkb.options in tty. (caps -> escape)
};
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh.settings.PermitRootLogin = "yes";
# Open ports in the firewall.
networking.firewall.allowedTCPPorts = [
22 # sshd
];
# networking.firewall.allowedUDPPorts = [ ... ];
fonts.packages = with pkgs; [
(nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
];
services.xserver.enable = true;
services.xserver.displayManager.gdm = {
enable = true;
autoSuspend = false;
};
services.xserver.desktopManager.gnome.enable = true;
services.gnome.core-utilities.enable = false;
# List packages installed in system profile. To search, run:
# $ nix search wget
nixpkgs.config.allowUnfree = true;
environment.systemPackages = with pkgs; [
# extras, more for my neovim setup TODO move these into a more isolated place for nvim setup? Should be its own flake probably
cargo
rustc
nodejs_21
python313
# ripgrep # now in common
nodePackages.cspell
];
# does for all shells. Can use `programs.zsh.shellAliases` for specific ones
environment.shellAliases = {
wifi = "nmtui";
};
}

View file

@ -0,0 +1,38 @@
# 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 = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-label/NIXROOT";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-label/NIXBOOT";
fsType = "vfat";
};
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.enp2s0.useDHCP = lib.mkDefault true;
# networking.interfaces.wlo1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}