Compare commits
No commits in common. "9f38ea87a613b84f8df0a3c636753d4fd32082ab" and "c70b8451872b5b15b641b0107b11884f9824b41c" have entirely different histories.
9f38ea87a6
...
c70b845187
7 changed files with 20 additions and 171 deletions
|
@ -9,11 +9,11 @@
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
}: let
|
}: let
|
||||||
mapOverlayOverride = prefix: overlay: final: prev: let
|
mapOverlayOverride = namespace: overlay: final: prev: let
|
||||||
overlayPkgs = overlay final prev;
|
overlayPkgs = overlay final prev;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
"${prefix}" = (prev.${prefix} or {}) // builtins.removeAttrs overlayPkgs ["override"];
|
"${namespace}" = builtins.removeAttrs overlayPkgs ["override"];
|
||||||
}
|
}
|
||||||
// (overlayPkgs.override or {});
|
// (overlayPkgs.override or {});
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
packages =
|
packages =
|
||||||
(import nixpkgs {
|
(import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
overlays = [self.overlays.default];
|
overlays = [(mapOverlayOverride doctrineNoPkgs.prefix (import ./pkgs))];
|
||||||
}).${
|
}).${
|
||||||
doctrineNoPkgs.prefix
|
doctrineNoPkgs.prefix
|
||||||
};
|
};
|
||||||
|
@ -121,7 +121,7 @@
|
||||||
}
|
}
|
||||||
# NB: Preserve the relative order
|
# NB: Preserve the relative order
|
||||||
{
|
{
|
||||||
overlay = mapOverlayOverride prefix (import ./pkgs);
|
overlay = self.overlays.default;
|
||||||
condition = true;
|
condition = true;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -164,12 +164,24 @@
|
||||||
}
|
}
|
||||||
// optionalAttrs (paths ? nixosSource) {
|
// optionalAttrs (paths ? nixosSource) {
|
||||||
nixosConfigurations = let
|
nixosConfigurations = let
|
||||||
hostConfig = platform:
|
nixosSystem = {modules}:
|
||||||
self.lib.mkSystem {
|
lib.makeOverridable nixpkgs.lib.nixosSystem {
|
||||||
inherit flakes pkgs;
|
inherit modules pkgs system;
|
||||||
doctrine = doctrineNoPkgs;
|
|
||||||
|
|
||||||
|
specialArgs = {
|
||||||
|
inherit flakes;
|
||||||
|
|
||||||
|
doctrine = mkDoctrine {
|
||||||
|
inherit pkgs;
|
||||||
|
namespace = "sys";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
hostConfig = platform:
|
||||||
|
nixosSystem {
|
||||||
modules = [
|
modules = [
|
||||||
|
self.nixosModules.default
|
||||||
nixosSourcePath
|
nixosSourcePath
|
||||||
platform
|
platform
|
||||||
];
|
];
|
||||||
|
@ -201,29 +213,6 @@
|
||||||
in
|
in
|
||||||
lib.mapAttrs home (importAll {root = hmPlatformsPath;});
|
lib.mapAttrs home (importAll {root = hmPlatformsPath;});
|
||||||
};
|
};
|
||||||
|
|
||||||
mkSystem = {
|
|
||||||
pkgs,
|
|
||||||
flakes,
|
|
||||||
doctrine,
|
|
||||||
modules,
|
|
||||||
}:
|
|
||||||
flakes.nixpkgs.lib.makeOverridable flakes.nixpkgs.lib.nixosSystem {
|
|
||||||
inherit pkgs;
|
|
||||||
inherit (pkgs) system;
|
|
||||||
|
|
||||||
modules = [self.nixosModules.default] ++ modules;
|
|
||||||
|
|
||||||
specialArgs = {
|
|
||||||
inherit flakes;
|
|
||||||
|
|
||||||
doctrine = self.lib.mkDoctrine {
|
|
||||||
inherit pkgs;
|
|
||||||
inherit (doctrine) prefix;
|
|
||||||
namespace = "sys";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
doctrine,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
doctrine.lib.mkModule {
|
|
||||||
inherit config;
|
|
||||||
name = "soju";
|
|
||||||
sys = ./sys.nix;
|
|
||||||
options = ./options.nix;
|
|
||||||
}
|
|
|
@ -1,16 +0,0 @@
|
||||||
{lib, ...}:
|
|
||||||
with lib.types; {
|
|
||||||
sys = {
|
|
||||||
fullyQualifiedDomain = lib.mkOption {
|
|
||||||
type = str;
|
|
||||||
example = "soju.trivionomicon.com";
|
|
||||||
description = "fully qualified domain name to be used by soju";
|
|
||||||
};
|
|
||||||
|
|
||||||
port = lib.mkOption {
|
|
||||||
type = port;
|
|
||||||
default = 6697;
|
|
||||||
description = "port to be used by soju";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,47 +0,0 @@
|
||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
cfg,
|
|
||||||
doctrine,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
with lib; {
|
|
||||||
security.acme.certs."${cfg.fullyQualifiedDomain}" = {
|
|
||||||
reloadServices = ["soju.service"];
|
|
||||||
group = "soju";
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [cfg.port];
|
|
||||||
|
|
||||||
services.soju = let
|
|
||||||
sojuCertDir = config.security.acme.certs."${cfg.fullyQualifiedDomain}".directory;
|
|
||||||
in {
|
|
||||||
enable = true;
|
|
||||||
hostName = "${cfg.fullyQualifiedDomain}";
|
|
||||||
listen = ["ircs://[::]:${toString cfg.port}"];
|
|
||||||
tlsCertificate = "${sojuCertDir}/fullchain.pem";
|
|
||||||
tlsCertificateKey = "${sojuCertDir}/key.pem";
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.soju = {
|
|
||||||
after = ["acme-${cfg.fullyQualifiedDomain}.service"];
|
|
||||||
serviceConfig = {
|
|
||||||
DynamicUser = mkForce false; # fuck dynamic users
|
|
||||||
User = "soju";
|
|
||||||
Group = "soju";
|
|
||||||
ProtectSystem = "strict";
|
|
||||||
ProtectHome = "read-only";
|
|
||||||
PrivateTmp = true;
|
|
||||||
RemoveIPC = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users = {
|
|
||||||
users.soju = {
|
|
||||||
isSystemUser = true;
|
|
||||||
group = "soju";
|
|
||||||
};
|
|
||||||
groups.soju = {};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -5,6 +5,5 @@ in {
|
||||||
override = {};
|
override = {};
|
||||||
|
|
||||||
athena-bccr = callPackage ./athena-bccr {};
|
athena-bccr = callPackage ./athena-bccr {};
|
||||||
snapborg = final.python3Packages.callPackage ./snapborg {};
|
|
||||||
spliit = callPackage ./spliit {};
|
spliit = callPackage ./spliit {};
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
From c363931656938f9cc3354b8e2797fe9abac1b0e3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Alejandro Soto <alejandro@34project.org>
|
|
||||||
Date: Sun, 31 Aug 2025 13:30:45 -0600
|
|
||||||
Subject: [PATCH] Remove "env" arg from subprocess calls
|
|
||||||
|
|
||||||
---
|
|
||||||
snapborg/borg.py | 3 +--
|
|
||||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/snapborg/borg.py b/snapborg/borg.py
|
|
||||||
index 89a3d84..b74ddf7 100644
|
|
||||||
--- a/snapborg/borg.py
|
|
||||||
+++ b/snapborg/borg.py
|
|
||||||
@@ -173,11 +173,10 @@ def launch_borg(args, password=None, print_output=False, dryrun=False, cwd=None)
|
|
||||||
# TODO: parse output from JSON log lines
|
|
||||||
try:
|
|
||||||
if print_output:
|
|
||||||
- subprocess.run(cmd, env=env, check=True, cwd=cwd)
|
|
||||||
+ subprocess.run(cmd, check=True, cwd=cwd)
|
|
||||||
else:
|
|
||||||
subprocess.check_output(cmd,
|
|
||||||
stderr=subprocess.STDOUT,
|
|
||||||
- env=env,
|
|
||||||
cwd=cwd)
|
|
||||||
except CalledProcessError as e:
|
|
||||||
if e.returncode == 1:
|
|
||||||
--
|
|
||||||
2.49.0
|
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
{
|
|
||||||
borgbackup,
|
|
||||||
buildPythonApplication,
|
|
||||||
fetchFromGitHub,
|
|
||||||
lib,
|
|
||||||
packaging,
|
|
||||||
pyyaml,
|
|
||||||
}:
|
|
||||||
buildPythonApplication {
|
|
||||||
pname = "snapborg";
|
|
||||||
version = "0.1.0-unstable-20250331";
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
|
||||||
repo = "snapborg";
|
|
||||||
owner = "enzingerm";
|
|
||||||
|
|
||||||
rev = "7e860395319f995161a6e0c7954ce47635e3cd59";
|
|
||||||
hash = "sha256-RzYL4IHulk1Q/ALWFs6YCTeCO8ohwqXH2NMHRctRVSA=";
|
|
||||||
};
|
|
||||||
|
|
||||||
patches = [
|
|
||||||
./0001-Remove-env-arg-from-subprocess-calls.patch # Fixes broken $PATH when calling borg
|
|
||||||
];
|
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
|
||||||
borgbackup
|
|
||||||
packaging
|
|
||||||
pyyaml
|
|
||||||
];
|
|
||||||
|
|
||||||
preFixup = ''
|
|
||||||
makeWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [borgbackup]})
|
|
||||||
'';
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue