Set up GOA declaratively

This commit is contained in:
Alexander Bantyev 2021-01-11 21:50:18 +03:00
parent 696a70c9e0
commit 327c201061
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
8 changed files with 203 additions and 154 deletions

View File

@ -65,6 +65,9 @@ in {
font-size: 16px;
}
'';
xdg.configFile."geary/account_03/geary.ini".text = genIni gearyConfig;
home.activation.geary = ''
mkdir -p "$XDG_CONFIG_HOME/geary/account_03"
$DRY_RUN_CMD ln -sf $VERBOSE_ARG ${builtins.toFile "geary.ini" (genIni gearyConfig)} "$XDG_CONFIG_HOME/geary/account_03/geary.ini"
'';
};
}

View File

@ -14,7 +14,7 @@ device:
./workspace/i3blocks
./workspace/zsh.nix
./workspace/gtk.nix
./workspace/gnome3.nix
./workspace/gnome3
./workspace/misc.nix
./workspace/kde
./workspace/ssh.nix

View File

@ -113,7 +113,7 @@ in {
pkgs.writeShellScript "push" "${pkgs.git}/bin/git push origin master"
} "$HOME/.password-store/.git/hooks/post-commit"
cat $HOME/.password-store/email/balsoft@balsoft.ru.gpg | ${pkgs.gnupg}/bin/gpg --decrypt > /dev/null
sudo systemctl restart '*-secrets.service' '*-envsubst.service'
sudo systemctl start --all '*-secrets.service' '*-envsubst.service'
'')
];
@ -121,7 +121,7 @@ in {
users = [ "balsoft" ];
commands = [{
command =
"/run/current-system/sw/bin/systemctl restart '*-secrets.service' '*-envsubst.service'";
"/run/current-system/sw/bin/systemctl start --all '*-secrets.service' '*-envsubst.service'";
options = [ "NOPASSWD" ];
}];
}];

View File

@ -1,150 +0,0 @@
{ config, pkgs, lib, ... }: {
services.gnome3 = {
core-os-services.enable = true;
core-utilities.enable = true;
sushi.enable = true;
tracker.enable = true;
tracker-miners.enable = true;
gnome-settings-daemon.enable = true;
glib-networking.enable = true;
};
services.gvfs.enable = true;
services.geoclue2.enable = true;
home-manager.users.balsoft = {
xdg.userDirs.enable = true;
home.activation.gnome-keyring = ''
ln -sf ${config.secrets-envsubst.gnome-keyring} "$XDG_DATA_HOME/keyrings/Default_keyring.keyring"
echo "Default_keyring" > "$XDG_DATA_HOME/keyrings/default"
'';
dconf.settings = {
"org/gnome/nautilus/icon-view" = {
captions = [ "size" "date_modified" "none" ];
};
"org/gnome/nautilus/list-view" = {
default-column-order = [
"name"
"size"
"type"
"owner"
"group"
"permissions"
"where"
"date_modified"
"date_modified_with_time"
"date_accessed"
"recency"
"starred"
"detailed_type"
];
default-visible-columns = [ "name" "size" "date_modified" "starred" ];
};
"org/gnome/nautilus/preferences" = {
default-folder-viewer = "list-view";
executable-text-activation = "display";
search-filter-time-type = "last_modified";
search-view = "list-view";
show-image-thumbnails = "always";
thumbnail-limit = 10;
};
"org/gnome/evince/default" = {
inverted-colors = true;
};
"org/gnome/maps" = {
night-mode = true;
transportation-type = "car";
};
};
};
secrets-envsubst.gnome-keyring = {
owner = "balsoft:users";
secrets = [ "matrix_token" "matrix_password" "email" "nextcloud" ];
template = ''
[keyring]
display-name=Default keyring
ctime=1609508068
mtime=0
lock-on-idle=false
lock-after=false
[5]
item-type=0
display-name=fractal-token
secret=$matrix_token
mtime=1610374847
ctime=1610374847
[5:attribute0]
name=uid
type=string
value=@balsoft:balsoft.ru
[3]
item-type=0
display-name=Geary IMAP password
secret=$email
mtime=1610307006
ctime=1609572471
[3:attribute0]
name=host
type=string
value=balsoft.ru
[3:attribute1]
name=login
type=string
value=balsoft@balsoft.ru
[3:attribute2]
name=proto
type=string
value=IMAP
[3:attribute3]
name=xdg:schema
type=string
value=org.gnome.Geary
[1]
item-type=0
display-name=GOA owncloud credentials for identity account_1609508064_4
secret={'password': <'$nextcloud'>}
mtime=1609508086
ctime=1609508086
[1:attribute0]
name=goa-identity
type=string
value=owncloud:gen0:account_1609508064_4
[1:attribute1]
name=xdg:schema
type=string
value=org.gnome.OnlineAccounts
[4]
item-type=0
display-name=fractal
secret=$matrix_password
mtime=1610374846
ctime=1610374846
[4:attribute0]
name=identity
type=string
value=https://vector.im/
[4:attribute1]
name=server
type=string
value=https://balsoft.ru/
[4:attribute2]
name=username
type=string
value=balsoft
'';
};
}

View File

@ -0,0 +1,10 @@
[Account account_1609508064_4]
Provider=owncloud
Identity=balsoft
PresentationIdentity=balsoft@nextcloud.balsoft.ru
CalendarEnabled=true
ContactsEnabled=true
DocumentsEnabled=true
FilesEnabled=true
Uri=https://nextcloud.balsoft.ru/
AcceptSslErrors=false

View File

@ -0,0 +1,71 @@
{ config, pkgs, lib, ... }: {
services.gnome3 = {
core-os-services.enable = true;
core-utilities.enable = true;
sushi.enable = true;
tracker.enable = true;
tracker-miners.enable = true;
gnome-settings-daemon.enable = true;
glib-networking.enable = true;
};
services.gvfs.enable = true;
services.geoclue2.enable = true;
home-manager.users.balsoft = {
xdg.userDirs.enable = true;
home.activation.gnome = ''
$DRY_RUN_CMD mkdir -p "$XDG_DATA_HOME/keyrings/Default_keyring"
$DRY_RUN_CMD cp -f ${config.secrets-envsubst.gnome-keyring} "$XDG_DATA_HOME/keyrings/Default_keyring.keyring"
echo "Default_keyring" > "$XDG_DATA_HOME/keyrings/default"
$DRY_RUN_CMD mkdir -p "$XDG_CONFIG_HOME/goa-1.0"
$DRY_RUN_CMD cp -f ${./accounts.conf} "$XDG_CONFIG_HOME/goa-1.0/accounts.conf"
$DRY_RUN_CMD mkdir -p "$XDG_CONFIG_HOME/evolution/sources"
$DRY_RUN_CMD cp -f ${./nextcloud.source} "$XDG_CONFIG_HOME/evolution/sources/nextcloud.source"
'';
dconf.settings = {
"org/gnome/nautilus/icon-view" = {
captions = [ "size" "date_modified" "none" ];
};
"org/gnome/nautilus/list-view" = {
default-column-order = [
"name"
"size"
"type"
"owner"
"group"
"permissions"
"where"
"date_modified"
"date_modified_with_time"
"date_accessed"
"recency"
"starred"
"detailed_type"
];
default-visible-columns = [ "name" "size" "date_modified" "starred" ];
};
"org/gnome/nautilus/preferences" = {
default-folder-viewer = "list-view";
executable-text-activation = "display";
search-filter-time-type = "last_modified";
search-view = "list-view";
show-image-thumbnails = "always";
thumbnail-limit = 10;
};
"org/gnome/evince/default" = {
inverted-colors = true;
};
"org/gnome/maps" = {
night-mode = true;
transportation-type = "car";
};
};
};
secrets-envsubst.gnome-keyring = {
owner = "balsoft:users";
secrets = [ "matrix_token" "matrix_password" "email" "nextcloud" ];
template = builtins.readFile ./gnome-keyring-template.conf;
};
}

View File

@ -0,0 +1,84 @@
[keyring]
display-name=Default keyring
ctime=1609508068
mtime=0
lock-on-idle=false
lock-after=false
[5]
item-type=0
display-name=fractal-token
secret=$matrix_token
mtime=1610374847
ctime=1610374847
[5:attribute0]
name=uid
type=string
value=@balsoft:balsoft.ru
[3]
item-type=0
display-name=Geary IMAP password
secret=$email
mtime=1610307006
ctime=1609572471
[3:attribute0]
name=host
type=string
value=balsoft.ru
[3:attribute1]
name=login
type=string
value=balsoft@balsoft.ru
[3:attribute2]
name=proto
type=string
value=IMAP
[3:attribute3]
name=xdg:schema
type=string
value=org.gnome.Geary
[1]
item-type=0
display-name=GOA owncloud credentials for identity account_1609508064_4
secret={'password': <'$nextcloud'>}
mtime=1609508086
ctime=1609508086
[1:attribute0]
name=goa-identity
type=string
value=owncloud:gen0:account_1609508064_4
[1:attribute1]
name=xdg:schema
type=string
value=org.gnome.OnlineAccounts
[4]
item-type=0
display-name=fractal
secret=$matrix_password
mtime=1610374846
ctime=1610374846
[4:attribute0]
name=identity
type=string
value=https://vector.im/
[4:attribute1]
name=server
type=string
value=https://balsoft.ru/
[4:attribute2]
name=username
type=string
value=balsoft

View File

@ -0,0 +1,31 @@
[Data Source]
DisplayName=balsoft@nextcloud.balsoft.ru
Enabled=true
Parent=
[Authentication]
Host=
Method=none
Port=0
ProxyUid=system-proxy
RememberPassword=true
User=
CredentialName=
IsExternal=true
[Collection]
BackendName=webdav
CalendarEnabled=true
ContactsEnabled=true
Identity=balsoft
MailEnabled=true
AllowSourcesRename=false
CalendarUrl=
ContactsUrl=
[GNOME Online Accounts]
AccountId=account_1609508064_4
CalendarUrl=https://balsoft@nextcloud.balsoft.ru/remote.php/caldav/
ContactsUrl=https://balsoft@nextcloud.balsoft.ru/remote.php/carddav/
Name=
Address=