generated from john/nix-docker
working flakes
This commit is contained in:
67
flake.nix
Normal file
67
flake.nix
Normal file
@@ -0,0 +1,67 @@
|
||||
{
|
||||
description = "Loki flake config";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||
nixpkgs-stable.url = "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";
|
||||
timeZone = "America/Chicago";
|
||||
hostname = "loki";
|
||||
lokiUser = "loki";
|
||||
lokiPath = "/srv/loki";
|
||||
in
|
||||
{
|
||||
nixosConfigurations = {
|
||||
# FIXME replace with your hostname
|
||||
${hostname} = nixpkgs.lib.nixosSystem {
|
||||
system = "${system}";
|
||||
# time.timeZone = "${timeZone}";
|
||||
specialArgs = {inherit inputs outputs;};
|
||||
modules = [
|
||||
./configuration.nix # > Our main nixos configuration file <
|
||||
vscode-server.nixosModules.default
|
||||
({ config, pkgs, ... }: {services.vscode-server.enable = true;})
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# 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}"; })
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user