generated from john/nix-docker
Compare commits
9 Commits
a6348adef1
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41bf8a074e | ||
|
|
68bfa4ef4b | ||
|
|
3121bffc30 | ||
|
|
a3179e52d7 | ||
|
|
679f8bfca0 | ||
|
|
f303b9ec57 | ||
|
|
dd3de3c145 | ||
|
|
d741b62d2c | ||
|
|
4e87f3119f |
40
flake.lock
generated
40
flake.lock
generated
@@ -48,9 +48,10 @@
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"type": "indirect"
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
@@ -63,12 +64,25 @@
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-24.11",
|
||||
"type": "indirect"
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 0,
|
||||
"narHash": "sha256-kEsTJTUQfQFIJOcLYFt/RvNxIK653ZkTBIs4DG+cBns=",
|
||||
"path": "/nix/store/nr5nl3zwzl02x3rnikjbry3s5xy7bm1d-source",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"nixpkgs_3": {
|
||||
"locked": {
|
||||
"lastModified": 1682134069,
|
||||
"narHash": "sha256-TnI/ZXSmRxQDt2sjRYK/8j8iha4B4zP2cnQCZZ3vp7k=",
|
||||
@@ -106,9 +120,25 @@
|
||||
}
|
||||
},
|
||||
"vscode-server": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
"vscode-server": "vscode-server_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1,
|
||||
"narHash": "sha256-IWEQNW6HVBCztzSy/1SmMTU6R/dyLlnZrJKk9ldJG/I=",
|
||||
"path": "./nixos/vscode",
|
||||
"type": "path"
|
||||
},
|
||||
"original": {
|
||||
"path": "./nixos/vscode",
|
||||
"type": "path"
|
||||
}
|
||||
},
|
||||
"vscode-server_2": {
|
||||
"inputs": {
|
||||
"flake-utils": "flake-utils",
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
"nixpkgs": "nixpkgs_3"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1729422940,
|
||||
|
||||
40
flake.nix
40
flake.nix
@@ -2,13 +2,13 @@
|
||||
description = "Loki flake config";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "nixpkgs/nixos-unstable";
|
||||
nixpkgs-stable.url = "nixpkgs/nixos-24.11";
|
||||
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";
|
||||
vscode-server.url = "path:./nixos/vscode";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
@@ -16,28 +16,42 @@
|
||||
nixpkgs,
|
||||
nixpkgs-stable,
|
||||
home-manager,
|
||||
vscode-server,
|
||||
...
|
||||
} @ inputs:
|
||||
let
|
||||
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";
|
||||
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;})
|
||||
./nixos/configuration.nix # > Our main nixos configuration file <
|
||||
"${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;
|
||||
})
|
||||
];
|
||||
};
|
||||
};
|
||||
@@ -49,7 +63,7 @@
|
||||
"root@${hostname}" = home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
extraSpecialArgs = {inherit inputs outputs;};
|
||||
modules = [(import ./git.nix { repoPath = "${lokiPath}"; })];
|
||||
modules = [(import ./home-manager/git.nix { repoPath = "${lokiPath}"; })];
|
||||
};
|
||||
|
||||
# FIXME replace with your username@hostname
|
||||
@@ -58,8 +72,8 @@
|
||||
extraSpecialArgs = {inherit inputs outputs;};
|
||||
# > Our main home-manager configuration file <
|
||||
modules = [
|
||||
(import ./home.nix { user = "${lokiUser}"; repoPath = "${lokiPath}"; })
|
||||
(import ./git.nix { repoPath = "${lokiPath}"; })
|
||||
(import ./home-manager/home.nix { user = "${lokiUser}"; repoPath = "${lokiPath}"; })
|
||||
(import ./home-manager/git.nix { repoPath = "${lokiPath}"; })
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
{ pkgs, lib, modulesPath, ... }:
|
||||
let
|
||||
stateVersion = "24.05";
|
||||
userName = "loki";
|
||||
repoPath = "/srv/loki";
|
||||
in
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
system.stateVersion = stateVersion;
|
||||
imports = [
|
||||
(modulesPath + "/virtualisation/proxmox-lxc.nix")
|
||||
];
|
||||
|
||||
# time.timeZone = "America/Chicago";
|
||||
|
||||
nix.settings.experimental-features = [ "nix-command" "flakes" ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
@@ -1,18 +1,15 @@
|
||||
{ pkgs, userName, ... }:
|
||||
let
|
||||
lokiPort = 3100;
|
||||
in
|
||||
{ pkgs, lokiPort ? 3100, ... }:
|
||||
{
|
||||
networking.firewall.allowedTCPPorts = [ lokiPort ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
(pkgs.writeShellScriptBin "loki-check" "curl http://localhost:3100/ready")
|
||||
(pkgs.writeShellScriptBin "loki-logs" "journalctl -b -u loki.service -n 25")
|
||||
(pkgs.writeShellScriptBin "loki-check" "curl http://localhost:${builtins.toString lokiPort}/ready")
|
||||
(pkgs.writeShellScriptBin "loki-logs" "journalctl -b -u loki.service -n 10")
|
||||
];
|
||||
|
||||
services.loki = {
|
||||
enable = true;
|
||||
user = "${userName}";
|
||||
user = "loki";
|
||||
|
||||
configuration = {
|
||||
server.http_listen_port = lokiPort;
|
||||
Reference in New Issue
Block a user