WIP panoptes transition

This commit is contained in:
John Lancaster
2024-12-09 18:00:41 -06:00
parent 41bf8a074e
commit 76dbeeeff1
10 changed files with 154 additions and 137 deletions

View File

@@ -1,5 +1,5 @@
{
description = "Loki flake config";
description = "Panoptes flake config";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
@@ -8,7 +8,7 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
vscode-server.url = "path:./nixos/vscode";
vscode-server.url = "github:nix-community/nixos-vscode-server";
};
outputs = {
@@ -19,61 +19,65 @@
...
} @ inputs:
let
stateVersion = "24.11";
inherit (self) outputs;
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
stateVersion = "24.05";
timeZone = "America/Chicago";
hostname = "loki";
lokiPort = 3100;
lokiUser = "loki";
lokiPath = "/srv/loki";
nixosSystem = inputs.nixpkgs.lib.nixosSystem;
userSettings = rec {
username = "panoptes";
gitUserName = "John Lancaster";
gitUserEmail = "32917998+jsl12@users.noreply.github.com";
# gitUserEmail = "asdfasdf@asdf.com";
};
systemSettings = rec {
hostName = "panoptes-nix";
system = "x86_64-linux";
timeZone = "America/Chicago";
locale = "en_US.UTF-8";
};
pkgs = inputs.nixpkgs.legacyPackages.${systemSettings.system};
pkgs-stable = inputs.nixpkgs-stable.legacyPackages.${systemSettings.system};
in
{
nixosModules.default = ./nixosModules;
nixosConfigurations = {
${hostname} = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
"${systemSettings.hostName}" = nixosSystem {
system = systemSettings.system;
specialArgs = {
inherit inputs;
inherit outputs;
inherit userSettings;
inherit systemSettings;
};
modules = [
./nixos/configuration.nix # > Our main nixos configuration file <
"${nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
./configuration.nix # > Our main nixos configuration file <
"${inputs.nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
({ ... }: {
nixpkgs.hostPlatform = "${system}";
system.stateVersion = "${stateVersion}";
time.timeZone = "${timeZone}";
environment.systemPackages = [
(pkgs.writeShellScriptBin "nfs" ''
sudo nixos-rebuild switch --flake git+file://${lokiPath}#${hostname}
'')
];
})
(import ./nixos/loki.nix {
inherit pkgs;
inherit lokiPort;
inherit lokiUser;
inherit lokiPath;
services.vscode-server.enable = true;
})
inputs.vscode-server.nixosModules.default
];
};
};
# 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}"; })];
};
# 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 <
"panoptes@panoptes-nix" = home-manager.lib.homeManagerConfiguration {
inherit pkgs stateVersion;
specialArgs = {
inherit inputs;
inherit outputs;
inherit userSettings;
inherit systemSettings;
};
modules = [
(import ./home-manager/home.nix { user = "${lokiUser}"; repoPath = "${lokiPath}"; })
(import ./home-manager/git.nix { repoPath = "${lokiPath}"; })
./home.nix
# ({...}: {home.stateVersion = "${stateVersion}";})
];
};
};