Skip to content

Latest commit

 

History

History
213 lines (201 loc) · 6.29 KB

nix.org

File metadata and controls

213 lines (201 loc) · 6.29 KB

.envrc

nix flake lock --update-input valiant
use nix

shell.nix

Adapted from here:

with builtins;
let
  this-flake = import ./.;
  flake =
    this-flake.inputs.valiant or this-flake.inputs.bundle.inputs.valiant or (if (builtins
      ? getFlake) then
      (getFlake "github:syvlorg/valiant")
    else
      (import fetchTarball (let
        lockExists = pathExists ./flake.lock;
        lock = if lockExists then
          (fromJSON (readFile ./flake.lock))
        else {
          nodes.valiant.locked.rev = "main";
        };
      in {
        url =
          "https://github.com/syvlorg/valiant/archive/${lock.nodes.valiant.locked.rev}.tar.gz";
        ${if lockExists then "sha256" else null} =
          lock.nodes.valiant.locked.narHash;
      }) { src = ./.; }).defaultNix);
  inherit (flake.${currentSystem}) pkgs;
in with pkgs;
mkShell rec {
  buildInputs = [ valiant ];
  nativeBuildInputs = buildInputs;
}

default.nix

Adapted from here:

with builtins;
if (builtins ? getFlake) then
  (getFlake (toString ./.))
else
  (import (fetchTarball (let
    lockExists = pathExists ./flake.lock;
    lock = if lockExists then
      (fromJSON (readFile ./flake.lock))
    else {
      nodes.flake-compat.locked.rev = "master";
    };
  in {
    url =
      "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
    ${if lockExists then "sha256" else null} =
      lock.nodes.flake-compat.locked.narHash;
  })) { src = ./.; }).defaultNix

flake.nix

(mapconcat
    #'(lambda (pkg) (format "ePkg-%s.url = %s;" pkg (let* ((path (f-expand (f-join "lib" pkg))))
                                                        (if (f-exists? path)
                                                            (concat "git+file://" path)
                                                            (format "github:syvlorg/%s" pkg)))))
    '("aiern-aiernhide-state"
        "aiern-god-state"
        "cosmoem"
        "cosmog"
        "doc-templates"
        "doom-aiern-modeline"
        "evil-evilified-state"
        "fell-templates"
        "helm-ido-like"
        "leaf-keywords"
        "lode"
        "meta"
        "prime"
        "riot"
        "sorrow"
        "uru"
        "use-package-deino"
        "use-package-extras")
    "\n")
{
  nixConfig = {
    # Adapted From: https://github.com/divnix/digga/blob/main/examples/devos/flake.nix#L4
    accept-flake-config = true;
    auto-optimise-store = true;
    builders-use-substitutes = true;
    cores = 0;
    extra-experimental-features =
      "nix-command flakes impure-derivations recursive-nix";
    fallback = true;
    flake-registry =
      "https://raw.githubusercontent.com/syvlorg/flake-registry/master/flake-registry.json";
    keep-derivations = true;
    keep-outputs = true;
    max-free = 1073741824;
    min-free = 262144000;
    show-trace = true;
    trusted-public-keys = [
      "cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
      "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
      "nickel.cachix.org-1:ABoCOGpTJbAum7U6c+04VbjvLxG9f0gJP5kYihRRdQs="
      "sylvorg.cachix.org-1:xd1jb7cDkzX+D+Wqt6TemzkJH9u9esXEFu1yaR9p8H8="
    ];
    trusted-substituters = [
      "https://cache.nixos.org/"
      "https://nix-community.cachix.org"
      "https://nickel.cachix.org"
      "https://sylvorg.cachix.org"
    ];
    warn-dirty = false;
  };
  description = "My emacs config!";
  inputs = rec {
    bundle = {
      url = <<input-path-exists(path="../bundle", url="https://github/sylvorg/bundle", submodule='t)>>;
      type = "git";
      submodules = true;
    };
    valiant.follows = "bundle/valiant";
    nixpkgs.follows = "bundle/nixpkgs";

    <<95482c5c-648e-43d2-b810-99033c1843d3()>>

    flake-utils.url = github:numtide/flake-utils;
    flake-compat = {
      url = "github:edolstra/flake-compat";
      flake = false;
    };
  };
  outputs = inputs@{ self, flake-utils, bundle, ... }:
    with builtins;
    with bundle.lib;
    with flake-utils.lib;
    bundle.mkOutputs.general {
      inherit inputs self;
      pname = "damascus";
      overlays = let
        damascan = iron.fold.set (map (pkg:
          let pname = "damascus" + (removePrefix "emacs" pkg);
          in genAttrs [ pname pkg ] (name: final: prev: {
            ${pname} = final.${pkg}.withPackages (epkgs:
              with epkgs;
              flatten [
                auto-compile
                command-log-mode
                company-prescient
                counsel-projectile
                dired-plus
                dired-sidebar
                dmenu
                doom-themes
                evil-god-state
                exec-path-from-shell
                exwm
                helm-projectile
                helm-smex
                helm-swoop
                help-fns-plus
                hy-mode
                gcmh
                general
                helm
                helm-flx
                ivy
                ivy-prescient
                lispy
                magit
                modalka
                no-littering
                ob-hy
                objed
                olivetti
                org-contrib
                ox-pandoc
                pyvenv
                rainbow-identifiers
                rainbow-mode
                restart-emacs
                ryo-modal
                selectrum-prescient
                sly
                use-package-chords
                undo-fu
                undo-fu-session
                vlfi
                xah-fly-keys
                (map (epkg:
                  let epkg' = epkgs.${removePrefix "ePkg-" epkg};
                  in [ epkg' epkg'.propagatedUserEnvPkgs ])
                  (filter (hasPrefix "ePkg-") (attrNames inputs)))
              ]);
          })) (let prev = inputs.nixpkgs.legacyPackages.x86_64-linux;
          in iron.emacsenGen prev (bundle.inputs.emacs.overlay prev prev)));
      in iron.fold.set [ damascan { default = damascan.emacs-nox; } ];
    } { };
}