what
This commit is contained in:
parent
616f310f4a
commit
1555d7b643
|
@ -9,3 +9,6 @@ This is my cobbled together NixOS configuration. There are many like it, but thi
|
||||||
- [ ] logging (loki)
|
- [ ] logging (loki)
|
||||||
- [ ] kiosk
|
- [ ] kiosk
|
||||||
- [ ] tailscale and headscale
|
- [ ] tailscale and headscale
|
||||||
|
- [ ] game rom sync insomniac
|
||||||
|
- [ ] insomniac backups
|
||||||
|
- [ ] nginx websites
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
{
|
{config, ...}: let
|
||||||
config,
|
virtualHostName = "grafana.helveticanonstandard.net";
|
||||||
lib,
|
in {
|
||||||
...
|
|
||||||
}: {
|
|
||||||
services.grafana = {
|
services.grafana = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
settings.server = {
|
settings.server = {
|
||||||
domain = "grafana.pele";
|
domain = virtualHostName;
|
||||||
http_port = 9010;
|
http_port = 9010;
|
||||||
http_addr = "127.0.0.1";
|
http_addr = "127.0.0.1";
|
||||||
root_url = "http://192.168.1.10:8010"; # TODO
|
root_url = "http://192.168.1.10:8010"; # TODO
|
||||||
|
@ -23,24 +21,24 @@
|
||||||
name = "Prometheus";
|
name = "Prometheus";
|
||||||
type = "prometheus";
|
type = "prometheus";
|
||||||
access = "proxy";
|
access = "proxy";
|
||||||
url = "http://127.0.0.1:${toString config.services.prometheus.port}";
|
url = "http://127.0.0.1:${builtins.toString config.services.prometheus.port}";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
name = "Loki";
|
name = "Loki";
|
||||||
type = "loki";
|
type = "loki";
|
||||||
access = "proxy";
|
access = "proxy";
|
||||||
url = "http://127.0.0.1:${toString config.services.loki.configuration.server.http_listen_port}";
|
url = "http://127.0.0.1:${builtins.toString config.services.loki.configuration.server.http_listen_port}";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = {
|
services.nginx.virtualHosts.${virtualHostName} = {
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://${lib.formatHostPort {
|
proxyPass = let
|
||||||
host = config.services.grafana.settings.server.http_addr;
|
host = config.services.grafana.settings.server.http_addr;
|
||||||
port = config.services.grafana.settings.server.http_port;
|
port = builtins.toString config.services.grafana.settings.server.http_port;
|
||||||
}}";
|
in "http://${host}:${port}";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,8 +1,4 @@
|
||||||
{
|
{config, ...}: {
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
services.prometheus = {
|
services.prometheus = {
|
||||||
enable = true;
|
enable = true;
|
||||||
port = 3020;
|
port = 3020;
|
||||||
|
@ -22,11 +18,9 @@
|
||||||
static_configs = [
|
static_configs = [
|
||||||
{
|
{
|
||||||
targets = let
|
targets = let
|
||||||
target = lib.formatHostPort {
|
|
||||||
host = config.services.prometheus.exporters.node.listenAddress;
|
host = config.services.prometheus.exporters.node.listenAddress;
|
||||||
inherit (config.services.prometheus.exporters.node) port;
|
port = builtins.toString config.services.prometheus.exporters.node.port;
|
||||||
};
|
in ["${host}:${port}"];
|
||||||
in [target];
|
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
{
|
|
||||||
services.tailscale = {
|
|
||||||
enable = true;
|
|
||||||
openFirewall = true; #TODO
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.firewall = {
|
|
||||||
checkReversePath = "loose";
|
|
||||||
trustedInterfaces = ["tailscale0"];
|
|
||||||
allowedUDPPorts = [config.services.tailscale.port];
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,32 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
|
||||||
inputs.nixos-cosmic.nixosModules.default
|
|
||||||
];
|
|
||||||
|
|
||||||
nix.settings = {
|
|
||||||
substituters = ["https://cosmic.cachix.org/"];
|
|
||||||
trusted-public-keys = ["cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE="];
|
|
||||||
};
|
|
||||||
|
|
||||||
services = {
|
|
||||||
desktopManager.cosmic.enable = true;
|
|
||||||
displayManager.cosmic-greeter.enable = true;
|
|
||||||
|
|
||||||
greetd.settings.initial_session = {
|
|
||||||
user = config.users.mainUser;
|
|
||||||
command = ''
|
|
||||||
${lib.getExe' pkgs.coreutils "env"} XCURSOR_THEME="''${XCURSOR_THEME:-Pop}" systemd-cat --identifier start-cosmic ${lib.getExe' pkgs.cosmic-session "start-cosmic"}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.cosmic.excludePackages = [
|
|
||||||
pkgs.cosmic-store
|
|
||||||
];
|
|
||||||
}
|
|
|
@ -1,14 +0,0 @@
|
||||||
{inputs, ...}: {
|
|
||||||
imports = [
|
|
||||||
inputs.flatpak.nixosModules.nix-flatpak
|
|
||||||
];
|
|
||||||
|
|
||||||
services.flatpak = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
update.auto = {
|
|
||||||
enable = true;
|
|
||||||
onCalendar = "weekly";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
{pkgs, ...}: {
|
|
||||||
fonts = {
|
|
||||||
enableDefaultPackages = true;
|
|
||||||
packages = [
|
|
||||||
pkgs.noto-fonts
|
|
||||||
pkgs.noto-fonts-extra
|
|
||||||
pkgs.noto-fonts-cjk-sans
|
|
||||||
pkgs.noto-fonts-cjk-serif
|
|
||||||
pkgs.noto-fonts-monochrome-emoji
|
|
||||||
pkgs.noto-fonts-color-emoji
|
|
||||||
];
|
|
||||||
|
|
||||||
fontconfig = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
defaultFonts = {
|
|
||||||
monospace = ["Noto Sans Mono"];
|
|
||||||
sansSerif = ["Noto Sans"];
|
|
||||||
serif = ["Noto Serif"];
|
|
||||||
emoji = ["Noto Color Emoji" "Noto Emoji"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
fontDir.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
{pkgs, ...}: {
|
|
||||||
xdg.portal.extraPortals = [pkgs.xdg-desktop-portal-gtk];
|
|
||||||
|
|
||||||
programs.dconf.enable = true;
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
hardware = {
|
|
||||||
bluetooth.enable = true;
|
|
||||||
steam-hardware.enable = true;
|
|
||||||
xone.enable = true;
|
|
||||||
xpadneo.enable = true;
|
|
||||||
graphics.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
location.provider = "geoclue2";
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
{config, ...}: {
|
|
||||||
services.resolved.enable = true;
|
|
||||||
|
|
||||||
networking.networkmanager = {
|
|
||||||
enable = true;
|
|
||||||
dns = "systemd-resolved";
|
|
||||||
};
|
|
||||||
|
|
||||||
users.groups.networkmanager.members = config.users.normalUsers;
|
|
||||||
}
|
|
|
@ -1,11 +0,0 @@
|
||||||
{
|
|
||||||
security.rtkit.enable = true;
|
|
||||||
|
|
||||||
services.pipewire = {
|
|
||||||
enable = true;
|
|
||||||
wireplumber.enable = true;
|
|
||||||
alsa.enable = true;
|
|
||||||
pulse.enable = true;
|
|
||||||
jack.enable = true;
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,3 +0,0 @@
|
||||||
{
|
|
||||||
xdg.portal.xdgOpenUsePortal = true;
|
|
||||||
}
|
|
3
common/comma.nix
Normal file
3
common/comma.nix
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
programs.nix-index-database.comma.enable = true;
|
||||||
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
{
|
{
|
||||||
|
# TODO
|
||||||
programs.command-not-found.enable = false;
|
programs.command-not-found.enable = false;
|
||||||
}
|
}
|
5
common/nix-index-database.nix
Normal file
5
common/nix-index-database.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{inputs, ...}: {
|
||||||
|
imports = [
|
||||||
|
inputs.nix-index-database.nixosModules.nix-index
|
||||||
|
];
|
||||||
|
}
|
|
@ -18,6 +18,8 @@
|
||||||
"flakes"
|
"flakes"
|
||||||
];
|
];
|
||||||
auto-optimise-store = true;
|
auto-optimise-store = true;
|
||||||
|
flake-registry = "";
|
||||||
|
use-xdg-base-directories = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
14
common/tailscale.nix
Normal file
14
common/tailscale.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{config, ...}: {
|
||||||
|
services.tailscale = {
|
||||||
|
enable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall = {
|
||||||
|
trustedInterfaces = [
|
||||||
|
config.services.tailscale.interfaceName
|
||||||
|
];
|
||||||
|
# Required to connect to Tailscale exit nodes
|
||||||
|
checkReversePath = "loose";
|
||||||
|
};
|
||||||
|
}
|
69
flake.lock
69
flake.lock
|
@ -95,11 +95,11 @@
|
||||||
"nixpkgs": "nixpkgs_4"
|
"nixpkgs": "nixpkgs_4"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741348424,
|
"lastModified": 1742659231,
|
||||||
"narHash": "sha256-nPwbJpX8AxmzbgRd2m6KHIbyN1xavq1BaBdJzO/lkW0=",
|
"narHash": "sha256-7bvafmxXeRfoAtWSJeTFmHlCHMte0cZecGE/BvvgyqE=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "devenv",
|
"repo": "devenv",
|
||||||
"rev": "8f8c96bb1e0c6a59a97592328dc61b9fdbe7474b",
|
"rev": "c651cb04013be972767aaecb3e9a98fc930d080e",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -332,11 +332,11 @@
|
||||||
},
|
},
|
||||||
"hardware": {
|
"hardware": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741325094,
|
"lastModified": 1742631601,
|
||||||
"narHash": "sha256-RUAdT8dZ6k/486vnu3tiNRrNW6+Q8uSD2Mq7gTX4jlo=",
|
"narHash": "sha256-yJ3OOAmsGAxSl0bTmKUp3+cEYtSS+V6hUPK2rYhIPr8=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixos-hardware",
|
"repo": "nixos-hardware",
|
||||||
"rev": "b48cc4dab0f9711af296fc367b6108cf7b8ccb16",
|
"rev": "380ed15bcd6440606c6856db44a99140d422b46f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -425,11 +425,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1734114420,
|
"lastModified": 1741798497,
|
||||||
"narHash": "sha256-n52PUzub5jZWc8nI/sR7UICOheU8rNA+YZ73YaHeCBg=",
|
"narHash": "sha256-E3j+3MoY8Y96mG1dUIiLFm2tZmNbRvSiyN7CrSKuAVg=",
|
||||||
"owner": "domenkozar",
|
"owner": "domenkozar",
|
||||||
"repo": "nix",
|
"repo": "nix",
|
||||||
"rev": "bde6a1a0d1f2af86caa4d20d23eca019f3d57eee",
|
"rev": "f3f44b2baaf6c4c6e179de8cbb1cc6db031083cd",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -439,6 +439,26 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nix-index-database": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1742701275,
|
||||||
|
"narHash": "sha256-AulwPVrS9859t+eJ61v24wH/nfBEIDSXYxlRo3fL/SA=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nix-index-database",
|
||||||
|
"rev": "36dc43cb50d5d20f90a28d53abb33a32b0a2aae6",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nix-index-database",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixos-cosmic": {
|
"nixos-cosmic": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat_3",
|
"flake-compat": "flake-compat_3",
|
||||||
|
@ -446,11 +466,11 @@
|
||||||
"nixpkgs-stable": "nixpkgs-stable_2"
|
"nixpkgs-stable": "nixpkgs-stable_2"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741532023,
|
"lastModified": 1742641703,
|
||||||
"narHash": "sha256-wPoRT99r7dMQiXWzDe9v/2OSXOmGOWad/0q9norshvs=",
|
"narHash": "sha256-hoN8blvJco8OSZmPj8izwQaQUdydVi+5FO4/nWd1MNU=",
|
||||||
"owner": "lilyinstarlight",
|
"owner": "lilyinstarlight",
|
||||||
"repo": "nixos-cosmic",
|
"repo": "nixos-cosmic",
|
||||||
"rev": "364761eb5ba3f1514446b6a0eb8e8651c5bc4c67",
|
"rev": "216557e6cd229dbe7d73a497c227824a3c579cd7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -508,11 +528,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs-stable_2": {
|
"nixpkgs-stable_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741332913,
|
"lastModified": 1742512142,
|
||||||
"narHash": "sha256-ri1e8ZliWS3Jnp9yqpKApHaOo7KBN33W8ECAKA4teAQ=",
|
"narHash": "sha256-8XfURTDxOm6+33swQJu/hx6xw1Tznl8vJJN5HwVqckg=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "20755fa05115c84be00b04690630cb38f0a203ad",
|
"rev": "7105ae3957700a9646cc4b766f5815b23ed0c682",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -588,11 +608,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_6": {
|
"nixpkgs_6": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741379970,
|
"lastModified": 1742422364,
|
||||||
"narHash": "sha256-Wh7esNh7G24qYleLvgOSY/7HlDUzWaL/n4qzlBePpiw=",
|
"narHash": "sha256-mNqIplmEohk5jRkqYqG19GA8MbQ/D4gQSK0Mu4LvfRQ=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "36fd87baa9083f34f7f5027900b62ee6d09b1f2f",
|
"rev": "a84ebe20c6bc2ecbcfb000a50776219f48d134cc",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -604,11 +624,11 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_7": {
|
"nixpkgs_7": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741310760,
|
"lastModified": 1742578646,
|
||||||
"narHash": "sha256-aizILFrPgq/W53Jw8i0a1h1GZAAKtlYOrG/A5r46gVM=",
|
"narHash": "sha256-GiQ40ndXRnmmbDZvuv762vS+gew1uDpFwOfgJ8tLiEs=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "de0fe301211c267807afd11b12613f5511ff7433",
|
"rev": "94c4dbe77c0740ebba36c173672ca15a7926c993",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -625,11 +645,11 @@
|
||||||
"utils": "utils"
|
"utils": "utils"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1741496686,
|
"lastModified": 1742730186,
|
||||||
"narHash": "sha256-dJJ6n2w4OIemUWwfOy3yufKhggE0ncNOklbKgfa8CRY=",
|
"narHash": "sha256-LSAS036RA4iXtJNBzdiOayHQ3ZUrLlgi//jqwsuqqv4=",
|
||||||
"owner": "fossar",
|
"owner": "fossar",
|
||||||
"repo": "nix-phps",
|
"repo": "nix-phps",
|
||||||
"rev": "f40909d5223656db01879d3325a8306883bcc668",
|
"rev": "032d917f90ac19899915bfc528ebf9ae7a58e53f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
@ -674,6 +694,7 @@
|
||||||
"flatpak": "flatpak",
|
"flatpak": "flatpak",
|
||||||
"hardware": "hardware",
|
"hardware": "hardware",
|
||||||
"lanzaboote": "lanzaboote",
|
"lanzaboote": "lanzaboote",
|
||||||
|
"nix-index-database": "nix-index-database",
|
||||||
"nixos-cosmic": "nixos-cosmic",
|
"nixos-cosmic": "nixos-cosmic",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixos-cosmic",
|
"nixos-cosmic",
|
||||||
|
|
13
flake.nix
13
flake.nix
|
@ -4,18 +4,22 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
hardware.url = "github:NixOS/nixos-hardware";
|
|
||||||
agenix.url = "github:ryantm/agenix";
|
|
||||||
devenv-root = {
|
devenv-root = {
|
||||||
url = "file+file:///dev/null";
|
url = "file+file:///dev/null";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
devenv.url = "github:cachix/devenv";
|
devenv.url = "github:cachix/devenv";
|
||||||
|
hardware.url = "github:NixOS/nixos-hardware";
|
||||||
|
agenix.url = "github:ryantm/agenix";
|
||||||
phps.url = "github:fossar/nix-phps";
|
phps.url = "github:fossar/nix-phps";
|
||||||
lanzaboote.url = "github:nix-community/lanzaboote/v0.4.2";
|
lanzaboote.url = "github:nix-community/lanzaboote/v0.4.2";
|
||||||
flatpak.url = "github:gmodena/nix-flatpak?ref=latest";
|
flatpak.url = "github:gmodena/nix-flatpak?ref=latest";
|
||||||
nixpkgs.follows = "nixos-cosmic/nixpkgs";
|
nixpkgs.follows = "nixos-cosmic/nixpkgs";
|
||||||
nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";
|
nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";
|
||||||
|
nix-index-database = {
|
||||||
|
url = "github:nix-community/nix-index-database";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
|
@ -40,13 +44,14 @@
|
||||||
perSystem = {
|
perSystem = {
|
||||||
pkgs,
|
pkgs,
|
||||||
inputs',
|
inputs',
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
devenv.shells.default = {
|
devenv.shells.default = {
|
||||||
devenv.root = let
|
devenv.root = let
|
||||||
devenvRootFileContent = builtins.readFile inputs.devenv-root.outPath;
|
devenvRootFileContent = builtins.readFile inputs.devenv-root.outPath;
|
||||||
in
|
in
|
||||||
self.lib.mkIf (devenvRootFileContent != "") devenvRootFileContent;
|
lib.mkIf (devenvRootFileContent != "") devenvRootFileContent;
|
||||||
|
|
||||||
name = "puter";
|
name = "puter";
|
||||||
|
|
||||||
|
@ -59,7 +64,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
packages = self.lib.packagesFromDirectoryRecursive {
|
packages = lib.packagesFromDirectoryRecursive {
|
||||||
inherit (pkgs) callPackage;
|
inherit (pkgs) callPackage;
|
||||||
directory = ./packages;
|
directory = ./packages;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
services.flatpak.packages = [
|
services.flatpak.packages = [
|
||||||
"io.gitlab.librewolf-community"
|
"org.libreoffice.LibreOffice"
|
||||||
];
|
];
|
||||||
}
|
}
|
5
hosts/headful/flamingo/mpv.nix
Normal file
5
hosts/headful/flamingo/mpv.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
services.flatpak.packages = [
|
||||||
|
"io.mpv.Mpv"
|
||||||
|
];
|
||||||
|
}
|
5
hosts/headful/flamingo/spotify.nix
Normal file
5
hosts/headful/flamingo/spotify.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
services.flatpak.packages = [
|
||||||
|
"com.spotify.Client"
|
||||||
|
];
|
||||||
|
}
|
5
hosts/headful/glacier/gimp.nix
Normal file
5
hosts/headful/glacier/gimp.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
services.flatpak.packages = [
|
||||||
|
"org.gimp.GIMP"
|
||||||
|
];
|
||||||
|
}
|
5
hosts/headful/glacier/inkscape.nix
Normal file
5
hosts/headful/glacier/inkscape.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
services.flatpak.packages = [
|
||||||
|
"org.inkscape.Inkscape"
|
||||||
|
];
|
||||||
|
}
|
5
hosts/headful/glacier/libreoffice.nix
Normal file
5
hosts/headful/glacier/libreoffice.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
services.flatpak.packages = [
|
||||||
|
"org.libreoffice.LibreOffice"
|
||||||
|
];
|
||||||
|
}
|
5
hosts/headful/glacier/mpv.nix
Normal file
5
hosts/headful/glacier/mpv.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
services.flatpak.packages = [
|
||||||
|
"io.mpv.Mpv"
|
||||||
|
];
|
||||||
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
services.flatpak.packages = [
|
services.flatpak.packages = [
|
||||||
"com.valvesoftware.Steam"
|
"com.valvesoftware.Steam"
|
||||||
|
"com.github.Matoking.protontricks"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
17
hosts/headful/insomniac/cosmic.nix
Normal file
17
hosts/headful/insomniac/cosmic.nix
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
config,
|
||||||
|
lib,
|
||||||
|
pkgs,
|
||||||
|
...
|
||||||
|
}: {
|
||||||
|
services.greetd.settings.initial_session = {
|
||||||
|
user = config.users.mainUser;
|
||||||
|
command = ''
|
||||||
|
${lib.getExe' pkgs.coreutils "env"} XCURSOR_THEME="''${XCURSOR_THEME:-Pop}" systemd-cat --identifier start-cosmic ${lib.getExe' pkgs.cosmic-session "start-cosmic"}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.cosmic.excludePackages = [
|
||||||
|
pkgs.cosmic-store
|
||||||
|
];
|
||||||
|
}
|
6
hosts/headful/insomniac/flatpak.nix
Normal file
6
hosts/headful/insomniac/flatpak.nix
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
services.flatpak.update.auto = {
|
||||||
|
enable = true;
|
||||||
|
onCalendar = "weekly";
|
||||||
|
};
|
||||||
|
}
|
5
hosts/headful/insomniac/spotify.nix
Normal file
5
hosts/headful/insomniac/spotify.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
services.flatpak.packages = [
|
||||||
|
"com.spotify.Client"
|
||||||
|
];
|
||||||
|
}
|
5
hosts/headful/work/spotify.nix
Normal file
5
hosts/headful/work/spotify.nix
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
services.flatpak.packages = [
|
||||||
|
"com.spotify.Client"
|
||||||
|
];
|
||||||
|
}
|
14
hosts/headless/abacus/domains.nix
Normal file
14
hosts/headless/abacus/domains.nix
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{lib, ...}: let
|
||||||
|
inherit (lib) types;
|
||||||
|
in {
|
||||||
|
options.networking.domains = lib.mkOption {
|
||||||
|
description = "Domains.";
|
||||||
|
type = types.attrsOf types.str;
|
||||||
|
default = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
config.networking.domains = {
|
||||||
|
wrz = "wrz.one";
|
||||||
|
helvetica = "helveticanonstandard.net";
|
||||||
|
};
|
||||||
|
}
|
|
@ -3,8 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (config.networking) domain;
|
virtualHostName = "tea.wrz.one";
|
||||||
virtualHostName = "tea.${domain}";
|
|
||||||
in {
|
in {
|
||||||
age.secrets = lib.mkSecrets {
|
age.secrets = lib.mkSecrets {
|
||||||
forgejo-mailer = {
|
forgejo-mailer = {
|
||||||
|
@ -43,8 +42,8 @@ in {
|
||||||
mailer = {
|
mailer = {
|
||||||
ENABLED = true;
|
ENABLED = true;
|
||||||
SMTP_ADDR = "smtp.fastmail.com";
|
SMTP_ADDR = "smtp.fastmail.com";
|
||||||
FROM = "tea@${domain}";
|
FROM = "tea@wrz.one";
|
||||||
USER = "lukas@${domain}";
|
USER = "lukas@wrz.one";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
secrets.mailer.PASSWD = config.age.secrets.forgejo-mailer.path;
|
secrets.mailer.PASSWD = config.age.secrets.forgejo-mailer.path;
|
||||||
|
@ -53,6 +52,7 @@ in {
|
||||||
systemd.services.forgejo.preStart = let
|
systemd.services.forgejo.preStart = let
|
||||||
forgejo = lib.getExe config.services.forgejo.package;
|
forgejo = lib.getExe config.services.forgejo.package;
|
||||||
passwordFile = config.age.secrets.forgejo-admin.path;
|
passwordFile = config.age.secrets.forgejo-admin.path;
|
||||||
|
# TODO
|
||||||
user = "lukas";
|
user = "lukas";
|
||||||
email = "lukas@wrz.one";
|
email = "lukas@wrz.one";
|
||||||
in ''
|
in ''
|
||||||
|
@ -78,10 +78,8 @@ in {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
locations."/".proxyPass = let
|
locations."/".proxyPass = let
|
||||||
inherit (config.services.forgejo.settings.server) HTTP_ADDR HTTP_PORT;
|
host = config.services.forgejo.settings.server.HTTP_ADDR;
|
||||||
in "http://${lib.formatHostPort {
|
port = builtins.toString config.services.forgejo.settings.server.HTTP_PORT;
|
||||||
host = HTTP_ADDR;
|
in "http://${host}:${port}";
|
||||||
port = HTTP_PORT;
|
|
||||||
}}";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,23 @@
|
||||||
{
|
# {config, ...}: let
|
||||||
services.headscale = {
|
# virtualHostName = "";
|
||||||
enable = true;
|
# in {
|
||||||
address = "127.0.0.1";
|
# services.headscale = {
|
||||||
port = 3122; # TODO
|
# enable = true;
|
||||||
settings = {
|
# address = "127.0.0.1";
|
||||||
};
|
# port = 8070;
|
||||||
};
|
# server_url = "https://${virtualHostName}";
|
||||||
}
|
# settings = {
|
||||||
|
# logtail.enabled = false;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
#
|
||||||
|
# services.nginx.virtualHosts.${virtualHostName} = {
|
||||||
|
# forceSSL = true;
|
||||||
|
# enableACME = true;
|
||||||
|
# locations."/" = {
|
||||||
|
# proxyPass = "http://localhost:${toString config.services.headscale.port}";
|
||||||
|
# proxyWebsockets = true;
|
||||||
|
# };
|
||||||
|
# };
|
||||||
|
# }
|
||||||
|
{}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# TODO: use another service for this
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
@ -41,9 +42,9 @@ in {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
||||||
locations."/".proxyPass = "http://${lib.formatHostPort {
|
locations."/".proxyPass = let
|
||||||
host = config.services.microbin.settings.MICROBIN_BIND;
|
host = config.services.microbin.settings.MICROBIN_BIND;
|
||||||
port = config.services.microbin.settings.MICROBIN_PORT;
|
port = builtins.toString config.services.microbin.settings.MICROBIN_PORT;
|
||||||
}}";
|
in "http://${host}:${port}";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
# TODO: is this bloat
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
lib,
|
lib,
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
{
|
{config, ...}: let
|
||||||
config,
|
virtualHostName = "navidrome.helveticanonstandard.net";
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (config.networking) domain;
|
|
||||||
virtualHostName = "navi.${domain}";
|
|
||||||
in {
|
in {
|
||||||
services.navidrome = {
|
services.navidrome = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
@ -19,9 +14,9 @@ in {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
||||||
locations."/".proxyPass = "http://${lib.formatHostPort {
|
locations."/".proxyPass = let
|
||||||
host = config.services.navidrome.settings.Address;
|
host = config.services.navidrome.settings.Address;
|
||||||
port = config.services.navidrome.settings.Port;
|
port = builtins.toString config.services.navidrome.settings.Port;
|
||||||
}}";
|
in "http://${host}:${port}";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{config, ...}: {
|
{
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
|
@ -12,11 +12,19 @@
|
||||||
access_log /var/log/nginx/access.log;
|
access_log /var/log/nginx/access.log;
|
||||||
'';
|
'';
|
||||||
|
|
||||||
virtualHosts."~.*" = {
|
virtualHosts = let
|
||||||
|
matchAll = ''~.*'';
|
||||||
|
matchWww = ''~^www\.(?<domain>.+)$'';
|
||||||
|
in {
|
||||||
|
# Redirect anything that doesn't match any server name to networking.domain
|
||||||
|
${matchAll} = {
|
||||||
default = true;
|
default = true;
|
||||||
rejectSSL = true;
|
rejectSSL = true;
|
||||||
|
|
||||||
globalRedirect = config.networking.domain;
|
globalRedirect = "wrz.one";
|
||||||
|
};
|
||||||
|
# Redirect www to non-www
|
||||||
|
${matchWww}.globalRedirect = "$domain";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (config.networking) domain;
|
|
||||||
parent = "/var/www";
|
parent = "/var/www";
|
||||||
sites = [
|
sites = [
|
||||||
domain
|
"wrz.one"
|
||||||
"log.${domain}"
|
"helveticanonstandard.net"
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
lib.mkMerge (map (
|
lib.mkMerge (
|
||||||
|
map (
|
||||||
virtualHostName: let
|
virtualHostName: let
|
||||||
root = "${parent}/${virtualHostName}";
|
root = "${parent}/${virtualHostName}";
|
||||||
in {
|
in {
|
||||||
|
@ -28,4 +28,5 @@ in
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
sites)
|
sites
|
||||||
|
)
|
|
@ -3,8 +3,7 @@
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (config.networking) domain;
|
virtualHostName = "vault.wrz.one";
|
||||||
virtualHostName = "vault.${domain}";
|
|
||||||
backupDir = "/srv/backup/vaultwarden";
|
backupDir = "/srv/backup/vaultwarden";
|
||||||
in {
|
in {
|
||||||
age.secrets = lib.mkSecrets {vaultwarden = {};};
|
age.secrets = lib.mkSecrets {vaultwarden = {};};
|
||||||
|
@ -38,10 +37,10 @@ in {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
|
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
proxyPass = "http://${lib.formatHostPort {
|
proxyPass = let
|
||||||
host = config.services.vaultwarden.config.ROCKET_ADDRESS;
|
host = config.services.vaultwarden.config.ROCKET_ADDRESS;
|
||||||
port = config.services.vaultwarden.config.ROCKET_PORT;
|
port = builtins.toString config.services.vaultwarden.config.ROCKET_PORT;
|
||||||
}}";
|
in "http://${host}:${port}";
|
||||||
proxyWebsockets = true;
|
proxyWebsockets = true;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
{lib, ...}: let
|
# TODO: unify syncthing.nix files
|
||||||
|
let
|
||||||
guiPort = 8384;
|
guiPort = 8384;
|
||||||
in {
|
in {
|
||||||
services.syncthing = {
|
services.syncthing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
systemService = true;
|
systemService = true;
|
||||||
openDefaultPorts = true;
|
openDefaultPorts = true;
|
||||||
guiAddress = lib.formatHostPort {
|
guiAddress = let
|
||||||
host = "0.0.0.0";
|
host = "0.0.0.0";
|
||||||
port = guiPort;
|
port = builtins.toString guiPort;
|
||||||
};
|
in "${host}:${port}";
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [guiPort];
|
networking.firewall.allowedTCPPorts = [guiPort];
|
||||||
|
|
Loading…
Reference in a new issue