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

67
flake.nix Normal file
View File

@@ -0,0 +1,67 @@
{
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";
sops-nix = {
url = "github:Mic92/sops-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, ... }@args:
let
inherit (self) outputs;
nixosSystem = args.nixpkgs.lib.nixosSystem;
userSettings = {
username = "panoptes";
gitUserName = "John Lancaster";
gitUserEmail = "32917998+jsl12@users.noreply.github.com";
};
systemSettings = {
hostName = "ad-nix";
stateVersion = "24.11";
system = "x86_64-linux";
timeZone = "America/Chicago";
locale = "en_US.UTF-8";
};
pkgs = args.nixpkgs.legacyPackages.${systemSettings.system};
in
{
nixosConfigurations.${systemSettings.hostName} = nixosSystem {
system = systemSettings.system;
specialArgs = {
inherit systemSettings;
inherit userSettings;
};
modules = [
(args.nixpkgs + "/nixos/modules/virtualisation/proxmox-lxc.nix")
./configuration.nix
args.home-manager.nixosModules.default
args.vscode-server.nixosModules.default
args.sops-nix.nixosModules.sops
({ ... }: { services.vscode-server.enable = true; })
];
};
# homeConfigurations = {
# useGlobalPkgs = true;
# ${userSettings.username} = args.home-manager.lib.homeManagerConfiguration {
# inherit pkgs;
# extraSpecialArgs = {
# inherit systemSettings;
# inherit userSettings;
# };
# modules = [ ./home.nix ];
# };
# };
};
}