diff --git a/README.md b/README.md index da054e5..caa1fc0 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,7 @@ NixOS dotfiles and configuration for various hosts and users. - [`flake.lock`](./flake.lock) and [`flake.nix`](./flake.nix): Core Nix flake files defining the repository's dependencies and entry points. - [`hosts/`](./hosts): All host-specific configurations. + - [`common/`](./hosts/common): Shared configuration definitions. - [`shells/`](./hosts/common/shells): Nix dev shells. - [`configs/`](./hosts/common/configs): System configurations applicable to all hosts. @@ -19,6 +20,7 @@ NixOS dotfiles and configuration for various hosts and users. - `secrets//`: Global secrets for individual namespaces that apply across all hosts. - [`lib/`](./lib): Nix library function definitions and utilities. + - [`scripts/`](./lib/scripts): Utility scripts for managing the repository. - [`add-host.sh`](./lib/scripts/add-host.sh): Instantiate the keys for a new host configuration. - [`remove-host.sh`](./lib/scripts/remove-host.sh): Remove references to a host. @@ -34,7 +36,7 @@ Any `options.nix` files create custom option definitions when present. Below is a table of all hosts, with links to their respective README files, which may provide further details and/or post-installation checklists. | Host | README | -|-------------|----------------------------------------------------------| +| ----------- | -------------------------------------------------------- | | `installer` | [hosts/installer/README.md](./hosts/installer/README.md) | | `eirene` | [hosts/eirene/README.md](./hosts/eirene/README.md) | | `elara` | [hosts/elara/README.md](./hosts/elara/README.md) | diff --git a/flake.lock b/flake.lock index faa034c..c2646ca 100644 --- a/flake.lock +++ b/flake.lock @@ -19,6 +19,7 @@ }, "original": { "owner": "aylur", + "ref": "main", "repo": "ags", "type": "github" } @@ -30,15 +31,16 @@ ] }, "locked": { - "lastModified": 1739233175, - "narHash": "sha256-ZH9J3PtGi1iHoKbn6U1NHxTFU3+eJfRQRjKdvKGJDuQ=", + "lastModified": 1739380580, + "narHash": "sha256-wGtGEfdooudj74wn59Vu5Z2DLsrX9cxdGTFc9sJrP9M=", "owner": "aylur", "repo": "astal", - "rev": "ee91402cabc994bb4fb7c3f5405a218ad0b57fd3", + "rev": "956b74fd9ff8c607b6683b404860c4e6b30ffe2b", "type": "github" }, "original": { "owner": "aylur", + "ref": "main", "repo": "astal", "type": "github" } @@ -50,15 +52,16 @@ ] }, "locked": { - "lastModified": 1738765162, - "narHash": "sha256-3Z40qHaFScWUCVQrGc4Y+RdoPsh1R/wIh+AN4cTXP0I=", + "lastModified": 1739634831, + "narHash": "sha256-xFnU+uUl48Icas2wPQ+ZzlL2O3n8f6J2LrzNK9f2nng=", "owner": "nix-community", "repo": "disko", - "rev": "ff3568858c54bd306e9e1f2886f0f781df307dff", + "rev": "fa5746ecea1772cf59b3f34c5816ab3531478142", "type": "github" }, "original": { "owner": "nix-community", + "ref": "master", "repo": "disko", "type": "github" } @@ -100,6 +103,7 @@ }, "original": { "owner": "numtide", + "ref": "main", "repo": "flake-utils", "type": "github" } @@ -150,15 +154,16 @@ "treefmt-nix": "treefmt-nix" }, "locked": { - "lastModified": 1739229047, - "narHash": "sha256-sSTgA86wdk8d544c2+gzrfvVPHQF4mbsomvLOW2thn0=", + "lastModified": 1739724221, + "narHash": "sha256-hu0SN4bqS1NDT70qUzDmBxpdQFeKYH1VH3ZKPABmJhc=", "owner": "nix-community", "repo": "NUR", - "rev": "8348d89f30598a73fee7efb4b5d34c3de201e71b", + "rev": "9b067eebe1e32f625fb43e218155ca60072a3a20", "type": "github" }, "original": { "owner": "nix-community", + "ref": "master", "repo": "NUR", "type": "github" } @@ -174,7 +179,8 @@ "nur": "nur", "sops-nix": "sops-nix", "spicetify-nix": "spicetify-nix", - "systems": "systems" + "systems": "systems", + "treefmt-nix": "treefmt-nix_2" } }, "sops-nix": { @@ -193,6 +199,7 @@ }, "original": { "owner": "Mic92", + "ref": "master", "repo": "sops-nix", "type": "github" } @@ -257,6 +264,27 @@ "repo": "treefmt-nix", "type": "github" } + }, + "treefmt-nix_2": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1738953846, + "narHash": "sha256-yrK3Hjcr8F7qS/j2F+r7C7o010eVWWlm4T1PrbKBOxQ=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "4f09b473c936d41582dd744e19f34ec27592c5fd", + "type": "github" + }, + "original": { + "owner": "numtide", + "ref": "main", + "repo": "treefmt-nix", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index ca0eaec..10c9322 100644 --- a/flake.nix +++ b/flake.nix @@ -32,12 +32,20 @@ }; disko = { - url = "github:nix-community/disko"; + type = "github"; + owner = "nix-community"; + repo = "disko"; + ref = "master"; + inputs.nixpkgs.follows = "nixpkgs"; }; sops-nix = { - url = "github:Mic92/sops-nix"; + type = "github"; + owner = "Mic92"; + repo = "sops-nix"; + ref = "master"; + inputs.nixpkgs.follows = "nixpkgs"; }; @@ -49,22 +57,47 @@ }; nur = { - url = "github:nix-community/NUR"; + type = "github"; + owner = "nix-community"; + repo = "NUR"; + ref = "master"; + inputs.nixpkgs.follows = "nixpkgs"; }; flake-utils = { - url = "github:numtide/flake-utils"; + type = "github"; + owner = "numtide"; + repo = "flake-utils"; + ref = "main"; + inputs.systems.follows = "systems"; }; + treefmt-nix = { + type = "github"; + owner = "numtide"; + repo = "treefmt-nix"; + ref = "main"; + + inputs.nixpkgs.follows = "nixpkgs"; + }; + astal = { - url = "github:aylur/astal"; + type = "github"; + owner = "aylur"; + repo = "astal"; + ref = "main"; + inputs.nixpkgs.follows = "nixpkgs"; }; ags = { - url = "github:aylur/ags"; + type = "github"; + owner = "aylur"; + repo = "ags"; + ref = "main"; + inputs = { nixpkgs.follows = "nixpkgs"; astal.follows = "astal"; @@ -115,10 +148,11 @@ }; }; } - // inputs.flake-utils.lib.eachDefaultSystem ( + // inputs.flake-utils.lib.eachSystem [ "x86_64-linux" ] ( system: let pkgs = nixpkgs.legacyPackages.${system}; + treefmt = inputs.treefmt-nix.lib.evalModule pkgs ./treefmt.nix; in { devShells = { @@ -131,7 +165,8 @@ python = import ./hosts/common/shells/python { inherit pkgs; }; }; - formatter = pkgs.nixfmt-rfc-style; + formatter = treefmt.config.build.wrapper; + checks.formatting = treefmt.config.build.check self; } ); diff --git a/hosts/common/configs/system/backup/backup.sh b/hosts/common/configs/system/backup/backup.sh index 8584a2e..17f6c6f 100644 --- a/hosts/common/configs/system/backup/backup.sh +++ b/hosts/common/configs/system/backup/backup.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + if [[ "$EUID" -ne 0 ]]; then echo "Please run the script as root." exit 1 diff --git a/hosts/common/configs/system/backup/default.nix b/hosts/common/configs/system/backup/default.nix index 9c0e152..dc1a49c 100644 --- a/hosts/common/configs/system/backup/default.nix +++ b/hosts/common/configs/system/backup/default.nix @@ -13,8 +13,6 @@ ]; home-manager.sharedModules = [ - { - programs.zsh.initExtra = builtins.readFile ./backup.completion.zsh; - } + { programs.zsh.initExtra = builtins.readFile ./backup.completion.zsh; } ]; } diff --git a/hosts/common/configs/system/bluetooth/default.nix b/hosts/common/configs/system/bluetooth/default.nix index 2ef3069..362ec5f 100644 --- a/hosts/common/configs/system/bluetooth/default.nix +++ b/hosts/common/configs/system/bluetooth/default.nix @@ -14,9 +14,5 @@ config.environment.persistence."/persist"."/var/lib/bluetooth".mount ]; - home-manager.sharedModules = [ - { - services.mpris-proxy.enable = config.services.pipewire.enable; - } - ]; + home-manager.sharedModules = [ { services.mpris-proxy.enable = config.services.pipewire.enable; } ]; } diff --git a/hosts/common/configs/system/impermanence/scripts/start.sh b/hosts/common/configs/system/impermanence/scripts/start.sh index 77b1b38..37186e5 100644 --- a/hosts/common/configs/system/impermanence/scripts/start.sh +++ b/hosts/common/configs/system/impermanence/scripts/start.sh @@ -1,3 +1,6 @@ +# shellcheck shell=bash + +# shellcheck disable=SC2154 echo "Starting impermanence mount with source: $source, target: $target, path: $path." source_current="$source" diff --git a/hosts/common/configs/system/impermanence/scripts/stop.sh b/hosts/common/configs/system/impermanence/scripts/stop.sh index 126d13c..b053f05 100644 --- a/hosts/common/configs/system/impermanence/scripts/stop.sh +++ b/hosts/common/configs/system/impermanence/scripts/stop.sh @@ -1,3 +1,6 @@ +# shellcheck shell=bash + +# shellcheck disable=SC2154 echo "Stopping impermanence mount with source: $source, target: $target, path: $path." source_current="$source" diff --git a/hosts/common/configs/system/impermanence/scripts/wipe.sh b/hosts/common/configs/system/impermanence/scripts/wipe.sh index d6131c6..e3942f0 100644 --- a/hosts/common/configs/system/impermanence/scripts/wipe.sh +++ b/hosts/common/configs/system/impermanence/scripts/wipe.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + delete_subvolume_recursively() { IFS=$'\n' for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do diff --git a/hosts/common/configs/system/nix-cleanup/cleanup.sh b/hosts/common/configs/system/nix-cleanup/cleanup.sh index 5f1d735..157c326 100644 --- a/hosts/common/configs/system/nix-cleanup/cleanup.sh +++ b/hosts/common/configs/system/nix-cleanup/cleanup.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + if [[ "${EUID}" -ne 0 ]]; then echo "Please run the script as root." exit 1 diff --git a/hosts/common/configs/system/nix-install/default.nix b/hosts/common/configs/system/nix-install/default.nix index 9e32c80..0ca2ed4 100644 --- a/hosts/common/configs/system/nix-install/default.nix +++ b/hosts/common/configs/system/nix-install/default.nix @@ -15,8 +15,6 @@ ]; home-manager.sharedModules = [ - { - programs.zsh.initExtra = builtins.readFile ./install.completion.zsh; - } + { programs.zsh.initExtra = builtins.readFile ./install.completion.zsh; } ]; } diff --git a/hosts/common/configs/system/nix-install/install.sh b/hosts/common/configs/system/nix-install/install.sh index bfe39d6..02daa58 100644 --- a/hosts/common/configs/system/nix-install/install.sh +++ b/hosts/common/configs/system/nix-install/install.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + usage() { echo "Usage: $0 flake -m install|repair -h host [-k key] [-p password_file] [-c] [-r]" echo diff --git a/hosts/common/configs/system/powertop/mouse.sh b/hosts/common/configs/system/powertop/mouse.sh index dc0f6ea..9fe760c 100644 --- a/hosts/common/configs/system/powertop/mouse.sh +++ b/hosts/common/configs/system/powertop/mouse.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + SEARCH_STRINGS=( "Mouse" "Razer DeathAdder V3 HyperSpeed" @@ -6,8 +8,9 @@ SEARCH_STRINGS=( for search_string in "${SEARCH_STRINGS[@]}"; do echo "Searching for devices matching: $search_string" - for f in $(grep -l "$search_string" /sys/bus/usb/devices/*/product 2>/dev/null | sed "s/product/power\\/control/"); do - echo "Setting power control to 'on' for: $f" - echo on >| "$f" + grep -l "$search_string" /sys/bus/usb/devices/*/product 2>/dev/null | sed "s/product/power\\/control/" | while IFS= read -r device + do + echo "Setting power control to 'on' for: $device" + echo on >| "$device" done done diff --git a/hosts/common/configs/system/timezone/timezone.sh b/hosts/common/configs/system/timezone/timezone.sh index 4854001..7ea6c59 100644 --- a/hosts/common/configs/system/timezone/timezone.sh +++ b/hosts/common/configs/system/timezone/timezone.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + case "$2" in connectivity-change) if timezone=$(curl --fail https://ipapi.co/timezone); then diff --git a/hosts/common/configs/user/console/docker/default.nix b/hosts/common/configs/user/console/docker/default.nix index 0f2df5c..f4f2acb 100644 --- a/hosts/common/configs/user/console/docker/default.nix +++ b/hosts/common/configs/user/console/docker/default.nix @@ -38,8 +38,6 @@ lib.mkMerge [ sessionVariables.DOCKER_CONFIG = "${home}/.config/docker"; }; - - programs.vscode.languages.docker.enable = true; }; } (lib.mkIf rootless { @@ -54,7 +52,5 @@ lib.mkMerge [ ]; }; }) - (lib.mkIf (!rootless) { - users.users.${user}.extraGroups = [ "docker" ]; - }) + (lib.mkIf (!rootless) { users.users.${user}.extraGroups = [ "docker" ]; }) ] diff --git a/hosts/common/configs/user/console/git/commit-msg.sh b/hosts/common/configs/user/console/git/commit-msg.sh index 5073087..22abd3f 100644 --- a/hosts/common/configs/user/console/git/commit-msg.sh +++ b/hosts/common/configs/user/console/git/commit-msg.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + git interpret-trailers --if-exists doNothing --trailer \ "Signed-off-by: $(git config user.name) <$(git config user.email)>" \ --in-place "$1" diff --git a/hosts/common/configs/user/console/gpg-agent/import-gpg-keys.sh b/hosts/common/configs/user/console/gpg-agent/import-gpg-keys.sh index 66122f2..44954bd 100644 --- a/hosts/common/configs/user/console/gpg-agent/import-gpg-keys.sh +++ b/hosts/common/configs/user/console/gpg-agent/import-gpg-keys.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + install -d -m 700 "$GNUPGHOME" KEYS="$HOME/.config/sops-nix/secrets/gpg" diff --git a/hosts/common/configs/user/console/home-manager/default.nix b/hosts/common/configs/user/console/home-manager/default.nix index 4372534..d78254e 100644 --- a/hosts/common/configs/user/console/home-manager/default.nix +++ b/hosts/common/configs/user/console/home-manager/default.nix @@ -9,9 +9,7 @@ programs.dconf.enable = true; home-manager = { - extraSpecialArgs = { - inherit inputs; - }; + extraSpecialArgs = { inherit inputs; }; backupFileExtension = "bak"; useUserPackages = true; useGlobalPkgs = true; diff --git a/hosts/common/configs/user/console/nix-develop/template.nix b/hosts/common/configs/user/console/nix-develop/template.nix index c72aebf..a5519d0 100644 --- a/hosts/common/configs/user/console/nix-develop/template.nix +++ b/hosts/common/configs/user/console/nix-develop/template.nix @@ -20,9 +20,7 @@ pkgs = nixpkgs.legacyPackages.${system}; in { - devShells.default = pkgs.mkShell { - packages = [ ]; - }; + devShells.default = pkgs.mkShell { packages = [ ]; }; formatter = pkgs.nixfmt-rfc-style; } diff --git a/hosts/common/configs/user/console/nix-direnv/default.nix b/hosts/common/configs/user/console/nix-direnv/default.nix index 4124139..e5f808d 100644 --- a/hosts/common/configs/user/console/nix-direnv/default.nix +++ b/hosts/common/configs/user/console/nix-direnv/default.nix @@ -99,9 +99,7 @@ ''; "direnv/direnv.toml".source = ( - (pkgs.formats.toml { }).generate "direnv.toml" { - global.warn_timeout = 0; - } + (pkgs.formats.toml { }).generate "direnv.toml" { global.warn_timeout = 0; } ); }; }; diff --git a/hosts/common/configs/user/console/sops/default.nix b/hosts/common/configs/user/console/sops/default.nix index 7ad8431..5023dc2 100644 --- a/hosts/common/configs/user/console/sops/default.nix +++ b/hosts/common/configs/user/console/sops/default.nix @@ -13,7 +13,5 @@ config.environment.persistence."/persist"."${home}/.config/sops-nix/key.txt".source; home.sessionVariables.SOPS_AGE_KEY_FILE = config.environment.persistence."/persist"."${home}/.config/sops-nix/key.txt".source; - - programs.vscode.languages.sops.enable = true; }; } diff --git a/hosts/common/configs/user/gui/astal/config/app.ts b/hosts/common/configs/user/gui/astal/config/app.ts index 08ccacd..bbedb42 100644 --- a/hosts/common/configs/user/gui/astal/config/app.ts +++ b/hosts/common/configs/user/gui/astal/config/app.ts @@ -1,10 +1,10 @@ -import { App } from "astal/gtk3" -import Bar from "./widget/Bar" -import { monitorFile } from "astal/file" -import { exec } from "astal/process" -import GLib from "gi://GLib" +import { App } from "astal/gtk3"; +import Bar from "./widget/Bar"; +import { monitorFile } from "astal/file"; +import { exec } from "astal/process"; +import GLib from "gi://GLib"; -const HOME = GLib.getenv("HOME") +const HOME = GLib.getenv("HOME"); const css = `${HOME}/.config/astal/theme.css`; const scss = `${HOME}/.config/astal/theme.sass`; @@ -18,6 +18,6 @@ exec(`sassc ${scss} ${css}`); App.start({ css, main() { - App.get_monitors().map(Bar) + App.get_monitors().map(Bar); }, -}) +}); diff --git a/hosts/common/configs/user/gui/astal/config/env.d.ts b/hosts/common/configs/user/gui/astal/config/env.d.ts index e6b3c08..1b5f06a 100644 --- a/hosts/common/configs/user/gui/astal/config/env.d.ts +++ b/hosts/common/configs/user/gui/astal/config/env.d.ts @@ -1,26 +1,26 @@ -export const SRC: string +export const SRC: string; declare module "inline:*" { - const content: string - export default content + const content: string; + export default content; } declare module "*.scss" { - const content: string - export default content + const content: string; + export default content; } declare module "*.sass" { - const content: string - export default content + const content: string; + export default content; } declare module "*.blp" { - const content: string - export default content + const content: string; + export default content; } declare module "*.css" { - const content: string - export default content + const content: string; + export default content; } diff --git a/hosts/common/configs/user/gui/astal/config/tsconfig.json b/hosts/common/configs/user/gui/astal/config/tsconfig.json index 041fc07..406d60d 100644 --- a/hosts/common/configs/user/gui/astal/config/tsconfig.json +++ b/hosts/common/configs/user/gui/astal/config/tsconfig.json @@ -7,6 +7,6 @@ "module": "ES2022", "moduleResolution": "Bundler", "jsx": "react-jsx", - "jsxImportSource": "astal/gtk3", + "jsxImportSource": "astal/gtk3" } } diff --git a/hosts/common/configs/user/gui/astal/config/widget/Bar.tsx b/hosts/common/configs/user/gui/astal/config/widget/Bar.tsx index 8996e97..3b9597e 100644 --- a/hosts/common/configs/user/gui/astal/config/widget/Bar.tsx +++ b/hosts/common/configs/user/gui/astal/config/widget/Bar.tsx @@ -1,13 +1,12 @@ -import { App, Astal, Gtk, Gdk } from 'astal/gtk3' -import Launcher from './components/Launcher'; -import Workspace from './components/Workspaces'; -import Date from './components/Date'; -import Systray from './components/Tray'; +import { App, Astal, Gtk, Gdk } from "astal/gtk3"; +import Launcher from "./components/Launcher"; +import Workspace from "./components/Workspaces"; +import Date from "./components/Date"; +import Systray from "./components/Tray"; import Hyprland from "gi://AstalHyprland"; -const anchor = Astal.WindowAnchor.TOP - | Astal.WindowAnchor.LEFT - | Astal.WindowAnchor.RIGHT; +const anchor = + Astal.WindowAnchor.TOP | Astal.WindowAnchor.LEFT | Astal.WindowAnchor.RIGHT; const hyprland = Hyprland.get_default(); @@ -20,22 +19,25 @@ function getHyprlandMonitor(gdkmonitor: Gdk.Monitor) { } } -export default (monitor: Gdk.Monitor) => - - - - - - - - - - - - - +export default (monitor: Gdk.Monitor) => ( + + + + + + + + + + + + + + +); diff --git a/hosts/common/configs/user/gui/astal/config/widget/components/Date.tsx b/hosts/common/configs/user/gui/astal/config/widget/components/Date.tsx index c93026d..909cbc0 100644 --- a/hosts/common/configs/user/gui/astal/config/widget/components/Date.tsx +++ b/hosts/common/configs/user/gui/astal/config/widget/components/Date.tsx @@ -1,13 +1,13 @@ +import { Variable } from "astal/variable"; +import { GLib } from "astal"; -import { Variable } from 'astal/variable'; -import { GLib } from 'astal'; +const time = Variable("").poll( + 1000, + () => GLib.DateTime.new_now_local().format("%H:%M - %A, %d %B %Y")!, +); -const time = Variable("").poll(1000, () => GLib.DateTime.new_now_local().format('%H:%M - %A, %d %B %Y')!) - -export default () => ; +export default () => ( + +); diff --git a/hosts/common/configs/user/gui/astal/config/widget/components/Launcher.tsx b/hosts/common/configs/user/gui/astal/config/widget/components/Launcher.tsx index f2d773d..7f4f140 100644 --- a/hosts/common/configs/user/gui/astal/config/widget/components/Launcher.tsx +++ b/hosts/common/configs/user/gui/astal/config/widget/components/Launcher.tsx @@ -1,7 +1,12 @@ -import { execAsync } from "astal/process" +import { execAsync } from "astal/process"; -export default () => ; +export default () => ( + +); diff --git a/hosts/common/configs/user/gui/astal/config/widget/components/Tray.tsx b/hosts/common/configs/user/gui/astal/config/widget/components/Tray.tsx index 242ca29..3a01c32 100644 --- a/hosts/common/configs/user/gui/astal/config/widget/components/Tray.tsx +++ b/hosts/common/configs/user/gui/astal/config/widget/components/Tray.tsx @@ -1,25 +1,28 @@ -import { App } from 'astal/gtk3' -import { bind } from 'astal' -import Tray from 'gi://AstalTray' +import { App } from "astal/gtk3"; +import { bind } from "astal"; +import Tray from "gi://AstalTray"; -const tray = Tray.get_default() +const tray = Tray.get_default(); const TrayButton = ({ item }: { item: Tray.TrayItem }) => ( ['dbusmenu', ag])} + menuModel={bind(item, "menuModel")} + actionGroup={bind(item, "actionGroup").as((ag) => ["dbusmenu", ag])} > - + -) +); -export default () => - { - bind(tray, 'items').as(items => items.map(item => { - if (item.iconThemePath) App.add_icons(item.iconThemePath); - return ; - }))} -; +export default () => ( + + {bind(tray, "items").as((items) => + items.map((item) => { + if (item.iconThemePath) App.add_icons(item.iconThemePath); + return ; + }), + )} + +); diff --git a/hosts/common/configs/user/gui/astal/config/widget/components/Workspaces.tsx b/hosts/common/configs/user/gui/astal/config/widget/components/Workspaces.tsx index 42595a1..5678d78 100644 --- a/hosts/common/configs/user/gui/astal/config/widget/components/Workspaces.tsx +++ b/hosts/common/configs/user/gui/astal/config/widget/components/Workspaces.tsx @@ -1,6 +1,6 @@ import { bind, Variable } from "astal"; import Hyprland from "gi://AstalHyprland"; -import { range } from '../../lib'; +import { range } from "../../lib"; const hyprland = Hyprland.get_default(); const BLOCK_SIZE = 10; @@ -20,14 +20,14 @@ const Workspace = ({ id }: { id: number }) => { const active = Variable.derive( [bind(hyprland, "focusedWorkspace")], - focused => focused.id == id + (focused) => focused.id == id, ); hyprland.connect("workspace-added", (_, workspace) => { if (workspace.id != id) return; maybeWorkspace.set(workspace); occupied.set(workspace.clients.length > 0); - workspace.connect("clients", clients => occupied.set(clients.length > 0)) + workspace.connect("clients", (clients) => occupied.set(clients.length > 0)); }); hyprland.connect("workspace-removed", (_, workspaceId) => { @@ -36,37 +36,43 @@ const Workspace = ({ id }: { id: number }) => { occupied.set(false); }); - const className = Variable.derive( - [active, occupied], - (active, occupied) => { - if (active) return "button active"; - if (occupied) return "button occupied"; - return "button"; - } - ); + const className = Variable.derive([active, occupied], (active, occupied) => { + if (active) return "button active"; + if (occupied) return "button occupied"; + return "button"; + }); - return - - hyprland.dispatch("workspace", `${id}`)}> - - - ; + return ( + + + hyprland.dispatch("workspace", `${id}`)}> + + + + ); }; export default ({ monitor }: { monitor: Hyprland.Monitor }) => { const workspaces = hyprland.get_workspaces(); - const displayWorkspaces = workspaces.filter(w => w.monitor.id === monitor.id); - const displayWorkspaceBlockStart = Math.floor((displayWorkspaces[0].id - 1) / BLOCK_SIZE) * 10; + const displayWorkspaces = workspaces.filter( + (w) => w.monitor.id === monitor.id, + ); + const displayWorkspaceBlockStart = + Math.floor((displayWorkspaces[0].id - 1) / BLOCK_SIZE) * 10; - return { - hyprland.dispatch("workspace", e.delta_y > 0 ? "m+1" : "m-1"); - }} - > - - {range(BLOCK_SIZE).map(i => )} - - ; + return ( + { + hyprland.dispatch("workspace", e.delta_y > 0 ? "m+1" : "m-1"); + }} + > + + {range(BLOCK_SIZE).map((i) => ( + + ))} + + + ); }; diff --git a/hosts/common/configs/user/gui/clipbook/copy.sh b/hosts/common/configs/user/gui/clipbook/copy.sh index e77268d..378a2c6 100755 --- a/hosts/common/configs/user/gui/clipbook/copy.sh +++ b/hosts/common/configs/user/gui/clipbook/copy.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + list() { echo -en "\0keep-selection\x1ftrue\n" jq -r 'keys[]' "$BOOKMARKS" diff --git a/hosts/common/configs/user/gui/clipbook/default.nix b/hosts/common/configs/user/gui/clipbook/default.nix index b896b58..9019a37 100644 --- a/hosts/common/configs/user/gui/clipbook/default.nix +++ b/hosts/common/configs/user/gui/clipbook/default.nix @@ -21,8 +21,6 @@ in let clipbook-rofi = lib.meta.getExe hmConfig.programs.clipbook.finalPackage; in - [ - "$mod, c, exec, ${clipbook-rofi}" - ]; + [ "$mod, c, exec, ${clipbook-rofi}" ]; }; } diff --git a/hosts/common/configs/user/gui/cliphist/scripts/copy.sh b/hosts/common/configs/user/gui/cliphist/scripts/copy.sh index b7a2167..110816e 100755 --- a/hosts/common/configs/user/gui/cliphist/scripts/copy.sh +++ b/hosts/common/configs/user/gui/cliphist/scripts/copy.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + list() { echo -en "\0keep-selection\x1ftrue\n" cliphist list diff --git a/hosts/common/configs/user/gui/cliphist/scripts/delete.sh b/hosts/common/configs/user/gui/cliphist/scripts/delete.sh index f3e347f..a01c20e 100755 --- a/hosts/common/configs/user/gui/cliphist/scripts/delete.sh +++ b/hosts/common/configs/user/gui/cliphist/scripts/delete.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + list() { echo -en "\0keep-selection\x1ftrue\n" cliphist list diff --git a/hosts/common/configs/user/gui/darktable/publish/src/index.ts b/hosts/common/configs/user/gui/darktable/publish/src/index.ts index 661df8a..f98cd98 100644 --- a/hosts/common/configs/user/gui/darktable/publish/src/index.ts +++ b/hosts/common/configs/user/gui/darktable/publish/src/index.ts @@ -1,9 +1,6 @@ import { Command } from "commander"; import { createFileNode, createImageNode, createHeadingNode } from "./lexical"; -import { - extractShootingConditions, - createImageCaption, -} from "./exif"; +import { extractShootingConditions, createImageCaption } from "./exif"; import { uploadFile, uploadImage, uploadPost } from "./api"; import { getBasenameWithExtension, prepareFiles } from "./files"; diff --git a/hosts/common/configs/user/gui/gaming/scripts/steam-ln.sh b/hosts/common/configs/user/gui/gaming/scripts/steam-ln.sh index bdffc77..73e1c1a 100644 --- a/hosts/common/configs/user/gui/gaming/scripts/steam-ln.sh +++ b/hosts/common/configs/user/gui/gaming/scripts/steam-ln.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + STEAM="$HOME/.local/share/Steam/steamapps/common" GAMES="$HOME/Games" diff --git a/hosts/common/configs/user/gui/hyprland/scripts/bind.sh b/hosts/common/configs/user/gui/hyprland/scripts/bind.sh index 4c70de3..ed5b722 100644 --- a/hosts/common/configs/user/gui/hyprland/scripts/bind.sh +++ b/hosts/common/configs/user/gui/hyprland/scripts/bind.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + SELECTED_WORKSPACE_BASE="$1" ACTION="$2" diff --git a/hosts/common/configs/user/gui/hyprland/scripts/monitors.sh b/hosts/common/configs/user/gui/hyprland/scripts/monitors.sh index 5e0b427..c861ed0 100644 --- a/hosts/common/configs/user/gui/hyprland/scripts/monitors.sh +++ b/hosts/common/configs/user/gui/hyprland/scripts/monitors.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + handle() { # shellcheck disable=SC2086 case $1 in diff --git a/hosts/common/configs/user/gui/obsidian/config/snippets/file-explorer-separators.css b/hosts/common/configs/user/gui/obsidian/config/snippets/file-explorer-separators.css index 59f49e1..6a6727a 100644 --- a/hosts/common/configs/user/gui/obsidian/config/snippets/file-explorer-separators.css +++ b/hosts/common/configs/user/gui/obsidian/config/snippets/file-explorer-separators.css @@ -1,18 +1,24 @@ :root { - --replete-custom-separators-vertical-padding: 4px; - --replete-custom-separators-left-margin: -12px; + --replete-custom-separators-vertical-padding: 4px; + --replete-custom-separators-left-margin: -12px; } -.nav-files-container [class*=nav-]:has(:is( - [data-path="Inbox"], - [data-path="Dreams"], - [data-path="Work"], - [data-path="Random"], -))::after { - content:''; - display:block; - height:1px; - width:calc(100% + 32px); - background:linear-gradient(to right, var(--tab-outline-color), transparent); - margin:var(--replete-custom-separators-vertical-padding) 0 var(--replete-custom-separators-vertical-padding) var(--replete-custom-separators-left-margin); +.nav-files-container + [class*="nav-"]:has( + :is( + [data-path="Inbox"], + [data-path="Dreams"], + [data-path="Work"], + [data-path="Random"], + + ) + )::after { + content: ""; + display: block; + height: 1px; + width: calc(100% + 32px); + background: linear-gradient(to right, var(--tab-outline-color), transparent); + margin: var(--replete-custom-separators-vertical-padding) 0 + var(--replete-custom-separators-vertical-padding) + var(--replete-custom-separators-left-margin); } diff --git a/hosts/common/configs/user/gui/obsidian/default.nix b/hosts/common/configs/user/gui/obsidian/default.nix index 1c8f290..4929b56 100644 --- a/hosts/common/configs/user/gui/obsidian/default.nix +++ b/hosts/common/configs/user/gui/obsidian/default.nix @@ -707,9 +707,7 @@ in _: vault: lib.attrsets.nameValuePair "${home}/${vault.target}/.obsidian/plugins/obsidian-style-settings/data.json" - { - source = ./theme.json; - } + { source = ./theme.json; } ) hmConfig.programs.obsidian.vaults; sops.secrets."google/geocoding".sopsFile = ../../../../../../secrets/personal/secrets.yaml; diff --git a/hosts/common/configs/user/gui/spicetify/default.nix b/hosts/common/configs/user/gui/spicetify/default.nix index 56c1bb8..390404d 100644 --- a/hosts/common/configs/user/gui/spicetify/default.nix +++ b/hosts/common/configs/user/gui/spicetify/default.nix @@ -35,7 +35,7 @@ in theme = spicePkgs.themes.sleek // { extraCommands = '' - export COLORS_CSS_PATH="${home}/.config/spotify/colors.css" + export COLORS_CSS_PATH="${home}/.config/spotify/theme.css" ''; additionalCss = '' @@ -77,7 +77,7 @@ in }; }; - theme.template."${home}/.config/spotify/colors.css".source = ./colors.css; + theme.template."${home}/.config/spotify/theme.css".source = ./theme.css; wayland.windowManager.hyprland.settings.bind = [ "$mod, s, exec, ${lib.meta.getExe hmConfig.programs.spicetify.spicedSpotify}" diff --git a/hosts/common/configs/user/gui/spicetify/colors.css b/hosts/common/configs/user/gui/spicetify/theme.css similarity index 100% rename from hosts/common/configs/user/gui/spicetify/colors.css rename to hosts/common/configs/user/gui/spicetify/theme.css diff --git a/hosts/common/configs/user/gui/theme/theme.sh b/hosts/common/configs/user/gui/theme/theme.sh index 7895a37..83a532f 100644 --- a/hosts/common/configs/user/gui/theme/theme.sh +++ b/hosts/common/configs/user/gui/theme/theme.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + wallpaper="" mode="" diff --git a/hosts/common/configs/user/gui/vscode/langs/docker/default.nix b/hosts/common/configs/user/gui/vscode/langs/docker/default.nix index 14aaef4..4ab3fff 100644 --- a/hosts/common/configs/user/gui/vscode/langs/docker/default.nix +++ b/hosts/common/configs/user/gui/vscode/langs/docker/default.nix @@ -5,7 +5,5 @@ ... }: lib.mkIf config.programs.vscode.languages.docker.enable { - programs.vscode.extensions = with pkgs.vscode-extensions; [ - ms-azuretools.vscode-docker - ]; + programs.vscode.extensions = with pkgs.vscode-extensions; [ ms-azuretools.vscode-docker ]; } diff --git a/hosts/common/configs/user/gui/vscode/langs/go/default.nix b/hosts/common/configs/user/gui/vscode/langs/go/default.nix index da61eac..d95cdee 100644 --- a/hosts/common/configs/user/gui/vscode/langs/go/default.nix +++ b/hosts/common/configs/user/gui/vscode/langs/go/default.nix @@ -5,7 +5,5 @@ ... }: lib.mkIf config.programs.vscode.languages.go.enable { - programs.vscode.extensions = with pkgs.vscode-extensions; [ - golang.go - ]; + programs.vscode.extensions = with pkgs.vscode-extensions; [ golang.go ]; } diff --git a/hosts/common/configs/user/gui/vscode/langs/jinja/default.nix b/hosts/common/configs/user/gui/vscode/langs/jinja/default.nix index 9e28d46..d166f24 100644 --- a/hosts/common/configs/user/gui/vscode/langs/jinja/default.nix +++ b/hosts/common/configs/user/gui/vscode/langs/jinja/default.nix @@ -5,7 +5,5 @@ ... }: lib.mkIf config.programs.vscode.languages.jinja.enable { - programs.vscode.extensions = with pkgs.vscode-extensions; [ - wholroyd.jinja - ]; + programs.vscode.extensions = with pkgs.vscode-extensions; [ wholroyd.jinja ]; } diff --git a/hosts/common/configs/user/gui/vscode/langs/lua/default.nix b/hosts/common/configs/user/gui/vscode/langs/lua/default.nix index 75abd9f..3c9825d 100644 --- a/hosts/common/configs/user/gui/vscode/langs/lua/default.nix +++ b/hosts/common/configs/user/gui/vscode/langs/lua/default.nix @@ -5,7 +5,5 @@ ... }: lib.mkIf config.programs.vscode.languages.lua.enable { - programs.vscode.extensions = with pkgs.vscode-extensions; [ - sumneko.lua - ]; + programs.vscode.extensions = with pkgs.vscode-extensions; [ sumneko.lua ]; } diff --git a/hosts/common/configs/user/gui/vscode/langs/markdown/default.nix b/hosts/common/configs/user/gui/vscode/langs/markdown/default.nix index 0bac97a..d14fe98 100644 --- a/hosts/common/configs/user/gui/vscode/langs/markdown/default.nix +++ b/hosts/common/configs/user/gui/vscode/langs/markdown/default.nix @@ -5,7 +5,5 @@ ... }: lib.mkIf config.programs.vscode.languages.markdown.enable { - programs.vscode.extensions = with pkgs.vscode-extensions; [ - yzhang.markdown-all-in-one - ]; + programs.vscode.extensions = with pkgs.vscode-extensions; [ yzhang.markdown-all-in-one ]; } diff --git a/hosts/common/configs/user/gui/vscode/langs/rest/default.nix b/hosts/common/configs/user/gui/vscode/langs/rest/default.nix index a2276a2..b8fd236 100644 --- a/hosts/common/configs/user/gui/vscode/langs/rest/default.nix +++ b/hosts/common/configs/user/gui/vscode/langs/rest/default.nix @@ -6,9 +6,7 @@ }: lib.mkIf config.programs.vscode.languages.rest.enable { programs.vscode = { - extensions = with pkgs.vscode-extensions; [ - humao.rest-client - ]; + extensions = with pkgs.vscode-extensions; [ humao.rest-client ]; userSettings = { "rest-client.enableTelemetry" = false; diff --git a/hosts/common/configs/user/gui/vscode/langs/sas/default.nix b/hosts/common/configs/user/gui/vscode/langs/sas/default.nix index f27e9ff..403e102 100644 --- a/hosts/common/configs/user/gui/vscode/langs/sas/default.nix +++ b/hosts/common/configs/user/gui/vscode/langs/sas/default.nix @@ -6,9 +6,7 @@ }: lib.mkIf config.programs.vscode.languages.sas.enable { programs.vscode = { - extensions = with pkgs.vscode-extensions; [ - sas.sas-lsp - ]; + extensions = with pkgs.vscode-extensions; [ sas.sas-lsp ]; userSettings = { "SAS.connectionProfiles" = { diff --git a/hosts/common/configs/user/gui/vscode/langs/sops/default.nix b/hosts/common/configs/user/gui/vscode/langs/sops/default.nix index 08a13e8..3389c8a 100644 --- a/hosts/common/configs/user/gui/vscode/langs/sops/default.nix +++ b/hosts/common/configs/user/gui/vscode/langs/sops/default.nix @@ -5,7 +5,5 @@ ... }: lib.mkIf config.programs.vscode.languages.sops.enable { - programs.vscode.extensions = with pkgs.vscode-extensions; [ - signageos.signageos-vscode-sops - ]; + programs.vscode.extensions = with pkgs.vscode-extensions; [ signageos.signageos-vscode-sops ]; } diff --git a/hosts/common/configs/user/gui/vscode/langs/svelte/default.nix b/hosts/common/configs/user/gui/vscode/langs/svelte/default.nix index 5d6127b..dd1b063 100644 --- a/hosts/common/configs/user/gui/vscode/langs/svelte/default.nix +++ b/hosts/common/configs/user/gui/vscode/langs/svelte/default.nix @@ -10,11 +10,6 @@ lib.mkIf config.programs.vscode.languages.svelte.enable { "svelte.enable-ts-plugin" = true; }; - extensions = - with pkgs; - with vscode-extensions; - [ - svelte.svelte-vscode - ]; + extensions = with pkgs; with vscode-extensions; [ svelte.svelte-vscode ]; }; } diff --git a/hosts/common/configs/user/gui/vscode/langs/yaml/default.nix b/hosts/common/configs/user/gui/vscode/langs/yaml/default.nix index 15b0c95..10eb439 100644 --- a/hosts/common/configs/user/gui/vscode/langs/yaml/default.nix +++ b/hosts/common/configs/user/gui/vscode/langs/yaml/default.nix @@ -5,7 +5,5 @@ ... }: lib.mkIf config.programs.vscode.languages.yaml.enable { - programs.vscode.extensions = with pkgs.vscode-extensions; [ - redhat.vscode-yaml - ]; + programs.vscode.extensions = with pkgs.vscode-extensions; [ redhat.vscode-yaml ]; } diff --git a/hosts/common/shells/bun/default.nix b/hosts/common/shells/bun/default.nix index 7baf42c..37f5955 100644 --- a/hosts/common/shells/bun/default.nix +++ b/hosts/common/shells/bun/default.nix @@ -1,6 +1 @@ -{ pkgs, ... }: -pkgs.mkShell { - packages = with pkgs; [ - bun - ]; -} +{ pkgs, ... }: pkgs.mkShell { packages = with pkgs; [ bun ]; } diff --git a/hosts/common/shells/nodejs/default.nix b/hosts/common/shells/nodejs/default.nix index b76036c..f1bdf48 100644 --- a/hosts/common/shells/nodejs/default.nix +++ b/hosts/common/shells/nodejs/default.nix @@ -1,6 +1 @@ -{ pkgs, ... }: -pkgs.mkShell { - packages = with pkgs; [ - nodejs - ]; -} +{ pkgs, ... }: pkgs.mkShell { packages = with pkgs; [ nodejs ]; } diff --git a/hosts/common/shells/python/default.nix b/hosts/common/shells/python/default.nix index 0d06379..d257ca2 100644 --- a/hosts/common/shells/python/default.nix +++ b/hosts/common/shells/python/default.nix @@ -1,8 +1,6 @@ { pkgs, ... }: pkgs.mkShell { - packages = with pkgs; [ - (python3.withPackages (python-pkgs: with python-pkgs; [ pip ])) - ]; + packages = with pkgs; [ (python3.withPackages (python-pkgs: with python-pkgs; [ pip ])) ]; shellHook = '' if git rev-parse --is-inside-work-tree &> /dev/null; then diff --git a/hosts/eirene/README.md b/hosts/eirene/README.md index 38a8631..528fff5 100644 --- a/hosts/eirene/README.md +++ b/hosts/eirene/README.md @@ -11,12 +11,15 @@ ### Third-party Services - [ ] Firefox + - [ ] Authenticate - [ ] Spotify + - [ ] Authenticate - [ ] Local Files - [ ] Steam + - [ ] Authenticate - [ ] `protonup` diff --git a/hosts/eirene/hardware/card.sh b/hosts/eirene/hardware/card.sh index e788521..03b5483 100644 --- a/hosts/eirene/hardware/card.sh +++ b/hosts/eirene/hardware/card.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + AMD=/dev/dri/by-path/pci-0000:06:00.0-card NVIDIA=/dev/dri/by-path/pci-0000:01:00.0-card diff --git a/hosts/eirene/hardware/default.nix b/hosts/eirene/hardware/default.nix index 078a7bd..025f72b 100644 --- a/hosts/eirene/hardware/default.nix +++ b/hosts/eirene/hardware/default.nix @@ -5,9 +5,7 @@ ... }: { - imports = [ - ./display.nix - ]; + imports = [ ./display.nix ]; # https://github.com/NixOS/nixos-hardware/tree/master/lenovo/legion/16achg6 hardware = { diff --git a/hosts/eirene/hardware/display.nix b/hosts/eirene/hardware/display.nix index 72e705b..9173057 100644 --- a/hosts/eirene/hardware/display.nix +++ b/hosts/eirene/hardware/display.nix @@ -2,9 +2,7 @@ { boot.kernelParams = [ "video=eDP-1:2560x1600@165" ]; - programs.steam.package = pkgs.steam.override { - extraEnv.STEAM_FORCE_DESKTOPUI_SCALING = 1.25; - }; + programs.steam.package = pkgs.steam.override { extraEnv.STEAM_FORCE_DESKTOPUI_SCALING = 1.25; }; home-manager.sharedModules = [ { diff --git a/hosts/eirene/users/nick/configs/gui/vscode/default.nix b/hosts/eirene/users/nick/configs/gui/vscode/default.nix index 912a73f..5ccbc9c 100644 --- a/hosts/eirene/users/nick/configs/gui/vscode/default.nix +++ b/hosts/eirene/users/nick/configs/gui/vscode/default.nix @@ -13,6 +13,7 @@ nix.enable = true; python.enable = true; rest.enable = true; + sops.enable = true; typescript.enable = true; yaml.enable = true; }; diff --git a/hosts/elara/README.md b/hosts/elara/README.md index 1ca0df7..b1ad749 100644 --- a/hosts/elara/README.md +++ b/hosts/elara/README.md @@ -20,8 +20,10 @@ You must build the system once with these imports commented out. Then, connect t ### Third-party Services - [ ] Firefox + - [ ] Authenticate - [ ] Spotify + - [ ] Authenticate - [ ] Local Files diff --git a/hosts/elara/hardware/sas/default.nix b/hosts/elara/hardware/sas/default.nix index 3c75e5d..8cb4323 100644 --- a/hosts/elara/hardware/sas/default.nix +++ b/hosts/elara/hardware/sas/default.nix @@ -1,8 +1,6 @@ { ... }: { - imports = [ - ./display.nix - ]; + imports = [ ./display.nix ]; hardware = { enableAllFirmware = true; diff --git a/hosts/elara/users/nikara/configs/console/kubernetes/default.nix b/hosts/elara/users/nikara/configs/console/kubernetes/default.nix index 52cec5b..1f1342b 100644 --- a/hosts/elara/users/nikara/configs/console/kubernetes/default.nix +++ b/hosts/elara/users/nikara/configs/console/kubernetes/default.nix @@ -7,9 +7,7 @@ nixpkgs.overlays = [ (final: prev: { telepresence = prev.telepresence.overrideAttrs (oldAttrs: { - patches = oldAttrs.patches or [ ] ++ [ - ./extend-timeout.patch - ]; + patches = oldAttrs.patches or [ ] ++ [ ./extend-timeout.patch ]; }); }) ]; diff --git a/hosts/elara/users/nikara/configs/gui/vscode/default.nix b/hosts/elara/users/nikara/configs/gui/vscode/default.nix index e15c94d..33a9aa5 100644 --- a/hosts/elara/users/nikara/configs/gui/vscode/default.nix +++ b/hosts/elara/users/nikara/configs/gui/vscode/default.nix @@ -18,6 +18,7 @@ python.enable = true; rest.enable = true; sas.enable = true; + sops.enable = true; typescript.enable = true; yaml.enable = true; }; diff --git a/hosts/installer/README.md b/hosts/installer/README.md index 1add57d..9127e16 100644 --- a/hosts/installer/README.md +++ b/hosts/installer/README.md @@ -8,21 +8,23 @@ I have automated myself out of a job. How to use: 3. Connect to the internet with `nmcli` - - Scan for available networks: +- Scan for available networks: - ```bash - nmcli device wifi list - ``` - - For an open network: + ```bash + nmcli device wifi list + ``` - ```bash - nmcli device wifi connect "" - ``` - - For a secured network: +- For an open network: - ```bash - nmcli device wifi connect "" password "" - ``` + ```bash + nmcli device wifi connect "" + ``` + +- For a secured network: + + ```bash + nmcli device wifi connect "" password "" + ``` 4. Run `sudo nix-install /etc/nixos -m install|repair -h host [-k key] [-c] [-r]"` @@ -30,48 +32,49 @@ I have automated myself out of a job. How to use: 1. Download a Minimal Live Nix ISO - - Visit the official NixOS website: [https://nixos.org/download.html](https://nixos.org/download.html). - - Download the "Minimal ISO image". +- Visit the official NixOS website: [https://nixos.org/download.html](https://nixos.org/download.html). +- Download the "Minimal ISO image". 2. Burn the ISO - - On Windows, use [Rufus](https://rufus.ie) to burn the ISO to a USB drive. +- On Windows, use [Rufus](https://rufus.ie) to burn the ISO to a USB drive. - - On Linux, use the `dd` command: +- On Linux, use the `dd` command: - ```bash - sudo dd if= of=/dev/sdX bs=4M status=progress - ``` + ```bash + sudo dd if= of=/dev/sdX bs=4M status=progress + ``` 3. Boot into USB 4. Connect to the Internet with `wpa_supplicant` - - Identify your network interface: +- Identify your network interface: - ```bash - ip link show | grep -E '^[0-9]+:' | awk '{print $2}' | tr -d ':' - ``` - - For an open network: + ```bash + ip link show | grep -E '^[0-9]+:' | awk '{print $2}' | tr -d ':' + ``` - ```bash - wpa_supplicant -i "${interface}" -c <(wpa_passphrase "${ssid}") -B - ``` +- For an open network: - - For a secured network: + ```bash + wpa_supplicant -i "${interface}" -c <(wpa_passphrase "${ssid}") -B + ``` - ```bash - config=$(mktemp) - wpa_passphrase "${ssid}" "${passphrase}" > "${config}" - wpa_supplicant -i "${interface}" -c "${config}" -B - rm "${config}" - ``` +- For a secured network: - - Obtain an IP address: + ```bash + config=$(mktemp) + wpa_passphrase "${ssid}" "${passphrase}" > "${config}" + wpa_supplicant -i "${interface}" -c "${config}" -B + rm "${config}" + ``` - ```bash - dhcpcd - ``` +- Obtain an IP address: + + ```bash + dhcpcd + ``` 5. Clone the flake repository diff --git a/lib/runtime/merge/key-value.sh b/lib/runtime/merge/key-value.sh index 1d65b31..d238bdd 100644 --- a/lib/runtime/merge/key-value.sh +++ b/lib/runtime/merge/key-value.sh @@ -1,3 +1,5 @@ +# shellcheck shell=bash + source=$(realpath -m "$1") target=$(realpath -m "$2") diff --git a/lib/scripts/add-host.sh b/lib/scripts/add-host.sh index e144340..d306104 100755 --- a/lib/scripts/add-host.sh +++ b/lib/scripts/add-host.sh @@ -1,4 +1,5 @@ #!/usr/bin/env -S nix shell nixpkgs#ssh-to-age -c bash +# shellcheck shell=bash set -o errexit set -o nounset @@ -15,11 +16,11 @@ mkdir -p "./hosts/$host/secrets" ssh-keygen -t ed25519 -f "./hosts/$host/secrets/ssh_host_ed25519_key" -N "" -age_key=$(cat './hosts/$host/secrets/ssh_host_ed25519_key.pub' | ssh-to-age) +age_key=$(ssh-to-age < "./hosts/$host/secrets/ssh_host_ed25519_key.pub") find . -type f -name "sops.yaml" | while IFS= read -r sops_file; do - sed -i "/- hosts:/a\ - &$host $age_key" "$sops_file" - sed -i "/- age:/a\ - *$host" "$sops_file" + sed -i "/- hosts:/a\ - &$host $age_key" "$sops_file" + sed -i "/- age:/a\ - *$host" "$sops_file" done sed -i "/knownHosts = {/a\ $host.publicKeyFile = ../../../../$host/secrets/ssh_host_ed25519_key.pub;" ./hosts/common/configs/system/ssh/default.nix @@ -29,4 +30,4 @@ sed -i "/userKnownHostsFile = lib.strings.concatStringsSep \" \" \[/a\ .. echo "Host $host has been successfully added." echo "You can generate SSH key pairs for any users that need to connect to user@host using the following command:" -echo "ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_$host_" +echo "ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_${host}_" diff --git a/lib/scripts/remove-host.sh b/lib/scripts/remove-host.sh index 0067d5c..75098e0 100755 --- a/lib/scripts/remove-host.sh +++ b/lib/scripts/remove-host.sh @@ -1,4 +1,5 @@ #!/usr/bin/env -S nix shell nixpkgs#ssh-to-age -c bash +# shellcheck shell=bash set -o errexit set -o nounset @@ -11,11 +12,11 @@ fi host="$1" -age_key=$(cat './hosts/$host/secrets/ssh_host_ed25519_key.pub' | ssh-to-age) +age_key=$(ssh-to-age < "./hosts/$host/secrets/ssh_host_ed25519_key.pub") find . -type f -name "sops.yaml" | while IFS= read -r sops_file; do - sed -i "/ - &$host $age_key/d" "$sops_file" - sed -i "/ - \*$host/d" "$sops_file" + sed -i "/ - &$host $age_key/d" "$sops_file" + sed -i "/ - \*$host/d" "$sops_file" done sed -i "/$host/d" ./hosts/common/configs/system/ssh/default.nix diff --git a/lib/scripts/update-keys.sh b/lib/scripts/update-keys.sh index bf6c52f..6fa449b 100755 --- a/lib/scripts/update-keys.sh +++ b/lib/scripts/update-keys.sh @@ -1,4 +1,5 @@ #!/usr/bin/env -S nix shell nixpkgs#sops -c bash +# shellcheck shell=bash set -o errexit set -o nounset diff --git a/treefmt.nix b/treefmt.nix new file mode 100644 index 0000000..56aa7cb --- /dev/null +++ b/treefmt.nix @@ -0,0 +1,52 @@ +{ ... }: +{ + projectRootFile = "flake.nix"; + + programs = { + nixfmt = { + enable = true; + strict = true; + }; + + shellcheck.enable = true; + prettier.enable = true; + gofmt.enable = true; + }; + + settings = { + global = { + excludes = [ + # Third-party + "submodules/*" + # Binary Files + "*.jpg" + "*.png" + "*.svg" + # Machine-generated + "*/secrets.yaml" + "*/secrets/*.pub" + # Theme Templates + "*/theme.css" + "*/theme.conf" + "*/theme.theme" + "*/theme.sass" + "*/*.kvconfig" + # Git + "*/.gitignore" + ".gitattributes" + ".envrc" + # One-offs + "hosts/*/users/*/uid" + "*/.stignore" + "*/spicetify/config/prefs*" + "*.zsh" + # Manifest Files + "*/package.json" + "*/go.mod" + "*/bun.lockb" + # Broken formatters + "*.lua" + ]; + }; + }; +}