Working
This commit is contained in:
+8
-1
@@ -54,4 +54,11 @@ Then in this directory:
|
|||||||
:lf .
|
:lf .
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
You'll get acces to 'lib' and such. (It evals here)
|
Then you can tpye:
|
||||||
|
|
||||||
|
#+begin_src nix
|
||||||
|
inputs.nixpkgs.lib
|
||||||
|
#+end_src
|
||||||
|
|
||||||
|
And stuff
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
#https://xeiaso.net/talks/asg-2023-nixos/ example
|
|
||||||
{ lib, config, pkgs, ... }:{
|
|
||||||
imports = [./gpg-agent.nix
|
|
||||||
./name.nix];
|
|
||||||
|
|
||||||
#Global suite options
|
|
||||||
options.azos.name = lib.mkOption{
|
|
||||||
default = "YOUR NAME HERE";
|
|
||||||
type = lib.types.str;
|
|
||||||
description = "Your full name.";
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#https://xeiaso.net/talks/asg-2023-nixos/ example
|
|
||||||
{ lib, config, pkgs, ... }:
|
|
||||||
let
|
|
||||||
cfg = config.azos.gpgagent;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
options.azos.gpgagent.enable = lib.mkEnableOption "Enables AZOS GPG agent";
|
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
|
||||||
home.packages = [ pkgs.gnupg ];
|
|
||||||
home.file.".gnupg/gpg-agent.conf".source = ./gpg-agent.conf;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -8,8 +8,10 @@
|
|||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
|
_module.args.azos-utils = import ./utils.nix { lib = lib; };
|
||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./base
|
./suites
|
||||||
];
|
];
|
||||||
|
|
||||||
nixpkgs = {
|
nixpkgs = {
|
||||||
@@ -25,7 +27,7 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
azos.gpgagent.enable = true;
|
azos.suites.base.enable = true;
|
||||||
azos.name = "Aner Zakobar";
|
azos.name = "Aner Zakobar";
|
||||||
|
|
||||||
# TODO: Set your username
|
# TODO: Set your username
|
||||||
@@ -36,7 +38,6 @@
|
|||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
# steam
|
# steam
|
||||||
emacs
|
|
||||||
pandoc
|
pandoc
|
||||||
offlineimap #emailing
|
offlineimap #emailing
|
||||||
liberation_ttf #fonts
|
liberation_ttf #fonts
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
#https://xeiaso.net/talks/asg-2023-nixos/ example
|
||||||
|
{ lib, config, pkgs, options, azos-utils, ... }:
|
||||||
|
{
|
||||||
|
options.azos.suites.base.enable = (azos-utils.mkSuiteEnableOption {});
|
||||||
|
|
||||||
|
options.azos.suites.face.enable = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./emacs
|
||||||
|
./gpg-agent
|
||||||
|
./name.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
options.azos.python.pkgs = lib.mkOption{
|
||||||
|
default = [];
|
||||||
|
type = lib.types.list;
|
||||||
|
description = "List of packages for python.";
|
||||||
|
};
|
||||||
|
|
||||||
|
options.azos.name = lib.mkOption{
|
||||||
|
default = "YOUR NAME HERE";
|
||||||
|
type = lib.types.str;
|
||||||
|
description = "Your full name.";
|
||||||
|
};
|
||||||
|
|
||||||
|
# config = lib.mkIf cfg.enable {
|
||||||
|
# # Global suite options
|
||||||
|
# };
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
{ lib, config, pkgs, azos-utils, ... }:
|
||||||
|
let
|
||||||
|
isEnabled =
|
||||||
|
config.azos.emacs.enable && config.azos.suites.base.enable;
|
||||||
|
emacspkgs = config.azos.emacs.emacspkg.pkgs;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.azos.emacs.enable = (azos-utils.mkFeatureEnableOption {});
|
||||||
|
|
||||||
|
options.azos.emacs.emacspkg = lib.mkOption{
|
||||||
|
type = lib.types.package;
|
||||||
|
default = pkgs.emacs;
|
||||||
|
};
|
||||||
|
|
||||||
|
options.azos.emacs.pkgs = lib.mkOption{
|
||||||
|
default = [];
|
||||||
|
description = "List of packages for emacs.";
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf isEnabled {
|
||||||
|
azos.emacs.pkgs = [(emacspkgs.trivialBuild (azos-utils.trivialFromOrg {
|
||||||
|
pname = "azos-emacs-base";
|
||||||
|
version = "0.1.6";
|
||||||
|
src = ./el/azos-emacs-base.org;
|
||||||
|
packageRequires = [
|
||||||
|
emacspkgs.evil
|
||||||
|
emacspkgs.magit
|
||||||
|
emacspkgs.vterm
|
||||||
|
];
|
||||||
|
}))];
|
||||||
|
|
||||||
|
home.packages = with pkgs;
|
||||||
|
[((emacsPackagesFor config.azos.emacs.emacspkg).emacsWithPackages (
|
||||||
|
config.azos.emacs.pkgs
|
||||||
|
)) ];
|
||||||
|
};
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
Hello!
|
||||||
|
|
||||||
|
#+begin_src emacs-lisp
|
||||||
|
(use-package evil
|
||||||
|
:init
|
||||||
|
:ensure t
|
||||||
|
:config
|
||||||
|
(setq evil-want-C-i-jump nil)
|
||||||
|
(evil-mode 1))
|
||||||
|
|
||||||
|
(provide 'azos-emacs-base)
|
||||||
|
#+end_src
|
||||||
@@ -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,16 @@
|
|||||||
|
#https://xeiaso.net/talks/asg-2023-nixos/ example
|
||||||
|
{ lib, config, pkgs, options, azos-utils, ... }:
|
||||||
|
{
|
||||||
|
# options.azos.suites.base.enable = azos-utils.mkSuiteEnableOption {
|
||||||
|
# suiteDependents = ["station"];
|
||||||
|
# };
|
||||||
|
|
||||||
|
# options.azos.suites.station.enable = azos-utils.mkSuiteEnableOption {
|
||||||
|
# suiteDependents = [];
|
||||||
|
# };
|
||||||
|
|
||||||
|
imports = [
|
||||||
|
./base
|
||||||
|
./station
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
{ lib, config, pkgs, options, azos-utils, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.azos.suites.base;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.azos.suites.station.enable = azos-utils.mkSuiteEnableOption {};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable {
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
{ lib, ... }:
|
||||||
|
{
|
||||||
|
# mkFeatureEnableOption = { suiteEnable, ...} @ attrs :
|
||||||
|
# lib.mkOption (builtins.removeAttrs (lib.mergeAttrs attrs {
|
||||||
|
# default = true;
|
||||||
|
# example = true;
|
||||||
|
# type = lib.types.bool;
|
||||||
|
# apply = old: suiteEnable && old;
|
||||||
|
# }) ["suiteEnable"]);
|
||||||
|
|
||||||
|
# mkDependentFeatureEnableOption = { suiteEnable, otherOption, ...} @ attrs :
|
||||||
|
# lib.mkOption (builtins.removeAttrs (lib.mergeAttrs attrs {
|
||||||
|
# default = true;
|
||||||
|
# example = true;
|
||||||
|
# type = lib.types.bool;
|
||||||
|
# apply = old: suiteEnable && otherOption && old;
|
||||||
|
# }) ["suiteEnable" "otherOption"]);
|
||||||
|
|
||||||
|
# mkSuiteEnableOption = { suiteDependents, ... } @ attrs :
|
||||||
|
# lib.mkOption lib.mergeAttrs attrs {
|
||||||
|
# default = [];
|
||||||
|
# example = [];
|
||||||
|
# type = lib.types.list;
|
||||||
|
# apply = old: old || lib.lists.any suiteEnabledPred suiteDependents;
|
||||||
|
# };
|
||||||
|
|
||||||
|
mkFeatureEnableOption = { ... } @ attrs :
|
||||||
|
lib.mkOption (lib.mergeAttrs attrs {
|
||||||
|
default = true;
|
||||||
|
example = true;
|
||||||
|
type = lib.types.bool;
|
||||||
|
});
|
||||||
|
|
||||||
|
mkSuiteEnableOption = { ... } @ attrs :
|
||||||
|
lib.mkOption (lib.mergeAttrs attrs {
|
||||||
|
default = false;
|
||||||
|
example = true;
|
||||||
|
type = lib.types.bool;
|
||||||
|
});
|
||||||
|
|
||||||
|
trivialFromOrg = { ... } @ attrs : (
|
||||||
|
lib.mergeAttrs attrs {
|
||||||
|
preBuild = ''
|
||||||
|
for file in ./*.org
|
||||||
|
do
|
||||||
|
emacs --batch --eval "(require 'org)" --eval "(org-babel-tangle-file \"$file\" (concat (file-name-sans-extension \"$file\") \".el\") \"emacs-lisp\")"
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
unpackCmd = ''
|
||||||
|
case "$curSrc" in
|
||||||
|
*.el)
|
||||||
|
# keep original source filename without the hash
|
||||||
|
local filename=$(basename "$curSrc")
|
||||||
|
filename="''${filename:33}"
|
||||||
|
cp $curSrc $filename
|
||||||
|
chmod +w $filename
|
||||||
|
sourceRoot="."
|
||||||
|
;;
|
||||||
|
*.org)
|
||||||
|
# keep original source filename without the hash
|
||||||
|
local filename=$(basename "$curSrc")
|
||||||
|
filename="''${filename:33}"
|
||||||
|
cp $curSrc $filename
|
||||||
|
chmod +w $filename
|
||||||
|
sourceRoot="."
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
_defaultUnpack "$curSrc"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user