mirror of
https://github.com/daylinmorgan/oizys.git
synced 2024-12-22 10:10:45 -06:00
library extensions
This commit is contained in:
parent
6e3aa008df
commit
280e475edc
12 changed files with 46 additions and 36 deletions
|
@ -8,10 +8,10 @@
|
||||||
restic
|
restic
|
||||||
];
|
];
|
||||||
|
|
||||||
languages = {
|
oizys.languages = [
|
||||||
nim = true;
|
"nim"
|
||||||
python = true;
|
"python"
|
||||||
};
|
];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
rclone
|
rclone
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{mkRune, ...}: {
|
{lib, ...}: {
|
||||||
users.motd = mkRune {
|
users.motd = lib.mkRune {
|
||||||
number = "6";
|
number = "6";
|
||||||
rune = "algiz";
|
rune = "algiz";
|
||||||
};
|
};
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
oizys.desktop.enable = true;
|
oizys.desktop.enable = true;
|
||||||
cli.enable = true;
|
|
||||||
# Enable the X11 windowing system.
|
# Enable the X11 windowing system.
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
mkRune,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
users.motd = mkRune {
|
users.motd = lib.mkRune {
|
||||||
number = "2";
|
number = "2";
|
||||||
rune = "mannaz";
|
rune = "mannaz";
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,17 +14,15 @@
|
||||||
desktop.enable = true;
|
desktop.enable = true;
|
||||||
vpn.enable = true;
|
vpn.enable = true;
|
||||||
languages = [
|
languages = [
|
||||||
"misc"
|
"misc"
|
||||||
"python"
|
"python"
|
||||||
"nim"
|
"nim"
|
||||||
"tex"
|
"tex"
|
||||||
"node"
|
"node"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
vivaldi.enable = true;
|
vivaldi.enable = true;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
zk
|
zk
|
||||||
rclone
|
rclone
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
pkgs,
|
pkgs,
|
||||||
mkRune,
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
networking.networkmanager.enable = true;
|
networking.networkmanager.enable = true;
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
pamixer
|
pamixer
|
||||||
];
|
];
|
||||||
|
|
||||||
services.getty.greetingLine = mkRune {
|
services.getty.greetingLine = lib.mkRune {
|
||||||
rune = "othalan";
|
rune = "othalan";
|
||||||
runeKind = "ascii";
|
runeKind = "ascii";
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,11 +7,9 @@
|
||||||
inherit (nixpkgs.lib) hasSuffix nixosSystem genAttrs;
|
inherit (nixpkgs.lib) hasSuffix nixosSystem genAttrs;
|
||||||
inherit (nixpkgs.lib.filesystem) listFilesRecursive;
|
inherit (nixpkgs.lib.filesystem) listFilesRecursive;
|
||||||
|
|
||||||
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
|
|
||||||
supportedSystems = ["x86_64-linux" ];
|
|
||||||
runes = import ../modules/runes;
|
runes = import ../modules/runes;
|
||||||
in rec {
|
lib = nixpkgs.lib.extend (final: prev: {
|
||||||
forAllSystems = f: genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system});
|
mkIfIn = name: list: prev.mkIf (builtins.elem name list);
|
||||||
mkRune = {
|
mkRune = {
|
||||||
rune,
|
rune,
|
||||||
number ? "6",
|
number ? "6",
|
||||||
|
@ -19,6 +17,20 @@ in rec {
|
||||||
}:
|
}:
|
||||||
"[1;3${number}m\n" + runes.${rune}.${runeKind} + "\n[0m";
|
"[1;3${number}m\n" + runes.${rune}.${runeKind} + "\n[0m";
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
#supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
|
||||||
|
supportedSystems = ["x86_64-linux"];
|
||||||
|
in rec {
|
||||||
|
forAllSystems = f: genAttrs supportedSystems (system: f nixpkgs.legacyPackages.${system});
|
||||||
|
# mkRune = {
|
||||||
|
# rune,
|
||||||
|
# number ? "6",
|
||||||
|
# runeKind ? "braille",
|
||||||
|
# }:
|
||||||
|
# "[1;3${number}m\n" + runes.${rune}.${runeKind} + "\n[0m";
|
||||||
|
|
||||||
isNixFile = path: hasSuffix ".nix" path;
|
isNixFile = path: hasSuffix ".nix" path;
|
||||||
buildOizys = _:
|
buildOizys = _:
|
||||||
forAllSystems (
|
forAllSystems (
|
||||||
|
@ -42,7 +54,7 @@ in rec {
|
||||||
isNixFile
|
isNixFile
|
||||||
(listFilesRecursive (../. + "/hosts/${hostname}"));
|
(listFilesRecursive (../. + "/hosts/${hostname}"));
|
||||||
|
|
||||||
specialArgs = {inherit inputs mkRune self;};
|
specialArgs = {inherit inputs lib self;};
|
||||||
};
|
};
|
||||||
mapHosts = dir: mapAttrs (name: _: mkSystem name) (readDir dir);
|
mapHosts = dir: mapAttrs (name: _: mkSystem name) (readDir dir);
|
||||||
buildHosts = _: mapHosts ../hosts;
|
buildHosts = _: mapHosts ../hosts;
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIfIn;
|
||||||
cfg = config.oizys.languages;
|
cfg = config.oizys.languages;
|
||||||
in {
|
in {
|
||||||
config = mkIf (builtins.elem "misc" cfg) {
|
config = mkIfIn "misc" cfg {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
go
|
go
|
||||||
rustup
|
rustup
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIfIn;
|
||||||
cfg = config.oizys.languages;
|
cfg = config.oizys.languages;
|
||||||
in {
|
in {
|
||||||
config = mkIf (builtins.elem "nim" cfg) {
|
config = mkIfIn "nim" cfg {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
nim
|
nim
|
||||||
|
|
||||||
|
|
|
@ -4,10 +4,10 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIfIn;
|
||||||
cfg = config.oizys.languages;
|
cfg = config.oizys.languages;
|
||||||
in {
|
in {
|
||||||
config = mkIf (builtins.elem "node" cfg) {
|
config = mkIfIn "node" cfg {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
nodejs
|
nodejs
|
||||||
nodePackages.pnpm
|
nodePackages.pnpm
|
||||||
|
|
|
@ -4,10 +4,11 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIf;
|
|
||||||
|
inherit (lib) mkIfIn;
|
||||||
cfg = config.oizys.languages;
|
cfg = config.oizys.languages;
|
||||||
in {
|
in {
|
||||||
config = mkIf (builtins.elem "python" cfg) {
|
config = mkIfIn "python" cfg {
|
||||||
environment.systemPackages = let
|
environment.systemPackages = let
|
||||||
python = pkgs.python3.withPackages (ps: with ps; [pip]);
|
python = pkgs.python3.withPackages (ps: with ps; [pip]);
|
||||||
in
|
in
|
||||||
|
|
|
@ -4,11 +4,10 @@
|
||||||
pkgs,
|
pkgs,
|
||||||
...
|
...
|
||||||
}: let
|
}: let
|
||||||
inherit (lib) mkIf;
|
inherit (lib) mkIf mkIfIn;
|
||||||
# cfg = config.oizys.languages;
|
cfg = config.oizys.languages;
|
||||||
langEnabled = name: builtins.elem name config.oizys.languages;
|
|
||||||
in {
|
in {
|
||||||
config = mkIf (langEnabled "tex") {
|
config = mkIfIn "tex" cfg {
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
texlive.combined.scheme-full
|
texlive.combined.scheme-full
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in a new issue