Compare commits
No commits in common. "a4d25df5ee530cb4d1d22aea0849393f44231fc9" and "0b5daa99edbc61f376a394a13d50c4cb11e78e97" have entirely different histories.
a4d25df5ee
...
0b5daa99ed
11 changed files with 112 additions and 63 deletions
53
flake.lock
generated
53
flake.lock
generated
|
|
@ -250,6 +250,21 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"flakey-profile": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1712898590,
|
||||||
|
"narHash": "sha256-FhGIEU93VHAChKEXx905TSiPZKga69bWl1VB37FK//I=",
|
||||||
|
"owner": "lf-",
|
||||||
|
"repo": "flakey-profile",
|
||||||
|
"rev": "243c903fd8eadc0f63d205665a92d4df91d42d9d",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "lf-",
|
||||||
|
"repo": "flakey-profile",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"gitignore": {
|
"gitignore": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": [
|
"nixpkgs": [
|
||||||
|
|
@ -313,6 +328,43 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"lix": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1751235704,
|
||||||
|
"narHash": "sha256-J4ycLoXHPsoBoQtEXFCelL4xlq5pT8U9tNWNKm43+YI=",
|
||||||
|
"rev": "1d7368585eebaa2c4bdbcb88fe600cfb2239b2c6",
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/lix/archive/1d7368585eebaa2c4bdbcb88fe600cfb2239b2c6.tar.gz?rev=1d7368585eebaa2c4bdbcb88fe600cfb2239b2c6"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://git.lix.systems/lix-project/lix/archive/release-2.93.tar.gz"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"lix-module": {
|
||||||
|
"inputs": {
|
||||||
|
"flake-utils": [
|
||||||
|
"flake-utils"
|
||||||
|
],
|
||||||
|
"flakey-profile": "flakey-profile",
|
||||||
|
"lix": "lix",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1751240025,
|
||||||
|
"narHash": "sha256-SXUAlxpjPRkArRMHy5+Hdi+PiC+ND9yzzIjiaHmTvQU=",
|
||||||
|
"rev": "8b1094356f4723d6e89d3f8a95b333ee16d9ab02",
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/8b1094356f4723d6e89d3f8a95b333ee16d9ab02.tar.gz?rev=8b1094356f4723d6e89d3f8a95b333ee16d9ab02"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"type": "tarball",
|
||||||
|
"url": "https://git.lix.systems/lix-project/nixos-module/archive/2.93.2-1.tar.gz"
|
||||||
|
}
|
||||||
|
},
|
||||||
"matrix-appservices": {
|
"matrix-appservices": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"devshell": "devshell",
|
"devshell": "devshell",
|
||||||
|
|
@ -468,6 +520,7 @@
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"home-manager": "home-manager_2",
|
"home-manager": "home-manager_2",
|
||||||
|
"lix-module": "lix-module",
|
||||||
"matrix-appservices": "matrix-appservices",
|
"matrix-appservices": "matrix-appservices",
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,12 @@ rec {
|
||||||
|
|
||||||
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
nixos-hardware.url = "github:NixOS/nixos-hardware";
|
||||||
|
|
||||||
|
lix-module = {
|
||||||
|
url = "https://git.lix.systems/lix-project/nixos-module/archive/2.93.2-1.tar.gz";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
inputs.flake-utils.follows = "flake-utils";
|
||||||
|
};
|
||||||
|
|
||||||
disko = {
|
disko = {
|
||||||
url = "github:nix-community/disko/latest";
|
url = "github:nix-community/disko/latest";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
|
|
||||||
|
|
@ -21,8 +21,7 @@ let
|
||||||
home.username = user;
|
home.username = user;
|
||||||
home.homeDirectory = "/home/${user}";
|
home.homeDirectory = "/home/${user}";
|
||||||
}
|
}
|
||||||
]
|
] ++ modules;
|
||||||
++ modules;
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,7 @@ let
|
||||||
configPath = [
|
configPath = [
|
||||||
"config"
|
"config"
|
||||||
"content" # due to mkIf
|
"content" # due to mkIf
|
||||||
]
|
] ++ modulePath;
|
||||||
++ modulePath;
|
|
||||||
in
|
in
|
||||||
lib.updateManyAttrsByPath
|
lib.updateManyAttrsByPath
|
||||||
[
|
[
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,7 @@ let
|
||||||
categories = [
|
categories = [
|
||||||
"Network"
|
"Network"
|
||||||
"WebBrowser"
|
"WebBrowser"
|
||||||
]
|
] ++ lib.optional isSecure "Security";
|
||||||
++ lib.optional isSecure "Security";
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
pkgs.runCommand pname { } ''
|
pkgs.runCommand pname { } ''
|
||||||
|
|
|
||||||
|
|
@ -35,8 +35,7 @@
|
||||||
count = 60000000;
|
count = 60000000;
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
} // user;
|
||||||
// user;
|
|
||||||
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
useGlobalPkgs = true;
|
useGlobalPkgs = true;
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,7 @@ in
|
||||||
"luci-ssl"
|
"luci-ssl"
|
||||||
"nextdns"
|
"nextdns"
|
||||||
"tailscale"
|
"tailscale"
|
||||||
]
|
] ++ packages;
|
||||||
++ packages;
|
|
||||||
|
|
||||||
# TODO set up SSH config (register public keys, disable password login, ...)
|
# TODO set up SSH config (register public keys, disable password login, ...)
|
||||||
files = pkgs.runCommand "image-files" { } ''
|
files = pkgs.runCommand "image-files" { } ''
|
||||||
|
|
|
||||||
|
|
@ -85,32 +85,34 @@ in
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.services."notify@" = {
|
systemd.services."notify@" =
|
||||||
onFailure = lib.mkForce [ ];
|
{
|
||||||
}
|
onFailure = lib.mkForce [ ];
|
||||||
// optionalAttrs (cfg.method == "libnotify") {
|
}
|
||||||
description = "Desktop notifications for %i service failure";
|
// optionalAttrs (cfg.method == "libnotify") {
|
||||||
environment = {
|
description = "Desktop notifications for %i service failure";
|
||||||
DISPLAY = ":0";
|
environment = {
|
||||||
INSTANCE = "%i";
|
DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/user/${
|
||||||
|
toString config.users.users.${cfg.libnotify.user}.uid
|
||||||
|
}/bus";
|
||||||
|
INSTANCE = "%i";
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
${pkgs.libnotify}/bin/notify-send --urgency=critical \
|
||||||
|
"Service '$INSTANCE' failed" \
|
||||||
|
"$(journalctl -n 6 -o cat -u $INSTANCE)"
|
||||||
|
'';
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = cfg.libnotify.user;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
// optionalAttrs (cfg.method == "email") {
|
||||||
|
description = "E-Mail notifications for %i service failure";
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = "${sendmail} %i";
|
||||||
|
Type = "oneshot";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
script = ''
|
|
||||||
export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/$(id -u '${cfg.libnotify.user}')/bus"
|
|
||||||
${pkgs.libnotify}/bin/notify-send --app-name="$INSTANCE" --urgency=critical \
|
|
||||||
"Service '$INSTANCE' failed" \
|
|
||||||
"$(journalctl -n 6 -o cat -u $INSTANCE)"
|
|
||||||
'';
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
User = cfg.libnotify.user;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// optionalAttrs (cfg.method == "email") {
|
|
||||||
description = "E-Mail notifications for %i service failure";
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = "${sendmail} %i";
|
|
||||||
Type = "oneshot";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,8 +53,7 @@ in
|
||||||
# reduce download bandwidth
|
# reduce download bandwidth
|
||||||
"--max-unused 10%"
|
"--max-unused 10%"
|
||||||
"--repack-cacheable-only"
|
"--repack-cacheable-only"
|
||||||
]
|
] ++ extraPruneOpts;
|
||||||
++ extraPruneOpts;
|
|
||||||
}
|
}
|
||||||
// (removeAttrs args [
|
// (removeAttrs args [
|
||||||
"name"
|
"name"
|
||||||
|
|
|
||||||
|
|
@ -10,22 +10,15 @@ let
|
||||||
inherit (inputs.self.outputs) nixConfig;
|
inherit (inputs.self.outputs) nixConfig;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
nixpkgs.config.allowUnfree = true;
|
imports = [
|
||||||
|
# TODO switch to lixFromNixpkgs once 2.93.2 is available
|
||||||
nixpkgs.overlays = [
|
inputs.lix-module.nixosModules.default
|
||||||
(final: prev: {
|
# inputs.lix-module.nixosModules.lixFromNixpkgs
|
||||||
inherit (final.lixPackageSets.stable)
|
|
||||||
nixpkgs-review
|
|
||||||
nix-direnv
|
|
||||||
nix-eval-jobs
|
|
||||||
nix-fast-build
|
|
||||||
colmena
|
|
||||||
;
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
nixpkgs.config.allowUnfree = true;
|
||||||
|
|
||||||
nix = {
|
nix = {
|
||||||
package = pkgs.lixPackageSets.stable.lix;
|
|
||||||
settings = {
|
settings = {
|
||||||
trusted-users = [ "@wheel" ];
|
trusted-users = [ "@wheel" ];
|
||||||
substituters = nixConfig.extra-substituters;
|
substituters = nixConfig.extra-substituters;
|
||||||
|
|
|
||||||
|
|
@ -89,20 +89,21 @@ in
|
||||||
wants = [ "tailscaled.service" ];
|
wants = [ "tailscaled.service" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
serviceConfig.Type = "oneshot";
|
serviceConfig.Type = "oneshot";
|
||||||
script = ''
|
script =
|
||||||
status=$(${config.systemd.package}/bin/systemctl show -P StatusText tailscaled.service)
|
''
|
||||||
if [[ $status != Connected* ]]; then
|
status=$(${config.systemd.package}/bin/systemctl show -P StatusText tailscaled.service)
|
||||||
${cfg.package}/bin/tailscale up
|
if [[ $status != Connected* ]]; then
|
||||||
fi
|
${cfg.package}/bin/tailscale up
|
||||||
|
fi
|
||||||
|
|
||||||
# some options cannot be set immediately
|
# some options cannot be set immediately
|
||||||
${cfg.package}/bin/tailscale up ${lib.escapeShellArgs cfg.extraUpFlags}
|
${cfg.package}/bin/tailscale up ${lib.escapeShellArgs cfg.extraUpFlags}
|
||||||
|
|
||||||
${cfg.package}/bin/tailscale cert ${tailnetHost}
|
${cfg.package}/bin/tailscale cert ${tailnetHost}
|
||||||
''
|
''
|
||||||
+ lib.optionalString config.services.nginx.enable ''
|
+ lib.optionalString config.services.nginx.enable ''
|
||||||
chown nginx:nginx /var/lib/tailscale/certs/${tailnetHost}.{key,crt}
|
chown nginx:nginx /var/lib/tailscale/certs/${tailnetHost}.{key,crt}
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
services.nginx.virtualHosts.${tailnetHost} = {
|
services.nginx.virtualHosts.${tailnetHost} = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue