From db49a78b625f61bd3477c3f35ddd6c95bbf57d76 Mon Sep 17 00:00:00 2001 From: Filipe Lima Date: Sun, 16 Feb 2025 12:09:28 -0300 Subject: [PATCH 1/7] refactor: remove devenvs module --- modules/devenvs/bun/.envrc | 5 -- modules/devenvs/bun/.gitignore | 1 - modules/devenvs/bun/flake.lock | 61 ----------------- modules/devenvs/bun/flake.nix | 26 -------- modules/devenvs/crystal/.envrc | 1 - modules/devenvs/crystal/.gitignore | 1 - modules/devenvs/crystal/flake.lock | 61 ----------------- modules/devenvs/crystal/flake.nix | 26 -------- modules/devenvs/electron/.envrc | 1 - modules/devenvs/electron/.gitignore | 1 - modules/devenvs/electron/flake.lock | 61 ----------------- modules/devenvs/electron/flake.nix | 27 -------- modules/devenvs/elixir/.envrc | 1 - modules/devenvs/elixir/.gitignore | 1 - modules/devenvs/elixir/flake.lock | 61 ----------------- modules/devenvs/elixir/flake.nix | 28 -------- modules/devenvs/git-hooks/.envrc | 7 -- modules/devenvs/git-hooks/.gitignore | 1 - modules/devenvs/git-hooks/flake.lock | 61 ----------------- modules/devenvs/git-hooks/flake.nix | 83 ----------------------- modules/devenvs/git-hooks/hooks.nix | 29 -------- modules/devenvs/go/.envrc | 4 -- modules/devenvs/go/.gitignore | 1 - modules/devenvs/go/flake.lock | 61 ----------------- modules/devenvs/go/flake.nix | 27 -------- modules/devenvs/nodejs/.envrc | 14 ---- modules/devenvs/nodejs/.gitignore | 1 - modules/devenvs/nodejs/flake.lock | 61 ----------------- modules/devenvs/nodejs/flake.nix | 29 -------- modules/devenvs/python/.envrc | 1 - modules/devenvs/python/.gitignore | 1 - modules/devenvs/python/flake.lock | 61 ----------------- modules/devenvs/python/flake.nix | 30 --------- modules/devenvs/qmk/.envrc | 1 - modules/devenvs/qmk/.gitignore | 2 - modules/devenvs/qmk/flake.lock | 98 ---------------------------- modules/devenvs/qmk/flake.nix | 61 ----------------- modules/devenvs/rust/.envrc | 1 - modules/devenvs/rust/.gitignore | 1 - modules/devenvs/rust/flake.lock | 96 --------------------------- modules/devenvs/rust/flake.nix | 42 ------------ modules/devenvs/work/.envrc | 14 ---- modules/devenvs/work/.gitignore | 1 - modules/devenvs/work/flake.lock | 61 ----------------- modules/devenvs/work/flake.nix | 33 ---------- 45 files changed, 1246 deletions(-) delete mode 100644 modules/devenvs/bun/.envrc delete mode 100644 modules/devenvs/bun/.gitignore delete mode 100644 modules/devenvs/bun/flake.lock delete mode 100644 modules/devenvs/bun/flake.nix delete mode 100644 modules/devenvs/crystal/.envrc delete mode 100644 modules/devenvs/crystal/.gitignore delete mode 100644 modules/devenvs/crystal/flake.lock delete mode 100644 modules/devenvs/crystal/flake.nix delete mode 100644 modules/devenvs/electron/.envrc delete mode 100644 modules/devenvs/electron/.gitignore delete mode 100644 modules/devenvs/electron/flake.lock delete mode 100644 modules/devenvs/electron/flake.nix delete mode 100644 modules/devenvs/elixir/.envrc delete mode 100644 modules/devenvs/elixir/.gitignore delete mode 100644 modules/devenvs/elixir/flake.lock delete mode 100644 modules/devenvs/elixir/flake.nix delete mode 100644 modules/devenvs/git-hooks/.envrc delete mode 100644 modules/devenvs/git-hooks/.gitignore delete mode 100644 modules/devenvs/git-hooks/flake.lock delete mode 100644 modules/devenvs/git-hooks/flake.nix delete mode 100644 modules/devenvs/git-hooks/hooks.nix delete mode 100644 modules/devenvs/go/.envrc delete mode 100644 modules/devenvs/go/.gitignore delete mode 100644 modules/devenvs/go/flake.lock delete mode 100644 modules/devenvs/go/flake.nix delete mode 100644 modules/devenvs/nodejs/.envrc delete mode 100644 modules/devenvs/nodejs/.gitignore delete mode 100644 modules/devenvs/nodejs/flake.lock delete mode 100644 modules/devenvs/nodejs/flake.nix delete mode 100644 modules/devenvs/python/.envrc delete mode 100644 modules/devenvs/python/.gitignore delete mode 100644 modules/devenvs/python/flake.lock delete mode 100644 modules/devenvs/python/flake.nix delete mode 100644 modules/devenvs/qmk/.envrc delete mode 100644 modules/devenvs/qmk/.gitignore delete mode 100644 modules/devenvs/qmk/flake.lock delete mode 100644 modules/devenvs/qmk/flake.nix delete mode 100644 modules/devenvs/rust/.envrc delete mode 100644 modules/devenvs/rust/.gitignore delete mode 100644 modules/devenvs/rust/flake.lock delete mode 100644 modules/devenvs/rust/flake.nix delete mode 100644 modules/devenvs/work/.envrc delete mode 100644 modules/devenvs/work/.gitignore delete mode 100644 modules/devenvs/work/flake.lock delete mode 100644 modules/devenvs/work/flake.nix diff --git a/modules/devenvs/bun/.envrc b/modules/devenvs/bun/.envrc deleted file mode 100644 index cf9409dd..00000000 --- a/modules/devenvs/bun/.envrc +++ /dev/null @@ -1,5 +0,0 @@ -use flake - -if ! test -d node_modules && test -f package.json && test -f bun.lockb; then - bun install -fi diff --git a/modules/devenvs/bun/.gitignore b/modules/devenvs/bun/.gitignore deleted file mode 100644 index 92b27930..00000000 --- a/modules/devenvs/bun/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.direnv diff --git a/modules/devenvs/bun/flake.lock b/modules/devenvs/bun/flake.lock deleted file mode 100644 index 4f7180d7..00000000 --- a/modules/devenvs/bun/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1720031269, - "narHash": "sha256-rwz8NJZV+387rnWpTYcXaRNvzUSnnF9aHONoJIYmiUQ=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "9f4128e00b0ae8ec65918efeba59db998750ead6", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/modules/devenvs/bun/flake.nix b/modules/devenvs/bun/flake.nix deleted file mode 100644 index af2f2e37..00000000 --- a/modules/devenvs/bun/flake.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - description = "dats bun shell"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs {inherit system;}; - inputs = with pkgs; [ - bun - ]; - in - with pkgs; { - devShells.default = mkShell { - name = "bun"; - packages = inputs; - }; - }); -} diff --git a/modules/devenvs/crystal/.envrc b/modules/devenvs/crystal/.envrc deleted file mode 100644 index 3550a30f..00000000 --- a/modules/devenvs/crystal/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake diff --git a/modules/devenvs/crystal/.gitignore b/modules/devenvs/crystal/.gitignore deleted file mode 100644 index 0334e266..00000000 --- a/modules/devenvs/crystal/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.direnv diff --git a/modules/devenvs/crystal/flake.lock b/modules/devenvs/crystal/flake.lock deleted file mode 100644 index b554cff1..00000000 --- a/modules/devenvs/crystal/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1706732774, - "narHash": "sha256-hqJlyJk4MRpcItGYMF+3uHe8HvxNETWvlGtLuVpqLU0=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "b8b232ae7b8b144397fdb12d20f592e5e7c1a64d", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/modules/devenvs/crystal/flake.nix b/modules/devenvs/crystal/flake.nix deleted file mode 100644 index e5431d80..00000000 --- a/modules/devenvs/crystal/flake.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - description = "dats crystal shell"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs {inherit system;}; - inputs = with pkgs; [ - crystal - ]; - in - with pkgs; { - devShells.default = mkShell { - name = "crystal"; - packages = inputs; - }; - }); -} diff --git a/modules/devenvs/electron/.envrc b/modules/devenvs/electron/.envrc deleted file mode 100644 index 3550a30f..00000000 --- a/modules/devenvs/electron/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake diff --git a/modules/devenvs/electron/.gitignore b/modules/devenvs/electron/.gitignore deleted file mode 100644 index 92b27930..00000000 --- a/modules/devenvs/electron/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.direnv diff --git a/modules/devenvs/electron/flake.lock b/modules/devenvs/electron/flake.lock deleted file mode 100644 index 11493fe2..00000000 --- a/modules/devenvs/electron/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1698924604, - "narHash": "sha256-GCFbkl2tj8fEZBZCw3Tc0AkGo0v+YrQlohhEGJ/X4s0=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "fa804edfb7869c9fb230e174182a8a1a7e512c40", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/modules/devenvs/electron/flake.nix b/modules/devenvs/electron/flake.nix deleted file mode 100644 index 0492ea2d..00000000 --- a/modules/devenvs/electron/flake.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - description = "dats electron shell"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs {inherit system;}; - - inputs = with pkgs; [ - electron - ]; - in - with pkgs; { - devShells.default = mkShell { - name = "electron"; - packages = inputs; - }; - }); -} diff --git a/modules/devenvs/elixir/.envrc b/modules/devenvs/elixir/.envrc deleted file mode 100644 index 3550a30f..00000000 --- a/modules/devenvs/elixir/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake diff --git a/modules/devenvs/elixir/.gitignore b/modules/devenvs/elixir/.gitignore deleted file mode 100644 index 92b27930..00000000 --- a/modules/devenvs/elixir/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.direnv diff --git a/modules/devenvs/elixir/flake.lock b/modules/devenvs/elixir/flake.lock deleted file mode 100644 index f2680c12..00000000 --- a/modules/devenvs/elixir/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1705133751, - "narHash": "sha256-rCIsyE80jgiOU78gCWN3A0wE0tR2GI5nH6MlS+HaaSQ=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "9b19f5e77dd906cb52dade0b7bd280339d2a1f3d", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/modules/devenvs/elixir/flake.nix b/modules/devenvs/elixir/flake.nix deleted file mode 100644 index 426d8e62..00000000 --- a/modules/devenvs/elixir/flake.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ - description = "dats elixir shell"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs {inherit system;}; - - inputs = with pkgs; [ - erlang - elixir - ]; - in - with pkgs; { - devShells.default = mkShell { - name = "elixir"; - packages = inputs; - }; - }); -} diff --git a/modules/devenvs/git-hooks/.envrc b/modules/devenvs/git-hooks/.envrc deleted file mode 100644 index ad52710b..00000000 --- a/modules/devenvs/git-hooks/.envrc +++ /dev/null @@ -1,7 +0,0 @@ -use flake - -if ! grep -q lefthook.yml .git/info/exclude; then - echo " -lefthook.yml -" >> .git/info/exclude -fi diff --git a/modules/devenvs/git-hooks/.gitignore b/modules/devenvs/git-hooks/.gitignore deleted file mode 100644 index 92b27930..00000000 --- a/modules/devenvs/git-hooks/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.direnv diff --git a/modules/devenvs/git-hooks/flake.lock b/modules/devenvs/git-hooks/flake.lock deleted file mode 100644 index 9eadad2b..00000000 --- a/modules/devenvs/git-hooks/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1720542800, - "narHash": "sha256-ZgnNHuKV6h2+fQ5LuqnUaqZey1Lqqt5dTUAiAnqH0QQ=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "feb2849fdeb70028c70d73b848214b00d324a497", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/modules/devenvs/git-hooks/flake.nix b/modules/devenvs/git-hooks/flake.nix deleted file mode 100644 index 5afd9fed..00000000 --- a/modules/devenvs/git-hooks/flake.nix +++ /dev/null @@ -1,83 +0,0 @@ -{ - description = "dats git hooks shell"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs {inherit system;}; - inputs = with pkgs; [ - lefthook - ]; - hooksModule = import ./hooks.nix; - hooks = hooksModule.hooks; - transformHookToYaml = hook: let - name = hook.name; - runOn = hook.run-on; - command = hook.command; - in - if hook == {} - then "" - else '' - ${runOn}: - commands: - ${name}: - run: ${command} - ''; - getHook = name: let - filteredHooks = builtins.filter (hook: hook.name == name) hooks; - in - if builtins.length filteredHooks > 0 - then builtins.elemAt filteredHooks 0 - else {}; - installHook = pkgs.writeShellScriptBin "install-hook" '' - if [ "$#" -lt 1 ]; then - echo "Please provide at least one hook name" - exit 1 - fi - - gitRoot=$(git rev-parse --show-toplevel) - hookFile=$(mktemp) - - for hookName in "$@"; do - case "$hookName" in - "eslint") - echo "${transformHookToYaml (getHook "eslint")}" - ;; - "lint") - echo "${transformHookToYaml (getHook "lint")}" - ;; - "prettier") - echo "${transformHookToYaml (getHook "prettier")}" - ;; - "normalize-filenames") - echo "${transformHookToYaml (getHook "normalize-filenames")}" - ;; - "normalize-filenames-on-push") - echo "${transformHookToYaml (getHook "normalize-filenames-on-push")}" - ;; - *) - echo "Hook $hookName not found" - exit 1 - ;; - esac - done > $hookFile - - cp $hookFile $gitRoot/lefthook.yml - lefthook install - ''; - in - with pkgs; { - devShells.default = mkShell { - name = "git-hooks"; - packages = inputs ++ [installHook]; - }; - }); -} diff --git a/modules/devenvs/git-hooks/hooks.nix b/modules/devenvs/git-hooks/hooks.nix deleted file mode 100644 index 3508f58f..00000000 --- a/modules/devenvs/git-hooks/hooks.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - hooks = [ - { - name = "eslint"; - run-on = "pre-push"; - command = "npx eslint --max-warnings=0 {staged_files}"; - } - { - name = "lint"; - run-on = "pre-push"; - command = "npm run lint {staged_files}"; - } - { - name = "prettier"; - run-on = "pre-push"; - command = "npx prettier -c {staged_files}"; - } - { - name = "normalize-filenames"; - run-on = "pre-commit"; - command = "normalize-filenames {staged_files}"; - } - { - name = "normalize-filenames-on-push"; - run-on = "pre-push"; - command = "normalize-filenames"; - } - ]; -} diff --git a/modules/devenvs/go/.envrc b/modules/devenvs/go/.envrc deleted file mode 100644 index ce04694a..00000000 --- a/modules/devenvs/go/.envrc +++ /dev/null @@ -1,4 +0,0 @@ -use flake - -export GOPATH=$HOME/.local/share/go/pkgs -export PATH=$PATH:$GOPATH/bin diff --git a/modules/devenvs/go/.gitignore b/modules/devenvs/go/.gitignore deleted file mode 100644 index 0334e266..00000000 --- a/modules/devenvs/go/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.direnv diff --git a/modules/devenvs/go/flake.lock b/modules/devenvs/go/flake.lock deleted file mode 100644 index 26e934f8..00000000 --- a/modules/devenvs/go/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1717602782, - "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/modules/devenvs/go/flake.nix b/modules/devenvs/go/flake.nix deleted file mode 100644 index d4008120..00000000 --- a/modules/devenvs/go/flake.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ - description = "dats go shell"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs {inherit system;}; - - inputs = with pkgs; [ - go - ]; - in - with pkgs; { - devShells.default = mkShell { - name = "go"; - packages = inputs; - }; - }); -} diff --git a/modules/devenvs/nodejs/.envrc b/modules/devenvs/nodejs/.envrc deleted file mode 100644 index 67a50e5c..00000000 --- a/modules/devenvs/nodejs/.envrc +++ /dev/null @@ -1,14 +0,0 @@ -use flake - -if ! test -d node_modules && test -f package.json; then - if test -f package-lock.json; then - npm install - elif test -f yarn.lock; then - yarn - elif test -f pnpm-lock.yaml; then - pnpm i - fi -fi - -export PNPM_HOME=$HOME/.local/share/pnpm -export PATH=$PNPM_HOME:$PATH diff --git a/modules/devenvs/nodejs/.gitignore b/modules/devenvs/nodejs/.gitignore deleted file mode 100644 index 0334e266..00000000 --- a/modules/devenvs/nodejs/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.direnv diff --git a/modules/devenvs/nodejs/flake.lock b/modules/devenvs/nodejs/flake.lock deleted file mode 100644 index 26e934f8..00000000 --- a/modules/devenvs/nodejs/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1717602782, - "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/modules/devenvs/nodejs/flake.nix b/modules/devenvs/nodejs/flake.nix deleted file mode 100644 index c911360b..00000000 --- a/modules/devenvs/nodejs/flake.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - description = "dats nodejs shell"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs {inherit system;}; - - inputs = with pkgs; [ - nodejs_latest - nodejs_latest.pkgs.pnpm - nodejs_latest.pkgs.yarn - ]; - in - with pkgs; { - devShells.default = mkShell { - name = "nodejs"; - packages = inputs; - }; - }); -} diff --git a/modules/devenvs/python/.envrc b/modules/devenvs/python/.envrc deleted file mode 100644 index 3550a30f..00000000 --- a/modules/devenvs/python/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake diff --git a/modules/devenvs/python/.gitignore b/modules/devenvs/python/.gitignore deleted file mode 100644 index 92b27930..00000000 --- a/modules/devenvs/python/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.direnv diff --git a/modules/devenvs/python/flake.lock b/modules/devenvs/python/flake.lock deleted file mode 100644 index 26e934f8..00000000 --- a/modules/devenvs/python/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1717602782, - "narHash": "sha256-pL9jeus5QpX5R+9rsp3hhZ+uplVHscNJh8n8VpqscM0=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "e8057b67ebf307f01bdcc8fba94d94f75039d1f6", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/modules/devenvs/python/flake.nix b/modules/devenvs/python/flake.nix deleted file mode 100644 index 8f8a5e91..00000000 --- a/modules/devenvs/python/flake.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ - description = "dats python shell"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs {inherit system;}; - - inputs = with pkgs; [ - python3 - python3Packages.virtualenv - python3Packages.pip - python3Packages.setuptools - ]; - in - with pkgs; { - devShells.default = mkShell { - name = "python"; - packages = inputs; - }; - }); -} diff --git a/modules/devenvs/qmk/.envrc b/modules/devenvs/qmk/.envrc deleted file mode 100644 index 3550a30f..00000000 --- a/modules/devenvs/qmk/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake diff --git a/modules/devenvs/qmk/.gitignore b/modules/devenvs/qmk/.gitignore deleted file mode 100644 index a8e96583..00000000 --- a/modules/devenvs/qmk/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.direnv -build diff --git a/modules/devenvs/qmk/flake.lock b/modules/devenvs/qmk/flake.lock deleted file mode 100644 index dc64cc8d..00000000 --- a/modules/devenvs/qmk/flake.lock +++ /dev/null @@ -1,98 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1731533236, - "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixos-unstable": { - "locked": { - "lastModified": 1735834308, - "narHash": "sha256-dklw3AXr3OGO4/XT1Tu3Xz9n/we8GctZZ75ZWVqAVhk=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "6df24922a1400241dae323af55f30e4318a6ca65", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1704290814, - "narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixos-unstable": "nixos-unstable", - "nixpkgs": "nixpkgs", - "vial-qmk": "vial-qmk" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "vial-qmk": { - "flake": false, - "locked": { - "lastModified": 1734862643, - "narHash": "sha256-3W/NKn2qidnqjXnSo4MD3hMarrZ7XSV9KrDDQwHDz5M=", - "ref": "vial", - "rev": "7137da7951b6a1f06ce8435558c593c251b783b7", - "revCount": 28798, - "submodules": true, - "type": "git", - "url": "https://github.com/vial-kb/vial-qmk.git" - }, - "original": { - "ref": "vial", - "submodules": true, - "type": "git", - "url": "https://github.com/vial-kb/vial-qmk.git" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/modules/devenvs/qmk/flake.nix b/modules/devenvs/qmk/flake.nix deleted file mode 100644 index 44d6af65..00000000 --- a/modules/devenvs/qmk/flake.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ - description = "Flake para construir firmware vial-qmk"; - - inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; - inputs.nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; - - inputs.vial-qmk = { - url = "git+https://github.com/vial-kb/vial-qmk.git?submodules=1&ref=vial"; - flake = false; - }; - - inputs.flake-utils.url = "github:numtide/flake-utils"; - - outputs = { - self, - nixpkgs, - nixos-unstable, - vial-qmk, - flake-utils, - }: - flake-utils.lib.eachSystem ["x86_64-linux"] ( - system: let - pkgs = import nixpkgs { - inherit system; - overlays = [ - (final: prev: { - unstable = nixos-unstable.legacyPackages."${prev.system}"; - }) - - (final: prev: { - python3 = final.python310; - python3Packages = final.python310.pkgs; - }) - ]; - }; - - VIAL_QMK_DIR = "${vial-qmk}"; - KEYBOARD = "lily58"; - KEYMAP = "vial"; - CONTROLLER = "promicro_rp2040"; - - build = pkgs.writeShellScriptBin "build" '' - make -C ${VIAL_QMK_DIR} BUILD_DIR=`pwd`/build COPY=echo -j8 ${KEYBOARD}:${KEYMAP} CONVERT_TO=${CONTROLLER} - ''; - flash = pkgs.writeShellScriptBin "flash" '' - make -C ${VIAL_QMK_DIR} BUILD_DIR=`pwd`/build COPY=echo -j8 ${KEYBOARD}:${KEYMAP}:flash CONVERT_TO=${CONTROLLER} - ''; - in { - devShell = pkgs.mkShell { - name = "qmk-shell"; - env = { - VIAL_QMK_DIR = VIAL_QMK_DIR; - KEYBOARD = KEYBOARD; - KEYMAP = KEYMAP; - CONTROLLER = CONTROLLER; - }; - packages = [build flash pkgs.qmk pkgs.unstable.vial]; - }; - } - ); -} diff --git a/modules/devenvs/rust/.envrc b/modules/devenvs/rust/.envrc deleted file mode 100644 index 3550a30f..00000000 --- a/modules/devenvs/rust/.envrc +++ /dev/null @@ -1 +0,0 @@ -use flake diff --git a/modules/devenvs/rust/.gitignore b/modules/devenvs/rust/.gitignore deleted file mode 100644 index 0334e266..00000000 --- a/modules/devenvs/rust/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.direnv diff --git a/modules/devenvs/rust/flake.lock b/modules/devenvs/rust/flake.lock deleted file mode 100644 index 0e73093e..00000000 --- a/modules/devenvs/rust/flake.lock +++ /dev/null @@ -1,96 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1720418205, - "narHash": "sha256-cPJoFPXU44GlhWg4pUk9oUPqurPlCFZ11ZQPk21GTPU=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "655a58a72a6601292512670343087c2d75d859c1", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1718428119, - "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - } - }, - "rust-overlay": { - "inputs": { - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1720577957, - "narHash": "sha256-RZuzLdB/8FaXaSzEoWLg3au/mtbuH7MGn2LmXUKT62g=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "a434177dfcc53bf8f1f348a3c39bfb336d760286", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/modules/devenvs/rust/flake.nix b/modules/devenvs/rust/flake.nix deleted file mode 100644 index 6f18be01..00000000 --- a/modules/devenvs/rust/flake.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ - description = "dats rust shell"; - - inputs = { - nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - rust-overlay.url = "github:oxalica/rust-overlay"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - rust-overlay, - flake-utils, - ... - }: - flake-utils.lib.eachDefaultSystem ( - system: let - overlays = [(import rust-overlay)]; - pkgs = import nixpkgs { - inherit system overlays; - }; - in { - devShells.default = with pkgs; - mkShell { - packages = [ - pkg-config - openssl - ]; - env = { - PKG_CONFIG_PATH = "${openssl.dev.outPath}/lib/pkgconfig:" + "$PKG_CONFIG_PATH"; - }; - buildInputs = [ - (rust-bin.beta.latest.default.override { - extensions = ["rust-src"]; - targets = ["wasm32-wasi"]; - }) - ]; - }; - } - ); -} diff --git a/modules/devenvs/work/.envrc b/modules/devenvs/work/.envrc deleted file mode 100644 index 67a50e5c..00000000 --- a/modules/devenvs/work/.envrc +++ /dev/null @@ -1,14 +0,0 @@ -use flake - -if ! test -d node_modules && test -f package.json; then - if test -f package-lock.json; then - npm install - elif test -f yarn.lock; then - yarn - elif test -f pnpm-lock.yaml; then - pnpm i - fi -fi - -export PNPM_HOME=$HOME/.local/share/pnpm -export PATH=$PNPM_HOME:$PATH diff --git a/modules/devenvs/work/.gitignore b/modules/devenvs/work/.gitignore deleted file mode 100644 index 0334e266..00000000 --- a/modules/devenvs/work/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.direnv diff --git a/modules/devenvs/work/flake.lock b/modules/devenvs/work/flake.lock deleted file mode 100644 index 11493fe2..00000000 --- a/modules/devenvs/work/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1698924604, - "narHash": "sha256-GCFbkl2tj8fEZBZCw3Tc0AkGo0v+YrQlohhEGJ/X4s0=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "fa804edfb7869c9fb230e174182a8a1a7e512c40", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/modules/devenvs/work/flake.nix b/modules/devenvs/work/flake.nix deleted file mode 100644 index 522e65fc..00000000 --- a/modules/devenvs/work/flake.nix +++ /dev/null @@ -1,33 +0,0 @@ -{ - description = "dats nodejs shell"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem (system: let - pkgs = import nixpkgs {inherit system;}; - - inputs = with pkgs; [ - nodejs_20 - nodejs_20.pkgs.pnpm - nodejs_20.pkgs.yarn - libuuid - ]; - in - with pkgs; { - devShells.default = mkShell { - name = "nodejs"; - packages = inputs; - env = { - LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [pkgs.libuuid]; - }; - }; - }); -} From 46bcfc26d048de4a00aa03246edf06838d0fcd0c Mon Sep 17 00:00:00 2001 From: Filipe Lima Date: Sun, 16 Feb 2025 12:13:56 -0300 Subject: [PATCH 2/7] feat: add bluetooth and ollama modules --- modules/nixos/desktop/bluetooth.nix | 16 ++++++++++++++++ modules/nixos/desktop/ollama.nix | 17 +++++++++++++++++ outputs/x86_64-linux/src/dtsf-pc.nix | 2 ++ 3 files changed, 35 insertions(+) create mode 100644 modules/nixos/desktop/bluetooth.nix create mode 100644 modules/nixos/desktop/ollama.nix diff --git a/modules/nixos/desktop/bluetooth.nix b/modules/nixos/desktop/bluetooth.nix new file mode 100644 index 00000000..b042b79c --- /dev/null +++ b/modules/nixos/desktop/bluetooth.nix @@ -0,0 +1,16 @@ +{ + pkgs, + lib, + config, + ... +}: +with lib; { + options.modules.desktop.bluetooth = { + enable = mkEnableOption "Bluetooth support"; + }; + + config = mkIf config.modules.desktop.bluetooth.enable { + hardware.bluetooth.enable = true; + environment.systemPackages = with pkgs; [blueberry]; + }; +} diff --git a/modules/nixos/desktop/ollama.nix b/modules/nixos/desktop/ollama.nix new file mode 100644 index 00000000..1893a933 --- /dev/null +++ b/modules/nixos/desktop/ollama.nix @@ -0,0 +1,17 @@ +{ + config, + lib, + ... +}: +with lib; { + options.modules.desktop.ollama = { + enable = mkEnableOption "Ollama"; + }; + + config = mkIf config.modules.desktop.ollama.enable { + services.ollama = { + enable = true; + acceleration = lib.mkIf config.modules.desktop.nvidia.enable "cuda"; + }; + }; +} diff --git a/outputs/x86_64-linux/src/dtsf-pc.nix b/outputs/x86_64-linux/src/dtsf-pc.nix index 7053594c..3bead6af 100644 --- a/outputs/x86_64-linux/src/dtsf-pc.nix +++ b/outputs/x86_64-linux/src/dtsf-pc.nix @@ -39,7 +39,9 @@ modules.desktop.wayland.enable = true; modules.desktop.wallpaper.enable = true; modules.desktop.nvidia.enable = true; + modules.desktop.ollama.enable = false; modules.ssh-key-manager.enable = true; + modules.desktop.bluetooth.enable = false; } ] ++ base-modules.nixos-modules; From 64d128b890adf21eb2c8c912cca615ed24f0cf6a Mon Sep 17 00:00:00 2001 From: Filipe Lima Date: Sun, 16 Feb 2025 12:14:21 -0300 Subject: [PATCH 3/7] feat: general updates to nvidia module --- modules/nixos/desktop/nvidia.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/nixos/desktop/nvidia.nix b/modules/nixos/desktop/nvidia.nix index 32c3b338..290b5de9 100644 --- a/modules/nixos/desktop/nvidia.nix +++ b/modules/nixos/desktop/nvidia.nix @@ -28,12 +28,17 @@ with lib; { ]; services.xserver.videoDrivers = ["nvidia"]; hardware.nvidia = { - package = config.boot.kernelPackages.nvidiaPackages.latest; + package = config.boot.kernelPackages.nvidiaPackages.beta; modesetting.enable = true; powerManagement.enable = true; - forceFullCompositionPipeline = false; + forceFullCompositionPipeline = true; nvidiaSettings = true; open = false; }; + + hardware.graphics = { + enable = true; + enable32Bit = true; + }; }; } From 398ae9f2449d2a30a82658a944f3be94617236bb Mon Sep 17 00:00:00 2001 From: Filipe Lima Date: Sun, 16 Feb 2025 12:14:46 -0300 Subject: [PATCH 4/7] refactor: remove global ignore from git config --- home/base/core/git/default.nix | 6 ------ 1 file changed, 6 deletions(-) diff --git a/home/base/core/git/default.nix b/home/base/core/git/default.nix index 4820a73a..4d1082f4 100644 --- a/home/base/core/git/default.nix +++ b/home/base/core/git/default.nix @@ -19,12 +19,6 @@ } ]; - ignores = [ - ".trash" - ".Trash" - ".Trash-1000" - ]; - extraConfig = { core.editor = "nvim"; init.defaultBranch = "main"; From af665c95465346158893cb1271a1d6587b1926cc Mon Sep 17 00:00:00 2001 From: Filipe Lima Date: Sun, 16 Feb 2025 12:15:39 -0300 Subject: [PATCH 5/7] refactor: general updates --- hosts/dtsf-pc/boot.nix | 3 ++- hosts/dtsf-pc/default.nix | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hosts/dtsf-pc/boot.nix b/hosts/dtsf-pc/boot.nix index 2f5433b0..93f7cc2e 100644 --- a/hosts/dtsf-pc/boot.nix +++ b/hosts/dtsf-pc/boot.nix @@ -1,3 +1,4 @@ -{ +{pkgs, ...}: { boot.loader.systemd-boot.enable = true; + boot.kernelPackages = pkgs.linuxPackages_latest; } diff --git a/hosts/dtsf-pc/default.nix b/hosts/dtsf-pc/default.nix index 1a87644c..0e36709b 100644 --- a/hosts/dtsf-pc/default.nix +++ b/hosts/dtsf-pc/default.nix @@ -1,4 +1,4 @@ -{myvars, ...}: let +let hostName = "dtsf-pc"; in { imports = [ From c84afe85589b70cb08a3771778d94cb2fa7ed884 Mon Sep 17 00:00:00 2001 From: Filipe Lima Date: Sun, 16 Feb 2025 12:24:04 -0300 Subject: [PATCH 6/7] test: update scan paths test --- lib/spec.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/spec.nix b/lib/spec.nix index d9adc65b..7df94704 100644 --- a/lib/spec.nix +++ b/lib/spec.nix @@ -13,7 +13,6 @@ in { ../modules/base.nix ../modules/colorscheme ../modules/conf - ../modules/devenvs ../modules/nixos ../modules/nupkgs ../modules/secrets From d8f28b25b6f0f6d9778de5ba16b9ec443334f698 Mon Sep 17 00:00:00 2001 From: Filipe Lima Date: Sun, 16 Feb 2025 12:54:22 -0300 Subject: [PATCH 7/7] refactor: switch to i3 --- hosts/dtsf-pc/home/default.nix | 59 +++++++++++++++++----------- hosts/dtsf-pc/home/keymaps.nix | 14 ++++++- modules/nixos/desktop/graphics.nix | 8 ++-- modules/wallpaper/nixos.nix | 10 ----- outputs/x86_64-linux/src/dtsf-pc.nix | 8 ++-- 5 files changed, 56 insertions(+), 43 deletions(-) diff --git a/hosts/dtsf-pc/home/default.nix b/hosts/dtsf-pc/home/default.nix index 9d2c3d56..ac841463 100644 --- a/hosts/dtsf-pc/home/default.nix +++ b/hosts/dtsf-pc/home/default.nix @@ -1,33 +1,34 @@ { + config, pkgs, mypkgs, lib, ... -}: { - imports = [./packages.nix]; - - modules.desktop.colorscheme.theme = "gruvbox"; - - modules.desktop = { - sway = let - mod = "Mod4"; - alt = "Mod1"; - keymaps = import ./keymaps.nix {inherit mod alt pkgs lib;}; - command = str: always: { - command = str; - always = always; - }; - in { - settings = { +}: let + generate = wm: let + mod = "Mod4"; + alt = "Mod1"; + msgCmd = + if wm == "sway" + then "swaymsg" + else "i3-msg"; + keymaps = import ./keymaps.nix {inherit mod alt pkgs lib config;}; + command = str: always: { + command = str; + always = always; + }; + in { + settings = lib.mkMerge [ + { modifier = mod; focus.followMouse = false; keybindings = keymaps.allBindings; startup = [ (command "udiskie --tray --notify" false) - (command "swaymsg 'workspace 1'" false) + (command "${msgCmd} 'workspace 1'" false) (command "dunst -config $HOME/.config/dunstrc" false) - (command "systemctl --user restart wallpaper.service" true) + (lib.mkIf (wm == "sway") (command "systemctl --user start wallpaper.service" false)) ]; modes = { @@ -61,7 +62,9 @@ criteria = {title = "^win";}; } ]; + } + (lib.mkIf (wm == "sway") { input = { "1133:16500:Logitech_G305" = { accel_profile = "flat"; @@ -74,8 +77,17 @@ xkb_options = "compose:menu,level3:ralt_switch,grp:win_space_toggle"; }; }; - }; - }; + }) + ]; + }; +in { + imports = [./packages.nix]; + + modules.desktop.colorscheme.theme = "gruvbox"; + + modules.desktop = { + sway = generate "sway"; + i3 = generate "i3"; }; programs.ssh = { @@ -88,7 +100,8 @@ ''; }; - modules.desktop.nupkgs.packages = with mypkgs; [ - astal - ]; + modules.desktop.nupkgs.packages = with mypkgs; + lib.mkIf (config.modules.desktop.sway.enable) [ + astal + ]; } diff --git a/hosts/dtsf-pc/home/keymaps.nix b/hosts/dtsf-pc/home/keymaps.nix index 2516b390..6aaf9e0b 100644 --- a/hosts/dtsf-pc/home/keymaps.nix +++ b/hosts/dtsf-pc/home/keymaps.nix @@ -1,4 +1,5 @@ { + config, mod, alt, pkgs, @@ -8,11 +9,20 @@ mod = "Mod4"; alt = "Mod1"; print = "Print"; + msgCmd = + if config.modules.desktop.sway.enable + then "swaymsg" + else "i3-msg"; - exit = "-B 'leave' 'exec swaymsg exit && exec loginctl terminate-user $USER'"; + exit = "-B 'leave' 'exec ${msgCmd} exit && exec loginctl terminate-user $USER'"; turnoff = "-B 'shutdown' 'exec systemctl poweroff'"; reboot = "-B 'reboot' 'exec systemctl reboot'"; + nag = + if config.modules.desktop.sway.enable + then "swaynag" + else "i3-nagbar"; + workspaceBindings = builtins.listToAttrs ( (map (i: { name = "${mod}+${toString i}"; @@ -69,7 +79,7 @@ "${mod}+r" = "mode resize"; "${mod}+Shift+c" = "reload"; - "${mod}+Shift+e" = "exec \"swaynag -t warning -m 'leave, shutdown or reboot?' ${turnoff} ${reboot} ${exit}\""; + "${mod}+Shift+e" = "exec \"${nag} -t warning -m 'leave, shutdown or reboot?' ${turnoff} ${reboot} ${exit}\""; "XF86MonBrightnessUp" = "exec --no-startup-id brightnessctl set +5%"; "XF86MonBrightnessDown" = "exec --no-startup-id brightnessctl set 5%-"; diff --git a/modules/nixos/desktop/graphics.nix b/modules/nixos/desktop/graphics.nix index 382c5c5a..b5734a84 100644 --- a/modules/nixos/desktop/graphics.nix +++ b/modules/nixos/desktop/graphics.nix @@ -10,9 +10,9 @@ }; }; - # xdgOpenUsePortal = false; - # extraPortals = with pkgs; [ - # xdg-desktop-portal-gtk - # ]; + xdgOpenUsePortal = false; + extraPortals = with pkgs; [ + xdg-desktop-portal-gtk + ]; }; } diff --git a/modules/wallpaper/nixos.nix b/modules/wallpaper/nixos.nix index b6950d4f..c9696ac0 100644 --- a/modules/wallpaper/nixos.nix +++ b/modules/wallpaper/nixos.nix @@ -17,11 +17,6 @@ with lib; { systemd.user.services.link-wallpaper = { description = "Create wallpaper symlink"; after = [ - ( - if config.modules.desktop.wayland.enable - then "sway-session.target" - else "" - ) "graphical-session.target" ]; wantedBy = ["default.target"]; @@ -49,11 +44,6 @@ with lib; { description = "Set wallpaper"; after = [ "link-wallpaper.service" - ( - if config.modules.desktop.wayland.enable - then "sway-session.target" - else "" - ) "graphical-session.target" ]; wantedBy = ["default.target"]; diff --git a/outputs/x86_64-linux/src/dtsf-pc.nix b/outputs/x86_64-linux/src/dtsf-pc.nix index 3bead6af..2247cad4 100644 --- a/outputs/x86_64-linux/src/dtsf-pc.nix +++ b/outputs/x86_64-linux/src/dtsf-pc.nix @@ -36,11 +36,11 @@ nixos-modules = [ { - modules.desktop.wayland.enable = true; + modules.desktop.xorg.enable = true; modules.desktop.wallpaper.enable = true; modules.desktop.nvidia.enable = true; - modules.desktop.ollama.enable = false; modules.ssh-key-manager.enable = true; + modules.desktop.ollama.enable = false; modules.desktop.bluetooth.enable = false; } ] @@ -48,7 +48,7 @@ home-modules = [ { - modules.desktop.sway.enable = true; + modules.desktop.i3.enable = true; modules.desktop.nupkgs.enable = true; modules.desktop.conf = { enableDunstIntegration = true; @@ -60,7 +60,7 @@ enable = true; enableNeovimIntegration = true; enableGTKIntegration = true; - enableSwayIntegration = true; + enableI3Integration = true; enableI3StatusIntegration = false; enableDunstIntegration = true; enableAlacrittyIntegration = true;