From 68bfa4ef4b8326bf74e9092a30c6e96d6bede8ef Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Sun, 8 Dec 2024 12:13:34 -0600 Subject: [PATCH] added nfs script --- flake.nix | 9 ++++++++- nixos/loki.nix | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 1e1b97f..ddf4a67 100644 --- a/flake.nix +++ b/flake.nix @@ -21,6 +21,7 @@ let inherit (self) outputs; system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; stateVersion = "24.05"; timeZone = "America/Chicago"; hostname = "loki"; @@ -39,11 +40,17 @@ nixpkgs.hostPlatform = "${system}"; system.stateVersion = "${stateVersion}"; time.timeZone = "${timeZone}"; + environment.systemPackages = [ + (pkgs.writeShellScriptBin "nfs" '' + sudo nixos-rebuild switch --flake git+file://${lokiPath}#${hostname} + '') + ]; }) (import ./nixos/loki.nix { - pkgs = nixpkgs.legacyPackages.${system}; + inherit pkgs; inherit lokiPort; inherit lokiUser; + inherit lokiPath; }) ]; }; diff --git a/nixos/loki.nix b/nixos/loki.nix index 221abbf..71e1e72 100644 --- a/nixos/loki.nix +++ b/nixos/loki.nix @@ -1,4 +1,4 @@ -{ pkgs, lokiUser, lokiPort ? (3100), ... }: +{ pkgs, lokiUser ? "loki", lokiPort ? (3100), lokiPath, ... }: { networking.firewall.allowedTCPPorts = [ lokiPort ];