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" ];
|
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;
|
||||||
|
|
||||||
36
flake.nix
36
flake.nix
@@ -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}"; })
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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 = {
|
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";
|
||||||
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; [
|
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")
|
||||||
Reference in New Issue
Block a user