From 4513f93fb1f9a9b21f81d0ff63ab9c83e36e11b5 Mon Sep 17 00:00:00 2001 From: Joseph Hanson Date: Tue, 23 Apr 2024 13:11:38 -0500 Subject: [PATCH] Add Telperion, the additional services node. --- flake.nix | 14 +++++ home-manager/telperion.nix | 68 ++++++++++++++++++++++ nixos/telperion/configuration.nix | 68 ++++++++++++++++++++++ nixos/telperion/hardware-configuration.nix | 38 ++++++++++++ 4 files changed, 188 insertions(+) create mode 100644 home-manager/telperion.nix create mode 100644 nixos/telperion/configuration.nix create mode 100644 nixos/telperion/hardware-configuration.nix diff --git a/flake.nix b/flake.nix index 8ca2d4b..b3affd5 100644 --- a/flake.nix +++ b/flake.nix @@ -120,6 +120,20 @@ } ]; }; + "telperion" = nixpkgs-stable.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = {inherit inputs outputs;}; + modules = [ + ./nixos/telperion/configuration.nix + ./nixos/common.nix + home-manager-stable.nixosModules.home-manager + { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.jahanson = import ./home-manager/telperion.nix; + } + ]; + }; }; }; } diff --git a/home-manager/telperion.nix b/home-manager/telperion.nix new file mode 100644 index 0000000..796e980 --- /dev/null +++ b/home-manager/telperion.nix @@ -0,0 +1,68 @@ +{ + pkgs, + ... +}: { + + home = { + username = "jahanson"; + homeDirectory = "/home/jahanson"; + }; + + # basic configuration of git, please change to your own + programs.git = { + enable = true; + userName = "Joseph Hanson"; + userEmail = "joe@veri.dev"; + }; + + # Fish configuration + programs.fish = { + enable = true; + shellAliases = { + # lsd + ls = "lsd"; + ll = "lsd -l"; + la = "lsd -a"; + lt = "lsd --tree"; + lla = "lsd -la"; + + # other + df = "df -h"; + du = "du -h"; + + # nvd - nix visual diff + nvdiff = "nixos-rebuild build && nvd diff /run/current-system result"; + }; + # rtx hook-env | source + # rtx activate fish | source + shellInit = '' + direnv hook fish | source + set -gx PATH $PATH $HOME/.krew/bin + ''; + interactiveShellInit = '' + atuin init fish | source + ''; + functions = { + fish_greeting = { + description = "Set the fish greeting"; + body = "fastfetch"; + }; + }; + }; + + # Packages that should be installed to the user profile. + home.packages = with pkgs; [ + # here is some command line tools I use frequently + # feel free to add your own or remove some of them + + # nix related + # + # it provides the command `nom` works just like `nix` + # with more details log output + nix-output-monitor + + ]; + + home.stateVersion = "23.11"; + programs.home-manager.enable = true; +} diff --git a/nixos/telperion/configuration.nix b/nixos/telperion/configuration.nix new file mode 100644 index 0000000..7136fb9 --- /dev/null +++ b/nixos/telperion/configuration.nix @@ -0,0 +1,68 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page, on +# https://search.nixos.org/options and in the NixOS manual (`nixos-help`). + +{ config, lib, pkgs, ... }: + +{ + imports = + [ # Include the results of the hardware scan. + ./hardware-configuration.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + # Network settings + networking = { + hostName = "Telperion"; # Define your hostname. + networkmanager.enable = true; + }; + # Set your time zone. + time.timeZone = "America/Chicago"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + # Define a user account. Don't forget to set a password with ‘passwd’. + users.users.jahanson = { + isNormalUser = true; + extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + packages = with pkgs; [ + tree + ]; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + wget + ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + services.openssh = { + enable = true; + settings.PasswordAuthentication = false; + settings.KbdInteractiveAuthentication = false; + }; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + networking.firewall.enable = false; + system.stateVersion = "23.11"; # Did you read the comment? + +} \ No newline at end of file diff --git a/nixos/telperion/hardware-configuration.nix b/nixos/telperion/hardware-configuration.nix new file mode 100644 index 0000000..70f5794 --- /dev/null +++ b/nixos/telperion/hardware-configuration.nix @@ -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" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/957686d5-f744-4f8a-8587-9ba24dcbb244"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/B976-0673"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} \ No newline at end of file