mirror of
https://git.sr.ht/~roxwize/.dotfiles
synced 2025-03-13 07:53:25 +00:00
~
This commit is contained in:
parent
15ba5fb4e8
commit
41fe95e9b1
7 changed files with 5 additions and 147 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
|||
result/
|
||||
result
|
||||
*.img
|
||||
|
|
|
@ -19,11 +19,6 @@ nixos-install --flake './nixos#[hostname]'
|
|||
|
||||
from my experience the process is more involved, but it ultimately boils down to those three commands above (the first command is only for bootstrapping). youll need to make a configuration for your host which involves creating default configurations with `nixos-generate-config`, copying it to your host's folder in `nixos/hosts/[host]/`, editing it, and then adding it to `flake.nix`. after that you should clone the repo inside of `/home/rae/` on your filesystem
|
||||
|
||||
FOOTNOTE: the `r5e` option set is importantm,, for Difnerent thigs,. Its individual segments can be found in:
|
||||
|
||||
- `docker/default.nix` - this file imports other files which use the r5e set to provide options for configuring predefined docker containers without needing to write yucky yaml, that dumbfuck piece of shit I HATE that STUPID Yaml (see the subdirectories' default.nix files for configuration options)
|
||||
- i lied HAHA, that is all the set is used for, ill probably make it more all-encompassing when the need for such a thing actually arises ...
|
||||
|
||||
## raspberry PI devices
|
||||
|
||||
[raspberry-pi-nix](https://github.com/nix-community/raspberry-pi-nix) is used to build PI sd card images. have yur lil sd card on hand (paw) and run in the root of the repository:
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{ lib, config, ... }: {
|
||||
imports = [
|
||||
./homepage
|
||||
];
|
||||
}
|
|
@ -1,67 +0,0 @@
|
|||
# Auto-generated using compose2nix v0.3.1.
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# Runtime
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
autoPrune.enable = true;
|
||||
};
|
||||
virtualisation.oci-containers.backend = "docker";
|
||||
|
||||
# Containers
|
||||
virtualisation.oci-containers.containers."homepage" = {
|
||||
image = "ghcr.io/gethomepage/homepage:latest";
|
||||
volumes = [
|
||||
"/etc/homepage-dashboard:/app/config:rw"
|
||||
"/var/run/docker.sock:/var/run/docker.sock:rw"
|
||||
];
|
||||
log-driver = "journald";
|
||||
extraOptions = [
|
||||
"--network-alias=homepage"
|
||||
"--network=homepage_default"
|
||||
];
|
||||
};
|
||||
systemd.services."docker-homepage" = {
|
||||
serviceConfig = {
|
||||
Restart = lib.mkOverride 90 "no";
|
||||
};
|
||||
after = [
|
||||
"docker-network-homepage_default.service"
|
||||
];
|
||||
requires = [
|
||||
"docker-network-homepage_default.service"
|
||||
];
|
||||
partOf = [
|
||||
"docker-compose-homepage-root.target"
|
||||
];
|
||||
wantedBy = [
|
||||
"docker-compose-homepage-root.target"
|
||||
];
|
||||
};
|
||||
|
||||
# Networks
|
||||
systemd.services."docker-network-homepage_default" = {
|
||||
path = [ pkgs.docker ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStop = "docker network rm -f homepage_default";
|
||||
};
|
||||
script = ''
|
||||
docker network inspect homepage_default || docker network create homepage_default
|
||||
'';
|
||||
partOf = [ "docker-compose-homepage-root.target" ];
|
||||
wantedBy = [ "docker-compose-homepage-root.target" ];
|
||||
};
|
||||
|
||||
# Root service
|
||||
# When started, this will automatically create all resources and start
|
||||
# the containers. When stopped, this will teardown all resources.
|
||||
systemd.targets."docker-compose-homepage-root" = {
|
||||
unitConfig = {
|
||||
Description = "Root target generated by compose2nix.";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
}
|
|
@ -1,49 +0,0 @@
|
|||
{ pkgs, lib, config, ... }: let
|
||||
cfg = config.r5e.containers.homepage;
|
||||
settingsFormat = pkgs.formats.yaml {};
|
||||
in with lib; {
|
||||
options.r5e.containers.homepage = {
|
||||
enable = mkEnableOption "homepage";
|
||||
listenPort = mkOption {
|
||||
type = types.int;
|
||||
default = 3000;
|
||||
};
|
||||
openFirewall = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
};
|
||||
settings = mkOption {
|
||||
inherit (settingsFormat) type;
|
||||
description = "See https://gethomepage.dev/configs/settings/";
|
||||
default = {};
|
||||
};
|
||||
widgets = mkOption {
|
||||
inherit (settingsFormat) type;
|
||||
description = "See https://gethomepage.dev/widgets/";
|
||||
default = [];
|
||||
};
|
||||
imagesDir = mkOption {
|
||||
type = types.path;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
(import ./compose.nix { inherit pkgs lib; })
|
||||
{
|
||||
environment.etc = mkIf cfg.enable {
|
||||
"homepage-dashboard/settings.yaml".source = settingsFormat.generate "settings.yaml" cfg.settings;
|
||||
"homepage-dashboard/widgets.yaml".source = settingsFormat.generate "widgets.yaml" cfg.widgets;
|
||||
};
|
||||
|
||||
networking.firewall = mkIf cfg.openFirewall {
|
||||
allowedTCPPorts = [ cfg.listenPort ];
|
||||
};
|
||||
|
||||
virtualisation.oci-containers.containers.homepage = {
|
||||
ports = [ (builtins.toString cfg.listenPort + ":3000/tcp") ];
|
||||
volumes = mkIf (cfg.imagesDir != null) [ (builtins.toString cfg.imagesDir + ":/app/public/images:rw") ];
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
name: homepage
|
||||
services:
|
||||
homepage:
|
||||
image: ghcr.io/gethomepage/homepage:latest
|
||||
container_name: homepage
|
||||
ports:
|
||||
- 3000:3000
|
||||
volumes:
|
||||
- /etc/homepage-dashboard:/app/config # Make sure your local config directory exists
|
||||
- /var/run/docker.sock:/var/run/docker.sock # (optional) For docker integrations
|
|
@ -4,7 +4,6 @@
|
|||
inputs.raspberry-pi-nix.nixosModules.sd-image
|
||||
./hardware-configuration.nix
|
||||
../base.nix
|
||||
../../docker
|
||||
];
|
||||
|
||||
users.users.root.openssh.authorizedKeys.keys = [
|
||||
|
@ -13,16 +12,14 @@
|
|||
|
||||
programs.git.enable = true;
|
||||
virtualisation.docker.enable = true;
|
||||
r5e.containers = {
|
||||
# TODO: this doesnt work (some random ENOENT shit) and it seems slightly overkill
|
||||
# maybe make your own dashboard page yourself or something
|
||||
homepage = {
|
||||
enable = false;
|
||||
|
||||
services = {
|
||||
homepage-dashboard = {
|
||||
enable = true;
|
||||
listenPort = 80;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
title = "near";
|
||||
background = "/images/2kki_rainy_apartments.png";
|
||||
theme = "dark";
|
||||
color = "violet";
|
||||
headerStyle = "clean";
|
||||
|
@ -52,11 +49,7 @@
|
|||
};
|
||||
}
|
||||
];
|
||||
imagesDir = /home/rae/.dotfiles/assets/wallpapers;
|
||||
};
|
||||
};
|
||||
|
||||
services = {
|
||||
openssh = {
|
||||
ports = [ 22 ];
|
||||
banner = "I won't hold it against you";
|
||||
|
|
Loading…
Add table
Reference in a new issue