"doom-emacs": {
"flake": false,
"locked": {
- "lastModified": 1647913749,
- "narHash": "sha256-JlPq+PAJW00rDFOSdLYCdd+nnQzNkjztK2zXAS2S2zY=",
+ "lastModified": 1656519163,
+ "narHash": "sha256-iNg3DnQJB6iIWLBsFGcloFHwwQUgrJeIQeNJHD7nwIo=",
"owner": "hlissner",
"repo": "doom-emacs",
- "rev": "aed2972d7400834210759727117c50de34826db9",
+ "rev": "c2f8476c8641fcc9a1371d873ed3b5924952a059",
"type": "github"
},
"original": {
}
},
"emacs-overlay": {
+ "inputs": {
+ "flake-utils": "flake-utils_2",
+ "nixpkgs": "nixpkgs"
+ },
"locked": {
- "lastModified": 1648290468,
- "narHash": "sha256-Mibv/7lr2QxNwydU0WP1VDC0GMu6Xn0E5Yez73xDjQE=",
+ "lastModified": 1656413262,
+ "narHash": "sha256-I8X1LaW/qoSWeBLK0N8GPOshIuXG9zyNyZUtKZYa0h4=",
"owner": "nix-community",
"repo": "emacs-overlay",
- "rev": "adf05412cca0a492c2465ac5de719954834c449e",
+ "rev": "8772891c73e2809df5e5469d14535ea77e123d3e",
"type": "github"
},
"original": {
"type": "github"
}
},
+ "flake-utils_2": {
+ "locked": {
+ "lastModified": 1656065134,
+ "narHash": "sha256-oc6E6ByIw3oJaIyc67maaFcnjYOz1mMcOtHxbEf9NwQ=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "bee6a7250dd1b01844a2de7e02e4df7d8a0a206c",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
+ },
"home-manager": {
"inputs": {
"nixpkgs": [
"julm-nix",
"nixpkgs"
- ]
+ ],
+ "utils": "utils"
},
"locked": {
- "lastModified": 1650190514,
- "narHash": "sha256-BoBvGT71yOfrNDTZQs7+FX0zb4yjMBETgIjtTsdJw+o=",
+ "lastModified": 1656367977,
+ "narHash": "sha256-0hV17V9Up9pnAtPJ+787FhrsPnawxoTPA/VxgjRMrjc=",
"owner": "nix-community",
"repo": "home-manager",
- "rev": "620ed197f3624dafa5f42e61d5c043f39b8df366",
+ "rev": "3bf16c0fd141c28312be52945d1543f9ce557bb1",
"type": "github"
},
"original": {
]
},
"locked": {
- "lastModified": 1655398770,
- "narHash": "sha256-6M3bhk7PFiQCTCwKWSq1SpLO85gUzJsgFUIC0MBYDzM=",
+ "lastModified": 1659790679,
+ "narHash": "sha256-6g6Vx+rZPINUbgzpGhH5IfCfUjzEqUAOXmx55TgIkRQ=",
"ref": "main",
- "rev": "71b7edf3240dd5eef4e1779baf7feaccd5445d0a",
- "revCount": 458,
+ "rev": "94f28bdd976d68743a98035810b3973ed9851d69",
+ "revCount": 462,
"type": "git",
"url": "file:///home/julm/work/sourcephile/nix/julm-nix"
},
},
"nixpkgs": {
"locked": {
- "lastModified": 1656500841,
- "narHash": "sha256-13IRoh3uu29S4IfoVO6Sb0UPwzDhSqXoBKKQ4ssEzF0=",
+ "lastModified": 1653086549,
+ "narHash": "sha256-9Gt55P+hh70m/vx0zS5iJrMFrU4Rf0uO+nG9NFxTW1U=",
+ "owner": "NixOS",
+ "repo": "nixpkgs",
+ "rev": "98bcd08cb1778d103bac1149621b3568014aadbd",
+ "type": "github"
+ },
+ "original": {
+ "id": "nixpkgs",
+ "type": "indirect"
+ }
+ },
+ "nixpkgs_2": {
+ "locked": {
+ "lastModified": 1657815135,
+ "narHash": "sha256-+5Jby1ayRjtSgsM5IpRNeUgdcIutCKQWR6sypRtd1RE=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "be6da3774db3746e6ae94bf412dd3707e35b2800",
+ "rev": "c06d5fa9c605d143b15cafdbbb61c7c95388d76e",
"type": "github"
},
"original": {
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "be6da3774db3746e6ae94bf412dd3707e35b2800",
+ "rev": "c06d5fa9c605d143b15cafdbbb61c7c95388d76e",
"type": "github"
}
},
"julm-nix",
"nix-doom-emacs"
],
- "nixpkgs": "nixpkgs",
+ "nixpkgs": "nixpkgs_2",
"pass": "pass",
"secrets": "secrets",
"shell": "shell"
"path": "./shell",
"type": "path"
}
+ },
+ "utils": {
+ "locked": {
+ "lastModified": 1653893745,
+ "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
+ "type": "github"
+ },
+ "original": {
+ "owner": "numtide",
+ "repo": "flake-utils",
+ "type": "github"
+ }
}
},
"root": "root",
{
# Pin down nixpkgs from github, instead of using global, system or user registries.
-inputs.nixpkgs.url = "github:NixOS/nixpkgs/be6da3774db3746e6ae94bf412dd3707e35b2800";
+#inputs.nixpkgs.url = "github:NixOS/nixpkgs/168d1c578909dc143ba52dbed661c36e76b12b36";
+inputs.nixpkgs.url = "github:NixOS/nixpkgs/c06d5fa9c605d143b15cafdbbb61c7c95388d76e";
#inputs.nixpkgs.url = "flake:nixpkgs";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.home-manager.follows = "julm-nix/home-manager";
../nixos/defaults.nix
../nixos/profiles/systems/debug.nix
#carotte/fileSystems.nix
+
carotte/hardware.nix
+ carotte/hostapd.nix
carotte/networking.nix
carotte/security.nix
carotte/system.nix
carotte/users.nix
(inputs.secrets + "/hosts/${hostName}/users.nix")
- carotte/xserver.nix
+ #carotte/xserver.nix
];
}
};
systemd.services."openvpn-${netns}" = {
preStart = ''
- set -e
- ${pkgs.curl}/bin/curl -X POST --cacert ${ca} -o ${key-cert} -Ls ${apiUrl}
+ set -ex
+ ${pkgs.curl}/bin/curl -v -X POST --cacert ${ca} -o ${key-cert} -Ls ${apiUrl}
chmod 700 ${key-cert}
'';
+ unitConfig = {
+ StartLimitIntervalSec = 0;
+ };
serviceConfig = {
RuntimeDirectory = [ "openvpn-${netns}" ];
RuntimeDirectoryMode = "0700";
};
};
+environment.systemPackages = [
+ pkgs.riseup-vpn
+];
networking.nftables.ruleset = ''
add rule inet filter fw2net meta skuid root tcp dport 443 counter accept comment "OpenVPN Riseup"
'';
-{ pkgs, lib, config, hosts, hostName, ... }:
+{ pkgs, lib, config, hosts, hostName, credentials, ... }:
let
wg = "wg-extra";
listenPort = 16843;
add rule inet filter output oifname "${wg}" log level warn prefix "fw2extra: " counter drop
'';
#boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
+systemd.services."wireguard-${wg}".serviceConfig.LoadCredentialEncrypted = "privateKey:${credentials}/wireguard/${wg}/privateKey.secret";
networking.wireguard.interfaces."${wg}" = {
# publicKey: 1Iyq96rPHfyrt4B31NqKLgWzlglkMAWjA41aF279gjM=
- privateKeyFile = "/root/secrets/wireguard/${wg}/privateKey";
+ privateKeyFile = "$CREDENTIALS_DIRECTORY/privateKey";
ips = [ "192.168.43.1/32" ];
inherit listenPort;
socketNamespace = null;
patate.enable = true;
carotte.enable = true;
};
-networking.wireguard.interfaces.${iface} = {
- privateKeyFile = "/root/secrets/wireguard/${iface}/privateKey";
-};
systemd.services."wireguard-${iface}" = {
unitConfig.Upholds = [ "upnpc-${toString wg.listenPort}.service" ];
};
};
}
../nixos/defaults.nix
+ ../nixos/profiles/systems/debug.nix
mermet/acme.nix
mermet/croc.nix
mermet/coturn.nix
mermet/rspamd.nix
mermet/sanoid.nix
mermet/security.nix
- mermet/sourcehut.nix
+ #mermet/sourcehut.nix
mermet/system.nix
mermet/unbound.nix
mermet/users.nix
debug_level = 0
# LDAP database
-uris = ldapi://
+uris = ldapi://%2Frun%2Fslapd%2Fsock
base = ou=posix,dc=%Dd
scope = subtree
#deref = never
oignon.enable = true;
patate.enable = true;
};
-networking.wireguard.interfaces.${iface} = {
- privateKeyFile = secrets."wireguard/${iface}/privateKey".path;
-};
-security.gnupg.secrets."wireguard/${iface}/privateKey" = {};
-systemd.services."wireguard-${iface}" = {
- after = [ secrets."wireguard/${iface}/privateKey".service ];
- requires = [ secrets."wireguard/${iface}/privateKey".service ];
-};
networking.nftables.ruleset = ''
# Allow peers to initiate connection for ${iface}
add rule inet filter net2fw udp dport ${toString wg.listenPort} counter accept comment "${iface}"
];
users.ldap = {
enable = false;
- server = "ldapi:///";
+ # FIXME: reset to ldapi:/// once https://nixpk.gs/pr-tracker.html?pr=179597 is included
+ #server = "ldapi:///";
+ server = "ldapi://%2Frun%2Fslapd%2Fsock";
base = "ou=posix,${domainSuffix}";
bind = {
#distinguishedName = "cn=admin,${domainSuffix}";
enable = true;
#dataDir = "/var/db/ldap";
#configDir = "/var/db/slapd";
- urlList = [ "ldapi:///" ]; # UNIX socket
+ # FIXME: reset to ldapi:///
+ #urlList = [ "ldapi:///" ]; # UNIX socket
+ urlList = [ "ldapi://%%2Frun%%2Fslapd%%2Fsock" ]; # UNIX socket
# sudo ldapsearch -LLL -H ldapi:// -D cn=admin,cn=config -Y EXTERNAL -b "" -s base supportedControl
settings = {
attrs = {
posixAccount = pkgs.callPackage (import ./posixAccount.nix) { inherit domain domainSuffix domainGroup; };
in
{
-users.groups."${domainGroup}" = {
+users.groups.${domainGroup} = {
gid = 20000;
members = [
users."julm".name
# and the index/control on different ZFS datasets like here.
"maildir:/home/${uid}/mail/${domain}/mail:LAYOUT=maildir++:UTF-8:CONTROL=${stateDir}/control/${domain}/${uid}:INDEX=${stateDir}/index/${domain}/${uid}";
}
+ rec {
+ uid = "testbox";
+ cn = "Test Box";
+ sn = uid;
+ uidNumber = 21000;
+ gidNumber = groups.${domainGroup}.gid;
+ mailAlias = [ "test.box" ];
+ userPassword = builtins.readFile (inputs.secrets + "/members/mail/julm/hashedPassword");
+ #mailHomeDirectory = "/home/${uid}/mail/${domain}";
+ mailQuota = "1G";
+ }
];
};
}
# Parse the extension in email address, eg. contact+extension@
recipientDelimiter = "+";
mapFiles.sender_access = inputs.secrets + "/postfix/sender_access";
+ #mapFiles.virtual_mailbox_maps = ;
config = {
debug_peer_level = "4";
debug_peer_list = [
virtual_mailbox_domains = [];
# Completed by the postfix/*.nix
virtual_mailbox_maps = [
+ # Is it necessary because it's already in virtual_alias_maps
"hash:/etc/postfix/virtual"
];
virtual_transport = "lmtp:unix:private/dovecot-lmtp";
domain = ${domain}
version = 3
debuglevel = 0
- server_host = ldapi://
+ server_host = ldapi://%2Frun%2Fslapd%2Fsock
bind = sasl
sasl_mechs = EXTERNAL
search_base = ou=posix,${domainSuffix}
domain = ${domain}
version = 3
debuglevel = 0
- server_host = ldapi://
+ server_host = ldapi://%2Frun%2Fslapd%2Fsock
bind = sasl
sasl_mechs = EXTERNAL
search_base = ou=posix,${domainSuffix}
domain = ${domain}
version = 3
debuglevel = 0
- server_host = ldapi://
+ server_host = ldapi://%2Frun%2Fslapd%2Fsock
bind = sasl
sasl_mechs = EXTERNAL
search_base = ou=posix,${domainSuffix}
domain = ${domain}
version = 3
debuglevel = 0
- server_host = ldapi://
+ server_host = ldapi://%2Frun%2Fslapd%2Fsock
bind = sasl
sasl_mechs = EXTERNAL
search_base = ou=posix,${domainSuffix}
css = [ "href=https://mails.${domain}/style/light.css" ];
nntpserver = [ "nntps://news.${domain}" ];
wwwlisting = "match=domain";
+ #imapserver = [ "mails.${domain}" ];
};
mda = {
enable = true;
};
#dispatch.enable = true;
- git.enable = true;
+ #git.enable = true;
#hub.enable = true;
meta.enable = true;
meta.port = 4999;
#!/bin/sh -eux
cd "${0%/*}"/../..
-nix -L run .#mermet.switch "$@"
+host=mermet
+chmod -R g-rwx,o-rwx "$PWD"/private/hosts/*/root
+#ln -sfn "$PWD/private/hosts/$host/root" /root/private
+trap 'git reset private/hosts/"*"/root' EXIT
+git rm -rf --cached --ignore-unmatch private/hosts/'*'/root # prevent copying to /nix/store
+nix -L run .#$host.switch "$@"
environment.enableDebugInfo = true;
environment.systemPackages = [
#pkgs.valgrind
- #pkgs.gdb
+ pkgs.gdb
];
/*
environment.etc."sudo.conf".text = ''
#overlays/sourcehut.nix
] ++ [
#(self: super: { biboumi = super.callPackage pkgs/biboumi {}; })
+ /*
+ (final: super: {
+ pythonPackages = (super.python.override {
+ packageOverrides = super.lib.const (python-super: {
+ # TODO: remove after https://github.com/NixOS/nixpkgs/pull/152698 has hit master
+ dbus-python = python-super.dbus-python.overrideAttrs (oldAttrs: rec {
+ #configureFlags = ["PYTHON=${super.python.pythonForBuild.interpreter}"];
+ });
+ });
+ }).pkgs;
+ })
+ */
]
hosts/mermet/** filter=git-crypt-mermet diff=git-crypt-mermet
hosts/losurdo/** filter=git-crypt-losurdo diff=git-crypt-losurdo
-shared/** filter=git-crypt-shared diff=git-crypt-shared
+shared/** filter=git-crypt-shared diff=git-crypt-shared
mkdir -p "$dir/$host/credentials/${hostkey%/*}"
pass "$key" |
sudo unshare --mount sh -xc "
- mount --bind '$dir/$host/root/credential.secret' /var/lib/systemd/credential.secret &&
+ mount --bind $dir/$host/root/credential.secret /var/lib/systemd/credential.secret &&
+ mount --bind $dir/$host/root/machine-id /etc/machine-id &&
systemd-creds encrypt --with-key=host --name '${hostkey##*/}' - - |
install -m 400 -o $USER -g users /dev/stdin '$dir/$host/credentials/$hostkey.secret'
"