Compare commits
9 commits
f8fc9db0b2
...
fe916fe9e3
Author | SHA1 | Date | |
---|---|---|---|
Casper V. Kristensen | fe916fe9e3 | ||
Casper V. Kristensen | 887cedd40e | ||
Casper V. Kristensen | f3ae1b711f | ||
Casper V. Kristensen | 1cec05270e | ||
Casper V. Kristensen | 76e6e99460 | ||
Casper V. Kristensen | 24b13a61ab | ||
Casper V. Kristensen | 252127cd36 | ||
Casper V. Kristensen | 9acfc136d0 | ||
Casper V. Kristensen | 984bf66b2d |
26
flake.lock
26
flake.lock
|
@ -85,11 +85,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714203603,
|
"lastModified": 1714515075,
|
||||||
"narHash": "sha256-eT7DENhYy7EPLOqHI9zkIMD9RvMCXcqh6gGqOK5BWYQ=",
|
"narHash": "sha256-azMK7aWH0eUc3IqU4Fg5rwZdB9WZBvimOGG3piqvtsY=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "c1609d584a6b5e9e6a02010f51bd368cb4782f8e",
|
"rev": "6d3b6dc9222c12b951169becdf4b0592ee9576ef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -136,11 +136,11 @@
|
||||||
},
|
},
|
||||||
"nixos-hardware": {
|
"nixos-hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714201532,
|
"lastModified": 1714465198,
|
||||||
"narHash": "sha256-nk0W4rH7xYdDeS7k1SqqNtBaNrcgIBYNmOVc8P2puEY=",
|
"narHash": "sha256-ySkEJvS0gPz2UhXm0H3P181T8fUxvDVcoUyGn0Kc5AI=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "53db5e1070d07e750030bf65f1b9963df8f0c678",
|
"rev": "68d680c1b7c0e67a9b2144d6776583ee83664ef4",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -152,11 +152,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714272655,
|
"lastModified": 1714409183,
|
||||||
"narHash": "sha256-3/ghIWCve93ngkx5eNPdHIKJP/pMzSr5Wc4rNKE1wOc=",
|
"narHash": "sha256-Wacm/DrzLD7mjFGnSxxyGkJgg2unU/dNdNgdngBH+RU=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "12430e43bd9b81a6b4e79e64f87c624ade701eaf",
|
"rev": "576ecd43d3b864966b4423a853412d6177775e8b",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -228,11 +228,11 @@
|
||||||
},
|
},
|
||||||
"secrets": {
|
"secrets": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1714320269,
|
"lastModified": 1714518477,
|
||||||
"narHash": "sha256-hc1oeeIyhoSwz4uW1i6XbKyPrUmmjj/EwnqEjpLD1N8=",
|
"narHash": "sha256-doZSxR7Aot5ZvcCSa/qiC9LbRXJr6XNuflWPS2skStk=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "3cb27fc185eceef3c6efc4e6084a275c153fe9ee",
|
"rev": "e09d11dbc33eb854f64cfda0d153ca23aeec4035",
|
||||||
"revCount": 30,
|
"revCount": 34,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "ssh://git@git.caspervk.net/caspervk/nixos-secrets.git"
|
"url": "ssh://git@git.caspervk.net/caspervk/nixos-secrets.git"
|
||||||
},
|
},
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
./hardware.nix
|
./hardware.nix
|
||||||
./jellyfin.nix
|
./jellyfin.nix
|
||||||
./mail.nix
|
./mail.nix
|
||||||
|
./memos.nix
|
||||||
./network.nix
|
./network.nix
|
||||||
./sonarr.nix
|
./sonarr.nix
|
||||||
];
|
];
|
||||||
|
|
|
@ -54,6 +54,10 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Add caspervk user to the 'torrent' group to allow viewing downloads
|
||||||
|
users.groups.torrent.members = ["caspervk"];
|
||||||
|
|
||||||
|
|
||||||
environment.persistence."/nix/persist" = {
|
environment.persistence."/nix/persist" = {
|
||||||
directories = [
|
directories = [
|
||||||
# Deluge data directory. This is *NOT* where the downloads are saved
|
# Deluge data directory. This is *NOT* where the downloads are saved
|
||||||
|
@ -70,7 +74,7 @@
|
||||||
# /srv/torrents/downloads/movies/ and /srv/torrents/tv/.
|
# /srv/torrents/downloads/movies/ and /srv/torrents/tv/.
|
||||||
{
|
{
|
||||||
directory = "/srv/torrents";
|
directory = "/srv/torrents";
|
||||||
user = "caspervk";
|
user = "deluge";
|
||||||
group = "torrent";
|
group = "torrent";
|
||||||
mode = "0770";
|
mode = "0770";
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,83 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
nixpkgs-unstable,
|
||||||
pkgs,
|
pkgs,
|
||||||
secrets,
|
secrets,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
# Forgejo is a lightweight software forge (Git host), with a highlight on
|
||||||
|
# being completely free software. It's a fork of Gitea.
|
||||||
|
# https://wiki.nixos.org/wiki/Forgejo
|
||||||
|
services.forgejo = {
|
||||||
|
enable = true;
|
||||||
|
# TODO: remove package override in NixOS 24.04
|
||||||
|
package = nixpkgs-unstable.legacyPackages.x86_64-linux.forgejo;
|
||||||
|
# Run Forgejo under git:git for better ssh clone urls.
|
||||||
|
user = "git";
|
||||||
|
group = "git";
|
||||||
|
# https://forgejo.org/docs/latest/admin/config-cheat-sheet/
|
||||||
|
settings = {
|
||||||
|
DEFAULT = {
|
||||||
|
# Application name, used in the page title.
|
||||||
|
APP_NAME = "Git";
|
||||||
|
};
|
||||||
|
repository = {
|
||||||
|
# Default branch name of all repositories.
|
||||||
|
DEFAULT_BRANCH = "master";
|
||||||
|
# Comma separated list of globally disabled repo units.
|
||||||
|
DISABLED_REPO_UNITS = "repo.issues,repo.ext_issues,repo.pulls,repo.wiki,repo.ext_wiki,repo.projects,repo.packages";
|
||||||
|
};
|
||||||
|
ui = {
|
||||||
|
# Default theme.
|
||||||
|
DEFAULT_THEME = "gitea-light";
|
||||||
|
};
|
||||||
|
server = {
|
||||||
|
# Listen address. Defaults to '0.0.0.0'.
|
||||||
|
HTTP_ADDR = "localhost";
|
||||||
|
# Domain name of the server.
|
||||||
|
DOMAIN = "git.caspervk.net";
|
||||||
|
# Full public URL of Forgejo server.
|
||||||
|
ROOT_URL = "https://git.caspervk.net/";
|
||||||
|
# Landing page for unauthenticated users.
|
||||||
|
LANDING_PAGE = "/caspervk";
|
||||||
|
};
|
||||||
|
security = {
|
||||||
|
# Cookie lifetime, in days.
|
||||||
|
LOGIN_REMEMBER_DAYS = 365;
|
||||||
|
};
|
||||||
|
service = {
|
||||||
|
# Disable registration, after which only admin can create accounts for
|
||||||
|
# users.
|
||||||
|
DISABLE_REGISTRATION = true;
|
||||||
|
};
|
||||||
|
session = {
|
||||||
|
# Marks session cookies as “secure” as a hint for browsers to only send
|
||||||
|
# them via HTTPS. This option is recommend, if Forgejo is being served
|
||||||
|
# over HTTPS.
|
||||||
|
COOKIE_SECURE = true;
|
||||||
|
# Session engine provider.
|
||||||
|
PROVIDER = "db";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# The configured Forgejo user and group is only created automatically if it
|
||||||
|
# is left at the default "forgejo". The following is copied from
|
||||||
|
# https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/forgejo.nix
|
||||||
|
# but with the mkIf removed and "forgejo" substituted for "git".
|
||||||
|
users.users = {
|
||||||
|
git = {
|
||||||
|
home = config.services.forgejo.stateDir;
|
||||||
|
useDefaultShell = true;
|
||||||
|
group = "git";
|
||||||
|
isSystemUser = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
users.groups = {
|
||||||
|
git = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
# https://wiki.nixos.org/wiki/Forgejo
|
||||||
# https://forgejo.org/docs/latest/admin/actions/
|
# https://forgejo.org/docs/latest/admin/actions/
|
||||||
services.gitea-actions-runner = {
|
services.gitea-actions-runner = {
|
||||||
package = pkgs.forgejo-actions-runner;
|
package = pkgs.forgejo-actions-runner;
|
||||||
|
@ -31,6 +105,17 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.persistence."/nix/persist" = {
|
||||||
|
directories = [
|
||||||
|
{
|
||||||
|
directory = "/var/lib/forgejo";
|
||||||
|
user = "git";
|
||||||
|
group = "git";
|
||||||
|
mode = "0750";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
age.secrets.forgejo-actions-runner-token-file = {
|
age.secrets.forgejo-actions-runner-token-file = {
|
||||||
file = "${secrets}/secrets/forgejo-actions-runner-token-file.age";
|
file = "${secrets}/secrets/forgejo-actions-runner-token-file.age";
|
||||||
mode = "400";
|
mode = "400";
|
||||||
|
|
20
hosts/sigma/memos.nix
Normal file
20
hosts/sigma/memos.nix
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
{...}: {
|
||||||
|
virtualisation.oci-containers.containers = {
|
||||||
|
memos = {
|
||||||
|
# https://www.usememos.com/docs/install/self-hosting
|
||||||
|
image = "docker.io/neosmemo/memos:stable";
|
||||||
|
environment = {
|
||||||
|
# https://github.com/usememos/memos/issues/2433#issuecomment-1797316081
|
||||||
|
MEMOS_METRIC = "false";
|
||||||
|
};
|
||||||
|
ports = [
|
||||||
|
# TODO: for some *very* weird reason, exposing the port does not work
|
||||||
|
# if we use the same port on the host and inside the container. Why??
|
||||||
|
"127.0.0.1:5231:5230"
|
||||||
|
];
|
||||||
|
volumes = [
|
||||||
|
"memos:/var/opt/memos"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
|
@ -11,6 +11,7 @@
|
||||||
./network.nix
|
./network.nix
|
||||||
./nix.nix
|
./nix.nix
|
||||||
./packages.nix
|
./packages.nix
|
||||||
|
./podman.nix
|
||||||
./ripgrep.nix
|
./ripgrep.nix
|
||||||
./ssh.nix
|
./ssh.nix
|
||||||
./sudo.nix
|
./sudo.nix
|
||||||
|
|
30
modules/base/podman.nix
Normal file
30
modules/base/podman.nix
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
{...}: {
|
||||||
|
# Podman can run rootless containers and be a drop-in replacement for Docker.
|
||||||
|
# It is used for systemd services containers defined using
|
||||||
|
# `virtualisation.oci-containers`.
|
||||||
|
# https://wiki.nixos.org/wiki/Podman
|
||||||
|
virtualisation.containers.enable = true;
|
||||||
|
virtualisation.podman = {
|
||||||
|
enable = true;
|
||||||
|
# Automatically `podman system prune` weekly
|
||||||
|
autoPrune.enable = true;
|
||||||
|
# Required for containers under podman-compose to be able to talk to each
|
||||||
|
# other.
|
||||||
|
defaultNetwork.settings = {
|
||||||
|
dns_enabled = true;
|
||||||
|
ipv6_enabled = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Persist docker volumes
|
||||||
|
environment.persistence."/nix/persist" = {
|
||||||
|
directories = [
|
||||||
|
{
|
||||||
|
directory = "/var/lib/containers";
|
||||||
|
user = "root";
|
||||||
|
group = "root";
|
||||||
|
mode = "0700";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
|
@ -90,15 +90,17 @@
|
||||||
"! /**/found.000/*"
|
"! /**/found.000/*"
|
||||||
|
|
||||||
"! /**/.cache"
|
"! /**/.cache"
|
||||||
"! /**/Cache"
|
|
||||||
"! /**/cache"
|
"! /**/cache"
|
||||||
|
"! /**/Cache"
|
||||||
"! /srv/torrents"
|
"! /srv/torrents"
|
||||||
|
"! /var/lib/containers/overlay*"
|
||||||
"! /var/lib/docker/overlay2"
|
"! /var/lib/docker/overlay2"
|
||||||
"- *.tmp"
|
"- *.tmp"
|
||||||
|
|
||||||
"! /home/*/Android/Sdk"
|
"! /home/*/Android/Sdk"
|
||||||
"! /home/*/Downloads"
|
"! /home/*/Downloads"
|
||||||
"! /home/*/GOG Games"
|
"! /home/*/GOG Games"
|
||||||
|
"! /home/*/.local/share/containers/storage/overlay*"
|
||||||
"! /home/*/.steam"
|
"! /home/*/.steam"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue