mirror of
https://github.com/nmasur/dotfiles
synced 2025-04-24 05:42:25 +00:00
Compare commits
4 Commits
9b948f45ee
...
28ffa10a59
Author | SHA1 | Date | |
---|---|---|---|
|
28ffa10a59 | ||
|
006554f545 | ||
|
1b04f9a883 | ||
|
00f23f4b9c |
@ -259,6 +259,7 @@
|
|||||||
notifications = "ntfy.${baseName}";
|
notifications = "ntfy.${baseName}";
|
||||||
prometheus = "prom.${baseName}";
|
prometheus = "prom.${baseName}";
|
||||||
paperless = "paper.${baseName}";
|
paperless = "paper.${baseName}";
|
||||||
|
photos = "photos.${baseName}";
|
||||||
secrets = "vault.${baseName}";
|
secrets = "vault.${baseName}";
|
||||||
stream = "stream.${baseName}";
|
stream = "stream.${baseName}";
|
||||||
content = "cloud.${baseName}";
|
content = "cloud.${baseName}";
|
||||||
|
@ -109,6 +109,7 @@ inputs.nixpkgs.lib.nixosSystem rec {
|
|||||||
services.audiobookshelf.enable = true;
|
services.audiobookshelf.enable = true;
|
||||||
services.bind.enable = true;
|
services.bind.enable = true;
|
||||||
services.caddy.enable = true;
|
services.caddy.enable = true;
|
||||||
|
services.immich.enable = true;
|
||||||
services.jellyfin.enable = true;
|
services.jellyfin.enable = true;
|
||||||
services.nextcloud.enable = true;
|
services.nextcloud.enable = true;
|
||||||
services.calibre-web.enable = true;
|
services.calibre-web.enable = true;
|
||||||
|
@ -101,6 +101,10 @@
|
|||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Hostname for document server (paperless-ngx).";
|
description = "Hostname for document server (paperless-ngx).";
|
||||||
};
|
};
|
||||||
|
photos = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Hostname for photo management (Immich).";
|
||||||
|
};
|
||||||
prometheus = lib.mkOption {
|
prometheus = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
description = "Hostname for Prometheus server.";
|
description = "Hostname for Prometheus server.";
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
}:
|
}:
|
||||||
{
|
{
|
||||||
|
|
||||||
|
unfreePackages = [ "gh-copilot" ];
|
||||||
|
|
||||||
home-manager.users.${config.user} = {
|
home-manager.users.${config.user} = {
|
||||||
|
|
||||||
programs.gh = lib.mkIf config.home-manager.users.${config.user}.programs.git.enable {
|
programs.gh = lib.mkIf config.home-manager.users.${config.user}.programs.git.enable {
|
||||||
@ -15,6 +17,7 @@
|
|||||||
extensions = [
|
extensions = [
|
||||||
pkgs.gh-collaborators
|
pkgs.gh-collaborators
|
||||||
pkgs.gh-dash
|
pkgs.gh-dash
|
||||||
|
pkgs.gh-copilot
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -16,7 +16,9 @@
|
|||||||
nps = "nix repl --expr 'import <nixpkgs>{}'";
|
nps = "nix repl --expr 'import <nixpkgs>{}'";
|
||||||
nixo = "man configuration.nix";
|
nixo = "man configuration.nix";
|
||||||
nixh = "man home-configuration.nix";
|
nixh = "man home-configuration.nix";
|
||||||
nr = "rebuild-nixos";
|
nr = {
|
||||||
|
function = "rebuild-nixos";
|
||||||
|
};
|
||||||
nro = "rebuild-nixos offline";
|
nro = "rebuild-nixos offline";
|
||||||
hm = "rebuild-home";
|
hm = "rebuild-home";
|
||||||
};
|
};
|
||||||
@ -43,18 +45,16 @@
|
|||||||
rebuild-nixos = {
|
rebuild-nixos = {
|
||||||
body = ''
|
body = ''
|
||||||
if test "$argv[1]" = "offline"
|
if test "$argv[1]" = "offline"
|
||||||
set option "--option substitute false"
|
set option "--option substitute false "
|
||||||
end
|
end
|
||||||
git -C ${config.dotfilesPath} add --intent-to-add --all
|
git -C ${config.dotfilesPath} add --intent-to-add --all
|
||||||
commandline -r "doas nixos-rebuild switch $option --flake ${config.dotfilesPath}#${config.networking.hostName}"
|
echo "doas nixos-rebuild switch $option--flake ${config.dotfilesPath}#${config.networking.hostName}"
|
||||||
commandline --function execute
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
rebuild-home = {
|
rebuild-home = {
|
||||||
body = ''
|
body = ''
|
||||||
git -C ${config.dotfilesPath} add --intent-to-add --all
|
git -C ${config.dotfilesPath} add --intent-to-add --all
|
||||||
commandline -r "${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#${config.networking.hostName}";
|
echo "${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#${config.networking.hostName}";
|
||||||
commandline --function execute
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -10,7 +10,9 @@
|
|||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
shellAbbrs = {
|
shellAbbrs = {
|
||||||
nr = lib.mkForce "rebuild-darwin";
|
nr = {
|
||||||
|
function = lib.mkForce "rebuild-darwin";
|
||||||
|
};
|
||||||
nro = lib.mkForce "rebuild-darwin offline";
|
nro = lib.mkForce "rebuild-darwin offline";
|
||||||
};
|
};
|
||||||
functions = {
|
functions = {
|
||||||
@ -20,15 +22,13 @@
|
|||||||
set option "--option substitute false"
|
set option "--option substitute false"
|
||||||
end
|
end
|
||||||
git -C ${config.dotfilesPath} add --intent-to-add --all
|
git -C ${config.dotfilesPath} add --intent-to-add --all
|
||||||
commandline -r "darwin-rebuild switch $option --flake ${config.dotfilesPath}#lookingglass"
|
echo "darwin-rebuild switch $option--flake ${config.dotfilesPath}#lookingglass"
|
||||||
commandline --function execute
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
rebuild-home = lib.mkForce {
|
rebuild-home = lib.mkForce {
|
||||||
body = ''
|
body = ''
|
||||||
git -C ${config.dotfilesPath} add --intent-to-add --all
|
git -C ${config.dotfilesPath} add --intent-to-add --all
|
||||||
commandline -r "${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#lookingglass";
|
echo "${pkgs.home-manager}/bin/home-manager switch --flake ${config.dotfilesPath}#lookingglass";
|
||||||
commandline --function execute
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
./cloudflare.nix
|
./cloudflare.nix
|
||||||
./filebrowser.nix
|
./filebrowser.nix
|
||||||
./identity.nix
|
./identity.nix
|
||||||
|
./immich.nix
|
||||||
./irc.nix
|
./irc.nix
|
||||||
./gitea-runner.nix
|
./gitea-runner.nix
|
||||||
./gitea.nix
|
./gitea.nix
|
||||||
|
42
modules/nixos/services/immich.nix
Normal file
42
modules/nixos/services/immich.nix
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
config = lib.mkIf config.services.immich.enable {
|
||||||
|
|
||||||
|
services.immich = {
|
||||||
|
port = 2283;
|
||||||
|
group = "shared";
|
||||||
|
database.enable = true;
|
||||||
|
redis.enable = true;
|
||||||
|
machine-learning.enable = true;
|
||||||
|
machine-learning.environment = { };
|
||||||
|
mediaLocation = "/data/images";
|
||||||
|
secretsFile = null;
|
||||||
|
settings.server.externalDomain = "https://${config.hostnames.photos}";
|
||||||
|
environment = {
|
||||||
|
IMMICH_ENV = "production";
|
||||||
|
IMMICH_LOG_LEVEL = "log";
|
||||||
|
NO_COLOR = "false";
|
||||||
|
IMMICH_TRUSTED_PROXIES = "127.0.0.1";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
caddy.routes = [
|
||||||
|
{
|
||||||
|
match = [ { host = [ config.hostnames.photos ]; } ];
|
||||||
|
handle = [
|
||||||
|
{
|
||||||
|
handler = "reverse_proxy";
|
||||||
|
upstreams = [ { dial = "localhost:${builtins.toString config.services.immich.port}"; } ];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
|
# Configure Cloudflare DNS to point to this machine
|
||||||
|
services.cloudflare-dyndns.domains = [ config.hostnames.photos ];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -10,6 +10,7 @@
|
|||||||
./auto-upgrade.nix
|
./auto-upgrade.nix
|
||||||
./doas.nix
|
./doas.nix
|
||||||
./journald.nix
|
./journald.nix
|
||||||
|
./shared.nix
|
||||||
./user.nix
|
./user.nix
|
||||||
./timezone.nix
|
./timezone.nix
|
||||||
];
|
];
|
||||||
|
14
modules/nixos/system/shared.nix
Normal file
14
modules/nixos/system/shared.nix
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{ config, lib, ... }:
|
||||||
|
{
|
||||||
|
|
||||||
|
config = lib.mkIf config.server {
|
||||||
|
|
||||||
|
# Create a shared group for many services
|
||||||
|
users.groups.shared = { };
|
||||||
|
|
||||||
|
# Give the human user access to the shared group
|
||||||
|
users.users.${config.user}.extraGroups = [ config.users.groups.shared.name ];
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user