generated from john/nix-docker
Compare commits
7 Commits
41bf8a074e
...
ee521c87eb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee521c87eb | ||
|
|
7667011dbf | ||
|
|
6bf90e6b24 | ||
|
|
36cf352c67 | ||
|
|
2a00037711 | ||
|
|
38c7effc93 | ||
|
|
fee9256b39 |
@@ -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;
|
||||
|
||||
36
flake.nix
36
flake.nix
@@ -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 ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
{ user, repoPath, ... }:
|
||||
{
|
||||
programs.home-manager.enable = true;
|
||||
home = {
|
||||
stateVersion = "24.05";
|
||||
username = "${user}";
|
||||
homeDirectory = "${repoPath}";
|
||||
};
|
||||
}
|
||||
@@ -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";
|
||||
24
homeManagerModules/home.nix
Normal file
24
homeManagerModules/home.nix
Normal 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";
|
||||
}
|
||||
@@ -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")
|
||||
Reference in New Issue
Block a user