-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: rename installations -> configurations, initial implementation …
…of post-boot part
- Loading branch information
Showing
3 changed files
with
81 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
modules/default-flatpaks/v2/post-boot/system-flatpak-setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,41 @@ | ||
#!/usr/bin/env nu | ||
|
||
const usrSharePath = "/usr/share/bluebuild/default-flatpaks" | ||
const configPath = $"($usrSharePath)/configuration.yaml" | ||
|
||
def main [] { | ||
let configFile = open $configPath | ||
|
||
if (flatpak remotes | str contains fedora) { | ||
/usr/bin/gnome-software --quit | ||
/usr/lib/fedora-third-party/fedora-third-party-opt-out | ||
/usr/bin/fedora-third-party disable | ||
|
||
flatpak remote-delete --system fedora --force | ||
flatpak remote-delete --system fedora-testing --force | ||
|
||
# TODO remove Fedora Flatpaks | ||
} | ||
|
||
$configFile.configurations | where scope == system | each { |config| | ||
flatpak remote-add --system --if-not-exists $config.repo.name $config.repo.url --title $config.repo.title | ||
|
||
if ($config.notify) { | ||
# TODO implement notification sending | ||
# (notify-send | ||
# --app-name "Automatic Flatpak Installation Service" | ||
# $"Starting automated installation of ($config.install | length) Flatpak\(s) from ($config.repo.title)..." | ||
# ) | ||
} | ||
|
||
flatpak install --system $config.repo.name ...$config.install | ||
|
||
if ($config.notify) { | ||
# (notify-send | ||
# --app-name "Automatic Flatpak Installation Service" | ||
# $"Finished automated installation of ($config.install | length) Flatpak\(s) from ($config.repo.title)!" | ||
# ($config.install | str join ', ') | ||
# ) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,34 @@ | ||
#!/usr/bin/env nu | ||
|
||
const usrSharePath = "/usr/share/bluebuild/default-flatpaks" | ||
const configPath = $"($usrSharePath)/configuration.yaml" | ||
|
||
def main [] { | ||
let configFile = open $configPath | ||
|
||
if (flatpak remotes | str contains fedora) { | ||
flatpak remote-delete --user fedora --force | ||
flatpak remote-delete --user fedora-testing --force | ||
} | ||
|
||
$configFile.configurations | where scope == user | each { |config| | ||
flatpak remote-add --user --if-not-exists $config.repo.name $config.repo.url --title $config.repo.title | ||
|
||
if ($config.notify) { | ||
(notify-send | ||
--app-name "Automatic Flatpak Installation Service" | ||
$"Starting automated installation of ($config.install | length) Flatpak\(s) from ($config.repo.title)..." | ||
) | ||
} | ||
|
||
flatpak install --user $config.repo.name ...$config.install | ||
|
||
if ($config.notify) { | ||
(notify-send | ||
--app-name "Automatic Flatpak Installation Service" | ||
$"Finished automated installation of ($config.install | length) Flatpak\(s) from ($config.repo.title)!" | ||
($config.install | str join ', ') | ||
) | ||
} | ||
} | ||
} |