diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index 55e16b1..0000000 --- a/.editorconfig +++ /dev/null @@ -1,41 +0,0 @@ -# Editor configuration, see http://editorconfig.org -root = true - -[*] -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -charset = utf-8 -indent_style = space -indent_size = 2 - -# Ignore diffs/patches -[*.{diff,patch}] -end_of_line = unset -insert_final_newline = unset -trim_trailing_whitespace = unset -indent_size = unset - -[{.*,secrets}/**] -end_of_line = unset -insert_final_newline = unset -trim_trailing_whitespace = unset -charset = unset -indent_style = unset -indent_size = unset - -[*.py] -indent_size = 4 - -[*.md] -max_line_length = off -trim_trailing_whitespace = false - -[*.{el,org}] -end_of_line = unset -insert_final_newline = unset -trim_trailing_whitespace = unset -charset = unset -indent_style = unset -indent_size = unset - diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml deleted file mode 100644 index b96c834..0000000 --- a/.github/workflows/check.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: "Check & Build (with Cachix)" -on: - workflow_dispatch: # allows manual triggering - push: - branches: - - master - - update_flake_lock_action -jobs: - check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.3.4 - - run: | - DEBIAN_FRONTEND=noninteractive - sudo apt-get update -q -y && sudo apt-get install -q -y qemu-system-aarch64 qemu-efi binfmt-support qemu-user-static - - uses: cachix/install-nix-action@v17 - with: - extra_nix_config: > - experimental-features = nix-command flakes - system-features = nixos-test benchmark big-parallel kvm recursive-nix - extra-platforms = aarch64-linux - keep-going = true - substituters = - https://aciceri-fleet.cachix.org - https://nrdxp.cachix.org - https://nix-community.cachix.org - arm.cachix.org - https://cache.nixos.org - trusted-public-keys = > - aciceri-fleet.cachix.org-1:WiHJIK4UFTdfvWx0lG3mCR4EddyYsRhIuMGSje3/YGI= - nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4= - nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= - arm.cachix.org-1:K3XjAeWPgWkFtSS9ge5LJSLw3xgnNqyOaG7MDecmTQ8= - cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - - uses: cachix/cachix-action@v10 - with: - name: aciceri-fleet - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - - run: nix -Lv build ".#nixosConfigurations.pc.config.system.build.toplevel" - - run: nix -Lv build ".#nixosConfigurations.pbp.config.system.build.toplevel" --option system aarch64-linux - - run: nix -Lv build ".#nixosConfigurations.hs.config.system.build.toplevel" \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 477e722..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: "Release (with Cachix)" -on: - push: - tags: - - "release-*" -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2.3.4 - - uses: cachix/install-nix-action@v16 - with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/8d8xah1f6ypccpmw9cfsl8ziw1chj4cl/install - install_options: "--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve" - extra_nix_config: > - experimental-features = nix-command flakes - system-features = nixos-test benchmark big-parallel kvm recursive-nix - extra-platforms = aarch64-linux - keep-going = true - substituters = - https://aciceri-fleet.cachix.org - https://nrdxp.cachix.org - https://nix-community.cachix.org - arm.cachix.org - https://cache.nixos.org - trusted-public-keys = > - aciceri-fleet.cachix.org-1:WiHJIK4UFTdfvWx0lG3mCR4EddyYsRhIuMGSje3/YGI= - nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4= - nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs= - arm.cachix.org-1:K3XjAeWPgWkFtSS9ge5LJSLw3xgnNqyOaG7MDecmTQ8= - cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - - uses: cachix/cachix-action@v10 - with: - name: aciceri-fleet - authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" - # - run: nix -Lv develop -c bud build pc pcBootstrapIso - # - run: nix -Lv develop -c bud build hs hsBootstrapIso - - uses: marvinpinto/action-automatic-releases@latest - with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - prerelease: false - automatic_release_tag: latest - title: Latest ISOs - files: | - result/iso/*.iso diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml deleted file mode 100644 index 03c631f..0000000 --- a/.github/workflows/update.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: update-flake-lock -on: - workflow_dispatch: # allows manual triggering - schedule: - - cron: '0 2 * * *' # runs weekly on Friday at 02:00 AM - -jobs: - lockfile: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v3 - - - uses: cachix/install-nix-action@v17 - - - name: Update flake.lock - uses: DeterminateSystems/update-flake-lock@v9 - with: - pr-title: "Automatic `flake.lock` update" - pr-labels: | - flake-inputs - automatic - token: ${{ secrets.PR_UPDATE_FLAKE_TOKEN }} # to open the PR using my GitHub account, needed to trigger the `check` workflow diff --git a/.gitignore b/.gitignore index 7772023..6aecdb6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,4 @@ result .direnv -doc/index.html - -# Result of flk commands -vm -iso -doi - -pkgs/_sources/.shake* - +.pre-commit-config.yaml *.qcow2 - -profiles/cachix/mlabs.nix diff --git a/README.org b/README.org deleted file mode 100644 index 916fb1f..0000000 --- a/README.org +++ /dev/null @@ -1,77 +0,0 @@ -* NixFleet - - A complete, declarative and reproducible configuration of my entire - Nix fleet, this includes the following machines: - - - [X] my main home workstation ~pc~ - - [X] homeserver (mainly a nas) ~hs~ - - [X] my arm based [[https://wiki.pine64.org/wiki/Pinebook_Pro][PineBook Pro]] ~pbp~, almost completely open hardware - - The different confgurations share many profiles, in fact my original - goal was to avoid to rewrite the same Nix derivations for my - different machines. - -** Continuous integration -At every commit a GitHub action builds all the machines and publish the -artifacts produces to [[aciceri-fleet.cachix.org]]. -Moreover, every night, another GitHub action is triggered and it try to update -the flake's lockfile creating a PR, the same GitHub action is before is run -against the branch of this PR. - -** Commands -Here I describe my most used commands. All the commands are executed -inside the Flake's development shell. To enter in this shell is -sufficent to ~cd~ in the folder (if you use ~direnv~) or run ~nix -develop~. - -*** Checking -To check that the Nix Flake is [[https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake-check.html#evaluation-checks][well defined]]: -#+begin_src shell - nix flake check -#+end_src - -*** Building -#+begin_src shell -nix -Lv build -".#nixosConfigurations..config.system.build.toplevel" -#+end_src - -where ~~ is the hostname e.g. ~pc~. - -*** Testing new config -#+begin_src shell - bud rebuild test -#+end_src - -where ~~ is the hostname e.g. ~pc~. - - -*** Switching -#+begin_src shell - bud rebuild switch -#+end_src - -where ~~ is the hostname e.g. ~pc~. - -*** Remote deploy - -#+begin_src shell - deploy -d --hostname '.#' --skip-checks --ssh-user root -#+end_src - -where -- ~~ is the remote machine hostname or ip -- ~~ is one between ~pc~, ~pbp~ or ~hs~ - -** Github Actions -*** Check and build -At every commit pushed on ~master~ a Github actions which ~nix flake -check~ the flake is executed and then every system is build. -Currently this workflow will skip ~aarch64~ hosts since the runner is -~x86_64~ and I didn't find a way to make it cross compile. - -*** Release -At every tagged commit whose tag name starts with ~release-~ a process -that releases all the bootstrap ISOs for the systems is started. Here -I've the same problem with ~aarch64~ hosts so the runner will skip -them. diff --git a/bors.toml b/bors.toml deleted file mode 100644 index 6703d41..0000000 --- a/bors.toml +++ /dev/null @@ -1,5 +0,0 @@ -status = [ "check" ] - -required_approvals = 1 - -up_to_date_approvals = true diff --git a/default.nix b/default.nix deleted file mode 100644 index 0e6bdee..0000000 --- a/default.nix +++ /dev/null @@ -1,31 +0,0 @@ -let - inherit (default.inputs.nixos) lib; - - default = (import ./lib/compat).defaultNix; - - ciSystems = [ - "aarch64-linux" - "i686-linux" - "x86_64-linux" - ]; - - filterSystems = lib.filterAttrs - (system: _: lib.elem system ciSystems); - - recurseIntoAttrsRecursive = lib.mapAttrs (_: v: - if lib.isAttrs v - then recurseIntoAttrsRecursive (lib.recurseIntoAttrs v) - else v - ); - - systemOutputs = lib.filterAttrs - (name: set: lib.isAttrs set - && lib.any - (system: set ? ${system} && name != "legacyPackages") - ciSystems - ) - default.outputs; - - ciDrvs = lib.mapAttrs (_: system: filterSystems system) systemOutputs; -in -(recurseIntoAttrsRecursive ciDrvs) // { shell = import ./shell.nix; } diff --git a/doom.d/config.el b/doom.d/config.el new file mode 100644 index 0000000..eb57731 --- /dev/null +++ b/doom.d/config.el @@ -0,0 +1,80 @@ +;;; $DOOMDIR/config.el -*- lexical-binding: t; -*- + +;; Place your private configuration here! Remember, you do not need to run 'doom +;; sync' after modifying this file! + + +;; Some functionality uses this to identify you, e.g. GPG configuration, email +;; clients, file templates and snippets. It is optional. +(setq user-full-name "Andrea Ciceri" + user-mail-address "andrea.ciceri@autistici.org") + +;; Doom exposes five (optional) variables for controlling fonts in Doom: +;; +;; - `doom-font' -- the primary font to use +;; - `doom-variable-pitch-font' -- a non-monospace font (where applicable) +;; - `doom-big-font' -- used for `doom-big-font-mode'; use this for +;; presentations or streaming. +;; - `doom-unicode-font' -- for unicode glyphs +;; - `doom-serif-font' -- for the `fixed-pitch-serif' face +;; +;; See 'C-h v doom-font' for documentation and more examples of what they +;; accept. For example: +;; +;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light)) +;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13)) +;; +;; If you or Emacs can't find your font, use 'M-x describe-font' to look them +;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to +;; refresh your font settings. If Emacs still can't find your font, it likely +;; wasn't installed correctly. Font issues are rarely Doom issues! + +;; There are two ways to load a theme. Both assume the theme is installed and +;; available. You can either set `doom-theme' or manually load a theme with the +;; `load-theme' function. This is the default: +(setq doom-theme 'doom-one) + +;; This determines the style of line numbers in effect. If set to `nil', line +;; numbers are disabled. For relative line numbers, set this to `relative'. +(setq display-line-numbers-type 'relative) + +;; If you use `org' and don't want your org files in the default location below, +;; change `org-directory'. It must be set before org loads! +(setq org-directory "~/org/") + + +;; Whenever you reconfigure a package, make sure to wrap your config in an +;; `after!' block, otherwise Doom's defaults may override your settings. E.g. +;; +;; (after! PACKAGE +;; (setq x y)) +;; +;; The exceptions to this rule: +;; +;; - Setting file/directory variables (like `org-directory') +;; - Setting variables which explicitly tell you to set them before their +;; package is loaded (see 'C-h v VARIABLE' to look up their documentation). +;; - Setting doom variables (which start with 'doom-' or '+'). +;; +;; Here are some additional functions/macros that will help you configure Doom. +;; +;; - `load!' for loading external *.el files relative to this one +;; - `use-package!' for configuring packages +;; - `after!' for running code after a package has loaded +;; - `add-load-path!' for adding directories to the `load-path', relative to +;; this file. Emacs searches the `load-path' when you load packages with +;; `require' or `use-package'. +;; - `map!' for binding new keys +;; +;; To get information about any of these functions/macros, move the cursor over +;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k'). +;; This will open documentation for it, including demos of how they are used. +;; Alternatively, use `C-h o' to look up a symbol (functions, variables, faces, +;; etc). +;; +;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how +;; they are implemented. + +(use-package! pinentry + :init (setq epa-pinentry-mode `loopback) + (pinentry-start)) diff --git a/doom.d/init.el b/doom.d/init.el new file mode 100644 index 0000000..dd6156d --- /dev/null +++ b/doom.d/init.el @@ -0,0 +1,195 @@ +;;; init.el -*- lexical-binding: t; -*- + +;; This file controls what Doom modules are enabled and what order they load +;; in. Remember to run 'doom sync' after modifying it! + +;; NOTE Press 'SPC h d h' (or 'C-h d h' for non-vim users) to access Doom's +;; documentation. There you'll find a link to Doom's Module Index where all +;; of our modules are listed, including what flags they support. + +;; NOTE Move your cursor over a module's name (or its flags) and press 'K' (or +;; 'C-c c k' for non-vim users) to view its documentation. This works on +;; flags as well (those symbols that start with a plus). +;; +;; Alternatively, press 'gd' (or 'C-c c d') on a module to browse its +;; directory (for easy access to its source code). + +(doom! :input + ;;bidi ; (tfel ot) thgir etirw uoy gnipleh + ;;chinese + ;;japanese + ;;layout ; auie,ctsrnm is the superior home row + + :completion + company ; the ultimate code completion backend + ;;helm ; the *other* search engine for love and life + ;;ido ; the other *other* search engine... + ;;ivy ; a search engine for love and life + vertico ; the search engine of the future + + :ui + ;;deft ; notational velocity for Emacs + doom ; what makes DOOM look the way it does + doom-dashboard ; a nifty splash screen for Emacs + ;;doom-quit ; DOOM quit-message prompts when you quit Emacs + ;;(emoji +unicode) ; 🙂 + hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW + ;;hydra + ;;indent-guides ; highlighted indent columns + ;;ligatures ; ligatures and symbols to make your code pretty again + minimap ; show a map of the code on the side + modeline ; snazzy, Atom-inspired modeline, plus API + ;;nav-flash ; blink cursor line after big motions + ;;neotree ; a project drawer, like NERDTree for vim + ophints ; highlight the region an operation acts on + (popup +defaults) ; tame sudden yet inevitable temporary windows + ;;tabs ; a tab bar for Emacs + treemacs ; a project drawer, like neotree but cooler + ;;unicode ; extended unicode support for various languages + vc-gutter ; vcs diff in the fringe + vi-tilde-fringe ; fringe tildes to mark beyond EOB + ;;window-select ; visually switch windows + workspaces ; tab emulation, persistence & separate workspaces + ;;zen ; distraction-free coding or writing + + :editor + (evil +everywhere); come to the dark side, we have cookies + file-templates ; auto-snippets for empty files + fold ; (nigh) universal code folding + ;;(format +onsave) ; automated prettiness + ;;god ; run Emacs commands without modifier keys + ;;lispy ; vim for lisp, for people who don't like vim + ;;multiple-cursors ; editing in many places at once + ;;objed ; text object editing for the innocent + ;;parinfer ; turn lisp into python, sort of + ;;rotate-text ; cycle region at point between text candidates + snippets ; my elves. They type so I don't have to + ;;word-wrap ; soft wrapping with language-aware indent + + :emacs + dired ; making dired pretty [functional] + electric ; smarter, keyword-based electric-indent + ;;ibuffer ; interactive buffer management + undo ; persistent, smarter undo for your inevitable mistakes + vc ; version-control and Emacs, sitting in a tree + + :term + eshell ; the elisp shell that works everywhere + ;;shell ; simple shell REPL for Emacs + ;;term ; basic terminal emulator for Emacs + vterm ; the best terminal emulation in Emacs + + :checkers + syntax ; tasing you for every semicolon you forget + ;;(spell +flyspell) ; tasing you for misspelling mispelling + grammar ; tasing grammar mistake every you make + + :tools + ;;ansible + ;;biblio ; Writes a PhD for you (citation needed) + ;;debugger ; FIXME stepping through code, to help you add bugs + ;;direnv + ;;docker + ;;editorconfig ; let someone else argue about tabs vs spaces + ;;ein ; tame Jupyter notebooks with emacs + (eval +overlay) ; run code, run (also, repls) + ;;gist ; interacting with github gists + lookup ; navigate your code and its documentation + ;;lsp ; M-x vscode + magit ; a git porcelain for Emacs + make ; run make tasks from Emacs + pass ; password manager for nerds + ;;pdf ; pdf enhancements + ;;prodigy ; FIXME managing external services & code builders + ;;rgb ; creating color strings + ;;taskrunner ; taskrunner for all your projects + ;;terraform ; infrastructure as code + ;;tmux ; an API for interacting with tmux + tree-sitter ; syntax and parsing, sitting in a tree... + ;;upload ; map local to remote projects via ssh/ftp + + :os + (:if IS-MAC macos) ; improve compatibility with macOS + tty ; improve the terminal Emacs experience + exwm + + :lang + ;;agda ; types of types of types of types... + ;;beancount ; mind the GAAP + ;;(cc +lsp) ; C > C++ == 1 + ;;clojure ; java with a lisp + ;;common-lisp ; if you've seen one lisp, you've seen them all + ;;coq ; proofs-as-programs + ;;crystal ; ruby at the speed of c + ;;csharp ; unity, .NET, and mono shenanigans + ;;data ; config/data formats + ;;(dart +flutter) ; paint ui and not much else + ;;dhall + ;;elixir ; erlang done right + ;;elm ; care for a cup of TEA? + emacs-lisp ; drown in parentheses + ;;erlang ; an elegant language for a more civilized age + ;;ess ; emacs speaks statistics + ;;factor + ;;faust ; dsp, but you get to keep your soul + ;;fortran ; in FORTRAN, GOD is REAL (unless declared INTEGER) + ;;fsharp ; ML stands for Microsoft's Language + ;;fstar ; (dependent) types and (monadic) effects and Z3 + ;;gdscript ; the language you waited for + ;;(go +lsp) ; the hipster dialect + ;;(graphql +lsp) ; Give queries a REST + (haskell +lsp) ; a language that's lazier than I am + ;;hy ; readability of scheme w/ speed of python + ;;idris ; a language you can depend on + json ; At least it ain't XML + ;;(java +lsp) ; the poster child for carpal tunnel syndrome + javascript ; all(hope(abandon(ye(who(enter(here)))))) + ;;julia ; a better, faster MATLAB + ;;kotlin ; a better, slicker Java(Script) + ;;latex ; writing papers in Emacs has never been so fun + ;;lean ; for folks with too much to prove + ;;ledger ; be audit you can be + ;;lua ; one-based indices? one-based indices + markdown ; writing docs for people to ignore + ;;nim ; python + lisp at the speed of c + nix ; I hereby declare "nix geht mehr!" + ;;ocaml ; an objective camel + org ; organize your plain life in plain text + ;;php ; perl's insecure younger brother + ;;plantuml ; diagrams for confusing people more + ;;purescript ; javascript, but functional + python ; beautiful is better than ugly + ;;qt ; the 'cutest' gui framework ever + ;;racket ; a DSL for DSLs + ;;raku ; the artist formerly known as perl6 + ;;rest ; Emacs as a REST client + ;;rst ; ReST in peace + ;;(ruby +rails) ; 1.step {|i| p "Ruby is #{i.even? ? 'love' : 'life'}"} + ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() + ;;scala ; java, but good + ;;(scheme +guile) ; a fully conniving family of lisps + sh ; she sells {ba,z,fi}sh shells on the C xor + ;;sml + solidity ; do you need a blockchain? No. + ;;swift ; who asked for emoji variables? + ;;terra ; Earth and Moon in alignment for performance. + ;;web ; the tubes + yaml ; JSON, but readable + ;;zig ; C, but simpler + + :email + ;;(mu4e +org +gmail) + ;;notmuch + ;;(wanderlust +gmail) + + :app + ;;calendar + ;;emms + ;;everywhere ; *leave* Emacs!? You must be joking + ;;irc ; how neckbeards socialize + ;;(rss +org) ; emacs as an RSS reader + ;;twitter ; twitter client https://twitter.com/vnought + + :config + ;;literate + (default +bindings +smartparens)) diff --git a/doom.d/modules/os/exwm/config.el b/doom.d/modules/os/exwm/config.el new file mode 100644 index 0000000..d71cf79 --- /dev/null +++ b/doom.d/modules/os/exwm/config.el @@ -0,0 +1,134 @@ +;;; os/exwm/config.el -*- lexical-binding: t; -*- + +;; Define custom variables for the `exwm-update-class-hook' for users to +;; configure which buffers names should NOT be modified. +(defvar exwm/ignore-wm-prefix "sun-awt-X11-" + "Don't rename exwm buffers with this prefix.") +(defvar exwm/ignore-wm-name "gimp" + "Don't rename exwm buffers with this name.") + +;; Make sure `exwm' windows can be restored when switching workspaces. +(defun exwm--update-utf8-title-advice (oldfun id &optional force) + "Only update the window title when the buffer is visible." + (when (get-buffer-window (exwm--id->buffer id)) + (funcall oldfun id force))) + +;; Confgure `exwm' the X window manager for emacs. +(use-package! exwm + :config + ;; Configure global key bindings. + (setq exwm-input-global-keys + `(([?\s-r] . exwm-reset) + ([?\s-w] . exwm-workspace-switch) + ([?\s-&] . (lambda (command) + (interactive (list (read-shell-command "$ "))) + (start-process-shell-command command nil command))) + ,@(mapcar (lambda (i) + `(,(kbd (format "s-%d" i)) . + (lambda () + (interactive) + (exwm-workspace-switch-create ,i)))) + (number-sequence 0 9)))) + + ;; Configure the default buffer behaviour. All buffers created in `exwm-mode' + ;; are named "*EXWM*". Change it in `exwm-update-class-hook' and `exwm-update-title-hook' + ;; which are run when a new X window class name or title is available. + (add-hook 'exwm-update-class-hook + (lambda () + (unless (or (string-prefix-p exwm/ignore-wm-prefix exwm-instance-name) + (string= exwm/ignore-wm-name exwm-instance-name)) + (exwm-workspace-rename-buffer exwm-class-name)))) + (add-hook 'exwm-update-title-hook + (lambda () + (when (or (not exwm-instance-name) + (string-prefix-p exwm/ignore-wm-prefix exwm-instance-name) + (string= exwm/ignore-wm-name exwm-instance-name)) + (exwm-workspace-rename-buffer exwm-title)))) + + ;; Show `exwm' buffers in buffer switching prompts. + (add-hook 'exwm-mode-hook #'doom-mark-buffer-as-real-h) + + ;; Restore window configurations involving exwm buffers by only changing names + ;; of visible buffers. + (advice-add #'exwm--update-utf8-title :around #'exwm--update-utf8-title-advice) + + ;; Enable the window manager. + (exwm-enable)) + +;; Use the `ido' configuration for a few configuration fixes that alter +;; 'C-x b' workplace switching behaviour. This also effects the functionality +;; of 'SPC .' file searching in doom regardless of the users `ido' configuration. +(use-package! exwm-config + :after exwm + :config + (exwm-config--fix/ido-buffer-window-other-frame)) + +;; Configure `exwm-randr' to support multi-monitor setups as well as +;; hot-plugging HDMI outputs. Read more at: +;; https://github.com/ch11ng/exwm/wiki#randr-multi-screen +(use-package! exwm-randr + :after exwm + :config + (add-hook 'exwm-randr-screen-change-hook + (lambda () + (let ((xrandr-output-regexp "\n\\([^ ]+\\) connected ") + default-output) + (with-temp-buffer + (call-process "xrandr" nil t nil) + (goto-char (point-min)) + (re-search-forward xrandr-output-regexp nil 'noerror) + (setq default-output (match-string 1)) + (forward-line) + (if (not (re-search-forward xrandr-output-regexp nil 'noerror)) + (call-process + "xrandr" nil nil nil + "--output" default-output + "--auto") + (call-process + "xrandr" nil nil nil + "--output" (match-string 1) "--primary" "--auto" + "--output" default-output "--off") + (setq exwm-randr-workspace-monitor-plist + (list 0 (match-string 1)))))))) + (exwm-randr-enable)) + +;; Configure emacs input methods in all X windows. +(when (featurep! +xim) + (use-package! exwm-xim + :after exwm + :config + ;; These variables are required for X programs to pick up Emacs IM. + (setenv "XMODIFIERS" "@im=exwm-xim") + (setenv "GTK_IM_MODULE" "xim") + (setenv "QT_IM_MODULE" "xim") + (setenv "CLUTTER_IM_MODULE" "xim") + (setenv "QT_QPA_PLATFORM" "xcb") + (setenv "SDL_VIDEODRIVER" "x11") + (exwm-xim-enable))) + +;; Configure the rudamentary status bar. +(when (featurep! +status) + (setq display-time-default-load-average nil) + (display-time-mode +1) + (display-battery-mode +1)) + +;; Configure `exwm-firefox-*'. +(when (featurep! +firefox) + (use-package! exwm-firefox-core + :after exwm + :config + ;; Add the key to the exwm input keys for firefox buffers. + (dolist (k `(escape)) + (cl-pushnew k exwm-input-prefix-keys))) + + ;; Configure further depending if the user has evil mode enabled. + (when (featurep! :editor evil) + (use-package! exwm-firefox-evil + :after exwm + :config + ;; Add the firefox wm class name. + (dolist (k `("firefox")) + (cl-pushnew k exwm-firefox-evil-firefox-class-name)) + ;; Add the firefox buffer hook + (add-hook 'exwm-manage-finish-hook + 'exwm-firefox-evil-activate-if-firefox)))) diff --git a/doom.d/modules/os/exwm/doctor.el b/doom.d/modules/os/exwm/doctor.el new file mode 100644 index 0000000..b84123d --- /dev/null +++ b/doom.d/modules/os/exwm/doctor.el @@ -0,0 +1,6 @@ +;;; -*- lexical-binding: t; no-byte-compile: t; -*- +;;; os/exwm/doctor.el + +(when (featurep! +firefox) + (unless (executable-find "firefox") + (warn! "Couldn't find firefox. exwm-firefox will not work"))) diff --git a/doom.d/modules/os/exwm/packages.el b/doom.d/modules/os/exwm/packages.el new file mode 100644 index 0000000..da58a9c --- /dev/null +++ b/doom.d/modules/os/exwm/packages.el @@ -0,0 +1,11 @@ +;; -*- no-byte-compile: t; -*- +;;; os/exwm/packages.el + +;; Here we require the `exwm' package. +(package! exwm :pin "e43bd78...") + +;; Here we require the `exwm-firefox*' packages. +(when (featurep! +firefox) + (if (featurep! :editor evil) + (package! exwm-firefox-evil :pin "14643ee...") + (package! exwm-firefox-core :pin "e2fe2a8ODO..."))) diff --git a/doom.d/packages.el b/doom.d/packages.el new file mode 100644 index 0000000..d800a98 --- /dev/null +++ b/doom.d/packages.el @@ -0,0 +1,52 @@ +;; -*- no-byte-compile: t; -*- +;;; $DOOMDIR/packages.el + +;; To install a package with Doom you must declare them here and run 'doom sync' +;; on the command line, then restart Emacs for the changes to take effect -- or +;; use 'M-x doom/reload'. + + +;; To install SOME-PACKAGE from MELPA, ELPA or emacsmirror: +;(package! some-package) + +;; To install a package directly from a remote git repo, you must specify a +;; `:recipe'. You'll find documentation on what `:recipe' accepts here: +;; https://github.com/radian-software/straight.el#the-recipe-format +;(package! another-package +; :recipe (:host github :repo "username/repo")) + +;; If the package you are trying to install does not contain a PACKAGENAME.el +;; file, or is located in a subdirectory of the repo, you'll need to specify +;; `:files' in the `:recipe': +;(package! this-package +; :recipe (:host github :repo "username/repo" +; :files ("some-file.el" "src/lisp/*.el"))) + +;; If you'd like to disable a package included with Doom, you can do so here +;; with the `:disable' property: +;(package! builtin-package :disable t) + +;; You can override the recipe of a built in package without having to specify +;; all the properties for `:recipe'. These will inherit the rest of its recipe +;; from Doom or MELPA/ELPA/Emacsmirror: +;(package! builtin-package :recipe (:nonrecursive t)) +;(package! builtin-package-2 :recipe (:repo "myfork/package")) + +;; Specify a `:branch' to install a package from a particular branch or tag. +;; This is required for some packages whose default branch isn't 'master' (which +;; our package manager can't deal with; see radian-software/straight.el#279) +;(package! builtin-package :recipe (:branch "develop")) + +;; Use `:pin' to specify a particular commit to install. +;(package! builtin-package :pin "1a2b3c4d5e") + + +;; Doom's packages are pinned to a specific commit and updated from release to +;; release. The `unpin!' macro allows you to unpin single packages... +;(unpin! pinned-package) +;; ...or multiple packages +;(unpin! pinned-package another-pinned-package) +;; ...Or *all* packages (NOT RECOMMENDED; will likely break things) +;(unpin! t) + +(package! pinentry) diff --git a/emacs.d b/emacs.d deleted file mode 120000 index 683a6b9..0000000 --- a/emacs.d +++ /dev/null @@ -1 +0,0 @@ -users/profiles/emacs/emacs.d \ No newline at end of file diff --git a/flake.lock b/flake.lock index ea591de..cd03c88 100644 --- a/flake.lock +++ b/flake.lock @@ -1,125 +1,106 @@ { "nodes": { - "blank": { - "locked": { - "lastModified": 1625557891, - "narHash": "sha256-O8/MWsPBGhhyPoPLHZAuoZiiHo9q6FLlEeIDEXuj6T4=", - "owner": "divnix", - "repo": "blank", - "rev": "5a5d2684073d9f563072ed07c871d577a6c614a8", - "type": "github" - }, - "original": { - "owner": "divnix", - "repo": "blank", - "type": "github" - } - }, - "darwin": { + "agenix": { "inputs": { "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1650976225, - "narHash": "sha256-PGM65SQHS63Dd5MmLJo3GJsZP9lJVZmpWxluQoG1Dt8=", - "owner": "LnL7", - "repo": "nix-darwin", - "rev": "bb3baef6e115ae47bc2ab4973bd3a486488485b0", + "lastModified": 1652712410, + "narHash": "sha256-hMJ2TqLt0DleEnQFGUHK9sV2aAzJPU8pZeiZoqRozbE=", + "owner": "ryantm", + "repo": "agenix", + "rev": "7e5e58b98c3dcbf497543ff6f22591552ebfe65b", "type": "github" }, "original": { - "owner": "LnL7", - "repo": "nix-darwin", + "owner": "ryantm", + "repo": "agenix", "type": "github" } }, - "deploy": { + "doom-emacs": { + "flake": false, + "locked": { + "lastModified": 1657393840, + "narHash": "sha256-ISaIbqCNKKz9DhrTVKvDS40CzZiqICb2eDepGUdwYQA=", + "owner": "doomemacs", + "repo": "doomemacs", + "rev": "33c5f3721a704c72e49efc5960be3785d1a80b81", + "type": "github" + }, + "original": { + "owner": "doomemacs", + "ref": "master", + "repo": "doomemacs", + "type": "github" + } + }, + "doom-snippets": { + "flake": false, + "locked": { + "lastModified": 1655900328, + "narHash": "sha256-fEYwFxW2sdzNK14DrS92OCGy8KDPZKewrHljnE/RlzQ=", + "owner": "doomemacs", + "repo": "snippets", + "rev": "6b2bd5a77c536ed414794ecf71d37a60ebd4663e", + "type": "github" + }, + "original": { + "owner": "doomemacs", + "repo": "snippets", + "type": "github" + } + }, + "doomEmacs": { "inputs": { + "doom-emacs": "doom-emacs", + "doom-snippets": "doom-snippets", + "emacs-overlay": "emacs-overlay", + "emacs-so-long": "emacs-so-long", + "evil-escape": "evil-escape", + "evil-markdown": "evil-markdown", + "evil-org-mode": "evil-org-mode", + "evil-quick-diff": "evil-quick-diff", + "explain-pause-mode": "explain-pause-mode", "flake-compat": "flake-compat", - "nixpkgs": "nixpkgs_2", - "utils": "utils" - }, - "locked": { - "lastModified": 1648475189, - "narHash": "sha256-gAGAS6IagwoUr1B0ohE3iR6sZ8hP4LSqzYLC8Mq3WGU=", - "owner": "serokell", - "repo": "deploy-rs", - "rev": "83e0c78291cd08cb827ba0d553ad9158ae5a95c3", - "type": "github" - }, - "original": { - "owner": "serokell", - "repo": "deploy-rs", - "type": "github" - } - }, - "devshell": { - "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_3" + "format-all": "format-all", + "nix-straight": "nix-straight", + "nixpkgs": "nixpkgs_2", + "nose": "nose", + "ob-racket": "ob-racket", + "org": "org", + "org-contrib": "org-contrib", + "org-yt": "org-yt", + "php-extras": "php-extras", + "revealjs": "revealjs", + "rotate-text": "rotate-text", + "sln-mode": "sln-mode", + "ts-fold": "ts-fold", + "ws-butler": "ws-butler" }, "locked": { - "lastModified": 1650389807, - "narHash": "sha256-GFRBdHMJ/T/ifaE2GS58RWpxyufH0LqI3oGS6oWAnHk=", - "owner": "numtide", - "repo": "devshell", - "rev": "5a53bbf3eb4c908d83884d725a86b3a3bde35979", + "lastModified": 1658470797, + "narHash": "sha256-ovk7xcjGqoXgc7fV4m0tlKhiuAglON4TKmt//Bd0fLE=", + "owner": "nix-community", + "repo": "nix-doom-emacs", + "rev": "f7fd8620be427c6489f496645513d536e380c50c", "type": "github" }, "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, - "digga": { - "inputs": { - "blank": "blank", - "darwin": "darwin", - "deploy": "deploy", - "devshell": "devshell", - "flake-compat": "flake-compat_2", - "flake-utils-plus": "flake-utils-plus", - "home-manager": [ - "unstable" - ], - "latest": "latest", - "nixlib": [ - "unstable" - ], - "nixpkgs": [ - "unstable" - ], - "nixpkgs-unstable": "nixpkgs-unstable" - }, - "locked": { - "lastModified": 1653150882, - "narHash": "sha256-uxz5yS6BliJE7Ed7gV9e6c0cCxo8AoWorHBpc7/I8FI=", - "owner": "divnix", - "repo": "digga", - "rev": "6b0c0aa1ae0410960de8f3ae7168e1991783ecbb", - "type": "github" - }, - "original": { - "owner": "divnix", - "ref": "hotfix-exported-overlays", - "repo": "digga", + "owner": "nix-community", + "repo": "nix-doom-emacs", "type": "github" } }, "emacs-overlay": { - "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": [ - "unstable" - ] - }, + "flake": false, "locked": { - "lastModified": 1653736770, - "narHash": "sha256-Vp8fWSGTEeuWc71rVXsh+ofsHHUPhKunc8aQLGN0ETc=", + "lastModified": 1658430126, + "narHash": "sha256-W5zw1NI7c47qT/FCkNAVmahA5On5UUs1pabAL6Tb2iI=", "owner": "nix-community", "repo": "emacs-overlay", - "rev": "ff629e757452d010b7c91fdd2597aeca370bcf68", + "rev": "6c868dbad387da912e2a47f63a913c8a62555127", "type": "github" }, "original": { @@ -128,23 +109,103 @@ "type": "github" } }, + "emacs-so-long": { + "flake": false, + "locked": { + "lastModified": 1575031854, + "narHash": "sha256-xIa5zO0ZaToDrec1OFjBK6l39AbA4l/CE4LInVu2hi0=", + "owner": "hlissner", + "repo": "emacs-so-long", + "rev": "ed666b0716f60e8988c455804de24b55919e71ca", + "type": "github" + }, + "original": { + "owner": "hlissner", + "repo": "emacs-so-long", + "type": "github" + } + }, + "evil-escape": { + "flake": false, + "locked": { + "lastModified": 1588439096, + "narHash": "sha256-aB2Ge5o/93B18tPf4fN1c+O46CNh/nOqwLJbox4c8Gw=", + "owner": "hlissner", + "repo": "evil-escape", + "rev": "819f1ee1cf3f69a1ae920e6004f2c0baeebbe077", + "type": "github" + }, + "original": { + "owner": "hlissner", + "repo": "evil-escape", + "type": "github" + } + }, + "evil-markdown": { + "flake": false, + "locked": { + "lastModified": 1626852210, + "narHash": "sha256-HBBuZ1VWIn6kwK5CtGIvHM1+9eiNiKPH0GUsyvpUVN8=", + "owner": "Somelauw", + "repo": "evil-markdown", + "rev": "8e6cc68af83914b2fa9fd3a3b8472573dbcef477", + "type": "github" + }, + "original": { + "owner": "Somelauw", + "repo": "evil-markdown", + "type": "github" + } + }, + "evil-org-mode": { + "flake": false, + "locked": { + "lastModified": 1607203864, + "narHash": "sha256-JxwqVYDN6OIJEH15MVI6XOZAPtUWUhJQWHyzcrUvrFg=", + "owner": "hlissner", + "repo": "evil-org-mode", + "rev": "a9706da260c45b98601bcd72b1d2c0a24a017700", + "type": "github" + }, + "original": { + "owner": "hlissner", + "repo": "evil-org-mode", + "type": "github" + } + }, + "evil-quick-diff": { + "flake": false, + "locked": { + "lastModified": 1575189609, + "narHash": "sha256-oGzl1ayW9rIuq0haoiFS7RZsS8NFMdEA7K1BSozgnJU=", + "owner": "rgrinberg", + "repo": "evil-quick-diff", + "rev": "69c883720b30a892c63bc89f49d4f0e8b8028908", + "type": "github" + }, + "original": { + "owner": "rgrinberg", + "repo": "evil-quick-diff", + "type": "github" + } + }, + "explain-pause-mode": { + "flake": false, + "locked": { + "lastModified": 1595842060, + "narHash": "sha256-++znrjiDSx+cy4okFBBXUBkRFdtnE2x+trkmqjB3Njs=", + "owner": "lastquestion", + "repo": "explain-pause-mode", + "rev": "2356c8c3639cbeeb9751744dbe737267849b4b51", + "type": "github" + }, + "original": { + "owner": "lastquestion", + "repo": "explain-pause-mode", + "type": "github" + } + }, "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1648199409, - "narHash": "sha256-JwPKdC2PoVBkG6E+eWw3j6BMR6sL3COpYWfif7RVb8Y=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "64a525ee38886ab9028e6f61790de0832aa3ef03", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "flake-compat_2": { "flake": false, "locked": { "lastModified": 1650374568, @@ -162,11 +223,11 @@ }, "flake-utils": { "locked": { - "lastModified": 1642700792, - "narHash": "sha256-XqHrk7hFb+zBvRg6Ghl+AZDq03ov6OshJLiSWOoX5es=", + "lastModified": 1656928814, + "narHash": "sha256-RIFfgBuKz6Hp89yRr7+NR5tzIAbn52h8vT6vXkYjZoM=", "owner": "numtide", "repo": "flake-utils", - "rev": "846b2ae0fc4cc943637d3d1def4454213e203cba", + "rev": "7e2a3b3dfd9af950a856d66b0a7d01e3c18aa249", "type": "github" }, "original": { @@ -175,24 +236,6 @@ "type": "github" } }, - "flake-utils-plus": { - "inputs": { - "flake-utils": "flake-utils_2" - }, - "locked": { - "lastModified": 1652704544, - "narHash": "sha256-UTKE33tYgCmDszaVyWA33a8mtegM5xfH4fH8w4y6TxA=", - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "rev": "f8d6d1f87b6177e3bc674c29f247bdbf897ba274", - "type": "github" - }, - "original": { - "owner": "gytis-ivaskevicius", - "repo": "flake-utils-plus", - "type": "github" - } - }, "flake-utils_2": { "locked": { "lastModified": 1644229661, @@ -208,33 +251,36 @@ "type": "github" } }, - "flake-utils_3": { + "format-all": { + "flake": false, "locked": { - "lastModified": 1652776076, - "narHash": "sha256-gzTw/v1vj4dOVbpBSJX4J0DwUR6LIyXo7/SuuTJp1kM=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "04c1b180862888302ddfb2e3ad9eaa63afc60cf8", + "lastModified": 1581716637, + "narHash": "sha256-ul7LCe60W8TIvUmUtZtZRo8489TK9iTPDsLHmzxY57M=", + "owner": "lassik", + "repo": "emacs-format-all-the-code", + "rev": "47d862d40a088ca089c92cd393c6dca4628f87d3", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "lassik", + "repo": "emacs-format-all-the-code", + "rev": "47d862d40a088ca089c92cd393c6dca4628f87d3", "type": "github" } }, - "home": { + "homeManager": { "inputs": { "nixpkgs": [ - "unstable" - ] + "nixpkgsUnstable" + ], + "utils": "utils" }, "locked": { - "lastModified": 1653518057, - "narHash": "sha256-cam3Nfae5ADeEs6mRPzr0jXB7+DhyMIXz0/0Q13r/yk=", + "lastModified": 1658238241, + "narHash": "sha256-naoSta79MYYRtVnIZhzq+YWgTOBhWE1Sr1AIhG7ZA9g=", "owner": "nix-community", "repo": "home-manager", - "rev": "64831f938bd413cefde0b0cf871febc494afaa4f", + "rev": "70d5929885ccec8dde8585894dd3ebe606e75f41", "type": "github" }, "original": { @@ -243,44 +289,92 @@ "type": "github" } }, - "latest": { + "nix-straight": { + "flake": false, "locked": { - "lastModified": 1650701402, - "narHash": "sha256-XKfstdtqDg+O+gNBx1yGVKWIhLgfEDg/e2lvJSsp9vU=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "bc41b01dd7a9fdffd32d9b03806798797532a5fe", + "lastModified": 1656684255, + "narHash": "sha256-ZefQiv4Ipu2VkLjs1oyelTLU7kBVJgkcQd+yBpJU0yo=", + "owner": "nix-community", + "repo": "nix-straight.el", + "rev": "fb8dd5c44cde70abd13380766e40af7a63888942", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixos-hardware": { - "locked": { - "lastModified": 1653463224, - "narHash": "sha256-bUxKhqZhki2vPzFTl8HOo1m7pagF7WzY1MZiso8U5ws=", - "owner": "NixOS", - "repo": "nixos-hardware", - "rev": "39a7bfc496d2ddfce73fe9542af1f2029ba4fe39", - "type": "github" - }, - "original": { - "owner": "NixOS", - "repo": "nixos-hardware", + "owner": "nix-community", + "repo": "nix-straight.el", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1653738054, - "narHash": "sha256-IaR8iLN4Ms3f5EjU1CJkXSc49ZzyS5qv03DtVAti6/s=", + "lastModified": 1638587357, + "narHash": "sha256-2ySMW3QARG8BsRPmwe7clTbdCuaObromOKewykP+UJc=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e34c5379866833f41e2a36f309912fa675d687c7", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-21.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgsStable": { + "locked": { + "lastModified": 1658500284, + "narHash": "sha256-g7vwZ5UF8PvC9f2/7Zf5O6zxgJiMSuh1CiGZVuuOhEQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "17b62c338f2a0862a58bb6951556beecd98ccda9", + "rev": "e3583ad6e533a9d8dd78f90bfa93812d390ea187", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-22.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgsUnstable": { + "locked": { + "lastModified": 1658380158, + "narHash": "sha256-DBunkegKWlxPZiOcw3/SNIFg93amkdGIy2g0y/jDpHg=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a65b5b3f5504b8b89c196aba733bdf2b0bd13c16", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1658397257, + "narHash": "sha256-2M1Ih3r8/mL8h0n8+PYoGXFazVY9zBcGJrNxNC3JgNo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a174de16edfc6aa0893530b9a95d0bd0c2a952b7", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixpkgs-unstable", + "type": "indirect" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1645655918, + "narHash": "sha256-ZfbEFRW7o237+A1P7eTKhXje435FCAoe0blj2n20Was=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "77a7a4197740213879b9a1d2e1788c6c8ade4274", "type": "github" }, "original": { @@ -288,139 +382,202 @@ "type": "indirect" } }, - "nixpkgs-unstable": { + "nose": { + "flake": false, "locked": { - "lastModified": 1650726686, - "narHash": "sha256-hE5PCqQlsdgWH3AUTwesvjZWs5ZUZ8SjMS5cnFB6W54=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "3c0f57e36ed0cf9947281e3b31f1bebb7ce5d4a1", + "lastModified": 1400604510, + "narHash": "sha256-daEi8Kta1oGaDEmUUDDQMahTTPOpvNpDKk22rlr7cB0=", + "owner": "emacsattic", + "repo": "nose", + "rev": "f8528297519eba911696c4e68fa88892de9a7b72", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", + "owner": "emacsattic", + "repo": "nose", "type": "github" } }, - "nixpkgsDevInput": { + "ob-racket": { + "flake": false, "locked": { - "lastModified": 1650581082, - "narHash": "sha256-aq5jnmGhP0hSXYozkxUKpgSZILvDobxB976JZFG6If8=", - "owner": "aciceri", - "repo": "nixpkgs", - "rev": "24b40a255c6adc6ab32c69737e8b4cfc50d8c8b4", + "lastModified": 1584656173, + "narHash": "sha256-rBUYDDCXb+3D4xTPQo9UocbTPZ32kWV1Uya/1DmZknU=", + "owner": "xchrishawk", + "repo": "ob-racket", + "rev": "83457ec9e1e96a29fd2086ed19432b9d75787673", "type": "github" }, "original": { - "owner": "aciceri", - "repo": "nixpkgs", + "owner": "xchrishawk", + "repo": "ob-racket", "type": "github" } }, - "nixpkgs_2": { + "org": { + "flake": false, "locked": { - "lastModified": 1653738054, - "narHash": "sha256-IaR8iLN4Ms3f5EjU1CJkXSc49ZzyS5qv03DtVAti6/s=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "17b62c338f2a0862a58bb6951556beecd98ccda9", + "lastModified": 1658412564, + "narHash": "sha256-JHiUjc4OAfPtNTWikVYEIkJkba9qV4N3QbtcJpjk4cM=", + "owner": "emacs-straight", + "repo": "org-mode", + "rev": "99681ce38937ba993a0407cee4fd6a7f869211bf", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", + "owner": "emacs-straight", + "repo": "org-mode", "type": "github" } }, - "nixpkgs_3": { + "org-contrib": { + "flake": false, "locked": { - "lastModified": 1653738054, - "narHash": "sha256-IaR8iLN4Ms3f5EjU1CJkXSc49ZzyS5qv03DtVAti6/s=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "17b62c338f2a0862a58bb6951556beecd98ccda9", + "lastModified": 1652646857, + "narHash": "sha256-IWIShWyVnbwXqGLQaDNvJ0KoepxhIrXWTjPyGPEkQ14=", + "owner": "emacsmirror", + "repo": "org-contrib", + "rev": "c1e0980fd7a57ca2042fd78acfb1dfb5c3bc03fa", "type": "github" }, "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", + "owner": "emacsmirror", + "repo": "org-contrib", "type": "github" } }, - "nur": { + "org-yt": { + "flake": false, "locked": { - "lastModified": 1653724318, - "narHash": "sha256-4J2d/fc7huLrYsU7VRiquSNOcQoqQQQGNweR48zFEc4=", - "owner": "nix-community", - "repo": "NUR", - "rev": "7a8313c6322856a5adbf9217e289733e67020652", + "lastModified": 1527381913, + "narHash": "sha256-dzQ6B7ryzatHCTLyEnRSbWO0VUiX/FHYnpHTs74aVUs=", + "owner": "TobiasZawada", + "repo": "org-yt", + "rev": "40cc1ac76d741055cbefa13860d9f070a7ade001", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "NUR", + "owner": "TobiasZawada", + "repo": "org-yt", + "type": "github" + } + }, + "php-extras": { + "flake": false, + "locked": { + "lastModified": 1573312690, + "narHash": "sha256-r4WyVbzvT0ra4Z6JywNBOw5RxOEYd6Qe2IpebHXkj1U=", + "owner": "arnested", + "repo": "php-extras", + "rev": "d410c5af663c30c01d461ac476d1cbfbacb49367", + "type": "github" + }, + "original": { + "owner": "arnested", + "repo": "php-extras", + "type": "github" + } + }, + "preCommitHooks": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1656169028, + "narHash": "sha256-y9DRauokIeVHM7d29lwT8A+0YoGUBXV3H0VErxQeA8s=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "db3bd555d3a3ceab208bed48f983ccaa6a71a25e", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "revealjs": { + "flake": false, + "locked": { + "lastModified": 1653993278, + "narHash": "sha256-X43lsjoLBWmttIKj9Jzut0UP0dZlsue3fYbJ3++ojbU=", + "owner": "hakimel", + "repo": "reveal.js", + "rev": "039972c730690af7a83a5cb832056a7cc8b565d7", + "type": "github" + }, + "original": { + "owner": "hakimel", + "repo": "reveal.js", "type": "github" } }, "root": { "inputs": { - "deploy": [ - "digga", - "deploy" - ], - "digga": "digga", - "emacs-overlay": "emacs-overlay", - "home": "home", - "nixos-hardware": "nixos-hardware", - "nixpkgsDevInput": "nixpkgsDevInput", - "nur": "nur", - "stable": "stable", - "unstable": "unstable" + "agenix": "agenix", + "doomEmacs": "doomEmacs", + "homeManager": "homeManager", + "nixpkgsStable": "nixpkgsStable", + "nixpkgsUnstable": "nixpkgsUnstable", + "preCommitHooks": "preCommitHooks" } }, - "stable": { + "rotate-text": { + "flake": false, "locked": { - "lastModified": 1653653155, - "narHash": "sha256-zeKfULtxT5f7yDHhg7awVhVEsTsMNGNS2/7xlymUIFU=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "13c15a84ffa02c5dd288f2398cd6eaf107d16dc5", + "lastModified": 1322962747, + "narHash": "sha256-SOeOgSlcEIsKhUiYDJv0p+mLUb420s9E2BmvZQvZ0wk=", + "owner": "debug-ito", + "repo": "rotate-text.el", + "rev": "48f193697db996855aee1ad2bc99b38c6646fe76", "type": "github" }, "original": { - "owner": "nixos", - "ref": "release-21.11", - "repo": "nixpkgs", + "owner": "debug-ito", + "repo": "rotate-text.el", "type": "github" } }, - "unstable": { + "sln-mode": { + "flake": false, "locked": { - "lastModified": 1653581809, - "narHash": "sha256-Uvka0V5MTGbeOfWte25+tfRL3moECDh1VwokWSZUdoY=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "83658b28fe638a170a19b8933aa008b30640fbd1", + "lastModified": 1423727528, + "narHash": "sha256-XqkqPyEJuTtFslOz1fpTf/Klbd/zA7IGpzpmum/MGao=", + "owner": "sensorflo", + "repo": "sln-mode", + "rev": "0f91d1b957c7d2a7bab9278ec57b54d57f1dbd9c", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", + "owner": "sensorflo", + "repo": "sln-mode", + "type": "github" + } + }, + "ts-fold": { + "flake": false, + "locked": { + "lastModified": 1658223568, + "narHash": "sha256-HxUAg+MUbH8nNhKtRzZDeN/a/sCQHSpDRCK2nvvHp8g=", + "owner": "jcs-elpa", + "repo": "ts-fold", + "rev": "ea554f10e79ed9846662b1639adc4b86783ecfc6", + "type": "github" + }, + "original": { + "owner": "jcs-elpa", + "repo": "ts-fold", "type": "github" } }, "utils": { "locked": { - "lastModified": 1648297722, - "narHash": "sha256-W+qlPsiZd8F3XkzXOzAoR+mpFqzm3ekQkJNa+PIh1BQ=", + "lastModified": 1653893745, + "narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "0f8662f1319ad6abf89b3380dd2722369fc51ade", + "rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1", "type": "github" }, "original": { @@ -428,6 +585,22 @@ "repo": "flake-utils", "type": "github" } + }, + "ws-butler": { + "flake": false, + "locked": { + "lastModified": 1634511126, + "narHash": "sha256-c0y0ZPtxxICPk+eaNbbQf6t+FRCliNY54CCz9QHQ8ZI=", + "owner": "hlissner", + "repo": "ws-butler", + "rev": "572a10c11b6cb88293de48acbb59a059d36f9ba5", + "type": "github" + }, + "original": { + "owner": "hlissner", + "repo": "ws-butler", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index bc811c1..8cf30b4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,145 +1,36 @@ { - description = "A complete, declarative and reproducible configuration of my entire Nix fleet"; + description = "A complete, declarative, and reproducible configuration of my entire Nix fleet"; - inputs = - { - stable.url = github:nixos/nixpkgs/release-21.11; - unstable.url = github:nixos/nixpkgs/nixos-unstable; - nixpkgsDevInput.url = github:aciceri/nixpkgs; - - nur.url = github:nix-community/NUR; - - digga.url = github:divnix/digga/hotfix-exported-overlays; # waiting for https://github.com/divnix/digga/issues/464 - digga.inputs.nixpkgs.follows = "unstable"; - digga.inputs.nixlib.follows = "unstable"; - digga.inputs.home-manager.follows = "unstable"; - - home.url = github:nix-community/home-manager; - home.inputs.nixpkgs.follows = "unstable"; - - deploy.follows = "digga/deploy"; - - emacs-overlay.url = github:nix-community/emacs-overlay; - emacs-overlay.inputs.nixpkgs.follows = "unstable"; - - nixos-hardware.url = github:NixOS/nixos-hardware; + inputs = { + nixpkgsUnstable.url = github:NixOS/nixpkgs/nixos-unstable; + nixpkgsStable.url = github:NixOS/nixpkgs/nixos-22.05; + homeManager = { + url = github:nix-community/home-manager; + inputs.nixpkgs.follows = "nixpkgsUnstable"; }; + preCommitHooks.url = github:cachix/pre-commit-hooks.nix; + agenix.url = github:ryantm/agenix; + doomEmacs.url = github:nix-community/nix-doom-emacs; + }; - outputs = - { self - , stable - , unstable - , nixpkgsDevInput - , digga - , home - , nixos-hardware - , emacs-overlay - , nur - , deploy - , ... - } @ inputs: + outputs = { + self, + nixpkgsUnstable, + nixpkgsStable, + homeManager, + preCommitHooks, + agenix, + doomEmacs, + } @ inputs: let + utils = (import ./utils) inputs; + inherit (utils) lib mkConfigurations mkVmApps checkFormatting formatApp mkDevShell; + in { + nixosConfigurations = mkConfigurations; - digga.lib.mkFlake - { - inherit self inputs; + apps = lib.recursiveUpdate (mkVmApps self.nixosConfigurations) formatApp; - channelsConfig = { allowUnfree = true; }; + checks = checkFormatting ./.; - channels = { - stable = { - imports = [ (digga.lib.importOverlays ./overlays) ]; - }; - unstable = { - imports = [ (digga.lib.importOverlays ./overlays) ]; - }; - }; - - sharedOverlays = [ - ( - final: prev: { - __dontExport = true; - lib = prev.lib.extend ( - lfinal: lprev: { - our = self.lib; - } - ); - } - ) - emacs-overlay.overlay - nur.overlay - deploy.overlay - (import ./pkgs { - nixpkgsStableInput = stable; - nixpkgsDevInput = nixpkgsDevInput; - }) - ]; - - nixos = { - hostDefaults = { - channelName = "stable"; - imports = [ (digga.lib.importExportableModules ./modules) ]; - modules = [ - # { lib.our = self.lib; } - digga.nixosModules.bootstrapIso - digga.nixosModules.nixConfig - home.nixosModules.home-manager - ]; - }; - hosts = { - pc = { - system = "x86_64-linux"; - channelName = "unstable"; - imports = [{ modules = ./hosts/pc; }]; - }; - hs = { - system = "x86_64-linux"; - channelName = "stable"; - imports = [{ modules = ./hosts/hs; }]; - }; - pbp = { - system = "aarch64-linux"; - channelName = "unstable"; - imports = [{ modules = ./hosts/pbp; }]; - modules = [ - "${nixos-hardware}/pine64/pinebook-pro" - ]; - }; - }; - importables = rec { - profiles = digga.lib.rakeLeaves ./profiles // { - users = digga.lib.rakeLeaves ./users; - }; - suites = with profiles; rec { - base = [ core upower users.ccr users.root ]; - }; - }; - }; - - home = { - imports = [ (digga.lib.importExportableModules ./users/modules) ]; - modules = [ ]; - importables = rec { - profiles = digga.lib.rakeLeaves ./users/profiles; - suites = with profiles; rec { - base = [ direnv git zsh gpg password-store udiskie tmux ]; - emails = [ mails ]; - shell = [ zsh exa fzf ]; - gui = [ sway xdg gtk foot bat ]; - browser = [ firefox chromium qutebrowser tor-browser ]; - multimedia = [ mpv zathura ]; - dev = [ vim emacs vscode lorri direnv qmk ]; - modelling = [ blender cura ]; - }; - }; - }; - - devshell = ./shell; - - homeConfigurations = digga.lib.mkHomeConfigurations - self.nixosConfigurations; - - deploy.nodes = digga.lib.mkDeployNodes - self.nixosConfigurations - { }; - }; + devShells = mkDevShell; + }; } diff --git a/hmModules/emacs/default.nix b/hmModules/emacs/default.nix new file mode 100644 index 0000000..67f4b8f --- /dev/null +++ b/hmModules/emacs/default.nix @@ -0,0 +1,12 @@ +{pkgs, ...}: { + programs.emacs.enable = true; + programs.doom-emacs = { + enable = true; + package = pkgs.emacs28NativeComp; + doomPrivateDir = ../../doom.d; + }; + + services.emacs = { + enable = true; + }; +} diff --git a/hmModules/firefox/default.nix b/hmModules/firefox/default.nix new file mode 100644 index 0000000..876afd3 --- /dev/null +++ b/hmModules/firefox/default.nix @@ -0,0 +1,18 @@ +{pkgs, ...}: { + programs.firefox = { + enable = true; + profiles.ccr = { + settings = { + "browser.startup.homepage" = "https://google.it"; + "browser.search.region" = "IT"; + "browser.search.isUS" = false; + "distribution.searchplugins.defaultLocale" = "it-IT"; + "general.useragent.locale" = "it-IT"; + "browser.bookmarks.showMobileBookmarks" = true; + "browser.download.folderList" = 2; + "browser.download.lastDir" = "/home/ccr/downloads/"; + "browser.shell.checkDefaultBrowser" = false; + }; + }; + }; +} diff --git a/hmModules/git/default.nix b/hmModules/git/default.nix new file mode 100644 index 0000000..0327947 --- /dev/null +++ b/hmModules/git/default.nix @@ -0,0 +1,33 @@ +{pkgs, ...}: let + config = { + name = "Andrea Ciceri"; + email = "andrea.ciceri@autistici.org"; + }; +in { + programs.git = { + enable = true; + package = pkgs.gitAndTools.gitFull; + + extraConfig = { + ui.color = true; + pull.rebase = false; + rebase.autostash = true; + }; + + userName = config.name; + userEmail = config.email; + signing = { + signByDefault = true; + key = config.email; + }; + + extraConfig = { + url = + if pkgs.stdenv.hostPlatform.isDarwin + then {} + else { + "ssh://git@github.com/" = {insteadOf = https://github.com/;}; + }; + }; + }; +} diff --git a/hmModules/gpg/default.nix b/hmModules/gpg/default.nix new file mode 100644 index 0000000..c4a6429 --- /dev/null +++ b/hmModules/gpg/default.nix @@ -0,0 +1,16 @@ +{pkgs, ...}: { + services.gpg-agent = { + enable = true; + enableSshSupport = true; + sshKeys = ["CE2FD0D9BECBD8876811714925066CC257413416"]; + extraConfig = '' + allow-emacs-pinentry + allow-loopback-pinentry + ''; + }; + + programs.gpg = { + enable = true; + settings = {}; + }; +} diff --git a/hmModules/mpv/default.nix b/hmModules/mpv/default.nix new file mode 100644 index 0000000..cd51d6f --- /dev/null +++ b/hmModules/mpv/default.nix @@ -0,0 +1,3 @@ +{ + programs.mpv.enable = true; +} diff --git a/users/profiles/password-store/default.nix b/hmModules/password-store/default.nix similarity index 83% rename from users/profiles/password-store/default.nix rename to hmModules/password-store/default.nix index 185e323..c2a01b3 100644 --- a/users/profiles/password-store/default.nix +++ b/hmModules/password-store/default.nix @@ -1,9 +1,14 @@ { - services.password-store-sync.enable = true; + config, + lib, + pkgs, + ... +}: { programs.password-store = { enable = true; settings = { PASSWORD_STORE_DIR = "/home/ccr/.password-store"; }; }; + services.password-store-sync.enable = true; } diff --git a/users/profiles/qutebrowser/default.nix b/hmModules/qutebrowser/default.nix similarity index 92% rename from users/profiles/qutebrowser/default.nix rename to hmModules/qutebrowser/default.nix index 435d55b..ad87314 100644 --- a/users/profiles/qutebrowser/default.nix +++ b/hmModules/qutebrowser/default.nix @@ -1,6 +1,4 @@ -{ pkgs, ... }: - -{ +{pkgs, ...}: { programs.qutebrowser = { enable = true; searchEngines = { @@ -23,7 +21,7 @@ }; }; settings = { - url.start_pages = [ "https://searx.be" ]; + url.start_pages = ["https://searx.be"]; editor.command = [ "emacsclient" "+{line}:{column}" @@ -41,9 +39,8 @@ comment = "Qutebrowser"; desktopName = "qutebrowser"; type = "Application"; - mimeTypes = [ "x-scheme-handler/https" ]; + mimeTypes = ["x-scheme-handler/https"]; } ) ]; } - diff --git a/users/profiles/zsh/default.nix b/hmModules/shell/default.nix similarity index 86% rename from users/profiles/zsh/default.nix rename to hmModules/shell/default.nix index 5b04313..3c7682f 100644 --- a/users/profiles/zsh/default.nix +++ b/hmModules/shell/default.nix @@ -1,5 +1,28 @@ -{ pkgs, config, ... }: { + config, + lib, + pkgs, + ... +}: { + programs.bat.enable = true; + + programs.direnv = { + enable = true; + config = { + warn_timeout = "60s"; # default was 5s + }; + nix-direnv.enable = true; + }; + + programs.exa = { + enable = true; + enableAliases = true; + }; + + programs.fzf.enable = true; + + programs.vim.enable = true; + programs.zsh = { enable = true; enableAutosuggestions = true; @@ -55,7 +78,7 @@ NIX_BUILD_SHELL = "${pkgs.zsh-nix-shell}/scripts/buildShellShim.zsh"; PROMPT = "\\\${IN_NIX_SHELL:+[nix-shell] }$PROMPT"; }; - loginExtra = "[[ -z $DISPLAY && $TTY = /dev/tty1 ]] && exec sway"; + loginExtra = "[[ -z $DISPLAY && $TTY = /dev/tty1 ]] && exec startx"; initExtra = if pkgs.stdenv.hostPlatform.isDarwin then "if test -e /etc/static/bashrc; then source /etc/static/bashrc > /dev/null 2>&1; fi" diff --git a/hosts/bootstrap.nix b/hosts/bootstrap.nix deleted file mode 100644 index aa25488..0000000 --- a/hosts/bootstrap.nix +++ /dev/null @@ -1,18 +0,0 @@ -{ profiles, ... }: -{ - # build with: `bud build bootstrap bootstrapIso` - # reachable on the local link via ssh root@fe80::47%eno1 - # where 'eno1' is replaced by your own machine's network - # interface that has the local link to the target machine - imports = [ - # profiles.networking - profiles.core - profiles.users.root # make sure to configure ssh keys - profiles.users.ccr - ]; - - boot.loader.systemd-boot.enable = true; - - # will be overridden by the bootstrapIso instrumentation - fileSystems."/" = { device = "/dev/disk/by-label/nixos"; }; -} diff --git a/hosts/hs/configuration.nix b/hosts/hs/configuration.nix deleted file mode 100644 index f9e38fb..0000000 --- a/hosts/hs/configuration.nix +++ /dev/null @@ -1,334 +0,0 @@ -{ config, lib, pkgs, profiles, ... }: - -{ - imports = with profiles; [ sshd ]; - - boot = { - initrd.availableKernelModules = [ "ohci_pci" "ehci_pci" "ahci" "usb_storage" "usbhid" "sd_mod" ]; - loader.grub = pkgs.lib.mkForce { - enable = true; - version = 2; - device = "/dev/disk/by-id/ata-OCZ-VERTEX_TMHAK8OARSURAIF6N1A5"; - }; - }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-label/nixos"; - fsType = "btrfs"; - }; - "/mnt/archivio" = { - device = "/dev/disk/by-label/archivio"; - fsType = "ext4"; - }; - "/mnt/film" = { - device = "/dev/disk/by-label/film"; - fsType = "ext4"; - }; - }; - - swapDevices = - [{ device = "/dev/disk/by-label/swap"; }]; - - systemd.services.standby-sdb = { - description = "Set spindown time (sleep) for /dev/sdb "; - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - Type = "oneshot"; - ExecStart = "${pkgs.hdparm}/bin/hdparm -B 127 -S 241 /dev/sdb"; - }; - }; - - systemd.services.standby-sdc = { - description = "Set spindown time (sleep) for /dev/sdc "; - wantedBy = [ "multi-user.target" ]; - serviceConfig = { - Type = "oneshot"; - ExecStart = "${pkgs.hdparm}/bin/hdparm -B 127 -S 241 /dev/sdc"; - }; - }; - - systemd.services.amuled.serviceConfig.Restart = pkgs.lib.mkForce "always"; - users.users.amule = { - isNormalUser = false; - isSystemUser = true; - group = "amule"; - }; - users.groups."amule" = { }; - - services = { - - samba-wsdd = { - enable = true; - workgroup = "WORKGROUP"; - hostname = "nas"; - discovery = true; - }; - - samba = { - enable = true; - securityType = "user"; - extraConfig = '' - workgroup = WORKGROUP - server string = nas - netbios name = nas - security = user - map to guest = bad user - vfs objects = recycle - recycle:repository = .recycle - recycle:keeptree = yes - recycle:versions = yes - ''; - shares = { - archivio = { - path = "/mnt/archivio/archivio"; - comment = "archivio"; - "force user" = "ccr"; - browseable = "yes"; - writeable = "yes"; - "guest ok" = "yes"; - "read only" = "no"; - }; - film = { - path = "/mnt/film/film"; - comment = "film"; - "force user" = "ccr"; - browseable = "yes"; - writeable = "yes"; - "guest ok" = "yes"; - "read only" = "no"; - }; - transmission = { - path = "/mnt/archivio/transmission"; - comment = "transmission"; - "force user" = "transmission"; - browseable = "yes"; - writeable = "yes"; - "guest ok" = "yes"; - "read only" = "no"; - }; - amule = { - path = "/mnt/archivio/amule"; - comment = "amule"; - "force user" = "ccr"; - browseable = "yes"; - writeable = "yes"; - "guest ok" = "yes"; - "read only" = "no"; - }; - musica = { - path = "/mnt/film/musica"; - comment = "music"; - "force user" = "ccr"; - browseable = "yes"; - writeable = "no"; - "guest ok" = "yes"; - "read only" = "no"; - }; - }; - }; - - transmission = { - enable = true; - # the following json is merged to this attrset, it must have `rpc-username` and `rpc-password` - credentialsFile = "/mnt/archivio/transmission/credentials.json"; - settings = { - download-dir = "/mnt/archivio/transmission/"; - incomplete-dir = "/mnt/archivio/transmission/.incomplete"; - incomplete-dir-enabled = true; - - rpc-port = 9091; - rpc-whitelist-enabled = false; - rpc-host-whitelist-enabled = false; - rpc-authentication-required = true; - }; - }; - - amule = { - dataDir = "/mnt/archivio/amule"; - enable = true; - user = "amule"; - }; - - calibre-web = { - enable = true; - listen = { - ip = "0.0.0.0"; - port = 9092; - }; - options.calibreLibrary = "/mnt/archivio/calibre/"; - openFirewall = true; - }; - - syncthing = { - enable = true; - guiAddress = "0.0.0.0:8384"; - dataDir = "/mnt/archivio/syncthing"; - user = "ccr"; - overrideDevices = false; - overrideFolders = false; - folders = { - "/mnt/archivio/syncthing/camera" = { - id = "camera"; - }; - "/mnt/archivio/syncthing/orgzly" = { - id = "orgzly"; - }; - "/mnt/archivio/syncthing/roam" = { - id = "roam"; - }; - "/mnt/archivio/syncthing/whatsapp" = { - id = "whatsapp"; - }; - "/mnt/archivio/syncthing/calls" = { - id = "calls"; - }; - }; - }; - - navidrome = { - enable = false; - settings = { - Address = "0.0.0.0"; - Port = 9093; - MusicFolder = "/mnt/film/musica"; - DataFolder = "/mnt/film/musica/.navidrome"; - }; - }; - - nginx = { - enable = true; - recommendedGzipSettings = true; - recommendedOptimisation = true; - recommendedProxySettings = true; - recommendedTlsSettings = true; - clientMaxBodySize = "10G"; # max file size for uploads - commonHttpConfig = '' - log_format upstream_time '$remote_addr - $remote_user [$time_local] ' - '"$request" $status $body_bytes_sent ' - '"$http_referer" "$http_user_agent"' - 'rt=$request_time uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"'; - ''; - virtualHosts = { - "torrent.ccr.ydns.eu" = { - enableACME = true; - forceSSL = true; - locations."/" = { - proxyPass = "http://localhost:9091"; - - }; - }; - - "sync.ccr.ydns.eu" = { - enableACME = true; - addSSL = true; - locations."/" = { - proxyPass = "http://localhost:8384"; - }; - }; - - "books.ccr.ydns.eu" = { - enableACME = true; - addSSL = true; - locations."/" = { - proxyPass = "http://localhost:9092"; - }; - }; - - "music.ccr.ydns.eu" = { - enableACME = true; - addSSL = true; - locations."/" = { - proxyPass = "http://localhost:9093"; - }; - }; - - "gate.ccr.ydns.eu" = { - enableACME = true; - addSSL = true; - locations."/" = { - proxyPass = "http://192.168.1.71:80"; - }; - }; - - "cam.ccr.ydns.eu" = { - enableACME = true; - addSSL = true; - locations."/" = { - proxyPass = "http://192.168.1.80:80"; - }; - }; - }; - }; - }; - - - systemd.services.ydns = - let - ydnsUpdater = pkgs.writeScriptBin "ydnsUpdater" '' - #!${pkgs.stdenv.shell} - USER="andrea.ciceri@autistici.org" - PASSWORD=$(cat /home/ccr/.ydns-password) - DOMAIN="ccr.ydns.eu" - - for SUBDOMAIN in "books" "music" "sync" "torrent" "gate" "cam" - do - HOST="$SUBDOMAIN.$DOMAIN" - ${pkgs.curl}/bin/curl --basic -u "$USER:$PASSWORD" --silent https://ydns.io/api/v1/update/?host=$HOST - done - ${pkgs.curl}/bin/curl --basic -u "$USER:$PASSWORD" --silent https://ydns.io/api/v1/update/?host=$DOMAIN - ''; - in - { - description = "YDNS IP updater"; - wantedBy = [ "multi-user.target" ]; - after = [ "network.target" ]; - serviceConfig = { - User = "ccr"; - Type = "oneshot"; - ExecStart = "${ydnsUpdater}/bin/ydnsUpdater"; - }; - }; - - systemd.timers.ydnsUpdater = { - wantedBy = [ "timers.target" ]; - partOf = [ "ydnsUpdater.service" ]; - timerConfig = { - OnCalendar = "*-*-* *:00:00"; # hourly - Unit = "ydnsUpdater.service"; - }; - }; - - networking.firewall = { - enable = true; - allowPing = true; - allowedTCPPorts = [ - 80 # http - 139 # samba - 443 # https - 445 # samba - 4712 # amule - 4711 # amule web gui - 8384 # syncthing - ]; - allowedUDPPorts = [ - 137 # samba - 138 # samba - ]; - }; - - security.acme = { - acceptTerms = true; - email = "andrea.ciceri@autistici.org"; - }; - - nix = { - gc = { - automatic = true; - options = "--delete-older-than 3d"; - }; - }; - - powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; -} - diff --git a/hosts/hs/default.nix b/hosts/hs/default.nix deleted file mode 100644 index 0418194..0000000 --- a/hosts/hs/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ suites, ... }: -{ - imports = [ - ./configuration.nix - ] ++ suites.base; - -} diff --git a/hosts/pbp/configuration.nix b/hosts/pbp/configuration.nix deleted file mode 100644 index 789132d..0000000 --- a/hosts/pbp/configuration.nix +++ /dev/null @@ -1,79 +0,0 @@ -{ config, lib, pkgs, profiles, ... }: - -{ - imports = with profiles; [ mount-nas sshd dbus avahi printing xdg syncthing ]; - - boot = { - initrd.availableKernelModules = [ "usbhid" ]; - extraModulePackages = with config.boot.kernelPackages; [ - v4l2loopback - ]; - loader = { - grub.enable = false; - generic-extlinux-compatible.enable = true; - }; - }; - - hardware = { - opengl.enable = true; - pulseaudio = { - enable = true; - package = pkgs.pulseaudioFull; - }; - bluetooth = { - enable = true; - settings = { - General = { - MultiProfile = "multiple"; - ControllerMode = "dual"; - AutoConnect = true; - }; - Policy = { - AutoEnable = true; - }; - }; - }; - }; - - services.blueman.enable = true; - - networking = { - useDHCP = false; - interfaces.wlan0.useDHCP = true; - networkmanager.enable = true; - }; - - time.timeZone = "Europe/Rome"; - # location = { - # # not using geoclue since it's broken on aarch64 - # latitude = "45.4654219"; - # longitude = "45.4654219"; - # }; - - fileSystems = { - "/" = { - device = "/dev/disk/by-uuid/5aa67d2d-93fd-4e7c-b634-aa8d7b65bbb8"; - fsType = "btrfs"; - }; - "/boot" = { - device = "/dev/disk/by-uuid/C406-2AFC"; - fsType = "vfat"; - }; - }; - - swapDevices = - [{ device = "/dev/disk/by-uuid/e236d328-496e-4cf8-ba54-857789ca258f"; }]; - - nix = { - gc = { - automatic = true; - options = "--delete-older-than 3d"; - }; - }; - - powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand"; - - services.logind.extraConfig = '' - HandlePowerKey=ignore - ''; -} diff --git a/hosts/pbp/default.nix b/hosts/pbp/default.nix deleted file mode 100644 index c1374f3..0000000 --- a/hosts/pbp/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ suites, ... }: -{ - imports = [ - ./configuration.nix - ] ++ suites.base; -} diff --git a/hosts/pc/configuration.nix b/hosts/pc/configuration.nix deleted file mode 100644 index b0f448f..0000000 --- a/hosts/pc/configuration.nix +++ /dev/null @@ -1,89 +0,0 @@ -{ config, lib, pkgs, profiles, ... }: - -{ - imports = with profiles; [ mount-nas sshd dbus avahi printing xdg docker adb syncthing qmk-udev ]; - - system.stateVersion = "22.05"; - - boot = { - initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" ]; - initrd.kernelModules = [ ]; - kernelModules = [ "kvm-intel" "snd-aloop" "v4l2loopback" ]; - extraModulePackages = with config.boot.kernelPackages; [ - v4l2loopback - pkgs.v4l2loopback-dc - ]; - - extraModprobeConfig = '' - options v42loopback exclusive_caps=1 max_buffers=2 - ''; - - binfmt.emulatedSystems = [ "aarch64-linux" ]; - - loader.grub = pkgs.lib.mkForce { - enable = true; - version = 2; - device = "/dev/sda"; - }; - }; - - sound.enable = true; - - hardware = { - opengl.enable = true; - pulseaudio = { - enable = true; - package = pkgs.pulseaudioFull; - }; - }; - - fileSystems."/" = - { - device = "/dev/disk/by-label/nixos"; - fsType = "ext4"; - }; - - fileSystems."/home" = - { - device = "/dev/disk/by-label/home"; - fsType = "ext4"; - }; - - swapDevices = - [{ device = "/dev/disk/by-label/swap"; }]; - - nix = { - gc = { - automatic = lib.mkForce false; # Temporarily disabled, TODO: re-enable - options = "--delete-older-than 3d"; - }; - # package = pkgs.nixFromMaster; - package = pkgs.nix; - extraOptions = lib.mkForce '' - experimental-features = ca-derivations nix-command flakes - - keep-outputs = true - keep-derivations = true - ''; - }; - - systemd.services.nix-daemon.serviceConfig = { - LimitNOFILE = lib.mkForce "Infinity"; # 131072; # should help with fds errors due to experimental feature `ca-derivations` - }; - - networking.firewall = { - enable = true; - allowPing = true; - }; - - - services.hydra = { - enable = true; - hydraURL = "http://localhost:3000"; # externally visible URL - notificationSender = "hydra@localhost"; # e-mail of hydra service - # a standalone hydra will require you to unset the buildMachinesFiles list to avoid using a nonexistant /etc/nix/machines - buildMachinesFiles = [ ]; - # you will probably also want, otherwise *everything* will be built from scratch - useSubstitutes = true; - }; -} diff --git a/hosts/pc/default.nix b/hosts/pc/default.nix deleted file mode 100644 index 0418194..0000000 --- a/hosts/pc/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ suites, ... }: -{ - imports = [ - ./configuration.nix - ] ++ suites.base; - -} diff --git a/hosts/thinkpad/default.nix b/hosts/thinkpad/default.nix new file mode 100644 index 0000000..1d0f5d8 --- /dev/null +++ b/hosts/thinkpad/default.nix @@ -0,0 +1,151 @@ +{ + config, + lib, + pkgs, + fleetModules, + ... +}: { + imports = fleetModules [ + "common" + "audio" + "ccr" + "exwm" + ]; + + hardware.cpu.intel.updateMicrocode = true; + hardware.enableRedistributableFirmware = true; + + boot.initrd.availableKernelModules = ["xhci_pci" "nvme" "usb_storage" "sd_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = ["kvm-intel"]; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "rpool/system/root"; + fsType = "zfs"; + }; + + fileSystems."/nix" = { + device = "rpool/system/nix"; + fsType = "zfs"; + }; + + fileSystems."/home" = { + device = "rpool/user/home"; + fsType = "zfs"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + }; + + swapDevices = [ + {device = "/dev/disk/by-uuid/3cab8a5d-602c-4e3d-b436-c0e5595aeb94";} + ]; + + networking.hostId = "8ef630a9"; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + #networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true; + #networking.interfaces.wlp0s20f3.useDHCP = lib.mkDefault true; + + powerManagement.cpuFreqGovernor = lib.mkDefault "powersave"; + + boot.loader.grub = { + enable = true; + copyKernels = true; + efiSupport = true; + devices = ["nodev"]; + efiInstallAsRemovable = true; + }; + + networking.hostName = "thinkpad"; # Define your hostname. + # Pick only one of the below networking options. + #networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + console = { + font = "Lat2-Terminus16"; + # keyMap = "us"; + useXkbConfig = true; # use xkbOptions in tty. + }; + + # Enable the X11 windowing system. + # services.xserver.enable = true; + + # Configure keymap in X11 + # services.xserver.layout = "us"; + # services.xserver.xkbOptions = { + # "eurosign:e"; + # "caps:escape" # map caps to escape. + # }; + + # Enable CUPS to print documents. + # services.printing.enable = true; + + # Enable sound. + # sound.enable = true; + # hardware.pulseaudio.enable = true; + + # Enable touchpad support (enabled default in most desktopManager). + # services.xserver.libinput.enable = true; + + #Define a user account. Don't forget to set a password with ‘passwd’. + #users.users.jane = { + # isNormalUser = true; + # extraGroups = [ "wheel" ]; # Enable ‘sudo’ for the user. + # packages = with pkgs; [ + # firefox + # thunderbird + # ]; + # }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + networkmanager + wget + ]; + + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + + # List services that you want to enable: + + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + + # Copy the NixOS configuration file and link it from the resulting system + # (/run/current-system/configuration.nix). This is useful in case you + # accidentally delete configuration.nix. + # system.copySystemConfiguration = true; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "22.05"; # Did you read the comment? +} diff --git a/lib/compat/default.nix b/lib/compat/default.nix deleted file mode 100644 index 9d0c283..0000000 --- a/lib/compat/default.nix +++ /dev/null @@ -1,14 +0,0 @@ -let - rev = "e7e5d481a0e15dcd459396e55327749989e04ce0"; - flake = (import - ( - fetchTarball { - url = "https://github.com/edolstra/flake-compat/archive/${rev}.tar.gz"; - sha256 = "0zd3x46fswh5n6faq4x2kkpy6p3c6j593xbdlbsl40ppkclwc80x"; - } - ) - { - src = ../../.; - }); -in -flake diff --git a/lib/compat/nixos/default.nix b/lib/compat/nixos/default.nix deleted file mode 100644 index e4e0e68..0000000 --- a/lib/compat/nixos/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ ... }: -let - inherit (default.inputs.nixos) lib; - - host = configs.${hostname} or configs.NixOS; - configs = default.nixosConfigurations; - default = (import ../.).defaultNix; - hostname = lib.fileContents /etc/hostname; -in -host diff --git a/lib/default.nix b/lib/default.nix deleted file mode 100644 index 2356e1f..0000000 --- a/lib/default.nix +++ /dev/null @@ -1,2 +0,0 @@ -{ lib }: -lib.makeExtensible (self: { }) diff --git a/modules/audio/default.nix b/modules/audio/default.nix new file mode 100644 index 0000000..d8933a8 --- /dev/null +++ b/modules/audio/default.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: { + sound.enable = true; + + hardware.pulseaudio = { + enable = true; + package = pkgs.pulseaudioFull; + }; +} diff --git a/users/ccr/default.nix b/modules/ccr/default.nix similarity index 61% rename from users/ccr/default.nix rename to modules/ccr/default.nix index 3969ae9..d150bc8 100644 --- a/users/ccr/default.nix +++ b/modules/ccr/default.nix @@ -1,43 +1,10 @@ -{ pkgs, suites, lib, config, ... }: { - home-manager.users.ccr = { suites, ... }: { - imports = with suites; shell ++ base ++ (if config.networking.hostName != "hs" then - ( - gui ++ browser ++ multimedia ++ emails ++ dev ++ modelling - ) else [ ]); - - home.packages = with pkgs; [ - ack - ranger - umoria - droidcam - ] ++ (if config.networking.hostName != "hs" then [ - imv - calibre - # scrcpy # TODO: create a profile only for x86_64 (not available for aarch64) - element-desktop - gtk-engine-murrine - gtk_engines - gsettings-desktop-schemas - lxappearance - yarn - yarn2nix - python39Packages.poetry - texlive.combined.scheme-full - gphoto2 - rawtherapee - translate-shell - ] ++ - (if !stdenv.hostPlatform.isAarch64 then [ - slack - wineWowPackages.full - vial - deploy-rs.deploy-rs # to slow to cross compile for aarch64 - digikam - ] else [ ]) - else [ ]); - }; - + config, + lib, + pkgs, + fleetHmModules, + ... +}: { users.users.ccr = { uid = 1000; hashedPassword = "$6$JGOefuRk7kL$fK9.5DFnLLoW08GL4eKRyf958jyZdw//hLMaz4pp28jJuSFb24H6R3dgt1.sMs0huPY85rludSw4dnQJG5xSw1"; # mkpasswd -m sha-512 @@ -60,4 +27,22 @@ "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDynKeHTnXOTCi+MH2agM4k5uBkTL+W5xkL/ep3DKuTIb9MbKjHkRIquSdVRAit4ZQVQN+S3yoCXCRdLLurM3/a6C7vc/a3UfGPyV/oDYDCdHNsOwimqIQg8Pc0WtnevLpZTC2VR4UU8zzaD/mmEWqxNszaNNUve+Fy0lwg6jn6vTnQCupbyMnghherozPJu94H/JLuDEcPT0wZUmBjhjT+yHp65Yk8hKVb1jRqEdjAHM4yZf6ceIxI9NMGeSnAKf/b8IsO6y7A93NZ75CnD6AW9Rclemi+nOqZo9zQ2m2LRtMTHSoNOLLkNQCCD+l2G4w1wPMONw4mz1vR917iJdd+5BXDtEVwScDfOmqVewynxkfztSvB+qTDzdqde3NO8fFA8jMk3rUXXfIl/Yb0G87wVT/Jcl7+ZBch8s+ljPsmyy5RY+uXLgKgE1tne0KJuzeJtxSAzTrPUhILB/A8PuJUzVGVWAdGRcusOc/0SdsluFsa11E0D946JcgNo72bWm0=" ]; }; + + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.users.ccr = { + imports = fleetHmModules [ + "shell" + "emacs" + "mpv" + "firefox" + "qutebrowser" + "git" + "gpg" + "password-store" + ]; + home.packages = with pkgs; [ + ]; + home.stateVersion = config.system.stateVersion; + }; } diff --git a/modules/common/default.nix b/modules/common/default.nix new file mode 100644 index 0000000..5547749 --- /dev/null +++ b/modules/common/default.nix @@ -0,0 +1,16 @@ +{ + lib, + fleetModules, + ... +}: { + imports = fleetModules [ + "nix" + ]; + + system.stateVersion = lib.mkForce "22.11"; + time.timeZone = lib.mkDefault "Europe/Rome"; + networking.useDHCP = lib.mkDefault true; + users.mutableUsers = false; + users.users.root.password = "password"; + i18n.defaultLocale = "en_US.UTF-8"; +} diff --git a/modules/exwm/default.nix b/modules/exwm/default.nix new file mode 100644 index 0000000..1ba2e73 --- /dev/null +++ b/modules/exwm/default.nix @@ -0,0 +1,36 @@ +{pkgs, ...}: { + services.xserver = { + enable = true; + autorun = false; + libinput.enable = true; + displayManager.startx.enable = true; + }; + + hardware.opengl.enable = true; + + home-manager.users.ccr.home.file.".xinitrc".text = '' + # Disable access control for the current user. + xhost +SI:localuser:$USER + + # Make Java applications aware this is a non-reparenting window manager. + export _JAVA_AWT_WM_NONREPARENTING=1 + + # Set default cursor. + xsetroot -cursor_name left_ptr + + # Set keyboard repeat rate. + xset r rate 200 60 + + # Uncomment the following block to use the exwm-xim module. + #export XMODIFIERS=@im=exwm-xim + #export GTK_IM_MODULE=xim + #export QT_IM_MODULE=xim + #export CLUTTER_IM_MODULE=xim + + # Lockscreen + exec ${pkgs.xss-lock}/bin/xss-lock -- ${pkgs.i3lock-blur}/bin/i3lock-blur & + + # Finally start Emacs + exec emacsclient --eval "(exwm-init)" --create-frame -F "((fullscreen . fullboth))" + ''; +} diff --git a/modules/hm-system-defaults.nix b/modules/hm-system-defaults.nix deleted file mode 100644 index 66c034e..0000000 --- a/modules/hm-system-defaults.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ config, ... }: { - home-manager.sharedModules = [ - { - home.sessionVariables = { - inherit (config.environment.sessionVariables) NIX_PATH; - }; - } - ]; -} diff --git a/modules/nix-path.nix b/modules/nix-path.nix deleted file mode 100644 index 273f67a..0000000 --- a/modules/nix-path.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ channel, inputs, ... }: { - nix.nixPath = [ - "nixpkgs=${channel.input}" - "nixos-config=${../lib/compat/nixos}" - "home-manager=${inputs.home}" - ]; -} diff --git a/modules/nix/default.nix b/modules/nix/default.nix new file mode 100644 index 0000000..064ec21 --- /dev/null +++ b/modules/nix/default.nix @@ -0,0 +1,24 @@ +{ + config, + lib, + pkgs, + ... +}: { + nix = { + settings = { + auto-optimise-store = true; + }; + + extraOptions = '' + experimental-features = nix-command flakes ca-derivations + ''; + + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + optimise.automatic = true; + }; +} diff --git a/overlays/various-flake-fixes.nix b/overlays/various-flake-fixes.nix deleted file mode 100644 index 7dbfc18..0000000 --- a/overlays/various-flake-fixes.nix +++ /dev/null @@ -1,11 +0,0 @@ -final: prev: { - # Since: https://github.com/NixOS/nixpkgs/pull/126137 - nix-direnv = - if builtins.hasAttr "enableFlakes" prev.nix-direnv.override.__functionArgs - then - prev.nix-direnv.override - { - enableFlakes = true; - } - else prev.nix-direnv; -} diff --git a/pkgs/amule/default.nix b/pkgs/amule/default.nix deleted file mode 100644 index 1d32434..0000000 --- a/pkgs/amule/default.nix +++ /dev/null @@ -1,99 +0,0 @@ -{ fetchFromGitHub -, stdenv -, lib -, zlib -, wxGTK -, perl -, cryptopp -, libupnp -, gettext -, libpng -, autoreconfHook -, pkg-config -, makeWrapper -, libX11 -, ... -}: -let - monolithic = true; # build monolithic amule - enableDaemon = true; # build amule daemon - httpServer = false; # build web interface for the daemon - client = false; # build amule remote gui - - oldAmule = stdenv.mkDerivation rec { - pname = "amule"; - version = "unstable-20201006"; - - src = fetchFromGitHub { - owner = "amule-project"; - repo = "amule"; - rev = "6f8951527eda670c7266984ce476061bfe8867fc"; - sha256 = "12b44b6hz3mb7nsn6xhzvm726xs06xcim013i1appif4dr8njbx1"; - }; - - postPatch = '' - substituteInPlace src/libs/ec/file_generator.pl \ - --replace /usr/bin/perl ${perl}/bin/perl - # autotools expects these to be in the root - cp docs/{AUTHORS,README} . - cp docs/Changelog ./ChangeLog - cp docs/Changelog ./NEWS - ''; - - preAutoreconf = '' - pushd src/pixmaps/flags_xpm >/dev/null - ./makeflags.sh - popd >/dev/null - ''; - - nativeBuildInputs = [ autoreconfHook gettext makeWrapper pkg-config ]; - - buildInputs = [ - zlib - wxGTK - perl - cryptopp.dev - libupnp - ] ++ lib.optional httpServer libpng - ++ lib.optional client libX11; - - enableParallelBuilding = true; - - configureFlags = [ - "--with-crypto-prefix=${cryptopp.dev}" - "--disable-debug" - "--enable-optimize" - (lib.enableFeature monolithic "monolithic") - (lib.enableFeature enableDaemon "amule-daemon") - (lib.enableFeature client "amule-gui") - (lib.enableFeature httpServer "webserver") - ]; - - # aMule will try to `dlopen' libupnp and libixml, so help it - # find them. - postInstall = lib.optionalString monolithic '' - wrapProgram $out/bin/amule \ - --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libupnp ]} - ''; - - meta = with lib; { - description = "Peer-to-peer client for the eD2K and Kademlia networks"; - longDescription = '' - aMule is an eMule-like client for the eD2k and Kademlia - networks, supporting multiple platforms. Currently aMule - (officially) supports a wide variety of platforms and operating - systems, being compatible with more than 60 different - hardware+OS configurations. aMule is entirely free, its - sourcecode released under the GPL just like eMule, and includes - no adware or spyware as is often found in proprietary P2P - applications. - ''; - - homepage = "https://github.com/amule-project/amule"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ phreedom ]; - platforms = platforms.unix; - }; - }; -in -oldAmule diff --git a/pkgs/cura/default.nix b/pkgs/cura/default.nix deleted file mode 100644 index c7dacf8..0000000 --- a/pkgs/cura/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs }: - -pkgs.cura.overrideAttrs (old: { - buildInputs = old.buildInputs ++ [ pkgs.jq ]; - postInstall = old.postInstall or "" + '' - definitions="$out/share/cura/resources/definitions" - ce3="$definitions/creality_ender3.def.json" - cat <<< "$(jq '.overrides.machine_disallowed_areas.default_value = []' $ce3)" > $ce3 - ''; -}) diff --git a/pkgs/default.nix b/pkgs/default.nix deleted file mode 100644 index 14f74a3..0000000 --- a/pkgs/default.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ nixpkgsStableInput, nixpkgsDevInput }: -final: prev: -let - config.allowUnfree = true; - overlays = [ ]; - nixpkgsStable = (import nixpkgsStableInput { - inherit config overlays; - system = prev.system; - }).pkgs; - nixpkgsDev = (import nixpkgsDevInput { - inherit config overlays; - system = prev.system; - }).pkgs; -in -{ - # keep sources this first - # sources = prev.callPackage (import ./_sources/generated.nix) { }; - amule = prev.callPackage (import ./amule) { }; - customEmacs = prev.callPackage (import ./emacs) { pkgs = prev; }; - cura = prev.callPackage (import ./cura) { pkgs = prev; }; - droidcam = prev.callPackage (import ./droidcam) { }; - google-chrome = import ./google-chrome { pkgs = prev; }; - nixFromMaster = import ./nix-from-master { nix = prev.nix; pkgs = prev; }; - qutebrowser = import ./qutebrowser { pkgs = prev; }; - slack = import ./slack { pkgs = prev; }; - umoria = nixpkgsDev.umoria; - v4l2loopback-dc = prev.callPackage (import ./v4l2loopback-dc) { kernel = prev.linux; }; - # then, call packages with `final.callPackage` -} diff --git a/pkgs/droidcam/default.nix b/pkgs/droidcam/default.nix deleted file mode 100644 index 6b6bce0..0000000 --- a/pkgs/droidcam/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ stdenv, fetchzip, pkgconfig, ffmpeg, gtk3-x11, libjpeg, libusbmuxd, alsaLib, speex }: - -stdenv.mkDerivation rec { - pname = "droidcam"; - version = "0"; - - src = fetchzip { - url = "https://github.com/dev47apps/droidcam/archive/refs/tags/v1.7.2.zip"; - sha256 = "1iskvs5p71gkiinj78kkl9ygl5il9rdbzm0h85hwyzm2xwkcybrp"; - }; - - sourceRoot = "source"; - - buildInputs = [ pkgconfig ]; - nativeBuildInputs = [ ffmpeg gtk3-x11 libusbmuxd alsaLib libjpeg speex ]; - - postPatch = '' - cat Makefile - ls ${libusbmuxd.out}/lib - sed -i -e 's:-lusbmuxd:-I ${libusbmuxd.out} ${libusbmuxd.out}/lib/libusbmuxd-2.0.so:' Makefile - sed -i -e 's:/opt/libjpeg-turbo:${libjpeg.out}:' Makefile - sed -i -e 's:$(JPEG_DIR)/lib`getconf LONG_BIT`:${libjpeg.out}/lib:' Makefile - sed -i -e 's:libturbojpeg.a:libturbojpeg.so:' Makefile - cat Makefile - ''; - - installPhase = '' - mkdir -p $out/bin - cp droidcam droidcam-cli $out/bin/ - ''; - - meta = with stdenv.lib; { - description = "DroidCam Linux client"; - homepage = https://github.com/aramg/droidcam; - }; -} diff --git a/pkgs/emacs/default.nix b/pkgs/emacs/default.nix deleted file mode 100644 index b82f8cd..0000000 --- a/pkgs/emacs/default.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ pkgs, ... }: -let - # TODO: when `emcasPgtkNativeComp` will build on aarch64 re-use it - myEmacs = with pkgs; if stdenv.hostPlatform.isAarch64 then emacs else emacsPgtkNativeComp; - emacsWithPackages = (pkgs.emacsPackagesFor myEmacs).emacsWithPackages; -in -emacsWithPackages ( - epkgs: ( - with epkgs.melpaStablePackages; [ ] - ) ++ ( - with epkgs.melpaPackages; [ - # ts-fold - aggressive-indent - all-the-icons - company - company-nixos-options - dap-mode - diff-hl - diredfl - dirvish - doom-modeline - envrc - evil - evil-collection - evil-tree-edit - fira-code-mode - git-auto-commit-mode - go-translate - good-scroll - haskell-mode - helm - helm-ag - helm-company - helm-nixos-options - helm-projectile - highlight-indent-guides - hl-todo - lispy - lsp-haskell - lsp-mode - lsp-python-ms - lsp-ui - magit - magit-delta - nix-mode - nix-modeline - nixos-options - notmuch - org-download - org-fragtog - org-roam - org-roam-ui - org-superstar - origami - pkgs.emacs28Packages.tree-sitter-langs - pkgs.emacs28Packages.tsc - projectile - psc-ide - psci - purescript-mode - rainbow-delimiters - rainbow-identifiers - scad-mode - sudo-utils - symex - tree-edit - tree-sitter - treemacs - treemacs-evil - treemacs-icons-dired - treemacs-magit - treemacs-persp - treemacs-projectile - use-package - visual-fill-column - which-key - writegood-mode - ] - ) ++ ( - with epkgs.elpaPackages; [ - modus-themes - minimap - ] - ) ++ ( - with pkgs; [ ] - ) -) diff --git a/pkgs/google-chrome/default.nix b/pkgs/google-chrome/default.nix deleted file mode 100644 index 424deea..0000000 --- a/pkgs/google-chrome/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs }: - -pkgs.google-chrome.override { - commandLineArgs = [ - "--enable-features=UseOzonePlatform" - "--ozone-platform=wayland" - ]; -} diff --git a/pkgs/nix-from-master/default.nix b/pkgs/nix-from-master/default.nix deleted file mode 100644 index 9238be3..0000000 --- a/pkgs/nix-from-master/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ nix, pkgs }: -nix.overrideAttrs (old: { - src = pkgs.fetchFromGitHub { - owner = "NixOS"; - repo = "nix"; - rev = "3ec979fa902c49e975a9af7dc2792fb197030e04"; - hash = "sha256-mpFR1OrjayyVe8LpxJVaTLVIPPeTSIu7SDz/wXP78Vg="; - }; -}) diff --git a/pkgs/qutebrowser/default.nix b/pkgs/qutebrowser/default.nix deleted file mode 100644 index 2b3c6ad..0000000 --- a/pkgs/qutebrowser/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs }: - -pkgs.qutebrowser.overrideAttrs (old: { - buildInputs = old.buildInputs ++ [ pkgs.makeWrapper ]; - postInstall = old.postInstall or "" + '' - wrapProgram "$out/bin/qutebrowser" --set QT_QPA_PLATFORM wayland --set QT_WAYLAND_DISABLE_WINDOWDECORATION 1 - ''; -}) - diff --git a/pkgs/slack/default.nix b/pkgs/slack/default.nix deleted file mode 100644 index 5b99c44..0000000 --- a/pkgs/slack/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs }: - -pkgs.slack.overrideAttrs (old: { - buildInputs = old.buildInputs ++ [ pkgs.makeWrapper ]; - postInstall = old.postInstall or "" + '' - rm $out/bin/slack - makeWrapper $out/lib/slack/slack $out/bin/slack \ - --prefix XDG_DATA_DIRS : $GSETTINGS_SCHEMAS_PATH \ - --prefix PATH : ${pkgs.lib.makeBinPath [pkgs.xdg-utils]} \ - --add-flags "--ozone-platform=wayland --enable-features=UseOzonePlatform,WebRTCPipeWireCapturer" - ''; -}) diff --git a/pkgs/v4l2loopback-dc/default.nix b/pkgs/v4l2loopback-dc/default.nix deleted file mode 100644 index 0329c54..0000000 --- a/pkgs/v4l2loopback-dc/default.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ stdenv, fetchzip, kernel }: - -# if "Built-in-audio" (virtual device) is not shown in pavucontrol try the following -# pacmd load-module module-alsa-source device=hw:Loopback,1,0 - -stdenv.mkDerivation rec { - pname = "v4l2loopback-dc"; - version = "0"; - - src = fetchzip { - url = "https://github.com/dev47apps/droidcam/archive/refs/tags/v1.7.2.zip"; - sha256 = "1iskvs5p71gkiinj78kkl9ygl5il9rdbzm0h85hwyzm2xwkcybrp"; - }; - - sourceRoot = "source/v4l2loopback"; - - KVER = "${kernel.modDirVersion}"; - KBUILD_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"; - - nativeBuildInputs = kernel.moduleBuildDependencies; - - postPatch = '' - sed -i -e 's:/lib/modules/$(KERNELRELEASE)/build:${KBUILD_DIR}:g' Makefile - ''; - - installPhase = '' - mkdir -p $out/lib/modules/${KVER}/kernels/media/video - cp v4l2loopback-dc.ko $out/lib/modules/${KVER}/kernels/media/video/ - ''; - - meta = with stdenv.lib; { - description = "DroidCam kernel module v4l2loopback-dc"; - homepage = https://github.com/aramg/droidcam; - }; -} diff --git a/profiles/adb/default.nix b/profiles/adb/default.nix deleted file mode 100644 index eb52fbb..0000000 --- a/profiles/adb/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: -{ - programs.adb.enable = !pkgs.stdenv.hostPlatform.isAarch64; - - services.udev.packages = [ - pkgs.android-udev-rules - ]; -} diff --git a/profiles/avahi/default.nix b/profiles/avahi/default.nix deleted file mode 100644 index 4ad4613..0000000 --- a/profiles/avahi/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - services.avahi = { - enable = true; - nssmdns = true; - }; -} diff --git a/profiles/cachix/aciceri-fleet.nix b/profiles/cachix/aciceri-fleet.nix deleted file mode 100644 index bc00051..0000000 --- a/profiles/cachix/aciceri-fleet.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - nix = { - binaryCaches = [ - "https://aciceri-fleet.cachix.org" - ]; - binaryCachePublicKeys = [ - "aciceri-fleet.cachix.org-1:WiHJIK4UFTdfvWx0lG3mCR4EddyYsRhIuMGSje3/YGI=" - ]; - }; -} diff --git a/profiles/cachix/arm.nix b/profiles/cachix/arm.nix deleted file mode 100644 index 5f2f128..0000000 --- a/profiles/cachix/arm.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - nix = { - binaryCaches = [ - "https://arm.cachix.org" - ]; - binaryCachePublicKeys = [ - "arm.cachix.org-1:K3XjAeWPgWkFtSS9ge5LJSLw3xgnNqyOaG7MDecmTQ8=" - ]; - }; -} diff --git a/profiles/cachix/ca-derivations.nix b/profiles/cachix/ca-derivations.nix deleted file mode 100644 index a0dd9eb..0000000 --- a/profiles/cachix/ca-derivations.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - nix = { - binaryCaches = [ - "https://cache.ngi0.nixos.org/" - ]; - binaryCachePublicKeys = [ - "cache.ngi0.nixos.org-1:KqH5CBLNSyX184S9BKZJo1LxrxJ9ltnY2uAs5c/f1MA=" - ]; - }; -} diff --git a/profiles/cachix/default.nix b/profiles/cachix/default.nix deleted file mode 100644 index d88a3f7..0000000 --- a/profiles/cachix/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ pkgs, lib, ... }: -let - folder = ./.; - toImport = name: value: folder + ("/" + name); - filterCaches = key: value: value == "regular" && lib.hasSuffix ".nix" key && key != "default.nix"; - imports = lib.mapAttrsToList toImport (lib.filterAttrs filterCaches (builtins.readDir folder)); -in -{ - inherit imports; - nix.binaryCaches = [ "https://cache.nixos.org/" ]; -} diff --git a/profiles/cachix/haskell.nix b/profiles/cachix/haskell.nix deleted file mode 100644 index 99b570a..0000000 --- a/profiles/cachix/haskell.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - nix = { - binaryCaches = [ - "https://hydra.iohk.io" - ]; - binaryCachePublicKeys = [ - "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" - ]; - }; -} diff --git a/profiles/cachix/nix-community.nix b/profiles/cachix/nix-community.nix deleted file mode 100644 index 7e4be28..0000000 --- a/profiles/cachix/nix-community.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - nix = { - binaryCaches = [ - "https://nix-community.cachix.org" - ]; - binaryCachePublicKeys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - }; -} diff --git a/profiles/cachix/nixpkgs-wayland.nix b/profiles/cachix/nixpkgs-wayland.nix deleted file mode 100644 index aa84dce..0000000 --- a/profiles/cachix/nixpkgs-wayland.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - nix = { - binaryCaches = [ - "https://nixpkgs-wayland.cachix.org" - ]; - binaryCachePublicKeys = [ - "nixpkgs-wayland.cachix.org-1:3lwxaILxMRkVhehr5StQprHdEo4IrE8sRho9R9HOLYA=" - ]; - }; -} diff --git a/profiles/cachix/nrdxp.nix b/profiles/cachix/nrdxp.nix deleted file mode 100644 index bb3b4a5..0000000 --- a/profiles/cachix/nrdxp.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ - nix = { - binaryCaches = [ - "https://nrdxp.cachix.org" - ]; - binaryCachePublicKeys = [ - "nrdxp.cachix.org-1:Fc5PSqY2Jm1TrWfm88l6cvGWwz3s93c6IOifQWnhNW4=" - ]; - }; -} diff --git a/profiles/chromecast/default.nix b/profiles/chromecast/default.nix deleted file mode 100644 index 696ff4b..0000000 --- a/profiles/chromecast/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - config = { - networking.firewall.extraCommands = '' - iptables -I INPUT -p udp -m udp --dport 32768:60999 -j ACCEPT - ''; - }; -} diff --git a/profiles/core/default.nix b/profiles/core/default.nix deleted file mode 100644 index 3c07443..0000000 --- a/profiles/core/default.nix +++ /dev/null @@ -1,66 +0,0 @@ -{ self, config, lib, pkgs, ... }: -let - inherit (lib) fileContents; -in -{ - imports = [ ../cachix ]; - - environment = { - - systemPackages = with pkgs; [ - #skim - bat - bat-extras.batman - binutils - bottom - coreutils - curl - dnsutils - dosfstools - fd - git - glances - gptfdisk - htop - iputils - jq - lsof - manix - moreutils - nix-index - nmap - ripgrep - tealdeer - usbutils - utillinux - whois - ]; - }; - - fonts = { - fonts = with pkgs; [ powerline-fonts dejavu_fonts fira-code fira-code-symbols emacs-all-the-icons-fonts ]; - fontconfig.defaultFonts = { - monospace = [ "DejaVu Sans Mono for Powerline" ]; - sansSerif = [ "DejaVu Sans" ]; - }; - }; - - time.timeZone = "Europe/Rome"; - location.provider = "geoclue2"; - - - users.users.root.openssh.authorizedKeys.keys = [ - "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDJmn7H6wxrxCHypvY74Z6pBr5G6v564NaUZb9xIILV92JEdpZzuTLLlP+JkMx/8MLRy+pC7prMwR+FhH+LaTm/9x3T6FYP/q9UIAL3cFwBAwj5XQXQKzx9f6pX/7iJrMfAUQ+ZrRUNJHt5Gl+8UypmDgnQLuv5vmQSMRzKnUPuu4lCJtWOpSPhXffz3Ec1tm5nAMuxIMRPY91PYu1fMLlFrjB1FX1goVHKB1uWx16GjJszYCVbN6xcPac0sgUg+qNGBhWkUh0F073rhepQJeWp5FtwIxe2zRsZBxxTy5qxNLmHzBeNDxlOkcy2/Lr+BxVy+mhF/2fJziX80/bWSEA1" - ]; - - nix = { - gc.automatic = true; - optimise.automatic = true; - autoOptimiseStore = true; - useSandbox = true; - allowedUsers = [ "@wheel" ]; - trustedUsers = [ "root" "@wheel" "hydra" "hydra-www" ]; - }; - - services.earlyoom.enable = true; -} diff --git a/profiles/core/starship.toml b/profiles/core/starship.toml deleted file mode 100644 index 6ed366b..0000000 --- a/profiles/core/starship.toml +++ /dev/null @@ -1,95 +0,0 @@ -[aws] -symbol = " " - -[character] -success_symbol = "[❯](bold purple)" -vicmd_symbol = "[❮](bold purple)" - -[battery] -full_symbol = "" -charging_symbol = "" -discharging_symbol = "" - -[conda] -symbol = " " - -[directory] -style = "cyan" -read_only = " 🔒" - -[docker] -symbol = " " - -[elixir] -symbol = " " - -[elm] -symbol = " " - -[git_branch] -format = "[$symbol$branch]($style) " -symbol = " " -style = "bold dimmed white" - -[git_status] -format = '([「$all_status$ahead_behind」]($style) )' -conflicted = "⚠️" -ahead = "⟫${count} " -behind = "⟪${count}" -diverged = "🔀 " -untracked = "📁 " -stashed = "↪ " -modified = "𝚫 " -staged = "✔ " -renamed = "⇆ " -deleted = "✘ " -style = "bold bright-white" - -[golang] -symbol = " " - -[haskell] -symbol = " " - -[hg_branch] -symbol = " " - -[java] -symbol = " " - -[julia] -symbol = " " - -[memory_usage] -symbol = " " -disabled = false - -[nim] -symbol = " " - -[nix_shell] -format = '[$symbol$state]($style) ' -symbol = " " -pure_msg = "λ" -impure_msg = "⎔" - -[nodejs] -symbol = " " - -[package] -symbol = " " - -[php] -symbol = " " - -[python] -symbol = " " - -[ruby] -symbol = " " - -[rust] -symbol = " " - -[status] -disabled = false diff --git a/profiles/dbus/default.nix b/profiles/dbus/default.nix deleted file mode 100644 index f1d7d01..0000000 --- a/profiles/dbus/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ pkgs, ... }: -{ - services.dbus.packages = with pkgs; [ dconf ]; - programs.dconf.enable = true; -} diff --git a/profiles/docker/default.nix b/profiles/docker/default.nix deleted file mode 100644 index a878015..0000000 --- a/profiles/docker/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - virtualisation.docker.enable = true; -} diff --git a/profiles/mount-nas/default.nix b/profiles/mount-nas/default.nix deleted file mode 100644 index 90f5924..0000000 --- a/profiles/mount-nas/default.nix +++ /dev/null @@ -1,61 +0,0 @@ -# FIXME: why this doesn't work anymore? - -{ pkgs, ... }: -{ - environment.systemPackages = [ pkgs.sshfs ]; - - fileSystems = - let - nasUser = "ccr"; - nasHost = "ccr.ydns.eu"; - fsType = "fuse.sshfs"; - target = "/home/ccr/nas"; - options = [ - "delay_connect" - "_netdev,user" - "idmap=user" - "transform_symlinks" - # ssh-add -L > ~/.ssh/id_rsa - "identityfile=/home/ccr/.ssh/id_rsa" - "allow_other" - "default_permissions" - "uid=1000" - "gid=100" - "nofail" - ]; - in - { - # "${target}/amule" = { - # inherit fsType options; - # device = "${nasUser}@${nasHost}:/mnt/archivio/amule/"; - # }; - # "${target}/transmission" = { - # inherit fsType options; - # device = "${nasUser}@${nasHost}:/mnt/archivio/transmission/"; - # }; - # "${target}/calibre" = { - # inherit fsType options; - # device = "${nasUser}@${nasHost}:/mnt/archivio/calibre/"; - # }; - # "${target}/archivio" = { - # inherit fsType options; - # device = "${nasUser}@${nasHost}:/mnt/archivio/archivio/"; - # }; - # "${target}/film" = { - # inherit fsType options; - # device = "${nasUser}@${nasHost}:/mnt/film/film/"; - # }; - # "${target}/syncthing" = { - # inherit fsType options; - # device = "${nasUser}@${nasHost}:/mnt/archivio/syncthing/"; - # }; - # "${target}/aria" = { - # inherit fsType options; - # device = "${nasUser}@${nasHost}:/mnt/archivio/aria2/"; - # }; - # "${target}/musica" = { - # inherit fsType options; - # device = "${nasUser}@${nasHost}:/mnt/film/musica/"; - # }; - }; -} diff --git a/profiles/printing/default.nix b/profiles/printing/default.nix deleted file mode 100644 index 6ad6385..0000000 --- a/profiles/printing/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: -{ - services.printing = { - enable = true; - drivers = [ pkgs.hplip ]; - }; -} diff --git a/profiles/qmk-udev/default.nix b/profiles/qmk-udev/default.nix deleted file mode 100644 index f995ceb..0000000 --- a/profiles/qmk-udev/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ pkgs, ... }: { - services.udev.packages = [ pkgs.qmk-udev-rules ]; -} diff --git a/profiles/sshd/default.nix b/profiles/sshd/default.nix deleted file mode 100644 index ad4d9aa..0000000 --- a/profiles/sshd/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ - services.openssh = { - enable = true; - permitRootLogin = "yes"; - forwardX11 = true; - }; - - programs.ssh.setXAuthLocation = true; -} diff --git a/profiles/syncthing/default.nix b/profiles/syncthing/default.nix deleted file mode 100644 index 7135c21..0000000 --- a/profiles/syncthing/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - services.syncthing = { - enable = true; - guiAddress = "127.0.0.1:8384"; - dataDir = "/home/ccr/syncthing"; - user = "ccr"; - }; -} diff --git a/profiles/upower/default.nix b/profiles/upower/default.nix deleted file mode 100644 index 1aab014..0000000 --- a/profiles/upower/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ - services.upower.enable = true; -} diff --git a/profiles/xdg/default.nix b/profiles/xdg/default.nix deleted file mode 100644 index 523cb2a..0000000 --- a/profiles/xdg/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ pkgs, ... }: -{ - xdg.portal.enable = true; - xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr ]; - xdg.portal.gtkUsePortal = true; - services.pipewire.enable = true; - environment.sessionVariables = { - MOZ_ENABLE_WAYLAND = "1"; - #XDG_CURRENT_DESKTOP = "sway"; # https://github.com/emersion/xdg-desktop-portal-wlr/issues/20 - #XDG_SESSION_TYPE = "wayland"; # https://github.com/emersion/xdg-desktop-portal-wlr/pull/11 - }; -} diff --git a/shell.nix b/shell.nix deleted file mode 100644 index 575a5d8..0000000 --- a/shell.nix +++ /dev/null @@ -1 +0,0 @@ -(import ./lib/compat).shellNix diff --git a/shell/default.nix b/shell/default.nix deleted file mode 100644 index 743107e..0000000 --- a/shell/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ self, inputs, ... }: -{ - - modules = [ - ./devos.nix - ]; -} - diff --git a/shell/devos.nix b/shell/devos.nix deleted file mode 100644 index 5245be7..0000000 --- a/shell/devos.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ pkgs, extraModulesPath, ... }: -let - - hooks = import ./hooks; - - pkgWithCategory = category: package: { inherit package category; }; - linter = pkgWithCategory "linter"; - docs = pkgWithCategory "docs"; - devos = pkgWithCategory "devos"; - -in -{ - _file = toString ./.; - - imports = [ "${extraModulesPath}/git/hooks.nix" ]; - git = { inherit hooks; }; - - # tempfix: remove when merged https://github.com/numtide/devshell/pull/123 - devshell.startup.load_profiles = pkgs.lib.mkForce ( - pkgs.lib.noDepEntry '' - # PATH is devshell's exorbitant privilige: - # fence against its pollution - _PATH=''${PATH} - # Load installed profiles - for file in "$DEVSHELL_DIR/etc/profile.d/"*.sh; do - # If that folder doesn't exist, bash loves to return the whole glob - [[ -f "$file" ]] && source "$file" - done - # Exert exorbitant privilige and leave no trace - export PATH=''${_PATH} - unset _PATH - '' - ); - - packages = with pkgs; [ - git-crypt - ]; - - commands = with pkgs; [ - (devos nixUnstable) - # { - # category = "devos"; - # name = nvfetcher-bin.pname; - # help = nvfetcher-bin.meta.description; - # command = "cd $DEVSHELL_ROOT/pkgs; ${pkgs.nvfetcher-bin}/bin/nvfetcher -c ./sources.toml --no-output $@"; - # } - (linter nixpkgs-fmt) - (linter editorconfig-checker) - # (docs python3Packages.grip) too many deps - (docs mdbook) - ] - ++ lib.optional - (system != "i686-linux") - (devos cachix) - - ; -} diff --git a/shell/hooks/default.nix b/shell/hooks/default.nix deleted file mode 100644 index 10f2c9d..0000000 --- a/shell/hooks/default.nix +++ /dev/null @@ -1,4 +0,0 @@ -{ - enable = true; - pre-commit.text = builtins.readFile ./pre-commit.sh; -} diff --git a/shell/hooks/pre-commit.sh b/shell/hooks/pre-commit.sh deleted file mode 100755 index 985d3b4..0000000 --- a/shell/hooks/pre-commit.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -if git rev-parse --verify HEAD >/dev/null 2>&1 -then - against=HEAD -else - # Initial commit: diff against an empty tree object - against=$(${git}/bin/git hash-object -t tree /dev/null) -fi - -diff="git diff-index --name-only --cached $against --diff-filter d" - -nix_files=($($diff -- '*.nix')) -all_files=($($diff)) - -# Format staged nix files. -if [[ -n "${nix_files[@]}" ]]; then - nixpkgs-fmt "${nix_files[@]}" \ - && git add "${nix_files[@]}" -fi - -# check editorconfig -editorconfig-checker -- "${all_files[@]}" -if [[ $? != '0' ]]; then - printf "%b\n" \ - "\nCode is not aligned with .editorconfig" \ - "Review the output and commit your fixes" >&2 - exit 1 -fi diff --git a/users/modules/.flake-keep b/users/modules/.flake-keep deleted file mode 100644 index e69de29..0000000 diff --git a/users/profiles/bat/default.nix b/users/profiles/bat/default.nix deleted file mode 100644 index 4cb0b03..0000000 --- a/users/profiles/bat/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.bat = { - enable = true; - }; -} diff --git a/users/profiles/blender/default.nix b/users/profiles/blender/default.nix deleted file mode 100644 index 36b4472..0000000 --- a/users/profiles/blender/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ - openscad - ] ++ (if !stdenv.hostPlatform.isAarch64 then [ - blender - ] - else [ ]); -} diff --git a/users/profiles/chromium/default.nix b/users/profiles/chromium/default.nix deleted file mode 100644 index ace9357..0000000 --- a/users/profiles/chromium/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: -{ - programs.chromium = { - enable = true; - package = with pkgs; if stdenv.hostPlatform.isAarch64 then ungoogled-chromium else google-chrome; - }; -} diff --git a/users/profiles/cura/default.nix b/users/profiles/cura/default.nix deleted file mode 100644 index 6b6ac0b..0000000 --- a/users/profiles/cura/default.nix +++ /dev/null @@ -1,10 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = with pkgs; [ ] ++ - (if !stdenv.hostPlatform.isAarch64 then [ - cura # cura is currently broken on aarch64 - ] else [ ]); - home.sessionVariables = { - QT_QPA_PLATFORM = "xcb"; - }; -} diff --git a/users/profiles/direnv/default.nix b/users/profiles/direnv/default.nix deleted file mode 100644 index fd719c9..0000000 --- a/users/profiles/direnv/default.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - programs.direnv = { - enable = true; - config = { - warn_timeout = "60s"; # default was 5s - }; - nix-direnv = { - enable = true; - }; - }; -} diff --git a/users/profiles/emacs/default.nix b/users/profiles/emacs/default.nix deleted file mode 100644 index 742ba3a..0000000 --- a/users/profiles/emacs/default.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ pkgs, ... }: -{ - home.file."emacs" = { - recursive = true; - source = ./emacs.d; - target = ".emacs.d"; - }; - - programs.emacs = { - enable = true; - package = pkgs.customEmacs; - }; - - services.emacs = { - enable = true; - }; - - # For some reason Hunspell dictionaries paths must be specified on Darwin - home.sessionVariables = - if pkgs.stdenv.hostPlatform.isDarwin then { - DICPATH = "${pkgs.hunspellDicts.it_IT}/share/hunspell:${pkgs.hunspellDicts.en_US}/share/hunspell"; - } else { }; - - home.packages = - let - easy-ps = import - (pkgs.fetchFromGitHub { - owner = "justinwoo"; - repo = "easy-purescript-nix"; - rev = "7802db65618c2ead3a55121355816b4c41d276d9"; - sha256 = "0n99hxxcp9yc8yvx7bx4ac6askinfark7dnps3hzz5v9skrvq15q"; - }) - { - inherit pkgs; - }; - in - with pkgs; [ - delta - fd - graphviz-nox - hunspell - hunspellDicts.en_US - hunspellDicts.it_IT - imagemagick - mediainfo - nixpkgs-fmt - poppler_utils - python3Full - rnix-lsp - silver-searcher - unzip - ( - makeDesktopItem { - name = "org-protocol"; - exec = "emacsclient %u"; - comment = "Org protocol"; - desktopName = "org-protocol"; - type = "Application"; - mimeTypes = [ "x-scheme-handler/org-protocol" ]; - } - ) - ] ++ (if pkgs.system == "x86_64-linux" then [ - python-language-server - ] ++ (with easy-ps; [ - ffmpegthumbnailer - ]) else [ ]); -} diff --git a/users/profiles/emacs/emacs.d/config/aesthetics.el b/users/profiles/emacs/emacs.d/config/aesthetics.el deleted file mode 100644 index 2916349..0000000 --- a/users/profiles/emacs/emacs.d/config/aesthetics.el +++ /dev/null @@ -1,85 +0,0 @@ -(use-package modus-themes - :init - (setq - modus-themes-region '(bg-only no-extend)) - (modus-themes-load-themes) - :config - (modus-themes-load-operandi) ;white theme - ;; (modus-themes-load-vivendi) ;black theme - :bind ("" . modus-themes-toggle) - ) - -(use-package fira-code-mode - :after all-the-icons - ;;:custom (fira-code-mode-disabled-ligatures '("x")) ;; List of ligatures to turn off - :config - :hook ((prog-mode . (lambda () (progn (fira-code-mode) (set-fontset-font t '(#Xe100 . #Xe16f) "Fira Code Symbol")))))) - -(use-package visual-fill-column - :commands (visual-fill-column-mode) - :hook - (markdown-mode . activate-visual-fill-column) - (org-mode . activate-visual-fill-column) - :init - (defun activate-visual-fill-column () - (interactive) - (setq-local fill-column 80) - (visual-line-mode t) - (visual-fill-column-mode t)) - :config - (setq-default visual-fill-column-center-text t - visual-fill-column-fringes-outside-margins nil)) - -(use-package minimap - :custom ((minimap-window-location 'right)) - :bind ("" . minimap-mode)) - -(use-package good-scroll - :config (good-scroll-mode 1) - :bind (("" . #'good-scroll-up-full-screen) - ("" . #'good-scroll-down-full-screen))) - -(use-package rainbow-identifiers - ;; :hook ((prog-mode . rainbow-identifiers-mode)) - ) - -(use-package highlight-indent-guides - :hook ((prog-mode . highlight-indent-guides-mode)) - :config (setq highlight-indent-guides-method 'character - highlight-indent-guides-responsive 'top)) - -(use-package origami - :hook ((prog-mode . origami-mode))) - -(use-package hl-todo - :hook ((prog-mode . hl-todo-mode))) - -;; TODO: To move in a different config file -(when (string-equal system-type "darwin") - (set-face-attribute 'default nil :height 150) - (setq mac-command-modifier 'ctrl)) - -(use-package doom-modeline - :ensure t - :init (doom-modeline-mode 1)) - - -(defalias 'yes-or-no-p 'y-or-n-p) -(setq use-dialog-box nil - display-time-format "%H:%M" - column-number-mode t - mouse-autoselect-window t - inhibit-startup-screen t) -(menu-bar-mode -1) -(tool-bar-mode -1) -(scroll-bar-mode -1) -(fringe-mode 1) -(display-time-mode 1) -(global-hl-line-mode 1) - -(add-hook 'prog-mode-hook #'display-line-numbers-mode) -(add-hook 'prog-mode-hook #'rainbow-delimiters-mode) -(add-hook 'prog-mode-hook #'show-paren-mode) - - -(provide 'aesthetics) diff --git a/users/profiles/emacs/emacs.d/config/config-company.el b/users/profiles/emacs/emacs.d/config/config-company.el deleted file mode 100644 index 3a4ca42..0000000 --- a/users/profiles/emacs/emacs.d/config/config-company.el +++ /dev/null @@ -1,36 +0,0 @@ -(use-package company - :init - (setq company-backends '(company-capf - company-keywords - company-nixos-options - company-semantic - company-files - company-etags - company-elisp - company-jedi - company-ispell - company-yasnippet) - company-tooltip-limit 20 - company-show-numbers t - company-idle-delay 0 - company-echo-delay 0) - :bind - (("C-c ." . company-complete) - ("C-c C-." . company-complete) - ("C-c s s" . company-yasnippet) - :map company-active-map - ("C-n" . company-select-next) - ("C-p" . company-select-previous) - ("C-d" . company-show-doc-buffer) - ("M-." . company-show-location))) - -(use-package helm-company - :after (helm company) - :bind (("C-c C-;" . helm-company)) - :commands (helm-company) - :init - (define-key company-mode-map (kbd "C-;") 'helm-company) - (define-key company-active-map (kbd "C-;") 'helm-company)) - - -(provide 'config-company) diff --git a/users/profiles/emacs/emacs.d/config/config-direnv.el b/users/profiles/emacs/emacs.d/config/config-direnv.el deleted file mode 100644 index 358aa82..0000000 --- a/users/profiles/emacs/emacs.d/config/config-direnv.el +++ /dev/null @@ -1,7 +0,0 @@ -(use-package envrc - :disabled t - :after exec-path-from-shell - :config - (envrc-global-mode)) - -(provide 'config-direnv) diff --git a/users/profiles/emacs/emacs.d/config/config-dirvish.el b/users/profiles/emacs/emacs.d/config/config-dirvish.el deleted file mode 100644 index a09c065..0000000 --- a/users/profiles/emacs/emacs.d/config/config-dirvish.el +++ /dev/null @@ -1,123 +0,0 @@ -(use-package dired - ;; Dirvish respects all the keybindings in `dired-mode-map' - :bind - (nil - :map dired-mode-map - ("h" . dired-up-directory) - ("j" . dired-next-line) - ("k" . dired-previous-line) - ("l" . dired-find-file) - ("i" . wdired-change-to-wdired-mode) - ("." . dired-omit-mode)) - :config - (setq dired-recursive-deletes 'always) - (setq delete-by-moving-to-trash t) - (setq dired-dwim-target t) - ;; Make sure to use the long name of flags when exists - ;; eg. use "--almost-all" instead of "-A" - ;; Otherwise some commands won't work properly - (setq dired-listing-switches - "-l --almost-all --human-readable --time-style=long-iso --group-directories-first --no-group")) - -(use-package dired-x - ;; Enable dired-omit-mode by default - ;; :hook - ;; (dired-mode . dired-omit-mode) - :config - ;; Make dired-omit-mode hide all "dotfiles" - (setq dired-omit-files - (concat dired-omit-files "\\|^\\..*$"))) - -(use-package dirvish - :custom - ;; Go back home? Just press `bh' - (dirvish-menu-bookmarks - '(("h" "~/" "Home") - ("d" "~/Downloads/" "Downloads") - ("m" "/mnt/" "Drives") - ("t" "~/.local/share/Trash/files/" "TrashCan"))) - ;; (dirvish-header-line-format '(:left (path) :right (free-space))) - (dirvish-mode-line-format - '(:left - (sort file-time " " file-size symlink) ; it's ok to place string inside - :right - ;; For `dired-filter' users, replace `omit' with `filter' segment defined below - (omit yank index))) - (dirvish-attributes '(subtree-state - ;; file-size - ;; Feel free to replace `all-the-icons' with `vscode-icon'. - all-the-icons)) - ;; Maybe the icons are too big to your eyes - ;; (dirvish-all-the-icons-height 0.8) - ;; In case you want the details at startup like `dired' - ;; (dirvish-hide-details nil) - :config - ;; Place this line under :init to ensure the overriding at startup, see #22 - (dirvish-override-dired-mode) - (dirvish-peek-mode) - ;; Define mode line segment for `dired-filter' - ;; (dirvish-define-mode-line filter "Describe filters." - ;; (when (bound-and-true-p dired-filter-mode) - ;; (propertize (format " %s " (dired-filter--describe-filters)) - ;; 'face 'dired-filter-group-header))) - :bind - ;; Bind `dirvish|dirvish-dired|dirvish-side|dirvish-dwim' as you see fit - (("C-c f" . dirvish-fd) - :map dired-mode-map - ("TAB" . dirvish-toggle-subtree) - ("SPC" . dirvish-show-history) - ("*" . dirvish-mark-menu) - ("r" . dirvish-roam) - ("b" . dirvish-goto-bookmark) - ("f" . dirvish-file-info-menu) - ("M-n" . dirvish-go-forward-history) - ("M-p" . dirvish-go-backward-history) - ("M-s" . dirvish-setup-menu) - ("M-f" . dirvish-toggle-fullscreen) - ([remap dired-sort-toggle-or-edit] . dirvish-quicksort) - ([remap dired-do-redisplay] . dirvish-ls-switches-menu) - ([remap dired-summary] . dirvish-dispatch) - ([remap dired-do-copy] . dirvish-yank-menu) - ([remap mode-line-other-buffer] . dirvish-other-buffer))) - -;; Addtional syntax highlighting for dired -(use-package diredfl - :hook - (dired-mode . diredfl-mode)) - -;; Use `all-the-icons' as Dirvish's icon backend -(use-package all-the-icons - :if (display-graphic-p)) - -;; Or, use `vscode-icon' instead -;; (use-package vscode-icon -;; :config -;; (push '("jpg" . "image") vscode-icon-file-alist)) - -;; `ibuffer' like file filtering system -(use-package dired-filter - :after dirvish - :config - :custom - ;; Do not touch the header line - (dired-filter-show-filters nil) - (dired-filter-revert 'always) - :bind - (:map dired-mode-map - ([remap dired-omit-mode] . dired-filter-mode))) - -(use-package dired-collapse - :bind - (:map dired-mode-map - ("M-c" . dired-collapse-mode))) - -;; We already have `dirvish-toggle-subtree' -;; But you can still use this package if you want those fancy features -;; (use-package dired-subtree -;; :config -;; (setq dired-subtree-use-backgrounds nil) -;; :bind -;; (:map dired-mode-map -;; ("TAB" . dired-subtree-toggle))) - -(provide 'config-dirvish) diff --git a/users/profiles/emacs/emacs.d/config/config-emacs.el b/users/profiles/emacs/emacs.d/config/config-emacs.el deleted file mode 100644 index b7b1511..0000000 --- a/users/profiles/emacs/emacs.d/config/config-emacs.el +++ /dev/null @@ -1,10 +0,0 @@ -(setq backup-directory-alist `(("." . "~/.saves")) - backup-by-copying t - delete-old-versions 6 - kept-old-versions 2 - version-control t - create-lockfiles nil - native-comp-async-report-warnings-errors nil - ) - -(provide 'config-emacs) diff --git a/users/profiles/emacs/emacs.d/config/config-emails.el b/users/profiles/emacs/emacs.d/config/config-emails.el deleted file mode 100644 index 6d232c5..0000000 --- a/users/profiles/emacs/emacs.d/config/config-emails.el +++ /dev/null @@ -1,46 +0,0 @@ -(use-package notmuch - :custom - (notmuch-archive-tags '("-unread")) - ;;(notmuch-show-indent-content nil) - (notmuch-search-older-first nil) - (message-kill-buffer-on-exit t) - (notmuch-hello-sections - '(notmuch-hello-insert-header - notmuch-hello-insert-saved-searches - notmuch-hello-insert-search - notmuch-hello-insert-alltags - notmuch-hello-insert-recent-searches - notmuch-hello-insert-footer - )) - (notmuch-tagging-keys - '(("a" notmuch-archive-tags "Archive") - ("u" notmuch-show- - mark-read-tags "Mark read") - ("m" ("+muted") "Mute") - ("f" ("+flagged") "Flag") - ("s" ("+spam" "-inbox") "Mark as spam") - ("d" ("+deleted" "-inbox") "Delete"))) - ) - -(use-package message - :config - (setq message-send-mail-function 'message-send-mail-with-sendmail - message-sendmail-f-is-evil t - message-sendmail-envelope-from nil ; 'header - message-sendmail-extra-arguments '("--read-envelope-from")) - - (setq mml-secure-smime-sign-with-sender t) - (setq mml-secure-openpgp-sign-with-sender t) - - ;; Add signature by default - (add-hook 'message-setup-hook 'mml-secure-message-sign-pgpmime) - ;; Verify other's signatures - (setq mm-verify-option 'always)) - -(use-package sendmail - :config - (setq mail-specify-envelope-from nil - send-mail-function 'message-send-mail-with-sendmail - sendmail-program "msmtp")) - -(provide 'config-emails) diff --git a/users/profiles/emacs/emacs.d/config/config-evil.el b/users/profiles/emacs/emacs.d/config/config-evil.el deleted file mode 100644 index 8797f2f..0000000 --- a/users/profiles/emacs/emacs.d/config/config-evil.el +++ /dev/null @@ -1,19 +0,0 @@ - -(use-package evil - :custom - (evil-want-keybinding nil) - (evil-undo-system 'undo-redo) - :config - (evil-mode 1) ; globally enable evil-mode except for the following modes - (mapcar (lambda (mode) (evil-set-initial-state mode 'emacs)) - '(vterm-mode - eshell-mode - dired-mode - ))) - -(use-package evil-collection - :after (evil) - :config - (evil-collection-init)) - -(provide 'config-evil) diff --git a/users/profiles/emacs/emacs.d/config/config-helm.el b/users/profiles/emacs/emacs.d/config/config-helm.el deleted file mode 100644 index f020422..0000000 --- a/users/profiles/emacs/emacs.d/config/config-helm.el +++ /dev/null @@ -1,38 +0,0 @@ -(use-package helm - :init - (progn - (require 'helm-config) - (setq helm-autoresize-max-height 0) - (setq helm-autoresize-min-height 20) - (global-set-key (kbd "C-c h") 'helm-command-prefix) - (global-unset-key (kbd "C-x c")) - - (when (executable-find "ack") - (setq helm-grep-default-command "ack -Hn --no-group --no-color %e %p %f" - helm-grep-default-recurse-command "ack -H --no-group --no-color %e %p %f")) - - (setq helm-semantic-fuzzy-match t - helm-imenu-fuzzy-match t - helm-M-x-fuzzy-match t ;; optional fuzzy matching for helm-M-x - helm-buffers-fuzzy-matching t - helm-recentf-fuzzy-match t - helm-split-window-in-side-p t - helm-buffer-max-length nil) - - (helm-mode 1) - (helm-autoresize-mode 1)) - - :bind - (("C-c h" . helm-command-prefix) - :map helm-command-map - ("b" . helm-buffers-list) - ("f" . helm-find-files) - ("m" . helm-mini) - ("o" . helm-imenu)) - :bind - (("M-x" . helm-M-x) - ("M-y" . helm-show-kill-ring) - ("C-x b" . helm-mini) - ("C-x C-f" . helm-find-files))) - -(provide 'config-helm) diff --git a/users/profiles/emacs/emacs.d/config/config-lisp.el b/users/profiles/emacs/emacs.d/config/config-lisp.el deleted file mode 100644 index 17cebcf..0000000 --- a/users/profiles/emacs/emacs.d/config/config-lisp.el +++ /dev/null @@ -1,15 +0,0 @@ -(use-package symex - :custom - (symex-modal-backend 'evil) - :config - (symex-initialize) - (global-set-key (kbd "C-c s") 'symex-mode-interface)) ; or whatever keybinding you like - - -(use-package aggressive-indent - :commands (aggressive-indent-mode aggressive-indent-global-mode) - :hook - (emacs-lisp-mode . aggressive-indent-mode) - (lisp-mode . aggressive-indent-mode)) - -(provide 'config-lisp) diff --git a/users/profiles/emacs/emacs.d/config/config-lsp.el b/users/profiles/emacs/emacs.d/config/config-lsp.el deleted file mode 100644 index f2dc252..0000000 --- a/users/profiles/emacs/emacs.d/config/config-lsp.el +++ /dev/null @@ -1,30 +0,0 @@ -(use-package lsp-mode - :init - ;; set prefix for lsp-command-keymap (few alternatives - "C-l", "C-c l") - (setq lsp-keymap-prefix "C-c l") - :custom - (lsp-haskell-server-path "haskell-language-server-wrapper") - :hook (;; replace XXX-mode with concrete major-mode(e. g. python-mode) - (nix-mode . lsp) - (python-mode . lsp) - (haskell-mode . lsp) - ;; if you want which-key integration - (lsp-mode . lsp-enable-which-key-integration)) - :commands lsp) - -;; optionally -(use-package lsp-ui :commands lsp-ui-mode) -;; if you are helm user -(use-package helm-lsp :commands helm-lsp-workspace-symbol) -(use-package lsp-treemacs :commands lsp-treemacs-errors-list) - -;; optionally if you want to use debugger -(use-package dap-mode) -;; (use-package dap-LANGUAGE) to load the dap adapter for your language - -;; optional if you want which-key integration -(use-package which-key - :config - (which-key-mode)) - -(provide 'config-lsp) diff --git a/users/profiles/emacs/emacs.d/config/config-magit.el b/users/profiles/emacs/emacs.d/config/config-magit.el deleted file mode 100644 index 6a0d3e9..0000000 --- a/users/profiles/emacs/emacs.d/config/config-magit.el +++ /dev/null @@ -1,23 +0,0 @@ -(setenv "SSH_AUTH_SOCK" "/run/user/1000/gnupg/S.gpg-agent.ssh") - -(use-package magit - :bind (("C-x g" . magit-status) - ("C-x C-g" . magit-status))) - -(use-package magit-delta - :hook (magit-mode . magit-delta-mode)) - -(use-package transient - :defer t - :config - (transient-bind-q-to-quit)) - -(use-package diff-hl - :after magit - :config - (require 'diff-hl-flydiff) - (add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh) - (diff-hl-flydiff-mode t) - (global-diff-hl-mode t)) - -(provide 'config-magit) diff --git a/users/profiles/emacs/emacs.d/config/config-nix.el b/users/profiles/emacs/emacs.d/config/config-nix.el deleted file mode 100644 index 4151db9..0000000 --- a/users/profiles/emacs/emacs.d/config/config-nix.el +++ /dev/null @@ -1,21 +0,0 @@ -(use-package nix-mode - :mode "\\.nix\\'" - :config (setq format-on-save t) - :bind ("" . (lambda () (interactive) (setq format-on-save (not format-on-save)) )) - :hook - (before-save . (lambda () (when (format-on-save) (lsp-format-buffer))))) - -(require 'sudo-utils) - -(defun nixos-rebuild-switch () - (interactive) - (sudo-utils-shell-command "nixos-rebuild switch")) - -(defun nixos-rebuild-test () - (interactive) - ;; async-shell command should be sufficient, to check why it isn't - (sudo-utils-shell-command "nixos-rebuild test")) - -(global-set-key [f6] 'nixos-rebuild-test) - -(provide 'config-nix) diff --git a/users/profiles/emacs/emacs.d/config/config-org.el b/users/profiles/emacs/emacs.d/config/config-org.el deleted file mode 100644 index 200f91f..0000000 --- a/users/profiles/emacs/emacs.d/config/config-org.el +++ /dev/null @@ -1,137 +0,0 @@ -(use-package org - :init - (setq fill-column 80) - (require 'org-protocol) - :custom - (org-startup-folded 'fold) - (org-startup-indented f) - (org-startup-indented nil) - (org-agenda-files '("~/roam/" "~/orgzly~")) - (org-ellipsis "⤵") - (org-pretty-entities t) - (org-hide-emphasis-markers t) - (org-agenda-block-separator "") - (org-fontify-whole-heading-line t) - (org-fontify-done-headline t) - (org-fontify-quote-and-verse-blocks t) - (prettify-symbols-alist '(("#+BEGIN_SRC" . "λ") - ("#+END_SRC" . "λ") - ("#+begin_src" . "λ") - ("#+end_src" . "λ"))) - (org-babel-python-command "python3") - (org-src-preserve-indentation t) - :config - (org-babel-do-load-languages - 'org-babel-load-languages - '((python . t))) - :hook - ((org-mode . auto-fill-mode) ;refill-mode breaks org headings - ;; (org-mode . org-num-mode) - ;; (org-mode . (lambda () - ;; (dolist (face '((org-level-1 1.5) - ;; (org-level-2 1.4) - ;; (org-level-3 1.3) - ;; (org-level-4 1.2) - ;; (org-level-5 1.1))) - ;; (set-face-attribute (car face) nil :weight 'semi-bold :height (cadr face))))) - (org-mode . prettify-symbols-mode))) - -(use-package org-fragtog - :custom - (org-format-latex-options (plist-put org-format-latex-options :scale 1.6)) - :hook - ((org-mode . org-fragtog-mode))) - -(use-package org-download - :hook - ((org-mode . (lambda () (setq-local org-download-image-dir "~/roam/images/"))))) - -(use-package org-superstar - :custom - (org-superstar-special-todo-items t) - ;; :hook (('org-mode . (lambda () (org-superstar-mode 1)))) - ) - -(use-package org-download - :hook - ((org-mode . (lambda () (setq-local org-download-image-dir "~/roam/images/"))))) - -(use-package org-roam - :init - (setq org-roam-v2-ack t) - :custom - (org-roam-directory (file-truename "~/roam/")) - (org-roam-graph-executable "dot") - (org-roam-db-location (file-truename "roam/org-roam.db")) - (org-roam-node-display-template "${title:72} ${tags:10} ${backlinkscount:6}") - (org-roam-capture-templates - '(("d" "default" plain "\n%?" :target (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}") :unnarrowed t))) - :hook - ((org-roam-mode . (lambda () (org-hide-properties)))) - :bind (("C-c n l" . org-roam-buffer-toggle) - ("C-c n f" . org-roam-node-find) - ("C-c n g" . org-roam-graph) - ("C-c n i" . org-roam-node-insert) - ("C-c n I" . org-roam-node-insert-immediate) - ("C-c n c" . org-roam-capture) - ;; Dailies - ("C-c n j" . org-roam-dailies-capture-today)) - :config - (defun org-roam-node-insert-immediate (arg &rest args) - (interactive "P") - (let ((args (cons arg args)) - (org-roam-capture-templates (list (append (car org-roam-capture-templates) - '(:immediate-finish t))))) - (apply #'org-roam-node-insert args))) - - (defun org-hide-properties () - "Hide all org-mode headline property drawers in buffer. Could be slow if it has a lot of overlays." - (interactive) - (save-excursion - (goto-char (point-min)) - (while (re-search-forward - "^ *:properties:\n\\( *:.+?:.*\n\\)+ *:end:\n" nil t) - (let ((ov_this (make-overlay (match-beginning 0) (match-end 0)))) - (overlay-put ov_this 'display "") - (overlay-put ov_this 'hidden-prop-drawer t)))) - (put 'org-toggle-properties-hide-state 'state 'hidden)) - - (defun org-show-properties () - "Show all org-mode property drawers hidden by org-hide-properties." - (interactive) - (remove-overlays (point-min) (point-max) 'hidden-prop-drawer t) - (put 'org-toggle-properties-hide-state 'state 'shown)) - - (defun org-toggle-properties () - "Toggle visibility of property drawers." - (interactive) - (if (eq (get 'org-toggle-properties-hide-state 'state) 'hidden) - (org-show-properties) - (org-hide-properties))) - - (cl-defmethod org-roam-node-directories ((node org-roam-node)) - (if-let ((dirs (file-name-directory (file-relative-name (org-roam-node-file node) org-roam-directory)))) - (format "(%s)" (car (f-split dirs))) - "")) - - (cl-defmethod org-roam-node-backlinkscount ((node org-roam-node)) - (let* ((count (caar (org-roam-db-query - [:select (funcall count source) - :from links - :where (= dest $s1) - :and (= type "id")] - (org-roam-node-id node))))) - (format "[%d]" count))) - - - (org-roam-db-autosync-mode) - (require 'org-roam-protocol)) - -(use-package org-roam-ui - :after org-roam - :config (setq org-roam-ui-sync-theme t - org-roam-ui-follow t - org-roam-ui-update-on-save t - org-roam-ui-open-on-start t)) - -(provide 'config-org) diff --git a/users/profiles/emacs/emacs.d/config/config-projectile.el b/users/profiles/emacs/emacs.d/config/config-projectile.el deleted file mode 100644 index 0ce54d2..0000000 --- a/users/profiles/emacs/emacs.d/config/config-projectile.el +++ /dev/null @@ -1,12 +0,0 @@ - -(use-package projectile - :init - (projectile-mode +1) - :bind (:map projectile-mode-map - ("s-p" . projectile-command-map) - ("C-c p" . projectile-command-map)) - :config - (helm-projectile-on)) - - -(provide 'config-projectile) diff --git a/users/profiles/emacs/emacs.d/config/config-purescript.el b/users/profiles/emacs/emacs.d/config/config-purescript.el deleted file mode 100644 index c2aa46f..0000000 --- a/users/profiles/emacs/emacs.d/config/config-purescript.el +++ /dev/null @@ -1,47 +0,0 @@ -(use-package psc-ide - :custom - (psc-ide-rebuild-on-save t) - - :config - ;; The following is stolen from the Spacemacs purescript layer - - (defun purescript-purs-tidy-format-buffer () - "Format buffer with purs-tidy." - (interactive) - (if (executable-find "purs-tidy") - (let* ((extension (file-name-extension (or buffer-file-name "tmp.purs") t)) - (tmpfile (make-temp-file "~fmt-tmp" nil extension)) - (coding-system-for-read 'utf-8) - (coding-system-for-write 'utf-8) - (outputbuf (get-buffer-create "*~fmt-tmp.purs*"))) - (unwind-protect - (progn - (with-current-buffer outputbuf (erase-buffer)) - (write-region nil nil tmpfile) - (if (zerop (apply #'call-process-region nil nil "purs-tidy" nil - `(,outputbuf ,tmpfile) nil - `("format"))) - (let ((p (point))) - (save-excursion - (with-current-buffer (current-buffer) - (replace-buffer-contents outputbuf))) - (goto-char p) - (message "formatted.") - (kill-buffer outputbuf)) - (message "Formatting failed!") - (display-buffer outputbuf))) - (delete-file tmpfile))) - (error "purs-tidy not found"))) - - :hook - (purescript-mode . (lambda () - (add-hook 'before-save-hook purescript-purs-tidy-format-buffer nil 'make-it-local) - (psc-ide-mode) - (company-mode) - (flycheck-mode) - (turn-on-purescript-indentation) - ))) - -(use-package psci) - -(provide 'config-purescript) diff --git a/users/profiles/emacs/emacs.d/config/config-python.el b/users/profiles/emacs/emacs.d/config/config-python.el deleted file mode 100644 index 19ed001..0000000 --- a/users/profiles/emacs/emacs.d/config/config-python.el +++ /dev/null @@ -1,9 +0,0 @@ -(use-package lsp-python-ms - :hook (python-mode . (lambda () - (setq indent-tabs-mode nil) ; disable tabs - (require 'lsp-python-ms) - (lsp))) - :init - (setq lsp-python-ms-executable (executable-find "python-language-server"))) - -(provide 'config-python) diff --git a/users/profiles/emacs/emacs.d/config/config-scad.el b/users/profiles/emacs/emacs.d/config/config-scad.el deleted file mode 100644 index 709a125..0000000 --- a/users/profiles/emacs/emacs.d/config/config-scad.el +++ /dev/null @@ -1,4 +0,0 @@ -(use-package scad-mode - :mode "\\.scad\\'") - -(provide 'config-scad) diff --git a/users/profiles/emacs/emacs.d/config/config-spelling.el b/users/profiles/emacs/emacs.d/config/config-spelling.el deleted file mode 100644 index 5500387..0000000 --- a/users/profiles/emacs/emacs.d/config/config-spelling.el +++ /dev/null @@ -1,29 +0,0 @@ -(use-package ispell - :bind - (("C-c s c" . ispell-complete-word) - ("C-c s d" . switch-dictionary-it-en)) - :hook - ((org-mode . flyspell-mode) - (prog-mode . flyspell-prog-mode) - ) - :custom - ((ispell-program-name "hunspell") - (ispell-dictionary "en_US")) - :config - (defun switch-dictionary-it-en () - (interactive) - (let* ((dict ispell-current-dictionary) - (new (if (string= dict "en_US") "it_IT" - "en_US"))) - (ispell-change-dictionary new) - (message "Switched dictionary from %s to %s" dict new)))) - -(use-package writegood-mode - :bind - (("C-c s g" . writegood-grade-level) - ("C-c s r" . writegood-reading-ease) - ("C-c s w" . writegood-mode))) - - - -(provide 'config-spelling) diff --git a/users/profiles/emacs/emacs.d/config/config-translate.el b/users/profiles/emacs/emacs.d/config/config-translate.el deleted file mode 100644 index c05f747..0000000 --- a/users/profiles/emacs/emacs.d/config/config-translate.el +++ /dev/null @@ -1,34 +0,0 @@ -(use-package go-translate - :config - (defclass gts-insert-render (gts-render) ()) - - (cl-defmethod gts-out ((_ gts-insert-render) task) - (deactivate-mark) - (insert (oref task result))) - - (setq gts-translate-list '(("it" "en"))) - (setq gts-default-translator - (gts-translator - :picker - (gts-prompt-picker) - :engines - (gts-google-engine :parser (gts-google-summary-parser)) - :render - (gts-insert-render) - )) - (defun gts-pop-definition () - (interactive) - (gts-translate (gts-translator - :picker - (gts-noprompt-picker :texter (gts-current-or-selection-texter) :single t) - :engines - (gts-google-engine) - :render - (gts-posframe-pop-render) - ))) - - :bind - (("C-c t t" . gts-do-translate) - ("C-c t p" . gts-pop-definition))) - -(provide 'config-translate) diff --git a/users/profiles/emacs/emacs.d/config/config-treemacs.el b/users/profiles/emacs/emacs.d/config/config-treemacs.el deleted file mode 100644 index 19f0bf1..0000000 --- a/users/profiles/emacs/emacs.d/config/config-treemacs.el +++ /dev/null @@ -1,103 +0,0 @@ -(use-package treemacs - :ensure t - :defer t - :init - (with-eval-after-load 'winum - (define-key winum-keymap (kbd "M-0") #'treemacs-select-window)) - :config - (progn - (setq treemacs-collapse-dirs (if treemacs-python-executable 3 0) - treemacs-deferred-git-apply-delay 0.5 - treemacs-directory-name-transformer #'identity - treemacs-display-in-side-window t - treemacs-eldoc-display t - treemacs-file-event-delay 5000 - treemacs-file-extension-regex treemacs-last-period-regex-value - treemacs-file-follow-delay 0.2 - treemacs-file-name-transformer #'identity - treemacs-follow-after-init t - treemacs-expand-after-init t - treemacs-git-command-pipe "" - treemacs-goto-tag-strategy 'refetch-index - treemacs-indentation 2 - treemacs-indentation-string " " - treemacs-is-never-other-window nil - treemacs-max-git-entries 5000 - treemacs-missing-project-action 'ask - treemacs-move-forward-on-expand nil - treemacs-no-png-images nil - treemacs-no-delete-other-windows t - treemacs-project-follow-cleanup nil - treemacs-persist-file (expand-file-name ".cache/treemacs-persist" user-emacs-directory) - treemacs-position 'left - treemacs-read-string-input 'from-child-frame - treemacs-recenter-distance 0.1 - treemacs-recenter-after-file-follow nil - treemacs-recenter-after-tag-follow nil - treemacs-recenter-after-project-jump 'always - treemacs-recenter-after-project-expand 'on-distance - treemacs-litter-directories '("/node_modules" "/.venv" "/.cask") - treemacs-show-cursor nil - treemacs-show-hidden-files t - treemacs-silent-filewatch nil - treemacs-silent-refresh nil - treemacs-sorting 'alphabetic-asc - treemacs-select-when-already-in-treemacs 'move-back - treemacs-space-between-root-nodes t - treemacs-tag-follow-cleanup t - treemacs-tag-follow-delay 1.5 - treemacs-text-scale nil - treemacs-user-mode-line-format nil - treemacs-user-header-line-format nil - treemacs-width 35 - treemacs-width-is-initially-locked t - treemacs-workspace-switch-cleanup nil) - - ;; The default width and height of the icons is 22 pixels. If you are - ;; using a Hi-DPI display, uncomment this to double the icon size. - ;;(treemacs-resize-icons 44) - - (treemacs-follow-mode t) - (treemacs-filewatch-mode t) - (treemacs-fringe-indicator-mode 'always) - - (pcase (cons (not (null (executable-find "git"))) - (not (null treemacs-python-executable))) - (`(t . t) - (treemacs-git-mode 'deferred)) - (`(t . _) - (treemacs-git-mode 'simple))) - - (treemacs-hide-gitignored-files-mode nil)) - :bind - (:map global-map - ("M-0" . treemacs-select-window) - ("C-x t 1" . treemacs-delete-other-windows) - ("C-x t t" . treemacs) - ("C-x t B" . treemacs-bookmark) - ("C-x t C-t" . treemacs-find-file) - ("C-x t M-t" . treemacs-find-tag))) - -(use-package treemacs-evil - :after (treemacs evil) - :ensure t) - -(use-package treemacs-projectile - :after (treemacs projectile) - :ensure t) - -(use-package treemacs-icons-dired - :after (treemacs dired) - :ensure t - :config (treemacs-icons-dired-mode)) - -(use-package treemacs-magit - :after (treemacs magit) - :ensure t) - -(use-package treemacs-persp ;;treemacs-perspective if you use perspective.el vs. persp-mode - :after (treemacs persp-mode) ;;or perspective vs. persp-mode - :ensure t - :config (treemacs-set-scope-type 'Perspectives)) - -(provide 'config-treemacs) diff --git a/users/profiles/emacs/emacs.d/init.el b/users/profiles/emacs/emacs.d/init.el deleted file mode 100644 index 62cd967..0000000 --- a/users/profiles/emacs/emacs.d/init.el +++ /dev/null @@ -1,27 +0,0 @@ -(add-to-list 'load-path "~/.emacs.d/config") - -(setq gc-cons-threshold 100000000 - read-process-output-max (* 1024 1024)) - -(require 'aesthetics) -(require 'config-emacs) -(require 'config-evil) -(require 'config-helm) -(require 'config-org) -(require 'config-emails) -(require 'config-projectile) -(require 'config-company) -(require 'config-magit) -(require 'config-treemacs) -(require 'config-lsp) -(require 'config-python) -(require 'config-spelling) -(require 'config-nix) -(require 'config-purescript) -(require 'config-scad) -(require 'config-translate) -(require 'config-lisp) -(require 'config-direnv) -(require 'config-dirvish) - -(server-start) diff --git a/users/profiles/exa/default.nix b/users/profiles/exa/default.nix deleted file mode 100644 index 114b158..0000000 --- a/users/profiles/exa/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - programs.exa = { - enable = true; - enableAliases = true; - }; -} diff --git a/users/profiles/firefox/default.nix b/users/profiles/firefox/default.nix deleted file mode 100644 index c3b57b4..0000000 --- a/users/profiles/firefox/default.nix +++ /dev/null @@ -1,51 +0,0 @@ -{ pkgs, ... }: -{ - programs.firefox = { - enable = true; - package = pkgs.firefox-unwrapped; - #package = (pkgs.firefox.override { extraNativeMessagingHosts = [ - # pkgs.browserpass - # pkgs.passff-host - #]; }); - #extensions = with pkgs.nur.repos.rycee.firefox-addons; [ - #https-everywhere - #privacy-badger - #ublock-origin - #react-devtools - #org-capture - #clearurls - #browserpass # not working, manually installed passff - #firefox-color - #darkreader - #cookie-autodelete - # and manually installed ghost-text for atomic-chrome - #]; - profiles.ccr = { - settings = { - "browser.startup.homepage" = "https://google.it"; - "browser.search.region" = "IT"; - "browser.search.isUS" = false; - "distribution.searchplugins.defaultLocale" = "it-IT"; - "general.useragent.locale" = "it-IT"; - "browser.bookmarks.showMobileBookmarks" = true; - "browser.download.folderList" = 2; - "browser.download.lastDir" = "/home/ccr/downloads/"; - "browser.shell.checkDefaultBrowser" = false; - }; - userChrome = '' - /* Hide tab bar in FF Quantum * / - @-moz-document url("chrome://browser/content/browser.xul") { - #TabsToolbar { - visibility: collapse !important; - margin-bottom: 21px !emportant; - } - - #sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header { - visibility: collapse !important; - } - } - ''; - userContent = ""; - }; - }; -} diff --git a/users/profiles/foot/default.nix b/users/profiles/foot/default.nix deleted file mode 100644 index a82a564..0000000 --- a/users/profiles/foot/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - programs.foot = { - enable = true; - server.enable = false; # server is executed by sway without systemd integration - settings = { - main = { - term = "xterm-256color"; - - font = "Fira Code:size=11"; - dpi-aware = "yes"; - }; - - mouse = { - hide-when-typing = "yes"; - }; - }; - - }; -} diff --git a/users/profiles/fzf/default.nix b/users/profiles/fzf/default.nix deleted file mode 100644 index 9134638..0000000 --- a/users/profiles/fzf/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.fzf = { - enable = true; - }; -} diff --git a/users/profiles/git/default.nix b/users/profiles/git/default.nix deleted file mode 100644 index d7b27d9..0000000 --- a/users/profiles/git/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ pkgs, ... }: - -let - config = - if pkgs.stdenv.hostPlatform.isDarwin then { - name = "Andrea Ciceri"; - email = "andrea.ciceri@beatdata.it"; - } else { - name = "Andrea Ciceri"; - email = "andrea.ciceri@autistici.org"; - }; -in -{ - programs.git = { - enable = true; - package = pkgs.gitAndTools.gitFull; - - extraConfig = { - ui.color = true; - pull.rebase = false; - rebase.autostash = true; - }; - - userName = config.name; - userEmail = config.email; - signing = { - signByDefault = true; - key = config.email; - }; - - extraConfig = { - url = if pkgs.stdenv.hostPlatform.isDarwin then { } else { - "ssh://git@github.com/" = { insteadOf = https://github.com/; }; - }; - }; - - }; -} diff --git a/users/profiles/gpg/default.nix b/users/profiles/gpg/default.nix deleted file mode 100644 index fd7e8fb..0000000 --- a/users/profiles/gpg/default.nix +++ /dev/null @@ -1,16 +0,0 @@ -{ pkgs, ... }: -{ - services.gpg-agent = { - enable = true; - enableSshSupport = true; - sshKeys = [ "CE2FD0D9BECBD8876811714925066CC257413416" ]; - extraConfig = '' - pinentry-program ${pkgs.pinentry-gtk2}/bin/pinentry-gtk-2 - ''; - }; - - programs.gpg = { - enable = true; - settings = { }; - }; -} diff --git a/users/profiles/gtk/default.nix b/users/profiles/gtk/default.nix deleted file mode 100644 index 4ba869d..0000000 --- a/users/profiles/gtk/default.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ pkgs, ... }: -{ - gtk = { - enable = true; - font.name = "DejaVu Sans"; - # broken - #theme = { - # name = "WhiteSur-dark-alt-blue"; - # package = pkgs.whitesur-gtk-theme; - #}; - iconTheme = { - name = "Adwaita"; - package = pkgs.gnome.adwaita-icon-theme; - }; - }; - # home.file.".icons/default" = { - # recursive = true; - # source = let - # drv = pkgs.stdenv.mkDerivation { - # name = "apple-cursor"; - # src = pkgs.fetchurl { - # url = "https://github.com/ful1e5/apple_cursor/releases/download/v1.2.0/macOSBigSur.tar.gz"; - # sha256 = "sha256-8QNd8EEf11MIBVUbgZy6U1ZnDIWj92EGQmKLR8Edqfw="; - # }; - # installPhase = '' - # mkdir -p $out - # mv * $out/ - # ''; - # }; - # in - # "${drv}/"; - # }; -} diff --git a/users/profiles/lorri/default.nix b/users/profiles/lorri/default.nix deleted file mode 100644 index a296bee..0000000 --- a/users/profiles/lorri/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - services.lorri = { - enable = true; - }; -} diff --git a/users/profiles/mails/default.nix b/users/profiles/mails/default.nix deleted file mode 100644 index 62bc13d..0000000 --- a/users/profiles/mails/default.nix +++ /dev/null @@ -1,87 +0,0 @@ -{ pkgs, lib, ... }: -let - maildir = "mail"; -in -{ - programs.msmtp.enable = true; # For sending emails - - # For fetching emails - accounts.email.maildirBasePath = maildir; - programs.mbsync = { - enable = true; - }; - - # For email browsing, tagging, and searching - programs.notmuch.enable = true; - - accounts.email.accounts = { - personal = { - realName = "Andrea Ciceri"; - address = "andrea.ciceri@autistici.org"; - primary = true; - flavor = "plain"; - passwordCommand = "pass show autistici/password"; - #gpg = { - # key = ""; - # signByDefault = true; - #}; - imap = - { - host = "mail.autistici.org"; - port = 993; - tls.enable = true; - }; - mbsync = { - enable = true; - create = "maildir"; - expunge = "both"; - }; - msmtp.enable = true; - notmuch.enable = true; - #signature = { - # text = '' - # ''; - # showSignature = "append"; - #}; - smtp = { - host = "smtp.autistici.org"; - port = 465; - tls.enable = true; - }; - userName = "andrea.ciceri@autistici.org"; - }; - }; - - systemd.user = - let - description = "Download mailboxes with mbsync and update notmuch db"; - in - { - services.mbsync-and-notmuch = - { - Unit = { - After = [ "network.target" ]; - Description = description; - }; - Service = { - Type = "simple"; - ExecStart = ''${pkgs.isync}/bin/mbsync -Va && ${pkgs.notmuch}/bin/notmuch new''; - }; - Install = { - WantedBy = [ "multi-user.target" ]; - }; - }; - timers.mbsync-and-notmuch = { - Unit = { - Description = "Timer to \"${description}\""; - }; - Timer = { - OnBootSec = "2m"; - OnUnitInactiveSec = "5m"; - }; - Install = { - WantedBy = [ "timers.target" ]; - }; - }; - }; -} diff --git a/users/profiles/mpv/default.nix b/users/profiles/mpv/default.nix deleted file mode 100644 index f296001..0000000 --- a/users/profiles/mpv/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - programs.mpv = { - enable = true; - config = { - hwdec = "rkmpp"; - }; - }; -} diff --git a/users/profiles/qmk/default.nix b/users/profiles/qmk/default.nix deleted file mode 100644 index 0d7250f..0000000 --- a/users/profiles/qmk/default.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ pkgs, ... }: with pkgs; { - - home.packages = [ - gnumake - #qmk - ]; - -} diff --git a/users/profiles/sway/default.nix b/users/profiles/sway/default.nix deleted file mode 100644 index c4785d7..0000000 --- a/users/profiles/sway/default.nix +++ /dev/null @@ -1,147 +0,0 @@ -{ pkgs, lib, ... }: -{ - home.packages = with pkgs; [ wl-clipboard fuzzel ]; - - wayland = { - windowManager.sway = - let - modifier = "Mod4"; - in - { - enable = true; - wrapperFeatures.gtk = true; - config = { - modifier = modifier; - menu = "${pkgs.bemenu}/bin/bemenu-run -b -m 1 -p 'λ'"; - output = - let - bg = "${./wallpaper.jpg} fill"; in - { - HDMI-A-2 = { - inherit bg; - }; - eDP-1 = { - inherit bg; - }; - }; - #fonts = [ "Font Awesome" "Fira Code" ]; - terminal = "footclient"; - bars = [ - { - command = "${pkgs.waybar}/bin/waybar"; - } - ]; - - startup = [ - { - command = "foot --server"; - always = true; - } - ]; - floating.criteria = [ - { title = "MetaMask Notification.*"; } - { title = "Volume Control"; } # pavucontrol - ]; - input = { - "*" = { - xkb_layout = "us"; - xkb_variant = "intl"; - }; - }; - keybindings = - let - screenshotScript = pkgs.writeShellScript "screenshot.sh" '' - filename="$HOME/shots/$(date --iso-8601=seconds).png" - coords="$(${pkgs.slurp}/bin/slurp)" - ${pkgs.grim}/bin/grim -t png -g "$coords" $filename - wl-copy -t image/png < $filename - ''; - in - lib.mkOptionDefault { - "${modifier}+x" = "exec emacsclient -c"; - "${modifier}+b" = "exec qutebrowser"; - "${modifier}+s" = "exec ${screenshotScript}"; - "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s +5%"; - "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl s 5%-"; - }; - }; - extraConfig = '' - bindsym ${modifier}+p move workspace to output right - #seat seat0 xcursor_theme "Adwaita" - ''; - xwayland = true; - systemdIntegration = true; - }; - }; - - programs.waybar = { - enable = true; - style = builtins.readFile ./style.css; - settings = [ - { - layer = "top"; - position = "top"; - height = 30; - - modules-left = [ - "sway/mode" - "sway/workspaces" - ]; - modules-center = [ "sway/window" ]; - modules-right = [ - "tray" - "network" - "cpu" - "memory" - "pulseaudio" - "clock" - "backlight" - "battery" - ]; - - modules = { - "sway/workspaces" = { - all-outputs = true; - disable-scroll-wraparound = true; - }; - - "sway/mode" = { tooltip = false; }; - - "sway/window" = { max_length = 50; }; - - pulseaudio = { - format = "vol {volume}%"; - on-click-middle = "${pkgs.sway}/bin/swaymsg exec \"${pkgs.pavucontrol}/bin/pavucontrol\""; - }; - - network = { - format-wifi = "{essid} {signalStrength}% {bandwidthUpBits} {bandwidthDownBits}"; - format-ethernet = "{ifname} eth {bandwidthUpBits} {bandwidthDownBits}"; - }; - - cpu = { - interval = 2; - format = "cpu {load}% {usage}%"; - }; - - memory.format = "mem {}%"; - - backlight = { - format = "nit {percent}%"; - on-scroll-up = "${pkgs.brightnessctl}/bin/brightnessctl s +5%"; - on-scroll-down = "${pkgs.brightnessctl}/bin/brightnessctl s 5%-"; - }; - - tray.spacing = 10; - - clock.format = "{:%a %b %d %H:%M}"; - - battery = { - format = "bat {}"; - }; - }; - - } - ]; - }; -} diff --git a/users/profiles/sway/style.css b/users/profiles/sway/style.css deleted file mode 100644 index 5e3bf32..0000000 --- a/users/profiles/sway/style.css +++ /dev/null @@ -1,63 +0,0 @@ -* { - border: none; - font-family: "Fira Code"; - font-weight: bold; - font-size: 9pt; - min-height: 0; -} - -window#waybar { - background-color: rgba(43, 48, 59, 0.5); - border-bottom: 3px solid rgba(100, 114, 125, 0.5); - color: #ffffff; - transition-property: background-color; - transition-duration: .5s; -} - -window .modules-right * { - margin: 0 1rem; -} - -window#waybar.hidden { - opacity: 0.2; -} - -#workspaces button { - padding: 0 5px; - background-color: transparent; - color: #ffffff; -} - -/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */ -#workspaces button:hover { - background: rgba(0, 0, 0, 0.2); -} - -#workspaces button.current_output { - border-bottom: 3px solid #64727D; -} - -#workspaces button.focused { - background-color: #64727D; -} - -#workspaces button.focused.current_output { - border-bottom: 3px solid #ffffff; -} - -#workspaces button.urgent { - background-color: #eb4d4b; -} - - - -@keyframes blink { - to { - background-color: #ffffff; - color: #000000; - } -} - -label:focus { - background-color: #000000; -} diff --git a/users/profiles/sway/wallpaper.jpg b/users/profiles/sway/wallpaper.jpg deleted file mode 100644 index d18810f..0000000 Binary files a/users/profiles/sway/wallpaper.jpg and /dev/null differ diff --git a/users/profiles/tmux/default.nix b/users/profiles/tmux/default.nix deleted file mode 100644 index 401295e..0000000 --- a/users/profiles/tmux/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - programs.tmux = { - enable = true; - extraConfig = '' - # loud or quiet? - set -g visual-activity off - set -g visual-bell off - set -g visual-silence off - setw -g monitor-activity off - set -g bell-action none - - # modes - setw -g clock-mode-colour colour5 - setw -g mode-style 'fg=colour1 bg=colour18 bold' - - # panes - set -g pane-border-style 'fg=colour19 bg=colour0' - set -g pane-active-border-style 'bg=colour0 fg=colour9' - - # statusbar - set -g status-position bottom - set -g status-justify left - set -g status-style 'bg=colour18 fg=colour137 dim' - set -g status-left "" - set -g status-right '#[fg=colour233,bg=colour19] %d/%m #[fg=colour233,bg=colour8] %H:%M:%S ' - set -g status-right-length 50 - set -g status-left-length 20 - - setw -g window-status-current-style 'fg=colour1 bg=colour19 bold' - setw -g window-status-current-format ' #I#[fg=colour249]:#[fg=colour255]#W#[fg=colour249]#F ' - - setw -g window-status-style 'fg=colour9 bg=colour18' - setw -g window-status-format ' #I#[fg=colour237]:#[fg=colour250]#W#[fg=colour244]#F ' - - setw -g window-status-bell-style 'fg=colour255 bg=colour1 bold' - - # messages - set -g message-style 'fg=colour232 bg=colour16 bold' - ''; - }; -} diff --git a/users/profiles/tor-browser/default.nix b/users/profiles/tor-browser/default.nix deleted file mode 100644 index 94ea836..0000000 --- a/users/profiles/tor-browser/default.nix +++ /dev/null @@ -1,3 +0,0 @@ -{ pkgs, ... }: { - #home.packages = [ pkgs.tor-browser-bundle-bin ]; # broken -} diff --git a/users/profiles/udiskie/default.nix b/users/profiles/udiskie/default.nix deleted file mode 100644 index 1f5043f..0000000 --- a/users/profiles/udiskie/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - services.udiskie = { - enable = true; - automount = true; - tray = "auto"; - }; -} diff --git a/users/profiles/vim/default.nix b/users/profiles/vim/default.nix deleted file mode 100644 index ad03155..0000000 --- a/users/profiles/vim/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.vim = { - enable = true; - }; -} diff --git a/users/profiles/vscode/default.nix b/users/profiles/vscode/default.nix deleted file mode 100644 index 4932c5c..0000000 --- a/users/profiles/vscode/default.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ pkgs, ... }: -{ - programs.vscode = { - enable = true; - - userSettings = { - "update.channel" = "none"; - "editor" = { - "formatOnSave" = true; - "fontFamily" = "Fira Code"; - "fontLigatures" = true; - }; - "window"."menuBarVisibility" = "classic"; - "[nix]"."editor.tabSize" = 2; - "nix"."enableLanguageServer" = true; - "github.copilot.enable" = { - "*" = true; - }; - }; - extensions = with pkgs.vscode-extensions; [ - eamodio.gitlens - jnoortheen.nix-ide - haskell.haskell - justusadam.language-haskell - #ms-python.python - ]; - }; - - home.packages = with pkgs; [ - gnome.gnome-keyring - stylish-haskell - ghc - ] ++ (if pkgs.system == "x86_64-linux" then [ - haskell-language-server - ] else [ ]); -} diff --git a/users/profiles/xdg/default.nix b/users/profiles/xdg/default.nix deleted file mode 100644 index 01378f7..0000000 --- a/users/profiles/xdg/default.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ pkgs, ... }: -{ - home.packages = [ pkgs.xdg-utils ]; - xdg = { - enable = true; - }; -} diff --git a/users/profiles/zathura/default.nix b/users/profiles/zathura/default.nix deleted file mode 100644 index b46dd3f..0000000 --- a/users/profiles/zathura/default.nix +++ /dev/null @@ -1,5 +0,0 @@ -{ - programs.zathura = { - enable = true; - }; -} diff --git a/users/root/default.nix b/users/root/default.nix deleted file mode 100644 index 2c440f5..0000000 --- a/users/root/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ pkgs, ... }: -# recommend using `hashedPassword` -{ - users.users.root = { - password = "nixos"; - shell = pkgs.zsh; - }; - - # FIXME: (temporary?) workaround for https://github.com/NixOS/nixpkgs/issues/169193 - home-manager.users.ccr.programs.git = { - enable = true; - extraConfig.safe.directory = "/home/ccr/fleet"; - }; - home-manager.users.root.programs.git = { - enable = true; - extraConfig.safe.directory = "/home/ccr/fleet"; - }; - -} diff --git a/utils/default.nix b/utils/default.nix new file mode 100644 index 0000000..f630352 --- /dev/null +++ b/utils/default.nix @@ -0,0 +1,106 @@ +{ + nixpkgsUnstable, + preCommitHooks, + homeManager, + doomEmacs, + agenix, + ... +}: let + supportedSystems = {x86_64-linux = "x86_64-linux";}; + + pkgsFor = lib.genAttrs (lib.attrValues supportedSystems) (system: nixpkgsUnstable.legacyPackages.${system}); + + lib = nixpkgsUnstable.lib.extend (self: super: { + perSystem = super.genAttrs (super.attrValues supportedSystems); + }); + + mkConfiguration = { + name, + system, + modules ? [], + }: + lib.nixosSystem { + inherit system; + modules = + [ + { + networking.hostName = lib.mkForce name; + } + (../hosts + "/${name}") + homeManager.nixosModule + agenix.nixosModule + { + home-manager.users.ccr.imports = [ + doomEmacs.hmModule + ]; + } + ] + ++ modules; + specialArgs = { + # The following paths (../modules and ../hmModules) are relative to the location + # where they are imported, *not* from here + fleetModules = moduleNames: builtins.map (moduleName: ../modules + "/${moduleName}") moduleNames; + fleetHmModules = moduleNames: builtins.map (moduleName: ../hmModules + "/${moduleName}") moduleNames; + }; + }; + + mkConfigurations = { + thinkpad = mkConfiguration { + name = "thinkpad"; + system = supportedSystems.x86_64-linux; + modules = []; + }; + }; + + mkVmApp = system: configuration: let + shellScript = pkgsFor.${system}.writeShellScript "run-vm" '' + #rm ${configuration.config.networking.hostName}.qcow2 + ${configuration.config.system.build.vm}/bin/run-${configuration.config.networking.hostName}-vm + ''; + in { + type = "app"; + program = "${shellScript}"; + }; + + mkVmApps = configurations: + lib.perSystem (system: + lib.genAttrs (lib.attrNames configurations) ( + configurationName: + mkVmApp system configurations.${configurationName} + )); + + formatApp = lib.perSystem ( + system: { + format = { + type = "app"; + program = "${pkgsFor.${system}.alejandra}/bin/alejandra"; + }; + } + ); + + checkFormatting = flakePath: + lib.perSystem ( + system: let + pkgs = pkgsFor.${system}; + in { + check-nix-formatting = pkgs.runCommand "check-nix-formatting" {buildInputs = [pkgs.alejandra];} "alejandra --check ${flakePath} > $out"; + } + ); + + checkFormattingHook = lib.perSystem ( + system: { + nix = preCommitHooks.lib.${system}.run { + src = ./.; + hooks.alejandra.enable = true; + }; + } + ); + + mkDevShell = lib.perSystem (system: { + default = pkgsFor.${system}.mkShell { + inherit (checkFormattingHook.${system}.nix) shellHook; + }; + }); +in { + inherit lib mkConfigurations mkVmApps supportedSystems formatApp mkDevShell checkFormatting; +}