Packages build!

This commit is contained in:
2024-09-07 00:24:08 +03:00
parent 4d29cc73b2
commit f8a16189f0
30 changed files with 1584 additions and 446 deletions
@@ -0,0 +1,20 @@
#https://xeiaso.net/talks/asg-2023-nixos/ example
{ lib, config, pkgs, options, azos-utils, ... }:
{
options.azos.suites.base.enable = (azos-utils.mkSuiteEnableOption {});
imports = [
./emacs
./python
./gpg-agent
./git
./name.nix
];
options.azos.name = lib.mkOption{
default = "YOUR NAME HERE";
type = lib.types.str;
description = "Your full name.";
};
}
@@ -0,0 +1,51 @@
{ lib, config, pkgs, azos-utils, outputs, ... }:
let
isEnabled =
config.azos.emacs.enable && config.azos.suites.base.enable;
emacspkgs = config.azos.emacs.emacspkg.pkgs;
localPkgName = "azos-emacs-base";
in
{
options.azos.emacs.enable = (azos-utils.mkFeatureEnableOption {
description = "Enables EMACS installation.";});
options.azos.emacs.emacspkg = lib.mkOption{
type = lib.types.package;
default = pkgs.emacs;
description = "The base package to use for Emacs.";
};
options.azos.emacs.pkgs = lib.mkOption{
default = [];
description = "List of packages for Emacs.";
};
options.azos.emacs.enabledSuites = lib.mkOption{
default = [];
description = "List of enabled suite names for Emacs. Used to enable the " +
"custom packages in init.el.";
};
#Set config
config = lib.mkIf isEnabled {
#Base emacs suite definition
azos.emacs.pkgs = [pkgs.azos.emacs.base];
azos.emacs.enabledSuites = [localPkgName];
#Global instantiation of Emacs
programs.emacs = {
enable = true;
package =
((pkgs.emacsPackagesFor config.azos.emacs.emacspkg).emacsWithPackages (
config.azos.emacs.pkgs
));
extraConfig = lib.strings.concatStringsSep "\n"
(builtins.map (s : "(require '" + s + ")\n")
config.azos.emacs.enabledSuites);
};
};
# imports = [./vterm.nix];
}
@@ -0,0 +1,20 @@
#+title: Aner's Emacs Vterm Configuration
#+property: header-args :results silent
* Vterm
#+begin_src emacs-lisp
(require 'azos-emacs-base)
(use-package vterm
:if (member system-type '(gnu gnu/linux))
:config
(add-hook 'vterm-mode-hook
(lambda () (setq-local global-hl-line-mode nil)))
(evil-collection-define-key 'normal 'vterm-mode-map
(kbd "p") 'vterm-yank)
(setq vterm-timer-delay 0.01
vterm-term-environment-variable "xterm-256color"))
#+end_src
@@ -0,0 +1,29 @@
{ lib, config, pkgs, azos-utils, ... }:
let
isEnabled =
config.azos.emacs.enable && config.azos.suites.editor.enable &&
config.azos.emacs.vterm.enable;
emacspkgs = config.azos.emacs.emacspkg.pkgs;
localPkgName = "azos-emacs-vterm";
in
{
options.azos.emacs.vterm.enable = (azos-utils.mkFeatureEnableOption {
description = "Enables Emacs VTERM installation.";});
#Set config
config = lib.mkIf isEnabled {
#Base emacs suite definition
azos.emacs.pkgs = [(emacspkgs.trivialBuild (azos-utils.trivialFromOrg {
pname = localPkgName;
version = "0.1.6";
src = ./el/azos-emacs-vterm.org;
packageRequires = with emacspkgs; [
vterm
];
}))];
azos.emacs.enabledSuites = [localPkgName];
};
}
@@ -0,0 +1,13 @@
{ lib, config, pkgs, azos-utils, ... }:
let
isEnabled =
config.azos.git.enable &&
config.azos.suites.base.enable;
in
{
options.azos.git.enable = (azos-utils.mkFeatureEnableOption {});
config = lib.mkIf isEnabled {
programs.git.enable = true;
};
}
@@ -0,0 +1,14 @@
{ lib, config, pkgs, azos-utils, ... }:
let
isEnabled =
config.azos.gpgagent.enable &&
config.azos.suites.base.enable;
in
{
options.azos.gpgagent.enable = (azos-utils.mkFeatureEnableOption {});
config = lib.mkIf isEnabled {
home.packages = [ pkgs.gnupg ];
home.file.".gnupg/gpg-agent.conf".source = ./gpg-agent.conf;
};
}
@@ -0,0 +1,6 @@
grab
pinentry-program /usr/bin/pinentry
default-cache-ttl 86400
max-cache-ttl 86400
enable-ssh-support
@@ -0,0 +1,4 @@
#https://xeiaso.net/talks/asg-2023-nixos/ example
{ lib, config, pkgs, ... }:{
home.file."name.txt".text = ''${config.azos.name}'';
}
@@ -0,0 +1,29 @@
{ lib, config, pkgs, azos-utils, ... }:
let
isEnabled =
config.azos.python.enable && config.azos.suites.base.enable;
pythonpkgs = config.azos.python.pythonpkg.pkgs;
in
{
options.azos.python.enable = (azos-utils.mkFeatureEnableOption {});
options.azos.python.pythonpkg = lib.mkOption{
type = lib.types.package;
default = pkgs.python3;
};
options.azos.python.pkgs = lib.mkOption{
default = [];
description = "List of packages for python.";
};
config = lib.mkIf isEnabled {
home.packages = with pkgs;
[(config.azos.python.pythonpkg.withPackages (python-pkgs: config.azos.python.pkgs))
];
};
imports = [
];
}