reorg
This commit is contained in:
@@ -1,36 +0,0 @@
|
|||||||
{ pkgs, userSettings, systemSettings, ... }:
|
|
||||||
{
|
|
||||||
# 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")
|
|
||||||
bash
|
|
||||||
busybox
|
|
||||||
git
|
|
||||||
eza
|
|
||||||
];
|
|
||||||
|
|
||||||
# For SSH access
|
|
||||||
services.openssh.enable = true;
|
|
||||||
|
|
||||||
# Networking stuff
|
|
||||||
services.avahi = { enable = true; nssmdns4 = true; };
|
|
||||||
|
|
||||||
# Uses rust-based sudo
|
|
||||||
security.sudo-rs = {
|
|
||||||
enable = true;
|
|
||||||
execWheelOnly = false;
|
|
||||||
wheelNeedsPassword = false; # allows sudo without password for those in the wheel group
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.${userSettings.username} = {
|
|
||||||
isNormalUser = true;
|
|
||||||
uid = 1000;
|
|
||||||
extraGroups = [ "wheel" ];
|
|
||||||
openssh.authorizedKeys.keyFiles = [ /root/.ssh/authorized_keys ];
|
|
||||||
};
|
|
||||||
|
|
||||||
time.timeZone = "${systemSettings.timeZone}";
|
|
||||||
networking.hostName = systemSettings.hostName;
|
|
||||||
}
|
|
||||||
76
flake.nix
76
flake.nix
@@ -1,27 +1,10 @@
|
|||||||
{
|
{
|
||||||
description = "Panoptes flake config";
|
description = "Panoptes flake config";
|
||||||
|
|
||||||
inputs = {
|
outputs = { self, ... }@args:
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
||||||
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11";
|
|
||||||
home-manager = {
|
|
||||||
url = "github:nix-community/home-manager";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
vscode-server.url = "github:nix-community/nixos-vscode-server";
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = {
|
|
||||||
self,
|
|
||||||
nixpkgs,
|
|
||||||
nixpkgs-stable,
|
|
||||||
home-manager,
|
|
||||||
...
|
|
||||||
} @ inputs:
|
|
||||||
let
|
let
|
||||||
stateVersion = "24.11";
|
|
||||||
inherit (self) outputs;
|
inherit (self) outputs;
|
||||||
nixosSystem = inputs.nixpkgs.lib.nixosSystem;
|
nixosSystem = args.nixpkgs.lib.nixosSystem;
|
||||||
|
|
||||||
userSettings = rec {
|
userSettings = rec {
|
||||||
username = "panoptes";
|
username = "panoptes";
|
||||||
@@ -32,54 +15,59 @@
|
|||||||
|
|
||||||
systemSettings = rec {
|
systemSettings = rec {
|
||||||
hostName = "panoptes-nix";
|
hostName = "panoptes-nix";
|
||||||
|
stateVersion = "24.11";
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
timeZone = "America/Chicago";
|
timeZone = "America/Chicago";
|
||||||
locale = "en_US.UTF-8";
|
locale = "en_US.UTF-8";
|
||||||
};
|
};
|
||||||
|
|
||||||
pkgs = inputs.nixpkgs.legacyPackages.${systemSettings.system};
|
pkgs = args.nixpkgs.legacyPackages.${systemSettings.system};
|
||||||
pkgs-stable = inputs.nixpkgs-stable.legacyPackages.${systemSettings.system};
|
pkgs-stable = args.nixpkgs-stable.legacyPackages.${systemSettings.system};
|
||||||
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixosModules.default = ./nixosModules;
|
nixosModules.default = ./nixosModules;
|
||||||
|
|
||||||
nixosConfigurations = {
|
nixosConfigurations.${systemSettings.hostName} = nixosSystem {
|
||||||
"${systemSettings.hostName}" = nixosSystem {
|
system = systemSettings.system;
|
||||||
system = systemSettings.system;
|
specialArgs = {
|
||||||
specialArgs = {
|
inherit systemSettings;
|
||||||
inherit inputs;
|
inherit userSettings;
|
||||||
inherit outputs;
|
|
||||||
inherit userSettings;
|
|
||||||
inherit systemSettings;
|
|
||||||
};
|
|
||||||
modules = [
|
|
||||||
./configuration.nix # > Our main nixos configuration file <
|
|
||||||
"${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
|
|
||||||
({ ... }: {
|
|
||||||
system.stateVersion = "${stateVersion}";
|
|
||||||
services.vscode-server.enable = true;
|
|
||||||
})
|
|
||||||
inputs.vscode-server.nixosModules.default
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
modules = [
|
||||||
|
(args.nixpkgs + "/nixos/modules/virtualisation/proxmox-lxc.nix")
|
||||||
|
# ./configuration.nix # > Our main nixos configuration file <
|
||||||
|
outputs.nixosModules.default
|
||||||
|
args.home-manager.nixosModules.default
|
||||||
|
args.vscode-server.nixosModules.default
|
||||||
|
({ ... }: { services.vscode-server.enable = true; })
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
"panoptes@panoptes-nix" = home-manager.lib.homeManagerConfiguration {
|
${userSettings.username} = args.home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs stateVersion;
|
inherit pkgs;
|
||||||
specialArgs = {
|
extraSpecialArgs = {
|
||||||
inherit inputs;
|
inherit args;
|
||||||
inherit outputs;
|
inherit outputs;
|
||||||
inherit userSettings;
|
inherit userSettings;
|
||||||
inherit systemSettings;
|
inherit systemSettings;
|
||||||
};
|
};
|
||||||
modules = [
|
modules = [
|
||||||
./home.nix
|
./home.nix
|
||||||
# ({...}: {home.stateVersion = "${stateVersion}";})
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.11";
|
||||||
|
home-manager = {
|
||||||
|
url = "github:nix-community/home-manager";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
vscode-server.url = "github:nix-community/nixos-vscode-server";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
20
home.nix
20
home.nix
@@ -5,9 +5,10 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
homePath = "/srv/panoptes";
|
repoURL = "https://gitea.john-stream.com/john/panoptes-nix";
|
||||||
repoURL = "https://gitea.john-stream.com/john/loki-nix";
|
repoBranch = "main";
|
||||||
repoBranch = "reorg";
|
homePath = "/home/${userSettings.username}";
|
||||||
|
repoPath = "${homePath}/${systemSettings.hostName}";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
@@ -25,15 +26,18 @@ in
|
|||||||
programs.ssh.enable = true;
|
programs.ssh.enable = true;
|
||||||
|
|
||||||
home = {
|
home = {
|
||||||
|
stateVersion = "${systemSettings.stateVersion}";
|
||||||
|
username = "${userSettings.username}";
|
||||||
homeDirectory = "${homePath}";
|
homeDirectory = "${homePath}";
|
||||||
packages = [
|
packages = with pkgs; [
|
||||||
(pkgs.writeShellScriptBin "nfs" ''
|
(writeShellScriptBin "nfs" ''
|
||||||
sudo nixos-rebuild switch --flake ${homePath}#${hostName} --impure
|
sudo nixos-rebuild switch --flake ${repoPath}#${systemSettings.hostName} --impure
|
||||||
'')
|
'')
|
||||||
(pkgs.writeShellScriptBin "init-panoptes" ''
|
(writeShellScriptBin "init-panoptes" ''
|
||||||
sudo -u git clone -b ${repoBranch} ${repoURL} /srv/panoptes
|
sudo -u ${userSettings.username} git clone -b ${repoBranch} ${repoURL} ${repoPath}
|
||||||
'')
|
'')
|
||||||
git
|
git
|
||||||
|
python313
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
config,
|
config,
|
||||||
lib,
|
systemSettings,
|
||||||
inputs,
|
userSettings,
|
||||||
outputs,
|
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
imports =
|
imports =
|
||||||
@@ -13,7 +12,34 @@
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
nix.settings.experimental-features = ["nix-command" "flakes"];
|
nix.settings.experimental-features = ["nix-command" "flakes"];
|
||||||
programs.nix-ld.enable = true;
|
|
||||||
nixpkgs.config.allowUnfree = true;
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
system.stateVersion = "${systemSettings.stateVersion}";
|
||||||
|
# programs.nix-ld.enable = true;
|
||||||
|
services.openssh.enable = true;
|
||||||
|
services.avahi = { enable = true; nssmdns4 = true; };
|
||||||
|
|
||||||
|
time.timeZone = "${systemSettings.timeZone}";
|
||||||
|
networking.hostName = systemSettings.hostName;
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
home-manager
|
||||||
|
bash
|
||||||
|
busybox
|
||||||
|
git
|
||||||
|
eza
|
||||||
|
];
|
||||||
|
|
||||||
|
security.sudo-rs = {
|
||||||
|
enable = true;
|
||||||
|
execWheelOnly = false;
|
||||||
|
wheelNeedsPassword = false; # allows sudo without password for those in the wheel group
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.${userSettings.username} = {
|
||||||
|
isNormalUser = true;
|
||||||
|
uid = 1000;
|
||||||
|
extraGroups = [ "wheel" ];
|
||||||
|
openssh.authorizedKeys.keyFiles = [ /root/.ssh/authorized_keys ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
{ pkgs, config, ... }:
|
{ pkgs, config, ... }:
|
||||||
|
let
|
||||||
|
lokiPort = config.services.loki.configuration.server.http_listen_port;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
networking.firewall.allowedTCPPorts = [
|
networking.firewall.allowedTCPPorts = [ lokiPort ];
|
||||||
config.services.loki.configuration.server.http_listen_port
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
(pkgs.writeShellScriptBin "loki-check" ''
|
(pkgs.writeShellScriptBin "loki-check" ''
|
||||||
curl http://localhost:${config.services.loki.configuration.server.http_listen_port}/ready
|
curl http://localhost:${builtins.toString lokiPort}/ready
|
||||||
'')
|
'')
|
||||||
(pkgs.writeShellScriptBin "loki-logs" "journalctl -b -u loki.service -n 10")
|
(pkgs.writeShellScriptBin "loki-logs" "journalctl -b -u loki.service -n 10")
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user