Add nix support to emacs.
This commit is contained in:
parent
5c823f3353
commit
3116d34994
22
ansible/roles/emacs/files/elisp/lang-nix.el
Normal file
22
ansible/roles/emacs/files/elisp/lang-nix.el
Normal file
@ -0,0 +1,22 @@
|
||||
(require 'common-lsp)
|
||||
(require 'util-tree-sitter)
|
||||
|
||||
(use-package nix-mode
|
||||
:mode (("\\.nix\\'" . nix-mode)
|
||||
)
|
||||
:commands nix-mode
|
||||
:hook (
|
||||
(nix-mode . (lambda ()
|
||||
;; (eglot-ensure)
|
||||
;; (defclass my/eglot-nix (eglot-lsp-server) ()
|
||||
;; :documentation
|
||||
;; "Own eglot server class.")
|
||||
|
||||
;; (add-to-list 'eglot-server-programs
|
||||
;; '(nix-mode . (my/eglot-nix "nixd")))
|
||||
;; (add-hook 'before-save-hook 'eglot-format-buffer nil 'local)
|
||||
))
|
||||
)
|
||||
)
|
||||
|
||||
(provide 'lang-nix)
|
@ -36,4 +36,6 @@
|
||||
|
||||
(require 'lang-xml)
|
||||
|
||||
(require 'lang-nix)
|
||||
|
||||
(load-directory autoload-directory)
|
||||
|
@ -7,3 +7,5 @@ dependencies:
|
||||
when: 'emacs_flavor == "full"'
|
||||
- role: terraform
|
||||
when: 'emacs_flavor == "full"'
|
||||
- role: nix
|
||||
when: 'emacs_flavor == "full"'
|
||||
|
@ -42,6 +42,10 @@ nat pass on restricted_nat proto {tcp, udp} from 10.215.1.217/32 to 10.215.2.2 p
|
||||
rdr pass on $ext_if inet proto {tcp, udp} from $not_restricted_nat_v4 to any port 8082 -> 10.215.2.2 port 8082
|
||||
nat pass on restricted_nat proto {tcp, udp} from any to 10.215.2.2 port 8082 -> 10.215.2.1
|
||||
|
||||
# cloak -> dagger old
|
||||
rdr pass on $ext_if inet proto {tcp, udp} from $not_restricted_nat_v4 to any port 8083 -> 10.215.2.2 port 8083
|
||||
nat pass on restricted_nat proto {tcp, udp} from any to 10.215.2.2 port 8083 -> 10.215.2.1
|
||||
|
||||
# -> sftp
|
||||
# TODO: Limit bandwidth for sftp
|
||||
rdr pass on $ext_if inet proto {tcp, udp} from $not_jail_nat_v4 to any port 8022 -> 10.215.1.216 port 22
|
||||
|
55
ansible/roles/nix/tasks/common.yaml
Normal file
55
ansible/roles/nix/tasks/common.yaml
Normal file
@ -0,0 +1,55 @@
|
||||
# - name: Create directories
|
||||
# file:
|
||||
# name: "{{ item }}"
|
||||
# state: directory
|
||||
# mode: 0755
|
||||
# owner: root
|
||||
# group: wheel
|
||||
# loop:
|
||||
# - /foo/bar
|
||||
|
||||
# - name: Install scripts
|
||||
# copy:
|
||||
# src: "files/{{ item.src }}"
|
||||
# dest: "{{ item.dest }}"
|
||||
# mode: 0755
|
||||
# owner: root
|
||||
# group: wheel
|
||||
# loop:
|
||||
# - src: foo.bash
|
||||
# dest: /usr/local/bin/foo
|
||||
|
||||
# - name: Install Configuration
|
||||
# copy:
|
||||
# src: "files/{{ item.src }}"
|
||||
# dest: "{{ item.dest }}"
|
||||
# mode: 0600
|
||||
# owner: root
|
||||
# group: wheel
|
||||
# loop:
|
||||
# - src: foo.conf
|
||||
# dest: /usr/local/etc/foo.conf
|
||||
|
||||
# - name: Clone Source
|
||||
# git:
|
||||
# repo: "https://foo.bar/baz.git"
|
||||
# dest: /foo/bar
|
||||
# version: "v1.0.2"
|
||||
# force: true
|
||||
# diff: false
|
||||
|
||||
- import_tasks: tasks/freebsd.yaml
|
||||
when: 'os_flavor == "freebsd"'
|
||||
|
||||
- import_tasks: tasks/linux.yaml
|
||||
when: 'os_flavor == "linux"'
|
||||
|
||||
- include_tasks:
|
||||
file: tasks/peruser.yaml
|
||||
apply:
|
||||
become: yes
|
||||
become_user: "{{ initialize_user }}"
|
||||
when: users is defined
|
||||
loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}"
|
||||
loop_control:
|
||||
loop_var: initialize_user
|
5
ansible/roles/nix/tasks/freebsd.yaml
Normal file
5
ansible/roles/nix/tasks/freebsd.yaml
Normal file
@ -0,0 +1,5 @@
|
||||
# - name: Install packages
|
||||
# package:
|
||||
# name:
|
||||
# - foo
|
||||
# state: present
|
21
ansible/roles/nix/tasks/linux.yaml
Normal file
21
ansible/roles/nix/tasks/linux.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
# - name: Build aur packages
|
||||
# register: buildaur
|
||||
# become_user: "{{ build_user.name }}"
|
||||
# command: "aurutils-sync --no-view {{ item }}"
|
||||
# args:
|
||||
# creates: "/var/cache/pacman/custom/{{ item }}-*.pkg.tar.*"
|
||||
# loop:
|
||||
# - nixd
|
||||
|
||||
# - name: Update cache
|
||||
# when: buildaur.changed
|
||||
# pacman:
|
||||
# name: []
|
||||
# state: present
|
||||
# update_cache: true
|
||||
|
||||
# - name: Install packages
|
||||
# package:
|
||||
# name:
|
||||
# - nixd
|
||||
# state: present
|
2
ansible/roles/nix/tasks/main.yaml
Normal file
2
ansible/roles/nix/tasks/main.yaml
Normal file
@ -0,0 +1,2 @@
|
||||
- import_tasks: tasks/common.yaml
|
||||
# when: foo is defined
|
29
ansible/roles/nix/tasks/peruser.yaml
Normal file
29
ansible/roles/nix/tasks/peruser.yaml
Normal file
@ -0,0 +1,29 @@
|
||||
- include_role:
|
||||
name: per_user
|
||||
|
||||
# - name: Create directories
|
||||
# file:
|
||||
# name: "{{ account_homedir.stdout }}/{{ item }}"
|
||||
# state: directory
|
||||
# mode: 0700
|
||||
# owner: "{{ account_name.stdout }}"
|
||||
# group: "{{ group_name.stdout }}"
|
||||
# loop:
|
||||
# - ".config/foo"
|
||||
|
||||
# - name: Copy files
|
||||
# copy:
|
||||
# src: "files/{{ item.src }}"
|
||||
# dest: "{{ account_homedir.stdout }}/{{ item.dest }}"
|
||||
# mode: 0600
|
||||
# owner: "{{ account_name.stdout }}"
|
||||
# group: "{{ group_name.stdout }}"
|
||||
# loop:
|
||||
# - src: foo.conf
|
||||
# dest: .config/foo/foo.conf
|
||||
|
||||
- import_tasks: tasks/peruser_freebsd.yaml
|
||||
when: 'os_flavor == "freebsd"'
|
||||
|
||||
- import_tasks: tasks/peruser_linux.yaml
|
||||
when: 'os_flavor == "linux"'
|
0
ansible/roles/nix/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/nix/tasks/peruser_freebsd.yaml
Normal file
0
ansible/roles/nix/tasks/peruser_linux.yaml
Normal file
0
ansible/roles/nix/tasks/peruser_linux.yaml
Normal file
@ -42,7 +42,7 @@ function main {
|
||||
local night_mode_icon night_mode_text night_mode_class
|
||||
night_mode_mode="auto"
|
||||
night_mode_class=""
|
||||
wlsunset -l 40.7 -L -74.0 &
|
||||
wlsunset -S 07:00 -s 22:00 &
|
||||
wlsunset_pid=$!
|
||||
|
||||
while true; do
|
||||
|
Loading…
x
Reference in New Issue
Block a user