[nix] Messing around with how to override desktop files
This commit is contained in:
@@ -1,28 +1,20 @@
|
||||
{ nixpkgs, inputs, ... }:
|
||||
nixpkgs.lib.nixosSystem {
|
||||
system = "x86_64-linux";
|
||||
modules = [
|
||||
{
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./configuration.nix
|
||||
./hardware-configuration.nix
|
||||
../../authorized-keys.nix
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
{
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
home-manager.users.drew =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./drew.nix
|
||||
];
|
||||
};
|
||||
home-manager.useGlobalPkgs = true;
|
||||
home-manager.useUserPackages = true;
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
}
|
||||
];
|
||||
specialArgs = {
|
||||
inherit inputs;
|
||||
};
|
||||
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
|
||||
home-manager.users.drew =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./drew.nix
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ let
|
||||
localNetRule = "(ClientIP(`${localNet}`) || ClientIP(`${dockerNet}`))";
|
||||
localHostRule = host: domain: "${localNetRule} && ${hostRule host domain}";
|
||||
localHostRuleHavenisms = host: localHostRule host havenisms;
|
||||
in
|
||||
in
|
||||
{
|
||||
inherit
|
||||
hostRule
|
||||
@@ -17,26 +17,35 @@ in
|
||||
hostRuleHavenisms
|
||||
localHostRuleHavenisms
|
||||
havenisms
|
||||
blazestar;
|
||||
blazestar
|
||||
;
|
||||
|
||||
|
||||
mkContainer = {
|
||||
image,
|
||||
hostName,
|
||||
port,
|
||||
homepageOpts,
|
||||
dependsOn ? [],
|
||||
domain ? havenisms,
|
||||
ports ? [],
|
||||
volumes ? [],
|
||||
environment ? {},
|
||||
environmentFiles ? [],
|
||||
public ? false,
|
||||
}:
|
||||
let routerRule = if public then hostRule hostName domain else localHostRule hostName domain;
|
||||
mkContainer =
|
||||
{
|
||||
image,
|
||||
hostName,
|
||||
port,
|
||||
homepageOpts,
|
||||
dependsOn ? [ ],
|
||||
domain ? havenisms,
|
||||
ports ? [ ],
|
||||
volumes ? [ ],
|
||||
environment ? { },
|
||||
environmentFiles ? [ ],
|
||||
public ? false,
|
||||
}:
|
||||
let
|
||||
routerRule = if public then hostRule hostName domain else localHostRule hostName domain;
|
||||
in
|
||||
{
|
||||
inherit image dependsOn volumes environment environmentFiles ports;
|
||||
inherit
|
||||
image
|
||||
dependsOn
|
||||
volumes
|
||||
environment
|
||||
environmentFiles
|
||||
ports
|
||||
;
|
||||
hostname = "${hostName}.${domain}";
|
||||
autoStart = true;
|
||||
extraOptions = [
|
||||
@@ -57,30 +66,33 @@ in
|
||||
# user.
|
||||
#
|
||||
# Note that this returns a _module_ so that it can be imported and provide many different config values.
|
||||
mkMariaDbContainer = {
|
||||
name,
|
||||
uid,
|
||||
gid,
|
||||
passwordSecret,
|
||||
directory,
|
||||
}: { config, ... }: {
|
||||
virtualisation.oci-containers.containers."${name}-mariadb" = {
|
||||
image = "lscr.io/linuxserver/mariadb:latest";
|
||||
autoStart = true;
|
||||
ports = [ "3306:3306" ];
|
||||
volumes = [
|
||||
"${directory}:/config"
|
||||
"${config.sops.secrets.mariadb_root_password.path}:/run/secrets/mariadb_root_password"
|
||||
"${config.sops.secrets."${passwordSecret}".path}:/run/secrets/mariadb_password"
|
||||
];
|
||||
environment = {
|
||||
PUID = "${toString uid}";
|
||||
PGID = "${toString gid}";
|
||||
MYSQL_USER = name;
|
||||
MYSQL_DATABASE = name;
|
||||
FILE__MYSQL_ROOT_PASSWORD = "/run/secrets/mariadb_root_password";
|
||||
FILE__MYSQL_PASSWORD = "/run/secrets/mariadb_password";
|
||||
mkMariaDbContainer =
|
||||
{
|
||||
name,
|
||||
uid,
|
||||
gid,
|
||||
passwordSecret,
|
||||
directory,
|
||||
}:
|
||||
{ config, ... }:
|
||||
{
|
||||
virtualisation.oci-containers.containers."${name}-mariadb" = {
|
||||
image = "lscr.io/linuxserver/mariadb:latest";
|
||||
autoStart = true;
|
||||
ports = [ "3306:3306" ];
|
||||
volumes = [
|
||||
"${directory}:/config"
|
||||
"${config.sops.secrets.mariadb_root_password.path}:/run/secrets/mariadb_root_password"
|
||||
"${config.sops.secrets."${passwordSecret}".path}:/run/secrets/mariadb_password"
|
||||
];
|
||||
environment = {
|
||||
PUID = "${toString uid}";
|
||||
PGID = "${toString gid}";
|
||||
MYSQL_USER = name;
|
||||
MYSQL_DATABASE = name;
|
||||
FILE__MYSQL_ROOT_PASSWORD = "/run/secrets/mariadb_root_password";
|
||||
FILE__MYSQL_PASSWORD = "/run/secrets/mariadb_password";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user