├── .editorconfig ├── .envrc ├── .github └── workflows │ └── check.yml ├── .gitignore ├── .sops.yaml ├── LICENSE ├── README.org ├── channels ├── darwin-nixpkgs.nix ├── default.nix └── nixos.nix ├── darwin ├── default.nix ├── hostDefault.nix ├── hosts.nix └── suites.nix ├── default.nix ├── devshell ├── default.nix ├── devos.nix ├── devshell.toml ├── hooks │ ├── default.nix │ └── pre-commit.sh └── sops-shell.toml ├── flake.lock ├── flake.nix ├── home └── default.nix ├── hosts ├── darwin │ └── MacBook │ │ └── default.nix └── nixos │ └── NixOS │ ├── NixOS-hardware-configuration.nix │ └── default.nix ├── lib ├── compat │ ├── default.nix │ └── nixos │ │ └── default.nix ├── default.nix ├── hosts │ └── default.nix └── installApp.nix ├── modules ├── nixos │ ├── promnesia │ │ └── promnesia.nix │ └── resources │ │ ├── default.nix │ │ └── hosts │ │ └── NixOS.toml └── shared │ ├── hm-system-defaults.nix │ └── nix-path.nix ├── nixos ├── default.nix ├── hostDefault.nix ├── hosts.nix └── suites.nix ├── overlays ├── nixos │ ├── adguardhome.nix │ ├── apps.nix │ ├── drawio-desktop.nix │ ├── my-node-packages.nix │ ├── nix.nix │ ├── overrides.nix │ ├── polar-bookshelf.nix │ └── python-mkdocs-deps.nix └── shared │ └── default.nix ├── pkgs ├── _sources │ ├── app │ │ ├── generated.json │ │ └── generated.nix │ ├── default │ │ ├── generated.json │ │ └── generated.nix │ └── vscode │ │ ├── generated.json │ │ └── generated.nix ├── appimage │ ├── Motrix.nix │ ├── build-appimage.nix │ ├── chord.nix │ ├── magnetw.nix │ └── shadowsocks-qt5.nix ├── default.nix ├── go │ ├── got │ │ ├── default.nix │ │ └── deps.nix │ ├── govet │ │ └── default.nix │ └── horcrux │ │ ├── default.nix │ │ └── deps.nix ├── my-node-packages │ ├── node-env.nix │ ├── node-packages.nix │ ├── packages.json │ ├── plugins.nix │ └── upgrade.sh ├── output-builder │ └── default.nix ├── packages │ ├── StevenBlack-hosts │ │ └── default.nix │ └── notdeft │ │ └── default.nix ├── python │ ├── HPI │ │ └── default.nix │ ├── orgparse │ │ └── default.nix │ └── promnesia │ │ └── default.nix ├── rust │ └── sudo_pair │ │ ├── add-Cargo.lock.patch │ │ └── default.nix ├── sources-app.toml ├── sources-vscode.toml └── sources.toml ├── profiles ├── application │ ├── base │ │ └── default.nix │ ├── chat │ │ └── default.nix │ └── misc │ │ ├── default.nix │ │ ├── image.nix │ │ ├── mpd.nix │ │ └── photoprism.nix ├── cachix │ ├── default.nix │ ├── emacsng.nix │ ├── nix-community.nix │ └── zeek.nix ├── coding │ ├── common │ │ └── default.nix │ ├── go │ │ └── default.nix │ ├── haskell │ │ └── default.nix │ ├── library │ │ └── default.nix │ ├── nix │ │ ├── default.nix │ │ └── repl.nix │ ├── node │ │ └── default.nix │ ├── python │ │ └── default.nix │ ├── rust │ │ └── default.nix │ ├── tex │ │ └── default.nix │ └── vscode │ │ ├── default.nix │ │ └── extensions.nix ├── core │ ├── darwin │ │ └── default.nix │ └── nixos │ │ ├── base.nix │ │ ├── default.nix │ │ ├── nix.nix │ │ ├── shell.nix │ │ └── sysctl.nix ├── data │ ├── airflow │ │ └── default.nix │ ├── cassandra.nix │ ├── database │ │ └── default.nix │ ├── filestash │ │ └── default.nix │ ├── miniflux │ │ └── default.nix │ ├── nextcloud │ │ ├── default.nix │ │ └── nextcloud_db.nix │ ├── promnesia │ │ ├── config.py │ │ ├── default.nix │ │ └── promnesia.org │ └── syncthing │ │ └── default.nix ├── devices │ ├── buletooth.nix │ ├── default.nix │ └── pipewire.nix ├── fonts │ └── default.nix ├── graphical │ ├── dbus │ │ └── default.nix │ ├── i3 │ │ └── default.nix │ ├── misc │ │ ├── default.nix │ │ └── volnoti.nix │ ├── nvidia │ │ └── default.nix │ ├── xdg │ │ └── default.nix │ └── xserver │ │ └── default.nix ├── networking │ ├── adblocking │ │ └── default.nix │ ├── adguardhome │ │ └── default.nix │ └── common │ │ └── default.nix ├── nsm │ └── default.nix ├── registry │ └── nixos │ │ └── default.nix ├── searching │ └── hound │ │ ├── config-hound.json │ │ └── default.nix ├── secrets │ └── sops │ │ └── default.nix ├── ssh │ └── default.nix └── virtualisation │ ├── docker │ └── default.nix │ ├── libvirtd │ └── default.nix │ ├── oci-containers │ └── default.nix │ └── podman │ └── default.nix ├── secrets ├── keys │ └── users │ │ └── gtrunsec.asc ├── secrets.nix └── secrets.yaml ├── shell.nix ├── templates └── devos │ ├── .envrc │ ├── channels │ └── default.nix │ ├── darwin │ ├── default.nix │ ├── hostDefault.nix │ ├── hosts.nix │ └── suites.nix │ ├── default.nix │ ├── devshell │ ├── default.nix │ ├── devos.nix │ └── hooks │ │ ├── default.nix │ │ └── pre-commit.sh │ ├── flake.lock │ ├── flake.nix │ ├── home │ └── default.nix │ ├── hosts │ ├── darwin │ │ └── Mac.nix │ └── nixos │ │ ├── NixOS.nix │ │ └── bootstrap.nix │ ├── lib │ ├── compat │ │ ├── default.nix │ │ └── nixos │ │ │ └── default.nix │ └── default.nix │ ├── modules │ ├── nixos │ │ └── module-list.nix │ └── shared │ │ ├── hm-system-defaults.nix │ │ └── nix-path.nix │ ├── nixos │ ├── default.nix │ ├── hostDefault.nix │ ├── hosts.nix │ └── suites.nix │ ├── overlays │ ├── common │ │ ├── manix.nix │ │ └── overrides.nix │ └── shared │ │ └── default.nix │ ├── pkgs │ ├── _sources │ │ └── generated.nix │ ├── default.nix │ └── sources.toml │ ├── profiles │ ├── cachix │ │ ├── default.nix │ │ ├── nix-community.nix │ │ └── nrdxp.nix │ └── core │ │ ├── common.nix │ │ ├── darwin.nix │ │ ├── nixos.nix │ │ └── starship.toml │ ├── secrets │ └── secrets.nix │ ├── shell.nix │ └── users │ ├── admin │ └── default.nix │ ├── darwin │ └── default.nix │ ├── modules │ └── .flake-keep │ ├── nixos │ └── default.nix │ ├── profiles │ ├── direnv │ │ └── default.nix │ ├── git │ │ └── default.nix │ └── lorri │ │ └── default.nix │ └── root │ └── default.nix ├── treefmt.toml └── users ├── darwin └── default.nix ├── dotfiles ├── .xinitrc ├── block │ ├── Brower-brave │ │ └── shutup │ │ │ └── block-comment.list │ └── adguard │ │ └── custom-filter.list ├── direnv │ └── direnvrc.sh ├── doom-emacs │ ├── .dir-locals.el │ ├── autoload │ │ └── misc.el │ ├── bin │ │ ├── clean-git-lock.sh │ │ └── emacs.sh │ ├── config.org │ ├── hugo.setup │ ├── lisp │ │ ├── compile.el │ │ ├── nix.el │ │ └── update.el │ ├── meow.org │ ├── modules │ │ ├── poly-org.el │ │ ├── private │ │ │ └── spacemacs-default │ │ │ │ ├── buffer.el │ │ │ │ ├── config.el │ │ │ │ ├── misc.el │ │ │ │ └── vinegar.el │ │ └── templates │ │ │ ├── braindumo-blog:braindump.*.setup │ │ │ ├── braindump-blog:braindump.*.org │ │ │ ├── emacs-lisp:.*.el │ │ │ ├── git:.*.gitignore │ │ │ ├── go-mode:.*.go │ │ │ └── my-blog:posts.*.org │ ├── snippets │ │ ├── conf-toml-mode │ │ │ └── commands │ │ ├── emacs-lisp-mode │ │ │ └── org-package │ │ ├── envrc-file-mode │ │ │ └── nix │ │ ├── nix-mode │ │ │ ├── l │ │ │ ├── machix-head │ │ │ ├── machix-python │ │ │ ├── nocargo │ │ │ ├── python-replace │ │ │ └── rule │ │ ├── org-mode │ │ │ ├── +[] │ │ │ ├── -[] │ │ │ ├── .[] │ │ │ ├── R-src │ │ │ ├── asciinema │ │ │ ├── attr_html │ │ │ ├── audio_list │ │ │ ├── conf │ │ │ ├── config.el │ │ │ ├── ein-R │ │ │ ├── ein-haskell │ │ │ ├── ein-julia │ │ │ ├── ein-python │ │ │ ├── ein-rust │ │ │ ├── git-update-master │ │ │ ├── git-upstram │ │ │ ├── go-src │ │ │ ├── gtrun_blog │ │ │ ├── haskell-src │ │ │ ├── home-manager-src │ │ │ ├── html-image │ │ │ ├── info │ │ │ ├── item-price │ │ │ ├── julia-src │ │ │ ├── lambda-nixops-infra-list │ │ │ ├── logseq-embed-id │ │ │ ├── logseq-public │ │ │ ├── logseq-vedio │ │ │ ├── nix-src │ │ │ ├── nixos-flk-conf │ │ │ ├── nixos-host │ │ │ ├── org-super-link-type │ │ │ ├── pdf-image │ │ │ ├── property-header-dir │ │ │ ├── property-template-habit │ │ │ ├── python-src │ │ │ ├── python-val │ │ │ ├── rust-src │ │ │ └── shell-src │ │ └── yaml-mode │ │ │ └── gh-nix │ └── theme-readtheorg.setup ├── i3 │ ├── config │ ├── i3-test.sh │ └── move-cursor-window-center.sh ├── kde │ ├── kded5rc │ └── kwalletrc ├── kitty │ ├── cscheme.conf │ ├── kitty.conf │ └── solarized.conf ├── lsyncd.conf ├── my-font │ ├── MacFSGB2312.ttf │ ├── MacFZXBSGBK.ttf │ ├── MacFZXBSJT.ttf │ ├── MacKTGB2312.ttf │ ├── WeibeiSC-Bold.otf │ ├── icomoon-feather.ttf │ ├── scientifica-11.bdf │ ├── scientificaBold-11.bdf │ ├── scientificaItalic-11.bdf │ └── waffle-10.bdf ├── omf │ ├── bundle │ ├── channel │ └── theme ├── pet │ ├── config.toml │ ├── darwin-config.toml │ └── snippet.toml ├── polybar │ ├── Scripts │ │ ├── bbswitch.sh │ │ ├── openweathermap-detailed.sh │ │ ├── player-moc.sh │ │ └── uptime.sh │ ├── config │ └── launch.sh ├── rofi │ ├── powermenu.sh │ └── themes │ │ ├── blurry.rasi │ │ ├── config.rasi │ │ ├── launcher.sh │ │ └── powermenu │ │ ├── confirm.rasi │ │ ├── message.rasi │ │ ├── row_square.rasi │ │ └── styles │ │ ├── berry.rasi │ │ ├── bluish.rasi │ │ ├── cocoa.rasi │ │ ├── colors.rasi │ │ ├── faded.rasi │ │ ├── gotham.rasi │ │ ├── mask.rasi │ │ ├── nightly.rasi │ │ └── nordic.rasi ├── termite │ └── config └── wallpaper │ ├── .attach │ ├── 12 │ │ └── 004cda-72c7-4199-898a-e1c05e389f36 │ │ │ └── richard-rude-richardrude-d2f-hellrisecanyon-002_2019-07-27_16-32-49.jpeg │ ├── 13 │ │ ├── 03f0d8-1ed0-48dc-a27b-04f6c1de086b │ │ │ └── tumblr_p7ikadfPzT1uzeyaxo3_1280.jpg │ │ └── 2975b6-d781-4491-90e8-dca19c17b321 │ │ │ ├── 20201106_203824grafit-studio-imgpsh-fullsize-3.jpg.jpeg │ │ │ └── grafit-studio-5_2019-07-27_08-31-07.jpeg │ ├── 14 │ │ └── 78c80d-71ae-445b-85fe-0fa02a74bb0d │ │ │ └── 20200926_171435rogelio-olguin-int-h-15.jpg.jpeg │ ├── 46 │ │ └── b72c9c-ed4a-4ffc-9c55-a1e285e67484 │ │ │ └── herman-ng-20161012-style-sheet-final_2019-07-27_13-52-45.jpeg │ ├── 53 │ │ └── a30b83-7100-4366-b338-35eafe4c41db │ │ │ └── 20200926_173420guillem-h-pongiluppi-guillemhp-barcelona-future-3.jpg.jpeg │ ├── 58 │ │ └── caff13-ba26-4df1-b157-7e9d0117fd3c │ │ │ └── ferdinand-ladera-mystical-woods_2019-07-27_16-18-37.jpeg │ ├── 90 │ │ └── 8bd9d2-d180-427a-a101-d68588b310a4 │ │ │ └── ferdinand-ladera-torrent-of-gelion-2k_2019-07-27_16-17-26.jpeg │ ├── 00 │ │ └── d885ed-3c8e-4c03-b325-52a807f9a3c7 │ │ │ ├── 20201219_162324george-turmanidze-10.jpg.jpeg │ │ │ ├── 20201219_162452george-turmanidze-8.jpg.jpeg │ │ │ ├── 20201219_170859george-turmanidze-8.jpg.jpeg │ │ │ ├── 20201219_173036george-turmanidze-img-20200427-063133-132.jpg.jpeg │ │ │ ├── 20201219_173459ana-obradovic-kupatilo-final2.jpg.jpeg │ │ │ ├── 20201219_173713andrea-marinelli-liv1-best.jpg.jpeg │ │ │ ├── 20201219_173725andrea-marinelli-liv1-best2.jpg.jpeg │ │ │ ├── 20201219_182522vincent-gros-demetersdream005.jpg.jpeg │ │ │ └── 20201219_182537vincent-gros-demetersdream007.jpg.jpeg │ ├── 04 │ │ └── 6d8397-51e7-4cd8-b21b-2909a0ada976 │ │ │ └── eddie-del-rio-622709-10152191443342178-2030898129-o_2019-07-27_04-21-22.jpeg │ ├── 0d │ │ └── f5cb5d-08df-430d-bfcb-6914a15abfed │ │ │ └── guillem-h-pongiluppi-palau-de-la-musica-catalana-barcelona-catalunya-guillemhp_2019-07-27_04-57-33.jpeg │ ├── 6e │ │ └── d261a7-2765-4b14-9d9b-32bd28571799 │ │ │ └── wadim-kashin-exotic1_2019-07-27_04-42-57.jpeg │ ├── 7a │ │ └── f39d03-3e47-402a-851f-4612e912c501 │ │ │ └── james-ross-mcnab-matte-final_2019-07-27_16-31-34.jpeg │ ├── 9e │ │ └── 52b037-c0a3-40ac-a10a-8ee2103864b1 │ │ │ └── 20200926_170934feiyang-wang-cats-shelter.jpg.jpeg │ ├── ab │ │ └── b03852-d40d-40ae-acf0-a772cded8d97 │ │ │ └── ned-rogers-forest-forestchoir-concept01-002_2019-07-27_14-07-36.jpeg │ ├── d4 │ │ └── b26468-99c5-4b42-8949-14cf7fb04e43 │ │ │ └── robert-berg-beauty2_2019-07-27_16-16-10.jpeg │ ├── ea │ │ └── 4a8cbb-f230-49ca-97f5-bcc9e65dc485 │ │ │ ├── tumblr_p7ikadfPzT1uzeyaxo3_1280.jpg │ │ │ └── wadim-kashin-halflife1_2019-07-27_08-18-11.jpeg │ ├── f1 │ │ └── 6cf808-6d36-4640-8356-778c4da416d2 │ │ │ └── 20200926_173359donglu-yu-cyberpunk-demo-lowres.jpg.jpeg │ ├── f6 │ │ └── 54c3b9-c22e-49c8-bc1c-79aeb2dc04db │ │ │ └── max-bedulenko-_2019-07-27_04-48-06.jpeg │ └── ff │ │ └── 23b42a-8b53-4bc4-bae2-34823573f154 │ │ └── 20200926_171057mike-paolilli-int-living-space-final.jpg.jpeg │ ├── .dir-locals.el │ ├── README.org │ ├── hugo.local │ ├── theme-readtheorg.setup │ ├── wallpaper.html │ └── wallpaper.org ├── gtrun └── default.nix ├── modules └── darwin-module-list.nix ├── nixos └── default.nix ├── profiles ├── alacritty │ └── default.nix ├── bin-scripts │ ├── clean-nix-store.nix │ ├── et.sh │ ├── lsyncd-rsync.nix │ └── test-emacs.sh ├── common-nixos │ └── default.nix ├── common │ └── default.nix ├── cursor │ └── default.nix ├── dircolors │ ├── LS_COLORS │ └── default.nix ├── direnv │ └── default.nix ├── doom-emacs │ ├── darwin │ │ └── default.nix │ └── nixos │ │ └── default.nix ├── dropbox │ └── default.nix ├── dunst │ └── default.nix ├── feh │ └── default.nix ├── fzf │ └── default.nix ├── git │ └── default.nix ├── gpg │ └── default.nix ├── home-packages │ ├── darwin │ │ └── default.nix │ └── nixos │ │ └── default.nix ├── link-home-file │ └── default.nix ├── lorri │ └── default.nix ├── lsd │ └── default.nix ├── misc │ └── default.nix ├── nushell │ └── default.nix ├── picom │ └── default.nix ├── randr │ ├── default.nix │ └── work.nix ├── starship │ ├── default.nix │ └── starship.toml ├── systemd │ └── default.nix ├── tmux │ └── default.nix ├── zoxide │ └── default.nix └── zsh │ ├── autoload.zsh │ ├── compinit-setopt.zsh │ ├── default.nix │ ├── init-bindkey.zsh │ └── zshrc.zsh └── root └── default.nix /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | end_of_line = lf 6 | insert_final_newline = true 7 | trim_trailing_whitespace = true 8 | charset = utf-8 9 | indent_style = space 10 | indent_size = 2 11 | 12 | # Ignore diffs/patches 13 | [*.{diff,patch}] 14 | end_of_line = unset 15 | insert_final_newline = unset 16 | trim_trailing_whitespace = unset 17 | indent_size = unset 18 | 19 | [{.*,secrets}/**] 20 | end_of_line = unset 21 | insert_final_newline = unset 22 | trim_trailing_whitespace = unset 23 | charset = unset 24 | indent_style = unset 25 | indent_size = unset 26 | 27 | [*.py] 28 | indent_size = 4 29 | 30 | [*.md] 31 | max_line_length = off 32 | trim_trailing_whitespace = false 33 | -------------------------------------------------------------------------------- /.envrc: -------------------------------------------------------------------------------- 1 | watch_file flake.nix flake.lock \ 2 | devshell/* 3 | { 4 | # shell gc root dir 5 | mkdir -p "$(direnv_layout_dir)" 6 | eval "$(nix print-dev-env --no-update-lock-file --no-write-lock-file --profile $(direnv_layout_dir)/flake-profile)" 7 | } || use nix 8 | -------------------------------------------------------------------------------- /.github/workflows/check.yml: -------------------------------------------------------------------------------- 1 | name: "CI" 2 | on: 3 | push: 4 | branches: 5 | - main 6 | jobs: 7 | check: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v2.4.0 11 | - uses: cachix/install-nix-action@v15 12 | with: 13 | install_url: 14 | https://github.com/numtide/nix-unstable-installer/releases/download/nix-2.8.0pre20220311_d532269/install 15 | extra_nix_config: | 16 | experimental-features = nix-command flakes 17 | system-features = nixos-test benchmark big-parallel kvm recursive-nix 18 | 19 | #- run: nix -Lv flake check 20 | - run: nix -Lv develop -c echo OK 21 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | result 2 | up 3 | hosts/up-* 4 | .direnv 5 | 6 | .DS_Store 7 | 8 | doc/index.html 9 | my-org 10 | my-code 11 | -------------------------------------------------------------------------------- /.sops.yaml: -------------------------------------------------------------------------------- 1 | keys: 2 | - &guangtao 6A43333DBD6C7C70B7A1DB59761C8EBEA940960E 3 | creation_rules: 4 | - path_regex: (secrets|secrets/keys/rootIdentityFile)/[^/]+\.(yaml|keytab)$ 5 | key_groups: 6 | - pgp: 7 | - *guangtao 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2022 GuangTao Zhang 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | #+title: Readme 2 | 3 | * Get your Template 4 | 5 | #+begin_src sh :async :exports both :results output 6 | nix flake init --template github:gtrunsec/nixos-flk#templates.devos 7 | #+end_src 8 | -------------------------------------------------------------------------------- /channels/darwin-nixpkgs.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: { 6 | imports = [(inputs.digga.lib.importOverlays ../overlays/nixos)]; 7 | overlays = [ 8 | ../pkgs/default.nix 9 | ( 10 | final: prev: { 11 | __dontExport = true; 12 | 13 | lib = prev.lib.extend ( 14 | lfinal: lprev: { 15 | installApp = import ../lib/installApp.nix prev; 16 | } 17 | ); 18 | 19 | inherit 20 | (inputs.darwin-emacs.packages.${prev.system}) 21 | emacs 22 | ; 23 | } 24 | ) 25 | inputs.rust-overlay.overlays.default 26 | ]; 27 | } 28 | -------------------------------------------------------------------------------- /channels/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | } @ args: { 5 | nixos = import ./nixos.nix args; 6 | nixos-latest = {}; 7 | nixos-unstable = {}; 8 | darwin-nixpkgs = import ./darwin-nixpkgs.nix args; 9 | } 10 | -------------------------------------------------------------------------------- /channels/nixos.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: { 6 | imports = [(inputs.digga.lib.importOverlays ../overlays/nixos)]; 7 | overlays = [ 8 | ../pkgs/default.nix 9 | ( 10 | final: prev: { 11 | __dontExport = true; 12 | alejandra = inputs.alejandra.defaultPackage."${prev.stdenv.hostPlatform.system}"; 13 | inherit 14 | (inputs.nixpkgs-hardenedlinux.packages."${prev.system}") 15 | brim 16 | feishu 17 | ; 18 | inherit 19 | (inputs.nil.packages."${prev.system}") 20 | nil 21 | ; 22 | # nixUnstable = inputs.nix.defaultPackage."${prev.stdenv.hostPlatform.system}"; 23 | } 24 | ) 25 | inputs.nur.overlay 26 | inputs.tenvideo.overlay 27 | inputs.rust-overlay.overlays.default 28 | inputs.sops-nix.overlay 29 | inputs.devos-ext-lib.overlay.vscode 30 | inputs.gomod2nix.overlays.default 31 | inputs.emacs-overlay.overlay 32 | ]; 33 | } 34 | -------------------------------------------------------------------------------- /darwin/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | } @ args: 6 | with inputs; { 7 | hostDefaults = import ./hostDefault.nix args; 8 | 9 | imports = [(digga.lib.importHosts ../hosts/darwin)]; 10 | 11 | hosts = import ./hosts.nix args; 12 | 13 | importables = import ./suites.nix args; 14 | } 15 | -------------------------------------------------------------------------------- /darwin/hostDefault.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | self, 4 | ... 5 | }: 6 | with inputs; { 7 | system = "x86_64-darwin"; 8 | channelName = "darwin-nixpkgs"; 9 | imports = [(digga.lib.importExportableModules ../modules/shared)]; 10 | modules = [ 11 | {lib.our = self.lib;} 12 | digga.darwinModules.nixConfig 13 | home.darwinModules.home-manager 14 | ragenix.nixosModules.age 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /darwin/hosts.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: {} 6 | -------------------------------------------------------------------------------- /darwin/suites.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: 6 | with inputs; rec { 7 | profiles = 8 | digga.lib.rakeLeaves ../profiles 9 | // { 10 | users = digga.lib.rakeLeaves ../users; 11 | core = digga.lib.rakeLeaves ../profiles/core; 12 | coding = digga.lib.rakeLeaves ../profiles/coding; 13 | }; 14 | suites = with profiles; rec { 15 | base = [core.darwin users.darwin]; 16 | MacBook = 17 | base 18 | ++ [ 19 | coding.rust 20 | coding.node 21 | coding.python 22 | ]; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /default.nix: -------------------------------------------------------------------------------- 1 | let 2 | inherit (default.inputs.nixos) lib; 3 | 4 | default = (import ./lib/compat).defaultNix; 5 | 6 | ciSystems = [ 7 | "aarch64-linux" 8 | "i686-linux" 9 | "x86_64-linux" 10 | ]; 11 | 12 | filterSystems = 13 | lib.filterAttrs 14 | (system: _: lib.elem system ciSystems); 15 | 16 | recurseIntoAttrsRecursive = lib.mapAttrs ( 17 | _: v: 18 | if lib.isAttrs v 19 | then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v) 20 | else v 21 | ); 22 | 23 | systemOutputs = 24 | lib.filterAttrs 25 | ( 26 | name: set: 27 | lib.isAttrs set 28 | && lib.any 29 | (system: set ? ${system} && name != "legacyPackages") 30 | ciSystems 31 | ) 32 | default.outputs; 33 | 34 | ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs; 35 | in 36 | (recurseIntoAttrsRecursive ciDrvs) // {shell = import ./shell.nix;} 37 | -------------------------------------------------------------------------------- /devshell/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: { 6 | modules = with inputs; []; 7 | exportedModules = [ 8 | ./devos.nix 9 | ./devshell.toml 10 | ./sops-shell.toml 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /devshell/devos.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | extraModulesPath, 5 | ... 6 | }: let 7 | hooks = import ./hooks; 8 | 9 | pkgWithCategory = category: package: {inherit package category;}; 10 | linter = pkgWithCategory "linter"; 11 | docs = pkgWithCategory "docs"; 12 | devos = pkgWithCategory "devos"; 13 | in { 14 | _file = toString ./.; 15 | 16 | imports = ["${extraModulesPath}/git/hooks.nix"]; 17 | git = {inherit hooks;}; 18 | 19 | packages = with pkgs; [ 20 | # formatters 21 | alejandra 22 | nodePackages.prettier 23 | nodePackages.prettier-plugin-toml 24 | shfmt 25 | ]; 26 | devshell.startup.nodejs-setuphook = 27 | lib.stringsWithDeps.noDepEntry 28 | '' 29 | export NODE_PATH=${pkgs.nodePackages.prettier-plugin-toml}/lib/node_modules:$NODE_PATH 30 | ''; 31 | commands = with pkgs; [ 32 | (devos nixUnstable) 33 | ]; 34 | } 35 | -------------------------------------------------------------------------------- /devshell/devshell.toml: -------------------------------------------------------------------------------- 1 | [devshell] 2 | packages = ["treefmt"] 3 | 4 | [[commands]] 5 | name = "darwin-MacBook" 6 | category = "nix-darwin" 7 | command = ''' 8 | darwin-rebuild $@ --flake $PRJ_ROOT/hosts/MacBook/#MacBook 9 | ''' 10 | help = "darwin-MacBook rebuild" 11 | 12 | [[commands]] 13 | name = "nvfetcher" 14 | category = "Update" 15 | command = "nix develop github:GTrunSec/cells-lab#devShells.x86_64-linux.update --command nvfetcher $@" 16 | help = "run nvfetcher" 17 | 18 | [[commands]] 19 | name = "nvfetcher-default" 20 | category = "Update" 21 | command = "nvfetcher -c $PRJ_ROOT/pkgs/sources.toml -o $PRJ_ROOT/pkgs/_sources/default" 22 | help = "run nvfetcher with local sources.toml" 23 | 24 | [[commands]] 25 | name = "nvfetcher-vscode" 26 | category = "Update" 27 | command = "nvfetcher -c $PRJ_ROOT/pkgs/sources-vscode.toml -o $PRJ_ROOT/pkgs/_sources/vscode" 28 | help = "run nvfetcher with local sources-vscode.toml" 29 | 30 | [[commands]] 31 | name = "nvfetcher-app" 32 | category = "Update" 33 | command = "nvfetcher -c $PRJ_ROOT/pkgs/sources-app.toml -o $PRJ_ROOT/pkgs/_sources/app" 34 | help = "Update nvfetcher app part" 35 | 36 | [[commands]] 37 | name = "update" 38 | category = "Update" 39 | command = "nix flake lock --update-input $@" 40 | help = "lock-update unstable" 41 | 42 | [[commands]] 43 | name = "rebuild" 44 | category = "devos" 45 | command = "sudo nixos-rebuild --flake .#NixOS switch $@" 46 | help = "rebuild current NixOS" 47 | # [[env]] 48 | # name = "GC_DONT_GC" #https://github.com/NixOS/nix/issues/4178 49 | # value = "1" 50 | -------------------------------------------------------------------------------- /devshell/hooks/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | enable = true; 3 | pre-commit.text = builtins.readFile ./pre-commit.sh; 4 | } 5 | -------------------------------------------------------------------------------- /devshell/hooks/pre-commit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if git rev-parse --verify HEAD >/dev/null 2>&1; then 4 | against=HEAD 5 | else 6 | # Initial commit: diff against an empty tree object 7 | against=$(${git}/bin/git hash-object -t tree /dev/null) 8 | fi 9 | 10 | diff="git diff-index --name-only --cached $against --diff-filter d" 11 | 12 | nix_files=($($diff -- '*.nix')) 13 | all_files=($($diff)) 14 | 15 | # Format staged nix files. 16 | if [[ -n ${nix_files[@]} ]]; then 17 | nixpkgs-fmt "${nix_files[@]}" && 18 | git add "${nix_files[@]}" 19 | fi 20 | -------------------------------------------------------------------------------- /devshell/sops-shell.toml: -------------------------------------------------------------------------------- 1 | [devshell] 2 | packages = ["sops-init-gpg-key", "ssh-to-pgp"] 3 | 4 | [[commands]] 5 | name = "sops" 6 | category = "secrets" 7 | command = "nix develop .#sops-shell --impure --command sops $@" 8 | help = "launch sops with sops-shell" 9 | 10 | [[commands]] 11 | name = "sops-new" 12 | category = "secrets" 13 | command = "sops-init-gpg-key --hostname $@ --gpghome /tmp/$@-sops-gpg-key &>> $@.asc" 14 | help = "sops-new | Generate a new gpg-key with sops-nix /tmp/-sops-gpg-key" 15 | 16 | [[commands]] 17 | name = "sops-copy" 18 | category = "secrets" 19 | command = "scp -r /tmp/$1-sops-gpg-key $2:/var/lib/sops" 20 | help = "sops-copy | Copy the host's GPG(sops-init-gpg-key) key to target host." 21 | 22 | [[commands]] 23 | name = "ssh-new-ed25519" 24 | category = "secrets" 25 | command = ''' 26 | ssh $@ 'ssh-keygen -o -a 256 -t ed25519 -C "$(hostname)-$(date +'%d-%m-%Y')"' 27 | ''' 28 | help = "ssh-new-ed25519 Generate a new SSH ed25519 key to target host" 29 | 30 | [[commands]] 31 | name = "copy-newHost" 32 | category = "" 33 | command = ''' 34 | scp -r $1:/etc/nixos/ hosts/$2 35 | ''' 36 | help = "copy-newHost " 37 | -------------------------------------------------------------------------------- /home/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: { 6 | imports = [(inputs.digga.lib.importExportableModules ../users/modules)]; 7 | 8 | modules = []; 9 | 10 | importables = with inputs; rec { 11 | profiles = 12 | digga.lib.rakeLeaves ../users/profiles 13 | // { 14 | doom-emacs = digga.lib.rakeLeaves ../users/profiles/doom-emacs; 15 | home-packages = digga.lib.rakeLeaves ../users/profiles/home-packages; 16 | }; 17 | 18 | suites = with profiles; rec { 19 | base = [common direnv git gpg alacritty shellProfile link-home-file]; 20 | 21 | shellProfile = [zsh zoxide fzf starship dircolors direnv tmux lsd]; 22 | 23 | graphicalProfile = [cursor randr feh picom]; 24 | 25 | serviceProfile = [lorri dunst dropbox systemd]; 26 | 27 | gtrun = [graphicalProfile serviceProfile doom-emacs.nixos home-packages.nixos] ++ base; 28 | 29 | darwinProfile = [doom-emacs.darwin]; 30 | 31 | darwin = [base shellProfile home-packages.darwin darwinProfile]; 32 | }; 33 | }; 34 | users = { 35 | gtrun = {suites, ...}: {imports = suites.gtrun;}; 36 | darwin = {suites, ...}: {imports = suites.darwin;}; 37 | nixos = {suites, ...}: {imports = suites.base;}; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /hosts/darwin/MacBook/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | suites, 5 | ... 6 | }: { 7 | imorts = suites.MacBook; 8 | 9 | system.build.applications = pkgs.lib.mkForce ( 10 | pkgs.buildEnv { 11 | name = "applications"; 12 | paths = config.environment.systemPackages ++ config.home-manager.users."gtrun".home.packages; 13 | pathsToLink = "/Applications"; 14 | } 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /hosts/nixos/NixOS/NixOS-hardware-configuration.nix: -------------------------------------------------------------------------------- 1 | # Do not modify this file! It was generated by ‘nixos-generate-config’ 2 | # and may be overwritten by future invocations. Please make changes 3 | # to /etc/nixos/configuration.nix instead. 4 | { 5 | config, 6 | lib, 7 | pkgs, 8 | ... 9 | }: { 10 | boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "usb_storage" "usbhid" "sd_mod"]; 11 | boot.initrd.kernelModules = []; 12 | boot.extraModulePackages = []; 13 | 14 | fileSystems."/boot" = { 15 | device = "/dev/disk/by-uuid/CF48-6C3C"; 16 | fsType = "vfat"; 17 | }; 18 | 19 | fileSystems."/" = { 20 | device = "/dev/disk/by-uuid/a8b91326-9a5f-47c9-b827-19e1ce17cfe8"; 21 | fsType = "xfs"; 22 | }; 23 | ##sudo blkid 24 | fileSystems."/SSD-1TB" = { 25 | device = "/dev/disk/by-uuid/ae748e00-3013-4c27-8824-a1d36631cf34"; 26 | options = ["x-systemd.automount"]; 27 | fsType = "xfs"; 28 | }; 29 | 30 | swapDevices = [{device = "/dev/disk/by-uuid/d05ef9fb-1433-4819-b1a7-e15b5a7b9a90";}]; 31 | 32 | fileSystems."/DATABASE-4TB" = { 33 | device = "/dev/disk/by-uuid/749df476-c355-469a-9d00-4565a07901bf"; 34 | options = ["x-systemd.automount"]; 35 | fsType = "xfs"; 36 | }; 37 | 38 | powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; 39 | } 40 | -------------------------------------------------------------------------------- /hosts/nixos/NixOS/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | suites, 3 | pkgs, 4 | ... 5 | }: { 6 | ### root password is empty by default ### 7 | imports = 8 | suites.nixos 9 | ++ [ 10 | ./NixOS-hardware-configuration.nix 11 | ]; 12 | 13 | boot.loader.systemd-boot.enable = true; 14 | boot.loader.efi.canTouchEfiVariables = true; 15 | 16 | system.stateVersion = "22.05"; 17 | 18 | ## ssd 19 | services.fstrim.enable = true; 20 | 21 | i18n.defaultLocale = "en_US.UTF-8"; 22 | time.timeZone = "America/Los_Angeles"; 23 | 24 | # sudo cp -r ~/.gnupg /var/lib/sops 25 | sops.gnupg.home = "/home/gtrun/.gnupg"; 26 | 27 | networking.firewall = { 28 | allowedTCPPorts = [8888 8889]; 29 | allowedUDPPorts = [8888 8889]; 30 | }; 31 | 32 | networking.nat.enable = true; 33 | 34 | networking.firewall.extraCommands = '' 35 | # iptables -t nat -A PREROUTING -i eno1 -p tcp --dport 443 -j REDIRECT --to-port 8080 36 | # iptables -t nat -A PREROUTING -i eno1 -p tcp --dport 80 -j REDIRECT --to-port 8080 37 | ''; 38 | 39 | i18n = { 40 | inputMethod = { 41 | enabled = "fcitx5"; 42 | fcitx.engines = with pkgs.fcitx-engines; [cloudpinyin rime]; 43 | fcitx5.addons = with pkgs; [ 44 | fcitx5-chinese-addons 45 | fcitx5-rime 46 | ]; 47 | }; 48 | }; 49 | } 50 | -------------------------------------------------------------------------------- /lib/compat/default.nix: -------------------------------------------------------------------------------- 1 | let 2 | lock = builtins.fromJSON (builtins.readFile ../../flake.lock); 3 | flake = ( 4 | import 5 | ( 6 | fetchTarball { 7 | url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; 8 | sha256 = lock.nodes.flake-compat.locked.narHash; 9 | } 10 | ) 11 | { 12 | src = ../../.; 13 | } 14 | ); 15 | in 16 | flake 17 | -------------------------------------------------------------------------------- /lib/compat/nixos/default.nix: -------------------------------------------------------------------------------- 1 | {...}: let 2 | inherit (default.inputs.nixpkgs) lib; 3 | 4 | host = configs.${hostname} or configs.NixOS; 5 | configs = default.nixosConfigurations; 6 | default = (import ../.).defaultNix; 7 | hostname = lib.fileContents /etc/hostname; 8 | in 9 | host 10 | -------------------------------------------------------------------------------- /lib/default.nix: -------------------------------------------------------------------------------- 1 | {lib}: 2 | lib.makeExtensible ( 3 | self: { 4 | hosts = import ./hosts {inherit lib;}; 5 | overlayNullProtector = import ./overlay-null-protector.nix; 6 | } 7 | ) 8 | -------------------------------------------------------------------------------- /lib/hosts/default.nix: -------------------------------------------------------------------------------- 1 | {lib}: {} 2 | -------------------------------------------------------------------------------- /lib/installApp.nix: -------------------------------------------------------------------------------- 1 | #credit: https://github.com/akoppela/.dotfiles/blob/95fc955a2f05390481bf56b01f2ebddae826a786/nix/overlay/apps.nix 2 | { 3 | stdenv, 4 | lib, 5 | fetchurl, 6 | undmg, 7 | ... 8 | }: { 9 | pname, 10 | version, 11 | src, 12 | postInstall ? "", 13 | sourceRoot ? ".", 14 | extraBuildInputs ? [], 15 | ... 16 | }: 17 | stdenv.mkDerivation 18 | { 19 | inherit src pname version; 20 | 21 | buildInputs = [undmg] ++ extraBuildInputs; 22 | 23 | sourceRoot = sourceRoot; 24 | 25 | phases = [ 26 | "unpackPhase" 27 | "installPhase" 28 | ]; 29 | 30 | installPhase = let 31 | appname = lib.removeSuffix "-darwin" pname; 32 | in 33 | '' 34 | runHook preInstall 35 | 36 | mkdir -p "$out/Applications" 37 | cp -r "${appname}.app" "$out/Applications/${appname}.app" 38 | '' 39 | + postInstall; 40 | 41 | meta = { 42 | platforms = lib.platforms.darwin; 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /modules/nixos/resources/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: let 7 | DirNames = builtins.attrNames (builtins.readDir ./hosts); 8 | machine = 9 | ( 10 | {} 11 | // ( 12 | builtins.listToAttrs 13 | ( 14 | map 15 | ( 16 | pkgDir: { 17 | value = lib.importTOML (./hosts + "/${pkgDir}"); 18 | name = lib.removeSuffix ".toml" pkgDir; 19 | } 20 | ) 21 | DirNames 22 | ) 23 | ) 24 | ) 25 | ."${config.networking.hostName}"; 26 | in { 27 | options = with lib; { 28 | machine = mkOption { 29 | default = machine; 30 | description = "hosts resource info"; 31 | }; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /modules/nixos/resources/hosts/NixOS.toml: -------------------------------------------------------------------------------- 1 | [common] 2 | user = "gtrun" 3 | ip = "10.220.170.112" 4 | 5 | [services.syncthing] 6 | port = "8384" 7 | -------------------------------------------------------------------------------- /modules/shared/hm-system-defaults.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: { 6 | home-manager.sharedModules = [ 7 | { 8 | home.sessionVariables = { 9 | # environment.sessionVariables is not currently available in nix-darwin 10 | NIX_PATH = 11 | config.environment.sessionVariables.NIX_PATH 12 | or config.environment.variables.NIX_PATH; 13 | }; 14 | xdg.configFile."nix/registry.json".text = 15 | config.environment.etc."nix/registry.json".text; 16 | } 17 | ]; 18 | } 19 | -------------------------------------------------------------------------------- /modules/shared/nix-path.nix: -------------------------------------------------------------------------------- 1 | { 2 | channel, 3 | inputs, 4 | ... 5 | }: { 6 | nix.nixPath = [ 7 | "nixpkgs=${channel.input}" 8 | "nixos-config=${../../lib/compat/nixos}" 9 | "home-manager=${inputs.home}" 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /nixos/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | } @ args: 6 | with inputs; { 7 | hostDefaults = import ./hostDefault.nix args; 8 | 9 | imports = [(digga.lib.importHosts ../hosts/nixos)]; 10 | 11 | hosts = import ./hosts.nix args; 12 | 13 | importables = import ./suites.nix args; 14 | } 15 | -------------------------------------------------------------------------------- /nixos/hostDefault.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | self, 4 | ... 5 | }: 6 | with inputs; { 7 | system = "x86_64-linux"; 8 | channelName = "nixos"; 9 | imports = [ 10 | (digga.lib.importExportableModules ../modules/shared) 11 | (digga.lib.importExportableModules ../modules/nixos) 12 | ]; 13 | modules = [ 14 | {lib.our = self.lib;} 15 | digga.nixosModules.bootstrapIso 16 | home.nixosModules.home-manager 17 | sops-nix.nixosModules.sops 18 | qnr.nixosModules.local-registry 19 | #User's custom modules 20 | photoprism2nix.nixosModules.photoprism 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /nixos/hosts.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: { 6 | NixOS = {}; 7 | } 8 | -------------------------------------------------------------------------------- /overlays/nixos/adguardhome.nix: -------------------------------------------------------------------------------- 1 | final: prev: { 2 | adguardhome = prev.adguardhome.overrideAttrs ( 3 | o: { 4 | inherit (prev.sources.adguardhome) pname version src; 5 | } 6 | ); 7 | } 8 | #// prev.lib.optionalAttrs true {} 9 | 10 | -------------------------------------------------------------------------------- /overlays/nixos/apps.nix: -------------------------------------------------------------------------------- 1 | final: prev: 2 | with final.lib; { 3 | logseq-darwin = installApp rec { 4 | inherit (final.sources.logseq-darwin) pname version src; 5 | }; 6 | polar-darwin = installApp rec { 7 | inherit (final.sources.polar-darwin) pname version src; 8 | }; 9 | kitty-darwin = installApp rec { 10 | inherit (final.sources.kitty-darwin) pname version src; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /overlays/nixos/drawio-desktop.nix: -------------------------------------------------------------------------------- 1 | final: prev: { 2 | drawio = prev.drawio.overrideAttrs ( 3 | o: rec { 4 | inherit (prev.sources.drawio) pname version src; 5 | } 6 | ); 7 | } 8 | -------------------------------------------------------------------------------- /overlays/nixos/my-node-packages.nix: -------------------------------------------------------------------------------- 1 | final: prev: let 2 | packages = prev.callPackage ../../pkgs/my-node-packages/plugins.nix {}; 3 | in { 4 | nodePackages = 5 | prev.nodePackages 6 | // packages 7 | // { 8 | # https://github.com/NixOS/nixpkgs/issues/60057#issuecomment-505781308 9 | mermaid-cli = packages."@mermaid-js/mermaid-cli".overrideAttrs ( 10 | oldAttrs: { 11 | nativeBuildInputs = 12 | (oldAttrs.nativeBuildInputs or []) 13 | ++ [prev.makeWrapper prev.which]; 14 | 15 | PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = 1; 16 | 17 | nixpkgsChromePuppeteerConfig = prev.writeText "puppeteerConfig.json" '' 18 | { "executablePath": "${prev.chromium}/bin/chromium" } 19 | ''; 20 | 21 | postInstall = 22 | (oldAttrs.postInstall or "") 23 | + '' 24 | wrapProgram $out/bin/mmdc --add-flags "-p $nixpkgsChromePuppeteerConfig" 25 | ''; 26 | } 27 | ); 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /overlays/nixos/nix.nix: -------------------------------------------------------------------------------- 1 | final: prev: { 2 | # nix-dram = prev.nix-dram.overrideAttrs (old: { 3 | # patches = (old.patches or [ ]) ++ [ 4 | # (prev.fetchpatch { 5 | # name = "fix-follows.diff"; 6 | # url = "https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/4641.patch"; 7 | # sha256 = "sha256-nyLMSltS9XjNaF446M5yV/o08XtZkYbU7yMVnqYERts="; 8 | # }) 9 | # ]; 10 | # }); 11 | # nixUnstable = prev.nixUnstable.overrideAttrs (o: rec{ 12 | # patches = (o.patches or [ ]) ++ [ 13 | # (prev.fetchpatch { 14 | # name = "fix-follows.diff"; 15 | # url = "https://patch-diff.githubusercontent.com/raw/NixOS/nix/pull/4641.patch"; 16 | # sha256 = "sha256-0xNgbyWFmD3UIHPNFrgKiSejGJfuVj1OjqbS1ReLJRc="; 17 | # }) 18 | # ]; 19 | # }); 20 | } 21 | -------------------------------------------------------------------------------- /overlays/nixos/overrides.nix: -------------------------------------------------------------------------------- 1 | channels: final: prev: { 2 | __dontExport = true; 3 | # overrides clutter up actual creations 4 | inherit 5 | (channels.nixos-latest) 6 | cachix 7 | dhall 8 | discord 9 | #element-desktop 10 | 11 | _1password-gui 12 | _1password 13 | manix 14 | nix-direnv 15 | nixUnstable 16 | direnv 17 | tree-sitter 18 | starship 19 | treefmt 20 | appimage-run 21 | zoom-us 22 | qt6 23 | ; 24 | 25 | inherit 26 | (channels.nixos-unstable) 27 | brave 28 | rnix-lsp 29 | signal-desktop 30 | tdesktop 31 | alacritty 32 | onlyoffice-bin 33 | i3-gaps 34 | tmux 35 | julia_18-bin 36 | texmacs 37 | podman 38 | ; 39 | 40 | nixos-rebuild = prev.nixos-rebuild.override { 41 | nix = channels.nixos-latest.nixUnstable; 42 | }; 43 | 44 | haskellPackages = 45 | prev.haskellPackages.override 46 | ( 47 | old: { 48 | overrides = prev.lib.composeExtensions (old.overrides or (_: _: {})) (hfinal: hprev: let 49 | version = prev.lib.replaceChars ["."] [""] prev.ghc.version; 50 | in { 51 | # same for haskell packages, matching ghc versions 52 | inherit 53 | (channels.nixos-unstable.haskell.packages."ghc${version}") 54 | ; 55 | }); 56 | } 57 | ); 58 | 59 | # python3 = 60 | # prev.python3.override 61 | # ( 62 | # old: { 63 | # packageOverrides = prev.lib.composeExtensions (old.packageOverrides or (_: _: {})) (selfPythonPackages: pythonPackages: let 64 | # in { 65 | # pyqt6 = channels.nixos-unstable.python39Packages.pyqt6; 66 | # pyqt6-webengine = channels.nixos-unstable.python39Packages.pyqt6-webengine; 67 | # }); 68 | # } 69 | # ); 70 | python3Override = channels.nixos-unstable.python3; 71 | } 72 | -------------------------------------------------------------------------------- /overlays/nixos/polar-bookshelf.nix: -------------------------------------------------------------------------------- 1 | final: prev: { 2 | polar-bookshelf = prev.polar-bookshelf.overrideAttrs ( 3 | o: rec { 4 | inherit (prev.sources.polar-bookshelf) pname version src; 5 | buildInputs = 6 | (o.buildInputs or []) 7 | ++ ( 8 | with prev; [ 9 | libdrm 10 | mesa 11 | ] 12 | ); 13 | } 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /overlays/nixos/python-mkdocs-deps.nix: -------------------------------------------------------------------------------- 1 | final: prev: { 2 | # python-packages-mkdocs = prev.machlib.mkPython rec { 3 | # ignoreDataOutdated = true; 4 | # requirements = '' 5 | # mkdocs-material 6 | # mkdocs-awesome-pages-plugin 7 | # setuptools 8 | # ''; 9 | # }; 10 | } 11 | -------------------------------------------------------------------------------- /overlays/shared/default.nix: -------------------------------------------------------------------------------- 1 | {self, ...}: [ 2 | (final: prev: { 3 | __dontExport = true; 4 | lib = prev.lib.extend ( 5 | lfinal: lprev: { 6 | our = self.lib; 7 | installApp = import ../../lib/installApp.nix prev; 8 | } 9 | ); 10 | nix = final.nixUnstable; 11 | }) 12 | ] 13 | -------------------------------------------------------------------------------- /pkgs/_sources/app/generated.json: -------------------------------------------------------------------------------- 1 | { 2 | "kitty-darwin": { 3 | "cargoLocks": null, 4 | "date": null, 5 | "extract": null, 6 | "name": "kitty-darwin", 7 | "passthru": null, 8 | "pinned": false, 9 | "src": { 10 | "name": null, 11 | "sha256": "sha256-slgdXB8I1cZxjcSFDM/DA1RYjdkPeoG8RsVDacxyXVA=", 12 | "type": "url", 13 | "url": "https://github.com/kovidgoyal/kitty/releases/download/v0.26.3/kitty-0.26.3.dmg" 14 | }, 15 | "version": "0.26.3" 16 | }, 17 | "logseq": { 18 | "cargoLocks": null, 19 | "date": null, 20 | "extract": null, 21 | "name": "logseq", 22 | "passthru": null, 23 | "pinned": false, 24 | "src": { 25 | "name": null, 26 | "sha256": "sha256-0RVGTANlnzULusQPZ14+a6G5mK1ezDC9VfWWdNqNcs4=", 27 | "type": "url", 28 | "url": "https://github.com/logseq/logseq/releases/download/0.8.8/logseq-linux-x64-0.8.8.AppImage" 29 | }, 30 | "version": "0.8.8" 31 | }, 32 | "logseq-darwin": { 33 | "cargoLocks": null, 34 | "date": null, 35 | "extract": null, 36 | "name": "logseq-darwin", 37 | "passthru": null, 38 | "pinned": false, 39 | "src": { 40 | "name": null, 41 | "sha256": "sha256-kOno88J92QTh8t6p7SWCwW6QR5V7ki+gSyAeRqj9zbg=", 42 | "type": "url", 43 | "url": "https://github.com/logseq/logseq/releases/download/0.8.8/logseq-darwin-x64-0.8.8.dmg" 44 | }, 45 | "version": "0.8.8" 46 | } 47 | } -------------------------------------------------------------------------------- /pkgs/_sources/app/generated.nix: -------------------------------------------------------------------------------- 1 | # This file was generated by nvfetcher, please do not modify it manually. 2 | { fetchgit, fetchurl, fetchFromGitHub }: 3 | { 4 | kitty-darwin = { 5 | pname = "kitty-darwin"; 6 | version = "0.26.3"; 7 | src = fetchurl { 8 | url = "https://github.com/kovidgoyal/kitty/releases/download/v0.26.3/kitty-0.26.3.dmg"; 9 | sha256 = "sha256-slgdXB8I1cZxjcSFDM/DA1RYjdkPeoG8RsVDacxyXVA="; 10 | }; 11 | }; 12 | logseq = { 13 | pname = "logseq"; 14 | version = "0.8.8"; 15 | src = fetchurl { 16 | url = "https://github.com/logseq/logseq/releases/download/0.8.8/logseq-linux-x64-0.8.8.AppImage"; 17 | sha256 = "sha256-0RVGTANlnzULusQPZ14+a6G5mK1ezDC9VfWWdNqNcs4="; 18 | }; 19 | }; 20 | logseq-darwin = { 21 | pname = "logseq-darwin"; 22 | version = "0.8.8"; 23 | src = fetchurl { 24 | url = "https://github.com/logseq/logseq/releases/download/0.8.8/logseq-darwin-x64-0.8.8.dmg"; 25 | sha256 = "sha256-kOno88J92QTh8t6p7SWCwW6QR5V7ki+gSyAeRqj9zbg="; 26 | }; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /pkgs/appimage/Motrix.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | sources, 4 | ... 5 | }: 6 | with pkgs; 7 | with (import ./build-appimage.nix {inherit pkgs;}); 8 | buildAppImage { 9 | inherit (sources.motrix) pname src version; 10 | icon = fetchurl { 11 | url = https://raw.githubusercontent.com/agalwood/Motrix/master/static/512x512.png; 12 | sha256 = "sha256-aGBccae981kL3tpfQx4oVXlPNdLRKM6iNGqjY6yAt4Q="; 13 | }; 14 | categories = "download manager"; 15 | } 16 | -------------------------------------------------------------------------------- /pkgs/appimage/build-appimage.nix: -------------------------------------------------------------------------------- 1 | {pkgs}: { 2 | #{ fetchurl, runCommand }: { 3 | buildAppImage = { 4 | pname, 5 | src, 6 | version, 7 | icon, 8 | categories, 9 | }: let 10 | image = 11 | src 12 | // { 13 | executable = true; 14 | }; 15 | in 16 | pkgs.runCommand pname {} '' 17 | binDir="$out/bin" 18 | mkdir -p $binDir 19 | cat > ''${binDir}/${pname} < $out/share/applications/${pname}.desktop < { 5 | inherit system; 6 | }, 7 | system ? builtins.currentSystem, 8 | nodejs ? pkgs."nodejs-10_x", 9 | }: let 10 | nodeEnv = import ./node-env.nix { 11 | inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript; 12 | inherit pkgs nodejs; 13 | libtool = 14 | if pkgs.stdenv.isDarwin 15 | then pkgs.darwin.cctools 16 | else null; 17 | }; 18 | in 19 | import ./node-packages.nix { 20 | inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit; 21 | inherit nodeEnv; 22 | } 23 | -------------------------------------------------------------------------------- /pkgs/my-node-packages/upgrade.sh: -------------------------------------------------------------------------------- 1 | # /bin/sh 2 | # run inside nix-shell -p nodePackages.node2nix 3 | 4 | cmd="node2nix -10 -i packages.json -c plugins.nix" 5 | 6 | if ! type "node2nix" &>/dev/null; then 7 | nix-shell -p nodePackages.node2nix --run "$cmd" 8 | else 9 | $cmd 10 | fi 11 | -------------------------------------------------------------------------------- /pkgs/output-builder/default.nix: -------------------------------------------------------------------------------- 1 | channels: inputs: { 2 | packages = { 3 | #nix develop .#sops-shell --impure 4 | sops-shell = with channels.nixos; 5 | mkShell { 6 | sopsPGPKeyDirs = [ 7 | #"./secrets/keys/hosts" 8 | "./secrets/keys/users" 9 | ]; 10 | nativeBuildInputs = [sops-import-keys-hook]; 11 | }; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /pkgs/packages/StevenBlack-hosts/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | sources, 5 | ... 6 | }: 7 | with pkgs; 8 | with lib; let 9 | whitelist = concatStringsSep "|" [".*pirate(bay|proxy).*"]; 10 | 11 | blacklist = 12 | concatStringsSep '' 13 | 0.0.0.0 '' 14 | [ 15 | "# auto-generated: must be first" 16 | 17 | # starts here 18 | ]; 19 | in 20 | stdenv.mkDerivation 21 | { 22 | inherit (sources.StevenBlack-hosts) src pname version; 23 | 24 | nativeBuildInputs = [gnugrep]; 25 | 26 | installPhase = '' 27 | mkdir -p $out/etc 28 | 29 | # filter whitelist 30 | grep -Ev '(${whitelist})' hosts > $out/etc/hosts 31 | 32 | # filter blacklist 33 | cat << EOF >> $out/etc/hosts 34 | ${blacklist} 35 | EOF 36 | ''; 37 | } 38 | -------------------------------------------------------------------------------- /pkgs/packages/notdeft/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | sources, 3 | stdenv, 4 | lib, 5 | fetchgit, 6 | xapian, 7 | emacs, 8 | tclap, 9 | pkg-config, 10 | }: 11 | stdenv.mkDerivation rec { 12 | inherit (sources.notdeft) pname src version; 13 | 14 | nativeBuildInputs = [xapian emacs tclap pkg-config]; 15 | 16 | phases = ["installPhase"]; 17 | 18 | installPhase = '' 19 | mkdir -p $out/bin 20 | cd $src/xapian 21 | c++ -o $out/bin/notdeft-xapian notdeft-xapian.cc -std=c++11 -Wall `pkg-config --cflags --libs tclap` `xapian-config --cxxflags --libs` 22 | ''; 23 | 24 | enableParallelBuilding = true; 25 | 26 | meta = with lib; { 27 | description = "NotDeft note manager for Emacs"; 28 | homepage = https://github.com/hasu/notdeft; 29 | license = licenses.bsd3; 30 | platforms = with platforms; all; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /pkgs/python/HPI/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | python3Packages, 4 | fetchurl, 5 | sources, 6 | }: 7 | with python3Packages; 8 | python3Packages.buildPythonPackage rec { 9 | inherit (sources.HPI) pname version src; 10 | 11 | propagatedBuildInputs = with python3Packages; [ 12 | pandas 13 | appdirs 14 | more-itertools 15 | mypy 16 | decorator 17 | setuptools_scm 18 | click 19 | ]; 20 | 21 | makeWrapperArgs = ["--prefix PYTHONPATH : $PYTHONPATH"]; 22 | 23 | doCheck = false; 24 | 25 | meta = with lib; { 26 | description = "Human Programming Interface 🧑👽🤖"; 27 | homepage = "https://github.com/karlicoss/HPI"; 28 | license = licenses.asl20; 29 | maintainers = with maintainers; [gtrunsec]; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /pkgs/python/orgparse/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | python3Packages, 4 | fetchurl, 5 | sources, 6 | }: 7 | with python3Packages; 8 | python3Packages.buildPythonPackage rec { 9 | inherit (sources.orgparse) pname version src; 10 | 11 | propagatedBuildInputs = with python3Packages; [ 12 | setuptools_scm 13 | ]; 14 | 15 | doCheck = false; 16 | 17 | meta = with lib; { 18 | description = "Python module for reading Emacs org-mode files"; 19 | homepage = "https://github.com/karlicoss/orgparse"; 20 | license = licenses.asl20; 21 | maintainers = with maintainers; [gtrunsec]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /pkgs/rust/sudo_pair/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | fetchurl, 4 | rustPlatform, 5 | }: 6 | rustPlatform.buildRustPackage rec { 7 | pname = "sudo-pair"; 8 | version = "master"; 9 | src = fetchurl { 10 | url = "https://github.com/square/sudo_pair/archive/5b572ff19468c807148c77f7d9e052acbd7569d1.tar.gz"; 11 | sha256 = "sha256-of51E6SZtalsoZ8yeNul/L8gNyHmI0ZM88Q0WttzUe8="; 12 | }; 13 | 14 | cargoPatches = [ 15 | ./add-Cargo.lock.patch 16 | ]; 17 | 18 | cargoSha256 = "sha256-tw0biqDMElEeYH9u+w63QtP4T+27Iqt6xhRJj7U+5ms="; 19 | 20 | meta = with lib; { 21 | homepage = "https://github.com/square/sudo_pair/"; 22 | description = "Plugin for sudo that requires another human to approve and monitor privileged sudo sessions"; 23 | license = licenses.gpl3; 24 | maintainers = [maintainers.gtrunsec]; 25 | platforms = platforms.linux; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /pkgs/sources-app.toml: -------------------------------------------------------------------------------- 1 | [logseq-darwin] 2 | src.github = "logseq/logseq" 3 | #src.manual = "0.5.4" 4 | fetch.url = "https://github.com/logseq/logseq/releases/download/$ver/logseq-darwin-x64-$ver.dmg" 5 | 6 | [logseq] 7 | src.github = "logseq/logseq" 8 | # src.manual = "0.5.4" 9 | fetch.url = "https://github.com/logseq/logseq/releases/download/$ver/logseq-linux-x64-$ver.AppImage" 10 | 11 | [kitty-darwin] 12 | src.github = "kovidgoyal/kitty" 13 | src.prefix = "v" 14 | fetch.url = "https://github.com/kovidgoyal/kitty/releases/download/v$ver/kitty-$ver.dmg" 15 | -------------------------------------------------------------------------------- /pkgs/sources.toml: -------------------------------------------------------------------------------- 1 | # nvfetcher.toml 2 | [StevenBlack-hosts] 3 | src.git = "https://github.com/StevenBlack/hosts" 4 | fetch.github = "StevenBlack/hosts" 5 | 6 | [polar-darwin] 7 | src.github = "burtonator/polar-bookshelf" 8 | fetch.url = "https://github.com/burtonator/polar-bookshelf/releases/download/v$ver/Polar-$ver.dmg" 9 | src.prefix = "v" 10 | 11 | [drawio] 12 | src.github = "jgraph/drawio-desktop" 13 | fetch.url = "https://github.com/jgraph/drawio-desktop/releases/download/v$ver/drawio-x86_64-$ver.rpm" 14 | src.prefix = "v" 15 | 16 | [chord] 17 | src.manual = "0.2.38" 18 | fetch.url = "https://github.com/PeterDing/chord/releases/download/v$ver/chord-$ver-linux-x86_64.AppImage" 19 | 20 | [magnetw] 21 | src.github = "xiandanin/magnetW" 22 | fetch.url = "https://github.com/xiandanin/magnetW/releases/download/$ver/magnetw-$ver-linux.AppImage" 23 | 24 | [motrix] 25 | src.github = "agalwood/Motrix" 26 | fetch.url = "https://github.com/agalwood/Motrix/releases/download/v$ver/Motrix-$ver.AppImage" 27 | src.prefix = "v" 28 | 29 | [polar-bookshelf] 30 | src.github = "burtonator/polar-bookshelf" 31 | fetch.url = "https://github.com/burtonator/polar-bookshelf/releases/download/v$ver/polar-desktop-app-$ver-amd64.deb" 32 | src.prefix = "v" 33 | 34 | [adguardhome] 35 | src.github = "AdguardTeam/AdGuardHome" 36 | fetch.url = "https://github.com/AdguardTeam/AdGuardHome/releases/download/$ver/AdGuardHome_linux_amd64.tar.gz" 37 | 38 | [notdeft] 39 | src.git = "https://github.com/hasu/notdeft" 40 | fetch.github = "hasu/notdeft" 41 | 42 | [spaceship-prompt] 43 | src.git = "https://github.com/spaceship-prompt/spaceship-prompt" 44 | fetch.github = "spaceship-prompt/spaceship-prompt" 45 | 46 | [promnesia] 47 | src.git = "https://github.com/karlicoss/promnesia" 48 | fetch.github = "karlicoss/promnesia" 49 | 50 | [picom] 51 | src.git = "https://github.com/yshui/picom" 52 | fetch.github = "yshui/picom" 53 | 54 | [HPI] 55 | src.pypi = "HPI" 56 | fetch.pypi = "HPI" 57 | 58 | [hug] 59 | src.pypi = "hug" 60 | fetch.pypi = "hug" 61 | 62 | [orgparse] 63 | src.pypi = "orgparse" 64 | fetch.pypi = "orgparse" 65 | -------------------------------------------------------------------------------- /profiles/application/base/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; [ 3 | #notice 4 | dunst 5 | #browwser 6 | brave 7 | 8 | #book 9 | # polar-bookshelf 10 | foliate 11 | # elementary-planner 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /profiles/application/chat/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; [ 3 | discord 4 | element-desktop 5 | signal-desktop 6 | slack 7 | # fcitx does not work 8 | # kotatogram-desktop 9 | tdesktop 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /profiles/application/misc/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | imports = [./mpd.nix ./photoprism.nix ./image.nix]; 3 | 4 | environment.systemPackages = with pkgs; [ 5 | goldendict 6 | flameshot 7 | du-dust 8 | # graph 9 | drawio 10 | #downloader 11 | magnetw 12 | got 13 | aria2 14 | # motrix 15 | #VPN 16 | shadowsocks-libev 17 | # manager password 18 | gopass 19 | _1password-gui 20 | _1password 21 | #media 22 | vlc 23 | #plex-media-player 24 | youtube-dl 25 | cmus 26 | mpc_cli 27 | chord 28 | #image 29 | pqiv 30 | digikam 31 | phototonic 32 | photoqt 33 | #tools 34 | tree 35 | desktop-file-utils 36 | # TMSU lets you tags your files and then access them through a nifty virtual filesystem from any other application. 37 | tmsu 38 | nuclear 39 | #ytmdesktop 40 | gitAndTools.delta 41 | ## 42 | sshfs 43 | zotero 44 | # export permission issue 45 | ( 46 | pkgs.writeShellScriptBin "logseq-run" '' 47 | export XDG_DATA_DIRS=${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}:$XDG_DATA_DIRS 48 | ${pkgs.appimage-run}/bin/appimage-run ${pkgs.sources.logseq.src} 49 | '' 50 | ) 51 | xclip 52 | screenfetch 53 | urxvt_perls 54 | #disk 55 | duf 56 | #office 57 | #video 58 | tenvideo 59 | zoom-us 60 | jitsi-meet-electron 61 | # feishu 62 | #git workflow manager 63 | gst 64 | ghq 65 | peco 66 | 67 | # pdf reader 68 | okular 69 | onlyoffice-bin 70 | ]; 71 | } 72 | -------------------------------------------------------------------------------- /profiles/application/misc/image.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; [ 3 | imgcat 4 | gimp 5 | screenfetch 6 | exa 7 | spectacle 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /profiles/application/misc/mpd.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | services.mpd.enable = true; 3 | } 4 | -------------------------------------------------------------------------------- /profiles/application/misc/photoprism.nix: -------------------------------------------------------------------------------- 1 | {config, ...}: { 2 | networking.firewall = { 3 | allowedTCPPorts = [2344]; 4 | allowedUDPPorts = [2344]; 5 | }; 6 | 7 | services.photoprism = { 8 | enable = true; 9 | port = 2344; 10 | host = "10.220.170.112"; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /profiles/cachix/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | ... 5 | }: let 6 | folder = ./.; 7 | toImport = name: value: folder + ("/" + name); 8 | filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix"; 9 | imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); 10 | in { 11 | inherit imports; 12 | nix.binaryCaches = ["https://cache.nixos.org/"]; 13 | } 14 | -------------------------------------------------------------------------------- /profiles/cachix/emacsng.nix: -------------------------------------------------------------------------------- 1 | { 2 | nix = { 3 | binaryCaches = [ 4 | "https://emacsng.cachix.org" 5 | ]; 6 | binaryCachePublicKeys = [ 7 | "emacsng.cachix.org-1:i7wOr4YpdRpWWtShI8bT6V7lOTnPeI7Ho6HaZegFWMI=" 8 | ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /profiles/cachix/nix-community.nix: -------------------------------------------------------------------------------- 1 | { 2 | nix = { 3 | binaryCaches = [ 4 | "https://nix-community.cachix.org" 5 | ]; 6 | binaryCachePublicKeys = [ 7 | "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" 8 | ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /profiles/cachix/zeek.nix: -------------------------------------------------------------------------------- 1 | { 2 | nix = { 3 | binaryCaches = [ 4 | "https://zeek.cachix.org" 5 | ]; 6 | binaryCachePublicKeys = [ 7 | "zeek.cachix.org-1:Jv0hB/P5eF7RQUZgSQiVqzqzgweP29YIwpSiukGlDWQ=" 8 | ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /profiles/coding/common/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | imports = []; 3 | environment.systemPackages = with pkgs; [ 4 | cmake 5 | sbcl 6 | tree-sitter 7 | cue 8 | clang_11 9 | gcc 10 | julia_18-bin 11 | shfmt 12 | terraform-lsp 13 | just 14 | yaml-language-server 15 | nodePackages.bash-language-server 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /profiles/coding/go/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; [ 3 | go_1_18 4 | #overlay 5 | horcrux 6 | govet 7 | ####### 8 | gopls 9 | gocode 10 | go-outline 11 | go-symbols 12 | go-tools 13 | gocode-gomod 14 | godef 15 | gopkgs 16 | delve 17 | golint 18 | #for nix 19 | go2nix 20 | gomod2nix 21 | dep 22 | gosec 23 | gotests 24 | gotty 25 | hugo 26 | go-bindata 27 | ]; 28 | environment.variables = {GOROOT = ["${pkgs.go_1_18.out}/share/go"];}; 29 | } 30 | -------------------------------------------------------------------------------- /profiles/coding/haskell/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; [ 3 | ormolu 4 | ]; 5 | } 6 | -------------------------------------------------------------------------------- /profiles/coding/library/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | python3, 4 | ... 5 | }: { 6 | environment.systemPackages = with pkgs; [ 7 | # emacs python 8 | #emacs eaf 9 | qt5.qtbase 10 | wmctrl 11 | lxqt.qtermwidget 12 | libvterm 13 | libtool 14 | scrot 15 | # TCLAP - Templatized Command Line Argument Parser 16 | tclap 17 | autojump 18 | hunspell 19 | #search eng 20 | xapian 21 | nmap 22 | silver-searcher 23 | ]; 24 | 25 | # Configure aspell system wide 26 | environment.etc."aspell.conf".text = '' 27 | master en_US 28 | extra-dicts en-computers.rws 29 | add-extra-dicts en_US-science.rws 30 | ''; 31 | } 32 | -------------------------------------------------------------------------------- /profiles/coding/nix/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | imports = []; 8 | 9 | environment.systemPackages = with pkgs; [ 10 | # rnix-lsp 11 | nil 12 | ( 13 | pkgs.writeShellScriptBin "repl" '' 14 | export PATH=${pkgs.coreutils}/bin:${pkgs.nixUnstable}/bin:$PATH 15 | if [ -z "$1" ]; then 16 | nix repl --argstr host "$HOST" --argstr flakePath "$PRJ_ROOT" ${./repl.nix} 17 | else 18 | nix repl --argstr host "$HOST" --argstr flakePath $(readlink -f $1 | sed 's|/flake.nix||') ${./repl.nix} 19 | fi 20 | '' 21 | ) 22 | nixpkgs-fmt 23 | alejandra 24 | ]; 25 | } 26 | -------------------------------------------------------------------------------- /profiles/coding/nix/repl.nix: -------------------------------------------------------------------------------- 1 | # Adapted on 3rd of July 2021 from 2 | # https://github.com/gytis-ivaskevicius/flake-utils-plus/blob/438316a7b7d798bff326c97da8e2b15a56c7657e/lib/repl.nix 3 | {flakePath}: let 4 | Flake = 5 | if builtins.pathExists flakePath 6 | then 7 | (import (fetchTarball { 8 | url = "https://github.com/edolstra/flake-compat/archive/b4a34015c698c7793d592d66adbab377907a2be8.tar.gz"; 9 | sha256 = "1qc703yg0babixi6wshn5wm2kgl5y1drcswgszh4xxzbrwkk9sv7"; 10 | }) {src = toString flakePath;}) 11 | .defaultNix 12 | else {}; 13 | 14 | Channels = Flake.pkgs.${builtins.currentSystem} or ; 15 | 16 | LoadFlake = path: builtins.getFlake (toString path); 17 | in { 18 | inherit 19 | Channels 20 | Flake 21 | LoadFlake 22 | ; 23 | } 24 | -------------------------------------------------------------------------------- /profiles/coding/node/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; 3 | [ 4 | nodejs 5 | yarn 6 | 7 | jre 8 | ] 9 | ++ ( 10 | with nodePackages; [ 11 | # mermaid-cli 12 | mathjax 13 | # mathjax-node-cli 14 | # TOML formater 15 | ] 16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /profiles/coding/python/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, lib, ...}: let 2 | wenls = pkgs.fetchFromGitHub { 3 | owner = "metaescape"; 4 | repo = "Wen"; 5 | rev = "25a815217d5234e9e28c18e740e1aa5e74690208"; 6 | sha256 = "sha256-2kFiaPZnc5Y7jaCJTG50bgFWhs6mejKqeumqwg44XP8="; 7 | }; 8 | my-python-packages = 9 | ( 10 | pkgs.python3Override.withPackages ( 11 | ps: 12 | with ps; [ 13 | #emacs-eaf 14 | shapely 15 | dbus-python 16 | qrcode 17 | xlib 18 | grip 19 | black 20 | # pyqt5 21 | # pyqtwebengine 22 | markdown 23 | feedparser 24 | retrying 25 | epc 26 | orjson 27 | ### 28 | pytest 29 | #orgparse 30 | pytest 31 | #voila 32 | pygments 33 | # orgbabelhelper 34 | # jupyterlab 35 | pdftotext 36 | pypinyin 37 | pygls 38 | ] ++ lib.optional pkgs.stdenv.isLinux [ 39 | pyqt6 40 | pyqt6-webengine 41 | pyinotify 42 | pymupdf 43 | ] 44 | ) 45 | ) 46 | .override (args: {ignoreCollisions = true;}); 47 | in { 48 | environment.systemPackages = with pkgs; [ 49 | my-python-packages 50 | nodePackages.pyright 51 | promnesia 52 | orgparse 53 | ( 54 | pkgs.writeShellScriptBin "wenls" '' 55 | ${my-python-packages}/bin/python3 ${wenls}/server.py 56 | '' 57 | ) 58 | ]; 59 | } 60 | -------------------------------------------------------------------------------- /profiles/coding/rust/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; [ 3 | (rust-bin.nightly.latest.default.override {extensions = ["rust-src"];}) 4 | rust-bin.nightly.latest."rust-analyzer-preview" 5 | tokio-console 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /profiles/coding/tex/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; [ 3 | # graph 4 | ditaa 5 | graphviz 6 | ( 7 | texmacs.override { 8 | chineseFonts = true; 9 | extraFonts = true; 10 | } 11 | ) 12 | ( 13 | texlive.combine 14 | # latex + packages 15 | { 16 | inherit 17 | (texlive) 18 | collection-plaingeneric 19 | collection-latexextra 20 | collection-fontsrecommended 21 | collection-pictures 22 | collection-bibtexextra 23 | collection-mathscience 24 | collection-langgerman 25 | scheme-basic 26 | xetex 27 | cjk 28 | ctex 29 | xecjk 30 | dvipng 31 | fontspec 32 | euenc 33 | ; 34 | } 35 | ) 36 | ]; 37 | } 38 | -------------------------------------------------------------------------------- /profiles/coding/vscode/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: let 2 | customVscode = import ./extensions.nix {inherit pkgs;}; 3 | in { 4 | environment.systemPackages = with pkgs; [ 5 | customVscode 6 | ]; 7 | } 8 | -------------------------------------------------------------------------------- /profiles/coding/vscode/extensions.nix: -------------------------------------------------------------------------------- 1 | {pkgs}: 2 | pkgs.vscode-with-extensions.override { 3 | # When the extension is already available in the default extensions set. 4 | vscodeExtensions = with pkgs.vscode-extensions; 5 | [ 6 | bbenoist 7 | nickel-syntax 8 | multi-cursor-case-preserve 9 | # theme 10 | tokyo-night 11 | vscode-emacs-friendly 12 | zeek 13 | indent-rainbow 14 | readable-indent 15 | # Julia 16 | julia-color-themes 17 | language-julia 18 | pdf 19 | vscode-markdownlint 20 | markdown-preview-enhanced 21 | vscode-direnv 22 | 23 | copilot 24 | # language-rust 25 | # rust-analyzer 26 | ] 27 | # Concise version from the vscode market place when not available in the default set. 28 | ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace []; 29 | } 30 | -------------------------------------------------------------------------------- /profiles/core/darwin/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | config, 4 | lib, 5 | pkgs, 6 | ... 7 | }: { 8 | imports = []; 9 | 10 | # Recreate /run/current-system symlink after boot 11 | services.activate-system.enable = true; 12 | 13 | services.nix-daemon.enable = true; 14 | users.nix.configureBuildUsers = true; 15 | 16 | environment = { 17 | systemPackages = with pkgs; [ 18 | m-cli 19 | terminal-notifier 20 | ]; 21 | 22 | darwinConfig = "${self}/lib/compat"; 23 | 24 | shellAliases = { 25 | nrb = "sudo darwin-rebuild switch --flake"; 26 | }; 27 | }; 28 | 29 | nix = { 30 | nixPath = [ 31 | # TODO: This entry should be added automatically via FUP's 32 | # `nix.linkInputs` and `nix.generateNixPathFromInputs` options, but 33 | # currently that doesn't work because nix-darwin doesn't export packages, 34 | # which FUP expects. 35 | # 36 | # This entry should be removed once the upstream issues are fixed. 37 | # 38 | # https://github.com/LnL7/nix-darwin/issues/277 39 | # https://github.com/gytis-ivaskevicius/flake-utils-plus/issues/107 40 | "darwin=/etc/nix/inputs/darwin" 41 | ]; 42 | 43 | # Administrative users on Darwin are part of this group. 44 | trustedUsers = ["@admin"]; 45 | }; 46 | 47 | programs.bash = { 48 | # nix-darwin's shell options are very different from those on nixos. there 49 | # is no `promptInit` option, for example. so instead, we throw the prompt 50 | # init line into `interactiveShellInit`. 51 | # 52 | # https://github.com/LnL7/nix-darwin/blob/master/modules/programs/bash/default.nix 53 | interactiveShellInit = '' 54 | eval "$(${pkgs.starship}/bin/starship init bash)" 55 | eval "$(${pkgs.direnv}/bin/direnv hook bash)" 56 | ''; 57 | }; 58 | } 59 | -------------------------------------------------------------------------------- /profiles/core/nixos/base.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | environment.systemPackages = with pkgs; [ 8 | ]; 9 | services.earlyoom.enable = true; 10 | } 11 | -------------------------------------------------------------------------------- /profiles/core/nixos/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | config, 4 | lib, 5 | pkgs, 6 | ... 7 | }: let 8 | inherit (lib) fileContents; 9 | in { 10 | imports = [./base.nix ./nix.nix ./sysctl.nix ./shell.nix]; 11 | 12 | programs.nix-ld.enable = true; 13 | 14 | # boot.kernelPackages = pkgs.linuxPackages_6_0.extend (_: super: {}); 15 | 16 | environment = { 17 | systemPackages = with pkgs; [ 18 | binutils 19 | coreutils 20 | curl 21 | direnv 22 | dnsutils 23 | dosfstools 24 | fd 25 | git 26 | git-town 27 | gotop 28 | gptfdisk 29 | iputils 30 | jq 31 | # manix 32 | moreutils 33 | nix-index 34 | nmap 35 | ripgrep 36 | skim 37 | tealdeer 38 | usbutils 39 | utillinux 40 | whois 41 | cachix 42 | zstd 43 | unzip 44 | zip 45 | pciutils 46 | # lspci 47 | psmisc 48 | # pkill, killall, pstree, fuser 49 | lsd 50 | # remote 51 | rxvt_unicode.terminfo 52 | ncurses.dev 53 | # infocmp/tic/etc 54 | # Linux/OSX/FreeBSD resource monitor 55 | bpytop 56 | # password 57 | pwgen 58 | wget 59 | nix-output-monitor 60 | nix-top 61 | zsh 62 | ]; 63 | }; 64 | } 65 | -------------------------------------------------------------------------------- /profiles/core/nixos/nix.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | #nix.generateRegistryFromInputs = lib.mkDefault true; 8 | 9 | nix = { 10 | package = pkgs.nixUnstable; 11 | 12 | localRegistry = { 13 | enable = false; 14 | 15 | cacheGlobalRegistry = true; 16 | 17 | noGlobalRegistry = false; 18 | }; 19 | 20 | settings = { 21 | auto-optimise-store = true; 22 | max-jobs = lib.mkDefault 12; 23 | allowed-users = ["@wheel"]; 24 | trusted-users = ["root" "@wheel"]; 25 | system-features = ["nixos-test" "benchmark" "big-parallel" "kvm"]; 26 | }; 27 | 28 | gc = { 29 | automatic = true; 30 | dates = "weekly"; 31 | options = "--delete-older-than 3d"; 32 | }; 33 | 34 | optimise.automatic = true; 35 | 36 | extraOptions = '' 37 | min-free = 536870912 38 | accept-flake-config = true 39 | keep-outputs = true 40 | keep-derivations = true 41 | fallback = true 42 | ''; 43 | 44 | }; 45 | 46 | #systemd.services.sync-nixpkgs.serviceConfig.TimeoutSec = lib.mkForce 500; 47 | } 48 | -------------------------------------------------------------------------------- /profiles/core/nixos/sysctl.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | boot.kernel.sysctl = { 8 | "fs.inotify.max_queued_events" = 1048576; 9 | "fs.inotify.max_user_instances" = 1048576; 10 | "fs.inotify.max_user_watches" = 1048576; 11 | "vm.max_map_count" = 262144; 12 | "kernel.dmesg_restrict" = 1; 13 | "net.ipv4.neigh.default.gc_thresh3" = 8192; 14 | "net.ipv6.neigh.default.gc_thresh3" = 8192; 15 | "kernel.keys.maxkeys" = 2000; 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /profiles/data/airflow/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | services.postgresql = { 8 | enable = true; 9 | enableTCPIP = true; 10 | ensureDatabases = [ 11 | "airflow_db" 12 | ]; 13 | ensureUsers = [ 14 | { 15 | name = "airflow_user"; 16 | ensurePermissions."DATABASE airflow_db" = "ALL PRIVILEGES"; 17 | } 18 | ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /profiles/data/cassandra.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | services.cassandra = { 8 | enable = true; 9 | clusterName = "thp"; 10 | package = pkgs.cassandra_3_11; 11 | 12 | extraConfig = { 13 | authenticator = "PasswordAuthenticator"; 14 | authorizer = "CassandraAuthorizer"; 15 | role_manager = "CassandraRoleManager"; 16 | }; 17 | 18 | remoteJmx = true; 19 | 20 | jmxRoles = [ 21 | { 22 | username = "thehive"; 23 | password = "thehive-password"; 24 | } 25 | ]; 26 | }; 27 | } 28 | -------------------------------------------------------------------------------- /profiles/data/database/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | services.mysql = { 8 | enable = true; 9 | package = pkgs.mysql; 10 | }; 11 | environment.systemPackages = with pkgs; [ 12 | mysql-client 13 | ]; 14 | } 15 | -------------------------------------------------------------------------------- /profiles/data/filestash/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | services.filestash = { 8 | enable = false; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /profiles/data/miniflux/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | networking.firewall = { 8 | allowedTCPPorts = [9005 9000]; 9 | allowedUDPPorts = [9005 9000]; 10 | }; 11 | 12 | # services.miniflux = { 13 | # enable = true; 14 | # adminCredentialsFile = ../../secrets/miniflux-admin-credentials; 15 | # config.LISTEN_ADDR = "10.220.170.112:9005"; 16 | # }; 17 | } 18 | -------------------------------------------------------------------------------- /profiles/data/nextcloud/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | imports = [./nextcloud_db.nix]; 8 | 9 | networking.firewall = { 10 | allowedTCPPorts = [80]; 11 | allowedUDPPorts = [80]; 12 | }; 13 | 14 | environment.systemPackages = with pkgs; [ 15 | nextcloud-client 16 | ]; 17 | 18 | sops.secrets."services/nextcloud/admin" = { 19 | owner = "nextcloud"; 20 | group = "nextcloud"; 21 | }; 22 | 23 | services.nextcloud = { 24 | enable = true; 25 | package = pkgs.nextcloud24; 26 | home = "/DATABASE-4TB/nextcloud"; 27 | # Auto-update Nextcloud Apps 28 | autoUpdateApps.enable = true; 29 | # Set what time makes sense for you 30 | autoUpdateApps.startAt = "05:00:00"; 31 | 32 | hostName = "10.220.170.112"; 33 | 34 | config = { 35 | dbtype = "pgsql"; 36 | dbuser = "nextcloud"; 37 | # nextcloud will add /.s.PGSQL.5432 by itself 38 | dbhost = "/run/postgresql"; 39 | dbname = "nextcloud"; 40 | 41 | adminpassFile = "${config.sops.secrets."services/nextcloud/admin".path}"; 42 | adminuser = "guangtao"; 43 | }; 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /profiles/data/nextcloud/nextcloud_db.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | services.postgresql = { 8 | enable = true; 9 | enableTCPIP = true; 10 | ensureDatabases = [ 11 | "nextcloud" 12 | ]; 13 | initialScript = pkgs.writeText "backend-initScript" '' 14 | #CREATE DATABASE "timesketch" WITH OWNER "timesketch"; 15 | ''; 16 | ensureUsers = [ 17 | { 18 | name = "nextcloud"; 19 | ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES"; 20 | } 21 | ]; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /profiles/data/promnesia/config.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.8 2 | from promnesia import Source 3 | from promnesia.sources import auto 4 | from promnesia.sources import guess 5 | 6 | """ 7 | List of sources to use 8 | 9 | You can specify your own, add more sources, etc. 10 | See https://github.com/karlicoss/promnesia#setup for more information 11 | """ 12 | SOURCES = [ 13 | # Source( 14 | # auto.index, 15 | # # just some arbitrary directory with html files 16 | # '~/Dropbox/org-notes', 17 | # name='org-notes', 18 | # ignored=[ '*.html', '*.glass', '*.jpeg', '*.png', '*.jpg', '*.py', '*.csv', '*.json', '*.org.organice-bak' ], 19 | # ), 20 | Source( 21 | auto.index, 22 | # just some arbitrary directory with html files 23 | "~/.config/guangtao/dotfiles/doom-emacs", 24 | name="doom-emacs", 25 | ignored=["*.html", "*.glass", "*.jpeg", "*.png", "*.jpg", "*.el", "*.elc"], 26 | ), 27 | Source( 28 | auto.index, 29 | # just some arbitrary directory with html files 30 | "~/Dropbox/org-notes/braindump", 31 | name="my-braindump", 32 | ignored=[ 33 | "*.html", 34 | "*.glass", 35 | "*.jpeg", 36 | "*.png", 37 | "*.jpg", 38 | "*.el", 39 | "*.elc", 40 | "*.bib", 41 | "*Z", 42 | ], 43 | ), 44 | ] 45 | 46 | """ 47 | Optional setting. 48 | A directory to keep intemediate caches in order to speed up indexing. 49 | If not specified, caching isn't used. 50 | """ 51 | CACHE_DIR = "/tmp/promnesia_cache/" 52 | 53 | FILTERS = [ 54 | "mail.google.com", 55 | "192.168.0.", 56 | "10.220.170.", 57 | # you can use regexes too! 58 | "redditmedia.com.*.(jpg|png|gif)", 59 | ] 60 | -------------------------------------------------------------------------------- /profiles/data/promnesia/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: let 7 | readConfig = builtins.readFile ./config.py; 8 | 9 | configFile = pkgs.writeScript "config.py" readConfig; 10 | 11 | watcherPath = "/home/gtrun/Dropbox/org-notes/braindump"; 12 | in { 13 | systemd.user.services.promnesia = { 14 | description = "promnesia Daemon"; 15 | wantedBy = ["graphical-session.target"]; 16 | preStart = '' 17 | ${pkgs.promnesia}/bin/promnesia index --config ${configFile} 18 | ''; 19 | serviceConfig = { 20 | ExecStart = '' 21 | ${pkgs.promnesia}/bin/promnesia serve 22 | ''; 23 | Restart = "on-failure"; 24 | }; 25 | }; 26 | 27 | systemd.user.paths.promnesia-watcher = { 28 | wantedBy = ["promnesia.service"]; 29 | pathConfig = { 30 | PathChanged = [watcherPath]; 31 | Unit = "promnesia-restarter.service"; 32 | }; 33 | }; 34 | 35 | systemd.user.services.promnesia-restarter = { 36 | serviceConfig.Type = "oneshot"; 37 | wantedBy = ["promnesia.service"]; 38 | script = '' 39 | systemctl --user restart promnesia.service 40 | ''; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /profiles/data/syncthing/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | networking.firewall = { 8 | allowedTCPPorts = [8384]; 9 | allowedUDPPorts = [8384]; 10 | }; 11 | 12 | environment.systemPackages = with pkgs; [ 13 | # syncthing-gtk 14 | ]; 15 | 16 | services.syncthing = { 17 | enable = true; 18 | openDefaultPorts = true; 19 | guiAddress = "${config.machine.common.ip}:${config.machine.services.syncthing.port}"; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /profiles/devices/buletooth.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; [ 3 | lxqt.pavucontrol-qt 4 | ]; 5 | 6 | hardware.bluetooth = { 7 | enable = true; 8 | powerOnBoot = true; 9 | # config = '' 10 | # ControllerMode = bredr 11 | # AutoConnect=true 12 | # [Headset] 13 | # HFP=true 14 | # MaxConnected=1 15 | # FastConnectable=true 16 | # ''; 17 | }; 18 | services.blueman.enable = true; 19 | } 20 | -------------------------------------------------------------------------------- /profiles/devices/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | imports = [ 3 | ./buletooth.nix 4 | ./pipewire.nix 5 | ]; 6 | } 7 | -------------------------------------------------------------------------------- /profiles/devices/pipewire.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | services.pipewire = { 3 | enable = true; 4 | alsa.enable = true; 5 | alsa.support32Bit = true; 6 | pulse.enable = true; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /profiles/fonts/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | fonts = { 3 | enableDefaultFonts = true; 4 | fonts = with pkgs; [ 5 | fantasque-sans-mono 6 | noto-fonts 7 | noto-fonts-cjk 8 | noto-fonts-emoji 9 | emojione 10 | twemoji-color-font 11 | siji 12 | unifont 13 | unifont_upper 14 | liberation_ttf 15 | fira-code 16 | fira-code-symbols 17 | dina-font 18 | proggyfonts 19 | source-han-sans-simplified-chinese 20 | source-han-sans-traditional-chinese 21 | material-icons 22 | weather-icons 23 | iosevka 24 | nerdfonts 25 | ]; 26 | 27 | fontconfig = { 28 | defaultFonts = { 29 | serif = ["FantasqueSansMono Nerd Font Mono" "Weibei SC"]; 30 | sansSerif = ["FantasqueSansMono Nerd Font Mono" "Weibei SC"]; 31 | monospace = ["FantasqueSansMono Nerd Font Mono"]; 32 | }; 33 | }; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /profiles/graphical/dbus/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | services.dbus = { 8 | enable = true; 9 | }; 10 | 11 | services.dbus.packages = with pkgs; [ 12 | pass-secret-service 13 | ]; 14 | } 15 | -------------------------------------------------------------------------------- /profiles/graphical/i3/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | environment.systemPackages = with pkgs; [ 3 | rofi 4 | ( 5 | polybar.override { 6 | i3Support = true; 7 | githubSupport = true; 8 | pulseSupport = true; 9 | mpdSupport = true; 10 | alsaSupport = true; 11 | } 12 | ) 13 | ]; 14 | 15 | services.xserver = { 16 | windowManager = { 17 | i3 = { 18 | package = pkgs.i3-gaps; 19 | enable = true; 20 | }; 21 | }; 22 | 23 | displayManager.defaultSession = "none+i3"; 24 | desktopManager.xterm.enable = false; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /profiles/graphical/misc/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | environment.systemPackages = [pkgs.gnome.seahorse]; 8 | services.gnome.gnome-keyring.enable = true; 9 | } 10 | -------------------------------------------------------------------------------- /profiles/graphical/misc/volnoti.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: let 2 | inherit (pkgs) alsaUtils bash gnugrep volnoti; 3 | in 4 | pkgs.writeScript "volnoti.sh" '' 5 | #!${bash}/bin/bash 6 | 7 | declare -i current=$(${alsaUtils}/bin/amixer get Master | ${gnugrep}/bin/grep -m1 -Po "[0-9]+(?=%)") 8 | if [[ $current -gt 100 ]]; then 9 | current=100 10 | fi 11 | 12 | 13 | if ${alsaUtils}/bin/amixer get Master | ${gnugrep}/bin/grep -Fq "[off]"; then 14 | ${volnoti}/bin/volnoti-show -m $current 15 | else 16 | ${volnoti}/bin/volnoti-show $current 17 | fi 18 | '' 19 | -------------------------------------------------------------------------------- /profiles/graphical/nvidia/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | services.xserver = { 8 | videoDrivers = ["nvidia" "intel"]; 9 | }; 10 | 11 | hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta; 12 | 13 | hardware.nvidia.modesetting.enable = true; 14 | 15 | # hardware.nvidia.powerManagement.enable = true; 16 | # hardware.nvidia.prime = { 17 | # nvidiaBusId = "PCI:1:0:0"; 18 | # intelBusId = "PCI:0:2:0"; 19 | # offload.enable = true; 20 | # }; 21 | 22 | systemd.services.nvidia-control-devices = { 23 | wantedBy = [ 24 | "multi-user.target" 25 | ]; 26 | }; 27 | 28 | boot.blacklistedKernelModules = ["nouveau"]; 29 | } 30 | -------------------------------------------------------------------------------- /profiles/graphical/xdg/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | environment.etc = { 8 | "xdg/gtk-3.0/settings.ini" = { 9 | text = '' 10 | [Settings] 11 | gtk-icon-theme-name=Papirus 12 | gtk-theme-name=Adapta 13 | gtk-cursor-theme-name=Adwaita 14 | gtk-cursor-theme-size=128 15 | ''; 16 | mode = "444"; 17 | }; 18 | 19 | "xdg/user-dirs.defaults" = { 20 | text = '' 21 | DESKTOP=Desktop 22 | DOCUMENTS=Documents 23 | DOWNLOAD=Downloads 24 | MUSIC=Music 25 | PICTURES=Pictures 26 | PUBLICSHARE=Public 27 | TEMPLATES=Templates 28 | VIDEOS=Videos 29 | ''; 30 | }; 31 | 32 | "xdg/mimeapps.list" = { 33 | text = '' 34 | [Default Applications] 35 | inode/directory=org.kde.krusader.desktop 36 | x-scheme-handler/http=brave-browser.desktop 37 | x-scheme-handler/https=brave-browser.desktop 38 | x-scheme-handler/org-protocol=org-protocol.desktop 39 | ''; 40 | }; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /profiles/graphical/xserver/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | pkgs, 4 | ... 5 | }: { 6 | hardware.opengl.enable = true; 7 | hardware.opengl.driSupport = true; 8 | 9 | environment = { 10 | sessionVariables = { 11 | # Theme settings 12 | QT_QPA_PLATFORMTHEME = "gtk2"; 13 | 14 | # GDK_SCALE = "2"; 15 | # GDK_DPI_SCALE = "0.5"; 16 | 17 | GTK2_RC_FILES = let 18 | gtk = '' 19 | gtk-icon-theme-name="Papirus" 20 | gtk-cursor-theme-name="Adwaita" 21 | gtk-cursor-theme-size ="128" 22 | ''; 23 | in [ 24 | "${pkgs.writeText "iconrc" "${gtk}"}" 25 | "${pkgs.adapta-gtk-theme}/share/themes/Adapta/gtk-2.0/gtkrc" 26 | "${pkgs.gnome3.gnome-themes-extra}/share/themes/Adwaita/gtk-2.0/gtkrc" 27 | ]; 28 | }; 29 | 30 | systemPackages = with pkgs; [ 31 | adapta-gtk-theme 32 | dzen2 33 | ffmpeg-full 34 | gsettings-desktop-schemas 35 | networkmanagerapplet 36 | gnome-themes-extra 37 | imagemagick 38 | imlib2 39 | librsvg 40 | libsForQt5.qtstyleplugins 41 | papirus-icon-theme 42 | pulsemixer 43 | qt5.qtgraphicaleffects 44 | # stdmanpages 45 | xsel 46 | zathura 47 | xdotool 48 | xorg.xwininfo 49 | krusader 50 | kdiff3 51 | krename 52 | keditbookmarks 53 | kazam 54 | obs-studio 55 | ]; 56 | }; 57 | 58 | services.xserver = { 59 | enable = true; 60 | 61 | libinput.enable = true; 62 | 63 | displayManager.lightdm = { 64 | enable = true; 65 | }; 66 | 67 | displayManager.autoLogin = { 68 | enable = true; 69 | user = "gtrun"; 70 | }; 71 | }; 72 | hardware.video.hidpi.enable = true; 73 | } 74 | -------------------------------------------------------------------------------- /profiles/networking/adblocking/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | ... 5 | }: {networking.extraHosts = lib.readFile "${pkgs.StevenBlack-hosts}/etc/hosts";} 6 | -------------------------------------------------------------------------------- /profiles/networking/adguardhome/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | networking.firewall = { 8 | allowedTCPPorts = [9002]; 9 | allowedUDPPorts = [9002]; 10 | }; 11 | 12 | services.adguardhome = { 13 | enable = true; 14 | host = "10.220.170.112"; 15 | port = 9002; 16 | }; 17 | 18 | environment.systemPackages = with pkgs; [ 19 | adguardhome 20 | ]; 21 | } 22 | -------------------------------------------------------------------------------- /profiles/networking/common/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | networking.networkmanager.enable = true; 8 | 9 | environment.systemPackages = with pkgs; [ 10 | bc 11 | dnsutils 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /profiles/nsm/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | imports = []; 3 | 4 | environment.systemPackages = with pkgs; [ 5 | #home 6 | #sudo-pair 7 | #btest 8 | brim 9 | tcpdump 10 | wireshark 11 | ]; 12 | 13 | services.dbus = { 14 | enable = true; 15 | }; 16 | 17 | programs.dconf.enable = true; 18 | #for brim to dfconf service 19 | } 20 | -------------------------------------------------------------------------------- /profiles/registry/nixos/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | nix = { 8 | registry = { 9 | nixpkgs-hardenedlinux = lib.mkForce { 10 | exact = false; 11 | from = { 12 | id = "nixpkgs-hardenedlinux"; 13 | type = "indirect"; 14 | }; 15 | to = { 16 | type = "git"; 17 | url = "file:///home/gtrun/ghq/github.com/hardenedlinux/nixpkgs-hardenedlinux"; 18 | }; 19 | }; 20 | threatbus2nix = lib.mkForce { 21 | exact = false; 22 | from = { 23 | id = "threatbus2nix"; 24 | type = "indirect"; 25 | }; 26 | to = { 27 | type = "git"; 28 | url = "file:///home/gtrun/ghq/github.com/GTrunSec/threatbus2nix"; 29 | }; 30 | }; 31 | vast2nix = lib.mkForce { 32 | exact = false; 33 | from = { 34 | id = "vast2nix"; 35 | type = "indirect"; 36 | }; 37 | to = { 38 | type = "git"; 39 | url = "file:///home/gtrun/ghq/github.com/GTrunSec/vast2nix"; 40 | }; 41 | }; 42 | zeek2nix = lib.mkForce { 43 | exact = false; 44 | from = { 45 | id = "zeek2nix"; 46 | type = "indirect"; 47 | }; 48 | to = { 49 | type = "git"; 50 | url = "file:///home/gtrun/ghq/github.com/GTrunSec/zeek2nix"; 51 | }; 52 | }; 53 | }; 54 | }; 55 | } 56 | -------------------------------------------------------------------------------- /profiles/searching/hound/config-hound.json: -------------------------------------------------------------------------------- 1 | { 2 | "dbpath": "/var/lib/hound/data", 3 | "max-concurrent-indexers": 2, 4 | "repos": { 5 | "nixpkgs": { 6 | "url": "https://www.github.com/NixOS/nixpkgs.git" 7 | }, 8 | "zeek": { 9 | "url": "https://www.github.com/zeek/zeek.git" 10 | }, 11 | "Xe": { 12 | "url": "https://github.com/Xe/nixos-configs.git" 13 | }, 14 | "jlesquembre": { 15 | "url": "https://github.com/jlesquembre/dotfiles.git" 16 | }, 17 | "charvp": { 18 | "url": "https://github.com/charvp/nixos-config.git" 19 | }, 20 | "GTrunSec": { 21 | "url": "https://github.com/GTrunSec/nixos-flk.git" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /profiles/searching/hound/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: let 7 | config = builtins.readFile ./config-hound.json; 8 | in { 9 | networking.firewall = { 10 | allowedTCPPorts = [9003]; 11 | allowedUDPPorts = [9003]; 12 | }; 13 | 14 | services.hound = { 15 | enable = true; 16 | listen = "10.220.170.112:9003"; 17 | inherit config; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /profiles/secrets/sops/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | sops.gnupg.sshKeyPaths = []; 8 | sops.defaultSopsFile = ../../../secrets/secrets.yaml; 9 | } 10 | -------------------------------------------------------------------------------- /profiles/ssh/default.nix: -------------------------------------------------------------------------------- 1 | {...}: { 2 | services.openssh = { 3 | enable = true; 4 | kbdInteractiveAuthentication = false; 5 | passwordAuthentication = false; 6 | forwardX11 = true; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /profiles/virtualisation/docker/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | virtualisation.docker = { 3 | enable = true; 4 | autoPrune.enable = true; 5 | }; 6 | environment.systemPackages = with pkgs; [ 7 | docker_compose 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /profiles/virtualisation/libvirtd/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | virtualisation.libvirtd = { 3 | enable = true; 4 | allowedBridges = ["all"]; 5 | qemu = { 6 | runAsRoot = false; 7 | }; 8 | }; 9 | # nsjail 10 | # https://systemd.io/CGROUP_DELEGATION/ 11 | systemd.services."user@".serviceConfig.Delegate = true; 12 | systemd.services."user@".serviceConfig.LimitNOFILE = 9001; 13 | # virtualisation = { 14 | # virtualbox = { 15 | # host = { 16 | # enable = true; 17 | # enableExtensionPack = true; 18 | # }; 19 | # }; 20 | # kvmgt.enable = true; 21 | # }; 22 | # users.extraUsers.gtrun.extraGroups = [ "vboxusers" ]; 23 | users.extraUsers.gtrun.extraGroups = ["libvirtd"]; 24 | networking.firewall.checkReversePath = false; 25 | # you'll need to add your user to 'libvirtd' group to use virt-manager 26 | boot.kernelModules = ["kvm-intel"]; 27 | 28 | environment.systemPackages = with pkgs; [ 29 | virt-manager 30 | ]; 31 | } 32 | -------------------------------------------------------------------------------- /profiles/virtualisation/oci-containers/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | networking.firewall = { 3 | allowedTCPPorts = [9004]; 4 | allowedUDPPorts = [9004]; 5 | }; 6 | 7 | virtualisation.oci-containers.containers = { 8 | rsshub = { 9 | image = "diygod/rsshub"; 10 | ports = ["1200:1200"]; 11 | }; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /profiles/virtualisation/podman/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | virtualisation.docker.enable = false; 3 | virtualisation.podman.enable = true; 4 | virtualisation.podman.dockerSocket.enable = true; 5 | virtualisation.podman.defaultNetwork.dnsname.enable = true; 6 | users.extraUsers.gtrun.extraGroups = ["podman"]; 7 | 8 | services.dockerRegistry.storagePath = "/SSD-1TB/docker-registry"; 9 | 10 | environment.systemPackages = with pkgs; [ 11 | docker-client 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /secrets/secrets.nix: -------------------------------------------------------------------------------- 1 | let 2 | # set ssh public keys here for your system and user 3 | system = ""; 4 | user = ""; 5 | allKeys = [system user]; 6 | in { 7 | "secret.age".publicKeys = allKeys; 8 | } 9 | -------------------------------------------------------------------------------- /shell.nix: -------------------------------------------------------------------------------- 1 | (import ./lib/compat).shellNix 2 | -------------------------------------------------------------------------------- /templates/devos/.envrc: -------------------------------------------------------------------------------- 1 | watch_file flake.nix flake.lock \ 2 | devshell/* 3 | { 4 | # shell gc root dir 5 | mkdir -p "$(direnv_layout_dir)" 6 | eval "$(nix print-dev-env --no-update-lock-file --no-write-lock-file --profile $(direnv_layout_dir)/flake-profile)" 7 | } || use nix 8 | -------------------------------------------------------------------------------- /templates/devos/channels/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | digga, 4 | ... 5 | }: { 6 | nixos = { 7 | imports = [(digga.lib.importOverlays ../overlays/common)]; 8 | overlays = []; 9 | }; 10 | darwin-nixpkgs = { 11 | imports = [(digga.lib.importOverlays ../overlays/common)]; 12 | overlays = []; 13 | }; 14 | nixos-latest = {}; 15 | nixos-unstable = {}; 16 | } 17 | -------------------------------------------------------------------------------- /templates/devos/darwin/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | } @ args: 6 | with inputs; { 7 | hostDefaults = import ./hostDefault.nix args; 8 | 9 | imports = [(digga.lib.importHosts ../hosts/darwin)]; 10 | 11 | hosts = import ./hosts.nix args; 12 | 13 | importables = import ./suites.nix args; 14 | } 15 | -------------------------------------------------------------------------------- /templates/devos/darwin/hostDefault.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | self, 4 | ... 5 | }: 6 | with inputs; { 7 | system = "x86_64-darwin"; 8 | channelName = "darwin-nixpkgs"; 9 | imports = [(digga.lib.importExportableModules ../modules/shared)]; 10 | modules = [ 11 | {lib.our = self.lib;} 12 | digga.darwinModules.nixConfig 13 | home.darwinModules.home-manager 14 | ragenix.nixosModules.age 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /templates/devos/darwin/hosts.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: {} 6 | -------------------------------------------------------------------------------- /templates/devos/darwin/suites.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: 6 | with inputs; rec { 7 | profiles = 8 | digga.lib.rakeLeaves ../profiles 9 | // { 10 | users = digga.lib.rakeLeaves ../users; 11 | }; 12 | suites = with profiles; rec { 13 | base = [core.darwin users.darwin]; 14 | MacBook = 15 | base 16 | ++ []; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /templates/devos/default.nix: -------------------------------------------------------------------------------- 1 | let 2 | inherit (default.inputs.nixos) lib; 3 | 4 | default = (import ./lib/compat).defaultNix; 5 | 6 | ciSystems = [ 7 | "aarch64-linux" 8 | "i686-linux" 9 | "x86_64-linux" 10 | ]; 11 | 12 | filterSystems = 13 | lib.filterAttrs 14 | (system: _: lib.elem system ciSystems); 15 | 16 | recurseIntoAttrsRecursive = lib.mapAttrs ( 17 | _: v: 18 | if lib.isAttrs v 19 | then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v) 20 | else v 21 | ); 22 | 23 | systemOutputs = 24 | lib.filterAttrs 25 | ( 26 | name: set: 27 | lib.isAttrs set 28 | && lib.any 29 | (system: set ? ${system} && name != "legacyPackages") 30 | ciSystems 31 | ) 32 | default.outputs; 33 | 34 | ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs; 35 | in 36 | (recurseIntoAttrsRecursive ciDrvs) // {shell = import ./shell.nix;} 37 | -------------------------------------------------------------------------------- /templates/devos/devshell/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: { 6 | modules = with inputs; []; 7 | exportedModules = [ 8 | ./devos.nix 9 | ]; 10 | } 11 | -------------------------------------------------------------------------------- /templates/devos/devshell/devos.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | extraModulesPath, 4 | inputs, 5 | lib, 6 | ... 7 | }: let 8 | inherit 9 | (pkgs) 10 | agenix 11 | cachix 12 | nixUnstable 13 | ; 14 | 15 | hooks = import ./hooks; 16 | 17 | pkgWithCategory = category: package: {inherit package category;}; 18 | devos = pkgWithCategory "devos"; 19 | linter = pkgWithCategory "linter"; 20 | docs = pkgWithCategory "docs"; 21 | in { 22 | _file = toString ./.; 23 | 24 | imports = ["${extraModulesPath}/git/hooks.nix"]; 25 | git = {inherit hooks;}; 26 | 27 | commands = 28 | [ 29 | (devos nixUnstable) 30 | (devos agenix) 31 | ] 32 | ++ lib.optional (!pkgs.stdenv.buildPlatform.isi686) 33 | (devos cachix) 34 | ++ lib.optional (pkgs.stdenv.hostPlatform.isLinux && !pkgs.stdenv.buildPlatform.isDarwin) 35 | (devos inputs.nixos-generators.defaultPackage.${pkgs.system}); 36 | } 37 | -------------------------------------------------------------------------------- /templates/devos/devshell/hooks/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | enable = true; 3 | pre-commit.text = builtins.readFile ./pre-commit.sh; 4 | } 5 | -------------------------------------------------------------------------------- /templates/devos/devshell/hooks/pre-commit.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if git rev-parse --verify HEAD >/dev/null 2>&1; then 4 | against=HEAD 5 | else 6 | # Initial commit: diff against an empty tree object 7 | against=$(${git}/bin/git hash-object -t tree /dev/null) 8 | fi 9 | 10 | diff="git diff-index --name-only --cached $against --diff-filter d" 11 | 12 | nix_files=($($diff -- '*.nix')) 13 | all_files=($($diff)) 14 | 15 | # Format staged nix files. 16 | if [[ -n ${nix_files[@]} ]]; then 17 | nixpkgs-fmt "${nix_files[@]}" && 18 | git add "${nix_files[@]}" 19 | fi 20 | 21 | # check editorconfig 22 | editorconfig-checker -- "${all_files[@]}" 23 | if [[ $? != '0' ]]; then 24 | printf "%b\n" \ 25 | "\nCode is not aligned with .editorconfig" \ 26 | "Review the output and commit your fixes" >&2 27 | exit 1 28 | fi 29 | -------------------------------------------------------------------------------- /templates/devos/home/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: { 6 | imports = [(inputs.digga.lib.importExportableModules ../users/modules)]; 7 | modules = []; 8 | importables = rec { 9 | profiles = inputs.digga.lib.rakeLeaves ../users/profiles; 10 | suites = with profiles; rec { 11 | base = [direnv git]; 12 | }; 13 | }; 14 | users = { 15 | admin = {suites, ...}: {imports = suites.base;}; 16 | darwin = {suites, ...}: {imports = suites.base;}; 17 | nixos = {suites, ...}: {imports = suites.base;}; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /templates/devos/hosts/darwin/Mac.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | suites, 5 | ... 6 | }: { 7 | imports = with suites; base; 8 | } 9 | -------------------------------------------------------------------------------- /templates/devos/hosts/nixos/NixOS.nix: -------------------------------------------------------------------------------- 1 | {suites, ...}: { 2 | ### root password is empty by default ### 3 | imports = suites.base; 4 | 5 | boot.loader.systemd-boot.enable = true; 6 | boot.loader.efi.canTouchEfiVariables = true; 7 | 8 | networking.networkmanager.enable = true; 9 | 10 | fileSystems."/" = {device = "/dev/disk/by-label/nixos";}; 11 | } 12 | -------------------------------------------------------------------------------- /templates/devos/hosts/nixos/bootstrap.nix: -------------------------------------------------------------------------------- 1 | {profiles, ...}: { 2 | # build with: `bud build bootstrap bootstrapIso` 3 | # reachable on the local link via ssh root@fe80::47%eno1 4 | # where 'eno1' is replaced by your own machine's network 5 | # interface that has the local link to the target machine 6 | imports = [ 7 | # profiles.networking 8 | profiles.core.nixos 9 | profiles.users.root # make sure to configure ssh keys 10 | profiles.users.nixos 11 | ]; 12 | 13 | boot.loader.systemd-boot.enable = true; 14 | 15 | # will be overridden by the bootstrapIso instrumentation 16 | fileSystems."/" = {device = "/dev/disk/by-label/nixos";}; 17 | } 18 | -------------------------------------------------------------------------------- /templates/devos/lib/compat/default.nix: -------------------------------------------------------------------------------- 1 | let 2 | lock = builtins.fromJSON (builtins.readFile ../../flake.lock); 3 | flake = 4 | import 5 | ( 6 | fetchTarball { 7 | url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; 8 | sha256 = lock.nodes.flake-compat.locked.narHash; 9 | } 10 | ) 11 | { 12 | src = ../../.; 13 | }; 14 | in 15 | flake 16 | -------------------------------------------------------------------------------- /templates/devos/lib/compat/nixos/default.nix: -------------------------------------------------------------------------------- 1 | {...}: let 2 | inherit (default.inputs.nixos) lib; 3 | 4 | host = configs.${hostname} or configs.NixOS; 5 | configs = default.nixosConfigurations; 6 | default = (import ../.).defaultNix; 7 | hostname = lib.fileContents /etc/hostname; 8 | in 9 | host 10 | -------------------------------------------------------------------------------- /templates/devos/lib/default.nix: -------------------------------------------------------------------------------- 1 | {lib}: 2 | lib.makeExtensible (self: {}) 3 | -------------------------------------------------------------------------------- /templates/devos/modules/nixos/module-list.nix: -------------------------------------------------------------------------------- 1 | {...}: { 2 | } 3 | -------------------------------------------------------------------------------- /templates/devos/modules/shared/hm-system-defaults.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: { 6 | home-manager.sharedModules = [ 7 | { 8 | home.sessionVariables = { 9 | # environment.sessionVariables is not currently available in nix-darwin 10 | NIX_PATH = 11 | config.environment.sessionVariables.NIX_PATH 12 | or config.environment.variables.NIX_PATH; 13 | }; 14 | xdg.configFile."nix/registry.json".text = 15 | config.environment.etc."nix/registry.json".text; 16 | } 17 | ]; 18 | } 19 | -------------------------------------------------------------------------------- /templates/devos/modules/shared/nix-path.nix: -------------------------------------------------------------------------------- 1 | { 2 | channel, 3 | inputs, 4 | ... 5 | }: { 6 | nix.nixPath = [ 7 | "nixpkgs=${channel.input}" 8 | "nixos-config=${../../lib/compat/nixos}" 9 | "home-manager=${inputs.home}" 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /templates/devos/nixos/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | } @ args: 6 | with inputs; { 7 | hostDefaults = import ./hostDefault.nix args; 8 | 9 | imports = [(digga.lib.importHosts ../hosts/nixos)]; 10 | 11 | hosts = import ./hosts.nix args; 12 | 13 | importables = import ./suites.nix args; 14 | } 15 | -------------------------------------------------------------------------------- /templates/devos/nixos/hostDefault.nix: -------------------------------------------------------------------------------- 1 | { 2 | inputs, 3 | self, 4 | ... 5 | }: 6 | with inputs; { 7 | system = "x86_64-linux"; 8 | channelName = "nixos"; 9 | imports = [ 10 | (digga.lib.importExportableModules ../modules/shared) 11 | (digga.lib.importExportableModules ../modules/nixos) 12 | ]; 13 | modules = [ 14 | {lib.our = self.lib;} 15 | digga.nixosModules.bootstrapIso 16 | home.nixosModules.home-manager 17 | sops-nix.nixosModules.sops 18 | ragenix.nixosModules.age 19 | #User's custom modules 20 | ]; 21 | } 22 | -------------------------------------------------------------------------------- /templates/devos/nixos/hosts.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: { 6 | NixOS = {}; 7 | } 8 | -------------------------------------------------------------------------------- /templates/devos/nixos/suites.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | }: 6 | with inputs; rec { 7 | profiles = 8 | digga.lib.rakeLeaves ../profiles 9 | // { 10 | users = digga.lib.rakeLeaves ../users; 11 | }; 12 | suites = with profiles; rec { 13 | base = [core.nixos users.admin users.root]; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /templates/devos/overlays/common/manix.nix: -------------------------------------------------------------------------------- 1 | final: prev: { 2 | manix = prev.manix.overrideAttrs (o: rec { 3 | inherit (prev.sources.manix) pname version src; 4 | }); 5 | } 6 | -------------------------------------------------------------------------------- /templates/devos/overlays/common/overrides.nix: -------------------------------------------------------------------------------- 1 | channels: final: prev: { 2 | __dontExport = true; # overrides clutter up actual creations 3 | 4 | inherit 5 | (channels.nixos-latest) 6 | cachix 7 | dhall 8 | discord 9 | element-desktop 10 | rage 11 | nix-index 12 | nixpkgs-fmt 13 | qutebrowser 14 | signal-desktop 15 | starship 16 | deploy-rs 17 | ; 18 | 19 | haskellPackages = 20 | prev.haskellPackages.override 21 | (old: { 22 | overrides = prev.lib.composeExtensions (old.overrides or (_: _: {})) (hfinal: hprev: let 23 | version = prev.lib.replaceChars ["."] [""] prev.ghc.version; 24 | in { 25 | # same for haskell packages, matching ghc versions 26 | inherit 27 | (channels.latest.haskell.packages."ghc${version}") 28 | haskell-language-server 29 | ; 30 | }); 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /templates/devos/overlays/shared/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | ragenix, 4 | ... 5 | }: [ 6 | (final: prev: { 7 | __dontExport = true; 8 | lib = prev.lib.extend (lfinal: lprev: { 9 | our = self.lib; 10 | }); 11 | }) 12 | ragenix.overlay 13 | (import ../../pkgs) 14 | ] 15 | -------------------------------------------------------------------------------- /templates/devos/pkgs/_sources/generated.nix: -------------------------------------------------------------------------------- 1 | # This file was generated by nvfetcher, please do not modify it manually. 2 | { 3 | fetchgit, 4 | fetchurl, 5 | }: { 6 | manix = { 7 | pname = "manix"; 8 | version = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; 9 | src = fetchgit { 10 | url = "https://github.com/mlvzk/manix"; 11 | rev = "d08e7ca185445b929f097f8bfb1243a8ef3e10e4"; 12 | fetchSubmodules = false; 13 | deepClone = false; 14 | leaveDotGit = false; 15 | sha256 = "1b7xi8c2drbwzfz70czddc4j33s7g1alirv12dwl91hbqxifx8qs"; 16 | }; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /templates/devos/pkgs/default.nix: -------------------------------------------------------------------------------- 1 | final: prev: { 2 | # keep sources this first 3 | sources = prev.callPackage (import ./_sources/generated.nix) {}; 4 | # then, call packages with `final.callPackage` 5 | } 6 | -------------------------------------------------------------------------------- /templates/devos/pkgs/sources.toml: -------------------------------------------------------------------------------- 1 | # nvfetcher.toml 2 | [manix] 3 | src.git = "https://github.com/mlvzk/manix" 4 | fetch.github = "mlvzk/manix" 5 | -------------------------------------------------------------------------------- /templates/devos/profiles/cachix/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | ... 5 | }: let 6 | folder = ./.; 7 | toImport = name: value: folder + ("/" + name); 8 | filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix"; 9 | imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); 10 | in { 11 | inherit imports; 12 | nix.binaryCaches = ["https://cache.nixos.org/"]; 13 | } 14 | -------------------------------------------------------------------------------- /templates/devos/profiles/cachix/nix-community.nix: -------------------------------------------------------------------------------- 1 | { 2 | nix = { 3 | binaryCaches = [ 4 | "https://nix-community.cachix.org" 5 | ]; 6 | binaryCachePublicKeys = [ 7 | "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" 8 | ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /templates/devos/profiles/cachix/nrdxp.nix: -------------------------------------------------------------------------------- 1 | { 2 | nix = { 3 | binaryCaches = [ 4 | "https://nrdxp.cachix.org" 5 | ]; 6 | binaryCachePublicKeys = [ 7 | "nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4=" 8 | ]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /templates/devos/profiles/core/darwin.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | config, 4 | lib, 5 | pkgs, 6 | ... 7 | }: { 8 | imports = [ 9 | ./common.nix 10 | ]; 11 | 12 | # Recreate /run/current-system symlink after boot 13 | services.activate-system.enable = true; 14 | 15 | services.nix-daemon.enable = true; 16 | users.nix.configureBuildUsers = true; 17 | 18 | environment = { 19 | systemPackages = with pkgs; [ 20 | m-cli 21 | terminal-notifier 22 | ]; 23 | 24 | darwinConfig = "${self}/lib/compat"; 25 | 26 | shellAliases = { 27 | nrb = "sudo darwin-rebuild switch --flake"; 28 | }; 29 | }; 30 | 31 | nix = { 32 | nixPath = [ 33 | # TODO: This entry should be added automatically via FUP's 34 | # `nix.linkInputs` and `nix.generateNixPathFromInputs` options, but 35 | # currently that doesn't work because nix-darwin doesn't export packages, 36 | # which FUP expects. 37 | # 38 | # This entry should be removed once the upstream issues are fixed. 39 | # 40 | # https://github.com/LnL7/nix-darwin/issues/277 41 | # https://github.com/gytis-ivaskevicius/flake-utils-plus/issues/107 42 | "darwin=/etc/nix/inputs/darwin" 43 | ]; 44 | 45 | # Administrative users on Darwin are part of this group. 46 | trustedUsers = ["@admin"]; 47 | }; 48 | 49 | programs.bash = { 50 | # nix-darwin's shell options are very different from those on nixos. there 51 | # is no `promptInit` option, for example. so instead, we throw the prompt 52 | # init line into `interactiveShellInit`. 53 | # 54 | # https://github.com/LnL7/nix-darwin/blob/master/modules/programs/bash/default.nix 55 | interactiveShellInit = '' 56 | eval "$(${pkgs.starship}/bin/starship init bash)" 57 | eval "$(${pkgs.direnv}/bin/direnv hook bash)" 58 | ''; 59 | }; 60 | } 61 | -------------------------------------------------------------------------------- /templates/devos/profiles/core/starship.toml: -------------------------------------------------------------------------------- 1 | [aws] 2 | symbol = " " 3 | 4 | [character] 5 | success_symbol = "[❯](bold purple)" 6 | vicmd_symbol = "[❮](bold purple)" 7 | 8 | [battery] 9 | full_symbol = "" 10 | charging_symbol = "" 11 | discharging_symbol = "" 12 | 13 | [conda] 14 | symbol = " " 15 | 16 | [directory] 17 | style = "cyan" 18 | read_only = " 🔒" 19 | 20 | [docker] 21 | symbol = " " 22 | 23 | [elixir] 24 | symbol = " " 25 | 26 | [elm] 27 | symbol = " " 28 | 29 | [git_branch] 30 | format = "[$symbol$branch]($style) " 31 | symbol = " " 32 | style = "bold dimmed white" 33 | 34 | [git_status] 35 | format = '([「$all_status$ahead_behind」]($style) )' 36 | conflicted = "⚠️" 37 | ahead = "⟫${count} " 38 | behind = "⟪${count}" 39 | diverged = "🔀 " 40 | untracked = "📁 " 41 | stashed = "↪ " 42 | modified = "𝚫 " 43 | staged = "✔ " 44 | renamed = "⇆ " 45 | deleted = "✘ " 46 | style = "bold bright-white" 47 | 48 | [golang] 49 | symbol = " " 50 | 51 | [haskell] 52 | symbol = " " 53 | 54 | [hg_branch] 55 | symbol = " " 56 | 57 | [java] 58 | symbol = " " 59 | 60 | [julia] 61 | symbol = " " 62 | 63 | [memory_usage] 64 | symbol = " " 65 | disabled = false 66 | 67 | [nim] 68 | symbol = " " 69 | 70 | [nix_shell] 71 | format = '[$symbol$state]($style) ' 72 | symbol = " " 73 | pure_msg = "λ" 74 | impure_msg = "⎔" 75 | 76 | [nodejs] 77 | symbol = " " 78 | 79 | [package] 80 | symbol = " " 81 | 82 | [php] 83 | symbol = " " 84 | 85 | [python] 86 | symbol = " " 87 | 88 | [ruby] 89 | symbol = " " 90 | 91 | [rust] 92 | symbol = " " 93 | 94 | [status] 95 | disabled = false 96 | -------------------------------------------------------------------------------- /templates/devos/secrets/secrets.nix: -------------------------------------------------------------------------------- 1 | let 2 | # set ssh public keys here for your system and user 3 | system = ""; 4 | user = ""; 5 | allKeys = [system user]; 6 | in { 7 | "secret.age".publicKeys = allKeys; 8 | } 9 | -------------------------------------------------------------------------------- /templates/devos/shell.nix: -------------------------------------------------------------------------------- 1 | (import ./lib/compat).shellNix 2 | -------------------------------------------------------------------------------- /templates/devos/users/admin/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | hmUsers, 3 | config, 4 | pkgs, 5 | ... 6 | }: let 7 | user = builtins.baseNameOf ./.; 8 | in { 9 | home-manager.users = {inherit (hmUsers) admin;}; 10 | 11 | networking.firewall = { 12 | allowedTCPPorts = [8888 8889]; 13 | allowedUDPPorts = [8888 8889]; 14 | }; 15 | 16 | sops.secrets."users/${user}".neededForUsers = true; 17 | 18 | #Unstbale issue 19 | security.sudo.wheelNeedsPassword = false; 20 | 21 | users.users.admin = { 22 | home = "/home/admin"; 23 | passwordFile = config.sops.secrets."users/${user}".path; 24 | isNormalUser = true; 25 | extraGroups = [ 26 | "wheel" 27 | "audio" 28 | "pulse" 29 | "sound" 30 | "libvirtd" 31 | "video" 32 | "docker" 33 | ]; 34 | # Enable ‘sudo’ for the user. 35 | shell = pkgs.zsh; 36 | uid = 1000; 37 | openssh.authorizedKeys.keys = []; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /templates/devos/users/darwin/default.nix: -------------------------------------------------------------------------------- 1 | {hmUsers, ...}: { 2 | home-manager.users = {inherit (hmUsers) darwin;}; 3 | 4 | users.users.darwin = { 5 | description = "default"; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /templates/devos/users/modules/.flake-keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/templates/devos/users/modules/.flake-keep -------------------------------------------------------------------------------- /templates/devos/users/nixos/default.nix: -------------------------------------------------------------------------------- 1 | {hmUsers, ...}: { 2 | home-manager.users = {inherit (hmUsers) nixos;}; 3 | 4 | users.users.nixos = { 5 | password = "nixos"; 6 | description = "default"; 7 | isNormalUser = true; 8 | extraGroups = ["wheel"]; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /templates/devos/users/profiles/direnv/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs.direnv = { 3 | enable = true; 4 | nix-direnv = { 5 | enable = true; 6 | }; 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /templates/devos/users/profiles/git/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs.git = { 3 | enable = true; 4 | 5 | extraConfig = { 6 | pull.rebase = false; 7 | }; 8 | 9 | aliases = { 10 | a = "add -p"; 11 | co = "checkout"; 12 | cob = "checkout -b"; 13 | f = "fetch -p"; 14 | c = "commit"; 15 | p = "push"; 16 | ba = "branch -a"; 17 | bd = "branch -d"; 18 | bD = "branch -D"; 19 | d = "diff"; 20 | dc = "diff --cached"; 21 | ds = "diff --staged"; 22 | r = "restore"; 23 | rs = "restore --staged"; 24 | st = "status -sb"; 25 | 26 | # reset 27 | soft = "reset --soft"; 28 | hard = "reset --hard"; 29 | s1ft = "soft HEAD~1"; 30 | h1rd = "hard HEAD~1"; 31 | 32 | # logging 33 | lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; 34 | plog = "log --graph --pretty='format:%C(red)%d%C(reset) %C(yellow)%h%C(reset) %ar %C(green)%aN%C(reset) %s'"; 35 | tlog = "log --stat --since='1 Day Ago' --graph --pretty=oneline --abbrev-commit --date=relative"; 36 | rank = "shortlog -sn --no-merges"; 37 | 38 | # delete merged branches 39 | bdm = "!git branch --merged | grep -v '*' | xargs -n 1 git branch -d"; 40 | }; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /templates/devos/users/profiles/lorri/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | services.lorri = { 8 | enable = true; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /templates/devos/users/root/default.nix: -------------------------------------------------------------------------------- 1 | {...}: 2 | # recommend using `hashedPassword` 3 | { 4 | users.users.root.password = ""; 5 | } 6 | -------------------------------------------------------------------------------- /treefmt.toml: -------------------------------------------------------------------------------- 1 | [formatter.nix] 2 | command = "alejandra" 3 | includes = ["*.nix"] 4 | excludes = ["./pkgs/_sources/*"] 5 | 6 | # [formatter.prettier] 7 | # command = "prettier" 8 | # options = ["--plugin", "prettier-plugin-toml", "--write"] 9 | # includes = ["*.md", "*.yaml", "*.toml", "*.json"] 10 | # excludes = ["./pkgs/_sources/*"] 11 | 12 | [formatter.black] 13 | command = "black" 14 | includes = ["*.py"] 15 | 16 | [formatter.shell] 17 | command = "shfmt" 18 | options = [ 19 | "-i", 20 | "2", # indent 2 21 | "-s", # simplify the code 22 | "-w", # write back to the file 23 | 24 | ] 25 | includes = ["*.sh", "*.zsh"] 26 | -------------------------------------------------------------------------------- /users/darwin/default.nix: -------------------------------------------------------------------------------- 1 | {hmUsers, ...}: { 2 | home-manager.users = {gtrun = hmUsers.darwin;}; 3 | 4 | users.users.gtrun = { 5 | description = "default"; 6 | }; 7 | } 8 | -------------------------------------------------------------------------------- /users/dotfiles/.xinitrc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | xsetroot -cursor_name left_ptr 3 | -------------------------------------------------------------------------------- /users/dotfiles/block/Brower-brave/shutup/block-comment.list: -------------------------------------------------------------------------------- 1 | ;;; https://rickyromero.com/shutup/ 2 | 3 | https://www.bilibili.com/* 4 | https://www.bilibili.com/* 5 | -------------------------------------------------------------------------------- /users/dotfiles/block/adguard/custom-filter.list: -------------------------------------------------------------------------------- 1 | /huyaimg.msstatic.com/ 2 | /metric.huya.com/ 3 | ||a.msstatic.com^$important 4 | ||v-huya-img.huya.com^$important 5 | ||vhuya-static.huya.com^$important 6 | ||danmuproxy.douyu.com^$important 7 | ||gift.douyucdn.cn^$important 8 | ||apm.douyucdn.cn^$important 9 | -------------------------------------------------------------------------------- /users/dotfiles/direnv/direnvrc.sh: -------------------------------------------------------------------------------- 1 | if [ "$(uname -r)" == "NixOS" ]; then 2 | source /run/current-system/sw/share/nix-direnv/direnvrc 3 | elif [ "$(uname)" == "Darwin" ]; then 4 | source $HOME/.nix-profile/share/nix-direnv/direnvrc 5 | fi 6 | 7 | use_flake() { 8 | watch_file flake.nix 9 | watch_file flake.lock 10 | eval "$(nix print-dev-env)" 11 | } 12 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((org-mode . ((eval . (setq-local org-attach-id-dir "./.attach")) 2 | ))) 3 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/autoload/misc.el: -------------------------------------------------------------------------------- 1 | ;;; ~/.doom.d/autoload/misc.el -*- lexical-binding: t; -*- 2 | 3 | (defvar current-date-time-format "%a %b %d %H:%M:%S %Z %Y" 4 | 5 | "Format of date to insert with `insert-current-date-time' func 6 | See help of `format-time-string' for possible replacements") 7 | 8 | ;;;###autoload 9 | (defun insert-current-date-time () 10 | "insert the current date and time into current buffer. 11 | Uses `current-date-time-format' for the formatting the date/time." 12 | (interactive) 13 | ;;(insert "==========\n") 14 | ; (insert (let () (comment-start))) 15 | (insert (format-time-string current-date-time-format (current-time))) 16 | ) 17 | 18 | 19 | (defvar current-date-time-format-inactive "[%Y-%m-%d %a %H:%M]" 20 | 21 | 22 | "Format of date to insert with `insert-current-date-time' func 23 | See help of `format-time-string' for possible replacements") 24 | 25 | ;;;###autoload 26 | (defun insert-current-date-time-inactive 27 | () 28 | "insert the current date and time into current buffer. 29 | Uses `current-date-time-format' for the formatting the date/time." 30 | (interactive) 31 | ;;(insert "==========\n") 32 | ; (insert (let () (comment-start))) 33 | (insert (format-time-string current-date-time-format-inactive (current-time))) 34 | ;;(insert "\n") 35 | ) 36 | 37 | 38 | 39 | (defvar current-date-time-format-active "<%Y-%m-%d %a %H:%M>" 40 | 41 | 42 | "Format of date to insert with `insert-current-date-time' func 43 | See help of `format-time-string' for possible replacements") 44 | 45 | ;;;###autoload 46 | (defun insert-current-date-time-active 47 | () 48 | "insert the current date and time into current buffer. 49 | Uses `current-date-time-format' for the formatting the date/time." 50 | (interactive) 51 | ;;(insert "==========\n") 52 | ; (insert (let () (comment-start))) 53 | (insert (format-time-string current-date-time-format-active (current-time))) 54 | ;;(insert "\n") 55 | ) 56 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/bin/clean-git-lock.sh: -------------------------------------------------------------------------------- 1 | if [[ $OSTYPE == "linux-gnu" ]]; then 2 | rm -rf $HOME/.config/guangtao/nixos/overlays/.git/index.lock 3 | elif [[ $OSTYPE == "darwin"* ]]; then 4 | rm -rf $HOME/project/gtrun-profile/.git/modules/dotfiles/emacs/emacs.d/private/emacs-snippets/index.lock 5 | rm -rf ~/Documents/org-notes/.git/modules/course/pcl-cn/index.lock 6 | fi 7 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/bin/emacs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | cd ~/.doom.d 3 | make compile 4 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/hugo.setup: -------------------------------------------------------------------------------- 1 | #+HUGO_BASE_DIR: ~/Documents/my-blog/ 2 | #+HUGO_SECTION: post 3 | #+hugo_custom_front_matter: :author "GTrunSec" 4 | #+options: creator:t author:nil 5 | #+hugo_auto_set_lastmod: t 6 | #+HUGO_categories: profile Doom-Emacs 7 | #+HUGO_tags: Emacs Config 8 | #+PROPERTY: header-args :tangle "~/.emacs.d/init.el" 9 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/lisp/compile.el: -------------------------------------------------------------------------------- 1 | ;;; compile.el --- description -*- lexical-binding: t; -*- 2 | (require 'org) 3 | (org-babel-tangle-file "config.org") 4 | (org-babel-tangle-file "meow.org") 5 | (setq byte-compile-warnings '(not free-vars unresolved noruntime lexical make-local)) 6 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/lisp/nix.el: -------------------------------------------------------------------------------- 1 | ;;; compile.el --- description -*- lexical-binding: t; -*- 2 | (require 'org) 3 | (org-babel-tangle-file "nix.org") 4 | (setq byte-compile-warnings '(not free-vars unresolved noruntime lexical make-local)) 5 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/modules/private/spacemacs-default/buffer.el: -------------------------------------------------------------------------------- 1 | ;;; private/spacemacs-default/buffer.el -*- lexical-binding: t; -*- 2 | 3 | (defun spacemacs/alternate-buffer (&optional window) 4 | "Switch back and forth between current and last buffer in the 5 | current window." 6 | (interactive) 7 | (let ((current-buffer (window-buffer window))) 8 | ;; if no window is found in the windows history, `switch-to-buffer' will 9 | ;; default to calling `other-buffer'. 10 | (switch-to-buffer 11 | (cl-find-if (lambda (buffer) 12 | (not (eq buffer current-buffer))) 13 | (mapcar #'car (window-prev-buffers window)))))) 14 | 15 | 16 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/modules/private/spacemacs-default/config.el: -------------------------------------------------------------------------------- 1 | ;;; private/spacemacs-default/config.el -*- lexical-binding: t; -*- 2 | 3 | 4 | (load! "buffer") 5 | (load! "vinegar") 6 | (load! "misc") 7 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/modules/private/spacemacs-default/misc.el: -------------------------------------------------------------------------------- 1 | ;;; private/spacemacs-default/misc.el -*- lexical-binding: t; -*- 2 | 3 | (defun spacemacs/backward-kill-word-or-region (&optional arg) 4 | "Calls `kill-region' when a region is active and 5 | `backward-kill-word' otherwise. ARG is passed to 6 | `backward-kill-word' if no region is active." 7 | (interactive "p") 8 | (if (region-active-p) 9 | ;; call interactively so kill-region handles rectangular selection 10 | ;; correctly (see https://github.com/syl20bnr/spacemacs/issues/3278) 11 | (call-interactively #'kill-region) 12 | (backward-kill-word arg))) 13 | 14 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/modules/templates/braindumo-blog:braindump.*.setup: -------------------------------------------------------------------------------- 1 | # -*- mode: org; -*- 2 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/modules/templates/braindump-blog:braindump.*.org: -------------------------------------------------------------------------------- 1 | #+TITLE: ${1:Title} 2 | #+AUTHOR: `user-full-name` 3 | #+EMAIL: `user-mail-address` 4 | #+DATE: `(format-time-string "%Y-%m-%d %a %H:%M")` 5 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/modules/templates/emacs-lisp:.*.el: -------------------------------------------------------------------------------- 1 | ;;; `(file-name-nondirectory buffer-file-name)`${1: --- ${2:description}} -*- lexical-binding: t; -*- 2 | 3 | $0 4 | 5 | (provide '`(file-name-base buffer-file-name)`) 6 | ;;; `(file-name-nondirectory buffer-file-name)` ends here -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/modules/templates/git:.*.gitignore: -------------------------------------------------------------------------------- 1 | # -*- mode: gitignore; -*- 2 | 3 | ## nixos 4 | result 5 | 6 | 7 | .DS_Store 8 | dotfiles/emacs/emacs.d/var 9 | dotfiles/emacs/emacs.d/straight 10 | dotfiles/emacs/emacs.d/.* 11 | dotfiles/emacs/emacs.d/librime.so 12 | dotfiles/emacs/emacs.d/setup 13 | dotfiles/emacs/emacs.d/elpa 14 | dotfiles/emacs/emacs.d/pyim/rime 15 | Pattern.org 16 | ##Emacs bookmarks 17 | bm-macos-data 18 | ## Emacs librime config 19 | dotfiles/emacs/emacs.d/pyim/rime/build 20 | dotfiles/emacs/emacs.d/pyim/rime/easy_en.userdb 21 | dotfiles/emacs/emacs.d/pyim/rime/easy_en.userdb.old 22 | dotfiles/emacs/emacs.d/pyim/rime/luna_pinyin.userdb 23 | dotfiles/emacs/emacs.d/pyim/rime/luna_pinyin.userdb.old 24 | dotfiles/emacs/emacs.d/pyim/scel2pyim/scel2pyim 25 | dotfiles/emacs/emacs.d/liberime.so 26 | dotfiles/emacs/emacs.d/pyim/rime/user.yaml 27 | 28 | ## lsp 29 | 30 | dotfiles/emacs/emacs.d/mspyls 31 | dotfiles/emacs/emacs.d/SessionDesktop.el 32 | 33 | 34 | #latex 35 | _minted-math 36 | #lang-python 37 | *.pyg 38 | 39 | #lang-R 40 | 41 | .Rhistory -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/modules/templates/go-mode:.*.go: -------------------------------------------------------------------------------- 1 | package ${1:main} 2 | 3 | import ( 4 | $2 5 | ) 6 | 7 | func main() { 8 | $0 9 | } 10 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/modules/templates/my-blog:posts.*.org: -------------------------------------------------------------------------------- 1 | #+TITLE: ${1:Title} 2 | #+AUTHOR: `user-full-name` 3 | #+EMAIL: `user-mail-address` 4 | #+DATE: `(format-time-string "%Y-%m-%d %a %H:%M")` 5 | #+SETUPFILE: ./hugo.local 6 | #+SETUPFILE: ./theme-readtheorg.setup 7 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/conf-toml-mode/commands: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: commands 3 | # key: c 4 | # -- 5 | [[commands]] 6 | name = "$1" 7 | category = "" 8 | command = "" 9 | help = "" -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/emacs-lisp-mode/org-package: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: org 3 | # uuid: 4 | # key: org 5 | # condition: t 6 | # -- 7 | (package! org 8 | :recipe (:host github 9 | :repo "yantar92/org" 10 | :branch "feature/org-fold" 11 | :files ("*.el" "lisp/*.el" "contrib/lisp/*.el" "contrib/scripts") 12 | :build t 13 | :pre-build 14 | (with-temp-file "org-version.el" 15 | (insert "(defun org-release () \"9.5\")\n" 16 | (format "(defun org-git-version (&rest _) \"9.5-%s\")\n" 17 | (cdr (doom-call-process "git" "rev-parse" "--short" "HEAD"))) 18 | "(provide 'org-version)\n"))) 19 | ) 20 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/envrc-file-mode/nix: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: nix 3 | # uuid: 4 | # key: nix 5 | # condiixtion: t 6 | # -- 7 | watch_file flake.nix flake.lock 8 | { 9 | # shell gc root dir 10 | mkdir -p "$(direnv_layout_dir)" 11 | eval "$(nix print-dev-env --no-update-lock-file --no-write-lock-file --profile $(direnv_layout_dir)/flake-profile)" 12 | } || use nix 13 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/nix-mode/l: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: l 3 | # uuid: 4 | # key: l 5 | # condition: t 6 | # -- 7 | l = inputs.nixpkgs.lib // builtins; -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/nix-mode/machix-head: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: machix to head 3 | # key: mach 4 | # condition: t 5 | # -- 6 | {pkgs}: 7 | with builtins; 8 | let 9 | pypi_fetcher_src = import (builtins.fetchTarball { 10 | name = "nix-pypi-fetcher"; 11 | url = "https://github.com/DavHau/nix-pypi-fetcher/tarball/0d94c66e7b259f4dba0a7c5121d1f611f93bdfc8"; 12 | # Hash obtained using `nix-prefetch-url --unpack ` 13 | sha256 = "1s1jag3cm2i05jraa9g42hfd3ya1x9ca3zdb2g5nnvzq5x52wwnx"; 14 | }){inherit pkgs;}; 15 | 16 | fetchPypi = pypi_fetcher_src.fetchPypi; 17 | fetchPypiWheel = pypi_fetcher_src.fetchPypiWheel; 18 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/nix-mode/machix-python: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: mach-nix to python 3 | # key: macp 4 | # condition: t 5 | # -- 6 | {pkgs}: 7 | let 8 | result = import ./machnix.nix {inherit pkgs;}; 9 | python = pkgs.python37; 10 | manylinux1 = pkgs.pythonManylinuxPackages.manylinux1; 11 | overrides = result.overrides manylinux1 pkgs.autoPatchelfHook; 12 | py = pkgs.python37.override { packageOverrides = overrides; }; 13 | in 14 | py.withPackages (ps: result.select_pkgs ps) 15 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/nix-mode/nocargo: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: nocargo 3 | # uuid: 4 | # key: nocargo 5 | # condition: t 6 | # -- 7 | { 8 | description = "Rust crate deploy-rs"; 9 | 10 | inputs = { 11 | nixpkgs.url = "nixpkgs/nixos-unstable"; 12 | flake-utils.url = "github:numtide/flake-utils"; 13 | rust-overlay = { 14 | url = "github:oxalica/rust-overlay"; 15 | inputs.nixpkgs.follows = "nixpkgs"; 16 | inputs.flake-utils.follows = "flake-utils"; 17 | }; 18 | nocargo = { 19 | url = "github:oxalica/nocargo"; 20 | inputs.nixpkgs.follows = "nixpkgs"; 21 | inputs.registry-crates-io.follows = "registry-crates-io"; 22 | }; 23 | 24 | registry-crates-io = { url = "github:rust-lang/crates.io-index"; flake = false; }; 25 | }; 26 | 27 | outputs = { nixpkgs, flake-utils, rust-overlay, nocargo, ... }@inputs: 28 | flake-utils.lib.eachDefaultSystem (system: 29 | let 30 | pkgs = import nixpkgs { 31 | inherit system; 32 | overlays = [ rust-overlay.overlays.default nocargo.overlay ]; 33 | }; 34 | 35 | rustc = pkgs.rust-bin.stable.latest.minimal; 36 | 37 | in 38 | rec { 39 | defaultPackage = packages."$1"; 40 | defaultApp = defaultPackage.bin; 41 | 42 | packages."$2" = pkgs.nocargo.buildRustCrateFromSrcAndLock { 43 | src = ./.; 44 | inherit rustc; 45 | }; 46 | }); 47 | } 48 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/nix-mode/python-replace: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: py replace 3 | # uuid: 4 | # key: pr 5 | # condition: t 6 | # -- 7 | --replace "$1" "$2" \ -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/nix-mode/rule: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: rule 3 | # uuid: 4 | # key: _r 5 | # condition: t 6 | # -- 7 | schemas.result.rule = { 8 | "0" = ""; 9 | "1" = ""; 10 | "-1" = ""; 11 | }; -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/+[]: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: +[ ] 3 | # key: +[ 4 | 5 | # -- 6 | 7 | + [ ] [$1 8 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/-[]: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: -[ ] 3 | # key: -[ 4 | # -- 5 | - [ ] [$1 -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/.[]: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: [ ] [] 3 | # key: [] 4 | # -- 5 | [ ] [] -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/R-src: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: R_src 3 | # key: Ro 4 | # -- 5 | #+begin_src R :results file :exports both 6 | $1 7 | #+end_src 8 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/asciinema: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: as 3 | # key: as 4 | # -- 5 | 6 | #+begin_export md 7 | {{< asciinema key="$1" rows="10" preload="1" >}} 8 | #+end_export 9 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/attr_html: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: atth 3 | # key: atth 4 | # -- 5 | #+attr_html: :width 300 :height 300 6 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/audio_list: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: au 3 | # key: au 4 | # -- 5 |
  • 6 | $2
  • -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/conf: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: conf 3 | # key: conf 4 | # -- 5 | #+begin_src conf :exports both :tangle "~/.config/guangtao/dotfiles/" 6 | 7 | #+end_src 8 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/config.el: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: config.el 3 | # key: cfg 4 | # -- 5 | #+begin_src emacs-lisp :tangle "config.el" 6 | $1 7 | #+end_src -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/ein-R: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: jupyter-R 3 | # key: eR 4 | # -- 5 | #+BEGIN_SRC ein-R :session localhost :exports both :results raw drawer 6 | $1 7 | #+END_SRC -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/ein-haskell: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: ein-haskell 3 | # uuid: 4 | # key: eh 5 | # condition: t 6 | # -- 7 | #+begin_src ein-haskell :session localhost :exports both 8 | $1 9 | #+end_src 10 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/ein-julia: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: jupyter-julia 3 | # key: ej 4 | # -- 5 | #+BEGIN_SRC ein-julia :session localhost :exports both :results raw drawer 6 | $1 7 | #+end_src -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/ein-python: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: ein-python 3 | # key: ep 4 | # -- 5 | #+BEGIN_SRC ein-python :session localhost :exports both :results output 6 | $1 7 | #+END_SRC 8 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/ein-rust: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: ein-rust 3 | # uuid: 4 | # key: er 5 | # condition: t 6 | # -- 7 | #+begin_src ein-rust :session localhost :exports both 8 | $1 9 | #+end_src 10 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/git-update-master: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: git-update 3 | # key: gu 4 | # -- 5 | cd $1 6 | TODAY=$(date) 7 | HOST=$(hostname) 8 | echo $TODAY 9 | echo $HOST 10 | git fetch origin master 11 | git pull origin master -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/git-upstram: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: git-upstream 3 | # key: gus 4 | # -- 5 | cd $1 6 | TODAY=$(date) 7 | HOST=$(hostname) 8 | echo $TODAY 9 | echo $HOST 10 | git fetch upstream master 11 | git pull upstream master -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/go-src: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: go-src 3 | # key: go 4 | # -- 5 | #+begin_src go :exports both :results output :async nil 6 | $1 7 | #+end_src 8 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/gtrun_blog: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: ~/project/blog/static/ 3 | # key: ~/project/blog/static/ 4 | # -- 5 | https://www.gtrun.org/ -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/haskell-src: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: haskell-src 3 | # key: ho 4 | # -- 5 | #+begin_src haskell :exports both :results output 6 | $1 7 | #+end_src 8 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/home-manager-src: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: home-manager org-babel 3 | # key: hm 4 | # condition: t 5 | # -- 6 | #+begin_src nix :exports both :tangle "~/.config/guangtao/home-manager/" 7 | $1 8 | #+end_src 9 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/html-image: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: html-image size 3 | # key: hi 4 | # -- 5 | #+NAME: $2 6 | #+CAPTION: $3 7 | #+ATTR_HTML: :width 500 $1 8 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/info: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: info 3 | # key: info 4 | # -- 5 | TODAY=$(date) 6 | HOST=$(hostname) 7 | echo $TODAY 8 | echo $HOST -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/item-price: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: Item price 3 | # uuid: 4 | # key: ip 5 | # condition: t 6 | # -- 7 | Item price: $1 -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/julia-src: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: julia 3 | # key: jo 4 | # -- 5 | #+begin_src julia :async :exports both :results output 6 | $1 7 | #+end_src -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/lambda-nixops-infra-list: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: infra list 3 | # key: il 4 | # -- 5 | + [ ] [nixpkgs] 6 | + [ ] [nixos] 7 | - [ ] [micro-vm] 8 | - [ ] [module] 9 | + [ ] [nomad] 10 | - [ ] [docker] 11 | - [ ] [podmad] 12 | - [ ] [qemu] 13 | - [ ] [nix] 14 | + [ ] [makes] 15 | - [ ] [release] 16 | - [ ] [dev] 17 | - [ ] [staging] 18 | + [ ] [Nickel] 19 | - [ ] [dockerFile] 20 | - [ ] [nomad] 21 | - [ ] [kubernetes] 22 | + [ ] [github] 23 | - [ ] [internal] 24 | - [ ] [runner] 25 | + [ ] [CUE] 26 | - [ ] [dockerFile] 27 | - [ ] [nomad] 28 | - [ ] [kubernetes] -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/logseq-embed-id: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: logseq-embed-id 3 | # key: lei 4 | # -- 5 | - {{{embed(($1))}}} -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/logseq-public: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: logseq-public 3 | # key: :p 4 | # condition: t 5 | # -- 6 | :public: true -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/logseq-vedio: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: logseq-vedio 3 | # key: lv 4 | # -- 5 | 6 | [:div.videoWrapper.mb-4 7 | [:iframe 8 | {:allowFullScreen "allowfullscreen" 9 | :allow 10 | "accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" 11 | :frameBorder "0" 12 | :src "https://www.youtube.com/embed/$1" 13 | :height "367" 14 | :width "653"}]] 15 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/nix-src: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: nix 3 | # uuid: nix-src 4 | # key: no 5 | # condition: t 6 | # -- 7 | #+begin_src nix :exports both :results output 8 | $1 9 | #+end_src -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/nixos-flk-conf: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: nixos-flk conf 3 | # key: nf 4 | # condition: t 5 | # -- 6 | #+begin_src nix :exports both :tangle "~/.config/guangtao/nixos-flk/" 7 | $1 8 | #+end_src 9 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/nixos-host: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: nixos 3 | # key: nixos 4 | # -- 5 | 10.220.170.137 -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/org-super-link-type: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: org-superlink type 3 | # key: -l 4 | # -- 5 | 6 | - `(insert-current-date-time-inactive)` -> $1 7 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/pdf-image: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: pdf-image size 3 | # key: pi 4 | # -- 5 | #+NAME: $1 6 | #+CAPTION: $2 7 | #+ATTR_ORG: :width 600 8 | #+ATTR_LATEX: :width 5in 9 | $0 10 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/property-header-dir: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: PROPERTIES header dir 3 | # key: phd 4 | # condition: t 5 | # -- 6 | :PROPERTIES: 7 | :header-args:sh: :dir ./$1 8 | :END: 9 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/property-template-habit: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: property-template-habit 3 | # key: pth 4 | # condition: t 5 | # -- 6 | :PROPERTIES: 7 | :STYLE: habit 8 | :LAST_REPEAT: 9 | :END: 10 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/python-src: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name:python-src 3 | # key: po 4 | # -- 5 | #+begin_src python :results output :async 6 | $1 7 | #+end_src -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/python-val: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: python-val 3 | # key: pval 4 | # -- 5 | #+tblname: data_table 6 | $1 7 | #+begin_src python :var val=1 :var data=data_table 8 | # Return row specified by val. 9 | # In non-session mode, use return to return results. 10 | $2 11 | # return(data[val]) 12 | #+end_src -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/rust-src: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: rust-src 3 | # key: ro 4 | # condition: t 5 | # -- 6 | #+begin_src rust :exports both :crates 7 | $1 8 | #+end_src -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/org-mode/shell-src: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: sh 3 | # key: sh 4 | # -- 5 | #+begin_src sh :async :exports both :results output 6 | $1 7 | #+end_src 8 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/snippets/yaml-mode/gh-nix: -------------------------------------------------------------------------------- 1 | # -*- mode: snippet -*- 2 | # name: ghnix 3 | # uuid: 4 | # key: ghnix 5 | # condition: t 6 | # -- 7 | - name: Update nix verison of GH 8 | run: nix -Lv run github:hardenedlinux/nixpkgs-hardenedlinux#gh-nix-update 9 | -------------------------------------------------------------------------------- /users/dotfiles/doom-emacs/theme-readtheorg.setup: -------------------------------------------------------------------------------- 1 | # -*- mode: org; -*- 2 | 3 | #+HTML_HEAD: 4 | 5 | #+HTML_HEAD: 6 | #+HTML_HEAD: 7 | #+HTML_HEAD: 8 | #+HTML_HEAD: 9 | 10 | #+HTML_HEAD: 11 | -------------------------------------------------------------------------------- /users/dotfiles/i3/i3-test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -euo pipefail 3 | 4 | #!/bin/sh 5 | 6 | # i3-get-window-criteria - Get criteria for use with i3 config commands 7 | 8 | # To use, run this script, then click on a window. 9 | # Output is in the format: [= = ...] 10 | 11 | # Known problem: when WM_NAME is used as fallback for the 'title=""' criterion, 12 | # quotes in "" are not escaped properly. This is a problem with the output of `xprop`, 13 | # reported upstream: https://bugs.freedesktop.org/show_bug.cgi?id=66807 14 | 15 | PROGNAME=$(basename "$0") 16 | 17 | # Check for xwininfo and xprop 18 | for cmd in xwininfo xprop; do 19 | if ! which $cmd >/dev/null 2>&1; then 20 | echo "$PROGNAME: $cmd: command not found" >&2 21 | exit 1 22 | fi 23 | done 24 | 25 | match_int='[0-9][0-9]*' 26 | match_string='".*"' 27 | match_qstring='"[^"\\]*(\\.[^"\\]*)*"' # NOTE: Adds 1 backreference 28 | 29 | { 30 | # Run xwininfo, get window id 31 | window_id=$(xwininfo -int | sed -nre "s/^xwininfo: Window id: ($match_int) .*$/\1/p") 32 | echo "id=$window_id" 33 | 34 | # Run xprop, transform its output into i3 criteria. Handle fallback to 35 | # WM_NAME when _NET_WM_NAME isn't set 36 | xprop -id $window_id | 37 | sed -nr \ 38 | -e "s/^WM_CLASS\(STRING\) = ($match_qstring), ($match_qstring)$/instance=\1\nclass=\3/p" \ 39 | -e "s/^WM_WINDOW_ROLE\(STRING\) = ($match_qstring)$/window_role=\1/p" \ 40 | -e "/^WM_NAME\(STRING\) = ($match_string)$/{s//title=\1/; h}" \ 41 | -e "/^_NET_WM_NAME\(UTF8_STRING\) = ($match_qstring)$/{s//title=\1/; h}" \ 42 | -e '${g; p}' 43 | } | sort | tr "\n" " " | sed -r 's/^(.*) $/[\1]\n/' 44 | -------------------------------------------------------------------------------- /users/dotfiles/i3/move-cursor-window-center.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | eval i3-msg $* 3 | HERE=$(xdotool getwindowfocus) 4 | 5 | ULX=$(xwininfo -id $HERE | grep " Absolute upper-left X:" | awk '{print $4}') 6 | ULY=$(xwininfo -id $HERE | grep " Absolute upper-left Y:" | awk '{print $4}') 7 | 8 | if [ $ULX != "-1" -o $ULY != "-1" ]; then 9 | eval $(xdotool getwindowgeometry --shell $HERE) 10 | 11 | NX=$(expr $WIDTH / 2) 12 | NY=$(expr $HEIGHT / 2) 13 | 14 | xdotool mousemove --window $WINDOW $NX $NY 15 | fi 16 | -------------------------------------------------------------------------------- /users/dotfiles/kde/kded5rc: -------------------------------------------------------------------------------- 1 | [Module-device_automounter] 2 | autoload=false 3 | -------------------------------------------------------------------------------- /users/dotfiles/kde/kwalletrc: -------------------------------------------------------------------------------- 1 | [Wallet] 2 | Enabled=false 3 | 4 | 5 | -------------------------------------------------------------------------------- /users/dotfiles/kitty/cscheme.conf: -------------------------------------------------------------------------------- 1 | # [[https://github.com/MartinSeeler/iterm2-material-design][MartinSeeler/iterm2-material-design: A theme / color scheme for iTerm2 based on Google's Material Design Color Palette]] 2 | # [[https://github.com/evicinelli/Dotfiles/blob/master/kitty/.config/kitty/kitty.conf][Dotfiles/kitty.conf at master · evicinelli/Dotfiles]] 3 | foreground #ECEFF1 4 | background #263238 5 | cursor #A7FDEB 6 | # url_color #0075c9 7 | # cursor_text_color #fff8e7 8 | # inactive_border_color #fff8e7 9 | # inactive_tab_background #fff8e7 10 | # selection_foreground #fff8e7 11 | # active_border_color #485a62 12 | # active_tab_background #485a62 13 | # foreground #485a62 14 | # inactive_tab_foreground #485a62 15 | # selection_background #485a62 16 | # cursor #364850 17 | # bell_border_color #c44756 18 | # url_color #0075c9 19 | 20 | color0 #546E7A 21 | color1 #FF5252 22 | color2 #5CF19E 23 | color3 #FFD740 24 | color4 #40C4FF 25 | color5 #FF4081 26 | color6 #64FCDA 27 | color7 #FFFFFF 28 | color8 #B0BEC5 29 | color9 #FF8A80 30 | color10 #B9F6CA 31 | color11 #FFE57F 32 | color12 #80D8FF 33 | color13 #FF80AB 34 | color14 #A7FDEB 35 | color15 #FFFFFF -------------------------------------------------------------------------------- /users/dotfiles/kitty/kitty.conf: -------------------------------------------------------------------------------- 1 | # Font ❤ 2 | font_family Fantasque Sans Mono 3 | font_size 40 4 | 5 | 6 | map ctrl+shift+1 goto_tab 1 7 | map shift+ctrl+2 goto_tab 2 8 | map shift+ctrl+3 goto_tab 3 9 | map shift+ctrl+4 goto_tab 4 10 | map shift+ctrl+5 goto_tab 5 11 | map shift+ctrl+6 goto_tab 6 12 | 13 | map alt+shift+1 first_window 14 | map alt+shift+2 second_window 15 | map alt+shift+3 third_window 16 | map alt+shift+4 fourth_window 17 | map alt+shift+5 fifth_window 18 | map alt+shift+6 sixth_window 19 | map alt+shift+7 seventh_window 20 | 21 | # Kitty option 22 | background_opacity 0.85 23 | remember_window_size yes 24 | adjust_line_height 150% 25 | 26 | # Colorscheme 27 | include ~/.config/guangtao/dotfiles/kitty/cscheme.conf 28 | #include ~/.config/kitty/solarized.conf 29 | 30 | 31 | 32 | new_tab my tab 33 | cd ~/org-notes 34 | # Set the layouts allowed in this tab 35 | enabled_layouts tall, stack 36 | # Set the current layout 37 | layout tall 38 | launch fish 39 | kitty +kitten clipboard --get-clipboard 40 | echo hooray | kitty +kitten clipboard 41 | -------------------------------------------------------------------------------- /users/dotfiles/kitty/solarized.conf: -------------------------------------------------------------------------------- 1 | Base16 Solarized Light - kitty color config 2 | # Scheme by Ethan Schoonover (modified by aramisgithub) 3 | # background #fdf6e3 4 | # foreground #586e75 5 | selection_background #586e75 6 | selection_foreground #fdf6e3 7 | url_color #657b83 8 | cursor #586e75 9 | active_border_color #839496 10 | inactive_border_color #eee8d5 11 | active_tab_background #fdf6e3 12 | active_tab_foreground #586e75 13 | inactive_tab_background #eee8d5 14 | inactive_tab_foreground #657b83 15 | 16 | # normal 17 | color0 #fdf6e3 18 | color0 #ece5d2 19 | color1 #dc322f 20 | color2 #859900 21 | color3 #b58900 22 | color4 #268bd2 23 | color5 #6c71c4 24 | color6 #2aa198 25 | color7 #586e75 26 | 27 | # bright 28 | color8 #839496 29 | color9 #dc322f 30 | color10 #859900 31 | color11 #b58900 32 | color12 #268bd2 33 | color13 #6c71c4 34 | color14 #2aa198 35 | color15 #586e75 36 | 37 | # extended base16 colors 38 | color16 #cb4b16 39 | color17 #d33682 40 | color18 #eee8d5 41 | color19 #93a1a1 42 | color20 #657b83 43 | color21 #073642 -------------------------------------------------------------------------------- /users/dotfiles/lsyncd.conf: -------------------------------------------------------------------------------- 1 | --[[ 2 | The _extra= hack allows synchronization of individual files. Use one sync {} 3 | stanza per source directory. Use additional --include= lines to handle multiple 4 | files within a single source directory. 5 | ]] 6 | 7 | sync { 8 | default.rsync, 9 | delay = 0, 10 | source = "/home/gtrun/.config/guangtao/nixos-flk/users/dotfiles/doom-emacs", 11 | target = "/home/gtrun/Documents/org-notes/braindump", 12 | rsync = { 13 | _extra = { 14 | "--include=config.org", 15 | "--exclude=*", 16 | } 17 | } 18 | } 19 | sync { 20 | default.rsync, 21 | delay = 0, 22 | source = "/home/gtrun/ghq", 23 | target = "/DATABASE-4TB/ghq", 24 | rsync = { 25 | _extra = { 26 | "--include=*", 27 | } 28 | } 29 | } 30 | sync { 31 | default.rsync, 32 | delay = 0, 33 | source = "/home/gtrun/.emacs.d/.local/straight/", 34 | target = "/DATABASE-4TB/emacs-backup", 35 | rsync = { 36 | _extra = { 37 | "--include=*", 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /users/dotfiles/my-font/MacFSGB2312.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/my-font/MacFSGB2312.ttf -------------------------------------------------------------------------------- /users/dotfiles/my-font/MacFZXBSGBK.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/my-font/MacFZXBSGBK.ttf -------------------------------------------------------------------------------- /users/dotfiles/my-font/MacFZXBSJT.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/my-font/MacFZXBSJT.ttf -------------------------------------------------------------------------------- /users/dotfiles/my-font/MacKTGB2312.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/my-font/MacKTGB2312.ttf -------------------------------------------------------------------------------- /users/dotfiles/my-font/WeibeiSC-Bold.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/my-font/WeibeiSC-Bold.otf -------------------------------------------------------------------------------- /users/dotfiles/my-font/icomoon-feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/my-font/icomoon-feather.ttf -------------------------------------------------------------------------------- /users/dotfiles/omf/bundle: -------------------------------------------------------------------------------- 1 | package https://github.com/otms61/fish-pet 2 | theme default 3 | theme https://github.com/oh-my-fish/theme-batman 4 | -------------------------------------------------------------------------------- /users/dotfiles/omf/channel: -------------------------------------------------------------------------------- 1 | stable 2 | -------------------------------------------------------------------------------- /users/dotfiles/omf/theme: -------------------------------------------------------------------------------- 1 | batman 2 | -------------------------------------------------------------------------------- /users/dotfiles/pet/config.toml: -------------------------------------------------------------------------------- 1 | [General] 2 | snippetfile = "/home/gtrun/.config/guangtao/nixos-flk/users/dotfiles/pet/snippet.toml" 3 | editor = "emacsclient -nw" 4 | column = 40 5 | selectcmd = "fzf --ansi" 6 | backend = "gist" 7 | sortby = "" 8 | 9 | [Gist] 10 | file_name = "pet-snippet.toml" 11 | access_token = "" 12 | gist_id = "" 13 | public = false 14 | auto_sync = false 15 | 16 | [GitLab] 17 | file_name = "pet-snippet.toml" 18 | access_token = "" 19 | url = "" 20 | id = "" 21 | visibility = "private" 22 | auto_sync = false 23 | -------------------------------------------------------------------------------- /users/dotfiles/pet/darwin-config.toml: -------------------------------------------------------------------------------- 1 | [General] 2 | snippetfile = "/Users/gtrun/.config/nixpkgs/nixos-flk/users/dotfiles/pet/snippet.toml" 3 | editor = "emacs" 4 | column = 40 5 | selectcmd = "fzf --ansi" 6 | backend = "gist" 7 | sortby = "" 8 | 9 | [Gist] 10 | file_name = "pet-snippet.toml" 11 | access_token = "" 12 | gist_id = "" 13 | public = false 14 | auto_sync = false 15 | 16 | [GitLab] 17 | file_name = "pet-snippet.toml" 18 | access_token = "" 19 | url = "" 20 | id = "" 21 | visibility = "private" 22 | auto_sync = false 23 | -------------------------------------------------------------------------------- /users/dotfiles/pet/snippet.toml: -------------------------------------------------------------------------------- 1 | [[snippets]] 2 | description = "shadowsocks lib" 3 | command = "ss-local -c ~/.config/ss/config.json" 4 | output = "" 5 | 6 | [[snippets]] 7 | description = "cut zeek log" 8 | command = "cat | zeek-cut " 9 | output = "" 10 | 11 | ###vast 12 | [[snippets]] 13 | description = "zeek|vast: import zeek logs to vast" 14 | command = "zcat | vast import zeek" 15 | output = "" 16 | 17 | [[snippets]] 18 | description = "zeek|vast: export zeek logs filtered by addr " 19 | command = " vast export zeek ':addr in '" 20 | output = "" 21 | 22 | [[snippets]] 23 | description = "docker: clean regex" 24 | command = "docker rmi (docker images --filter=reference='' -q)" 25 | output = "" 26 | 27 | ### deepsea 28 | [[snippets]] 29 | description = "deepsea: Inline CSS with template" 30 | command = "deepsea --config template.yaml content inline" 31 | output = "" 32 | 33 | [[snippets]] 34 | description = "deepsea: Create a TXT verson from the HTML version (.ttpl)" 35 | command = "deepsea --config template.yaml content multipart" 36 | output = "" 37 | 38 | [[snippets]] 39 | description = "deepsea-Step1: create DB and createtable " 40 | command = "deepsea -t --config template.yaml storage -D template.db manager -T createtable" 41 | output = "if this command failed, you can touch a db .db file" 42 | 43 | [[snippets]] 44 | description = "deepsea: load marks from CSV" 45 | command = "deepsea -t --config template.yaml " 46 | 47 | [[snippets]] 48 | description = "deepsea: show the marks are loaded" 49 | command = "deepsea --config template.yaml storage -d template.db manager -T showmarks" 50 | output = "" 51 | 52 | [[snippets]] 53 | description = "deepsea: mailclient" 54 | command = "deepsea mailclient --config template.yaml" 55 | output = "" 56 | -------------------------------------------------------------------------------- /users/dotfiles/polybar/Scripts/bbswitch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Script criado para ser usado como modulo para o polybar, 4 | # vai dizer se a placa nvidia está em uso ou não. 5 | 6 | if [ -e /proc/acpi/bbswitch ]; then 7 | if grep -qs "ON" /proc/acpi/bbswitch; then 8 | echo " Nvidia %{F#7FFF00}  %{F-} " 9 | else 10 | echo " Nvidia %{F#7FFF00}  %{F-} " 11 | fi 12 | fi 13 | -------------------------------------------------------------------------------- /users/dotfiles/polybar/Scripts/player-moc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Change according to information you wish to show in your polybar: 4 | # %state State 5 | # %file File 6 | # %title Title 7 | # %artist Artist 8 | # %song SongTitle 9 | # %album Album 10 | # %tt TotalTime 11 | # %tl TimeLeft 12 | # %ts TotalSec 13 | # %ct CurrentTime 14 | # %cs CurrentSec 15 | # %b Bitrate 16 | # %r Rate 17 | 18 | if [ "$(mocp -Q %state)" != "STOP" ]; then 19 | SONG=$(mocp -Q %song) 20 | 21 | if [ -n "$SONG" ]; then 22 | echo "$SONG - $(mocp -Q %album)" 23 | else 24 | basename "$(mocp -Q %file)" 25 | fi 26 | else 27 | echo "" 28 | fi 29 | -------------------------------------------------------------------------------- /users/dotfiles/polybar/Scripts/uptime.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | uptime | sed 's/up //; s/\ days\?,/d/; s/\ hours\?,\?/h/; s/\ minutes\?/m/' 3 | -------------------------------------------------------------------------------- /users/dotfiles/polybar/launch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Terminate already running bar instances 4 | kill -9 $(pgrep polybar) 5 | # Wait until the processes have been shut down 6 | while pgrep -x polybar >/dev/null; do sleep 1; done 7 | 8 | # Launch bar1 and bar2 9 | for monitor in $(polybar --list-monitors | cut -d ":" -f1); do 10 | MONITOR=$monitor polybar top --reload --quiet & 11 | MONITOR=$monitor polybar bottom --reload --quiet & 12 | done 13 | 14 | echo "Bars launched..." 15 | dunstify -u low "Bars launched" 16 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/config.rasi: -------------------------------------------------------------------------------- 1 | /** Basic config file **/ 2 | 3 | configuration { 4 | show-icons: true; 5 | icon-theme: "Papirus"; 6 | } 7 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/launcher.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ## Author : Aditya Shakya 4 | ## Mail : adi1090x@gmail.com 5 | ## Github : @adi1090x 6 | ## Twitter : @adi1090x 7 | 8 | # Available Styles 9 | # >> Created and tested on : rofi 1.6.0-1 10 | # 11 | # blurry blurry_full kde_simplemenu kde_krunner launchpad 12 | # gnome_do slingshot appdrawer appdrawer_alt appfolder 13 | # column row row_center screen row_dock row_dropdown 14 | 15 | theme="screen" 16 | dir="$HOME/.config/rofi/themes" 17 | 18 | case "$1" in 19 | "drun") 20 | shift 1 21 | rofi -no-lazy-grab -show drun -modi drun -theme $dir/"blurry.rasi" 22 | ;; 23 | "window") 24 | shift 1 25 | rofi -no-lazy-grab -show window -modi window -theme $dir/"blurry.rasi" 26 | ;; 27 | "run") 28 | shift 1 29 | rofi -no-lazy-grab -show run -modi run -theme $dir/"blurry.rasi" 30 | ;; 31 | esac 32 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/powermenu/confirm.rasi: -------------------------------------------------------------------------------- 1 | /* Confirm Dialog */ 2 | 3 | @import "styles/colors.rasi" 4 | 5 | * { 6 | background-color: @background; 7 | text-color: @foreground; 8 | font: "FantasqueSansMono Nerd Font 50"; 9 | } 10 | 11 | 12 | window { 13 | width: 1080px; 14 | padding: 50px; 15 | border: 1px; 16 | border-radius: 0px; 17 | border-color: @border; 18 | location: center; 19 | y-offset: -2em; 20 | } 21 | 22 | entry { 23 | expand: true; 24 | text-color: @border; 25 | } 26 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/powermenu/message.rasi: -------------------------------------------------------------------------------- 1 | /* Message Dialog */ 2 | 3 | @import "styles/colors.rasi" 4 | 5 | * { 6 | background-color: @background; 7 | text-color: @foreground; 8 | font: "FantasqueSansMono Nerd Font 50"; 9 | } 10 | 11 | 12 | window { 13 | width: 1080px; 14 | padding: 30px; 15 | border: 1px; 16 | border-radius: 0px; 17 | border-color: @border; 18 | location: center; 19 | y-offset: -2em; 20 | } 21 | 22 | entry { 23 | expand: true; 24 | text-color: @border; 25 | } 26 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/powermenu/styles/berry.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #280F28ff; 3 | background-alt: #2D142Cff; 4 | foreground: #ffffffA6; 5 | border: #EE4540ff; 6 | border-alt: #C92A42ff; 7 | selected: #510A3299; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/powermenu/styles/bluish.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #EFF0F1FF; 3 | background-alt: #E3E3E3FF; 4 | foreground: #000000A6; 5 | border: #000B83FF; 6 | border-alt: #3DAEE9FF; 7 | selected: #93CEE9FF; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/powermenu/styles/cocoa.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #3C3945FF; 3 | background-alt: #413E4Aff; 4 | foreground: #F7C7B2ff; 5 | border: #B38184ff; 6 | border-alt: #F3B69Eff; 7 | selected: #B381841a; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/powermenu/styles/colors.rasi: -------------------------------------------------------------------------------- 1 | /* 2 | * Change the colorscheme for every menu simply by editing this file... 3 | * 4 | * Available Color Schemes 5 | * 6 | * bluish berry nordic nightly gotham mask faded cocoa 7 | * 8 | */ 9 | 10 | @import "nightly.rasi" 11 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/powermenu/styles/faded.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #57678CFF; 3 | background-alt: #5E6C91ff; 4 | foreground: #FFFCFFff; 5 | border: #FF83A7ff; 6 | border-alt: #F4BB6Cff; 7 | selected: #A0B5F44c; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/powermenu/styles/gotham.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #24334Aff; 3 | background-alt: #29384Fff; 4 | foreground: #FEFFF1ff; 5 | border: #3A6081ff; 6 | border-alt: #715979ff; 7 | selected: #C46C854C; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/powermenu/styles/mask.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #3E4667ff; 3 | background-alt: #434C6Dff; 4 | foreground: #FAF7CCff; 5 | border: #CA8CA5ff; 6 | border-alt: #F0B2B3ff; 7 | selected: #EFD4B61a; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/powermenu/styles/nightly.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #25344Bff; 3 | background-alt: #2A3950ff; 4 | foreground: #FEFFF1ff; 5 | border: #A162F7ff; 6 | border-alt: #45E3FFff; 7 | selected: #6F88FE1a; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /users/dotfiles/rofi/themes/powermenu/styles/nordic.rasi: -------------------------------------------------------------------------------- 1 | * { 2 | background: #425775ff; 3 | background-alt: #475C7Bff; 4 | foreground: #ffffffcc; 5 | border: #FDBB6Dff; 6 | border-alt: #DA717Fff; 7 | selected: #685E79ff; 8 | urgent: #DA4453FF; 9 | } 10 | -------------------------------------------------------------------------------- /users/dotfiles/termite/config: -------------------------------------------------------------------------------- 1 | [options] 2 | font = hack 14 3 | scrollback_lines = 1000000 4 | 5 | ## 6 | clickable_url = true 7 | browser = /usr/bin/google-chrome-stable 8 | urgent_on_bell = true 9 | audible_bell = false 10 | 11 | allow_bold = true 12 | 13 | # system, on, off 14 | cursor_blink = system 15 | 16 | # block, underline, ibeam 17 | cursor_shape = ibeam 18 | 19 | [colors] 20 | background = rgba(32,32,32,0.8) 21 | 22 | # Black + DarkGrey 23 | color0 = #282a36 24 | color8 = #686868 25 | 26 | # DarkRed + Red 27 | color1 = #ff5c57 28 | color9 = #ff5c57 29 | 30 | # DarkGreen + Green 31 | color2 = #5af78e 32 | color10 = #5af78e 33 | 34 | # DarkYellow + Yellow 35 | color3 = #f3f99d 36 | color11 = #f3f99d 37 | 38 | # DarkBlue + Blue 39 | color4 = #57c7ff 40 | color12 = #57c7ff 41 | 42 | # DarkMagenta + Magenta 43 | color5 = #ff6ac1 44 | color13 = #ff6ac1 45 | 46 | # DarkCyan + Cyan (both 47 | color6 = #9aedfe 48 | color14 = #9aedfe 49 | 50 | # LightGrey + White 51 | color7= #eff0eb 52 | color15 = #f1f1f0 53 | 54 | -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_162324george-turmanidze-10.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_162324george-turmanidze-10.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_162452george-turmanidze-8.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_162452george-turmanidze-8.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_170859george-turmanidze-8.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_170859george-turmanidze-8.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_173036george-turmanidze-img-20200427-063133-132.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_173036george-turmanidze-img-20200427-063133-132.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_173459ana-obradovic-kupatilo-final2.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_173459ana-obradovic-kupatilo-final2.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_173713andrea-marinelli-liv1-best.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_173713andrea-marinelli-liv1-best.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_173725andrea-marinelli-liv1-best2.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_173725andrea-marinelli-liv1-best2.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_182522vincent-gros-demetersdream005.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_182522vincent-gros-demetersdream005.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_182537vincent-gros-demetersdream007.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/00/d885ed-3c8e-4c03-b325-52a807f9a3c7/20201219_182537vincent-gros-demetersdream007.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/04/6d8397-51e7-4cd8-b21b-2909a0ada976/eddie-del-rio-622709-10152191443342178-2030898129-o_2019-07-27_04-21-22.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/04/6d8397-51e7-4cd8-b21b-2909a0ada976/eddie-del-rio-622709-10152191443342178-2030898129-o_2019-07-27_04-21-22.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/0d/f5cb5d-08df-430d-bfcb-6914a15abfed/guillem-h-pongiluppi-palau-de-la-musica-catalana-barcelona-catalunya-guillemhp_2019-07-27_04-57-33.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/0d/f5cb5d-08df-430d-bfcb-6914a15abfed/guillem-h-pongiluppi-palau-de-la-musica-catalana-barcelona-catalunya-guillemhp_2019-07-27_04-57-33.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/12/004cda-72c7-4199-898a-e1c05e389f36/richard-rude-richardrude-d2f-hellrisecanyon-002_2019-07-27_16-32-49.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/12/004cda-72c7-4199-898a-e1c05e389f36/richard-rude-richardrude-d2f-hellrisecanyon-002_2019-07-27_16-32-49.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/13/03f0d8-1ed0-48dc-a27b-04f6c1de086b/tumblr_p7ikadfPzT1uzeyaxo3_1280.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/13/03f0d8-1ed0-48dc-a27b-04f6c1de086b/tumblr_p7ikadfPzT1uzeyaxo3_1280.jpg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/13/2975b6-d781-4491-90e8-dca19c17b321/20201106_203824grafit-studio-imgpsh-fullsize-3.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/13/2975b6-d781-4491-90e8-dca19c17b321/20201106_203824grafit-studio-imgpsh-fullsize-3.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/13/2975b6-d781-4491-90e8-dca19c17b321/grafit-studio-5_2019-07-27_08-31-07.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/13/2975b6-d781-4491-90e8-dca19c17b321/grafit-studio-5_2019-07-27_08-31-07.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/14/78c80d-71ae-445b-85fe-0fa02a74bb0d/20200926_171435rogelio-olguin-int-h-15.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/14/78c80d-71ae-445b-85fe-0fa02a74bb0d/20200926_171435rogelio-olguin-int-h-15.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/46/b72c9c-ed4a-4ffc-9c55-a1e285e67484/herman-ng-20161012-style-sheet-final_2019-07-27_13-52-45.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/46/b72c9c-ed4a-4ffc-9c55-a1e285e67484/herman-ng-20161012-style-sheet-final_2019-07-27_13-52-45.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/53/a30b83-7100-4366-b338-35eafe4c41db/20200926_173420guillem-h-pongiluppi-guillemhp-barcelona-future-3.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/53/a30b83-7100-4366-b338-35eafe4c41db/20200926_173420guillem-h-pongiluppi-guillemhp-barcelona-future-3.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/58/caff13-ba26-4df1-b157-7e9d0117fd3c/ferdinand-ladera-mystical-woods_2019-07-27_16-18-37.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/58/caff13-ba26-4df1-b157-7e9d0117fd3c/ferdinand-ladera-mystical-woods_2019-07-27_16-18-37.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/6e/d261a7-2765-4b14-9d9b-32bd28571799/wadim-kashin-exotic1_2019-07-27_04-42-57.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/6e/d261a7-2765-4b14-9d9b-32bd28571799/wadim-kashin-exotic1_2019-07-27_04-42-57.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/7a/f39d03-3e47-402a-851f-4612e912c501/james-ross-mcnab-matte-final_2019-07-27_16-31-34.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/7a/f39d03-3e47-402a-851f-4612e912c501/james-ross-mcnab-matte-final_2019-07-27_16-31-34.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/90/8bd9d2-d180-427a-a101-d68588b310a4/ferdinand-ladera-torrent-of-gelion-2k_2019-07-27_16-17-26.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/90/8bd9d2-d180-427a-a101-d68588b310a4/ferdinand-ladera-torrent-of-gelion-2k_2019-07-27_16-17-26.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/9e/52b037-c0a3-40ac-a10a-8ee2103864b1/20200926_170934feiyang-wang-cats-shelter.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/9e/52b037-c0a3-40ac-a10a-8ee2103864b1/20200926_170934feiyang-wang-cats-shelter.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/ab/b03852-d40d-40ae-acf0-a772cded8d97/ned-rogers-forest-forestchoir-concept01-002_2019-07-27_14-07-36.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/ab/b03852-d40d-40ae-acf0-a772cded8d97/ned-rogers-forest-forestchoir-concept01-002_2019-07-27_14-07-36.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/d4/b26468-99c5-4b42-8949-14cf7fb04e43/robert-berg-beauty2_2019-07-27_16-16-10.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/d4/b26468-99c5-4b42-8949-14cf7fb04e43/robert-berg-beauty2_2019-07-27_16-16-10.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/ea/4a8cbb-f230-49ca-97f5-bcc9e65dc485/tumblr_p7ikadfPzT1uzeyaxo3_1280.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/ea/4a8cbb-f230-49ca-97f5-bcc9e65dc485/tumblr_p7ikadfPzT1uzeyaxo3_1280.jpg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/ea/4a8cbb-f230-49ca-97f5-bcc9e65dc485/wadim-kashin-halflife1_2019-07-27_08-18-11.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/ea/4a8cbb-f230-49ca-97f5-bcc9e65dc485/wadim-kashin-halflife1_2019-07-27_08-18-11.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/f1/6cf808-6d36-4640-8356-778c4da416d2/20200926_173359donglu-yu-cyberpunk-demo-lowres.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/f1/6cf808-6d36-4640-8356-778c4da416d2/20200926_173359donglu-yu-cyberpunk-demo-lowres.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/f6/54c3b9-c22e-49c8-bc1c-79aeb2dc04db/max-bedulenko-_2019-07-27_04-48-06.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/f6/54c3b9-c22e-49c8-bc1c-79aeb2dc04db/max-bedulenko-_2019-07-27_04-48-06.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.attach/ff/23b42a-8b53-4bc4-bae2-34823573f154/20200926_171057mike-paolilli-int-living-space-final.jpg.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/GTrunSec/nixos-flk/6258e0f73c94717a72a52ca43e0e8b860e20917a/users/dotfiles/wallpaper/.attach/ff/23b42a-8b53-4bc4-bae2-34823573f154/20200926_171057mike-paolilli-int-living-space-final.jpg.jpeg -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/.dir-locals.el: -------------------------------------------------------------------------------- 1 | ((org-mode . ((eval . (setq-local org-attach-id-dir "./.attach")) 2 | (eval . (org-hugo-auto-export-mode)) 3 | (eval . (setq-local org-download-timestamp "%Y%m%d_%H%M%S")) 4 | ))) 5 | -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/README.org: -------------------------------------------------------------------------------- 1 | #+TITLE: README 2 | 3 | My wallpapers collection list -> [[https://www.gtrun.org/post/wallpaper/][wallpaper - GTruNSec | 光涛]] 4 | -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/hugo.local: -------------------------------------------------------------------------------- 1 | ;;;;https://ox-hugo.scripter.co/doc/dates/ 2 | 3 | #+HUGO_BASE_DIR: ~/Documents/my-blog 4 | #+HUGO_SECTION: post 5 | #+hugo_custom_front_matter: :author "GTrunSec" 6 | #+options: creator:t author:nil 7 | #+DESCRIPTION: my wallpaper 8 | #+KEYWORDS: wallpaper 9 | #+LANGUAGE: en cn 10 | #+hugo_publishdate: 11 | #+hugo_auto_set_lastmod: t 12 | #+HUGO_categories: profile 13 | #+HUGO_tags: wallpaper personal 14 | -------------------------------------------------------------------------------- /users/dotfiles/wallpaper/theme-readtheorg.setup: -------------------------------------------------------------------------------- 1 | # -*- mode: org; -*- 2 | 3 | #+HTML_HEAD: 4 | 5 | #+HTML_HEAD: 6 | #+HTML_HEAD: 7 | #+HTML_HEAD: 8 | #+HTML_HEAD: 9 | 10 | #+HTML_HEAD: 11 | -------------------------------------------------------------------------------- /users/gtrun/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | hmUsers, 3 | config, 4 | pkgs, 5 | ... 6 | }: let 7 | user = builtins.baseNameOf ./.; 8 | in { 9 | home-manager.users = {inherit (hmUsers) gtrun;}; 10 | 11 | sops.secrets."users/${user}".neededForUsers = true; 12 | 13 | #Unstbale issue 14 | security.sudo.wheelNeedsPassword = false; 15 | 16 | users.users.gtrun = { 17 | home = "/home/gtrun"; 18 | passwordFile = config.sops.secrets."users/${user}".path; 19 | isNormalUser = true; 20 | extraGroups = [ 21 | "wheel" 22 | "audio" 23 | "pulse" 24 | "sound" 25 | "libvirtd" 26 | "video" 27 | "docker" 28 | ]; 29 | # Enable ‘sudo’ for the user. 30 | shell = pkgs.zsh; 31 | uid = 1000; 32 | openssh.authorizedKeys.keys = [ 33 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDI2uDp51HMggnfz4Zn5ky4gb/XVdQiJR7pZyb/LcCLx macOSdeMBP.attlocal.net-gtrun-14-05-2021" 34 | ]; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /users/modules/darwin-module-list.nix: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /users/nixos/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | self, 3 | inputs, 4 | ... 5 | } @ args: 6 | with inputs; { 7 | hostDefaults = import ./hostDefault.nix args; 8 | 9 | imports = [(digga.lib.importHosts ../hosts/nixos)]; 10 | 11 | hosts = import ./hosts.nix args; 12 | 13 | importables = import ./suites.nix args; 14 | } 15 | -------------------------------------------------------------------------------- /users/profiles/bin-scripts/clean-nix-store.nix: -------------------------------------------------------------------------------- 1 | {home-manager}: '' 2 | nix-env --delete-generations 3d 3 | ${home-manager} expire-generations 3d 4 | sudo nix-env -p /nix/var/nix/profiles/system --delete-generations 3d 5 | nix-collect-garbage -d 6 | nix optimise-store 2>&1 | sed -E 's/.*'\'''(\/nix\/store\/[^\/]*).*'\'''/\1/g' | uniq | sudo parallel 'nix-store --repair-path {}' 7 | #nix-store --optimize 8 | '' 9 | -------------------------------------------------------------------------------- /users/profiles/bin-scripts/et.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # edit file with emacsclient directly or as pipe 4 | # https://emacs-china.org/t/shell-emacs/17964 5 | # SEE https://www.emacswiki.org/emacs/EmacsPipe 6 | # pipe stdin to emacsclient like vim with "| et - " 7 | if [[ $1 == "-" ]]; then 8 | TMP="$(mktemp /tmp/et-stdin-XXX)" 9 | 10 | # SEE https://superuser.com/a/380778 11 | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | cat >"$TMP" 12 | 13 | [ ! -s "$TMP" ] && rm "$TMP" && exit 0 14 | fi 15 | 16 | emacsclient -u -e '(server-running-p)' 2>/dev/null || emacs --daemon 17 | 18 | if [[ $1 == "-" ]]; then 19 | emacsclient -q -t "$TMP" 20 | else 21 | emacsclient -q -t "$@" 22 | fi 23 | -------------------------------------------------------------------------------- /users/profiles/bin-scripts/lsyncd-rsync.nix: -------------------------------------------------------------------------------- 1 | {}: '' 2 | killall -q lsyncd & 3 | PID=$! 4 | wait $PID 5 | # sync to webdev 6 | # lsyncd -rsync ~/Nextcloud/phone /var/lib/photoprism/import/phone-backup 7 | # lsyncd -rsync ~/Nextcloud/oneplus /var/lib/photoprism/import/oneplus-backup 8 | '' 9 | -------------------------------------------------------------------------------- /users/profiles/bin-scripts/test-emacs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TMPHOME="$(mktemp -d)" 4 | 5 | mkdir -p "$TMPHOME/.emacs.d/" 6 | rm -f "$TMPHOME/.emacs.d/config.el"{,c} 7 | cp config.org init.el custom.el "$TMPHOME/.emacs.d/" 8 | HOME="$TMPHOME" \ 9 | emacs "$@" \ 10 | --eval "(setq after-init-time nil)" \ 11 | --eval "(setq network-security-level 'low)" \ 12 | -f toggle-debug-on-error \ 13 | -l "~/.emacs.d/init.el" \ 14 | --eval "(wsi-simulate-idle-time 500)" 15 | -------------------------------------------------------------------------------- /users/profiles/common-nixos/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | } 8 | -------------------------------------------------------------------------------- /users/profiles/common/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | home.stateVersion = "22.05"; 8 | } 9 | -------------------------------------------------------------------------------- /users/profiles/cursor/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | config = with lib; 8 | mkMerge [ 9 | (mkIf pkgs.stdenv.isLinux { 10 | home.pointerCursor = { 11 | x11.enable = true; 12 | package = pkgs.gnome3.adwaita-icon-theme; 13 | name = "Adwaita"; 14 | size = 130; 15 | }; 16 | }) 17 | ]; 18 | } 19 | -------------------------------------------------------------------------------- /users/profiles/dircolors/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | programs.dircolors = { 8 | enable = true; 9 | extraConfig = builtins.readFile ./LS_COLORS; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /users/profiles/direnv/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | programs.direnv = { 3 | enable = true; 4 | enableZshIntegration = true; 5 | nix-direnv = { 6 | enable = true; 7 | }; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /users/profiles/doom-emacs/darwin/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: let 7 | updatefont = ''fc-cache -f -v''; 8 | onChange = '' 9 | export PATH=${pkgs.emacs}/bin:$PATH 10 | cd $HOME/.doom.d/ 11 | # emacs -Q -batch -l 'lisp/compile.el' 12 | $HOME/.emacs.d/bin/doom sync 13 | ''; 14 | in { 15 | home.file.".doom.d/config.org" = { 16 | source = ../../../dotfiles/doom-emacs/config.org; 17 | inherit onChange; 18 | }; 19 | 20 | home.file.".doom.d/meow.org" = { 21 | source = ../../../dotfiles/doom-emacs/meow.org; 22 | inherit onChange; 23 | }; 24 | 25 | programs.emacs = { 26 | enable = true; 27 | package = pkgs.emacs; 28 | }; 29 | 30 | home.activation.linkEmacsPrivate = config.lib.dag.entryAfter ["writeBoundary"] '' 31 | if [ ! -d "$HOME/.emacs.d" ];then 32 | ${pkgs.git}/bin/git clone https://github.com/GTrunSec/doom-emacs.git -b my-doom ~/.emacs.d 33 | fi 34 | 35 | if [ ! -d "$HOME/.doom.d" ];then 36 | mkdir -p $HOME/.doom.d/ 37 | mkdir -p $HOME/.doom.d/etc 38 | fi 39 | 40 | if [ ! -d "$HOME/.doom.d/modules" ];then 41 | ln -sfT "$HOME/.config/guangtao/nixos-flk/users/dotfiles/doom-emacs/lisp" $HOME/.doom.d/lisp 42 | ln -sfT "$HOME/.config/guangtao/nixos-flk/users/dotfiles/doom-emacs/bin" $HOME/.doom.d/bin 43 | ln -sfT "$HOME/.config/guangtao/nixos-flk/users/dotfiles/doom-emacs/snippets" $HOME/.doom.d/snippets 44 | ln -sfT "$HOME/.config/guangtao/nixos-flk/users/dotfiles/doom-emacs/modules" $HOME/.doom.d/modules 45 | ln -sfT "$HOME/.config/guangtao/nixos-flk/users/dotfiles/doom-emacs/Makefile" $HOME/.doom.d/Makefile 46 | fi 47 | 48 | if [ ! -d "$HOME/.doom.d/modules/my-code" ];then 49 | mkdir -p $HOME/.doom.d/modules/private/my-org 50 | mkdir -p $HOME/.doom.d/modules/private/my-code 51 | mkdir -p $HOME/.doom.d/autoload 52 | fi 53 | ''; 54 | } 55 | -------------------------------------------------------------------------------- /users/profiles/doom-emacs/nixos/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: let 7 | updatefont = ''fc-cache -f -v''; 8 | onChange = '' 9 | export PATH=${config.programs.emacs.finalPackage}/bin/:$PATH 10 | cd $HOME/.doom.d/ 11 | emacs -Q -batch -l 'lisp/compile.el' 12 | $HOME/.emacs.d/bin/doom sync 13 | ''; 14 | in { 15 | home.activation.linkEmacsPrivate = config.lib.dag.entryAfter ["writeBoundary"] '' 16 | if [ ! -d "$HOME/.emacs.d" ];then 17 | ${pkgs.git}/bin/git clone https://github.com/hlissner/doom-emacs/ ~/.emacs.d 18 | fi 19 | 20 | if [ ! -d "$HOME/.doom.d" ];then 21 | mkdir -p $HOME/.doom.d/ 22 | mkdir -p $HOME/.doom.d/etc 23 | fi 24 | 25 | if [ ! -d "$HOME/.doom.d/modules" ];then 26 | ln -sfT "$HOME/.config/guangtao/nixos-flk/users/dotfiles/doom-emacs/lisp" $HOME/.doom.d/lisp 27 | ln -sfT "$HOME/.config/guangtao/nixos-flk/users/dotfiles/doom-emacs/bin" $HOME/.doom.d/bin 28 | ln -sfT "$HOME/.config/guangtao/nixos-flk/users/dotfiles/doom-emacs/snippets" $HOME/.doom.d/snippets 29 | ln -sfT "$HOME/.config/guangtao/nixos-flk/users/dotfiles/doom-emacs/modules" $HOME/.doom.d/modules 30 | fi 31 | 32 | if [ ! -d "$HOME/.doom.d/modules/my-code" ];then 33 | mkdir -p $HOME/.doom.d/modules/private/my-org 34 | mkdir -p $HOME/.doom.d/modules/private/my-code 35 | mkdir -p $HOME/.doom.d/autoload 36 | fi 37 | ''; 38 | # editors 39 | home.file.".doom.d/config.org" = { 40 | source = ../../../dotfiles/doom-emacs/config.org; 41 | inherit onChange; 42 | }; 43 | 44 | home.file.".doom.d/meow.org" = { 45 | source = ../../../dotfiles/doom-emacs/meow.org; 46 | inherit onChange; 47 | }; 48 | 49 | programs.emacs.enable = true; 50 | 51 | programs.emacs.package = pkgs.emacsPgtkNativeComp; 52 | 53 | programs.emacs.extraPackages = epkgs: 54 | with epkgs; [ 55 | vterm 56 | grab-x-link 57 | ]; 58 | 59 | # services.emacs.enable = true; 60 | services.emacs.client.enable = true; 61 | } 62 | -------------------------------------------------------------------------------- /users/profiles/dropbox/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | config = with lib; 8 | mkMerge [ 9 | (mkIf pkgs.stdenv.isLinux { 10 | services.dropbox = { 11 | enable = true; 12 | }; 13 | }) 14 | ]; 15 | } 16 | -------------------------------------------------------------------------------- /users/profiles/dunst/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | config = with lib; 8 | mkMerge [ 9 | (mkIf pkgs.stdenv.isLinux { 10 | services.dunst = { 11 | enable = true; 12 | }; 13 | }) 14 | ]; 15 | } 16 | -------------------------------------------------------------------------------- /users/profiles/feh/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: 7 | with lib; { 8 | programs.feh = { 9 | enable = true; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /users/profiles/fzf/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | programs.fzf = { 8 | enable = true; 9 | enableBashIntegration = true; 10 | enableZshIntegration = true; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /users/profiles/git/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | pkgs, 3 | lib, 4 | ... 5 | }: { 6 | home.packages = with pkgs; [ 7 | git-absorb 8 | pre-commit 9 | ]; 10 | programs.git = { 11 | enable = true; 12 | userName = "GTrunSec"; 13 | userEmail = "gtrunsec@hardenedlinux.org"; 14 | signing.key = "761C8EBEA940960E"; 15 | ignores = [ 16 | ".projectile" 17 | ".indium.json" 18 | ".ccls-cache" 19 | ".Rhistory" 20 | ".notdeft*" 21 | "eaf" 22 | ".auctex-auto" 23 | "vast.db" 24 | ".DS_Store" 25 | "result" 26 | ".ipynb_checkpoints" 27 | "__pycache__" 28 | "*.org.organice-bak" 29 | ".direnv" 30 | ".direnv.d" 31 | ".secrets" 32 | ".cargo" 33 | ]; 34 | extraConfig = { 35 | github = { 36 | user = "GTrunSec"; 37 | }; 38 | 39 | pull = { 40 | rebase = true; 41 | }; 42 | merge = { 43 | ff = "only"; 44 | }; 45 | rebase = { 46 | autostash = true; 47 | }; 48 | core = { 49 | pager = [ 50 | '' 51 | delta --plus-style="#012800" --minus-style="#340001" 52 | '' 53 | ]; 54 | }; 55 | credential = { 56 | helper = "store"; 57 | }; 58 | 59 | interactive = { 60 | diffFilter = "delta --color-only"; 61 | }; 62 | }; 63 | }; 64 | programs.git.signing.signByDefault = true; 65 | } 66 | -------------------------------------------------------------------------------- /users/profiles/gpg/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | config = with lib; 8 | mkMerge [ 9 | { 10 | programs.gpg = { 11 | enable = true; 12 | settings = { 13 | cert-digest-algo = "SHA512"; 14 | disable-cipher-algo = "3DES"; 15 | default-recipient-self = true; 16 | use-agent = true; 17 | with-fingerprint = true; 18 | }; 19 | }; 20 | } 21 | ( 22 | mkIf pkgs.stdenv.isLinux { 23 | programs.gpg = { 24 | enable = true; 25 | settings = { 26 | default-key = "0x761C8EBEA940960E"; 27 | }; 28 | }; 29 | services.gpg-agent = { 30 | defaultCacheTtl = 180000; 31 | defaultCacheTtlSsh = 180000; 32 | enable = true; 33 | enableScDaemon = true; 34 | enableSshSupport = true; 35 | grabKeyboardAndMouse = false; 36 | }; 37 | } 38 | ) 39 | ]; 40 | } 41 | -------------------------------------------------------------------------------- /users/profiles/link-home-file/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | config = with lib; 8 | mkMerge [ 9 | ( 10 | mkIf pkgs.stdenv.isLinux { 11 | home.file.".config/i3/config".source = ../../dotfiles/i3/config; 12 | home.file.".config/i3/move-cursor-window-center.sh".source = ../../dotfiles/i3/move-cursor-window-center.sh; 13 | 14 | #polyar 15 | home.file.".config/polybar/".source = ../../dotfiles/polybar; 16 | # rofi 17 | home.file.".config/rofi".source = ../../dotfiles/rofi; 18 | # termite 19 | home.file.".config/termite/config".source = ../../dotfiles/termite/config; 20 | # kitty 21 | home.file.".config/kitty/kitty.conf".source = ../../dotfiles/kitty/kitty.conf; 22 | # Let Home Manager install and manage itself. 23 | #programs.home-manager.enable = true; 24 | # pet 25 | home.file.".config/pet".source = ../../dotfiles/pet; 26 | 27 | home.file.".config/promnesia/config.py".source = ../../../profiles/data/promnesia/config.py; 28 | } 29 | ) 30 | 31 | ( 32 | mkIf pkgs.stdenv.isDarwin { 33 | home.file.".config/pet/config.toml".source = ../../dotfiles/pet/darwin-config.toml; 34 | home.file.".config/pet/snippet.toml".source = ../../dotfiles/pet/snippet.toml; 35 | home.file."Library/Application Support/promnesia/config.py".source = ../../../profiles/data/promnesia/config.py; 36 | } 37 | ) 38 | 39 | {} 40 | ]; 41 | } 42 | -------------------------------------------------------------------------------- /users/profiles/lorri/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | config = with lib; 8 | mkMerge [ 9 | (mkIf pkgs.stdenv.isLinux { 10 | services.lorri = { 11 | enable = true; 12 | }; 13 | }) 14 | ]; 15 | } 16 | -------------------------------------------------------------------------------- /users/profiles/lsd/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | } 8 | -------------------------------------------------------------------------------- /users/profiles/misc/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | programs.htop.enable = true; 8 | programs.bat.enable = true; 9 | programs.broot.enable = true; 10 | } 11 | -------------------------------------------------------------------------------- /users/profiles/nushell/default.nix: -------------------------------------------------------------------------------- 1 | {pkgs, ...}: { 2 | programs.nushell = { 3 | enable = true; 4 | package = pkgs.nushell; 5 | 6 | settings = { 7 | line_editor = { 8 | edit_mode = "vi"; 9 | completion_mode = "circular"; 10 | }; 11 | 12 | skip_welcome_message = true; 13 | table_mode = "light"; 14 | prompt = "starship prompt"; 15 | 16 | env = { 17 | STARSHIP_SHELL = "nushell"; 18 | }; 19 | }; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /users/profiles/picom/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | services.picom = { 8 | enable = true; 9 | backend = "glx"; 10 | package = pkgs.picom.overrideAttrs (o: { 11 | inherit (pkgs.sources.picom) src pname version; 12 | }); 13 | fade = true; 14 | fadeDelta = 5; 15 | vSync = true; 16 | shadow = true; 17 | shadowOpacity = 0.16; 18 | menuOpacity = 0.9; 19 | opacityRules = [ 20 | "95:class_g *?= 'brave'" 21 | "80:class_g *?= 'emacs' && focused" 22 | "75:class_g *?= 'emacs' && !focused" 23 | ]; 24 | # extraOptions = '' 25 | # corner-radius = 10; 26 | # # blur-method = "dual_kawase"; 27 | # blur-strength = "10"; 28 | # xinerama-shadow-crop = true; 29 | # ''; 30 | shadowExclude = [ 31 | "class_g = 'eww-bar'" 32 | "name = 'Picture-in-Picture'" 33 | 34 | # Tabbed windows 35 | "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" 36 | 37 | # Screen sharing 38 | "name = 'cpt_frame_xcb_window'" 39 | "class_g ?= 'zoom'" 40 | "name = 'rect-overlay'" 41 | ]; 42 | }; 43 | } 44 | -------------------------------------------------------------------------------- /users/profiles/randr/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | ... 5 | }: { 6 | imports = [ 7 | ./work.nix 8 | ]; 9 | } 10 | -------------------------------------------------------------------------------- /users/profiles/randr/work.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: { 7 | config = with lib; 8 | mkMerge [ 9 | ( 10 | mkIf pkgs.stdenv.isLinux { 11 | programs = { 12 | autorandr = { 13 | enable = true; 14 | profiles = { 15 | "home-1" = { 16 | fingerprint = { 17 | DP-2 = "00ffffffffffff004c2d000e394d5130261b0104b53d23783a5fb1a2574fa2280f5054bfef80714f810081c08180a9c0b300950001014dd000a0f0703e80302035005f592100001a000000fd001e4b1e873c000a202020202020000000fc00553238483735780a2020202020000000ff004854504a3930323631370a2020018402030ff042105f2309070783010000023a801871382d40582c45005f592100001e565e00a0a0a02950302035005f592100001a04740030f2705a80b0588a005f592100001e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f1"; 18 | }; 19 | config = { 20 | DP-2 = { 21 | dpi = 300; 22 | enable = true; 23 | mode = "3840x2160"; 24 | position = "0x0"; 25 | rate = "60.00"; 26 | }; 27 | }; 28 | }; 29 | }; 30 | }; 31 | }; 32 | } 33 | ) 34 | ]; 35 | } 36 | -------------------------------------------------------------------------------- /users/profiles/starship/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | programs.starship = { 8 | enable = true; 9 | enableBashIntegration = true; 10 | enableZshIntegration = true; 11 | settings = lib.importTOML ./starship.toml; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /users/profiles/starship/starship.toml: -------------------------------------------------------------------------------- 1 | [aws] 2 | symbol = " " 3 | 4 | [character] 5 | success_symbol = "[λ](bold blue) " 6 | vicmd_symbol = "[V](bold green) " 7 | error_symbol = "[λ](bold red) " 8 | 9 | [battery] 10 | full_symbol = "" 11 | charging_symbol = "" 12 | discharging_symbol = "" 13 | 14 | [conda] 15 | symbol = " " 16 | 17 | [directory] 18 | style = "cyan" 19 | read_only = " 🔒" 20 | 21 | [docker_context] 22 | symbol = " " 23 | 24 | [elixir] 25 | symbol = " " 26 | 27 | [elm] 28 | symbol = " " 29 | 30 | [git_branch] 31 | format = "[$symbol$branch]($style) " 32 | symbol = " " 33 | style = "bold dimmed white" 34 | 35 | [git_status] 36 | conflicted = "⚠️" 37 | 38 | [golang] 39 | symbol = " " 40 | 41 | [hg_branch] 42 | symbol = " " 43 | 44 | [java] 45 | symbol = " " 46 | 47 | [julia] 48 | symbol = " " 49 | 50 | [memory_usage] 51 | symbol = " " 52 | disabled = false 53 | 54 | [nim] 55 | symbol = " " 56 | 57 | [nix_shell] 58 | format = 'via [☃️ $state( \($name\))](bold blue) ' 59 | symbol = " " 60 | impure_msg = "impure" 61 | pure_msg = "λ" 62 | style = "cyan" 63 | 64 | [nodejs] 65 | symbol = " " 66 | 67 | [package] 68 | symbol = " " 69 | 70 | [php] 71 | symbol = " " 72 | 73 | [python] 74 | symbol = " " 75 | 76 | [ruby] 77 | symbol = " " 78 | 79 | [rust] 80 | symbol = " " 81 | 82 | [status] 83 | disabled = false 84 | -------------------------------------------------------------------------------- /users/profiles/systemd/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | config = with lib; 8 | mkMerge [ 9 | (mkIf pkgs.stdenv.isLinux { 10 | systemd.user.startServices = true; 11 | }) 12 | ]; 13 | } 14 | -------------------------------------------------------------------------------- /users/profiles/tmux/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | pkgs, 4 | lib, 5 | ... 6 | }: { 7 | programs.tmux = { 8 | enable = true; 9 | clock24 = true; 10 | keyMode = "vi"; 11 | extraConfig = 12 | ( 13 | if pkgs.stdenv.isLinux 14 | then '' 15 | '' 16 | else '' 17 | '' 18 | ) 19 | + '' 20 | set -g prefix C-b 21 | bind C-b send-prefix 22 | 23 | #https://github.com/gpakosz/.tmux/issues/53 24 | set -gu prefix2 25 | 26 | unbind C-a 27 | 28 | set -g @resurrect-capture-pane-contents "on" 29 | 30 | set -g mouse on 31 | bind P paste-buffer 32 | bind-key -T copy-mode-vi v send-keys -X begin-selection 33 | bind-key -T copy-mode-vi y send-keys -X copy-selection 34 | bind-key -T copy-mode-vi r send-keys -X rectangle-toggle 35 | ''; 36 | 37 | plugins = with pkgs.tmuxPlugins; [ 38 | sidebar 39 | yank 40 | fingers 41 | sensible 42 | continuum 43 | resurrect 44 | power-theme 45 | ]; 46 | }; 47 | } 48 | -------------------------------------------------------------------------------- /users/profiles/zoxide/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | config, 3 | lib, 4 | pkgs, 5 | ... 6 | }: { 7 | programs.zoxide = { 8 | enable = true; 9 | enableBashIntegration = true; 10 | enableZshIntegration = true; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /users/profiles/zsh/autoload.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | autoload -Uz up-line-or-beginning-search 4 | autoload -Uz down-line-or-beginning-search 5 | autoload -U bashcompinit && bashcompinit 6 | 7 | zle -N up-line-or-beginning-search 8 | zle -N down-line-or-beginning-search 9 | -------------------------------------------------------------------------------- /users/profiles/zsh/compinit-setopt.zsh: -------------------------------------------------------------------------------- 1 | setopt hist_verify # reload full command when runing from history 2 | setopt notify # report the status of backgrounds jobs immediately 3 | setopt hist_ignore_space # do not remember commands starting with space 4 | setopt hist_reduce_blanks # reduce whitespace in history 5 | 6 | setopt auto_continue #automatically send SIGCON to disowned jobs 7 | 8 | # Fancy substitutions in prompts 9 | setopt prompt_subst 10 | setopt transient_rprompt 11 | 12 | # If a pattern for filename generation has no matches, print an error, instead 13 | # of leaving it unchanged in the argument list. This also applies to file 14 | # expansion of an initial ‘~’ or ‘=’. 15 | setopt NOMATCH 16 | 17 | # no Beep on error in ZLE. 18 | setopt NO_BEEP 19 | -------------------------------------------------------------------------------- /users/profiles/zsh/init-bindkey.zsh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env zsh 2 | 3 | # https://superuser.com/questions/427163/altarrow-moving-between-words-in-zsh-and-iterm2 4 | bindkey "\e[1;3C" emacs-forward-word 5 | bindkey "\e[1;3D" emacs-backward-word 6 | 7 | bindkey -M emacs '^x' fzf-cd-widget 8 | # bindkey -M emacs '^P' history-substring-search-up 9 | # bindkey -M emacs '^N' history-substring-search-down 10 | 11 | bindkey "^[[1;5C" vi-forward-word 12 | bindkey "^[[1;5D" vi-backward-word 13 | 14 | bindkey '^Z' fzf-z-widget 15 | 16 | [[ -n "$key[Up]" ]] && bindkey -- "$key[Up]" up-line-or-beginning-search 17 | [[ -n "$key[Down]" ]] && bindkey -- "$key[Down]" down-line-or-beginning-search 18 | -------------------------------------------------------------------------------- /users/profiles/zsh/zshrc.zsh: -------------------------------------------------------------------------------- 1 | ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=#fdf6e3,bg=#586e75,bold,underline" 2 | 3 | export TERM=xterm-256color 4 | export EDITOR="emacsclient -nw" 5 | export VISUAL=$EDITOR 6 | 7 | fzf-z-widget() { 8 | if type "z" >/dev/null; then 9 | cd "$(echo $(z -t -l | cut -d' ' -f2- | tr -d ' ' | fzf --tac))" 10 | zle reset-prompt 11 | fi 12 | } 13 | 14 | zle -N fzf-z-widget 15 | -------------------------------------------------------------------------------- /users/root/default.nix: -------------------------------------------------------------------------------- 1 | {config, ...}: 2 | # recommend using `hashedPassword` 3 | let 4 | user = builtins.baseNameOf ./.; 5 | in { 6 | sops.secrets."users/${user}" = { 7 | neededForUsers = true; 8 | }; 9 | 10 | users.users.root = { 11 | # passwordFile = config.sops.secrets."users/${user}".path; 12 | password = "nixos"; 13 | openssh.authorizedKeys.keys = [ 14 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDI2uDp51HMggnfz4Zn5ky4gb/XVdQiJR7pZyb/LcCLx macOSdeMBP.attlocal.net-gtrun-14-05-2021" 15 | "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKTQ1V9mjPZY31h55Jl6nl7VBxl6cQgag9+s8kvJSEpZ NixOS-gtrun-14-05-2021" 16 | ]; 17 | }; 18 | } 19 | --------------------------------------------------------------------------------