diff --git a/.argocd-ignore b/.argocd-ignore deleted file mode 100644 index e90b739..0000000 --- a/.argocd-ignore +++ /dev/null @@ -1 +0,0 @@ -.pre-commit-config.yaml diff --git a/.devenv.flake.nix b/.devenv.flake.nix deleted file mode 100644 index cb97411..0000000 --- a/.devenv.flake.nix +++ /dev/null @@ -1,163 +0,0 @@ -{ - inputs = - let - version = "1.6.1"; -system = "x86_64-linux"; -devenv_root = "/home/gwg313/repos/homelab-gitops"; -devenv_dotfile = ./.devenv; -devenv_dotfile_string = ".devenv"; -container_name = null; -devenv_tmpdir = "/run/user/1000"; -devenv_runtime = "/run/user/1000/devenv-f22e6d0"; -devenv_istesting = false; -devenv_direnvrc_latest_version = 1; - - in { - git-hooks.url = "github:cachix/git-hooks.nix"; - git-hooks.inputs.nixpkgs.follows = "nixpkgs"; - pre-commit-hooks.follows = "git-hooks"; - nixpkgs.url = "github:cachix/devenv-nixpkgs/rolling"; - devenv.url = "github:cachix/devenv?dir=src/modules"; - } // (if builtins.pathExists (devenv_dotfile + "/flake.json") - then builtins.fromJSON (builtins.readFile (devenv_dotfile + "/flake.json")) - else { }); - - outputs = { nixpkgs, ... }@inputs: - let - version = "1.6.1"; -system = "x86_64-linux"; -devenv_root = "/home/gwg313/repos/homelab-gitops"; -devenv_dotfile = ./.devenv; -devenv_dotfile_string = ".devenv"; -container_name = null; -devenv_tmpdir = "/run/user/1000"; -devenv_runtime = "/run/user/1000/devenv-f22e6d0"; -devenv_istesting = false; -devenv_direnvrc_latest_version = 1; - - devenv = - if builtins.pathExists (devenv_dotfile + "/devenv.json") - then builtins.fromJSON (builtins.readFile (devenv_dotfile + "/devenv.json")) - else { }; - getOverlays = inputName: inputAttrs: - map - (overlay: - let - input = inputs.${inputName} or (throw "No such input `${inputName}` while trying to configure overlays."); - in - input.overlays.${overlay} or (throw "Input `${inputName}` has no overlay called `${overlay}`. Supported overlays: ${nixpkgs.lib.concatStringsSep ", " (builtins.attrNames input.overlays)}")) - inputAttrs.overlays or [ ]; - overlays = nixpkgs.lib.flatten (nixpkgs.lib.mapAttrsToList getOverlays (devenv.inputs or { })); - pkgs = import nixpkgs { - inherit system; - config = { - allowUnfree = devenv.allowUnfree or false; - allowBroken = devenv.allowBroken or false; - permittedInsecurePackages = devenv.permittedInsecurePackages or [ ]; - }; - inherit overlays; - }; - lib = pkgs.lib; - importModule = path: - if lib.hasPrefix "./" path - then if lib.hasSuffix ".nix" path - then ./. + (builtins.substring 1 255 path) - else ./. + (builtins.substring 1 255 path) + "/devenv.nix" - else if lib.hasPrefix "../" path - then throw "devenv: ../ is not supported for imports" - else - let - paths = lib.splitString "/" path; - name = builtins.head paths; - input = inputs.${name} or (throw "Unknown input ${name}"); - subpath = "/${lib.concatStringsSep "/" (builtins.tail paths)}"; - devenvpath = "${input}" + subpath; - devenvdefaultpath = devenvpath + "/devenv.nix"; - in - if lib.hasSuffix ".nix" devenvpath - then devenvpath - else if builtins.pathExists devenvdefaultpath - then devenvdefaultpath - else throw (devenvdefaultpath + " file does not exist for input ${name}."); - project = pkgs.lib.evalModules { - specialArgs = inputs // { inherit inputs; }; - modules = [ - ({ config, ... }: { - _module.args.pkgs = pkgs.appendOverlays (config.overlays or [ ]); - }) - (inputs.devenv.modules + /top-level.nix) - { - devenv.cliVersion = version; - devenv.root = devenv_root; - devenv.dotfile = devenv_root + "/" + devenv_dotfile_string; - } - (pkgs.lib.optionalAttrs (inputs.devenv.isTmpDir or false) { - devenv.tmpdir = devenv_tmpdir; - devenv.runtime = devenv_runtime; - }) - (pkgs.lib.optionalAttrs (inputs.devenv.hasIsTesting or false) { - devenv.isTesting = devenv_istesting; - }) - (pkgs.lib.optionalAttrs (container_name != null) { - container.isBuilding = pkgs.lib.mkForce true; - containers.${container_name}.isBuilding = true; - }) - ({ options, ... }: { - config.devenv = pkgs.lib.optionalAttrs (builtins.hasAttr "direnvrcLatestVersion" options.devenv) { - direnvrcLatestVersion = devenv_direnvrc_latest_version; - }; - }) - ] ++ (map importModule (devenv.imports or [ ])) ++ [ - (if builtins.pathExists ./devenv.nix then ./devenv.nix else { }) - (devenv.devenv or { }) - (if builtins.pathExists ./devenv.local.nix then ./devenv.local.nix else { }) - (if builtins.pathExists (devenv_dotfile + "/cli-options.nix") then import (devenv_dotfile + "/cli-options.nix") else { }) - ]; - }; - config = project.config; - - options = pkgs.nixosOptionsDoc { - options = builtins.removeAttrs project.options [ "_module" ]; - warningsAreErrors = false; - # Unpack Nix types, e.g. literalExpression, mDoc. - transformOptions = - let isDocType = v: builtins.elem v [ "literalDocBook" "literalExpression" "literalMD" "mdDoc" ]; - in lib.attrsets.mapAttrs (_: v: - if v ? _type && isDocType v._type then - v.text - else if v ? _type && v._type == "derivation" then - v.name - else - v - ); - }; - - build = options: config: - lib.concatMapAttrs - (name: option: - if builtins.hasAttr "type" option then - if option.type.name == "output" || option.type.name == "outputOf" then { - ${name} = config.${name}; - } else { } - else - let v = build option config.${name}; - in if v != { } then { - ${name} = v; - } else { } - ) - options; - - systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; - in - { - devShell = lib.genAttrs systems (system: config.shell); - packages = lib.genAttrs systems (system: { - optionsJSON = options.optionsJSON; - # deprecated - inherit (config) info procfileScript procfileEnv procfile; - ci = config.ciDerivation; - }); - devenv = config; - build = build project.options project.config; - }; - } diff --git a/.envrc b/.envrc index 894571b..3550a30 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1 @@ -source_url "https://raw.githubusercontent.com/cachix/devenv/82c0147677e510b247d8b9165c54f73d32dfd899/direnvrc" "sha256-7u4iDd1nZpxL4tCzmPG0dQgC5V+/44Ba+tHkPob1v2k=" - -use devenv +use flake diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 0000000..90bf8fe --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,11 @@ +on: [push, pull_request] +name: Basic Code Checks +jobs: + formatting-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4.1.1 + - uses: cachix/install-nix-action@v23 + with: + nix_path: nixpkgs=channel:nixos-unstable + - run: nix develop --command alejandra --check . diff --git a/.gitignore b/.gitignore index 26d999e..21e1222 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ -.devenv +.direnv + +.pre-commit-config.yaml + diff --git a/.gitleaks.toml b/.gitleaks.toml deleted file mode 100644 index d077ace..0000000 --- a/.gitleaks.toml +++ /dev/null @@ -1,5 +0,0 @@ -[allowlist] -description = "Ignore Kubernetes SealedSecrets" -regexes = [ - '''(?s)kind:\s*SealedSecret.*?encryptedData:.*?''' -] diff --git a/.profile b/.profile new file mode 100644 index 0000000..017c331 --- /dev/null +++ b/.profile @@ -0,0 +1 @@ +export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share diff --git a/.sops.yaml b/.sops.yaml new file mode 100644 index 0000000..971379a --- /dev/null +++ b/.sops.yaml @@ -0,0 +1,7 @@ +keys: + - &primary age1k3hs0gyzrmsdyqh9lpret46q3xaayxxntruzc4euy6h3slqn4u6q36h7rg +creation_rules: + - path_regex: secrets/secrets.yaml$ + key_groups: + - age: + - *primary diff --git a/.yamllint b/.yamllint deleted file mode 100644 index a9bdbc2..0000000 --- a/.yamllint +++ /dev/null @@ -1,10 +0,0 @@ -extends: default - -rules: - document-start: disable - line-length: - max: 80 - allow-non-breakable-words: false - -ignore: | - **/*sealed*.yaml diff --git a/README.md b/README.md new file mode 100644 index 0000000..54d05bc --- /dev/null +++ b/README.md @@ -0,0 +1,54 @@ +# NixOS Flake Configuration + +## Overview + +This repository contains my NixOS configuration as a flake. This configuration +is designed to provide a reproducible and declarative setup for my system. It +includes system configuration, package management, and various other NixOS +features. + +### Window Manager + +- hyrpland +- waybar +- swaylock +- wofi +- light +- grimshot +- mako + +### Terminal + +- alacritty +- zsh +- starship +- tmux +- neovim(my configuration can be found + [here](https://github.com/gwg313/nvim-nix)) +- eza +- ripgrep +- fd + +## Prerequisites + +Before using this NixOS flake configuration, you should have the following +prerequisites: + +- NixOs should be installed on your system. +- Familiarity with Nix and NixOS concepts is helpful but not required. + +## Usage + +NixOS and home-manager are called seperately, + +To rebuild and switch to the new NixOS configuration: + +```bash +nixos-rebuild switch --flake .#candlekeep +``` + +To rebuild and switch to the new home-manager configuration: + +```bash +home-manager switch --flake .#gwg313@candlekeep +``` diff --git a/apps/audiobookshelf.yaml b/apps/audiobookshelf.yaml deleted file mode 100644 index a309f47..0000000 --- a/apps/audiobookshelf.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: audiobookshelf - namespace: argocd -spec: - project: default - source: - repoURL: https://github.com/gwg313/homelab-gitops - targetRevision: main - path: audiobookshelf - destination: - server: https://kubernetes.default.svc - namespace: audiobookshelf - syncPolicy: - automated: - selfHeal: true - prune: true - syncOptions: - - CreateNamespace=true diff --git a/apps/bytestash.yaml b/apps/bytestash.yaml deleted file mode 100644 index 945c677..0000000 --- a/apps/bytestash.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: bytestash - namespace: argocd -spec: - project: default - source: - repoURL: https://github.com/gwg313/homelab-gitops - targetRevision: main - path: bytestash - destination: - server: https://kubernetes.default.svc - namespace: bytestash - syncPolicy: - automated: - selfHeal: true - prune: true - syncOptions: - - CreateNamespace=true diff --git a/apps/cert-issuer.yaml b/apps/cert-issuer.yaml deleted file mode 100644 index e3c961f..0000000 --- a/apps/cert-issuer.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: cert-issuer - namespace: argocd -spec: - project: default - source: - repoURL: https://github.com/gwg313/homelab-gitops - targetRevision: main - path: cluster-issuer - destination: - server: https://kubernetes.default.svc - namespace: cert-manager - syncPolicy: - automated: - selfHeal: true - prune: true diff --git a/apps/cert-manager.yaml b/apps/cert-manager.yaml deleted file mode 100644 index 223a61b..0000000 --- a/apps/cert-manager.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: cert-manager - namespace: argocd -spec: - project: default - source: - repoURL: https://charts.jetstack.io - chart: cert-manager - targetRevision: v1.15.0 - helm: - releaseName: cert-manager - values: | - installCRDs: true - destination: - server: https://kubernetes.default.svc - namespace: cert-manager - syncPolicy: - automated: - selfHeal: true - prune: true - syncOptions: - - CreateNamespace=true diff --git a/apps/forgejo.yaml b/apps/forgejo.yaml deleted file mode 100644 index 0410e0a..0000000 --- a/apps/forgejo.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: forgejo - namespace: argocd -spec: - project: default - source: - repoURL: https://github.com/gwg313/homelab-gitops - targetRevision: main - path: forgejo - destination: - server: https://kubernetes.default.svc - namespace: forgejo - syncPolicy: - automated: - selfHeal: true - prune: true - syncOptions: - - CreateNamespace=true diff --git a/apps/harbor-config.yaml b/apps/harbor-config.yaml deleted file mode 100644 index 728dc9c..0000000 --- a/apps/harbor-config.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: harbor-config - namespace: argocd -spec: - project: default - source: - repoURL: https://github.com/gwg313/homelab-gitops - targetRevision: main - path: harbor-config - destination: - server: https://kubernetes.default.svc - namespace: harbor - syncPolicy: - automated: - selfHeal: true - prune: true - syncOptions: - - CreateNamespace=true diff --git a/apps/harbor.yaml b/apps/harbor.yaml deleted file mode 100644 index f077ad3..0000000 --- a/apps/harbor.yaml +++ /dev/null @@ -1,51 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: harbor - namespace: argocd -spec: - project: default - destination: - server: https://kubernetes.default.svc - namespace: harbor - source: - repoURL: https://helm.goharbor.io - chart: harbor - targetRevision: 1.14.2 - helm: - releaseName: harbor - values: | - externalURL: https://registry.gwg313.xyz - expose: - type: clusterIP - tls: - enabled: false - certSource: secret - secret: - secretName: harbor-cert-nginx - nginx: - replicas: 0 - - persistence: - persistentVolumeClaim: - registry: - existingClaim: harbor-registry - jobservice: - existingClaim: harbor-jobservice - trivy: - existingClaim: harbor-trivy - database: - existingClaim: harbor-database - redis: - existingClaim: harbor-redis - core: - existingClaim: harbor-core - - ingress: - enabled: false - syncPolicy: - automated: - prune: true - selfHeal: true - syncOptions: - - CreateNamespace=true diff --git a/apps/istio/istio-base.yaml b/apps/istio/istio-base.yaml deleted file mode 100644 index 3421a1b..0000000 --- a/apps/istio/istio-base.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: istio-base - namespace: argocd - annotations: - argocd.argoproj.io/sync-wave: "0" -spec: - project: default - source: - repoURL: https://istio-release.storage.googleapis.com/charts - chart: base - targetRevision: 1.26.0 - destination: - server: https://kubernetes.default.svc - namespace: istio-system - syncPolicy: - automated: - prune: true - selfHeal: true - syncOptions: - - CreateNamespace=true diff --git a/apps/istio/istio-cni.yaml b/apps/istio/istio-cni.yaml deleted file mode 100644 index 772c789..0000000 --- a/apps/istio/istio-cni.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: istio-cni - namespace: argocd - annotations: - argocd.argoproj.io/sync-wave: "1" -spec: - project: default - source: - repoURL: https://istio-release.storage.googleapis.com/charts - chart: cni - targetRevision: 1.26.0 - helm: - values: | - cni: - enabled: true - chained: false - logLevel: info - destination: - server: https://kubernetes.default.svc - namespace: istio-system - syncPolicy: - automated: - prune: true - selfHeal: true diff --git a/apps/istio/istio-gateway.yaml b/apps/istio/istio-gateway.yaml deleted file mode 100644 index 20d7d61..0000000 --- a/apps/istio/istio-gateway.yaml +++ /dev/null @@ -1,50 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: istio-gateway - namespace: argocd - annotations: - argocd.argoproj.io/sync-wave: "2" -spec: - project: default - source: - repoURL: https://istio-release.storage.googleapis.com/charts - chart: gateway - targetRevision: 1.26.0 - helm: - values: | - replicaCount: 2 - - autoscaling: - enabled: false - - resources: - requests: - cpu: "500m" - memory: "512Mi" - limits: - cpu: "1000m" - memory: "1Gi" - - podDisruptionBudget: - enabled: true - minAvailable: 1 - - proxy: - logLevel: warning - componentLogLevel: "misc:error,config:debug" - - readinessProbe: - httpGet: - path: /healthz/ready - port: 15021 - initialDelaySeconds: 5 - periodSeconds: 5 - failureThreshold: 3 - destination: - server: https://kubernetes.default.svc - namespace: istio-system - syncPolicy: - automated: - prune: true - selfHeal: true diff --git a/apps/istio/istio-istiod.yaml b/apps/istio/istio-istiod.yaml deleted file mode 100644 index 55cbaf4..0000000 --- a/apps/istio/istio-istiod.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: istio-istiod - namespace: argocd - annotations: - argocd.argoproj.io/sync-wave: "1" -spec: - project: default - source: - repoURL: https://istio-release.storage.googleapis.com/charts - chart: istiod - targetRevision: 1.26.0 - helm: - values: | - global: - istioCNI: - enabled: true - - sidecarInjectorWebhook: - disableInitContainers: true - - pilot: - autoscaleEnabled: false - replicaCount: 2 - resources: - requests: - cpu: "500m" - memory: "512Mi" - limits: - cpu: "1000m" - memory: "1Gi" - - podDisruptionBudget: - enabled: true - minAvailable: 1 - destination: - server: https://kubernetes.default.svc - namespace: istio-system - syncPolicy: - automated: - prune: true - selfHeal: true diff --git a/apps/istio/istio-peer-auth.yaml b/apps/istio/istio-peer-auth.yaml deleted file mode 100644 index 5f4446a..0000000 --- a/apps/istio/istio-peer-auth.yaml +++ /dev/null @@ -1,9 +0,0 @@ -apiVersion: security.istio.io/v1beta1 -kind: PeerAuthentication -metadata: - annotations: - name: default - namespace: istio-system -spec: - mtls: - mode: PERMISSIVE diff --git a/apps/metallb-config.yaml b/apps/metallb-config.yaml deleted file mode 100644 index 06c86be..0000000 --- a/apps/metallb-config.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: metallb-config - namespace: argocd -spec: - project: default - source: - path: metallb/config - repoURL: https://github.com/gwg313/homelab-gitops - targetRevision: HEAD - destination: - server: https://kubernetes.default.svc - namespace: metallb-system - syncPolicy: - automated: - prune: true - selfHeal: true diff --git a/apps/metallb.yaml b/apps/metallb.yaml deleted file mode 100644 index bdf37ed..0000000 --- a/apps/metallb.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: metallb - namespace: argocd -spec: - project: default - source: - repoURL: https://metallb.github.io/metallb - chart: metallb - targetRevision: 0.14.5 - helm: - releaseName: metallb - destination: - server: https://kubernetes.default.svc - namespace: metallb-system - syncPolicy: - automated: - prune: true - selfHeal: true - syncOptions: - - CreateNamespace=true diff --git a/apps/minio-config.yaml b/apps/minio-config.yaml deleted file mode 100644 index 83e1911..0000000 --- a/apps/minio-config.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: minio-config - namespace: argocd -spec: - project: default - source: - repoURL: https://github.com/gwg313/homelab-gitops - targetRevision: main - path: minio - destination: - server: https://kubernetes.default.svc - namespace: minio - syncPolicy: - automated: - selfHeal: true - prune: true - syncOptions: - - CreateNamespace=true diff --git a/apps/minio.yaml b/apps/minio.yaml deleted file mode 100644 index ee9de30..0000000 --- a/apps/minio.yaml +++ /dev/null @@ -1,37 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: minio - namespace: argocd -spec: - destination: - namespace: minio - server: https://kubernetes.default.svc - project: default - source: - repoURL: https://charts.bitnami.com/bitnami - chart: minio - targetRevision: 17.0.9 - helm: - releaseName: minio - values: | - auth: - existingSecret: minio-auth - - ingress: - enabled: false - - service: - type: ClusterIP - ports: - api: 9000 - console: 9001 - - persistence: - existingClaim: minio-data - syncPolicy: - automated: - prune: true - selfHeal: true - syncOptions: - - CreateNamespace=true diff --git a/apps/navidrome.yaml b/apps/navidrome.yaml deleted file mode 100644 index 2962f82..0000000 --- a/apps/navidrome.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: navidrome - namespace: argocd -spec: - project: default - source: - repoURL: https://github.com/gwg313/homelab-gitops - targetRevision: main - path: navidrome - destination: - server: https://kubernetes.default.svc - namespace: navidrome - syncPolicy: - automated: - selfHeal: true - prune: true - syncOptions: - - CreateNamespace=true diff --git a/apps/nfs-subdir.yaml b/apps/nfs-subdir.yaml deleted file mode 100644 index dd612f0..0000000 --- a/apps/nfs-subdir.yaml +++ /dev/null @@ -1,33 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: nfs-subdir-external-provisioner - namespace: argocd -spec: - project: default - source: - repoURL: https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner - chart: nfs-subdir-external-provisioner - targetRevision: 4.0.18 - helm: - releaseName: nfs-subdir-external-provisioner - values: | - nfs: - server: truenas.local.gwg313.xyz - path: /mnt/tank/k8s/nfs-subdir - - storageClass: - name: nfs-client - defaultClass: true - accessModes: ["ReadWriteMany"] - reclaimPolicy: Delete - archiveOnDelete: false - destination: - server: https://kubernetes.default.svc - namespace: nfs-subdir-external-provisioner - syncPolicy: - automated: - prune: true - selfHeal: true - syncOptions: - - CreateNamespace=true diff --git a/apps/sealed-secrets.yaml b/apps/sealed-secrets.yaml deleted file mode 100644 index 5e7463d..0000000 --- a/apps/sealed-secrets.yaml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: sealed-secrets - namespace: argocd -spec: - project: default - source: - repoURL: https://bitnami-labs.github.io/sealed-secrets - chart: sealed-secrets - targetRevision: 2.15.3 - helm: - releaseName: sealed-secrets - values: | - fullnameOverride: sealed-secrets-controller - destination: - server: https://kubernetes.default.svc - namespace: sealed-secrets - syncPolicy: - automated: - prune: true - selfHeal: true - syncOptions: - - CreateNamespace=true diff --git a/apps/security.yaml b/apps/security.yaml deleted file mode 100644 index 5bcdeb1..0000000 --- a/apps/security.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: cluster-security - namespace: argocd -spec: - project: default - source: - repoURL: https://github.com/gwg313/homelab-gitops - targetRevision: main - path: security - destination: - server: https://kubernetes.default.svc - namespace: kube-system - syncPolicy: - automated: - selfHeal: true - prune: true diff --git a/apps/woodpecker-manifests.yaml b/apps/woodpecker-manifests.yaml deleted file mode 100644 index 8a36b56..0000000 --- a/apps/woodpecker-manifests.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: woodpecker-manifests - namespace: argocd -spec: - project: default - source: - repoURL: https://github.com/gwg313/homelab-gitops - targetRevision: HEAD - path: woodpecker - destination: - server: https://kubernetes.default.svc - namespace: woodpecker - syncPolicy: - automated: - selfHeal: true - prune: true - syncOptions: - - CreateNamespace=true diff --git a/apps/woodpecker.yaml b/apps/woodpecker.yaml deleted file mode 100644 index 0a9f7a0..0000000 --- a/apps/woodpecker.yaml +++ /dev/null @@ -1,23 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: woodpecker - namespace: argocd -spec: - project: default - source: - repoURL: https://woodpecker-ci.org/ - chart: woodpecker - targetRevision: 3.2.0 - helm: - releaseName: woodpecker - values: "server:\n env:\n WOODPECKER_HOST: \"https://ci.gwg313.xyz\"\n extraSecretNamesForEnvFrom:\n - woodpecker-server-secrets\n persistentVolume:\n enabled: true\n existingClaim: woodpecker-server-pvc5\n\nagent:\n enabled: true\n replicaCount: 1\n extraSecretNamesForEnvFrom:\n - woodpecker-agent-secrets\n env:\n WOODPECKER_SERVER: \"woodpecker-server:9000\"\n WOODPECKER_MAX_WORKFLOWS: \"5\"\n persistence:\n enabled: true\n existingClaim: woodpecker-agent-pvc5\n securityContext:\n privileged: true \n" - destination: - server: https://kubernetes.default.svc - namespace: woodpecker - syncPolicy: - automated: - prune: true - selfHeal: true - syncOptions: - - CreateNamespace=true diff --git a/apps/yopass.yaml b/apps/yopass.yaml deleted file mode 100644 index 491a828..0000000 --- a/apps/yopass.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: yopass - namespace: argocd -spec: - project: default - source: - repoURL: https://github.com/gwg313/homelab-gitops - targetRevision: main - path: yopass - destination: - server: https://kubernetes.default.svc - namespace: yopass - syncPolicy: - automated: - selfHeal: true - prune: true - syncOptions: - - CreateNamespace=true diff --git a/audiobookshelf/certificate.yaml b/audiobookshelf/certificate.yaml deleted file mode 100644 index 4af686f..0000000 --- a/audiobookshelf/certificate.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: audiobookshelf-cert - namespace: istio-system -spec: - secretName: audiobookshelf-cert - issuerRef: - name: letsencrypt-dns - kind: ClusterIssuer - dnsNames: - - audiobooks.gwg313.xyz diff --git a/audiobookshelf/deployment.yaml b/audiobookshelf/deployment.yaml deleted file mode 100644 index 01f20f9..0000000 --- a/audiobookshelf/deployment.yaml +++ /dev/null @@ -1,42 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: audiobookshelf - namespace: audiobookshelf -spec: - replicas: 1 - selector: - matchLabels: - app: audiobookshelf - template: - metadata: - labels: - app: audiobookshelf - spec: - containers: - - name: audiobookshelf - image: registry.gwg313.xyz/library/audiobookshelf:latest - ports: - - containerPort: 8080 - volumeMounts: - - name: audiobooks-volume - mountPath: /audiobooks - - name: podcasts-volume - mountPath: /podcasts - - name: config-volume - mountPath: /config - - name: metadata-volume - mountPath: /metadata - volumes: - - name: audiobooks-volume - persistentVolumeClaim: - claimName: audiobookshelf-audiobooks - - name: podcasts-volume - persistentVolumeClaim: - claimName: audiobookshelf-podcasts - - name: config-volume - persistentVolumeClaim: - claimName: audiobookshelf-config - - name: metadata-volume - persistentVolumeClaim: - claimName: audiobookshelf-metadata diff --git a/audiobookshelf/gateway.yaml b/audiobookshelf/gateway.yaml deleted file mode 100644 index 7d9270d..0000000 --- a/audiobookshelf/gateway.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: Gateway -metadata: - name: audiobookshelf-gateway - namespace: audiobookshelf -spec: - selector: - istio: gateway - servers: - - port: - number: 443 - name: https - protocol: HTTPS - tls: - mode: SIMPLE - credentialName: audiobookshelf-cert - hosts: - - audiobooks.gwg313.xyz diff --git a/audiobookshelf/iscsi-sealed.yaml b/audiobookshelf/iscsi-sealed.yaml deleted file mode 100644 index b0057c6..0000000 --- a/audiobookshelf/iscsi-sealed.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - creationTimestamp: null - name: audiobookshelf-iscsi-auth - namespace: audiobookshelf -spec: - encryptedData: - discovery.sendtargets.auth.password: AgBlREGUmNCv4V+AAsTN4xn1+CTIQspG86tK34CH8LbAQQtCwrldsyH/ZDnDEK2bmb7Eq0o4Lt9bYYdAFt/2d74ViMWVWyarIG5dU3kwMfzysQsu3lrWtIUwlFS08YaQJg+7Eipy1LbJvncTLY9ixZ3xA7Vx+rlyhXp0bt0Aet6ItzcxTbifA14xtCGDDDRcOjkBp+lhOY70tnqAkQ7NxLooPcNGSIqMPbIwhdc8Nq9Knz7ZqVTnVyl2QxdQSooUIcYBN0V97tiwtZUvwU0pb7LsxSEac2NbwzPMfoP8LnTETURK0JhqvO6Uvi7iMNBLw3sDzR2fCX1VhleLOM1JQgk93w5VA33GZOb+7iofJt+gVIs651G9+rCS2hN8XiQPiZnCVtZ9upxM4DnHz1GvuML0NRcXyIN2zOzcZdwMXBRAQ42XwcdbZIOubiVNbV/yEDoNmA6aR1ItRYDGyheRKwphLEDnbXlgWEDnKKHiUjrj833vNTXn9wtOZ2mnfzE//cr3fvaosQthfnviI/QRo8plpXI8y9BgjNToecsbQNzNIP17ZljCZB2HTBa8urX9A9vAOcFD51k6FugfE92tnBtSu42vGi3vkEuxM2blrFAWlpsChHkyQmONJchHgNsyKqZdlRzFLraZTtic9z8HBjmOyXgykGuoPzGf29vB8bwZ3mIUE8GSsF7WV9hAGdfGzE0VnUp3CKOIMFyrudVeWFOX - discovery.sendtargets.auth.username: AgBerGD4HXIRcJDdyknlztVIIfpLYyEnB5jIQV7tHksPPtDp4VxOQcOOnsgn2xcskpGbPP60iQJgTn9eNtHnRVylFhRDBr7ugn7LKWw0KGg/sexYx07Do6Sc7h7+MrzaoxV7kV7hOJrflALtKhSTmsiNLVnskmU+reckgLYFrFjSPOYJsDJlpq7WPXVBVW2nEJ0EMkCyfWAU1ADfpM5rvbtLu3geCAWAz557BASYgdvaBEWOT5sONC2rbl2MaSJeBVZX+Wr5IdzVd3K/VFJRSJ7xE5LAVKbuWGPpt18H86uU7mqXuyYUz7FR7nD21FT8rPvj4/rXKTR0W2U/hrH/53Jn5yFj30+iAcDhq9C4fRA8ZvI9KsESRZXq0dnInPkYpHzPIKdMwtEs/qycIMGwczRO9d6UDj3qJsJTO4E1btvzPQMt1kJ3d2U87/r7TCzcbIpLlMez8VTS0osnwVkD9/4oR074TX/0m9aMqLomsrw4oyXsetJL8O4R1A59NsjtBRvyeG00BmmJMlSrI+DF+wa131/4g/y6BsYP30QwxxxoOHH1clSdXGueHhQpttmc7le8FSJ+pyyPLR8BrFi76GojZG3GZScArJm/072WcUnsvxpitmtwKgihRFGr6V5yPU/vvPLWsV+swQ+zh6IZ1RPNn8QPk4oKqJnoAlDmMkdXhgqLucor322cxU+bNkE0v3RPBeynzEVpGSzrtYzOvw== - node.session.auth.password: AgB/lsTVb/3hrYtzpEydBfcesvDgZUi6Si4VNjlGRS1PfK9DSLpRBZazgLkrFSIhLOviWb9Rp9zQDNTJFAZkLbPGh8zNWyTzbANgsSziht7ljBArnsT3iMRQbFvZGUkI3QM95EURVXC7GhPEfr15bkEqq93ETzaDaBvZ3tKN2XqjRTFFAR2aFVVV6rPPea3FfAVhhcR700pfbW4YpLPfHuUFentEuMo5a3QRYo3VdzPYB7lzRx+YgD9Rv1rSffTdnPJzlE9IkUeBZKnuK9Xg80Q75aPHvb6MfT++LRZHUtsftQFjbJMcFKqqDu+JktjViyrTYG/2cfdQKsHbsQu4OW4XamU0isZiz42T8cj/Dpo0C+m2meZVXkSrsvyeHCA77vl9yd24O7CkDGKLnAqe5RLWAMJVBQwnVqiDhTdTvEItoyV9MZM079CsPKSpVZMJ4GQoJDjKN3L9Z0IIWHlrV5RJ65RJA3d8/9Ku+vFtxyfGWB3GtXAFvXYW/OZn1vuIEmA3U11mgnGKDIRETBMpuJSvzVKiTxCL4yrq5Ap0VRfBlJlNbDSlj78z6x9Pd8TsSoKUA5htpObLy3+Dx2Lm6SUflKvB6ywKnIbhlfFONlUrsxX6J02taDmqTzeAFT5sSM2Xl4yFveb7XLQQOJUIc32ZAFXOkYkvr9T8lbxXDE9mJG7abzwal7i1KWrxgVnmgN8oM6QDciHqElUb+z+tE69g - node.session.auth.username: AgCjON6B6NWGlbQsJvBLvy1SOgUt7fuIScFKqsnVLZf/AmUH6VJ70qAtjOr+MfoyhvGkpNLAb64LpUsEmxX/AI4pONZnNUVYgWSha+yEizCLsYCp2wL7PHbobg9nkYxL7vRcS/So5iIaHHS+3cHIHJI5O8Dhb6gqOz5kafNgdLu0TJ56n1Axe4QI3mz0m5/XjovzzImM3DiMaqtzJotENGxnnA/X0/zBbNZry94iWuXCTJ115+6cVn+h3SvVw0/rwcJgfNxgIJJW4Rukl6WCyC6MTKTjNnA65Z5R9oW4JviGNF/0PNGTjmkuCoJqSNZ+p5XebhTxn65ultLMxvJXZhVmSHo3es3x8wlmO49UOGhT1a38P+p/9DrrTg3xEdIeDHMmdLaZgOjjEfDh/2OP2S2ZHVEXQnFvG2VnKgmMYWyeylhBGyn4cEkLc1fFhy55g2EMCeF5zXNldTlT3Gh0ca1ipF0BBXgvuJCa9c5tNBK2QS66QVdehOLBOxrnjTnd4VPt05JXKqSQZ6S0ukNecL5hBju2nGHlXdYcVeI94/uZmpkNJC+mqRTJdXGwtUhF9F529Ln+DtkhTcGUAPBcZdP9eEc/lkAjp/lJyzW2jgTynVkqAyBZJsA7etAHAUlsFMgFOw6bG/oKXpJE7wFJ4J929/inpVj8J9rlLC7ruRlQy9gUT8A2uLwAXVmQufpjBTi2AVyS6wACG+eusvOHYg== - template: - metadata: - creationTimestamp: null - name: audiobookshelf-iscsi-auth - namespace: audiobookshelf - type: kubernetes.io/iscsi-chap diff --git a/audiobookshelf/pvcs.yaml b/audiobookshelf/pvcs.yaml deleted file mode 100644 index 8f8abbe..0000000 --- a/audiobookshelf/pvcs.yaml +++ /dev/null @@ -1,57 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: audiobookshelf-config - namespace: audiobookshelf -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - volumeName: audiobookshelf-config-pv - storageClassName: audiobookshelf-iscsi - ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: audiobookshelf-metadata - namespace: audiobookshelf -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - volumeName: audiobookshelf-metadata-pv - storageClassName: audiobookshelf-iscsi - ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: audiobookshelf-audiobooks - namespace: audiobookshelf -spec: - accessModes: - - ReadOnlyMany - resources: - requests: - storage: 100Gi - volumeName: audiobookshelf-audiobooks-pv - storageClassName: audiobookshelf-nfs ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: audiobookshelf-podcasts - namespace: audiobookshelf -spec: - accessModes: - - ReadOnlyMany - resources: - requests: - storage: 100Gi - volumeName: audiobookshelf-podcasts-pv - storageClassName: audiobookshelf-nfs diff --git a/audiobookshelf/pvs.yaml b/audiobookshelf/pvs.yaml deleted file mode 100644 index 65b1e78..0000000 --- a/audiobookshelf/pvs.yaml +++ /dev/null @@ -1,73 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: audiobookshelf-config-pv -spec: - capacity: - storage: 1Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - storageClassName: audiobookshelf-iscsi - iscsi: - targetPortal: truenas.local.gwg313.xyz:3260 - iqn: iqn.2005-10.org.freenas.ctl:audiobookshelf-config - lun: 0 - fsType: ext4 - readOnly: false - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: audiobookshelf-iscsi-auth ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: audiobookshelf-metadata-pv -spec: - capacity: - storage: 1Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - storageClassName: audiobookshelf-iscsi - iscsi: - targetPortal: truenas.local.gwg313.xyz:3260 - iqn: iqn.2005-10.org.freenas.ctl:audiobookshelf-metadata - lun: 1 - fsType: ext4 - readOnly: false - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: audiobookshelf-iscsi-auth ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: audiobookshelf-audiobooks-pv -spec: - capacity: - storage: 100Gi - accessModes: - - ReadOnlyMany - persistentVolumeReclaimPolicy: Retain - nfs: - server: truenas.local.gwg313.xyz - path: /mnt/tank/media/audiobooks - storageClassName: audiobookshelf-nfs ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: audiobookshelf-podcasts-pv -spec: - capacity: - storage: 100Gi - accessModes: - - ReadOnlyMany - persistentVolumeReclaimPolicy: Retain - nfs: - server: truenas.local.gwg313.xyz - path: /mnt/tank/media/podcasts - storageClassName: audiobookshelf-nfs diff --git a/audiobookshelf/service.yaml b/audiobookshelf/service.yaml deleted file mode 100644 index f34268b..0000000 --- a/audiobookshelf/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: audiobookshelf - namespace: audiobookshelf -spec: - selector: - app: audiobookshelf - ports: - - port: 80 - targetPort: 8080 diff --git a/audiobookshelf/virtualservice.yaml b/audiobookshelf/virtualservice.yaml deleted file mode 100644 index f128e38..0000000 --- a/audiobookshelf/virtualservice.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: VirtualService -metadata: - name: audiobookshelf - namespace: audiobookshelf -spec: - hosts: - - audiobooks.gwg313.xyz - gateways: - - audiobookshelf-gateway - http: - - match: - - uri: - prefix: / - route: - - destination: - host: audiobookshelf - port: - number: 80 diff --git a/bytestash/bytestash-peer-auth.yaml b/bytestash/bytestash-peer-auth.yaml deleted file mode 100644 index 8a3354a..0000000 --- a/bytestash/bytestash-peer-auth.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: security.istio.io/v1beta1 -kind: PeerAuthentication -metadata: - name: strict-mtls - namespace: bytestash -spec: - mtls: - mode: STRICT diff --git a/bytestash/bytestash-secret-sealed.yaml b/bytestash/bytestash-secret-sealed.yaml deleted file mode 100644 index 255eb8a..0000000 --- a/bytestash/bytestash-secret-sealed.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - creationTimestamp: null - name: bytestash-secret - namespace: bytestash -spec: - encryptedData: - JWT_SECRET_KEY: AgBhyqlrAr9hDaCZ7yPbZZuXtZMeqbMqd0LXWwT8nlEpTY0Tk7LLwjdv6DoY3gvj0Jbgcoa+Edgg6HywykouVAqe2i6HbDwWOPVjRw5K1GA7y7jlb8IOP2D7ZJN8sKW7MUfhmmraN0piuvpCMVl/NHbT1XfQq4mym/PChHcD4Ju+lNMfFWkHNZtXf/9tpYcTa3cmREf0uBFQRNQFP2TaUx8X+QmzIIdoGaqZA+Jud2HkTHymsRhn7fSK3smaJecw/y7IR4ohNcJ17FqOyaqbnQ/MUzB+aprFKjBOnVmZwbWSjJYWPN1nx6NPndmk8X3Q3XeB50WnoAhqNSwI6a58wo/zVHyM5B3Q+L9slCWd8t27z+Jv7Y8zRFl137dbhDBcrHf73miNnaK5x0b741Bv3yDakJG+DrU5YlmGH2/t4XBZjMMRxF4y0CgdT+DN+cZrkbkATHIQWZARmLTqYfig/2D+PfKhrniE4Tfq3V2gLN12Kwf09fqM02Uo2faOya6QF3fvGGZx3QXiDrzPMthLuvk1JqPqU98fNKniS8x7/q1LdHH6ga5wyXyGk76tl540p+kdY2sAi7K5/VAw0QM6A+6EHXJJgZ4bdd02eB0F1/lCKcCzZhs5lIjBu0r/d81wYlId6GtMvXZiMfsbMS9a7evGl20PXAn2C5KxWfyyyIX3wn7JIAxiOdGwPUOI6E4/LCJSnzlfBa7SWFrMHAjniNyQOLB0S9amtHwDDt6j - template: - metadata: - creationTimestamp: null - name: bytestash-secret - namespace: bytestash - type: Opaque diff --git a/bytestash/certificate.yaml b/bytestash/certificate.yaml deleted file mode 100644 index a50a49e..0000000 --- a/bytestash/certificate.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: bytestash-cert - namespace: istio-system -spec: - secretName: bytestash-cert - issuerRef: - name: letsencrypt-dns - kind: ClusterIssuer - commonName: bytestash.local.gwg313.xyz - dnsNames: - - bytestash.local.gwg313.xyz diff --git a/bytestash/configmap.yaml b/bytestash/configmap.yaml deleted file mode 100644 index 65e7119..0000000 --- a/bytestash/configmap.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: bytestash-config - namespace: bytestash -data: - BASE_PATH: "" - TOKEN_EXPIRY: "24h" - ALLOW_NEW_ACCOUNTS: "true" - DEBUG: "true" - DISABLE_ACCOUNTS: "false" - DISABLE_INTERNAL_ACCOUNTS: "false" - OIDC_ENABLED: "false" - OIDC_DISPLAY_NAME: "" - OIDC_ISSUER_URL: "" - OIDC_CLIENT_ID: "" - OIDC_CLIENT_SECRET: "" - OIDC_SCOPES: "" diff --git a/bytestash/deployment.yaml b/bytestash/deployment.yaml deleted file mode 100644 index 9408803..0000000 --- a/bytestash/deployment.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: bytestash - namespace: bytestash -spec: - replicas: 1 - selector: - matchLabels: - app: bytestash - template: - metadata: - labels: - app: bytestash - annotations: - sidecar.istio.io/inject: "true" - spec: - securityContext: - runAsNonRoot: false - seccompProfile: - type: RuntimeDefault - containers: - - name: bytestash - image: "ghcr.io/jordan-dalby/bytestash:latest" - ports: - - containerPort: 5000 - envFrom: - - configMapRef: - name: bytestash-config - - secretRef: - name: bytestash-secret - volumeMounts: - - name: bytestash-storage - mountPath: /data/snippets - securityContext: - allowPrivilegeEscalation: false - runAsNonRoot: false - capabilities: - drop: ["ALL"] - volumes: - - name: bytestash-storage - persistentVolumeClaim: - claimName: bytestash-pvc diff --git a/bytestash/gateway.yaml b/bytestash/gateway.yaml deleted file mode 100644 index ca6ecee..0000000 --- a/bytestash/gateway.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: Gateway -metadata: - name: bytestash-gateway - namespace: bytestash -spec: - selector: - istio: gateway - servers: - - port: - number: 443 - name: https - protocol: HTTPS - hosts: - - "bytestash.local.gwg313.xyz" - tls: - mode: SIMPLE - credentialName: bytestash-cert diff --git a/bytestash/namespace.yaml b/bytestash/namespace.yaml deleted file mode 100644 index 5288ac9..0000000 --- a/bytestash/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: bytestash diff --git a/bytestash/service.yaml b/bytestash/service.yaml deleted file mode 100644 index 4b305db..0000000 --- a/bytestash/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: bytestash - namespace: bytestash -spec: - selector: - app: bytestash - ports: - - port: 80 - targetPort: 5000 diff --git a/bytestash/storage.yaml b/bytestash/storage.yaml deleted file mode 100644 index 585fc43..0000000 --- a/bytestash/storage.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: bytestash-pv -spec: - capacity: - storage: 1Gi - volumeMode: Filesystem - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - storageClassName: manual - nfs: - path: /mnt/tank/docker-volumes/bytestash - server: truenas.local.gwg313.xyz ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: bytestash-pvc - namespace: bytestash -spec: - storageClassName: manual - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 1Gi - volumeName: bytestash-pv diff --git a/bytestash/virtualservice.yaml b/bytestash/virtualservice.yaml deleted file mode 100644 index 095671b..0000000 --- a/bytestash/virtualservice.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: VirtualService -metadata: - name: bytestash - namespace: bytestash -spec: - hosts: - - "bytestash.local.gwg313.xyz" - gateways: - - bytestash/bytestash-gateway - http: - - route: - - destination: - host: bytestash - port: - number: 80 diff --git a/cert-manager/values.yaml b/cert-manager/values.yaml deleted file mode 100644 index 66e328a..0000000 --- a/cert-manager/values.yaml +++ /dev/null @@ -1,4 +0,0 @@ -installCRDs: true -extraArgs: - - --dns01-recursive-nameservers-only - - --dns01-recursive-nameservers=1.1.1.1:53,8.8.8.8:53 diff --git a/cluster-issuer/01-sealedsecret.yaml b/cluster-issuer/01-sealedsecret.yaml deleted file mode 100644 index e9586d9..0000000 --- a/cluster-issuer/01-sealedsecret.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - creationTimestamp: null - name: cloudflare-api-token - namespace: cert-manager -spec: - encryptedData: - api-token: AgC7jVHCCMGqv2ZcLxU13J2icxYM6pLCpy9ODRFtEZpjY4MGmja+ScRs00ziY8DeH9Ahhrc21VYTTZAmw1bCesHIys0y19KeXbO5HudWbSt02792kT5sPsjlNdkZyXT0Qmbz3i4OPcH1V1+oXJArTuicoJkAiVg05jGPuIcYM2zDaMvMjk4cq7L8PYc/HAusXlHI/ggozPqmohS4ACBYvsUvgyDEGAvwW0vFRjHb1z3IxyzVtbDdgae8okoQWCHlKRTeFRReB1AX9wml+kNpq2SeElh/5Grdiz4MEr8PsoKUIJg3n+KqjOFgHX7I5gDW7LQv2+W66sYzd3GFF0g6MUs1EjznX35J/e7uYSm3ERtomSIFx3FFx6fFXuN5QkCx79MgKZxP8F/PwBdusc8tDHocgK8V2hvSjxIU2J74rjcMw4ZUqwFvlZa0xAJcUAlkFQrN/b7ldlwQYyzsXhPyRIvIGvGSmBabq+yHE4nyjCVezy28h361O3zB2kCJUXi1k2rbD2+NI1Z+25q6JyRgnUelnfzyiPFJTKlFIiP1He1FC441OPjXILYhuaIenm0w9GQKUt2ndNJng4wRtsCPi6PcGHUIOjiT8ErZTkN4pJmm4/bRYPXumS9J0sTPNr2z564fsZjRpyCD97BJuntnXRnWxQRVbMb55f99Zu2j5jziEDegg6aCsXRLoATHLsBFlK5IiC95cMpkaAbY5FWwCCp4IMLkiPWGlR1dnCbBgF2P4NtxihNW9cPC - template: - metadata: - creationTimestamp: null - name: cloudflare-api-token - namespace: cert-manager - type: Opaque diff --git a/cluster-issuer/02-cluster-issuer.yaml b/cluster-issuer/02-cluster-issuer.yaml deleted file mode 100644 index a168955..0000000 --- a/cluster-issuer/02-cluster-issuer.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: ClusterIssuer -metadata: - name: letsencrypt-dns -spec: - acme: - server: https://acme-v02.api.letsencrypt.org/directory - email: gwg313@pm.me - privateKeySecretRef: - name: letsencrypt-dns-key - solvers: - - dns01: - cloudflare: - apiTokenSecretRef: - name: cloudflare-api-token - key: api-token diff --git a/common/gui/common.nix b/common/gui/common.nix new file mode 100644 index 0000000..b7b296f --- /dev/null +++ b/common/gui/common.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: +{ + services.printing.enable = true; + + environment.systemPackages = with pkgs; [ + adwaita-icon-theme + gnome-themes-extra + librewolf + qt5.qtwayland + qt6.qmake + qt6.qtwayland + adwaita-qt + adwaita-qt6 + ]; +} diff --git a/common/gui/dbus.nix b/common/gui/dbus.nix new file mode 100644 index 0000000..d433ad5 --- /dev/null +++ b/common/gui/dbus.nix @@ -0,0 +1,14 @@ +{ + config, + pkgs, + ... +}: { + services.dbus = { + enable = true; + packages = [pkgs.dconf]; + }; + + programs.dconf = { + enable = true; + }; +} diff --git a/common/gui/default.nix b/common/gui/default.nix new file mode 100644 index 0000000..a81a95f --- /dev/null +++ b/common/gui/default.nix @@ -0,0 +1,9 @@ +{lib, ...}: { + imports = [ + ./thunar.nix + ./steam.nix + ]; + + thunar.enable = lib.mkDefault true; + steam.enable = lib.mkDefault false; +} diff --git a/common/gui/displayManager.nix b/common/gui/displayManager.nix new file mode 100644 index 0000000..816340c --- /dev/null +++ b/common/gui/displayManager.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + pkgs, + ... +}: { + services.xserver = { + displayManager.gdm = { + enable = false; + wayland = true; + }; + displayManager.lightdm.enable = false; + }; + environment.systemPackages = with pkgs; [ + ]; +} diff --git a/common/gui/hyprland.nix b/common/gui/hyprland.nix new file mode 100644 index 0000000..d8242e5 --- /dev/null +++ b/common/gui/hyprland.nix @@ -0,0 +1,87 @@ +{ + pkgs, + inputs, + ... +}: +{ + imports = [ + ./common.nix + ./dbus.nix + ./pipewire.nix + ./wayland.nix + ./displayManager.nix + # ./xdg.nix + ]; + + # Security + security = { + pam.services.swaylock = { + text = '' + auth include login + ''; + }; + }; + + # Services + services = { + xserver = { + enable = true; + xkb = { + variant = ""; + layout = "us"; + }; + excludePackages = [ pkgs.xterm ]; + # videoDrivers = ["amdgpu"]; + libinput = { + enable = true; + touchpad.tapping = true; + touchpad.naturalScrolling = true; + touchpad.scrollMethod = "twofinger"; + touchpad.disableWhileTyping = true; + touchpad.clickMethod = "clickfinger"; + }; + }; + gvfs.enable = true; + tumbler.enable = true; + gnome = { + sushi.enable = true; + gnome-keyring.enable = true; + }; + }; + + programs = { + hyprland = { + enable = true; + withUWSM = true; # recommended for most users + package = inputs.hyprland.packages.${pkgs.system}.hyprland; + xwayland = { + enable = true; + }; + }; + waybar = { + enable = false; + package = pkgs.waybar.overrideAttrs (oldAttrs: { + mesonFlags = oldAttrs.mesonFlags ++ [ "-Dexperimental=true" ]; + }); + }; + thunar = { + enable = true; + plugins = with pkgs.xfce; [ + thunar-archive-plugin + thunar-volman + ]; + }; + }; + + environment.systemPackages = with pkgs; [ + libva-utils + gsettings-desktop-schemas + xdg-utils + hyprland-qtutils + ]; + environment.sessionVariables = { + XDG_CURRENT_DESKTOP = "Hyprland"; + XDG_SESSION_DESKTOP = "Hyprland"; + XDG_SESSION_TYPE = "wayland"; + }; +} diff --git a/common/gui/pipewire.nix b/common/gui/pipewire.nix new file mode 100644 index 0000000..ea26dd9 --- /dev/null +++ b/common/gui/pipewire.nix @@ -0,0 +1,40 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + # Enable sound with pipewire. + hardware.pulseaudio.enable = false; + # hardware.alsa.enablePersistence = true; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + + # use the example session manager (no others are packaged yet so this is enabled by default, + # no need to redefine it in your config for now) + #media-session.enable = true; + extraConfig.pipewire.adjust-sample-rate = { + "context.properties" = { + "default.clock.rate" = 192000; + #"defautlt.allowed-rates" = [ 192000 48000 44100 ]; + "defautlt.allowed-rates" = [ 192000 ]; + #"default.clock.quantum" = 32; + #"default.clock.min-quantum" = 32; + #"default.clock.max-quantum" = 32; + }; + }; + }; + + environment.systemPackages = with pkgs; [ + pipewire + wireplumber + easyeffects + ]; +} diff --git a/common/gui/retroarch.nix b/common/gui/retroarch.nix new file mode 100644 index 0000000..9f7f4d1 --- /dev/null +++ b/common/gui/retroarch.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: +let + retroarchWithCores = ( + pkgs.retroarch.withCores ( + cores: with cores; [ + bsnes + mgba + quicknes + genesis-plus-gx + ] + ) + ); +in +{ + environment.systemPackages = [ + retroarchWithCores + ]; +} diff --git a/common/gui/steam.nix b/common/gui/steam.nix new file mode 100644 index 0000000..b4dd8f6 --- /dev/null +++ b/common/gui/steam.nix @@ -0,0 +1,55 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + options = { + steam.enable = lib.mkEnableOption "Enables steam"; + }; + + config = lib.mkIf config.steam.enable { + hardware.opengl.driSupport32Bit = true; + + nixpkgs.config.packageOverrides = pkgs: { + steam = pkgs.steam.override { + extraPkgs = + pkgs: with pkgs; [ + xorg.libXcursor + xorg.libXi + xorg.libXinerama + xorg.libXScrnSaver + libpng + libpulseaudio + libvorbis + stdenv.cc.cc.lib + libkrb5 + keyutils + ]; + }; + }; + + programs.steam = { + enable = true; + remotePlay.openFirewall = true; + gamescopeSession = { + enable = true; + args = [ + "-F fsr" + "-f" + ]; + }; + }; + + environment.sessionVariables = { + # Proton GE flag + WINE_FULLSCREEN_FSR = "1"; + }; + + environment.systemPackages = with pkgs; [ + protonup + scanmem + ]; + }; +} diff --git a/common/gui/thunar.nix b/common/gui/thunar.nix new file mode 100644 index 0000000..45c8ed2 --- /dev/null +++ b/common/gui/thunar.nix @@ -0,0 +1,24 @@ +{ + pkgs, + config, + lib, + ... +}: +{ + options = { + thunar.enable = lib.mkEnableOption "Enables thunar and its plugins"; + }; + config = lib.mkIf config.thunar.enable { + programs.thunar = { + enable = true; + plugins = with pkgs.xfce; [ + xfconf + tumbler + thunar-archive-plugin + thunar-volman + ]; + }; + services.gvfs.enable = true; # Mount, trash, and other functionalities + services.tumbler.enable = true; # Thumbnail support for images + }; +} diff --git a/common/gui/wayland.nix b/common/gui/wayland.nix new file mode 100644 index 0000000..ee4a70a --- /dev/null +++ b/common/gui/wayland.nix @@ -0,0 +1,26 @@ +{pkgs, ...}: { + environment.systemPackages = with pkgs; [ + wlr-randr + wl-clipboard + ]; + + environment.sessionVariables = { + POLKIT_AUTH_AGENT = "${pkgs.polkit_gnome}/libexec/polkit-gnome-authentication-agent-1"; + GSETTINGS_SCHEMA_DIR = "${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}/glib-2.0/schemas"; + WLR_NO_HARDWARE_CURSORS = "1"; + NIXOS_OZONE_WL = "1"; + MOZ_ENABLE_WAYLAND = "1"; + SDL_VIDEODRIVER = "wayland"; + _JAVA_AWT_WM_NONREPARENTING = "1"; + CLUTTER_BACKEND = "wayland"; + # WLR_RENDERER = "vulkan"; + GTK_USE_PORTAL = "1"; + #NIXOS_XDG_OPEN_USE_PORTAL = "1"; # Sets the desktop portal to use flatpak + WLR_NO_HARDWARE_CURSOR = "1"; + GDK_BACKEND = "wayland"; + QT_QPA_PLATFORM = "wayland;xcb"; + QT_AUTO_SCREEN_SCALE_FACTOR = "1"; + QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; + QT_QPA_PLATFORMTHEME = "qt5ct"; + }; +} diff --git a/common/gui/xdg.nix b/common/gui/xdg.nix new file mode 100644 index 0000000..b48af6c --- /dev/null +++ b/common/gui/xdg.nix @@ -0,0 +1,33 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + # XDG Portals + xdg = { + autostart.enable = true; + portal = { + enable = true; + wlr.enable = true; + xdgOpenUsePortal = true; + extraPortals = [ + pkgs.xdg-desktop-portal-hyprland + pkgs.xdg-desktop-portal-gtk + pkgs.libsForQt5.xdg-desktop-portal-kde + pkgs.lxqt.xdg-desktop-portal-lxqt + ]; + }; + }; + environment.systemPackages = with pkgs; [ + xdg-utils + xdg-desktop-portal + xdg-desktop-portal-gtk + xdg-desktop-portal-hyprland + ]; + + environment.sessionVariables = { + XDG_SESSION_TYPE = "wayland"; + }; +} diff --git a/common/networking/default.nix b/common/networking/default.nix new file mode 100644 index 0000000..a9a6091 --- /dev/null +++ b/common/networking/default.nix @@ -0,0 +1,13 @@ +{ lib, ... }: +{ + imports = [ + ./zerotier.nix + ./firewall.nix + # ./wireless.nix + ./networkmanager.nix + ]; + + zerotier.enable = lib.mkDefault true; + firewall.enable = lib.mkDefault true; + # wireless.enable = lib.mkDefault false; +} diff --git a/common/networking/firewall.nix b/common/networking/firewall.nix new file mode 100644 index 0000000..96ceb9a --- /dev/null +++ b/common/networking/firewall.nix @@ -0,0 +1,19 @@ +{ + config, + lib, + pkgs, + inputs, + outputs, + ... +}: +{ + options = { + firewall.enable = lib.mkEnableOption "Enable the Firewall"; + }; + config = lib.mkIf config.firewall.enable { + networking.nftables.enable = true; + networking.firewall = { + enable = true; + }; + }; +} diff --git a/common/networking/hosts.nix b/common/networking/hosts.nix new file mode 100644 index 0000000..54126d5 --- /dev/null +++ b/common/networking/hosts.nix @@ -0,0 +1,29 @@ +_: { + networking.extraHosts = '' + 10.147.17.246 audiobooks.zerotier.gwg313.xyz + 10.147.17.246 music.zerotier.gwg313.xyz + 10.147.17.246 recipes.zerotier.gwg313.xyz + 10.147.17.246 scholarsome.zerotier.gwg313.xyz + 10.147.17.246 bookmarks.zerotier.gwg313.xyz + 10.147.17.246 pastebin.zerotier.gwg313.xyz + 10.147.17.246 snippets.zerotier.gwg313.xyz + 10.147.17.246 git.zerotier.gwg313.xyz + 10.147.17.246 s3.zerotier.gwg313.xyz + 10.147.17.246 s3-console.zerotier.gwg313.xyz + 10.147.17.246 registry.zerotier.gwg313.xyz + 10.147.17.246 ci.zerotier.gwg313.xyz + 10.147.17.246 uptime.zerotier.gwg313.xyz + + + + 10.1.10.50 music.gwg313.xyz + 10.1.10.50 git.gwg313.xyz + 10.1.10.50 ci.gwg313.xyz + 10.1.10.50 registry.gwg313.xyz + 10.1.10.50 s3.gwg313.xyz + 10.1.10.50 s3-console.gwg313.xyz + 10.1.10.50 pastebin.gwg313.xyz + 10.1.10.50 audiobooks.gwg313.xyz + 10.1.10.9 uptime.gwg313.xyz + ''; +} diff --git a/common/networking/networkmanager.nix b/common/networking/networkmanager.nix new file mode 100644 index 0000000..b025d2d --- /dev/null +++ b/common/networking/networkmanager.nix @@ -0,0 +1,84 @@ +{ + config, + pkgs, + ... +}: +{ + + environment.systemPackages = with pkgs; [ linuxKernel.packages.linux_5_4.wireguard ]; + + sops.secrets."wireless.env" = { }; + networking = { + networkmanager = { + enable = true; + wifi.scanRandMacAddress = true; + ensureProfiles = { + environmentFiles = [ config.sops.secrets."wireless.env".path ]; + profiles = { + home-wifi = { + connection.id = "home-wifi"; + connection.type = "wifi"; + wifi.ssid = "$home_uuid"; + wifi-security = { + auth-alg = "open"; + key-mgmt = "wpa-psk"; + psk = "$home_psk"; + }; + connection.autoconnect-priority = 100; + }; + eduroam = { + connection.id = "eduroam"; + connection.type = "wifi"; + wifi.ssid = "eduroam"; + wifi-security = { + key-mgmt = "wpa-eap"; + }; + "802-1x" = { + eap = "peap;"; + identity = "$eduroam_identity"; + password = "$school_password"; + phase2-auth = "mschapv2"; + }; + connection.autoconnect = true; + connection.autoconnect-priority = 80; + wifi.powersave = 2; + wifi.mode = "infrastructure"; + ipv4.method = "auto"; + # ipv4.dns = "8.8.8.8,8.8.4.4."; + # ipv6.dns = "2001:4860:4860::8888"; + # wifi.mac-address-randomization = "random"; + ipv4.dhcp-send-hostname = false; + # ipv4.dhcp-hostname = "NoName"; + # connection.metered = "yes"; + }; + + school = { + connection.id = "School"; + connection.type = "wifi"; + wifi.ssid = "$school_uuid"; + wifi-security = { + key-mgmt = "wpa-eap"; + }; + "802-1x" = { + eap = "peap;"; + identity = "$school_identity"; + password = "$school_password"; + phase2-auth = "mschapv2"; + }; + connection.autoconnect = true; + connection.autoconnect-priority = 90; + wifi.powersave = 2; + wifi.mode = "infrastructure"; + ipv4.method = "auto"; + # ipv4.dns = "8.8.8.8,8.8.4.4."; + # ipv6.dns = "2001:4860:4860::8888"; + # wifi.mac-address-randomization = "random"; + ipv4.dhcp-send-hostname = false; + # ipv4.dhcp-hostname = "NoName"; + # connection.metered = "yes"; + }; + }; + }; + }; + }; +} diff --git a/common/networking/wireless.nix b/common/networking/wireless.nix new file mode 100644 index 0000000..46389ff --- /dev/null +++ b/common/networking/wireless.nix @@ -0,0 +1,55 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + + options = { + wireless.enable = lib.mkEnableOption "Enables Wifi and adds my networks"; + }; + config = lib.mkIf config.wireless.enable { + sops.templates."wpa_supplicant.conf" = { + content = '' + network={ + } + ''; + path = "/etc/wpa_supplicant.conf"; + }; + sops.secrets."wireless.env" = { }; + networking.wireless.enable = true; + environment.systemPackages = with pkgs; [ wpa_supplicant_gui ]; + networking.wireless.userControlled.enable = true; + networking.wireless.allowAuxiliaryImperativeNetworks = true; + + networking.wireless.secretsFile = config.sops.secrets."wireless.env".path; + networking.wireless.networks = { + "Tycho Station" = { + pskRaw = "ext:home_psk"; + priority = 99; + }; + "CU-Wireless" = { + auth = '' + key_mgmt=WPA-EAP + eap=PEAP + phase2="auth=MSCHAPV2" + identity="glengoodwin" + password=ext:school_password + ''; + priority = 89; + }; + + "eduroam" = { + auth = '' + key_mgmt=WPA-EAP + eap=PEAP + phase2="auth=MSCHAPV2" + identity="ext:eduroam_identity" + password="ext:school_password" + ''; + priority = 79; + }; + }; + }; +} diff --git a/common/networking/zerotier.nix b/common/networking/zerotier.nix new file mode 100644 index 0000000..e474bda --- /dev/null +++ b/common/networking/zerotier.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + inputs, + outputs, + ... +}: +{ + options = { + zerotier.enable = lib.mkEnableOption "Enables zerotier and joins my network"; + }; + config = lib.mkIf config.zerotier.enable { + services.zerotierone = { + joinNetworks = [ + "ebe7fbd445359e9d" + ]; + enable = true; + }; + + networking.extraHosts = '' + 192.168.194.54 graphene.zt + 192.168.191.218 candlekeep.zt + 192.168.191.201 grymforge.zt + ''; + }; +} diff --git a/common/nixos/bluetooth.nix b/common/nixos/bluetooth.nix new file mode 100644 index 0000000..eaff4f0 --- /dev/null +++ b/common/nixos/bluetooth.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + ... +}: { + options = { + bluetooth.enable = lib.mkEnableOption "Enables Bluetooth"; + }; + + config = lib.mkIf config.bluetooth.enable { + services.blueman.enable = true; + hardware.bluetooth = { + enable = true; + powerOnBoot = true; + }; + + services.upower = { + enable = true; + }; + }; +} diff --git a/common/nixos/common.nix b/common/nixos/common.nix new file mode 100644 index 0000000..f3dc8ed --- /dev/null +++ b/common/nixos/common.nix @@ -0,0 +1,78 @@ +{ + config, + lib, + pkgs, + inputs, + outputs, + user, + ... +}: +{ + imports = [ + ./packages.nix + ./users.nix + ./locale.nix + ./documentation.nix + ../../common/style/stylix.nix + ]; + # + security.sudo.extraRules = [ + { + users = [ "gwg313" ]; + commands = [ + { + command = "/run/current-system/sw/bin/nixos-rebuild"; + options = [ "NOPASSWD" ]; + } + ]; + } + ]; + nixpkgs.config = { + allowUnfree = true; + }; + nix = { + settings = { + substituters = [ + "https://cache.nixos.org?priority=10" + "https://hyprland.cachix.org" + "https://nix-community.cachix.org" + "https://cache.garnix.io" + "https://numtide.cachix.org" + ]; + trusted-public-keys = [ + "hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g=" + "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" + ]; + experimental-features = [ + "nix-command" + "flakes" + ]; + auto-optimise-store = true; + trusted-users = [ "${user}" ]; + }; + optimise.automatic = true; + gc = { + automatic = true; + dates = "daily"; + options = "--delete-older-than 14d"; + }; + + }; + + services = { + fstrim.enable = true; + }; + # Disable so comma can be installed + programs.command-not-found.enable = false; + programs.nix-index-database.comma.enable = true; + + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system we e ere taken. It's perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "23.05"; # Did you read the comment? +} diff --git a/common/nixos/default.nix b/common/nixos/default.nix new file mode 100644 index 0000000..8210252 --- /dev/null +++ b/common/nixos/default.nix @@ -0,0 +1,24 @@ +{ lib, pkgs, ... }: +{ + imports = [ + ./common.nix + ./laptop.nix + ./nfs.nix + ./restic.nix + ./ssh/default.nix + ./logrotate.nix + ]; + + laptop.enable = lib.mkDefault false; + nfs.enable = lib.mkDefault false; + restic.enable = lib.mkDefault true; + services.flatpak.enable = true; + systemd.services.flatpak-repo = { + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.flatpak ]; + script = '' + flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo + ''; + }; + # flatpak override --user --socket=wayland md.obsidian.Obsidian (Must run this for obsidian to launch) +} diff --git a/common/nixos/documentation.nix b/common/nixos/documentation.nix new file mode 100644 index 0000000..19d8e1e --- /dev/null +++ b/common/nixos/documentation.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: +{ + environment.systemPackages = [ + pkgs.man-pages + pkgs.man-pages-posix + ]; + documentation = { + dev.enable = true; + man = { + man-db.enable = false; + mandoc.enable = true; + }; + }; + + environment.sessionVariables = { + MANPAGER = "sh -c '${pkgs.gnugrep}/bin/sed -u -e \"s/\\x1B\[[0-9\;]*m//g; s/.\\x08//g\" | ${pkgs.bat}/bin/bat -p -lman'"; + }; +} diff --git a/common/nixos/laptop.nix b/common/nixos/laptop.nix new file mode 100644 index 0000000..d849971 --- /dev/null +++ b/common/nixos/laptop.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + ... +}: +{ + imports = [ + ./bluetooth.nix + # ../networking/wireless.nix + ../networking/networkmanager.nix + ]; + options = { + laptop.enable = lib.mkEnableOption "Enables Laptop options"; + }; + + config = lib.mkIf config.laptop.enable { + # enable's backlight switching + programs.light.enable = true; + + # use TLP for power management + services.tlp.enable = true; + + bluetooth.enable = true; + # wireless.enable = true; + }; +} diff --git a/common/nixos/locale.nix b/common/nixos/locale.nix new file mode 100644 index 0000000..5364945 --- /dev/null +++ b/common/nixos/locale.nix @@ -0,0 +1,26 @@ +{ + config, + lib, + pkgs, + inputs, + outputs, + ... +}: { + # Set your time zone. + time.timeZone = "America/Toronto"; + + # Select internationalisation properties. + i18n.defaultLocale = "en_US.UTF-8"; + + i18n.extraLocaleSettings = { + LC_ADDRESS = "en_US.UTF-8"; + LC_IDENTIFICATION = "en_US.UTF-8"; + LC_MEASUREMENT = "en_US.UTF-8"; + LC_MONETARY = "en_US.UTF-8"; + LC_NAME = "en_US.UTF-8"; + LC_NUMERIC = "en_US.UTF-8"; + LC_PAPER = "en_US.UTF-8"; + LC_TELEPHONE = "en_US.UTF-8"; + LC_TIME = "en_US.UTF-8"; + }; +} diff --git a/common/nixos/logrotate.nix b/common/nixos/logrotate.nix new file mode 100644 index 0000000..734a340 --- /dev/null +++ b/common/nixos/logrotate.nix @@ -0,0 +1,19 @@ +{ + ... +}: +{ + + services.logrotate = { + settings = { + header = { + dateext = true; + }; + + "var/log/audit/audit.log" = { + frequency = "daily"; + rotate = 3; + size = "100k"; + }; + }; + }; +} diff --git a/common/nixos/nfs.nix b/common/nixos/nfs.nix new file mode 100644 index 0000000..7ba3549 --- /dev/null +++ b/common/nixos/nfs.nix @@ -0,0 +1,70 @@ +{ + config, + lib, + inputs, + ... +}: +{ + options = { + nfs.enable = lib.mkEnableOption "Enables NFS and sets up mounts"; + }; + + config = lib.mkIf config.nfs.enable { + fileSystems = { + "/media" = { + device = inputs.secrets.nfs.devices.media; + fsType = "nfs"; + options = [ + "x-systemd.automount" + "noauto" + "x-systemd.after=network-online.target" + "x-systemd.mount-timeout=90" + ]; + }; + + "/books" = { + device = inputs.secrets.nfs.devices.books; + fsType = "nfs"; + options = [ + "x-systemd.automount" + "noauto" + "x-systemd.after=network-online.target" + "x-systemd.mount-timeout=90" + ]; + }; + + "/music" = { + device = inputs.secrets.nfs.devices.music; + fsType = "nfs"; + options = [ + "x-systemd.automount" + "noauto" + "x-systemd.after=network-online.target" + "x-systemd.mount-timeout=90" + ]; + }; + + "/projects" = { + device = inputs.secrets.nfs.devices.projects; + fsType = "nfs"; + options = [ + "x-systemd.automount" + "noauto" + "x-systemd.after=network-online.target" + "x-systemd.mount-timeout=90" + ]; + }; + + "/backups" = { + device = inputs.secrets.nfs.devices.backups; + fsType = "nfs"; + options = [ + "x-systemd.automount" + "noauto" + "x-systemd.after=network-online.target" + "x-systemd.mount-timeout=90" + ]; + }; + }; + }; +} diff --git a/common/nixos/packages.nix b/common/nixos/packages.nix new file mode 100644 index 0000000..b2c84fd --- /dev/null +++ b/common/nixos/packages.nix @@ -0,0 +1,40 @@ +{ + config, + lib, + pkgs, + user, + inputs, + outputs, + ... +}: +{ + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + environment.sessionVariables = { + SSH_AUTH_SOCK = "/run/user/1000/gnupg/S.gpg-agent.ssh"; + }; + + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + alejandra + sops + just + # vim + wget + home-manager + git + nh + nix-output-monitor + nvd + # inputs.superfile.packages.${system}.default + ]; + environment.sessionVariables = { + NH_FLAKE = "/home/${user}/repos/nixos-config"; + }; +} diff --git a/common/nixos/restic.nix b/common/nixos/restic.nix new file mode 100644 index 0000000..cb89774 --- /dev/null +++ b/common/nixos/restic.nix @@ -0,0 +1,35 @@ +{ + config, + lib, + user, + ... +}: +{ + options = { + restic.enable = lib.mkEnableOption "Enables Restic"; + }; + + config = lib.mkIf config.nfs.enable { + sops.secrets.restic_key = { + owner = config.users.users.${user}.name; + }; + + services.restic.backups = { + backups = { + user = "${user}"; + repository = "/backups/grymforge"; + initialize = true; + passwordFile = "${config.sops.secrets.restic_key.path}"; + paths = [ + "/home/${user}/repos" + "/home/${user}/Documents" + "/home/${user}/.local/share/password-store" + ]; + # extraBackupArgs = [ "--exclude-file=/home/gwg313/Documents/Celsus" ]; + timerConfig = { + OnCalendar = "06:40"; + }; + }; + }; + }; +} diff --git a/common/nixos/ssh/default.nix b/common/nixos/ssh/default.nix new file mode 100644 index 0000000..c6f352e --- /dev/null +++ b/common/nixos/ssh/default.nix @@ -0,0 +1,12 @@ +{ lib, ... }: +{ + imports = [ + ./ssh.nix + ./ssh_client.nix + ./ssh_guard.nix + ]; + + ssh_client.enable = lib.mkDefault true; + ssh.enable = lib.mkDefault false; + ssh_guard.enable = lib.mkDefault false; +} diff --git a/common/nixos/ssh/ssh.nix b/common/nixos/ssh/ssh.nix new file mode 100644 index 0000000..273e758 --- /dev/null +++ b/common/nixos/ssh/ssh.nix @@ -0,0 +1,156 @@ +{ + config, + lib, + user, + ... +}: +{ + options = { + ssh.enable = lib.mkEnableOption "enable ssh settings"; + }; + config = lib.mkIf config.ssh.enable { + # https://www.ssh-audit.com/hardening_guides.html + # https://github.com/jtesta/ssh-audit + services.openssh = { + enable = true; + settings = { + ########## Features ########## + + # disallow ssh-agent forwarding to prevent lateral movement + AllowAgentForwarding = false; + + # prevent TCP ports from being forwarded over SSH tunnels + # **please be aware that disabling TCP forwarding does not prevent port forwarding** + # any user with an interactive login shell can spin up his/her own instance of sshd + AllowTcpForwarding = false; + + # prevent StreamLocal (Unix-domain socket) forwarding + AllowStreamLocalForwarding = false; + + # disables all forwarding features + # overrides all other forwarding switches + DisableForwarding = true; + + # disallow remote hosts from connecting to forwarded ports + # i.e. forwarded ports are forced to bind to 127.0.0.1 instad of 0.0.0.0 + GatewayPorts = "no"; + + # prevent tun device forwarding + PermitTunnel = false; + + # suppress MOTD + PrintMotd = false; + + # disable X11 forwarding since it is not necessary + X11Forwarding = false; + + ########## Authentication ########## + + AllowUsers = [ "${user}" ]; + + # Use keys only. Remove if you want to SSH using password (not recommended) + PasswordAuthentication = false; + HostbasedAuthentication = false; + + # enable pubkey authentication + PubkeyAuthentication = true; + + # Forbid root login through SSH. + PermitRootLogin = "no"; + + # nix enables pam by default + # UsePAM = false; + + # challenge-response authentication backend it not configured by default + # therefore, it is set to "no" by default to avoid the use of an unconfigured backend + ChallengeResponseAuthentication = false; + + # set maximum authentication retries to prevent brute force attacks + MaxAuthTries = 3; + + # disallow connecting using empty passwords + PermitEmptyPasswords = false; + + ########## Cryptography ########## + + # explicitly define cryptography algorithms to avoid the use of weak algorithms + # AES CTR modes have been removed to mitigate the Terrapin attack + # https://terrapin-attack.com/ + + Ciphers = [ + "aes256-gcm@openssh.com" + "aes128-gcm@openssh.com" + ]; + Macs = [ + "hmac-sha2-256-etm@openssh.com" + "hmac-sha2-512-etm@openssh.com" + "umac-128-etm@openssh.com" + ]; + KexAlgorithms = [ + "sntrup761x25519-sha512@openssh.com" + "curve25519-sha256" + "curve25519-sha256@libssh.org" + "diffie-hellman-group16-sha512" + "diffie-hellman-group18-sha512" + ]; + + # hostKeyAlgorithms = [ + # "rsa-sha2-512" + # "rsa-sha2-256" + # "ssh-ed25519" + # ]; + + ########## Connection Preferences ########## + + # enforce SSH server to only use SSH protocol version 2 + # SSHv1 contains security issues and should be avoided at all costs + # SSHv1 is disabled by default after OpenSSH 7.0, but this option is + # specified anyways to ensure this configuration file's compatibility + # with older versions of OpenSSH server + Protocol = 2; + + # number of client alive messages sent without client responding + ClientAliveCountMax = 2; + + # send a keepalive message to the client when the session has been idle for 300 seconds + # this prevents/detects connection timeouts + ClientAliveInterval = 300; + + # compression before encryption might cause security issues + Compression = false; + + # prevent SSH trust relationships from allowing lateral movements + IgnoreRhosts = true; + + # log verbosely for addtional information + LogLevel = "VERBOSE"; + + # allow a maximum of two multiplexed sessions over a single TCP connection + MaxSessions = 2; + + # let ClientAliveInterval handle keepalive + TCPKeepAlive = false; + + # disable reverse DNS lookups + # UseDNS = false; + }; + extraConfig = '' + ########## Features ########## + + # accept locale-related environment variables + AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES + AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT + AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE + AcceptEnv XMODIFIERS + + ########## Connection Preferences ########## + # disable reverse DNS lookups + UseDNS no + + ########## Disable GSS ########## + + GSSAPIAuthentication no + ''; + }; + }; +} diff --git a/common/nixos/ssh/ssh_client.nix b/common/nixos/ssh/ssh_client.nix new file mode 100644 index 0000000..ad5fa89 --- /dev/null +++ b/common/nixos/ssh/ssh_client.nix @@ -0,0 +1,86 @@ +{ + config, + lib, + ... +}: +{ + options = { + ssh_client.enable = lib.mkEnableOption "enable ssh client settings"; + }; + config = lib.mkIf config.ssh_client.enable { + programs.ssh = { + # disable unnecessary forwardings + forwardX11 = false; + + # explicitly define cryptography algorithms to avoid the use of weak algorithms + # AES CTR modes have been removed to mitigate the Terrapin attack + # https://terrapin-attack.com/ + ciphers = [ + "aes256-gcm@openssh.com" + "aes128-gcm@openssh.com" + ]; + hostKeyAlgorithms = [ + "ssh-ed25519" + "ssh-ed25519-cert-v01@openssh.com" + "sk-ssh-ed25519@openssh.com" + "sk-ssh-ed25519-cert-v01@openssh.com" + "rsa-sha2-256" + "rsa-sha2-256-cert-v01@openssh.com" + "rsa-sha2-512" + "rsa-sha2-512-cert-v01@openssh.com" + ]; + macs = [ + "hmac-sha2-256-etm@openssh.com" + "hmac-sha2-512-etm@openssh.com" + "umac-128-etm@openssh.com" + ]; + kexAlgorithms = [ + "sntrup761x25519-sha512@openssh.com" + "curve25519-sha256" + "curve25519-sha256@libssh.org" + "diffie-hellman-group16-sha512" + "diffie-hellman-group18-sha512" + ]; + extraConfig = " + # disable unnecessary forwardings + ForwardAgent no + ForwardX11Trusted no + GatewayPorts no + Tunnel no + + # disable unnecessary authentication methods + ChallengeResponseAuthentication no + HostbasedAuthentication no + + # define authentication methods to be used + PasswordAuthentication yes + PubkeyAuthentication yes + PreferredAuthentications publickey,password + + # disable pre-connection compression as it could cause security issues + Compression no + + # in addition to checking a host's hostname, also check the host's IP address + # this provides extra safety against DNS spoofing attacks + CheckHostIP yes + + # ask the user if the user wants to accept the new host's host key + StrictHostKeyChecking ask + + # hash the entries in the known_hosts file to prevent disclosure + # of the file's content + HashKnownHosts yes + + # send a keepalive message to the server when the session has been idle for 60 seconds + # this prevents/detects connection timeouts + ServerAliveInterval 60 + + # increase the number of password retries + NumberOfPasswordPrompts 5 + + # display an ASCII art of the server's host key + VisualHostKey yes + "; + }; + }; +} diff --git a/common/nixos/ssh/ssh_guard.nix b/common/nixos/ssh/ssh_guard.nix new file mode 100644 index 0000000..456040b --- /dev/null +++ b/common/nixos/ssh/ssh_guard.nix @@ -0,0 +1,21 @@ +{ + config, + lib, + ... +}: { + options = { + ssh_guard.enable = lib.mkEnableOption "enable ssh guard"; + }; + config = lib.mkIf config.ssh_guard.enable { + services.sshguard = { + enable = true; + services = [ + "sshd" + ]; + blocktime = 120; + detection_time = 1800; + blacklist_threshold = 120; + blacklist_file = "/var/lib/sshguard/blacklist.db"; + }; + }; +} diff --git a/common/nixos/sysctl/default.nix b/common/nixos/sysctl/default.nix new file mode 100644 index 0000000..afb70c3 --- /dev/null +++ b/common/nixos/sysctl/default.nix @@ -0,0 +1,8 @@ +{ + imports = [ + ./kernel.nix + ./file_system.nix + ./virtualization.nix + ./networking/default.nix + ]; +} diff --git a/common/nixos/sysctl/file_system.nix b/common/nixos/sysctl/file_system.nix new file mode 100644 index 0000000..2cc0586 --- /dev/null +++ b/common/nixos/sysctl/file_system.nix @@ -0,0 +1,41 @@ +{ + config, + pkgs, + ... +}: { + boot.kernel.sysctl = { + # disallow core dumping by SUID/SGID programs + "fs.suid_dumpable" = 0; + + # protect the creation of hard links + # one of the following conditions must be fulfilled + # - the user can only link to files that he or she owns + # - the user must first have read and write access to a file, that he/she wants to link to + "fs.protected_hardlinks" = 1; + + # protect the creation of symbolic links + # one of the following conditions must be fulfilled + # - the process following the symbolic link is the owner of the symbolic link + # - the owner of the directory is also the owner of the symbolic link + "fs.protected_symlinks" = 1; + + # enable extended FIFO protection + "fs.protected_fifos" = 2; + + # similar to protected_fifos, but it avoids writes to an attacker-controlled regular file + "fs.protected_regular" = 2; + + # increase system file descriptor limit + # this value can be up to: + # - 2147483647 (0x7fffffff) on a 32-bit system + # - 9223372036854775807 (0x7fffffffffffffff) on a 64-bit system + # be aware that the Linux kernel documentation suggests that inode-max should be 3-4 times + # larger than this value + "fs.file-max" = 9223372036854775807; + + # increase the amount of files that can be watched + # each file watch handle takes 1080 bytes + # up to 540 MiB of memory will be consumed if all 524288 handles are used + "fs.inotify.max_user_watches" = 524288; + }; +} diff --git a/common/nixos/sysctl/kernel.nix b/common/nixos/sysctl/kernel.nix new file mode 100644 index 0000000..2effb04 --- /dev/null +++ b/common/nixos/sysctl/kernel.nix @@ -0,0 +1,73 @@ +{ + config, + pkgs, + ... +}: +{ + boot.kernel.sysctl = { + # enable ExecShield protection + # 2 enables ExecShield by default unless applications bits are set to disabled + # uncomment on systems without NX/XD protections + # check with: dmesg | grep --color '[NX|DX]*protection' + #kernel.exec-shield = 2 + + # enable ASLR + # turn on protection and randomize stack, vdso page and mmap + randomize brk base address + "kernel.randomize_va_space" = 2; + + # controls the System Request debugging functionality of the kernel + "kernel.sysrq" = 0; + + # controls whether core dumps will append the PID to the core filename + # useful for debugging multi-threaded applications + "kernel.core_uses_pid" = 1; + + # restrict access to kernel address + # kernel pointers printed using %pK will be replaced with 0’s regardless of privileges + "kernel.kptr_restrict" = 2; + + # Ptrace protection using Yama + # - 1: only a parent process can be debugged + # - 2: only admins can use ptrace (CAP_SYS_PTRACE capability required) + # - 3: disables ptrace completely, reboot is required to re-enable ptrace + # If you need ptrace to work, then avoid non-ancestor ptrace access to running processes and their credentials, and use value "1". + # # breaks debuggers + # "kernel.yama.ptrace_scope" = 3; + + # restrict kernel logs to root only + "kernel.dmesg_restrict" = 1; + + # restrict BPF JIT compiler to root only + "kernel.unprivileged_bpf_disabled" = 1; + + # disables kexec as it can be used to livepatch the running kernel + "kernel.kexec_load_disabled" = 1; + + # disable unprivileged user namespaces to decrease attack surface + "kernel.unprivileged_userns_clone" = 0; + + # disable the loading of kernel modules + # this can be used to prevent runtime insertion of malicious modules + # could break the system if enabled within sysctl.conf + # consider setting this manually after system is up + # sudo sysctl -w kernel.modules_disabled=1 + #kernel.modules_disabled = 1 + + # allow for more PIDs + # this value can be up to: + # - 32768 (2^15) on a 32-bit system + # - 4194304 (2^22) on a 64-bit system + "kernel.pid_max" = 4194304; + + # reboot machine after kernel panic + #kernel.panic = 10 + + # restrict perf subsystem usage + "kernel.perf_event_paranoid" = 3; + "kernel.perf_cpu_time_max_percent" = 1; + "kernel.perf_event_max_sample_rate" = 1; + + # prevent unprivileged attackers from loading vulnerable line disciplines with the TIOCSETD ioctl + "dev.tty.ldisc_autoload" = 0; + }; +} diff --git a/common/nixos/sysctl/network.nix b/common/nixos/sysctl/network.nix new file mode 100644 index 0000000..1f13683 --- /dev/null +++ b/common/nixos/sysctl/network.nix @@ -0,0 +1,8 @@ +{ + config, + pkgs, + ... +}: { + boot.kernel.sysctl = { + }; +} diff --git a/common/nixos/sysctl/networking/default.nix b/common/nixos/sysctl/networking/default.nix new file mode 100644 index 0000000..edb4ce2 --- /dev/null +++ b/common/nixos/sysctl/networking/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./ipv4.nix + ./ipv6.nix + ./net.nix + ]; +} diff --git a/common/nixos/sysctl/networking/ipv4.nix b/common/nixos/sysctl/networking/ipv4.nix new file mode 100644 index 0000000..7f50248 --- /dev/null +++ b/common/nixos/sysctl/networking/ipv4.nix @@ -0,0 +1,114 @@ +{ + config, + pkgs, + ... +}: { + boot.kernel.sysctl = { + # enable BBR congestion control + "net.ipv4.tcp_congestion_control" = "bbr"; + + # disallow IPv4 packet forwarding + "net.ipv4.ip_forward" = 0; + + # enable SYN cookies for SYN flooding protection + "net.ipv4.tcp_syncookies" = 1; + + # number of times SYNACKs for a passive TCP connection attempt will be retransmitted + "net.ipv4.tcp_synack_retries" = 5; + + # do not send redirects + "net.ipv4.conf.default.send_redirects" = 0; + "net.ipv4.conf.all.send_redirects" = 0; + + # do not accept packets with SRR option + "net.ipv4.conf.default.accept_source_route" = 0; + "net.ipv4.conf.all.accept_source_route" = 0; + + # enable reverse path source validation (BCP38) + # refer to RFC1812, RFC2827, and BCP38 (http://www.bcp38.info) + "net.ipv4.conf.default.rp_filter" = 1; + "net.ipv4.conf.all.rp_filter" = 1; + + # log packets with impossible addresses to kernel log + "net.ipv4.conf.default.log_martians" = 1; + "net.ipv4.conf.all.log_martians" = 1; + + # do not accept ICMP redirect messages + "net.ipv4.conf.default.accept_redirects" = 0; + "net.ipv4.conf.default.secure_redirects" = 0; + "net.ipv4.conf.all.accept_redirects" = 0; + "net.ipv4.conf.all.secure_redirects" = 0; + + # disable sending and receiving of shared media redirects + # this setting overwrites net.ipv4.conf.all.secure_redirects + # refer to RFC1620 + "net.ipv4.conf.default.shared_media" = 0; + "net.ipv4.conf.all.shared_media" = 0; + + # always use the best local address for announcing local IP via ARP + "net.ipv4.conf.default.arp_announce" = 2; + "net.ipv4.conf.all.arp_announce" = 2; + + # reply only if the target IP address is local address configured on the incoming interface + "net.ipv4.conf.default.arp_ignore" = 1; + "net.ipv4.conf.all.arp_ignore" = 1; + + # drop Gratuitous ARP frames to prevent ARP poisoning + # this can cause issues when ARP proxies are used in the network + "net.ipv4.conf.default.drop_gratuitous_arp" = 1; + "net.ipv4.conf.all.drop_gratuitous_arp" = 1; + + # ignore all ICMP echo requests + #net.ipv4.icmp_echo_ignore_all = 1 + + # ignore all ICMP echo and timestamp requests sent to broadcast/multicast + "net.ipv4.icmp_echo_ignore_broadcasts" = 1; + + # ignore bad ICMP errors + "net.ipv4.icmp_ignore_bogus_error_responses" = 1; + + # mitigate TIME-WAIT Assassination hazards in TCP + # refer to RFC1337 + "net.ipv4.tcp_rfc1337" = 1; + + # disable TCP window scaling + # this makes the host less susceptible to TCP RST DoS attacks + # could drastically reduce throughput if latency is high + #net.ipv4.tcp_window_scaling = 0 + + # increase system IP port limits + "net.ipv4.ip_local_port_range" = "1024 65535"; + + # TCP timestamps could provide protection against wrapped sequence numbers, + # but the host's uptime can be calculated precisely from its timestamps + # it is also possible to differentiate operating systems based on their use of timestamps + # - 0: disable TCP timestamps + # - 1: enable timestamps as defined in RFC1323 and use random offset for + # each connection rather than only using the current time + # - 2: enable timestamps without random offsets + "net.ipv4.tcp_timestamps" = 0; + + # enabling SACK can increase the throughput + # but SACK is commonly exploited and rarely used + "net.ipv4.tcp_sack" = 0; + "net.ipv4.tcp_dsack" = 0; + "net.ipv4.tcp_fack" = 0; + + # divide socket buffer evenly between TCP window size and application + "net.ipv4.tcp_adv_win_scale" = 1; + + # SSR could impact TCP's performance on a fixed-speed network (e.g., wired) + # but it could be helpful on a variable-speed network (e.g., LTE) + # uncomment this if you are on a fixed-speed network + "net.ipv4.tcp_slow_start_after_idle" = 0; + + # enabling MTU probing helps mitigating PMTU blackhole issues + # this may not be desirable on congested networks + "net.ipv4.tcp_mtu_probing" = 1; + "net.ipv4.tcp_base_mss" = 1024; + + # increase memory thresholds to prevent packet dropping + "net.ipv4.tcp_rmem" = "4096 87380 8388608"; + "net.ipv4.tcp_wmem" = "4096 87380 8388608"; + }; +} diff --git a/common/nixos/sysctl/networking/ipv6.nix b/common/nixos/sysctl/networking/ipv6.nix new file mode 100644 index 0000000..693f774 --- /dev/null +++ b/common/nixos/sysctl/networking/ipv6.nix @@ -0,0 +1,56 @@ +{ + config, + pkgs, + ... +}: { + boot.kernel.sysctl = { + # disallow IPv6 packet forwarding + "net.ipv6.conf.default.forwarding" = 0; + "net.ipv6.conf.all.forwarding" = 0; + + # number of Router Solicitations to send until assuming no routers are present + "net.ipv6.conf.default.router_solicitations" = 0; + "net.ipv6.conf.all.router_solicitations" = 0; + + # do not accept Router Preference from RA + "net.ipv6.conf.default.accept_ra_rtr_pref" = 0; + "net.ipv6.conf.all.accept_ra_rtr_pref" = 0; + + # learn prefix information in router advertisement + "net.ipv6.conf.default.accept_ra_pinfo" = 0; + "net.ipv6.conf.all.accept_ra_pinfo" = 0; + + # setting controls whether the system will accept Hop Limit settings from a router advertisement + "net.ipv6.conf.default.accept_ra_defrtr" = 0; + "net.ipv6.conf.all.accept_ra_defrtr" = 0; + + # router advertisements can cause the system to assign a global unicast address to an interface + "net.ipv6.conf.default.autoconf" = 0; + "net.ipv6.conf.all.autoconf" = 0; + + # number of neighbor solicitations to send out per address + "net.ipv6.conf.default.dad_transmits" = 0; + "net.ipv6.conf.all.dad_transmits" = 0; + + # number of global unicast IPv6 addresses can be assigned to each interface + "net.ipv6.conf.default.max_addresses" = 1; + "net.ipv6.conf.all.max_addresses" = 1; + + # enable IPv6 Privacy Extensions (RFC30;41) and prefer the temporary address + #"net.ipv6.conf.default.use_tempaddr" = 2; # Nix sets by default + "net.ipv6.conf.all.use_tempaddr" = 2; + + # ignore IPv6 ICMP redirect messages + "net.ipv6.conf.default.accept_redirects" = 0; + "net.ipv6.conf.all.accept_redirects" = 0; + + # do not accept packets with SRR option + "net.ipv6.conf.default.accept_source_route" = 0; + "net.ipv6.conf.all.accept_source_route" = 0; + + # ignore all ICMPv6 echo requests + #net.ipv6.icmp.echo_ignore_all = 1 + #net.ipv6.icmp.echo_ignore_anycast = 1 + #net.ipv6.icmp.echo_ignore_multicast = 1 + }; +} diff --git a/common/nixos/sysctl/networking/net.nix b/common/nixos/sysctl/networking/net.nix new file mode 100644 index 0000000..fe281dd --- /dev/null +++ b/common/nixos/sysctl/networking/net.nix @@ -0,0 +1,21 @@ +{ + config, + pkgs, + ... +}: { + boot.kernel.sysctl = { + # increase the maximum length of processor input queues + "net.core.netdev_max_backlog" = 250000; + + # enable BPF JIT hardening for all users + # this trades off performance, but can mitigate JIT spraying + "net.core.bpf_jit_harden" = 2; + + # increase TCP max buffer size setable using setsockopt() + "net.core.rmem_max" = 8388608; + "net.core.wmem_max" = 8388608; + "net.core.rmem_default" = 8388608; + "net.core.wmem_default" = 8388608; + #net.core.optmem_max = 40960 + }; +} diff --git a/common/nixos/sysctl/virtualization.nix b/common/nixos/sysctl/virtualization.nix new file mode 100644 index 0000000..073ca9b --- /dev/null +++ b/common/nixos/sysctl/virtualization.nix @@ -0,0 +1,18 @@ +{ + config, + pkgs, + ... +}: { + boot.kernel.sysctl = { + # do not allow mmap in lower addresses + "vm.mmap_min_addr" = 65536; + + # improve mmap ASLR effectiveness + "vm.mmap_rnd_bits" = 32; + "vm.mmap_rnd_compat_bits" = 16; + + # prevent unprivileged users from accessing userfaultfd + # restricts syscall to the privileged users or the CAP_SYS_PTRACE capability + "vm.unprivileged_userfaultfd" = 0; + }; +} diff --git a/common/nixos/tuigreet.nix b/common/nixos/tuigreet.nix new file mode 100644 index 0000000..5114705 --- /dev/null +++ b/common/nixos/tuigreet.nix @@ -0,0 +1,27 @@ +{ pkgs, ... }: +{ + services.greetd = { + enable = true; + settings = { + default_session = { + command = "${pkgs.greetd.tuigreet}/bin/tuigreet --remember --asterisks --container-padding 2 --time --time-format '%I:%M %p | %a • %h | %F' --cmd Hyprland"; + user = "greeter"; + }; + }; + }; + + environment.systemPackages = with pkgs; [ greetd.tuigreet ]; + + systemd.services.greetd.serviceConfig = { + Type = "idle"; + StandardInput = "tty"; + StandardOutput = "tty"; + StandardError = "journal"; + TTYReset = true; + TTYVHangup = true; + TTYVTDisallocate = true; + }; + + systemd.extraConfig = "DefaultTimeoutStopSec=10s"; + +} diff --git a/common/nixos/users.nix b/common/nixos/users.nix new file mode 100644 index 0000000..b9d8fba --- /dev/null +++ b/common/nixos/users.nix @@ -0,0 +1,27 @@ +{ + config, + lib, + pkgs, + inputs, + outputs, + ... +}: +{ + # Define a user account. Don't forget to set a password with 'passwd'. + programs.zsh.enable = true; + users.users.gwg313 = { + isNormalUser = true; + description = "Glen Goodwin"; + extraGroups = [ + "networkmanager" + "wheel" + "video" + "docker" + "audio" + "wireshark" + ]; + shell = pkgs.zsh; + # shell = pkgs.nushell; + uid = 1000; + }; +} diff --git a/common/nixos/variables-config.nix b/common/nixos/variables-config.nix new file mode 100644 index 0000000..e7cfce2 --- /dev/null +++ b/common/nixos/variables-config.nix @@ -0,0 +1,9 @@ +{ lib, ... }: +{ + options = { + var = lib.mkOption { + type = lib.types.attrs; + default = { }; + }; + }; +} diff --git a/common/style/stylix.nix b/common/style/stylix.nix new file mode 100644 index 0000000..1334e62 --- /dev/null +++ b/common/style/stylix.nix @@ -0,0 +1,42 @@ +{ pkgs, ... }: +{ + stylix = { + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-latte.yaml"; + # base16Scheme = "${pkgs.base16-schemes}/share/themes/atelier-sulphurpool-light.yaml"; + # image = ./wallpaper.jpg; + image = ../../wallpapers/nixos-wallpaper-catppuccin-latte.png; + #polarity = "dark"; + autoEnable = true; + enable = true; + + opacity.terminal = 1.0; + fonts.sizes.terminal = 18; + + fonts = { + serif = { + package = pkgs.lmodern; + name = "Latin Modern Roman"; + }; + + sansSerif = { + package = pkgs.inter; + name = "Inter"; + }; + + monospace = { + package = pkgs.fira-code; + name = "Fire Code"; + }; + + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; + }; + }; + cursor = { + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Classic"; + size = 20; + }; + }; +} diff --git a/common/style/vars/vars.nix b/common/style/vars/vars.nix new file mode 100644 index 0000000..d059ef8 --- /dev/null +++ b/common/style/vars/vars.nix @@ -0,0 +1,97 @@ +{ + lib, + pkgs, + config, + ... +}: +{ + options.theme = lib.mkOption { + type = lib.types.attrs; + default = { + rounding = 20; + gaps-in = 10; + gaps-out = 10 * 2; + active-opacity = 0.96; + inactive-opacity = 0.92; + blur = true; + border-size = 3; + animation-speed = "fast"; # "fast" | "medium" | "slow" + fetch = "none"; # "nerdfetch" | "neofetch" | "pfetch" | "none" + textColorOnWallpaper = config.lib.stylix.colors.base01; # Color of the text displayed on the wallpaper (Lockscreen, display manager, ...) + + bar = { + # Hyprpanel + position = "top"; # "top" | "bottom" + transparent = true; + transparentButtons = false; + floating = true; + }; + }; + description = "Theme configuration options"; + }; + + config.stylix = { + enable = true; + + # See https://tinted-theming.github.io/tinted-gallery/ for more schemes + base16Scheme = "${pkgs.base16-schemes}/share/themes/catppuccin-latte.yaml"; + # base16Scheme = { + # base00 = "09090B"; # Default Background + # base01 = "1c1e1f"; # Lighter Background (Used for status bars, line number and folding marks) + # base02 = "313244"; # Selection Background + # base03 = "45475a"; # Comments, Invisibles, Line Highlighting + # base04 = "585b70"; # Dark Foreground (Used for status bars) + # base05 = "cdd6f4"; # Default Foreground, Caret, Delimiters, Operators + # base06 = "f5e0dc"; # Light Foreground (Not often used) + # base07 = "b4befe"; # Light Background (Not often used) + # base08 = "f38ba8"; # Variables, XML Tags, Markup Link Text, Markup Lists, Diff Deleted + # base09 = "fab387"; # Integers, Boolean, Constants, XML Attributes, Markup Link Url + # base0A = "f9e2af"; # Classes, Markup Bold, Search Text Background + # base0B = "a6e3a1"; # Strings, Inherited Class, Markup Code, Diff Inserted + # base0C = "94e2d5"; # Support, Regular Expressions, Escape Characters, Markup Quotes + # base0D = "c5afd4"; # Functions, Methods, Attribute IDs, Headings, Accent color + # base0E = "cba6f7"; # Keywords, Storage, Selector, Markup Italic, Diff Changed + # base0F = "f2cdcd"; # Deprecated, Opening/Closing Embedded Language Tags, e.g. + # }; + + cursor = { + name = "phinger-cursors-light"; + package = pkgs.phinger-cursors; + size = 20; + }; + + fonts = { + serif = { + package = pkgs.lmodern; + name = "Latin Modern Roman"; + }; + + sansSerif = { + package = pkgs.inter; + name = "Inter"; + }; + + monospace = { + package = pkgs.fira-code; + name = "Fire Code"; + }; + + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; + }; + sizes = { + applications = 13; + desktop = 13; + popups = 13; + terminal = 13; + }; + }; + + polarity = "light"; + image = pkgs.fetchurl { + url = "https://raw.githubusercontent.com/anotherhadi/awesome-wallpapers/refs/heads/main/app/static/wallpapers/black-and-white-forest_minimalist_black-and-white.png"; + sha256 = "sha256-MOlLRQonZ6UAaSJlysjL8snxnMrSFH9VOLrjXaU82Kw="; + }; + }; +} diff --git a/common/style/wallpaper.jpg b/common/style/wallpaper.jpg new file mode 100644 index 0000000..4d55dec Binary files /dev/null and b/common/style/wallpaper.jpg differ diff --git a/common/virtualization/default.nix b/common/virtualization/default.nix new file mode 100644 index 0000000..d6e49ee --- /dev/null +++ b/common/virtualization/default.nix @@ -0,0 +1,18 @@ +{ + config, + pkgs, + user, + lib, + ... +}: +{ + imports = [ + ./libvirt.nix + ./podman.nix + ./kubernetes.nix + ]; + + libvirt.enable = lib.mkDefault true; + podman.enable = lib.mkDefault true; + kubernetes.enable = lib.mkDefault true; +} diff --git a/common/virtualization/kubernetes.nix b/common/virtualization/kubernetes.nix new file mode 100644 index 0000000..e0025f7 --- /dev/null +++ b/common/virtualization/kubernetes.nix @@ -0,0 +1,24 @@ +{ + config, + pkgs, + lib, + ... +}: +{ + options = { + kubernetes.enable = lib.mkEnableOption "Enables Kubernetes and tooling"; + }; + config = lib.mkIf config.kubernetes.enable { + environment.systemPackages = with pkgs; [ + argocd # Declarative, GitOps continuous delivery tool for Kubernetes. + k3d # Lightweight utility to run Kubernetes clusters using Docker. + k9s # Kubernetes CLI to visually navigate and manage resources in clusters. + kind # Kubernetes IN Docker: Tool for running local Kubernetes clusters using Docker container nodes. + kubectl # Kubernetes command-line tool for interacting with clusters. + kubectx # Switch between Kubernetes contexts and namespaces with ease. + kubernetes-helm # Package manager for Kubernetes applications, simplifying deployment and management. + minikube # Local Kubernetes cluster for easy testing and development. + stern # Multi-container log tailing and streaming for Kubernetes. + ]; + }; +} diff --git a/common/virtualization/libvirt.nix b/common/virtualization/libvirt.nix new file mode 100644 index 0000000..f4f22cf --- /dev/null +++ b/common/virtualization/libvirt.nix @@ -0,0 +1,74 @@ +{ + config, + pkgs, + user, + lib, + ... +}: +{ + options = { + libvirt.enable = lib.mkEnableOption "Enables Libvirt"; + }; + config = lib.mkIf config.libvirt.enable { + networking.firewall.trustedInterfaces = [ "virbr0" ]; + boot.kernelModules = [ "kvm-amd" ]; + environment.systemPackages = with pkgs; [ + virt-manager + virtiofsd + # vagrant + ]; + + users.users.${user} = { + extraGroups = [ + "libvirtd" + "qemu-libvirtd" + "kvm" + ]; + }; + # Allow VM to run as non-root without ulimit + security.pam.loginLimits = [ + { + domain = "${user}"; + type = "soft"; + item = "memlock"; + value = "20000000"; + } + { + domain = "${user}"; + type = "hard"; + item = "memlock"; + value = "20000000"; + } + ]; + + virtualisation.libvirtd = { + enable = true; + # qemu.ovmf.enable = true; + # qemu.runAsRoot = false; + onBoot = "ignore"; + onShutdown = "shutdown"; + qemu = { + package = pkgs.qemu_kvm; + runAsRoot = true; + swtpm.enable = true; + ovmf = { + enable = true; + packages = [ + (pkgs.OVMF.override { + secureBoot = true; + tpmSupport = true; + }).fd + ]; + }; + }; + }; + + users.extraGroups.libvirtd.members = [ "${user}" ]; + + # virtualisation.virtualbox.host.enable = true; + # users.extraGroups.vboxusers.members = [ "${user}" ]; + # virtualisation.virtualbox.host.enableExtensionPack = true; + # virtualisation.virtualbox.guest.enable = true; + # virtualisation.virtualbox.guest.dragAndDrop = true; + }; +} diff --git a/common/virtualization/libvirt.sync-conflict-20250112-184217-N2TYFZ4.nix b/common/virtualization/libvirt.sync-conflict-20250112-184217-N2TYFZ4.nix new file mode 100644 index 0000000..9fd9c81 --- /dev/null +++ b/common/virtualization/libvirt.sync-conflict-20250112-184217-N2TYFZ4.nix @@ -0,0 +1,27 @@ +{ + config, + pkgs, + user, + lib, + ... +}: +{ + options = { + libvirt.enable = lib.mkEnableOption "Enables Libvirt"; + }; + config = lib.mkIf config.libvirt.enable { + boot.kernelModules = [ "kvm-amd" ]; + environment.systemPackages = with pkgs; [ + virt-manager + # vagrant + ]; + virtualisation.libvirtd.enable = true; + users.extraGroups.libvirtd.members = [ "${user}" ]; + + virtualisation.virtualbox.host.enable = true; + users.extraGroups.vboxusers.members = [ "user-with-access-to-virtualbox" ]; + virtualisation.virtualbox.host.enableExtensionPack = true; + virtualisation.virtualbox.guest.enable = true; + virtualisation.virtualbox.guest.dragAndDrop = true; + }; +} diff --git a/common/virtualization/podman.nix b/common/virtualization/podman.nix new file mode 100644 index 0000000..a09f7f3 --- /dev/null +++ b/common/virtualization/podman.nix @@ -0,0 +1,35 @@ +{ + pkgs, + lib, + config, + ... +}: { + options = { + podman.enable = lib.mkEnableOption "Enables podman and installs container tools"; + }; + + config = lib.mkIf config.podman.enable { + virtualisation = { + podman = { + enable = true; + + # Create a `docker` alias for podman, to use it as a drop-in replacement + dockerCompat = true; + + # Required for containers under podman-compose to be able to talk to each other. + defaultNetwork.settings.dns_enabled = true; + }; + }; + + environment.systemPackages = with pkgs; [ + buildah # Tool for building OCI (Open Container Initiative) and Docker container images. + distrobox # Lightweight utility for running Linux distributions in containers. + dive # A tool for exploring a Docker image, allowing inspection of layer contents. + grype # A vulnerability scanner for container images and filesystems. + hadolint # Dockerfile linter to analyze and enforce best practices in containerization. + podman-compose # Podman plugin for managing multi-container applications. + podman-tui # Text-based user interface (TUI) for Podman, facilitating container management. + syft # Open-source tool for scanning and analyzing container images for software composition and vulnerabilities. + ]; + }; +} diff --git a/devenv.lock b/devenv.lock deleted file mode 100644 index 43b0105..0000000 --- a/devenv.lock +++ /dev/null @@ -1,103 +0,0 @@ -{ - "nodes": { - "devenv": { - "locked": { - "dir": "src/modules", - "lastModified": 1750529628, - "owner": "cachix", - "repo": "devenv", - "rev": "cee0466541d357356b8c1ee0a61f3e0b94c7a54e", - "type": "github" - }, - "original": { - "dir": "src/modules", - "owner": "cachix", - "repo": "devenv", - "type": "github" - } - }, - "flake-compat": { - "flake": false, - "locked": { - "lastModified": 1747046372, - "owner": "edolstra", - "repo": "flake-compat", - "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", - "type": "github" - }, - "original": { - "owner": "edolstra", - "repo": "flake-compat", - "type": "github" - } - }, - "git-hooks": { - "inputs": { - "flake-compat": "flake-compat", - "gitignore": "gitignore", - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1749636823, - "owner": "cachix", - "repo": "git-hooks.nix", - "rev": "623c56286de5a3193aa38891a6991b28f9bab056", - "type": "github" - }, - "original": { - "owner": "cachix", - "repo": "git-hooks.nix", - "type": "github" - } - }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "git-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1750441195, - "owner": "cachix", - "repo": "devenv-nixpkgs", - "rev": "0ceffe312871b443929ff3006960d29b120dc627", - "type": "github" - }, - "original": { - "owner": "cachix", - "ref": "rolling", - "repo": "devenv-nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "devenv": "devenv", - "git-hooks": "git-hooks", - "nixpkgs": "nixpkgs", - "pre-commit-hooks": [ - "git-hooks" - ] - } - } - }, - "root": "root", - "version": 7 -} diff --git a/devenv.nix b/devenv.nix deleted file mode 100644 index bcd2d5d..0000000 --- a/devenv.nix +++ /dev/null @@ -1,96 +0,0 @@ -{ - pkgs, - lib, - config, - inputs, - ... -}: { - # https://devenv.sh/basics/ - env.GREET = "devenv"; - env = { - }; - - # https://devenv.sh/packages/ - packages = with pkgs; [ - kubectl - talosctl - kubeseal - kubeconform - yamllint - shellcheck - gitleaks - yamlfmt - ]; - - # https://devenv.sh/languages/ - # languages.rust.enable = true; - - # https://devenv.sh/processes/ - # processes.cargo-watch.exec = "cargo-watch"; - - # https://devenv.sh/services/ - # services.postgres.enable = true; - - # https://devenv.sh/scripts/ - scripts.hello.exec = '' - echo hello from $GREET - ''; - - enterShell = '' - hello - git --version - ''; - - # https://devenv.sh/tasks/ - # tasks = { - # "myproj:setup".exec = "mytool build"; - # "devenv:enterShell".after = [ "myproj:setup" ]; - # }; - - # https://devenv.sh/tests/ - enterTest = '' - echo "Running tests" - git --version | grep --color=auto "${pkgs.git.version}" - ''; - - # https://devenv.sh/pre-commit-hooks/ - # git-hooks.hooks = { - # check-yaml.enable = true; - # end-of-file-fixer.enable = true; - # trim-trailing-whitespace.enable = true; - # yamlfmt = { - # enable = true; - # entry = "yamlfmt"; - # args = ["-in-place"]; - # files = "\\.ya?ml$"; - # language = "system"; - # }; - # yamllint.enable = true; - # shellcheck.enable = true; - # - # kubeconform = { - # enable = true; - # entry = "kubeconform"; - # args = [ - # "-strict" - # "-summary" - # "-ignore-missing-schemas" - # "-schema-location" - # "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/{{.ResourceKind}}-{{.ResourceAPIVersion}}.json" - # "-schema-location" - # "default" - # ]; - # files = "\\.ya?ml$"; - # }; - # - # gitleaks = { - # enable = true; - # entry = "gitleaks detect --no-git -v --redact"; - # language = "system"; - # pass_filenames = false; - # }; - # }; - # pre-commit.hooks.shellcheck.enable = true; - - # See full reference at https://devenv.sh/reference/options/ -} diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..415eebb --- /dev/null +++ b/flake.lock @@ -0,0 +1,2615 @@ +{ + "nodes": { + "ags": { + "inputs": { + "astal": "astal", + "gnim": "gnim", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1751452620, + "narHash": "sha256-o06N/D80Epywtlg04PiP8gFl/fdVDocIZeET15v1pl0=", + "owner": "Aylur", + "repo": "ags", + "rev": "7b06a791969a83c7fe0fda4333fb82db186e1c57", + "type": "github" + }, + "original": { + "owner": "Aylur", + "repo": "ags", + "type": "github" + } + }, + "aquamarine": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1750974272, + "narHash": "sha256-VaeQzSzekMvP+/OhwNZP4kzs4paWk5+20N0MFLTn+cs=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "dd921421391e75793d0cc674dc15eca16b46a089", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "aquamarine_2": { + "inputs": { + "hyprutils": [ + "hyprspace", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprspace", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1745357003, + "narHash": "sha256-jYwzQkv1r7HN/4qrAuKp+NR4YYNp2xDrOX5O9YVqkWo=", + "owner": "hyprwm", + "repo": "aquamarine", + "rev": "a19cf76ee1a15c1c12083fa372747ce46387289f", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "aquamarine", + "type": "github" + } + }, + "astal": { + "inputs": { + "nixpkgs": [ + "ags", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751126708, + "narHash": "sha256-AodIKw7TmI7rHVcOfEsO82stupMYIMVQeLAUQfVxnkU=", + "owner": "aylur", + "repo": "astal", + "rev": "ac90f09385a2295da9fdc108aaba4a317aaeacc7", + "type": "github" + }, + "original": { + "owner": "aylur", + "repo": "astal", + "type": "github" + } + }, + "base16": { + "inputs": { + "fromYaml": "fromYaml" + }, + "locked": { + "lastModified": 1746562888, + "narHash": "sha256-YgNJQyB5dQiwavdDFBMNKk1wyS77AtdgDk/VtU6wEaI=", + "owner": "SenchoPens", + "repo": "base16.nix", + "rev": "806a1777a5db2a1ef9d5d6f493ef2381047f2b89", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "base16.nix", + "type": "github" + } + }, + "base16-fish": { + "flake": false, + "locked": { + "lastModified": 1622559957, + "narHash": "sha256-PebymhVYbL8trDVVXxCvZgc0S5VxI7I1Hv4RMSquTpA=", + "owner": "tomyun", + "repo": "base16-fish", + "rev": "2f6dd973a9075dabccd26f1cded09508180bf5fe", + "type": "github" + }, + "original": { + "owner": "tomyun", + "repo": "base16-fish", + "type": "github" + } + }, + "base16-helix": { + "flake": false, + "locked": { + "lastModified": 1748408240, + "narHash": "sha256-9M2b1rMyMzJK0eusea0x3lyh3mu5nMeEDSc4RZkGm+g=", + "owner": "tinted-theming", + "repo": "base16-helix", + "rev": "6c711ab1a9db6f51e2f6887cc3345530b33e152e", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-helix", + "type": "github" + } + }, + "base16-vim": { + "flake": false, + "locked": { + "lastModified": 1732806396, + "narHash": "sha256-e0bpPySdJf0F68Ndanwm+KWHgQiZ0s7liLhvJSWDNsA=", + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-vim", + "rev": "577fe8125d74ff456cf942c733a85d769afe58b7", + "type": "github" + } + }, + "cachix": { + "inputs": { + "devenv": [ + "devenv" + ], + "flake-compat": [ + "devenv" + ], + "git-hooks": [ + "devenv", + "git-hooks" + ], + "nixpkgs": [ + "devenv", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748883665, + "narHash": "sha256-R0W7uAg+BLoHjMRMQ8+oiSbTq8nkGz5RDpQ+ZfxxP3A=", + "owner": "cachix", + "repo": "cachix", + "rev": "f707778d902af4d62d8dd92c269f8e70de09acbe", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "latest", + "repo": "cachix", + "type": "github" + } + }, + "colmena": { + "inputs": { + "flake-compat": "flake-compat", + "flake-utils": "flake-utils", + "nix-github-actions": "nix-github-actions", + "nixpkgs": "nixpkgs_2", + "stable": "stable" + }, + "locked": { + "lastModified": 1751144689, + "narHash": "sha256-cgIntaqhcm62V1KU6GmrAGpHpahT4UExEWW2ryS02ZU=", + "owner": "zhaofengli", + "repo": "colmena", + "rev": "3ceec72cfb396a8a8de5fe96a9d75a9ce88cc18e", + "type": "github" + }, + "original": { + "owner": "zhaofengli", + "repo": "colmena", + "type": "github" + } + }, + "devenv": { + "inputs": { + "cachix": "cachix", + "flake-compat": "flake-compat_2", + "git-hooks": "git-hooks", + "nix": "nix", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751418294, + "narHash": "sha256-9uNvQpop5vZiDD/zIacpXKLAiFV1TfkDGks39tcRKgg=", + "owner": "cachix", + "repo": "devenv", + "rev": "ea17286a36947f6702ce21a18677006dc1e01ffd", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "main", + "repo": "devenv", + "type": "github" + } + }, + "firefox-gnome-theme": { + "flake": false, + "locked": { + "lastModified": 1748383148, + "narHash": "sha256-pGvD/RGuuPf/4oogsfeRaeMm6ipUIznI2QSILKjKzeA=", + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "rev": "4eb2714fbed2b80e234312611a947d6cb7d70caf", + "type": "github" + }, + "original": { + "owner": "rafaelmardojai", + "repo": "firefox-gnome-theme", + "type": "github" + } + }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1650374568, + "narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "b4a34015c698c7793d592d66adbab377907a2be8", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_2": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_3": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_4": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_5": { + "locked": { + "lastModified": 1733328505, + "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=", + "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec", + "revCount": 69, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.1.0/01948eb7-9cba-704f-bbf3-3fa956735b52/source.tar.gz?rev=ff81ac966bb2cae68946d5ed5fc4994f96d0ffec&revCount=69" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz" + } + }, + "flake-compat_6": { + "flake": false, + "locked": { + "lastModified": 1696426674, + "narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_7": { + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-compat_8": { + "flake": false, + "locked": { + "lastModified": 1747046372, + "narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": [ + "devenv", + "nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733312601, + "narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1749398372, + "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_3": { + "inputs": { + "nixpkgs-lib": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749398372, + "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_4": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib_2" + }, + "locked": { + "lastModified": 1749398372, + "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-parts_5": { + "inputs": { + "nixpkgs-lib": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "locked": { + "lastModified": 1659877975, + "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_4" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_6" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "inputs": { + "systems": "systems_9" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "fromYaml": { + "flake": false, + "locked": { + "lastModified": 1731966426, + "narHash": "sha256-lq95WydhbUTWig/JpqiB7oViTcHFP8Lv41IGtayokA8=", + "owner": "SenchoPens", + "repo": "fromYaml", + "rev": "106af9e2f715e2d828df706c386a685698f3223b", + "type": "github" + }, + "original": { + "owner": "SenchoPens", + "repo": "fromYaml", + "type": "github" + } + }, + "git-hooks": { + "inputs": { + "flake-compat": [ + "devenv", + "flake-compat" + ], + "gitignore": "gitignore", + "nixpkgs": [ + "devenv", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749636823, + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "623c56286de5a3193aa38891a6991b28f9bab056", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "git-hooks_2": { + "inputs": { + "flake-compat": [ + "stylix", + "flake-compat" + ], + "gitignore": "gitignore_5", + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1747372754, + "narHash": "sha256-2Y53NGIX2vxfie1rOW0Qb86vjRZ7ngizoo+bnXU9D9k=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "80479b6ec16fefd9c1db3ea13aeb038c60530f46", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "devenv", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_2": { + "inputs": { + "nixpkgs": [ + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_3": { + "inputs": { + "nixpkgs": [ + "hyprspace", + "hyprland", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_4": { + "inputs": { + "nixpkgs": [ + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gitignore_5": { + "inputs": { + "nixpkgs": [ + "stylix", + "git-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709087332, + "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, + "gnim": { + "flake": false, + "locked": { + "lastModified": 1751120710, + "narHash": "sha256-sT1ILM8m1QG8CeMmqLHhW/8T/MzUq3JL9jO3V7FMa4w=", + "owner": "aylur", + "repo": "gnim", + "rev": "5d2b734be452e2819f3a7313dbb34fa43c23e5d9", + "type": "github" + }, + "original": { + "owner": "aylur", + "repo": "gnim", + "type": "github" + } + }, + "gnome-shell": { + "flake": false, + "locked": { + "lastModified": 1748186689, + "narHash": "sha256-UaD7Y9f8iuLBMGHXeJlRu6U1Ggw5B9JnkFs3enZlap0=", + "owner": "GNOME", + "repo": "gnome-shell", + "rev": "8c88f917db0f1f0d80fa55206c863d3746fa18d0", + "type": "github" + }, + "original": { + "owner": "GNOME", + "ref": "48.2", + "repo": "gnome-shell", + "type": "github" + } + }, + "gomod2nix": { + "inputs": { + "flake-utils": [ + "superfile", + "flake-utils" + ], + "nixpkgs": [ + "superfile", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1745875161, + "narHash": "sha256-0YkWCS13jpoo3+sX/3kcgdxBNt1VZTmvF+FhZb4rFKI=", + "owner": "nix-community", + "repo": "gomod2nix", + "rev": "2cbd7fdd6eeab65c494cc426e18f4e4d2a5e35c0", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "gomod2nix", + "type": "github" + } + }, + "home-manager": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751429452, + "narHash": "sha256-4s5vRtaqdNhVBnbOWOzBNKrRa0ShQTLoEPjJp3joeNI=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "df12269039dcf752600b1bcc176bacf2786ec384", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "home-manager", + "type": "github" + } + }, + "home-manager_2": { + "inputs": { + "nixpkgs": [ + "stylix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748737919, + "narHash": "sha256-5kvBbLYdp+n7Ftanjcs6Nv+UO6sBhelp6MIGJ9nWmjQ=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "5675a9686851d9626560052a032c4e14e533c1fa", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, + "hyprcursor": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1749155331, + "narHash": "sha256-XR9fsI0zwLiFWfqi/pdS/VD+YNorKb3XIykgTg4l1nA=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "45fcc10b4c282746d93ec406a740c43b48b4ef80", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprcursor_2": { + "inputs": { + "hyprlang": [ + "hyprspace", + "hyprland", + "hyprlang" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1745948457, + "narHash": "sha256-lzTV10FJTCGNtMdgW5YAhCAqezeAzKOd/97HbQK8GTU=", + "owner": "hyprwm", + "repo": "hyprcursor", + "rev": "ac903e80b33ba6a88df83d02232483d99f327573", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprcursor", + "type": "github" + } + }, + "hyprgraphics": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1750621377, + "narHash": "sha256-8u6b5oAdX0rCuoR8wFenajBRmI+mzbpNig6hSCuWUzE=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "b3d628d01693fb9bb0a6690cd4e7b80abda04310", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprgraphics_2": { + "inputs": { + "hyprutils": [ + "hyprspace", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1745015490, + "narHash": "sha256-apEJ9zoSzmslhJ2vOKFcXTMZLUFYzh1ghfB6Rbw3Low=", + "owner": "hyprwm", + "repo": "hyprgraphics", + "rev": "60754910946b4e2dc1377b967b7156cb989c5873", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprgraphics", + "type": "github" + } + }, + "hyprland": { + "inputs": { + "aquamarine": "aquamarine", + "hyprcursor": "hyprcursor", + "hyprgraphics": "hyprgraphics", + "hyprland-protocols": "hyprland-protocols", + "hyprland-qtutils": "hyprland-qtutils", + "hyprlang": "hyprlang", + "hyprutils": "hyprutils", + "hyprwayland-scanner": "hyprwayland-scanner", + "nixpkgs": "nixpkgs_4", + "pre-commit-hooks": "pre-commit-hooks", + "systems": "systems", + "xdph": "xdph" + }, + "locked": { + "lastModified": 1751404714, + "narHash": "sha256-U2EbKyeRJmJp54AxAt426vVdznrMkCgUiGuv0OSnPJs=", + "ref": "refs/heads/main", + "rev": "90c8609cbb5ae7b488d7b14b4dfb3ec9585ed2b7", + "revCount": 6239, + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://github.com/hyprwm/Hyprland" + } + }, + "hyprland-protocols": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1749046714, + "narHash": "sha256-kymV5FMnddYGI+UjwIw8ceDjdeg7ToDVjbHCvUlhn14=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "613878cb6f459c5e323aaafe1e6f388ac8a36330", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-protocols_2": { + "inputs": { + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1743714874, + "narHash": "sha256-yt8F7NhMFCFHUHy/lNjH/pjZyIDFNk52Q4tivQ31WFo=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "3a5c2bda1c1a4e55cc1330c782547695a93f05b2", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland-qt-support": { + "inputs": { + "hyprlang": [ + "hyprland", + "hyprland-qtutils", + "hyprlang" + ], + "nixpkgs": [ + "hyprland", + "hyprland-qtutils", + "nixpkgs" + ], + "systems": [ + "hyprland", + "hyprland-qtutils", + "systems" + ] + }, + "locked": { + "lastModified": 1749154592, + "narHash": "sha256-DO7z5CeT/ddSGDEnK9mAXm1qlGL47L3VAHLlLXoCjhE=", + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "rev": "4c8053c3c888138a30c3a6c45c2e45f5484f2074", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "type": "github" + } + }, + "hyprland-qt-support_2": { + "inputs": { + "hyprlang": "hyprlang_2", + "nixpkgs": [ + "hyprpolkitagent", + "nixpkgs" + ], + "systems": [ + "hyprpolkitagent", + "systems" + ] + }, + "locked": { + "lastModified": 1749154592, + "narHash": "sha256-DO7z5CeT/ddSGDEnK9mAXm1qlGL47L3VAHLlLXoCjhE=", + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "rev": "4c8053c3c888138a30c3a6c45c2e45f5484f2074", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "type": "github" + } + }, + "hyprland-qt-support_3": { + "inputs": { + "hyprlang": [ + "hyprspace", + "hyprland", + "hyprland-qtutils", + "hyprlang" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "hyprland-qtutils", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "hyprland-qtutils", + "systems" + ] + }, + "locked": { + "lastModified": 1737634706, + "narHash": "sha256-nGCibkfsXz7ARx5R+SnisRtMq21IQIhazp6viBU8I/A=", + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "rev": "8810df502cdee755993cb803eba7b23f189db795", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qt-support", + "type": "github" + } + }, + "hyprland-qtutils": { + "inputs": { + "hyprland-qt-support": "hyprland-qt-support", + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprland-qtutils", + "hyprlang", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1750371812, + "narHash": "sha256-D868K1dVEACw17elVxRgXC6hOxY+54wIEjURztDWLk8=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "b13c7481e37856f322177010bdf75fccacd1adc8", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprland-qtutils_2": { + "inputs": { + "hyprland-qt-support": "hyprland-qt-support_3", + "hyprlang": [ + "hyprspace", + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprspace", + "hyprland", + "hyprland-qtutils", + "hyprlang", + "hyprutils" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1745951494, + "narHash": "sha256-2dModE32doiyQMmd6EDAQeZnz+5LOs6KXyE0qX76WIg=", + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "rev": "4be1d324faf8d6e82c2be9f8510d299984dfdd2e", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-qtutils", + "type": "github" + } + }, + "hyprland_2": { + "inputs": { + "aquamarine": "aquamarine_2", + "hyprcursor": "hyprcursor_2", + "hyprgraphics": "hyprgraphics_2", + "hyprland-protocols": "hyprland-protocols_2", + "hyprland-qtutils": "hyprland-qtutils_2", + "hyprlang": "hyprlang_3", + "hyprutils": "hyprutils_4", + "hyprwayland-scanner": "hyprwayland-scanner_2", + "nixpkgs": "nixpkgs_6", + "pre-commit-hooks": "pre-commit-hooks_2", + "systems": [ + "hyprspace", + "systems" + ], + "xdph": "xdph_2" + }, + "locked": { + "lastModified": 1747431568, + "narHash": "sha256-pYwBbtvjHgJzvrHkZHsaqgMcCpOmQ4/9kymUgAnAjgk=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "2946009006bd8a988ff8a51b83528f6e1d8f0e98", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "hyprlang": { + "inputs": { + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1750371198, + "narHash": "sha256-/iuJ1paQOBoSLqHflRNNGyroqfF/yvPNurxzcCT0cAE=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "cee01452bca58d6cadb3224e21e370de8bc20f0b", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprlang_2": { + "inputs": { + "hyprutils": "hyprutils_2", + "nixpkgs": [ + "hyprpolkitagent", + "hyprland-qt-support", + "nixpkgs" + ], + "systems": [ + "hyprpolkitagent", + "hyprland-qt-support", + "systems" + ] + }, + "locked": { + "lastModified": 1749145882, + "narHash": "sha256-qr0KXeczF8Sma3Ae7+dR2NHhvG7YeLBJv19W4oMu6ZE=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "1bfb84f54d50c7ae6558c794d3cfd5f6a7e6e676", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprlang_3": { + "inputs": { + "hyprutils": [ + "hyprspace", + "hyprland", + "hyprutils" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1746655412, + "narHash": "sha256-kVQ0bHVtX6baYxRWWIh4u3LNJZb9Zcm2xBeDPOGz5BY=", + "owner": "hyprwm", + "repo": "hyprlang", + "rev": "557241780c179cf7ef224df392f8e67dab6cef83", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprlang", + "type": "github" + } + }, + "hyprpolkitagent": { + "inputs": { + "hyprland-qt-support": "hyprland-qt-support_2", + "hyprutils": "hyprutils_3", + "nixpkgs": "nixpkgs_5", + "systems": "systems_2" + }, + "locked": { + "lastModified": 1750372026, + "narHash": "sha256-TNK4bEM5vnbN0lj1zTjWYMrUFzjXq7ytkEMGaKP7czM=", + "owner": "hyprwm", + "repo": "hyprpolkitagent", + "rev": "5f8de19fd0d723c421fc7892f5d2a2ac76994066", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprpolkitagent", + "type": "github" + } + }, + "hyprspace": { + "inputs": { + "hyprland": "hyprland_2", + "systems": "systems_3" + }, + "locked": { + "lastModified": 1751272032, + "narHash": "sha256-493llKN7yyLkKlz8uYVAyvXH261IpDzuVA+TnewFIAg=", + "owner": "KZDKM", + "repo": "Hyprspace", + "rev": "847a770436e1ecebdbe5ed006a93db7666937ff2", + "type": "github" + }, + "original": { + "owner": "KZDKM", + "repo": "Hyprspace", + "type": "github" + } + }, + "hyprutils": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1751061882, + "narHash": "sha256-g9n8Vrbx+2JYM170P9BbvGHN39Wlkr4U+V2WLHQsXL8=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "4737241eaf8a1e51671a2a088518071f9a265cf4", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprutils_2": { + "inputs": { + "nixpkgs": [ + "hyprpolkitagent", + "hyprland-qt-support", + "hyprlang", + "nixpkgs" + ], + "systems": [ + "hyprpolkitagent", + "hyprland-qt-support", + "hyprlang", + "systems" + ] + }, + "locked": { + "lastModified": 1749135356, + "narHash": "sha256-Q8mAKMDsFbCEuq7zoSlcTuxgbIBVhfIYpX0RjE32PS0=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "e36db00dfb3a3d3fdcc4069cb292ff60d2699ccb", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprutils_3": { + "inputs": { + "nixpkgs": [ + "hyprpolkitagent", + "nixpkgs" + ], + "systems": [ + "hyprpolkitagent", + "systems" + ] + }, + "locked": { + "lastModified": 1749135356, + "narHash": "sha256-Q8mAKMDsFbCEuq7zoSlcTuxgbIBVhfIYpX0RjE32PS0=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "e36db00dfb3a3d3fdcc4069cb292ff60d2699ccb", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprutils_4": { + "inputs": { + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1746635225, + "narHash": "sha256-W9G9bb0zRYDBRseHbVez0J8qVpD5QbizX67H/vsudhM=", + "owner": "hyprwm", + "repo": "hyprutils", + "rev": "674ea57373f08b7609ce93baff131117a0dfe70d", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprutils", + "type": "github" + } + }, + "hyprwayland-scanner": { + "inputs": { + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1750371869, + "narHash": "sha256-lGk4gLjgZQ/rndUkzmPYcgbHr8gKU5u71vyrjnwfpB4=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "aa38edd6e3e277ae6a97ea83a69261a5c3aab9fd", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "hyprwayland-scanner_2": { + "inputs": { + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1739870480, + "narHash": "sha256-SiDN5BGxa/1hAsqhgJsS03C3t2QrLgBT8u+ENJ0Qzwc=", + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "rev": "206367a08dc5ac4ba7ad31bdca391d098082e64b", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprwayland-scanner", + "type": "github" + } + }, + "ixx": { + "inputs": { + "flake-utils": [ + "nixvim", + "nuschtosSearch", + "flake-utils" + ], + "nixpkgs": [ + "nixvim", + "nuschtosSearch", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748294338, + "narHash": "sha256-FVO01jdmUNArzBS7NmaktLdGA5qA3lUMJ4B7a05Iynw=", + "owner": "NuschtOS", + "repo": "ixx", + "rev": "cc5f390f7caf265461d4aab37e98d2292ebbdb85", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "ref": "v0.0.8", + "repo": "ixx", + "type": "github" + } + }, + "mnw": { + "locked": { + "lastModified": 1748710831, + "narHash": "sha256-eZu2yH3Y2eA9DD3naKWy/sTxYS5rPK2hO7vj8tvUCSU=", + "owner": "Gerg-L", + "repo": "mnw", + "rev": "cff958a4e050f8d917a6ff3a5624bc4681c6187d", + "type": "github" + }, + "original": { + "owner": "Gerg-L", + "repo": "mnw", + "type": "github" + } + }, + "nil": { + "inputs": { + "nixpkgs": [ + "nvf", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750047244, + "narHash": "sha256-vluLARrk4485npdyHOj8XKr0yk6H22pNf+KVRNL+i/Y=", + "owner": "oxalica", + "repo": "nil", + "rev": "870a4b1b5f12004832206703ac15aa85c42c247b", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "nil", + "type": "github" + } + }, + "nix": { + "inputs": { + "flake-compat": [ + "devenv", + "flake-compat" + ], + "flake-parts": "flake-parts", + "git-hooks-nix": [ + "devenv", + "git-hooks" + ], + "nixpkgs": "nixpkgs_3", + "nixpkgs-23-11": [ + "devenv" + ], + "nixpkgs-regression": [ + "devenv" + ] + }, + "locked": { + "lastModified": 1750955511, + "narHash": "sha256-IDB/oh/P63ZTdhgSkey2LZHzeNhCdoKk+4j7AaPe1SE=", + "owner": "cachix", + "repo": "nix", + "rev": "afa41b08df4f67b8d77a8034b037ac28c71c77df", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "devenv-2.30", + "repo": "nix", + "type": "github" + } + }, + "nix-github-actions": { + "inputs": { + "nixpkgs": [ + "colmena", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1729742964, + "narHash": "sha256-B4mzTcQ0FZHdpeWcpDYPERtyjJd/NIuaQ9+BV1h+MpA=", + "owner": "nix-community", + "repo": "nix-github-actions", + "rev": "e04df33f62cdcf93d73e9a04142464753a16db67", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nix-github-actions", + "type": "github" + } + }, + "nix-index-database": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751170039, + "narHash": "sha256-3EKpUmyGmHYA/RuhZjINTZPU+OFWko0eDwazUOW64nw=", + "owner": "Mic92", + "repo": "nix-index-database", + "rev": "9c932ae632d6b5150515e5749b198c175d8565db", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-index-database", + "type": "github" + } + }, + "nix-ld": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1751299546, + "narHash": "sha256-9UQQstDOhUD4qjFdOtO3lp0FY7lafPsUYUiC4q6wszM=", + "owner": "Mic92", + "repo": "nix-ld", + "rev": "9b03141cf43989ce602e3d3cc50a15ab63e11ebd", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "nix-ld", + "type": "github" + } + }, + "nixcord": { + "inputs": { + "flake-compat": "flake-compat_5", + "flake-parts": "flake-parts_2", + "nixpkgs": "nixpkgs_7" + }, + "locked": { + "lastModified": 1751444861, + "narHash": "sha256-zEQOZt97TVDUxVX/s6JY+Yvjm7ri8uejXQ0zOrdaEy0=", + "owner": "kaylorben", + "repo": "nixcord", + "rev": "da2507d7613534513024ed07282f75ffef1cb8f0", + "type": "github" + }, + "original": { + "owner": "kaylorben", + "repo": "nixcord", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1751011381, + "narHash": "sha256-krGXKxvkBhnrSC/kGBmg5MyupUUT5R6IBCLEzx9jhMM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "30e2e2857ba47844aa71991daa6ed1fc678bcbb7", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-24_05": { + "locked": { + "lastModified": 1735563628, + "narHash": "sha256-OnSAY7XDSx7CtDoqNh8jwVwh4xNL/2HaJxGjryLWzX8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b134951a4c9f3c995fd7be05f3243f8ecd65d798", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-24.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1748740939, + "narHash": "sha256-rQaysilft1aVMwF14xIdGS3sj1yHlI6oKQNBRTF40cc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "656a64127e9d791a334452c6b6606d17539476e2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-lib_2": { + "locked": { + "lastModified": 1748740939, + "narHash": "sha256-rQaysilft1aVMwF14xIdGS3sj1yHlI6oKQNBRTF40cc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "656a64127e9d791a334452c6b6606d17539476e2", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1751271578, + "narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_10": { + "locked": { + "lastModified": 1744868846, + "narHash": "sha256-5RJTdUHDmj12Qsv7XOhuospjAjATNiTMElplWnJE9Hs=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "ebe4301cbd8f81c4f8d3244b3632338bbeb6d49c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_11": { + "locked": { + "lastModified": 1747744144, + "narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_12": { + "locked": { + "lastModified": 1751271578, + "narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1750134718, + "narHash": "sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9e83b64f727c88a7711a2c463a7b16eedb69a84c", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1747179050, + "narHash": "sha256-qhFMmDkeJX9KJwr5H32f1r7Prs7XbQWtO0h3V0a0rFY=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "adaa24fbf46737f3f1b5497bf64bae750f82942e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1751011381, + "narHash": "sha256-krGXKxvkBhnrSC/kGBmg5MyupUUT5R6IBCLEzx9jhMM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "30e2e2857ba47844aa71991daa6ed1fc678bcbb7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_5": { + "locked": { + "lastModified": 1748929857, + "narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c2a03962b8e24e669fb37b7df10e7c79531ff1a4", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_6": { + "locked": { + "lastModified": 1746461020, + "narHash": "sha256-7+pG1I9jvxNlmln4YgnlW4o+w0TZX24k688mibiFDUE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3730d8a308f94996a9ba7c7138ede69c1b9ac4ae", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_7": { + "locked": { + "lastModified": 1749494155, + "narHash": "sha256-FG4DEYBpROupu758beabUk9lhrblSf5hnv84v1TLqMc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "88331c17ba434359491e8d5889cce872464052c2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_8": { + "locked": { + "lastModified": 1751271578, + "narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_9": { + "locked": { + "lastModified": 1750811787, + "narHash": "sha256-rD/978c35JXz6JLAzciTIOCMenPumF6zrQOj4rVZeHE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "992f916556fcfaa94451ebc7fc6e396134bbf5b1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixvim": { + "inputs": { + "flake-parts": "flake-parts_3", + "nixpkgs": "nixpkgs_9", + "nuschtosSearch": "nuschtosSearch", + "systems": "systems_5" + }, + "locked": { + "lastModified": 1751144320, + "narHash": "sha256-KJsKiGfkfXFB23V26NQ1p+UPsexI6NKtivnrwSlWWdQ=", + "owner": "nix-community", + "repo": "nixvim", + "rev": "ceb52aece5d571b37096945c2815604195a04eb4", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixvim", + "type": "github" + } + }, + "nur": { + "inputs": { + "flake-parts": [ + "stylix", + "flake-parts" + ], + "nixpkgs": [ + "stylix", + "nixpkgs" + ], + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1748730660, + "narHash": "sha256-5LKmRYKdPuhm8j5GFe3AfrJL8dd8o57BQ34AGjJl1R0=", + "owner": "nix-community", + "repo": "NUR", + "rev": "2c0bc52fe14681e9ef60e3553888c4f086e46ecb", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "NUR", + "type": "github" + } + }, + "nuschtosSearch": { + "inputs": { + "flake-utils": "flake-utils_2", + "ixx": "ixx", + "nixpkgs": [ + "nixvim", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749730855, + "narHash": "sha256-L3x2nSlFkXkM6tQPLJP3oCBMIsRifhIDPMQQdHO5xWo=", + "owner": "NuschtOS", + "repo": "search", + "rev": "8dfe5879dd009ff4742b668d9c699bc4b9761742", + "type": "github" + }, + "original": { + "owner": "NuschtOS", + "repo": "search", + "type": "github" + } + }, + "nvf": { + "inputs": { + "flake-parts": "flake-parts_4", + "flake-utils": "flake-utils_3", + "mnw": "mnw", + "nil": "nil", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_7" + }, + "locked": { + "lastModified": 1751186226, + "narHash": "sha256-Bt7jtmCW72JUPxOIrV73qBTAUOy4qvJXsls2ERDUcGo=", + "owner": "notashelf", + "repo": "nvf", + "rev": "5bad5dd94ce5ea3b40b08d9e6802e69d02198d21", + "type": "github" + }, + "original": { + "owner": "notashelf", + "repo": "nvf", + "type": "github" + } + }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": "flake-compat_3", + "gitignore": "gitignore_2", + "nixpkgs": [ + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750779888, + "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "pre-commit-hooks_2": { + "inputs": { + "flake-compat": "flake-compat_4", + "gitignore": "gitignore_3", + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1746537231, + "narHash": "sha256-Wb2xeSyOsCoTCTj7LOoD6cdKLEROyFAArnYoS+noCWo=", + "owner": "cachix", + "repo": "git-hooks.nix", + "rev": "fa466640195d38ec97cf0493d6d6882bc4d14969", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "git-hooks.nix", + "type": "github" + } + }, + "pre-commit-hooks_3": { + "inputs": { + "flake-compat": "flake-compat_6", + "gitignore": "gitignore_4", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1750779888, + "narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, + "root": { + "inputs": { + "ags": "ags", + "colmena": "colmena", + "devenv": "devenv", + "home-manager": "home-manager", + "hyprland": "hyprland", + "hyprpolkitagent": "hyprpolkitagent", + "hyprspace": "hyprspace", + "nix-index-database": "nix-index-database", + "nix-ld": "nix-ld", + "nixcord": "nixcord", + "nixpkgs": "nixpkgs_8", + "nixpkgs-24_05": "nixpkgs-24_05", + "nixpkgs-unstable": "nixpkgs-unstable", + "nixvim": "nixvim", + "nvf": "nvf", + "pre-commit-hooks": "pre-commit-hooks_3", + "secrets": "secrets", + "sops-nix": "sops-nix", + "stylix": "stylix", + "superfile": "superfile", + "zen-browser": "zen-browser" + } + }, + "secrets": { + "locked": { + "lastModified": 1743305321, + "narHash": "sha256-2H42Qu7PRCeFe/asA5sq4SeD5IM0YXbkYnU51AaUChw=", + "ref": "refs/heads/main", + "rev": "7faa37e94383c6846f8a1a0192369e74d787eccb", + "revCount": 4, + "type": "git", + "url": "ssh://git@github.com/gwg313/nixos-secrets.git" + }, + "original": { + "type": "git", + "url": "ssh://git@github.com/gwg313/nixos-secrets.git" + } + }, + "sops-nix": { + "inputs": { + "nixpkgs": "nixpkgs_10" + }, + "locked": { + "lastModified": 1750119275, + "narHash": "sha256-Rr7Pooz9zQbhdVxux16h7URa6mA80Pb/G07T4lHvh0M=", + "owner": "Mic92", + "repo": "sops-nix", + "rev": "77c423a03b9b2b79709ea2cb63336312e78b72e2", + "type": "github" + }, + "original": { + "owner": "Mic92", + "repo": "sops-nix", + "type": "github" + } + }, + "stable": { + "locked": { + "lastModified": 1750133334, + "narHash": "sha256-urV51uWH7fVnhIvsZIELIYalMYsyr2FCalvlRTzqWRw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "36ab78dab7da2e4e27911007033713bab534187b", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "stylix": { + "inputs": { + "base16": "base16", + "base16-fish": "base16-fish", + "base16-helix": "base16-helix", + "base16-vim": "base16-vim", + "firefox-gnome-theme": "firefox-gnome-theme", + "flake-compat": "flake-compat_7", + "flake-parts": "flake-parts_5", + "git-hooks": "git-hooks_2", + "gnome-shell": "gnome-shell", + "home-manager": "home-manager_2", + "nixpkgs": [ + "nixpkgs" + ], + "nur": "nur", + "systems": "systems_8", + "tinted-foot": "tinted-foot", + "tinted-kitty": "tinted-kitty", + "tinted-schemes": "tinted-schemes", + "tinted-tmux": "tinted-tmux", + "tinted-zed": "tinted-zed" + }, + "locked": { + "lastModified": 1751405764, + "narHash": "sha256-romzrDMOWMPZioeChZnrugwaUSpROfkWClHhWHuRnRQ=", + "owner": "danth", + "repo": "stylix", + "rev": "5b257989a8337dddc22aa04a70d3665d0384abef", + "type": "github" + }, + "original": { + "owner": "danth", + "repo": "stylix", + "type": "github" + } + }, + "superfile": { + "inputs": { + "flake-compat": "flake-compat_8", + "flake-utils": "flake-utils_4", + "gomod2nix": "gomod2nix", + "nixpkgs": "nixpkgs_11" + }, + "locked": { + "lastModified": 1751412022, + "narHash": "sha256-KJcEmfedn3rBRmrdUuhEBaeKQF1iHF4IPmFTrIv0DuI=", + "owner": "MHNightCat", + "repo": "superfile", + "rev": "ac240dbaf5878901c9f71dfdbbe41ede949be545", + "type": "github" + }, + "original": { + "owner": "MHNightCat", + "repo": "superfile", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "owner": "nix-systems", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default-linux", + "type": "github" + } + }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_7": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_9": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "tinted-foot": { + "flake": false, + "locked": { + "lastModified": 1726913040, + "narHash": "sha256-+eDZPkw7efMNUf3/Pv0EmsidqdwNJ1TaOum6k7lngDQ=", + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-foot", + "rev": "fd1b924b6c45c3e4465e8a849e67ea82933fcbe4", + "type": "github" + } + }, + "tinted-kitty": { + "flake": false, + "locked": { + "lastModified": 1735730497, + "narHash": "sha256-4KtB+FiUzIeK/4aHCKce3V9HwRvYaxX+F1edUrfgzb8=", + "owner": "tinted-theming", + "repo": "tinted-kitty", + "rev": "de6f888497f2c6b2279361bfc790f164bfd0f3fa", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-kitty", + "type": "github" + } + }, + "tinted-schemes": { + "flake": false, + "locked": { + "lastModified": 1748180480, + "narHash": "sha256-7n0XiZiEHl2zRhDwZd/g+p38xwEoWtT0/aESwTMXWG4=", + "owner": "tinted-theming", + "repo": "schemes", + "rev": "87d652edd26f5c0c99deda5ae13dfb8ece2ffe31", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "schemes", + "type": "github" + } + }, + "tinted-tmux": { + "flake": false, + "locked": { + "lastModified": 1748740859, + "narHash": "sha256-OEM12bg7F4N5WjZOcV7FHJbqRI6jtCqL6u8FtPrlZz4=", + "owner": "tinted-theming", + "repo": "tinted-tmux", + "rev": "57d5f9683ff9a3b590643beeaf0364da819aedda", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "tinted-tmux", + "type": "github" + } + }, + "tinted-zed": { + "flake": false, + "locked": { + "lastModified": 1725758778, + "narHash": "sha256-8P1b6mJWyYcu36WRlSVbuj575QWIFZALZMTg5ID/sM4=", + "owner": "tinted-theming", + "repo": "base16-zed", + "rev": "122c9e5c0e6f27211361a04fae92df97940eccf9", + "type": "github" + }, + "original": { + "owner": "tinted-theming", + "repo": "base16-zed", + "type": "github" + } + }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "stylix", + "nur", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1733222881, + "narHash": "sha256-JIPcz1PrpXUCbaccEnrcUS8jjEb/1vJbZz5KkobyFdM=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "49717b5af6f80172275d47a418c9719a31a78b53", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, + "xdph": { + "inputs": { + "hyprland-protocols": [ + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1750372504, + "narHash": "sha256-VBeZb1oqZM1cqCAZnFz/WyYhO8aF/ImagI7WWg/Z3Og=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "400308fc4f9d12e0a93e483c2e7a649e12af1a92", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + }, + "xdph_2": { + "inputs": { + "hyprland-protocols": [ + "hyprspace", + "hyprland", + "hyprland-protocols" + ], + "hyprlang": [ + "hyprspace", + "hyprland", + "hyprlang" + ], + "hyprutils": [ + "hyprspace", + "hyprland", + "hyprutils" + ], + "hyprwayland-scanner": [ + "hyprspace", + "hyprland", + "hyprwayland-scanner" + ], + "nixpkgs": [ + "hyprspace", + "hyprland", + "nixpkgs" + ], + "systems": [ + "hyprspace", + "hyprland", + "systems" + ] + }, + "locked": { + "lastModified": 1745871725, + "narHash": "sha256-M24SNc2flblWGXFkGQfqSlEOzAGZnMc9QG3GH4K/KbE=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "76bbf1a6b1378e4ab5230bad00ad04bc287c969e", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + }, + "zen-browser": { + "inputs": { + "nixpkgs": "nixpkgs_12" + }, + "locked": { + "lastModified": 1751447312, + "narHash": "sha256-3O3Tvfyb6Wx3jCLTXx8DYwC+aPsMkba+bnmt6fI5EvY=", + "ref": "refs/heads/main", + "rev": "65d7cdedfa21891bb876adb8204fa70f52d7f85f", + "revCount": 109, + "type": "git", + "url": "https://git.sr.ht/~canasta/zen-browser-flake/" + }, + "original": { + "type": "git", + "url": "https://git.sr.ht/~canasta/zen-browser-flake/" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..d2abd18 --- /dev/null +++ b/flake.nix @@ -0,0 +1,257 @@ +{ + description = "gwg313 Nix configs"; + + inputs = { + # Nixpkgs + #nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + # You can access packages and modules from different nixpkgs revs + # at the same time. Here's an working example: + nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable"; + # Also see the 'unstable-packages' overlay at 'overlays/default.nix'. + nix-ld.url = "github:Mic92/nix-ld"; + nix-ld.inputs.nixpkgs.follows = "nixpkgs"; + nixpkgs-24_05.url = "github:NixOS/nixpkgs/nixos-24.05"; + secrets.url = "git+ssh://git@github.com/gwg313/nixos-secrets.git"; + hyprpolkitagent.url = "github:hyprwm/hyprpolkitagent"; + hyprspace = { + url = "github:KZDKM/Hyprspace"; + }; + + # Home manager + home-manager.url = "github:nix-community/home-manager/master"; + home-manager.inputs.nixpkgs.follows = "nixpkgs"; + + nix-index-database = { + url = "github:Mic92/nix-index-database"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + hyprland = { + type = "git"; + url = "https://github.com/hyprwm/Hyprland"; + submodules = true; + # Don't follow nixpkgs or cache will miss + # inputs.nixpkgs.follows = "nixpkgs"; + }; + zen-browser.url = "git+https://git.sr.ht/~canasta/zen-browser-flake/"; + nixcord.url = "github:kaylorben/nixcord"; + devenv = { + url = "github:cachix/devenv/main"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + stylix = { + url = "github:danth/stylix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + ags.url = "github:Aylur/ags"; + + # neovim-config.url = "github:gwg313/nvim-nix"; + + sops-nix.url = "github:Mic92/sops-nix"; + + superfile = { + url = "github:MHNightCat/superfile"; + }; + + nixvim = { + url = "github:nix-community/nixvim"; + }; + nvf = { + url = "github:notashelf/nvf"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix"; + pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs"; + colmena.url = "github:zhaofengli/colmena"; + }; + + outputs = + { + self, + nixpkgs, + home-manager, + colmena, + nix-ld, + ... + }@inputs: + let + inherit (self) outputs; + # Supported systems for your flake packages, shell, etc. + systems = [ + "aarch64-linux" + "i686-linux" + "x86_64-linux" + "aarch64-darwin" + "x86_64-darwin" + ]; + # This is a function that generates an attribute by calling a function you + # pass to it, with each system as an argument + forAllSystems = nixpkgs.lib.genAttrs systems; + user = "gwg313"; + in + { + # Your custom packages + # Accessible through 'nix build', 'nix shell', etc + packages = forAllSystems (system: import ./pkgs nixpkgs.legacyPackages.${system}); + # Formatter for your nix files, available through 'nix fmt' + # Other options beside 'alejandra' include 'nixpkgs-fmt' + formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.alejandra); + + # Your custom packages and modifications, exported as overlays + overlays = import ./overlays { inherit inputs; }; + # Reusable nixos modules you might want to export + # These are usually stuff you would upstream into nixpkgs + nixosModules = import ./modules/nixos; + # Reusable home-manager modules you might want to export + # These are usually stuff you would upstream into home-manager + homeModules = import ./modules/home-manager; + + devShells = forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + default = pkgs.mkShell { + inherit (self.checks.${system}.pre-commit-check) shellHook; + buildInputs = with pkgs; [ + alejandra + apacheHttpd + ]; + }; + } + ); + + checks = forAllSystems ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + in + { + pre-commit-check = inputs.pre-commit-hooks.lib.${system}.run { + src = ./.; + hooks = { + nixfmt-rfc-style.enable = true; + }; + }; + } + ); + + # NixOS configuration entrypoint + # Available through 'nixos-rebuild --flake .#your-hostname' + nixosConfigurations = { + candlekeep = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit user inputs outputs; + }; + modules = [ + # > Our main nixos configuration file < + ./hosts/candlekeep/configuration.nix + nix-ld.nixosModules.nix-ld + ]; + }; + }; + + nixosConfigurations = { + grymforge = nixpkgs.lib.nixosSystem { + specialArgs = { + inherit user inputs outputs; + }; + modules = [ + # > Our main nixos configuration file < + ./hosts/grymforge/configuration.nix + ]; + }; + }; + + # Standalone home-manager configuration entrypoint + # Available through 'home-manager --flake .#your-username@your-hostname' + homeConfigurations = { + "gwg313@candlekeep" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance + extraSpecialArgs = { + inherit inputs outputs; + }; + modules = [ + # > Our main home-manager configuration file < + ./home-manager/machines/candlekeep.nix + inputs.nixcord.homeModules.nixcord + inputs.stylix.homeModules.stylix + ]; + }; + }; + + homeConfigurations = { + "gwg313@grymforge" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance + extraSpecialArgs = { + inherit inputs outputs; + }; + modules = [ + # > Our main home-manager configuration file < + ./home-manager/machines/grymforge.nix + inputs.nixcord.homeModules.nixcord + inputs.stylix.homeModules.stylix + ]; + }; + }; + + homeConfigurations = { + "gwg313@dorino" = home-manager.lib.homeManagerConfiguration { + pkgs = nixpkgs.legacyPackages.x86_64-linux; # Home-manager requires 'pkgs' instance + extraSpecialArgs = { + inherit inputs outputs; + }; + modules = [ + # > Our main home-manager configuration file < + ./home-manager/machines/dorino.nix + inputs.stylix.homeModules.stylix + ]; + }; + }; + + # colmena managed systems + colmenaHive = colmena.lib.makeHive self.outputs.colmena; + colmena = { + meta = { + specialArgs = { + inherit user inputs outputs; + }; + nixpkgs = import nixpkgs { + system = "x86_64-linux"; + }; + }; + + waypoint = { + deployment = { + targetHost = "waypoint"; # <- defined in ~/.ssh/config + }; + imports = [ ./hosts/waypoint/configuration.nix ]; + }; + + # kerby = { + # deployment = { + # targetHost = "waypoint"; # <- defined in ~/.ssh/config + # }; + # imports = [./hosts/kerby/configuration.nix]; + # }; + + seikan = { + deployment = { + targetHost = "seikan"; # <- defined in ~/.ssh/config + }; + imports = [ ./hosts/seikan/configuration.nix ]; + }; + + panopticon = { + deployment = { + targetHost = "panopticon"; # <- defined in ~/.ssh/config + }; + imports = [ ./hosts/panopticon/configuration.nix ]; + }; + }; + }; +} diff --git a/forgejo/certificate.yaml b/forgejo/certificate.yaml deleted file mode 100644 index 66c8e1f..0000000 --- a/forgejo/certificate.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: forgejo-cert - namespace: istio-system -spec: - secretName: forgejo-cert - issuerRef: - name: letsencrypt-dns - kind: ClusterIssuer - dnsNames: - - git.local.gwg313.xyz - - git.gwg313.xyz - - git.zerotier.gwg313.xyz diff --git a/forgejo/deployment.yaml b/forgejo/deployment.yaml deleted file mode 100644 index 62ce0e3..0000000 --- a/forgejo/deployment.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: forgejo - namespace: forgejo - labels: - app: forgejo -spec: - strategy: - type: Recreate - replicas: 1 - selector: - matchLabels: - app: forgejo - template: - metadata: - labels: - app: forgejo - spec: - securityContext: - runAsUser: 1000 - runAsGroup: 1000 - fsGroup: 1000 - terminationGracePeriodSeconds: 30 - containers: - - name: forgejo - image: codeberg.org/forgejo/forgejo:11-rootless - ports: - - containerPort: 3000 - - containerPort: 2222 - env: - - name: FORGEJO__server__ROOT_URL - value: "https://git.gwg313.xyz/" - - name: FORGEJO__ssh__START_SSH_SERVER - value: "false" - - name: FORGEJO__webhook__ALLOWED_HOST_LIST - value: "ci.gwg313.xyz" - volumeMounts: - - name: forgejo-volume - mountPath: /var/lib/gitea - subPath: data - - name: forgejo-volume - mountPath: /etc/gitea - subPath: config - volumes: - - name: forgejo-volume - persistentVolumeClaim: - claimName: forgejo-pvc diff --git a/forgejo/destinationrule.yaml b/forgejo/destinationrule.yaml deleted file mode 100644 index 1ec42cc..0000000 --- a/forgejo/destinationrule.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: DestinationRule -metadata: - name: forgejo - namespace: forgejo -spec: - host: forgejo.forgejo.svc.cluster.local - trafficPolicy: - outlierDetection: - consecutive5xxErrors: 1 - interval: 5s - baseEjectionTime: 30s diff --git a/forgejo/gateway.yaml b/forgejo/gateway.yaml deleted file mode 100644 index 4699a1a..0000000 --- a/forgejo/gateway.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: Gateway -metadata: - name: forgejo-gateway - namespace: forgejo -spec: - selector: - istio: gateway - servers: - - port: - number: 443 - name: https - protocol: HTTPS - tls: - mode: SIMPLE - credentialName: forgejo-cert - hosts: - - git.local.gwg313.xyz - - git.gwg313.xyz - - git.zerotier.gwg313.xyz diff --git a/forgejo/sealed-secret.yaml b/forgejo/sealed-secret.yaml deleted file mode 100644 index a969f58..0000000 --- a/forgejo/sealed-secret.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - creationTimestamp: null - name: forgejo-iscsi-auth - namespace: forgejo -spec: - encryptedData: - discovery.sendtargets.auth.password: AgAcRgPxIe/pBpeUWcSJzzf8HVUpFe8pl9U8qzs1eutcun91clbW5m/sra3oKV6KmmFgd69I2M3w38wtSGG7iztZdIPcCkVXZSqX3ANKrWIwiJXUBqfNtXAD0IxGu8SdkHRp7fGWR9NlynT7WDEZpTNNQrQE0O4GQrM7gMy9wzy22Foxk8hhUCOKW9o2q/HefBBp4BHHhdAmnaya26Cm2Fdji6U2bnORlY8SESRAyty7jkQFI4FcUlXXUhamVccFGVxufhRNkJP+90iPQbD48VDPSGHQS11EbfoSaoXlt+NTRt/FCwSMc2h5L5AtuZHTh72PGCk2+coYDLQb2IL0o+jujsf0hVlRAzMvHi5nDrwNVh+gbuV1MmC1SED3CA6nkevTeEj5mmK+kviZua1Ezi4LQ9daFPhOGjobCtPyZZsHwIzKceqWM5dULvckzgvNLecwkJgDOYRd9j3/G1wgsCUNZj4OhZZgO6rfG+XXMZfFnoRR1x0NK6jInaNm5oG+vYgBjN1WlR7dgEdUN8W0dC0uqmbpsoCTEyjOnumB7ecqknonh/syU8GqlB8KLBv5pZs9YR2fdMgDwh+RW/oPXcNCbbjsGi8N6+R6TdM7hp7NYh4yQaI/qkruCuUgGLEmziFUgrcWfjpwsmhNIuYG2lC0MC+oFlLiS1vF2mIkAM6AnbGgnwnWUU1FK6Y9q0aUjsPKp6Yv169oXgsyHqMk0EzD - discovery.sendtargets.auth.username: AgCCpqxtivSysp6XGnnh3xhyqg0I6/RLlwjJMsyQ5RJRoRSxKspKEuaW2+oIzVbCrCm6JS1Amrjk9MgR9jGNo+MtGNXTIWGcy3IAV+Cg6JZSyD/MGCHMQh/NIfZQnAPt2AuFAsXUUbcZbuVS5BYf+27KD8a9sCRH9McPv6IqSPC4tVSWOrdGD+FeL4oZhWhMuMiqAVwXi18tx+bu8TmCXjUUS/bYD64KnwBo+xyGAkiem+0NLqn9b85YMZQ68RWUepfFVZywbxWDuO0cQALHTUPPnVRCZPFImhz6vitlEY1dOkEmBYWQ9NoJZhTdiQA0pnnCvs7bDpGiqOK2qvlSyR6Bii5ZEUSBVfbtFDLQqcw+4mwOr1o+Zh1tSYZspHrm3ogAf3tzgEgHuZdWwXe/MFxDiaUviBjRwWAeCapl39+kn/PUSNQuta87DAOH9WecGE4vE5cvytDs21R+TXuY5IRtXngumEIuxex8Pm0CzjHt5JarWnhLs6kSMpJ2erI129mHh6OclC7ahACuKIMneQhVyWOHoGYdU3YuitRYPz9opYRi0tR1FilUmxKebHhOzu00FjtQTwIME4WIZpRXzvSHapNmx3k/aAX19Ow/lzr0fcszJNebc0p9cRsK+amxB9vIttpFTvhShd0+RQ5R/xAsoj49h0fyKT0Y/pNybZFRMtdMTbYLH2HxZj0DEz71HC5Y3bxGhWQS - node.session.auth.password: AgBfFtXL40WF/RcyVHRZ4LxDfFEpzaldSWjahyOQUJAKAgb5flbMdP99nEpL1Z+ZChMXMIn1hU5AbbbdYiMTeSAGyyg8/MHnikv5dvNzUWRYIT2jK++XvqfMWBvFC5Tc9TVFrsc2nFBeNgQ1E5a9W8vLv42sC4MTEHNvCsMxARCcDoxSzzmrZUV+RNy2ze20kp9pgWPxqcsaouynS2Kxdo0L3Tch6wcAOKewi6VKgtmsqrQjdl1wFCiHZrHl421c7Z18kQFsMnq8bF1tbELxm+KB2B78jaPQNHBYKM0aURmt6mnKI99XIIUf42s7fqlInceQwCRx7Q8HYOMWgI2FPwGVAOKRh4CS7woXfwbEga44uBRA91F5UV6i2VHkpfEnF7i6aZ/wKqnlVZQVvs5zZvumn+TuPDXibExTl///dCof7v2Q5xY8OLr2YUScfW3gokj7QUmCqfANG0sUxx+UqeNArXPaSRAw5gvTqRGtDAEZMBevPJSpcoWNJuKOkHST+lgF4T56s3KdyQoe10nrsgTmTEamOn9inkJOtNIlIpDjUHVHrTUgs24Tjfm9LKkrvP+/finuUbVJob6ltA6iU7tHDAAo2XgV2KfFTJC1ogv0hKltZA5TqPiqwUBF9w9iI1aEN2ghjc7+s1YcRtUFHCRnKdg9kU8LraxY166Iwajl1PESQ58LFMXqdLYRb2xIvZGATRYhG8qfhUYokMWTwpAj - node.session.auth.username: AgCKkZz7+v4qNvKCoxJUQK+ti3ptzvB3tQFrAhhtz14ifumuPhewFWwDMesWrzavnSm6jtD1U+8rnwgRvS1yyJ4ZtypohbJGWJlp1b/Pk0RT4lwxVLj0zRPvATYHTNSvRhFrnMeLBWMQbAfFNRdGUXN03qp3oq9uWr1I4jJ9fOHfCsqa4j7SH5raZ8qvDO1lPPrUioysbWkMjgP8DG+C8w+LEazgZu86WO/whCG4mEEHSaXs1aofSKfygYRxpd7GKcdmdflU9xbmIWdJMdQ6COWRZb9G8gJE1RsFum3pF5xfx6nxUOm6FkPbRBjtroMEKd4EWAGfl+P2AWWZ3xpA1WSoxjUztDRRvy7xGnU2QOZV3EEXqjG1/H4VUY9kd/3v10rFB9N1UgdatqRZpcxweNzaMJcUUGHMO5TsCjrwcPOD9gCLtWtsbYlvvUFTN2jfPiS2hzquEZI/hdr+qJC9sPJSu9OUvmFx+quT7DzVjvov/HjkdKd+N/dDpXHFVsL2oDq7mjUmT5mzqg3F/6/YkKn8b2X0LTgXUONXxF8xTUsI4HKCSBoANUuT/ePwBY3tVyz0AY+sUQd5Pxq708HeHC2edNTUwmY6ucuLWtTorXzFXSBXQXfeGZqjONtkYCE60CsTp7+RUtdNnG23CNDMFAUujVxLQVa1XfNFlfk9znBQ1IxUBLkU6JJm9kw3hYn6Bk06B/+mOOim - template: - metadata: - creationTimestamp: null - name: forgejo-iscsi-auth - namespace: forgejo - type: kubernetes.io/iscsi-chap diff --git a/forgejo/service.yaml b/forgejo/service.yaml deleted file mode 100644 index be8a302..0000000 --- a/forgejo/service.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: forgejo - namespace: forgejo -spec: - selector: - app: forgejo - ports: - - name: http - port: 80 - targetPort: 3000 - type: ClusterIP diff --git a/forgejo/storage.yaml b/forgejo/storage.yaml deleted file mode 100644 index 376c165..0000000 --- a/forgejo/storage.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: forgejo-pv -spec: - capacity: - storage: 20Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - iscsi: - targetPortal: truenas.local.gwg313.xyz:3260 - iqn: iqn.2005-10.org.freenas.ctl:forgejo - lun: 0 - fsType: ext4 - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: forgejo-iscsi-auth - claimRef: - namespace: forgejo - name: forgejo-pvc ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: forgejo-pvc - namespace: forgejo -spec: - storageClassName: manual - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 20Gi - volumeName: forgejo-pv diff --git a/forgejo/virtualservice.yaml b/forgejo/virtualservice.yaml deleted file mode 100644 index 0efd103..0000000 --- a/forgejo/virtualservice.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: VirtualService -metadata: - name: forgejo - namespace: forgejo -spec: - hosts: - - git.local.gwg313.xyz - - git.gwg313.xyz - - git.zerotier.gwg313.xyz - gateways: - - forgejo-gateway - http: - - match: - - uri: - prefix: / - route: - - destination: - host: forgejo - port: - number: 80 diff --git a/harbor-config/certificate-harbor.yaml b/harbor-config/certificate-harbor.yaml deleted file mode 100644 index d541d5c..0000000 --- a/harbor-config/certificate-harbor.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: harbor-cert-nginx - namespace: harbor -spec: - secretName: harbor-cert-nginx - issuerRef: - name: letsencrypt-dns - kind: ClusterIssuer - dnsNames: - - harbor.gwg313.xyz diff --git a/harbor-config/certificate.yaml b/harbor-config/certificate.yaml deleted file mode 100644 index 0fb929a..0000000 --- a/harbor-config/certificate.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: harbor-cert - namespace: istio-system -spec: - secretName: harbor-cert - issuerRef: - name: letsencrypt-dns - kind: ClusterIssuer - dnsNames: - - registry.gwg313.xyz diff --git a/harbor-config/gateway.yaml b/harbor-config/gateway.yaml deleted file mode 100644 index a5d3d1e..0000000 --- a/harbor-config/gateway.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: Gateway -metadata: - name: harbor-gateway - namespace: harbor -spec: - selector: - istio: gateway - servers: - - port: - number: 443 - name: https - protocol: HTTPS - hosts: - - registry.gwg313.xyz - tls: - mode: SIMPLE - credentialName: harbor-cert diff --git a/harbor-config/harbor-iscsi-secrets-sealed.yaml b/harbor-config/harbor-iscsi-secrets-sealed.yaml deleted file mode 100644 index e2f19b5..0000000 --- a/harbor-config/harbor-iscsi-secrets-sealed.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - creationTimestamp: null - name: harbor-iscsi-auth - namespace: harbor -spec: - encryptedData: - discovery.sendtargets.auth.password: AgAeJ3ODG8BmuWuPNj9VRVGJdi68V0NMTAdhF2Nhk8soW+l742UnEQNneZLEg2MBM4iHOit5Nsjw/0YRm8Yb8loTZInIDIXCi6LrP1NX58zANuoc/K8lovHL9BxwSeucfs+/Jh9vfM6tvuFExFz+yHeYhlufWSBkZIqF7LkX/yR7H1Yc5r4hXCJ2lDd/0TDssN8CjrIZ/2R/8rhKB7/14KfHifV/bXVwXUMtevXvbeEqeJxPPvRPb2fX6D3rrlbOLBnWBiRr4pLf76QrKG5ZgRiV2iXOKHfP3JBO5SCh5ftK8qIVgmAt7TcnEftzp4R6z6BvD2s5UNtUdzXSuwBuGW6Hc7jR8KszoziLI4LEVfU5YZtlc4U2NYuvrWUfzl7WB4c15saqr3ZK1jFxfzTQE4CPfY3HD4mQR0wQvzpDFrTI57sygXG5mRcpePnxu62i7rmx/RUSMAY6kt00YnrnSTafufdcFBA+RbFcJ7saDiidhC1R9nmanl1R2bOh0aZN6c5GPfGcaAvP4CqSVmns/e3s3Csm3OIMaKB+D3adkcMT3iDrpmaoN0eSCYFFKeIzUApVgEWMOWGoGRfeomAzJbpqwhfLecNkOAH2jgX3OTDYuKxik1oAwNOlH7s9ogTXtALG51x7brH1Hfcp5J36v0g+dZV4k2/z4V1R4GbQ9HvKiIA/zWDjZXUwh1/Jmf/n1J2tgK4DFnOpfA5+Hi27OFtQ - discovery.sendtargets.auth.username: AgAUXQyptx3bktJI+I6jvViwYvq1tETgA4z06HqAF9sCy7FA/tLnhmaDFOJBlsUUZdxKvybpL4gFfibfEGv0hrVb5yPhf2CZGPRnWEjqRBTzKwmtT8eeRnkR4WxNx/bsJhlNr3p1EAAVYJqot4qH6FuFh9zG/rwzAaLT883/p4HCGPf0vgCQmQYOrKT1tNVb7+hvDWLTkA+A45R86SznapYMT+awIHRO/ePngMYzpwmnBw82X+z7QubLSZyqEzyBoF7G1Bst81aiSlCeip/BWgS///EAvqvFTUMMHkRn48Qm4S4qRHepEJD3jpk28PcF4hs06e3NluEmxJ6cr7ejtFMoSu0vkw5FHHZN3U5YoafxvC8hc+5TotkFs4KIUnAsgFwTn68w7qwjmClUtFoughW3Ku5+7DEd1Klw1CBqSO7kURZI/777kyfcoEeXmkXbRzr8lOfvJoaMrHUsR5v9RZrsvWiuhXJjOdfVGw5p8RL137E4MxPwMAdlCW3Ry78AJnSAaIn+3Nuv0+lSpB1LFGGiuDPR5hKfA/dKX+FqFFF1CMn7q/DrLlcBlkjUHLR5sg0IBc4EReZLLa02USNwsisTkiQo+Wm5rwZ0ZvCCHOSmJjbLsbmqzSuAf5ffVcnEk2OWjxzZoMB8+d7HRqXumrA7vKK70sTpSNoMR1UuL0Kfgm8wvKvP3Fqd0dKEb/etLaGvL0RJ4ek= - node.session.auth.password: AgANvpN/nYqlyN7mZyIBE9aXRrOiINOTurXYDSwI9N9rc2SwBKvtUC9kvDE/5MZaU/Itk2SK4vFJEKuLkmomeyk9BFJJ0V3tqEDklgvGG2EMSt8Xlj9We8ujWnrN4GYSb047F3b0mBakczxcRNiJisPkvq/XyYrBVCgPPJqVhJIYKXjSXcthd1Jfd3kJzbippjCykmupRTbz7/Vk6QtKmQXfEcPDuOLPCaF/gFL2/3vVachJh7zON62lKCkuHE7QTeIEPFOCJib/oDSi2TG4ts5u8h+uTXoJCBpJwAGDhHly6cOOAiXR9BAp2nbprRb193Ga5aOGmR+qXmjQdMc3dLiJnWpMmGo0tbl5JD4bUOi/E9VFzOprKdGeYlGssGOTdAtmlrnKvaiSS6YiuCvFMFsHdo8jyC45dE4LNuiOI3MX6mkyLEGOYStiS8e/HzRPg5AGLQsuD33RVKE0+IpPGys4ScU44k+jclpcdS00eXI+ZSEfSUQA8di8rXgZfrJLvuVtRFCTjx3HA8kb4J68nHEdBeXJJEQp9Nx/Tc1ic/Iyi+Br/4Pw+UQHI3YYkUfwWaBuCqxOX5Yedcy3BHqxkdCARNVB9cRBcfFMhJJnS6WVaCgXa0qzZLt7RqutVCa7jtCOmMK3PiU4q09ML4OqyIg/HV+c2OMCJG9nBKL8wtE0Huz1ZNWDgFIWybKA4an1P2cULiMAMNQHGPrvL+o9v9CO - node.session.auth.username: AgA+bt5d5wiAHDmoV5fJExQIUFFy+WmJFFmZY5/WnulzC+/SRxssz/MtikNv8nkFdtvPfTXM57ic2SwPfSXULyQbDY/Kiwi0UejaC+9lN+weCKhks2UgaHYUtv3Inm6xLMHcvfxrwUERrfx7U70vl60WP3CYQ91l0d3fxbbRByw3TZuTZkuYnGmCsfJK0q+hd7GCa8cSxMvUf32MbRrVXecxsBKB4dtsMz0kHiZaH0wchmzWV/mBmAHV5oqkTyk3rAKZHd8D9uqy23fUr8BV6e5hSF67JicCgn94gJq8Z0hrDnu93zZl+mCFnkwPk9uA1jAuQOptHNdXEkZSjUKXFSp5pG5hgxCmwtJNBxUiZDc7IjPETCh/BzD3WLHIzfYAqW7LxDDr9IKlUEf5CUeBw2CULCq9wIaRhXqiJmV36XmMlAGJt+J2SCCKUbhKsJfyHL+PG19gDv2f75bcWc3U6646Pn5b3f0X+eJ9wIyW2Q1cqxo0yZJ+kQ3M7/ABOQfZBYoafi305fE5byecWBgz91ZrXDG/lXGat1rZBVpZ660iIZ9YvCHCC0Vb5LNEPwsfgodUnp1lXoSq8Fm6ggfLhKLL2JrlJhmou3fHsnovNmqTC9wJ026iGrwFNE8nRKvniK8aujK8IHfklodDSFWC4h/IpJf9oLWw8li0a4Ll/s0msFlWq+GABYJZW9CA0br0tp4Or8PwUwM= - template: - metadata: - creationTimestamp: null - name: harbor-iscsi-auth - namespace: harbor - type: kubernetes.io/iscsi-chap diff --git a/harbor-config/storage.yaml b/harbor-config/storage.yaml deleted file mode 100644 index 1125792..0000000 --- a/harbor-config/storage.yaml +++ /dev/null @@ -1,197 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: harbor-registry-pv -spec: - capacity: - storage: 200Gi - accessModes: - - ReadWriteOnce - volumeMode: Filesystem - persistentVolumeReclaimPolicy: Retain - storageClassName: harbor-iscsi - iscsi: - targetPortal: truenas.local.gwg313.xyz - iqn: iqn.2005-10.org.freenas.ctl:harbor-registry - lun: 1 - fsType: ext4 - readOnly: false - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: harbor-iscsi-auth - namespace: harbor ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: harbor-registry - namespace: harbor -spec: - accessModes: - - ReadWriteOnce - storageClassName: harbor-iscsi - volumeName: harbor-registry-pv - resources: - requests: - storage: 200Gi - -# Harbor: Jobservice ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: harbor-jobservice-pv -spec: - capacity: - storage: 10Gi - accessModes: - - ReadWriteOnce - volumeMode: Filesystem - persistentVolumeReclaimPolicy: Retain - storageClassName: harbor-iscsi - iscsi: - targetPortal: truenas.local.gwg313.xyz - iqn: iqn.2005-10.org.freenas.ctl:harbor-jobservice - lun: 0 - fsType: ext4 - readOnly: false - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: harbor-iscsi-auth - namespace: harbor ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: harbor-jobservice - namespace: harbor -spec: - accessModes: - - ReadWriteOnce - storageClassName: harbor-iscsi - volumeName: harbor-jobservice-pv - resources: - requests: - storage: 10Gi - -# Harbor: Database ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: harbor-database-pv -spec: - capacity: - storage: 10Gi - accessModes: - - ReadWriteOnce - volumeMode: Filesystem - persistentVolumeReclaimPolicy: Retain - storageClassName: harbor-iscsi - iscsi: - targetPortal: truenas.local.gwg313.xyz - iqn: iqn.2005-10.org.freenas.ctl:harbor-database - lun: 2 - fsType: ext4 - readOnly: false - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: harbor-iscsi-auth - namespace: harbor ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: harbor-database - namespace: harbor -spec: - accessModes: - - ReadWriteOnce - storageClassName: harbor-iscsi - volumeName: harbor-database-pv - resources: - requests: - storage: 10Gi - -# Harbor: Redis ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: harbor-redis-pv -spec: - capacity: - storage: 10Gi - accessModes: - - ReadWriteOnce - volumeMode: Filesystem - persistentVolumeReclaimPolicy: Retain - storageClassName: harbor-iscsi - iscsi: - targetPortal: truenas.local.gwg313.xyz - iqn: iqn.2005-10.org.freenas.ctl:harbor-redis - lun: 3 - fsType: ext4 - readOnly: false - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: harbor-iscsi-auth - namespace: harbor ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: harbor-redis - namespace: harbor -spec: - accessModes: - - ReadWriteOnce - storageClassName: harbor-iscsi - volumeName: harbor-redis-pv - resources: - requests: - storage: 10Gi - -# Harbor: Trivy ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: harbor-trivy-pv -spec: - capacity: - storage: 10Gi - accessModes: - - ReadWriteOnce - volumeMode: Filesystem - persistentVolumeReclaimPolicy: Retain - storageClassName: harbor-iscsi - iscsi: - targetPortal: truenas.local.gwg313.xyz - iqn: iqn.2005-10.org.freenas.ctl:harbor-trivy - lun: 4 - fsType: ext4 - readOnly: false - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: harbor-iscsi-auth - namespace: harbor ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: harbor-trivy - namespace: harbor -spec: - accessModes: - - ReadWriteOnce - storageClassName: harbor-iscsi - volumeName: harbor-trivy-pv - resources: - requests: - storage: 10Gi diff --git a/harbor-config/virtualservice.yaml b/harbor-config/virtualservice.yaml deleted file mode 100644 index d28983e..0000000 --- a/harbor-config/virtualservice.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: VirtualService -metadata: - name: harbor - namespace: harbor -spec: - hosts: - - registry.gwg313.xyz - gateways: - - harbor-gateway - http: - - match: - - uri: - prefix: /api/ - - uri: - prefix: /service/ - - uri: - prefix: /chartrepo - - uri: - prefix: /c/ - - uri: - prefix: /v1/ - - uri: - prefix: /v2/ - route: - - destination: - host: harbor-core - port: - number: 80 - - match: - - uri: - prefix: / - name: portal - route: - - destination: - host: harbor-portal - port: - number: 80 - timeout: 30s diff --git a/home-manager/machines/candlekeep.nix b/home-manager/machines/candlekeep.nix new file mode 100644 index 0000000..6c9d961 --- /dev/null +++ b/home-manager/machines/candlekeep.nix @@ -0,0 +1,113 @@ +# This is your home-manager configuration file +# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: +{ + # You can import other home-manager modules here + imports = [ + # If you want to use modules your own flake exports (from modules/home-manager): + # outputs.homeManagerModules.example + + # Or modules exported from other flakes (such as nix-colors): + # inputs.nix-colors.homeManagerModules.default + inputs.ags.homeManagerModules.default + + # You can also split up your configuration and import pieces of it here: + + ../modules/nvf + ./candlekeep/variables.nix + # ./nvim.nix + ../modules/common.nix + ../../common/style/vars/vars.nix + ../modules/hyprland + ../modules/common-gui.nix + ../modules/linux-gui.nix + ../modules/devenv.nix + ../modules/ssh.nix + ../modules/gh-dash.nix + ../modules/ags.nix + # ../modules/neovim + ../modules/yazi.nix + # ../modules/hyprpanel.nix + # ../modules/hyprlock.nix + # ../modules/hypridle.nix + # ../modules/hyprspace.nix + ../modules/qutebrowser.nix + ../scripts/default.nix + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + # (final: prev: { neovim = inputs.neovim-config.packages."x86_64-linux".default; }) + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + # Workaround for https://github.com/nix-community/home-manager/issues/2942 + allowUnfreePredicate = _: true; + }; + }; + + home = { + username = "gwg313"; + homeDirectory = "/home/gwg313"; + }; + + gtk = { + enable = true; + iconTheme = { + name = "WhiteSur-Light"; + package = pkgs.whitesur-icon-theme.override { + boldPanelIcons = true; + alternativeIcons = true; + }; + }; + # font.name = "Inter 13"; + }; + + qt = { + enable = true; + platformTheme.name = "gtk"; + style.name = "adwaita"; + }; + + # Add stuff for your user as you see fit: + # programs.neovim.enable = true; + home.packages = with pkgs; [ + openvpn + hyprpanel + nerd-fonts.overpass + ]; + + # Enable home-manager and git + programs.home-manager.enable = true; + programs.git.enable = true; + + # Nicely reload system units when changing configs + systemd.user.startServices = "sd-switch"; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + home.stateVersion = "23.05"; +} diff --git a/home-manager/machines/candlekeep/variables.nix b/home-manager/machines/candlekeep/variables.nix new file mode 100644 index 0000000..881f78c --- /dev/null +++ b/home-manager/machines/candlekeep/variables.nix @@ -0,0 +1,26 @@ +{ config, ... }: +{ + imports = [ ../../../common/nixos/variables-config.nix ]; + + config.var = { + hostname = "candlekeep"; + username = "gwg313"; + configDirectory = "/home/" + config.var.username + "/.config/nixos"; + + keyboardLayout = "en_US"; + + location = "Ottawa"; + timeZone = "American/Toronto"; + defaultLocale = "en_US.UTF-8"; + + git = { + username = "gwg313"; + email = "gwg313@pm.me"; + }; + + autoUpgrade = true; + autoGarbageCollector = true; + + theme = import ../../../common/style/vars/candlekeep.nix; + }; +} diff --git a/home-manager/machines/dorino.nix b/home-manager/machines/dorino.nix new file mode 100644 index 0000000..2180bb6 --- /dev/null +++ b/home-manager/machines/dorino.nix @@ -0,0 +1,111 @@ +# This is your home-manager configuration file +# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: { + # You can import other home-manager modules here + imports = [ + # If you want to use modules your own flake exports (from modules/home-manager): + # outputs.homeManagerModules.example + + # Or modules exported from other flakes (such as nix-colors): + # inputs.nix-colors.homeManagerModules.default + + # You can also split up your configuration and import pieces of it here: + # ./nvim.nix + ../modules/common.nix + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + (final: prev: { + neovim = inputs.neovim-config.packages."x86_64-linux".default; + }) + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + # Workaround for https://github.com/nix-community/home-manager/issues/2942 + allowUnfreePredicate = _: true; + }; + }; + + home = { + username = "gwg313"; + homeDirectory = "/home/gwg313"; + }; + + stylix = { + base16Scheme = "${pkgs.base16-schemes}/share/themes/tokyo-night-terminal-storm.yaml"; + image = ./wallpaper.jpg; + autoEnable = true; + + opacity.terminal = 1.0; + fonts.sizes.terminal = 15; + + fonts = { + serif = { + package = pkgs.meslo-lgs-nf; + name = "MesloLGS NF"; + }; + + sansSerif = { + package = pkgs.meslo-lgs-nf; + name = "MesloLGS NF"; + }; + + monospace = { + package = pkgs.ibm-plex; + name = "IBM Plex Mono"; + }; + + emoji = { + package = pkgs.noto-fonts-emoji; + name = "Noto Color Emoji"; + }; + }; + cursor = { + package = pkgs.bibata-cursors; + name = "Bibata-Modern-Classic"; + size = 20; + }; + }; + + # Add stuff for your user as you see fit: + # programs.neovim.enable = true; + home.packages = with pkgs; [ + podman + podman-compose + ]; + + # Enable home-manager and git + programs.home-manager.enable = true; + programs.git.enable = true; + + programs.direnv.enable = true; + # Nicely reload system units when changing configs + systemd.user.startServices = "sd-switch"; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + home.stateVersion = "23.05"; +} diff --git a/home-manager/machines/grymforge.nix b/home-manager/machines/grymforge.nix new file mode 100644 index 0000000..04d966a --- /dev/null +++ b/home-manager/machines/grymforge.nix @@ -0,0 +1,108 @@ +# This is your home-manager configuration file +# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix) +{ + inputs, + outputs, + lib, + config, + pkgs, + ... +}: +{ + # You can import other home-manager modules here + imports = [ + # If you want to use modules your own flake exports (from modules/home-manager): + # outputs.homeManagerModules.example + + # Or modules exported from other flakes (such as nix-colors): + # inputs.nix-colors.homeManagerModules.default + + # You can also split up your configuration and import pieces of it here: + + ./grymforge/variables.nix + # ../modules/hyprpanel.nix + # ../modules/hyprlock.nix + # ../modules/hypridle.nix + # ./nvim.nix + ../modules/nvf + ../modules/common.nix + ../modules/hyprland + # ../modules/hyprland.nix + ../modules/common-gui.nix + ../modules/linux-gui.nix + ../modules/devenv.nix + ../modules/gh-dash.nix + ../modules/ssh.nix + # ../modules/neovim/default.nix + ../modules/yazi.nix + ../modules/qutebrowser.nix + ../scripts/default.nix + ../../common/style/vars/vars.nix + ]; + + nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + # (final: prev: { + # neovim = inputs.neovim-config.packages."x86_64-linux".default; + # }) + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + # Workaround for https://github.com/nix-community/home-manager/issues/2942 + allowUnfreePredicate = _: true; + }; + }; + + home = { + username = "gwg313"; + homeDirectory = "/home/gwg313"; + }; + + gtk = { + enable = true; + iconTheme = { + name = "WhiteSur-Light"; + package = pkgs.whitesur-icon-theme.override { + boldPanelIcons = true; + alternativeIcons = true; + }; + }; + # font.name = "Inter 13"; + }; + + qt = { + enable = true; + platformTheme.name = "gtk"; + style.name = "adwaita"; + }; + # Add stuff for your user as you see fit: + # programs.neovim.enable = true; + home.packages = with pkgs; [ openvpn ]; + + # Enable home-manager and git + programs.home-manager.enable = true; + programs.git.enable = true; + + # Nicely reload system units when changing configs + systemd.user.startServices = "sd-switch"; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + home.stateVersion = "23.05"; +} diff --git a/home-manager/machines/grymforge/variables.nix b/home-manager/machines/grymforge/variables.nix new file mode 100644 index 0000000..762f024 --- /dev/null +++ b/home-manager/machines/grymforge/variables.nix @@ -0,0 +1,26 @@ +{ config, ... }: +{ + imports = [ ../../../common/nixos/variables-config.nix ]; + + config.var = { + hostname = "grymforge"; + username = "gwg313"; + configDirectory = "/home/" + config.var.username + "/.config/nixos"; + + keyboardLayout = "en_US"; + + location = "Ottawa"; + timeZone = "American/Toronto"; + defaultLocale = "en_US.UTF-8"; + + git = { + username = "gwg313"; + email = "gwg313@pm.me"; + }; + + autoUpgrade = true; + autoGarbageCollector = true; + + theme = import ../../../common/style/vars/grymforge.nix; + }; +} diff --git a/home-manager/machines/wallpaper.jpg b/home-manager/machines/wallpaper.jpg new file mode 100644 index 0000000..4d55dec Binary files /dev/null and b/home-manager/machines/wallpaper.jpg differ diff --git a/home-manager/machines/wallpaper2.png b/home-manager/machines/wallpaper2.png new file mode 100644 index 0000000..1cd2ed9 Binary files /dev/null and b/home-manager/machines/wallpaper2.png differ diff --git a/home-manager/modules/ags.nix b/home-manager/modules/ags.nix new file mode 100644 index 0000000..e55803b --- /dev/null +++ b/home-manager/modules/ags.nix @@ -0,0 +1,16 @@ +# A cat clone with syntax highlighting and Git integration. +{ pkgs, ... }: +{ + programs.ags = { + enable = true; + # null or path, leave as null if you don't want hm to manage the config + # configDir = ../ags; + + # additional packages to add to gjs's runtime + extraPackages = with pkgs; [ + gtksourceview + accountsservice + libdbusmenu-gtk3 + ]; + }; +} diff --git a/home-manager/modules/alacritty.nix b/home-manager/modules/alacritty.nix new file mode 100644 index 0000000..1fa8aba --- /dev/null +++ b/home-manager/modules/alacritty.nix @@ -0,0 +1,26 @@ +# A fast, GPU-accelerated terminal emulator. +{ + pkgs, + lib, + ... +}: +{ + programs.alacritty = { + enable = true; + settings = { + env = { + TERM = "xterm-256color"; + }; + font = { + normal = { + # family = lib.mkForce "Monaspace Krypton"; + family = lib.mkForce "Comic Code"; + }; + }; + }; + }; + home.packages = with pkgs; [ + ueberzugpp + monaspace + ]; +} diff --git a/home-manager/modules/ansible.nix b/home-manager/modules/ansible.nix new file mode 100644 index 0000000..e24b8c7 --- /dev/null +++ b/home-manager/modules/ansible.nix @@ -0,0 +1,13 @@ +{ + config, + lib, + pkgs, + ... +}: { + home.packages = with pkgs; [ + ansible # Open-source automation platform for configuration management, application deployment, and task automation. + ansible-doctor # Ansible utility for diagnosing and troubleshooting common issues. + ansible-later # Ansible plugin for scheduling tasks to run later. + molecule # Testing framework for testing Ansible roles and playbooks in various environments. + ]; +} diff --git a/home-manager/modules/atuin.nix b/home-manager/modules/atuin.nix new file mode 100644 index 0000000..0ade0ff --- /dev/null +++ b/home-manager/modules/atuin.nix @@ -0,0 +1,9 @@ +# ✨ Magical shell history +{...}: { + programs.atuin = { + enable = true; + flags = [ + "--disable-up-arrow" + ]; + }; +} diff --git a/home-manager/modules/bat.nix b/home-manager/modules/bat.nix new file mode 100644 index 0000000..f53b995 --- /dev/null +++ b/home-manager/modules/bat.nix @@ -0,0 +1,6 @@ +# A cat clone with syntax highlighting and Git integration. +{...}: { + programs.bat = { + enable = true; + }; +} diff --git a/home-manager/modules/broot.nix b/home-manager/modules/broot.nix new file mode 100644 index 0000000..bc473a5 --- /dev/null +++ b/home-manager/modules/broot.nix @@ -0,0 +1,7 @@ +# An interactive treeview directory navigator +{...}: { + programs.broot = { + enable = true; + enableZshIntegration = true; + }; +} diff --git a/home-manager/modules/btop.nix b/home-manager/modules/btop.nix new file mode 100644 index 0000000..dcd59ed --- /dev/null +++ b/home-manager/modules/btop.nix @@ -0,0 +1,6 @@ +{ ... }: +{ + programs.btop = { + enable = true; + }; +} diff --git a/home-manager/modules/common-gui.nix b/home-manager/modules/common-gui.nix new file mode 100644 index 0000000..5d15883 --- /dev/null +++ b/home-manager/modules/common-gui.nix @@ -0,0 +1,28 @@ +{ pkgs, ... }: +{ + imports = [ + ./alacritty.nix + ./fuzzel.nix + ./kitty.nix + ./ghostty.nix + ./obs.nix + ./thunar.nix + ./zen.nix + ./mime.nix + ./nixcord.nix + ]; + + fonts.fontconfig.enable = true; + + # Bluetooth power alerts + services.poweralertd.enable = true; + + home.packages = with pkgs; [ + # fonts + nerd-fonts.monaspace + noto-fonts-cjk-sans + rPackages.fontawesome + ubuntu_font_family + yt-dlp + ]; +} diff --git a/home-manager/modules/common.nix b/home-manager/modules/common.nix new file mode 100644 index 0000000..69bffda --- /dev/null +++ b/home-manager/modules/common.nix @@ -0,0 +1,120 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + imports = [ + ./atuin.nix + ./bat.nix + ./btop.nix + # ./broot.nix + ./eza.nix + ./lazygit.nix + ./git.nix + ./pass.nix + ./starship.nix + ./tmux/tmux.nix + ./zoxide.nix + ./zsh.nix + ./fzf.nix + ./nushell/default.nix + ]; + nixpkgs.config.allowUnfree = true; + + home.packages = + with pkgs; + [ + ncdu + minio-client + + # Editors + # neovim # Improved version of vim, often used with overlays. + # vim # Highly configurable text editor popular for efficiency and extensibility. + + sshfs + lurk + + # Builtin Replacements + bottom # Similar to 'htop,' providing a top-like interface with additional features. + colordiff # Tool to colorize 'diff' output, making differences between files easier to spot. + du-dust # Modern replacement for 'du,' offering intuitive and visually appealing disk usage analysis. + duf # Disk Usage/Free utility with a user-friendly interface for visualizing disk space consumption and information. + eza # Modern replacement for 'ls' with additional features and a user-friendly interface. + fd # Faster and user-friendly alternative to 'find' for searching and locating files. + fzf # Fuzzy finder for rapid file and directory searches. + htop # Modern and interactive process viewer, an improved alternative to 'top.' + moar # A syntax highlighting pager + ripgrep # Faster alternative to 'grep,' recursively searching directories for a regex pattern. + rm-improved # Enhanced file and directory removal tool with interactive prompts, advanced options, and improved user feedback. + tealdeer # Command-line utility providing simplified and community-driven man pages. + pay-respects # Handy tool that corrects mistyped console commands. + viddy # A modern watch command. Time machine and pager etc. + + # Multiplexers + tmate # Terminal multiplexer allowing multiple users to access a single session. + + # Misc Tools + hyperfine # Command-line benchmarking tool. + mkvtoolnix # Set of tools to create, alter, and inspect Matroska files (MKV). + p7zip # Command-line tool for handling 7z compressed files. + rclone # Command-line program to manage files on cloud storage with support for a wide range of providers and advanced synchronization features. + restic # Secure and efficient backup tool with deduplication, encryption, and flexible storage options. + scc # Source code counter for various programming languages, providing code statistics and complexity analysis. + tree # Displays directory structure in a tree-like format. + unzip # Command-line tool for extracting files from ZIP archives. + yt-dlp # Fork of youtube-dl, facilitating video downloads from various sites. + age + portal + atac + dblab + gobang + lazyjournal + + # TUI Apps + #ncdu_2 + + # Networking + dig # A command-line tool for querying DNS name servers, providing detailed information about domain names, IP addresses, and DNS records. + gping # Ping with TUI for a visual representation of network connectivity. + iperf # Tool for measuring maximum TCP and UDP bandwidth performance. + nmap # Network scanning tool for discovering hosts and services. + rsync # Fast and versatile file copying and synchronization tool. + speedtest-cli # Command-line interface for testing internet bandwidth. + wget # Command-line utility for downloading files from the web. + + picocom # Minimal terminal emulator for microcontrollers. + + # Docs + gnumake # GNU make tool, a build automation tool for compiling projects. + pandoc # Document converter transforming files between markup formats. + + # Useful Utils + buku # Powerful command-line bookmark manager, providing a flexible and efficient way to organize, search, and access your bookmarks securely. + entr # Event notifier for automation and development, executing commands whenever files change in the specified directory. + git-cliff # Tool for visualizing project commit history and generating release notes. + grex # Tool generating regular expressions from user-provided test cases. + sshs + + # Nix Tools + alejandra # Nix code formatter. + direnv # Environment switcher for the shell. + nix-direnv # Integration of direnv with the Nix package manager. + nix-init # Simplifies the process of creating Nix projects. + nix-prefetch-github # Tool for fetching the latest version and hash of a GitHub repository. + ] + ++ lib.optionals stdenv.isDarwin [ + coreutils # Essential GNU core utilities, including `dd` with the `--status=progress` option for more informative progress reporting. + time # GNU time command, providing more detailed and accurate information about the resource usage of a command or process. + wifi-password # Command-line tool to quickly retrieve the current Wi-Fi password, simplifying access to network credentials. + ] + ++ lib.optionals stdenv.isLinux [ + bandwhich # Network bandwidth monitor that identifies and displays bandwidth usage per process, helping to pinpoint data-hungry applications. + bmon # Bandwidth monitoring tool that visually represents network usage with a simple and easy-to-read interface. + iftop # Network monitoring tool that displays a real-time, interactive view of network bandwidth usage by different connections. + iotop # Disk I/O monitoring tool that provides a top-like interface to showcase real-time disk activity and identify performance bottlenecks. + iputils # Package providing essential network utilities such as `ping` and `ifconfig` for network diagnostics and configuration. + libuuid # Library for generating universally unique identifiers (UUIDs), with the `uuidgen` utility included. (Note: Already pre-installed on macOS.) + ]; +} diff --git a/home-manager/modules/devenv.nix b/home-manager/modules/devenv.nix new file mode 100644 index 0000000..2c9eacf --- /dev/null +++ b/home-manager/modules/devenv.nix @@ -0,0 +1,16 @@ +{ + config, + lib, + pkgs, + inputs, + ... +}: { + home.packages = with pkgs; [ + cachix + # inputs.devenv.packages.${system}.devenv + devenv + ]; + + programs.direnv.enable = true; + programs.direnv.nix-direnv.enable = true; +} diff --git a/home-manager/modules/discord/default.nix b/home-manager/modules/discord/default.nix new file mode 100644 index 0000000..816cfcb --- /dev/null +++ b/home-manager/modules/discord/default.nix @@ -0,0 +1,46 @@ +{ + config, + pkgs, + lib, + ... +}: +let + cfg = config.programs.discord; + + discordPatcherBin = pkgs.writers.writePython3Bin "discord-krisp-patcher" { + libraries = with pkgs.python3Packages; [ + pyelftools + capstone + ]; + flakeIgnore = [ + "E265" # from nix-shell shebang + "E501" # line too long (82 > 79 characters) + "F403" # 'from module import *' used; unable to detect undefined names + "F405" # name may be undefined, or defined from star imports: module + ]; + } (builtins.readFile ./krisp-patcher.py); + + wrapDiscordBinary = pkgs.writeShellScriptBin "discord" '' + ${pkgs.findutils}/bin/find -L $HOME/.config/discord -name 'discord_krisp.node' -exec ${discordPatcherBin}/bin/discord-krisp-patcher {} + + ${pkgs.discord}/bin/discord "$@" + ''; + + discord = pkgs.discord.override { + # Performance mod + withOpenASAR = true; + # link fix + nss = pkgs.nss_latest; + }; +in +{ + options.programs.discord = { + enable = lib.mkEnableOption "Discord"; + wrapDiscord = lib.mkEnableOption "wrap the Discord binary with a patching each time"; + }; + + config = lib.mkIf cfg.enable { + home.packages = [ + discordPatcherBin + ] ++ (if cfg.wrapDiscord then [ wrapDiscordBinary ] else [ pkgs.discord ]); + }; +} diff --git a/home-manager/modules/discord/krisp-patcher.py b/home-manager/modules/discord/krisp-patcher.py new file mode 100644 index 0000000..984036c --- /dev/null +++ b/home-manager/modules/discord/krisp-patcher.py @@ -0,0 +1,87 @@ +import shutil +import sys + +from capstone import * +from capstone.x86 import * +from elftools.elf.elffile import ELFFile + +if len(sys.argv) < 2: + print(f"Usage: {sys.argv[0]} [path to discord_krisp.node]") + # "Unix programs generally use 2 for command line syntax errors and 1 for all other kind of errors." + sys.exit(2) + +executable = sys.argv[1] + +elf = ELFFile(open(executable, "rb")) +symtab = elf.get_section_by_name(".symtab") + +krisp_initialize_address = symtab.get_symbol_by_name("_ZN7discord15KrispInitializeEv")[ + 0 +].entry.st_value +isSignedByDiscord_address = symtab.get_symbol_by_name( + "_ZN7discord4util17IsSignedByDiscordERKNSt2Cr12basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE" +)[0].entry.st_value + +text = elf.get_section_by_name(".text") +text_start = text["sh_addr"] +text_start_file = text["sh_offset"] +# This seems to always be zero (.text starts at the right offset in the file). Do it just in case? +address_to_file = text_start_file - text_start + +# Done with the ELF now. +# elf.close() + +krisp_initialize_offset = krisp_initialize_address - address_to_file +isSignedByDiscord_offset = krisp_initialize_address - address_to_file + +f = open(executable, "rb") +f.seek(krisp_initialize_offset) +krisp_initialize = f.read(64) +f.close() + +# States +found_issigned_by_discord_call = False +found_issigned_by_discord_test = False +found_issigned_by_discord_je = False +found_already_patched = False +je_location = None + +# We are looking for a call to IsSignedByDiscord, followed by a test, followed by a je. +# Then we patch the je into a two byte nop. + +md = Cs(CS_ARCH_X86, CS_MODE_64) +md.detail = True +for i in md.disasm(krisp_initialize, krisp_initialize_address): + if i.id == X86_INS_CALL: + if i.operands[0].type == X86_OP_IMM: + if i.operands[0].imm == isSignedByDiscord_address: + found_issigned_by_discord_call = True + + if i.id == X86_INS_TEST: + if found_issigned_by_discord_call: + found_issigned_by_discord_test = True + + if i.id == X86_INS_JE: + if found_issigned_by_discord_test: + found_issigned_by_discord_je = True + je_location = i.address + break + + if i.id == X86_INS_NOP: + if found_issigned_by_discord_test: + found_already_patched = True + break + +if je_location: + print(f"Found patch location: 0x{je_location:x}") + + shutil.copyfile(executable, executable + ".orig") + f = open(executable, "rb+") + f.seek(je_location - address_to_file) + f.write(b"\x66\x90") # Two byte NOP + f.close() +else: + if found_already_patched: + print("Couldn't find patch location - already patched.") + else: + print("Couldn't find patch location - review manually. Sorry.") diff --git a/home-manager/modules/eza.nix b/home-manager/modules/eza.nix new file mode 100644 index 0000000..302ae90 --- /dev/null +++ b/home-manager/modules/eza.nix @@ -0,0 +1,16 @@ +# A modern replacement for 'ls'. +{ ... }: +{ + programs.eza = { + enable = true; + enableZshIntegration = true; + git = true; + icons = "auto"; + extraOptions = [ + "--group-directories-first" + "--no-quotes" + "--git-ignore" + "--icons=always" + ]; + }; +} diff --git a/home-manager/modules/fuzzel.nix b/home-manager/modules/fuzzel.nix new file mode 100644 index 0000000..89e6f9e --- /dev/null +++ b/home-manager/modules/fuzzel.nix @@ -0,0 +1,6 @@ +# Application launcher for wlroots based Wayland compositors, similar to rofi's `drun` mode. +{...}: { + programs.fuzzel = { + enable = true; + }; +} diff --git a/home-manager/modules/fzf.nix b/home-manager/modules/fzf.nix new file mode 100644 index 0000000..41568ba --- /dev/null +++ b/home-manager/modules/fzf.nix @@ -0,0 +1,35 @@ +# Fzf is a general-purpose command-line fuzzy finder. +{ + config, + lib, + ... +}: +let + accent = "#" + config.lib.stylix.colors.base0D; + foreground = "#" + config.lib.stylix.colors.base05; + muted = "#" + config.lib.stylix.colors.base03; +in +{ + programs.fzf = { + enable = true; + enableZshIntegration = true; + colors = lib.mkForce { + "fg+" = accent; + "bg+" = "-1"; + "fg" = foreground; + "bg" = "-1"; + "prompt" = muted; + "pointer" = accent; + }; + defaultOptions = [ + "--margin=1" + "--layout=reverse" + "--border=none" + "--info='hidden'" + "--header=''" + "--prompt='/ '" + "-i" + "--no-bold" + ]; + }; +} diff --git a/home-manager/modules/gammastep.nix b/home-manager/modules/gammastep.nix new file mode 100644 index 0000000..1256e14 --- /dev/null +++ b/home-manager/modules/gammastep.nix @@ -0,0 +1,12 @@ +{ + services.gammastep = { + enable = true; + latitude = 45.4; + longitude = -75.7; + temperature = { + day = 6500; + night = 3500; + }; + tray = true; + }; +} diff --git a/home-manager/modules/gh-dash.nix b/home-manager/modules/gh-dash.nix new file mode 100644 index 0000000..79d55b2 --- /dev/null +++ b/home-manager/modules/gh-dash.nix @@ -0,0 +1,63 @@ +{...}: { + programs.gh-dash = { + enable = true; + settings = { + defaults = { + prsLimit = 20; + issuesLimit = 20; + layout = { + prs = { + repo = { + grow = true; + width = 10; + hidden = false; + }; + }; + }; + }; + prSections = [ + { + title = "My Pull Requests"; + filters = "is:open author:@me"; + } + { + title = "Needs My Review"; + filters = "is:open review-requested:@me"; + } + { + title = "Nixvim"; + filters = "is:open repo:nix-community/nixvim"; + } + ]; + issuesSections = [ + { + title = "Created"; + filters = "is:open author:@me"; + } + { + title = "Assigned"; + filters = "is:open assignee:@me"; + } + { + title = "Subscribed"; + filters = "is:open -author:@me"; + } + ]; + repoPaths = { + "NixOS/nixpkgs" = "~/repos/nix/nixpkgs"; + "nix-community/*" = "~/repos/nix-community/*"; + }; + keybindings = { + prs = [ + { + key = "C"; + command = "tmux split-window -h -c {{.RepoPath}} 'gh pr checkout {{.PrNumber}} && nvim -c \":Octo pr edit {{.PrNumber}}\"'"; + } + ]; + }; + pager = { + diff = "delta"; + }; + }; + }; +} diff --git a/home-manager/modules/ghostty.nix b/home-manager/modules/ghostty.nix new file mode 100644 index 0000000..e9ba672 --- /dev/null +++ b/home-manager/modules/ghostty.nix @@ -0,0 +1,25 @@ +{ + pkgs, + lib, + ... +}: +{ + programs.ghostty = { + enable = true; + enableZshIntegration = true; + settings = { + auto-update = "off"; + # background-opacity = 0.8; + background-opacity = 1; + confirm-close-surface = false; + font-family = lib.mkForce "Comic Code Ligatures"; + font-size = 16; + gtk-titlebar = false; + # theme = "Teerb"; + }; + + }; + home.packages = with pkgs; [ + ueberzugpp + ]; +} diff --git a/home-manager/modules/git.nix b/home-manager/modules/git.nix new file mode 100644 index 0000000..6f7b7ad --- /dev/null +++ b/home-manager/modules/git.nix @@ -0,0 +1,154 @@ +{ + config, + lib, + pkgs, + user, + ... +}: +{ + programs.git = { + enable = true; + userName = "gwg313"; + userEmail = "gwg313@pm.me"; + extraConfig = { + credential = { + helper = "!pass-git-helper $@"; + }; + user = { + signingkey = "60FF63B4826B7400"; + }; + commit = { + gpgsign = true; + verbose = "true"; + }; + diff = { + algorithm = "histogram"; + colorMoved = "plain"; + mnemonicPrefix = "true"; + renames = "true"; + compactionHeuristic = "true"; + tool = "nvimdiff"; + }; + "difftool \"nvimdiff\"" = { + cmd = "nvim -d \"$LOCAL\" \"$REMOTE\" -c \"wincmd w\" -c \"wincmd L\""; + }; + merge = { + tool = "nvimdiff4"; + prompt = "false"; + conflictstyle = "zdiff3"; + }; + "mergetool \"nvimdiff4\"" = { + cmd = "nvim -d $LOCAL $BASE $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'"; + }; + mergetool = { + keepBackup = false; + }; + init = { + defaultBranch = "main"; + }; + core = { + pager = "delta"; + editor = "nvim"; + }; + delta = { + features = "line-numbers decorations"; + navigate = "true"; + whitespace-error-style = "22 reverse"; + }; + interactive = { + diffFilter = "delta --color-only"; + }; + push = { + default = "simple"; + autoSetupRemote = "true"; + followTags = "true"; + }; + pull = { + rebase = "true"; + }; + rebase = { + autoSquash = "true"; + autoStash = "true"; + updateRefs = "true"; + }; + fetch = { + prune = "true"; + pruneTags = "true"; + all = "true"; + }; + tag = { + sort = "version:refname"; + }; + branch = { + sort = "-committerdate"; + }; + + help = { + autocorrect = "true"; + }; + rerere = { + enabled = "true"; + autoupdate = "true"; + }; + + color.ui = "1"; + }; + ignores = [ + "__pycache__" + ".direnv" + "npm-debug.log" + ".cache/" + ".DS_Store" + ".idea/" + "*.swp" + "*.elc" + "auto-save-list" + ".direnv/" + "node_modules" + "result" + "result-*" + ]; + }; + + programs.zsh = { + shellAliases = { + trackme = "git branch --set-upstream-to=origin/$(git symbolic-ref --short HEAD)"; + rebasemain = "git pull origin main --rebase"; + hist = ''log --pretty=format:"%Cgreen%h %Creset%cd %Cblue[%cn] %Creset%s%C(yellow)%d%C(reset)" --graph --date=relative --decorate --all''; + llog = ''log --graph --name-status --pretty=format:"%C(red)%h %C(reset)(%cd) %C(green)%an %Creset%s %C(yellow)%d%Creset" --date=relative''; + g = "lazygit"; + ga = "git add"; + gc = "git commit"; + gcu = "git add . && git commit -m 'Update'"; + gp = "git push"; + gpl = "git pull"; + gs = "git status"; + gd = "git diff"; + gco = "git checkout"; + gcb = "git checkout -b"; + gbr = "git branch"; + grs = "git reset HEAD~1"; + grh = "git reset --hard HEAD~1"; + + gaa = "git add ."; + gcm = "git commit -m"; + }; + }; + + home.packages = with pkgs; [ + cocogitto + delta + lazygit + gh + pre-commit + graphite-cli + tig + pass-git-helper + ]; + + xdg.configFile."pass-git-helper/git-pass-mapping.ini".text = '' + [git.gwg313.xyz*] + target=git/https/git.gwg313.xyz + line_username=1 + ''; +} diff --git a/home-manager/modules/hyprland/animations.nix b/home-manager/modules/hyprland/animations.nix new file mode 100644 index 0000000..ec0c90e --- /dev/null +++ b/home-manager/modules/hyprland/animations.nix @@ -0,0 +1,56 @@ +{ config, ... }: +let + animationSpeed = config.theme.animation-speed; + + animationDuration = + if animationSpeed == "slow" then + "4" + else if animationSpeed == "medium" then + "2.5" + else + "1.5"; + borderDuration = + if animationSpeed == "slow" then + "10" + else if animationSpeed == "medium" then + "6" + else + "3"; +in +{ + wayland.windowManager.hyprland.settings = { + animations = { + enabled = true; + bezier = [ + "linear, 0, 0, 1, 1" + "md3_standard, 0.2, 0, 0, 1" + "md3_decel, 0.05, 0.7, 0.1, 1" + "md3_accel, 0.3, 0, 0.8, 0.15" + "overshot, 0.05, 0.9, 0.1, 1.1" + "crazyshot, 0.1, 1.5, 0.76, 0.92" + "hyprnostretch, 0.05, 0.9, 0.1, 1.0" + "menu_decel, 0.1, 1, 0, 1" + "menu_accel, 0.38, 0.04, 1, 0.07" + "easeInOutCirc, 0.85, 0, 0.15, 1" + "easeOutCirc, 0, 0.55, 0.45, 1" + "easeOutExpo, 0.16, 1, 0.3, 1" + "softAcDecel, 0.26, 0.26, 0.15, 1" + "md2, 0.4, 0, 0.2, 1" + ]; + + animation = [ + "windows, 1, ${animationDuration}, md3_decel, popin 60%" + "windowsIn, 1, ${animationDuration}, md3_decel, popin 60%" + "windowsOut, 1, ${animationDuration}, md3_accel, popin 60%" + "border, 1, ${borderDuration}, default" + "fade, 1, ${animationDuration}, md3_decel" + "layersIn, 1, ${animationDuration}, menu_decel, slide" + "layersOut, 1, ${animationDuration}, menu_accel" + "fadeLayersIn, 1, ${animationDuration}, menu_decel" + "fadeLayersOut, 1, ${animationDuration}, menu_accel" + "workspaces, 1, ${animationDuration}, menu_decel, slide" + "specialWorkspace, 1, ${animationDuration}, md3_decel, slidevert" + ]; + }; + }; +} diff --git a/home-manager/modules/hyprland/bindings.nix b/home-manager/modules/hyprland/bindings.nix new file mode 100644 index 0000000..fa2f867 --- /dev/null +++ b/home-manager/modules/hyprland/bindings.nix @@ -0,0 +1,70 @@ +{ pkgs, ... }: +{ + wayland.windowManager.hyprland.settings = { + bindm = [ + # mouse movements + "$mod, mouse:272, movewindow" + "$mod_ALT, mouse:273, resizewindow" + "$mod_ALT, mouse:272, resizewindow" + ]; + + "$mod" = "SUPER"; + + bind = + [ + # general binds + ",switch:Lid Switch, exec, ${pkgs.hyprlock}/bin/hyprlock" # Lock when closing Lid + # "$mod, RETURN, exec, ${pkgs.alacritty}/bin/alacritty" + "$mod, RETURN, exec, ${pkgs.kitty}/bin/kitty" + "$shiftMod,SPACE, exec, hyprfocus-toggle" # Toggle HyprFocus + "$mod, Q, killactive" + "SUPER_SHIFT, Q, exec, ${pkgs.wlogout}/bin/wlogout" + "$mod, SPACE, exec, pkill fuzzel || ${pkgs.fuzzel}/bin/fuzzel" # pkill or allows for toggle + "SUPER_SHIFT, SPACE, togglefloating" + # "$mod, F, fullscreen" + "$mod,F, fullscreen" # Toggle fullscreen + "$mod, L, exec, ${pkgs.hyprlock}/bin/hyprlock" + "$mod, B, exec, ${pkgs.grim}/bin/grim \"desktop-$(${pkgs.busybox}/bin/date +\"%Y%m%d%H%m\").png" + "SUPER_SHIFT, B, exec, ${pkgs.grim}/bin/grim -g \"$(${pkgs.slurp}/bin/slurp -d)\" - | ${pkgs.wl-clipboard}/bin/wl-copy" # Screenshot selection directly to clipboard + + # move focus + "$mod, left, movefocus, l" + "$mod, right, movefocus, r" + "$mod, up, movefocus, u" + "$mod, down, movefocus, d" + "$mod,right,workspace,+1" + "$mod,left,workspace,-1" + + # Scroll through workspaces + "$mod, mouse_down, workspace, e+1" + "$mod, mouse_up, workspace, e-1" + ] + ++ (builtins.concatLists ( + builtins.genList ( + i: + let + ws = i + 1; + in + [ + "$mod,code:1${toString i}, workspace, ${toString ws}" + "$mod SHIFT,code:1${toString i}, movetoworkspace, ${toString ws}" + ] + ) 9 + )); + + bindl = [ + ",XF86AudioMute, exec, sound-toggle" # Toggle Mute + ",XF86AudioPlay, exec, ${pkgs.playerctl}/bin/playerctl play-pause" # Play/Pause Song + ",XF86AudioNext, exec, ${pkgs.playerctl}/bin/playerctl next" # Next Song + ",XF86AudioPrev, exec, ${pkgs.playerctl}/bin/playerctl previous" # Previous Song + ",switch:Lid Switch, exec, ${pkgs.hyprlock}/bin/hyprlock" # Lock when closing Lid + ]; + + bindle = [ + ",XF86AudioRaiseVolume, exec, sound-up" # Sound Up + ",XF86AudioLowerVolume, exec, sound-down" # Sound Down + ",XF86MonBrightnessUp, exec, brightness-up" # Brightness Up + ",XF86MonBrightnessDown, exec, brightness-down" # Brightness Down + ]; + }; +} diff --git a/home-manager/modules/hyprland/default.nix b/home-manager/modules/hyprland/default.nix new file mode 100644 index 0000000..26d34b7 --- /dev/null +++ b/home-manager/modules/hyprland/default.nix @@ -0,0 +1,209 @@ +# So best window tiling manager +{ + pkgs, + config, + inputs, + lib, + ... +}: +let + border-size = config.theme.border-size; + gaps-in = config.theme.gaps-in; + gaps-out = config.theme.gaps-out; + active-opacity = config.theme.active-opacity; + inactive-opacity = config.theme.inactive-opacity; + rounding = config.theme.rounding; + blur = config.theme.blur; + keyboardLayout = config.var.keyboardLayout; + background = "rgb(" + config.lib.stylix.colors.base00 + ")"; +in +{ + imports = [ + ./animations.nix + ./bindings.nix + ./polkitagent.nix + ./hyprspace.nix + ./hyprpanel.nix + ./hyprlock.nix + ../gammastep.nix + ]; + + home.packages = with pkgs; [ + qt5.qtwayland + qt6.qtwayland + libsForQt5.qt5ct + qt6ct + hyprshot + hyprpicker + swappy + imv + wf-recorder + wlr-randr + wl-clipboard + brightnessctl + gnome-themes-extra + libva + dconf + wayland-utils + wayland-protocols + glib + direnv + meson + ]; + + wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = true; + systemd = { + enable = false; + variables = [ + "--all" + ]; # https://wiki.hyprland.org/Nix/Hyprland-on-Home-Manager/#programs-dont-work-in-systemd-services-but-do-on-the-terminal + }; + package = null; + portalPackage = null; + + settings = { + "$mod" = "SUPER"; + "$shiftMod" = "SUPER_SHIFT"; + + exec-once = [ + "dbus-update-activation-environment --systemd --all &" + "systemctl --user enable --now hyprpaper.service &" + "systemctl --user enable --now hypridle.service &" + "systemctl --user enable --now nextcloud-client.service &" + ]; + + monitor = [ + "eDP-2,highres,0x0,1" # My internal laptop screen + ",prefered,auto,1" # default + ]; + + env = [ + "XDG_CURRENT_DESKTOP,Hyprland" + "MOZ_ENABLE_WAYLAND,1" + "ANKI_WAYLAND,1" + "DISABLE_QT5_COMPAT,0" + "NIXOS_OZONE_WL,1" + "XDG_SESSION_TYPE,wayland" + "XDG_SESSION_DESKTOP,Hyprland" + "QT_AUTO_SCREEN_SCALE_FACTOR,1" + "QT_QPA_PLATFORM=wayland,xcb" + "QT_WAYLAND_DISABLE_WINDOWDECORATION,1" + "ELECTRON_OZONE_PLATFORM_HINT,auto" + "__GL_GSYNC_ALLOWED,0" + "__GL_VRR_ALLOWED,0" + "DISABLE_QT5_COMPAT,0" + "DIRENV_LOG_FORMAT," + "WLR_DRM_NO_ATOMIC,1" + "WLR_BACKEND,vulkan" + "WLR_RENDERER,vulkan" + "WLR_NO_HARDWARE_CURSORS,1" + "SDL_VIDEODRIVER,wayland" + "CLUTTER_BACKEND,wayland" + ]; + + cursor = { + no_hardware_cursors = true; + default_monitor = "eDP-2"; + }; + + general = { + resize_on_border = true; + gaps_in = gaps-in; + gaps_out = gaps-out; + border_size = border-size; + layout = "master"; + "col.inactive_border" = lib.mkForce background; + }; + + decoration = { + active_opacity = active-opacity; + inactive_opacity = inactive-opacity; + rounding = rounding; + shadow = { + enabled = true; + range = 20; + render_power = 3; + }; + blur = { + enabled = if blur then "true" else "false"; + size = 18; + }; + }; + + master = { + new_status = true; + allow_small_split = true; + mfact = 0.5; + }; + + gestures = { + workspace_swipe = true; + }; + + misc = { + vfr = true; + disable_hyprland_logo = true; + disable_splash_rendering = true; + disable_autoreload = true; + focus_on_activate = true; + new_window_takes_over_fullscreen = 2; + }; + + windowrulev2 = [ + "float, tag:modal" + "pin, tag:modal" + "center, tag:modal" + # telegram media viewer + "float, title:^(Media viewer)$" + + # Bitwarden extension + "float, title:^(.*Bitwarden Password Manager.*)$" + + # gnome calculator + "float, class:^(org.gnome.Calculator)$" + "size 360 490, class:^(org.gnome.Calculator)$" + + # make Firefox/Zen PiP window floating and sticky + "float, title:^(Picture-in-Picture)$" + "pin, title:^(Picture-in-Picture)$" + + # idle inhibit while watching videos + "idleinhibit focus, class:^(mpv|.+exe|celluloid)$" + "idleinhibit focus, class:^(zen)$, title:^(.*YouTube.*)$" + "idleinhibit fullscreen, class:^(zen)$" + + "dimaround, class:^(gcr-prompter)$" + "dimaround, class:^(xdg-desktop-portal-gtk)$" + "dimaround, class:^(polkit-gnome-authentication-agent-1)$" + "dimaround, class:^(zen)$, title:^(File Upload)$" + + # fix xwayland apps + "rounding 0, xwayland:1" + "center, class:^(.*jetbrains.*)$, title:^(Confirm Exit|Open Project|win424|win201|splash)$" + "size 640 400, class:^(.*jetbrains.*)$, title:^(splash)$" + ]; + + layerrule = [ + "noanim, launcher" + "noanim, ^ags-.*" + ]; + + input = { + # kb_layout = keyboardLayout; + + follow_mouse = 1; + sensitivity = 0.5; + repeat_delay = 300; + repeat_rate = 50; + numlock_by_default = true; + + touchpad = { + natural_scroll = true; + clickfinger_behavior = true; + }; + }; + }; + }; +} diff --git a/home-manager/modules/hyprland/hypridle.nix b/home-manager/modules/hyprland/hypridle.nix new file mode 100644 index 0000000..7023b31 --- /dev/null +++ b/home-manager/modules/hyprland/hypridle.nix @@ -0,0 +1,27 @@ +# Hypridle is a daemon that listens for user activity and runs commands when the user is idle. +{ pkgs, ... }: +{ + services.hypridle = { + enable = true; + settings = { + general = { + ignore_dbus_inhibit = false; + lock_cmd = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; + before_sleep_cmd = "loginctl lock-session"; + after_sleep_cmd = "hyprctl dispatch dpms on"; + }; + + listener = [ + { + timeout = 600; + on-timeout = "pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock"; + } + + # { + # timeout = 660; + # on-timeout = "systemctl suspend"; + # } + ]; + }; + }; +} diff --git a/home-manager/modules/hyprland/hyprlock.nix b/home-manager/modules/hyprland/hyprlock.nix new file mode 100644 index 0000000..74f8b1c --- /dev/null +++ b/home-manager/modules/hyprland/hyprlock.nix @@ -0,0 +1,91 @@ +{ + config, + lib, + ... +}: +let + foreground = "rgba(${config.theme.textColorOnWallpaper}ee)"; + font = config.stylix.fonts.serif.name; +in +{ + programs.hyprlock = { + enable = true; + settings = { + general = { + grace = 5; + no_fade_in = false; + disable_loading_bar = false; + }; + + # BACKGROUND + background = { + monitor = ""; + blur_passes = 0; + contrast = 0.8916; + brightness = 0.7172; + vibrancy = 0.1696; + vibrancy_darkness = 0.0; + }; + + label = [ + { + # Day-Month-Date + monitor = ""; + text = ''cmd[update:1000] echo -e "$(date +"%A, %B %d")"''; + color = foreground; + font_size = 28; + font_family = font + " Bold"; + position = "0, 490"; + halign = "center"; + valign = "center"; + } + # Time + { + monitor = ""; + text = ''cmd[update:1000] echo "$(date +"%I:%M")"''; + color = foreground; + font_size = 160; + font_family = "steelfish outline regular"; + position = "0, 370"; + halign = "center"; + valign = "center"; + } + # USER + { + monitor = ""; + text = " $USER"; + color = foreground; + outline_thickness = 2; + dots_size = 0.2; # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.2; # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = true; + font_size = 18; + font_family = font + " Bold"; + position = "0, -180"; + halign = "center"; + valign = "center"; + } + ]; + + # INPUT FIELD + input-field = lib.mkForce { + monitor = ""; + size = "300, 60"; + outline_thickness = 2; + dots_size = 0.2; # Scale of input-field height, 0.2 - 0.8 + dots_spacing = 0.2; # Scale of dots' absolute size, 0.0 - 1.0 + dots_center = true; + outer_color = "rgba(25, 25, 25, 0)"; + inner_color = "rgba(25, 25, 25, 0.1)"; + font_color = foreground; + fade_on_empty = false; + font_family = font + " Bold"; + placeholder_text = "🔒 Enter Password"; + hide_input = false; + position = "0, -250"; + halign = "center"; + valign = "center"; + }; + }; + }; +} diff --git a/home-manager/modules/hyprland/hyprpanel.nix b/home-manager/modules/hyprland/hyprpanel.nix new file mode 100644 index 0000000..1cd1bb1 --- /dev/null +++ b/home-manager/modules/hyprland/hyprpanel.nix @@ -0,0 +1,214 @@ +# Hyprpanel is the bar on top of the screen +# Display information like workspaces, battery, wifi, ... +{ config, ... }: +let + transparentButtons = config.theme.bar.transparentButtons; + + accent = "#${config.lib.stylix.colors.base0D}"; + accent-alt = "#${config.lib.stylix.colors.base03}"; + background = "#${config.lib.stylix.colors.base00}"; + background-alt = "#${config.lib.stylix.colors.base01}"; + foreground = "#${config.lib.stylix.colors.base05}"; + foregroundOnWallpaper = "#${config.theme.textColorOnWallpaper}"; + font = "${config.stylix.fonts.serif.name}"; + fontSizeForHyprpanel = "${toString config.stylix.fonts.sizes.desktop}px"; + + rounding = config.theme.rounding; + border-size = config.theme.border-size; + + gaps-out = config.theme.gaps-out; + gaps-in = config.theme.gaps-in; + + floating = config.theme.bar.floating; + transparent = config.theme.bar.transparent; + position = config.theme.bar.position; # "top" ou "bottom" + + notificationOpacity = 90; + + location = config.var.location; +in +{ + wayland.windowManager.hyprland.settings.exec-once = [ "hyprpanel" ]; + + programs.hyprpanel = { + enable = true; + + settings = { + layout = { + bar.layouts = { + "*" = { + "left" = [ + "dashboard" + "workspaces" + "windowtitle" + ]; + "middle" = [ + "media" + "cava" + ]; + "right" = [ + "systray" + "volume" + "bluetooth" + "battery" + "network" + "clock" + "notifications" + ]; + }; + }; + }; + + theme.font.name = font; + theme.font.size = fontSizeForHyprpanel; + + theme.bar.outer_spacing = if floating && transparent then "0px" else "8px"; + theme.bar.buttons.y_margins = if floating && transparent then "0px" else "8px"; + theme.bar.buttons.spacing = "0.3em"; + theme.bar.buttons.radius = + (if transparent then toString rounding else toString (rounding - 8)) + "px"; + theme.bar.floating = floating; + theme.bar.buttons.padding_x = "0.8rem"; + theme.bar.buttons.padding_y = "0.4rem"; + + theme.bar.margin_top = (if position == "top" then toString (gaps-in * 2) else "0") + "px"; + theme.bar.margin_bottom = (if position == "top" then "0" else toString (gaps-in * 2)) + "px"; + theme.bar.margin_sides = toString gaps-out + "px"; + theme.bar.border_radius = toString rounding + "px"; + theme.bar.transparent = transparent; + theme.bar.location = position; + theme.bar.dropdownGap = "4.5em"; + theme.bar.menus.shadow = if transparent then "0 0 0 0" else "0px 0px 3px 1px #16161e"; + theme.bar.buttons.style = "default"; + theme.bar.buttons.monochrome = true; + theme.bar.menus.monochrome = true; + theme.bar.menus.card_radius = toString rounding + "px"; + theme.bar.menus.border.size = toString border-size + "px"; + theme.bar.menus.border.radius = toString rounding + "px"; + theme.bar.menus.menu.media.card.tint = 90; + + bar.launcher.icon = ""; + bar.workspaces.show_numbered = false; + bar.workspaces.workspaces = 5; + bar.workspaces.numbered_active_indicator = "color"; + bar.workspaces.monitorSpecific = false; + bar.workspaces.applicationIconEmptyWorkspace = ""; + bar.workspaces.showApplicationIcons = true; + bar.workspaces.showWsIcons = true; + + bar.windowtitle.label = true; + bar.volume.label = false; + bar.network.truncation_size = 12; + bar.bluetooth.label = false; + bar.clock.format = "%a %b %d %I:%M %p"; + bar.notifications.show_total = true; + bar.media.show_active_only = true; + + bar.customModules.updates.pollingInterval = 1440000; + bar.customModules.cava.showIcon = false; + bar.customModules.cava.stereo = true; + bar.customModules.cava.showActiveOnly = true; + + notifications.position = "top right"; + notifications.showActionsOnHover = true; + theme.notification.opacity = notificationOpacity; + theme.notification.enableShadow = true; + theme.notification.border_radius = toString rounding + "px"; + + theme.osd.enable = true; + theme.osd.orientation = "vertical"; + theme.osd.location = "left"; + theme.osd.radius = toString rounding + "px"; + theme.osd.margins = "0px 0px 0px 10px"; + theme.osd.muted_zero = true; + + menus.clock.weather.location = location; + menus.clock.weather.unit = "metric"; + menus.dashboard.powermenu.confirmation = false; + menus.dashboard.powermenu.avatar.image = "~/.face.icon"; + + menus.dashboard.shortcuts.left.shortcut1.icon = ""; + menus.dashboard.shortcuts.left.shortcut1.command = "zen"; + menus.dashboard.shortcuts.left.shortcut1.tooltip = "Zen"; + menus.dashboard.shortcuts.left.shortcut2.icon = "󰅶"; + menus.dashboard.shortcuts.left.shortcut2.command = "caffeine"; + menus.dashboard.shortcuts.left.shortcut2.tooltip = "Caffeine"; + menus.dashboard.shortcuts.left.shortcut3.icon = "󰖔"; + menus.dashboard.shortcuts.left.shortcut3.command = "night-shift"; + menus.dashboard.shortcuts.left.shortcut3.tooltip = "Night-shift"; + menus.dashboard.shortcuts.left.shortcut4.icon = ""; + menus.dashboard.shortcuts.left.shortcut4.command = "menu"; + menus.dashboard.shortcuts.left.shortcut4.tooltip = "Search Apps"; + + menus.dashboard.shortcuts.right.shortcut1.icon = ""; + menus.dashboard.shortcuts.right.shortcut1.command = "hyprpicker -a"; + menus.dashboard.shortcuts.right.shortcut1.tooltip = "Color Picker"; + menus.dashboard.shortcuts.right.shortcut3.icon = "󰄀"; + menus.dashboard.shortcuts.right.shortcut3.command = "screenshot region swappy"; + menus.dashboard.shortcuts.right.shortcut3.tooltip = "Screenshot"; + + menus.power.lowBatteryNotification = true; + + wallpaper.enable = false; + + theme.bar.buttons.workspaces.hover = accent-alt; + theme.bar.buttons.workspaces.active = accent; + theme.bar.buttons.workspaces.available = accent-alt; + theme.bar.buttons.workspaces.occupied = accent-alt; + + theme.bar.menus.background = background; + theme.bar.menus.cards = background-alt; + theme.bar.menus.label = foreground; + theme.bar.menus.text = foreground; + theme.bar.menus.border.color = accent; + theme.bar.menus.popover.text = foreground; + theme.bar.menus.popover.background = background-alt; + theme.bar.menus.listitems.active = accent; + theme.bar.menus.icons.active = accent; + theme.bar.menus.switch.enabled = accent; + theme.bar.menus.check_radio_button.active = accent; + theme.bar.menus.buttons.default = accent; + theme.bar.menus.buttons.active = accent; + theme.bar.menus.iconbuttons.active = accent; + theme.bar.menus.progressbar.foreground = accent; + theme.bar.menus.slider.primary = accent; + theme.bar.menus.tooltip.background = background-alt; + theme.bar.menus.tooltip.text = foreground; + theme.bar.menus.dropdownmenu.background = background-alt; + theme.bar.menus.dropdownmenu.text = foreground; + + theme.bar.background = background + (if transparentButtons && transparent then "00" else ""); + theme.bar.buttons.text = + if transparent && transparentButtons then foregroundOnWallpaper else foreground; + theme.bar.buttons.background = + (if transparent then background else background-alt) + (if transparentButtons then "00" else ""); + theme.bar.buttons.icon = accent; + + theme.bar.buttons.notifications.background = background-alt; + theme.bar.buttons.hover = background; + theme.bar.buttons.notifications.hover = background; + theme.bar.buttons.notifications.total = accent; + theme.bar.buttons.notifications.icon = accent; + + theme.osd.bar_color = accent; + theme.osd.bar_overflow_color = accent-alt; + theme.osd.icon = background; + theme.osd.icon_container = accent; + theme.osd.label = accent; + theme.osd.bar_container = background-alt; + + theme.bar.menus.menu.media.background.color = background-alt; + theme.bar.menus.menu.media.card.color = background-alt; + + theme.notification.background = background-alt; + theme.notification.actions.background = accent; + theme.notification.actions.text = foreground; + theme.notification.label = accent; + theme.notification.border = background-alt; + theme.notification.text = foreground; + theme.notification.labelicon = accent; + theme.notification.close_button.background = background-alt; + theme.notification.close_button.label = "#f38ba8"; + }; + }; +} diff --git a/home-manager/modules/hyprland/hyprspace.nix b/home-manager/modules/hyprland/hyprspace.nix new file mode 100644 index 0000000..2e0f98a --- /dev/null +++ b/home-manager/modules/hyprland/hyprspace.nix @@ -0,0 +1,20 @@ +{ inputs, pkgs, ... }: +{ + wayland.windowManager.hyprland = { + plugins = [ inputs.hyprspace.packages.${pkgs.system}.Hyprspace ]; + settings = { + plugin = { + overview = { + centerAligned = true; + hideTopLayers = true; + hideOverlayLayers = true; + showNewWorkspace = true; + exitOnClick = true; + exitOnSwitch = true; + drawActiveWorkspace = true; + autoDrag = false; + }; + }; + }; + }; +} diff --git a/home-manager/modules/hyprland/polkitagent.nix b/home-manager/modules/hyprland/polkitagent.nix new file mode 100644 index 0000000..ac5d1ca --- /dev/null +++ b/home-manager/modules/hyprland/polkitagent.nix @@ -0,0 +1,6 @@ +{ inputs, pkgs, ... }: +{ + home.packages = [ inputs.hyprpolkitagent.packages."${pkgs.system}".hyprpolkitagent ]; + + wayland.windowManager.hyprland.settings.exec-once = [ "systemctl --user start hyprpolkitagent" ]; +} diff --git a/home-manager/modules/k9s.nix b/home-manager/modules/k9s.nix new file mode 100644 index 0000000..85427ac --- /dev/null +++ b/home-manager/modules/k9s.nix @@ -0,0 +1,6 @@ +# A terminal-based Kubernetes CLI. +{...}: { + programs.k9s = { + enable = true; + }; +} diff --git a/home-manager/modules/kitty.nix b/home-manager/modules/kitty.nix new file mode 100644 index 0000000..b88e3e6 --- /dev/null +++ b/home-manager/modules/kitty.nix @@ -0,0 +1,47 @@ +# A fast, GPU-accelerated terminal emulator. +{ + pkgs, + lib, + ... +}: +{ + programs.kitty = { + enable = true; + settings = { + scrollback_lines = 10000; + initial_window_width = 1200; + initial_window_height = 600; + update_check_interval = 0; + enable_audio_bell = false; + confirm_os_window_close = "0"; + remember_window_size = "no"; + disable_ligatures = "never"; + url_style = "curly"; + copy_on_select = "clipboard"; + cursor_shape = "Underline"; + cursor_underline_thickness = 3; + cursor_trail = 3; + cursor_trail_decay = "0.1 0.4"; + window_padding_width = 10; + open_url_with = "default"; + }; + font = { + # name = lib.mkForce "Comic Code"; + size = lib.mkForce 16; + }; + shellIntegration.enableZshIntegration = true; + extraConfig = '' + font_family family="Comic Code Ligatures" + bold_font auto + italic_font auto + bold_italic_font auto + symbol_map U+e000-U+e00a,U+ea60-U+ebeb,U+e0a0-U+e0c8,U+e0ca,U+e0cc-U+e0d7,U+e200-U+e2a9,U+e300-U+e3e3,U+e5fa-U+e6b1,U+e700-U+e7c5,U+ed00-U+efc1,U+f000-U+f2ff,U+f000-U+f2e0,U+f300-U+f372,U+f400-U+f533,U+f0001-U+f1af0 Symbols Nerd Font Mono + ''; + environment = { + "TERM" = "xterm-256color"; + }; + }; + home.packages = with pkgs; [ + ueberzugpp + ]; +} diff --git a/home-manager/modules/lazygit.nix b/home-manager/modules/lazygit.nix new file mode 100644 index 0000000..d0683f6 --- /dev/null +++ b/home-manager/modules/lazygit.nix @@ -0,0 +1,36 @@ +{ config, lib, ... }: +let + accent = "#${config.lib.stylix.colors.base0D}"; + muted = "#${config.lib.stylix.colors.base03}"; +in +{ + programs.lazygit = { + enable = true; + settings = lib.mkForce { + + disableStartupPopups = true; + notARepository = "skip"; + promptToReturnFromSubprocess = false; + update.method = "never"; + + git = { + commit.signOff = true; + overrideGpg = true; + }; + gui = { + theme = { + activeBorderColor = [ + accent + "bold" + ]; + inactiveBorderColor = [ muted ]; + }; + showListFooter = false; + showRandomTip = false; + showCommandLog = false; + showBottomLine = false; + nerdFontsVersion = "3"; + }; + }; + }; +} diff --git a/home-manager/modules/linux-gui.nix b/home-manager/modules/linux-gui.nix new file mode 100644 index 0000000..d3557dc --- /dev/null +++ b/home-manager/modules/linux-gui.nix @@ -0,0 +1,32 @@ +{ pkgs, ... }: +{ + imports = [ + ./zathura.nix + ]; + + # programs.discord = { + # enable = true; + # wrapDiscord = true; + # }; + + home.packages = with pkgs; [ + element-desktop # A feature-rich client for Matrix.org + gimp # GNU Image Manipulation Program, a powerful and open-source raster graphics editor for tasks like photo editing and graphic design. + gparted # Gnome Partition Editor, a graphical partition manager for creating, resizing, and managing disk partitions. + # kicad # An open-source electronic design automation (EDA) suite for creating schematics, PCB layouts, and 3D models. + kodi # An open-source media center, providing a versatile platform for streaming and organizing media content. + pavucontrol # PulseAudio Volume Control, a feature-rich GUI for controlling and configuring the PulseAudio sound system. + #sublime-music # A modern and feature-rich music player with a clean user interface and advanced playback options. + thunderbird # Mozilla Thunderbird, a powerful and customizable email client with integrated calendaring and chat features. + wireshark # Open-source network protocol analyzer for real-time packet inspection and analysis. + inkscape + nicotine-plus + anki + # obsidian + chromium + vlc + zotero + feishin + picard + ]; +} diff --git a/home-manager/modules/mime.nix b/home-manager/modules/mime.nix new file mode 100644 index 0000000..d650516 --- /dev/null +++ b/home-manager/modules/mime.nix @@ -0,0 +1,100 @@ +{ + pkgs, + lib, + ... +}: +with lib; +let + defaultApps = { + browser = [ "zen-beta.desktop" ]; + text = [ "org.gnome.TextEditor.desktop" ]; + image = [ "imv-dir.desktop" ]; + audio = [ "mpv.desktop" ]; + video = [ "mpv.desktop" ]; + directory = [ "thunar.desktop" ]; + office = [ "libreoffice.desktop" ]; + pdf = [ "zathura.desktop" ]; + terminal = [ "kitty.desktop" ]; + discord = [ "discord.desktop" ]; + archive = [ "xarchiver.desktop" ]; + }; + + mimeMap = { + text = [ "text/plain" ]; + image = [ + "image/bmp" + "image/gif" + "image/jpeg" + "image/jpg" + "image/png" + "image/svg+xml" + "image/tiff" + "image/vnd.microsoft.icon" + "image/webp" + ]; + audio = [ + "audio/aac" + "audio/mpeg" + "audio/ogg" + "audio/opus" + "audio/wav" + "audio/webm" + "audio/x-matroska" + ]; + video = [ + "video/mp2t" + "video/mp4" + "video/mpeg" + "video/ogg" + "video/webm" + "video/x-flv" + "video/x-matroska" + "video/x-msvideo" + ]; + directory = [ "inode/directory" ]; + browser = [ + "text/html" + "x-scheme-handler/about" + "x-scheme-handler/http" + "x-scheme-handler/https" + "x-scheme-handler/unknown" + ]; + office = [ + "application/vnd.oasis.opendocument.text" + "application/vnd.oasis.opendocument.spreadsheet" + "application/vnd.oasis.opendocument.presentation" + "application/vnd.openxmlformats-officedocument.wordprocessingml.document" + "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" + "application/vnd.openxmlformats-officedocument.presentationml.presentation" + "application/msword" + "application/vnd.ms-excel" + "application/vnd.ms-powerpoint" + "application/rtf" + ]; + pdf = [ "application/pdf" ]; + terminal = [ "terminal" ]; + archive = [ + "application/zip" + "application/rar" + "application/7z" + "application/*tar" + ]; + discord = [ "x-scheme-handler/discord" ]; + }; + + associations = + with lists; + listToAttrs ( + flatten (mapAttrsToList (key: map (type: attrsets.nameValuePair type defaultApps."${key}")) mimeMap) + ); +in +{ + xdg = { + configFile."mimeapps.list".force = true; + mimeApps = { + enable = true; + associations.added = associations; + defaultApplications = associations; + }; + }; +} diff --git a/home-manager/modules/neovim/autocommands.nix b/home-manager/modules/neovim/autocommands.nix new file mode 100644 index 0000000..4feba30 --- /dev/null +++ b/home-manager/modules/neovim/autocommands.nix @@ -0,0 +1,31 @@ +{...}: { + programs.nixvim = { + autoCmd = [ + # Remove trailing whitespace on save + { + event = "BufWrite"; + command = "%s/\\s\\+$//e"; + } + + { + event = "FileType"; + pattern = [ + "tex" + "latex" + "markdown" + ]; + command = "setlocal spell spelllang=en_us"; + } + + { + event = "FileType"; + pattern = [ + "tex" + "latex" + "markdown" + ]; + command = "setlocal wrap"; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/default.nix b/home-manager/modules/neovim/default.nix new file mode 100644 index 0000000..ffeb224 --- /dev/null +++ b/home-manager/modules/neovim/default.nix @@ -0,0 +1,28 @@ +# A cat clone with syntax highlighting and Git integration. +{inputs, ...}: { + imports = [ + inputs.nixvim.homeManagerModules.nixvim + ./options.nix + ./plugins + ./autocommands.nix + ./keymappings.nix + ]; + programs.nixvim = { + enable = true; + defaultEditor = true; + viAlias = true; + vimAlias = true; + luaLoader.enable = true; + + performance = { + combinePlugins = { + enable = true; + standalonePlugins = [ + "hmts.nvim" + "nvim-treesitter" + ]; + }; + byteCompileLua.enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/keymappings.nix b/home-manager/modules/neovim/keymappings.nix new file mode 100644 index 0000000..61fbc3f --- /dev/null +++ b/home-manager/modules/neovim/keymappings.nix @@ -0,0 +1,387 @@ +{ + config, + lib, + ... +}: { + programs.nixvim = { + extraConfigLuaPre = '' + function bool2str(bool) return bool and "on" or "off" end + ''; + + keymaps = let + helpers = config.lib.nixvim; + normal = + lib.mapAttrsToList + ( + key: {action, ...} @ attrs: { + mode = "n"; + inherit action key; + options = attrs.options or {}; + } + ) + { + "" = { + action = ""; + }; + + # Esc to clear search results + "" = { + action = "noh"; + }; + + # Backspace delete in normal + "" = { + action = "x"; + }; + + # fix Y behaviour + "Y" = { + action = "y$"; + }; + + # back and fourth between the two most recent files + "" = { + action = "b#"; + }; + + # navigate to left/right window + "[" = { + action = "h"; + options = { + desc = "Left window"; + }; + }; + "]" = { + action = "l"; + options = { + desc = "Right window"; + }; + }; + "." = { + action = "j"; + options = { + desc = "Up window"; + }; + }; + "," = { + action = "k"; + options = { + desc = "Down window"; + }; + }; + + # navigate quickfix list + "" = { + action = "cnext"; + }; + "" = { + action = "cprev"; + }; + + # resize with arrows + "" = { + action = "resize -2"; + }; + "" = { + action = "resize +2"; + }; + "" = { + action = "vertical resize +2"; + }; + "" = { + action = "vertical resize -2"; + }; + + # move current line up/down + # M = Alt key + "" = { + action = "move-2"; + }; + "" = { + action = "move+"; + }; + + "w" = { + action = "w"; # Action to perform (save the file in this case) + options = { + desc = "Save"; + }; + }; + + "j" = { + action = "v:count == 0 ? 'gj' : 'j'"; + options = { + desc = "Move cursor down"; + expr = true; + }; + }; + "k" = { + action = "v:count == 0 ? 'gk' : 'k'"; + options = { + desc = "Move cursor up"; + expr = true; + }; + }; + "q" = { + action = "confirm q"; + options = { + desc = "Quit"; + }; + }; + "" = { + action = "enew"; + options = { + desc = "New file"; + }; + }; + "W" = { + action = "w!"; + options = { + desc = "Force write"; + }; + }; + "Q" = { + action = "q!"; + options = { + desc = "Force quit"; + }; + }; + "|" = { + action = "vsplit"; + options = { + desc = "Vertical split"; + }; + }; + "\\" = { + action = "split"; + options = { + desc = "Horizontal split"; + }; + }; + + "bC" = { + action = "%bd!"; + options = { + desc = "Close all buffers"; + }; + }; + "b]" = { + action = "bnext"; + options = { + desc = "Next buffer"; + }; + }; + "" = { + action = "bnext"; + options = { + desc = "Next buffer (default)"; + }; + }; + "b[" = { + action = "bprevious"; + options = { + desc = "Previous buffer"; + }; + }; + "" = { + action = "bprevious"; + options = { + desc = "Previous buffer"; + }; + }; + + "ud" = { + action.__raw = '' + function () + vim.b.disable_diagnostics = not vim.b.disable_diagnostics + if vim.b.disable_diagnostics then + vim.diagnostic.disable(0) + else + vim.diagnostic.enable(0) + end + vim.notify(string.format("Buffer Diagnostics %s", bool2str(not vim.b.disable_diagnostics), "info")) + end''; + options = { + desc = "Buffer Diagnostics toggle"; + }; + }; + + "uD" = { + action.__raw = '' + function () + vim.g.disable_diagnostics = not vim.g.disable_diagnostics + if vim.g.disable_diagnostics then + vim.diagnostic.disable() + else + vim.diagnostic.enable() + end + vim.notify(string.format("Global Diagnostics %s", bool2str(not vim.g.disable_diagnostics), "info")) + end''; + options = { + desc = "Global Diagnostics toggle"; + }; + }; + + "uf" = { + action.__raw = '' + function () + -- vim.g.disable_autoformat = not vim.g.disable_autoformat + vim.cmd('FormatToggle!') + vim.notify(string.format("Buffer Autoformatting %s", bool2str(not vim.b[0].disable_autoformat), "info")) + end''; + options = { + desc = "Buffer Autoformatting toggle"; + }; + }; + + "uF" = { + action.__raw = '' + function () + -- vim.g.disable_autoformat = not vim.g.disable_autoformat + vim.cmd('FormatToggle') + vim.notify(string.format("Global Autoformatting %s", bool2str(not vim.g.disable_autoformat), "info")) + end''; + options = { + desc = "Global Autoformatting toggle"; + }; + }; + + "uS" = { + action.__raw = '' + function () + if vim.g.spell_enabled then vim.cmd('setlocal nospell') end + if not vim.g.spell_enabled then vim.cmd('setlocal spell') end + vim.g.spell_enabled = not vim.g.spell_enabled + vim.notify(string.format("Spell %s", bool2str(vim.g.spell_enabled), "info")) + end''; + options = { + desc = "Spell toggle"; + }; + }; + + "uw" = { + action.__raw = '' + function () + vim.wo.wrap = not vim.wo.wrap + vim.notify(string.format("Wrap %s", bool2str(vim.wo.wrap), "info")) + end''; + options = { + desc = "Word Wrap toggle"; + }; + }; + + "uh" = { + action.__raw = '' + function () + local curr_foldcolumn = vim.wo.foldcolumn + if curr_foldcolumn ~= "0" then vim.g.last_active_foldcolumn = curr_foldcolumn end + vim.wo.foldcolumn = curr_foldcolumn == "0" and (vim.g.last_active_foldcolumn or "1") or "0" + vim.notify(string.format("Fold Column %s", bool2str(vim.wo.foldcolumn), "info")) + end''; + options = { + desc = "Fold Column toggle"; + }; + }; + + "uc" = { + action.__raw = '' + function () + vim.g.cmp_enabled = not vim.g.cmp_enabled + vim.notify(string.format("Completions %s", bool2str(vim.g.cmp_enabled), "info")) + end''; + options = { + desc = "Completions toggle"; + }; + }; + }; + visual = + lib.mapAttrsToList + ( + key: {action, ...} @ attrs: { + mode = "v"; + inherit action key; + options = attrs.options or {}; + } + ) + { + # Better indenting + "" = { + action = "" = { + action = ">gv"; + options = { + desc = "Indent line"; + }; + }; + ">" = { + action = ">gv"; + options = { + desc = "Indent line"; + }; + }; + + # Move selected line/block in visual mode + "K" = { + action = "m '<-2gv=gv"; + }; + "J" = { + action = "m '>+1gv=gv"; + }; + + # Backspace delete in visual + "" = { + action = "x"; + }; + }; + insert = + lib.mapAttrsToList + ( + key: {action, ...} @ attrs: { + mode = "i"; + inherit action key; + options = attrs.options or {}; + } + ) + { + # Move selected line/block in insert mode + "" = { + action = "gk"; + }; + "" = { + action = ""; + }; + "" = { + action = ""; + }; + "" = { + action = "gj"; + }; + }; + in + helpers.keymaps.mkKeymaps {options.silent = true;} (normal ++ visual ++ insert); + plugins.which-key.settings.spec = [ + { + __unkeyed = "w"; + icon = ""; + } + { + __unkeyed = "W"; + icon = "󰽃"; + } + { + __unkeyed = "/"; + icon = ""; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/options.nix b/home-manager/modules/neovim/options.nix new file mode 100644 index 0000000..b2ce59c --- /dev/null +++ b/home-manager/modules/neovim/options.nix @@ -0,0 +1,67 @@ +{ + programs.nixvim = { + globals = { + mapleader = " "; + # Disable useless providers + loaded_ruby_provider = 0; # Ruby + loaded_perl_provider = 0; # Perl + loaded_python_provider = 0; # Python 2 + }; + + colorscheme = "base16-atelier-sulphurpool-light"; + + clipboard = { + # Use system clipboard + register = "unnamedplus"; + + providers.wl-copy.enable = true; + }; + + opts = { + updatetime = 100; # Faster completion + + # Line numbers + relativenumber = true; # Relative line numbers + number = true; # Display the absolute line number of the current line + hidden = true; # Keep closed buffer open in the background + mouse = "a"; # Enable mouse control + mousemodel = "extend"; # Mouse right-click extends the current selection + splitbelow = true; # A new window is put below the current one + splitright = true; # A new window is put right of the current one + + swapfile = false; # Disable the swap file + modeline = true; # Tags such as 'vim:ft=sh' + modelines = 100; # Sets the type of modelines + undofile = true; # Automatically save and restore undo history + incsearch = true; # Incremental search: show match for partly typed search command + inccommand = "split"; # Search and replace: preview changes in quickfix list + ignorecase = true; # When the search query is lower-case, match both lower and upper-case + # patterns + smartcase = true; # Override the 'ignorecase' option if the search pattern contains upper + # case characters + scrolloff = 8; # Number of screen lines to show around the cursor + # scrolloff = 999; # Number of screen lines to show around the cursor + cursorline = false; # Highlight the screen line of the cursor + cursorcolumn = false; # Highlight the screen column of the cursor + signcolumn = "yes"; # Whether to show the signcolumn + colorcolumn = ""; # Columns to highlight + laststatus = 3; # When to use a status line for the last window + fileencoding = "utf-8"; # File-content encoding for the current buffer + termguicolors = true; # Enables 24-bit RGB color in the |TUI| + spell = false; # Highlight spelling mistakes (local to window) + wrap = false; # Prevent text from wrapping + + # Tab options + tabstop = 4; # Number of spaces a in the text stands for (local to buffer) + shiftwidth = 4; # Number of spaces used for each step of (auto)indent (local to buffer) + expandtab = true; # Expand to spaces in Insert mode (local to buffer) + autoindent = true; # Do clever autoindenting + + textwidth = 0; # Maximum width of text that is being inserted. A longer line will be + # broken after white space to get this width. + + # Folding + foldlevel = 99; # Folds with a level higher than this number will be closed + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/autopairs.nix b/home-manager/modules/neovim/plugins/autopairs.nix new file mode 100644 index 0000000..0d364a5 --- /dev/null +++ b/home-manager/modules/neovim/plugins/autopairs.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.nvim-autopairs = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/base16.nix b/home-manager/modules/neovim/plugins/base16.nix new file mode 100644 index 0000000..b672b6b --- /dev/null +++ b/home-manager/modules/neovim/plugins/base16.nix @@ -0,0 +1,10 @@ +{ ... }: +{ + programs.nixvim = { + colorschemes.base16 = { + enable = true; + colorscheme = "atelier-sulphurpool-light"; + autoLoad = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/bufferline.nix b/home-manager/modules/neovim/plugins/bufferline.nix new file mode 100644 index 0000000..dae888c --- /dev/null +++ b/home-manager/modules/neovim/plugins/bufferline.nix @@ -0,0 +1,168 @@ +{ ... }: +{ + programs.nixvim = { + plugins.bufferline = + let + mouse = { + right = + # Lua + "'vertical sbuffer %d'"; + close = + # Lua + '' + function(bufnum) + require("mini.bufremove").delete(bufnum) + end + ''; + }; + in + { + enable = true; + + settings = { + options = { + mode = "buffers"; + always_show_bufferline = true; + buffer_close_icon = "󰅖"; + close_command.__raw = mouse.close; + close_icon = ""; + diagnostics = "nvim_lsp"; + diagnostics_indicator = + # Lua + '' + function(count, level, diagnostics_dict, context) + local s = "" + for e, n in pairs(diagnostics_dict) do + local sym = e == "error" and " " + or (e == "warning" and " " or "" ) + if(sym ~= "") then + s = s .. " " .. n .. sym + end + end + return s + end + ''; + # Will make sure all names in bufferline are unique + enforce_regular_tabs = false; + + groups = { + options = { + toggle_hidden_on_enter = true; + }; + + items = [ + { + name = "Tests"; + highlight = { + underline = true; + fg = "#a6da95"; + sp = "#494d64"; + }; + priority = 2; + # icon = ""; + matcher.__raw = '' + function(buf) + return buf.name:match('%test') or buf.name:match('%.spec') + end + ''; + } + { + name = "Docs"; + highlight = { + undercurl = true; + fg = "#ffffff"; + sp = "#494d64"; + }; + auto_close = false; + matcher.__raw = '' + function(buf) + return buf.name:match('%.md') or buf.name:match('%.txt') + end + ''; + } + ]; + }; + + indicator = { + style = "icon"; + icon = "▎"; + }; + + left_trunc_marker = ""; + max_name_length = 18; + max_prefix_length = 15; + modified_icon = "●"; + + numbers.__raw = '' + function(opts) + return string.format('%s·%s', opts.raise(opts.id), opts.lower(opts.ordinal)) + end + ''; + + persist_buffer_sort = true; + right_mouse_command.__raw = mouse.right; + right_trunc_marker = ""; + separator_style = "slant"; + show_buffer_close_icons = true; + show_buffer_icons = true; + show_close_icon = true; + show_tab_indicators = true; + sort_by = "extension"; + tab_size = 18; + + offsets = [ + { + filetype = "neo-tree"; + text = "File Explorer"; + text_align = "center"; + highlight = "Directory"; + } + ]; + }; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "bP"; + action = "BufferLineTogglePin"; + options = { + desc = "Pin buffer toggle"; + }; + } + { + mode = "n"; + key = "bp"; + action = "BufferLinePick"; + options = { + desc = "Pick Buffer"; + }; + } + { + mode = "n"; + key = "bsd"; + action = "BufferLineSortByDirectory"; + options = { + desc = "Sort By Directory"; + }; + } + { + mode = "n"; + key = "bse"; + action = "BufferLineSortByExtension"; + options = { + desc = "Sort By Extension"; + }; + } + { + mode = "n"; + key = "bsr"; + action = "BufferLineSortByRelativeDirectory"; + options = { + desc = "Sort By Relative Directory"; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/catppuccin.nix b/home-manager/modules/neovim/plugins/catppuccin.nix new file mode 100644 index 0000000..742d600 --- /dev/null +++ b/home-manager/modules/neovim/plugins/catppuccin.nix @@ -0,0 +1,66 @@ +_: { + programs.nixvim = { + colorschemes.catppuccin = { + enable = true; + settings = { + dim_inactive = { + enabled = false; + percentage = 0.25; + }; + + # flavour = "macchiato"; + flavour = "latte"; + + integrations = { + aerial = true; + cmp = true; + dap = { + enabled = true; + enable_ui = true; + }; + gitsigns = true; + headlines = true; + markdown = true; + mason = true; + mini.enabled = true; + + native_lsp = { + enabled = true; + virtual_text = { + errors = ["italic"]; + hints = ["italic"]; + warnings = ["italic"]; + information = ["italic"]; + }; + underlines = { + errors = ["underline"]; + hints = ["underline"]; + warnings = ["underline"]; + information = ["underline"]; + }; + inlay_hints = { + background = false; + }; + }; + + neogit = true; + neotree = false; + noice = true; + notify = true; + rainbow_delimiters = true; + sandwich = true; + semantic_tokens = true; + symbols_outline = true; + telescope = { + enabled = true; + # style = "nvchad"; + }; + treesitter = true; + which_key = true; + }; + + transparent_background = false; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/clangd-extensions.nix b/home-manager/modules/neovim/plugins/clangd-extensions.nix new file mode 100644 index 0000000..ebf141e --- /dev/null +++ b/home-manager/modules/neovim/plugins/clangd-extensions.nix @@ -0,0 +1,33 @@ +{ ... }: +{ + programs.nixvim = { + plugins = { + clangd-extensions = { + enable = true; + enableOffsetEncodingWorkaround = true; + settings = { + ast = { + role_icons = { + type = ""; + declaration = ""; + expression = ""; + specifier = ""; + statement = ""; + templateArgument = ""; + }; + kind_icons = { + compound = ""; + recovery = ""; + translationUnit = ""; + packExpansion = ""; + templateTypeParm = ""; + templateTemplateParm = ""; + templateParamObject = ""; + }; + }; + }; + + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/cmp.nix b/home-manager/modules/neovim/plugins/cmp.nix new file mode 100644 index 0000000..31e0947 --- /dev/null +++ b/home-manager/modules/neovim/plugins/cmp.nix @@ -0,0 +1,181 @@ +{pkgs, ...}: { + programs.nixvim = { + extraConfigLuaPre = '' + local has_words_before = function() + unpack = unpack or table.unpack + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil + end + ''; + plugins = { + luasnip = { + enable = true; + fromVscode = [{}]; + + settings = { + enable_autosnippets = true; + store_selection_keys = ""; + }; + }; + friendly-snippets = { + enable = true; + }; + + lspkind = { + enable = true; + mode = "symbol_text"; + cmp = { + enable = true; + # Custom Theme + after = '' + function(entry, vim_item, kind) + local strings = vim.split(kind.kind, "%s", { trimempty = true }) + kind.kind = " " .. (strings[1] or "") .. " " + kind.menu = " (" .. (strings[2] or "") .. ")" + return kind + end + ''; + }; + }; + cmp-nvim-lsp.enable = true; + cmp-nvim-lua.enable = true; + cmp_luasnip.enable = true; + # cmp-path.enable = true; + cmp-latex-symbols.enable = true; + cmp-buffer.enable = true; + cmp = { + enable = true; + autoEnableSources = true; + + settings = { + experimental = { + ghost_text = true; + }; + sources = [ + { + name = "nvim_lsp"; + # priority = 1000; + # option = { }; + } + + {name = "luasnip";} + + {name = "buffer";} + + # { name = "path"; } + ]; + + mapping = { + "" = "cmp.mapping.confirm({ select = true })"; + "" = '' + cmp.mapping(function(fallback) + if require("luasnip").expand_or_locally_jumpable() then + require("luasnip").expand_or_jump() + elseif cmp.visible() then + cmp.select_next_item() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }) + ''; + "" = '' + cmp.mapping(function(fallback) + if require("luasnip").jumpable(-1) then + require("luasnip").jump(-1) + elseif cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, { "i", "s" }) + ''; + "" = "cmp.mapping.complete()"; + "" = "cmp.mapping.abort()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.select_prev_item()"; + "" = "cmp.mapping.select_next_item()"; + "" = "cmp.mapping.scroll_docs(-4)"; + "" = "cmp.mapping.scroll_docs(4)"; + }; + window = { + documentation.max_height = "math.floor(40 * (40 / vim.o.lines))"; + completion = { + winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None"; + col_offset = -3; + side_padding = 0; + border = "rounded"; + }; + documentation = { + border = "rounded"; + }; + }; + + snippet.expand = '' + function(args) + require('luasnip').lsp_expand(args.body) + end + ''; + + formatting = { + fields = [ + "kind" + "abbr" + "menu" + ]; + }; + + menu = { + buffer = ""; + calc = ""; + cmdline = ""; + codeium = "󱜙"; + emoji = "󰞅"; + git = ""; + luasnip = "󰩫"; + neorg = ""; + nvim_lsp = ""; + nvim_lua = ""; + path = ""; + spell = ""; + treesitter = "󰔱"; + }; + }; + }; + }; + + extraPlugins = with pkgs.vimPlugins; [vim-snippets]; + extraConfigLua = '' + luasnip = require("luasnip") + kind_icons = { + Text = "󰊄", + Method = "", + Function = "󰡱", + Constructor = "", + Field = "", + Variable = "󱀍", + Class = "", + Interface = "", + Module = "󰕳", + Property = "", + Unit = "", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "", + Event = "", + Operator = "", + TypeParameter = "", + } + ''; + }; +} diff --git a/home-manager/modules/neovim/plugins/comment.nix b/home-manager/modules/neovim/plugins/comment.nix new file mode 100644 index 0000000..3d0e571 --- /dev/null +++ b/home-manager/modules/neovim/plugins/comment.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.comment = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/conform.nix b/home-manager/modules/neovim/plugins/conform.nix new file mode 100644 index 0000000..883fc64 --- /dev/null +++ b/home-manager/modules/neovim/plugins/conform.nix @@ -0,0 +1,237 @@ +{ + lib, + pkgs, + ... +}: +{ + programs.nixvim = { + extraConfigLuaPre = + # lua + '' + local slow_format_filetypes = {} + + vim.api.nvim_create_user_command("FormatDisable", function(args) + if args.bang then + -- FormatDisable! will disable formatting just for this buffer + vim.b.disable_autoformat = true + else + vim.g.disable_autoformat = true + end + end, { + desc = "Disable autoformat-on-save", + bang = true, + }) + vim.api.nvim_create_user_command("FormatEnable", function() + vim.b.disable_autoformat = false + vim.g.disable_autoformat = false + end, { + desc = "Re-enable autoformat-on-save", + }) + vim.api.nvim_create_user_command("FormatToggle", function(args) + if args.bang then + -- Toggle formatting for current buffer + vim.b.disable_autoformat = not vim.b.disable_autoformat + else + -- Toggle formatting globally + vim.g.disable_autoformat = not vim.g.disable_autoformat + end + end, { + desc = "Toggle autoformat-on-save", + bang = true, + }) + ''; + + plugins = { + conform-nvim = { + enable = true; + settings = { + format_on_save = + # lua + '' + function(bufnr) + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + end + + if slow_format_filetypes[vim.bo[bufnr].filetype] then + return + end + + local function on_format(err) + if err and err:match("timeout$") then + slow_format_filetypes[vim.bo[bufnr].filetype] = true + end + end + + return { timeout_ms = 200, lsp_fallback = true }, on_format + end + ''; + + format_after_save = + # lua + '' + function(bufnr) + if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then + return + end + + if not slow_format_filetypes[vim.bo[bufnr].filetype] then + return + end + + return { lsp_fallback = true } + end + ''; + + formattersByFt = { + bash = [ + "shellcheck" + "shellharden" + "shfmt" + ]; + bicep = [ "bicep" ]; + c = [ "clang_format" ]; + cmake = [ "cmake-format" ]; + cpp = [ "clang_format" ]; + cs = [ "csharpier" ]; + css = [ "stylelint" ]; + fish = [ "fish_indent" ]; + fsharp = [ "fantomas" ]; + go = [ "gofmt" ]; + haskell = [ "ormolu" ]; + java = [ "google-java-format" ]; + javascript = [ + [ + "prettierd" + "prettier" + ] + ]; + json = [ "jq" ]; + lua = [ "stylua" ]; + markdown = [ "deno_fmt" ]; + nix = [ "nixfmt" ]; + python = [ + "isort" + "black" + ]; + rust = [ "rustfmt" ]; + sh = [ + "shellcheck" + "shellharden" + "shfmt" + ]; + sql = [ "sqlfluff" ]; + swift = [ "swift_format" ]; + terraform = [ "terraform_fmt" ]; + toml = [ "taplo" ]; + typescript = [ + [ + "prettierd" + "prettier" + ] + ]; + xml = [ + "xmlformat" + "xmllint" + ]; + yaml = [ "yamlfmt" ]; + zig = [ "zigfmt" ]; + "_" = [ + "squeeze_blanks" + "trim_whitespace" + "trim_newlines" + ]; + }; + + formatters = { + black = { + command = lib.getExe pkgs.black; + }; + bicep = { + command = lib.getExe pkgs.bicep; + }; + cmake-format = { + command = lib.getExe pkgs.cmake-format; + }; + csharpier = { + command = lib.getExe pkgs.csharpier; + }; + deno_fmt = { + command = lib.getExe pkgs.deno; + }; + isort = { + command = lib.getExe pkgs.isort; + }; + fantomas = { + command = lib.getExe pkgs.fantomas; + }; + ormolu = { + command = lib.getExe pkgs.ormolu; + }; + jq = { + command = lib.getExe pkgs.jq; + }; + nixfmt = { + command = lib.getExe pkgs.nixfmt-rfc-style; + }; + prettierd = { + command = lib.getExe pkgs.prettierd; + }; + rustfmt = { + command = lib.getExe pkgs.rustfmt; + }; + shellcheck = { + command = lib.getExe pkgs.shellcheck; + }; + shfmt = { + command = lib.getExe pkgs.shfmt; + }; + shellharden = { + command = lib.getExe pkgs.shellharden; + }; + sqlfluff = { + command = lib.getExe pkgs.sqlfluff; + }; + squeeze_blanks = { + comamnd = lib.getExe' pkgs.coreutils "cat"; + }; + stylelint = { + command = lib.getExe pkgs.stylelint; + }; + stylua = { + command = lib.getExe pkgs.stylua; + }; + swift_format = { + command = lib.getExe pkgs.swift-format; + }; + taplo = { + command = lib.getExe pkgs.taplo; + }; + terraform_fmt = { + command = lib.getExe pkgs.terraform; + }; + xmlformat = { + command = lib.getExe pkgs.xmlformat; + }; + yamlfmt = { + command = lib.getExe pkgs.yamlfmt; + }; + zigfmt = { + command = lib.getExe pkgs.zig; + }; + }; + }; + + # NOTE: + # Conform will run multiple formatters sequentially + # [ "1" "2" "3"] + # Use a sub-list to run only the first available formatter + # [ ["1"] ["2"] ["3"] ] + # Use the "*" filetype to run formatters on all filetypes. + # Use the "_" filetype to run formatters on filetypes that don't + # have other formatters configured. + + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/debugprint.nix b/home-manager/modules/neovim/plugins/debugprint.nix new file mode 100644 index 0000000..cbf6f95 --- /dev/null +++ b/home-manager/modules/neovim/plugins/debugprint.nix @@ -0,0 +1,38 @@ +{...}: { + programs.nixvim = { + plugins = { + debugprint = { + enable = true; + + settings = { + commands = { + toggle_comment_debug_prints = "ToggleCommentDebugPrints"; + delete_debug_prints = "DeleteDebugPrints"; + }; + + display_counter = true; + display_snippet = true; + + keymaps = { + normal = { + plain_below = "g?p"; + plain_above = "g?P"; + variable_below = "g?v"; + variable_above = "g?V"; + variable_below_alwaysprompt.__raw = "nil"; + variable_above_alwaysprompt.__raw = "nil"; + textobj_below = "g?o"; + textobj_above = "g?O"; + toggle_comment_debug_prints.__raw = "nil"; + delete_debug_prints.__raw = "nil"; + }; + visual = { + variable_below = "g?v"; + variable_above = "g?V"; + }; + }; + }; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/default.nix b/home-manager/modules/neovim/plugins/default.nix new file mode 100644 index 0000000..b620f1d --- /dev/null +++ b/home-manager/modules/neovim/plugins/default.nix @@ -0,0 +1,57 @@ +_: { + imports = [ + # ./none-ls.nix + ./autopairs.nix + ./bufferline.nix + ./base16.nix + # ./catppuccin.nix + ./comment.nix + ./conform.nix + ./clangd-extensions.nix + ./cmp.nix + ./debugprint.nix + ./diffview.nix + ./flash.nix + ./git-conflict.nix + ./gitsigns.nix + ./harpoon.nix + # ./haskell-scope-highlighting.nix + ./illuminate.nix + # ./obsidian.nix + ./indent-blankline.nix + ./lightbulb.nix + ./lualine.nix + ./luasnip.nix + ./lean.nix + ./lsp.nix + ./marks.nix + ./mark-radar.nix + ./mini.nix + ./mini-bufremove.nix + ./mini-surround.nix + ./mini-indentscope.nix + ./glow.nix + ./navic.nix + ./neoscroll.nix + ./nix.nix + ./noice.nix + ./notify.nix + ./precognition.nix + # ./spectre.nix + ./grug-far.nix + ./snacks.nix + ./refactoring.nix + ./render-markdown.nix + ./telescope.nix + ./todo-comments.nix + ./toggleterm.nix + ./treesitter.nix + ./trouble.nix + ./which-key.nix + ./undotree.nix + ./yazi.nix + ./yanky.nix + ./vimtex.nix + ./zenmode.nix + ]; +} diff --git a/home-manager/modules/neovim/plugins/diffview.nix b/home-manager/modules/neovim/plugins/diffview.nix new file mode 100644 index 0000000..828e5ea --- /dev/null +++ b/home-manager/modules/neovim/plugins/diffview.nix @@ -0,0 +1,32 @@ +{...}: { + programs.nixvim = { + plugins = { + diffview = { + enable = true; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "gd"; + action.__raw = + # lua + '' + function() + vim.g.diffview_enabled = not vim.g.diffview_enabled + if vim.g.diffview_enabled then + vim.cmd('DiffviewClose') + else + vim.cmd('DiffviewOpen') + end + end + ''; + options = { + desc = "Git Diff toggle"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/flash.nix b/home-manager/modules/neovim/plugins/flash.nix new file mode 100644 index 0000000..dd18195 --- /dev/null +++ b/home-manager/modules/neovim/plugins/flash.nix @@ -0,0 +1,93 @@ +{...}: { + programs.nixvim = { + plugins.flash = { + enable = true; + settings = { + labels = "rsthnaio"; + }; + }; + + keymaps = [ + { + mode = [ + "n" + "x" + "o" + ]; + key = "s"; + action.__raw = '' + function() + require("flash").jump() + end + ''; + options = { + silent = true; + desc = "Flash"; + }; + } + + { + mode = [ + "n" + "x" + "o" + ]; + key = "S"; + action.__raw = '' + function() + require("flash").treesitter() + end + ''; + options = { + silent = true; + desc = "Flash Treesitter"; + }; + } + + { + mode = "o"; + key = "r"; + action.__raw = '' + function() + require("flash").remote() + end + ''; + options = { + silent = true; + desc = "Flash Remote"; + }; + } + + { + mode = [ + "o" + "x" + ]; + key = "R"; + action.__raw = '' + function() + require("flash").treesitter_search() + end + ''; + options = { + silent = true; + desc = "Treesitter Search"; + }; + } + + { + mode = "c"; + key = ""; + action.__raw = '' + function() + require("flash").toggle() + end + ''; + options = { + silent = true; + desc = "Toggle Flash Search"; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/git-conflict.nix b/home-manager/modules/neovim/plugins/git-conflict.nix new file mode 100644 index 0000000..7820cc2 --- /dev/null +++ b/home-manager/modules/neovim/plugins/git-conflict.nix @@ -0,0 +1,20 @@ +_: { + programs.nixvim = { + plugins = { + git-conflict = { + enable = true; + + settings = { + default_mappings = { + ours = "co"; + theirs = "ct"; + none = "c0"; + both = "cb"; + next = "]x"; + prev = "[x"; + }; + }; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/gitsigns.nix b/home-manager/modules/neovim/plugins/gitsigns.nix new file mode 100644 index 0000000..c787576 --- /dev/null +++ b/home-manager/modules/neovim/plugins/gitsigns.nix @@ -0,0 +1,118 @@ +{...}: { + programs.nixvim = { + plugins.gitsigns = { + enable = true; + settings = { + signs = { + add.text = "▎"; + change.text = "▎"; + delete.text = "󰐊"; + topdelete.text = "󰐊"; + changedelete.text = "󰐊"; + }; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "gs"; + action = "Gitsigns stage_hunk"; + options = { + silent = true; + desc = "Stage Hunk"; + }; + } + + { + mode = "n"; + key = "gr"; + action = "Gitsigns reset_hunk"; + options = { + silent = true; + desc = "Reset Hunk"; + }; + } + + { + mode = "v"; + key = "gs"; + action = "lua function() Gitsigns stage_hunk {vim.fn.line('.'), vim.fn.line('v')} end"; + options = { + silent = true; + desc = "Stage Hunk"; + }; + } + + { + mode = "v"; + key = "gr"; + action = "function() gs.reset_hunk {vim.fn.line('.'), vim.fn.line('v')} end"; + options = { + silent = true; + desc = "Reset Hunk"; + }; + } + + { + mode = "n"; + key = "gS"; + action = "Gitsigns stage_buffer"; + options = { + silent = true; + desc = "Stage Buffer"; + }; + } + + { + mode = "n"; + key = "gu"; + action = "Gitsigns undo_stage_hunk"; + options = { + silent = true; + desc = "Undo Stage Hunk"; + }; + } + + { + mode = "n"; + key = "gR"; + action = " Gitsigns reset_buffer"; + options = { + silent = true; + desc = "Reset Buffer"; + }; + } + + { + mode = "n"; + key = "gp"; + action = " Gitsigns preview_hunk"; + options = { + silent = true; + desc = "Preview Hunk"; + }; + } + + { + mode = "n"; + key = "gb"; + action = " Gitsigns toggle_current_line_blame"; + options = { + silent = true; + desc = "Blame"; + }; + } + + # { + # mode = "n"; + # key = "gd"; + # action = " Gitsigns diffthis"; + # options = { + # silent = true; + # desc = "Diff"; + # }; + # } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/glow.nix b/home-manager/modules/neovim/plugins/glow.nix new file mode 100644 index 0000000..2082566 --- /dev/null +++ b/home-manager/modules/neovim/plugins/glow.nix @@ -0,0 +1,41 @@ +{pkgs, ...}: let + stylePkg = pkgs.fetchFromGitHub { + owner = "catppuccin"; + repo = "glamour"; + rev = "f410083af1e9b2418bcd73dbbbc987461d4aa292"; + hash = "sha256-a7yR19KcxIS4UPhuhB+X0B+s8D5eytw0/EB0X4z46kA="; + }; +in { + programs.nixvim = { + plugins = { + glow = { + enable = true; + + settings = { + border = "single"; + style = "${stylePkg.outPath}/themes/catppuccin-latte.json"; + }; + }; + + which-key.settings.spec = [ + { + __unkeyed = "p"; + mode = "n"; + group = "Preview"; + icon = " "; + } + ]; + }; + + keymaps = [ + { + mode = "n"; + key = "pg"; + action = "Glow"; + options = { + desc = "Glow (Markdown)"; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/grug-far.nix b/home-manager/modules/neovim/plugins/grug-far.nix new file mode 100644 index 0000000..fe410cd --- /dev/null +++ b/home-manager/modules/neovim/plugins/grug-far.nix @@ -0,0 +1,25 @@ +{ ... }: +{ + programs.nixvim = { + plugins = { + grug-far = { + enable = true; + settings = { + cmd = "GrugFar"; + }; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "rs"; + action = "GrugFar"; + options = { + desc = "GrugFar toggle"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/harpoon.nix b/home-manager/modules/neovim/plugins/harpoon.nix new file mode 100644 index 0000000..217d766 --- /dev/null +++ b/home-manager/modules/neovim/plugins/harpoon.nix @@ -0,0 +1,59 @@ +{...}: { + programs.nixvim = { + plugins = { + harpoon.enable = true; + which-key.settings.spec = [ + { + __unkeyed = "m"; + mode = "n"; + group = "󱋼 Marks"; + } + ]; + }; + + keymaps = [ + { + mode = "n"; + key = "mm"; + action = ":lua require('harpoon.ui').toggle_quick_menu()"; + # lua = true; + options = { + silent = true; + desc = "Mark Menu"; + }; + } + + { + mode = "n"; + key = "ma"; + action = ":lua require('harpoon.mark').add_file()"; + # lua = true; + options = { + silent = true; + desc = "Mark File"; + }; + } + { + mode = "n"; + key = "mn"; + action = ":lua require('harpoon.ui').nav_next()"; + # lua = true; + options = { + silent = true; + desc = "Next Mark"; + }; + } + + { + mode = "n"; + key = "mp"; + action = ":lua require('harpoon.ui').nav_prev()"; + # lua = true; + options = { + silent = true; + desc = "Prev Mark"; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/haskell-scope-highlighting.nix b/home-manager/modules/neovim/plugins/haskell-scope-highlighting.nix new file mode 100644 index 0000000..5722587 --- /dev/null +++ b/home-manager/modules/neovim/plugins/haskell-scope-highlighting.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.haskell-scope-highlighting = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/illuminate.nix b/home-manager/modules/neovim/plugins/illuminate.nix new file mode 100644 index 0000000..bd33560 --- /dev/null +++ b/home-manager/modules/neovim/plugins/illuminate.nix @@ -0,0 +1,17 @@ +{...}: { + programs.nixvim = { + plugins = { + illuminate = { + enable = true; + + filetypesDenylist = [ + "dirvish" + "fugitive" + "neo-tree" + "TelescopePrompt" + ]; + largeFileCutoff = 3000; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/indent-blankline.nix b/home-manager/modules/neovim/plugins/indent-blankline.nix new file mode 100644 index 0000000..910699d --- /dev/null +++ b/home-manager/modules/neovim/plugins/indent-blankline.nix @@ -0,0 +1,30 @@ +{...}: { + programs.nixvim = { + plugins.indent-blankline = { + enable = true; + + settings = { + scope.enabled = false; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "ui"; + action = "IBLToggle"; + options = { + desc = "Indent-Blankline toggle"; + }; + } + { + mode = "n"; + key = "uI"; + action = "IBLToggleScope"; + options = { + desc = "Indent-Blankline Scope toggle"; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/lean.nix b/home-manager/modules/neovim/plugins/lean.nix new file mode 100644 index 0000000..733be76 --- /dev/null +++ b/home-manager/modules/neovim/plugins/lean.nix @@ -0,0 +1,12 @@ +{ ... }: +{ + programs.nixvim = { + plugins.lean = { + enable = true; + settings = { + abbreviations.enable = false; + lsp.enable = false; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/lightbulb.nix b/home-manager/modules/neovim/plugins/lightbulb.nix new file mode 100644 index 0000000..d32a74e --- /dev/null +++ b/home-manager/modules/neovim/plugins/lightbulb.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.nvim-lightbulb = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/lsp.nix b/home-manager/modules/neovim/plugins/lsp.nix new file mode 100644 index 0000000..1edf45a --- /dev/null +++ b/home-manager/modules/neovim/plugins/lsp.nix @@ -0,0 +1,164 @@ +{ + lib, + pkgs, + ... +}: +{ + programs.nixvim = { + extraConfigLuaPre = + # lua + '' + vim.fn.sign_define("DiagnosticSignError", { text = " ", texthl = "DiagnosticError", linehl = "", numhl = "" }) + vim.fn.sign_define("DiagnosticSignWarn", { text = " ", texthl = "DiagnosticWarn", linehl = "", numhl = "" }) + vim.fn.sign_define("DiagnosticSignHint", { text = " 󰌵", texthl = "DiagnosticHint", linehl = "", numhl = "" }) + vim.fn.sign_define("DiagnosticSignInfo", { text = " ", texthl = "DiagnosticInfo", linehl = "", numhl = "" }) + ''; + plugins = { + lspkind.enable = true; + lsp-lines.enable = true; + lsp-format.enable = false; # conform-nvim does this + lsp = { + enable = true; + keymaps = { + silent = true; + diagnostic = { + # Navigate in diagnostics + "lp" = "goto_prev"; + "ln" = "goto_next"; + }; + + extra = [ + { + action.__raw = + # lua + '' + function() + vim.lsp.buf.format({ + async = true, + range = { + ["start"] = vim.api.nvim_buf_get_mark(0, "<"), + ["end"] = vim.api.nvim_buf_get_mark(0, ">"), + } + }) + end + ''; + mode = "v"; + key = "lf"; + options = { + desc = "Format selection"; + }; + } + ]; + + lspBuf = { + "la" = "code_action"; + "ld" = "definition"; + "lf" = "format"; + "lD" = "references"; + "lt" = "type_definition"; + "li" = "implementation"; + "lh" = "hover"; + "lr" = "rename"; + }; + }; + servers = { + nil_ls = { + enable = true; + filetypes = [ "nix" ]; + settings = { + formatting = { + command = [ "${lib.getExe pkgs.nixfmt-rfc-style}" ]; + }; + }; + }; + + pyright.enable = true; + hls.enable = true; + gopls.enable = true; + # hls.installGhc = true; + hls.filetypes = [ + "haskell" + "lhaskell" + "cabal" + ]; + leanls.enable = true; + texlab.enable = true; + html.enable = true; + + cmake = { + enable = true; + filetypes = [ "cmake" ]; + }; + + # ccls = { + # enable = true; + # filetypes = [ + # "c" + # "cpp" + # "objc" + # "objcpp" + # ]; + # + # initOptions.compilationDatabaseDirectory = "build"; + # }; + jdtls.enable = true; + clangd = { + enable = true; + filetypes = [ + "c" + "cpp" + "objc" + "objcpp" + ]; + }; + }; + }; + which-key.settings.spec = [ + { + __unkeyed = "l"; + group = " LSP"; + } + { + __unkeyed = "la"; + desc = "Code Action"; + } + { + __unkeyed = "ld"; + desc = "Definition"; + } + { + __unkeyed = "lD"; + desc = "References"; + } + { + __unkeyed = "lf"; + desc = "Format"; + } + { + __unkeyed = "lp"; + desc = "Prev"; + } + { + __unkeyed = "ln"; + desc = "Next"; + } + { + __unkeyed = "lt"; + desc = "Type Definition"; + } + { + __unkeyed = "li"; + desc = "Implementation"; + } + { + __unkeyed = "lh"; + desc = "Hover"; + } + { + __unkeyed = "lr"; + desc = "Rename"; + } + ]; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/lualine.nix b/home-manager/modules/neovim/plugins/lualine.nix new file mode 100644 index 0000000..d4f3088 --- /dev/null +++ b/home-manager/modules/neovim/plugins/lualine.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.lualine = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/luasnip.nix b/home-manager/modules/neovim/plugins/luasnip.nix new file mode 100644 index 0000000..22d438f --- /dev/null +++ b/home-manager/modules/neovim/plugins/luasnip.nix @@ -0,0 +1,41 @@ +{pkgs, ...}: { + programs.nixvim = { + plugins.luasnip = { + enable = true; + settings = { + enable_autosnippets = true; + store_selection_keys = ""; + }; + fromVscode = [ + { + lazyLoad = true; + paths = "${pkgs.vimPlugins.friendly-snippets}"; + } + ]; + fromLua = [{paths = [../snippets];}]; + }; + extraFiles = { + "lua/personal/luasnip-helper-funcs.lua".text = '' + local M = {} + + local ls = require("luasnip") + local sn = ls.snippet_node + local i = ls.insert_node + + function M.get_ISO_8601_date() + return os.date("%Y-%m-%d") + end + + function M.get_visual(args, parent) + if (#parent.snippet.env.LS_SELECT_RAW > 0) then + return sn(nil, i(1, parent.snippet.env.LS_SELECT_RAW)) + else + return sn(nil, i(1, ''')) + end + end + + return M + ''; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/mark-radar.nix b/home-manager/modules/neovim/plugins/mark-radar.nix new file mode 100644 index 0000000..dbd74aa --- /dev/null +++ b/home-manager/modules/neovim/plugins/mark-radar.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.mark-radar = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/marks.nix b/home-manager/modules/neovim/plugins/marks.nix new file mode 100644 index 0000000..5a9bad6 --- /dev/null +++ b/home-manager/modules/neovim/plugins/marks.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.marks = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/mini-bufremove.nix b/home-manager/modules/neovim/plugins/mini-bufremove.nix new file mode 100644 index 0000000..91b5158 --- /dev/null +++ b/home-manager/modules/neovim/plugins/mini-bufremove.nix @@ -0,0 +1,39 @@ +{ ... }: +{ + programs.nixvim = { + plugins = { + mini = { + enable = true; + + modules = { + bufremove = { }; + }; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "c"; + action.__raw = + # lua + ''require("mini.bufremove").delete''; + options = { + desc = "Close buffer"; + silent = true; + }; + } + { + mode = "n"; + key = ""; + action.__raw = + # lua + ''require("mini.bufremove").delete''; + options = { + desc = "Close buffer"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/mini-indentscope.nix b/home-manager/modules/neovim/plugins/mini-indentscope.nix new file mode 100644 index 0000000..6e417f2 --- /dev/null +++ b/home-manager/modules/neovim/plugins/mini-indentscope.nix @@ -0,0 +1,37 @@ +{...}: { + programs.nixvim = { + autoCmd = [ + { + event = ["FileType"]; + pattern = [ + "help" + "alpha" + "dashboard" + "neo-tree" + "Trouble" + "trouble" + "lazy" + "mason" + "notify" + "toggleterm" + "lazyterm" + ]; + callback.__raw = '' + function() + vim.b.miniindentscope_disable = true + end + ''; + } + ]; + + plugins = { + mini = { + enable = true; + + modules = { + indentscope = {}; + }; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/mini-surround.nix b/home-manager/modules/neovim/plugins/mini-surround.nix new file mode 100644 index 0000000..55eb723 --- /dev/null +++ b/home-manager/modules/neovim/plugins/mini-surround.nix @@ -0,0 +1,24 @@ +{ ... }: +{ + programs.nixvim = { + plugins = { + mini = { + enable = true; + + modules = { + surround = { + mappings = { + add = "gsa"; # -- Add surrounding in Normal and Visual modes + delete = "gsd"; # -- Delete surrounding + find = "gsf"; # -- Find surrounding (to the right) + find_left = "gsF"; # -- Find surrounding (to the left) + highlight = "gsh"; # -- Highlight surrounding + replace = "gsr"; # -- Replace surrounding + update_n_lines = "gsn"; # -- Update `n_lines` + }; + }; + }; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/mini.nix b/home-manager/modules/neovim/plugins/mini.nix new file mode 100644 index 0000000..863b43e --- /dev/null +++ b/home-manager/modules/neovim/plugins/mini.nix @@ -0,0 +1,18 @@ +{...}: { + programs.nixvim = { + plugins.mini = { + enable = true; + mockDevIcons = true; + + modules = { + ai = {}; + align = {}; + basics = {}; + bracketed = {}; + git = {}; + icons = {}; + pairs = {}; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/navic.nix b/home-manager/modules/neovim/plugins/navic.nix new file mode 100644 index 0000000..312cffd --- /dev/null +++ b/home-manager/modules/neovim/plugins/navic.nix @@ -0,0 +1,11 @@ +{ ... }: +{ + programs.nixvim = { + plugins.navic = { + enable = true; + settings = { + lsp.autoAttach = true; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/neoscroll.nix b/home-manager/modules/neovim/plugins/neoscroll.nix new file mode 100644 index 0000000..cb1d686 --- /dev/null +++ b/home-manager/modules/neovim/plugins/neoscroll.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + programs.nixvim = { + plugins.neoscroll = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/nix.nix b/home-manager/modules/neovim/plugins/nix.nix new file mode 100644 index 0000000..4cb6373 --- /dev/null +++ b/home-manager/modules/neovim/plugins/nix.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.nix = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/noice.nix b/home-manager/modules/neovim/plugins/noice.nix new file mode 100644 index 0000000..fce0d77 --- /dev/null +++ b/home-manager/modules/neovim/plugins/noice.nix @@ -0,0 +1,144 @@ +{ ... }: +{ + programs.nixvim = { + plugins.noice = { + enable = true; + + # Hides the title above noice boxes + + # Doesn't support the standard cmdline completions + # popupmenu.backend = "cmp"; + + settings = { + popupmenu.backend = "nui"; + routes = [ + { + filter = { + event = "msg_show"; + kind = "search_count"; + }; + opts = { + skip = true; + }; + } + { + # skip progress messages from noisy servers + filter = { + event = "lsp"; + kind = "progress"; + cond.__raw = '' + function(message) + local client = vim.tbl_get(message.opts, 'progress', 'client') + local servers = { 'jdtls' } + + for index, value in ipairs(servers) do + if value == client then + return true + end + end + end + ''; + }; + opts = { + skip = true; + }; + } + ]; + + views = { + cmdline_popup = { + border = { + style = "single"; + }; + }; + + confirm = { + border = { + style = "single"; + text = { + top = ""; + }; + }; + }; + }; + + presets = { + bottom_search = false; + command_palette = true; + long_message_to_split = true; + inc_rename = true; + lsp_doc_border = true; + }; + + lsp = { + override = { + "vim.lsp.util.convert_input_to_markdown_lines" = true; + "vim.lsp.util.stylize_markdown" = true; + "cmp.entry.get_documentation" = true; + }; + + progress.enabled = true; + signature.enabled = true; + }; + + messages = { + view = "mini"; + viewError = "mini"; + viewWarn = "mini"; + }; + + cmdline = { + format = { + cmdline = { + pattern = "^:"; + icon = ""; + lang = "vim"; + opts = { + border = { + text = { + top = "Cmd"; + }; + }; + }; + }; + search_down = { + kind = "search"; + pattern = "^/"; + icon = " "; + lang = "regex"; + }; + search_up = { + kind = "search"; + pattern = "^%?"; + icon = " "; + lang = "regex"; + }; + filter = { + pattern = "^:%s*!"; + icon = ""; + lang = "bash"; + opts = { + border = { + text = { + top = "Bash"; + }; + }; + }; + }; + lua = { + pattern = "^:%s*lua%s+"; + icon = ""; + lang = "lua"; + }; + help = { + pattern = "^:%s*he?l?p?%s+"; + icon = "󰋖"; + }; + input = { }; + }; + }; + }; + + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/none-ls.nix b/home-manager/modules/neovim/plugins/none-ls.nix new file mode 100644 index 0000000..6b28be8 --- /dev/null +++ b/home-manager/modules/neovim/plugins/none-ls.nix @@ -0,0 +1,32 @@ +{...}: { + programs.nixvim = { + plugins.none-ls = { + enable = true; + settings = { + cmd = ["bash -c nvim"]; + + debug = true; + }; + sources = { + code_actions = { + statix.enable = true; + }; + diagnostics = { + statix.enable = true; + deadnix.enable = true; + }; + formatting = { + alejandra.enable = true; + stylua.enable = true; + shfmt.enable = true; + nixpkgs_fmt.enable = true; + # prettier = { + # enable = true; + # disableTsServerFormatter = true; + # }; + # black.enable = true; + }; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/notify.nix b/home-manager/modules/neovim/plugins/notify.nix new file mode 100644 index 0000000..d87e2a9 --- /dev/null +++ b/home-manager/modules/neovim/plugins/notify.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.notify = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/obsidian.nix b/home-manager/modules/neovim/plugins/obsidian.nix new file mode 100644 index 0000000..f9e18be --- /dev/null +++ b/home-manager/modules/neovim/plugins/obsidian.nix @@ -0,0 +1,7 @@ +{...}: { + programs.nixvim = { + plugins.obsidian = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/precognition.nix b/home-manager/modules/neovim/plugins/precognition.nix new file mode 100644 index 0000000..2076ecc --- /dev/null +++ b/home-manager/modules/neovim/plugins/precognition.nix @@ -0,0 +1,27 @@ +{ pkgs, ... }: +{ + programs.nixvim = { + extraPlugins = [ pkgs.vimPlugins.precognition-nvim ]; + + keymaps = [ + { + mode = "n"; + key = "vp"; + action.__raw = '' + function() + if require("precognition").toggle() then + vim.notify("precognition on") + else + vim.notify("precognition off") + end + end + ''; + + options = { + desc = "Precognition Toggle"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/refactoring.nix b/home-manager/modules/neovim/plugins/refactoring.nix new file mode 100644 index 0000000..178a119 --- /dev/null +++ b/home-manager/modules/neovim/plugins/refactoring.nix @@ -0,0 +1,100 @@ +{...}: { + programs.nixvim = { + plugins = { + refactoring = { + enable = true; + }; + + telescope.enabledExtensions = ["refactoring"]; + + which-key.settings.spec = [ + { + __unkeyed = "r"; + mode = "x"; + group = " Refactor"; + } + ]; + }; + + keymaps = [ + { + mode = "x"; + key = "re"; + action = ":Refactor extract "; + options = { + desc = "Extract"; + silent = true; + }; + } + { + mode = "x"; + key = "rE"; + action = ":Refactor extract_to_file "; + options = { + desc = "Extract to file"; + silent = true; + }; + } + { + mode = "x"; + key = "rv"; + action = ":Refactor extract_var "; + options = { + desc = "Extract var"; + silent = true; + }; + } + { + mode = "n"; + key = "ri"; + action = ":Refactor inline_var"; + options = { + desc = "Inline var"; + silent = true; + }; + } + { + mode = "n"; + key = "rI"; + action = ":Refactor inline_func"; + options = { + desc = "Inline Func"; + silent = true; + }; + } + { + mode = "n"; + key = "rb"; + action = ":Refactor extract_block"; + options = { + desc = "Extract block"; + silent = true; + }; + } + { + mode = "n"; + key = "rB"; + action = ":Refactor extract_block_to_file"; + options = { + desc = "Extract block to file"; + silent = true; + }; + } + { + mode = "n"; + key = "fR"; + action.__raw = + # lua + '' + function() + require('telescope').extensions.refactoring.refactors() + end + ''; + options = { + desc = "Refactoring"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/render-markdown.nix b/home-manager/modules/neovim/plugins/render-markdown.nix new file mode 100644 index 0000000..c4a9d2c --- /dev/null +++ b/home-manager/modules/neovim/plugins/render-markdown.nix @@ -0,0 +1,9 @@ +{pkgs, ...}: { + programs.nixvim = { + plugins.render-markdown = { + enable = true; + }; + }; + + home.packages = with pkgs; [python312Packages.pylatexenc]; +} diff --git a/home-manager/modules/neovim/plugins/snacks.nix b/home-manager/modules/neovim/plugins/snacks.nix new file mode 100644 index 0000000..628ca4c --- /dev/null +++ b/home-manager/modules/neovim/plugins/snacks.nix @@ -0,0 +1,73 @@ +{ ... }: +{ + programs.nixvim = { + plugins.snacks = { + enable = true; + settings = { + bigfile.enabled = true; + bufdelete.enabled = true; + gitbrowse.enabled = true; + lazygit.enabled = true; + statuscolumn = { + enabled = true; + + folds = { + open = true; + git_hl = true; + }; + }; + }; + }; + keymaps = [ + { + mode = "n"; + key = "gg"; + action = "lua Snacks.lazygit()"; + options = { + desc = "Open Lazygit"; + silent = true; + }; + } + { + mode = "n"; + key = "go"; + action = "lua Snacks.gitbrowse()"; + options = { + desc = "Open file in browser"; + }; + } + { + mode = "n"; + key = "gl"; + action = "lua Snacks.lazygit.log()"; + options = { + desc = "Open Lazygit Log (cwd)"; + }; + } + { + mode = "n"; + key = "c"; + action = ''lua Snacks.bufdelete.delete()''; + options = { + desc = "Close buffer"; + }; + } + { + mode = "n"; + key = "bc"; + action = ''lua Snacks.bufdelete.other()''; + options = { + desc = "Close all buffers but current"; + }; + } + { + mode = "n"; + key = "bC"; + action = ''lua Snacks.bufdelete.all()''; + options = { + desc = "Close all buffers"; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/spectre.nix b/home-manager/modules/neovim/plugins/spectre.nix new file mode 100644 index 0000000..3d35555 --- /dev/null +++ b/home-manager/modules/neovim/plugins/spectre.nix @@ -0,0 +1,21 @@ +{...}: { + programs.nixvim = { + plugins = { + spectre = { + enable = true; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "rs"; + action = ":Spectre"; + options = { + desc = "Spectre toggle"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/telescope.nix b/home-manager/modules/neovim/plugins/telescope.nix new file mode 100644 index 0000000..37e48e4 --- /dev/null +++ b/home-manager/modules/neovim/plugins/telescope.nix @@ -0,0 +1,240 @@ +{pkgs, ...}: { + programs.nixvim = { + extraPackages = with pkgs; [ripgrep]; + + keymaps = [ + { + mode = "n"; + key = "fc"; + action.__raw = + # lua + '' + function() + require("telescope.builtin").find_files { + prompt_title = "Config Files", + cwd = vim.fn.stdpath "config", + follow = true, + } + end + ''; + options = { + desc = "Find config files"; + silent = true; + }; + } + { + mode = "n"; + key = "fF"; + action.__raw = + # lua + '' + function() + require("telescope.builtin").find_files({ hidden = true, no_ignore = true}) + end + ''; + options = { + desc = "Find all files"; + silent = true; + }; + } + { + mode = "n"; + key = "fT"; + action.__raw = + # lua + '' + function() + require("telescope.builtin").colorscheme({ enable_preview = true }) + end + ''; + options = { + desc = "Find theme"; + silent = true; + }; + } + { + mode = "n"; + key = "fW"; + action.__raw = + # lua + '' + function() + require("telescope.builtin").live_grep { + additional_args = function(args) return vim.list_extend(args, { "--hidden", "--no-ignore" }) end, + } + end + ''; + options = { + desc = "Find words in all files"; + silent = true; + }; + } + { + mode = "n"; + key = "f?"; + action.__raw = + # lua + '' + function() + require("telescope.builtin").live_grep { grep_open_files=true } + end + ''; + options = { + desc = "Find words in all open buffers"; + silent = true; + }; + } + { + mode = "n"; + key = "fe"; + action = ":Telescope file_browser"; + options = { + desc = "File Explorer"; + silent = true; + }; + } + # { + # mode = "n"; + # key = "fO"; + # action = ":Telescope frecency"; + # options = { + # desc = "Find Frequent Files"; + # silent = true; + # }; + # } + ]; + + plugins.telescope = { + enable = true; + + extensions = { + file-browser = { + enable = true; + settings = { + hidden = true; + }; + }; + + # FIX: annoying frecency validation on startup about removed files + # frecency = { + # enable = true; + # }; + + ui-select = { + enable = true; + }; + }; + + keymaps = { + "f'" = { + action = "marks"; + options.desc = "View marks"; + }; + "f/" = { + action = "current_buffer_fuzzy_find"; + options.desc = "Fuzzy find in current buffer"; + }; + "f" = { + action = "resume"; + options.desc = "Resume action"; + }; + "fa" = { + action = "autocommands"; + options.desc = "View autocommands"; + }; + "fC" = { + action = "commands"; + options.desc = "View commands"; + }; + "fb" = { + action = "buffers"; + options.desc = "View buffers"; + }; + "fc" = { + action = "grep_string"; + options.desc = "Grep string"; + }; + "fd" = { + action = "diagnostics"; + options.desc = "View diagnostics"; + }; + "ff" = { + action = "find_files"; + options.desc = "Find files"; + }; + "fh" = { + action = "help_tags"; + options.desc = "View help tags"; + }; + "fk" = { + action = "keymaps"; + options.desc = "View keymaps"; + }; + "fm" = { + action = "man_pages"; + options.desc = "View man pages"; + }; + "fo" = { + action = "oldfiles"; + options.desc = "View old files"; + }; + "fr" = { + action = "registers"; + options.desc = "View registers"; + }; + "fs" = { + action = "lsp_document_symbols"; + options.desc = "Search symbols"; + }; + "fq" = { + action = "quickfix"; + options.desc = "Search quickfix"; + }; + "fw" = { + action = "live_grep"; + options.desc = "Live grep"; + }; + "gC" = { + action = "git_bcommits"; + options.desc = "View git bcommits"; + }; + "gB" = { + action = "git_branches"; + options.desc = "View git branches"; + }; + "gc" = { + action = "git_commits"; + options.desc = "View git commits"; + }; + "gs" = { + action = "git_status"; + options.desc = "View git status"; + }; + "gS" = { + action = "git_stash"; + options.desc = "View git stashes"; + }; + }; + + settings = { + defaults = { + file_ignore_patterns = [ + "^.git/" + "^.mypy_cache/" + "^__pycache__/" + "^output/" + "^data/" + "%.ipynb" + ]; + set_env.COLORTERM = "truecolor"; + }; + + pickers = { + colorscheme = { + enable_preview = true; + }; + }; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/todo-comments.nix b/home-manager/modules/neovim/plugins/todo-comments.nix new file mode 100644 index 0000000..71b5b8c --- /dev/null +++ b/home-manager/modules/neovim/plugins/todo-comments.nix @@ -0,0 +1,67 @@ +{ ... }: +{ + programs.nixvim = { + plugins.todo-comments = { + enable = true; + + keymaps = { + todoTelescope = { + key = "ft"; + keywords = "TODO,FIX,HACK"; + }; + }; + settings = { + keywords = { + FIX = { + alt = [ + "FIXME" + "BUG" + "FIXIT" + "ISSUE" + ]; + color = "error"; + icon = " "; + }; + HACK = { + color = "warning"; + icon = " "; + }; + NOTE = { + alt = [ "INFO" ]; + color = "hint"; + icon = " "; + }; + PERF = { + alt = [ + "OPTIM" + "PERFORMANCE" + "OPTIMIZE" + ]; + icon = " "; + }; + TEST = { + alt = [ + "TESTING" + "PASSED" + "FAILED" + ]; + color = "test"; + icon = "⏲ "; + }; + TODO = { + color = "info"; + icon = " "; + }; + WARN = { + alt = [ + "WARNING" + "XXX" + ]; + color = "warning"; + icon = " "; + }; + }; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/toggleterm.nix b/home-manager/modules/neovim/plugins/toggleterm.nix new file mode 100644 index 0000000..27c0172 --- /dev/null +++ b/home-manager/modules/neovim/plugins/toggleterm.nix @@ -0,0 +1,41 @@ +{ ... }: +{ + programs.nixvim = { + plugins.toggleterm = { + enable = true; + + settings = { + direction = "float"; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "tt"; + action = ":ToggleTerm"; + options = { + desc = "Open Terminal"; + silent = true; + }; + } + { + mode = "n"; + key = "tg"; + action.__raw = + # lua + '' + function() + local toggleterm = require('toggleterm.terminal') + + toggleterm.Terminal:new({cmd = 'lazygit',hidden = true}):toggle() + end + ''; + options = { + desc = "Open Lazygit"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/treesitter.nix b/home-manager/modules/neovim/plugins/treesitter.nix new file mode 100644 index 0000000..c2e37af --- /dev/null +++ b/home-manager/modules/neovim/plugins/treesitter.nix @@ -0,0 +1,31 @@ +{...}: { + programs.nixvim = { + plugins = { + treesitter = { + enable = true; + nixvimInjections = true; + + settings = { + indent.enable = true; + highlight = { + enable = true; + disable = [ + "latex" + ]; + }; + incremental_selection.enable = true; + }; + }; + + treesitter-context = { + enable = false; + }; + + treesitter-refactor = { + enable = true; + highlightDefinitions.enable = true; + }; + hmts.enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/trouble.nix b/home-manager/modules/neovim/plugins/trouble.nix new file mode 100644 index 0000000..9130c96 --- /dev/null +++ b/home-manager/modules/neovim/plugins/trouble.nix @@ -0,0 +1,108 @@ +{...}: { + programs.nixvim = { + plugins = { + trouble = { + enable = true; + + settings = { + modes = { + preview_split = { + mode = "diagnostics"; + preview = { + type = "split"; + relative = "win"; + position = "right"; + size = 0.5; + }; + }; + + preview_float = { + mode = "diagnostics"; + preview = { + type = "float"; + relative = "editor"; + border = "rounded"; + title = "Preview"; + title_pos = "center"; + position = [ + 0 + (-2) + ]; + size = { + width = 0.3; + height = 0.3; + }; + zindex = 200; + }; + }; + }; + }; + }; + + which-key.settings.spec = [ + { + __unkeyed = "x"; + mode = "n"; + group = " Trouble"; + } + ]; + }; + + keymaps = [ + { + mode = "n"; + key = "xx"; + action = "Trouble preview_split toggle"; + options = { + desc = "Diagnostics toggle"; + silent = true; + }; + } + { + mode = "n"; + key = "xX"; + action = "Trouble preview_split toggle filter.buf=0"; + options = { + desc = "Buffer Diagnostics toggle"; + silent = true; + }; + } + { + mode = "n"; + key = "us"; + action = "Trouble symbols toggle focus=false"; + options = { + desc = "Symbols toggle"; + silent = true; + }; + } + { + mode = "n"; + key = "xl"; + action = "Trouble lsp toggle focus=false win.position=right"; + options = { + desc = "LSP Definitions / references / ... toggle"; + silent = true; + }; + } + { + mode = "n"; + key = "xL"; + action = "Trouble loclist toggle"; + options = { + desc = "Location List toggle"; + silent = true; + }; + } + { + mode = "n"; + key = "xQ"; + action = "Trouble qflist toggle"; + options = { + desc = "Quickfix List toggle"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/undotree.nix b/home-manager/modules/neovim/plugins/undotree.nix new file mode 100644 index 0000000..a63d00b --- /dev/null +++ b/home-manager/modules/neovim/plugins/undotree.nix @@ -0,0 +1,39 @@ +{...}: { + programs.nixvim = { + plugins.undotree = { + enable = true; + + settings = { + CursorLine = true; + DiffAutoOpen = true; + DiffCommand = "diff"; + DiffpanelHeight = 10; + HelpLine = true; + HighlightChangedText = true; + HighlightChangedWithSign = true; + HighlightSyntaxAdd = "DiffAdd"; + HighlightSyntaxChange = "DiffChange"; + HighlightSyntaxDel = "DiffDelete"; + RelativeTimestamp = true; + SetFocusWhenToggle = true; + ShortIndicators = false; + TreeNodeShape = "*"; + TreeReturnShape = "\\"; + TreeSplitShape = "/"; + TreeVertShape = "|"; + }; + }; + + keymaps = [ + { + mode = "n"; + key = "uu"; + action = ":UndotreeToggle"; + options = { + desc = "Undotree toggle"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/vimtex.nix b/home-manager/modules/neovim/plugins/vimtex.nix new file mode 100644 index 0000000..6569407 --- /dev/null +++ b/home-manager/modules/neovim/plugins/vimtex.nix @@ -0,0 +1,87 @@ +{...}: { + # inria + programs.nixvim = { + plugins.vimtex = { + enable = true; + + settings = { + view_method = "zathura"; + + quickfix_enabled = true; + quickfix_open_on_warning = false; + + # Ignore undesired errors and warnings + quickfix_ignore_filters = [ + "Underfull" + "Overfull" + "specifier changed to" + "Token not allowed in a PDF string" + ]; + + # TOC settings + toc_config = { + name = "TOC"; + layers = [ + "content" + "todo" + ]; + resize = true; + split_width = 50; + todo_sorted = false; + show_help = true; + show_numbers = true; + mode = 2; + }; + }; + }; + + files."after/ftplugin/tex.lua".keymaps = [ + { + mode = "n"; + key = "m"; + action = ":VimtexView"; + } + ]; + + autoCmd = [ + { + event = [ + "BufEnter" + "BufWinEnter" + ]; + pattern = "*.tex"; + command = "set filetype=tex \"| VimtexTocOpen"; + } + + # Folding + { + event = "FileType"; + pattern = [ + "tex" + "latex" + ]; + callback.__raw = '' + function () + vim.o.foldmethod = 'expr' + vim.o.foldexpr = 'vimtex#fold#level(v:lnum)' + vim.o.foldtext = 'vimtex#fold#text()' + end + ''; + } + + # Compile on initialization + { + event = "User"; + pattern = "VimtexEventInitPost"; + callback = "vimtex#compiler#compile"; + } + + # Cleanup on exit + { + event = "User"; + pattern = "VimtexEventQuit"; + command = "call vimtex#compiler#clean(0)"; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/which-key.nix b/home-manager/modules/neovim/plugins/which-key.nix new file mode 100644 index 0000000..258cd33 --- /dev/null +++ b/home-manager/modules/neovim/plugins/which-key.nix @@ -0,0 +1,17 @@ +{...}: { + programs.nixvim = { + plugins.which-key = { + enable = true; + settings = { + spec = [ + # "m" = "󱋼 Marks"; + # "t" = " Trouble"; + # "w" = " Window"; + # "d" = " Dap"; + # "n" = " Neorg"; + # "l" = "󰒋 Lsp"; + ]; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/yanky.nix b/home-manager/modules/neovim/plugins/yanky.nix new file mode 100644 index 0000000..e4919de --- /dev/null +++ b/home-manager/modules/neovim/plugins/yanky.nix @@ -0,0 +1,9 @@ +{...}: { + programs.nixvim = { + plugins = { + yanky = { + enable = true; + }; + }; + }; +} diff --git a/home-manager/modules/neovim/plugins/yazi.nix b/home-manager/modules/neovim/plugins/yazi.nix new file mode 100644 index 0000000..f31c548 --- /dev/null +++ b/home-manager/modules/neovim/plugins/yazi.nix @@ -0,0 +1,21 @@ +{...}: { + programs.nixvim = { + plugins.yazi.enable = true; + + keymaps = [ + { + mode = "n"; + key = "e"; + action.__raw = '' + function() + require('yazi').yazi() + end + ''; + options = { + desc = "Yazi toggle"; + silent = true; + }; + } + ]; + }; +} diff --git a/home-manager/modules/neovim/plugins/zenmode.nix b/home-manager/modules/neovim/plugins/zenmode.nix new file mode 100644 index 0000000..f1e5b8a --- /dev/null +++ b/home-manager/modules/neovim/plugins/zenmode.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + programs.nixvim = { + plugins.zen-mode = { + enable = true; + }; + }; +} diff --git a/home-manager/modules/neovim/snippets/tex/delimiter.lua b/home-manager/modules/neovim/snippets/tex/delimiter.lua new file mode 100644 index 0000000..e99989d --- /dev/null +++ b/home-manager/modules/neovim/snippets/tex/delimiter.lua @@ -0,0 +1,92 @@ +local helpers = require("personal.luasnip-helper-funcs") +local get_visual = helpers.get_visual + +-- Math context detection +local tex = {} +tex.in_mathzone = function() + return vim.fn["vimtex#syntax#in_mathzone"]() == 1 +end +tex.in_text = function() + return not tex.in_mathzone() +end + +-- Return snippet tables +return { + -- LEFT/RIGHT PARENTHESES + s( + { trig = "([^%a])l%(", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\left(<>\\right)", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- LEFT/RIGHT SQUARE BRACES + s( + { trig = "([^%a])l%[", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\left[<>\\right]", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- LEFT/RIGHT CURLY BRACES + s( + { trig = "([^%a])l%{", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\left\\{<>\\right\\}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- BIG PARENTHESES + s( + { trig = "([^%a])b%(", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\big(<>\\big)", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- BIG SQUARE BRACES + s( + { trig = "([^%a])b%[", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\big[<>\\big]", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- BIG CURLY BRACES + s( + { trig = "([^%a])b%{", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\big\\{<>\\big\\}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- ESCAPED CURLY BRACES + s( + { trig = "([^%a])\\%{", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, + fmta("<>\\{<>\\}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- LATEX QUOTATION MARK + s( + { trig = "``", snippetType = "autosnippet" }, + fmta("``<>''", { + d(1, get_visual), + }) + ), +} diff --git a/home-manager/modules/neovim/snippets/tex/environments.lua b/home-manager/modules/neovim/snippets/tex/environments.lua new file mode 100644 index 0000000..93d5255 --- /dev/null +++ b/home-manager/modules/neovim/snippets/tex/environments.lua @@ -0,0 +1,221 @@ +local helpers = require("personal.luasnip-helper-funcs") +local get_visual = helpers.get_visual + +-- Math context detection +local tex = {} +tex.in_mathzone = function() + return vim.fn["vimtex#syntax#in_mathzone"]() == 1 +end +tex.in_text = function() + return not tex.in_mathzone() +end + +local line_begin = require("luasnip.extras.expand_conditions").line_begin + +-- Return snippet tables +return { + -- GENERIC ENVIRONMENT + s( + { trig = "new", snippetType = "autosnippet" }, + fmta( + [[ + \begin{<>} + <> + \end{<>} + ]], + { + i(1), + d(2, get_visual), + rep(1), + } + ), + { condition = line_begin } + ), + s( + { trig = "def", snippetType = "autosnippet" }, + fmta( + [[ + \begin{definition}[<>] + <> + \end{definition} + ]], + { + i(1), + d(2, get_visual), + } + ), + { condition = line_begin } + ), + -- ENVIRONMENT WITH ONE EXTRA ARGUMENT + s( + { trig = "n2", snippetType = "autosnippet" }, + fmta( + [[ + \begin{<>}{<>} + <> + \end{<>} + ]], + { + i(1), + i(2), + d(3, get_visual), + rep(1), + } + ), + { condition = line_begin } + ), + -- ENVIRONMENT WITH TWO EXTRA ARGUMENTS + s( + { trig = "n3", snippetType = "autosnippet" }, + fmta( + [[ + \begin{<>}{<>}{<>} + <> + \end{<>} + ]], + { + i(1), + i(2), + i(3), + d(4, get_visual), + rep(1), + } + ), + { condition = line_begin } + ), + -- TOPIC ENVIRONMENT (my custom tcbtheorem environment) + s( + { trig = "nt", snippetType = "autosnippet" }, + fmta( + [[ + \begin{topic}{<>}{<>} + <> + \end{topic} + ]], + { + i(1), + i(2), + d(3, get_visual), + } + ), + { condition = line_begin } + ), + -- EQUATION + s( + { trig = "nn", snippetType = "autosnippet" }, + fmta( + [[ + \begin{equation*} + <> + \end{equation*} + ]], + { + i(1), + } + ), + { condition = line_begin } + ), + -- SPLIT EQUATION + s( + { trig = "ss", snippetType = "autosnippet" }, + fmta( + [[ + \begin{equation*} + \begin{split} + <> + \end{split} + \end{equation*} + ]], + { + d(1, get_visual), + } + ), + { condition = line_begin } + ), + -- ALIGN + s( + { trig = "all", snippetType = "autosnippet" }, + fmta( + [[ + \begin{align*} + <> + \end{align*} + ]], + { + i(1), + } + ), + { condition = line_begin } + ), + -- ITEMIZE + s( + { trig = "itt", snippetType = "autosnippet" }, + fmta( + [[ + \begin{itemize} + + \item <> + + \end{itemize} + ]], + { + i(0), + } + ), + { condition = line_begin } + ), + -- ENUMERATE + s( + { trig = "enn", snippetType = "autosnippet" }, + fmta( + [[ + \begin{enumerate} + + \item <> + + \end{enumerate} + ]], + { + i(0), + } + ) + ), + -- INLINE MATH + s( + { trig = "([^%l])mm", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>$<>$", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- INLINE MATH ON NEW LINE + s( + { trig = "^mm", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("$<>$", { + i(1), + }) + ), + -- FIGURE + s( + { trig = "fig" }, + fmta( + [[ + \begin{figure}[htb!] + \centering + \includegraphics[width=<>\linewidth]{<>} + \caption{<>} + \label{fig:<>} + \end{figure} + ]], + { + i(1), + i(2), + i(3), + i(4), + } + ), + { condition = line_begin } + ), +} diff --git a/home-manager/modules/neovim/snippets/tex/fonts.lua b/home-manager/modules/neovim/snippets/tex/fonts.lua new file mode 100644 index 0000000..49bb1eb --- /dev/null +++ b/home-manager/modules/neovim/snippets/tex/fonts.lua @@ -0,0 +1,106 @@ +local helpers = require("personal.luasnip-helper-funcs") +local get_visual = helpers.get_visual + +-- A logical OR of `line_begin` and the regTrig '[^%a]trig' +function line_begin_or_non_letter(line_to_cursor, matched_trigger) + local line_begin = line_to_cursor:sub(1, -(#matched_trigger + 1)):match("^%s*$") + local non_letter = line_to_cursor:sub(-(#matched_trigger + 1), -(#matched_trigger + 1)):match("[^%a]") + return line_begin or non_letter +end + +-- Math context detection +local tex = {} +tex.in_mathzone = function() + return vim.fn["vimtex#syntax#in_mathzone"]() == 1 +end +tex.in_text = function() + return not tex.in_mathzone() +end + +local line_begin = function(line_to_cursor, matched_trigger) + -- +1 because `string.sub("abcd", 1, -2)` -> abc + return line_to_cursor:sub(1, -(#matched_trigger + 1)):match("^%s*$") +end + +-- Return snippet tables +return { + -- TYPEWRITER i.e. \texttt + s( + { trig = "([^%a])tt", regTrig = true, wordTrig = false, snippetType = "autosnippet", priority = 2000 }, + fmta("<>\\texttt{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_text } + ), + -- ITALIC i.e. \textit + s( + { trig = "([^%a])tii", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\textit{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- BOLD i.e. \textbf + s( + { trig = "tbb", snippetType = "autosnippet" }, + fmta("\\textbf{<>}", { + d(1, get_visual), + }) + ), + -- MATH ROMAN i.e. \mathrm + s( + { trig = "([^%a])rmm", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\mathrm{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- MATH CALIGRAPHY i.e. \mathcal + s( + { trig = "([^%a])mcc", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\mathcal{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- MATH BOLDFACE i.e. \mathbf + s( + { trig = "([^%a])mbf", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\mathbf{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- MATH BLACKBOARD i.e. \mathbb + s( + { trig = "([^%a])mbb", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\mathbb{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }) + ), + -- REGULAR TEXT i.e. \text (in math environments) + s( + { trig = "([^%a])tee", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\text{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), +} diff --git a/home-manager/modules/neovim/snippets/tex/greek.lua b/home-manager/modules/neovim/snippets/tex/greek.lua new file mode 100644 index 0000000..9acc05f --- /dev/null +++ b/home-manager/modules/neovim/snippets/tex/greek.lua @@ -0,0 +1,105 @@ +-- Return snippet tables +return { + s({ trig = ";a", snippetType = "autosnippet" }, { + t("\\alpha"), + }), + s({ trig = ";b", snippetType = "autosnippet" }, { + t("\\beta"), + }), + s({ trig = ";g", snippetType = "autosnippet" }, { + t("\\gamma"), + }), + s({ trig = ";G", snippetType = "autosnippet" }, { + t("\\Gamma"), + }), + s({ trig = ";d", snippetType = "autosnippet" }, { + t("\\delta"), + }), + s({ trig = ";D", snippetType = "autosnippet" }, { + t("\\Delta"), + }), + s({ trig = ";e", snippetType = "autosnippet" }, { + t("\\epsilon"), + }), + s({ trig = ";ve", snippetType = "autosnippet" }, { + t("\\varepsilon"), + }), + s({ trig = ";z", snippetType = "autosnippet" }, { + t("\\zeta"), + }), + s({ trig = ";h", snippetType = "autosnippet" }, { + t("\\eta"), + }), + s({ trig = ";o", snippetType = "autosnippet" }, { + t("\\theta"), + }), + s({ trig = ";vo", snippetType = "autosnippet" }, { + t("\\vartheta"), + }), + s({ trig = ";O", snippetType = "autosnippet" }, { + t("\\Theta"), + }), + s({ trig = ";k", snippetType = "autosnippet" }, { + t("\\kappa"), + }), + s({ trig = ";l", snippetType = "autosnippet" }, { + t("\\lambda"), + }), + s({ trig = ";L", snippetType = "autosnippet" }, { + t("\\Lambda"), + }), + s({ trig = ";m", snippetType = "autosnippet" }, { + t("\\mu"), + }), + s({ trig = ";n", snippetType = "autosnippet" }, { + t("\\nu"), + }), + s({ trig = ";x", snippetType = "autosnippet" }, { + t("\\xi"), + }), + s({ trig = ";X", snippetType = "autosnippet" }, { + t("\\Xi"), + }), + s({ trig = ";i", snippetType = "autosnippet" }, { + t("\\pi"), + }), + s({ trig = ";I", snippetType = "autosnippet" }, { + t("\\Pi"), + }), + s({ trig = ";r", snippetType = "autosnippet" }, { + t("\\rho"), + }), + s({ trig = ";s", snippetType = "autosnippet" }, { + t("\\sigma"), + }), + s({ trig = ";S", snippetType = "autosnippet" }, { + t("\\Sigma"), + }), + s({ trig = ";t", snippetType = "autosnippet" }, { + t("\\tau"), + }), + s({ trig = ";f", snippetType = "autosnippet" }, { + t("\\phi"), + }), + s({ trig = ";vf", snippetType = "autosnippet" }, { + t("\\varphi"), + }), + s({ trig = ";F", snippetType = "autosnippet" }, { + t("\\Phi"), + }), + s({ trig = ";c", snippetType = "autosnippet" }, { + t("\\chi"), + }), + s({ trig = ";p", snippetType = "autosnippet" }, { + t("\\psi"), + }), + s({ trig = ";P", snippetType = "autosnippet" }, { + t("\\Psi"), + }), + s({ trig = ";w", snippetType = "autosnippet" }, { + t("\\omega"), + }), + s({ trig = ";W", snippetType = "autosnippet" }, { + t("\\Omega"), + }), +} diff --git a/home-manager/modules/neovim/snippets/tex/luatex.lua b/home-manager/modules/neovim/snippets/tex/luatex.lua new file mode 100644 index 0000000..c845673 --- /dev/null +++ b/home-manager/modules/neovim/snippets/tex/luatex.lua @@ -0,0 +1,19 @@ +local helpers = require("personal.luasnip-helper-funcs") +local get_visual = helpers.get_visual +local line_begin = require("luasnip.extras.expand_conditions").line_begin + +-- Return snippet tables +return { + -- tex.sprint + s( + { trig = "tpp", snippetType = "autosnippet" }, + fmta( + [[ + tex.sprint(<>) + ]], + { + d(1, get_visual), + } + ) + ), +} diff --git a/home-manager/modules/neovim/snippets/tex/math.lua b/home-manager/modules/neovim/snippets/tex/math.lua new file mode 100644 index 0000000..a97dace --- /dev/null +++ b/home-manager/modules/neovim/snippets/tex/math.lua @@ -0,0 +1,560 @@ +local helpers = require("personal.luasnip-helper-funcs") +local get_visual = helpers.get_visual +local ls = require("luasnip") +local sn = ls.snippet_node +local t = ls.text_node +local r = ls.restore_node +-- Math context detection +local tex = {} +-- local function in_mathzone() return vim.api.nvim_eval('vimtex#syntax#in_mathzone()') == 1 end +tex.in_mathzone = function() + return vim.fn["vimtex#syntax#in_mathzone"]() == 1 +end +tex.in_text = function() + return not tex.in_mathzone() +end + +tex.generate_matrix = function(args, snip) + local rows = tonumber(snip.captures[2]) + local cols = tonumber(snip.captures[3]) + local nodes = {} + local ins_indx = 1 + for j = 1, rows do + table.insert(nodes, r(ins_indx, tostring(j) .. "x1", i(1))) + ins_indx = ins_indx + 1 + for k = 2, cols do + table.insert(nodes, t(" & ")) + table.insert(nodes, r(ins_indx, tostring(j) .. "x" .. tostring(k), i(1))) + ins_indx = ins_indx + 1 + end + table.insert(nodes, t({ "\\\\", "" })) + end + -- fix last node. + nodes[#nodes] = t("\\\\") + return sn(nil, nodes) +end + +-- Return snippet tables +return { + s({ trig = "vton", snippetType = "autosnippet" }, { + t("\\vec{v}_1, \\cdots, \\vec{v}_n"), + }), + -- SUPERSCRIPT + s( + { trig = "([%w%)%]%}])'", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>^{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + -- SUBSCRIPT + s( + { trig = "([%w%)%]%}]);", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>_{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + -- SUBSCRIPT AND SUPERSCRIPT + s( + { trig = "([%w%)%]%}])__", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>^{<>}_{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + i(1), + i(2), + }), + { condition = tex.in_mathzone } + ), + -- TEXT SUBSCRIPT + s( + { trig = "sd", snippetType = "autosnippet", wordTrig = false }, + fmta("_{\\mathrm{<>}}", { d(1, get_visual) }), + { condition = tex.in_mathzone } + ), + -- SUPERSCRIPT SHORTCUT + -- Places the first alphanumeric character after the trigger into a superscript. + s( + { trig = '([%w%)%]%}])"([%w])', regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>^{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + f(function(_, snip) + return snip.captures[2] + end), + }), + { condition = tex.in_mathzone } + ), + -- SUBSCRIPT SHORTCUT + -- Places the first alphanumeric character after the trigger into a subscript. + s( + { trig = "([%w%)%]%}]):([%w])", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>_{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + f(function(_, snip) + return snip.captures[2] + end), + }), + { condition = tex.in_mathzone } + ), + -- EULER'S NUMBER SUPERSCRIPT SHORTCUT + s( + { trig = "([^%a])ee", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>e^{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + -- ZERO SUBSCRIPT SHORTCUT + s( + { trig = "([%a%)%]%}])00", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>_{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + t("0"), + }), + { condition = tex.in_mathzone } + ), + -- MINUS ONE SUPERSCRIPT SHORTCUT + s( + { trig = "([%a%)%]%}])11", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>_{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + t("-1"), + }), + { condition = tex.in_mathzone } + ), + -- J SUBSCRIPT SHORTCUT (since jk triggers snippet jump forward) + s( + { trig = "([%a%)%]%}])JJ", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>_{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + t("j"), + }), + { condition = tex.in_mathzone } + ), + -- PLUS SUPERSCRIPT SHORTCUT + s( + { trig = "([%a%)%]%}])%+%+", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>^{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + t("+"), + }), + { condition = tex.in_mathzone } + ), + -- COMPLEMENT SUPERSCRIPT + s( + { trig = "([%a%)%]%}])CC", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>^{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + t("\\complement"), + }), + { condition = tex.in_mathzone } + ), + -- CONJUGATE (STAR) SUPERSCRIPT SHORTCUT + s( + { trig = "([%a%)%]%}])%*%*", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>^{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + t("*"), + }), + { condition = tex.in_mathzone } + ), + -- VECTOR, i.e. \vec + s( + { trig = "([^%a])vv", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\vec{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + -- DEFAULT UNIT VECTOR WITH SUBSCRIPT, i.e. \unitvector_{} + s( + { trig = "([^%a])ue", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\unitvector_{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + -- UNIT VECTOR WITH HAT, i.e. \uvec{} + s( + { trig = "([^%a])uv", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\uvec{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + -- MATRIX, i.e. \vec + s( + { trig = "([^%a])mt", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\mat{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + -- FRACTION + s( + { trig = "([^%a])ff", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\frac{<>}{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + i(2), + }), + { condition = tex.in_mathzone } + ), + -- ANGLE + s( + { trig = "([^%a])gg", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\ang{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + -- ABSOLUTE VALUE + s( + { trig = "([^%a])aa", regTrig = true, wordTrig = false, snippetType = "autosnippet" }, + fmta("<>\\abs{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + -- SQUARE ROOT + s( + { trig = "([^%\\])sq", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\sqrt{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + -- BINOMIAL SYMBOL + s( + { trig = "([^%\\])bnn", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\binom{<>}{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + i(1), + i(2), + }), + { condition = tex.in_mathzone } + ), + -- LOGARITHM WITH BASE SUBSCRIPT + s( + { trig = "([^%a%\\])ll", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\log_{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + i(1), + }), + { condition = tex.in_mathzone } + ), + -- DERIVATIVE with denominator only + s( + { trig = "([^%a])dV", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\dvOne{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + -- DERIVATIVE with numerator and denominator + s( + { trig = "([^%a])dvv", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\dv{<>}{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + i(1), + i(2), + }), + { condition = tex.in_mathzone } + ), + -- DERIVATIVE with numerator, denominator, and higher-order argument + s( + { trig = "([^%a])ddv", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\dvN{<>}{<>}{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + i(1), + i(2), + i(3), + }), + { condition = tex.in_mathzone } + ), + -- PARTIAL DERIVATIVE with denominator only + s( + { trig = "([^%a])pV", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\pdvOne{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + -- PARTIAL DERIVATIVE with numerator and denominator + s( + { trig = "([^%a])pvv", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\pdv{<>}{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + i(1), + i(2), + }), + { condition = tex.in_mathzone } + ), + -- PARTIAL DERIVATIVE with numerator, denominator, and higher-order argument + s( + { trig = "([^%a])ppv", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\pdvN{<>}{<>}{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + i(1), + i(2), + i(3), + }), + { condition = tex.in_mathzone } + ), + -- SUM with lower limit + s( + { trig = "([^%a])sM", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\sum_{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + i(1), + }), + { condition = tex.in_mathzone } + ), + -- SUM with upper and lower limit + s( + { trig = "([^%a])smm", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\sum_{<>}^{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + i(1), + i(2), + }), + { condition = tex.in_mathzone } + ), + -- INTEGRAL with upper and lower limit + s( + { trig = "([^%a])intt", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\int_{<>}^{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + i(1), + i(2), + }), + { condition = tex.in_mathzone } + ), + -- INTEGRAL from positive to negative infinity + s( + { trig = "([^%a])intf", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\int_{\\infty}^{\\infty}", { + f(function(_, snip) + return snip.captures[1] + end), + }), + { condition = tex.in_mathzone } + ), + -- BOXED command + s( + { trig = "([^%a])bb", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + fmta("<>\\boxed{<>}", { + f(function(_, snip) + return snip.captures[1] + end), + d(1, get_visual), + }), + { condition = tex.in_mathzone } + ), + + -- { trig = "([^%a])lim", wordTrig = false, regTrig = true, snippetType = "autosnippet" }, + -- fmta("<>\\lim_{<>}", { + -- f(function(_, snip) + -- return snip.captures[1] + -- end), + -- }), + -- { condition = tex.in_mathzone } + -- ), + -- + -- BEGIN STATIC SNIPPETS + -- + + -- DIFFERENTIAL, i.e. \diff + s({ trig = "df", snippetType = "autosnippet", priority = 2000, snippetType = "autosnippet" }, { + t("\\diff"), + }, { condition = tex.in_mathzone }), + -- BASIC INTEGRAL SYMBOL, i.e. \int + s({ trig = "in1", snippetType = "autosnippet" }, { + t("\\int"), + }, { condition = tex.in_mathzone }), + -- DOUBLE INTEGRAL, i.e. \iint + s({ trig = "in2", snippetType = "autosnippet" }, { + t("\\iint"), + }, { condition = tex.in_mathzone }), + -- TRIPLE INTEGRAL, i.e. \iiint + s({ trig = "in3", snippetType = "autosnippet" }, { + t("\\iiint"), + }, { condition = tex.in_mathzone }), + -- CLOSED SINGLE INTEGRAL, i.e. \oint + s({ trig = "oi1", snippetType = "autosnippet" }, { + t("\\oint"), + }, { condition = tex.in_mathzone }), + -- CLOSED DOUBLE INTEGRAL, i.e. \oiint + s({ trig = "oi2", snippetType = "autosnippet" }, { + t("\\oiint"), + }, { condition = tex.in_mathzone }), + -- GRADIENT OPERATOR, i.e. \grad + s({ trig = "gdd", snippetType = "autosnippet" }, { + t("\\grad "), + }, { condition = tex.in_mathzone }), + -- CURL OPERATOR, i.e. \curl + s({ trig = "cll", snippetType = "autosnippet" }, { + t("\\curl "), + }, { condition = tex.in_mathzone }), + -- DIVERGENCE OPERATOR, i.e. \divergence + s({ trig = "DI", snippetType = "autosnippet" }, { + t("\\div "), + }, { condition = tex.in_mathzone }), + -- LAPLACIAN OPERATOR, i.e. \laplacian + s({ trig = "laa", snippetType = "autosnippet" }, { + t("\\laplacian "), + }, { condition = tex.in_mathzone }), + -- PARALLEL SYMBOL, i.e. \parallel + s({ trig = "||", snippetType = "autosnippet" }, { + t("\\parallel"), + }), + -- CDOTS, i.e. \cdots + s({ trig = "cdd", snippetType = "autosnippet" }, { + t("\\cdots"), + }), + -- LDOTS, i.e. \ldots + s({ trig = "ldd", snippetType = "autosnippet" }, { + t("\\ldots"), + }), + -- EQUIV, i.e. \equiv + s({ trig = "eqq", snippetType = "autosnippet" }, { + t("\\equiv "), + }), + -- SETMINUS, i.e. \setminus + s({ trig = "stm", snippetType = "autosnippet" }, { + t("\\setminus "), + }), + -- SUBSET, i.e. \subset + s({ trig = "sbb", snippetType = "autosnippet" }, { + t("\\subset "), + }), + -- APPROX, i.e. \approx + s({ trig = "px", snippetType = "autosnippet" }, { + t("\\approx "), + }, { condition = tex.in_mathzone }), + -- PROPTO, i.e. \propto + s({ trig = "pt", snippetType = "autosnippet" }, { + t("\\propto "), + }, { condition = tex.in_mathzone }), + -- COLON, i.e. \colon + s({ trig = "::", snippetType = "autosnippet" }, { + t("\\colon "), + }), + -- IMPLIES, i.e. \implies + s({ trig = ">>", snippetType = "autosnippet" }, { + t("\\implies "), + }), + -- DOT PRODUCT, i.e. \cdot + s({ trig = ",.", snippetType = "autosnippet" }, { + t("\\cdot "), + }), + -- CROSS PRODUCT, i.e. \times + s({ trig = "xx", snippetType = "autosnippet" }, { + t("\\times "), + }), + s( + { + trig = "([bBpvV])mat(%d+)x(%d+)([ar])", + name = "[bBpvV]matrix", + dscr = "matrices", + regTrig = true, + hidden = true, + }, + fmta( + [[ + \begin{<>}<> + <> + \end{<>}]], + { + f(function(_, snip) + return snip.captures[1] .. "matrix" + end), + f(function(_, snip) + if snip.captures[4] == "a" then + out = string.rep("c", tonumber(snip.captures[3]) - 1) + return "[" .. out .. "|c]" + end + return "" + end), + d(1, tex.generate_matrix), + f(function(_, snip) + return snip.captures[1] .. "matrix" + end), + } + ), + { condition = tex.in_math, show_condition = tex.in_math } + ), +} diff --git a/home-manager/modules/neovim/snippets/tex/static.lua b/home-manager/modules/neovim/snippets/tex/static.lua new file mode 100644 index 0000000..0540f4b --- /dev/null +++ b/home-manager/modules/neovim/snippets/tex/static.lua @@ -0,0 +1,58 @@ +local helpers = require("personal.luasnip-helper-funcs") +local get_visual = helpers.get_visual + +local line_begin = require("luasnip.extras.expand_conditions").line_begin + +-- Environment/syntax context detection +local tex = {} +tex.in_mathzone = function() + return vim.fn["vimtex#syntax#in_mathzone"]() == 1 +end +tex.in_text = function() + return not tex.in_mathzone() +end +tex.in_tikz = function() + local is_inside = vim.fn["vimtex#env#is_inside"]("tikzpicture") + return (is_inside[1] > 0 and is_inside[2] > 0) +end + +-- Return snippet tables +return { + s({ trig = "q" }, { + t("\\quad "), + }), + s({ trig = "qq", snippetType = "autosnippet" }, { + t("\\qquad "), + }), + s({ trig = "npp", snippetType = "autosnippet" }, { + t({ "\\newpage", "" }), + }, { condition = line_begin }), + s({ trig = "which", snippetType = "autosnippet" }, { + t("\\text{ for which } "), + }, { condition = tex.in_mathzone }), + s({ trig = "all", snippetType = "autosnippet" }, { + t("\\text{ for all } "), + }, { condition = tex.in_mathzone }), + s({ trig = "and", snippetType = "autosnippet" }, { + t("\\quad \\text{and} \\quad"), + }, { condition = tex.in_mathzone }), + s({ trig = "forall", snippetType = "autosnippet" }, { + t("\\text{ for all } "), + }, { condition = tex.in_mathzone }), + s({ trig = "toc", snippetType = "autosnippet" }, { + t("\\tableofcontents"), + }, { condition = line_begin }), + s({ trig = "inff", snippetType = "autosnippet" }, { + t("\\infty"), + }), + s({ trig = "ii", snippetType = "autosnippet" }, { + t("\\item "), + }, { condition = line_begin }), + s( + { trig = "--", snippetType = "autosnippet" }, + { t("% --------------------------------------------- %") }, + { condition = line_begin } + ), + -- HLINE WITH EXTRA VERTICAL SPACE + s({ trig = "hl" }, { t("\\hline {\\rule{0pt}{2.5ex}} \\hspace{-7pt}") }, { condition = line_begin }), +} diff --git a/home-manager/modules/neovim/snippets/tex/system.lua b/home-manager/modules/neovim/snippets/tex/system.lua new file mode 100644 index 0000000..506d385 --- /dev/null +++ b/home-manager/modules/neovim/snippets/tex/system.lua @@ -0,0 +1,192 @@ +local helpers = require("personal.luasnip-helper-funcs") +local get_visual = helpers.get_visual + +local line_begin = require("luasnip.extras.expand_conditions").line_begin + +-- Math context detection +local tex = {} +tex.in_mathzone = function() + return vim.fn["vimtex#syntax#in_mathzone"]() == 1 +end +tex.in_text = function() + return not tex.in_mathzone() +end + +-- Return snippet tables +return { + -- ANNOTATE (custom command for annotating equation derivations) + s( + { trig = "ann", snippetType = "autosnippet" }, + fmta( + [[ + \annotate{<>}{<>} + ]], + { + i(1), + d(2, get_visual), + } + ) + ), + -- REFERENCE + s( + { trig = " RR", snippetType = "autosnippet", wordTrig = false }, + fmta( + [[ + ~\ref{<>} + ]], + { + d(1, get_visual), + } + ) + ), + -- DOCUMENTCLASS + s( + { trig = "dcc", snippetType = "autosnippet" }, + fmta( + [=[ + \documentclass[<>]{<>} + ]=], + { + i(1, "a4paper"), + i(2, "article"), + } + ), + { condition = line_begin } + ), + -- USE A LATEX PACKAGE + s( + { trig = "pack", snippetType = "autosnippet" }, + fmta( + [[ + \usepackage{<>} + ]], + { + d(1, get_visual), + } + ), + { condition = line_begin } + ), + -- INPUT a LaTeX file + s( + { trig = "inn", snippetType = "autosnippet" }, + fmta( + [[ + \input{<><>} + ]], + { + i(1, "~/dotfiles/config/latex/templates/"), + i(2), + } + ), + { condition = line_begin } + ), + -- LABEL + s( + { trig = "lbl", snippetType = "autosnippet" }, + fmta( + [[ + \label{<>} + ]], + { + d(1, get_visual), + } + ) + ), + -- HPHANTOM + s( + { trig = "hpp", snippetType = "autosnippet" }, + fmta( + [[ + \hphantom{<>} + ]], + { + d(1, get_visual), + } + ) + ), + s( + { trig = "TODOO", snippetType = "autosnippet" }, + fmta([[\TODO{<>}]], { + d(1, get_visual), + }) + ), + s( + { trig = "nc" }, + fmta([[\newcommand{<>}{<>}]], { + i(1), + i(2), + }), + { condition = line_begin } + ), + s( + { trig = "sii", snippetType = "autosnippet" }, + fmta([[\si{<>}]], { + i(1), + }) + ), + s( + { trig = "qtt" }, + fmta([[\qty{<>}{<>}]], { + i(1), + i(2), + }) + ), + -- URL + s( + { trig = "url" }, + fmta([[\url{<>}]], { + d(1, get_visual), + }) + ), + -- href command with URL in visual selection + s( + { trig = "LU", snippetType = "autosnippet" }, + fmta([[\href{<>}{<>}]], { + d(1, get_visual), + i(2), + }) + ), + -- href command with text in visual selection + s( + { trig = "LL", snippetType = "autosnippet" }, + fmta([[\href{<>}{<>}]], { + i(1), + d(2, get_visual), + }) + ), + -- HSPACE + s( + { trig = "hss", snippetType = "autosnippet" }, + fmta([[\hspace{<>}]], { + d(1, get_visual), + }) + ), + -- VSPACE + s( + { trig = "vss", snippetType = "autosnippet" }, + fmta([[\vspace{<>}]], { + d(1, get_visual), + }) + ), + -- SECTION + s( + { trig = "h1", snippetType = "autosnippet" }, + fmta([[\section{<>}]], { + d(1, get_visual), + }) + ), + -- SUBSECTION + s( + { trig = "h2", snippetType = "autosnippet" }, + fmta([[\subsection{<>}]], { + d(1, get_visual), + }) + ), + -- SUBSUBSECTION + s( + { trig = "h3", snippetType = "autosnippet" }, + fmta([[\subsubsection{<>}]], { + d(1, get_visual), + }) + ), +} diff --git a/home-manager/modules/neovim/snippets/tex/tmp.lua b/home-manager/modules/neovim/snippets/tex/tmp.lua new file mode 100644 index 0000000..271524a --- /dev/null +++ b/home-manager/modules/neovim/snippets/tex/tmp.lua @@ -0,0 +1,84 @@ +local helpers = require("personal.luasnip-helper-funcs") +local get_visual = helpers.get_visual + +local line_begin = require("luasnip.extras.expand_conditions").line_begin + +-- Math context detection +local tex = {} +tex.in_mathzone = function() + return vim.fn["vimtex#syntax#in_mathzone"]() == 1 +end +tex.in_text = function() + return not tex.in_mathzone() +end + +return { + + -- Equation, choice for labels + s( + { + trig = "beq", + dscr = "Expands 'beq' into an equation environment, with a choice for labels", + snippetType = "autosnippet", + }, + fmta( + [[ + \begin{equation}<> + <> + \end{equation} + ]], + { + c(1, { + sn( + 2, -- Choose to specify an equation label + { + t("\\label{eq:"), + i(1), + t("}"), + } + ), + t([[]]), -- Choose no label + }, {}), + i(2), + } + ) + ), + + -- Figure environment + s( + { trig = "foofig", dscr = "Use 'fig' for figure environmennt, with options" }, + fmta( + [[ + \begin{figure}<> + \centering + \includegraphics<>{<>} + \caption{<>} + \label{fig:<>} + \end{figure} + ]], + { + -- Optional [htbp] field + c(1, { + t([[]]), -- Choice 1, empty + t("[htbp]"), -- Choice 2, this may be turned into a snippet + }, {}), + -- Options for includegraphics + c(2, { + t([[]]), -- Choice 1, empty + sn( + 3, -- Choice 2, this may be turned into a snippet + { + t("[width="), + i(1), + t("\\textwidth]"), + } + ), + }, {}), + i(3, "filename"), + i(4, "text"), + i(5, "label"), + } + ), + { condition = line_begin } + ), +} diff --git a/home-manager/modules/nixcord.nix b/home-manager/modules/nixcord.nix new file mode 100644 index 0000000..ce30e0c --- /dev/null +++ b/home-manager/modules/nixcord.nix @@ -0,0 +1,25 @@ +{ + # ... + programs.nixcord = { + enable = true; + # quickCss = "some CSS"; + config = { + # useQuickCss = true; + themeLinks = [ + ]; + frameless = true; # set some Vencord options + plugins = { + hideAttachments.enable = true; + ignoreActivities = { + enable = true; + ignorePlaying = true; + ignoreWatching = true; + # ignoredActivities = [ "someActivity" ]; + }; + }; + }; + extraConfig = { + }; + }; + # ... +} diff --git a/home-manager/modules/nushell.nix b/home-manager/modules/nushell.nix new file mode 100644 index 0000000..a2ed3b0 --- /dev/null +++ b/home-manager/modules/nushell.nix @@ -0,0 +1,114 @@ +{ pkgs, ... }: +{ + programs.nushell = { + enable = true; + envFile.text = '' + # Environment Variables + $env.XDG_CONFIG_HOME = ($env.HOME | path join ".config") + # Starship Prompt + mkdir ~/.cache/starship + starship init nu | save -f ~/.cache/starship/init.nu + # Zoxide + zoxide init nushell | save -f ~/.zoxide.nu + ''; + shellAliases = { + update = "sudo nixos-rebuild switch"; + clean = "nix-collect-garbage -d"; + repair = "nix-store --repair --verify --check-contents"; + + "." = "cd ../"; + ".." = "cd ../../"; + "..." = "cd ../../../"; + "...." = "cd ../../../../"; + + ps = "procs"; + grep = "rg"; + cat = "bat"; + vim = "nvim"; + + # Default flags + rm = "rm -i"; + chmod = "chmod -R"; + cp = "cp -r -i -v"; + mv = "mv -i -v"; + mkdir = "mkdir -p -v"; + df = "df -h"; + du = "du -h -s"; + dd = "dd status=progress bs=4M conv=fdatasync "; + wgetpaste = "wgetpaste -Xx"; + sudo = "sudo "; # Makes sudo work with es + ssh = "TERM=xterm ssh"; # Fixes some issues with ssh on some terminals + wget = "wget -c"; + ping = "ping -c 5"; + ftp = "ftp -p"; + + # Misc alieses I use often + + ports = "ss -tulanp"; + rmd = "rm -rf"; + mine = "sudo chown -R $(whoami):users"; + benchmark = "hyperfine --warmup 3 "; + c = "clear"; + listen = "lsof -P -i -n"; + octal = "stat -c '%a %n'"; + }; + configFile.text = '' + $env.config = { + show_banner: false + } + # Starhip Prompt + use ~/.cache/starship/init.nu + # Zoxide + source ~/.zoxide.nu + # nix shell + def nix-shell [] { + nix-shell --run $env.SHELL + } + def "version-completions" [] { + [ + {value: "4", description: "IPv4 address (default)"}, + {value: "6", description: "IPv6 address"} + ]} + # Define the function with completion annotation + def "whatismyip" [ + version?: int@version-completions # Parameter with custom completion + ] { + # Validate and set default version + let version = if ($version == null) { + 4 + } else if ($version in [4 6]) { + $version + } else { + error make { + msg: "Invalid IP version. Must be either 4 or 6." + } + } + # Get IP address + let ip = (http get $"https://api($version).ipify.org") + # Create record and display as table + { + $"ip($version)": $ip + } | table + } + ''; + }; + + home.packages = with pkgs; [ + fastfetch + ]; + + programs = { + carapace.enable = true; + carapace.enableNushellIntegration = true; + # starship = { + # enable = true; + # settings = { + # add_newline = true; + # character = { + # success_symbol = "[➜](bold green)"; + # error_symbol = "[➜](bold red)"; + # }; + # }; + # }; + }; +} diff --git a/home-manager/modules/nushell/config.nu b/home-manager/modules/nushell/config.nu new file mode 100644 index 0000000..e69de29 diff --git a/home-manager/modules/nushell/default.nix b/home-manager/modules/nushell/default.nix new file mode 100644 index 0000000..a5b2859 --- /dev/null +++ b/home-manager/modules/nushell/default.nix @@ -0,0 +1,96 @@ +{ ... }: +{ + programs = { + nushell = { + enable = true; + # The config.nu can be anywhere you want if you like to edit your Nushell with Nu + # configFile.source = ./.../config.nu; + # for editing directly to config.nu + envFile.source = ./env.nu; + extraConfig = '' + let carapace_completer = {|spans| + carapace $spans.0 nushell $spans | from json + } + $env.config = { + show_banner: false, + completions: { + case_sensitive: false # case-sensitive completions + quick: true # set to false to prevent auto-selecting completions + partial: true # set to false to prevent partial filling of the prompt + algorithm: "fuzzy" # prefix or fuzzy + external: { + # set to false to prevent nushell looking into $env.PATH to find more suggestions + enable: true + # set to lower can improve completion performance at the cost of omitting some options + max_results: 100 + completer: $carapace_completer # check 'carapace_completer' + } + } + } + $env.PATH = ($env.PATH | + split row (char esep) | + prepend /home/myuser/.apps | + append /usr/bin/env + ) + ''; + shellAliases = { + # cd = "z"; + + update = "sudo nixos-rebuild switch"; + clean = "nix-collect-garbage -d"; + repair = "nix-store --repair --verify --check-contents"; + + "." = "cd ../"; + ".." = "cd ../../"; + "..." = "cd ../../../"; + "...." = "cd ../../../../"; + + ps = "procs"; + grep = "rg"; + cat = "bat"; + vim = "nvim"; + + # Default flags + rm = "rm -i"; + chmod = "chmod -R"; + cp = "cp -i -v"; + mv = "mv -i -v"; + mkdir = "mkdir -v"; + df = "df -h"; + du = "du -h"; + dd = "dd status=progress bs=4M conv=fdatasync "; + wgetpaste = "wgetpaste -Xx"; + sudo = "sudo "; # Makes sudo work with es + # ssh = "TERM=xterm ssh"; # Fixes some issues with ssh on some terminals + wget = "wget -c"; + ping = "ping -c 5"; + ftp = "ftp -p"; + + # Misc alieses I use often + + ports = "ss -tulanp"; + rmd = "rm -rf"; + # mine = "sudo chown -R (whoami):users"; + benchmark = "hyperfine --warmup 3 "; + c = "clear"; + listen = "lsof -P -i -n"; + octal = "stat -c '%a %n'"; + l = "ls --all"; + lt = "eza --tree --level=2 --long --icons --git"; + }; + }; + carapace.enable = true; + carapace.enableNushellIntegration = true; + + starship = { + enable = true; + settings = { + add_newline = true; + # character = { + # success_symbol = "[➜](bold green)"; + # error_symbol = "[➜](bold red)"; + # }; + }; + }; + }; +} diff --git a/home-manager/modules/nushell/default.sync-conflict-20250129-104440-N2TYFZ4.nix b/home-manager/modules/nushell/default.sync-conflict-20250129-104440-N2TYFZ4.nix new file mode 100644 index 0000000..c112346 --- /dev/null +++ b/home-manager/modules/nushell/default.sync-conflict-20250129-104440-N2TYFZ4.nix @@ -0,0 +1,97 @@ +{ ... }: +{ + programs = { + nushell = { + enable = true; + # The config.nu can be anywhere you want if you like to edit your Nushell with Nu + # configFile.source = ./.../config.nu; + # for editing directly to config.nu + envFile.source = ./env.nu; + extraConfig = '' + let carapace_completer = {|spans| + carapace $spans.0 nushell $spans | from json + } + $env.config = { + show_banner: false, + completions: { + case_sensitive: false # case-sensitive completions + quick: true # set to false to prevent auto-selecting completions + partial: true # set to false to prevent partial filling of the prompt + algorithm: "fuzzy" # prefix or fuzzy + external: { + # set to false to prevent nushell looking into $env.PATH to find more suggestions + enable: true + # set to lower can improve completion performance at the cost of omitting some options + max_results: 100 + completer: $carapace_completer # check 'carapace_completer' + } + } + } + $env.PATH = ($env.PATH | + split row (char esep) | + prepend /home/myuser/.apps | + append /usr/bin/env + ) + fastfetch + ''; + shellAliases = { + cd = "z"; + + update = "sudo nixos-rebuild switch"; + clean = "nix-collect-garbage -d"; + repair = "nix-store --repair --verify --check-contents"; + + "." = "cd ../"; + ".." = "cd ../../"; + "..." = "cd ../../../"; + "...." = "cd ../../../../"; + + ps = "procs"; + grep = "rg"; + cat = "bat"; + vim = "nvim"; + + # Default flags + rm = "rm -i"; + chmod = "chmod -R"; + cp = "cp -i -v"; + mv = "mv -i -v"; + mkdir = "mkdir -v"; + df = "df -h"; + # du = "du -h"; + dd = "dd status=progress bs=4M conv=fdatasync "; + wgetpaste = "wgetpaste -Xx"; + sudo = "sudo "; # Makes sudo work with es + ssh = "TERM=xterm ssh"; # Fixes some issues with ssh on some terminals + wget = "wget -c"; + ping = "ping -c 5"; + ftp = "ftp -p"; + + # Misc alieses I use often + + ports = "ss -tulanp"; + rmd = "rm -rf"; + # mine = "sudo chown -R (whoami):users"; + benchmark = "hyperfine --warmup 3 "; + c = "clear"; + listen = "lsof -P -i -n"; + octal = "stat -c '%a %n'"; + l = "ls --all"; + lt = "eza --tree --level=2 --long --icons --git"; + }; + }; + carapace.enable = true; + carapace.enableNushellIntegration = true; + + starship = { + enable = true; + settings = { + add_newline = true; + # character = { + # success_symbol = "[➜](bold green)"; + # error_symbol = "[➜](bold red)"; + # }; + }; + }; + }; +} diff --git a/home-manager/modules/nushell/env.nu b/home-manager/modules/nushell/env.nu new file mode 100644 index 0000000..b497cea --- /dev/null +++ b/home-manager/modules/nushell/env.nu @@ -0,0 +1,3 @@ +$env.config.buffer_editor = "nvim" +$env.PASSWORD_STORE_DIR = "/home/gwg313/.local/share/password-store" +$env.SSH_AUTH_SOCK = (echo /run/user/(id -u)/gnupg/S.gpg-agent.ssh) diff --git a/home-manager/modules/nushell/gitaliases.nix b/home-manager/modules/nushell/gitaliases.nix new file mode 100644 index 0000000..5902ba8 --- /dev/null +++ b/home-manager/modules/nushell/gitaliases.nix @@ -0,0 +1,126 @@ +{ }: +{ + programs.nushell.aliases = { + + s = "git status -sb"; + g = "git"; + ga = "git add"; + gaa = "git add --all"; + gapa = "git add --patch"; + gau = "git add --update"; + gb = "git branch"; + gba = "git branch -a"; + gbd = "git branch -d"; + gbl = "git blame -b -w"; + gbnm = "git branch --no-merged"; + gbr = "git branch --remote"; + gbs = "git bisect"; + gbsb = "git bisect bad"; + gbsg = "git bisect good"; + gbsr = "git bisect reset"; + gbss = "git bisect start"; + gc = "git commit -v"; + "gc!" = "git commit -v --amend"; + gca = "git commit -v -a"; + "gca!" = "git commit -v -a --amend"; + gcam = "git commit -a -m"; + "gcan!" = "git commit -v -a --no-edit --amend"; + "gcans!" = "git commit -v -a -s --no-edit --amend"; + gcb = "git checkout -b"; + gcd = "git checkout develop"; + gcf = "git config --list"; + gcl = "git clone --recursive"; + gclean = "git clean -fd"; + gcm = "git checkout master"; + gcmsg = "git commit -m"; + "gcn!" = "git commit -v --no-edit --amend"; + gco = "git checkout"; + gcount = "git shortlog -sn"; + gcp = "git cherry-pick"; + gcpa = "git cherry-pick --abort"; + gcpc = "git cherry-pick --continue"; + gcs = "git commit -S"; + gcsm = "git commit -s -m"; + gd = "git diff"; + gdca = "git diff --cached"; + gdt = "git diff-tree --no-commit-id --name-only -r"; + gdw = "git diff --word-diff"; + gf = "git fetch"; + gfa = "git fetch --all --prune"; + gfo = "git fetch origin"; + gg = "git gui citool"; + gga = "git gui citool --amend"; + ggpull = "git pull origin (git_current_branch)"; + ggpush = "git push origin (git_current_branch)"; + ggsup = "git branch --set-upstream-to=origin/(git_current_branch)"; + ghh = "git help"; + gignore = "git update-index --assume-unchanged"; + gk = "gitk --all --branches"; + gke = "gitk --all (git log -g --pretty=%h)"; + gl = "git pull"; + glg = "git log --stat"; + glgg = "git log --graph"; + glgga = "git log --graph --decorate --all"; + glgm = "git log --graph --max-count=10"; + glgp = "git log --stat -p"; + glo = "git log --oneline --decorate"; + globurl = "noglob urlglobber"; + glog = "git log --oneline --decorate --graph"; + gloga = "git log --oneline --decorate --graph --all"; + glol = "git log --graph --pretty=%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\\ --abbrev-commit"; + glola = "git log --graph --pretty=%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset\\ --abbrev-commit --all"; + glp = "_git_log_prettily"; + glum = "git pull upstream master"; + gm = "git merge"; + gmom = "git merge origin/master"; + gmt = "git mergetool --no-prompt"; + gmtvim = "git mergetool --no-prompt --tool=vimdiff"; + gmum = "git merge upstream/master"; + gp = "git push"; + gpd = "git push --dry-run"; + gpoat = "git push origin --all && git push origin --tags"; + gpristine = "git reset --hard && git clean -dfx"; + gpsup = "git push --set-upstream origin (git_current_branch)"; + gpu = "git push upstream"; + gpv = "git push -v"; + gr = "git remote"; + gra = "git remote add"; + grb = "git rebase"; + grba = "git rebase --abort"; + grbc = "git rebase --continue"; + grbi = "git rebase -i"; + grbm = "git rebase master"; + grbs = "git rebase --skip"; + grep = "grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}"; + grh = "git reset HEAD"; + grhh = "git reset HEAD --hard"; + grmv = "git remote rename"; + grrm = "git remote remove"; + grset = "git remote set-url"; + grt = "cd (git rev-parse --show-toplevel || echo '.')"; + gru = "git reset --"; + grup = "git remote update"; + grv = "git remote -v"; + gsb = "git status -sb"; + gsd = "git svn dcommit"; + gsi = "git submodule init"; + gsps = "git show --pretty=short --show-signature"; + gsr = "git svn rebase"; + gss = "git status -s"; + gst = "git status"; + gsta = "git stash save"; + gstaa = "git stash apply"; + gstc = "git stash clear"; + gstd = "git stash drop"; + gstl = "git stash list"; + gstp = "git stash pop"; + gsts = "git stash show --text"; + gsu = "git submodule update"; + gts = "git tag -s"; + gtv = "git tag | sort"; + gunignore = "git update-index --no-assume-unchanged"; + gup = "git pull --rebase"; + gupv = "git pull --rebase -v"; + gwch = "git whatchanged -p --abbrev-commit --pretty=medium"; + }; +} diff --git a/home-manager/modules/nvf/default.nix b/home-manager/modules/nvf/default.nix new file mode 100644 index 0000000..dec6519 --- /dev/null +++ b/home-manager/modules/nvf/default.nix @@ -0,0 +1,26 @@ +{ + inputs, + pkgs, + ... +}: +{ + imports = [ + inputs.nvf.homeManagerModules.default + ./options.nix + ./languages.nix + ./picker.nix + ./snacks.nix + ./keymaps.nix + ./utils.nix + ./mini.nix + ]; + + programs.nvf = { + enable = true; + settings.vim = { + startPlugins = [ + pkgs.vimPlugins.vim-kitty-navigator + ]; + }; + }; +} diff --git a/home-manager/modules/nvf/keymaps.nix b/home-manager/modules/nvf/keymaps.nix new file mode 100644 index 0000000..1a6a18e --- /dev/null +++ b/home-manager/modules/nvf/keymaps.nix @@ -0,0 +1,275 @@ +{ + programs.nvf.settings.vim = { + globals.mapleader = " "; + binds = { + whichKey = { + enable = true; + # TODO: registers + register = { }; + }; + }; + keymaps = [ + # General Mappings + { + key = "s"; + mode = "n"; + silent = true; + action = "lua require('flash').jump()"; + desc = "Flash"; + } + { + key = "K"; + mode = "n"; + silent = true; + action = "lua vim.lsp.buf.hover()"; + desc = "LSP Hover"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "bnext"; + desc = "Next Buffer"; + } + + # Kitty navigator + { + key = ""; + mode = "n"; + silent = true; + action = "KittyNavigateLeft"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "KittyNavigateDown"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "KittyNavigateUp"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "KittyNavigateRight"; + } + + # Disable Arrow Keys in Normal Mode + # { + # key = ""; + # mode = "n"; + # silent = true; + # action = "k"; + # desc = "Disable Up Arrow"; + # } + # { + # key = ""; + # mode = "n"; + # silent = true; + # action = "j"; + # desc = "Disable Down Arrow"; + # } + # { + # key = ""; + # mode = "n"; + # silent = true; + # action = "h"; + # desc = "Disable Left Arrow"; + # } + # { + # key = ""; + # mode = "n"; + # silent = true; + # action = "l"; + # desc = "Disable Right Arrow"; + # } + + # UI + { + key = "uw"; + mode = "n"; + silent = true; + action = "set wrap!"; + desc = "Toggle word wrapping"; + } + { + key = "ul"; + mode = "n"; + silent = true; + action = "set linebreak!"; + desc = "Toggle linebreak"; + } + { + key = "us"; + mode = "n"; + silent = true; + action = "set spell!"; + desc = "Toggle spellLazyGitcheck"; + } + { + key = "uc"; + mode = "n"; + silent = true; + action = "set cursorline!"; + desc = "Toggle cursorline"; + } + { + key = "un"; + mode = "n"; + silent = true; + action = "set number!"; + desc = "Toggle line numbers"; + } + { + key = "ur"; + mode = "n"; + silent = true; + action = "set relativenumber!"; + desc = "Toggle relative line numbers"; + } + { + key = "ut"; + mode = "n"; + silent = true; + action = "set showtabline=2"; + desc = "Show tabline"; + } + { + key = "uT"; + mode = "n"; + silent = true; + action = "set showtabline=0"; + desc = "Hide tabline"; + } + + # Windows + { + key = "ws"; + mode = "n"; + silent = true; + action = "split"; + desc = "Split"; + } + { + key = "wv"; + mode = "n"; + silent = true; + action = "vsplit"; + desc = "VSplit"; + } + { + key = "wd"; + mode = "n"; + silent = true; + action = "close"; + desc = "Close"; + } + { + key = "ma"; + mode = "n"; + silent = true; + action = "close"; + desc = "Close"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "lua require('smart-splits').move_cursor_left()"; + desc = "Move to left split"; + } + + { + key = ""; + mode = "n"; + silent = true; + action = "lua require('smart-splits').move_cursor_down()"; + desc = "Move to lower split"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "lua require('smart-splits').move_cursor_up()"; + desc = "Move to upper split"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "lua require('smart-splits').move_cursor_right()"; + desc = "Move to right split"; + } + + { + key = ""; + mode = "n"; + silent = true; + action = "lua require('smart-splits').resize_left()"; + desc = "Resize left"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "lua require('smart-splits').resize_down()"; + desc = "Resize down"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "lua require('smart-splits').resize_up()"; + desc = "Resize up"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "lua require('smart-splits').resize_right()"; + desc = "Resize right"; + } + + { + key = "w="; + mode = "n"; + silent = true; + action = "="; + desc = "Equalize Splits"; + } + { + key = "we"; + mode = "n"; + silent = true; + action = "lua require('smart-splits').swap_buf_right()"; + desc = "Swap Buffer Right"; + } + { + key = "wh"; + mode = "n"; + silent = true; + action = "lua require('smart-splits').swap_buf_left()"; + desc = "Swap Buffer Left"; + } + + { + key = ""; + mode = "n"; + silent = true; + action = "zz"; + desc = "Jump back and center"; + } + { + key = ""; + mode = "n"; + silent = true; + action = "zz"; + desc = "Jump forward and center"; + } + ]; + }; +} diff --git a/home-manager/modules/nvf/languages.nix b/home-manager/modules/nvf/languages.nix new file mode 100644 index 0000000..c17999d --- /dev/null +++ b/home-manager/modules/nvf/languages.nix @@ -0,0 +1,49 @@ +{ + programs.nvf.settings.vim = { + diagnostics = { + enable = true; + nvim-lint.enable = true; + config.virtual_text = true; + }; + syntaxHighlighting = true; + treesitter = { + enable = true; + autotagHtml = true; + context.enable = true; + highlight = { + enable = true; + additionalVimRegexHighlighting = true; + }; + }; + lsp = { + enable = true; + trouble.enable = true; + formatOnSave = true; + inlayHints.enable = true; + lightbulb.enable = true; + null-ls.enable = true; + otter-nvim.enable = true; + }; + languages = { + enableDAP = true; + enableExtraDiagnostics = true; + enableFormat = true; + enableTreesitter = true; + + astro.enable = true; + python.enable = true; + java.enable = true; + clang.enable = true; + go.enable = true; + markdown.enable = true; + ts.enable = true; + ts.extensions.ts-error-translator.enable = true; + css.enable = true; + svelte.enable = true; + html.enable = true; + bash.enable = true; + nix.enable = true; + tailwind.enable = true; + }; + }; +} diff --git a/home-manager/modules/nvf/mini.nix b/home-manager/modules/nvf/mini.nix new file mode 100644 index 0000000..2c0568b --- /dev/null +++ b/home-manager/modules/nvf/mini.nix @@ -0,0 +1,13 @@ +{ + programs.nvf.settings.vim.mini = { + starter.enable = true; + comment.enable = true; + # cursorword.enable = true; + icons.enable = true; + indentscope.enable = true; + notify.enable = true; + pairs.enable = true; + diff.enable = true; + git.enable = true; + }; +} diff --git a/home-manager/modules/nvf/options.nix b/home-manager/modules/nvf/options.nix new file mode 100644 index 0000000..8776771 --- /dev/null +++ b/home-manager/modules/nvf/options.nix @@ -0,0 +1,23 @@ +{ + programs.nvf.settings.vim = { + viAlias = false; + vimAlias = true; + withNodeJs = true; + # syntaxHighlighting = true; + options = { + autoindent = true; + shiftwidth = 2; + signcolumn = "yes"; + tabstop = 2; + softtabstop = 2; + wrap = false; + undofile = true; + shada = "!,'100,<50,s10,h"; + }; + clipboard = { + enable = true; + registers = "unnamedplus"; + providers.wl-copy.enable = true; + }; + }; +} diff --git a/home-manager/modules/nvf/picker.nix b/home-manager/modules/nvf/picker.nix new file mode 100644 index 0000000..5b1a629 --- /dev/null +++ b/home-manager/modules/nvf/picker.nix @@ -0,0 +1,256 @@ +{ + programs.nvf.settings.vim = { + utility = { + oil-nvim.enable = true; + snacks-nvim = { + setupOpts = { + picker.enabled = true; + explorer.enabled = true; + }; + }; + }; + keymaps = [ + # Top Pickers & Explorer + { + key = " "; + mode = "n"; + silent = true; + action = "lua Snacks.picker.smart()"; + desc = "Smart Find Files"; + } + { + key = ","; + mode = "n"; + silent = true; + action = "lua Snacks.picker.buffers()"; + desc = "Buffers"; + } + { + key = "/"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.grep()"; + desc = "Grep"; + } + { + key = ":"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.command_history()"; + desc = "Command History"; + } + { + key = "e"; + mode = "n"; + silent = true; + action = "lua Snacks.explorer()"; + desc = "File Explorer"; + } + { + key = "-"; + mode = "n"; + silent = true; + action = "Oil"; + desc = "Oil"; + } + + # Find + { + key = "fb"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.buffers()"; + desc = "Buffers"; + } + { + key = "fc"; + mode = "n"; + silent = true; + action = ''lua Snacks.picker.files({ cwd = vim.fn.stdpath("config") })''; + desc = "Find Config File"; + } + { + key = "ff"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.files()"; + desc = "Find Files"; + } + { + key = "fg"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_files()"; + desc = "Find Git Files"; + } + { + key = "fp"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.projects()"; + desc = "Projects"; + } + { + key = "fr"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.recent()"; + desc = "Recent"; + } + { + key = "fn"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.notifications()"; + desc = "Notification History"; + } + { + key = "fe"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.icons()"; + desc = "Emoji"; + } + + # Git + { + key = "gb"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_branches()"; + desc = "Git Branches"; + } + { + key = "gL"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_log()"; + desc = "Git Log Line"; + } + { + key = "gs"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_status()"; + desc = "Git Status"; + } + { + key = "gS"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_stash()"; + desc = "Git Stash"; + } + { + key = "gd"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_diff()"; + desc = "Git Diff (Hunks)"; + } + { + key = "gf"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.git_log_file()"; + desc = "Git Log File"; + } + + # Grep + { + key = "sb"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lines()"; + desc = "Buffer Lines"; + } + { + key = "st"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.todo_comments()"; + desc = "Todos"; + } + { + key = "sB"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.grep_buffers()"; + desc = "Grep Open Buffers"; + } + { + key = "sg"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.grep()"; + desc = "Grep"; + } + { + key = "sw"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.grep_word()"; + desc = "Visual selection or word"; + } + { + key = "sr"; + mode = "n"; + silent = true; + action = "nohlsearch"; + desc = "Reset search"; + } + + # LSP + { + key = "gd"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_definitions()"; + desc = "Goto Definition"; + } + { + key = "gD"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_declarations()"; + desc = "Goto Declaration"; + } + { + key = "gr"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_references()"; + desc = "References"; + nowait = true; + } + { + key = "gI"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_implementations()"; + desc = "Goto Implementation"; + } + { + key = "gy"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_type_definitions()"; + desc = "Goto Type Definition"; + } + { + key = "ss"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_symbols()"; + desc = "LSP Symbols"; + } + { + key = "sS"; + mode = "n"; + silent = true; + action = "lua Snacks.picker.lsp_workspace_symbols()"; + desc = "LSP Workspace Symbols"; + } + ]; + }; +} diff --git a/home-manager/modules/nvf/snacks.nix b/home-manager/modules/nvf/snacks.nix new file mode 100644 index 0000000..f0faf03 --- /dev/null +++ b/home-manager/modules/nvf/snacks.nix @@ -0,0 +1,16 @@ +{ + programs.nvf.settings.vim.utility.snacks-nvim = { + enable = true; + setupOpts = { + image = { + enabled = true; + setupOpts.doc.inline = false; + }; + quickfile.enabled = true; + statuscolumn.enabled = true; + zen.enabled = true; + bufdelete.enabled = true; + gitsigns.enabled = true; + }; + }; +} diff --git a/home-manager/modules/nvf/utils.nix b/home-manager/modules/nvf/utils.nix new file mode 100644 index 0000000..1d56d97 --- /dev/null +++ b/home-manager/modules/nvf/utils.nix @@ -0,0 +1,82 @@ +{ lib, ... }: +{ + programs.nvf.settings.vim = { + theme = lib.mkForce { + enable = true; + name = "catppuccin"; + style = "latte"; + transparent = false; + }; + navigation = { + harpoon.enable = true; + }; + utility = { + motion.flash-nvim.enable = true; + outline.aerial-nvim.enable = true; + diffview-nvim.enable = true; + surround.enable = true; + smart-splits.enable = true; + yanky-nvim.enable = true; + }; + tabline.nvimBufferline.enable = true; + notes.todo-comments.enable = true; + assistant.copilot = { + enable = true; + cmp.enable = true; + }; + statusline.lualine.enable = true; + autocomplete.blink-cmp = { + enable = true; + friendly-snippets.enable = true; + }; + snippets.luasnip.enable = true; + ui = { + noice.enable = true; + colorizer.enable = true; + }; + visuals = { + cinnamon-nvim.enable = true; + }; + git = { + enable = true; + gitsigns.enable = true; + }; + terminal.toggleterm = { + enable = true; + lazygit = { + enable = true; + mappings.open = "gl"; + }; + }; + formatter.conform-nvim.enable = true; + binds.hardtime-nvim.enable = true; + utility.motion.precognition.enable = true; + binds.hardtime-nvim.setupOpts = { + max_count = 3; # Optional: limit of consecutive presses + disabled_keys = { + "" = false; + "" = false; + "" = false; + "" = false; + }; + restricted_keys = { + "" = [ + "n" + "x" + ]; + "" = [ + "n" + "x" + ]; + "" = [ + "n" + "x" + ]; + "" = [ + "n" + "x" + ]; + }; + }; + }; +} diff --git a/home-manager/modules/obs.nix b/home-manager/modules/obs.nix new file mode 100644 index 0000000..ebd4527 --- /dev/null +++ b/home-manager/modules/obs.nix @@ -0,0 +1,18 @@ +# A cat clone with syntax highlighting and Git integration. +{ pkgs, ... }: +{ + programs.obs-studio = { + enable = true; + + # additional packages to add to gjs's runtime + plugins = with pkgs.obs-studio-plugins; [ + wlrobs + obs-backgroundremoval + obs-pipewire-audio-capture + obs-vaapi # optional AMD hardware acceleration + obs-gstreamer + obs-vkcapture + ]; + }; + +} diff --git a/home-manager/modules/pass.nix b/home-manager/modules/pass.nix new file mode 100644 index 0000000..11eccfb --- /dev/null +++ b/home-manager/modules/pass.nix @@ -0,0 +1,12 @@ +# ✨ Magical shell history +{pkgs, ...}: { + programs.password-store = { + enable = true; + package = pkgs.pass.withExtensions (exts: [exts.pass-otp]); + }; + + home.packages = with pkgs; [ + tessen + zbar + ]; +} diff --git a/home-manager/modules/qutebrowser.nix b/home-manager/modules/qutebrowser.nix new file mode 100644 index 0000000..3f087f8 --- /dev/null +++ b/home-manager/modules/qutebrowser.nix @@ -0,0 +1,170 @@ +# A cat clone with syntax highlighting and Git integration. +{ ... }: +{ + programs.qutebrowser = { + enable = true; + + searchEngines = { + "DEFAULT" = "https://duckduckgo.com/?q={}&ia=web"; + "d" = "https://duckduckgo.com/?q={}&ia=web"; + "g" = "https://google.com/search?q={}"; + "y" = "https://youtube.com/results?search_query={}"; + "ya" = "https://yandex.com/search/?text={}"; + "n" = "https://mynixos.com/search?q={}"; + "nixo" = "https://search.nixos.org/options?channel=unstable&query={}"; + "nixp" = "https://search.nixos.org/packages?channel=unstable&query={}"; + "gt" = "https://github.com/search?q={}&type=repositories"; + }; + + quickmarks = { + home = "github.com/gwg313"; + mynixos = "https://mynixos.com"; + github = "https://github.com"; + outlook = "https://outlook.office.com/mail/"; + office = "https://www.office.com/?auth=2"; + proton = "https://mail.proton.me/u/0/inbox"; + cloudflare-one = "https://one.dash.cloudflare.com/"; + chatgpt = "https://chat.openai.com/"; + nixvim = "https://nix-community.github.io/nixvim/"; + hyprland = "https://wiki.hyprland.org/"; + nerdfont = "https://www.nerdfonts.com/cheat-sheet"; + youtube = "https://youtube.com/"; + cloudflare = "https://dash.cloudflare.com/"; + }; + + settings = { + url = { + default_page = "github.com/gwg313"; + start_pages = [ "github.com/gwg313" ]; + }; + + colors = { + webpage.preferred_color_scheme = "dark"; # Enable dark mode for websites that support it + }; + + statusbar.show = "in-mode"; + + completion = { + height = "30%"; + open_categories = [ "history" ]; + scrollbar = { + padding = 0; + width = 0; + }; + show = "always"; + shrink = true; + timestamp_format = ""; + web_history.max_items = 7; + }; + + content = { + autoplay = false; + javascript.clipboard = "access"; + javascript.enabled = true; + webgl = true; + pdfjs = true; + }; + + downloads = { + position = "bottom"; + remove_finished = 0; + }; + + hints = { + radius = 1; + }; + + scrolling = { + bar = "never"; + smooth = true; + }; + + tabs = { + show = "multiple"; + last_close = "close"; + mode_on_change = "restore"; + close_mouse_button = "right"; + }; + + zoom.default = "100%"; + + qt.force_software_rendering = "chromium"; + }; + + keyBindings = { + normal = { + " p" = "tab-move -"; + " n" = "tab-move +"; + " w" = "tab-close"; + + " 1" = "tab-focus 1"; + " 2" = "tab-focus 2"; + " 3" = "tab-focus 3"; + " 4" = "tab-focus 4"; + " 5" = "tab-focus 5"; + " 6" = "tab-focus 6"; + " 7" = "tab-focus 7"; + " 8" = "tab-focus 8"; + " 9" = "tab-focus 9"; + " 0" = "tab-focus 10"; + + "" = "tab-close"; + "" = "open -w"; + + "" = "tab-focus 1"; + "" = "tab-focus 2"; + "" = "tab-focus 3"; + "" = "tab-focus 4"; + "" = "tab-focus 5"; + "" = "tab-focus 6"; + "" = "tab-focus 7"; + "" = "tab-focus 8"; + "" = "tab-focus 9"; + "" = "tab-focus 10"; + }; + + command = { + "" = "tab-close"; + "" = "open -w"; + "" = "tab-focus 1"; + "" = "tab-focus 2"; + "" = "tab-focus 3"; + "" = "tab-focus 4"; + "" = "tab-focus 5"; + "" = "tab-focus 6"; + "" = "tab-focus 7"; + "" = "tab-focus 8"; + "" = "tab-focus 9"; + "" = "tab-focus 10"; + }; + + insert = { + "" = "tab-close"; + "" = "open -w"; + "" = "tab-focus 1"; + "" = "tab-focus 2"; + "" = "tab-focus 3"; + "" = "tab-focus 4"; + "" = "tab-focus 5"; + "" = "tab-focus 6"; + "" = "tab-focus 7"; + "" = "tab-focus 8"; + "" = "tab-focus 9"; + "" = "tab-focus 10"; + }; + }; + + extraConfig = '' + config.unbind("gm") + config.unbind("gd") + config.unbind("gb") + config.unbind("tl") + config.unbind("gt") + + c.tabs.padding = {"bottom": 6, "left": 7, "right": 7, "top": 6} + c.statusbar.padding = {"bottom": 6, "left": 7, "right": 7, "top": 6} + + config.load_autoconfig(True) + ''; + }; +} diff --git a/home-manager/modules/ssh.nix b/home-manager/modules/ssh.nix new file mode 100644 index 0000000..da190ff --- /dev/null +++ b/home-manager/modules/ssh.nix @@ -0,0 +1,56 @@ +{ ... }: +{ + programs.ssh = { + enable = true; + hashKnownHosts = true; + matchBlocks = { + "router" = { + hostname = "router.local.gwg313.xyz"; + user = "glen"; + identityFile = "/home/gwg313/.ssh/home/id_ed25519"; + }; + "github.com" = { + hostname = "github.com"; + identityFile = "/home/gwg313/.ssh/github/id_ed25519"; + }; + "candlekeep" = { + hostname = "candlekeep.local.gwg313.xyz"; + user = "gwg313"; + identityFile = "/home/gwg313/.ssh/home/id_ed25519"; + }; + "candlekeep.zt" = { + hostname = "candlekeep.zt"; # added to hosts in zerotier config + user = "gwg313"; + identityFile = "/home/gwg313/.ssh/home/id_ed25519"; + }; + "grymforge" = { + hostname = "grymforge.local.gwg313.xyz"; + user = "gwg313"; + identityFile = "/home/gwg313/.ssh/home/id_ed25519"; + }; + "grymforge.zt" = { + hostname = "grymforge.zt"; # added to hosts in zerotier config + user = "gwg313"; + identityFile = "/home/gwg313/.ssh/home/id_ed25519"; + }; + + "waypoint" = { + hostname = "waypoint.local.gwg313.xyz"; + user = "root"; + identityFile = "/home/gwg313/.ssh/colmena/id_ed25519"; + }; + + "seikan" = { + hostname = "147.182.147.32"; + user = "root"; + identityFile = "/home/gwg313/.ssh/digital_ocean/id_ed25519"; + }; + + "panopticon" = { + hostname = "10.1.10.9"; + user = "root"; + identityFile = "/home/gwg313/.ssh/colmena/id_ed25519"; + }; + }; + }; +} diff --git a/home-manager/modules/starship.nix b/home-manager/modules/starship.nix new file mode 100644 index 0000000..9ea90d9 --- /dev/null +++ b/home-manager/modules/starship.nix @@ -0,0 +1,52 @@ +# A customizable prompt for shells. +{ config, lib, ... }: +let + accent = "#${config.lib.stylix.colors.base0D}"; + background-alt = "#${config.lib.stylix.colors.base01}"; +in +{ + programs.starship = { + enable = true; + enableZshIntegration = true; + settings = { + add_newline = true; + format = lib.concatStrings [ + "$hostname" + "$directory" + "$git_branch" + "$git_state" + "$git_status" + "$character" + ]; + directory = { + style = accent; + }; + + character = { + success_symbol = "[❯](${accent})"; + error_symbol = "[❯](red)"; + vimcmd_symbol = "[❮](cyan)"; + }; + + git_branch = { + symbol = "[](${background-alt}) "; + style = "fg:${accent} bg:${background-alt}"; + format = "on [$symbol$branch]($style)[](${background-alt}) "; + }; + + git_status = { + format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218)($ahead_behind$stashed)]($style)"; + style = "cyan"; + conflicted = ""; + renamed = ""; + deleted = ""; + stashed = "≡"; + }; + + git_state = { + format = "([$state( $progress_current/$progress_total)]($style)) "; + style = "bright-black"; + }; + }; + }; +} diff --git a/home-manager/modules/thunar.nix b/home-manager/modules/thunar.nix new file mode 100644 index 0000000..3380a03 --- /dev/null +++ b/home-manager/modules/thunar.nix @@ -0,0 +1,103 @@ +# Thunar is a file explorer +{ pkgs, user, ... }: +{ + # ctrl + m to toggle the menubar + home.packages = with pkgs; [ + xfce.thunar + xfce.xfconf + xfce.tumbler + xfce.thunar-archive-plugin + xfce.thunar-volman + xfce.thunar-media-tags-plugin + p7zip + xarchiver + ]; + # gtk = { + # iconTheme = { + # name = "WhiteSur"; + # package = pkgs.whitesur-icon-theme.override { + # boldPanelIcons = true; + # alternativeIcons = true; + # }; + # }; + # }; + + home.sessionVariables = { + XDG_ICON_DIR = "${pkgs.whitesur-icon-theme}/share/icons/WhiteSur"; + }; + + # bookmarks for the side pane + gtk.gtk3.bookmarks = [ + "file:///home/gwg313/Documents Documents" + "file:///home/gwg313/Downloads Downloads" + "file:///home/gwg313/repos Repositories" + ]; + + home.file.".config/xarchiver/xarchiverrc".text = '' + [xarchiver] + preferred_format=0 + prefer_unzip=true + confirm_deletion=true + sort_filename_content=false + advanced_isearch=true + auto_expand=true + store_output=false + icon_size=2 + show_archive_comment=false + show_sidebar=true + show_location_bar=true + show_toolbar=true + preferred_custom_cmd= + preferred_temp_dir=/tmp + preferred_extract_dir=/home/gwg313/Downloads + allow_sub_dir=0 + ensure_directory=true + overwrite=false + full_path=2 + touch=false + fresh=false + update=false + store_path=false + updadd=true + freshen=false + recurse=true + solid_archive=false + remove_files=false + ''; + + home.file.".config/xfce4/xfconf/xfce-perchannel-xml/thunar.xml".text = '' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ''; +} diff --git a/home-manager/modules/tmux/gitmux.yml b/home-manager/modules/tmux/gitmux.yml new file mode 100644 index 0000000..ca58708 --- /dev/null +++ b/home-manager/modules/tmux/gitmux.yml @@ -0,0 +1,28 @@ +tmux: + symbols: + branch: " " + hashprefix: ":" + ahead: " " + behind: " " + staged: " " + conflict: "󰕚 " + untracked: "󱀶 " + modified: " " + stashed: " " + clean: " " + insertions: " " + deletions: " " + styles: + state: "#[fg=red,nobold]" + branch: "#[fg=white,nobold]" + staged: "#[fg=green,nobold]" + conflict: "#[fg=red,nobold]" + modified: "#[fg=yellow,nobold]" + untracked: "#[fg=gray,nobold]" + stashed: "#[fg=gray,nobold]" + clean: "#[fg=green,nobold]" + divergence: "#[fg=cyan,nobold]" + layout: [branch, divergence, flags, stats, " "] + options: + branch_max_len: 0 + hide_clean: true diff --git a/home-manager/modules/tmux/tmux.nix b/home-manager/modules/tmux/tmux.nix new file mode 100644 index 0000000..01bd3dd --- /dev/null +++ b/home-manager/modules/tmux/tmux.nix @@ -0,0 +1,198 @@ +{ + pkgs, + config, + ... +}: +{ + stylix.targets.tmux.enable = false; + programs.tmux = { + enable = true; + clock24 = true; + plugins = with pkgs.tmuxPlugins; [ + sensible + yank + resurrect + continuum + vim-tmux-navigator + tmux-thumbs + ]; + + extraConfig = '' + bind -n M-r source-file ~/.config/tmux/tmux.conf + + set -ag terminal-overrides ",xterm-256color:RGB" + + + + set -g detach-on-destroy off # don't exit from tmux when closing a session + + # New Theme + set -g status-interval 3 # update the status bar every 3 seconds + #set -g status-left "#[fg=blue,bold,bg=#${config.lib.stylix.colors.base00}] #S  " + set -ga status-left " #[fg=blue,nobold]#(gitmux -cfg $HOME/.config/tmux/gitmux.yml)" + set -g status-right "" + + set -g status-justify left + set -g status-left-length 200 # increase length (from 10) + set -g status-right-length 200 # increase length (from 10) + set -g status-position top # macOS / darwin style + set -g status-style 'bg=#${config.lib.stylix.colors.base00}' # transparent + set -g window-status-current-format '#[fg=magenta,bg=#${config.lib.stylix.colors.base00}]#I👉#W#{?window_zoomed_flag,(),} ' + set -g window-status-format '#[fg=gray,bg=#${config.lib.stylix.colors.base00}] #I #W' + set -g window-status-last-style 'fg=white,bg=black' + set -g message-command-style bg=default,fg=yellow + set -g message-style bg=default,fg=yellow + set -g mode-style bg=default,fg=yellow + set -g pane-active-border-style 'fg=magenta,bg=default' + set -g pane-border-style 'fg=brightblack,bg=default' + set -g @tmux-last-prompt-pattern ' ' + + + + set -g mouse on + + set-option -g status-position top + + bind-key x kill-pane + + #bind-key g display-popup -h 95% -w 95% -E 'lazygit' + bind -N "⌘+g lazygit " g new-window -c "#{pane_current_path}" -n "🌳" "lazygit 2> /dev/null" + bind -N "⌘+G gh-dash " G new-window -c "#{pane_current_path}" -n "😺" "gh-dash 2> /dev/null" + bind-key t display-popup -h 95% -w 95% -E "${pkgs.htop}/bin/htop" + bind-key e send-keys "tmux capture-pane -p -S - | nvim -c 'set buftype=nofile' +" Enter + + bind -n M-g display-popup -E "tmux new-session -A -s scratch" + + bind -n M-b switch-client -l + bind -n M-p previous-window # for ansi + bind -n M-n next-window # for ansi + bind -n M-P switch-client -p + bind -n M-N switch-client -n + + unbind f + bind f resize-pane -Z + + # create session + bind C-c new-session + + # split current window horizontally + bind - split-window -v + # split current window vertically + bind _ split-window -h + + # Select Layouts + #――――――――――――――――― + bind -n M-a select-layout main-vertical + bind -n M-A select-layout main-horizontal + bind -n M-E select-layout even-vertical + bind -n M-V select-layout even-horizontal + + # pane navigation + bind -r h select-pane -L # move left + bind -r j select-pane -D # move down + bind -r k select-pane -U # move up + bind -r l select-pane -R # move right + bind > swap-pane -D # swap current pane with the next one + bind < swap-pane -U # swap current pane with the previous one + + # pane resizing + bind -r H resize-pane -L 2 + bind -r J resize-pane -D 2 + bind -r K resize-pane -U 2 + bind -r L resize-pane -R 2 + bind -r c-f resize-pane -Z + + # window navigation + # unbind n + # unbind p + + setw -g mode-keys vi + + bind Enter copy-mode # enter copy mode + + bind -T copy-mode-vi v send -X begin-selection + bind -T copy-mode-vi C-v send -X rectangle-toggle + bind -T copy-mode-vi y send -X copy-selection-and-cancel + bind -T copy-mode-vi Escape send -X cancel + bind -T copy-mode-vi H send -X start-of-line + bind -T copy-mode-vi L send -X end-of-line + + # -- buffers ------------------------------------------------------------------- + + bind b list-buffers # list paste buffers + #bind p paste-buffer -p # paste from the top paste buffer + bind P choose-buffer # choose which buffer to paste from + + # -- display ------------------------------------------------------------------- + + set -g renumber-windows on # renumber windows when a window is closed + + bind-key "T" run-shell "sesh connect $( + sesh list -tz | fzf-tmux -p 55%,60% \ + --no-sort --border-label ' sesh ' --prompt '⚡ ' \ + --header ' ^a all ^t tmux ^x zoxide ^f find' \ + --bind 'tab:down,btab:up' \ + --bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list)' \ + --bind 'ctrl-t:change-prompt(🪟 )+reload(sesh list -t)' \ + --bind 'ctrl-x:change-prompt(📁 )+reload(sesh list -z)' \ + --bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' + --bind 'ctrl-d:execute(tmux kill-session -t {})+change-prompt(⚡ )+reload(sesh list)' + )" + + ''; + }; + + programs.tmate = { + enable = true; + }; + + home.packages = [ + pkgs.fzf + pkgs.gitmux + pkgs.sesh + ]; + + home.file.".config/tmux/gitmux.yml".source = ./gitmux.yml; + + programs.zsh = { + shellAliases = { + tx = "sesh connect /home/${config.home.username}"; + ta = "tmux attach -t"; + tad = "tmux attach -d -t"; + ts = "tmux new-session -s"; + tl = "tmux list-sessions"; + tksv = "tmux kill-server"; + tkss = "tmux kill-session -t"; + }; + + initExtra = '' + function sesh-sessions() { + { + exec {}"; + }; + + "clock" = { + format = " {:%a %b %d %R}"; + }; + + "cpu" = { + "interval" = 2; + "format" = "{usage}%  "; + }; + + "custom/cpu_freq" = { + format = "{}MHz "; + interval = 5; + exec = pkgs.writeShellScript "cpuFreq" '' + ${pkgs.busybox}/bin/cat /proc/cpuinfo | \ + ${pkgs.busybox}/bin/grep MHz | \ + ${pkgs.busybox}/bin/cut -c 12-15 | \ + ${pkgs.busybox}/bin/tr '\n' ' ' | \ + ${pkgs.busybox}/bin/awk '{s+=$1}END{print "",s/NR}' RS=" " | \ + ${pkgs.busybox}/bin/cut -c 2-5 + ''; + }; + + "battery" = { + "bat" = "BAT0"; + "states" = { + "good" = 95; + "warning" = 30; + "critical" = 15; + }; + "format" = "{capacity}% {icon} "; + "format-full" = ""; + "format-icons" = [ + "" + "" + "" + "" + "" + ]; + }; + + "memory"."format" = "{used:0.1f}G/{total:0.1f}G  "; + + "network" = { + "interface" = "${networkInterface.eth}"; + "interval" = 2; + "format-ethernet" = "Up: {bandwidthUpBits} Down: {bandwidthDownBits}  "; + "tooltip-format-ethernet" = "{ifname}  "; + "format-wifi" = "Up: {bandwidthUpBits} Down: {bandwidthDownBits} {essid} ({signalStrength}%)  "; + "tooltip-format-wifi" = "{ifname} {essid} ({signalStrength}%) "; + "format-disconnected" = "Disconnected ⚠"; + }; + + "pulseaudio" = { + "format" = "{volume}% {icon} "; + "format-bluetooth" = "{volume}% {icon} "; + "format-muted" = ""; + "format-icons" = { + "headphones" = ""; + "handsfree" = ""; + "headset" = ""; + "phone" = ""; + "portable" = ""; + "car" = ""; + "default" = [ + "" + "" + ]; + }; + "on-click" = "pavucontrol"; + }; + "temperature" = { + "hwmon-path" = "/sys/class/hwmon/hwmon2/temp1_input"; + "format" = "{}°C"; + "critical-threshold" = 80; + }; + "gamemode" = { + "format" = "{glyph}"; + "format-alt" = "{glyph} {count}"; + "glyph" = ""; + "hide-not-running" = true; + "use-icon" = true; + "icon-name" = "input-gaming-symbolic"; + "icon-spacing" = 4; + "icon-size" = 20; + "tooltip" = true; + "tooltip-format" = "Games running: {count}"; + }; + }; + }; +} diff --git a/home-manager/modules/yazi.nix b/home-manager/modules/yazi.nix new file mode 100644 index 0000000..206aa13 --- /dev/null +++ b/home-manager/modules/yazi.nix @@ -0,0 +1,62 @@ +{ pkgs, ... }: +let + plugins-repo = pkgs.fetchFromGitHub { + owner = "yazi-rs"; + repo = "plugins"; + rev = "273019910c1111a388dd20e057606016f4bd0d17"; + hash = "sha256-80mR86UWgD11XuzpVNn56fmGRkvj0af2cFaZkU8M31I="; + }; + +in +{ + programs.yazi = { + enable = true; + enableZshIntegration = true; + shellWrapperName = "y"; + + settings = { + manager = { + show_hidden = true; + }; + preview = { + max_width = 1000; + max_height = 1000; + }; + }; + + plugins = { + chmod = "${plugins-repo}/chmod.yazi"; + full-border = "${plugins-repo}/full-border.yazi"; + max-preview = "${plugins-repo}/max-preview.yazi"; + starship = pkgs.fetchFromGitHub { + owner = "Rolv-Apneseth"; + repo = "starship.yazi"; + rev = "6c639b474aabb17f5fecce18a4c97bf90b016512"; + sha256 = "sha256-bhLUziCDnF4QDCyysRn7Az35RAy8ibZIVUzoPgyEO1A="; + }; + }; + + initLua = '' + require("full-border"):setup() + require("starship"):setup() + ''; + + keymap = { + manager.prepend_keymap = [ + { + on = "T"; + run = "plugin sync max-preview"; + desc = "Maximize or restore the preview pane"; + } + { + on = [ + "c" + "m" + ]; + run = "plugin chmod"; + desc = "Chmod on selected files"; + } + ]; + }; + }; +} diff --git a/home-manager/modules/zathura.nix b/home-manager/modules/zathura.nix new file mode 100644 index 0000000..35f3842 --- /dev/null +++ b/home-manager/modules/zathura.nix @@ -0,0 +1,14 @@ +# A highly customizable document viewer. +{ + pkgs, + config, + ... +}: { + programs.zathura = { + enable = true; + extraConfig = '' + # Open document in fit-width mode by default + set adjust-open "best-fit" + ''; + }; +} diff --git a/home-manager/modules/zen.nix b/home-manager/modules/zen.nix new file mode 100644 index 0000000..02cc268 --- /dev/null +++ b/home-manager/modules/zen.nix @@ -0,0 +1,87 @@ +{ + pkgs, + config, + inputs, + ... +}: +let + accent = "#${config.lib.stylix.colors.base0D}"; + background = "#${config.lib.stylix.colors.base00}"; + foreground = "#${config.lib.stylix.colors.base05}"; + muted = "#${config.lib.stylix.colors.base03}"; + + settings = '' + { + "config": { + "title" : "Welcome Home", + "openLinksInNewTab": false, + "locale": "en-US", + "colors": { + "primary": "${accent}", + "background": "${background}", + "foreground": "${foreground}", + "muted": "#${muted}" + }, + "folders": [ + { + "name": "Bookmarks", + "links": [ + {"title": "MyNixOs", "url": "https://mynixos.com", "icon": "󱄅"}, + {"title": "Github", "url": "https://github.com", "icon": ""}, + {"title": "Proton", "url": "https://mail.proton.me/u/0/inbox", "icon": ""}, + {"title": "Chat GPT", "url": "https://chat.openai.com/", "icon": "󰭹"}, + {"title": "Nixvim", "url": "https://nix-community.github.io/nixvim/", "icon": ""}, + {"title": "Hyprland Wiki", "url": "https://wiki.hyprland.org/", "icon": "󰖬"}, + {"title": "Youtube", "url": "https://youtube.com", "icon": "󰗃"} + ] + }, + { + "name": "Uni", + "links": [ + {"title": "Outlook", "url": "https://outlook.office.com/mail/", "icon": "󰴢"}, + {"title": "Office", "url": "https://www.office.com/?auth=2", "icon": "󰏆"}, + {"title": "Teams", "url": "https://teams.microsoft.com/_", "icon": "󰊻"}, + {"title": "Brightspace", "url": "https://carleton.ca/brightspace/_", "icon": "󱨡"} + ] + } + ] + } + } + ''; + + homepage = pkgs.buildNpmPackage { + pname = "homepage"; + version = "0.0.0"; + + src = pkgs.fetchFromGitHub { + owner = "gwg313"; + repo = "homepage"; + rev = "b77d35ed3596eb451bd2ec78063d7cc6e73c773d"; + hash = "sha256-j/40922kfAh6zqJ4IRYpr66YXNNYsxuXwZ0aiJFJea0="; + }; + + # npmDepsHash = lib.fakeHash; + npmDepsHash = "sha256-bG+CHTq2Rst3JMxsjAC81KhK+G7WwsTVD1eyP87g0z4="; + + buildPhase = '' + npm install + cp ${pkgs.writeText "src/routes/config.json" settings} src/routes/config.json + npm run build + mkdir $out + mv build $out + ''; + + meta = { + description = "homepage"; + homepage = "https://github.com/gwg313/homepage"; + }; + }; +in +{ + home.file.".config/homepage" = { + source = "${homepage}/build"; + recursive = true; + }; + + home.packages = with pkgs; [ inputs.zen-browser.packages."${system}".default ]; +} diff --git a/home-manager/modules/zoxide.nix b/home-manager/modules/zoxide.nix new file mode 100644 index 0000000..5ed04b3 --- /dev/null +++ b/home-manager/modules/zoxide.nix @@ -0,0 +1,14 @@ +# ✨ Magical shell history +{ ... }: +{ + programs.zoxide = { + enable = true; + enableNushellIntegration = true; + }; + + programs.zsh = { + shellAliases = { + cd = "z"; + }; + }; +} diff --git a/home-manager/modules/zsh.nix b/home-manager/modules/zsh.nix new file mode 100644 index 0000000..4428950 --- /dev/null +++ b/home-manager/modules/zsh.nix @@ -0,0 +1,139 @@ +{ + config, + lib, + pkgs, + user, + ... +}: +{ + programs.zsh = { + enable = true; + enableCompletion = true; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + syntaxHighlighting.highlighters = [ + "main" + "brackets" + "pattern" + "regexp" + "root" + "line" + ]; + historySubstringSearch.enable = true; + shellAliases = { + update = "sudo nixos-rebuild switch"; + clean = "nix-collect-garbage -d"; + repair = "nix-store --repair --verify --check-contents"; + reload = "source ~/.zshrc"; + + "." = "cd ../"; + ".." = "cd ../../"; + "..." = "cd ../../../"; + "...." = "cd ../../../../"; + + ps = "procs"; + grep = "rg"; + cat = "bat --theme=base16 --color=always --paging=never --tabs=2 --wrap=never --plain"; + vim = "nvim"; + + # Default flags + rm = "rm -i"; + chmod = "chmod -R"; + cp = "cp -R -i -v"; + mv = "mv -i -v"; + mkdir = "mkdir -p -v"; + df = "df -h"; + du = "du -h -s"; + dd = "dd status=progress bs=4M conv=fdatasync "; + wgetpaste = "wgetpaste -Xx"; + sudo = "sudo "; # Makes sudo work with es + ssh = "TERM=xterm ssh"; # Fixes some issues with ssh on some terminals + wget = "wget -c"; + ping = "ping -c 5"; + ftp = "ftp -p"; + + # Misc alieses I use often + + ports = "ss -tulanp"; + rmd = "rm -rf"; + mine = "sudo chown -R $(whoami):users"; + benchmark = "hyperfine --warmup 3 "; + c = "clear"; + listen = "lsof -P -i -n"; + octal = "stat -c '%a %n'"; + f = "$(pay-respects zsh)"; + }; + + history = { + size = 10000; + path = "${config.xdg.dataHome}/zsh/history"; + }; + initExtra = '' + eval "$(pay-respects zsh --alias)" + + # search history based on what's typed in the prompt + autoload -U history-search-end + zle -N history-beginning-search-backward-end history-search-end + zle -N history-beginning-search-forward-end history-search-end + bindkey "^[OA" history-beginning-search-backward-end + bindkey "^[OB" history-beginning-search-forward-end + + + # General completion behavior + zstyle ':completion:*' completer _extensions _complete _approximate + # Use cache + zstyle ':completion:*' use-cache on + zstyle ':completion:*' cache-path "$XDG_CACHE_HOME/zsh/.zcompcache" + + + # Complete the alias + zstyle ':completion:*' complete true + # Autocomplete options + zstyle ':completion:*' complete-options true + + + # Completion matching control + zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*' + zstyle ':completion:*' keep-prefix true + + + # Group matches and describe + zstyle ':completion:*' menu select + zstyle ':completion:*' list-grouped false + zstyle ':completion:*' list-separator ''' + zstyle ':completion:*' group-name ''' + zstyle ':completion:*' verbose yes + zstyle ':completion:*:matches' group 'yes' + zstyle ':completion:*:warnings' format '%F{red}%B-- No match for: %d --%b%f' + zstyle ':completion:*:messages' format '%d' + zstyle ':completion:*:corrections' format '%B%d (errors: %e)%b' + zstyle ':completion:*:descriptions' format '[%d]' + + + # Colors + zstyle ':completion:*' list-colors ''${(s.:.)LS_COLORS} + + + # case insensitive tab completion + zstyle ':completion:*:*:cd:*' tag-order local-directories directory-stack path-directories + zstyle ':completion:*:*:cd:*:directory-stack' menu yes select + zstyle ':completion:*:-tilde-:*' group-order 'named-directories' 'path-directories' 'users' 'expand' + zstyle ':completion:*:*:-command-:*:*' group-order aliases builtins functions commands + zstyle ':completion:*' special-dirs true + zstyle ':completion:*' squeeze-slashes true + + + # Sort + zstyle ':completion:*' sort false + zstyle ":completion:*:git-checkout:*" sort false + zstyle ':completion:*' file-sort modification + zstyle ':completion:*:eza' sort false + zstyle ':completion:complete:*:options' sort false + zstyle ':completion:files' sort false + ''; + }; + + home.packages = with pkgs; [ + fastfetch + ]; +} diff --git a/home-manager/scripts/brightness/default.nix b/home-manager/scripts/brightness/default.nix new file mode 100644 index 0000000..05a09e5 --- /dev/null +++ b/home-manager/scripts/brightness/default.nix @@ -0,0 +1,41 @@ +# - ## Brightness +#- +#- This module provides a set of scripts to control the brightness of the screen. +#- +#- - `brightness-up` increases the brightness by 5%. +#- - `brightness-down` decreases the brightness by 5%. +#- - `brightness-set [value]` sets the brightness to the given value. +#- - `brightness-change [up|down] [value]` increases or decreases the brightness by the given value. + +{ pkgs, ... }: + +let + increments = "5"; + + brightness-change = pkgs.writeShellScriptBin "brightness-change" '' + [[ $1 == "up" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ''${2-${increments}}%+ + [[ $1 == "down" ]] && ${pkgs.brightnessctl}/bin/brightnessctl set ''${2-${increments}}%- + ''; + + brightness-set = pkgs.writeShellScriptBin "brightness-set" '' + ${pkgs.brightnessctl}/bin/brightnessctl set ''${1-100}% + ''; + + brightness-up = pkgs.writeShellScriptBin "brightness-up" '' + brightness-change up ${increments} + ''; + + brightness-down = pkgs.writeShellScriptBin "brightness-down" '' + brightness-change down ${increments} + ''; + +in +{ + home.packages = [ + pkgs.brightnessctl + brightness-change + brightness-up + brightness-down + brightness-set + ]; +} diff --git a/home-manager/scripts/caffeine/default.nix b/home-manager/scripts/caffeine/default.nix new file mode 100644 index 0000000..cd21efb --- /dev/null +++ b/home-manager/scripts/caffeine/default.nix @@ -0,0 +1,40 @@ +# - ## Caffeine +#- +#- Caffeine is a simple script that toggles hypridle (disable suspend & screenlock). +#- +#- - `caffeine-status` - Check if hypridle is running. (0/1) +#- - `caffeine-status-icon` - Check if hypridle is running. (icon) +#- - `caffeine` - Toggle hypridle. + +{ pkgs, ... }: +let + caffeine-status = pkgs.writeShellScriptBin "caffeine-status" '' + [[ $(pidof "hypridle") ]] && echo "0" || echo "1" + ''; + + caffeine-status-icon = pkgs.writeShellScriptBin "caffeine-status-icon" '' + [[ $(pidof "hypridle") ]] && echo "󰾪" || echo "󰅶" + ''; + + caffeine = pkgs.writeShellScriptBin "caffeine" '' + if [[ $(pidof "hypridle") ]]; then + systemctl --user stop hypridle.service + title="󰅶 Caffeine Activated" + description="Caffeine is now active! Your screen will not turn off automatically." + else + systemctl --user start hypridle.service + title="󰾪 Caffeine Deactivated" + description="Caffeine is now deactivated! Your screen will turn off automatically." + fi + + notif "caffeine" "$title" "$description" + ''; + +in +{ + home.packages = [ + caffeine-status + caffeine + caffeine-status-icon + ]; +} diff --git a/home-manager/scripts/default.nix b/home-manager/scripts/default.nix new file mode 100644 index 0000000..e1a754c --- /dev/null +++ b/home-manager/scripts/default.nix @@ -0,0 +1,12 @@ +{ + imports = [ + ./night-shift + ./brightness + ./hyprfocus + ./hyprpanel + ./caffeine + ./notification + ./screenshot + ./sound + ]; +} diff --git a/home-manager/scripts/hyprfocus/default.nix b/home-manager/scripts/hyprfocus/default.nix new file mode 100644 index 0000000..91578e6 --- /dev/null +++ b/home-manager/scripts/hyprfocus/default.nix @@ -0,0 +1,52 @@ +# - ## Hyprfocus +#- +#- A simple script to toggle focus on few windows in Hyprland. +#- (disable gaps, border, shadow, opacity, etc.) +#- +#- - `hyprfocus-on` - Enable hyprfocus. +#- - `hyprfocus-off` - Disable hyprfocus. +#- - `hyprfocus-toggle` - Toggle hyprfocus. +{ pkgs, ... }: +let + hyprfocus-on = + pkgs.writeShellScriptBin "hyprfocus-on" + # bash + '' + hyprpanel-hide + hyprctl keyword "general:gaps_in" 0 + hyprctl keyword "general:gaps_out" 0 + hyprctl keyword "general:border_size" 1 + hyprctl keyword "decoration:rounding" 0 + hyprctl keyword "decoration:drop_shadow" false + hyprctl keyword "decoration:inactive_opacity" 0.98 + hyprctl keyword "decoration:active_opacity" 1 + echo "1" > /tmp/hyprfocus + ''; + + hyprfocus-off = + pkgs.writeShellScriptBin "hyprfocus-off" + # bash + '' + hyprctl reload + hyprpanel-show + rm /tmp/hyprfocus + ''; + + hyprfocus-toggle = + pkgs.writeShellScriptBin "hyprfocus-toggle" + # bash + '' + if [ -f /tmp/hyprfocus ]; then + hyprfocus-off + else + hyprfocus-on + fi + ''; +in +{ + home.packages = [ + hyprfocus-on + hyprfocus-off + hyprfocus-toggle + ]; +} diff --git a/home-manager/scripts/hyprpanel/default.nix b/home-manager/scripts/hyprpanel/default.nix new file mode 100644 index 0000000..9f1fc29 --- /dev/null +++ b/home-manager/scripts/hyprpanel/default.nix @@ -0,0 +1,52 @@ +# - ## Hyprpanel +#- +#- Quick scripts to toggle, reload, hide & show hyprpanel. +#- +#- - `hyprpanel-toggle` - Toggle hyprpanel (hide/show). +#- - `hyprpanel-show` - Show hyprpanel. +#- - `hyprpanel-hide` - Hide hyprpanel. +#- - `hyprpanel-reload` - Reload hyprpanel. +{ pkgs, ... }: +let + hyprpanel-toggle = pkgs.writeShellScriptBin "hyprpanel-toggle" '' + hyprpanel -t bar-0 + hyprpanel -t bar-1 + hyprpanel -t bar-2 + hyprpanel -t bar-3 + ''; + + hyprpanel-hide = pkgs.writeShellScriptBin "hyprpanel-hide" '' + status=$(hyprpanel -r "isWindowVisible('bar-0')") + if [[ $status == "true" ]]; then + hyprpanel -t bar-0 + fi + status=$(hyprpanel -r "isWindowVisible('bar-1')") + if [[ $status == "true" ]]; then + hyprpanel -t bar-1 + fi + ''; + + hyprpanel-show = pkgs.writeShellScriptBin "hyprpanel-show" '' + status=$(hyprpanel -r "isWindowVisible('bar-0')") + if [[ $status == "false" ]]; then + hyprpanel -t bar-0 + fi + status=$(hyprpanel -r "isWindowVisible('bar-1')") + if [[ $status == "false" ]]; then + hyprpanel -t bar-1 + fi + ''; + + hyprpanel-reload = pkgs.writeShellScriptBin "hyprpanel-reload" '' + [ $(pgrep "ags") ] && pkill ags + hyprctl dispatch exec hyprpanel + ''; +in +{ + home.packages = [ + hyprpanel-toggle + hyprpanel-reload + hyprpanel-hide + hyprpanel-show + ]; +} diff --git a/home-manager/scripts/night-shift/default.nix b/home-manager/scripts/night-shift/default.nix new file mode 100644 index 0000000..2e010cc --- /dev/null +++ b/home-manager/scripts/night-shift/default.nix @@ -0,0 +1,79 @@ +# - ## Night-Shift +#- +#- Night-Shift is a feature that reduces the amount of blue light emitted by your screen, which can help reduce eye strain and improve sleep quality. This module provides a set of scripts to control Night-Shift on your system. +#- It use hyprsunset to control the screen temperature. +#- +#- - `night-shift-on` activates Night-Shift. +#- - `night-shift-off` deactivates Night-Shift. +#- - `night-shift` toggles Night-Shift. +#- - `night-shift-status` checks if Night-Shift is active. (0/1) +#- - `night-shift-status-icon` checks if Night-Shift is active. (icon) +{ pkgs, ... }: +let + value = "4500"; # Default value for night-shift temperature + + night-shift-on = + pkgs.writeShellScriptBin "night-shift-on" + # bash + '' + ${pkgs.hyprsunset}/bin/hyprsunset -t ${value} & + title="󰖔 Night-Shift Activated" + description="Night-Shift is now activated! Your screen will be warmer and easier on the eyes." + + notif "night-shift" "$title" "$description" + ''; + + night-shift-off = + pkgs.writeShellScriptBin "night-shift-off" + # bash + '' + pkill hyprsunset + title="󰖕 Night-Shift Deactivated" + description="Night-Shift is now deactivated! Your screen will return to normal." + + notif "night-shift" "$title" "$description" + ''; + + night-shift = + pkgs.writeShellScriptBin "night-shift" + # bash + '' + if pidof "hyprsunset"; then + night-shift-off + else + night-shift-on + fi + ''; + + night-shift-status = + pkgs.writeShellScriptBin "night-shift-status" + # bash + '' + if pidof "hyprsunset"; then + echo "1" + else + echo "0" + fi + ''; + + night-shift-status-icon = + pkgs.writeShellScriptBin "night-shift-status-icon" + # bash + '' + if pidof "hyprsunset"; then + echo "󰖔" + else + echo "󰖕" + fi + ''; +in +{ + home.packages = [ + pkgs.hyprsunset + night-shift-on + night-shift-off + night-shift + night-shift-status + night-shift-status-icon + ]; +} diff --git a/home-manager/scripts/notification/default.nix b/home-manager/scripts/notification/default.nix new file mode 100644 index 0000000..084ac55 --- /dev/null +++ b/home-manager/scripts/notification/default.nix @@ -0,0 +1,33 @@ +{ pkgs, ... }: +let + notif = + pkgs.writeShellScriptBin "notif" # bash + '' + # Shell script to send custom notifications + # Usage: notif "sender_id" "message" ["description"] + NOTIF_FOLDER="/tmp/notif" + sender_id=$1 # To overwrite existing notifications + title=$2 + description=$3 + + [[ -d "$NOTIF_FOLDER" ]] || mkdir $NOTIF_FOLDER + [[ -f "$NOTIF_FOLDER/$sender_id" ]] || (echo "0" > "$NOTIF_FOLDER/$sender_id") + + old_notification_id=$(cat "$NOTIF_FOLDER/$sender_id") + [[ -z "$old_notification_id" ]] && old_notification_id=0 + + ${pkgs.libnotify}/bin/notify-send \ + --replace-id="$old_notification_id" --print-id \ + --app-name="$sender_id" \ + "$title" \ + "$description" \ + > "$NOTIF_FOLDER/$sender_id" + ''; + +in +{ + home.packages = [ + pkgs.libnotify + notif + ]; +} diff --git a/home-manager/scripts/screenshot/default.nix b/home-manager/scripts/screenshot/default.nix new file mode 100644 index 0000000..04be4cd --- /dev/null +++ b/home-manager/scripts/screenshot/default.nix @@ -0,0 +1,40 @@ +# - ## Screenshot +#- +#- This module provides a script to take screenshots using `grimblast` and `swappy`. +#- +#- - `screenshot [region|window|monitor] [swappy]` - Take a screenshot of the region, window, or monitor. Optionally, use `swappy` to copy the screenshot to the clipboard. +{ pkgs, ... }: +let + screenshot = pkgs.writeShellScriptBin "screenshot" '' + if [[ $2 == "swappy" ]];then + folder="/tmp" + else + folder="$HOME/Pictures" + fi + filename="$(date +%Y-%m-%d_%H:%M:%S).png" + + if [[ $1 == "window" ]];then + mode="active" + elif [[ $1 == "region" ]];then + mode="area" + elif [[ $1 == "monitor" ]];then + mode="output" + fi + + ${pkgs.grimblast}/bin/grimblast --notify --freeze save $mode "$folder/$filename" || exit 1 + + if [[ $2 == "swappy" ]];then + ${pkgs.swappy}/bin/swappy -f "$folder/$filename" -o "$HOME/Pictures/$filename" + exit 0 + fi + ''; +in +{ + home.packages = [ + pkgs.hyprshot + screenshot + pkgs.slurp + pkgs.grim + pkgs.grimblast + ]; +} diff --git a/home-manager/scripts/sound/default.nix b/home-manager/scripts/sound/default.nix new file mode 100644 index 0000000..2058e56 --- /dev/null +++ b/home-manager/scripts/sound/default.nix @@ -0,0 +1,45 @@ +# - ## Sound +#- +#- This module provides a set of scripts to control the volume of the default audio sink using `wpctl`. +#- +#- - `sound-up` increases the volume by 5%. +#- - `sound-down` decreases the volume by 5%. +#- - `sound-set [value]` sets the volume to the given value. +#- - `sound-toggle` toggles the mute state of the default audio sink. +{ pkgs, ... }: + +let + increments = "5"; + + sound-change = pkgs.writeShellScriptBin "sound-change" '' + [[ $1 == "mute" ]] && wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle + [[ $1 == "up" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-${increments}}%+ + [[ $1 == "down" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-${increments}}%- + [[ $1 == "set" ]] && wpctl set-volume @DEFAULT_AUDIO_SINK@ ''${2-100}% + ''; + + sound-up = pkgs.writeShellScriptBin "sound-up" '' + sound-change up ${increments} + ''; + + sound-set = pkgs.writeShellScriptBin "sound-set" '' + sound-change set ''${1-100} + ''; + + sound-down = pkgs.writeShellScriptBin "sound-down" '' + sound-change down ${increments} + ''; + + sound-toggle = pkgs.writeShellScriptBin "sound-toggle" '' + sound-change mute + ''; +in +{ + home.packages = [ + sound-change + sound-up + sound-down + sound-toggle + sound-set + ]; +} diff --git a/hosts/candlekeep/auditd.nix b/hosts/candlekeep/auditd.nix new file mode 100644 index 0000000..cf1b81e --- /dev/null +++ b/hosts/candlekeep/auditd.nix @@ -0,0 +1,7 @@ +{...}: { + security.auditd.enable = true; + security.audit.enable = true; + security.audit.rules = [ + "-a exit,always -F arch=b64 -S execve" + ]; +} diff --git a/hosts/candlekeep/configuration.nix b/hosts/candlekeep/configuration.nix new file mode 100644 index 0000000..425c19e --- /dev/null +++ b/hosts/candlekeep/configuration.nix @@ -0,0 +1,147 @@ +# This is your system's configuration file. +# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) +{ + inputs, + outputs, + lib, + config, + user, + pkgs, + ... +}: +{ + # You can import other NixOS modules here + imports = [ + # If you want to use modules your own flake exports (from modules/nixos): + # outputs.nixosModules.example + ../../common/nixos/common.nix + ../../common/gui/hyprland.nix + ../../common/style/stylix.nix + # ../../common/style/vars/candlekeep.nix + ../../common/nixos/sysctl + ../../common/nixos/tuigreet.nix + + ../../common/networking + ../../common/nixos + ../../common/gui + ../../common/virtualization + + # ./auditd.nix + ./kernel.nix + ./sysctl.nix + ./earlyoom.nix + ./syncthing.nix + + # Or modules from other flakes (such as nixos-hardware): + # inputs.hardware.nixosModules.common-cpu-amd + # inputs.hardware.nixosModules.common-ssd + inputs.nix-index-database.nixosModules.nix-index + inputs.stylix.nixosModules.stylix + inputs.sops-nix.nixosModules.sops + # You can also split up your configuration and import pieces of it here: + # ./users.nix + + # Import your generated (nixos-generate-config) hardware configuration + ./hardware-configuration.nix + ]; + + laptop.enable = true; + # nfs.enable = true; + ssh.enable = true; + ssh_guard.enable = true; + steam.enable = true; + + programs.nix-ld.dev.enable = true; + + # Bootloader. + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + initrd.luks.devices."luks-1dbfdeb6-8537-41b2-abf0-09373af3eeee".device = + "/dev/disk/by-uuid/1dbfdeb6-8537-41b2-abf0-09373af3eeee"; + }; + + # sops + sops = { + defaultSopsFile = ../../secrets/secrets.yaml; + defaultSopsFormat = "yaml"; + age.keyFile = "/home/${user}/.config/sops/age/keys.txt"; + }; + + nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + }; + }; + + # This will add each flake input as a registry + # To make nix3 commands consistent with your flake + nix.registry = (lib.mapAttrs (_: flake: { inherit flake; })) ( + (lib.filterAttrs (_: lib.isType "flake")) inputs + ); + + # This will additionally add your inputs to the system's legacy channels + # Making legacy nix commands consistent as well, awesome! + nix.nixPath = [ "/etc/nix/path" ]; + environment.etc = lib.mapAttrs' (name: value: { + name = "nix/path/${name}"; + value.source = value.flake; + }) config.nix.registry; + + networking.hostName = "candlekeep"; + # networking.networkmanager.enable = true; + + users.users = { + gwg313 = { + initialPassword = "correcthorsebatterystaple"; + isNormalUser = true; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILq54YrM3BbhBs0oDLOrc1bkg6FCCmkV4E3pWLZp0ejN gwg313@pm.me" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPZK7127ict2+Urhi1cbD6EIU85mD4lkQ9/ihaif0jsX" # Phone + ]; + extraGroups = [ "wheel" ]; + }; + }; + + environment = { + loginShellInit = '' + # if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then + # exec Hyprland + # fi + + if (empty $env.DISPLAY) && ($tty == '/dev/tty1') { + exec Hyprland + } + ''; # Will automatically open Hyprland when logged into tty1 + variables = { + TERMINAL = "alacritty"; + EDITOR = "nvim"; + VISUAL = "nvim"; + PAGER = "moar"; + PASSWORD_STORE_DIR = "$HOME/.local/share/password-store"; + }; + }; + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "23.05"; +} diff --git a/hosts/candlekeep/earlyoom.nix b/hosts/candlekeep/earlyoom.nix new file mode 100644 index 0000000..46de16f --- /dev/null +++ b/hosts/candlekeep/earlyoom.nix @@ -0,0 +1,13 @@ +{ + services.earlyoom = { + enable = true; + freeSwapThreshold = 2; + freeMemThreshold = 2; + enableNotifications = true; + # extraArgs = [ + # "-g" + # "--avoid '^(.Hyrpland-wrapp|alacritty|zerotier-one|.waybar-wrapped)$'" + # "--prefer '^(electron|libreoffice|gimp|Isolated Web Co)$'" + # ]; + }; +} diff --git a/hosts/candlekeep/hardware-configuration.nix b/hosts/candlekeep/hardware-configuration.nix new file mode 100644 index 0000000..ab60837 --- /dev/null +++ b/hosts/candlekeep/hardware-configuration.nix @@ -0,0 +1,59 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ../../common/nixos/nfs.nix + ]; + + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "usb_storage" + "sd_mod" + "rtsx_pci_sdmmc" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/c79b630a-d130-42ed-8cdc-3f8545fe2993"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-96e3b309-ca79-4b42-aca5-3f098b123758".device = + "/dev/disk/by-uuid/96e3b309-ca79-4b42-aca5-3f098b123758"; + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/1FBA-8B80"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + + }; + swapDevices = [ + { device = "/dev/disk/by-uuid/17eec89e-2381-4a25-8935-63cbcc67d07c"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp2s0f0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp5s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/candlekeep/kernel.nix b/hosts/candlekeep/kernel.nix new file mode 100644 index 0000000..61403aa --- /dev/null +++ b/hosts/candlekeep/kernel.nix @@ -0,0 +1,27 @@ +{ + config, + pkgs, + stdenv, + ... +}: +{ + boot.kernelPackages = pkgs.linuxPackages_hardened; + boot.kernelParams = [ + # Disable slab merging to prevent heap exploitation + "slab_nomerge" + # Enable zeroing memory during allocation and free time + "init_on_alloc=1" + "init_on_free=1" + # Randomize page allocator freelists + "page_alloc.shuffle=1" + # Mitigations + "pti=on" + + "vsyscall=none" + "debugfs=off" + "oops=panic" + + # Enable lockdown LSM + "lockdown=confidentiality" + ]; +} diff --git a/hosts/candlekeep/syncthing.nix b/hosts/candlekeep/syncthing.nix new file mode 100644 index 0000000..327b514 --- /dev/null +++ b/hosts/candlekeep/syncthing.nix @@ -0,0 +1,68 @@ +{ + config, + user, + inputs, + ... +}: +{ + services.syncthing = { + enable = true; + dataDir = "/home/gwg313"; + openDefaultPorts = true; + configDir = "/home/gwg313/.config/syncthing"; + user = "gwg313"; + group = "users"; + guiAddress = "127.0.0.1:8384"; + + overrideDevices = true; + overrideFolders = true; + settings = { + gui = { + user = inputs.secrets.syncthing.gui_user; + password = inputs.secrets.syncthing.gui_password; + }; + devices = { + "grymforge" = { + id = inputs.secrets.syncthing.grymforge_id; + }; + }; + + folders = { + "repos" = { + path = "/home/gwg313/repos"; + devices = [ "grymforge" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + "documents" = { + path = "/home/gwg313/Documents"; + devices = [ "grymforge" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + + "password-store" = { + path = "/home/gwg313/.local/share/password-store"; + devices = [ "grymforge" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/candlekeep/sysctl.nix b/hosts/candlekeep/sysctl.nix new file mode 100644 index 0000000..c34f88a --- /dev/null +++ b/hosts/candlekeep/sysctl.nix @@ -0,0 +1,7 @@ +{lib, ...}: { + boot.kernel.sysctl = { + # disable unprivileged user namespaces to decrease attack surface + # Enabled because breaks discord/element etc + "kernel.unprivileged_userns_clone" = lib.mkForce 1; + }; +} diff --git a/hosts/grymforge/auditd.nix b/hosts/grymforge/auditd.nix new file mode 100644 index 0000000..cf1b81e --- /dev/null +++ b/hosts/grymforge/auditd.nix @@ -0,0 +1,7 @@ +{...}: { + security.auditd.enable = true; + security.audit.enable = true; + security.audit.rules = [ + "-a exit,always -F arch=b64 -S execve" + ]; +} diff --git a/hosts/grymforge/configuration.nix b/hosts/grymforge/configuration.nix new file mode 100644 index 0000000..23cd22e --- /dev/null +++ b/hosts/grymforge/configuration.nix @@ -0,0 +1,145 @@ +# This is your system's configuration file. +# Use this to configure your system environment (it replaces /etc/nixos/configuration.nix) +{ + inputs, + outputs, + lib, + config, + pkgs, + user, + ... +}: +{ + # You can import other NixOS modules here + imports = [ + # If you want to use modules your own flake exports (from modules/nixos): + # outputs.nixosModules.example + ../../common/nixos/common.nix + ../../common/nixos/restic.nix + ../../common/gui/hyprland.nix + ../../common/gui/steam.nix + ../../common/gui/thunar.nix + ../../common/gui/retroarch.nix + ../../common/style/stylix.nix + ../../common/nixos/sysctl + + ../../common/networking + ../../common/virtualization + ../../common/nixos + ../../common/gui + + ./syncthing.nix + # ./auditd.nix + ./kernel.nix + ./sysctl.nix + ./earlyoom.nix + + ./sleep.nix + + # Or modules from other flakes (such as nixos-hardware): + # inputs.hardware.nixosModules.common-cpu-amd + # inputs.hardware.nixosModules.common-ssd + inputs.nix-index-database.nixosModules.nix-index + inputs.stylix.nixosModules.stylix + inputs.sops-nix.nixosModules.sops + # You can also split up your configuration and import pieces of it here: + # ./users.nix + + # Import your generated (nixos-generate-config) hardware configuration + ./hardware-configuration.nix + ]; + programs.obs-studio.enableVirtualCamera = true; + + ssh.enable = true; + ssh_guard.enable = true; + nfs.enable = true; + steam.enable = true; + + # Bootloader. + boot = { + loader = { + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + initrd.luks.devices."luks-ab8d2b18-14de-44ff-a7b5-91d5f5d0e937".device = + "/dev/disk/by-uuid/ab8d2b18-14de-44ff-a7b5-91d5f5d0e937"; + }; + + # sops + sops = { + defaultSopsFile = ../../secrets/secrets.yaml; + defaultSopsFormat = "yaml"; + age.keyFile = "/home/${user}/.config/sops/age/keys.txt"; + }; + + nixpkgs = { + # You can add overlays here + overlays = [ + # Add overlays your own flake exports (from overlays and pkgs dir): + outputs.overlays.additions + outputs.overlays.modifications + outputs.overlays.unstable-packages + + # You can also add overlays exported from other flakes: + # neovim-nightly-overlay.overlays.default + + # Or define it inline, for example: + # (final: prev: { + # hi = final.hello.overrideAttrs (oldAttrs: { + # patches = [ ./change-hello-to-hi.patch ]; + # }); + # }) + ]; + # Configure your nixpkgs instance + config = { + # Disable if you don't want unfree packages + allowUnfree = true; + }; + }; + + # This will add each flake input as a registry + # To make nix3 commands consistent with your flake + nix.registry = (lib.mapAttrs (_: flake: { inherit flake; })) ( + (lib.filterAttrs (_: lib.isType "flake")) inputs + ); + + # This will additionally add your inputs to the system's legacy channels + # Making legacy nix commands consistent as well, awesome! + nix.nixPath = [ "/etc/nix/path" ]; + environment.etc = lib.mapAttrs' (name: value: { + name = "nix/path/${name}"; + value.source = value.flake; + }) config.nix.registry; + + networking.hostName = "grymforge"; + networking.networkmanager.enable = true; + + users.users = { + gwg313 = { + initialPassword = "correcthorsebatterystaple"; + isNormalUser = true; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILq54YrM3BbhBs0oDLOrc1bkg6FCCmkV4E3pWLZp0ejN gwg313@pm.me" + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPZK7127ict2+Urhi1cbD6EIU85mD4lkQ9/ihaif0jsX" # Phone + ]; + extraGroups = [ "wheel" ]; + }; + }; + + environment = { + loginShellInit = '' + # if [ -z $DISPLAY ] && [ "$(tty)" = "/dev/tty1" ]; then + # exec Hyprland + # fi + ''; # Will automatically open Hyprland when logged into tty1 + variables = { + TERMINAL = "alacritty"; + EDITOR = "nvim"; + VISUAL = "nvim"; + PAGER = "moar"; + }; + }; + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion + system.stateVersion = "23.05"; +} diff --git a/hosts/grymforge/earlyoom.nix b/hosts/grymforge/earlyoom.nix new file mode 100644 index 0000000..5d28890 --- /dev/null +++ b/hosts/grymforge/earlyoom.nix @@ -0,0 +1,13 @@ +{ + services.earlyoom = { + enable = true; + freeSwapThreshold = 2; + freeMemThreshold = 2; + enableNotifications = true; + # extraArgs = [ + # "-g" + # "--avoid '(^|/)(.Hyrpland-wrapp|ghostty|zerotier-one)$'" + # "--prefer '(^|/)(electron|libreoffice|gimp|Isolated Web Co)$'" + # ]; + }; +} diff --git a/hosts/grymforge/hardware-configuration.nix b/hosts/grymforge/hardware-configuration.nix new file mode 100644 index 0000000..b47d6c4 --- /dev/null +++ b/hosts/grymforge/hardware-configuration.nix @@ -0,0 +1,59 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ../../common/nixos/nfs.nix + ]; + + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/95565731-9a95-4fcc-857d-1f066f4e4acf"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-c140b0df-2cce-4710-a2fa-94dd3016a7e6".device = + "/dev/disk/by-uuid/c140b0df-2cce-4710-a2fa-94dd3016a7e6"; + + fileSystems."/boot" = { + device = "/dev/disk/by-uuid/34C4-ECCE"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-uuid/2fea88dc-b9a8-40d6-a87d-f7383548e60d"; } + ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp1s0.useDHCP = lib.mkDefault true; + # networking.interfaces.wlo1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/hosts/grymforge/kernel.nix b/hosts/grymforge/kernel.nix new file mode 100644 index 0000000..46e14b7 --- /dev/null +++ b/hosts/grymforge/kernel.nix @@ -0,0 +1,22 @@ +{ pkgs, ... }: +{ + boot.kernelPackages = pkgs.linuxPackages_hardened; + boot.kernelParams = [ + # Disable slab merging to prevent heap exploitation + "slab_nomerge" + # Enable zeroing memory during allocation and free time + "init_on_alloc=1" + "init_on_free=1" + # Randomize page allocator freelists + "page_alloc.shuffle=1" + # Mitigations + "pti=on" + + "vsyscall=none" + "debugfs=off" + "oops=panic" + + # Enable lockdown LSM + "lockdown=confidentiality" + ]; +} diff --git a/hosts/grymforge/sleep.nix b/hosts/grymforge/sleep.nix new file mode 100644 index 0000000..ee5267f --- /dev/null +++ b/hosts/grymforge/sleep.nix @@ -0,0 +1,34 @@ +{ pkgs, ... }: +{ + systemd.services.sleep-schedule = { + description = "Suspend PC at 10PM and wake at 6:30AM using rtcwake"; + serviceConfig = { + Type = "oneshot"; + ExecStart = pkgs.writeShellScript "sleep-schedule" '' + WAKE_TIME=$(${pkgs.coreutils}/bin/date +%s -d "tomorrow 06:30") + exec ${pkgs.util-linux}/bin/rtcwake -m mem -t "$WAKE_TIME" + ''; + }; + }; + + systemd.timers.sleep-schedule = { + description = "Timer to suspend PC at 10PM daily"; + wantedBy = [ "timers.target" ]; + timerConfig = { + OnCalendar = "daily 22:00"; + Persistent = true; + }; + }; + + security.sudo.extraRules = [ + { + users = [ "root" ]; + commands = [ + { + command = "/run/current-system/sw/bin/rtcwake"; + options = [ "NOPASSWD" ]; + } + ]; + } + ]; +} diff --git a/hosts/grymforge/syncthing.nix b/hosts/grymforge/syncthing.nix new file mode 100644 index 0000000..1b39931 --- /dev/null +++ b/hosts/grymforge/syncthing.nix @@ -0,0 +1,68 @@ +{ + config, + user, + inputs, + ... +}: +{ + services.syncthing = { + enable = true; + dataDir = "/home/gwg313"; + openDefaultPorts = true; + configDir = "/home/gwg313/.config/syncthing"; + user = "gwg313"; + group = "users"; + guiAddress = "127.0.0.1:8384"; + + overrideDevices = true; + overrideFolders = true; + + settings = { + gui = { + user = inputs.secrets.syncthing.gui_user; + password = inputs.secrets.syncthing.gui_password; + }; + devices = { + "candlekeep" = { + id = inputs.secrets.syncthing.candlekeep_id; + }; + }; + + folders = { + "repos" = { + path = "/home/gwg313/repos"; + devices = [ "candlekeep" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + "documents" = { + path = "/home/gwg313/Documents"; + devices = [ "candlekeep" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + "password-store" = { + path = "/home/gwg313/.local/share/password-store"; + devices = [ "candlekeep" ]; + versioning = { + type = "staggered"; + params = { + cleanInterval = "3600"; + maxAge = "15768000"; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/grymforge/sysctl.nix b/hosts/grymforge/sysctl.nix new file mode 100644 index 0000000..c34f88a --- /dev/null +++ b/hosts/grymforge/sysctl.nix @@ -0,0 +1,7 @@ +{lib, ...}: { + boot.kernel.sysctl = { + # disable unprivileged user namespaces to decrease attack surface + # Enabled because breaks discord/element etc + "kernel.unprivileged_userns_clone" = lib.mkForce 1; + }; +} diff --git a/hosts/kerby/configuration.nix b/hosts/kerby/configuration.nix new file mode 100644 index 0000000..74c1023 --- /dev/null +++ b/hosts/kerby/configuration.nix @@ -0,0 +1,112 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ + config, + pkgs, + lib, + inputs, + ... +}: +{ + # sops + sops = { + defaultSopsFile = ../../secrets/secrets.yaml; + defaultSopsFormat = "yaml"; + age.keyFile = "/home/gwg313/.config/sops/age/keys.txt"; + }; + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../common/nixos/ssh/default.nix + inputs.sops-nix.nixosModules.sops + ]; + + ssh.enable = true; + ssh_guard.enable = true; + ssh_client.enable = false; + services.openssh.authorizedKeysFiles = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvOfDSjlvegGqfUS18XwXB7SvS2n9/hGYUpKxRb9vgb gwg313@pm.me" + ]; + services.openssh.settings = { + PermitRootLogin = lib.mkForce "yes"; + + AllowUsers = lib.mkForce [ + "gwg313" + "root" + ]; + }; + + users.users.gwg313 = { + isNormalUser = true; + description = "gwg313"; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvOfDSjlvegGqfUS18XwXB7SvS2n9/hGYUpKxRb9vgb gwg313@pm.me" + ]; + extraGroups = [ + "networkmanager" + "wheel" + ]; + packages = with pkgs; [ ]; + }; + + users.users = { + root = { + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvOfDSjlvegGqfUS18XwXB7SvS2n9/hGYUpKxRb9vgb gwg313@pm.me" + ]; + }; + }; + + # Bootloader. + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.useOSProber = true; + networking.hostName = "kerby"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + # Enable networking + networking.networkmanager.enable = true; + # Set your time zone. + time.timeZone = "America/Toronto"; + # Select internationalisation properties. + i18n.defaultLocale = "en_CA.UTF-8"; + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + # Define a user account. Don't forget to set a password with ‘passwd’. + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + ]; + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + # List services that you want to enable: + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.11"; # Did you read the comment? +} diff --git a/hosts/kerby/hardware-configuration.nix b/hosts/kerby/hardware-configuration.nix new file mode 100644 index 0000000..107ed92 --- /dev/null +++ b/hosts/kerby/hardware-configuration.nix @@ -0,0 +1,43 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/979e137f-7d21-4dac-b6eb-51c8add1cf48"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens18.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/kerby/kerberos-kdc.nix b/hosts/kerby/kerberos-kdc.nix new file mode 100644 index 0000000..b5d8d1d --- /dev/null +++ b/hosts/kerby/kerberos-kdc.nix @@ -0,0 +1,15 @@ +{ }: +{ + services.kerberoskdc = { + enable = true; + realm = "LOCAL.GWG313.XYZ"; + databaseFile = "/var/lib/krb5kdc/principal"; + adminServer.enable = true; + kadmindPort = 749; + kdcPort = 88; + extraConfig = '' + max_life = 10h + max_renewable_life = 7d + ''; + }; +} diff --git a/hosts/kerby/kerberos.nix b/hosts/kerby/kerberos.nix new file mode 100644 index 0000000..c8e2c43 --- /dev/null +++ b/hosts/kerby/kerberos.nix @@ -0,0 +1,69 @@ +{ + config, + lib, + pkgs, + ... +}: +{ + services.krb5kdc = { + enable = true; + realms = { + "EXAMPLE.LOCAL" = { + aclFile = "/etc/krb5kdc/kadm5.acl"; + dictFile = "/etc/krb5kdc/kadm5.dict"; + databaseName = "/var/lib/krb5kdc/principal"; + adminServer = "kerberos.example.local"; + supportedEnctypes = [ "aes256-cts-hmac-sha1-96" ]; + }; + }; + }; + + services.kadmind.enable = true; + + services.krb5 = { + enable = true; + libdefaults = { + default_realm = "EXAMPLE.LOCAL"; + }; + realms = { + "EXAMPLE.LOCAL" = { + kdc = [ "kerberos.example.local" ]; + admin_server = "kerberos.example.local"; + }; + }; + }; + + environment.etc."krb5kdc/kadm5.acl".text = "*/admin@EXAMPLE.LOCAL *"; + + sops.secrets."kdc/master_password" = { }; + sops.secrets."kdc/admin_password" = { }; + + systemd.services.krb5-bootstrap = { + description = "Bootstrap KDC DB + principals"; + wantedBy = [ "multi-user.target" ]; + before = [ "krb5kdc.service" ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + }; + script = '' + set -e + DB="/var/lib/krb5kdc/principal" + if [ ! -f "$DB" ]; then + MASTER_PW=$(<${config.sops.secrets."kdc/master_password".path}) + ADMIN_PW=$(<${config.sops.secrets."kdc/admin_password".path}) + + echo "Creating KDC database..." + echo "$MASTER_PW" | kdb5_util create -s -P "$MASTER_PW" + + echo "$ADMIN_PW + $ADMIN_PW" | kadmin.local -q "addprinc root/admin" + + kadmin.local -q "addprinc -randkey nfs/truenas.example.local" + kadmin.local -q "ktadd -k /etc/krb5kdc/nfs.keytab nfs/truenas.example.local" + fi + ''; + }; + + environment.etc."krb5kdc/nfs.keytab".source = "/etc/krb5kdc/nfs.keytab"; +} diff --git a/hosts/kerby/krb5.nix b/hosts/kerby/krb5.nix new file mode 100644 index 0000000..677b1b5 --- /dev/null +++ b/hosts/kerby/krb5.nix @@ -0,0 +1,11 @@ +{ }: +{ + services.krb5 = { + enable = true; + defaultRealm = "LOCAL.GWG313.XYZ"; + realms."LOCAL.GWG313.XYZ" = { + kdc = [ "kerby.local.gwg313.xyz" ]; + adminServer = "kerby.local.gwg313.xyz"; + }; + }; +} diff --git a/hosts/panopticon/configuration.nix b/hosts/panopticon/configuration.nix new file mode 100644 index 0000000..e0e25f7 --- /dev/null +++ b/hosts/panopticon/configuration.nix @@ -0,0 +1,118 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ + config, + pkgs, + lib, + inputs, + ... +}: +{ + # sops + sops = { + defaultSopsFile = ../../secrets/secrets.yaml; + defaultSopsFormat = "yaml"; + age.keyFile = "/home/gwg313/.config/sops/age/keys.txt"; + }; + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../common/nixos/ssh/default.nix + ./grafana.nix + ./promtail.nix + ./loki.nix + ./uptime-kuma.nix + ./prometheus_node_exporter.nix + ./traefik.nix + inputs.sops-nix.nixosModules.sops + ]; + + ssh.enable = true; + ssh_guard.enable = true; + ssh_client.enable = false; + services.openssh.authorizedKeysFiles = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvOfDSjlvegGqfUS18XwXB7SvS2n9/hGYUpKxRb9vgb gwg313@pm.me" + ]; + services.openssh.settings = { + PermitRootLogin = lib.mkForce "yes"; + + AllowUsers = lib.mkForce [ + "gwg313" + "root" + ]; + }; + + users.users.gwg313 = { + isNormalUser = true; + description = "gwg313"; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvOfDSjlvegGqfUS18XwXB7SvS2n9/hGYUpKxRb9vgb gwg313@pm.me" + ]; + extraGroups = [ + "networkmanager" + "wheel" + ]; + packages = with pkgs; [ ]; + }; + + users.users = { + root = { + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvOfDSjlvegGqfUS18XwXB7SvS2n9/hGYUpKxRb9vgb gwg313@pm.me" + ]; + }; + }; + + # Bootloader. + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.useOSProber = true; + networking.hostName = "panopticon"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + # Enable networking + networking.networkmanager.enable = true; + # Set your time zone. + time.timeZone = "America/Toronto"; + # Select internationalisation properties. + i18n.defaultLocale = "en_CA.UTF-8"; + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + # Define a user account. Don't forget to set a password with ‘passwd’. + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + ]; + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + # List services that you want to enable: + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.11"; # Did you read the comment? +} diff --git a/hosts/panopticon/grafana.nix b/hosts/panopticon/grafana.nix new file mode 100644 index 0000000..0febadb --- /dev/null +++ b/hosts/panopticon/grafana.nix @@ -0,0 +1,40 @@ +{ config, ... }: +{ + sops.secrets.grafana_user = { + mode = "0440"; + owner = config.users.users.grafana.name; + group = config.users.users.grafana.group; + }; + + sops.secrets.grafana_password = { + mode = "0440"; + owner = config.users.users.grafana.name; + group = config.users.users.grafana.group; + }; + + services.grafana = { + enable = true; + settings = { + server = { + http_addr = "127.0.0.1"; + http_port = 3001; + }; + security = { + admin_user = "${config.sops.secrets.grafana_user.path}"; + admin_password = "${config.sops.secrets.grafana_password.path}"; + }; + }; + + provision = { + datasources.settings.datasources = [ + { + name = "Loki"; + type = "loki"; + access = "proxy"; + url = "http://localhost:3100"; + isDefault = true; + } + ]; + }; + }; +} diff --git a/hosts/panopticon/hardware-configuration.nix b/hosts/panopticon/hardware-configuration.nix new file mode 100644 index 0000000..107ed92 --- /dev/null +++ b/hosts/panopticon/hardware-configuration.nix @@ -0,0 +1,43 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/979e137f-7d21-4dac-b6eb-51c8add1cf48"; + fsType = "ext4"; + }; + + swapDevices = [ ]; + + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens18.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/panopticon/loki-config.yaml b/hosts/panopticon/loki-config.yaml new file mode 100644 index 0000000..0f69ce2 --- /dev/null +++ b/hosts/panopticon/loki-config.yaml @@ -0,0 +1,30 @@ + +# This is a complete configuration to deploy Loki backed by the filesystem. +# The index will be shipped to the storage via tsdb-shipper. + +auth_enabled: false + +server: + http_listen_port: 3100 + +common: + ring: + instance_addr: 127.0.0.1 + kvstore: + store: inmemory + replication_factor: 1 + path_prefix: /tmp/loki + +schema_config: + configs: + - from: 2020-05-15 + store: tsdb + object_store: filesystem + schema: v13 + index: + prefix: index_ + period: 24h + +storage_config: + filesystem: + directory: /tmp/loki/chunks diff --git a/hosts/panopticon/loki.nix b/hosts/panopticon/loki.nix new file mode 100644 index 0000000..6f24a0b --- /dev/null +++ b/hosts/panopticon/loki.nix @@ -0,0 +1,6 @@ +{ + services.loki = { + enable = true; + configFile = ./loki-config.yaml; + }; +} diff --git a/hosts/panopticon/prometheus_node_exporter.nix b/hosts/panopticon/prometheus_node_exporter.nix new file mode 100644 index 0000000..993f8a1 --- /dev/null +++ b/hosts/panopticon/prometheus_node_exporter.nix @@ -0,0 +1,6 @@ +_: { + services.prometheus.exporters.node = { + enable = true; + openFirewall = true; + }; +} diff --git a/hosts/panopticon/promtail.nix b/hosts/panopticon/promtail.nix new file mode 100644 index 0000000..d916e33 --- /dev/null +++ b/hosts/panopticon/promtail.nix @@ -0,0 +1,32 @@ +{ config, ... }: +{ + systemd.tmpfiles.rules = [ + "d /var/lib/promtail 0755 promtail promtail -" + ]; + services.promtail = { + enable = true; + configuration = { + server.http_listen_port = 9080; + server.grpc_listen_port = 0; + positions = { + filename = "/var/lib/promtail/positions.yaml"; + }; + clients = [ + { + url = "http://localhost:3100/loki/api/v1/push"; + } + ]; + scrape_configs = [ + { + job_name = "journal"; + journal = { + labels = { + job = "systemd-journal"; + host = config.networking.hostName; + }; + }; + } + ]; + }; + }; +} diff --git a/hosts/panopticon/routes.nix b/hosts/panopticon/routes.nix new file mode 100644 index 0000000..2bd2b39 --- /dev/null +++ b/hosts/panopticon/routes.nix @@ -0,0 +1,36 @@ +{ + imports = [ + ./services.nix + ]; + services.traefik = { + dynamicConfigOptions = { + http = { + routers = { + uptime_kuma_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`uptime.gwg313.xyz`)"; + service = "uptime_kuma_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + grafana_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`grafana.gwg313.xyz`)"; + service = "grafana_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + loki_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`loki.gwg313.xyz`)"; + service = "loki_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + }; + }; + }; + }; +} diff --git a/hosts/panopticon/services.nix b/hosts/panopticon/services.nix new file mode 100644 index 0000000..40cd74e --- /dev/null +++ b/hosts/panopticon/services.nix @@ -0,0 +1,27 @@ +{ + services.traefik = { + dynamicConfigOptions = { + http = { + services = { + uptime_kuma_local.loadBalancer.servers = [ + { + url = "http://127.0.0.1:3030"; + } + ]; + + grafana_local.loadBalancer.servers = [ + { + url = "http://127.0.0.1:3001"; + } + ]; + + loki_local.loadBalancer.servers = [ + { + url = "http://127.0.0.1:3100"; + } + ]; + }; + }; + }; + }; +} diff --git a/hosts/panopticon/traefik.nix b/hosts/panopticon/traefik.nix new file mode 100644 index 0000000..8e94b6a --- /dev/null +++ b/hosts/panopticon/traefik.nix @@ -0,0 +1,128 @@ +# Traefik +{ config, ... }: +{ + imports = [ + ./routes.nix + ]; + sops.secrets.cf-api-token = { + mode = "0440"; + owner = config.users.users.traefik.name; + group = config.users.users.traefik.group; + }; + + systemd.services.traefik.environment = { + CF_DNS_API_TOKEN_FILE = "${config.sops.secrets.cf-api-token.path}"; + }; + + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; + + services.traefik = { + enable = true; + staticConfigOptions = { + serversTransport = { + insecureSkipVerify = true; + }; + entryPoints = { + web = { + address = ":80"; + http = { + redirections = { + entryPoint = { + to = "websecure"; + scheme = "https"; + }; + }; + }; + }; + websecure = { + address = ":443"; + http = { + tls = { + options = "default"; + }; + }; + }; + }; + api = { + dashboard = true; + }; + certificatesResolvers = { + le = { + acme = { + email = "glen.goodwin@protonmail.com"; + storage = "/var/lib/traefik/acme.json"; + dnsChallenge = { + provider = "cloudflare"; + resolvers = [ "1.1.1.1:53" ]; + }; + }; + }; + }; + # log = { + # level = "DEBUG"; + # filePath = "/var/log/traefik/traefik.log"; + # }; + # + # accessLog = { + # filePath = "/var/log/traefik/access.log"; + # bufferingSize = 0; + # filters = {}; + # fields = { + # defaultMode = "keep"; + # names = { + # StartUTC = "drop"; + # }; + # }; + # }; + }; + dynamicConfigOptions = { + http = { + routers = { + dashboard = { + rule = "Host(`monitor.local.gwg313.xyz`)"; + service = "api@internal"; + middlewares = [ + # "auth" + "headers" + ]; + entrypoints = [ "websecure" ]; + tls = { + certResolver = "le"; + }; + }; + }; + middlewares = { + headers = { + headers = { + browserxssfilter = true; + contenttypenosniff = true; + customframeoptionsvalue = "SAMEORIGIN"; + forcestsheader = true; + framedeny = true; + sslhost = "gwg313.xyz"; + sslredirect = true; + stsincludesubdomains = true; + stspreload = true; + stsseconds = "315360000"; + }; + }; + }; + }; + tls = { + options = { + default = { + minVersion = "VersionTLS13"; + sniStrict = true; + curvePreferences = [ + "CurveP521" + "CurveP384" + ]; + }; + }; + }; + }; + }; +} diff --git a/hosts/panopticon/uptime-kuma.nix b/hosts/panopticon/uptime-kuma.nix new file mode 100644 index 0000000..0fb4d9b --- /dev/null +++ b/hosts/panopticon/uptime-kuma.nix @@ -0,0 +1,9 @@ +_: { + services.uptime-kuma = { + enable = true; + settings = { + HOST = "127.0.0.1"; + PORT = "3030"; + }; + }; +} diff --git a/hosts/seikan/configuration.nix b/hosts/seikan/configuration.nix new file mode 100644 index 0000000..66bb616 --- /dev/null +++ b/hosts/seikan/configuration.nix @@ -0,0 +1,119 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ + config, + pkgs, + modulesPath, + lib, + inputs, + ... +}: + +let + ## Pin the latest NixOS stable (nixos-24.05) release: + nixpkgs-src = builtins.fetchTarball { + url = "https://github.com/NixOS/nixpkgs/archive/797f7dc49e0bc7fab4b57c021cdf68f595e47841.tar.gz"; + sha256 = "sha256:0q96nxw7jg9l9zlpa3wkma5xzmgkdnnajapwhgb2fk2ll224rgs1"; + }; +in +{ + # sops + sops = { + defaultSopsFile = ../../secrets/secrets.yaml; + defaultSopsFormat = "yaml"; + age.keyFile = "/home/gwg313/.config/sops/age/keys.txt"; + }; + imports = lib.optional (builtins.pathExists ./do-userdata.nix) ./do-userdata.nix ++ [ + (modulesPath + "/virtualisation/digital-ocean-config.nix") + + ./traefik.nix + ./zerotier.nix + ../../common/nixos/ssh/default.nix + inputs.sops-nix.nixosModules.sops + ]; + + ssh.enable = true; + ssh_guard.enable = true; + ssh_client.enable = false; + services.openssh.authorizedKeysFiles = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvOfDSjlvegGqfUS18XwXB7SvS2n9/hGYUpKxRb9vgb gwg313@pm.me" + ]; + services.openssh.settings = { + PermitRootLogin = lib.mkForce "yes"; + + AllowUsers = lib.mkForce [ + "gwg313" + "root" + ]; + }; + + users.users.gwg313 = { + isNormalUser = true; + description = "gwg313"; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvOfDSjlvegGqfUS18XwXB7SvS2n9/hGYUpKxRb9vgb gwg313@pm.me" + ]; + extraGroups = [ + "networkmanager" + "wheel" + ]; + packages = with pkgs; [ ]; + }; + + users.users = { + root = { + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvOfDSjlvegGqfUS18XwXB7SvS2n9/hGYUpKxRb9vgb gwg313@pm.me" + ]; + }; + }; + + networking.hostName = "nixos"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + # Enable networking + networking.networkmanager.enable = true; + # Set your time zone. + time.timeZone = "America/Toronto"; + # Select internationalisation properties. + i18n.defaultLocale = "en_CA.UTF-8"; + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + # Define a user account. Don't forget to set a password with ‘passwd’. + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + ]; + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + # List services that you want to enable: + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.11"; # Did you read the comment? +} diff --git a/hosts/seikan/routes.nix b/hosts/seikan/routes.nix new file mode 100644 index 0000000..b85909d --- /dev/null +++ b/hosts/seikan/routes.nix @@ -0,0 +1,192 @@ +{ + services.traefik = { + dynamicConfigOptions = { + http = { + services = { + music_zt.loadBalancer.servers = [ + { + url = "https://music.zerotier.gwg313.xyz"; + } + ]; + + audiobooks_zt.loadBalancer.servers = [ + { + url = "https://audiobooks.zerotier.gwg313.xyz"; + } + ]; + + recipes_zt.loadBalancer.servers = [ + { + url = "https://recipes.zerotier.gwg313.xyz"; + } + ]; + + bookmarks_zt.loadBalancer.servers = [ + { + url = "https://bookmarks.zerotier.gwg313.xyz"; + } + ]; + + scholarsome_zt.loadBalancer.servers = [ + { + url = "https://scholarsome.zerotier.gwg313.xyz"; + } + ]; + + pastebin_zt.loadBalancer.servers = [ + { + url = "https://pastebin.zerotier.gwg313.xyz"; + } + ]; + + snippets_zt.loadBalancer.servers = [ + { + url = "https://snippets.zerotier.gwg313.xyz"; + } + ]; + + git_zt.loadBalancer.servers = [ + { + url = "https://git.zerotier.gwg313.xyz"; + } + ]; + + registry_zt.loadBalancer.servers = [ + { + url = "https://registry.zerotier.gwg313.xyz"; + } + ]; + + ci_zt.loadBalancer.servers = [ + { + url = "https://ci.zerotier.gwg313.xyz"; + } + ]; + + s3_zt.loadBalancer.servers = [ + { + url = "https://s3.zerotier.gwg313.xyz"; + } + ]; + + s3_console_zt.loadBalancer.servers = [ + { + url = "https://s3-console.zerotier.gwg313.xyz"; + } + ]; + + uptime_zt.loadBalancer.servers = [ + { + url = "https://uptime.zerotier.gwg313.xyz"; + } + ]; + }; + + routers = { + music_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`music.gwg313.xyz`)"; + service = "music_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + audiobooks_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`audiobooks.gwg313.xyz`)"; + service = "audiobooks_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + recipes_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`recipes.gwg313.xyz`)"; + service = "recipes_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + bookmarks_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`bookmarks.gwg313.xyz`)"; + service = "bookmarks_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + scholarsome_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`scholarsome.gwg313.xyz`)"; + service = "scholarsome_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + pastebin_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`pastebin.gwg313.xyz`)"; + service = "pastebin_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + snippets_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`snippets.gwg313.xyz`)"; + service = "snippets_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + git_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`git.gwg313.xyz`)"; + service = "git_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + ci_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`ci.gwg313.xyz`)"; + service = "ci_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + registry_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`registry.gwg313.xyz`)"; + service = "registry_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + s3_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`s3.gwg313.xyz`)"; + service = "s3_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + s3_console = { + entryPoints = [ "websecure" ]; + rule = "Host(`s3-console.gwg313.xyz`)"; + service = "s3_console_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + uptime_console = { + entryPoints = [ "websecure" ]; + rule = "Host(`uptime.gwg313.xyz`)"; + service = "s3_console_zt"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + }; + }; + }; + }; +} diff --git a/hosts/seikan/traefik.nix b/hosts/seikan/traefik.nix new file mode 100644 index 0000000..fd72837 --- /dev/null +++ b/hosts/seikan/traefik.nix @@ -0,0 +1,124 @@ +# Traefik +{ config, ... }: +{ + imports = [ + ./routes.nix + ../../common/networking/hosts.nix + ]; + sops.secrets.cf-api-token = { + mode = "0440"; + owner = config.users.users.traefik.name; + group = config.users.users.traefik.group; + }; + + sops.secrets.basic-auth = { + mode = "0440"; + owner = config.users.users.traefik.name; + group = config.users.users.traefik.group; + }; + + systemd.services.traefik.environment = { + CF_DNS_API_TOKEN_FILE = "${config.sops.secrets.cf-api-token.path}"; + }; + + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; + + services.traefik = { + enable = true; + staticConfigOptions = { + serversTransport = { + insecureSkipVerify = true; + }; + entryPoints = { + web = { + address = ":80"; + http = { + redirections = { + entryPoint = { + to = "websecure"; + scheme = "https"; + }; + }; + }; + }; + websecure = { + address = ":443"; + http = { + tls = { + options = "default"; + }; + }; + }; + }; + api = { + dashboard = true; + }; + certificatesResolvers = { + le = { + acme = { + email = "glen.goodwin@protonmail.com"; + storage = "/var/lib/traefik/acme.json"; + dnsChallenge = { + provider = "cloudflare"; + resolvers = [ "1.1.1.1:53" ]; + }; + }; + }; + }; + }; + dynamicConfigOptions = { + http = { + routers = { + dashboard = { + rule = "Host(`monitor.gwg313.xyz`)"; + service = "api@internal"; + middlewares = [ + "auth" + "headers" + ]; + entrypoints = [ "websecure" ]; + tls = { + certResolver = "le"; + }; + }; + }; + middlewares = { + auth = { + basicAuth = { + usersFile = "${config.sops.secrets.basic-auth.path}"; + }; + }; + headers = { + headers = { + browserxssfilter = true; + contenttypenosniff = true; + customframeoptionsvalue = "SAMEORIGIN"; + forcestsheader = true; + framedeny = true; + sslhost = "gwg313.xyz"; + sslredirect = true; + stsincludesubdomains = true; + stspreload = true; + stsseconds = "315360000"; + }; + }; + }; + }; + tls = { + options = { + default = { + minVersion = "VersionTLS13"; + sniStrict = true; + curvePreferences = [ + "CurveP521" + "CurveP384" + ]; + }; + }; + }; + }; + }; +} diff --git a/hosts/seikan/zerotier.nix b/hosts/seikan/zerotier.nix new file mode 100644 index 0000000..061d05d --- /dev/null +++ b/hosts/seikan/zerotier.nix @@ -0,0 +1,9 @@ +{ inputs, ... }: +{ + services.zerotierone = { + joinNetworks = [ + inputs.secrets.zerotier.infra + ]; + enable = true; + }; +} diff --git a/hosts/waypoint/cloudflared.nix b/hosts/waypoint/cloudflared.nix new file mode 100644 index 0000000..b42e70e --- /dev/null +++ b/hosts/waypoint/cloudflared.nix @@ -0,0 +1,19 @@ +{ + services = { + cloudflared = { + enable = true; + tunnels = { + "4d40bf21-d8ef-4a71-8fb7-e4f24bb8b0cf" = { + credentialsFile = "/home/gwg313/.cloudflared/4d40bf21-d8ef-4a71-8fb7-e4f24bb8b0cf.json"; + default = "http_status:404"; + ingress = { + "*.gwg313.xyz" = { + service = "http://localhost"; + # path = "/*.(jpg|png|css|js)"; + }; + }; + }; + }; + }; + }; +} diff --git a/hosts/waypoint/configuration.nix b/hosts/waypoint/configuration.nix new file mode 100644 index 0000000..48d9c80 --- /dev/null +++ b/hosts/waypoint/configuration.nix @@ -0,0 +1,114 @@ +# Edit this configuration file to define what should be installed on +# your system. Help is available in the configuration.nix(5) man page +# and in the NixOS manual (accessible by running ‘nixos-help’). +{ + config, + pkgs, + lib, + inputs, + ... +}: +{ + # sops + sops = { + defaultSopsFile = ../../secrets/secrets.yaml; + defaultSopsFormat = "yaml"; + age.keyFile = "/home/gwg313/.config/sops/age/keys.txt"; + }; + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ./traefik.nix + ./zerotier.nix + ../../common/nixos/ssh/default.nix + inputs.sops-nix.nixosModules.sops + ]; + + ssh.enable = true; + ssh_guard.enable = true; + ssh_client.enable = false; + services.openssh.authorizedKeysFiles = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvOfDSjlvegGqfUS18XwXB7SvS2n9/hGYUpKxRb9vgb gwg313@pm.me" + ]; + services.openssh.settings = { + PermitRootLogin = lib.mkForce "yes"; + + AllowUsers = lib.mkForce [ + "gwg313" + "root" + ]; + }; + + users.users.gwg313 = { + isNormalUser = true; + description = "gwg313"; + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvOfDSjlvegGqfUS18XwXB7SvS2n9/hGYUpKxRb9vgb gwg313@pm.me" + ]; + extraGroups = [ + "networkmanager" + "wheel" + ]; + packages = with pkgs; [ ]; + }; + + users.users = { + root = { + openssh.authorizedKeys.keys = [ + "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINvOfDSjlvegGqfUS18XwXB7SvS2n9/hGYUpKxRb9vgb gwg313@pm.me" + ]; + }; + }; + + # Bootloader. + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.useOSProber = true; + networking.hostName = "nixos"; # Define your hostname. + # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. + # Configure network proxy if necessary + # networking.proxy.default = "http://user:password@proxy:port/"; + # networking.proxy.noProxy = "127.0.0.1,localhost,internal.domain"; + # Enable networking + networking.networkmanager.enable = true; + # Set your time zone. + time.timeZone = "America/Toronto"; + # Select internationalisation properties. + i18n.defaultLocale = "en_CA.UTF-8"; + # Configure keymap in X11 + services.xserver.xkb = { + layout = "us"; + variant = ""; + }; + # Define a user account. Don't forget to set a password with ‘passwd’. + # Allow unfree packages + nixpkgs.config.allowUnfree = true; + # List packages installed in system profile. To search, run: + # $ nix search wget + environment.systemPackages = with pkgs; [ + # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. + # wget + ]; + # Some programs need SUID wrappers, can be configured further or are + # started in user sessions. + # programs.mtr.enable = true; + # programs.gnupg.agent = { + # enable = true; + # enableSSHSupport = true; + # }; + # List services that you want to enable: + # Enable the OpenSSH daemon. + # services.openssh.enable = true; + # Open ports in the firewall. + # networking.firewall.allowedTCPPorts = [ ... ]; + # networking.firewall.allowedUDPPorts = [ ... ]; + # Or disable the firewall altogether. + # networking.firewall.enable = false; + # This value determines the NixOS release from which the default + # settings for stateful data, like file locations and database versions + # on your system were taken. It‘s perfectly fine and recommended to leave + # this value at the release version of the first install of this system. + # Before changing this value read the documentation for this option + # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html). + system.stateVersion = "24.11"; # Did you read the comment? +} diff --git a/hosts/waypoint/hardware-configuration.nix b/hosts/waypoint/hardware-configuration.nix new file mode 100644 index 0000000..677a528 --- /dev/null +++ b/hosts/waypoint/hardware-configuration.nix @@ -0,0 +1,38 @@ +# Do not modify this file! It was generated by ‘nixos-generate-config’ +# and may be overwritten by future invocations. Please make changes +# to /etc/nixos/configuration.nix instead. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + boot.initrd.availableKernelModules = [ + "ata_piix" + "uhci_hcd" + "virtio_pci" + "virtio_scsi" + "sd_mod" + "sr_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ ]; + boot.extraModulePackages = [ ]; + fileSystems."/" = { + device = "/dev/disk/by-uuid/0692e3c0-aa34-4a5a-aaa5-c13f55783570"; + fsType = "ext4"; + }; + swapDevices = [ ]; + # Enables DHCP on each ethernet and wireless interface. In case of scripted networking + # (the default) this is the recommended approach. When using systemd-networkd it's + # still possible to use this option, but it's recommended to use it in conjunction + # with explicit per-interface declarations with `networking.interfaces..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.ens18.useDHCP = lib.mkDefault true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; +} diff --git a/hosts/waypoint/routes.nix b/hosts/waypoint/routes.nix new file mode 100644 index 0000000..5119cd8 --- /dev/null +++ b/hosts/waypoint/routes.nix @@ -0,0 +1,115 @@ +{ + imports = [ + ./services.nix + ]; + services.traefik = { + dynamicConfigOptions = { + http = { + routers = { + music = { + entryPoints = [ "websecure" ]; + rule = "Host(`music.gwg313.xyz`)"; + service = "music_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + recipes = { + entryPoints = [ "websecure" ]; + rule = "Host(`recipes.gwg313.xyz`)"; + service = "recipes_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + audiobooks = { + entryPoints = [ "websecure" ]; + rule = "Host(`audiobooks.gwg313.xyz`)"; + service = "audiobooks_local"; + tls.certResolver = "le"; + middlewares = [ ]; + }; + scholarsome = { + entryPoints = [ "websecure" ]; + rule = "Host(`scholarsome.gwg313.xyz`)"; + service = "scholarsome_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + bookmarks = { + entryPoints = [ "websecure" ]; + rule = "Host(`bookmarks.gwg313.xyz`)"; + service = "bookmarks_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + pastebin = { + entryPoints = [ "websecure" ]; + rule = "Host(`pastebin.gwg313.xyz`)"; + service = "pastebin_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + snippets = { + entryPoints = [ "websecure" ]; + rule = "Host(`snippets.gwg313.xyz`)"; + service = "snippets_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + git = { + entryPoints = [ "websecure" ]; + rule = "Host(`git.gwg313.xyz`)"; + service = "git_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + registry = { + entryPoints = [ "websecure" ]; + rule = "Host(`registry.gwg313.xyz`)"; + service = "registry_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + ci = { + entryPoints = [ "websecure" ]; + rule = "Host(`ci.gwg313.xyz`)"; + service = "ci_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + s3 = { + entryPoints = [ "websecure" ]; + rule = "Host(`s3.gwg313.xyz`)"; + service = "s3_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + s3_console = { + entryPoints = [ "websecure" ]; + rule = "Host(`s3-console.gwg313.xyz`)"; + service = "s3_console_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + uptime = { + entryPoints = [ "websecure" ]; + rule = "Host(`uptime.gwg313.xyz`)"; + service = "uptime_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + }; + }; + }; + }; +} diff --git a/hosts/waypoint/routes_local.nix b/hosts/waypoint/routes_local.nix new file mode 100644 index 0000000..c852bd7 --- /dev/null +++ b/hosts/waypoint/routes_local.nix @@ -0,0 +1,92 @@ +{ + imports = [ + ./services.nix + ]; + services.traefik = { + dynamicConfigOptions = { + http = { + routers = { + + arcocd_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`argocd.local.gwg313.xyz`)"; + service = "argocd_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + music_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`music.local.gwg313.xyz`)"; + service = "music_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + pinchflat_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`pinchflat.local.gwg313.xyz`)"; + service = "pinchflat_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + proxmox_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`proxmox.local.gwg313.xyz`)"; + service = "proxmox_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + recipes_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`recipes.local.gwg313.xyz`)"; + service = "recipes_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + audiobooks_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`audiobooks.local.gwg313.xyz`)"; + service = "audiobooks_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + scholarsome_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`scholarsome.local.gwg313.xyz`)"; + service = "scholarsome_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + privatebin_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`pastebin.local.gwg313.xyz`)"; + service = "pastebin_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + snippets_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`snippets.local.gwg313.xyz`)"; + service = "snippets_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + git_local = { + entryPoints = [ "websecure" ]; + rule = "Host(`git.local.gwg313.xyz`)"; + service = "git_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + }; + }; + }; + }; + +} diff --git a/hosts/waypoint/routes_zerotier.nix b/hosts/waypoint/routes_zerotier.nix new file mode 100644 index 0000000..ea52c68 --- /dev/null +++ b/hosts/waypoint/routes_zerotier.nix @@ -0,0 +1,122 @@ +{ + imports = [ + ./services.nix + ]; + services.traefik = { + dynamicConfigOptions = { + http = { + routers = { + music_zerotier = { + entryPoints = [ "websecure" ]; + rule = "Host(`music.zerotier.gwg313.xyz`)"; + service = "music_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + recipes_zerotier = { + entryPoints = [ "websecure" ]; + rule = "Host(`recipes.zerotier.gwg313.xyz`)"; + service = "recipes_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + audiobooks_zerotier = { + entryPoints = [ "websecure" ]; + rule = "Host(`audiobooks.zerotier.gwg313.xyz`)"; + service = "audiobooks_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + scholarsome_zerotier = { + entryPoints = [ "websecure" ]; + rule = "Host(`scholarsome.zerotier.gwg313.xyz`)"; + service = "scholarsome_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + bookmarks_zerotier = { + entryPoints = [ "websecure" ]; + rule = "Host(`bookmarks.zerotier.gwg313.xyz`)"; + service = "bookmarks_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + pastebin_zerotier = { + entryPoints = [ "websecure" ]; + rule = "Host(`pastebin.zerotier.gwg313.xyz`)"; + service = "pastebin_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + snippets_zerotier = { + entryPoints = [ "websecure" ]; + rule = "Host(`snippets.zerotier.gwg313.xyz`)"; + service = "snippets_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + git_zerotier = { + entryPoints = [ "websecure" ]; + rule = "Host(`git.zerotier.gwg313.xyz`)"; + service = "git_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + git_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`git.zerotier.gwg313.xyz`)"; + service = "git_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + ci_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`ci.zerotier.gwg313.xyz`)"; + service = "ci_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + registry_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`registry.zerotier.gwg313.xyz`)"; + service = "registry_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + s3_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`s3.zerotier.gwg313.xyz`)"; + service = "s3_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + s3_console_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`s3-console.zerotier.gwg313.xyz`)"; + service = "s3_console_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + + uptime_zt = { + entryPoints = [ "websecure" ]; + rule = "Host(`uptime.zerotier.gwg313.xyz`)"; + service = "uptime_local"; + tls.certResolver = "le"; + middlewares = [ "headers" ]; + }; + }; + }; + }; + }; +} diff --git a/hosts/waypoint/services.nix b/hosts/waypoint/services.nix new file mode 100644 index 0000000..48975ff --- /dev/null +++ b/hosts/waypoint/services.nix @@ -0,0 +1,102 @@ +{ + services.traefik = { + dynamicConfigOptions = { + http = { + services = { + argocd_local.loadBalancer.servers = [ + { + url = "https://10.1.10.3:30007"; + } + ]; + music_local.loadBalancer.servers = [ + { + url = "https://music.gwg313.xyz"; + } + ]; + + pinchflat_local.loadBalancer.servers = [ + { + url = "http://10.1.10.3:30001"; + } + ]; + + proxmox_local.loadBalancer.servers = [ + { + url = "https://10.1.10.2:8006"; + } + ]; + + recipes_local.loadBalancer.servers = [ + { + url = "http://10.1.10.3:30000"; + } + ]; + + audiobooks_local.loadBalancer.servers = [ + { + url = "https://audiobooks.gwg313.xyz"; + } + ]; + + scholarsome_local.loadBalancer.servers = [ + { + url = "http://10.1.10.3:30123"; + } + ]; + + bookmarks_local.loadBalancer.servers = [ + { + url = "http://10.1.10.3:30099"; + } + ]; + + pastebin_local.loadBalancer.servers = [ + { + url = "http://10.1.10.3:32090"; + } + ]; + snippets_local.loadBalancer.servers = [ + { + url = "http://10.1.10.3:31111"; + } + ]; + git_local.loadBalancer.servers = [ + { + url = "https://git.gwg313.xyz"; + } + ]; + + registry_local.loadBalancer.servers = [ + { + url = "https://registry.gwg313.xyz"; + } + ]; + + ci_local.loadBalancer.servers = [ + { + url = "https://ci.gwg313.xyz"; + } + ]; + + s3_local.loadBalancer.servers = [ + { + url = "https://s3.gwg313.xyz"; + } + ]; + + s3_console_local.loadBalancer.servers = [ + { + url = "https://s3-console.gwg313.xyz"; + } + ]; + + uptime_local.loadBalancer.servers = [ + { + url = "https://uptime.gwg313.xyz"; + } + ]; + }; + }; + }; + }; +} diff --git a/hosts/waypoint/traefik.nix b/hosts/waypoint/traefik.nix new file mode 100644 index 0000000..292f087 --- /dev/null +++ b/hosts/waypoint/traefik.nix @@ -0,0 +1,115 @@ +# Traefik +{ config, ... }: +{ + imports = [ + ./routes_local.nix + ./routes_zerotier.nix + ./routes.nix + ../../common/networking/hosts.nix + ]; + sops.secrets.cf-api-token = { + mode = "0440"; + owner = config.users.users.traefik.name; + group = config.users.users.traefik.group; + }; + + systemd.services.traefik.environment = { + CF_DNS_API_TOKEN_FILE = "${config.sops.secrets.cf-api-token.path}"; + }; + + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; + + services.traefik = { + enable = true; + staticConfigOptions = { + serversTransport = { + insecureSkipVerify = true; + }; + entryPoints = { + web = { + address = ":80"; + http = { + redirections = { + entryPoint = { + to = "websecure"; + scheme = "https"; + }; + }; + }; + }; + websecure = { + address = ":443"; + http = { + tls = { + options = "default"; + }; + }; + }; + }; + api = { + dashboard = true; + }; + certificatesResolvers = { + le = { + acme = { + email = "glen.goodwin@protonmail.com"; + storage = "/var/lib/traefik/acme.json"; + dnsChallenge = { + provider = "cloudflare"; + resolvers = [ "1.1.1.1:53" ]; + }; + }; + }; + }; + }; + dynamicConfigOptions = { + http = { + routers = { + dashboard = { + rule = "Host(`monitor.local.gwg313.xyz`)"; + service = "api@internal"; + middlewares = [ + # "auth" + "headers" + ]; + entrypoints = [ "websecure" ]; + tls = { + certResolver = "le"; + }; + }; + }; + middlewares = { + headers = { + headers = { + browserxssfilter = true; + contenttypenosniff = true; + customframeoptionsvalue = "SAMEORIGIN"; + forcestsheader = true; + framedeny = true; + sslhost = "gwg313.xyz"; + sslredirect = true; + stsincludesubdomains = true; + stspreload = true; + stsseconds = "315360000"; + }; + }; + }; + }; + tls = { + options = { + default = { + minVersion = "VersionTLS13"; + sniStrict = true; + curvePreferences = [ + "CurveP521" + "CurveP384" + ]; + }; + }; + }; + }; + }; +} diff --git a/hosts/waypoint/zerotier.nix b/hosts/waypoint/zerotier.nix new file mode 100644 index 0000000..061d05d --- /dev/null +++ b/hosts/waypoint/zerotier.nix @@ -0,0 +1,9 @@ +{ inputs, ... }: +{ + services.zerotierone = { + joinNetworks = [ + inputs.secrets.zerotier.infra + ]; + enable = true; + }; +} diff --git a/metallb/Chart.yaml b/metallb/Chart.yaml deleted file mode 100644 index 4113c40..0000000 --- a/metallb/Chart.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v2 -name: metallb -version: 0.1.0 -dependencies: - - name: metallb - version: 0.13.12 - repository: https://metallb.github.io/metallb diff --git a/metallb/config/ipaddresspool.yaml b/metallb/config/ipaddresspool.yaml deleted file mode 100644 index bad9f9f..0000000 --- a/metallb/config/ipaddresspool.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: metallb.io/v1beta1 -kind: IPAddressPool -metadata: - name: default - namespace: metallb-system -spec: - addresses: - - 10.1.10.50-10.1.10.100 diff --git a/metallb/config/kustomization.yaml b/metallb/config/kustomization.yaml deleted file mode 100644 index 39e1e1d..0000000 --- a/metallb/config/kustomization.yaml +++ /dev/null @@ -1,3 +0,0 @@ -resources: - - ipaddresspool.yaml - - l2advertisement.yaml diff --git a/metallb/config/l2advertisement.yaml b/metallb/config/l2advertisement.yaml deleted file mode 100644 index 6e56328..0000000 --- a/metallb/config/l2advertisement.yaml +++ /dev/null @@ -1,5 +0,0 @@ -apiVersion: metallb.io/v1beta1 -kind: L2Advertisement -metadata: - name: default - namespace: metallb-system diff --git a/metallb/namespace.yaml b/metallb/namespace.yaml deleted file mode 100644 index fe6f1d8..0000000 --- a/metallb/namespace.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: metallb-system diff --git a/metallb/values.yaml b/metallb/values.yaml deleted file mode 100644 index 85a0c56..0000000 --- a/metallb/values.yaml +++ /dev/null @@ -1,46 +0,0 @@ -metallb: - controller: - enabled: true - speaker: - enabled: true - hostNetwork: true - podAnnotations: - sidecar.istio.io/inject: "false" - tolerations: - - operator: Exists - securityContext: - allowPrivilegeEscalation: false - privileged: false - capabilities: - drop: ["ALL"] - # keep FRR disabled – GoBGP mode works fine and avoids NET_ADMIN - frr: - enabled: false - configInline: - peers: - - peer-address: 10.1.10.1 # OPNsense LAN IP - peer-asn: 65551 # ASN you set on OPNsense - my-asn: 64512 # <<< MUST MATCH “Remote AS” on OPNsense - hold-time: 90s - source-address: 10.1.10.3 # Talos node IP (optional but fine) - - peer-address: 10.1.10.1 # OPNsense LAN IP - peer-asn: 65551 # ASN you set on OPNsense - my-asn: 64512 # <<< MUST MATCH “Remote AS” on OPNsense - hold-time: 90s - source-address: 10.1.10.4 # Talos node IP (optional but fine) - - peer-address: 10.1.10.1 # OPNsense LAN IP - peer-asn: 65551 # ASN you set on OPNsense - my-asn: 64512 # <<< MUST MATCH “Remote AS” on OPNsense - hold-time: 90s - source-address: 10.1.10.5 # Talos node IP (optional but fine) - - peer-address: 10.1.10.1 # OPNsense LAN IP - peer-asn: 65551 # ASN you set on OPNsense - my-asn: 64512 # <<< MUST MATCH “Remote AS” on OPNsense - hold-time: 90s - source-address: 10.1.10.6 # Talos node IP (optional but fine) - # router-id optional – can omit or make unique per node - address-pools: - - name: default - protocol: bgp - addresses: - - 10.1.10.50-10.1.10.100 diff --git a/minio/certificate.yaml b/minio/certificate.yaml deleted file mode 100644 index c96d7bf..0000000 --- a/minio/certificate.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: minio-cert - namespace: istio-system -spec: - secretName: minio-cert - issuerRef: - name: letsencrypt-dns - kind: ClusterIssuer - dnsNames: - - s3.gwg313.xyz - - s3-console.gwg313.xyz diff --git a/minio/gateway.yaml b/minio/gateway.yaml deleted file mode 100644 index 912e8f2..0000000 --- a/minio/gateway.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: Gateway -metadata: - name: minio-gateway - namespace: minio -spec: - selector: - istio: gateway - servers: - - port: - number: 443 - name: minio-api - protocol: HTTPS - hosts: - - s3.gwg313.xyz - tls: - mode: SIMPLE - credentialName: minio-cert - - port: - number: 443 - name: minio-console - protocol: HTTPS - hosts: - - s3-console.gwg313.xyz - tls: - mode: SIMPLE - credentialName: minio-cert diff --git a/minio/minio-secrets-sealed.yaml b/minio/minio-secrets-sealed.yaml deleted file mode 100644 index db7b22c..0000000 --- a/minio/minio-secrets-sealed.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - creationTimestamp: null - name: minio-auth - namespace: minio -spec: - encryptedData: - root-password: AgCvWTrmBHyov/pb/N4PoK20fwAoH1zDh+MFUGqA60QYiXYLTMMax5fjbOd4NafbpFo18NKen0dEKuJGec2NrHTMq7oM+46+PnzrSIuw1If1PHeU5vi0tYSZSI6EeiwUOlz5HZUV19X4y/eHkFFTGjqxaIRRaelCFFwIFwRh17WgBrm2IfR5GUka9HFYPYYrDpXqlbSxV6en1UPOkzyLUqvS6QbdV5XP0Lb9Yd/3wybpIMtkLloMDQ4r8svYQCHlAHmpLDDQHr76060I5hSf4G7Sf7OtQL/ajfyXjPOHLpBNZjEhRGXkevaiBS75JqeJEBnJ2R1UmaA6sjU5kgcPy0ZsgcznI4Gga4e5lfOKIZz0P85WW6oZZKtKQ4HbZ2+nbrlgleYeWB1CqaqWyonK7GLMG8HpSwVEtUwKZD5AOs0IOC83jjDFfWcJbEsbkjIwN+LQzCzW2+3fkeJTZ/6oybIYXBjKfek9+l99oPhkGuqY0QTh7beFfo7EMqLP1kPiqKaMkYyVtL2l78hDtp0D+6urgF31c5bjUjs5wpWFxnmGwkj9prAjn5gqHetHT7jcob0Gj08wnRip7/gL17VwS++1e6DkInvWatU8I/R29VxEPV9GzsXHQmRCJp64am9VaNuFa13Ot5OgImrt4/zrDSz7ERazTuWeq3hE5swwMFRudW+d04PX7Hc2ypSSnNThhq1GGhRsnmNmN5YK0TcdqBhXvoj6/EXiBCrZ - root-user: AgC2+0bGtunOwD/FrXYlsVaAFguyzSkjikinYoAy8tUjskZQmiCukls/938JMdI0ZAFl9XEmAaEizDcyGBjxso+hxRO4A33WUoPyMx+2/JBCVNiCxtlszNk6c2+eIJ2khRE3JtY7lNPUcVJiJr7t9zLeVfzBeyBEO2STmLZcuqw1b55KuadMxbjkK6Zt+yH0sQsu6jtrfM0oo+dBHETI/1xIxq9kwn75fkAfHDU4Tz0bQ1HILr226Eo1NRHtLN5S+Thi0fDnhVSHTMPr1khr39eu9jQDegiKXl98Ps3iodM4cSb9ic+hn7bCsMBcM4Y+X9ZEBeAS/8S97Vi/1izuHDhK3a3gZYznl/8nor38GkuWx/c3oocy7fkFGe0dmvk4y+aXUal32su3gnG8mLK5GwCMoAE+CKh0skN/boXLYOahPAfNLTBpP4UJBP6sgf+oKktWMTgJ1NJuvIoEFZM+s6eo/8hbG+x9+ACKaco80UT1dd545eEppMVfjh05Z3fzWi0Ro096tw/qQZp+Me3MyWgX1KiLUxykhE80brZ7+NUVm/USpoHGY/jogHiF11mV/7hL2cKea/Tuz+BRXh9CgPGb4MYr+O5lGewEAmlJAFOjWqmVNG6eezvzJKug/uzXKNNblEYnVNXYYJanQFLQtDrXMvz18fULoT7EiV1THvV9bUOtxu5v5IF8eK7F+Vqma5itjUBq5t0= - template: - metadata: - creationTimestamp: null - name: minio-auth - namespace: minio diff --git a/minio/secrets-sealed.yaml b/minio/secrets-sealed.yaml deleted file mode 100644 index 2c373f1..0000000 --- a/minio/secrets-sealed.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - creationTimestamp: null - name: minio-iscsi-auth - namespace: minio -spec: - encryptedData: - discovery.sendtargets.auth.password: AgBmscqh2S8TPLgLJn+Wigsd0OAgPE4fHB9Me5dX6BTClvssIjg/fJJk0dFa3mxUcf44D6BkLpa6kquFHhYx7Ga7gNDB0SpLpL63jt8UVusEutE2+onTTh4saWGeQAmJHjdKvdWqdRFWSn+P1BWt6KqRAar+pPESCy010ZFC6Do/EJmxlKcwp2R/wlMg3VPOA25aHWwr8xjXgGIiAX3fHp8A5IWa3beqE26OfK1QixlVJUs4kr+VIIPLbyu8SlidcRNk0f7J5t+A6xwQTshjz3+BZiuvqU1vAfeVCbjtm0kTCohLlVTOw+TCCy28hd1rYdjUL1WNDy5+Z8AZdMyvQacwvuoygOZY2gQiuiA4dll51DIx3F+On43lAxg+UEMI2g8/Lk5G74+tHTm0xJ/UPVAg7aaru9j7XEoOtGuj1BvlFoQ04KDBynbMe9SRdkn7bC+ankKvs6tb9vaRGj8XNldd1zxWP3NX7cwEo4t2tvWJNtg9OKFrNRgajFNo/35N7NH0swtpLDLAOCGp4oQTvTEf74zniP5zaV9V7feO3F/t9Ha+N0PA/JdftQ++EHHnlI/eTRhJtH35vRHM1BYeVcNsrQMUIi7G3hx3Vwpu5iXNciMCFs3YDxwyYG6g4wSr1XLWT/zZW4R1jDx4ldYmGajF8f8lEAe5h/dilk44VVMsTAop5BXhlJykfEgCqf77hXIK8SQLpcWUvsgbaqeu/zGT - discovery.sendtargets.auth.username: AgBg+3rIcTT0tA479+DLobTdxmUZAkVfhcaweZlX5b8K4zRZFWuxFvZoVdJkL5O7dDR0F9lqp8MTdqWHyJ9uq5D/ei3cJb1CRHte5/Q7EkkcS1brMFP6sub+VXhDHMVZ8T4rC8XxdSZcGjyG3AH1wyqxNZ+C3vF7/Ngy6xBrukaS+6l9lwY/g4n7Q2+Up9i7s1nroBUM/nSgLCL5sVhvhgZ31r2aMxx8bXJT5/9JfAZL73hhInISCD8rjir0wj7mAFnrjfKxaNh2sEOZhXOyKPcgGk+ovDBeySZSF9mclV8iHXoHr/museX34oyvQejkkMGthMmL52PhZbXIlXwwIuf5n9bnPmMtPRQ/aovPHzmQDI+ks7ft4WfLnlX1Y16eQ/LVjT0ZD/0X7n4CE57utUAhdlVraxrFtr3YoPKsdLYfz/We3RGpeLWiW7JMYnmkc9j9XMHBwx91y0Ba3ssj9KSijtPVOzRqct3NoBJ+s1FpjbljIPS8iQKUYdHcSIhVjYIAebLMctZyxVG/cW1KbSPEeOo6MQ1drOFsvXOfUeYn0PiGcSmRWuJ8CJZxh+Y2YKUDf0eqJQCs8SlDucVcYvvjYM06tZXoGR6XuGqUnbzxguzTX6dbzR8mpfniAiQkIBkBVezdOvqh3OiOPfhFkVEX6V47UnZhfe9IA5RR9NehuUw9OVIZ6FGz1Adu1EeFJ6c0ikCSUg== - node.session.auth.password: AgCgA17eF7kgdTYGuBJ12HtWAdwQKluvmirOCpPWjIiGU7YHGfEQxIS3MEmuI7/Z0oNB/SYgqZwnS56AZ8OUEf6L90uYhfkN8VV79QJxZlk4EXSgu6EfiKjoYU0uwQSnqDVSOYG9VxEro+tgeYj4hpqag9MIfULX6kTbDll2bcuq/eXDl4QijNveU+wqMzRz5t/c7MSdcacJO9l3DvXvnZEUpKydw9TKyPBGyFB5Lsjlf9Lkxf8+kqScS7eC849LrDAUiFMktOrwKsK4gk7JX7Dvuc8n9iDOjGPjgv/mz1xOP9mEnQqpP7d9JIR7WLubl+MPeXwpTA4cR2/VA6TWV86hbmCuYGckPX80+DEW26jAHxmaSIk3U4ZOY11eiYGieTr7Irlx4L7TFukwB8g9Cf8io6pQJU2wA9vflF4s/yZOXiAqP4sit1qd4Z0/DR5n/7DbhOs0qKOHbiUTujmw36ewmfJ8IDxq6WzomjuJz2ezaVTVkdSXDcchyCg3yVutjqaAw+O1XNJdgtoAZXhh0dr6hiTLy1oi3nKyVy/EYn3mxZg8S/ixLyS3a6XcoAqsfpdXf2tirfrMG5OACZgLoi3+cYthgrpi1rrbIR23MSFuvAcDUjLKYiFbq2BJJUpuACeio2VMrgCC/Cb5xXS4Rprg4wUEz0wAB5vUH2NrkDTqMTofEw3EdhB5SfjLu5+HlBmasmlwgbyhmrSr0V609fog - node.session.auth.username: AgAUXhbc4OXDg1DgbJeJ3Q6ANfa6SKyQshDJeutnrHFJ8g5Ne59OzkMrbEafDEp+BmPtLA9gV/wYhieMWgsdtKQiYiEsBqqOwT4K/bxV0zTo1wUG5yfwC7QSPYssdOKTcDHix0sHB+V4e8n1HO8Y6gfZaqkrK65WairLtMWLF0fmCYZ7peMa8FGu94n0uDL1iglXdnp9CphFjMeaghHRDNUsvWKXnlP4wa+VsY3NQqGqiulfhRhFUyjCtR496VztD+JMtUdh4wp0xN0HRZxkTAfC0xcVuXBnTZgDv7OQ8lb1EOqjMmVaI9Xd9+JA1HYEwqSizkzP6EnOhQZgBviJfjYiLLqwZTqpIaaOtaQ0QO+ws65smG8TlRMfzsiW0NfpzwY3E3ZSUewp0Lq6wnKdB/7DeLQKbLJ2mUV/Xes1AHjJAcCgdVoVmNooepKTe9r6Ysvdab1UelYjbsgJB178Yohlhe0zAGNiBGjDwc9Y87ZzL8KTySiihl0u6/HIEJKYAhrivAXLDu/rwtFBGvpM0VjyOs3/2OhUIJ/a2ln8+xPXfqeGeAXzXmU4tRwoeS9df95gxyFnV+SrYT3Vv64CQvCbfnYtG+mlPznxiwRAdYBcjOuHm1GmfbeD0jgJeIMpLl91eg70pVa3RNYagA67bclF0ImXQQd7MFF2plUyH5DAq2yMxmVBs9Jx+7Adr60VomzVLr5ymw== - template: - metadata: - creationTimestamp: null - name: minio-iscsi-auth - namespace: minio - type: kubernetes.io/iscsi-chap diff --git a/minio/storage.yaml b/minio/storage.yaml deleted file mode 100644 index b43c309..0000000 --- a/minio/storage.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: minio-pv -spec: - capacity: - storage: 100Gi - accessModes: - - ReadWriteOnce - volumeMode: Filesystem - persistentVolumeReclaimPolicy: Retain - storageClassName: minio-iscsi - iscsi: - targetPortal: truenas.local.gwg313.xyz - iqn: iqn.2005-10.org.freenas.ctl:minio - lun: 0 - fsType: ext4 - readOnly: false - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: minio-iscsi-auth - namespace: minio ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: minio-data - namespace: minio -spec: - accessModes: - - ReadWriteOnce - volumeMode: Filesystem - resources: - requests: - storage: 100Gi - volumeName: minio-pv - storageClassName: minio-iscsi diff --git a/minio/virtualservice.yaml b/minio/virtualservice.yaml deleted file mode 100644 index 638a2c2..0000000 --- a/minio/virtualservice.yaml +++ /dev/null @@ -1,39 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: VirtualService -metadata: - name: minio-console - namespace: minio -spec: - hosts: - - s3-console.gwg313.xyz - gateways: - - minio-gateway - http: - - match: - - uri: - prefix: / - route: - - destination: - host: minio-console - port: - number: 9090 ---- -apiVersion: networking.istio.io/v1beta1 -kind: VirtualService -metadata: - name: minio-api - namespace: minio -spec: - hosts: - - s3.gwg313.xyz - gateways: - - minio-gateway - http: - - match: - - uri: - prefix: / - route: - - destination: - host: minio - port: - number: 9000 diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix new file mode 100644 index 0000000..45aae31 --- /dev/null +++ b/modules/home-manager/default.nix @@ -0,0 +1,6 @@ +# Add your reusable home-manager modules to this directory, on their own file (https://nixos.wiki/wiki/Module). +# These should be stuff you would like to share with others, not your personal configurations. +{ + # List your module files here + # my-module = import ./my-module.nix; +} diff --git a/modules/nixos/default.nix b/modules/nixos/default.nix new file mode 100644 index 0000000..8605069 --- /dev/null +++ b/modules/nixos/default.nix @@ -0,0 +1,6 @@ +# Add your reusable NixOS modules to this directory, on their own file (https://nixos.wiki/wiki/Module). +# These should be stuff you would like to share with others, not your personal configurations. +{ + # List your module files here + # my-module = import ./my-module.nix; +} diff --git a/navidrome/certificate.yaml b/navidrome/certificate.yaml deleted file mode 100644 index f320278..0000000 --- a/navidrome/certificate.yaml +++ /dev/null @@ -1,15 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: navidrome-cert - namespace: istio-system -spec: - secretName: navidrome-cert - issuerRef: - name: letsencrypt-dns - kind: ClusterIssuer - # commonName: music.local.gwg313.xyz - dnsNames: - - music.local.gwg313.xyz - - music.gwg313.xyz - - music.zerotier.gwg313.xyz diff --git a/navidrome/configmap.yaml b/navidrome/configmap.yaml deleted file mode 100644 index 4d98e21..0000000 --- a/navidrome/configmap.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: navidrome-config - namespace: navidrome -data: - ND_SCANSCHEDULE: "1h" - ND_LOGLEVEL: "info" - ND_SESSIONTIMEOUT: "24h" - ND_BASEURL: "" - ND_DEVACTIVITYPANEL: "false" diff --git a/navidrome/deployment.yaml b/navidrome/deployment.yaml deleted file mode 100644 index a2abd50..0000000 --- a/navidrome/deployment.yaml +++ /dev/null @@ -1,38 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: navidrome - namespace: navidrome -spec: - replicas: 1 - selector: - matchLabels: - app: navidrome - template: - metadata: - labels: - app: navidrome - spec: - containers: - - name: navidrome - image: deluan/navidrome:latest - ports: - - containerPort: 4533 - envFrom: - - configMapRef: - name: navidrome-config - - secretRef: - name: navidrome-secrets - volumeMounts: - - mountPath: /data - name: navidrome-data - - mountPath: /music - name: navidrome-music - readOnly: true - volumes: - - name: navidrome-data - persistentVolumeClaim: - claimName: navidrome-data - - name: navidrome-music - persistentVolumeClaim: - claimName: navidrome-music diff --git a/navidrome/gateway.yaml b/navidrome/gateway.yaml deleted file mode 100644 index 03f70c9..0000000 --- a/navidrome/gateway.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: Gateway -metadata: - name: music-gateway -spec: - selector: - istio: gateway - servers: - - port: - number: 443 - name: https - protocol: HTTPS - tls: - mode: SIMPLE - credentialName: navidrome-cert - hosts: - - music.local.gwg313.xyz - - music.gwg313.xyz - - music.zerotier.gwg313.xyz diff --git a/navidrome/iscsi-secret.yaml b/navidrome/iscsi-secret.yaml deleted file mode 100644 index 5bdc774..0000000 --- a/navidrome/iscsi-secret.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - creationTimestamp: null - name: navidrome-iscsi-auth - namespace: navidrome -spec: - encryptedData: - discovery.sendtargets.auth.password: AgCfQP4VjeYYMuHZn5ZOVrs3C9vm+kF0qiWfT1wTixwvvNA5I9mDFA7F2cR/SIT6NvDLpLVMaFku7tf88aJCjlQvhEoEJbeSEurLCfJcXDaQwFKaTeELrz6l1NbyusXlijblpLQYkupxl7ZNraY3mWJSAoBD0OdpQfP56+8NcoOHHEDDdBwYza/VkBdlYOYCFWtPCosbw+wjtLgSIRkiNbrWXEN0MkBAo9OWczvB0GKGyk5divHM8iDFTON34Rk1HMv41o3tvgHa7RvXFC8LJ3GB0NyFeawyrcQF7C3i+8P50zGmzUs3ie1il//8ICzkp+0zJk4hOG+9KBIu9sDInjjVhhwHcCZspvmuKOOqg9F2mjK8a6VGURoKdvxFX2HahqAB/FjFTp5diKKZQY+zfkd7mJ3OnPqhB9fIKmZnxWwtUq8AYI2jcDdERI4FeTrmkbcxAhMCgI7cCYStwDD11dQt4XRqWOeA3trOHubyslPjvjEkIDvoVj2BNHtFIwSNX16gAMs5HsRZnoo1SUc57+IRPH0v/ZaSfJXeE6Lrv2H7ZTSlHEusKkTAvAnVKAQyJmRTYCOMdYPePr169NUEhsAqWVmizjxN34VPiK7Y6kkwgGiQJpXZHHj1QxUQ63P4O4iuvYPEx40gCtR8cXBMesPE6XkH5udxmQ/zAHjjJSyodJgM6v2IO++0gYZb06AZjDPtqgp3sqrHnzlcNRh78oBz - discovery.sendtargets.auth.username: AgAY/IEE3LVt8co+pMWEppPD9RC2JnmL/qbFrZ5PKZc3XA33wrtzHGBoELDwWG4Lfc5Itg1Zr0t/Sh8aLNLGlgfa8Zd4KBmu6mi+sHnh4LKKEIEE3pMuyNUC6k4jWDz22XihEy9Qfs3fr4qOrDvn9OxzVSTogLQvvn2bG1jBauRawekN3bwln7B5eY2PVwYTxjdgDBIVe2DdJYoKquK2siFszXJzM9m+IpE7S1M5s1pzs6GdYH3qBiBoWnJ5vVZzx1h7O2Z+5yVrxC1T11gDsal6mOsqSP7XNerIy0G3/NcE/RkWPz0+/wqlWTv8kulnKYnKuG+m1lttnBLr7oc6xqRNQmcFlui+0R/FS0slDvoM52KU7ZBg9YSXoMjZsQziYVF8to2wxCNAvkNpATdsgqTfbj/ydUHNrXmtBgyVWyOmmJZYHw4rUIWqlgwOkEK1arsiHPWLbOEqY+MZAyqWO9s+/iTVhGckTwDACTavhWthEhZAaaW/mr42uDTQAapjnQ8/AYixuwK8pnL20j/89xNXdCIKiSPSx0i5F4vIv7jLRCuLSmyuhMk8yOrSFOMUnk2FHxdFrLMsP9q5L3+ZSU5pVe/pJJtYSM56TIg5sGKE4l8gEm+3aEVKQMhA1urzfEe8Gz1xxpd1qnViEWegaoAEqbfmDBGmnofxkpk6xK/27Y+DKWNtNpQTZ1Ss768sb6hsI1aidC/BcIo= - node.session.auth.password: AgCaw7xjK13WWHje8KBCyk9KJVvGsbwnZHcQZjl1OQlqpyPx2MuYt41z2jnReAieFwFJ0EUR0AcHWWVS1llrUl0v4URGLmFSX372s+Z1rZ0J/agFGgAIHwu+ksXRhG2rLtUk4YJ0RBJUaWOcIpFrHk3oGnUU55Nw1v5GtiYbgRTBehMkON6TXQt3PA0WLmVHxEoDoKy9kzQL643VnQ+jTiuFFcmmjVVAF+a+xEAwV0os6FgrO1okej2ucBTrNAmbFUl9dhzGidA50asSZimplrlRY8y1b2R9LUQOYZ/U4PgTsG9dAfM3wSjfhcWFlQ3D4pf4Y/pchUe0OkkFTLXnXCcY0MhdpMtDDWRU6JoBNkDsa4g36gzEL2s+dCcWa+ltA8XPdI1vpbOaFpZn1TZTgk00JQnnePOsL1bTObNY1Eh0Yl7g1zb2SgUzg7zp4C2rOz/0q9I4ftuNgMtAPtD+fbf53vxCOc6hHvEdCZN03uvbsGp2drF7R7xHOXbWNvJtXi1kCO/ddVP6hxKOLbg/5Ag07gf9p1scm+nDhsBvVaTJTI6Oc66MggAsHRkQVvdM6XJlmINVCIKPoqygXCkZwXrIJUXin6MTV3OTqIC/FdKUE4Or0hhQM4Gw6Dg3FE+zAENdPPQeEs6A7+KQbMw0NDA0WoyXDbOobEHpOU5IUcigycjklO/58sYOrQX7z8JlxyibtRunPHhiL7fBWi7p2PSG - node.session.auth.username: AgBGQxzefQTAt3/7O+1bqbt6XlqehG0Obc3+GH5V4dgDyZMcPGgq74Beh07j8ahe9i4T+tXY4DylnTaBoVBSrOW62ipwVYmiyxWRbQ7TJ0m4dcAJOddDFED2pmQ91S0xneIrHx7N8SZgXf2Gh9xabOrkqcTHx0n0KXjuQvrDO6DcckSdnvptS3PNniK9DogY1cOInHZdAX341wXY93U4DyQb1JsoKi3QvxjVGBlmPft9GiAfWTBj9Hj9q+AA6pymH69j7xhkUiv7b6XCgYdjOqE0D1/4hIMvJR7qybGYrwUbVv/xvfLcIKJFsAMkigi2VQaTvn4E+4MkmukM+FBDfuoJ64asvYlu8quJ5KwD/OHL8toYthjs/g3aq/EQBCn1hc3JNPq6ZZ52rfRKiPcjHKOdoFkPy8yXg6nb3HSqDlUv3i01CbQ841hQhJgFfnbqDYvI3xYH0ubXKiJsGlTbZVV8iDOiJJIPRiRKL9tt4PzR2J3GCnR4ZZVYYHWkE1wIYheLwklxBkKmg2lktc0MzBfCtbcCewmcfZ9bnQFy0TT9Bvzr5EA8UbYDVEiw7eqNiK8u//iwNPZvHyMXo0lKDQ0O8YuznUrZZ0g+RHALKwDPpYqhXvu5ARh3SnSkvonZ2STVDMJgeM4/p0Q2fKomfrzwJrzHth3ipR/9gScdInMvtrudcBpVhgULxsc9UxbwnW708N6kN5lo7fo= - template: - metadata: - creationTimestamp: null - name: navidrome-iscsi-auth - namespace: navidrome - type: kubernetes.io/iscsi-chap diff --git a/navidrome/navidrome-secrets.yaml b/navidrome/navidrome-secrets.yaml deleted file mode 100644 index 565ea8a..0000000 --- a/navidrome/navidrome-secrets.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - creationTimestamp: null - name: navidrome-secrets - namespace: navidrome -spec: - encryptedData: - ND_LASTFM_APIKEY: AgBtbBJ+dQ30vpgr5lU6e94qa4wsxBHrs6zuD/HjC8SB5eqFk5u6FT6/7SPvKbrSxllFkOrpeUJpvmQvstEO1pqCil54gwxTmtq5eMpqee9wASbGSPOlGGOz6BT+38HX60x2A8jXmg7AnZWm5gTdjS2k3UxzIfNW/6jrNx2X+sZer2gH5ck1cISbZli68oDYgyYQ5sJYTiTSoBBJFjICZHzep2pKEaUV+4sp+PHmeBseXEajUJ3XcxEOPORr0AQX+uyqb0jYQQBMk9/EmSIisaCR2Xn4/bH0YioosSGSsPkQzT1E6fdeDuaiwjtf2Vt/0FmtBvkT2KeEqQIVbRL5AEjjgP33hmVD+PvBYm6TS1VlE8MpP/gHfQtNASw8PO5txroPdtlRCI3DgmmEMw1knoJcTQ0LNxPBit0IlBEiN8sVlXe5jWxBD0NrywZdufYrgvl7bxtcV32nGYj6ux+aaK/GS41rIvfHdh2mDyAXNWGXQbl+VPTzH5jBhvGZqlqhmVsbL8EA8nuG3sP4/AfWINUO8M4ru50lOUR1yr7XjFxO/I8LWch3qExQ9MRyjKbfphm/ge/9rdVNTN9aeE190LCrGiDI41OITEPq27pl3UavoYM2e6TEf1j8qLgZRmZb+cdf5qbE5uOyig1nlclRGX8eUwQTJWMrJaLJnSLidLHiRL8yHSRvnH9tWa10HMUe/KmTkusAvdfxiMdfOsgyA8HwyXKPljrg/MDOzu+PSsYa+w== - ND_LASTFM_SECRET: AgCa1zBHgJ7H5yRJqK6HE0c/x7mxS0PlENPJ6gryJyciqezSznr0ONAVDAtvVkWvbZrhpvTcI1SPaiqRUIF8x+7kWTYROnnCXlphoX8zMFCaw+LZxv4mC6GI4q9ciUZTRvCMKKlzTVbJIYcUaPh8zH4F0MlyWyWhpTLamkkLiPst+uArxqTw40qtqLpA9rZoshSlIXq84eeZmUuyMEhGXRspjwI7HINAaF3TfsSsuuHsqsKjbY2atwfOmeyddWh2GT1r1OtjchOq43thHHLqXH3KkKhprUK0m0b9unna9wO8Q274CeXpXME0+/qH3A14nmsYtFeyPRTuBM3iHoHR4gMaSIPcm6xZNYxSkEKglxWJztOJ6JvSsepgd37RQpDmzaZe67/9gJKTHL3pe+Id7+TQVeWqCUMQFywYE3VqJdGJWF60jc28pkCQPnbuUNgsfQySY+s65RwEqfJwJrM7orfS66vK8FDlJtH4e3bBVvZfUKjoH5mc6H9mNhJeYMAWG+RMsRvC8WRnOf9n+GTSm0j6MZ7IPpKn0xCrUaAuTAhQrSJ94exqLTGQ99RNN5RHuwMshdwr3uK3fpo33Y3xL6mFTW+GNDhRpyjlh1c6mRrMtWIfkUvWlpfFA15JTc9yR0lupZjIb3dUPrNCWQJh5J3f8k9wfiR8oQLvQesKh90zM2OYcqodwxPysRfMhxrZLmVytjCoFEcjXJy8u1PD9oTw1KaSvk5m4hUqLirNNyZ8ig== - ND_SPOTIFY_ID: AgBEOjEOVPO7L1Yg/5b7Lp47Lo/ZDALMypfaKoGlt6dPUVfUd7D3Ex9fdydNdcOZroRgYKi4j8gOYg+5JMJVw/TzGVlXiuhCBWYga9deeboAatgr4EuldvUgApfwKBFdoMLsOtGnSI+UoAX4pXyJXTCsjqnxtN+HfYmBu5oxbOkm65ztoiodwpjFVOBsgsCgCVwt6uI6H37ryKxxZ2nPS+X38VbMJAyo6dvD3jLB+wyUB1hemmdTyg/VbnBFaIMX+Ms6iUmLMggfOq0P3oLvc4sL5LSaZ5ZCIcwDrNvFc19xR7c265XgIUGiD2HyT+lqIoNq6V6duLQkQynRsbh3fS2KLGui+CiIskajM6RqtjncsutVEXPSsuRxUD1WU9IB6UwrNuuiJXnLgUhB8/av9ERDN+Un3cxNW78ytXClIxTCyB8Ndr6A6urwJIBogAo/bL8rNg7TlKqUnzpYa/GYQ6lBIN2SL9UTRyBfi8sE664ERs8nZkPlf/BQQBKQxJpYeSjTVDGpDNhuSE1LdLK6VM+vDueFlJ38d/YAz0gaV2Km1eWmfm4dTpG0zjZoFQbfRjGFIZYhLaju/cBpSW5qb7IoVN8TdQzJ6YFLy2lDEWfTqEcmu/Lbp1cvjU1MYeQ48x4eRK+SsLD+7ds4tiQLwhi52nC+uLi4YcqQayF2m/pSoMOOqarhP5g0ZRG2tcgJnynvCzAzks2zkGWyA+3FPg75eEc49IueaNTE6jT+/4fgww== - ND_SPOTIFY_SECRET: AgBpGvv+LZdybstbYW39F5dY2YZHqTVL80XJ8oVLyuvCljamzABlpYaoVw58OygdGRuyDJCrOPpyCxpDRx1MoQV4+qwE/a4K6JLjlFXCg6yR1vySHjO7l7zwJtWhf71wmvQ5WSrs/l54BbWh7Vfz18Dr4kuoNgk6F394XdKBZv3jhawQP94b4sykHhmSkXoqoPAESxLkPJ8M3rhxmdnerdRA3y4Y7m1fXy7yXqw1ojr0w2850hubK6YYxpcCqDwGi97//V/tWzz+Z7XZe8cf8cQ4+KvxpZQUpOfeCE8mVVaPAuHCDDXk9y8ObsUbwlcLstds+GFGfo16Llb2mwoTfifSrby1nbPEKAvGqa7eQavGpaeFEP9t5SftASGWeKflzYveCa9lkdrH5/8ZsieWrVJJv2K0YemaD3QqwL3ymyzehWzG7O/6bK98RkxdHGHFCH3HzFl+rHzQTPSLKof5YQU6+cMwbr3TCNTFnQVJ7O9+AFrOQVYn2/3fC3ZXq5SDObRYJYQRw5bGQcJPGZFC8uUzhT9KI+8gAVJYSwtTwNrZzEgCHviUlg6mKyV0I+7KdC8ghfl4GmjBIwscH2Ur2h20NDGQ1z22RsqSkxaYZBtLzaMLE3jZFMZTEYtjs2NjXSspSWVR2eplBmXez/kdkUOV5r9x8Z6vs3FEDyslzEEsuyutC1OGY7xi4Jiuq6P87y1R7fZttkuTIiUgyz7j9ZaLPu5qs/fjGonU1vvYe8OVVA== - template: - metadata: - creationTimestamp: null - name: navidrome-secrets - namespace: navidrome - type: Opaque diff --git a/navidrome/pv.yaml b/navidrome/pv.yaml deleted file mode 100644 index 550477c..0000000 --- a/navidrome/pv.yaml +++ /dev/null @@ -1,42 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: navidrome-data-pv - namespace: navidrome -spec: - capacity: - storage: 20Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - storageClassName: manual - iscsi: - targetPortal: truenas.local.gwg313.xyz:3260 - iqn: iqn.2005-10.org.freenas.ctl:navidrome - lun: 0 - fsType: ext4 - readOnly: false - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: navidrome-iscsi-auth - claimRef: - namespace: navidrome - name: navidrome-data ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: navidrome-music-pv - namespace: navidrome -spec: - capacity: - storage: 10Gi - volumeMode: Filesystem - accessModes: - - ReadOnlyMany - persistentVolumeReclaimPolicy: Retain - storageClassName: manual - nfs: - path: /mnt/tank/media/music - server: truenas.local.gwg313.xyz diff --git a/navidrome/pvc.yaml b/navidrome/pvc.yaml deleted file mode 100644 index 2156dfb..0000000 --- a/navidrome/pvc.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: navidrome-data - namespace: navidrome -spec: - accessModes: - - ReadWriteOnce - storageClassName: manual - volumeMode: Block - volumeName: navidrome-data-pv - resources: - requests: - storage: 20Gi ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: navidrome-music - namespace: navidrome -spec: - accessModes: - - ReadOnlyMany - storageClassName: manual - volumeMode: Filesystem - volumeName: navidrome-music-pv - resources: - requests: - storage: 10Gi diff --git a/navidrome/service.yaml b/navidrome/service.yaml deleted file mode 100644 index 26ed577..0000000 --- a/navidrome/service.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: navidrome -spec: - selector: - app: navidrome - ports: - - name: http - port: 80 - targetPort: 4533 - type: ClusterIP diff --git a/navidrome/virtualservice.yaml b/navidrome/virtualservice.yaml deleted file mode 100644 index 5609a07..0000000 --- a/navidrome/virtualservice.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: VirtualService -metadata: - name: navidrome -spec: - hosts: - - music.local.gwg313.xyz - - music.gwg313.xyz - - music.zerotier.gwg313.xyz - gateways: - - music-gateway - http: - - match: - - uri: - prefix: / - route: - - destination: - host: navidrome - port: - number: 80 diff --git a/nixpkgs.nix b/nixpkgs.nix new file mode 100644 index 0000000..e4d0588 --- /dev/null +++ b/nixpkgs.nix @@ -0,0 +1,9 @@ +# A nixpkgs instance that is grabbed from the pinned nixpkgs commit in the lock file +# This is 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 new file mode 100644 index 0000000..a13ea3c --- /dev/null +++ b/overlays/default.nix @@ -0,0 +1,23 @@ +# This file defines overlays +{inputs, ...}: { + # This one brings our custom packages from the 'pkgs' directory + additions = final: _prev: import ../pkgs {pkgs = final;}; + + # This one contains whatever you want to overlay + # You can change versions, add patches, set compilation flags, anything really. + # https://nixos.wiki/wiki/Overlays + modifications = final: prev: { + # example = prev.example.overrideAttrs (oldAttrs: rec { + # ... + # }); + }; + + # When applied, the unstable nixpkgs set (declared in the flake inputs) will + # be accessible through 'pkgs.unstable' + unstable-packages = final: _prev: { + unstable = import inputs.nixpkgs-unstable { + system = final.system; + config.allowUnfree = true; + }; + }; +} diff --git a/pkgs/ceserver/default.nix b/pkgs/ceserver/default.nix new file mode 100644 index 0000000..014fd6f --- /dev/null +++ b/pkgs/ceserver/default.nix @@ -0,0 +1,54 @@ +{ + stdenv, + glibc, + zlib, + fetchFromGitHub, + lib, + gnumake, + # Int conversion error in gcc 14 + gcc13, +}: +stdenv.mkDerivation rec { + pname = "ceserver"; + name = pname; + src = fetchFromGitHub { + owner = "cheat-engine"; + repo = "cheat-engine"; + rev = "e137317cbe9692c4dc61e6d2e89bf543b4d7301f"; + hash = "sha256-kEpt4cspC5BR+03022cPnOpNLxAUbUpdEM+K9wcv1Mo="; + }; + buildInputs = [ + glibc + zlib + stdenv + ]; + nativeBuildInputs = [ + gnumake + gcc13 + ]; + buildPhase = '' + runHook preBuild + + pushd Cheat\ Engine/ceserver/gcc + + make + + popd + + runHook postBuild + ''; + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + ls + cp Cheat\ Engine/ceserver/gcc/ceserver $out/bin/ceserver + + runHook postInstall + ''; + meta = { + license = lib.licenses.unfree; + description = "Cheat engine server"; + mainProgram = "ceserver"; + }; +} diff --git a/pkgs/default.nix b/pkgs/default.nix new file mode 100644 index 0000000..daea785 --- /dev/null +++ b/pkgs/default.nix @@ -0,0 +1,8 @@ +# Custom packages, that can be defined similarly to ones from nixpkgs +# You can build them using 'nix build .#example' +{ pkgs, ... }: +{ + # example = pkgs.callPackage ./example { }; + # sesh = pkgs.callPackage ./sesh {}; + ceserver = pkgs.callPackage ./ceserver { }; +} diff --git a/pkgs/sesh/default.nix b/pkgs/sesh/default.nix new file mode 100644 index 0000000..de9244e --- /dev/null +++ b/pkgs/sesh/default.nix @@ -0,0 +1,32 @@ +{ + lib, + fetchFromGitHub, + buildGoModule, +}: +buildGoModule rec { + pname = "sesh"; + version = "0.12.0"; + + src = fetchFromGitHub { + owner = "joshmedeski"; + repo = "sesh"; + rev = "v${version}"; + hash = "sha256-m/EcWh4wfna9PB/NN+MCRUsz5Er0OZ70AAumlKdrm/s="; + }; + + vendorHash = "sha256-zt1/gE4bVj+3yr9n0kT2FMYMEmiooy3k1lQ77rN6sTk="; + + ldflags = [ + "-s" + "-w" + ]; + + meta = { + description = "Smart session manager for the terminal"; + homepage = "https://github.com/joshmedeski/sesh"; + changelog = "https://github.com/joshmedeski/sesh/releases/tag/${src.rev}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ gwg313 ]; + mainProgram = "sesh"; + }; +} diff --git a/root-app.yaml b/root-app.yaml deleted file mode 100644 index a0840f2..0000000 --- a/root-app.yaml +++ /dev/null @@ -1,22 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: root-app - namespace: argocd -spec: - project: default - source: - repoURL: https://github.com/gwg313/homelab-gitops - targetRevision: main - path: apps - directory: - recurse: true - destination: - server: https://kubernetes.default.svc - namespace: argocd - syncPolicy: - automated: - selfHeal: true - prune: true - syncOptions: - - CreateNamespace=true diff --git a/sealed-secrets/values.yaml b/sealed-secrets/values.yaml deleted file mode 100644 index 94edb81..0000000 --- a/sealed-secrets/values.yaml +++ /dev/null @@ -1 +0,0 @@ -fullnameOverride: sealed-secrets-controller diff --git a/secrets/secrets.yaml b/secrets/secrets.yaml new file mode 100644 index 0000000..a3daec3 --- /dev/null +++ b/secrets/secrets.yaml @@ -0,0 +1,21 @@ +restic_key: ENC[AES256_GCM,data:DzpWvFP5gyhrnLVIYgu9ouotWqkOAHehihSKf/TqJE+sHTD4vnIScfhzoKzdkoDoWfkcmQ==,iv:q83qNYuP/3mngvg+kUfOVToogL8VTvZ6HiGIztpnP/s=,tag:YNWwbma0HmPKqYCS1L5kQQ==,type:str] +wireless.env: ENC[AES256_GCM,data:bknujxgeDzXii2eUPTS609cige01pbqCVPm0EKFJaZfB6aHT1jUXtxN54bB5aKtaiOcuJ1Mcee8JbijH+n5LOM7LsApq9IoBDJsyChuBX0PilzCSmkftzOBrl4hhDzxHCelISvBxCnbrNQnywPkiffOxaQfP7NCSNKu2NsnJH/N26Kwda5CbXmBifQTPSwVn1Xs3aM96vS4KjsBrkCROWHQ2JMgywJ6jnFP2VUickEsr0BBFhnudmxhbooUbhkFH80jrGxJn,iv:aOHIxI2oHDltOUTkGuQqoNa6hU1gaqPMnLyBZpCNqB8=,tag:IdwvOcigWJ2W/gVpGBIWMA==,type:str] +cf-api-token: ENC[AES256_GCM,data:7FJtAEOdYnUpGqs5r3pNIkY+lsqn2wtRhyIGXD5G7in3U3Tt8CTn5g==,iv:61kKxSYk54NqvhNn4xZZ2Gec7p/93dAN+VWBqF5OSQQ=,tag:5yzcHjGzhD8KX2FgL+xK/Q==,type:str] +basic-auth: ENC[AES256_GCM,data:/YSAcTnyvM4sjj3cc46YwkXGeP3yG2MHctza+kDuRaNXb8ABMFofUHU6KuifTpsmUWwPQ4BPdamv+JC9ee8tsWRMxw==,iv:CUE70AISBOdYDLUXGAnIPT4t4tOugHWLlCLE6YxTkjM=,tag:MnyHoQCHaTbYjp/jrbWEcg==,type:str] +grafana_user: ENC[AES256_GCM,data:EI0aavin,iv:tfkJ2pVyAgH+um+Wb1lgbvngcemdtMa+URXWV30yzBI=,tag:5VoyXtW3U+cuhHr0gPpOsg==,type:str] +grafana_password: ENC[AES256_GCM,data:nock2uRcv29OHFRJ,iv:bXrGrTZrGMXLEVn8jWuhoOyfDY/Suqp2TBSMzYx/psA=,tag:tSxo7aZvVUBZFdTXaPjWVA==,type:str] +sops: + age: + - recipient: age1k3hs0gyzrmsdyqh9lpret46q3xaayxxntruzc4euy6h3slqn4u6q36h7rg + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSAyaTI1ZEhwbDJobnVPTlpm + OHRiYklTejE5dFJQaVE1V2xpOHcyRnVwd0MwCjJhQnpOTmdxSk1md0pNbS85L2tC + UVpnaUpPY0paaXFkOHZEOS9ZVUkySWsKLS0tIGp4UnZ6b3hXNDAyaHlXaUhMSzBi + US9oa0pORXRVWWlyYlZZTGhXdTdOaWsKClqIK/YNJIIGFqOO0t4oni8dRTTXQniG + ioIwAOdEgE/n0vcYhHXxLxWlTeqGZF076g7EFfIqiSNqrDtacRnazg== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2025-07-01T20:09:32Z" + mac: ENC[AES256_GCM,data:i+Q+2ottIzAINqlUVXxJ6erLEsItjkrSbjGjRg72hSZdAOusI9Er4A7R/JGnR26/+o8i6Ivf/HzYIGL1AX7mA48UCg5MM1gpUNnFlc4pkwP+9PdbhT/V7nvvzlHHyPc3y7AfjeY9SI0kVuStPwrIPtHkh1JYwqkpVl2DSU9OPCg=,iv:nXF7db9V7ZXtcmXFPPTcjWbld69HHYEQp8BhDEugYak=,tag:Dp5wuoWxB5PuxKiXvZWdIA==,type:str] + unencrypted_suffix: _unencrypted + version: 3.10.2 diff --git a/security/namespace-policies.yaml b/security/namespace-policies.yaml deleted file mode 100644 index 904d270..0000000 --- a/security/namespace-policies.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: secure-default - labels: - pod-security.kubernetes.io/enforce: "restricted" - pod-security.kubernetes.io/enforce-version: "latest" diff --git a/security/network-policies.yaml b/security/network-policies.yaml deleted file mode 100644 index 62a67f1..0000000 --- a/security/network-policies.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - name: default-deny-all - namespace: secure-default -spec: - podSelector: {} - policyTypes: - - Ingress - - Egress diff --git a/security/rbac.yaml b/security/rbac.yaml deleted file mode 100644 index 49296ba..0000000 --- a/security/rbac.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - name: readonly-users -subjects: - - kind: Group - name: readonly - apiGroup: rbac.authorization.k8s.io -roleRef: - kind: ClusterRole - name: view - apiGroup: rbac.authorization.k8s.io diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..14ad0d8 --- /dev/null +++ b/shell.nix @@ -0,0 +1,8 @@ +# Shell for bootstrapping flake-enabled nix and home-manager +{pkgs ? (import ./nixpkgs.nix) {}}: { + bootstrap = pkgs.mkShell { + # Enable experimental features without having to specify the argument + NIX_CONFIG = "experimental-features = nix-command flakes"; + nativeBuildInputs = with pkgs; [nix home-manager git]; + }; +} diff --git a/wallpapers/ai.png b/wallpapers/ai.png new file mode 100644 index 0000000..1cd2ed9 Binary files /dev/null and b/wallpapers/ai.png differ diff --git a/wallpapers/anime-girl.jpg b/wallpapers/anime-girl.jpg new file mode 100644 index 0000000..e76753c Binary files /dev/null and b/wallpapers/anime-girl.jpg differ diff --git a/wallpapers/classic.jpg b/wallpapers/classic.jpg new file mode 100644 index 0000000..e9bfda9 Binary files /dev/null and b/wallpapers/classic.jpg differ diff --git a/wallpapers/floating_city.jpg b/wallpapers/floating_city.jpg new file mode 100644 index 0000000..668690c Binary files /dev/null and b/wallpapers/floating_city.jpg differ diff --git a/wallpapers/forrest.png b/wallpapers/forrest.png new file mode 100644 index 0000000..f8c6dca Binary files /dev/null and b/wallpapers/forrest.png differ diff --git a/wallpapers/hollow-knight.jpg b/wallpapers/hollow-knight.jpg new file mode 100644 index 0000000..0c28daf Binary files /dev/null and b/wallpapers/hollow-knight.jpg differ diff --git a/wallpapers/night.jpg b/wallpapers/night.jpg new file mode 100644 index 0000000..a0feb99 Binary files /dev/null and b/wallpapers/night.jpg differ diff --git a/wallpapers/nix-black-4k.png b/wallpapers/nix-black-4k.png new file mode 100644 index 0000000..c1f20a2 Binary files /dev/null and b/wallpapers/nix-black-4k.png differ diff --git a/wallpapers/nixos-wallpaper-catppuccin-latte.png b/wallpapers/nixos-wallpaper-catppuccin-latte.png new file mode 100644 index 0000000..243c569 Binary files /dev/null and b/wallpapers/nixos-wallpaper-catppuccin-latte.png differ diff --git a/wallpapers/virtual-youtuber-anime-girl.jpg b/wallpapers/virtual-youtuber-anime-girl.jpg new file mode 100644 index 0000000..399ea03 Binary files /dev/null and b/wallpapers/virtual-youtuber-anime-girl.jpg differ diff --git a/woodpecker/certificate.yaml b/woodpecker/certificate.yaml deleted file mode 100644 index ebd064c..0000000 --- a/woodpecker/certificate.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: woodpecker-cert - namespace: istio-system -spec: - secretName: woodpecker-cert - issuerRef: - name: letsencrypt-dns - kind: ClusterIssuer - dnsNames: - - ci.gwg313.xyz diff --git a/woodpecker/gateway.yaml b/woodpecker/gateway.yaml deleted file mode 100644 index c77e25f..0000000 --- a/woodpecker/gateway.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: Gateway -metadata: - name: woodpecker-gateway - namespace: woodpecker -spec: - selector: - istio: gateway - servers: - - port: - number: 443 - name: https - protocol: HTTPS - tls: - mode: SIMPLE - credentialName: woodpecker-cert - hosts: - - ci.gwg313.xyz diff --git a/woodpecker/iscsi-secret-sealed.yaml b/woodpecker/iscsi-secret-sealed.yaml deleted file mode 100644 index 8042b49..0000000 --- a/woodpecker/iscsi-secret-sealed.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - creationTimestamp: null - name: woodpecker-iscsi-auth - namespace: woodpecker -spec: - encryptedData: - discovery.sendtargets.auth.password: AgAXwKZ0NHUvgJVsV6yb7qFx/HlLXNGkQCRQh4u5PyVG3BJCIyJXBbvmRMDHSTpzJPsaWD4q56ZBhGsduNSJf/oBttS3wNNdEtv0xLcWL1umOntkEv7uus9KT+ig3TmxiYgzCBrdD2t29oFlVosJWFOmBCdh2IcYfnZSBCDQJz2pHlC/6cA7wn+ykPXYKurxBs6MNiUx7cSBLZuWcdvXtouJ/8wZkARZSBdppk2vGzw7pqXzVLN8HyiiM8Uf9Zz6ShTHDuvtFAbiyeuTOVa+P9jmQ+y/2iRZf2DCE7rLDKT04xQZFrHaCGHHQ7ynrGQBLN3d8oVE6iDdacZiow4txEWTbxJ0pbDR7m0T0Nk04Xfc2MLyhCJhR6AGR03aMFd4DJYLnqzFHFoK//qvfFpNwj6hcSPkqzCEliaSeCldLM3aoTw9IPc4lGMgrIHefNzucpYlYMJhxc/OvEmXCi3ZxT7fcE8oYasswjtsDfXzAKsJA2tjzIwJiab+kJyXXyDsmWnF+CkmCMZWspHafICorFSObPsSgAm49+c17gwCprl+VKZf1mEl/g+iFRM5XKqlD50nUvx1my6VHRqaKowxGKxv2m87urhPQYvRCwApzHsoVK3OR01Q2YwjyPneAbZomwY/P+yixlGXDTQx9oxrYvm1Qt95OFvGsI4I/VIgUBkLJqsVDYz616w9ljGViyh/udNezgvXw4Vz1taRSMjR6EeF - discovery.sendtargets.auth.username: AgAYnEFgZ4zi8mmqMLNAQP6e+Y0re23os1wbu5Xj3gDm+3qLyK1JzzAeeHHVyTqU27gr12ofVqKUqOMb/aXNGjA5Jzn9SgWrWg9SbLxFiV6sL1s9LhQUJ0708GXcLwN9bdU8pjiEhO3eh8RYoH1+mP5aHy7s+56xmZsiIzP6Vk8+WI38bMXBy2jIhTZHyFxABVtBb6eBU+JPaGitOgkoi6JCyUmsZbV6GzdJPD/H2wZJBxG4B5rKDdVgpBtaQyPPmKSI/NheqQgOneabS3Dyeq7SgP0bxPq9tTU6jEHsvKOOigu6px4Tt0hx0BZZqOFFsMQAtU3ymofVyNZg7F2Uf6NEuRNgI6GUv7Wykv9H4ZjPffrI1OPmEBC/o84ThaGi4161gXcL/+atvQa/RkVvRou7iRG3oLM4qQWVDStanE7+Jq0cATFdXyFWCfXZ2/8TftadQfC5oKmdkOjvOGtPJgRZMA8lNogScoFZtCprioOjKvEeirjBBmbGUC2Uc8eEUkAIlwernimno6y3Z6prlK5nzK+HKI0EWSFQxYG69vtGgzxvJP4G14FwfJKl3Za84iZoC5OGld18JQ6b4qDphrxHU4K/mE8L99YpzrahdECKATwSzmKU6seJq+TrbYIzkWqPpV/GxSh53kIbPPi+CeK0xpFtuOfQ75lxiaGcbwt1QVaLuQzgKmjDgRMmNXHYAxOFJqnmawI2DLaR - node.session.auth.password: AgAJfFaVcDzIUGbDIRlCiz3ROdtm80nDwLcYKzAwfLDs8Gbcq7o1EldWtArR+zEss40va672lWdIhUO46mT+l2NDLJRvdCCHfZOxmU058ba5G81Hd87kpd4Kz/jyNgwBV8VNjSVE1v6oJKlmj1gnSJwRYclgqTXcmhP20gQKEtONnuDC6SZkFtjQBCP5//Kt9LBQrrXIJHe6DgNlqsqLtXA26RKBRJlt7H+tu6SG5u9HZ0rdz/jpBymESihVUpRBp3v98aG69Vaa9xWIPAivtsvJUURlSGu0raN3ipvq0Fk54eWAbRmqTkC/JJVrRmZwskfSOU+DET8kjU7h7hA/5Z2NTqkjKNXmL8e1nn3ZWAI7hnf1wFcvRrqlVIiiRldr+IsT2wXp9d8jEHr/qwVl0emxoiXHVKjLnvhH+FKpt7GfCQa/1K11RGw7vkfEIWF6lvcECHcGQbf+0kuFWsCBwwQhQem+KqbHo2gmsc73XUVUVkkyBYG5FIzH5MuYBf8nHI/mt+bUSdT+4YU9Qj13pgpURX1bzIgXYMHWgtfWdxdy/pHsPZiOuBOsMkD1qUoDuV0/nc13zS/gsSFhdX0mdyXixQgXe9R+XzzuWmgV/mO+/6AsnkvD4KnTt5cv1Ft+f3FUqoW4NViigZ9URlX4xZ7zI/UJhXiPm4RCjNNZrefDua0bRzESTxnakyKe1XeylPQ+hEZRdPU0lYLrk3b3GZdg - node.session.auth.username: AgBz3hk4xbhTTSigqw2L0Truwe4iFkNCtbWRaJ7Vm9huG69RAyOg63+fg8UFk1rmmECo+OaEadexUS6JIo+g8yA+Mds6KE3kr+3kdDOOMFdXh40VtJGHYlqzeyRYwJ/PU2BHWPZi72WW9/A8bPFfVQMzIEinnRpxtV1otRmdfZSXviE24LPiClkCzbwPGZPDW56wtfuxVJjuQyhAJ7ote8F8yV7N7q7lz6tBTYA58pfKCbs4KQdK39h2afW3gVjevw+4kLeTlzu5Ynj446ZIUR7pID1SHLVEVXXIW7rKZ+cs4EWB34M1jJL/T/EAOYsh1vaTwxhoDR/98awbnZZ/Z6SWoARwBLDjk3Nez4N2FqzFhn1EjYiBYym2Xz7c+kwhyDApOY0D7ESK0W8efg1RrsJgVKhFO4AO/oI6/MYxur6ZdI5/xReJirmhN9HNf7tvZ+wwo3sW37H5v6FhcTCG6/bXsTYj8vZT/JmrH9AmeqDzKfi4NkWhfG7RC+2NQxA3X8OuXdbPFWv0YriL/yk88eUzi+orS5O2PV7o8a4c7BplV6K6XiWlV+1oUsfpF9r8t1x+AQj4G83aGLgYvpmSinpMbmO33bEor+QY+4s1Epa/VEF84grc+It55G+7DjE3o5couWVre96HDXqN9falXt2yvRS1YdYSzh25mY33wnEWMDBMUBR3NnkYU/3GCLz7dpeYwZbBtayzdmli - template: - metadata: - creationTimestamp: null - name: woodpecker-iscsi-auth - namespace: woodpecker - type: Opaque diff --git a/woodpecker/privileges.yaml b/woodpecker/privileges.yaml deleted file mode 100644 index 5f4d0c5..0000000 --- a/woodpecker/privileges.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: woodpecker - labels: - pod-security.kubernetes.io/enforce: privileged diff --git a/woodpecker/server-agent-sealed.yaml b/woodpecker/server-agent-sealed.yaml deleted file mode 100644 index 3a3fb35..0000000 --- a/woodpecker/server-agent-sealed.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - creationTimestamp: null - name: woodpecker-agent-secrets - namespace: woodpecker -spec: - encryptedData: - WOODPECKER_AGENT_SECRET: AgBmeIkpWWnoPxHam7X6V5/TTI2pu3DwzuvWySQuWewf1N72hl6Ljw6aFJEU6Mu02keLB2ECPPBg+kJ5Bh/d3rMPllSW/HyuepjyrnaWBgNkAWObjJ7oOmqVR1TlXORj8cLz/vHkhq75Cn0FLQ+/2FlAxX436YEIB92IVObdx6J006UM+HqlRn7TXXuD168pd/3L/DhQdGnyBcDH7u21o1nLl+gZvqe6L6v/Jz6Z5gDi9B8B7zwldQfGY/BKv5fKOJixqisXfteV+BbAzce4KgI5djqKUoaOOy8T7Sm3uGYckxtEkA+mMcX5SUKInsFRnfpTfbMZU+2GofpHKbHFLYiqsZ8HG6/9P8EZ3DBsPrGG/xyccnH/Ylwj+jJfkrlDPo2i42rqB4XwES5sxnUAdF8W9f8QTK/4wlbglUqBJf/g74hNrYIVw+YikGpBYHaRInYLXnsXReaIyhvG0UK9fjotTZJ5ptta/OZ04kvXqoxXGojBPtZc/0n9vI0ynbIlHCOO7dRawaG/Iefg7cCZvpzBCyL5dd1gtCXUYrPoFrn1UFc9kD6YzRtiPO4AnTZjXXuEMiVsyjFBeewiq9b4QchXO5zY/6DhnLv8HDCJwAZD3HiCFJ/O6wOzBTdqCmPXMpVGbJOOy3Vm8W16uyMOkwmYeq78oFQxMhkfnLReh3svdPGKV9Mr9sn+7NmPJmZ50TEuXF6LUGc0AcgDw9MZ8JsURp8wrA== - WOODPECKER_SERVER: AgCrhcONkNTohkwUFIQBi5KO2RLKN18CNNjPkEobv9KxTrTY38aPKltuMC6hxBeR05Wt7ySRe5aaXfLOKHs6mO16qzIaIkyduQxpfJge7BJOKtCzjzhb3sflUqT6XY+wXJp0kN9wVFHEwplzBZc0gd0rUD6Y4wIJcUjIGVcdu0Hx+nujfpvEdxB4b7qIDGDyED7yL4XKAK4XmLD3lDjuVpTGAoVOuISqAdfRLDEJRQnpsQxvYQTJ6CizkSLL+K4R7STcWZtxOw0qQ3Y71eoiaW/G+aT64Tnu1fvCX65T632Ij4yTxz6pdjAltegpvmLh/6zdLTBloIn+jEHcKqaXyTjtTDUIsNkdJYArSB9NdjTQpBZBbSEvxMQx4ebyi1O3brhJVa891fcEAXOWqDM3lgK/FQQCIjKoX1DQ0OWfJO8oa/pJyoV6ZOz7ivv/dOqsHP1WsuEM19Y3oNNnNVgH30rShNxt2Vnz9z1BIOoEe0HZ95lL9AcuIgS2i1pNYvjkn2cm+o0CQa3Va0flFINIlXKmnoISbQKXqOzySn2U1uuunjyoemh2bXgZ/8FcAFbX0AMLkeLeqi51tBU0QWIxXDIVNlCMEufLFnCl3S2Yj0r8Q6zKVq1U2bZqn62IHI9ffUP8Nvs8oNVhIuq/1QGx5MzXIXcI3KVBZw+jKrHWEmOOhxfkTEw/Wk2fZocJ7WjjNlyBrOiYAtnHAl/v0nSELLjZPop4tG76 - template: - metadata: - creationTimestamp: null - name: woodpecker-agent-secrets - namespace: woodpecker - type: Opaque diff --git a/woodpecker/server-secrets-sealed.yaml b/woodpecker/server-secrets-sealed.yaml deleted file mode 100644 index baff49a..0000000 --- a/woodpecker/server-secrets-sealed.yaml +++ /dev/null @@ -1,23 +0,0 @@ ---- -apiVersion: bitnami.com/v1alpha1 -kind: SealedSecret -metadata: - creationTimestamp: null - name: woodpecker-server-secrets - namespace: woodpecker -spec: - encryptedData: - WOODPECKER_ADMIN: AgCSpZeEAzVMXCbLYckS+g8pn3QktiWERwIDGM5NRZPCGNf6o2zdeqWbnqXWhKVe+if7T9XVxPE8uGfNzpnJI1rSW9LQft9+2RsFq6MPxAE8yNW4kCfn4oQ8J6sI3noHGIR4PD/KqHidiTf+f50VGxAwUD5/as3mbvVgNnDEMNiF1mTD5g3PBBbUNQTPpAAmIrcoz8KwmQZNBqTeKQ+wBwkMpRSR1QcwcYryms8fnWjOxf0dGEEb0OMQk2h7OG16n+e4QOrt6Hs5vDv0APSMqsXBSk5AVEMVbjgoVyZsetG27L6JrTmg6KwQZut0LNLaPTHxGKQoyc0KCAJBLkUhnWu+lwdP0dY6vx4N6A+Eb1kkSJedHzZo4YfnDhQNvNlbSxHRmIlNNylsB7Z4RuwmX/ze06izGxPyZ0NXa2+2ehZZdMCcycFgeP6kzR8fyD0T6tPljWVVfMQ7PEBaCps7rf8g8W3zPzFuMeDkC94bRaIF14ooAwKVH2JIBcWiGFoUaLXu3TG2SUL0yOMmv7ovSX+iJtrtwzXBAvdG1TgmcugEQ7DwOVVNdpRbGx9F3OzYoVjx+ZKQMcbh53nPNIA2WEZ03sObXK7TOrrvidP/+fsncXQbH5GO9Y5/riyseMmK8P6Qc/S9Iqyi/z7FVRVXRKmhjCCsbuI+FcH56iUiSR+ysd968mDGfMCg9VfLlCP4N/37kLyndRg= - WOODPECKER_AGENT_SECRET: AgAk9p+U9ghWmPMkUvFMO/0UtvgRvEa0wFOJuGNIDus77GQP2ybMEN31t92aJEYr02o3mLPLPfF9nuT6L19o+/mjZ1ZTe7oszbrF/tM3cAwXH87iSpkOT7o7qnWOXobXN5WWftTbzABJlmaW0Dgaci7ycgSSlTGdUwNizaSlYwvUovGqaBsHRczCgKAQ8QGHLMraQphQLgqYKaK0KZcgQH7tIxuAg+USFJDf13+SOw5H2t05U4pH4SADOBovxv16GssiXxNJYJ1CCyxu1+BBgpLAStCU43vthJncBocANiTbsnsAXmsDVosUegRQWDRwxAygwSexboww1J5e8TG+ypMTa8T/MVPZn2+O1nI+LgRPh5uaISDeXDSTAHXVH5aodettqD+3kIc5F1FE5I4a8ylmnHkeQKVcrmqhiKBZ+7WcDMA0yS806zQ6xp9iOy2P5UYM9sjtD5ZsDnGgjFq42jF9pVnsx85l31rFSoXJZWOcciTOkigrXwMA5kuB5q76JHZXCWVFwy1ow0E6JdEfRDsWpJ2vR6DOPyYSSajgektNQdfa6YaSP+itm+hatzVIIvpFzbU5ZK2OLr68VNWdPqUfz5FkUG2zI9jGE8qGfWUTQ6LQk96GEzyd+Tpk5ZDkUg6lQAO6Op3J8TGaObYpuST+AMr1Vl7ghBuULFqSH5WkQw4YdsOkDrgt5BYR0vOIjmrNTBJ73ET6Ry0PpxTVhGOjRJZVRg== - WOODPECKER_BACKEND: AgB73OxahHCk4EajfFojKnZvy58C5/u/X2oWCd5RYN/wf7ylXBM1nnVBcziWt+MDQK66ullXLrb/Z6M/G6XvWwrFK4ZGM3N9kRtF+P3R+cq4pNhilr9DgabAdPTbD3fSsPFlX4lb52MILymHWvjsVFXJ/WMYa+yYiSkEU3oOGJID1+McDBiQ0iE6Fxd+gEpBbzCwyry4REsn37KIOFY612nZ9QKmD2t3VwHvwPrAQXMqVrS1kLumbiYvxYVrni69NMYtUFZBCXH2pwQnZVIb+zADVnIa3N3hQNzhzaAs5cvu9kedE2ZMb9zXDe33kzcIWbBh2PcROLMztiPNqclwthX/QDlEbpOv0zyJOHyTmtPMxMoGgaTOkgAfMRpVi49V9w+Mn4MG56KTsHNSJb6iv5ENjI5Mpm3ItGKvER8BrtBjWY5AJnBApmaNp07aKKjXtMZB4jSFhnMSE04zO9NFEHZQVJppYcVgDSY8oaiSqcK69Ywp6XKksHMxpDmGMGmI9QRyvISN4V17UN1pJxHXREGG2SAqsG7AIf8g0SZF6dGcVf7rv6BmaEsELBnHFzC13MuTBvnLXoCLLSb4OYEaye94yyKIqVKDNRXJYeNZeBfBji04eMv4RebPcfHydgsWDfsv1rsBQDVYj1BAOFE26LcOAjBWDfYUVDJyaTTCp+a2FIyEeFKRIzuYy5q+3atMASRbpfhS+LTlzq4m - WOODPECKER_GITEA: AgBxPWElw0PJuGrd7T0Ni6udPbVlp9gdg1YeXJbzoUKXCET8YD+b0uX3MC4YsQDWfKJuLRrk6QksTAhFXpk2bGcf0RqOay7mk3LhaLGkD6iUz7TU1KRcHV/xb4i/mXK9PzR2JnrgVFgdRj+NpMZx6sI/gnl9BP/Jrt70YT7K3Za0HNppOxNnyACk2SlKdBHq35A5fMiFpGSwRP6zScGfaqXqcCNkEGDhTxKsZ9rZ/2+GydEm1Eu0hCQReRdDLNLSLUcHUWLAq/Na8cZl/CPEMViGlEw0/zE18++GBdwNwZbnRPgiDhJwN63Hs4gVXiRLHHaubBzoofio2cADEmMlsFrtYyBLdq+1LS0mReo69mz9uMTKZkZHws/oAwAYF3793h2mWIj7f26QW0ac66QcLqwWDpqxabtSp7BO7Za6j2dRpSOMDnYtOV/0hBwtPOGsVGUjnC/uJCl0DH2Mv6jwbMXlRpmeq8eSu1KJmP6WUBUq4yqCUxixwHk4dhx7EdP25mcPU09XvqxDTWHnhkJi1jcM2pUjt4+H/t1aZfCxqS6mzY+VlaBm3a8F7Um77+JOQQr1XZU6Q1R+vVt7vnvWYKPlq7yZSrwndw4VbyFcz3kqnQ/Oa96sqbFAbZ0rl1mX9QUnarE9iNlX+mOjEpcCeMUyhOPZKvZijgaYl5W/iAjXpq+ElKvxrRVwBpHZdoScLR4p9/gf - WOODPECKER_GITEA_CLIENT: AgC2bdhqgcqFUd6rHWQhe24WZOFtEt4sKoQNkiaPDjGVqwXElvJk2sM7V7XbBBvTlqPvbDRQHDv0fiJAbxofDTdEF6/0+9H2jXByG73q9tj6TY684n3GYdgS+JKv24qwZ+/f/Lo+vpeiVjVhL85sXtznyu84FvOH32kICynmU0jifOFLvBvQAFs5OrY70NPqVx3we0Wea1gx3sKez5t3RK14wjiIN0KNUMOkNDEwCQpb/8C0n06aCtQ2htBCs/tYzzu4dOyhbQjy1aCqQjte6t4NiytL+VDACQluAkLZUwLSLfgxR+QlIlC9ud05mupQ6hBFQzNk8/omieAlqi3yAeRIb4xwHETKBCZq/Kj2sUi9Uu6hlXGhh/gcxBW0Y9UZqtbZfQBSt7rUBKNsxyw7f0Q8rYJzqtgoatq/PBzZFXF/1LqDCsqDratDTfNIi4tw4P7qiVw5r1fq2qHpa1OEay5Zz6f977LeFYktuI+0LMk1t6nYIMXm5yCPPU3n7gEoi128YSoKLAD/TrwDAjnL87I1GTwQ1P6yl0Ujao19Duhr6KcZQhvD456EhLCat/uBVMfqXkVa2AQE/qS07nTnX9dBDQSZaeje45Y2WyIMZpbzEEtBWtHefkoATF339XzkibUWSIgnbsrcTSirTQoPVqSqpI4EA+jSTTdGqLGtGR4bnmJY7QKTiLPMyZMYXmK0DTaMUALbDrbGyehnDWu771I20cF34YSmALCqyOLe/ovlD8kO5qZl - WOODPECKER_GITEA_SECRET: AgArFi05msWmqQWPNrf/OBZzJ+ABoibGDg7J5cmWbhZ1MTHDXDfogc51E0bQdwE1V/KdnS1jTp/PTpgElrbzdwon7QbhJmz+kipeYIDK5xdnM8PocRR/3pOaWHXqe2ibYFKRA2KsxXEVivNY7Q1QTBMreXOlE0zjzgIekNHqRbFRj0uMn4bdoxnddG2Jt1kCE6AO4edYd9E/AJLcHpX1/heEzKBQIfawCeyAjnidN9WXyVxCNPPsHF/NjZhijj/MKjuKzly9EQmXaPu3R6hY5yk0OTzQhn9C7Z4uD2rjmxre18h1niy1+aC4PGZu2+ksb8TvDCONJQU2lzO0cNSj5ate4h+3iKwpoBW9lRfDQmlv2eH+qIoAiVtn7zgdG7itYWaBAp/ASZSzzQ15ABXP0CT5zZ03GUo8v98g8G0DwPH19QkF+QjLxb+Mhbzza0K8UsYT37yB/rrVqXyu+1FeYqmh8pG2diqIN6nJZ87ZigglT94qYl608fHKy+c1QZtfFEn5Gfs/AtztH6wlIF77FlHGn9/Iz/UuFN5Phdu9RQfFHYbBitUiOyoDpzxNCefJnmTLOpvM3+gV3mJp3Fj2PRPnyNrcD4DnJgve/148WpzSIjtnMGcNMrf2pJqfgpKgHszv5fTeP+l4z/rtUt3TbLGee7cn/pDcMTwbYwkwSLrVs+VM2pu+v8VD5ei5P0iDK5gahfIqQynsxrLK22NRexSfusqQiZQrRFISl3iUBMGhIDn4XP9pjkisLSL9L3PGzEoYYull/JP+nb4= - WOODPECKER_GITEA_URL: AgAQTCI9ssMTT02cYcOxdqpgX7hl98jkDMpKMtQKeebowBAAncdmPtG4ma59JW1zHkqGy4sdcGY+mZ0ZnD9VAAaN4CMHSqMIezo2CZ7/vMnnFOY8+/kZNFyOGn3R6i1dDby0AZ2ACx/xF6QxVaJBb+7FPx0JMhekh9zBLgHbtjkCYWP+qOBaruTQWXT+UJFCfuhQaiAHUOZ03JJkg3pF6axuHAmRhf4/a8x1xyn9xBsvBpdWXZ61IRb+DiV35CJ/dEd9p/ygQPOe7pv3e699visCpTTCeIK1ztcYtZku2LAFW4kEGS+8Xab31uAGnEv7YqCntk8YUM7RSfzE+1r01baYF2Wb0kMDMY4AZHi36MPBvatNAx3fZj1AX7vGc+HChXUeuvZYBQ4qDZFglkPJPVHDYeNEe18KAEjXqqN7xVplPBkAaBqf0i+ywpv/x69GW83I5kj/f58fr3uDH6D2Hiq1odvKJJvsKuKf4BnLnCIvWifWqVn5A9SRO2/dc19QHKHLBvD36fPrk0xU6CvjPKFDoIo8u7rGGrDYlfYZEspk9nRWdmyh0Mi4zk/Ec+MXpTUqL8yiEfTC6Lfv/UmX1UFJeYt7eOzq5m3XKMwEQcwecjKGg0GebKPcBRfEEblTG6M7/DxgkWETgBLJkIWiC0EY1waGF/9TX6TCX9Mh1iNWr1ewgepabkGdqtdT6k4k0keGWeuEExWfCrIAIRt6dBkXuEJdhr35 - WOODPECKER_HOST: AgCigyJe53A1p22O/Q44Ss7bxyGbbxZvOpRD3uXQw67ztA5Ii5cIp8StexIb+SwUwKnadKncC9iWbQ9EyhDf8H+CiEOq4q8K7Rj6cTuFJl7+BO9uuyns3cklu8Lhj8ovgft+X2F3ixLY47Lmk3X15HWkY0gkAghoWBsCHELQzEodqBh5lenkn62DjMAp87riMnjp8xRsZxqmq5vELfVgM+cDFh3QDRoo3nKwbXvFg8OSV67kawKyM2FJ4U3cYcru+9Y/65V5qjNTthRqwW1muXPqN8dCkx3EGG2bkAGqInSI1S80fJte5soTd1gDJnLIpm2OTAFQ6uGpKsaOL3WF0Tb//GsGJtTjWuoJiJ2cZo1fg0iMmOagSFdTYgjqo1ALNlUA16oLA2pZhZCCZ0Xk3Fwgs6ISipxAcklsgUyVjDi/W2PiR8KX6uz8m2aKO70KlDrasyevKLTEkqXUcw02JgFmrGBPxIlE2UKP3jLw2x7RaACVuWucbZ8S2TdIP+vfbPfBFh22QcPMTJu86lE/k3ENs1jhrztpsLCdv16cuI96TtcKVj4H0qM097l+HJd3/BMqUvuAbXDsjZIWxJWoeO8VE+La8HAv6AfjXW+zal1z4maQsIEaxSXpn/4a3+DNnIQdhEINsMSXxpu58wZB9rCdA+WTqeBG+zRRJtlPXvawO6pDPMbqcZIGyJd5Hsara0XCGGhujxK4RFFsfruAU2D5xuYS80A= - template: - metadata: - creationTimestamp: null - name: woodpecker-server-secrets - namespace: woodpecker - type: Opaque diff --git a/woodpecker/service.yaml b/woodpecker/service.yaml deleted file mode 100644 index 3f0258e..0000000 --- a/woodpecker/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: woodpecker - namespace: woodpecker -spec: - selector: - app: woodpecker - ports: - - port: 80 - targetPort: 8000 diff --git a/woodpecker/shared-pvc.yaml b/woodpecker/shared-pvc.yaml deleted file mode 100644 index 3075fdc..0000000 --- a/woodpecker/shared-pvc.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: woodpecker-shared-storage - namespace: woodpecker -spec: - accessModes: - - ReadWriteMany - resources: - requests: - storage: 20Gi - storageClassName: nfs-client diff --git a/woodpecker/storage.yaml b/woodpecker/storage.yaml deleted file mode 100644 index 640eaea..0000000 --- a/woodpecker/storage.yaml +++ /dev/null @@ -1,114 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: woodpecker-agent-pv5 -spec: - capacity: - storage: 10Gi - accessModes: - - ReadWriteOnce - storageClassName: "" - persistentVolumeReclaimPolicy: Retain - volumeMode: Filesystem - iscsi: - targetPortal: truenas.local.gwg313.xyz - iqn: iqn.2005-10.org.freenas.ctl:woodpecker-agent - lun: 1 - fsType: ext4 - readOnly: false - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: woodpecker-iscsi-auth - namespace: woodpecker ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: woodpecker-agent-pvc5 - namespace: woodpecker -spec: - accessModes: - - ReadWriteOnce - storageClassName: "" - volumeName: woodpecker-agent-pv5 - resources: - requests: - storage: 10Gi ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: woodpecker-server-pv5 -spec: - capacity: - storage: 10Gi - accessModes: - - ReadWriteOnce - storageClassName: "" - persistentVolumeReclaimPolicy: Retain - volumeMode: Filesystem - iscsi: - targetPortal: truenas.local.gwg313.xyz - iqn: iqn.2005-10.org.freenas.ctl:woodpecker-server - lun: 0 - fsType: ext4 - readOnly: false - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: woodpecker-iscsi-auth - namespace: woodpecker ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: woodpecker-server-pvc5 - namespace: woodpecker -spec: - accessModes: - - ReadWriteOnce - storageClassName: "" - volumeName: woodpecker-server-pv5 - resources: - requests: - storage: 10Gi ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: data-woodpecker-server-0 -spec: - capacity: - storage: 10Gi - accessModes: - - ReadWriteOnce - volumeMode: Filesystem - storageClassName: "" - persistentVolumeReclaimPolicy: Retain - iscsi: - targetPortal: truenas.local.gwg313.xyz - iqn: iqn.2005-10.org.freenas.ctl:woodpecker-data - lun: 2 - fsType: ext4 - readOnly: false - chapAuthDiscovery: true - chapAuthSession: true - secretRef: - name: woodpecker-iscsi-auth - namespace: woodpecker ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: data-woodpecker-server-0 - namespace: woodpecker -spec: - accessModes: - - ReadWriteOnce - volumeMode: Filesystem - resources: - requests: - storage: 10Gi - volumeName: data-woodpecker-server-0 - storageClassName: "" # must match PV diff --git a/woodpecker/virtualservice.yaml b/woodpecker/virtualservice.yaml deleted file mode 100644 index 3168fb7..0000000 --- a/woodpecker/virtualservice.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: VirtualService -metadata: - name: woodpecker - namespace: woodpecker -spec: - gateways: - - woodpecker-gateway - hosts: - - ci.gwg313.xyz - http: - - route: - - destination: - host: woodpecker-server - port: - number: 80 diff --git a/woodpecker/woodpecker-cache.yaml b/woodpecker/woodpecker-cache.yaml deleted file mode 100644 index 6a988dc..0000000 --- a/woodpecker/woodpecker-cache.yaml +++ /dev/null @@ -1,27 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: wp-cache-pv1 -spec: - capacity: - storage: 1Gi - accessModes: - - ReadWriteMany - persistentVolumeReclaimPolicy: Retain - storageClassName: manual-nfs - nfs: - server: truenas.local.gwg313.xyz - path: /mnt/tank/k8s/democratic/woodpecker-cache ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: wp-cache-pvc1 - namespace: woodpecker -spec: - accessModes: - - ReadWriteMany - storageClassName: manual-nfs - resources: - requests: - storage: 1Gi diff --git a/yopass/certificate.yaml b/yopass/certificate.yaml deleted file mode 100644 index e9c905b..0000000 --- a/yopass/certificate.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: cert-manager.io/v1 -kind: Certificate -metadata: - name: yopass-cert - namespace: istio-system -spec: - secretName: yopass-cert - issuerRef: - name: letsencrypt-dns - kind: ClusterIssuer - dnsNames: - - pastebin.local.gwg313.xyz - - pastebin.gwg313.xyz diff --git a/yopass/deployment.yaml b/yopass/deployment.yaml deleted file mode 100644 index 2a26630..0000000 --- a/yopass/deployment.yaml +++ /dev/null @@ -1,43 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: yopass -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: yopass - template: - metadata: - labels: - app.kubernetes.io/name: yopass - spec: - containers: - - name: yopass - image: jhaals/yopass - args: - - "--memcached=localhost:11211" - ports: - - name: http - containerPort: 1337 - resources: - limits: - cpu: 100m - memory: 50Mi - requests: - cpu: 100m - memory: 50Mi - - name: yopass-memcached - image: memcached - resources: - limits: - cpu: 100m - memory: 100Mi - requests: - cpu: 100m - memory: 100Mi - args: - - "-m 64" - ports: - - name: memcached - containerPort: 11211 diff --git a/yopass/gateway.yaml b/yopass/gateway.yaml deleted file mode 100644 index 5b7167a..0000000 --- a/yopass/gateway.yaml +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: Gateway -metadata: - name: yopass-gateway - namespace: yopass -spec: - selector: - istio: gateway - servers: - - port: - number: 443 - name: https - protocol: HTTPS - tls: - mode: SIMPLE - credentialName: yopass-cert - hosts: - - pastebin.gwg313.xyz - - pastebin.local.gwg313.xyz diff --git a/yopass/service.yaml b/yopass/service.yaml deleted file mode 100644 index 97c5db4..0000000 --- a/yopass/service.yaml +++ /dev/null @@ -1,11 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: yopass -spec: - selector: - app.kubernetes.io/name: yopass - type: ClusterIP - ports: - - name: http - port: 1337 diff --git a/yopass/virtualservice.yaml b/yopass/virtualservice.yaml deleted file mode 100644 index 9827afa..0000000 --- a/yopass/virtualservice.yaml +++ /dev/null @@ -1,20 +0,0 @@ -apiVersion: networking.istio.io/v1beta1 -kind: VirtualService -metadata: - name: yopass - namespace: yopass -spec: - hosts: - - pastebin.gwg313.xyz - - pastebin.local.gwg313.xyz - gateways: - - yopass-gateway - http: - - match: - - uri: - prefix: / - route: - - destination: - host: yopass - port: - number: 1337