Files
loki-nix/flake.nix
John Lancaster f303b9ec57 better variables
2024-12-07 14:26:10 -06:00

80 lines
2.4 KiB
Nix

{
description = "Loki flake config";
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";
};
outputs = {
self,
nixpkgs,
nixpkgs-stable,
home-manager,
vscode-server,
...
} @ inputs:
let
inherit (self) outputs;
system = "x86_64-linux";
stateVersion = "24.05";
timeZone = "America/Chicago";
hostname = "loki";
lokiUser = "loki";
lokiPath = "/srv/loki";
lokiPort = 3100;
in
{
nixosConfigurations = {
# FIXME replace with your hostname
${hostname} = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs outputs;};
# pkgs = import nixpkgs { system = "x86_64-linux"; };
modules = [
./configuration.nix # > Our main nixos configuration file <
"${nixpkgs}/nixos/modules/virtualisation/proxmox-lxc.nix"
({ ... }: {
nixpkgs.hostPlatform = "${system}";
system.stateVersion = "${stateVersion}";
time.timeZone = "${timeZone}";
})
vscode-server.nixosModules.default
({ config, pkgs, ... }: {services.vscode-server.enable = true;})
(import ./loki.nix {
pkgs = nixpkgs.legacyPackages.${system};
inherit lokiPort;
inherit lokiUser;
})
];
};
};
# 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 ./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 <
modules = [
(import ./home.nix { user = "${lokiUser}"; repoPath = "${lokiPath}"; })
(import ./git.nix { repoPath = "${lokiPath}"; })
];
};
};
};
}