Skip to content

Commit f9ac94a

Browse files
authored
Merge pull request #470 from staticdev/feature/nvf
Enable Home Manager and Nixvim
2 parents 5bde406 + 5708d7b commit f9ac94a

11 files changed

+433
-138
lines changed

README.md

+4-17
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
## Features
1010

1111
- Support processor architectures: x86_64 (only one for now, may be extended in the future).
12-
- IDEs: [VSCodium] installation (via Nixpkgs).
13-
- Browsers: [Brave], [Firefox] and [Mullvad Browser] (via Nix).
12+
- IDEs: [VSCodium] installation (via Nixpkgs), [Neovim] (via [NixVim]).
13+
- Browsers: [Brave] and [Mullvad Browser] (via Nix).
1414
- Containers and virtualization: [Docker], [Podman] and [libvirtd].
1515
- Office: installs [OnlyOffice] (via Nixpkgs).
1616
- Assorted FOSS programs: [Cryptomator], [KeyPass], [OBS] (via Nixpkgs), [OpenRGB], [RClone], and [Signal] (via Nixpkgs) messenger installation.
@@ -81,7 +81,6 @@ It also installs with [Nix] package manager:
8181
- thefuck
8282
- tmux
8383
- vagrant
84-
- vim
8584
- wget
8685
- xclip
8786
```
@@ -105,19 +104,6 @@ To have you own dotfiles, just fork the [dotfiles eg. repo] and change the url o
105104

106105
For [Nix] packages, update your [Home Manager] config on your dotfiles repo.
107106

108-
Other package managers:
109-
110-
```yaml
111-
# requires snapd
112-
snap_packages:
113-
- name: code
114-
classic: true
115-
- name: postman
116-
117-
npm_packages:
118-
- name: webpack
119-
```
120-
121107
Any variable can be overridden in **config.yml**; see the supporting roles' documentation for a complete list of available variables.
122108

123109
### Use with a remote machine
@@ -160,7 +146,6 @@ This project was inspired by [@geerlingguy]'s [Mac Development Ansible Playbook]
160146
[dotfiles eg. repo]: https://github.com/staticdev/dotfiles-eg
161147
[download]: https://github.com/staticdev/linux-workstation-playbook/archive/refs/heads/main.zip
162148
[file an issue]: https://github.com/staticdev/linux-workstation-playbook/issues
163-
[firefox]: https://www.mozilla.org/firefox/
164149
[git]: https://git-scm.com/
165150
[gnome]: https://www.gnome.org/
166151
[home manager]: https://github.com/nix-community/home-manager
@@ -169,8 +154,10 @@ This project was inspired by [@geerlingguy]'s [Mac Development Ansible Playbook]
169154
[mac development ansible playbook]: https://github.com/geerlingguy/mac-dev-playbook
170155
[mit]: https://opensource.org/licenses/MIT
171156
[mullvad browser]: https://mullvad.net/en/browser
157+
[neovim]: https://github.com/neovim/neovim
172158
[nix]: https://nixos.org/
173159
[nixos download iso page]: https://nixos.org/download/#nixos-iso
160+
[nixvim]: https://github.com/nix-community/nixvim
174161
[obs]: https://obsproject.com/
175162
[onlyoffice]: https://github.com/ONLYOFFICE/
176163
[openrgb]: https://gitlab.com/CalcProgrammer1/OpenRGB

default.config.yml

+1-20
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,17 @@ nix_packages:
3131
check_cmd: tmux -V
3232
- name: vagrant
3333
check_cmd: vagrant --version
34-
- name: vim
35-
check_cmd: vim --version
3634
- name: wget
3735
check_cmd: wget --version
3836
- name: xclip
3937
check_cmd: xclip -version
4038

41-
# Install packages from other package managers
42-
install_extra_packages: true
43-
# Note: You are responsible for adding the required package managers
44-
# installation, eg. through nix
45-
snap_packages: []
46-
# - name: postman
47-
gem_packages: []
48-
# - name: bundler
49-
# state: present # present/absent/latest, default: present
50-
# version: "~> 1.15.1" # default: N/A
51-
npm_packages: []
52-
# - name: webpack
53-
# state: present # present/absent/latest, default: present
54-
# version: "^2.6" # default: N/A
55-
56-
# Dotfiles (requires git on installed_packages or extra_packages)
39+
# Dotfiles (requires git on installed_packages)
5740
configure_dotfiles: true
5841
dotfiles_repo: "https://github.com/staticdev/dotfiles-eg.git"
5942
dotfiles_repo_version: main
6043
dotfiles_files:
6144
- .tmux.conf
62-
- .vimrc
6345
- .zshrc
6446

6547
# Keyboard config
@@ -113,7 +95,6 @@ git_username: gitusername
11395
gnome_setup: false
11496
gnome_favorite_apps:
11597
[
116-
"firefox.desktop",
11798
"brave-browser.desktop",
11899
"org.gnome.Nautilus.desktop",
119100
"codium.desktop",

eg/local.nix

+67-55
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
{pkgs, config, options, ...}:
1+
{pkgs, options, ...}:
22

3-
let
4-
mainUser = config.environment.sysConf.mainUser;
5-
in
63
{
74
environment.sysConf = {
85
git = {
@@ -25,7 +22,6 @@ in
2522
systemWidePkgs = with pkgs; [
2623
ansible
2724
openssl
28-
vim
2925
wget
3026
];
3127
timeZone = "Europe/Amsterdam";
@@ -37,62 +33,78 @@ in
3733
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # ublock origin
3834
];
3935
};
40-
programs.firefox = {
36+
# fix issues with running ruff being dynamically linked
37+
programs.nix-ld.enable = true;
38+
programs.nix-ld.libraries = options.programs.nix-ld.libraries.default;
39+
# Neovim configs
40+
programs.nixvim = {
4141
enable = true;
42-
policies = {
43-
OfferToSaveLogins = false;
44-
PasswordManagerEnabled = false;
45-
DisableTelemetry = true;
46-
DisableFirefoxStudies = true;
47-
EnableTrackingProtection = {
48-
Value = true;
49-
Locked = true;
50-
Cryptomining = true;
51-
Fingerprinting = true;
52-
};
53-
DisablePocket = true;
54-
DisableFirefoxAccounts = true;
55-
DisableAccounts = true;
56-
DisableFirefoxScreenshots = true;
57-
OverrideFirstRunPage = "";
58-
OverridePostUpdatePage = "";
59-
DontCheckDefaultBrowser = true;
60-
DisplayBookmarksToolbar = "newtab";
61-
DisplayMenuBar = "default-off";
62-
SearchBar = "unified";
63-
ExtensionSettings = {
64-
# Blocks installing new extensions
65-
"*".installation_mode = "blocked";
66-
# uBlock Origin
67-
# https://addons.mozilla.org/api/v5/addons/addon/ublock-origin/
68-
69-
install_url = "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi";
70-
installation_mode = "force_installed";
71-
};
72-
# Startpage
73-
# https://addons.mozilla.org/en-US/firefox/addon/startpage-private-search/
74-
"{20fc2e06-e3e4-4b2b-812b-ab431220cada}" = {
75-
install_url = "https://addons.mozilla.org/firefox/downloads/file/4362482/startpage_private_search-2.0.2.xpi";
76-
installation_mode = "force_installed";
42+
viAlias = true;
43+
vimAlias = true;
44+
defaultEditor = true;
45+
colorschemes.vscode.enable = true;
46+
opts = {
47+
number = true;
48+
relativenumber = false;
49+
guicursor = "";
50+
undofile = true;
51+
encoding = "utf-8";
52+
signcolumn = "yes";
53+
belloff = "all";
54+
wrap = false;
55+
wildmenu = true;
56+
modeline = true;
57+
modelines = 1;
58+
tabstop = 2;
59+
softtabstop = 2;
60+
shiftwidth = 2;
61+
expandtab = true;
62+
smarttab = true;
63+
autoindent = true;
64+
};
65+
clipboard = {
66+
register = "unnamedplus";
67+
providers.wl-copy.enable = true;
68+
};
69+
plugins = {
70+
web-devicons.enable = true;
71+
lualine.enable = true;
72+
barbar.enable = true;
73+
lazygit.enable = true;
74+
gitblame.enable = true;
75+
gitsigns.enable = true;
76+
indent-blankline.enable = true;
77+
lastplace.enable = true;
78+
treesitter.enable = true;
79+
neo-tree.enable = true;
80+
nvim-autopairs.enable = true;
81+
helm.enable = true;
82+
cmp.enable = true;
83+
lsp = {
84+
enable = true;
85+
servers = {
86+
nixd.enable = true;
87+
clangd.enable = true;
7788
};
7889
};
7990
};
8091
};
81-
# fix issues with running ruff being dynamically linked
82-
programs.nix-ld.enable = true;
83-
programs.nix-ld.libraries = options.programs.nix-ld.libraries.default;
8492
# Enable zsh in case you want to use it
85-
programs.zsh.enable = true;
86-
87-
# Define a user account. Don't forget to set a password with ‘passwd’.
88-
users.users."${mainUser.name}" = {
89-
isNormalUser = true;
90-
shell = pkgs.zsh;
91-
extraGroups = [
92-
"docker" # Run docker without ‘sudo’
93-
"wheel" # Enable ‘sudo’ for the user.
94-
];
95-
packages = config.environment.sysConf.mainUser.pkgs;
93+
programs.zsh = {
94+
enable = true;
95+
enableCompletion = true;
96+
autosuggestions.enable = true;
97+
syntaxHighlighting.enable = true;
98+
shellAliases = {
99+
gc = "nix store gc";
100+
localedit = "sudo vim /etc/nixos/local.nix";
101+
nixup = "sudo nix flake update --flake /etc/nixos && sudo nixos-rebuild switch";
102+
};
103+
shellInit = ''
104+
if [ ! -f ~/.zshrc ]; then
105+
echo 'eval "$(direnv hook zsh)"' > ~/.zshrc
106+
fi
107+
'';
96108
};
97109

98110
virtualisation = {

0 commit comments

Comments
 (0)