initial migration
This commit is contained in:
parent
01fb98ba10
commit
59a1fbaf0f
54 changed files with 522 additions and 613 deletions
|
|
@ -2,7 +2,6 @@
|
|||
lib,
|
||||
config,
|
||||
namespace,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
inherit (lib) mkIf mkOption mkEnableOption mkMerge;
|
||||
|
|
@ -10,10 +9,6 @@
|
|||
|
||||
cfg = config.${namespace}.desktop;
|
||||
in {
|
||||
imports = [
|
||||
inputs.grub2-themes.nixosModules.default
|
||||
];
|
||||
|
||||
options.${namespace}.desktop = {
|
||||
use = mkOption {
|
||||
type = nullOr (enum ["plasma" "gamescope" "gnome" "cosmic"]);
|
||||
|
|
|
|||
|
|
@ -1,12 +1,10 @@
|
|||
{ lib, config, namespace, inputs, ... }:
|
||||
{ lib, config, namespace, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption mkForce;
|
||||
|
||||
cfg = config.${namespace}.desktop.gamescope;
|
||||
in
|
||||
{
|
||||
imports = [ inputs.jovian.nixosModules.default ];
|
||||
|
||||
options.${namespace}.desktop.gamescope = {
|
||||
enable = mkEnableOption "Enable Steamdeck ui" // {
|
||||
default = (config.${namespace}.desktop.use == "gamescope");
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
{ inputs, config, lib, pkgs, namespace, ... }:
|
||||
{ config, lib, pkgs, namespace, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption;
|
||||
|
||||
cfg = config.${namespace}.editor.nvim;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.nvf.nixosModules.default
|
||||
];
|
||||
|
||||
options.${namespace}.editor.nvim = {
|
||||
enable = mkEnableOption "enable nvim via nvf on system level";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
inputs,
|
||||
lib,
|
||||
config,
|
||||
namespace,
|
||||
|
|
@ -9,8 +8,6 @@
|
|||
|
||||
cfg = config.${namespace}.services.authentication.himmelblau;
|
||||
in {
|
||||
imports = [inputs.himmelblau.nixosModules.himmelblau];
|
||||
|
||||
options.${namespace}.services.authentication.himmelblau = {
|
||||
enable = mkEnableOption "enable azure entra ID authentication";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{ config, lib, pkgs, namespace, system, inputs, ... }:
|
||||
{ config, lib, pkgs, namespace, system, terranixLib, sneeuwvlokLib, ... }:
|
||||
let
|
||||
inherit (lib) mkIf mkEnableOption mkOption types toUpper toSentenceCase nameValuePair mapAttrs mapAttrs' concatMapAttrs concatMapStringsSep filterAttrsRecursive listToAttrs imap0 head drop length literalExpression attrNames;
|
||||
inherit (lib.${namespace}.strings) toSnakeCase;
|
||||
inherit (sneeuwvlokLib.strings) toSnakeCase;
|
||||
|
||||
cfg = config.${namespace}.services.authentication.zitadel;
|
||||
|
||||
|
|
@ -339,7 +339,7 @@ in
|
|||
config' = config;
|
||||
|
||||
# this is a nix package, the generated json file to be exact
|
||||
terraformConfiguration = inputs.terranix.lib.terranixConfiguration {
|
||||
terraformConfiguration = terranixLib.terranixConfiguration {
|
||||
inherit system;
|
||||
|
||||
modules = [
|
||||
|
|
@ -576,7 +576,7 @@ in
|
|||
let
|
||||
tofu = lib.getExe pkgs.opentofu;
|
||||
in
|
||||
''
|
||||
lib.replaceStrings ["\r"] [""] ''
|
||||
if [ "$(systemctl is-active zitadel)" != "active" ]; then
|
||||
echo "Zitadel is not running"
|
||||
exit 1
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
|
|
@ -11,10 +10,6 @@
|
|||
|
||||
cfg = config.${namespace}.services.games.minecraft;
|
||||
in {
|
||||
imports = [
|
||||
inputs.nix-minecraft.nixosModules.minecraft-servers
|
||||
];
|
||||
|
||||
options.${namespace}.services.games.minecraft = {
|
||||
enable = mkEnableOption "Minecraft";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@
|
|||
config,
|
||||
lib,
|
||||
namespace,
|
||||
inputs,
|
||||
system,
|
||||
...
|
||||
}: let
|
||||
|
|
@ -10,10 +9,6 @@
|
|||
|
||||
cfg = config.${namespace}.services.media.mydia;
|
||||
in {
|
||||
imports = [
|
||||
inputs.mydia.nixosModules.default
|
||||
];
|
||||
|
||||
options.${namespace}.services.media.mydia = {
|
||||
enable = mkEnableOption "Enable Mydia";
|
||||
};
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
config,
|
||||
lib,
|
||||
namespace,
|
||||
inputs,
|
||||
system,
|
||||
terranixLib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) toString;
|
||||
|
|
@ -155,7 +155,7 @@ in {
|
|||
config' = config;
|
||||
lib' = lib;
|
||||
|
||||
terraformConfiguration = inputs.terranix.lib.terranixConfiguration {
|
||||
terraformConfiguration = terranixLib.terranixConfiguration {
|
||||
inherit system;
|
||||
|
||||
modules = [
|
||||
|
|
@ -341,11 +341,11 @@ in {
|
|||
}
|
||||
'';
|
||||
|
||||
script = ''
|
||||
script = lib.replaceStrings ["\r"] [""] ''
|
||||
# Sleep for a bit to give the service a chance to start up
|
||||
sleep 5s
|
||||
|
||||
if [ "$(systemctl is-active "${service}")" != "active" ]; then
|
||||
if [ "$(systemctl is-active ${lib.escapeShellArg service})" != "active" ]; then
|
||||
echo "${service} is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -10,25 +10,22 @@
|
|||
|
||||
cfg = config.${namespace}.services.networking.caddy;
|
||||
hasHosts = (cfg.hosts |> attrNames |> length) > 0;
|
||||
caddyBase = pkgs.callPackage "${pkgs.path}/pkgs/by-name/ca/caddy/package.nix" {
|
||||
buildGo125Module = pkgs.buildGo126Module;
|
||||
caddy = caddyBase;
|
||||
caddyPackage = pkgs.caddy.withPlugins {
|
||||
plugins = ["github.com/corazawaf/coraza-caddy/v2@v2.1.0"];
|
||||
hash = "sha256-rsDnTunR8C7hVOX5aKcba+iFYHbpWek65DZgbMxOdTs=";
|
||||
};
|
||||
caddyPackage =
|
||||
caddyBase.withPlugins {
|
||||
plugins = ["github.com/corazawaf/coraza-caddy/v2@v2.1.0"];
|
||||
hash = "sha256-pSXjLaZoRtKV3eFl2ySRSjl3yxi514G1Cb7pfrpxxtE=";
|
||||
};
|
||||
in {
|
||||
options.${namespace}.services.networking.caddy = {
|
||||
enable = mkEnableOption "enable caddy" // {default = true;};
|
||||
|
||||
hosts = mkOption {
|
||||
type = types.attrsOf types.str;
|
||||
default = {};
|
||||
};
|
||||
|
||||
extraConfig = mkOption {
|
||||
type = types.str;
|
||||
default = "";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
config,
|
||||
lib,
|
||||
namespace,
|
||||
repoRoot,
|
||||
sneeuwvlokLib,
|
||||
...
|
||||
}: let
|
||||
inherit (builtins) toString;
|
||||
|
|
@ -26,7 +28,7 @@
|
|||
});
|
||||
|
||||
databaseProviderPostgresql = types.submodule ({...}: let
|
||||
urlOptions = lib.${namespace}.options.mkUrlOptions {
|
||||
urlOptions = sneeuwvlokLib.options.mkUrlOptions {
|
||||
host = {
|
||||
description = ''
|
||||
Hostname of the postgresql server
|
||||
|
|
@ -118,7 +120,7 @@ in {
|
|||
enable = true;
|
||||
dbBackend = "postgresql";
|
||||
|
||||
package = pkgs.${namespace}.vaultwarden;
|
||||
package = pkgs.callPackage (repoRoot + "/packages/vaultwarden/default.nix") {};
|
||||
|
||||
config = {
|
||||
SIGNUPS_ALLOWED = false;
|
||||
|
|
@ -196,7 +198,7 @@ in {
|
|||
else if type == "postgresql"
|
||||
then {
|
||||
inherit (db) type;
|
||||
url = lib.${namespace}.strings.toUrl {
|
||||
url = sneeuwvlokLib.strings.toUrl {
|
||||
inherit (db) protocol host port;
|
||||
path = "vaultwarden";
|
||||
query = {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
{ pkgs, config, namespace, inputs, system, ... }:
|
||||
{ pkgs, config, namespace, repoRoot, system, ... }:
|
||||
let
|
||||
cfg = config.${namespace}.system.security.sops;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.sops-nix.nixosModules.sops
|
||||
];
|
||||
|
||||
options.${namespace}.system.security.sops = {};
|
||||
|
||||
config = {
|
||||
|
|
@ -14,7 +10,7 @@ in
|
|||
|
||||
sops = {
|
||||
defaultSopsFormat = "yaml";
|
||||
defaultSopsFile = inputs.self + "/systems/${system}/${config.networking.hostName}/secrets.yml";
|
||||
defaultSopsFile = repoRoot + "/systems/${system}/${config.networking.hostName}/secrets.yml";
|
||||
|
||||
age = {
|
||||
# keyFile = "~/.config/sops/age/keys.txt";
|
||||
|
|
@ -23,4 +19,4 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue