From d794cbecfdf3e9db0e5542f4a5edffa0329c63ef Mon Sep 17 00:00:00 2001 From: caleb Date: Mon, 4 Mar 2024 00:23:39 -0500 Subject: [PATCH] first commit --- application-configuration.nix | 10 +++++ configuration.nix | 73 +++++++++++++++++++++++++++++++++++ hardware-configuration.nix | 40 +++++++++++++++++++ virtualisation.nix | 14 +++++++ 4 files changed, 137 insertions(+) create mode 100644 application-configuration.nix create mode 100644 configuration.nix create mode 100644 hardware-configuration.nix create mode 100644 virtualisation.nix diff --git a/application-configuration.nix b/application-configuration.nix new file mode 100644 index 0000000..f6a5155 --- /dev/null +++ b/application-configuration.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: +{ + users.users.caleb.packages = with pkgs; [ + john + ]; + + environment.systemPackages = with pkgs; [ + podman-compose + ]; +} diff --git a/configuration.nix b/configuration.nix new file mode 100644 index 0000000..9baffcf --- /dev/null +++ b/configuration.nix @@ -0,0 +1,73 @@ +{ config, lib, pkgs, ... }: +{ + imports = + [ + ./hardware-configuration.nix + ./application-configuration.nix + ./virtualisation.nix + ]; + + # Use the systemd-boot EFI boot loader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + networking.hostName = "talos"; + + # Set your time zone. + time.timeZone = "America/New_York"; + + nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + "intel-ocl" + ]; + + hardware.opengl.extraPackages = with pkgs; [ + intel-ocl + ]; + + users.users.caleb = { + isNormalUser = true; + extraGroups = [ "wheel" ]; + hashedPassword = "$y$j9T$v6EDyPW8C/K.Th4xg8MHL/$tA67k6U0kLtafTNNW2DM7j.xObjPSaZFQ4e/beBX7g2"; + }; + + environment.systemPackages = with pkgs; [ + wget + git + screen + ]; + + # disable sudo password for wheel + security.sudo.wheelNeedsPassword = false; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + # Enable tailscale + services.tailscale.enable = true; + + #neovim + programs.neovim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + }; + + # This option defines the first version of NixOS you have installed on this particular machine, + # and is used to maintain compatibility with application data (e.g. databases) created on older NixOS versions. + # + # Most users should NEVER change this value after the initial install, for any reason, + # even if you've upgraded your system to a new NixOS release. + # + # This value does NOT affect the Nixpkgs version your packages and OS are pulled from, + # so changing it will NOT upgrade your system. + # + # This value being lower than the current NixOS release does NOT mean your system is + # out of date, out of support, or vulnerable. + # + # Do NOT change this value unless you have manually inspected all the changes it would make to your configuration, + # and migrated your data accordingly. + # + # For more information, see `man configuration.nix` or https://nixos.org/manual/nixos/stable/options#opt-system.stateVersion . + system.stateVersion = "23.11"; # Did you read the comment? +} diff --git a/hardware-configuration.nix b/hardware-configuration.nix new file mode 100644 index 0000000..ec429c6 --- /dev/null +++ b/hardware-configuration.nix @@ -0,0 +1,40 @@ +# 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 = [ "ahci" "ohci_pci" "ehci_pci" "megaraid_sas" "usb_storage" "usbhid" "sd_mod" "sr_mod" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/5634580f-a3f5-4c87-ac96-e48e4e2e5fc6"; + fsType = "ext4"; + }; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/77A0-17F1"; + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.eno1.useDHCP = lib.mkDefault true; + # networking.interfaces.eno2.useDHCP = lib.mkDefault true; + # networking.interfaces.eno3.useDHCP = lib.mkDefault true; + # networking.interfaces.eno4.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/virtualisation.nix b/virtualisation.nix new file mode 100644 index 0000000..1a66142 --- /dev/null +++ b/virtualisation.nix @@ -0,0 +1,14 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + podman-compose + ]; + + virtualisation = { + podman = { + enable = true; + dockerCompat = true; + defaultNetwork.settings.dns_enabled = true; + }; + }; +}