Compare commits

..

7 Commits

Author SHA1 Message Date
John Lancaster
ee521c87eb removed commented lines 2024-12-08 13:10:51 -06:00
John Lancaster
7667011dbf commented scripts out 2024-12-08 13:09:01 -06:00
John Lancaster
6bf90e6b24 reorg 2024-12-08 13:04:18 -06:00
John Lancaster
36cf352c67 removed variable 2024-12-08 12:47:28 -06:00
John Lancaster
2a00037711 another fix 2024-12-08 12:45:47 -06:00
John Lancaster
38c7effc93 fix 2024-12-08 12:45:27 -06:00
John Lancaster
fee9256b39 WIP 2024-12-08 12:45:06 -06:00
7 changed files with 47 additions and 39 deletions

View File

@@ -3,14 +3,18 @@
nix.settings.experimental-features = [ "nix-command" "flakes" ]; nix.settings.experimental-features = [ "nix-command" "flakes" ];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(pkgs.writeShellScriptBin "nrbs" "sudo nixos-rebuild switch") # (pkgs.writeShellScriptBin "nrbs" "sudo nixos-rebuild switch")
(pkgs.writeShellScriptBin "nrbsu" "sudo nix-channel --update && sudo nixos-rebuild switch") # (pkgs.writeShellScriptBin "nrbsu" "sudo nix-channel --update && sudo nixos-rebuild switch")
bash bash
busybox busybox
git git
eza eza
]; ];
# imports = [
# ./
# ];
# For SSH access # For SSH access
services.openssh.enable = true; services.openssh.enable = true;

View File

@@ -24,17 +24,15 @@
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
stateVersion = "24.05"; stateVersion = "24.05";
timeZone = "America/Chicago"; timeZone = "America/Chicago";
hostname = "loki"; hostname = "panoptes-nix";
lokiPort = 3100; user = "panoptes";
lokiUser = "loki";
lokiPath = "/srv/loki";
in in
{ {
nixosConfigurations = { nixosConfigurations = {
${hostname} = nixpkgs.lib.nixosSystem { ${hostname} = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;}; specialArgs = {inherit inputs outputs;};
modules = [ modules = [
./nixos/configuration.nix # > Our main nixos configuration file < ./configuration.nix # > Our main nixos configuration file <
"${nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix" "${nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
({ ... }: { ({ ... }: {
nixpkgs.hostPlatform = "${system}"; nixpkgs.hostPlatform = "${system}";
@@ -42,39 +40,29 @@
time.timeZone = "${timeZone}"; time.timeZone = "${timeZone}";
environment.systemPackages = [ environment.systemPackages = [
(pkgs.writeShellScriptBin "nfs" '' (pkgs.writeShellScriptBin "nfs" ''
sudo nixos-rebuild switch --flake git+file://${lokiPath}#${hostname} sudo nixos-rebuild switch --flake git+file:///etc/nixos#${hostname}
'') '')
]; ];
}) })
(import ./nixos/loki.nix {
inherit pkgs;
inherit lokiPort;
inherit lokiUser;
inherit lokiPath;
})
]; ];
}; };
}; };
# homeManagerModules.default = ./homeManagerModules;
# nixosModules.default = ./nixosModules;
# Standalone home-manager configuration entrypoint # Standalone home-manager configuration entrypoint
# Available through 'home-manager --flake .#your-username@your-hostname' # Available through 'home-manager --flake .#your-username@your-hostname'
homeConfigurations = { homeConfigurations = {
useGlobalPkgs = true; useGlobalPkgs = true;
"root@${hostname}" = home-manager.lib.homeManagerConfiguration { "root@${hostname}" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.${system}; extraSpecialArgs = {inherit inputs outputs pkgs;};
extraSpecialArgs = {inherit inputs outputs;}; modules = [ ./home-manager/git.nix ];
modules = [(import ./home-manager/git.nix { repoPath = "${lokiPath}"; })];
}; };
# FIXME replace with your username@hostname "${user}@${hostname}" = home-manager.lib.homeManagerConfiguration {
"${lokiUser}@${hostname}" = home-manager.lib.homeManagerConfiguration { extraSpecialArgs = {inherit inputs outputs pkgs;};
pkgs = nixpkgs.legacyPackages.${system}; modules = [ ./home-manager/home.nix ];
extraSpecialArgs = {inherit inputs outputs;};
# > Our main home-manager configuration file <
modules = [
(import ./home-manager/home.nix { user = "${lokiUser}"; repoPath = "${lokiPath}"; })
(import ./home-manager/git.nix { repoPath = "${lokiPath}"; })
];
}; };
}; };
}; };

View File

@@ -1,9 +0,0 @@
{ user, repoPath, ... }:
{
programs.home-manager.enable = true;
home = {
stateVersion = "24.05";
username = "${user}";
homeDirectory = "${repoPath}";
};
}

View File

@@ -1,8 +1,7 @@
{ repoPath, ... }: { ... }:
{ {
programs.git = { programs.git = {
enable = true; enable = true;
extraConfig.safe.directory = "${repoPath}";
extraConfig.credential.helper = "store --file ~/.git-credentials"; extraConfig.credential.helper = "store --file ~/.git-credentials";
userName = "John Lancaster"; userName = "John Lancaster";
userEmail = "32917998+jsl12@users.noreply.github.com"; userEmail = "32917998+jsl12@users.noreply.github.com";

View File

@@ -0,0 +1,24 @@
{
inputs,
lib,
config,
pkgs,
...
}:
let
homePath = "/srv/panoptes";
in
{
imports = [ ./git.nix ];
programs.git.extraConfig.safe.directory = "${homePath}";
programs.home-manager.enable = true;
home = {
stateVersion = "24.05";
username = "${user}";
homeDirectory = "${homePath}";
};
systemd.user.startServices = "sd-switch";
}

View File

@@ -1,6 +1,8 @@
{ pkgs, lokiPort ? 3100, ... }: { pkgs, config, lokiPort ? 3100, ... }:
{ {
networking.firewall.allowedTCPPorts = [ lokiPort ]; networking.firewall.allowedTCPPorts = [
config.services.loki.configuration.server.http_listen_port
];
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
(pkgs.writeShellScriptBin "loki-check" "curl http://localhost:${builtins.toString lokiPort}/ready") (pkgs.writeShellScriptBin "loki-check" "curl http://localhost:${builtins.toString lokiPort}/ready")