From a2e25184c3d9480b46cce3e9b9aa0fd2efb21b3c Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Mon, 29 Jul 2024 16:51:12 -0400 Subject: [PATCH 1/6] Updated flakes --- flake.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index b09efdd..ba2661e 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1721270582, - "narHash": "sha256-MdZmYPPExntE5rJu88IhJSy8Um4UyZCTXhOwvzbjDVI=", + "lastModified": 1722082646, + "narHash": "sha256-od8dBWVP/ngg0cuoyEl/w9D+TCNDj6Kh4tr151Aax7w=", "owner": "LnL7", "repo": "nix-darwin", - "rev": "a3e4a7b8ffc08c7dc1973822a77ad432e1ec3dec", + "rev": "0413754b3cdb879ba14f6e96915e5fdf06c6aab6", "type": "github" }, "original": { @@ -43,11 +43,11 @@ }, "nixos-hardware": { "locked": { - "lastModified": 1721331912, - "narHash": "sha256-h2yaU+QEU4pHxMySHPIsRV2T/pihDHnrXBca8BY6xgc=", + "lastModified": 1722114937, + "narHash": "sha256-MOZ9woPwdpFJcHx3wic2Mlw9aztdKjMnFT3FaeLzJkM=", "owner": "NixOS", "repo": "nixos-hardware", - "rev": "bb90787ea034c8b9035dfcfc9b4dc23898d414be", + "rev": "e67b60fb1b2c3aad2202d95b91d4c218cf2a4fdd", "type": "github" }, "original": { @@ -59,11 +59,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1721226092, - "narHash": "sha256-UBvzVpo5sXSi2S/Av+t+Q+C2mhMIw/LBEZR+d6NMjws=", + "lastModified": 1722087241, + "narHash": "sha256-2ShmEaFi0kJVOEEu5gmlykN5dwjWYWYUJmlRTvZQRpU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c716603a63aca44f39bef1986c13402167450e0a", + "rev": "8c50662509100d53229d4be607f1a3a31157fa12", "type": "github" }, "original": { @@ -101,11 +101,11 @@ }, "unstable": { "locked": { - "lastModified": 1721359386, - "narHash": "sha256-FsW0f9FpL9ECgA3d6iqk+OWhAuwR4zOvtP6Ibsfgrrw=", + "lastModified": 1722256103, + "narHash": "sha256-M8/qIGTrAw7M9syoid9fvziEvgaXvuXP1lx71Jy+wMA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "20f734b3472ee06a29cb312c5da439c0089e258d", + "rev": "c4913a0ed9c3799ff87d06f90baf1498eec966dd", "type": "github" }, "original": { @@ -122,11 +122,11 @@ ] }, "locked": { - "lastModified": 1721135958, - "narHash": "sha256-H548rpPMsn25LDKn1PCFmPxmWlClJJGnvdzImHkqjuY=", + "lastModified": 1722203588, + "narHash": "sha256-91V5FMSQ4z9bkhTCf0f86Zjw0bh367daSf0mzCIW0vU=", "owner": "nix-community", "repo": "home-manager", - "rev": "afd2021bedff2de92dfce0e257a3d03ae65c603d", + "rev": "792757f643cedc13f02098d8ed506d82e19ec1da", "type": "github" }, "original": { From a52b5f6e844a7f0fb9fdd0d1a55af5b227e80151 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Mon, 29 Jul 2024 16:59:03 -0400 Subject: [PATCH 2/6] Added opengl support --- hosts/fwbook.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hosts/fwbook.nix b/hosts/fwbook.nix index 30318e3..29beee2 100644 --- a/hosts/fwbook.nix +++ b/hosts/fwbook.nix @@ -36,6 +36,13 @@ in # python python312 ]; + # Opengl + hardware.opengl = { + driSupport = true; + driSupport32Bit = true; + extraPackages = [ pkgs.amdvlk ]; + extraPackages32 = [ pkgs.driversi686Linux.amdvlk ]; + }; # Gaming programs.gamescope.enable = true; programs.steam = { From f51edc269ea09f5f4a3c6b3f9b57fae248916a9d Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Mon, 29 Jul 2024 17:10:14 -0400 Subject: [PATCH 3/6] Added steam to bigbox --- hosts/hl-bigbox1.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hosts/hl-bigbox1.nix b/hosts/hl-bigbox1.nix index 0278d72..80ab86e 100644 --- a/hosts/hl-bigbox1.nix +++ b/hosts/hl-bigbox1.nix @@ -59,4 +59,15 @@ nvidiaSettings = false; package = config.boot.kernelPackages.nvidiaPackages.production; }; + # Steam Settings + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + }; + environment.systemPackages = with pkgs; [ + steam-tui + steamPackages.steamcmd + ]; } From aeed9378742364b43bb8570b9a0382fc15eb45e2 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Wed, 31 Jul 2024 11:15:44 -0400 Subject: [PATCH 4/6] Removing micromamba & adding terra1 --- hosts/hl-terra1.nix | 10 ++++++++++ modules/home-manager/default.nix | 12 +++--------- 2 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 hosts/hl-terra1.nix diff --git a/hosts/hl-terra1.nix b/hosts/hl-terra1.nix new file mode 100644 index 0000000..3507bb6 --- /dev/null +++ b/hosts/hl-terra1.nix @@ -0,0 +1,10 @@ +{ user }: +{ pkgs, lib, config, ... }: { + imports = [ ./hl-minipc2.hardware-configuration.nix ]; + # firmware updater + services.fwupd.enable = true; + # Bootloader. + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; +} + diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix index 121a381..c9429fb 100644 --- a/modules/home-manager/default.nix +++ b/modules/home-manager/default.nix @@ -21,11 +21,10 @@ in }; home-manager.users.${user.name} = { home = { - sessionVariables = { MAMBA_ROOT_PREFIX = "$HOME/.local/micromamba"; }; + sessionVariables = { }; stateVersion = version; shellAliases = { cat = "bat"; - conda = "micromamba"; }; packages = with pkgs; [ jq nixfmt-classic devenv ipfetch nixd ] @@ -33,7 +32,6 @@ in rye uv devbox - micromamba terraform kubectl ] else @@ -75,13 +73,9 @@ in zsh = { enable = true; autosuggestion.enable = true; - initExtra = (if enableDevelopmentKit then '' - export MAMBA_ROOT_PREFIX="$HOME/.local/micromamba" - source <(micromamba shell hook --root-prefix=$MAMBA_ROOT_PREFIX) + initExtra = '' export PROMPT='%(!.%{%F{yellow}%}.)$USER@%{$fg[white]%}%M %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' - '' else '' - export PROMPT='%(!.%{%F{yellow}%}.)$USER@%{$fg[white]%}%M %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)' - ''); + ''; }; zsh.oh-my-zsh = { enable = true; From 8d25a30e92df91daa0f1c4a2f791fa250ca12e2c Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Wed, 31 Jul 2024 11:18:04 -0400 Subject: [PATCH 5/6] Added main flake entry for terra1 --- flake.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flake.nix b/flake.nix index 259c6e1..c60cf40 100644 --- a/flake.nix +++ b/flake.nix @@ -186,5 +186,13 @@ configuration = (import ./hosts/hl-minipc2.nix { user = user; }); systemStateVersion = "24.05"; }; + + # NIXOS Homelab - terramaster 1 + # ------------- + nixosConfigurations."hl-terra1" = makeHLService { + hostName = "hl-terra1"; + configuration = (import ./hosts/hl-terra1.nix { user = user; }); + systemStateVersion = "24.05"; + }; }; } From c33c4de55529e3e896cdfa2e705208d5393d2b96 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Wed, 31 Jul 2024 11:30:46 -0400 Subject: [PATCH 6/6] Updated cache builds --- flake.nix | 12 ++++++++---- hosts/hl-minipc1.nix | 5 +++++ modules/main.nix | 2 +- modules/nix/default.nix | 8 ++++---- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index c60cf40..cc23a8a 100644 --- a/flake.nix +++ b/flake.nix @@ -43,10 +43,14 @@ }; homeManagerVersion = "24.05"; # Local Services - localNixCaches = [ - "http://minipc1.lab.internal:5000" - "http://fwlaptop.devices.internal:5000" - ]; + localNixCaches = { + urls = [ + "http://minipc1.lab.internal:5000" + ]; + keys = [ + "minipc1.lab.internal:eIoib1JgcBEd0YKdW95QlRA2eCKDs+WxNhWhkA1wffc=" + ]; + }; localDockerRegistries = [ "minipc1.lab.internal:5001" ]; # Libs lib = (import modules/lib.nix { diff --git a/hosts/hl-minipc1.nix b/hosts/hl-minipc1.nix index 4056274..85bd054 100644 --- a/hosts/hl-minipc1.nix +++ b/hosts/hl-minipc1.nix @@ -1,6 +1,11 @@ { user }: { pkgs, lib, config, ... }: { imports = [ ./hl-minipc1.hardware-configuration.nix ]; + # Nix Stores + services.nix-serve = { + enable = true; + secretKeyFile = "/var/keys/cache-priv-key.pem"; + }; # firmware updater services.fwupd.enable = true; # Bootloader. diff --git a/modules/main.nix b/modules/main.nix index 4336b26..40f3eee 100644 --- a/modules/main.nix +++ b/modules/main.nix @@ -17,7 +17,7 @@ enable = false; enableDevelopmentKit = false; } -, localNixCaches ? [ ] +, localNixCaches ? { keys = [ ]; urls = [ ]; } , ... }: { ... }: { diff --git a/modules/nix/default.nix b/modules/nix/default.nix index 6547eba..b07705c 100644 --- a/modules/nix/default.nix +++ b/modules/nix/default.nix @@ -1,4 +1,4 @@ -{ user, systemStateVersion, localNixCaches ? [ ] }: +{ user, systemStateVersion, localNixCaches ? { keys = [ ]; urls = [ ]; } }: { pkgs, ... }: { # Nix core @@ -10,16 +10,16 @@ "https://cache.nixos.org" "https://cache.flox.dev" "https://devenv.cachix.org" - ] ++ localNixCaches; + ] ++ localNixCaches.urls; trusted-substituters = [ "https://cache.flox.dev" "https://devenv.cachix.org" - ] ++ localNixCaches; + ] ++ localNixCaches.urls; trusted-users = [ "root" user.name ]; trusted-public-keys = [ "flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs=" "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw=" - ]; + ] ++ localNixCaches.keys; }; # System Packages