converted to flakes and implemented sops-nix for the telegraf token

This commit is contained in:
John Lancaster
2024-12-17 00:56:38 -06:00
parent 3e7762c10e
commit d0544a89ff
7 changed files with 287 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
{ pkgs, lib, modulesPath, ... }:
{ pkgs, lib, userSettings, ... }:
let
stateVersion = "24.05";
unstable = import <nixos-unstable> {};
@@ -10,19 +10,22 @@ let
in
{
imports = [
(modulesPath + "/virtualisation/proxmox-lxc.nix")
(import "${builtins.fetchTarball https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz}/nixos")
(fetchTarball "https://github.com/nix-community/nixos-vscode-server/tarball/master")
./telegraf.nix
./promtail.nix
./portainer.nix
./watchtower.nix
];
nix.settings.trusted-users = [ "root" "@wheel" ];
nix.settings.experimental-features = [ "nix-command" "flakes" ];
sops.defaultSopsFile = ./secrets/secrets.yaml;
sops.defaultSopsFormat = "yaml";
sops.age.keyFile = "${adHome}/.config/sops/age/keys.txt";
environment.systemPackages = with pkgs; [
(pkgs.writeShellScriptBin "nrbs" "sudo nixos-rebuild switch")
(pkgs.writeShellScriptBin "nrbsu" "sudo nix-channel --update && sudo nixos-rebuild switch")
(pkgs.writeShellScriptBin "nfs" "sudo nixos-rebuild switch --flake ${adNixPath} --impure")
(pkgs.writeShellScriptBin "ads" ''
cd ${adPath}
nix develop --no-pure-eval ${adNixPath}/appdaemon
@@ -40,6 +43,7 @@ in
git
eza
gh
sops
# appdaemon
];
@@ -72,14 +76,13 @@ in
extraGroups = [ "wheel" "docker" ];
openssh.authorizedKeys.keyFiles = [ "/root/.ssh/authorized_keys" ];
};
nix.settings.trusted-users = [ "root" "@wheel" ];
home-manager = {
useGlobalPkgs = true;
users.appdaemon = { pkgs, ... }: {
home.stateVersion = stateVersion;
imports = [ ./git.nix ];
systemd.user.startServices = "sd-switch";
imports = [ (import ./git.nix {inherit userSettings;}) ];
programs = {
ssh.enable = true;
git.extraConfig.safe.directory = "${adNixPath}";