From b04f7d502a5f1af6413a8c10c3d8b4629ce13084 Mon Sep 17 00:00:00 2001 From: Ariel Sosnovsky Date: Thu, 21 Mar 2024 10:27:40 -0400 Subject: [PATCH] Clean up nixos --- os/nixos-amd/example-configuration.nix | 13 --------- os/nixos-amd/k3s.nix | 37 -------------------------- os/nixos-amd/main.nix | 23 ---------------- os/nixos-amd/settings.nix | 19 ------------- os/nixos-amd/users.nix | 21 --------------- os/nixos/amd-packages.nix | 7 +++++ os/nixos/k3s.nix | 12 +++++---- os/nixos/main.nix | 1 - 8 files changed, 14 insertions(+), 119 deletions(-) delete mode 100644 os/nixos-amd/example-configuration.nix delete mode 100644 os/nixos-amd/k3s.nix delete mode 100644 os/nixos-amd/main.nix delete mode 100644 os/nixos-amd/settings.nix delete mode 100644 os/nixos-amd/users.nix create mode 100644 os/nixos/amd-packages.nix diff --git a/os/nixos-amd/example-configuration.nix b/os/nixos-amd/example-configuration.nix deleted file mode 100644 index 5777a86..0000000 --- a/os/nixos-amd/example-configuration.nix +++ /dev/null @@ -1,13 +0,0 @@ -{ ... }: -{ - imports = - [ - ./hardware-configuration.nix - (import ./main.nix { - hostName = ""; - stateVersion = "23.05"; - dbConnectionStr = ""; - K3SToken = ""; - }) - ]; -} \ No newline at end of file diff --git a/os/nixos-amd/k3s.nix b/os/nixos-amd/k3s.nix deleted file mode 100644 index fc2d3ec..0000000 --- a/os/nixos-amd/k3s.nix +++ /dev/null @@ -1,37 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). -{ - hostName, - dbConnectionStr, - K3SToken -}: -{ config, pkgs, ... }: - -{ - # Bootloader. - boot.initrd = { - supportedFilesystems = [ "nfs" ]; - kernelModules = [ "nfs" ]; - }; - i18n.defaultLocale = "en_CA.UTF-8"; - services.nfs.server.enable = true; - services.rpcbind.enable = true; - environment.systemPackages = with pkgs; [ - k3s - nfs-utils - git - rocmPackages.rocm-smi - rocmPackages.rpp - ]; - services.k3s.enable = true; - services.k3s.role = "server"; - services.k3s.extraFlags = toString [ - "--tls-san" - hostName - "--datastore-endpoint" dbConnectionStr - "--token" K3SToken - ]; - networking.firewall.allowedTCPPorts = [ 22 80 443 ]; - networking.firewall.allowedUDPPorts = [ 80 443 ]; -} diff --git a/os/nixos-amd/main.nix b/os/nixos-amd/main.nix deleted file mode 100644 index 273058f..0000000 --- a/os/nixos-amd/main.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - hostName, - stateVersion, - dbConnectionStr, - K3SToken -}: -{ config, pkgs, ... }: -{ - imports = - [ - (import ./k3s.nix { - hostName = hostName; - dbConnectionStr = dbConnectionStr; - K3SToken = K3SToken; - }) - ./users.nix - ./settings.nix - ]; - - # Bootloader. - networking.hostName = hostName; - system.stateVersion = stateVersion; -} diff --git a/os/nixos-amd/settings.nix b/os/nixos-amd/settings.nix deleted file mode 100644 index 7c83a2b..0000000 --- a/os/nixos-amd/settings.nix +++ /dev/null @@ -1,19 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: - -{ - # Bootloader. - networking.networkmanager.enable = true; - time.timeZone = "America/Toronto"; - i18n.defaultLocale = "en_CA.UTF-8"; - services.xserver = { - layout = "us"; - xkbVariant = ""; - }; - nixpkgs.config.allowUnfree = true; - services.openssh.enable = true; - networking.firewall.enable = false; -} diff --git a/os/nixos-amd/users.nix b/os/nixos-amd/users.nix deleted file mode 100644 index 3e3d8ff..0000000 --- a/os/nixos-amd/users.nix +++ /dev/null @@ -1,21 +0,0 @@ -# Edit this configuration file to define what should be installed on -# your system. Help is available in the configuration.nix(5) man page -# and in the NixOS manual (accessible by running ‘nixos-help’). - -{ config, pkgs, ... }: - -{ - users.users.ari = { - isNormalUser = true; - description = "Ari"; - extraGroups = [ "networkmanager" "wheel" "root" ]; - packages = with pkgs; []; - }; - - environment.systemPackages = with pkgs; [ - pciutils - usbutils - jq - ]; - -} diff --git a/os/nixos/amd-packages.nix b/os/nixos/amd-packages.nix new file mode 100644 index 0000000..be55be4 --- /dev/null +++ b/os/nixos/amd-packages.nix @@ -0,0 +1,7 @@ +{ config, pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + rocmPackages.rocm-smi + rocmPackages.rpp + ]; +} \ No newline at end of file diff --git a/os/nixos/k3s.nix b/os/nixos/k3s.nix index 947dd5e..fc2d3ec 100644 --- a/os/nixos/k3s.nix +++ b/os/nixos/k3s.nix @@ -4,7 +4,7 @@ { hostName, dbConnectionStr, - K3SToken, + K3SToken }: { config, pkgs, ... }: @@ -17,10 +17,12 @@ i18n.defaultLocale = "en_CA.UTF-8"; services.nfs.server.enable = true; services.rpcbind.enable = true; - environment.systemPackages = [ - pkgs.k3s - pkgs.nfs-utils - pkgs.git + environment.systemPackages = with pkgs; [ + k3s + nfs-utils + git + rocmPackages.rocm-smi + rocmPackages.rpp ]; services.k3s.enable = true; services.k3s.role = "server"; diff --git a/os/nixos/main.nix b/os/nixos/main.nix index 8ca06b7..85ae804 100644 --- a/os/nixos/main.nix +++ b/os/nixos/main.nix @@ -3,7 +3,6 @@ stateVersion, dbConnectionStr, K3SToken, - additionalPkgs = [], }: { config, pkgs, ... }: {