Compare commits
2 Commits
bce2cb54f2
...
7700905647
Author | SHA1 | Date |
---|---|---|
LeRoyce Pearson | 7700905647 | |
LeRoyce Pearson | 49df89c466 |
|
@ -8,6 +8,7 @@
|
||||||
imports =
|
imports =
|
||||||
[ # Include the results of the hardware scan.
|
[ # Include the results of the hardware scan.
|
||||||
./hardware/samsehu.nix
|
./hardware/samsehu.nix
|
||||||
|
./samsehu/matrix-conduit.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
# Use the `systemd-boot` boot loader
|
# Use the `systemd-boot` boot loader
|
||||||
|
|
164
flake.lock
164
flake.lock
|
@ -63,136 +63,6 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"flake-utils_2": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems_3"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1701680307,
|
|
||||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"flake-utils_3": {
|
|
||||||
"inputs": {
|
|
||||||
"systems": "systems_4"
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1701680307,
|
|
||||||
"narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"glauth": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"gomod2nix": "gomod2nix",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1704867971,
|
|
||||||
"narHash": "sha256-ltNKZ5XP7x+23YudLeQvPrXWj3qDuqb71jH0c1f9aN0=",
|
|
||||||
"owner": "leroycep",
|
|
||||||
"repo": "glauth",
|
|
||||||
"rev": "5c0be9f05fbb8ee0e12c34fd35acea6189461061",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "leroycep",
|
|
||||||
"repo": "glauth",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"glauth-sqlite": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils_2",
|
|
||||||
"gomod2nix": "gomod2nix_2",
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1704871050,
|
|
||||||
"narHash": "sha256-V5GPi5SmCHpNAaUFEyvWkxV7W3tiLZyF1t7XpJ+NH4s=",
|
|
||||||
"owner": "leroycep",
|
|
||||||
"repo": "glauth-sqlite",
|
|
||||||
"rev": "43fc8b29722916a418e96527d7afbdfcf708a705",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "leroycep",
|
|
||||||
"repo": "glauth-sqlite",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"gomod2nix": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": [
|
|
||||||
"glauth",
|
|
||||||
"flake-utils"
|
|
||||||
],
|
|
||||||
"nixpkgs": [
|
|
||||||
"glauth",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1701687253,
|
|
||||||
"narHash": "sha256-qJCMxIKWXonJODPF2oV7mCd0xu7VYVenTucrY0bizto=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "gomod2nix",
|
|
||||||
"rev": "001bbfa22e2adeb87c34c6015e5694e88721cabe",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "gomod2nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"gomod2nix_2": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": [
|
|
||||||
"glauth-sqlite",
|
|
||||||
"flake-utils"
|
|
||||||
],
|
|
||||||
"nixpkgs": [
|
|
||||||
"glauth-sqlite",
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1701687253,
|
|
||||||
"narHash": "sha256-qJCMxIKWXonJODPF2oV7mCd0xu7VYVenTucrY0bizto=",
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "gomod2nix",
|
|
||||||
"rev": "001bbfa22e2adeb87c34c6015e5694e88721cabe",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-community",
|
|
||||||
"repo": "gomod2nix",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"home-manager": {
|
"home-manager": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
@ -216,7 +86,7 @@
|
||||||
},
|
},
|
||||||
"juanfont-headscale": {
|
"juanfont-headscale": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-utils": "flake-utils_3",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
"nixpkgs"
|
"nixpkgs"
|
||||||
]
|
]
|
||||||
|
@ -255,8 +125,6 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"agenix": "agenix",
|
"agenix": "agenix",
|
||||||
"glauth": "glauth",
|
|
||||||
"glauth-sqlite": "glauth-sqlite",
|
|
||||||
"juanfont-headscale": "juanfont-headscale",
|
"juanfont-headscale": "juanfont-headscale",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
@ -290,36 +158,6 @@
|
||||||
"repo": "default",
|
"repo": "default",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"systems_3": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"systems_4": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1681028828,
|
|
||||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nix-systems",
|
|
||||||
"repo": "default",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
|
14
flake.nix
14
flake.nix
|
@ -9,18 +9,9 @@
|
||||||
url = "github:juanfont/headscale/v0.23.0-alpha2";
|
url = "github:juanfont/headscale/v0.23.0-alpha2";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
|
|
||||||
glauth = {
|
|
||||||
url = "github:leroycep/glauth";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
glauth-sqlite = {
|
|
||||||
url = "github:leroycep/glauth-sqlite";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, agenix, juanfont-headscale, glauth, glauth-sqlite }: {
|
outputs = { self, nixpkgs, agenix, juanfont-headscale }: {
|
||||||
packages.x86_64-linux = let pkgs = import nixpkgs { system = "x86_64-linux"; }; in rec {
|
packages.x86_64-linux = let pkgs = import nixpkgs { system = "x86_64-linux"; }; in rec {
|
||||||
cockpit-tailscale = pkgs.callPackage ./pkgs/cockpit-tailscale.nix {};
|
cockpit-tailscale = pkgs.callPackage ./pkgs/cockpit-tailscale.nix {};
|
||||||
cockpit-zfs-manager = pkgs.callPackage ./pkgs/cockpit-zfs-manager.nix {};
|
cockpit-zfs-manager = pkgs.callPackage ./pkgs/cockpit-zfs-manager.nix {};
|
||||||
|
@ -32,15 +23,12 @@
|
||||||
({config, pkgs, ...}: {
|
({config, pkgs, ...}: {
|
||||||
nixpkgs.overlays = [ (final: prev: {
|
nixpkgs.overlays = [ (final: prev: {
|
||||||
juanfont-headscale = juanfont-headscale.packages.${prev.system};
|
juanfont-headscale = juanfont-headscale.packages.${prev.system};
|
||||||
glauth = glauth.packages.${prev.system}.glauth.v2;
|
|
||||||
glauth-sqlite = glauth-sqlite.packages.${prev.system}.glauth-sqlite;
|
|
||||||
cockpit-tailscale = self.packages.${prev.system}.cockpit-tailscale;
|
cockpit-tailscale = self.packages.${prev.system}.cockpit-tailscale;
|
||||||
cockpit-zfs-manager = self.packages.${prev.system}.cockpit-zfs-manager;
|
cockpit-zfs-manager = self.packages.${prev.system}.cockpit-zfs-manager;
|
||||||
})];
|
})];
|
||||||
})
|
})
|
||||||
./agenix-config-module.nix
|
./agenix-config-module.nix
|
||||||
./configuration.nix
|
./configuration.nix
|
||||||
./services/glauth.nix
|
|
||||||
./services/komga.nix
|
./services/komga.nix
|
||||||
agenix.nixosModules.default
|
agenix.nixosModules.default
|
||||||
];
|
];
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
|
||||||
|
# Edit this configuration file to define what should be installed on
|
||||||
|
# your system. Help is available in the configuration.nix(5) man page, on
|
||||||
|
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
|
||||||
|
|
||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
# Headscale for access to the network while away from home
|
||||||
|
services.headscale.settings.dns_config.extra_records = [
|
||||||
|
{ name = "matrix.samsehu.perli.casa"; type = "A"; value = "100.64.0.3"; }
|
||||||
|
];
|
||||||
|
|
||||||
|
# configure matrix-conduit as a server to host chat communications with end-to-end encryption
|
||||||
|
services.matrix-conduit = {
|
||||||
|
enable = true;
|
||||||
|
settings.global = {
|
||||||
|
server_name = "matrix.samsehu.perli.casa";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
# Reverse proxy with Caddy
|
||||||
|
services.caddy.virtualHosts."matrix.samsehu.perli.casa".extraConfig = ''
|
||||||
|
respond /.well-known/matrix/server `{ "m.server": "matrix.samsehu.perli.casa" }` 200
|
||||||
|
respond /.well-known/matrix/client `{ "m.homeserver": { "base_url": "https://matrix.samsehu.perli.casa" } }` 200
|
||||||
|
'';
|
||||||
|
services.caddy.virtualHosts."matrix.samsehu.perli.casa:8448".extraConfig = ''
|
||||||
|
reverse_proxy localhost:${toString config.services.matrix-conduit.settings.global.port}
|
||||||
|
'';
|
||||||
|
|
||||||
|
# Open ports in the firewall.
|
||||||
|
networking.firewall.allowedTCPPorts = [ 80 443 8448 ];
|
||||||
|
networking.firewall.allowedUDPPorts = [ 80 443 8448 ];
|
||||||
|
}
|
||||||
|
|
|
@ -1,79 +0,0 @@
|
||||||
{config, pkgs, lib, ...}:
|
|
||||||
let
|
|
||||||
cfg = config.services.glauth;
|
|
||||||
settingsFormat = pkgs.formats.toml {};
|
|
||||||
in
|
|
||||||
|
|
||||||
with lib;
|
|
||||||
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
services.glauth = {
|
|
||||||
enable = mkOption {
|
|
||||||
default = false;
|
|
||||||
type = with types; bool;
|
|
||||||
description = ''
|
|
||||||
Enable the glauth system service
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
package = mkPackageOption pkgs "glauth" { };
|
|
||||||
|
|
||||||
dataDir = mkOption {
|
|
||||||
type = types.path;
|
|
||||||
default = "/var/lib/glauth";
|
|
||||||
};
|
|
||||||
|
|
||||||
user = mkOption {
|
|
||||||
default = "glauth";
|
|
||||||
type = types.str;
|
|
||||||
description = ''
|
|
||||||
Name of the user.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
group = mkOption {
|
|
||||||
default = "glauth";
|
|
||||||
type = types.str;
|
|
||||||
description = ''
|
|
||||||
Name of the group.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
settings = mkOption {
|
|
||||||
type = settingsFormat.type;
|
|
||||||
default = {};
|
|
||||||
description = ''
|
|
||||||
Configuration for glauth.cfg, see
|
|
||||||
<link xlink:href="https://github.com/glauth/glauth/blob/master/v2/sample-simple.cfg"
|
|
||||||
for supported settings.
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
|
||||||
# Add user for glauth
|
|
||||||
users.users."${cfg.user}" = {
|
|
||||||
isSystemUser = true;
|
|
||||||
group = cfg.group;
|
|
||||||
home = cfg.dataDir;
|
|
||||||
};
|
|
||||||
users.groups."${cfg.group}" = {};
|
|
||||||
|
|
||||||
# Add systemd service
|
|
||||||
systemd.services.glauth = {
|
|
||||||
wantedBy = [ "multi-user.target" ];
|
|
||||||
after = [ "network.target" ];
|
|
||||||
description = "Start a glauth server.";
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "exec";
|
|
||||||
User = "${cfg.user}";
|
|
||||||
Group = "${cfg.group}";
|
|
||||||
ExecStart = ''${cfg.package}/bin/glauth -c ${settingsFormat.generate "glauth.cfg" cfg.settings}'';
|
|
||||||
StateDirectory = mkIf (cfg.dataDir == "/var/lib/glauth") [ "glauth" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
Loading…
Reference in New Issue