attempt modularilty
This commit is contained in:
parent
3f7c2eccc2
commit
73f883e6a4
5 changed files with 156 additions and 12 deletions
44
flake.nix
44
flake.nix
|
@ -26,13 +26,7 @@
|
||||||
nixosSystem = nixpkgs.lib.nixosSystem;
|
nixosSystem = nixpkgs.lib.nixosSystem;
|
||||||
mkMerge = nixpkgs.lib.mkMerge;
|
mkMerge = nixpkgs.lib.mkMerge;
|
||||||
|
|
||||||
settings = {
|
sett = {
|
||||||
system = {
|
|
||||||
hostname = "gpdPocket3";
|
|
||||||
architecture = "x86_64-linux";
|
|
||||||
timeZone = "America/Chicago";
|
|
||||||
defaultLocale = "en_US.UTF-8";
|
|
||||||
};
|
|
||||||
user = {
|
user = {
|
||||||
username = "josh";
|
username = "josh";
|
||||||
git = {
|
git = {
|
||||||
|
@ -51,10 +45,38 @@
|
||||||
ylib = ypkgs.lib;
|
ylib = ypkgs.lib;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosConfigurations.${settings.system.hostname} = nixosSystem {
|
nixosConfigurations = {
|
||||||
system = settings.system.architecture;
|
gpdPocket3 = nixosSystem {
|
||||||
modules = [ ./systems/_common/configuration.nix ./systems/${settings.system.hostname}/configuration.nix ];
|
system = "x86_64-linux";
|
||||||
specialArgs = inputs // { inherit settings; inherit ylib; };
|
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 = { };
|
# homeConfigurations = { };
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,8 +9,12 @@
|
||||||
let
|
let
|
||||||
publicKeys = [
|
publicKeys = [
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBdG4tG18VeuEr/g4GM7HWUzHuUVcR9k6oS3TPBs4JRF ragenix authority key"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBdG4tG18VeuEr/g4GM7HWUzHuUVcR9k6oS3TPBs4JRF ragenix authority key"
|
||||||
|
# gpdPocket3
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMhgYzACsd0GPuF8bl9SFB5y9KDwv+pU9UihoInzhRok josh@gpdPocket3"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMhgYzACsd0GPuF8bl9SFB5y9KDwv+pU9UihoInzhRok josh@gpdPocket3"
|
||||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJnV4aVyKStFH1KySfnuqBq+DLvyvJhRfKtMs7PCKlIq root@nixos"
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJnV4aVyKStFH1KySfnuqBq+DLvyvJhRfKtMs7PCKlIq root@nixos"
|
||||||
|
# joe
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG4PwrrOuZJWRjlc2dKBUKKE4ybqifJeVOn7x9J5IxIS josh@joe"
|
||||||
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIP+GYfPPKxR/18RdD736G7IQhImX/CYU3A+Gifud3CHg root@joe"
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
@ -10,7 +10,6 @@ in
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
# Include the results of the hardware scan.
|
# 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)
|
(/${settings.systemsDir}/${settings.system.hostname}/hardware-configuration.nix)
|
||||||
# home manager import
|
# home manager import
|
||||||
(import "${home-manager}/nixos")
|
(import "${home-manager}/nixos")
|
||||||
|
|
81
systems/joe/configuration.nix
Normal file
81
systems/joe/configuration.nix
Normal 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";
|
||||||
|
};
|
||||||
|
}
|
38
systems/joe/hardware-configuration.nix
Normal file
38
systems/joe/hardware-configuration.nix
Normal 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;
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue