Skip to content

Latest commit

 

History

History
executable file
·
316 lines (287 loc) · 9.61 KB

File metadata and controls

executable file
·
316 lines (287 loc) · 9.61 KB
<<0825f960-a3f1-4b7b-b8ac-04d62b23f431>>
{
  description = "Our tools and settings!";
  nixConfig = {
    <<generate-nix-conf(flake='t)>>
  };
  inputs = rec {

    # Deprecated; circular imports are much too confusing...
    # pyPkg-rich = {
    #   url =
    #     <<input-path-exists(path="../sylveon/syvlorg/rich", url="github:syvlorg/rich")>>;
    #   inputs.bundle.follows = "";
    # };
    # pyPkg-oreo = {
    #   url =
    #     <<input-path-exists(path="../sylveon/syvlorg/oreo", url="github:syvlorg/oreo")>>;
    #   inputs.bundle.follows = "";
    # };
    # pyPkg-pytest-hy = {
    #   url =
    #     <<input-path-exists(path="../sylveon/syvlorg/pytest-hy", url="github:syvlorg/pytest-hy")>>;
    #   inputs.bundle.follows = "";
    # };

    valiant = {
      url = <<input-path-exists(path="../sylveon/syvlorg/valiant", url="https://github/syvlorg/valiant", submodule='t)>>;
      type = "git";
      submodules = true;
    };
    flake-registry.url =
      <<input-path-exists(path="../sylveon/syvlorg/flake-registry", url="github:syvlorg/flake-registry")>>;

    emacs.url = "github:nix-community/emacs-overlay";
    nix.url = "github:nixos/nix";
    nur.url = "github:nix-community/nur";
    node2nix = {
      url = "github:svanderburg/node2nix";
      flake = false;
    };

    flake-utils.url = "github:numtide/flake-utils";
    flake-utils-plus.url = "github:gytis-ivaskevicius/flake-utils-plus";
    flake-compat = {
      url = "github:edolstra/flake-compat";
      flake = false;
    };

    nixos-21-11-small.url = "github:NixOS/nixpkgs/nixos-21.11-small";
    nixos-21-11.url = "github:NixOS/nixpkgs/nixos-21.11";
    nixos-22-05-small.url = "github:NixOS/nixpkgs/nixos-22.05-small";
    nixos-22-05.url = "github:NixOS/nixpkgs/nixos-22.05";
    nixos-22-11-small.url = "github:NixOS/nixpkgs/nixos-22.11-small";
    nixos-22-11.url = "github:NixOS/nixpkgs/nixos-22.11";
    nixos-23-05-small.url = "github:NixOS/nixpkgs/nixos-23.05-small";
    nixos-23-05.url = "github:NixOS/nixpkgs/nixos-23.05";
    nixos-master.url = "github:nixos/nixpkgs";
    nixos-unstable-small.url = "github:NixOS/nixpkgs/nixos-unstable-small";
    nixos-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
    nixpkgs.follows = "valiant/nixpkgs";

    a = {
      url = "github:plexus/a.el";
      flake = false;
    };
    dash = {
      url = "github:magnars/dash.el";
      flake = false;
    };
    f = {
      url = "github:syvlorg/f.el/f-presence";
      flake = false;
    };
    s = {
      url = "github:magnars/s.el";
      flake = false;
    };
    uuidgen = {
      url = "github:syvlorg/uuidgen-el";
      flake = false;
    };
    htmlize = {
      url = "github:hniksic/emacs-htmlize";
      flake = false;
    };
    nix-mode.url = "github:syvlorg/nix-mode";
    ob-hy = {
      url = "github:allison-casey/ob-hy";
      flake = false;
    };
    sysget = {
      url = "github:emilengler/sysget/v2.3";
      flake = false;
    };
    pacapt = {
      url = "github:icy/pacapt/v3.0.7";
      flake = false;
    };
    backtrace = {
      url = "github:nir0s/backtrace";
      flake = false;
    };
    mdsh = {
      url = "github:bashup/mdsh/7e7af618a341eebd50e7825b062bc192079ad5fc";
      flake = false;
    };
    maid = {
      url = "github:egoist/maid/v0.3.0";
      flake = false;
    };
    gomod2nix.url = "github:nix-community/gomod2nix";
    saku = {
      url = "github:kt3k/saku/v1.2.4";
      flake = false;
    };
    uglifycss = {
      url = "https://registry.npmjs.org/uglifycss/-/uglifycss-0.0.29.tgz";
      flake = false;
    };
    caddy = {
      url = "github:caddyserver/caddy/v2.5.1";
      flake = false;
    };
    org = {
      url = "github:bzg/org-mode";
      flake = false;
    };
    org-contrib = {
      url = "github:emacsmirror/org-contrib";
      flake = false;
    };
    emacswiki = {
      url = "github:emacsmirror/emacswiki.org/master";
      flake = false;
    };
    vlfi = {
      url = "github:m00natic/vlfi";
      flake = false;
    };
    oreo-cursors = {
      url = "github:varlesh/oreo-cursors";
      flake = false;
    };
    xero-figlet-fonts = {
      url = "github:xero/figlet-fonts";
      flake = false;
    };

    # Adapted From: https://github.com/NixOS/nix/issues/4423#issuecomment-1262247071
    flk = {
      url = "https://github.com/chr15m/flk";
      flake = false;
      type = "git";
      submodules = true;
    };
  };
  outputs = inputs@{ self, ... }:
    with builtins;
    let
      pname = "bundle";

With help from https://github.com/hlissner/dotfiles:

lib = inputs.valiant.lib.iron.extendIron inputs.valiant.lib
  (lfinal: lprev: lself: lsuper:
    lprev.iron.fold.merge [
      {
        mkPkg = mapAttrs (pname: v:
          args@{ ... }:
          final:
          lself.callPackageFilter final.callPackage v (args // { inherit pname; }))
          (with lfinal; filterAttrs (n: isFunction) self.callPackages);
        mkPkgOverlay = mapAttrs (pname: v: name:
          args@{ ... }:
          final: prev: {
            ${name} = v args final;
          }) lfinal.iron.mkPkg;
        functors = {

Adapted from here:

xelf:

  • User can access user values using self
  • User cannot access default values using self
  • Default values are not in output
  • Function cannot access user values by evaluating function x with argument self
  • Values from evaluating function x with argument self are not in output
  • User cannot access values from evaluating function x with argument self
nix-repl> xelf (self: { a = 1; b = 2; sa = self.a; sb = self.b; })
{ a = 1; b = 2; sa = 1; sb = 2; }
xelf = { __functor = self: x: let xelf = x self; in x xelf; };

xelfDefault:

  • User can access user values using self
  • User can access default values using self
  • Default values are not in output
  • Function cannot access user values by evaluating function x with argument self
  • Values from evaluating function x with argument self are not in output
  • User cannot access values from evaluating function x with argument self
nix-repl> xelfDefault (self: { a = 1; b = 2; d = self.c + 1; })
{ a = 1; b = 2; d = 4; }
xelfDefault = {
  __functor = self: x:
    let
      xelf = x self;
      default = { c = 3; };
    in x (xelf // default);
};

xelfDefaultOutput:

  • User can access user values using self
  • User can access default values using self
  • Default values are in output
  • Function cannot access user values by evaluating function x with argument self
  • Values from evaluating function x with argument self are not in output
  • User cannot access values from evaluating function x with argument self
nix-repl> xelfDefaultOutput (self: { a = 1; b = 2; d = self.c + 1; })
{ a = 1; b = 2; c = 3; d = 4; }
xelfDefaultOutput = {
  __functor = self: x:
    let
      xelf = x self;
      default = { c = 3; };
    in (x (xelf // default)) // default;
};

xelfDefaultFunctionOutput:

  • User can access user values using self
  • User can access default values using self
  • Default values are in output
  • Function can access user values by evaluating function x with argument self
  • Values from evaluating function x with argument self are in output
  • User cannot access values from evaluating function x with argument self
nix-repl> xelfDefaultFunctionOutput (self: { a = 1; b = 2; d = self.c + 1; })
{ a = 1; b = 2; c = 3; d = 4; xa = 1; xb = 2; }
xelfDefaultFunctionOutput = {
  __functor = self: x:
    let
      xelf = x self;
      default = { c = 3; };
      xefault = {
        xa = xelf.a;
        xb = xelf.b;
      };
    in (x (xelf // default)) // default // xefault;
};

xelfDefaultUserFunctionOutput:

  • User can access user values using self
  • User can access default values using self
  • Default values are in output
  • Function can access user values by evaluating function x with argument self
  • Values from evaluating function x with argument self are in output
  • User can access values from evaluating function x with argument self
nix-repl> xelfDefaultUserFunctionOutput (self: { a = 1; b = 2; d = self.c + 1; e = self.xa + 1; f = self.xb + 1; })
{ a = 1; b = 2; c = 3; d = 4; e = 2; f = 3; xa = 1; xb = 2; }
xelfDefaultUserFunctionOutput = {
  __functor = self: x:
    let
      xelf = x self;
      default = { c = 3; };
      xefault = {
        xa = xelf.a;
        xb = xelf.b;
      };
    in (x (xelf // default // xefault)) // default // xefault;
};
              };
            }
            (import ./lib inputs lfinal pname)
          ]);
    in import ./outputs self inputs lib pname;
}