-
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial try to use chezmoi to manage root dir
Handle apt repositories with chezmoi
- Loading branch information
Showing
13 changed files
with
118 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
# Available in ShellCheck v0.7.2 | ||
enable=add-default-case | ||
enable=avoid-nullary-conditions | ||
enable=check-extra-masked-returns | ||
enable=check-set-e-suppressed | ||
enable=check-unassigned-uppercase | ||
enable=deprecate-which | ||
enable=quote-safe-variables | ||
enable=require-variable-braces | ||
|
||
# Not available in ShellCheck v0.7.2 | ||
enable=check-extra-masked-returns | ||
enable=check-set-e-suppressed | ||
enable=require-double-brackets | ||
enable=require-variable-braces |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
readonly config_dir="${HOME}/.config/rootmoi" | ||
|
||
readonly config="${config_dir}/chezmoi.yaml" | ||
readonly persistent_state="${config_dir}/chezmoistate.boltdb" | ||
|
||
exec sudo "{{ .chezmoi.executable }}" \ | ||
--config="${config}" \ | ||
--persistent-state="${persistent_state}" \ | ||
"$@" |
15 changes: 15 additions & 0 deletions
15
home/private_dot_config/private_rootmoi/private_chezmoi.yaml.tmpl
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{{- $chezmoiData := deepCopy . -}} | ||
{{- $chezmoiData = unset $chezmoiData "chezmoi" -}} | ||
|
||
sourceDir: "{{ joinPath .chezmoi.workingTree "root" }}" | ||
|
||
destDir: "/" | ||
|
||
verbose: true | ||
|
||
diff: | ||
exclude: | ||
- scripts | ||
|
||
data: | ||
{{ $chezmoiData | toYaml | indent 2 }} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
echo "Applying chezmoi to root..." | ||
|
||
executable='{{ joinPath .chezmoi.homeDir ".local/bin/rootmoi" }}' | ||
args=({{ range (rest .chezmoi.args) }} {{ . | quote }}{{ end }}) | ||
|
||
echo "Executing: ${executable} ${args[@]}" | ||
exec "${executable}" "${args[@]}" |
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
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
"usr/share/keyrings/docker-archive-keyring.gpg": | ||
type: file | ||
url: "https://download.docker.com/linux/{{ .chezmoi.osRelease.id }}/gpg" | ||
filter: | ||
command: gpg | ||
args: ["--dearmor"] | ||
|
||
"usr/share/keyrings/kubic-archive-keyring.gpg": | ||
type: file | ||
url: "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ .chezmoi.osRelease.versionID }}/Release.key" | ||
filter: | ||
command: gpg | ||
args: ["--dearmor"] | ||
|
||
"usr/share/keyrings/git-core-ppa-archive-keyring.gpg": | ||
type: file | ||
url: "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xE1DD270288B4E6030699E45FA1715D88E1DF1F24" | ||
filter: | ||
command: gpg | ||
args: ["--dearmor"] | ||
|
||
"usr/share/keyrings/communitheme-ppa-archive-keyring.gpg": | ||
type: file | ||
url: "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0xDEE9D5E11727231736FD173F03D12CDECFB24D48" | ||
filter: | ||
command: gpg | ||
args: ["--dearmor"] | ||
|
||
{{ $composeSwitchVersion := (gitHubLatestRelease "docker/compose-switch").TagName -}} | ||
"usr/local/bin/docker-compose": | ||
type: file | ||
url: "https://github.com/docker/compose-switch/releases/download/{{ $composeSwitchVersion }}/docker-compose-linux-amd64" | ||
executable: true | ||
|
||
{{ $dockerCredsVersion := (gitHubLatestRelease "docker/docker-credential-helpers").TagName -}} | ||
"usr/bin/docker-credential-wincred.exe": | ||
type: file | ||
url: "https://github.com/docker/docker-credential-helpers/releases/download/{{ $dockerCredsVersion }}/docker-credential-wincred-{{ $dockerCredsVersion }}-amd64.zip" | ||
executable: true | ||
filter: | ||
command: zcat | ||
|
||
"usr/bin/docker-credential-secretservice": | ||
type: file | ||
url: "https://github.com/docker/docker-credential-helpers/releases/download/{{ $dockerCredsVersion }}/docker-credential-secretservice-{{ $dockerCredsVersion }}-amd64.tar.gz" | ||
executable: true | ||
filter: | ||
command: tar | ||
args: ["-xzOf-"] |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{{- if not (eq .chezmoi.osRelease.versionCodename "bionic") -}} | ||
etc/apt/sources.list.d/communitheme-ppa.list | ||
usr/share/keyrings/communitheme-ppa-archive-keyring.gpg | ||
{{- end }} | ||
|
||
{{ if .is_wsl -}} | ||
usr/bin/docker-credential-secretservice | ||
{{- else -}} | ||
usr/bin/docker-credential-wincred.exe | ||
{{- end }} |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
etc/apt/sources.list.d/git-core-ubuntu-ppa-*.list* | ||
etc/apt/sources.list.d/communitheme-ubuntu-ppa-*.list* | ||
etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list* |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
deb [signed-by=/usr/share/keyrings/communitheme-ppa-archive-keyring.gpg] http://ppa.launchpad.net/communitheme/ppa/ubuntu {{ .chezmoi.osRelease.ubuntuCodename }} main |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
deb [arch={{ .chezmoi.arch }} signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/{{ .chezmoi.osRelease.id }} {{ .chezmoi.osRelease.versionCodename }} stable |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
deb [signed-by=/usr/share/keyrings/git-core-ppa-archive-keyring.gpg] http://ppa.launchpad.net/git-core/ppa/ubuntu {{ .chezmoi.osRelease.ubuntuCodename }} main |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
deb [signed-by=/usr/share/keyrings/kubic-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_{{ .chezmoi.osRelease.versionID }}/ / |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
jq=(jq --raw-output --tab) | ||
json=$(cat /dev/stdin) | ||
|
||
if [[ -z "${json}" ]]; then | ||
json='{}' | ||
fi | ||
|
||
json=$("${jq[@]}" '.features.buildkit = true' <<<"${json}") | ||
|
||
echo -n "${json}" |