Compare commits
13 Commits
c940999d5d
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| ba794c28dd | |||
| 070bbe575b | |||
| e4fdd52d51 | |||
| ca8f14118b | |||
| c790ebec29 | |||
| 096dd77726 | |||
| 7b5a43954c | |||
| 77a2249a71 | |||
| e9ea2d48ad | |||
| 3ca8359834 | |||
| bd2964f894 | |||
| 81aa3fb89f | |||
| 785d78660f |
18
README.org
18
README.org
@@ -1,20 +1,4 @@
|
||||
#+title: Sydnix
|
||||
#+author: Madeleine Sydney Ślaga
|
||||
|
||||
Hello! These are my dotfiles for all my software and Nix machines. My TODO lists and READMEs tend to share a file, so I've moved it out of version-control. A link will be here soon enough.
|
||||
|
||||
* Overview
|
||||
|
||||
** Modules
|
||||
|
||||
Nix modules are Sydnix's primary mode of organisation. The modules in this repository are categorised by the scope of their applicability, be it user-specific, machine-specific, Sydnix-specific, or releasable. These sum of these categories resembles a hierarchy wherein modules become less generally-applicable as they build off one another. This all goes to say, in a very roundabout fashion, that we are using the [[https://www.nayuki.io/pe/designing-better-file-organization-around-tags-not-hierarchies][accursed]] hierarchical file-system as god intended:
|
||||
|
||||
#+begin_example
|
||||
«TODO: Annotated diagram explaining the structore of modules/»
|
||||
#+end_example
|
||||
|
||||
User modules may be configurations using a host-specific module, which itself may be a configuration of a Sydnix-specific module.
|
||||
|
||||
# Local Variables:
|
||||
# jinx-local-words: "dotfiles"
|
||||
# End:
|
||||
these are my disgusting undocumented dotfiles. someday they'll be documented. maybe. }:)
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
filesystemType = "btrfs";
|
||||
|
||||
stylix.enable = true;
|
||||
gc.enable = true;
|
||||
openssh.enable = true;
|
||||
sydpkgs.overlay.enable = true;
|
||||
|
||||
@@ -48,6 +49,7 @@
|
||||
|
||||
deertopia = {
|
||||
authelia.enable = true;
|
||||
gitea.enable = true;
|
||||
quiver.enable = true;
|
||||
www.enable = true;
|
||||
bepasty.enable = true;
|
||||
|
||||
@@ -25,14 +25,18 @@
|
||||
openssh.enable = true;
|
||||
sydpkgs.overlay.enable = true;
|
||||
dank-material-shell.enable = true;
|
||||
kdeconnect.enable = true;
|
||||
|
||||
steam = {
|
||||
enable = true;
|
||||
impermanenceUsers = ["crumb" "msyds"];
|
||||
impermanenceUsers = [
|
||||
# "crumb"
|
||||
"msyds"
|
||||
];
|
||||
};
|
||||
|
||||
users.users = [
|
||||
"crumb"
|
||||
# "crumb"
|
||||
"msyds"
|
||||
];
|
||||
|
||||
|
||||
20
modules/home/kdeconnect.nix
Normal file
20
modules/home/kdeconnect.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ config, lib, pkgs, osConfig, ... }:
|
||||
|
||||
let cfg = config.sydnix.kdeconnect;
|
||||
in {
|
||||
options.sydnix.kdeconnect = {
|
||||
enable = lib.mkEnableOption "KDE Connect";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.kdeconnect = {
|
||||
enable = true;
|
||||
indicator = true;
|
||||
};
|
||||
|
||||
warnings = lib.optional (!osConfig.sydnix.kdeconnect.openFirewall) ''
|
||||
The KDE Connect ports were not opened in the NixOS config. Make
|
||||
sure someone's allowing these ports!!!
|
||||
'';
|
||||
};
|
||||
}
|
||||
14
modules/home/terraria.nix
Normal file
14
modules/home/terraria.nix
Normal file
@@ -0,0 +1,14 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let cfg = config.sydnix.terraria;
|
||||
in {
|
||||
options.sydnix.terraria = {
|
||||
enable = lib.mkEnableOption "Terraria";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sydnix.impermanence.directories = [
|
||||
".local/share/Terraria"
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -44,13 +44,11 @@
|
||||
;; functionality.
|
||||
(cider-download-java-sources t))
|
||||
:general
|
||||
;; DEPRECATED: Remove once a `map!' equivalent is implemented.
|
||||
(:keymaps 'cider-repl-mode-map
|
||||
:states '(normal insert)
|
||||
"C-k" #'cider-repl-backward-input
|
||||
"C-j" #'cider-repl-forward-input
|
||||
"C-s" #'consult-history)
|
||||
;; DEPRECATED: Remove once a `map!' equivalent is implemented.
|
||||
(:keymaps '(cider-repl-mode-map clojure-mode-map)
|
||||
:states '(normal visual motion emacs insert)
|
||||
:major-modes t
|
||||
@@ -74,10 +72,15 @@
|
||||
"T n" #'cider-test-run-ns-tests
|
||||
"T r" #'cider-test-rerun-failed-tests
|
||||
"T R" #'cider-test-rerun-test
|
||||
"x" #'cider-scratch)
|
||||
"x" #'cider-scratch
|
||||
"i" #'cider-inspect-last-result)
|
||||
(:keymaps 'cider-repl-mode-map
|
||||
:states 'insert
|
||||
"S-<return>" #'cider-repl-newline-and-indent)
|
||||
(:keymaps 'cider-inspector-mode-map
|
||||
:states '(motion insert)
|
||||
"C-o" #'cider-inspector-pop
|
||||
"C-i" #'cider-inspector-push)
|
||||
:config
|
||||
(add-hook 'cider-mode-hook #'eldoc-mode)
|
||||
(with-eval-after-load 'consult
|
||||
|
||||
@@ -127,7 +127,6 @@ if FILE-NAME has no TRAMP prefix."
|
||||
(cons nil file-name)))
|
||||
|
||||
(use-package eshell
|
||||
:ensure nil
|
||||
:defer t
|
||||
:init
|
||||
(defvar syd-eshell-data-dir
|
||||
|
||||
@@ -65,9 +65,22 @@ in {
|
||||
server = {
|
||||
address = "tcp://:${builtins.toString cfg.httpPort}";
|
||||
# asset_path = "${authelia-state-dir}/assets";
|
||||
endpoints.authz = {
|
||||
# Necessary for Nginx integration. No, I do not understand what it
|
||||
# does.
|
||||
endpoints.authz.auth-request.implementation = "AuthRequest";
|
||||
auth-request = {
|
||||
implementation = "AuthRequest";
|
||||
authn_strategies = [
|
||||
{
|
||||
name = "HeaderAuthorization";
|
||||
schemes = [ "Basic" ];
|
||||
}
|
||||
{
|
||||
name = "CookieSession";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
authentication_backend =
|
||||
let base-dn = config.services.lldap.settings.ldap_base_dn;
|
||||
|
||||
@@ -13,8 +13,13 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
imports = [ ./copyparty/vault.nix ];
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sydnix.deertopia.copyparty.vault.enable = true;
|
||||
|
||||
sydnix.impermanence.directories = [
|
||||
"/var/lib/copyparty"
|
||||
];
|
||||
|
||||
nixpkgs.overlays = [ inputs.copyparty.overlays.default ];
|
||||
|
||||
46
modules/nixos/deertopia/copyparty/vault.nix
Normal file
46
modules/nixos/deertopia/copyparty/vault.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let cfg = config.sydnix.deertopia.copyparty.vault;
|
||||
in {
|
||||
options.sydnix.deertopia.copyparty.vault = {
|
||||
enable = lib.mkEnableOption "personal storage under Copyparty";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sydnix.impermanence.directories = [ "/vault" ];
|
||||
|
||||
# HACK: Ad-hoc permissions, as typical.
|
||||
users.groups.vault = {};
|
||||
users.users.copyparty.extraGroups = [ "vault" ];
|
||||
|
||||
systemd.tmpfiles.settings."50-vault" =
|
||||
let e = {
|
||||
z.group = "vault";
|
||||
z.mode = "2775";
|
||||
v.group = "vault";
|
||||
v.mode = "2775";
|
||||
};
|
||||
in {
|
||||
"/vault" = e;
|
||||
"/vault/~msyds" = e;
|
||||
};
|
||||
|
||||
services.copyparty.volumes = {
|
||||
"/~msyds" = {
|
||||
path = "/vault/~msyds";
|
||||
access.A = [ "msyds" ];
|
||||
};
|
||||
"/~msyds/zotero" = {
|
||||
path = "/vault/~msyds/zotero";
|
||||
flags.daw = true;
|
||||
access.A = [ "msyds" ];
|
||||
access.rwmd = [ "zotero" ];
|
||||
};
|
||||
"/~msyds/public" = {
|
||||
path = "/vault/~msyds/public";
|
||||
access.A = [ "msyds" ];
|
||||
access.r = [ "*" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
60
modules/nixos/deertopia/gitea.nix
Normal file
60
modules/nixos/deertopia/gitea.nix
Normal file
@@ -0,0 +1,60 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let cfg = config.sydnix.deertopia.gitea;
|
||||
in {
|
||||
options.sydnix.deertopia.gitea = {
|
||||
enable = lib.mkEnableOption "Gitea";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
sydnix.impermanence.directories = [
|
||||
{
|
||||
directory = config.services.gitea.stateDir;
|
||||
inherit (config.services.gitea) user group;
|
||||
}
|
||||
];
|
||||
|
||||
sydnix.deertopia.nginx.vhosts."git" = {
|
||||
directory = null;
|
||||
vhost = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/".extraConfig =
|
||||
let port = builtins.toString config.services.gitea
|
||||
.settings.server.HTTP_PORT;
|
||||
in ''
|
||||
proxy_pass http://127.0.0.1:${port}/;
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
users.users.git = {
|
||||
description = "Gitea Service";
|
||||
home = config.services.gitea.stateDir;
|
||||
useDefaultShell = true;
|
||||
group = config.services.gitea.group;
|
||||
isSystemUser = true;
|
||||
};
|
||||
|
||||
users.groups.git = { };
|
||||
|
||||
# sudo -u git gitea admin auth add-ldap --name gitea --port 3890 --bind-dn 'uid=gitea,ou=people,dc=deertopia,dc=net' --bind-password «password» --user-search-base 'ou=people,dc=deertopia,dc=net' --user-filter '(&(memberof=cn=git,ou=groups,dc=deertopia,dc=net)(|(uid=%[1]s)(mail=%[1]s)))' --username-attribute uid --firstname-attribute givenName --surname-attribute sn --email-attribute mail --avatar-attribute jpegPhoto --security-protocol unencrypted --host 127.0.0.1 --config /var/lib/gitea/custom/conf/app.ini --synchronize-users
|
||||
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
user = "git";
|
||||
group = "git";
|
||||
appName = "GupHub"; # Name per my darling Colestar ♥
|
||||
settings = {
|
||||
server = {
|
||||
ROOT_URL = "https://git.deertopia.net/";
|
||||
HTTP_PORT = 3000;
|
||||
DOMAIN = "deertopia.net";
|
||||
};
|
||||
service = {
|
||||
DISABLE_REGISTRATION = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -29,6 +29,8 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
imports = [ ./copyparty/vault.nix ];
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
users.users.${cfg.user} = {
|
||||
isSystemUser = true;
|
||||
|
||||
@@ -34,6 +34,7 @@ in {
|
||||
extraConfig = ''
|
||||
location /~msyds/ {
|
||||
index index.html;
|
||||
alias /vault/~msyds/public/;
|
||||
}
|
||||
location /~liv/ {
|
||||
index index.html;
|
||||
|
||||
16
modules/nixos/gc.nix
Normal file
16
modules/nixos/gc.nix
Normal file
@@ -0,0 +1,16 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let cfg = config.sydnix.gc;
|
||||
in {
|
||||
options.sydnix.gc = {
|
||||
enable = lib.mkEnableOption "the automatic Nix garbage collector";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
nix.gc = {
|
||||
automatic = true;
|
||||
randomizedDelaySec = "14m";
|
||||
options = "--delete-older-than 30d";
|
||||
};
|
||||
};
|
||||
}
|
||||
21
modules/nixos/kdeconnect.nix
Normal file
21
modules/nixos/kdeconnect.nix
Normal file
@@ -0,0 +1,21 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
let cfg = config.sydnix.kdeconnect;
|
||||
in {
|
||||
options.sydnix.kdeconnect = {
|
||||
enable = lib.mkEnableOption "KDE Connect";
|
||||
openFirewall = lib.mkOption {
|
||||
description = ''Open required ports for KDE Connect'';
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable
|
||||
(let
|
||||
port-range = lib.optional cfg.openFirewall { from = 1714; to = 1764; };
|
||||
in {
|
||||
networking.firewall.allowedTCPPortRanges = port-range;
|
||||
networking.firewall.allowedUDPPortRanges = port-range;
|
||||
});
|
||||
}
|
||||
@@ -37,6 +37,9 @@
|
||||
desktop-environment.enable = true;
|
||||
clojure.enable = true;
|
||||
capitaine-cursors.enable = true;
|
||||
terraria.enable = true;
|
||||
kdeconnect.enable = true;
|
||||
qalculate.enable = true;
|
||||
sops = {
|
||||
enable = true;
|
||||
keyFile = "/persist/private-keys/age/crumb";
|
||||
|
||||
Reference in New Issue
Block a user