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" ];
environment.systemPackages = with pkgs; [
(pkgs.writeShellScriptBin "nrbs" "sudo nixos-rebuild switch")
(pkgs.writeShellScriptBin "nrbsu" "sudo nix-channel --update && sudo nixos-rebuild switch")
# (pkgs.writeShellScriptBin "nrbs" "sudo nixos-rebuild switch")
# (pkgs.writeShellScriptBin "nrbsu" "sudo nix-channel --update && sudo nixos-rebuild switch")
bash
busybox
git
eza
];
# imports = [
# ./
# ];
# For SSH access
services.openssh.enable = true;

View File

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

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 = {
enable = true;
extraConfig.safe.directory = "${repoPath}";
extraConfig.credential.helper = "store --file ~/.git-credentials";
userName = "John Lancaster";
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; [
(pkgs.writeShellScriptBin "loki-check" "curl http://localhost:${builtins.toString lokiPort}/ready")