Store app configs under programs

This commit is contained in:
Manuel Thalmann 2024-10-13 19:52:28 +02:00
parent 95d079bcaf
commit 561ac46073
11 changed files with 80 additions and 72 deletions

View file

@ -40,13 +40,13 @@ let
in { in {
options = { options = {
valhalla = { valhalla = {
git = gitOption; programs.git = gitOption;
users = mkOption { users = mkOption {
type = types.attrsOf (types.submodule ( type = types.attrsOf (types.submodule (
{ ... }: { { ... }: {
options = { options = {
git = gitOption; programs.git = gitOption;
}; };
})); }));
}; };

View file

@ -25,7 +25,7 @@ in {
type = types.attrsOf (types.submodule ( type = types.attrsOf (types.submodule (
{ ... }: { { ... }: {
options = { options = {
nextcloud = { programs.nextcloud = {
folderSyncs = mkOption { folderSyncs = mkOption {
type = types.listOf syncType; type = types.listOf syncType;
description = "The folders to synchronize."; description = "The folders to synchronize.";

View file

@ -40,7 +40,7 @@ in {
type = types.attrsOf (types.submodule ( type = types.attrsOf (types.submodule (
{ ... }: { { ... }: {
options = { options = {
oh-my-posh = mkOption { programs.oh-my-posh = mkOption {
type = ompType; type = ompType;
description = "The Oh My Posh configuration to apply."; description = "The Oh My Posh configuration to apply.";
default = { }; default = { };

View file

@ -23,7 +23,7 @@ in {
type = types.attrsOf (types.submodule ( type = types.attrsOf (types.submodule (
{ ... }: { { ... }: {
options = { options = {
rclone = { programs.rclone = {
configurations = mkOption { configurations = mkOption {
type = types.attrsOf syncType; type = types.attrsOf syncType;
description = "The configurations of the rclone mounts."; description = "The configurations of the rclone mounts.";

View file

@ -45,43 +45,45 @@ in {
}; };
}; };
git = let defaultBranch = "main"; programs = {
in { git = let defaultBranch = "main";
inherit defaultBranch; in {
inherit defaultBranch;
flow = { flow = {
mainBranch = defaultBranch; mainBranch = defaultBranch;
devBranch = "dev"; devBranch = "dev";
}; };
aliases = { aliases = {
ahfange = "init"; ahfange = "init";
tuedezue = "add"; tuedezue = "add";
beschuldig = "blame"; beschuldig = "blame";
zieh = "pull"; zieh = "pull";
druck = "push"; druck = "push";
machnah = "clone"; machnah = "clone";
hol = "fetch"; hol = "fetch";
zwiigab = "branch"; zwiigab = "branch";
buechiih = "commit"; buechiih = "commit";
eich = "rebase"; eich = "rebase";
erd = "rebase"; erd = "rebase";
gahufwiifelde = "rebase"; gahufwiifelde = "rebase";
vergliich = "diff"; vergliich = "diff";
tuezemme = "merge"; tuezemme = "merge";
versorg = "stash"; versorg = "stash";
markier = "tag"; markier = "tag";
pflueckoepfel = "cherry-pick"; pflueckoepfel = "cherry-pick";
pflueckhimbeeri = "cherry-pick"; pflueckhimbeeri = "cherry-pick";
buechuus = "checkout"; buechuus = "checkout";
quaetsch = "merge --squash"; quaetsch = "merge --squash";
pfudle = "push --force"; pfudle = "push --force";
beschuldigung = "blame"; beschuldigung = "blame";
zwiigli = "branch"; zwiigli = "branch";
tagebuech = "log"; tagebuech = "log";
versteck = "stash"; versteck = "stash";
zuestand = "status"; zuestand = "status";
markierig = "tag"; markierig = "tag";
};
}; };
}; };
}; };

View file

@ -7,9 +7,11 @@
displayName = "Manuel Thalmann"; displayName = "Manuel Thalmann";
mailAddress = "m@nuth.ch"; mailAddress = "m@nuth.ch";
oh-my-posh = { programs = {
theme = { oh-my-posh = {
source = ./manuel.omp.json; theme = {
source = ./manuel.omp.json;
};
}; };
}; };
}; };
@ -22,36 +24,40 @@
"nix-users" "nix-users"
]; ];
rclone = { programs = {
configurations = { rclone = {
nextcloud = { configurations = {
dirName = "Nextcloud"; nextcloud = {
}; dirName = "Nextcloud";
};
proton = { proton = {
dirName = "Proton"; dirName = "Proton";
cacheDuration = "2w"; cacheDuration = "2w";
};
}; };
}; };
}; };
}; };
windows.users.manuel = { windows.users.manuel = {
nextcloud = { programs = {
folderSyncs = let nextcloud = {
localPath = "C:/tools/RetroArch-Win64"; folderSyncs = let
remotePath = "/Saved Games/RetroArch"; localPath = "C:/tools/RetroArch-Win64";
in [ remotePath = "/Saved Games/RetroArch";
{ in [
remotePath = "${remotePath}/Saves"; {
localPath = "${localPath}/saves"; remotePath = "${remotePath}/Saves";
virtualFiles = false; localPath = "${localPath}/saves";
} virtualFiles = false;
{ }
remotePath = "${remotePath}/System"; {
localPath = "${localPath}/system"; remotePath = "${remotePath}/System";
} localPath = "${localPath}/system";
]; }
];
};
}; };
}; };
}; };

View file

@ -21,7 +21,7 @@
$configArgs = @("--system"); $configArgs = @("--system");
} }
$config = & $getConfig "git"; $config = & $getConfig "programs.git";
<# <#
.SYNOPSIS .SYNOPSIS

View file

@ -23,7 +23,7 @@ Start-SoftwareInstaller @args `
) )
$user = $Arguments.Name; $user = $Arguments.Name;
$theme = Get-UserConfig -UserName "$user" "oh-my-posh.theme"; $theme = Get-UserConfig -UserName "$user" "programs.oh-my-posh.theme";
function New-Theme { function New-Theme {
param($info) param($info)
@ -52,7 +52,7 @@ Start-SoftwareInstaller @args `
return $path; return $path;
} }
foreach ($additionalTheme in (Get-UserConfig -UserName "$user" "oh-my-posh.additionalThemes")) { foreach ($additionalTheme in (Get-UserConfig -UserName "$user" "programs.oh-my-posh.additionalThemes")) {
Write-Host "creating theme $additionalTheme"; Write-Host "creating theme $additionalTheme";
$null = New-Theme $additionalTheme; $null = New-Theme $additionalTheme;
} }

View file

@ -9,7 +9,7 @@ begin
function userConfig -V dir -a name function userConfig -V dir -a name
source "$dir/../../Scripts/config.fish" source "$dir/../../Scripts/config.fish"
set -l key "rclone.configurations" set -l key "programs.rclone.configurations"
set -l configs (getUserConfig "$name" "$key" --apply "builtins.attrNames" --json) set -l configs (getUserConfig "$name" "$key" --apply "builtins.attrNames" --json)
if [ (echo "$configs" | jq "length") -gt 0 ] if [ (echo "$configs" | jq "length") -gt 0 ]

View file

@ -7,7 +7,7 @@ Start-SoftwareInstaller @args `
-Inherit "$PSScriptRoot/../../../Common/Software/git/Main.ps1" ` -Inherit "$PSScriptRoot/../../../Common/Software/git/Main.ps1" `
-Installer { -Installer {
$params = "/WindowsTerminalProfile"; $params = "/WindowsTerminalProfile";
$defaultBranch = Get-OSConfig "git.defaultBranch"; $defaultBranch = Get-OSConfig "programs.git.defaultBranch";
if ($defaultBranch) { if ($defaultBranch) {
$params += " /DefaultBranchName:`"$defaultBranch`""; $params += " /DefaultBranchName:`"$defaultBranch`"";

View file

@ -87,7 +87,7 @@
$user = $Arguments.Name; $user = $Arguments.Name;
& { & {
$syncs = Get-UserConfig -UserName $user "nextcloud.folderSyncs"; $syncs = Get-UserConfig -UserName $user "programs.nextcloud.folderSyncs";
$configExists = { (Test-Path (Get-ConfigFile) ) }; $configExists = { (Test-Path (Get-ConfigFile) ) };
if ($syncs.Count -gt 0) { if ($syncs.Count -gt 0) {