diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..d202a33 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every week + interval: "weekly" diff --git a/.github/workflows/build-iso.yml b/.github/workflows/build-iso.yml new file mode 100644 index 0000000..ad6ee92 --- /dev/null +++ b/.github/workflows/build-iso.yml @@ -0,0 +1,80 @@ +name: Build πŸ—οΈ and Publish πŸ“€ + +on: + push: + tags: ['*'] + +jobs: + create-release: + name: Create Release + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Create release ${{ github.ref }} as a draft + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create "${{ github.ref }}" --draft --generate-notes + + build-console-iso: + needs: [create-release] + name: Console ISO + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v4 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - name: Build Console ISO + run: | + nix build .#nixosConfigurations.iso-console.config.system.build.isoImage + mkdir iso || true + ISO=$(head -n1 result/nix-support/hydra-build-products | cut -d'/' -f6) + sudo mv "result/iso/${ISO}" iso/console-${ISO} + sha256sum "iso/console-${ISO}" > "iso/console-${ISO}.sha256" + sed -i -r "s/ .*\/(.+)/ \1/g" "iso/console-${ISO}.sha256" + - name: Upload Console ISO + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + for artefact in "iso/"*; do + gh release upload "${{ github.ref }}" "${artefact}" --clobber + done + + build-desktop-iso: + needs: [create-release] + name: Desktop ISO + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v4 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - name: Build Desktop ISO + run: | + nix build .#nixosConfigurations.iso-desktop.config.system.build.isoImage + mkdir iso || true + ISO=$(head -n1 result/nix-support/hydra-build-products | cut -d'/' -f6) + sudo mv "result/iso/${ISO}" iso/desktop-${ISO} + sha256sum "iso/desktop-${ISO}" > "iso/desktop-${ISO}.sha256" + sed -i -r "s/ .*\/(.+)/ \1/g" "iso/desktop-${ISO}.sha256" + - name: Upload Desktop ISO + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + for artefact in "iso/"*; do + gh release upload "${{ github.ref }}" "${artefact}" --clobber + done + + publish-release: + name: Publish Release + needs: [build-console-iso, build-desktop-iso] + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Publish release ${{ github.ref }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + if [ "$(gh release view "${{ github.ref }}" --json assets --template '{{len .assets}}')" -lt 0 ]; then + exit 1 + fi + gh release edit "${{ github.ref }}" --draft=false diff --git a/.github/workflows/deadnix.yml b/.github/workflows/deadnix.yml new file mode 100644 index 0000000..ba62fd0 --- /dev/null +++ b/.github/workflows/deadnix.yml @@ -0,0 +1,16 @@ +name: Dead 😡 Nix ❄️ Analysis πŸ”οΈ + +on: + push: + branches: + - main + +jobs: + deadnix: + name: Dead Nix Analysis + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: DeterminateSystems/nix-installer-action@v4 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - uses: astro/deadnix-action@v1 diff --git a/.github/workflows/flake-checker.yml b/.github/workflows/flake-checker.yml new file mode 100644 index 0000000..a93d972 --- /dev/null +++ b/.github/workflows/flake-checker.yml @@ -0,0 +1,22 @@ +name: Flake ❄️ Checker βœ… + +on: + push: + branches: + - main + schedule: + # l33t o'clock + - cron: '37 13 * * *' + workflow_dispatch: + +jobs: + flake-checker: + name: Flake Checker + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: DeterminateSystems/nix-installer-action@v4 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - uses: DeterminateSystems/flake-checker-action@v5 diff --git a/.github/workflows/lock-updater.yml b/.github/workflows/lock-updater.yml new file mode 100644 index 0000000..efe1771 --- /dev/null +++ b/.github/workflows/lock-updater.yml @@ -0,0 +1,25 @@ +name: Flake ❄️ Lock πŸ”’οΈ Updater ✨ + +on: + schedule: + # Pi o'clock + - cron: '3 14 * * 1,5' + workflow_dispatch: + +jobs: + lock-updater: + name: Flake Lock Updater + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: DeterminateSystems/nix-installer-action@v4 + - uses: DeterminateSystems/magic-nix-cache-action@v2 + - uses: DeterminateSystems/update-flake-lock@v20 + with: + pr-title: "chore: update flake.lock" + # Labels to be set on the PR + pr-labels: | + dependencies + automated diff --git a/NOTES b/NOTES index 495ec44..96ce12b 100644 --- a/NOTES +++ b/NOTES @@ -21,6 +21,9 @@ * swap (see: https://discourse.nixos.org/t/how-do-i-set-up-a-swap-file/8323/7) * udevadm trigger +nh os switch --ask + + INSTALL: export device=/dev/nvme0n1 export hostname=floki @@ -93,25 +96,24 @@ clear; sudo nixos-rebuild dry-activate --flake .#${hostname} https://mt-caret.github.io/blog/posts/2020-06-29-optin-state.html https://hoverbear.org/blog/declarative-gnome-configuration-in-nixos/ - +https://github.com/wimpysworld/nix-config +https://github.com/Misterio77/nix-config +https://github.com/Misterio77/nix-starter-configs ------------------------------------------ +TODO: + +* agenix: alternative to sops/age for secrets + agenix.url = "github:ryantm/agenix"; + agenix.inputs.nixpkgs.follows = "nixpkgs"; +* "yet-another-nix-helper" https://github.com/viperML/nh +* declarative disk partitioning/formatting + https://github.com/nix-community/disko +* https://aria2.github.io/ +* https://github.com/schollz/croc + ------------------------------------------ +EXAMPLE COMMANDS: - -building the system configuration... -warning: Git tree '/home/gburd/ws/nix-config' is dirty -trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05 -trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05 -trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05 -would stop the following units: ModemManager.service, NetworkManager-wait-online.service, NetworkManager.service, accounts-daemon.service, alsa-store.service, audit.service, avahi-daemon.service, avahi-daemon.socket, bluetooth.service, bolt.service, colord.service, cpufreq.service, kmod-static-nodes.service, logrotate-checkconf.service, mount-pstore.service, network-local-commands.service, network-setup.service, nscd.service, power-profiles-daemon.service, resolvconf.service, rtkit-daemon.service, systemd-machined.service, systemd-modules-load.service, systemd-oomd.service, systemd-oomd.socket, systemd-sysctl.service, systemd-timesyncd.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-udevd.service, systemd-update-done.service, udisks2.service, upower.service, wpa_supplicant.service -would NOT stop the following changed units: display-manager.service, getty@tty1.service, systemd-backlight@backlight:intel_backlight.service, systemd-backlight@leds:tpacpi::kbd_backlight.service, systemd-fsck@dev-disk-by\x2duuid-3D04\x2d3716.service, systemd-journal-flush.service, systemd-logind.service, systemd-random-seed.service, systemd-remount-fs.service, systemd-update-utmp.service, systemd-user-sessions.service, user-runtime-dir@1000.service, user@1000.service -would activate the configuration... -sops-install-secrets: Imported /persist/etc/ssh/ssh_host_ed25519_key as age key with fingerprint age1z2x0g05q2erpux006vwhul70d8akj9avrj67s9p27fm4ce32ly8qt8nllz -warning: password file β€˜/run/secrets-for-users/gburd-password’ does not exist -would restart systemd -would reload the following units: dbus.service, firewall.service, persist.mount, reload-systemd-vconsole-setup.service -would restart the following units: nix-daemon.service, polkit.service, sshd.service, systemd-journald.service -would start the following units: ModemManager.service, NetworkManager-wait-online.service, NetworkManager.service, accounts-daemon.service, audit.service, avahi-daemon.socket, bluetooth.service, bolt.service, colord.service, cpufreq.service, kmod-static-nodes.service, logrotate-checkconf.service, mount-pstore.service, network-local-commands.service, network-setup.service, nscd.service, power-profiles-daemon.service, resolvconf.service, rtkit-daemon.service, systemd-machined.service, systemd-modules-load.service, systemd-oomd.socket, systemd-sysctl.service, systemd-timesyncd.service, systemd-udevd-control.socket, systemd-udevd-kernel.socket, systemd-update-done.service, udisks2.service, upower.service, wpa_supplicant.service - -[nix-shell:~/ws/nix-config]$ clear; sudo nixos-rebuild dry-activate --flake .#floki +* nh os switch --ask +* clear; sudo nixos-rebuild dry-activate --flake .#floki diff --git a/flake.lock b/flake.lock index 76eb940..8b73e18 100644 --- a/flake.lock +++ b/flake.lock @@ -1,90 +1,22 @@ { "nodes": { - "base16-schemes": { - "flake": false, - "locked": { - "lastModified": 1680729003, - "narHash": "sha256-M9LHTL24/W4oqgbYRkz0B2qpNrkefTs98pfj3MxIXnU=", - "owner": "tinted-theming", - "repo": "base16-schemes", - "rev": "dc048afa066287a719ddbab62b3e19e4b5110cf0", - "type": "github" - }, - "original": { - "owner": "tinted-theming", - "repo": "base16-schemes", - "type": "github" - } - }, - "blobs": { - "flake": false, - "locked": { - "lastModified": 1604995301, - "narHash": "sha256-wcLzgLec6SGJA8fx1OEN1yV/Py5b+U5iyYpksUY/yLw=", - "owner": "simple-nixos-mailserver", - "repo": "blobs", - "rev": "2cccdf1ca48316f2cfd1c9a0017e8de5a7156265", - "type": "gitlab" - }, - "original": { - "owner": "simple-nixos-mailserver", - "repo": "blobs", - "type": "gitlab" - } - }, - "composer2nix-src": { - "flake": false, - "locked": { - "lastModified": 1646178110, - "narHash": "sha256-P3acfGwHYjjZQcviPiOT7T7qzzP/drc2mibzrsrNP18=", - "owner": "svanderburg", - "repo": "composer2nix", - "rev": "299caca4aac42d7639a42eb4dde951c010f6e91c", - "type": "github" - }, - "original": { - "owner": "svanderburg", - "ref": "v0.0.6", - "repo": "composer2nix", - "type": "github" - } - }, - "firefly": { + "disko": { "inputs": { - "composer2nix-src": "composer2nix-src", - "firefly-iii-src": "firefly-iii-src", "nixpkgs": [ "nixpkgs" ] }, "locked": { - "lastModified": 1689496855, - "narHash": "sha256-eLgJaeURjdKuBjyhS97texllfmtjCOhtPo1IOPvRCzI=", - "owner": "timhae", - "repo": "firefly", - "rev": "73aba7e1e9bd61bef0f8f54294beb3528e436806", + "lastModified": 1695632260, + "narHash": "sha256-B8nW57UouYtiWMJKX5leByifMj+lYk7IyV5uz0c/ZwA=", + "owner": "nix-community", + "repo": "disko", + "rev": "a14a3fb0a8e465fcd728e398d00204a195be06a3", "type": "github" }, "original": { - "owner": "timhae", - "repo": "firefly", - "type": "github" - } - }, - "firefly-iii-src": { - "flake": false, - "locked": { - "lastModified": 1681548383, - "narHash": "sha256-ymWotU5wM6nQhsfnyAt+unewJ5D0tJpNK+UedSyfITU=", - "owner": "firefly-iii", - "repo": "firefly-iii", - "rev": "f878af0d3bbfe7b1a51bef758d4e2e9a66118316", - "type": "github" - }, - "original": { - "owner": "firefly-iii", - "ref": "v6.0.8", - "repo": "firefly-iii", + "owner": "nix-community", + "repo": "disko", "type": "github" } }, @@ -111,22 +43,6 @@ "type": "gitlab" } }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1668681692, - "narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=", - "owner": "edolstra", - "repo": "flake-compat", - "rev": "009399224d5e398d03b22badca40a37ac85412a1", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -160,18 +76,21 @@ "type": "github" } }, - "hardware": { + "flake-utils_2": { + "inputs": { + "systems": "systems" + }, "locked": { - "lastModified": 1694710316, - "narHash": "sha256-uRh46iIC86D8BD1wCDA5gRrt+hslUXiD0kx/UjnjBcs=", - "owner": "nixos", - "repo": "nixos-hardware", - "rev": "570256327eb6ca6f7bebe8d93af49459092a0c43", + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", "type": "github" }, "original": { - "owner": "nixos", - "repo": "nixos-hardware", + "owner": "numtide", + "repo": "flake-utils", "type": "github" } }, @@ -182,15 +101,16 @@ ] }, "locked": { - "lastModified": 1695191928, - "narHash": "sha256-yXUtJZQweg6v9G5fXStqkVNwxT4Xf+cux37yBVpaYCY=", + "lastModified": 1695108154, + "narHash": "sha256-gSg7UTVtls2yO9lKtP0yb66XBHT1Fx5qZSZbGMpSn2c=", "owner": "nix-community", "repo": "home-manager", - "rev": "0ed5f9786bba801c59fb53eef497438040acd471", + "rev": "07682fff75d41f18327a871088d20af2710d4744", "type": "github" }, "original": { "owner": "nix-community", + "ref": "release-23.05", "repo": "home-manager", "type": "github" } @@ -232,25 +152,6 @@ "type": "github" } }, - "nix-colors": { - "inputs": { - "base16-schemes": "base16-schemes", - "nixpkgs-lib": "nixpkgs-lib_2" - }, - "locked": { - "lastModified": 1682108218, - "narHash": "sha256-tMr7BbxualFQlN+XopS8rMMgf2XR9ZfRuwIZtjsWmfI=", - "owner": "misterio77", - "repo": "nix-colors", - "rev": "b92df8f5eb1fa20d8e09810c03c9dc0d94ef2820", - "type": "github" - }, - "original": { - "owner": "misterio77", - "repo": "nix-colors", - "type": "github" - } - }, "nix-filter": { "locked": { "lastModified": 1687178632, @@ -266,47 +167,56 @@ "type": "github" } }, - "nixos-mailserver": { + "nix-formatter-pack": { "inputs": { - "blobs": "blobs", - "flake-compat": "flake-compat", "nixpkgs": [ "nixpkgs" ], - "nixpkgs-22_11": [ - "nixpkgs" - ], - "nixpkgs-23_05": [ - "nixpkgs" - ], - "utils": "utils" + "nmd": "nmd", + "nmt": "nmt" }, "locked": { - "lastModified": 1689976554, - "narHash": "sha256-uWJq3sIhkqfzPmfB2RWd5XFVooGFfSuJH9ER/r302xQ=", - "owner": "simple-nixos-mailserver", - "repo": "nixos-mailserver", - "rev": "c63f6e7b053c18325194ff0e274dba44e8d2271e", - "type": "gitlab" + "lastModified": 1694984852, + "narHash": "sha256-A1x55uLb2LT9evsTWYc1U9+iki1AmE5ROxOuCKPf3JE=", + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "rev": "23795a4daf29ce784b3edc13b9776c7b445c453b", + "type": "github" }, "original": { - "owner": "simple-nixos-mailserver", - "repo": "nixos-mailserver", - "type": "gitlab" + "owner": "Gerschtli", + "repo": "nix-formatter-pack", + "type": "github" } }, - "nixpkgs": { + "nixos-hardware": { "locked": { - "lastModified": 1694959747, - "narHash": "sha256-CXQ2MuledDVlVM5dLC4pB41cFlBWxRw4tCBsFrq3cRk=", + "lastModified": 1695541019, + "narHash": "sha256-rs++zfk41K9ArWkDAlmBDlGlKO8qeRIRzdjo+9SmNFI=", "owner": "nixos", - "repo": "nixpkgs", - "rev": "970a59bd19eff3752ce552935687100c46e820a5", + "repo": "nixos-hardware", + "rev": "61283b30d11f27d5b76439d43f20d0c0c8ff5296", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-unstable", + "ref": "master", + "repo": "nixos-hardware", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1695559356, + "narHash": "sha256-kXZ1pUoImD9OEbPCwpTz4tHsNTr4CIyIfXb3ocuR8sI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "261abe8a44a7e8392598d038d2e01f7b33cf26d0", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-23.05", "repo": "nixpkgs", "type": "github" } @@ -329,33 +239,67 @@ "type": "github" } }, - "nixpkgs-lib_2": { + "nixpkgs-unstable": { "locked": { - "lastModified": 1680397293, - "narHash": "sha256-wBpJ73+tJ8fZSWb4tzNbAVahC4HSo2QG3nICDy4ExBQ=", - "owner": "nix-community", - "repo": "nixpkgs.lib", - "rev": "b18d328214ca3c627d3cc3f51fd9d1397fdbcd7a", + "lastModified": 1695360818, + "narHash": "sha256-JlkN3R/SSoMTa+CasbxS1gq+GpGxXQlNZRUh9+LIy/0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e35dcc04a3853da485a396bdd332217d0ac9054f", "type": "github" }, "original": { - "owner": "nix-community", - "repo": "nixpkgs.lib", + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", "type": "github" } }, + "nmd": { + "flake": false, + "locked": { + "lastModified": 1666190571, + "narHash": "sha256-Z1hc7M9X6L+H83o9vOprijpzhTfOBjd0KmUTnpHAVjA=", + "owner": "rycee", + "repo": "nmd", + "rev": "b75d312b4f33bd3294cd8ae5c2ca8c6da2afc169", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmd", + "type": "gitlab" + } + }, + "nmt": { + "flake": false, + "locked": { + "lastModified": 1648075362, + "narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=", + "owner": "rycee", + "repo": "nmt", + "rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae", + "type": "gitlab" + }, + "original": { + "owner": "rycee", + "repo": "nmt", + "type": "gitlab" + } + }, "root": { "inputs": { - "firefly": "firefly", + "disko": "disko", "firefox-addons": "firefox-addons", - "hardware": "hardware", "home-manager": "home-manager", "impermanence": "impermanence", "nh": "nh", - "nix-colors": "nix-colors", - "nixos-mailserver": "nixos-mailserver", + "nix-formatter-pack": "nix-formatter-pack", + "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", - "sops-nix": "sops-nix" + "nixpkgs-unstable": "nixpkgs-unstable", + "sops-nix": "sops-nix", + "vscode-server": "vscode-server" } }, "sops-nix": { @@ -381,18 +325,39 @@ "type": "github" } }, - "utils": { + "systems": { "locked": { - "lastModified": 1605370193, - "narHash": "sha256-YyMTf3URDL/otKdKgtoMChu4vfVL3vCMkRqpGifhUn0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "5021eac20303a61fafe17224c087f5519baed54d", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { - "owner": "numtide", - "repo": "flake-utils", + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "vscode-server": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1684517665, + "narHash": "sha256-SaAr66uCQ8CF75jIr23FZjk1+9Kfwm5sQnwV25206Gs=", + "owner": "nix-community", + "repo": "nixos-vscode-server", + "rev": "1e1358493df6529d4c7bc4cc3066f76fd16d4ae6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixos-vscode-server", "type": "github" } } diff --git a/flake.nix b/flake.nix index e68632a..7936ad0 100644 --- a/flake.nix +++ b/flake.nix @@ -1,109 +1,120 @@ { - description = "My (Greg Burd's) NixOS configuration"; + description = "Greg Burd's NixOS and Home Manager Configuration"; - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + # You can access packages and modules from different nixpkgs revs at the + # same time. See 'unstable-packages' overlay in 'overlays/default.nix'. + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + + disko.url = "github:nix-community/disko"; + disko.inputs.nixpkgs.follows = "nixpkgs"; + + home-manager.url = "github:nix-community/home-manager/release-23.05"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + nixos-hardware.url = "github:nixos/nixos-hardware/master"; - hardware.url = "github:nixos/nixos-hardware"; impermanence.url = "github:nix-community/impermanence"; - nix-colors.url = "github:misterio77/nix-colors"; - sops-nix = { - url = "github:mic92/sops-nix"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.nixpkgs-stable.follows = "nixpkgs"; - }; - home-manager = { - url = "github:nix-community/home-manager"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - nh = { - url = "github:viperml/nh"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - nixos-mailserver = { - url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; - inputs.nixpkgs.follows = "nixpkgs"; - inputs.nixpkgs-22_11.follows = "nixpkgs"; - inputs.nixpkgs-23_05.follows = "nixpkgs"; - }; - firefly = { - url = "github:timhae/firefly"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - firefox-addons = { - url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; - inputs.nixpkgs.follows = "nixpkgs"; - }; + nix-formatter-pack.url = "github:Gerschtli/nix-formatter-pack"; + nix-formatter-pack.inputs.nixpkgs.follows = "nixpkgs"; + + vscode-server.url = "github:nix-community/nixos-vscode-server"; + vscode-server.inputs.nixpkgs.follows = "nixpkgs"; + + sops-nix.url = "github:mic92/sops-nix"; + sops-nix.inputs.nixpkgs.follows = "nixpkgs"; + sops-nix.inputs.nixpkgs-stable.follows = "nixpkgs"; + + nh.url = "github:viperml/nh"; + nh.inputs.nixpkgs.follows = "nixpkgs"; + + firefox-addons.url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons"; + firefox-addons.inputs.nixpkgs.follows = "nixpkgs"; + }; - - outputs = { self, nixpkgs, home-manager, ... }@inputs: + outputs = + { self + , nixpkgs + , nix-formatter-pack + , ... + } @ inputs: let inherit (self) outputs; - lib = nixpkgs.lib // home-manager.lib; - systems = [ "x86_64-linux" "aarch64-linux" ]; - forEachSystem = f: lib.genAttrs systems (sys: f pkgsFor.${sys}); - pkgsFor = nixpkgs.legacyPackages; + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + stateVersion = "23.05"; + libx = import ./lib { inherit inputs outputs stateVersion; }; in { - inherit lib; + # home-manager switch -b backup --flake $HOME/ws/nix-config + # nix build .#homeConfigurations."gburd@floki".activationPackage + homeConfigurations = { + # .iso images + # --------------------------------------------------------------------- + + "gburd@iso-console" = libx.mkHome { hostname = "iso-console"; username = "nixos"; }; + "gburd@iso-desktop" = libx.mkHome { hostname = "iso-desktop"; username = "nixos"; desktop = "pantheon"; }; + + # Workstations + # --------------------------------------------------------------------- + + "gburd@floki" = libx.mkHome { hostname = "floki"; username = "gburd"; desktop = "pantheon"; }; + + # Servers + # --------------------------------------------------------------------- + }; + + nixosConfigurations = { + # .iso images + # --------------------------------------------------------------------- + + # - nix build .#nixosConfigurations.{iso-console|iso-desktop}.config.system.build.isoImage + iso-console = libx.mkHost { hostname = "iso-console"; username = "nixos"; installer = nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"; }; + iso-desktop = libx.mkHost { hostname = "iso-desktop"; username = "nixos"; installer = nixpkgs + "/nixos/modules/installer/cd-dvd/installation-cd-graphical-calamares.nix"; desktop = "pantheon"; }; + + # Workstations + # --------------------------------------------------------------------- + + # Lenovo Carbon X1 Extreme Gen 5 - x86_64 + floki = libx.mkHost { hostname = "floki"; username = "gburd"; desktop = "pantheon"; }; + + # Servers + # --------------------------------------------------------------------- + }; + + # Custom packages and modifications, exported as overlays + overlays = import ./overlays { inherit inputs outputs; }; + + hydraJobs = import ./hydra.nix { inherit inputs outputs; }; + + # Devshell for bootstrapping; acessible via 'nix develop' or 'nix-shell' (legacy) + devShells = libx.forAllSystems (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in import ./shell.nix { inherit pkgs; } + ); + + # nix fmt + formatter = libx.forAllSystems (system: + nix-formatter-pack.lib.mkFormatter { + pkgs = nixpkgs.legacyPackages.${system}; + config.tools = { + alejandra.enable = false; + deadnix.enable = true; + nixpkgs-fmt.enable = true; + statix.enable = true; + }; + } + ); + + # Custom packages; acessible via 'nix build', 'nix shell', etc + packages = libx.forAllSystems (system: + let pkgs = nixpkgs.legacyPackages.${system}; + in import ./pkgs { inherit pkgs; } + ); + nixosModules = import ./modules/nixos; homeManagerModules = import ./modules/home-manager; templates = import ./templates; - - overlays = import ./overlays { inherit inputs outputs; }; - hydraJobs = import ./hydra.nix { inherit inputs outputs; }; - - packages = forEachSystem (pkgs: import ./pkgs { inherit pkgs; }); - devShells = forEachSystem (pkgs: import ./shell.nix { inherit pkgs; }); - formatter = forEachSystem (pkgs: pkgs.nixpkgs-fmt); - - wallpapers = import ./home/gburd/wallpapers; - - nixosConfigurations = { - # Personal laptop - Lenovo Carbon X1 Extreme Gen 5 - x86_64 - floki = lib.nixosSystem { - modules = [ ./hosts/floki ]; - specialArgs = { inherit inputs outputs; }; - }; - - # Work laptop - MacBook Air macOS/nix - aarch64 - # ? = lib.nixosSystem { - # modules = [ ./hosts/? ]; - # specialArgs = { inherit inputs outputs; }; - # }; - - # Main desktop - Intel NUC Skull Canyon - x86_64 - # ? = lib.nixosSystem { - # modules = [ ./hosts/? ]; - # specialArgs = { inherit inputs outputs; }; - # }; - - # Core server (?) - # ? = lib.nixosSystem { - # modules = [ ./hosts/? ]; - # specialArgs = { inherit inputs outputs; }; - # }; - - # Build and game server (?) - # ? = lib.nixosSystem { - # modules = [ ./hosts/? ]; - # specialArgs = { inherit inputs outputs; }; - # }; - }; - - homeConfigurations = { - # Desktops - "gburd@floki" = lib.homeManagerConfiguration { - modules = [ ./home/gburd/floki.nix ]; - pkgs = pkgsFor.x86_64-linux; - extraSpecialArgs = { inherit inputs outputs; }; - }; - "gburd@generic" = lib.homeManagerConfiguration { - modules = [ ./home/gburd/generic.nix ]; - pkgs = pkgsFor.x86_64-linux; - extraSpecialArgs = { inherit inputs outputs; }; - }; - }; }; } diff --git a/home/_mixins/console/default.nix b/home/_mixins/console/default.nix new file mode 100644 index 0000000..5e692bb --- /dev/null +++ b/home/_mixins/console/default.nix @@ -0,0 +1,185 @@ +{ config, lib, pkgs, ... }: { + home = { + file = { + "${config.xdg.configHome}/neofetch/config.conf".text = builtins.readFile ./neofetch.conf; + }; + packages = with pkgs; [ + neofetch + ]; + sessionVariables = { + EDITOR = "micro"; + MANPAGER = "sh -c 'col --no-backspaces --spaces | bat --language man'"; + SYSTEMD_EDITOR = "micro"; + VISUAL = "micro"; + }; + }; + + programs = { + atuin = { + enable = true; + enableBashIntegration = true; + enableFishIntegration = true; + flags = [ + "--disable-up-arrow" + ]; + package = pkgs.unstable.atuin; + settings = { + auto_sync = true; + dialect = "uk"; + show_preview = true; + style = "compact"; + sync_frequency = "1h"; + sync_address = "https://api.atuin.sh"; + update_check = false; + }; + }; + bat = { + enable = true; + extraPackages = with pkgs.bat-extras; [ + batwatch + prettybat + ]; + }; + bottom = { + enable = true; + settings = { + colors = { + high_battery_color = "green"; + medium_battery_color = "yellow"; + low_battery_color = "red"; + }; + disk_filter = { + is_list_ignored = true; + list = [ "/dev/loop" ]; + regex = true; + case_sensitive = false; + whole_word = false; + }; + flags = { + dot_marker = false; + enable_gpu_memory = true; + group_processes = true; + hide_table_gap = true; + mem_as_value = true; + tree = true; + }; + }; + }; + dircolors = { + enable = true; + enableBashIntegration = true; + enableFishIntegration = true; + }; + direnv = { + enable = true; + enableBashIntegration = true; + nix-direnv = { + enable = true; + }; + }; + exa = { + enable = true; + enableAliases = true; + icons = true; + }; + fish = { + enable = true; + shellAliases = { + cat = "bat --paging=never --style=plain"; + htop = "btm --basic --tree --hide_table_gap --dot_marker --mem_as_value"; + ip = "ip --color --brief"; + less = "bat --paging=always"; + more = "bat --paging=always"; + top = "btm --basic --tree --hide_table_gap --dot_marker --mem_as_value"; + tree = "exa --tree"; + }; + }; + gh = { + enable = true; + extensions = with pkgs; [ gh-markdown-preview ]; + settings = { + editor = "micro"; + git_protocol = "ssh"; + prompt = "enabled"; + }; + }; + git = { + enable = true; + delta = { + enable = true; + options = { + features = "decorations"; + navigate = true; + side-by-side = true; + }; + }; + aliases = { + lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"; + }; + extraConfig = { + push = { + default = "matching"; + }; + pull = { + rebase = true; + }; + init = { + defaultBranch = "main"; + }; + }; + ignores = [ + "*.log" + "*.out" + ".DS_Store" + "bin/" + "dist/" + "result" + ]; + }; + gpg.enable = true; + home-manager.enable = true; + info.enable = true; + jq.enable = true; + micro = { + enable = true; + settings = { + colorscheme = "simple"; + diffgutter = true; + rmtrailingws = true; + savecursor = true; + saveundo = true; + scrollbar = true; + }; + }; + powerline-go = { + enable = true; + settings = { + cwd-max-depth = 5; + cwd-max-dir-size = 12; + max-width = 60; + }; + }; + }; + + services = { + gpg-agent = { + enable = true; + enableSshSupport = true; + pinentryFlavor = "curses"; + }; + }; + + # Nicely reload system units when changing configs + systemd.user.startServices = "sd-switch"; + + xdg = { + enable = true; + userDirs = { + enable = true; + createDirectories = lib.mkDefault true; + extraConfig = { + XDG_SCREENSHOTS_DIR = "${config.home.homeDirectory}/Pictures/Screenshots"; + }; + }; + }; +} diff --git a/home/_mixins/console/neofetch.conf b/home/_mixins/console/neofetch.conf new file mode 100644 index 0000000..02c5e78 --- /dev/null +++ b/home/_mixins/console/neofetch.conf @@ -0,0 +1,842 @@ +# Adapted from https://github.com/chick2d/neofetch-themes/blob/main/normal/acenoster.conf +# Originally made by https://github.com/HimDek/ (HimDek) +# Customization Wiki https://github.com/dylanaraps/neofetch/wiki/Customizing-Info + +print_info() { + info "${cl2} β•­β”€ο‹œ" distro + info "${cl2} β”œβ”€ο…Ό" kernel +# info "${cl2} β”œβ”€ο€‡" users + info "${cl2} β”œβ”€ο£–" packages + info "${cl2} ╰─" uptime + echo + info "${cl6} β•­β”€οŠ’" shell + info "${cl6} β”œβ”€ο‹" de + info "${cl6} β”œβ”€ο‹’" wm + info "${cl6} β”œβ”€ξˆ«" theme +# info "${cl6} β”œβ”€ο–ͺ" icons + info "${cl6} β”œβ”€ο€±" font + info "${cl6} β”œβ”€ο€±" term_font + info "${cl6} ╰─" term + echo + info "${cl4} ╭─" model + info "${cl4} β”œβ”€ο‘š" cpu + info "${cl4} β”œβ”€ο‹›" memory + info "${cl4} β”œβ”€ο‚  ${cl0}" disk +# info "${cl4} β”œβ”€ο•Έ ${cl0} " battery + info "${cl4} β”œβ”€ο‘Έ" gpu +# info "${cl4} β”œβ”€ο‚…" gpu_driver + info "${cl4} ╰─" resolution + + prin " " + prin "\n \n ${cl0}─${cl1}──${cl2}──${cl3}──${cl4}──${cl5}──${cl6}──${cl7}─ " +} + +##--------- Title + +# Hide/Show Fully qualified domain name. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --title_fqdn +title_fqdn="off" + + +##--------- Kernel + +# Shorten the output of the kernel function. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --kernel_shorthand +# Supports: Everything except *BSDs (except PacBSD and PC-BSD) +# +# Example: +# on: '4.8.9-1-ARCH' +# off: 'Linux 4.8.9-1-ARCH' +kernel_shorthand="on" + + +##--------- Distro + +# Shorten the output of the distro function +# +# Default: 'off' +# Values: 'on', 'tiny', 'off' +# Flag: --distro_shorthand +# Supports: Everything except Windows and Haiku +distro_shorthand="on" + +# Show/Hide OS Architecture. +# Show 'x86_64', 'x86' and etc in 'Distro:' output. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --os_arch +# +# Example: +# on: 'Arch Linux x86_64' +# off: 'Arch Linux' +os_arch="on" + +##--------- Uptime + +# Shorten the output of the uptime function +# +# Default: 'on' +# Values: 'on', 'tiny', 'off' +# Flag: --uptime_shorthand +# +# Example: +# on: '2 days, 10 hours, 3 mins' +# tiny: '2d 10h 3m' +# off: '2 days, 10 hours, 3 minutes' +uptime_shorthand="tiny" + +##--------- Memory + +# Show memory pecentage in output. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --memory_percent +# +# Example: +# on: '1801MiB / 7881MiB (22%)' +# off: '1801MiB / 7881MiB' +memory_percent="on" + +# Change memory output unit. +# +# Default: 'mib' +# Values: 'kib', 'mib', 'gib' +# Flag: --memory_unit +# +# Example: +# kib '1020928KiB / 7117824KiB' +# mib '1042MiB / 6951MiB' +# gib: ' 0.98GiB / 6.79GiB' +memory_unit="Gib" + +##--------- Packages + +# Show/Hide Package Manager names. +# +# Default: 'tiny' +# Values: 'on', 'tiny' 'off' +# Flag: --package_managers +# +# Example: +# on: '998 (pacman), 8 (flatpak), 4 (snap)' +# tiny: '908 (pacman, flatpak, snap)' +# off: '908' +package_managers="on" + +##--------- Shell + +# Show the path to $SHELL +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --shell_path +# +# Example: +# on: '/bin/bash' +# off: 'bash' +shell_path="off" + +# Show $SHELL version +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --shell_version +# +# Example: +# on: 'bash 4.4.5' +# off: 'bash' +shell_version="on" + +##--------- CPU + +# CPU speed type +# +# Default: 'bios_limit' +# Values: 'scaling_cur_freq', 'scaling_min_freq', 'scaling_max_freq', 'bios_limit'. +# Flag: --speed_type +# Supports: Linux with 'cpufreq' +# NOTE: Any file in '/sys/devices/system/cpu/cpu0/cpufreq' can be used as a value. +speed_type="scaling_max_freq" + +# CPU speed shorthand +# +# Default: 'off' +# Values: 'on', 'off'. +# Flag: --speed_shorthand +# NOTE: This flag is not supported in systems with CPU speed less than 1 GHz +# +# Example: +# on: 'i7-6500U (4) @ 3.1GHz' +# off: 'i7-6500U (4) @ 3.100GHz' +speed_shorthand="on" + +# Enable/Disable CPU brand in output. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --cpu_brand +# +# Example: +# on: 'Intel i7-6500U' +# off: 'i7-6500U (4)' +cpu_brand="on" + +# CPU Speed +# Hide/Show CPU speed. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --cpu_speed +# +# Example: +# on: 'Intel i7-6500U (4) @ 3.1GHz' +# off: 'Intel i7-6500U (4)' +cpu_speed="on" + +# CPU Cores +# Display CPU cores in output +# +# Default: 'logical' +# Values: 'logical', 'physical', 'off' +# Flag: --cpu_cores +# Support: 'physical' doesn't work on BSD. +# +# Example: +# logical: 'Intel i7-6500U (4) @ 3.1GHz' (All virtual cores) +# physical: 'Intel i7-6500U (2) @ 3.1GHz' (All physical cores) +# off: 'Intel i7-6500U @ 3.1GHz' +cpu_cores="logical" + +# CPU Temperature +# Hide/Show CPU temperature. +# Note the temperature is added to the regular CPU function. +# +# Default: 'off' +# Values: 'C', 'F', 'off' +# Flag: --cpu_temp +# Supports: Linux, BSD +# NOTE: For FreeBSD and NetBSD-based systems, you'll need to enable +# coretemp kernel module. This only supports newer Intel processors. +# +# Example: sudo rm /var/lib/pacman/db.lck +# C: 'Intel i7-6500U (4) @ 3.1GHz [27.2Β°C]' +# F: 'Intel i7-6500U (4) @ 3.1GHz [82.0Β°F]' +# off: 'Intel i7-6500U (4) @ 3.1GHz' +cpu_temp="on" + +##--------- GPU + +# Enable/Disable GPU Brand +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gpu_brand +# +# Example: +# on: 'AMD HD 7950' +# off: 'HD 7950' +gpu_brand="on" + +# Which GPU to display +# +# Default: 'all' +# Values: 'all', 'dedicated', 'integrated' +# Flag: --gpu_type +# Supports: Linux +# +# Example: +# all: +# GPU1: AMD HD 7950 +# GPU2: Intel Integrated Graphics +# +# dedicated: +# GPU1: AMD HD 7950 +# +# integrated: +# GPU1: Intel Integrated Graphics +gpu_type="all" + +##--------- Resolution + +# Display refresh rate next to each monitor +# Default: 'off' +# Values: 'on', 'off' +# Flag: --refresh_rate +# Supports: Doesn't work on Windows. +# +# Example: +# on: '1920x1080 @ 60Hz' +# off: '1920x1080' +refresh_rate="on" + +##--------- Gtk Theme / Icons / Font + +# Shorten output of GTK Theme / Icons / Font +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --gtk_shorthand +# +# Example: +# on: 'Numix, Adwaita' +# off: 'Numix [GTK2], Adwaita [GTK3]' +gtk_shorthand="on" + +# Enable/Disable gtk2 Theme / Icons / Font +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gtk2 +# +# Example: +# on: 'Numix [GTK2], Adwaita [GTK3]' +# off: 'Adwaita [GTK3]' +gtk2="off" + +# Enable/Disable gtk3 Theme / Icons / Font +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --gtk3 +# +# Example: +# on: 'Numix [GTK2], Adwaita [GTK3]' +# off: 'Numix [GTK2]' +gtk3="on" + +##--------- IP Address + +# Website to ping for the public IP +# +# Default: 'http://ident.me' +# Values: 'url' +# Flag: --ip_host +public_ip_host="http://ident.me" + +# Public IP timeout. +# +# Default: '2' +# Values: 'int' +# Flag: --ip_timeout +public_ip_timeout=2 + +# Desktop Environment + +# Show Desktop Environment version +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --de_version +de_version="on" + +##--------- Disk + +# Which disks to display. +# The values can be any /dev/sdXX, mount point or directory. +# NOTE: By default we only show the disk info for '/'. +# +# Default: '/' +# Values: '/', '/dev/sdXX', '/path/to/drive'. +# Flag: --disk_show +# +# Example: +# disk_show=('/' '/dev/sdb1'): +# 'Disk (/): 74G / 118G (66%)' +# 'Disk (/mnt/Videos): 823G / 893G (93%)' +# +# disk_show=('/'): +# 'Disk (/): 74G / 118G (66%)' +# +disk_show=('/' '/home') + +# Disk subtitle. +# What to append to the Disk subtitle. +# +# Default: 'mount' +# Values: 'mount', 'name', 'dir', 'none' +# Flag: --disk_subtitle +# +# Example: +# name: 'Disk (/dev/sda1): 74G / 118G (66%)' +# 'Disk (/dev/sdb2): 74G / 118G (66%)' +# +# mount: 'Disk (/): 74G / 118G (66%)' +# 'Disk (/mnt/Local Disk): 74G / 118G (66%)' +# 'Disk (/mnt/Videos): 74G / 118G (66%)' +# +# dir: 'Disk (/): 74G / 118G (66%)' +# 'Disk (Local Disk): 74G / 118G (66%)' +# 'Disk (Videos): 74G / 118G (66%)' +# +# none: 'Disk: 74G / 118G (66%)' +# 'Disk: 74G / 118G (66%)' +# 'Disk: 74G / 118G (66%)' +disk_subtitle="mount" + +# Disk percent. +# Show/Hide disk percent. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --disk_percent +# +# Example: +# on: 'Disk (/): 74G / 118G (66%)' +# off: 'Disk (/): 74G / 118G' +disk_percent="on" + + +##--------- Song + +# Manually specify a music player. +# +# Default: 'auto' +# Values: 'auto', 'player-name' +# Flag: --music_player +# +# Available values for 'player-name': +# +# amarok +# audacious +# banshee +# bluemindo +# clementine +# cmus +# deadbeef +# deepin-music +# dragon +# elisa +# exaile +# gnome-music +# gmusicbrowser +# gogglesmm +# guayadeque +# io.elementary.music +# iTunes +# juk +# lollypop +# mocp +# mopidy +# mpd +# muine +# netease-cloud-music +# olivia +# playerctl +# pogo +# pragha +# qmmp +# quodlibet +# rhythmbox +# sayonara +# smplayer +# spotify +# strawberry +# tauonmb +# tomahawk +# vlc +# xmms2d +# xnoise +# yarock +music_player="auto" + +# Format to display song information. +# +# Default: '%artist% - %album% - %title%' +# Values: '%artist%', '%album%', '%title%' +# Flag: --song_format +# +# Example: +# default: 'Song: Jet - Get Born - Sgt Major' +song_format="%artist% - %album% - %title%" + +# Print the Artist, Album and Title on separate lines +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --song_shorthand +# +# Example: +# on: 'Artist: The Fratellis' +# 'Album: Costello Music' +# 'Song: Chelsea Dagger' +# +# off: 'Song: The Fratellis - Costello Music - Chelsea Dagger' +song_shorthand="off" + +# 'mpc' arguments (specify a host, password etc). +# +# Default: '' +# Example: mpc_args=(-h HOST -P PASSWORD) +mpc_args=() + +##--------- Text Colors + +# Text Colors +# +# Default: 'distro' +# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' +# Flag: --colors +# +# Each number represents a different part of the text in +# this order: 'title', '@', 'underline', 'subtitle', 'colon', 'info' +# +# Example: +# colors=(distro) - Text is colored based on Distro colors. +# colors=(4 6 1 8 8 6) - Text is colored in the order above. +colors=(distro) + +##--------- Text Options + +# Toggle bold text +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --bold +bold="on" + +# Enable/Disable Underline +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --underline +underline_enabled="on" + +# Underline character +# +# Default: '-' +# Values: 'string' +# Flag: --underline_char +underline_char="ο‘³" + +# Info Separator +# Replace the default separator with the specified string. +# +# Default: ':' +# Flag: --separator +# +# Example: +# separator="->": 'Shell-> bash' +# separator=" =": 'WM = dwm' +separator=" " + +##--------- Color Blocks + +# Color block range +# The range of colors to print. +# +# Default: '0', '15' +# Values: 'num' +# Flag: --block_range +# +# Example: +# +# Display colors 0-7 in the blocks. (8 colors) +# neofetch --block_range 0 7 +# +# Display colors 0-15 in the blocks. (16 colors) +# neofetch --block_range 0 15 +#block_range=(8 15) +block_range=(1 8) + +# Colors for custom colorblocks +#colors +#bold="(tput bold)" +magenta="\033[1;35m" +green="\033[1;32m" +white="\033[1;37m" +blue="\033[1;34m" +red="\033[1;31m" +black="\033[1;40;30m" +yellow="\033[1;33m" +cyan="\033[1;36m" +reset="\033[0m" +bgyellow="\033[1;43;33m" +bgwhite="\033[1;47;37m" +cl0="${reset}" +cl1="${magenta}" +cl2="${green}" +cl3="${white}" +cl4="${blue}" +cl5="${red}" +cl6="${yellow}" +cl7="${cyan}" +cl8="${black}" +cl9="${bgyellow}" +cl10="${bgwhite}" + +# Toggle color blocks +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --color_blocks +color_blocks="on" + +# Color block width in spaces +# +# Default: '3' +# Values: 'num' +# Flag: --block_width +block_width=4 + +# Color block height in lines +# +# Default: '1' +# Values: 'num' +# Flag: --block_height +block_height=1 + +# Color Alignment +# +# Default: 'auto' +# Values: 'auto', 'num' +# Flag: --col_offset +# +# Number specifies how far from the left side of the terminal (in spaces) to +# begin printing the columns, in case you want to e.g. center them under your +# text. +# Example: +# col_offset="auto" - Default behavior of neofetch +# col_offset=7 - Leave 7 spaces then print the colors +col_offset="auto" + +##--------- Progress Bars + +# Bar characters +# +# Default: '-', '=' +# Values: 'string', 'string' +# Flag: --bar_char +# +# Example: +# neofetch --bar_char 'elapsed' 'total' +# neofetch --bar_char '-' '=' +bar_char_elapsed="-" +bar_char_total="=" + +# Toggle Bar border +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --bar_border +bar_border="on" + +# Progress bar length in spaces +# Number of chars long to make the progress bars. +# +# Default: '15' +# Values: 'num' +# Flag: --bar_length +bar_length=15 + +# Progress bar colors +# When set to distro, uses your distro's logo colors. +# +# Default: 'distro', 'distro' +# Values: 'distro', 'num' +# Flag: --bar_colors +# +# Example: +# neofetch --bar_colors 3 4 +# neofetch --bar_colors distro 5 +bar_color_elapsed="distro" +bar_color_total="distro" + +# Info display +# Display a bar with the info. +# +# Default: 'off' +# Values: 'bar', 'infobar', 'barinfo', 'off' +# Flags: --cpu_display +# --memory_display +# --battery_display +# --disk_display +# +# Example: +# bar: '[---=======]' +# infobar: 'info [---=======]' +# barinfo: '[---=======] info' +# off: 'info' +cpu_display="on" +memory_display="on" +battery_display="on" +disk_display="on" + +##--------- Backend Settings + +# Image backend. +# +# Default: 'ascii' +# Values: 'ascii', 'caca', 'chafa', 'jp2a', 'iterm2', 'off', +# 'pot', 'termpix', 'pixterm', 'tycat', 'w3m', 'kitty' +# Flag: --backend +image_backend="ascii" + +# Image Source +# +# Which image or ascii file to display. +# +# Default: 'auto' +# Values: 'auto', 'ascii', 'wallpaper', '/path/to/img', '/path/to/ascii', '/path/to/dir/' +# 'command output (neofetch --ascii "$(fortune | cowsay -W 30)")' +# Flag: --source +# +# NOTE: 'auto' will pick the best image source for whatever image backend is used. +# In ascii mode, distro ascii art will be used and in an image mode, your +# wallpaper will be used. +image_source="auto" + +##--------- Ascii Options + +# Ascii distro +# Which distro's ascii art to display. +# +# Default: 'auto' +# Values: 'auto', 'distro_name' +# Flag: --ascii_distro +# NOTE: AIX, Alpine, Anarchy, Android, Antergos, antiX, "AOSC OS", +# "AOSC OS/Retro", Apricity, ArcoLinux, ArchBox, ARCHlabs, +# ArchStrike, XFerience, ArchMerge, Arch, Artix, Arya, Bedrock, +# Bitrig, BlackArch, BLAG, BlankOn, BlueLight, bonsai, BSD, +# BunsenLabs, Calculate, Carbs, CentOS, Chakra, ChaletOS, +# Chapeau, Chrom*, Cleanjaro, ClearOS, Clear_Linux, Clover, +# Condres, Container_Linux, CRUX, Cucumber, Debian, Deepin, +# DesaOS, Devuan, DracOS, DarkOs, DragonFly, Drauger, Elementary, +# EndeavourOS, Endless, EuroLinux, Exherbo, Fedora, Feren, FreeBSD, +# FreeMiNT, Frugalware, Funtoo, GalliumOS, Garuda, Gentoo, Pentoo, +# gNewSense, GNOME, GNU, GoboLinux, Grombyang, Guix, Haiku, Huayra, +# Hyperbola, janus, Kali, KaOS, KDE_neon, Kibojoe, Kogaion, +# Korora, KSLinux, Kubuntu, LEDE, LFS, Linux_Lite, +# LMDE, Lubuntu, Lunar, macos, Mageia, MagpieOS, Mandriva, +# Manjaro, Maui, Mer, Minix, LinuxMint, MX_Linux, Namib, +# Neptune, NetBSD, Netrunner, Nitrux, NixOS, Nurunner, +# NuTyX, OBRevenge, OpenBSD, openEuler, OpenIndiana, openmamba, +# OpenMandriva, OpenStage, OpenWrt, osmc, Oracle, OS Elbrus, PacBSD, +# Parabola, Pardus, Parrot, Parsix, TrueOS, PCLinuxOS, Peppermint, +# popos, Porteus, PostMarketOS, Proxmox, Puppy, PureOS, Qubes, Radix, +# Raspbian, Reborn_OS, Redstar, Redcore, Redhat, Refracted_Devuan, +# Regata, Rosa, sabotage, Sabayon, Sailfish, SalentOS, Scientific, +# Septor, SereneLinux, SharkLinux, Siduction, Slackware, SliTaz, +# SmartOS, Solus, Source_Mage, Sparky, Star, SteamOS, SunOS, +# openSUSE_Leap, openSUSE_Tumbleweed, openSUSE, SwagArch, Tails, +# Trisquel, Ubuntu-Budgie, Ubuntu-GNOME, Ubuntu-MATE, Ubuntu-Studio, +# Ubuntu, Venom, Void, Obarun, windows10, Windows7, Xubuntu, Zorin, +# and IRIX have ascii logos +# NOTE: Arch, Ubuntu, Redhat, and Dragonfly have 'old' logo variants. +# Use '{distro name}_old' to use the old logos. +# NOTE: Ubuntu has flavor variants. +# Change this to Lubuntu, Kubuntu, Xubuntu, Ubuntu-GNOME, +# Ubuntu-Studio, Ubuntu-Mate or Ubuntu-Budgie to use the flavors. +# NOTE: Arcolinux, Dragonfly, Fedora, Alpine, Arch, Ubuntu, +# CRUX, Debian, Gentoo, FreeBSD, Mac, NixOS, OpenBSD, android, +# Antrix, CentOS, Cleanjaro, ElementaryOS, GUIX, Hyperbola, +# Manjaro, MXLinux, NetBSD, Parabola, POP_OS, PureOS, +# Slackware, SunOS, LinuxLite, OpenSUSE, Raspbian, +# postmarketOS, and Void have a smaller logo variant. +# Use '{distro name}_small' to use the small variants. +ascii_distro="auto" + +# Ascii Colors +# +# Default: 'distro' +# Values: 'distro', 'num' 'num' 'num' 'num' 'num' 'num' +# Flag: --ascii_colors +# +# Example: +# ascii_colors=(distro) - Ascii is colored based on Distro colors. +# ascii_colors=(4 6 1 8 8 6) - Ascii is colored using these colors. +ascii_colors=(distro) + +# Bold ascii logo +# Whether or not to bold the ascii logo. +# +# Default: 'on' +# Values: 'on', 'off' +# Flag: --ascii_bold +ascii_bold="on" + +##--------- Image Options + +# Image loop +# Setting this to on will make neofetch redraw the image constantly until +# Ctrl+C is pressed. This fixes display issues in some terminal emulators. +# +# Default: 'off' +# Values: 'on', 'off' +# Flag: --loop +image_loop="off" + +# Thumbnail directory +# +# Default: '~/.cache/thumbnails/neofetch' +# Values: 'dir' +thumbnail_dir="${XDG_CACHE_HOME:-${HOME}/.cache}/thumbnails/neofetch" + +# Crop mode +# +# Default: 'normal' +# Values: 'normal', 'fit', 'fill' +# Flag: --crop_mode +# +# See this wiki page to learn about the fit and fill options. +# https://github.com/dylanaraps/neofetch/wiki/What-is-Waifu-Crop%3F +crop_mode="normal" + +# Crop offset +# Note: Only affects 'normal' crop mode. +# +# Default: 'center' +# Values: 'northwest', 'north', 'northeast', 'west', 'center' +# 'east', 'southwest', 'south', 'southeast' +# Flag: --crop_offset +crop_offset="center" + +# Image size +# The image is half the terminal width by default. +# +# Default: 'auto' +# Values: 'auto', '00px', '00%', 'none' +# Flags: --image_size +# --size +image_size="auto" + +# Gap between image and text +# +# Default: '3' +# Values: 'num', '-num' +# Flag: --gap +gap=2 + +# Image offsets +# Only works with the w3m backend. +# +# Default: '0' +# Values: 'px' +# Flags: --xoffset +# --yoffset +yoffset=0 +xoffset=0 + +# Image background color +# Only works with the w3m backend. +# +# Default: '' +# Values: 'color', 'blue' +# Flag: --bg_color +background_color= + +##--------- Misc Options + +# Stdout mode +# Turn off all colors and disables image backend (ASCII/Image). +# Useful for piping into another command. +# Default: 'off' +# Values: 'on', 'off' +stdout="off" diff --git a/home/_mixins/desktop/audio-recorder.nix b/home/_mixins/desktop/audio-recorder.nix new file mode 100644 index 0000000..f6d2ed5 --- /dev/null +++ b/home/_mixins/desktop/audio-recorder.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, username, ... }: +with lib.hm.gvariant; +{ + home.packages = with pkgs; [ + audio-recorder + ]; + + dconf.settings = { + "apps/audio-recorder" = { + append-to-file = false; + filename-pattern = "LMP-${username}-%V-%H%M"; + folder-name = "${config.home.homeDirectory}/Audio"; + keep-on-top = true; + level-bar-value = 2; + media-format = "Podcast Mono, Lossless 44KHz"; + #saved-profiles = [('CD Quality, AAC 44KHz', 'm4a', '', 'audio/x-raw,rate=44100,channels=2 ! avenc_aac compliance=-2 ! avmux_mp4'), ('CD Quality, Lossless 44KHz', 'flac', '', 'audio/x-raw,rate=44100,channels=2 ! flacenc name=enc'), ('CD Quality, Lossy 44KHz', 'ogg', '', 'audio/x-raw,rate=44100,channels=2 ! vorbisenc name=enc quality=0.5 ! oggmux'), ('CD Quality, MP3 Lossy 44KHz', 'mp3', '', 'audio/x-raw,rate=44100,channels=2 ! lamemp3enc name=enc target=0 quality=2'), ('Lossless WAV 22KHz', 'wav', '', 'audio/x-raw,rate=22050,channels=1 ! wavenc name=enc'), ('Lossless WAV 44KHz', 'wav', '', 'audio/x-raw,rate=44100,channels=2 ! wavenc name=enc'), ('Lossy Speex 32KHz', 'spx', '', 'audio/x-raw,rate=32000,channels=2 ! speexenc name=enc ! oggmux'), ('Podcast Mono, Lossless 44KHz', 'flac', '', 'audio/x-raw,rate=44100,channels=1 ! flacenc name=enc')]; + show-systray-icon = false; + timer-active = false; + timer-expanded = false; + timer-text = ""; + }; + }; + + systemd.user.tmpfiles.rules = [ + "d ${config.home.homeDirectory}/Audio 0755 ${username} users - -" + ]; +} diff --git a/home/_mixins/desktop/celluloid.nix b/home/_mixins/desktop/celluloid.nix new file mode 100644 index 0000000..2b0b971 --- /dev/null +++ b/home/_mixins/desktop/celluloid.nix @@ -0,0 +1,14 @@ +{ lib, pkgs, ... }: +with lib.hm.gvariant; +{ + home.packages = with pkgs; [ + celluloid + ]; + + dconf.settings = { + "io/github/celluloid-player/celluloid" = { + csd-enable = false; + dark-theme-enable = true; + }; + }; +} diff --git a/home/_mixins/desktop/dconf-editor.nix b/home/_mixins/desktop/dconf-editor.nix new file mode 100644 index 0000000..55b194b --- /dev/null +++ b/home/_mixins/desktop/dconf-editor.nix @@ -0,0 +1,13 @@ +{ lib, pkgs, ... }: +with lib.hm.gvariant; +{ + home.packages = with pkgs; [ + gnome.dconf-editor + ]; + + dconf.settings = { + "ca/desrt/dconf-editor" = { + show-warning = false; + }; + }; +} diff --git a/home/_mixins/desktop/deckmaster-xl.nix b/home/_mixins/desktop/deckmaster-xl.nix new file mode 100644 index 0000000..eddc9e3 --- /dev/null +++ b/home/_mixins/desktop/deckmaster-xl.nix @@ -0,0 +1,27 @@ +{ config, pkgs, ... }: +{ + # https://github.com/muesli/deckmaster + home = { + file = { + "${config.xdg.configHome}/autostart/deskmaster-xl.desktop".text = " + [Desktop Entry] + Name=Deckmaster XL + Comment=Deckmaster XL + Type=Application + Exec=deckmaster -deck ${config.home.homeDirectory}/Studio/StreamDeck/Deckmaster-xl/main.deck + Categories= + Terminal=false + NoDisplay=true + StartupNotify=false"; + }; + # Deckmaster and the utilities I bind to the Stream Deck + packages = with pkgs; [ + bc + deckmaster + hueadm + libnotify + unstable.obs-cli + playerctl + ]; + }; +} diff --git a/home/_mixins/desktop/default.nix b/home/_mixins/desktop/default.nix new file mode 100644 index 0000000..3a77c18 --- /dev/null +++ b/home/_mixins/desktop/default.nix @@ -0,0 +1,47 @@ +{ desktop, lib, username, ... }: { + imports = [ + (./. + "/${desktop}.nix") + ] ++ lib.optional (builtins.pathExists (./. + "/../users/${username}/desktop.nix")) ../users/${username}/desktop.nix; + + # https://nixos.wiki/wiki/Bluetooth#Using_Bluetooth_headsets_with_PulseAudio + services.mpris-proxy.enable = true; + + xresources.properties = { + "XTerm*background" = "#121214"; + "XTerm*foreground" = "#c8c8c8"; + "XTerm*cursorBlink" = true; + "XTerm*cursorColor" = "#FFC560"; + "XTerm*boldColors" = false; + + #Black + DarkGrey + "*color0" = "#141417"; + "*color8" = "#434345"; + #DarkRed + Red + "*color1" = "#D62C2C"; + "*color9" = "#DE5656"; + #DarkGreen + Green + "*color2" = "#42DD76"; + "*color10" = "#A1EEBB"; + #DarkYellow + Yellow + "*color3" = "#FFB638"; + "*color11" = "#FFC560"; + #DarkBlue + Blue + "*color4" = "#28A9FF"; + "*color12" = "#94D4FF"; + #DarkMagenta + Magenta + "*color5" = "#E66DFF"; + "*color13" = "#F3B6FF"; + #DarkCyan + Cyan + "*color6" = "#14E5D4"; + "*color14" = "#A1F5EE"; + #LightGrey + White + "*color7" = "#c8c8c8"; + "*color15" = "#e9e9e9"; + "XTerm*faceName" = "FiraCode Nerd Font:size=13:style=Medium:antialias=true"; + "XTerm*boldFont" = "FiraCode Nerd Font:size=13:style=Bold:antialias=true"; + "XTerm*geometry" = "132x50"; + "XTerm.termName" = "xterm-256color"; + "XTerm*locale" = false; + "XTerm*utf8" = true; + }; +} diff --git a/home/_mixins/desktop/emote.nix b/home/_mixins/desktop/emote.nix new file mode 100644 index 0000000..c6e16c9 --- /dev/null +++ b/home/_mixins/desktop/emote.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + # https://github.com/tom-james-watson/emote + home.packages = with pkgs.unstable; [ + emote + ]; + + systemd.user.services = { + emote = { + Unit = { + Description = "Emote"; + }; + Service = { + ExecStart = "${pkgs.unstable.emote}/bin/emote"; + Restart = "on-failure"; + }; + Install = { + WantedBy = [ "default.target" ]; + }; + }; + }; +} diff --git a/home/_mixins/desktop/gitkraken.nix b/home/_mixins/desktop/gitkraken.nix new file mode 100644 index 0000000..692e671 --- /dev/null +++ b/home/_mixins/desktop/gitkraken.nix @@ -0,0 +1,191 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + unstable.gitkraken + ]; + + home.file = { + ".gitkraken/themes/bearded-vivid-black.jsonc".text = '' + { + "meta": { + "name": "Bearded Vivid Black", + "scheme": "dark" // must be "light" or "dark" + }, + "themeValues": { + // values applied to the entire app + "root": { + "red": "#d62c2c", + "orange": "#ff7135", + "yellow": "#ffb638", + "green": "#42dd76", + "teal": "#14e5d4", + "blue": "#28a9ff", + "ltblue": "#94D4FF", + "purple": "#e66dff", + "app__bg0": "#141417", + "toolbar__bg0": "lighten(saturate(@app__bg0, 3%), 1%)", + "toolbar__bg1": "lighten(@toolbar__bg0, 4%)", //4% + "toolbar__bg2": "lighten(@toolbar__bg1, 6%)", //6% + "panel__bg0": "lighten(@app__bg0, 5%)", //5% + "panel__bg1": "lighten(@panel__bg0, 4%)", //4% + "panel__bg2": "lighten(@panel__bg1, 4%)", //4% + "input__bg": "#141417", + "input-bg-warn-color": "fade(@orange, 60%)", + "panel-border": "fade(#FFFFFF, 8%)", + "section-border": "fade(#FFFFFF, 8%)", + "subtle-border": "fade(#FFFFFF, 4%)", + "modal-overlay-color": "rgba(0,0,0,.5)", + // graph colors + "graph-color-0": "#14E5D4", //cyan + "graph-color-1": "#28A9FF", //blue + "graph-color-2": "#8e00c2", //purle + "graph-color-3": "#E66DFF", //magenta + "graph-color-4": "#F3B6FF", //lt. magenta + "graph-color-5": "#D62C2C", //red + "graph-color-6": "#ff7135", //orange + "graph-color-7": "#FFB638", //yellow + "graph-color-8": "#42DD76", //green + "graph-color-9": "#2ece9d", //teal + // text colors + // values starting with . aren't added to the CSS, they're just variables + ".text-color": "#c8c8c8", + "text-selected": "@.text-color", + "text-normal": "fade(@.text-color, 78%)", + "text-secondary": "fade(@.text-color, 65%)", + "text-disabled": "fade(@.text-color, 45%)", + "text-accent": "#28a9ff", //blue + "text-inverse": "#373737", + "text-bright": "@.text-color", + "text-dimmed": "fade(@text-normal, 20%)", + "text-dimmed-selected": "fade(@text-dimmed, 50%)", + "text-selected-row": "@text-selected", + // buttons + "btn-text": "@text-normal", + "btn-text-hover": "@text-selected", + "default-border": "@text-normal", + "default-bg": "transparent", + "default-hover": "transparent", + "default-border-hover": "@text-selected", + "primary-border": "@blue", + "primary-bg": "fade(@blue, 10%)", //10% + "primary-hover": "fade(@blue, 40%)", //40% + "success-border": "@green", + "success-bg": "fade(@green, 10%)", + "success-hover": "fade(@green, 40%)", + "warning-border": "@orange", + "warning-bg": "fade(@orange, 10%)", + "warning-hover": "fade(@orange, 35%)", + "danger-border": "@red", + "danger-bg": "fade(@red, 10%)", + "danger-hover": "fade(@red, 40%)", + // states + "hover-row": "fade(@blue, 50%)", //15% + "danger-row": "fade(@red, 40%)", + "selected-row": "fade(@blue, 75%)", //20% + "selected-row-border": "none", + "warning-row": "fade(@orange, 40%)", + "droppable": "fade(@yellow, 30%)", + "drop-target": "fade(@green, 50%)", + "input--disabled": "fade(#000000, 10%)", + "link-color": "#14e5d4", //cyan + "link-color-bright": "#14e5d4", //cyan + "form-control-focus": "@blue", + // various app elements + "scroll-thumb-border": "rgba(0,0,0,0)", + "scroll-thumb-bg": "rgba(255,255,255,0.15)", + "scroll-thumb-bg-light": "rgba(0,0,0,0.15)", + "wip-status": "fade(@blue, 40%)", + "card__bg": "@panel__bg2", + "card-shadow": "@rgba(0,0,0,.2)", + "statusbar__warning-bg": "mixLess(@graph-color-7, @app__bg0, 50%)", + "label__yellow-color": "#ffb638", //yellow + "label__light-blue-color": "#28a9ff", //blue + "label__purple-color": "#e66dff", //magenta + // component states + "filtering": "fade(@blue, 50%)", + "soloing": "fade(@orange, 50%)", + "checked-out": "fade(@green, 30%)", + "soloed": "fade(@orange, 30%)", + "filter-match": "fade(@blue, 50%)", + "clone__progress": "fade(@blue, 70%)", + "toolbar__prompt": "fade(@blue, 20%)", + "verified": "fade(@green, 30%)", + "unverified": "fade(#ffffff, 10%)", + "drop-sort-border": "@green", + // terminal + "terminal__repo-name-color": "turquoise", + "terminal__repo-branch-color": "violet", + "terminal__repo-tag-color": "coral", + "terminal__repo-upstream-color": "lime", + "terminal__background": "#121214", + "terminal__cursor": "#ffb638", + "terminal__cursorAccent": "#ffb638", + "terminal__foreground": "#c8c8c8", + "terminal__selection": "#37373a", //grey-dark + "terminal__black": "#141417", + "terminal__red": "#d62c2c", + "terminal__green": "#42dd76", + "terminal__yellow": "#ffb638", + "terminal__blue": "#28a9ff", + "terminal__magenta": "#e66dff", + "terminal__cyan": "#14e5d4", + "terminal__white": "#c8c8c8", + "terminal__brightBlack": "#434345", + "terminal__brightRed": "#DE5656", + "terminal__brightGreen": "#A1EEBB", + "terminal__brightYellow": "#FFC560", + "terminal__brightBlue": "#94D4FF", + "terminal__brightMagenta": "#F3B6FF", + "terminal__brightCyan": "#A1F5EE, + "terminal__brightWhite": "#E9E9E9, + // code editor + "code-bg": "@app__bg0", + "code-foreground": "@text-normal", + "code-blame-color-0": "@graph-color-0", + "code-blame-color-1": "@graph-color-1", + "code-blame-color-2": "@graph-color-2", + "code-blame-color-3": "@graph-color-3", + "code-blame-color-4": "@graph-color-4", + "code-blame-color-5": "@graph-color-5", + "code-blame-color-6": "@graph-color-6", + "code-blame-color-7": "@graph-color-7", + "code-blame-color-8": "@graph-color-8", + "code-blame-color-9": "@graph-color-9", + "added-line": "fade(@green, 30%)", + "deleted-line": "fade(@red, 30%)", + "modified-line": "fade(#000000, 25%)", + "conflict-info-color": "#14e5d4", //cyan + "conflict-left-border-color": "#14e5d4", //cyan + "conflict-left-color": "fade(@conflict-left-border-color, 25%)", + "conflict-right-border-color": "#ffb638", //yellow + "conflict-right-color": "fade(@conflict-right-border-color, 25%)", + "conflict-output-border-color": "#e66dff", //magenta + "conflict-output-color": "fade(@conflict-output-border-color, 25%)" + }, + // override specific values just for the toolbar + "toolbar": { + "text-selected": "rgba(255,255,255,1)", + "text-normal": "rgba(255,255,255,.9)", + "text-secondary": "rgba(255,255,255,.6)", + "text-disabled": "rgba(255,255,255,.4)", + "section-border": "rgba(255,255,255,.2)", + "input__bg": "rgba(0,0,0,.20)", + "link-color": "#14e5d4", //cyan + "btn-text": "var(--text-normal)" + }, + // override specific values just for the tabs bar + "tabsbar": { + "text-selected": "rgba(255,255,255,1)", + "text-normal": "rgba(255,255,255,.9)", + "text-secondary": "rgba(255,255,255,.6)", + "text-disabled": "rgba(255,255,255,.4)", + "section-border": "rgba(255,255,255,.2)", + "input__bg": "rgba(0,0,0,.20)", + "link-color": "#14e5d4", //cyan + "btn-text": "var(--text-normal)" + } + } + } + ''; + }; +} diff --git a/home/_mixins/desktop/gnome-sound-recorder.nix b/home/_mixins/desktop/gnome-sound-recorder.nix new file mode 100644 index 0000000..8c57758 --- /dev/null +++ b/home/_mixins/desktop/gnome-sound-recorder.nix @@ -0,0 +1,19 @@ +{ config, lib, pkgs, username, ... }: +with lib.hm.gvariant; +{ + home.packages = with pkgs; [ + gnome.gnome-sound-recorder + ]; + + dconf.settings = { + "org/gnome/SoundRecorder" = { + audio-channel = "mono"; + audio-profile = "flac"; + }; + }; + + systemd.user.tmpfiles.rules = [ + "d ${config.home.homeDirectory}/Audio 0755 ${username} users - -" + "L+ ${config.home.homeDirectory}/.local/share/org.gnome.SoundRecorder/ - - - - ${config.home.homeDirectory}/Audio/" + ]; +} diff --git a/home/_mixins/desktop/localsend.nix b/home/_mixins/desktop/localsend.nix new file mode 100644 index 0000000..b3c81ca --- /dev/null +++ b/home/_mixins/desktop/localsend.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + # https://localsend.org/ + home.packages = with pkgs; [ + localsend + ]; + + systemd.user.services = { + localsend = { + Unit = { + Description = "LocalSend"; + }; + Service = { + ExecStart = "${pkgs.localsend}/bin/localsend"; + Restart = "on-failure"; + }; + Install = { + WantedBy = [ "default.target" ]; + }; + }; + }; +} diff --git a/home/_mixins/desktop/mate.nix b/home/_mixins/desktop/mate.nix new file mode 100644 index 0000000..8e7500d --- /dev/null +++ b/home/_mixins/desktop/mate.nix @@ -0,0 +1,363 @@ +{ config, lib, pkgs, ... }: +with lib.hm.gvariant; +{ + dconf.settings = { + "org/gnome/charmap" = { + font = "Work Sans 22"; + }; + + "org/gnome/desktop/interface" = { + cursor-theme = "Yaru"; + document-font-name = "Work Sans 12"; + font-name = "Work Sans 12"; + gtk-theme = "Yaru-magenta-dark"; + icon-theme = "Yaru-magenta-dark"; + monospace-font-name = "FiraCode Nerd Font Medium 13"; + }; + + "org/gnome/desktop/wm/preferences" = { + button-layout = ":minimize,maximize,close"; + theme = "Yaru-dark"; + titlebar-font = "Work Sans Semi-Bold 12"; + titlebar-uses-system-font = false; + }; + + "org/gnome/evolution/mail" = { + monospace-font = "FiraCode Nerd Font Medium 13"; + search-gravatar-for-photo = true; + show-sender-photo = true; + variable-width-font = "Work Sans 12"; + }; + + "org/gnome/evolution/plugin/external-editor" = { + command = "pluma"; + }; + + "org/gtk/settings/file-chooser" = { + sort-directories-first = true; + }; + + "org/mate/applications-office/calendar" = { + exec = "evolution"; + }; + + "org/mate/applications-office/tasks" = { + exec = "evolution"; + }; + + "org/mate/caja/desktop" = { + computer-icon-visible = false; + font = "Work Sans Medium 12"; + home-icon-visible = true; + trash-icon-visible = false; + }; + + "org/mate/caja/list-view" = { + default-zoom-level = "small"; + }; + + "org/mate/caja/preferences" = { + default-folder-view = "list-view"; + }; + + "org/mate/dictionary" = { + print-font = "Work Sans 12"; + }; + + "org/mate/disk-usage-analyzer/ui" = { + statusbar-visible = true; + }; + + "org/mate/desktop/applications/calculator" = { + exec = "mate-calc"; + }; + + "org/mate/desktop/applications/messager" = { + exec = "telegram-desktop"; + }; + + "org/mate/desktop/applications/terminal" = { + exec = "mate-terminal"; + }; + + "org/mate/desktop/background" = { + picture-filename = ""; + primary-color = "rgb(192,97,203)"; + secondary-color = "rgb(28,113,216)"; + }; + + "org/mate/desktop/font-rendering" = { + antialiasing = "rgba"; + hinting = "slight"; + rgba-order = "rgb"; + }; + + "org/mate/desktop/interface" = { + document-font-name = "Work Sans 12"; + font-name = "Work Sans 12"; + gtk-decoration-layout = ":minimize,maximize,close"; + gtk-theme = "Yaru-magenta-dark"; + gtk-color-scheme = "tooltip_fg_color:#ffffff\ntooltip_bg_color:#343434"; + icon-theme = "Yaru-magenta-dark"; + monospace-font-name = "FiraCode Nerd Font Medium 13"; + }; + + "org/mate/desktop/peripherals/keyboard/kbd" = { + options = [ "terminate\tterminate:ctrl_alt_bksp" "caps\tcaps:none" ]; + }; + + "org/mate/desktop/peripherals/mouse" = { + cursor-size = 32; + cursor-theme = "Yaru"; + }; + + "org/mate/desktop/peripherals/touchpad" = { + disable-while-typing = true; + tap-to-click = true; + three-finger-click = 0; + two-finger-click = 0; + }; + + "org/mate/desktop/session" = { + idle-delay = 30; + }; + + "org/mate/desktop/sound" = { + event-sounds = true; + input-feedback-sounds = true; + theme-name = "Yaru"; + }; + + "org/mate/eom/view" = { + extrapolate = false; + interpolate = false; + }; + + "org/mate/notification-daemon" = { + theme = "slider"; + }; + + "org/mate/marco/general" = { + alt-tab-expand-to-fit-title = true; + button-layout = ":minimize,maximize,close"; + center-new-windows = false; + compositing-manager = true; + num-workspaces = 8; + show-tab-border = false; + theme = "Yaru-dark"; + titlebar-font = "Work Sans Semi-Bold 12"; + }; + + "org/mate/marco/global-keybindings" = { + run-command-1 = "l"; + run-command-2 = "Print"; + run-command-3 = "e"; + run-command-4 = "t"; + run-command-5 = "i"; + run-command-6 = "s"; + run-command-7 = "Escape"; + run-command-8 = "Pause"; + run-command-terminal = "t"; + switch-panels = "disabled"; + switch-windows = "Tab"; + switch-windows-all = "Tab"; + switch-windows-all-backward = "Tab"; + switch-windows-backward = "Tab"; + switch-to-workspace-1 = "1"; + switch-to-workspace-2 = "2"; + switch-to-workspace-3 = "3"; + switch-to-workspace-4 = "4"; + switch-to-workspace-5 = "5"; + switch-to-workspace-6 = "6"; + switch-to-workspace-7 = "7"; + switch-to-workspace-8 = "8"; + }; + + "org/mate/marco/keybinding-commands" = { + command-1 = "mate-screensaver-command --lock"; + command-2 = "/bin/sh -c \"sleep 0.1; mate-screenshot --area\""; + command-3 = "caja"; + command-4 = "mate-terminal --window"; + command-5 = "mate-control-center"; + command-6 = "mate-search-tool"; + command-7 = "mate-system-monitor -p"; + command-8 = "mate-system-monitor -s"; + }; + + "org/mate/marco/window-keybindings" = { + maximize = "Up"; + move-to-center = "c"; + tile-to-corner-ne = "Right"; + tile-to-corner-nw = "Left"; + tile-to-corner-se = "Right"; + tile-to-corner-sw = "Left"; + tile-to-side-e = "Right"; + tile-to-side-w = "Left"; + toggle-shaded = "s"; + unmaximize = "Down"; + }; + + "org/mate/marco/workspace-names" = { + name-1 = " Web "; + name-2 = " Work "; + name-3 = " Chat "; + name-4 = " Code "; + name-5 = " Virt "; + name-6 = " Cast "; + name-7 = " Fun "; + name-8 = " Stuff "; + }; + + "org/mate/maximus" = { + no-maximize = true; + undecorate = false; + }; + + "org/mate/media-handling" = { + autorun-x-content-start-app = [ "x-content/software" "x-content/video-bluray.xml" "x-content/video-dvd.xml" "x-content/video-hddvd.xml" "x-content/video-svcd.xml" "x-content/video-vcd.xml" ]; + }; + + "org/mate/panel" = { + enable-sni-support = true; + show-program-list = true; + }; + + "org/mate/panel/menubar" = { + icon-name = "start-here-symbolic"; + }; + + "org/mate/panel/objects/workspace-switcher/prefs" = { + display-workspace-names = true; + }; + + "org/mate/pluma" = { + auto-indent = true; + bracket-matching = true; + color-scheme = "Yaru-dark"; + display-line-numbers = true; + display-right-margin = true; + display-overview-map = true; + editor-font = "FiraCode Nerd Font Medium 13"; + highlight-current-line = true; + insert-spaces = true; + print-font-body-pango = "FiraCode Nerd Font Medium 10"; + print-font-header-pango = "Work Sans 11"; + print-font-numbers-pango = "Work Sans 8"; + }; + + "org/mate/power-manager" = { + button-power = "interactive"; + sleep-computer-ac = 0; + sleep-display-ac = 3600; + }; + + "org/mate/screensaver" = { + lock-delay = 1; + mode = "single"; + themes = [ "screensavers-footlogo-floaters" ]; + }; + + "org/mate/settings-daemon/plugins/media-keys" = { + magnifier = "m"; + on-screen-keyboard = "k"; + screenreader = "s"; + }; + + "org/mate/stickynotes" = { + default-font = "Work Sans Medium 10"; + }; + + "org/mate/system-monitor" = { + cpu-color0 = "#9A0606"; + cpu-color1 = "#B42828"; + cpu-color10 = "#6B9A06"; + cpu-color11 = "#86B428"; + cpu-color12 = "#A4CD50"; + cpu-color13 = "#C4E67F"; + cpu-color14 = "#E6FFB3"; + cpu-color15 = "#066B9A"; + cpu-color16 = "#2886B4"; + cpu-color17 = "#50A5CD"; + cpu-color18 = "#7FC4E6"; + cpu-color19 = "#B3E6FF"; + cpu-color2 = "#CD5050"; + cpu-color20 = "#21069A"; + cpu-color21 = "#4028B4"; + cpu-color22 = "#6550CD"; + cpu-color23 = "#907FE6"; + cpu-color24 = "#C0B4FF"; + cpu-color25 = "#870087"; + cpu-color26 = "#BC00BC"; + cpu-color27 = "#F100F1"; + cpu-color28 = "#FF4FFF"; + cpu-color29 = "#FF87FF"; + cpu-color3 = "#E67F7F"; + cpu-color30 = "#C4A000"; + cpu-color31 = "#EDD400"; + cpu-color4 = "#FFB4B4"; + cpu-color5 = "#9A5306"; + cpu-color6 = "#B47028"; + cpu-color7 = "#CD8F50"; + cpu-color8 = "#E6B37F"; + cpu-color9 = "#FFDBB5"; + show-tree = true; + solaris-mode = false; + }; + + "org/mate/terminal/profile" = { + allow-bold = false; + use-system-font = true; + }; + }; + + gtk = { + enable = true; + cursorTheme = { + name = "Yaru"; + package = pkgs.yaru-theme; + size = 32; + }; + + font = { + name = "Work Sans 12"; + package = pkgs.work-sans; + }; + + gtk2 = { + configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + extraConfig = '' + gtk-application-prefer-dark-theme=1 + ''; + }; + + gtk3 = { + extraConfig = { + gtk-application-prefer-dark-theme = 1; + }; + }; + + gtk4 = { + extraConfig = { + gtk-application-prefer-dark-theme = 1; + }; + }; + + iconTheme = { + name = "Yaru-dark-magenta"; + package = pkgs.yaru-theme; + }; + + theme = { + name = "Yaru-dark-magenta"; + package = pkgs.yaru-theme; + }; + }; + + home.pointerCursor = { + name = "Yaru"; + package = pkgs.yaru-theme; + size = 32; + gtk.enable = true; + x11.enable = true; + }; +} diff --git a/home/_mixins/desktop/meld.nix b/home/_mixins/desktop/meld.nix new file mode 100644 index 0000000..6544915 --- /dev/null +++ b/home/_mixins/desktop/meld.nix @@ -0,0 +1,19 @@ +{ lib, pkgs, ... }: +with lib.hm.gvariant; +{ + home.packages = with pkgs; [ + meld + ]; + + dconf.settings = { + "org/gnome/meld" = { + indent-width = 4; + insert-spaces-instead-of-tabs = true; + highlight-current-line = true; + show-line-numbers = true; + prefer-dark-theme = true; + highlight-syntax = true; + style-scheme = "Yaru-dark"; + }; + }; +} diff --git a/home/_mixins/desktop/pantheon.nix b/home/_mixins/desktop/pantheon.nix new file mode 100644 index 0000000..3a9a7e3 --- /dev/null +++ b/home/_mixins/desktop/pantheon.nix @@ -0,0 +1,267 @@ +{ config, lib, pkgs, ... }: +with lib.hm.gvariant; +{ + dconf.settings = { + "com/github/stsdc/monitor/settings" = { + background-state = true; + indicator-state = true; + indicator-cpu-state = false; + indicator-gpu-state = false; + indicator-memory-state = false; + indicator-network-download-state = true; + indicator-network-upload-state = true; + indicator-temperature-state = true; + }; + + "desktop/ibus/panel" = { + show-icon-on-systray = false; + use-custom-font = true; + custom-font = "Work Sans 10"; + }; + + "desktop/ibus/panel/emoji" = { + font = "JoyPixels 16"; + }; + + "io/elementary/code/saved-state" = { + outline-visible = true; + }; + + "io/elementary/code/settings" = { + strip-trailing-on-save = true; + show-mini-map = true; + show-right-margin = true; + style-scheme = "Yaru-dark"; + prefer-dark-style = true; + }; + + "io/elementary/desktop/agent-geoclue2" = { + location-enabled = true; + }; + + "io/elementary/desktop/wingpanel" = { + use-transparency = false; + }; + + "io/elementary/desktop/wingpanel/datetime" = { + clock-format = "24h"; + }; + + "io/elementary/desktop/wingpanel/sound" = { + max-volume = 100.0; + }; + + "io/elementary/files/preferences" = { + singleclick-select = true; + }; + + "io/elementary/notifications/applications/gala-other" = { + remember = false; + sounds = false; + }; + + "io/elementary/settings-daemon/datetime" = { + show-weeks = true; + }; + + "io/elementary/settings-daemon/housekeeping" = { + cleanup-downloads-folder = false; + }; + + "io/elementary/terminal/settings" = { + audible-bell = false; + background = "rgb(18,18,20)"; + cursor-color = "rgb(255,182,56)"; + follow-last-tab = "true"; + font = "FiraCode Nerd Font Medium 13"; + foreground = "rgb(200,200,200)"; + natural-copy-paste = false; + palette = "rgb(20,20,23):rgb(214,43,43):rgb(65,221,117):rgb(255,182,56):rgb(40,169,255):rgb(230,109,255):rgb(20,229,211):rgb(200,200,200):rgb(67,67,69):rgb(222,86,86):rgb(161,238,187):rgb(255,219,156):rgb(148,212,255):rgb(243,182,255):rgb(161,245,238):rgb(233,233,233)"; + theme = "custom"; + unsafe-paste-alert = false; + }; + + "net/launchpad/plank/docks/dock1" = { + alignment = "center"; + hide-mode = "window-dodge"; + icon-size = 48; + pinned-only = false; + position = "left"; + theme = "Transparent"; + }; + + "org/gnome/desktop/datetime" = { + automatic-timezone = true; + }; + + "org/gnome/desktop/input-sources" = { + xkb-options = [ "grp:alt_shift_toggle" "caps:none" ]; + }; + + "org/gnome/desktop/interface" = { + clock-format = "24h"; + color-scheme = "prefer-dark"; + cursor-size = 32; + cursor-theme = "elementary"; + document-font-name = "Work Sans 12"; + font-name = "Work Sans 12"; + gtk-theme = "io.elementary.stylesheet.bubblegum"; + gtk-enable-primary-paste = true; + icon-theme = "elementary"; + monospace-font-name = "FiraCode Nerd Font Medium 13"; + text-scaling-factor = 1.0; + }; + + "org/gnome/desktop/session" = { + idle-delay = lib.hm.gvariant.mkUint32 7200; + }; + + "org/gnome/desktop/sound" = { + theme-name = "elementary"; + }; + + "org/gnome/desktop/wm/keybindings" = { + switch-to-workspace-left = [ "Left" ]; + switch-to-workspace-right = [ "Right" ]; + }; + + "org/gnome/desktop/wm/preferences" = { + audible-bell = false; + button-layout = ":minimize,maximize,close"; + num-workspaces = 8; + titlebar-font = "Work Sans Semi-Bold 12"; + workspace-names = [ "Web" "Work" "Chat" "Code" "Virt" "Cast" "Fun" "Stuff" ]; + }; + + "org/gnome/GWeather" = { + temperature-unit = "centigrade"; + }; + + "org/gnome/mutter" = { + workspaces-only-on-primary = false; + dynamic-workspaces = false; + }; + + + "org/gnome/mutter/keybindings" = { + toggle-tiled-left = [ "Left" ]; + toggle-tiled-right = [ "Right" ]; + }; + + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = [ "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" ]; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0" = { + binding = "e"; + command = "io.elementary.files -n ~/"; + name = "io.elementary.files -n ~/"; + }; + + "org/gnome/settings-daemon/plugins/power" = { + power-button-action = "interactive"; + sleep-inactive-ac-timeout = 0; + sleep-inactive-ac-type = "nothing"; + }; + + #"org/gnome/settings-daemon/plugins/xsettings" = { + # overrides = "{\'Gtk/DialogsUseHeader\': <0>, \'Gtk/ShellShowsAppMenu\': <0>, \'Gtk/EnablePrimaryPaste\': <1>, \'Gtk/DecorationLayout\': <\':minimize,maximize,close,menu\'>, \'Gtk/ShowUnicodeMenu\': <0>}"; + #}; + + "org/gtk/gtk4/Settings/FileChooser" = { + clock-format = "24h"; + }; + + "org/gtk/Settings/FileChooser" = { + clock-format = "24h"; + }; + + "org/pantheon/desktop/gala/appearance" = { + button-layout = ":minimize,maximize,close"; + }; + + "org/pantheon/desktop/gala/behavior" = { + dynamic-workspaces = false; + overlay-action = "io.elementary.wingpanel --toggle-indicator=app-launcher"; + }; + + "org/pantheon/desktop/gala/mask-corners" = { + enable = false; + }; + }; + + gtk = { + enable = true; + cursorTheme = { + name = "elementary"; + package = pkgs.pantheon.elementary-icon-theme; + size = 32; + }; + + font = { + name = "Work Sans 12"; + package = pkgs.work-sans; + }; + + gtk2 = { + configLocation = "${config.xdg.configHome}/gtk-2.0/gtkrc"; + extraConfig = '' + gtk-application-prefer-dark-theme=1 + ''; + }; + + gtk3 = { + extraConfig = { + gtk-application-prefer-dark-theme = 1; + }; + }; + + gtk4 = { + extraConfig = { + gtk-application-prefer-dark-theme = 1; + }; + }; + + iconTheme = { + name = "elementary"; + package = pkgs.pantheon.elementary-icon-theme; + }; + + theme = { + name = "io.elementary.stylesheet.bubblegum"; + package = pkgs.pantheon.elementary-gtk-theme; + }; + }; + + home.pointerCursor = { + package = pkgs.pantheon.elementary-icon-theme; + name = "elementary"; + size = 32; + gtk.enable = true; + x11.enable = true; + }; + + home.file = { + "${config.xdg.configHome}/autostart/ibus-daemon.desktop".text = " +[Desktop Entry] +Name=IBus Daemon +Comment=IBus Daemon +Type=Application +Exec=${pkgs.ibus}/bin/ibus-daemon --daemonize --desktop=pantheon --replace --xim +Categories= +Terminal=false +NoDisplay=true +StartupNotify=false"; + + "${config.xdg.configHome}/autostart/monitor.desktop".text = " +[Desktop Entry] +Name=Monitor Indicators +Comment=Monitor Indicators +Type=Application +Exec=/run/current-system/sw/bin/com.github.stsdc.monitor --start-in-background +Icon=com.github.stsdc.monitor +Categories= +Terminal=false +StartupNotify=false"; + }; +} diff --git a/home/_mixins/desktop/rhythmbox.nix b/home/_mixins/desktop/rhythmbox.nix new file mode 100644 index 0000000..7b6393f --- /dev/null +++ b/home/_mixins/desktop/rhythmbox.nix @@ -0,0 +1,22 @@ +{ lib, pkgs, ... }: +with lib.hm.gvariant; +{ + home.packages = with pkgs; [ + rhythmbox + ]; + + dconf.settings = { + "org/gnome/rhythmbox/plugins" = { + active-plugins = [ "rb" "power-manager" "mpris" "iradio" "generic-player" "audiocd" "android" ]; + }; + + "org/gnome/rhythmbox/podcast" = { + download-interval = "manual"; + }; + + "org/gnome/rhythmbox/sources" = { + browser-views = "genres-artists-albums"; + visible-columns = [ "post-time" "duration" "track-number" "album" "genre" "beats-per-minute" "play-count" "artist" ]; + }; + }; +} diff --git a/home/_mixins/desktop/sakura.conf b/home/_mixins/desktop/sakura.conf new file mode 100644 index 0000000..b4a3a1d --- /dev/null +++ b/home/_mixins/desktop/sakura.conf @@ -0,0 +1,75 @@ +[sakura] +colorset1_fore=rgb(192,192,192) +colorset1_back=rgb(18,18,20) +colorset1_curs=rgb(255,182,56) +colorset1_scheme=0 +colorset1_key=F1 +colorset2_fore=rgb(192,192,192) +colorset2_back=rgb(0,0,0) +colorset2_curs=rgb(255,255,255) +colorset2_scheme=1 +colorset2_key=F2 +colorset3_fore=rgb(192,192,192) +colorset3_back=rgb(0,0,0) +colorset3_curs=rgb(255,255,255) +colorset3_scheme=1 +colorset3_key=F3 +colorset4_fore=rgb(192,192,192) +colorset4_back=rgb(0,0,0) +colorset4_curs=rgb(255,255,255) +colorset4_scheme=1 +colorset4_key=F4 +colorset5_fore=rgb(192,192,192) +colorset5_back=rgb(0,0,0) +colorset5_curs=rgb(255,255,255) +colorset5_scheme=1 +colorset5_key=F5 +colorset6_fore=rgb(192,192,192) +colorset6_back=rgb(0,0,0) +colorset6_curs=rgb(255,255,255) +colorset6_scheme=1 +colorset6_key=F6 +last_colorset=1 +bold_is_bright=false +scroll_lines=4096 +font=FixedsysModernV05 Nerd Font Mono 18 +show_tab_bar=never +scrollbar=false +closebutton=false +tabs_on_bottom=false +less_questions=true +disable_numbered_tabswitch=true +use_fading=false +scrollable_tabs=true +urgent_bell=Yes +audible_bell=Yes +blinking_cursor=Yes +cursor_type=VTE_CURSOR_SHAPE_BLOCK +word_chars=-,./?%&#_~: +palette=1 +add_tab_accelerator=5 +del_tab_accelerator=5 +switch_tab_accelerator=8 +move_tab_accelerator=9 +copy_accelerator=5 +scrollbar_accelerator=5 +open_url_accelerator=5 +font_size_accelerator=4 +set_tab_name_accelerator=5 +search_accelerator=5 +add_tab_key=T +del_tab_key=W +prev_tab_key=Left +next_tab_key=Right +copy_key=C +paste_key=V +scrollbar_key=S +set_tab_name_key=N +search_key=F +increase_font_size_key=plus +decrease_font_size_key=minus +fullscreen_key=F11 +set_colorset_accelerator=5 +icon_file=terminal-tango.svg +paste_button=2 +menu_button=3 diff --git a/home/_mixins/desktop/sakura.nix b/home/_mixins/desktop/sakura.nix new file mode 100644 index 0000000..766ea50 --- /dev/null +++ b/home/_mixins/desktop/sakura.nix @@ -0,0 +1,10 @@ +{ config, pkgs, ... }: { + home = { + file = { + "${config.xdg.configHome}/sakura/sakura.conf".text = builtins.readFile ./sakura.conf; + }; + packages = with pkgs; [ + sakura + ]; + }; +} diff --git a/home/_mixins/desktop/tilix.nix b/home/_mixins/desktop/tilix.nix new file mode 100644 index 0000000..42d5f8b --- /dev/null +++ b/home/_mixins/desktop/tilix.nix @@ -0,0 +1,86 @@ +# Generated via dconf2nix: https://github.com/gvolpe/dconf2nix +{ lib, pkgs, ... }: +with lib.hm.gvariant; +{ + home.packages = with pkgs; [ + tilix + ]; + + dconf.settings = { + "com/gexperts/Tilix" = { + app-title = "\${appName}: \${directory}"; + paste-strip-trailing-whitespace = true; + prompt-on-close = true; + quake-hide-lose-focus = true; + quake-specific-monitor = 0; + session-name = "\${id}"; + terminal-title-show-when-single = true; + terminal-title-style = "none"; + use-tabs = true; + window-style = "normal"; + }; + + "com/gexperts/Tilix/keybindings" = { + win-view-sidebar = "F12"; + }; + + "com/gexperts/Tilix/profiles" = { + default = "d1def387-a465-4497-81bc-b8b2de782b2d"; + list = [ "d1def387-a465-4497-81bc-b8b2de782b2d" ]; + }; + + "com/gexperts/Tilix/profiles/d1def387-a465-4497-81bc-b8b2de782b2d" = { + background-color = "#121212121414"; + badge-color = "#E6E66D6DFFFF"; + badge-color-set = true; + badge-font = "FiraCode Nerd Font Mono 12"; + badge-text = "\${columns}x\${rows}"; + badge-use-system-font = false; + bold-color = "#C8C8C8C8C8C8"; + bold-color-set = true; + bold-is-bright = false; + cell-height-scale = 1.0; + cell-width-scale = 1.0; + cursor-background-color = "#FFFFB6B63838"; + cursor-blink-mode = "on"; + cursor-colors-set = true; + cursor-foreground-color = "#FFFFB6B63838"; + default-size-columns = 132; + default-size-rows = 50; + draw-margin = 80; + font = "FiraCode Nerd Font Medium 12"; + foreground-color = "#C8C8C8C8C8C8"; + highlight-background-color = "#1E1E1E1E2020"; + highlight-colors-set = false; + highlight-foreground-color = "#C8C8C8C8C8C8"; + palette = [ "#121212121414" "#D6D62B2B2B2B" "#4141DDDD7575" "#FFFFB6B63838" "#2828A9A9FFFF" "#E6E66D6DFFFF" "#1414E5E5D3D3" "#C8C8C8C8C8C8" "#434343434545" "#DEDE56565656" "#A1A1EEEEBBBB" "#FFFFC5C56060" "#9494D4D4FFFF" "#F2F2B6B6FFFF" "#A0A0F5F5EDED" "#E9E9E9E9E9E9" ]; + scrollback-unlimited = true; + terminal-title = ""; + use-system-font = true; + use-theme-colors = false; + visible-name = "Bearded Dark Vivid"; + }; + + "org/gnome/desktop/default/applications/terminal" = { + exec = "tilix"; + exec-arg = "-e"; + }; + + "org/gnome/settings-daemon/plugins/media-keys" = { + custom-keybindings = [ "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom0/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1/" "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2/" ]; + terminal = [ "" ]; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom1" = { + binding = "t"; + command = "tilix"; + name = "tilix"; + }; + + "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom2" = { + binding = "t"; + command = "tilix"; + name = "tilix"; + }; + }; +} diff --git a/home/_mixins/desktop/vorta.nix b/home/_mixins/desktop/vorta.nix new file mode 100644 index 0000000..0a357be --- /dev/null +++ b/home/_mixins/desktop/vorta.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + borgbackup + vorta + ]; + + systemd.user.services = { + vorta = { + Unit = { + Description = "Vorta"; + }; + Service = { + ExecStart = "${pkgs.vorta}/bin/vorta --daemonise"; + Restart = "on-failure"; + }; + Install = { + WantedBy = [ "default.target" ]; + }; + }; + }; +} diff --git a/home/_mixins/services/keybase-gui.nix b/home/_mixins/services/keybase-gui.nix new file mode 100644 index 0000000..0ad6085 --- /dev/null +++ b/home/_mixins/services/keybase-gui.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: +{ + home.packages = with pkgs; [ + keybase-gui + ]; + + systemd.user.services = { + keybase-gui = { + Unit = { + Description = "Keybase GUI"; + }; + Service = { + ExecStart = "${pkgs.keybase-gui}/bin/keybase-gui"; + Restart = "on-failure"; + }; + Install = { + WantedBy = [ "default.target" ]; + }; + }; + }; +} diff --git a/home/_mixins/services/keybase.nix b/home/_mixins/services/keybase.nix new file mode 100644 index 0000000..9844ac4 --- /dev/null +++ b/home/_mixins/services/keybase.nix @@ -0,0 +1,12 @@ +{ desktop, lib, ... }: { + imports = [ ] ++ lib.optionals (desktop != null) [ + ./keybase-gui.nix + ]; + + services = { + kbfs = { + enable = true; + mountPoint = "Keybase"; + }; + }; +} diff --git a/home/_mixins/services/syncthing-tray.nix b/home/_mixins/services/syncthing-tray.nix new file mode 100644 index 0000000..fc14743 --- /dev/null +++ b/home/_mixins/services/syncthing-tray.nix @@ -0,0 +1,8 @@ +{ pkgs, ... }: { + services.syncthing = { + tray = { + enable = true; + package = pkgs.unstable.syncthingtray; + }; + }; +} diff --git a/home/_mixins/services/syncthing.nix b/home/_mixins/services/syncthing.nix new file mode 100644 index 0000000..de627d0 --- /dev/null +++ b/home/_mixins/services/syncthing.nix @@ -0,0 +1,16 @@ +{ config, desktop, hostname, lib, ... }: { + imports = [ ] ++ lib.optionals (desktop != null) [ + ./syncthing-tray.nix + ]; + + services.syncthing = { + enable = true; + extraOptions = [ + "--config=${config.home.homeDirectory}/Syncthing/Devices/${hostname}" + "--data=${config.home.homeDirectory}/Syncthing/DB/${hostname}" + "--gui-address=0.0.0.0:8384" + "--no-default-folder" + "--no-browser" + ]; + }; +} diff --git a/home/gburd/.gitconfig b/home/gburd/.gitconfig new file mode 100644 index 0000000..1640f28 --- /dev/null +++ b/home/gburd/.gitconfig @@ -0,0 +1,54 @@ +[format] + pretty=format:%C(yellow)%h%Creset | %C(green)%ad (%ar)%Creset | %C(blue)%an%Creset | %s + +[push] + default = simple + +[branch] + autosetuprebase = always + +[receive] + denyCurrentBranch = warn + +[filter "media"] + clean = git media clean %f + smudge = git media smudge %f + required = true + +# http://nicercode.github.io/blog/2013-04-30-excel-and-line-endings/ +[filter "cr"] + clean = LC_CTYPE=C awk '{printf(\"%s\\n\", $0)}' | LC_CTYPE=C tr '\\r' '\\n' + smudge = tr '\\n' '\\r' + +[diff] + tool = meld +[difftool] + prompt = false +[difftool "meld"] + cmd = meld "$LOCAL" "$REMOTE" + +[merge] + tool = meld +[mergetool "meld"] + # Choose one of these 2 lines (not both!) explained below. + cmd = meld "$LOCAL" "$MERGED" "$REMOTE" --output "$MERGED" + cmd = meld "$LOCAL" "$BASE" "$REMOTE" --output "$MERGED" + +[core] + editor = vim +# editor = emacs -nw -q + excludesfile = ~/.gitignore_global + pager = less -FMRiX + quotepath = false + +[filter "lfs"] + process = git-lfs filter-process + required = true + clean = git-lfs clean -- %f + smudge = git-lfs smudge -- %f + +[init] + templateDir = /home/gregburd/.git-template + defaultBranch = main +[commit] + gpgsign = true diff --git a/home/gburd/features/cli/bash.nix b/home/gburd/_mixins/cli/bash.nix similarity index 100% rename from home/gburd/features/cli/bash.nix rename to home/gburd/_mixins/cli/bash.nix diff --git a/home/gburd/features/cli/bat.nix b/home/gburd/_mixins/cli/bat.nix similarity index 100% rename from home/gburd/features/cli/bat.nix rename to home/gburd/_mixins/cli/bat.nix diff --git a/home/gburd/features/cli/default.nix b/home/gburd/_mixins/cli/default.nix similarity index 88% rename from home/gburd/features/cli/default.nix rename to home/gburd/_mixins/cli/default.nix index 527ed9f..f2c00de 100644 --- a/home/gburd/features/cli/default.nix +++ b/home/gburd/_mixins/cli/default.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, config, ... }: { +{ pkgs, ... }: { imports = [ ./bash.nix ./bat.nix @@ -17,6 +17,7 @@ ./starship.nix ./xpo.nix ]; + home.packages = with pkgs; [ comma # Install and run programs by sticking a , before them distrobox # Nice escape hatch, integrates docker images with my environment @@ -24,7 +25,7 @@ bc # Calculator bottom # System viewer ncdu # TUI disk usage -# eza # Better ls + # eza # Better ls ripgrep # Better grep fd # Better find curl # cURL @@ -41,6 +42,6 @@ tly # Tally counter -# inputs.nh.default # nixos-rebuild and home-manager CLI wrapper + inputs.nh.default # nixos-rebuild and home-manager CLI wrapper ]; } diff --git a/home/gburd/features/cli/direnv.nix b/home/gburd/_mixins/cli/direnv.nix similarity index 100% rename from home/gburd/features/cli/direnv.nix rename to home/gburd/_mixins/cli/direnv.nix diff --git a/home/gburd/features/cli/fish.nix b/home/gburd/_mixins/cli/fish.nix similarity index 100% rename from home/gburd/features/cli/fish.nix rename to home/gburd/_mixins/cli/fish.nix diff --git a/home/gburd/features/cli/gh.nix b/home/gburd/_mixins/cli/gh.nix similarity index 100% rename from home/gburd/features/cli/gh.nix rename to home/gburd/_mixins/cli/gh.nix diff --git a/home/gburd/features/cli/git.nix b/home/gburd/_mixins/cli/git.nix similarity index 98% rename from home/gburd/features/cli/git.nix rename to home/gburd/_mixins/cli/git.nix index 0dab974..0308099 100644 --- a/home/gburd/features/cli/git.nix +++ b/home/gburd/_mixins/cli/git.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, config, ... }: +{ pkgs, config, ... }: let ssh = "${pkgs.openssh}/bin/ssh"; diff --git a/home/gburd/features/cli/gpg-commands.nix b/home/gburd/_mixins/cli/gpg-commands.nix similarity index 100% rename from home/gburd/features/cli/gpg-commands.nix rename to home/gburd/_mixins/cli/gpg-commands.nix diff --git a/home/gburd/features/cli/gpg.nix b/home/gburd/_mixins/cli/gpg.nix similarity index 89% rename from home/gburd/features/cli/gpg.nix rename to home/gburd/_mixins/cli/gpg.nix index 8f932cb..ecc466c 100644 --- a/home/gburd/features/cli/gpg.nix +++ b/home/gburd/_mixins/cli/gpg.nix @@ -1,4 +1,4 @@ -{ pkgs, config, lib, ... }: +{ pkgs, config, ... }: let pinentry = if config.gtk.enable then { @@ -10,13 +10,14 @@ let }; in { -# home.packages = pinentry.packages; + # home.packages = pinentry.packages; home.packages = [ pkgs.pinentry-curses ]; - services.gpg-agent = { #TODO: gnupg vs gpg-agent ? + services.gpg-agent = { + #TODO: gnupg vs gpg-agent ? enable = true; enableSshSupport = true; -# sshKeys = [ "149F16412997785363112F3DBD713BC91D51B831" ]; + # sshKeys = [ "149F16412997785363112F3DBD713BC91D51B831" ]; pinentryFlavor = pinentry.name; enableExtraSocket = true; }; diff --git a/home/gburd/features/cli/jujutsu.nix b/home/gburd/_mixins/cli/jujutsu.nix similarity index 100% rename from home/gburd/features/cli/jujutsu.nix rename to home/gburd/_mixins/cli/jujutsu.nix diff --git a/home/gburd/features/cli/nix-index.nix b/home/gburd/_mixins/cli/nix-index.nix similarity index 100% rename from home/gburd/features/cli/nix-index.nix rename to home/gburd/_mixins/cli/nix-index.nix diff --git a/home/gburd/features/cli/pfetch.nix b/home/gburd/_mixins/cli/pfetch.nix similarity index 100% rename from home/gburd/features/cli/pfetch.nix rename to home/gburd/_mixins/cli/pfetch.nix diff --git a/home/gburd/features/cli/ranger.nix b/home/gburd/_mixins/cli/ranger.nix similarity index 100% rename from home/gburd/features/cli/ranger.nix rename to home/gburd/_mixins/cli/ranger.nix diff --git a/home/gburd/features/cli/screen.nix b/home/gburd/_mixins/cli/screen.nix similarity index 100% rename from home/gburd/features/cli/screen.nix rename to home/gburd/_mixins/cli/screen.nix diff --git a/home/gburd/features/cli/shellcolor.nix b/home/gburd/_mixins/cli/shellcolor.nix similarity index 100% rename from home/gburd/features/cli/shellcolor.nix rename to home/gburd/_mixins/cli/shellcolor.nix diff --git a/home/gburd/features/cli/ssh.nix b/home/gburd/_mixins/cli/ssh.nix similarity index 100% rename from home/gburd/features/cli/ssh.nix rename to home/gburd/_mixins/cli/ssh.nix diff --git a/home/gburd/features/cli/starship.nix b/home/gburd/_mixins/cli/starship.nix similarity index 82% rename from home/gburd/features/cli/starship.nix rename to home/gburd/_mixins/cli/starship.nix index b532192..1002001 100644 --- a/home/gburd/features/cli/starship.nix +++ b/home/gburd/_mixins/cli/starship.nix @@ -50,18 +50,25 @@ style = "bold red"; }; custom = { - nix_inspect = let - excluded = [ - "kitty" "imagemagick" "ncurses" "user-environment" "pciutils" "binutils-wrapper" - ]; - in { - disabled = false; - when = "test -z $IN_NIX_SHELL"; - command = "${(lib.getExe pkgs.nix-inspect)} ${(lib.concatStringsSep " " excluded)}"; - format = "[($output <- )$symbol]($style) "; - symbol = "ο‹œ "; - style = "bold blue"; - }; + nix_inspect = + let + excluded = [ + "kitty" + "imagemagick" + "ncurses" + "user-environment" + "pciutils" + "binutils-wrapper" + ]; + in + { + disabled = false; + when = "test -z $IN_NIX_SHELL"; + command = "${(lib.getExe pkgs.nix-inspect)} ${(lib.concatStringsSep " " excluded)}"; + format = "[($output <- )$symbol]($style) "; + symbol = "ο‹œ "; + style = "bold blue"; + }; }; character = { diff --git a/home/gburd/features/cli/xpo.nix b/home/gburd/_mixins/cli/xpo.nix similarity index 100% rename from home/gburd/features/cli/xpo.nix rename to home/gburd/_mixins/cli/xpo.nix diff --git a/home/gburd/global/default.nix b/home/gburd/_mixins/default.nix similarity index 80% rename from home/gburd/global/default.nix rename to home/gburd/_mixins/default.nix index df8f5b5..494d925 100644 --- a/home/gburd/global/default.nix +++ b/home/gburd/_mixins/default.nix @@ -1,21 +1,17 @@ { inputs, lib, pkgs, config, outputs, ... }: -let - inherit (inputs.nix-colors) colorSchemes; - inherit (inputs.nix-colors.lib-contrib { inherit pkgs; }) colorschemeFromPicture nixWallpaperFromScheme; -in { imports = [ inputs.impermanence.nixosModules.home-manager.impermanence inputs.nix-colors.homeManagerModule - ../features/cli - ../features/nvim + ./cli + ./nvim ] ++ (builtins.attrValues outputs.homeManagerModules); nixpkgs = { overlays = builtins.attrValues outputs.overlays; config = { allowUnfree = true; - allowUnfreePredicate = (_: true); + allowUnfreePredicate = _: true; }; }; @@ -41,7 +37,7 @@ in stateVersion = lib.mkDefault "23.05"; sessionPath = [ "$HOME/.local/bin" ]; sessionVariables = { - FLAKE = "$HOME/Documents/NixConfig"; + FLAKE = "$HOME/ws/nix-config"; }; persistence = { diff --git a/home/gburd/features/desktop/common/alacritty.nix b/home/gburd/_mixins/desktop/common/alacritty.nix similarity index 100% rename from home/gburd/features/desktop/common/alacritty.nix rename to home/gburd/_mixins/desktop/common/alacritty.nix diff --git a/home/gburd/features/desktop/common/default.nix b/home/gburd/_mixins/desktop/common/default.nix similarity index 90% rename from home/gburd/features/desktop/common/default.nix rename to home/gburd/_mixins/desktop/common/default.nix index 32ae268..a53127f 100644 --- a/home/gburd/features/desktop/common/default.nix +++ b/home/gburd/_mixins/desktop/common/default.nix @@ -6,7 +6,7 @@ ./alacritty.nix ./font.nix ./gtk.nix -# ./kdeconnect.nix + # ./kdeconnect.nix ./pavucontrol.nix ./playerctl.nix ./qt.nix diff --git a/home/gburd/features/desktop/common/deluge.nix b/home/gburd/_mixins/desktop/common/deluge.nix similarity index 100% rename from home/gburd/features/desktop/common/deluge.nix rename to home/gburd/_mixins/desktop/common/deluge.nix diff --git a/home/gburd/features/desktop/common/discord.nix b/home/gburd/_mixins/desktop/common/discord.nix similarity index 99% rename from home/gburd/features/desktop/common/discord.nix rename to home/gburd/_mixins/desktop/common/discord.nix index 68c9221..97492f9 100644 --- a/home/gburd/features/desktop/common/discord.nix +++ b/home/gburd/_mixins/desktop/common/discord.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: +{ config, pkgs, ... }: let inherit (config.colorscheme) colors; in { diff --git a/home/gburd/features/desktop/common/dragon.nix b/home/gburd/_mixins/desktop/common/dragon.nix similarity index 100% rename from home/gburd/features/desktop/common/dragon.nix rename to home/gburd/_mixins/desktop/common/dragon.nix diff --git a/home/gburd/_mixins/desktop/common/firefox.nix b/home/gburd/_mixins/desktop/common/firefox.nix new file mode 100644 index 0000000..23e1a1c --- /dev/null +++ b/home/gburd/_mixins/desktop/common/firefox.nix @@ -0,0 +1,127 @@ +{ pkgs, ... }: +{ + programs.browserpass.enable = true; + programs.firefox = { + enable = true; + + package = pkgs.wrapFirefox pkgs.firefox-unwrapped { + extraPolicies = { + CaptivePortal = false; + DisableFirefoxStudies = true; + DisablePocket = true; + DisableTelemetry = true; + DisableFirefoxAccounts = false; + NoDefaultBookmarks = true; + OfferToSaveLogins = false; + OfferToSaveLoginsDefault = false; + PasswordManagerEnabled = false; + FirefoxHome = { + Search = true; + Pocket = false; + Snippets = false; + TopSites = false; + Highlights = false; + }; + UserMessaging = { + ExtensionRecommendations = false; + SkipOnboarding = true; + }; + }; + }; + + profiles.gburd = { + id = 0; + bookmarks = { }; + extensions = with pkgs.inputs.firefox-addons; [ + # autoplay-no-more + bypass-paywalls-clean + i-dont-care-about-cookies + # kagi-search-for-firefox + clearurls + decentraleyes + disconnect + duckduckgo-privacy-essentials + floccus + ghostery + # https-everywhere + # languagetool + # onetab + privacy-badger + privacy-badger + privacy-redirect + proton-pass + react-devtools + ublock-origin + ]; + search = { + force = true; + default = "Kagi"; + engines = { + "Nix Packages" = { + urls = [{ + template = "https://search.nixos.org/packages"; + params = [ + { name = "type"; value = "packages"; } + { name = "query"; value = "{searchTerms}"; } + ]; + }]; + icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; + definedAliases = [ "@np" ]; + }; + "NixOS Wiki" = { + urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; + iconUpdateURL = "https://nixos.wiki/favicon.png"; + updateInterval = 24 * 60 * 60 * 1000; + definedAliases = [ "@nw" ]; + }; + "Wikipedia (en)".metaData.alias = "@wiki"; + "Google".metaData.hidden = true; + "Amazon.com".metaData.hidden = true; + "Bing".metaData.hidden = true; + "eBay".metaData.hidden = true; + }; + }; + extraConfig = '' + user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); + user_pref("full-screen-api.ignore-widgets", true); + user_pref("media.ffmpeg.vaapi.enabled", true); + user_pref("media.rdd-vpx.enabled", true); + ''; + userChrome = '' + # a css + ''; + userContent = '' + # Here too + ''; + settings = { + "general.smoothScroll" = true; + "browser.disableResetPrompt" = true; + "browser.download.panel.shown" = true; + "browser.download.useDownloadDir" = false; + "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; + "browser.shell.checkDefaultBrowser" = false; + "browser.shell.defaultBrowserCheckCount" = 1; + "browser.startup.homepage" = "about:blank"; + "browser.uiCustomization.state" = ''{"placements":{"widget-overflow-fixed-list":[],"nav-bar":["back-button","forward-button","stop-reload-button","home-button","urlbar-container","downloads-button","library-button","ublock0_raymondhill_net-browser-action","_testpilot-containers-browser-action"],"toolbar-menubar":["menubar-items"],"TabsToolbar":["tabbrowser-tabs","new-tab-button","alltabs-button"],"PersonalToolbar":["import-button","personal-bookmarks"]},"seen":["save-to-pocket-button","developer-button","ublock0_raymondhill_net-browser-action","_testpilot-containers-browser-action"],"dirtyAreaCache":["nav-bar","PersonalToolbar","toolbar-menubar","TabsToolbar","widget-overflow-fixed-list"],"currentVersion":18,"newElementCount":4}''; + "dom.security.https_only_mode" = true; + "identity.fxaccounts.enabled" = false; + "privacy.trackingprotection.enabled" = true; + "signon.rememberSignons" = false; + }; + }; + }; + + home = { + persistence = { + # Not persisting is safer, but... + "/persist/home/gburd".directories = [ ".mozilla/firefox" ]; + }; + }; + + xdg.mimeApps.defaultApplications = { + "text/html" = [ "firefox.desktop" ]; + "text/xml" = [ "firefox.desktop" ]; + "x-scheme-handler/http" = [ "firefox.desktop" ]; + "x-scheme-handler/https" = [ "firefox.desktop" ]; + }; +} diff --git a/home/gburd/features/desktop/common/font.nix b/home/gburd/_mixins/desktop/common/font.nix similarity index 100% rename from home/gburd/features/desktop/common/font.nix rename to home/gburd/_mixins/desktop/common/font.nix diff --git a/home/gburd/features/desktop/common/gnome-wm/default.nix b/home/gburd/_mixins/desktop/common/gnome-wm/default.nix similarity index 75% rename from home/gburd/features/desktop/common/gnome-wm/default.nix rename to home/gburd/_mixins/desktop/common/gnome-wm/default.nix index dabc9e7..09785e3 100644 --- a/home/gburd/features/desktop/common/gnome-wm/default.nix +++ b/home/gburd/_mixins/desktop/common/gnome-wm/default.nix @@ -1,14 +1,14 @@ { pkgs, ... }: { - imports = []; + imports = [ ]; home.packages = with pkgs; [ # Gnome3 apps -# gnome3.eog # image viewer -# gnome3.evince # pdf reader + # gnome3.eog # image viewer + # gnome3.evince # pdf reader # Desktop look & feel -# gnome.gnome-tweak-tool + # gnome.gnome-tweak-tool # Extensions gnomeExtensions.appindicator @@ -32,8 +32,8 @@ # gnome.gnome-tweaks # ] # }; -# dbus.packages = [ pkgs.gnome.dconf ]; -# udev.packages = [ pkgs.gnome.gnome-settings- + # dbus.packages = [ pkgs.gnome.dconf ]; + # udev.packages = [ pkgs.gnome.gnome-settings- home.sessionVariables = { MOZ_ENABLE_WAYLAND = 1; diff --git a/home/gburd/features/desktop/common/gtk.nix b/home/gburd/_mixins/desktop/common/gtk.nix similarity index 100% rename from home/gburd/features/desktop/common/gtk.nix rename to home/gburd/_mixins/desktop/common/gtk.nix diff --git a/home/gburd/features/desktop/common/kdeconnect.nix b/home/gburd/_mixins/desktop/common/kdeconnect.nix similarity index 98% rename from home/gburd/features/desktop/common/kdeconnect.nix rename to home/gburd/_mixins/desktop/common/kdeconnect.nix index 7dc253f..6512f3a 100644 --- a/home/gburd/features/desktop/common/kdeconnect.nix +++ b/home/gburd/_mixins/desktop/common/kdeconnect.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: +{ pkgs, ... }: let diff --git a/home/gburd/features/desktop/common/pavucontrol.nix b/home/gburd/_mixins/desktop/common/pavucontrol.nix similarity index 100% rename from home/gburd/features/desktop/common/pavucontrol.nix rename to home/gburd/_mixins/desktop/common/pavucontrol.nix diff --git a/home/gburd/features/desktop/common/playerctl.nix b/home/gburd/_mixins/desktop/common/playerctl.nix similarity index 100% rename from home/gburd/features/desktop/common/playerctl.nix rename to home/gburd/_mixins/desktop/common/playerctl.nix diff --git a/home/gburd/features/desktop/common/protonmail-bridge.nix b/home/gburd/_mixins/desktop/common/protonmail-bridge.nix similarity index 100% rename from home/gburd/features/desktop/common/protonmail-bridge.nix rename to home/gburd/_mixins/desktop/common/protonmail-bridge.nix diff --git a/home/gburd/features/desktop/common/qt.nix b/home/gburd/_mixins/desktop/common/qt.nix similarity index 85% rename from home/gburd/features/desktop/common/qt.nix rename to home/gburd/_mixins/desktop/common/qt.nix index 261768f..1ceedde 100644 --- a/home/gburd/features/desktop/common/qt.nix +++ b/home/gburd/_mixins/desktop/common/qt.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: +{ pkgs, ... }: { qt = { enable = true; diff --git a/home/gburd/features/desktop/common/slack.nix b/home/gburd/_mixins/desktop/common/slack.nix similarity index 100% rename from home/gburd/features/desktop/common/slack.nix rename to home/gburd/_mixins/desktop/common/slack.nix diff --git a/home/gburd/features/desktop/common/sublime-music.nix b/home/gburd/_mixins/desktop/common/sublime-music.nix similarity index 86% rename from home/gburd/features/desktop/common/sublime-music.nix rename to home/gburd/_mixins/desktop/common/sublime-music.nix index ba177b0..0bd6b04 100644 --- a/home/gburd/features/desktop/common/sublime-music.nix +++ b/home/gburd/_mixins/desktop/common/sublime-music.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, ... }: { +{ pkgs, ... }: { home.packages = [ pkgs.sublime-music ]; home.persistence = { "/persist/home/gburd".directories = [ ".config/sublime-music" ]; diff --git a/home/gburd/features/desktop/common/wayland-wm/default.nix b/home/gburd/_mixins/desktop/common/wayland-wm/default.nix similarity index 100% rename from home/gburd/features/desktop/common/wayland-wm/default.nix rename to home/gburd/_mixins/desktop/common/wayland-wm/default.nix diff --git a/home/gburd/features/desktop/common/wayland-wm/gammastep.nix b/home/gburd/_mixins/desktop/common/wayland-wm/gammastep.nix similarity index 100% rename from home/gburd/features/desktop/common/wayland-wm/gammastep.nix rename to home/gburd/_mixins/desktop/common/wayland-wm/gammastep.nix diff --git a/home/gburd/features/desktop/common/wayland-wm/hyprland-vnc.nix b/home/gburd/_mixins/desktop/common/wayland-wm/hyprland-vnc.nix similarity index 100% rename from home/gburd/features/desktop/common/wayland-wm/hyprland-vnc.nix rename to home/gburd/_mixins/desktop/common/wayland-wm/hyprland-vnc.nix diff --git a/home/gburd/features/desktop/common/wayland-wm/kitty.nix b/home/gburd/_mixins/desktop/common/wayland-wm/kitty.nix similarity index 100% rename from home/gburd/features/desktop/common/wayland-wm/kitty.nix rename to home/gburd/_mixins/desktop/common/wayland-wm/kitty.nix diff --git a/home/gburd/features/desktop/common/wayland-wm/mako.nix b/home/gburd/_mixins/desktop/common/wayland-wm/mako.nix similarity index 100% rename from home/gburd/features/desktop/common/wayland-wm/mako.nix rename to home/gburd/_mixins/desktop/common/wayland-wm/mako.nix diff --git a/home/gburd/features/desktop/common/wayland-wm/qutebrowser.nix b/home/gburd/_mixins/desktop/common/wayland-wm/qutebrowser.nix similarity index 99% rename from home/gburd/features/desktop/common/wayland-wm/qutebrowser.nix rename to home/gburd/_mixins/desktop/common/wayland-wm/qutebrowser.nix index 9efd4f5..43816a0 100644 --- a/home/gburd/features/desktop/common/wayland-wm/qutebrowser.nix +++ b/home/gburd/_mixins/desktop/common/wayland-wm/qutebrowser.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, ... }: let inherit (config.colorscheme) colors kind; in diff --git a/home/gburd/features/desktop/common/wayland-wm/swayidle.nix b/home/gburd/_mixins/desktop/common/wayland-wm/swayidle.nix similarity index 100% rename from home/gburd/features/desktop/common/wayland-wm/swayidle.nix rename to home/gburd/_mixins/desktop/common/wayland-wm/swayidle.nix diff --git a/home/gburd/features/desktop/common/wayland-wm/swaylock.nix b/home/gburd/_mixins/desktop/common/wayland-wm/swaylock.nix similarity index 100% rename from home/gburd/features/desktop/common/wayland-wm/swaylock.nix rename to home/gburd/_mixins/desktop/common/wayland-wm/swaylock.nix diff --git a/home/gburd/features/desktop/common/wayland-wm/waybar.nix b/home/gburd/_mixins/desktop/common/wayland-wm/waybar.nix similarity index 100% rename from home/gburd/features/desktop/common/wayland-wm/waybar.nix rename to home/gburd/_mixins/desktop/common/wayland-wm/waybar.nix diff --git a/home/gburd/features/desktop/common/wayland-wm/wezterm.nix b/home/gburd/_mixins/desktop/common/wayland-wm/wezterm.nix similarity index 98% rename from home/gburd/features/desktop/common/wayland-wm/wezterm.nix rename to home/gburd/_mixins/desktop/common/wayland-wm/wezterm.nix index 692f5fb..ceb31bf 100644 --- a/home/gburd/features/desktop/common/wayland-wm/wezterm.nix +++ b/home/gburd/_mixins/desktop/common/wayland-wm/wezterm.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, ... }: let inherit (config) colorscheme; diff --git a/home/gburd/features/desktop/common/wayland-wm/wofi-run-shell.patch b/home/gburd/_mixins/desktop/common/wayland-wm/wofi-run-shell.patch similarity index 100% rename from home/gburd/features/desktop/common/wayland-wm/wofi-run-shell.patch rename to home/gburd/_mixins/desktop/common/wayland-wm/wofi-run-shell.patch diff --git a/home/gburd/features/desktop/common/wayland-wm/wofi.nix b/home/gburd/_mixins/desktop/common/wayland-wm/wofi.nix similarity index 100% rename from home/gburd/features/desktop/common/wayland-wm/wofi.nix rename to home/gburd/_mixins/desktop/common/wayland-wm/wofi.nix diff --git a/home/gburd/features/desktop/common/wayland-wm/zathura.nix b/home/gburd/_mixins/desktop/common/wayland-wm/zathura.nix similarity index 100% rename from home/gburd/features/desktop/common/wayland-wm/zathura.nix rename to home/gburd/_mixins/desktop/common/wayland-wm/zathura.nix diff --git a/home/gburd/features/desktop/gnome/default.nix b/home/gburd/_mixins/desktop/gnome/default.nix similarity index 91% rename from home/gburd/features/desktop/gnome/default.nix rename to home/gburd/_mixins/desktop/gnome/default.nix index 7041143..ebb0425 100644 --- a/home/gburd/features/desktop/gnome/default.nix +++ b/home/gburd/_mixins/desktop/gnome/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, lib, ... }: { +{ pkgs, ... }: { imports = [ ../common ../common/gnome-wm diff --git a/home/gburd/features/desktop/gnome/tty-init.nix b/home/gburd/_mixins/desktop/gnome/tty-init.nix similarity index 100% rename from home/gburd/features/desktop/gnome/tty-init.nix rename to home/gburd/_mixins/desktop/gnome/tty-init.nix diff --git a/home/gburd/features/desktop/wireless/default.nix b/home/gburd/_mixins/desktop/wireless/default.nix similarity index 100% rename from home/gburd/features/desktop/wireless/default.nix rename to home/gburd/_mixins/desktop/wireless/default.nix diff --git a/home/gburd/features/desktop/wireless/wpa-gui.nix b/home/gburd/_mixins/desktop/wireless/wpa-gui.nix similarity index 100% rename from home/gburd/features/desktop/wireless/wpa-gui.nix rename to home/gburd/_mixins/desktop/wireless/wpa-gui.nix diff --git a/home/gburd/features/emacs/burd.org b/home/gburd/_mixins/emacs/burd.org similarity index 100% rename from home/gburd/features/emacs/burd.org rename to home/gburd/_mixins/emacs/burd.org diff --git a/home/gburd/features/emacs/default.nix b/home/gburd/_mixins/emacs/default.nix similarity index 100% rename from home/gburd/features/emacs/default.nix rename to home/gburd/_mixins/emacs/default.nix diff --git a/home/gburd/features/emacs/init.el b/home/gburd/_mixins/emacs/init.el similarity index 100% rename from home/gburd/features/emacs/init.el rename to home/gburd/_mixins/emacs/init.el diff --git a/home/gburd/features/emacs/theme.nix b/home/gburd/_mixins/emacs/theme.nix similarity index 100% rename from home/gburd/features/emacs/theme.nix rename to home/gburd/_mixins/emacs/theme.nix diff --git a/home/gburd/features/games/default.nix b/home/gburd/_mixins/games/default.nix similarity index 79% rename from home/gburd/features/games/default.nix rename to home/gburd/_mixins/games/default.nix index eac62c1..77cc96e 100644 --- a/home/gburd/features/games/default.nix +++ b/home/gburd/_mixins/games/default.nix @@ -1,6 +1,6 @@ { pkgs, ... }: { imports = [ -# ./steam.nix + # ./steam.nix ]; home.packages = with pkgs; [ gamescope ]; } diff --git a/home/gburd/features/games/steam.nix b/home/gburd/_mixins/games/steam.nix similarity index 100% rename from home/gburd/features/games/steam.nix rename to home/gburd/_mixins/games/steam.nix diff --git a/home/gburd/features/helix/default.nix b/home/gburd/_mixins/helix/default.nix similarity index 100% rename from home/gburd/features/helix/default.nix rename to home/gburd/_mixins/helix/default.nix diff --git a/home/gburd/features/helix/theme.nix b/home/gburd/_mixins/helix/theme.nix similarity index 96% rename from home/gburd/features/helix/theme.nix rename to home/gburd/_mixins/helix/theme.nix index c53b4f8..94b4151 100644 --- a/home/gburd/features/helix/theme.nix +++ b/home/gburd/_mixins/helix/theme.nix @@ -1,6 +1,6 @@ { colorscheme }: { "${colorscheme.slug}" = { - palette = builtins.mapAttrs (name: value: "#${value}") colorscheme.colors; # Add leading '#' + palette = builtins.mapAttrs (_name: value: "#${value}") colorscheme.colors; # Add leading '#' "attributes" = "base09"; "comment" = { fg = "base03"; modifiers = [ "italic" ]; }; "constant" = "base09"; diff --git a/home/gburd/features/music/default.nix b/home/gburd/_mixins/music/default.nix similarity index 100% rename from home/gburd/features/music/default.nix rename to home/gburd/_mixins/music/default.nix diff --git a/home/gburd/features/nvim/default.nix b/home/gburd/_mixins/nvim/default.nix similarity index 100% rename from home/gburd/features/nvim/default.nix rename to home/gburd/_mixins/nvim/default.nix diff --git a/home/gburd/features/nvim/lsp.nix b/home/gburd/_mixins/nvim/lsp.nix similarity index 100% rename from home/gburd/features/nvim/lsp.nix rename to home/gburd/_mixins/nvim/lsp.nix diff --git a/home/gburd/features/nvim/syntaxes.nix b/home/gburd/_mixins/nvim/syntaxes.nix similarity index 100% rename from home/gburd/features/nvim/syntaxes.nix rename to home/gburd/_mixins/nvim/syntaxes.nix diff --git a/home/gburd/features/nvim/theme.nix b/home/gburd/_mixins/nvim/theme.nix similarity index 100% rename from home/gburd/features/nvim/theme.nix rename to home/gburd/_mixins/nvim/theme.nix diff --git a/home/gburd/features/nvim/ui.nix b/home/gburd/_mixins/nvim/ui.nix similarity index 100% rename from home/gburd/features/nvim/ui.nix rename to home/gburd/_mixins/nvim/ui.nix diff --git a/home/gburd/features/pass/default.nix b/home/gburd/_mixins/pass/default.nix similarity index 100% rename from home/gburd/features/pass/default.nix rename to home/gburd/_mixins/pass/default.nix diff --git a/home/gburd/features/productivity/default.nix b/home/gburd/_mixins/productivity/default.nix similarity index 100% rename from home/gburd/features/productivity/default.nix rename to home/gburd/_mixins/productivity/default.nix diff --git a/home/gburd/features/productivity/khal.nix b/home/gburd/_mixins/productivity/khal.nix similarity index 100% rename from home/gburd/features/productivity/khal.nix rename to home/gburd/_mixins/productivity/khal.nix diff --git a/home/gburd/features/productivity/khard.nix b/home/gburd/_mixins/productivity/khard.nix similarity index 100% rename from home/gburd/features/productivity/khard.nix rename to home/gburd/_mixins/productivity/khard.nix diff --git a/home/gburd/features/productivity/mail.nix b/home/gburd/_mixins/productivity/mail.nix similarity index 97% rename from home/gburd/features/productivity/mail.nix rename to home/gburd/_mixins/productivity/mail.nix index dfefd67..195d6c0 100644 --- a/home/gburd/features/productivity/mail.nix +++ b/home/gburd/_mixins/productivity/mail.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, config, ... }: +{ pkgs, config, ... }: let mbsync = "${config.programs.mbsync.package}/bin/mbsync"; @@ -32,7 +32,7 @@ in personal = rec { primary = true; address = "greg@burd.me"; - aliases = ["gregburd@gmail.com"]; + aliases = [ "gregburd@gmail.com" ]; passwordCommand = "${pass} ${smtp.host}/${address}"; imap.host = "mail.burd.me"; diff --git a/home/gburd/_mixins/productivity/neomutt.nix b/home/gburd/_mixins/productivity/neomutt.nix new file mode 100644 index 0000000..3378414 --- /dev/null +++ b/home/gburd/_mixins/productivity/neomutt.nix @@ -0,0 +1,232 @@ +{ config, pkgs, lib, ... }: { + xdg = { + desktopEntries = { + neomutt = { + name = "Neomutt"; + genericName = "Email Client"; + comment = "Read and send emails"; + exec = "neomutt %U"; + icon = "mutt"; + terminal = true; + categories = [ "Network" "Email" "ConsoleOnly" ]; + type = "Application"; + mimeType = [ "x-scheme-handler/mailto" ]; + }; + }; + mimeApps.defaultApplications = { + "x-scheme-handler/mailto" = "neomutt.desktop"; + }; + }; + + programs.neomutt = { + enable = true; + vimKeys = true; + checkStatsInterval = 60; + sidebar = { + enable = true; + width = 30; + }; + settings = { + mark_old = "no"; + text_flowed = "yes"; + reverse_name = "yes"; + query_command = ''"khard email --parsable '%s'"''; + }; + binds = [ + { + action = "sidebar-toggle-visible"; + key = "\\\\"; + map = [ "index" "pager" ]; + } + { + action = "group-reply"; + key = "L"; + map = [ "index" "pager" ]; + } + { + action = "toggle-new"; + key = "B"; + map = [ "index" ]; + } + ]; + macros = + let + browserpipe = + "cat /dev/stdin > /tmp/muttmail.html && xdg-open /tmp/muttmail.html"; + in + [ + { + action = ""; + key = "J"; + map = [ "index" "pager" ]; + } + { + action = ""; + key = "K"; + map = [ "index" "pager" ]; + } + { + action = + ":set confirmappend=no\\n+Archive:set confirmappend=yes\\n"; + key = "A"; + map = [ "index" "pager" ]; + } + { + action = "${browserpipe}"; + key = "V"; + map = [ "attach" ]; + } + { + action = "${pkgs.urlscan}/bin/urlscan"; + key = "F"; + map = [ "pager" ]; + } + { + action = + "html${browserpipe}"; + key = "V"; + map = [ "index" "pager" ]; + } + ]; + extraConfig = + let + # Collect all addresses and aliases + addresses = lib.flatten (lib.mapAttrsToList (_n: v: [ v.address ] ++ v.aliases) config.accounts.email.accounts); + in + '' + alternates "${lib.concatStringsSep "|" addresses}" + '' + '' + # From: https://github.com/altercation/mutt-colors-solarized/blob/master/mutt-colors-solarized-dark-16.muttrc + + # basic colors --------------------------------------------------------- + color normal brightyellow default + color error red default + color tilde black default + color message cyan default + color markers red white + color attachment white default + color search brightmagenta default + color status brightyellow black + color indicator brightblack yellow + color tree cyan default # arrow in threads + + # basic monocolor screen + mono bold bold + mono underline underline + mono indicator reverse + mono error bold + + # index ---------------------------------------------------------------- + + color index red default "~A" # all messages + color index blue default "~N" # new messages + color index brightred default "~E" # expired messages + color index blue default "~N" # new messages + color index blue default "~O" # old messages + color index brightmagenta default "~Q" # messages that have been replied to + color index brightgreen default "~R" # read messages + color index blue default "~U" # unread messages + color index blue default "~U~$" # unread, unreferenced messages + color index cyan default "~v" # messages part of a collapsed thread + color index magenta default "~P" # messages from me + color index cyan default "~p!~F" # messages to me + color index cyan default "~N~p!~F" # new messages to me + color index cyan default "~U~p!~F" # unread messages to me + color index brightgreen default "~R~p!~F" # messages to me + color index red default "~F" # flagged messages + color index red default "~F~p" # flagged messages to me + color index red default "~N~F" # new flagged messages + color index red default "~N~F~p" # new flagged messages to me + color index red default "~U~F~p" # new flagged messages to me + color index brightcyan default "~v~(!~N)" # collapsed thread with no unread + color index yellow default "~v~(~N)" # collapsed thread with some unread + color index green default "~N~v~(~N)" # collapsed thread with unread parent + color index red black "~v~(~F)!~N" # collapsed thread with flagged, no unread + color index yellow black "~v~(~F~N)" # collapsed thread with some unread & flagged + color index green black "~N~v~(~F~N)" # collapsed thread with unread parent & flagged + color index green black "~N~v~(~F)" # collapsed thread with unread parent, no unread inside, but some flagged + color index cyan black "~v~(~p)" # collapsed thread with unread parent, no unread inside, some to me directly + color index yellow red "~v~(~D)" # thread with deleted (doesn't differentiate between all or partial) + color index yellow default "~(~N)" # messages in threads with some unread + color index green default "~S" # superseded messages + color index black red "~D" # deleted messages + color index black red "~N~D" # deleted messages + color index red default "~T" # tagged messages + + # message headers ------------------------------------------------------ + + color hdrdefault brightgreen default + color header brightyellow default "^(From)" + color header blue default "^(Subject)" + + # body ----------------------------------------------------------------- + + color quoted blue default + color quoted1 cyan default + color quoted2 yellow default + color quoted3 red default + color quoted4 brightred default + + color signature brightgreen default + color bold black default + color underline black default + color normal default default + color body brightcyan default "[;:][-o][)/(|]" # emoticons + color body brightcyan default "[;:][)(|]" # emoticons + color body brightcyan default "[*]?((N)?ACK|CU|LOL|SCNR|BRB|BTW|CWYL|\ + |FWIW|vbg|GD&R|HTH|HTHBE|IMHO|IMNSHO|\ + |IRL|RTFM|ROTFL|ROFL|YMMV)[*]?" + color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? + color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? + + ## pgp + + color body red default "(BAD signature)" + color body cyan default "(Good signature)" + color body brightblack default "^gpg: Good signature .*" + color body brightyellow default "^gpg: " + color body brightyellow red "^gpg: BAD signature from.*" + mono body bold "^gpg: Good signature" + mono body bold "^gpg: BAD signature from.*" + + # yes, an insance URL regex + color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" + # and a heavy handed email regex + color body magenta default "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])" + + # Various smilies and the like + color body brightwhite default "<[Gg]>" # + color body brightwhite default "<[Bb][Gg]>" # + color body yellow default " [;:]-*[})>{(<|]" # :-) etc... + # *bold* + color body blue default "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" + mono body bold "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" + # _underline_ + color body blue default "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" + mono body underline "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" + # /italic/ (Sometimes gets directory names) + color body blue default "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" + mono body underline "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" + + # Border lines. + color body blue default "( *[-+=#*~_]){6,}" + + # From https://github.com/jessfraz/dockerfiles/blob/master/mutt/.mutt/mutt-patch-highlighting.muttrc + color body cyan default ^(Signed-off-by).* + color body cyan default ^(Docker-DCO-1.1-Signed-off-by).* + color body brightwhite default ^(Cc) + color body yellow default "^diff \-.*" + color body brightwhite default "^index [a-f0-9].*" + color body brightblue default "^---$" + color body white default "^\-\-\- .*" + color body white default "^[\+]{3} .*" + color body green default "^[\+][^\+]+.*" + color body red default "^\-[^\-]+.*" + color body brightblue default "^@@ .*" + color body green default "LGTM" + color body brightmagenta default "-- Commit Summary --" + color body brightmagenta default "-- File Changes --" + color body brightmagenta default "-- Patch Links --" + ''; + }; +} diff --git a/home/gburd/features/productivity/todoman.nix b/home/gburd/_mixins/productivity/todoman.nix similarity index 100% rename from home/gburd/features/productivity/todoman.nix rename to home/gburd/_mixins/productivity/todoman.nix diff --git a/home/gburd/features/productivity/vdirsyncer.nix b/home/gburd/_mixins/productivity/vdirsyncer.nix similarity index 98% rename from home/gburd/features/productivity/vdirsyncer.nix rename to home/gburd/_mixins/productivity/vdirsyncer.nix index 3aea3c0..672c6f8 100644 --- a/home/gburd/features/productivity/vdirsyncer.nix +++ b/home/gburd/_mixins/productivity/vdirsyncer.nix @@ -1,4 +1,4 @@ -{ pkgs, lib, config, ... }: +{ pkgs, config, ... }: let pass = "${config.programs.password-store.package}/bin/pass"; in diff --git a/home/gburd/features/rgb/default.nix b/home/gburd/_mixins/rgb/default.nix similarity index 100% rename from home/gburd/features/rgb/default.nix rename to home/gburd/_mixins/rgb/default.nix diff --git a/home/gburd/desktop.nix b/home/gburd/desktop.nix new file mode 100644 index 0000000..4128a3d --- /dev/null +++ b/home/gburd/desktop.nix @@ -0,0 +1,29 @@ +{ config, lib, ... }: +with lib.hm.gvariant; +{ + imports = [ + ../../desktop/audio-recorder.nix + ../../desktop/celluloid.nix + ../../desktop/dconf-editor.nix + ../../desktop/emote.nix + ../../desktop/gitkraken.nix + ../../desktop/gnome-sound-recorder.nix + ../../desktop/localsend.nix + ../../desktop/meld.nix + ../../desktop/rhythmbox.nix + ../../desktop/sakura.nix + ../../desktop/tilix.nix + ]; + + dconf.settings = { + "org/gnome/rhythmbox/rhythmdb" = { + locations = [ "file://${config.home.homeDirectory}/Studio/Music" ]; + monitor-library = true; + }; + }; + + # Authrorize X11 access in Distrobox + home.file.".distroboxrc".text = '' + xhost +si:localuser:$USER + ''; +} diff --git a/home/gburd/face.png b/home/gburd/face.png new file mode 100644 index 0000000..ef9da94 Binary files /dev/null and b/home/gburd/face.png differ diff --git a/home/gburd/features/desktop/common/firefox.nix b/home/gburd/features/desktop/common/firefox.nix deleted file mode 100644 index d5192b9..0000000 --- a/home/gburd/features/desktop/common/firefox.nix +++ /dev/null @@ -1,127 +0,0 @@ -{ config, pkgs, lib, theme, ... }: -{ - programs.browserpass.enable = true; - programs.firefox = { - enable = true; - - package = pkgs.wrapFirefox pkgs.firefox-unwrapped { - extraPolicies = { - CaptivePortal = false; - DisableFirefoxStudies = true; - DisablePocket = true; - DisableTelemetry = true; - DisableFirefoxAccounts = false; - NoDefaultBookmarks = true; - OfferToSaveLogins = false; - OfferToSaveLoginsDefault = false; - PasswordManagerEnabled = false; - FirefoxHome = { - Search = true; - Pocket = false; - Snippets = false; - TopSites = false; - Highlights = false; - }; - UserMessaging = { - ExtensionRecommendations = false; - SkipOnboarding = true; - }; - }; - }; - - profiles.gburd = { - id = 0; - bookmarks = { }; - extensions = with pkgs.inputs.firefox-addons; [ -# autoplay-no-more - bypass-paywalls-clean - i-dont-care-about-cookies -# kagi-search-for-firefox - clearurls - decentraleyes - disconnect - duckduckgo-privacy-essentials - floccus - ghostery -# https-everywhere -# languagetool -# onetab - privacy-badger - privacy-badger - privacy-redirect - proton-pass - react-devtools - ublock-origin - ]; - search = { - force = true; - default = "Kagi"; - engines = { - "Nix Packages" = { - urls = [{ - template = "https://search.nixos.org/packages"; - params = [ - { name = "type"; value = "packages"; } - { name = "query"; value = "{searchTerms}"; } - ]; - }]; - icon = "${pkgs.nixos-icons}/share/icons/hicolor/scalable/apps/nix-snowflake.svg"; - definedAliases = [ "@np" ]; - }; - "NixOS Wiki" = { - urls = [{ template = "https://nixos.wiki/index.php?search={searchTerms}"; }]; - iconUpdateURL = "https://nixos.wiki/favicon.png"; - updateInterval = 24 * 60 * 60 * 1000; - definedAliases = [ "@nw" ]; - }; - "Wikipedia (en)".metaData.alias = "@wiki"; - "Google".metaData.hidden = true; - "Amazon.com".metaData.hidden = true; - "Bing".metaData.hidden = true; - "eBay".metaData.hidden = true; - }; - }; - extraConfig = '' - user_pref("toolkit.legacyUserProfileCustomizations.stylesheets", true); - user_pref("full-screen-api.ignore-widgets", true); - user_pref("media.ffmpeg.vaapi.enabled", true); - user_pref("media.rdd-vpx.enabled", true); - ''; - userChrome = '' - # a css - ''; - userContent = '' - # Here too - ''; - settings = { - "general.smoothScroll" = true; - "browser.disableResetPrompt" = true; - "browser.download.panel.shown" = true; - "browser.download.useDownloadDir" = false; - "browser.newtabpage.activity-stream.showSponsoredTopSites" = false; - "browser.shell.checkDefaultBrowser" = false; - "browser.shell.defaultBrowserCheckCount" = 1; - "browser.startup.homepage" = "about:blank"; - "browser.uiCustomization.state" = ''{"placements":{"widget-overflow-fixed-list":[],"nav-bar":["back-button","forward-button","stop-reload-button","home-button","urlbar-container","downloads-button","library-button","ublock0_raymondhill_net-browser-action","_testpilot-containers-browser-action"],"toolbar-menubar":["menubar-items"],"TabsToolbar":["tabbrowser-tabs","new-tab-button","alltabs-button"],"PersonalToolbar":["import-button","personal-bookmarks"]},"seen":["save-to-pocket-button","developer-button","ublock0_raymondhill_net-browser-action","_testpilot-containers-browser-action"],"dirtyAreaCache":["nav-bar","PersonalToolbar","toolbar-menubar","TabsToolbar","widget-overflow-fixed-list"],"currentVersion":18,"newElementCount":4}''; - "dom.security.https_only_mode" = true; - "identity.fxaccounts.enabled" = false; - "privacy.trackingprotection.enabled" = true; - "signon.rememberSignons" = false; - }; - }; - }; - - home = { - persistence = { - # Not persisting is safer, but... - "/persist/home/gburd".directories = [ ".mozilla/firefox" ]; - }; - }; - - xdg.mimeApps.defaultApplications = { - "text/html" = [ "firefox.desktop" ]; - "text/xml" = [ "firefox.desktop" ]; - "x-scheme-handler/http" = [ "firefox.desktop" ]; - "x-scheme-handler/https" = [ "firefox.desktop" ]; - }; -} diff --git a/home/gburd/features/productivity/keyring.nix b/home/gburd/features/productivity/keyring.nix deleted file mode 100644 index 8b13789..0000000 --- a/home/gburd/features/productivity/keyring.nix +++ /dev/null @@ -1 +0,0 @@ - diff --git a/home/gburd/features/productivity/neomutt.nix b/home/gburd/features/productivity/neomutt.nix deleted file mode 100644 index 1770c98..0000000 --- a/home/gburd/features/productivity/neomutt.nix +++ /dev/null @@ -1,230 +0,0 @@ -{ config, pkgs, lib, ... }: { - xdg = { - desktopEntries = { - neomutt = { - name = "Neomutt"; - genericName = "Email Client"; - comment = "Read and send emails"; - exec = "neomutt %U"; - icon = "mutt"; - terminal = true; - categories = [ "Network" "Email" "ConsoleOnly" ]; - type = "Application"; - mimeType = [ "x-scheme-handler/mailto" ]; - }; - }; - mimeApps.defaultApplications = { - "x-scheme-handler/mailto" = "neomutt.desktop"; - }; - }; - - programs.neomutt = { - enable = true; - vimKeys = true; - checkStatsInterval = 60; - sidebar = { - enable = true; - width = 30; - }; - settings = { - mark_old = "no"; - text_flowed = "yes"; - reverse_name = "yes"; - query_command = ''"khard email --parsable '%s'"''; - }; - binds = [ - { - action = "sidebar-toggle-visible"; - key = "\\\\"; - map = [ "index" "pager" ]; - } - { - action = "group-reply"; - key = "L"; - map = [ "index" "pager" ]; - } - { - action = "toggle-new"; - key = "B"; - map = [ "index" ]; - } - ]; - macros = - let - browserpipe = - "cat /dev/stdin > /tmp/muttmail.html && xdg-open /tmp/muttmail.html"; - in - [ - { - action = ""; - key = "J"; - map = [ "index" "pager" ]; - } - { - action = ""; - key = "K"; - map = [ "index" "pager" ]; - } - { - action = - ":set confirmappend=no\\n+Archive:set confirmappend=yes\\n"; - key = "A"; - map = [ "index" "pager" ]; - } - { - action = "${browserpipe}"; - key = "V"; - map = [ "attach" ]; - } - { - action = "${pkgs.urlscan}/bin/urlscan"; - key = "F"; - map = [ "pager" ]; - } - { - action = - "html${browserpipe}"; - key = "V"; - map = [ "index" "pager" ]; - } - ]; - extraConfig = let - # Collect all addresses and aliases - addresses = lib.flatten (lib.mapAttrsToList (n: v: [ v.address ] ++ v.aliases) config.accounts.email.accounts); - in '' - alternates "${lib.concatStringsSep "|" addresses}" - '' + '' - # From: https://github.com/altercation/mutt-colors-solarized/blob/master/mutt-colors-solarized-dark-16.muttrc - - # basic colors --------------------------------------------------------- - color normal brightyellow default - color error red default - color tilde black default - color message cyan default - color markers red white - color attachment white default - color search brightmagenta default - color status brightyellow black - color indicator brightblack yellow - color tree cyan default # arrow in threads - - # basic monocolor screen - mono bold bold - mono underline underline - mono indicator reverse - mono error bold - - # index ---------------------------------------------------------------- - - color index red default "~A" # all messages - color index blue default "~N" # new messages - color index brightred default "~E" # expired messages - color index blue default "~N" # new messages - color index blue default "~O" # old messages - color index brightmagenta default "~Q" # messages that have been replied to - color index brightgreen default "~R" # read messages - color index blue default "~U" # unread messages - color index blue default "~U~$" # unread, unreferenced messages - color index cyan default "~v" # messages part of a collapsed thread - color index magenta default "~P" # messages from me - color index cyan default "~p!~F" # messages to me - color index cyan default "~N~p!~F" # new messages to me - color index cyan default "~U~p!~F" # unread messages to me - color index brightgreen default "~R~p!~F" # messages to me - color index red default "~F" # flagged messages - color index red default "~F~p" # flagged messages to me - color index red default "~N~F" # new flagged messages - color index red default "~N~F~p" # new flagged messages to me - color index red default "~U~F~p" # new flagged messages to me - color index brightcyan default "~v~(!~N)" # collapsed thread with no unread - color index yellow default "~v~(~N)" # collapsed thread with some unread - color index green default "~N~v~(~N)" # collapsed thread with unread parent - color index red black "~v~(~F)!~N" # collapsed thread with flagged, no unread - color index yellow black "~v~(~F~N)" # collapsed thread with some unread & flagged - color index green black "~N~v~(~F~N)" # collapsed thread with unread parent & flagged - color index green black "~N~v~(~F)" # collapsed thread with unread parent, no unread inside, but some flagged - color index cyan black "~v~(~p)" # collapsed thread with unread parent, no unread inside, some to me directly - color index yellow red "~v~(~D)" # thread with deleted (doesn't differentiate between all or partial) - color index yellow default "~(~N)" # messages in threads with some unread - color index green default "~S" # superseded messages - color index black red "~D" # deleted messages - color index black red "~N~D" # deleted messages - color index red default "~T" # tagged messages - - # message headers ------------------------------------------------------ - - color hdrdefault brightgreen default - color header brightyellow default "^(From)" - color header blue default "^(Subject)" - - # body ----------------------------------------------------------------- - - color quoted blue default - color quoted1 cyan default - color quoted2 yellow default - color quoted3 red default - color quoted4 brightred default - - color signature brightgreen default - color bold black default - color underline black default - color normal default default - color body brightcyan default "[;:][-o][)/(|]" # emoticons - color body brightcyan default "[;:][)(|]" # emoticons - color body brightcyan default "[*]?((N)?ACK|CU|LOL|SCNR|BRB|BTW|CWYL|\ - |FWIW|vbg|GD&R|HTH|HTHBE|IMHO|IMNSHO|\ - |IRL|RTFM|ROTFL|ROFL|YMMV)[*]?" - color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? - color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? - - ## pgp - - color body red default "(BAD signature)" - color body cyan default "(Good signature)" - color body brightblack default "^gpg: Good signature .*" - color body brightyellow default "^gpg: " - color body brightyellow red "^gpg: BAD signature from.*" - mono body bold "^gpg: Good signature" - mono body bold "^gpg: BAD signature from.*" - - # yes, an insance URL regex - color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" - # and a heavy handed email regex - color body magenta default "((@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]),)*@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]\\]):)?[0-9a-z_.+%$-]+@(([0-9a-z-]+\\.)*[0-9a-z-]+\\.?|#[0-9]+|\\[[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\.[0-2]?[0-9]?[0-9]\\])" - - # Various smilies and the like - color body brightwhite default "<[Gg]>" # - color body brightwhite default "<[Bb][Gg]>" # - color body yellow default " [;:]-*[})>{(<|]" # :-) etc... - # *bold* - color body blue default "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" - mono body bold "(^|[[:space:][:punct:]])\\*[^*]+\\*([[:space:][:punct:]]|$)" - # _underline_ - color body blue default "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" - mono body underline "(^|[[:space:][:punct:]])_[^_]+_([[:space:][:punct:]]|$)" - # /italic/ (Sometimes gets directory names) - color body blue default "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" - mono body underline "(^|[[:space:][:punct:]])/[^/]+/([[:space:][:punct:]]|$)" - - # Border lines. - color body blue default "( *[-+=#*~_]){6,}" - - # From https://github.com/jessfraz/dockerfiles/blob/master/mutt/.mutt/mutt-patch-highlighting.muttrc - color body cyan default ^(Signed-off-by).* - color body cyan default ^(Docker-DCO-1.1-Signed-off-by).* - color body brightwhite default ^(Cc) - color body yellow default "^diff \-.*" - color body brightwhite default "^index [a-f0-9].*" - color body brightblue default "^---$" - color body white default "^\-\-\- .*" - color body white default "^[\+]{3} .*" - color body green default "^[\+][^\+]+.*" - color body red default "^\-[^\-]+.*" - color body brightblue default "^@@ .*" - color body green default "LGTM" - color body brightmagenta default "-- Commit Summary --" - color body brightmagenta default "-- File Changes --" - color body brightmagenta default "-- Patch Links --" - ''; - }; -} diff --git a/home/gburd/floki.nix b/home/gburd/floki.nix index a59a390..c745a57 100644 --- a/home/gburd/floki.nix +++ b/home/gburd/floki.nix @@ -1,21 +1,187 @@ -{ inputs, outputs, ... }: +{ config, pkgs, username, ... }: { imports = [ - ./global - ./features/desktop/gnome - ./features/productivity - ./features/pass - ./features/games + ../services/keybase.nix + + # TODO remove/migrate away from user mixins + ./_mixins + ./_mixins/desktop/gnome + ./_mixins/productivity + ./_mixins/pass + ./_mixins/games ]; - wallpaper = outputs.wallpapers.aenami-lunar; - colorscheme = inputs.nix-colors.colorSchemes.atelier-heath; + home = { + file.".face".source = ./face.png; - # monitors = [{ - # name = "eDP-1"; - # width = 1920; - # height = 1080; - # workspace = "1"; - # primary = true; - # }]; + file.".ssh/config".text = '' + Host burd.me *.burd.me *.ts.burd.me + ForwardAgent yes + Host floki + ForwardAgent yes + RemoteForward /%d/.gnupg-sockets/S.gpg-agent /%d/.gnupg-sockets/S.gpg-agent.extra + + Host * + ForwardAgent no + Compression no + ServerAliveInterval 0 + ServerAliveCountMax 3 + HashKnownHosts no + UserKnownHostsFile ~/.ssh/known_hosts + ControlMaster no + ControlPath ~/.ssh/master-%r@%n:%p + ControlPersist no + + Host github.com + HostName github.com + User git + ''; + + file."Quickemu/nixos-console.conf".text = '' + #!/run/current-system/sw/bin/quickemu --vm + guest_os="linux" + disk_img="nixos-console/disk.qcow2" + disk_size="96G" + iso="nixos-console/nixos.iso" + ''; + file."Quickemu/nixos-desktop.conf".text = '' + #!/run/current-system/sw/bin/quickemu --vm + guest_os="linux" + disk_img="nixos-desktop/disk.qcow2" + disk_size="96G" + iso="nixos-desktop/nixos.iso" + ''; + + # A Modern Unix experience + # https://jvns.ca/blog/2022/04/12/a-list-of-new-ish--command-line-tools/ + packages = with pkgs; [ + asciinema # Terminal recorder + black # Code format Python + bmon # Modern Unix `iftop` + breezy # Terminal bzr client + butler # Terminal Itch.io API client + chafa # Terminal image viewer + chroma # Code syntax highlighter + clinfo # Terminal OpenCL info + curlie # Terminal HTTP client + dconf2nix # Nix code from Dconf files + debootstrap # Terminal Debian installer + diffr # Modern Unix `diff` + difftastic # Modern Unix `diff` + dogdns # Modern Unix `dig` + dua # Modern Unix `du` + duf # Modern Unix `df` + du-dust # Modern Unix `du` + entr # Modern Unix `watch` + fast-cli # Terminal fast.com + fd # Modern Unix `find` + glow # Terminal Markdown renderer + gping # Modern Unix `ping` + hexyl # Modern Unix `hexedit` + httpie # Terminal HTTP client + hyperfine # Terminal benchmarking + iperf3 # Terminal network benchmarking + iw # Terminal WiFi info + jpegoptim # Terminal JPEG optimizer + jiq # Modern Unix `jq` + lazygit # Terminal Git client + libva-utils # Terminal VAAPI info + lurk # Modern Unix `strace` + mdp # Terminal Markdown presenter + moar # Modern Unix `less` + mtr # Modern Unix `traceroute` + netdiscover # Modern Unix `arp` + nethogs # Modern Unix `iftop` + nixpkgs-review # Nix code review + nodePackages.prettier # Code format + nurl # Nix URL fetcher + nyancat # Terminal rainbow spewing feline + speedtest-go # Terminal speedtest.net + optipng # Terminal PNG optimizer + procs # Modern Unix `ps` + python310Packages.gpustat # Terminal GPU info + quilt # Terminal patch manager + ripgrep # Modern Unix `grep` + rustfmt # Code format Rust + shellcheck # Code lint Shell + shfmt # Code format Shell + tldr # Modern Unix `man` + tokei # Modern Unix `wc` for code + vdpauinfo # Terminal VDPAU info + wavemon # Terminal WiFi monitor + yq-go # Terminal `jq` for YAML + ]; + sessionVariables = { + PAGER = "moar"; + }; + }; + programs = { + fish = { + shellAliases = { + diff = "diffr"; + fast = "fast -u"; + glow = "glow --pager"; + pubip = "curl -s ifconfig.me/ip"; # "curl -s https://api.ipify.org"; + speedtest = "speedtest-go"; + }; + }; + git = { + userEmail = "greg@burd.me"; + userName = "Greg Burd"; + signing = { + key = "D4BB42BE729AEFBD2EFEBF8822931AF7895E82DF"; + signByDefault = true; + }; + aliases = { + st = "status --short"; + ci = "commit"; + co = "checkout"; + di = "diff"; + dc = "diff --cached"; + amend = "commit --amend"; + aa = "add --all"; + head = "!git l -1"; + h = "!git head"; + r = "!git --no-pager l -20"; + ra = "!git r --all"; + ff = "merge --ff-only"; + pullff = "pull --ff-only"; + l = "log --graph --abbrev-commit --date=relative"; + la = "!git l --all"; + div = "divergence"; + gn = "goodness"; + gnc = "goodness --cached"; + fa = "fetch --all"; + pom = "push origin master"; + files = "show --oneline"; + graph = "log --graph --decorate --all"; + lol = "log --graph --decorate --pretty=oneline --abbrev-commit"; + lola = "log --graph --decorate --pretty=oneline --abbrev-commit --all"; + lg = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"; + sync = "pull --rebase"; + update = "merge --ff-only origin/master"; + mend = "commit --amend --no-edit"; + unadd = "reset --"; + unedit = "checkout --"; + unstage = "reset HEAD"; + unrm = "checkout --"; + unstash = "stash pop"; + lastchange = "log -n 1 -p"; + dag = "log --graph --format='format:%C(yellow)%h%C(reset) %C(blue)\"%an\" <%ae>%C(reset) %C(magenta)%cr%C(reset)%C(auto)%d%C(reset)%n%s' --date-order"; + subdate = "submodule update --init --recursive"; + }; + }; + }; + + systemd.user.tmpfiles.rules = [ + "d ${config.home.homeDirectory}/ws 0755 ${username} users - -" + "d ${config.home.homeDirectory}/Dropbox 0755 ${username} users - -" +# "d ${config.home.homeDirectory}/Quickemu/nixos-console 0755 ${username} users - -" +# "d ${config.home.homeDirectory}/Quickemu/nixos-desktop 0755 ${username} users - -" + "d ${config.home.homeDirectory}/bin 0755 ${username} users - -" + "d ${config.home.homeDirectory}/Studio/OBS/config/obs-studio/ 0755 ${username} users - -" +# "d ${config.home.homeDirectory}/Syncthing 0755 ${username} users - -" + "d ${config.home.homeDirectory}/Websites 0755 ${username} users - -" + "L+ ${config.home.homeDirectory}/.config/obs-studio/ - - - - ${config.home.homeDirectory}/Studio/OBS/config/obs-studio/" + ]; } diff --git a/home/gburd/wallpapers/default.nix b/home/gburd/wallpapers/default.nix deleted file mode 100644 index 671ae1a..0000000 --- a/home/gburd/wallpapers/default.nix +++ /dev/null @@ -1,9 +0,0 @@ -builtins.listToAttrs (map - (wallpaper: { - inherit (wallpaper) name; - value = builtins.fetchurl { - inherit (wallpaper) sha256; - url = "https://i.imgur.com/${wallpaper.id}.${wallpaper.ext}"; - }; - }) - (builtins.fromJSON (builtins.readFile ./list.json))) diff --git a/home/gburd/wallpapers/from_album.sh b/home/gburd/wallpapers/from_album.sh deleted file mode 100755 index b3a4895..0000000 --- a/home/gburd/wallpapers/from_album.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env -S nix shell nixpkgs#httpie nixpkgs#jq --command bash - -function fetch_image() { - jq -n \ - --arg name "$(echo $1 | cut -d '|' -f 1)" \ - --arg ext "$(echo $1 | cut -d '|' -f 2 | cut -d '/' -f 2)" \ - --arg id "$(echo $1 | cut -d '|' -f 3)" \ - --arg sha256 "$(nix-prefetch-url https://i.imgur.com/$id.$ext)" \ - '{"name": $name, "ext": $ext, "id": $id, "sha256": $sha256}' -} - -album="bXDPRpV" # https://imgur.com/a/bXDPRpV -clientid="0c2b2b57cdbe5d8" - -result=$(https api.imgur.com/3/album/$album Authorization:"Client-ID $clientid") -images=$(echo $result | jq -r '.data.images[] | "\(.description)|\(.type)|\(.id)"') - -echo "[" -while read -r image; do - fetch_image $image -done <<< "$images" -wait -echo "]" diff --git a/home/gburd/wallpapers/list.json b/home/gburd/wallpapers/list.json deleted file mode 100644 index ab109bd..0000000 --- a/home/gburd/wallpapers/list.json +++ /dev/null @@ -1,8 +0,0 @@ -[ - { - "ext": "jpeg", - "id": "u2T7X4I", - "name": "watercolor-beach", - "sha256": "00kcswwv9p14vs7ym0fmanzv8729i1gagk6gpl42icd93mmhlmd4" - } -] diff --git a/home/gburd/wallpapers/single_image.sh b/home/gburd/wallpapers/single_image.sh deleted file mode 100755 index d62fc3d..0000000 --- a/home/gburd/wallpapers/single_image.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p jq httpie - -image="$(echo "$1" | rev | cut -d '/' -f1 | rev | cut -d '.' -f1)" -clientid="0c2b2b57cdbe5d8" - -image=$(https api.imgur.com/3/image/$image Authorization:"Client-ID $clientid" | jq -r '.data | "\(.description)|\(.type)|\(.id)"') - -jq -n \ - --arg name "$(echo $image | cut -d '|' -f 1)" \ - --arg ext "$(echo $image | cut -d '|' -f 2 | cut -d '/' -f 2)" \ - --arg id "$(echo $image | cut -d '|' -f 3)" \ - --arg sha256 "$(nix-prefetch-url https://i.imgur.com/$id.$ext)" \ - '{"name": $name, "ext": $ext, "id": $id, "sha256": $sha256}' diff --git a/home/nixos/default.nix b/home/nixos/default.nix new file mode 100644 index 0000000..f5476b8 --- /dev/null +++ b/home/nixos/default.nix @@ -0,0 +1,3 @@ +_: { + home.file.".face".source = ./face.png; +} diff --git a/home/nixos/face.png b/home/nixos/face.png new file mode 100644 index 0000000..6ce6b36 Binary files /dev/null and b/home/nixos/face.png differ diff --git a/hosts/common/optional/pipewire.nix b/hosts/common/optional/pipewire.nix deleted file mode 100644 index e35a788..0000000 --- a/hosts/common/optional/pipewire.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ - security.rtkit.enable = true; - hardware.pulseaudio.enable = false; - services.pipewire = { - enable = true; - alsa.enable = true; - alsa.support32Bit = true; - pulse.enable = true; - jack.enable = true; - }; -} diff --git a/hosts/common/optional/quietboot.nix b/hosts/common/optional/quietboot.nix deleted file mode 100644 index 0913f74..0000000 --- a/hosts/common/optional/quietboot.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ pkgs, config, ... }: -{ - console = { - useXkbConfig = true; - earlySetup = false; - }; - - boot = { - plymouth = { - enable = true; - }; - loader.timeout = 0; - kernelParams = [ - "quiet" - "loglevel=3" - "systemd.show_status=auto" - "udev.log_level=3" - "rd.udev.log_level=3" - "vt.global_cursor_default=0" - ]; - consoleLogLevel = 0; - initrd.verbose = false; - }; -} diff --git a/hosts/common/optional/x11-keymap.nix b/hosts/common/optional/x11-keymap.nix deleted file mode 100644 index 4f90243..0000000 --- a/hosts/common/optional/x11-keymap.nix +++ /dev/null @@ -1,8 +0,0 @@ -{ - # Configure keymap in X11 - services.xserver = { - layout = "us"; - xkbVariant = ""; - xkbOptions = "ctrl:swapcaps"; - }; -} \ No newline at end of file diff --git a/hosts/common/users/gburd/default.nix b/hosts/common/users/gburd/default.nix deleted file mode 100644 index ccdff7c..0000000 --- a/hosts/common/users/gburd/default.nix +++ /dev/null @@ -1,42 +0,0 @@ -{ pkgs, config, ... }: -let ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; -in -{ - users.mutableUsers = false; - users.users.gburd = { - isNormalUser = true; - shell = pkgs.fish; - extraGroups = [ - "wheel" - "video" - "audio" - "networkmanager" - ] ++ ifTheyExist [ - "network" - "wireshark" - "i2c" - "docker" - "podman" - "git" - "libvirtd" - "deluge" - ]; - - openssh.authorizedKeys.keys = [ - (builtins.readFile ../../../../home/gburd/ssh.pub) - (builtins.readFile ../../../../home/gburd/symas-ssh.pub) - ]; - hashedPasswordFile = config.sops.secrets.gburd-password.path; - packages = [ pkgs.home-manager ]; - }; - - sops.secrets.gburd-password = { - sopsFile = ../../secrets.yaml; - neededForUsers = true; - }; - - home-manager.users.gburd = import ../../../../home/gburd/${config.networking.hostName}.nix; - - services.geoclue2.enable = true; - security.pam.services = { swaylock = { }; }; -} diff --git a/hosts/floki/default.nix b/hosts/floki/default.nix deleted file mode 100644 index d5616f2..0000000 --- a/hosts/floki/default.nix +++ /dev/null @@ -1,59 +0,0 @@ -{ pkgs, inputs, ... }: { - imports = [ - inputs.hardware.nixosModules.common-cpu-amd - inputs.hardware.nixosModules.common-gpu-amd - inputs.hardware.nixosModules.common-pc-ssd - - ./hardware-configuration.nix - - ../common/global - ../common/users/gburd - - ../common/optional/gnome.nix - ../common/optional/x11-keymap.nix -# ../common/optional/gamemode.nix - ../common/optional/pipewire.nix - ../common/optional/quietboot.nix - ]; - - networking = { - hostName = "floki"; - }; - - # Enable networking - networking.networkmanager.enable = true; - - boot = { - kernelPackages = pkgs.linuxKernel.packages.linux_zen; - }; - - powerManagement.powertop.enable = true; - programs = { - light.enable = true; - adb.enable = true; - dconf.enable = true; - kdeconnect.enable = true; - }; - - # Lid settings - services.logind = { - lidSwitch = "suspend"; - lidSwitchExternalPower = "lock"; - }; - - xdg.portal = { - enable = true; - wlr.enable = true; - }; - - hardware = { - opengl = { - enable = true; - extraPackages = with pkgs; [ amdvlk ]; - driSupport = true; - driSupport32Bit = true; - }; - }; - - system.stateVersion = "23.05"; -} diff --git a/hosts/floki/hardware-configuration.nix b/hosts/floki/hardware-configuration.nix deleted file mode 100644 index 38bf0c7..0000000 --- a/hosts/floki/hardware-configuration.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ - imports = [ - ../common/optional/btrfs.nix - ]; - - boot = { - initrd = { - availableKernelModules = [ "ahci" "xhci_pci" "nvme" "thunderbolt" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ]; - kernelModules = [ "kvm-amd" ]; - }; - loader = { - systemd-boot = { - enable = true; - consoleMode = "max"; - }; - efi.canTouchEfiVariables = true; - }; - }; - - boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/470152b6-16cc-4dcf-b1e9-c684c1589e33"; - - fileSystems."/swap" = - { device = "/dev/disk/by-uuid/bf75af76-49b0-41fa-a4e5-9a52a6a0a667"; - fsType = "btrfs"; - options = [ "subvol=swap" ]; - }; - - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/3D04-3716"; - fsType = "vfat"; - }; - - # fileSystems = { - # "/boot" = { - # device = "/dev/disk/by-label/ESP"; - # fsType = "vfat"; - # }; - # }; - - swapDevices = [{ - device = "/swap/swapfile"; - size = 8196; - }]; - - nixpkgs.hostPlatform.system = "x86_64-linux"; - hardware.cpu.amd.updateMicrocode = true; - powerManagement.cpuFreqGovernor = "powersave"; -} diff --git a/hydra.nix b/hydra.nix index 2e9fed4..c0c264f 100644 --- a/hydra.nix +++ b/hydra.nix @@ -4,7 +4,7 @@ let notBroken = pkg: !(pkg.meta.broken or false); hasPlatform = sys: pkg: elem sys (pkg.meta.platforms or [ ]); - filterValidPkgs = sys: pkgs: filterAttrs (_: pkg: hasPlatform sys pkg && notBroken pkg) pkgs; + filterValidPkgs = sys: filterAttrs (_: pkg: hasPlatform sys pkg && notBroken pkg); getCfg = _: cfg: cfg.config.system.build.toplevel; in { diff --git a/lib/default.nix b/lib/default.nix new file mode 100644 index 0000000..58c69c4 --- /dev/null +++ b/lib/default.nix @@ -0,0 +1,9 @@ +{ inputs, outputs, stateVersion, ... }: +let + helpers = import ./helpers.nix { inherit inputs outputs stateVersion; }; +in +{ + inherit (helpers) mkHome; + inherit (helpers) mkHost; + inherit (helpers) forAllSystems; +} diff --git a/lib/helpers.nix b/lib/helpers.nix new file mode 100644 index 0000000..a599ff3 --- /dev/null +++ b/lib/helpers.nix @@ -0,0 +1,29 @@ +{ inputs, outputs, stateVersion, ... }: { + # Helper function for generating home-manager configs + mkHome = { hostname, username, desktop ? null, platform ? "x86_64-linux" }: inputs.home-manager.lib.homeManagerConfiguration { + pkgs = inputs.nixpkgs.legacyPackages.${platform}; + extraSpecialArgs = { + inherit inputs outputs desktop hostname platform username stateVersion; + }; + modules = [ "../home/${username}/${hostname}.nix" ]; + }; + + # Helper function for generating host configs + mkHost = { hostname, username, desktop ? null, installer ? null }: inputs.nixpkgs.lib.nixosSystem { + specialArgs = { + inherit inputs outputs desktop hostname username stateVersion; + }; + modules = [ + "../nixos/${hostname}" + inputs.agenix.nixosModules.default + ] ++ (inputs.nixpkgs.lib.optionals (installer != null) [ installer ]); + }; + + forAllSystems = inputs.nixpkgs.lib.genAttrs [ + "aarch64-linux" + "i686-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; +} diff --git a/modules/home-manager/monitors.nix b/modules/home-manager/monitors.nix index 0dbdefc..21dd4a2 100644 --- a/modules/home-manager/monitors.nix +++ b/modules/home-manager/monitors.nix @@ -2,7 +2,6 @@ let inherit (lib) mkOption types; - cfg = config.monitors; in { options.monitors = mkOption { diff --git a/modules/home-manager/pass-secret-service.nix b/modules/home-manager/pass-secret-service.nix index 8a95a0e..92f8984 100644 --- a/modules/home-manager/pass-secret-service.nix +++ b/modules/home-manager/pass-secret-service.nix @@ -4,7 +4,8 @@ with lib; let cfg = config.services.pass-secret-service; -in { +in +{ disabledModules = [ "services/pass-secret-service.nix" ]; meta.maintainers = with maintainers; [ cab404 cyntheticfox ]; diff --git a/nixos/_mixins/desktop/chromium-extensions.nix b/nixos/_mixins/desktop/chromium-extensions.nix new file mode 100644 index 0000000..10a3f66 --- /dev/null +++ b/nixos/_mixins/desktop/chromium-extensions.nix @@ -0,0 +1,14 @@ +_: { + programs = { + chromium = { + extensions = [ + "kbfnbcaeplbcioakkpcpgfkobkghlhen" # Grammarly + "cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin + "mdjildafknihdffpkfmmpnpoiajfjnjd" # Consent-O-Matic + "mnjggcdmjocbbbhaepdhchncahnbgone" # SponsorBlock for YouTube + "gebbhagfogifgggkldgodflihgfeippi" # Return YouTube Dislike + "edlifbnjlicfpckhgjhflgkeeibhhcii" # Screenshot Tool + ]; + }; + }; +} diff --git a/nixos/_mixins/desktop/chromium.nix b/nixos/_mixins/desktop/chromium.nix new file mode 100644 index 0000000..0dadc22 --- /dev/null +++ b/nixos/_mixins/desktop/chromium.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs.unstable; [ + chromium + ]; + + programs = { + chromium = { + enable = true; + extensions = [ + "cdglnehniifkbagbbombnjghhcihifij" # kagi-search-for-chrome + "ghmbeldphafepmbegfdlkpapadhbakde" # proton-pass-free-password + ]; + extraOpts = { + "AutofillAddressEnabled" = false; + "AutofillCreditCardEnabled" = false; + "BuiltInDnsClientEnabled" = false; + "DeviceMetricsReportingEnabled" = true; + "ReportDeviceCrashReportInfo" = false; + "PasswordManagerEnabled" = false; + "SpellcheckEnabled" = true; + "SpellcheckLanguage" = [ + "en-US" + ]; + "VoiceInteractionHotwordEnabled" = false; + }; + }; + }; +} diff --git a/nixos/_mixins/desktop/default.nix b/nixos/_mixins/desktop/default.nix new file mode 100644 index 0000000..3e4ef3c --- /dev/null +++ b/nixos/_mixins/desktop/default.nix @@ -0,0 +1,54 @@ +{ desktop, lib, pkgs, ... }: { + imports = [ + ../services/cups.nix + ] + ++ lib.optional (builtins.pathExists (./. + "/${desktop}.nix")) ./${desktop}.nix; + + boot = { + kernelParams = [ + "loglevel=3" + "mitigations=off" + "quiet" + "rd.udev.log_level=3" + "systemd.show_status=auto" + "udev.log_level=3" + "vt.global_cursor_default=0" + ]; + plymouth.enable = true; + consoleLogLevel = 0; + initrd.verbose = false; + }; + + console = { + useXkbConfig = true; + earlySetup = false; + }; + + hardware = { + opengl = { + enable = true; + extraPackages = with pkgs; [ amdvlk ]; + driSupport = true; + driSupport32Bit = true; + }; + }; + + programs.dconf.enable = true; + + # Disable xterm + services.xserver.excludePackages = [ pkgs.xterm ]; + services.xserver.desktopManager.xterm.enable = false; + + systemd.services.disable-wifi-powersave = { + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.iw ]; + script = '' + iw dev wlan0 set power_save off + ''; + }; + + xdg.portal = { + enable = true; + xdgOpenUsePortal = true; + }; +} diff --git a/nixos/_mixins/desktop/evolution.nix b/nixos/_mixins/desktop/evolution.nix new file mode 100644 index 0000000..35f99d8 --- /dev/null +++ b/nixos/_mixins/desktop/evolution.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: { + environment = { + systemPackages = with pkgs; [ + evolutionWithPlugins + ]; + }; + programs.evolution.enable = true; + services.gnome.evolution-data-server.enable = true; +} diff --git a/nixos/_mixins/desktop/firefox.nix b/nixos/_mixins/desktop/firefox.nix new file mode 100644 index 0000000..303032f --- /dev/null +++ b/nixos/_mixins/desktop/firefox.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: { + programs.firefox = { + enable = true; + languagePacks = [ "en-US" ]; + package = pkgs.unstable.firefox; + }; +} diff --git a/nixos/_mixins/desktop/mate-apps.nix b/nixos/_mixins/desktop/mate-apps.nix new file mode 100644 index 0000000..f4872ec --- /dev/null +++ b/nixos/_mixins/desktop/mate-apps.nix @@ -0,0 +1,20 @@ +{ pkgs, ... }: { + imports = [ + ../services/flatpak.nix + ../services/sane.nix + ]; + + # Add some packages to complete the MATE desktop + environment.systemPackages = with pkgs; [ + gnome.gucharmap + gnome-firmware + gthumb + usbimager + ]; + + # Enable some programs to provide a complete desktop + programs = { + gnome-disks.enable = true; + seahorse.enable = true; + }; +} diff --git a/nixos/_mixins/desktop/mate.nix b/nixos/_mixins/desktop/mate.nix new file mode 100644 index 0000000..47a4cae --- /dev/null +++ b/nixos/_mixins/desktop/mate.nix @@ -0,0 +1,87 @@ +{ pkgs, ... }: { + imports = [ + ./qt-style.nix + ../services/networkmanager.nix + ]; + + # Exclude MATE themes. Yaru will be used instead. + # Don't install mate-netbook or caja-dropbox + environment = { + mate.excludePackages = with pkgs.mate; [ + caja-dropbox + eom + mate-themes + mate-netbook + mate-icon-theme + mate-backgrounds + mate-icon-theme-faenza + ]; + + # Add some packages to complete the MATE desktop + systemPackages = with pkgs; [ + networkmanagerapplet + ]; + }; + + # Enable some programs to provide a complete desktop + programs = { + nm-applet.enable = true; + system-config-printer.enable = true; + }; + + # Enable services to round out the desktop + services = { + blueman.enable = true; + gnome.gnome-keyring.enable = true; + gvfs.enable = true; + system-config-printer.enable = true; + xserver = { + enable = true; + displayManager = { + lightdm.enable = true; + lightdm.greeters.gtk = { + enable = true; + cursorTheme.name = "Yaru"; + cursorTheme.package = pkgs.yaru-theme; + cursorTheme.size = 32; + iconTheme.name = "Yaru-magenta-dark"; + iconTheme.package = pkgs.yaru-theme; + theme.name = "Yaru-magenta-dark"; + theme.package = pkgs.yaru-theme; + indicators = [ + "~session" + "~host" + "~spacer" + "~clock" + "~spacer" + "~a11y" + "~power" + ]; + # https://github.com/Xubuntu/lightdm-gtk-greeter/blob/master/data/lightdm-gtk-greeter.conf + extraConfig = '' + # background = Background file to use, either an image path or a color (e.g. #772953) + font-name = Work Sans 12 + xft-antialias = true + xft-dpi = 96 + xft-hintstyle = slight + xft-rgba = rgb + + active-monitor = #cursor + # position = x y ("50% 50%" by default) Login window position + # default-user-image = Image used as default user icon, path or #icon-name + hide-user-image = false + round-user-image = false + highlight-logged-user = true + panel-position = top + clock-format = %a, %b %d %H:%M + ''; + }; + }; + + desktopManager = { + mate.enable = true; + }; + }; + }; + xdg.portal.extraPortals = [ xdg-desktop-portal-gtk ]; +} diff --git a/nixos/_mixins/desktop/obs-studio.nix b/nixos/_mixins/desktop/obs-studio.nix new file mode 100644 index 0000000..05da591 --- /dev/null +++ b/nixos/_mixins/desktop/obs-studio.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: { + # https://nixos.wiki/wiki/OBS_Studio + boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ]; + boot.extraModprobeConfig = '' + options v4l2loopback devices=1 video_nr=13 card_label="OBS Virtual Camera" exclusive_caps=1 + ''; + + environment.systemPackages = [ + (pkgs.unstable.wrapOBS { + plugins = with pkgs.unstable.obs-studio-plugins; [ + obs-3d-effect + obs-command-source + obs-gradient-source + obs-gstreamer + obs-nvfbc + obs-move-transition + obs-mute-filter + obs-pipewire-audio-capture + obs-rgb-levels-filter + obs-text-pthread + obs-scale-to-sound + advanced-scene-switcher + obs-shaderfilter + obs-source-clone + obs-source-record + obs-source-switcher + obs-transition-table + obs-vaapi + obs-vintage-filter + obs-websocket + waveform + ]; + }) + ]; +} diff --git a/nixos/_mixins/desktop/pantheon-apps.nix b/nixos/_mixins/desktop/pantheon-apps.nix new file mode 100644 index 0000000..9c79460 --- /dev/null +++ b/nixos/_mixins/desktop/pantheon-apps.nix @@ -0,0 +1,30 @@ +{ pkgs, ... }: { + imports = [ + ../services/flatpak.nix + ../services/sane.nix + ]; + + # Add additional apps and include Yaru for syntax highlighting + environment.systemPackages = with pkgs; [ + appeditor + gthumb + formatter + usbimager + yaru-theme + ]; + + # Add GNOME Disks, Pantheon Tweaks and Seahorse + programs = { + gnome-disks.enable = true; + pantheon-tweaks.enable = true; + seahorse.enable = true; + }; + + systemd.services.configure-appcenter-repo = { + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.flatpak ]; + script = '' + flatpak remote-add --if-not-exists appcenter https://flatpak.elementary.io/repo.flatpakrepo + ''; + }; +} diff --git a/nixos/_mixins/desktop/pantheon.nix b/nixos/_mixins/desktop/pantheon.nix new file mode 100644 index 0000000..6c7743e --- /dev/null +++ b/nixos/_mixins/desktop/pantheon.nix @@ -0,0 +1,56 @@ +# NOTE: This is the minimum Pantheon, included in the live .iso image +# For actuall installs pantheon-apps.nix is also included +{ pkgs, ... }: { + imports = [ + ./qt-style.nix + ../services/networkmanager.nix + ]; + + # Exclude the elementary apps I don't use + environment = { + pantheon.excludePackages = with pkgs.pantheon; [ + elementary-music + elementary-photos + elementary-videos + epiphany + ]; + + # App indicator + # - https://discourse.nixos.org/t/anyone-with-pantheon-de/28422 + # - https://github.com/NixOS/nixpkgs/issues/144045#issuecomment-992487775 + pathsToLink = [ "/libexec" ]; + }; + + services = { + gnome.gnome-keyring.enable = true; + gvfs.enable = true; + xserver = { + enable = true; + displayManager = { + lightdm.enable = true; + lightdm.greeters.pantheon.enable = true; + }; + + desktopManager = { + pantheon = { + enable = true; + extraWingpanelIndicators = with pkgs; [ + monitor + wingpanel-indicator-ayatana + ]; + }; + }; + }; + }; + + # App indicator + # - https://github.com/NixOS/nixpkgs/issues/144045#issuecomment-992487775 + systemd.user.services.indicator-application-service = { + description = "indicator-application-service"; + wantedBy = [ "graphical-session.target" ]; + partOf = [ "graphical-session.target" ]; + serviceConfig = { + ExecStart = "${pkgs.indicator-application-gtk3}/libexec/indicator-application/indicator-application-service"; + }; + }; +} diff --git a/nixos/_mixins/desktop/qt-style.nix b/nixos/_mixins/desktop/qt-style.nix new file mode 100644 index 0000000..8ecf222 --- /dev/null +++ b/nixos/_mixins/desktop/qt-style.nix @@ -0,0 +1,18 @@ +{ lib, pkgs, ... }: { + environment = { + systemPackages = with pkgs; [ + qgnomeplatform-qt6 + ]; + + # Required to coerce dark theme that works with Yaru + # TODO: Set this in the user-session + variables = lib.mkForce { + QT_QPA_PLATFORMTHEME = "gnome"; + QT_STYLE_OVERRIDE = "Adwaita-Dark"; + }; + }; + + qt = { + enable = true; + }; +} diff --git a/nixos/_mixins/desktop/steam.nix b/nixos/_mixins/desktop/steam.nix new file mode 100644 index 0000000..cfbbd9a --- /dev/null +++ b/nixos/_mixins/desktop/steam.nix @@ -0,0 +1,15 @@ +_: { + # https://nixos.wiki/wiki/Steam + fonts.fontconfig.cache32Bit = true; + hardware.steam-hardware.enable = true; + hardware.opengl.driSupport32Bit = true; + programs = { + steam = { + enable = true; + remotePlay.openFirewall = true; # Open ports in the firewall for Steam Remote Play + dedicatedServer.openFirewall = true; # Open ports in the firewall for Source Dedicated Server + }; + }; + services.jack.alsa.support32Bit = true; + services.pipewire.alsa.support32Bit = true; +} diff --git a/nixos/_mixins/desktop/ungoogled-chromium.nix b/nixos/_mixins/desktop/ungoogled-chromium.nix new file mode 100644 index 0000000..3d69dcc --- /dev/null +++ b/nixos/_mixins/desktop/ungoogled-chromium.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs.unstable; [ + ungoogled-chromium + ]; + + programs = { + ungoogled-chromium = { + enable = true; + extensions = [ + "cdglnehniifkbagbbombnjghhcihifij" # kagi-search-for-chrome + "ghmbeldphafepmbegfdlkpapadhbakde" # proton-pass-free-password + ]; + extraOpts = { + "AutofillAddressEnabled" = false; + "AutofillCreditCardEnabled" = false; + "BuiltInDnsClientEnabled" = false; + "DeviceMetricsReportingEnabled" = true; + "ReportDeviceCrashReportInfo" = false; + "PasswordManagerEnabled" = false; + "SpellcheckEnabled" = true; + "SpellcheckLanguage" = [ + "en-US" + ]; + "VoiceInteractionHotwordEnabled" = false; + }; + }; + }; +} diff --git a/nixos/_mixins/desktop/vscode.nix b/nixos/_mixins/desktop/vscode.nix new file mode 100644 index 0000000..bb5c8ec --- /dev/null +++ b/nixos/_mixins/desktop/vscode.nix @@ -0,0 +1,131 @@ +{ pkgs, ... }: { + environment.systemPackages = with pkgs; [ + (vscode-with-extensions.override { + inherit (unstable) vscode; + vscodeExtensions = [ + unstable.vscode-extensions.coolbear.systemd-unit-file + unstable.vscode-extensions.dotjoshjohnson.xml + unstable.vscode-extensions.eamodio.gitlens + unstable.vscode-extensions.editorconfig.editorconfig + unstable.vscode-extensions.esbenp.prettier-vscode + unstable.vscode-extensions.github.copilot + unstable.vscode-extensions.github.vscode-github-actions + unstable.vscode-extensions.golang.go + unstable.vscode-extensions.jnoortheen.nix-ide + unstable.vscode-extensions.mads-hartmann.bash-ide-vscode + unstable.vscode-extensions.ms-azuretools.vscode-docker + vscode-extensions.ms-python.python + vscode-extensions.ms-python.vscode-pylance + unstable.vscode-extensions.ms-vscode.cpptools + unstable.vscode-extensions.ms-vsliveshare.vsliveshare + unstable.vscode-extensions.redhat.vscode-yaml + unstable.vscode-extensions.ryu1kn.partial-diff + unstable.vscode-extensions.streetsidesoftware.code-spell-checker + unstable.vscode-extensions.timonwong.shellcheck + unstable.vscode-extensions.vscode-icons-team.vscode-icons + unstable.vscode-extensions.yzhang.markdown-all-in-one + ] ++ pkgs.unstable.vscode-utils.extensionsFromVscodeMarketplace [ + { + name = "bash-debug"; + publisher = "rogalmic"; + version = "0.3.9"; + sha256 = "sha256-f8FUZCvz/PonqQP9RCNbyQLZPnN5Oce0Eezm/hD19Fg="; + } + { + name = "beardedicons"; + publisher = "beardedbear"; + version = "1.13.2"; + sha256 = "sha256-PpIut/yhUNK1eTPRvVXONt06TOXpoGgmd6lrhFdADRQ"; + } + { + name = "beardedtheme"; + publisher = "beardedbear"; + version = "8.3.2"; + sha256 = "sha256-TwHuoXme0o6EeciA1lxhs5vmhGlDvaWlH8tjVmuSQH8"; + } + { + name = "debian-vscode"; + publisher = "dawidd6"; + version = "0.1.2"; + sha256 = "sha256-DrCaEVf1tnB/ccFTJ5HpJfTxe0npbXMjqGkyHNri+G8="; + } + { + name = "font-switcher"; + publisher = "evan-buss"; + version = "4.1.0"; + sha256 = "sha256-KkXUfA/W73kRfs1TpguXtZvBXFiSMXXzU9AYZGwpVsY="; + } + { + name = "grammarly"; + publisher = "znck"; + version = "0.23.15"; + sha256 = "sha256-/LjLL8IQwQ0ghh5YoDWQxcPM33FCjPeg3cFb1Qa/cb0="; + } + { + name = "language-hugo-vscode"; + publisher = "budparr"; + version = "1.3.1"; + sha256 = "sha256-9dp8/gLAb8OJnmsLVbOAKAYZ5whavPW2Ak+WhLqEbJk="; + } + { + name = "linux-desktop-file"; + publisher = "nico-castell"; + version = "0.0.21"; + sha256 = "sha256-4qy+2Tg9g0/9D+MNvLSgWUE8sc5itsC/pJ9hcfxyVzQ="; + } + { + name = "non-breaking-space-highlighter"; + publisher = "viktorzetterstrom"; + version = "0.0.3"; + sha256 = "sha256-t+iRBVN/Cw/eeakRzATCsV8noC2Wb6rnbZj7tcZJ/ew="; + } + { + name = "pubspec-assist"; + publisher = "jeroen-meijer"; + version = "2.3.2"; + sha256 = "sha256-+Mkcbeq7b+vkuf2/LYT10mj46sULixLNKGpCEk1Eu/0="; + } + { + name = "simple-rst"; + publisher = "trond-snekvik"; + version = "1.5.3"; + sha256 = "sha256-0gPqckwzDptpzzg1tP4I9WQfrXlflO+G0KcAK5pEie8="; + } + { + name = "vala"; + publisher = "prince781"; + version = "1.0.8"; + sha256 = "sha256-IuIb7vLNiE3rzVHOsjInaYLzNYORbwabQq0bfaPLlqc="; + } + { + name = "vscode-front-matter"; + publisher = "eliostruyf"; + version = "8.4.0"; + sha256 = "sha256-L0PbZ4HxJAlxkwVcZe+kBGS87yzg0pZl89PU0aUVYzY="; + } + { + name = "vscode-mdx"; + publisher = "unifiedjs"; + version = "1.4.0"; + sha256 = "sha256-qqqq0QKTR0ZCLdPltsnQh5eTqGOh9fV1OSOZMjj4xXg="; + } + { + name = "vscode-mdx-preview"; + publisher = "xyc"; + version = "0.3.3"; + sha256 = "sha256-OKwEqkUEjHIJrbi9S2v2nJrZchYByDU6cXHAn7uhxcQ="; + } + { + name = "vscode-power-mode"; + publisher = "hoovercj"; + version = "3.0.2"; + sha256 = "sha256-ZE+Dlq0mwyzr4nWL9v+JG00Gllj2dYwL2r9jUPQ8umQ="; + } + ]; + }) + ]; + + services.vscode-server.enable = true; + # May require the service to be enable/started for the user + # - systemctl --user enable auto-fix-vscode-server.service --now +} diff --git a/hosts/common/global/acme.nix b/nixos/_mixins/global/acme.nix similarity index 94% rename from hosts/common/global/acme.nix rename to nixos/_mixins/global/acme.nix index f2ee4b1..e86e714 100644 --- a/hosts/common/global/acme.nix +++ b/nixos/_mixins/global/acme.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +_: { # Enable acme for usage with nginx vhosts security.acme = { diff --git a/hosts/common/global/auto-upgrade.nix b/nixos/_mixins/global/auto-upgrade.nix similarity index 100% rename from hosts/common/global/auto-upgrade.nix rename to nixos/_mixins/global/auto-upgrade.nix diff --git a/hosts/common/global/default.nix b/nixos/_mixins/global/default.nix similarity index 97% rename from hosts/common/global/default.nix rename to nixos/_mixins/global/default.nix index 161cc01..a19103c 100644 --- a/hosts/common/global/default.nix +++ b/nixos/_mixins/global/default.nix @@ -12,7 +12,7 @@ ./optin-persistence.nix ./podman.nix ./sops.nix -# ./ssh-serve-store.nix + # ./ssh-serve-store.nix ./steam-hardware.nix ./systemd-initrd.nix ./tailscale.nix diff --git a/hosts/common/global/fish.nix b/nixos/_mixins/global/fish.nix similarity index 100% rename from hosts/common/global/fish.nix rename to nixos/_mixins/global/fish.nix diff --git a/hosts/common/global/locale.nix b/nixos/_mixins/global/locale.nix similarity index 100% rename from hosts/common/global/locale.nix rename to nixos/_mixins/global/locale.nix diff --git a/hosts/common/global/nix.nix b/nixos/_mixins/global/nix.nix similarity index 100% rename from hosts/common/global/nix.nix rename to nixos/_mixins/global/nix.nix diff --git a/hosts/common/global/openssh.nix b/nixos/_mixins/global/openssh.nix similarity index 77% rename from hosts/common/global/openssh.nix rename to nixos/_mixins/global/openssh.nix index 3be0122..5e6da75 100644 --- a/hosts/common/global/openssh.nix +++ b/nixos/_mixins/global/openssh.nix @@ -1,10 +1,8 @@ { outputs, lib, config, ... }: let - inherit (config.networking) hostName; hosts = outputs.nixosConfigurations; pubKey = host: ../../${host}/ssh_host_ed25519_key.pub; - gitHost = hosts."TODO-host-git-host-name-here".config.networking.hostName; # Sops needs acess to the keys before the persist dirs are even mounted; so # just persisting the keys won't work, we must point at /persist @@ -34,9 +32,9 @@ in knownHosts = builtins.mapAttrs (name: _: { publicKeyFile = pubKey name; -# extraHostNames = -# (lib.optional (name == hostName) "localhost") ++ # Alias for localhost if it's the same host -# (lib.optionals (name == gitHost) [ "burd.me" "git.burd.me" ]); + # extraHostNames = + # (lib.optional (name == hostName) "localhost") ++ # Alias for localhost if it's the same host + # (lib.optionals (name == gitHost) [ "burd.me" "git.burd.me" ]); }) hosts; }; diff --git a/hosts/common/global/optin-persistence.nix b/nixos/_mixins/global/optin-persistence.nix similarity index 100% rename from hosts/common/global/optin-persistence.nix rename to nixos/_mixins/global/optin-persistence.nix diff --git a/hosts/common/global/podman.nix b/nixos/_mixins/global/podman.nix similarity index 100% rename from hosts/common/global/podman.nix rename to nixos/_mixins/global/podman.nix diff --git a/hosts/common/global/sops.nix b/nixos/_mixins/global/sops.nix similarity index 89% rename from hosts/common/global/sops.nix rename to nixos/_mixins/global/sops.nix index 54a5499..ef7e68f 100644 --- a/hosts/common/global/sops.nix +++ b/nixos/_mixins/global/sops.nix @@ -1,4 +1,4 @@ -{ inputs, lib, config, ... }: +{ inputs, config, ... }: let isEd25519 = k: k.type == "ed25519"; getKeyPath = k: k.path; diff --git a/hosts/common/global/ssh-serve-store.nix b/nixos/_mixins/global/ssh-serve-store.nix similarity index 94% rename from hosts/common/global/ssh-serve-store.nix rename to nixos/_mixins/global/ssh-serve-store.nix index 1250f72..406d8bf 100644 --- a/hosts/common/global/ssh-serve-store.nix +++ b/nixos/_mixins/global/ssh-serve-store.nix @@ -1,4 +1,4 @@ -{ config, ... }: +_: { nix = { sshServe = { diff --git a/hosts/common/global/steam-hardware.nix b/nixos/_mixins/global/steam-hardware.nix similarity index 100% rename from hosts/common/global/steam-hardware.nix rename to nixos/_mixins/global/steam-hardware.nix diff --git a/hosts/common/global/systemd-initrd.nix b/nixos/_mixins/global/systemd-initrd.nix similarity index 100% rename from hosts/common/global/systemd-initrd.nix rename to nixos/_mixins/global/systemd-initrd.nix diff --git a/hosts/common/global/tailscale.nix b/nixos/_mixins/global/tailscale.nix similarity index 100% rename from hosts/common/global/tailscale.nix rename to nixos/_mixins/global/tailscale.nix diff --git a/nixos/_mixins/hardware/gpd-dsi.nix b/nixos/_mixins/hardware/gpd-dsi.nix new file mode 100644 index 0000000..f217afb --- /dev/null +++ b/nixos/_mixins/hardware/gpd-dsi.nix @@ -0,0 +1,6 @@ +_: { + imports = [ ./gpd-generic.nix ]; + + # Many GPD devices uses a tablet displays that are mounted rotated 90Β° counter-clockwise + boot.kernelParams = [ "video=DSI-1:panel_orientation=right_side_up" ]; +} diff --git a/nixos/_mixins/hardware/gpd-edp.nix b/nixos/_mixins/hardware/gpd-edp.nix new file mode 100644 index 0000000..ac303b2 --- /dev/null +++ b/nixos/_mixins/hardware/gpd-edp.nix @@ -0,0 +1,6 @@ +_: { + imports = [ ./gpd-generic.nix ]; + + # Many GPD devices uses a tablet displays that are mounted rotated 90Β° counter-clockwise + boot.kernelParams = [ "video=eDP-1:panel_orientation=right_side_up" ]; +} diff --git a/nixos/_mixins/hardware/gpd-generic.nix b/nixos/_mixins/hardware/gpd-generic.nix new file mode 100644 index 0000000..d0f13e7 --- /dev/null +++ b/nixos/_mixins/hardware/gpd-generic.nix @@ -0,0 +1,11 @@ +{ lib, ... }: { + boot.kernelParams = [ "fbcon=rotate:1" ]; + + # Required for grub to properly display the boot menu. + boot.loader.grub.gfxmodeEfi = lib.mkDefault "720x1280x32"; + + fonts.fontconfig = { + # Pixel order for rotated screen + subpixel.rgba = lib.mkDefault "vbgr"; + }; +} diff --git a/nixos/_mixins/hardware/gpd-win-max.nix b/nixos/_mixins/hardware/gpd-win-max.nix new file mode 100644 index 0000000..6ddfbca --- /dev/null +++ b/nixos/_mixins/hardware/gpd-win-max.nix @@ -0,0 +1,19 @@ +{ lib, ... }: { + # Many GPD devices uses a tablet displays that are mounted rotated 90Β° counter-clockwise + boot.kernelParams = [ "fbcon=rotate:1" "video=eDP-1:panel_orientation=right_side_up" ]; + + # Required for grub to properly display the boot menu. + boot.loader.grub.gfxmodeEfi = lib.mkDefault "800x1280x32"; + + # Pixel order for rotated screen + fonts.fontconfig.subpixel.rgba = lib.mkDefault "vbgr"; + + # My GPD Win Max has a US keyboard layout + console.keyMap = lib.mkForce "us"; + + services.kmscon.extraConfig = lib.mkForce '' + font-size=14 + xkb-layout=us + ''; + services.xserver.layout = lib.mkForce "us"; +} diff --git a/nixos/_mixins/hardware/streamdeck.nix b/nixos/_mixins/hardware/streamdeck.nix new file mode 100644 index 0000000..0ae4fd1 --- /dev/null +++ b/nixos/_mixins/hardware/streamdeck.nix @@ -0,0 +1,34 @@ +_: { + # Provides users with access to all Elgato StreamDecks. + # https://github.com/muesli/deckmaster + # https://gitlab.gnome.org/World/boatswain/-/blob/main/README.md#udev-rules + services.udev.extraRules = '' + # Deckmaster needs write access to uinput to simulate keypresses. + # Users wanting to use Deckmaster should be added to the input group. + KERNEL=="uinput", SUBSYSTEM=="misc", TAG+="uaccess", OPTIONS+="static_node=uinput", GROUP="input", MODE="0660" + + # Elgato Stream Deck Mini + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0063", TAG+="uaccess", SYMLINK+="streamdeck-mini" + + # Elgato Stream Deck Mini (v2) + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0090", TAG+="uaccess", SYMLINK+="streamdeck-mini" + + # Elgato Stream Deck Original + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", TAG+="uaccess", SYMLINK+="streamdeck" + + # Elgato Stream Deck Original (v2) + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006d", TAG+="uaccess", SYMLINK+="streamdeck" + + # Elgato Stream Deck MK.2 + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0080", TAG+="uaccess", SYMLINK+="streamdeck" + + # Elgato Stream Deck XL + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006c", TAG+="uaccess", SYMLINK+="streamdeck-xl" + + # Elgato Stream Deck XL (v2) + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="008f", TAG+="uaccess", SYMLINK+="streamdeck-xl" + + # Elgato Stream Deck Pedal + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0086", TAG+="uaccess", SYMLINK+="streamdeck-pedal" + ''; +} diff --git a/nixos/_mixins/hardware/systemd-boot.nix b/nixos/_mixins/hardware/systemd-boot.nix new file mode 100644 index 0000000..fd1756a --- /dev/null +++ b/nixos/_mixins/hardware/systemd-boot.nix @@ -0,0 +1,12 @@ +_: { + boot = { + loader = { + efi.canTouchEfiVariables = true; + systemd-boot.configurationLimit = 10; + systemd-boot.consoleMode = "max"; + systemd-boot.enable = true; + systemd-boot.memtest86.enable = true; + timeout = 10; + }; + }; +} diff --git a/hosts/common/optional/btrfs.nix b/nixos/_mixins/optional/btrfs.nix similarity index 66% rename from hosts/common/optional/btrfs.nix rename to nixos/_mixins/optional/btrfs.nix index 7519dde..8b805c9 100644 --- a/hosts/common/optional/btrfs.nix +++ b/nixos/_mixins/optional/btrfs.nix @@ -1,26 +1,30 @@ -{ lib, config, ... }: +_: { fileSystems."/" = - { device = "/dev/disk/by-uuid/bf75af76-49b0-41fa-a4e5-9a52a6a0a667"; + { + device = "/dev/disk/by-uuid/bf75af76-49b0-41fa-a4e5-9a52a6a0a667"; fsType = "btrfs"; options = [ "subvol=root" "compress=zstd" ]; }; fileSystems."/nix" = - { device = "/dev/disk/by-uuid/bf75af76-49b0-41fa-a4e5-9a52a6a0a667"; + { + device = "/dev/disk/by-uuid/bf75af76-49b0-41fa-a4e5-9a52a6a0a667"; fsType = "btrfs"; options = [ "subvol=nix" "noatime" "compress=zstd" ]; }; fileSystems."/persist" = - { device = "/dev/disk/by-uuid/bf75af76-49b0-41fa-a4e5-9a52a6a0a667"; + { + device = "/dev/disk/by-uuid/bf75af76-49b0-41fa-a4e5-9a52a6a0a667"; fsType = "btrfs"; options = [ "subvol=persist" "noatime" "compression=zstd" ]; neededForBoot = true; }; fileSystems."/var/logs" = - { device = "/dev/disk/by-uuid/bf75af76-49b0-41fa-a4e5-9a52a6a0a667"; + { + device = "/dev/disk/by-uuid/bf75af76-49b0-41fa-a4e5-9a52a6a0a667"; fsType = "btrfs"; options = [ "subvol=logs" "noatime" "compress=zstd" ]; neededForBoot = true; diff --git a/hosts/common/optional/ckb-next.nix b/nixos/_mixins/optional/ckb-next.nix similarity index 100% rename from hosts/common/optional/ckb-next.nix rename to nixos/_mixins/optional/ckb-next.nix diff --git a/hosts/common/optional/docker.nix b/nixos/_mixins/optional/docker.nix similarity index 100% rename from hosts/common/optional/docker.nix rename to nixos/_mixins/optional/docker.nix diff --git a/hosts/common/optional/encrypted-root.nix b/nixos/_mixins/optional/encrypted-root.nix similarity index 95% rename from hosts/common/optional/encrypted-root.nix rename to nixos/_mixins/optional/encrypted-root.nix index 632110a..dd48fd7 100644 --- a/hosts/common/optional/encrypted-root.nix +++ b/nixos/_mixins/optional/encrypted-root.nix @@ -3,5 +3,5 @@ let hostname = config.networking.hostName; in { boot.initrd = { luks.devices."${hostname}".device = "/dev/disk/by-label/${hostname}_crypt"; - }; + }; } diff --git a/hosts/common/optional/ephemeral-btrfs.nix b/nixos/_mixins/optional/ephemeral-btrfs.nix similarity index 100% rename from hosts/common/optional/ephemeral-btrfs.nix rename to nixos/_mixins/optional/ephemeral-btrfs.nix diff --git a/hosts/common/optional/fail2ban.nix b/nixos/_mixins/optional/fail2ban.nix similarity index 100% rename from hosts/common/optional/fail2ban.nix rename to nixos/_mixins/optional/fail2ban.nix diff --git a/hosts/common/optional/gamemode.nix b/nixos/_mixins/optional/gamemode.nix similarity index 100% rename from hosts/common/optional/gamemode.nix rename to nixos/_mixins/optional/gamemode.nix diff --git a/hosts/common/optional/gnome.nix b/nixos/_mixins/optional/gnome.nix similarity index 72% rename from hosts/common/optional/gnome.nix rename to nixos/_mixins/optional/gnome.nix index 3581c88..00eb3c0 100644 --- a/hosts/common/optional/gnome.nix +++ b/nixos/_mixins/optional/gnome.nix @@ -1,4 +1,4 @@ -{ pkgs, ...}: +{ pkgs, ... }: { services = { xserver = { @@ -20,12 +20,12 @@ networking.networkmanager.enable = true; services.avahi.enable = true; -# console.font = "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz"; - environment.variables = { - GDK_SCALE = "2"; - GDK_DPI_SCALE = "0.5"; - _JAVA_OPTIONS = "-Dsun.java2d.uiScale=2"; - }; + # console.font = "${pkgs.terminus_font}/share/consolefonts/ter-u28n.psf.gz"; + # environment.variables = { + # GDK_SCALE = "2"; + # GDK_DPI_SCALE = "0.5"; + # _JAVA_OPTIONS = "-Dsun.java2d.uiScale=2"; + # }; # Enable CUPS to print documents. services.printing.enable = true; diff --git a/hosts/common/optional/lol-acfix.nix b/nixos/_mixins/optional/lol-acfix.nix similarity index 100% rename from hosts/common/optional/lol-acfix.nix rename to nixos/_mixins/optional/lol-acfix.nix diff --git a/hosts/common/optional/mysql.nix b/nixos/_mixins/optional/mysql.nix similarity index 100% rename from hosts/common/optional/mysql.nix rename to nixos/_mixins/optional/mysql.nix diff --git a/hosts/common/optional/nginx.nix b/nixos/_mixins/optional/nginx.nix similarity index 97% rename from hosts/common/optional/nginx.nix rename to nixos/_mixins/optional/nginx.nix index 8383551..846d814 100644 --- a/hosts/common/optional/nginx.nix +++ b/nixos/_mixins/optional/nginx.nix @@ -1,4 +1,5 @@ -{ lib, config, ... }: let +{ lib, config, ... }: +let inherit (config.networking) hostName; in { diff --git a/hosts/common/optional/pantheon.nix b/nixos/_mixins/optional/pantheon.nix similarity index 100% rename from hosts/common/optional/pantheon.nix rename to nixos/_mixins/optional/pantheon.nix diff --git a/hosts/common/optional/postgres.nix b/nixos/_mixins/optional/postgres.nix similarity index 89% rename from hosts/common/optional/postgres.nix rename to nixos/_mixins/optional/postgres.nix index 9632f5e..059a420 100644 --- a/hosts/common/optional/postgres.nix +++ b/nixos/_mixins/optional/postgres.nix @@ -1,4 +1,4 @@ -{ lib, ... }: { +_: { services.postgresql.enable = true; environment.persistence = { diff --git a/hosts/common/optional/starcitizen-fixes.nix b/nixos/_mixins/optional/starcitizen-fixes.nix similarity index 100% rename from hosts/common/optional/starcitizen-fixes.nix rename to nixos/_mixins/optional/starcitizen-fixes.nix diff --git a/hosts/common/optional/systemd-boot.nix b/nixos/_mixins/optional/systemd-boot.nix similarity index 100% rename from hosts/common/optional/systemd-boot.nix rename to nixos/_mixins/optional/systemd-boot.nix diff --git a/hosts/common/optional/tailscale-exit-node.nix b/nixos/_mixins/optional/tailscale-exit-node.nix similarity index 100% rename from hosts/common/optional/tailscale-exit-node.nix rename to nixos/_mixins/optional/tailscale-exit-node.nix diff --git a/hosts/common/optional/wireless.nix b/nixos/_mixins/optional/wireless.nix similarity index 98% rename from hosts/common/optional/wireless.nix rename to nixos/_mixins/optional/wireless.nix index e6ea26c..6084961 100644 --- a/hosts/common/optional/wireless.nix +++ b/nixos/_mixins/optional/wireless.nix @@ -1,4 +1,4 @@ -{ config, lib, ... }: { +{ config, ... }: { # Wireless secrets stored through sops sops.secrets.wireless = { sopsFile = ../secrets.yaml; diff --git a/hosts/common/optional/wireshark.nix b/nixos/_mixins/optional/wireshark.nix similarity index 100% rename from hosts/common/optional/wireshark.nix rename to nixos/_mixins/optional/wireshark.nix diff --git a/hosts/common/optional/x11-no-suspend.nix b/nixos/_mixins/optional/x11-no-suspend.nix similarity index 100% rename from hosts/common/optional/x11-no-suspend.nix rename to nixos/_mixins/optional/x11-no-suspend.nix diff --git a/hosts/common/secrets.yaml b/nixos/_mixins/secrets.yaml similarity index 100% rename from hosts/common/secrets.yaml rename to nixos/_mixins/secrets.yaml diff --git a/nixos/_mixins/services/avahi.nix b/nixos/_mixins/services/avahi.nix new file mode 100644 index 0000000..279d85f --- /dev/null +++ b/nixos/_mixins/services/avahi.nix @@ -0,0 +1,8 @@ +_: { + services = { + avahi = { + enable = true; + nssmdns = true; + }; + }; +} diff --git a/nixos/_mixins/services/bluetooth.nix b/nixos/_mixins/services/bluetooth.nix new file mode 100644 index 0000000..429c29a --- /dev/null +++ b/nixos/_mixins/services/bluetooth.nix @@ -0,0 +1,13 @@ +{ pkgs, ... }: +{ + # https://nixos.wiki/wiki/Bluetooth + hardware.bluetooth = { + enable = true; + package = pkgs.bluezFull; + settings = { + General = { + Enable = "Source,Sink,Media,Socket"; + }; + }; + }; +} diff --git a/nixos/_mixins/services/cups.nix b/nixos/_mixins/services/cups.nix new file mode 100644 index 0000000..fac671a --- /dev/null +++ b/nixos/_mixins/services/cups.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + imports = [ + ./avahi.nix + ]; + services = { + printing.enable = true; + #printing.drivers = with pkgs; [ gutenprint hplipWithPlugin ]; + printing.drivers = with pkgs; [ gutenprint ]; + }; +} diff --git a/nixos/_mixins/services/firewall.nix b/nixos/_mixins/services/firewall.nix new file mode 100644 index 0000000..79f2752 --- /dev/null +++ b/nixos/_mixins/services/firewall.nix @@ -0,0 +1,31 @@ +{ lib, hostname, ... }: +let + # Firewall configuration variable for syncthing + syncthing = { + hosts = [ + "designare" + "micropc" + "p1" + "p2-max" + "ripper" + "trooper" + "vm" + "win2" + "win-max" + "zed" + ]; + tcpPorts = [ 22000 ]; + udpPorts = [ 22000 21027 ]; + }; +in +{ + networking = { + firewall = { + enable = true; + allowedTCPPorts = [ ] + ++ lib.optionals (builtins.elem hostname syncthing.hosts) syncthing.tcpPorts; + allowedUDPPorts = [ ] + ++ lib.optionals (builtins.elem hostname syncthing.hosts) syncthing.udpPorts; + }; + }; +} diff --git a/nixos/_mixins/services/flatpak.nix b/nixos/_mixins/services/flatpak.nix new file mode 100644 index 0000000..40063c1 --- /dev/null +++ b/nixos/_mixins/services/flatpak.nix @@ -0,0 +1,10 @@ +{ pkgs, ... }: { + services.flatpak.enable = true; + systemd.services.configure-flathub-repo = { + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.flatpak ]; + script = '' + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + ''; + }; +} diff --git a/nixos/_mixins/services/homepage.nix b/nixos/_mixins/services/homepage.nix new file mode 100644 index 0000000..810b243 --- /dev/null +++ b/nixos/_mixins/services/homepage.nix @@ -0,0 +1,39 @@ +{ inputs, pkgs, ... }: +let + homepage-bookmarks = pkgs.writeTextFile { + name = "bookmarks.yaml"; + executable = false; + destination = "/var/lib/private/homepage-dashboard/bookmarks.yaml"; + text = '' + --- + # For configuration options and examples, please see: + # https://gethomepage.dev/en/configs/bookmarks + + - Developer: + - Github: + - abbr: GH + href: https://github.com/ + + - Social: + - Twitter: + - abbr: X + href: https://twitter.com/ + + - Entertainment: + - YouTube: + - abbr: YT + href: https://youtube.com/ + ''; + }; +in +{ + imports = [ "${inputs.nixpkgs-unstable}/nixos/modules/services/misc/homepage-dashboard.nix" ]; + + services.homepage-dashboard = { + enable = true; + package = pkgs.unstable.homepage-dashboard; + openFirewall = true; + }; + + environment.systemPackages = [ homepage-bookmarks ]; +} diff --git a/nixos/_mixins/services/kmscon.nix b/nixos/_mixins/services/kmscon.nix new file mode 100644 index 0000000..570d9a9 --- /dev/null +++ b/nixos/_mixins/services/kmscon.nix @@ -0,0 +1,16 @@ +{ pkgs, ... }: { + services = { + kmscon = { + enable = true; + hwRender = true; + fonts = [{ + name = "FiraCode Nerd Font Mono"; + package = pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; }; + }]; + extraConfig = '' + font-size=14 + xkb-layout=gb + ''; + }; + }; +} diff --git a/nixos/_mixins/services/maestral.nix b/nixos/_mixins/services/maestral.nix new file mode 100644 index 0000000..10bd9d3 --- /dev/null +++ b/nixos/_mixins/services/maestral.nix @@ -0,0 +1,8 @@ +{ desktop, lib, pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + unstable.maestral + ] ++ lib.optionals (desktop != null) [ + unstable.maestral-gui + ]; +} diff --git a/nixos/_mixins/services/networkmanager.nix b/nixos/_mixins/services/networkmanager.nix new file mode 100644 index 0000000..8dda87e --- /dev/null +++ b/nixos/_mixins/services/networkmanager.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: +{ + networking = { + networkmanager = { + enable = true; + # Use AdGuard Public DNS with ad/tracker blocking + # - https://adguard-dns.io/en/public-dns.html + insertNameservers = [ "94.140.14.14" "94.140.15.15" ]; + wifi = { + backend = "iwd"; + powersave = false; + }; + }; + wireless.iwd.package = pkgs.unstable.iwd; + }; + # Workaround https://github.com/NixOS/nixpkgs/issues/180175 + systemd.services.NetworkManager-wait-online.enable = false; +} diff --git a/nixos/_mixins/services/openrazer.nix b/nixos/_mixins/services/openrazer.nix new file mode 100644 index 0000000..64ad665 --- /dev/null +++ b/nixos/_mixins/services/openrazer.nix @@ -0,0 +1,17 @@ +{ desktop, pkgs, username, ... }: +{ + environment.systemPackages = with pkgs; [ ] ++ lib.optionals (desktop != null) [ + polychromatic + ]; + + hardware = { + openrazer = { + enable = true; + devicesOffOnScreensaver = false; + keyStatistics = true; + mouseBatteryNotifier = true; + syncEffectsEnabled = true; + users = [ "${username}" ]; + }; + }; +} diff --git a/nixos/_mixins/services/openssh.nix b/nixos/_mixins/services/openssh.nix new file mode 100644 index 0000000..615dd08 --- /dev/null +++ b/nixos/_mixins/services/openssh.nix @@ -0,0 +1,22 @@ +{ lib, ... }: { + services = { + openssh = { + enable = true; + settings = { + PasswordAuthentication = false; + PermitRootLogin = lib.mkDefault "no"; + }; + }; + sshguard = { + enable = true; + whitelist = [ + "192.168.2.0/24" + "192.168.192.0/24" + "62.31.16.154" + "80.209.186.67" + ]; + }; + }; + programs.ssh.startAgent = true; + networking.firewall.allowedTCPPorts = [ 22 ]; +} diff --git a/nixos/_mixins/services/pipewire.nix b/nixos/_mixins/services/pipewire.nix new file mode 100644 index 0000000..1555981 --- /dev/null +++ b/nixos/_mixins/services/pipewire.nix @@ -0,0 +1,22 @@ +{ desktop, lib, pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + alsa-utils + pulseaudio + pulsemixer + ] ++ lib.optionals (desktop != null) [ + pavucontrol + ]; + + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services = { + pipewire = { + enable = true; + alsa.enable = true; + jack.enable = true; + pulse.enable = true; + wireplumber.enable = true; + }; + }; +} diff --git a/nixos/_mixins/services/sane.nix b/nixos/_mixins/services/sane.nix new file mode 100644 index 0000000..fa9a206 --- /dev/null +++ b/nixos/_mixins/services/sane.nix @@ -0,0 +1,13 @@ +{ desktop, lib, pkgs, ... }: { + environment.systemPackages = with pkgs; [ ] ++ lib.optionals (desktop != null) [ + gnome.simple-scan + ]; + + hardware = { + sane = { + enable = true; + #extraBackends = with pkgs; [ hplipWithPlugin sane-airscan ]; + extraBackends = with pkgs; [ sane-airscan ]; + }; + }; +} diff --git a/nixos/_mixins/services/smartmon.nix b/nixos/_mixins/services/smartmon.nix new file mode 100644 index 0000000..1823ceb --- /dev/null +++ b/nixos/_mixins/services/smartmon.nix @@ -0,0 +1,11 @@ +{ desktop, lib, pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + nvme-cli + smartmontools + ] ++ lib.optionals (desktop != null) [ + gsmartcontrol + ]; + + services.smartd.enable = true; +} diff --git a/nixos/_mixins/services/tailscale.nix b/nixos/_mixins/services/tailscale.nix new file mode 100644 index 0000000..3945838 --- /dev/null +++ b/nixos/_mixins/services/tailscale.nix @@ -0,0 +1,10 @@ +{ config, ... }: { + services.tailscale.enable = true; + networking = { + firewall = { + checkReversePath = "loose"; + allowedUDPPorts = [ config.services.tailscale.port ]; + trustedInterfaces = [ "tailscale0" ]; + }; + }; +} diff --git a/nixos/_mixins/services/zerotier.nix b/nixos/_mixins/services/zerotier.nix new file mode 100644 index 0000000..4295a41 --- /dev/null +++ b/nixos/_mixins/services/zerotier.nix @@ -0,0 +1,19 @@ +{ config, ... }: { + networking = { + firewall = { + checkReversePath = "loose"; + allowedUDPPorts = [ config.services.zerotierone.port ]; + trustedInterfaces = [ + # "ztwfukvgqh" + # "ztrfyc7hsl" + ]; + }; + }; + services.zerotierone = { + enable = true; + joinNetworks = [ + # "e4da7455b2decfb5" + # "3efa5cb78a7329c1" + ]; + }; +} diff --git a/nixos/_mixins/users/gburd/default.nix b/nixos/_mixins/users/gburd/default.nix new file mode 100644 index 0000000..3b8eb2a --- /dev/null +++ b/nixos/_mixins/users/gburd/default.nix @@ -0,0 +1,95 @@ +{ config, desktop, hostname, lib, pkgs, ... }: +let + ifTheyExist = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; +in +{ + imports = [ ] + ++ lib.optionals (desktop != null) [ + ../../desktop/chromium.nix + ../../desktop/chromium-extensions.nix + ../../desktop/obs-studio.nix + ../../desktop/vscode.nix + ../../desktop/${desktop}-apps.nix + ]; + + environment.systemPackages = with pkgs; [ + aria2 + croc + rclone + curl + #yadm # Terminal dot file manager + zsync + ] ++ lib.optionals (desktop != null) [ + appimage-run + authy + chatterino2 + gimp-with-plugins + gnome.gnome-clocks + irccloud + inkscape + #libreoffice + pick-colour-picker + wmctrl + xdotool + ydotool + zoom-us + + # Fast moving apps use the unstable branch + unstable.discord + unstable.google-chrome + unstable.vivaldi + unstable.vivaldi-ffmpeg-codecs + ]; + + services = { + aria2 = { + enable = true; + openPorts = true; + rpcSecret = "${hostname}"; + }; + croc = { + enable = true; + pass = "${hostname}"; + openFirewall = true; + }; + }; + + users.users.gburd = { + extraGroups = [ + "audio" + "input" + "networkmanager" + "users" + "video" + "wheel" + ] ++ ifTheyExist [ + "deluge" + "docker" + "git" + "i2c" + "libvirtd" + "network" + "podman" + "wireshark" + ]; + + hashedPasswordFile = config.sops.secrets.gburd-password.path; + homeMode = "0755"; + isNormalUser = true; + openssh.authorizedKeys.keys = [ + (builtins.readFile ../../../../home/gburd/ssh.pub) + (builtins.readFile ../../../../home/gburd/symas-ssh.pub) + ]; + packages = [ pkgs.home-manager ]; + shell = pkgs.fish; + }; + + sops.secrets.gburd-password = { + sopsFile = ../../secrets.yaml; + neededForUsers = true; + }; + + home-manager.users.gburd = import ../../../../home/gburd/${config.networking.hostName}.nix; + + services.geoclue2.enable = true; +} diff --git a/nixos/_mixins/users/nixos/default.nix b/nixos/_mixins/users/nixos/default.nix new file mode 100644 index 0000000..edd5330 --- /dev/null +++ b/nixos/_mixins/users/nixos/default.nix @@ -0,0 +1,107 @@ +{ config, desktop, lib, pkgs, username, ... }: +let + ifExists = groups: builtins.filter (group: builtins.hasAttr group config.users.groups) groups; + install-system = pkgs.writeScriptBin "install-system" '' + #!${pkgs.stdenv.shell} + + #set -euo pipefail + + TARGET_HOST="''${1:-}" + TARGET_USER="''${2:-gburd}" + + if [ "$(id -u)" -eq 0 ]; then + echo "ERROR! $(basename "$0") should be run as a regular user" + exit 1 + fi + + if [ ! -d "$HOME/ws/nix-config/.git" ]; then + git clone https://github.com/gburd/nix-config.git "$HOME/ws/nix-config" + fi + + pushd "$HOME/ws/nix-config" + + if [[ -z "$TARGET_HOST" ]]; then + echo "ERROR! $(basename "$0") requires a hostname as the first argument" + echo " The following hosts are available" + ls -1 nixos/*/default.nix | cut -d'/' -f2 | grep -v iso + exit 1 + fi + + if [[ -z "$TARGET_USER" ]]; then + echo "ERROR! $(basename "$0") requires a username as the second argument" + echo " The following users are available" + ls -1 nixos/_mixins/users/ | grep -v -E "nixos|root" + exit 1 + fi + + if [ ! -e "nixos/$TARGET_HOST/disks.nix" ]; then + echo "ERROR! $(basename "$0") could not find the required nixos/$TARGET_HOST/disks.nix" + exit 1 + fi + + # Check if the machine we're provisioning expects a keyfile to unlock a disk. + # If it does, generate a new key, and write to a known location. + if grep -q "data.keyfile" "nixos/$TARGET_HOST/disks.nix"; then + echo -n "$(head -c32 /dev/random | base64)" > /tmp/data.keyfile + fi + + echo "WARNING! The disks in $TARGET_HOST are about to get wiped" + echo " NixOS will be re-installed" + echo " This is a destructive operation" + echo + read -p "Are you sure? [y/N]" -n 1 -r + echo + if [[ $REPLY =~ ^[Yy]$ ]]; then + sudo true + + sudo nix run github:nix-community/disko \ + --extra-experimental-features "nix-command flakes" \ + --no-write-lock-file \ + -- \ + --mode zap_create_mount \ + "nixos/$TARGET_HOST/disks.nix" + + sudo nixos-install --no-root-password --flake ".#$TARGET_HOST" + + # Rsync nix-config to the target install and set the remote origin to SSH. + rsync -a --delete "$HOME/ws/" "/mnt/home/$TARGET_USER/Zero/" + pushd "/mnt/home/$TARGET_USER/Zero/nix-config" + git remote set-url origin git@github.com:gburd/nix-config.git + popd + + # If there is a keyfile for a data disk, put copy it to the root partition and + # ensure the permissions are set appropriately. + if [[ -f "/tmp/data.keyfile" ]]; then + sudo cp /tmp/data.keyfile /mnt/etc/data.keyfile + sudo chmod 0400 /mnt/etc/data.keyfile + fi + fi + ''; +in +{ + # Only include desktop components if one is supplied. + imports = [ ] ++ lib.optional (desktop != null) ./desktop.nix; + + config.users.users.nixos = { + description = "NixOS"; + extraGroups = [ + "audio" + "networkmanager" + "users" + "video" + "wheel" + ] + ++ ifExists [ + "docker" + "podman" + ]; + homeMode = "0755"; + openssh.authorizedKeys.keys = [ (builtins.readFile ../../../home/gburd/ssh.pub) ]; + packages = [ pkgs.home-manager ]; + shell = pkgs.fish; + }; + + config.system.stateVersion = lib.mkForce lib.trivial.release; + config.environment.systemPackages = [ install-system ]; + config.services.kmscon.autologinUser = "${username}"; +} diff --git a/nixos/_mixins/users/nixos/desktop.nix b/nixos/_mixins/users/nixos/desktop.nix new file mode 100644 index 0000000..0d965c0 --- /dev/null +++ b/nixos/_mixins/users/nixos/desktop.nix @@ -0,0 +1,14 @@ +{ config, desktop, lib, pkgs, username, ... }: { + config.environment.systemPackages = with pkgs; [ + gparted + ]; + config.systemd.tmpfiles.rules = [ + "d /home/${username}/Desktop 0755 ${username} users" + "L+ /home/${username}/Desktop/gparted.desktop - - - - ${pkgs.gparted}/share/applications/gparted.desktop" + "L+ /home/${username}/Desktop/io.elementary.terminal.desktop - - - - ${pkgs.pantheon.elementary-terminal}/share/applications/io.elementary.terminal.desktop" + "L+ /home/${username}/Desktop/io.calamares.calamares.desktop - - - - ${pkgs.calamares-nixos}/share/applications/io.calamares.calamares.desktop" + ]; + config.isoImage.edition = lib.mkForce "${desktop}"; + config.services.xserver.displayManager.autoLogin.user = "${username}"; + config.services.kmscon.autologinUser = lib.mkForce null; +} diff --git a/nixos/_mixins/users/root/default.nix b/nixos/_mixins/users/root/default.nix new file mode 100644 index 0000000..9b53f33 --- /dev/null +++ b/nixos/_mixins/users/root/default.nix @@ -0,0 +1,7 @@ +_: +{ + users.users.root = { + hashedPassword = null; + openssh.authorizedKeys.keys = [ (builtins.readFile ../../../home/gburd/ssh.pub) ]; + }; +} diff --git a/nixos/_mixins/virt/default.nix b/nixos/_mixins/virt/default.nix new file mode 100644 index 0000000..414515c --- /dev/null +++ b/nixos/_mixins/virt/default.nix @@ -0,0 +1,25 @@ +{ config, desktop, lib, pkgs, ... }: { + #https://nixos.wiki/wiki/Podman + environment.systemPackages = with pkgs; [ + unstable.distrobox + fuse-overlayfs + podman-compose + podman-tui + ] ++ lib.optionals (desktop != null) [ + unstable.pods + unstable.quickemu + xorg.xhost + ]; + + virtualisation = { + podman = { + defaultNetwork.settings = { + dns_enabled = true; + }; + dockerCompat = true; + dockerSocket.enable = true; + enable = true; + enableNvidia = lib.elem "nvidia" config.services.xserver.videoDrivers; + }; + }; +} diff --git a/nixos/floki/default.nix b/nixos/floki/default.nix new file mode 100644 index 0000000..0a4dea0 --- /dev/null +++ b/nixos/floki/default.nix @@ -0,0 +1,86 @@ +{ pkgs, inputs, ... }: { + imports = [ + inputs.nixos-hardware.nixosModules.common-cpu-amd + inputs.nixos-hardware.nixosModules.common-gpu-amd + inputs.nixos-hardware.nixosModules.common-pc-ssd + #(import ./disks.nix { }) + + ../_mixins/hardware/systemd-boot.nix + ../_mixins/services/bluetooth.nix + ../_mixins/services/pipewire.nix + # ../_mixins/services/zerotier.nix + ../_mixins/virt + + ../_mixins/global + ../_mixins/users/gburd + ]; + + boot.initrd.luks.devices."enc".device = "/dev/disk/by-uuid/470152b6-16cc-4dcf-b1e9-c684c1589e33"; + + fileSystems."/swap" = + { + device = "/dev/disk/by-uuid/bf75af76-49b0-41fa-a4e5-9a52a6a0a667"; + fsType = "btrfs"; + options = [ "subvol=swap" ]; + }; + + fileSystems."/boot" = + { + device = "/dev/disk/by-uuid/3D04-3716"; + fsType = "vfat"; + }; + + # fileSystems = { + # "/boot" = { + # device = "/dev/disk/by-label/ESP"; + # fsType = "vfat"; + # }; + # }; + + swapDevices = [{ + device = "/swap/swapfile"; + size = 8196; + }]; + + boot = { + initrd.availableKernelModules = [ + "ahci" + "nvme" + "rtsx_pci_sdmmc" + "sd_mod" + "sdhci_pci" + "uas" + "usbhid" + "usb_storage" + "xhci_pci" + ]; + kernelModules = [ "kvm-intel" ]; + kernelPackages = pkgs.linuxPackages_latest; + }; + + # My GPD MicroPC has a US keyboard layout + console.keyMap = lib.mkForce "us"; + services.kmscon.extraConfig = lib.mkForce '' + font-size=14 + xkb-layout=us + ''; + services.xserver.layout = lib.mkForce "us"; + services.xserver.xkbOptions = "ctrl:swapcaps"; + + environment.systemPackages = with pkgs; [ + nvtop-amd + ]; + + networking.hostName = "floki"; + powerManagement.powertop.enable = true; + powerManagement.cpuFreqGovernor = "powersave"; + + # Lid settings + services.logind = { + lidSwitch = "suspend"; + lidSwitchExternalPower = "lock"; + }; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + +} diff --git a/nixos/floki/disks.nix b/nixos/floki/disks.nix new file mode 100644 index 0000000..48517fc --- /dev/null +++ b/nixos/floki/disks.nix @@ -0,0 +1,44 @@ +{ disks ? [ "/dev/nvme0n1" ], ... }: +let + defaultXfsOpts = [ "defaults" "relatime" "nodiratime" ]; +in +{ + disko.devices = { + disk = { + nvme0 = { + type = "disk"; + device = builtins.elemAt disks 0; + content = { + type = "table"; + format = "gpt"; + partitions = [{ + name = "ESP"; + start = "0%"; + end = "550MiB"; + bootable = true; + flags = [ "esp" ]; + fs-type = "fat32"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + } + { + name = "root"; + start = "550MiB"; + end = "100%"; + content = { + type = "filesystem"; + # Overwirte the existing filesystem + extraArgs = [ "-f" ]; + format = "xfs"; + mountpoint = "/"; + mountOptions = defaultXfsOpts; + }; + }]; + }; + }; + }; + }; +} diff --git a/hosts/floki/secrets.yaml b/nixos/floki/secrets.yaml similarity index 100% rename from hosts/floki/secrets.yaml rename to nixos/floki/secrets.yaml diff --git a/hosts/floki/ssh_host_ed25519_key.pub b/nixos/floki/ssh_host_ed25519_key.pub similarity index 100% rename from hosts/floki/ssh_host_ed25519_key.pub rename to nixos/floki/ssh_host_ed25519_key.pub diff --git a/hosts/floki/ssh_host_rsa_key.pub b/nixos/floki/ssh_host_rsa_key.pub similarity index 100% rename from hosts/floki/ssh_host_rsa_key.pub rename to nixos/floki/ssh_host_rsa_key.pub diff --git a/nixos/iso-console/default.nix b/nixos/iso-console/default.nix new file mode 100644 index 0000000..5589c62 --- /dev/null +++ b/nixos/iso-console/default.nix @@ -0,0 +1,4 @@ +{ lib, ... }: +{ + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/nixos/iso-desktop/default.nix b/nixos/iso-desktop/default.nix new file mode 100644 index 0000000..8653889 --- /dev/null +++ b/nixos/iso-desktop/default.nix @@ -0,0 +1,9 @@ +{ lib, ... }: +{ + imports = [ + ../_mixins/services/bluetooth.nix + ../_mixins/services/pipewire.nix + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/nixpkgs.nix b/nixpkgs.nix new file mode 100644 index 0000000..39a480d --- /dev/null +++ b/nixpkgs.nix @@ -0,0 +1,8 @@ +# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock +# file Useful to avoid using channels when using legacy nix commands +let lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; +in +import (fetchTarball { + url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; + sha256 = lock.narHash; +}) diff --git a/overlays/default.nix b/overlays/default.nix index ae815c2..86e7135 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,4 +1,4 @@ -{ outputs, inputs }: +{ inputs }: let addPatches = pkg: patches: pkg.overrideAttrs (oldAttrs: { patches = (oldAttrs.patches or [ ]) ++ patches; @@ -10,11 +10,12 @@ in # 'inputs.${flake}.legacyPackages.${pkgs.system}' flake-inputs = final: _: { inputs = builtins.mapAttrs - (_: flake: let - legacyPackages = ((flake.legacyPackages or {}).${final.system} or {}); - packages = ((flake.packages or {}).${final.system} or {}); - in - if legacyPackages != {} then legacyPackages else packages + (_: flake: + let + legacyPackages = (flake.legacyPackages or { }).${final.system} or { }; + packages = (flake.packages or { }).${final.system} or { }; + in + if legacyPackages != { } then legacyPackages else packages ) inputs; }; diff --git a/pkgs/formats/default.nix b/pkgs/formats/default.nix index 4ddabc4..33003d1 100644 --- a/pkgs/formats/default.nix +++ b/pkgs/formats/default.nix @@ -1,6 +1,6 @@ { pkgs }: { - gzipJson = {}: { + gzipJson = _: { generate = name: value: pkgs.callPackage ({ runCommand, gzip }: runCommand name { @@ -12,6 +12,6 @@ '') { }; - type = (pkgs.formats.json { }).type; + inherit ((pkgs.formats.json { })) type; }; } diff --git a/pkgs/pass-wofi/default.nix b/pkgs/pass-wofi/default.nix index e19a3c7..4167f8e 100644 --- a/pkgs/pass-wofi/default.nix +++ b/pkgs/pass-wofi/default.nix @@ -1,7 +1,5 @@ { lib -, pkgs , stdenv -, fetchFromGitHub , makeWrapper , pass , jq diff --git a/shell.nix b/shell.nix index be24d02..bb0ef53 100644 --- a/shell.nix +++ b/shell.nix @@ -1,15 +1,4 @@ -# Shell for bootstrapping flake-enabled nix and other tooling -{ pkgs ? # If pkgs is not defined, instanciate nixpkgs from locked commit - let - lock = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked; - nixpkgs = fetchTarball { - url = "https://github.com/nixos/nixpkgs/archive/${lock.rev}.tar.gz"; - sha256 = lock.narHash; - }; - in - import nixpkgs { overlays = [ ]; } -, ... }: -{ +{ pkgs ? (import ./nixpkgs.nix) { overlays = [ ]; } }: { default = pkgs.mkShell { NIX_CONFIG = "extra-experimental-features = nix-command flakes repl-flake"; nativeBuildInputs = with pkgs; [ @@ -32,8 +21,8 @@ services.dbus.packages = [ pkgs.gcr ]; services.pcscd.enable = true; programs.gnupg.agent = { - enable = true; - pinentryFlavor = "curses"; - enableSSHSupport = true; + enable = true; + pinentryFlavor = "curses"; + enableSSHSupport = true; }; } diff --git a/templates/c/flake.nix b/templates/c/flake.nix index 46cee2e..7f953e8 100644 --- a/templates/c/flake.nix +++ b/templates/c/flake.nix @@ -10,7 +10,7 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; }; - outputs = { self, nixpkgs }: + outputs = { nixpkgs }: let forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ]; pkgsFor = nixpkgs.legacyPackages; diff --git a/templates/haskell/flake.nix b/templates/haskell/flake.nix index 782db5a..58a764f 100644 --- a/templates/haskell/flake.nix +++ b/templates/haskell/flake.nix @@ -10,7 +10,7 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; }; - outputs = { self, nixpkgs }: + outputs = { nixpkgs }: let forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ]; pkgsFor = nixpkgs.legacyPackages; diff --git a/templates/node/flake.nix b/templates/node/flake.nix index 1f9847f..8e78445 100644 --- a/templates/node/flake.nix +++ b/templates/node/flake.nix @@ -10,7 +10,7 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; }; - outputs = { self, nixpkgs }: + outputs = { nixpkgs }: let forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ]; pkgsFor = nixpkgs.legacyPackages; diff --git a/templates/rust/flake.nix b/templates/rust/flake.nix index 80dae94..fe23934 100644 --- a/templates/rust/flake.nix +++ b/templates/rust/flake.nix @@ -10,7 +10,7 @@ nixpkgs.url = "github:NixOS/nixpkgs/nixos-22.11"; }; - outputs = { self, nixpkgs }: + outputs = { nixpkgs }: let forAllSystems = nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ]; pkgsFor = nixpkgs.legacyPackages;