From 998e9ac2fcff563e90af3c556bbdd86a797f8c18 Mon Sep 17 00:00:00 2001 From: "RingOfStorms (Joshua Bell)" Date: Thu, 2 Jan 2025 01:40:54 -0600 Subject: [PATCH] h002 new config --- hosts/h002/configuration.nix | 22 ------ hosts/h002/flake.nix | 104 +++++++++++++++++++++++++- hosts/h002/hardware-configuration.nix | 48 ++++++++---- hosts/lio/flake.nix | 2 - hosts/oren/flake.nix | 2 - 5 files changed, 137 insertions(+), 41 deletions(-) diff --git a/hosts/h002/configuration.nix b/hosts/h002/configuration.nix index 6f7248d..d169d1a 100644 --- a/hosts/h002/configuration.nix +++ b/hosts/h002/configuration.nix @@ -1,30 +1,8 @@ { pkgs, - settings, ... }: { - imports = [ - # Users this machine has - (settings.usersDir + "/root/configuration.nix") - (settings.usersDir + "/luser/configuration.nix") - ]; - - # My custom modules - mods = { - boot_grub.enable = true; - shell_common.enable = true; - # de_gnome_xorg.enable = true; - # audio.enable = true; - de_cosmic.enable = true; - neovim.enable = true; - tty_caps_esc.enable = true; - docker.enable = true; - stormd.enable = true; - nebula.enable = true; - ssh.enable = true; - }; - # machine specific configuration # ============================== hardware.enableAllFirmware = true; diff --git a/hosts/h002/flake.nix b/hosts/h002/flake.nix index 4640904..618e765 100644 --- a/hosts/h002/flake.nix +++ b/hosts/h002/flake.nix @@ -1 +1,103 @@ -# TODO +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + + mod_common.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_common"; + mod_common.inputs.nixpkgs.follows = "nixpkgs"; + mod_boot_grub.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_boot_grub"; + mod_ros_neovim.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_neovim"; + mod_ros_stormd.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_stormd"; + mod_nebula.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_nebula"; + mod_home-manager.url = "git+https://git.joshuabell.xyz/dotfiles?ref=mod_home_manager"; + mod_home-manager.inputs.home-manager.url = "github:rycee/home-manager/release-24.11"; + mod_home-manager.inputs.nixpkgs.follows = "nixpkgs"; + }; + + outputs = + { + nixpkgs, + ... + }@inputs: + let + configuration_name = "h002"; + lib = nixpkgs.lib; + in + { + nixosConfigurations = { + "${configuration_name}" = + let + auto_modules = builtins.concatMap ( + input: + lib.optionals + (builtins.hasAttr "nixosModules" input && builtins.hasAttr "default" input.nixosModules) + [ + input.nixosModules.default + ] + ) (builtins.attrValues inputs); + in + (lib.nixosSystem { + modules = [ + ./configuration.nix + ./hardware-configuration.nix + ( + { pkgs, ... }: + { + imports = [ + ../../components/nix/lua.nix + ../../components/nix/rust-repl.nix + ]; + + mods = { + common = { + systemName = configuration_name; + allowUnfree = true; + primaryUser = "luser"; + docker = true; + zsh = true; + users = { + luser = { + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJie9OPheWn/EZWfXJSZ3S0DnISqI3ToCmOqhX/Tkwby nix2h002" + ]; + initialPassword = "password1"; + isNormalUser = true; + extraGroups = [ + "wheel" + "networkmanager" + "video" + "input" + ]; + shell = pkgs.zsh; + }; + }; + }; + home_manager = { + users = { + luser = { + imports = [ + ../../components/hm/tmux/tmux.nix + ../../components/hm/atuin.nix + ../../components/hm/direnv.nix + ../../components/hm/git.nix + ../../components/hm/nix_deprecations.nix + ../../components/hm/postgres.nix + ../../components/hm/slicer.nix + ../../components/hm/ssh.nix + ../../components/hm/starship.nix + ../../components/hm/zoxide.nix + ../../components/hm/zsh.nix + ]; + }; + }; + }; + }; + } + ) + ] ++ auto_modules; + specialArgs = { + inherit inputs; + }; + }); + }; + }; +} diff --git a/hosts/h002/hardware-configuration.nix b/hosts/h002/hardware-configuration.nix index d1fbb4c..4065b7c 100644 --- a/hosts/h002/hardware-configuration.nix +++ b/hosts/h002/hardware-configuration.nix @@ -1,29 +1,49 @@ # 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, ... }: +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "firewire_ohci" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.availableKernelModules = [ + "ehci_pci" + "ahci" + "xhci_pci" + "firewire_ohci" + "usb_storage" + "usbhid" + "sd_mod" + "sr_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ "kvm-intel" ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-label/NIXROOT"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/NIXROOT"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-label/NIXBOOT"; - fsType = "vfat"; - }; + fileSystems."/boot" = { + device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + }; - swapDevices = [ ]; + swapDevices = [ + { + device = "/.swapfile"; + size = 18 * 1024; # 18GB + } + ]; # 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 diff --git a/hosts/lio/flake.nix b/hosts/lio/flake.nix index 747c3ec..45a628c 100644 --- a/hosts/lio/flake.nix +++ b/hosts/lio/flake.nix @@ -1,6 +1,4 @@ { - description = "lio system flake"; - inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; diff --git a/hosts/oren/flake.nix b/hosts/oren/flake.nix index 86eca09..0ba1d37 100644 --- a/hosts/oren/flake.nix +++ b/hosts/oren/flake.nix @@ -1,6 +1,4 @@ { - description = "oren system flake"; - inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";