Skip to content

Commit

Permalink
Add Home Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
staticdev committed Jan 10, 2024
1 parent d5ed18d commit 77d0c54
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
- Development: [Golang], [NodeJs] and [Python tools].
- IDEs: [VSCodium] and [Pycharm] installation.
- Browsers: [Firefox] ESR replacement with official PPA and configuration; and [Brave] installation.
- Package manager installation: [Nix].
- Package manager installation: [Nix] and [Home Manager].
- Packages intallation: apt, nix, snap, pip, npm, ruby gems.
- Replaces [LibreOffice] with [OnlyOffice].
- Assorted FOSS programs: [Cryptomator], [KeyPass], [OBS], [OpenRGB], [RClone], and [Signal] messenger installation.
Expand Down Expand Up @@ -194,6 +194,7 @@ This project was inspired by [@geerlingguy]'s [Mac Development Ansible Playbook]
[git]: https://git-scm.com/
[gnome]: https://www.gnome.org/
[golang]: https://go.dev/
[home manager]: https://github.com/nix-community/home-manager
[libreoffice]: https://www.libreoffice.org/
[nodejs]: https://nodejs.org/
[keypass]: https://keepass.info/
Expand Down
11 changes: 5 additions & 6 deletions default.config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ installed_packages:
- podman # see https://github.com/NixOS/nixpkgs/issues/138423
- poedit

install_home_manager: true
nix_packages:
- name: kubectl
check_cmd: kubectl version --client
Expand Down Expand Up @@ -82,13 +83,11 @@ nodejs_version: "20.x"
## Python settings
python_developer: true
pyenv_python_versions:
- 3.12.0
- 3.11.4
- 3.10.12
- 3.12.1
- 3.11.7
pyenv_global:
- 3.12.0
- 3.11.4
- 3.10.12
- 3.12.1
- 3.11.7
pyenv_virtualenvs: []

# IDEs
Expand Down
4 changes: 4 additions & 0 deletions main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
ansible.builtin.include_tasks: tasks/packages.yml
when: install_packages

- name: Install Home Manager
ansible.builtin.include_tasks: tasks/home-manager.yml
when: install_home_manager

- name: Install zsh
ansible.builtin.include_tasks: tasks/zsh.yml
when: install_zsh
Expand Down
18 changes: 18 additions & 0 deletions tasks/home-manager.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
- name: "Add home-manager channel"
ansible.builtin.command: "nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager"
environment:
PATH: "{{ ansible_env.HOME + '/.nix-profile/bin:$PATH' }}"
changed_when: false

- name: "Get channel updates"
ansible.builtin.command: "nix-channel --update"
environment:
PATH: "{{ ansible_env.HOME + '/.nix-profile/bin:$PATH' }}"
changed_when: false

- name: "Add Home Manager"
ansible.builtin.command: "nix-shell '<home-manager>' -A install"
environment:
PATH: "{{ ansible_env.HOME + '/.nix-profile/bin:$PATH' }}"
changed_when: true

0 comments on commit 77d0c54

Please sign in to comment.